@oscloudlab/knowledge-card 0.0.55 → 0.0.56

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 (310) hide show
  1. package/dist/{abap-WWWLj2kq.js → abap-BYCDGTj-.js} +1 -1
  2. package/dist/{abnf-BHJwxgIb.js → abnf-CCl_yMme.js} +1 -1
  3. package/dist/{actionscript-CHuwUYcU.js → actionscript-Crs1PPID.js} +1 -1
  4. package/dist/{ada-DhPdfx2d.js → ada-CEYk8VxH.js} +1 -1
  5. package/dist/{agda-Cogdmw9R.js → agda-DBdPwB9L.js} +1 -1
  6. package/dist/{al-B5nT_JwD.js → al-BmfGA_U2.js} +1 -1
  7. package/dist/{antlr4-_hXOKqt3.js → antlr4-C8rp_V_t.js} +1 -1
  8. package/dist/{apacheconf-CTaIk5sj.js → apacheconf-CPkZ-0LG.js} +1 -1
  9. package/dist/{apex-DjhpbplQ.js → apex-BonxtL0t.js} +1 -1
  10. package/dist/{apl-CQF50m2P.js → apl-CRcnVYaF.js} +1 -1
  11. package/dist/{applescript-Cg198CwB.js → applescript-BE_xDfJ6.js} +1 -1
  12. package/dist/{aql-ifhG9OMw.js → aql-CW5sM2ZM.js} +1 -1
  13. package/dist/{arduino-CRhxNAFQ.js → arduino-D_0mtW4F.js} +1 -1
  14. package/dist/{arff-DSub08ej.js → arff-C9H3BD_f.js} +1 -1
  15. package/dist/{asciidoc-fULlpbqp.js → asciidoc-C2Ieavzy.js} +1 -1
  16. package/dist/{asm6502-CrgdlBJQ.js → asm6502-BEfh9mFd.js} +1 -1
  17. package/dist/{asmatmel-BO7mca8T.js → asmatmel-Ch1Vo9gL.js} +1 -1
  18. package/dist/{aspnet-DQiFqYHg.js → aspnet-CGm_VEDM.js} +1 -1
  19. package/dist/{autohotkey-wZF7I2Fb.js → autohotkey-BNzMJiaz.js} +1 -1
  20. package/dist/autohotkey-BNzMJiaz.js.gz +0 -0
  21. package/dist/{autoit-DA0FPc01.js → autoit-jknnfJTK.js} +1 -1
  22. package/dist/{avisynth-PdH5kC4d.js → avisynth-8256r9Qp.js} +1 -1
  23. package/dist/{avro-idl-XPeKHUNS.js → avro-idl-GoGaF_Uk.js} +1 -1
  24. package/dist/{bash-BAVRfLhC.js → bash-CXGE7WKt.js} +1 -1
  25. package/dist/{basic-enfKU_K9.js → basic-B1Buh2xp.js} +1 -1
  26. package/dist/{batch-nf17CBYv.js → batch-CnW2sqQ5.js} +1 -1
  27. package/dist/{bbcode-D8l6u-5V.js → bbcode-GylPmz_v.js} +1 -1
  28. package/dist/{bicep-MYWm54T1.js → bicep-tzxzcTWV.js} +1 -1
  29. package/dist/{birb-DGYcucch.js → birb-BXXoWPZd.js} +1 -1
  30. package/dist/{bison-CkiB_Ecf.js → bison-BiGzeCvC.js} +1 -1
  31. package/dist/{bnf-CAzJEZZY.js → bnf-C6cvmEmL.js} +1 -1
  32. package/dist/{brainfuck-B9f55kfX.js → brainfuck-B6ehZo4y.js} +1 -1
  33. package/dist/{brightscript-Hy-FSGyo.js → brightscript-C9xO7VbE.js} +1 -1
  34. package/dist/{bro-DC8L-bzu.js → bro-eu8Ytmv8.js} +1 -1
  35. package/dist/{bsl-C9ghOa32.js → bsl-hCMgcCz2.js} +1 -1
  36. package/dist/{c-UlL3TUhy.js → c-ZTDIgR3O.js} +1 -1
  37. package/dist/{cfscript-Dxc-LIjg.js → cfscript-uhuKPccp.js} +1 -1
  38. package/dist/{chaiscript-BiZILfcS.js → chaiscript-CVijxo6M.js} +1 -1
  39. package/dist/{cil-Zc7NT1AJ.js → cil-CwRIxVdr.js} +1 -1
  40. package/dist/{clike-zuEyhEHy.js → clike-BXoRSgtw.js} +1 -1
  41. package/dist/{clojure-QofaEQLT.js → clojure-B1x-XUr7.js} +1 -1
  42. package/dist/{cmake-DnTECu1B.js → cmake-CwMCa606.js} +1 -1
  43. package/dist/cmake-CwMCa606.js.gz +0 -0
  44. package/dist/{cobol-Bv3qvzw4.js → cobol-CCCbVSQR.js} +1 -1
  45. package/dist/{coffeescript-DNi30TjZ.js → coffeescript-C151FwOk.js} +1 -1
  46. package/dist/{concurnas-BJKNLTI2.js → concurnas-oQl3tORY.js} +1 -1
  47. package/dist/{coq-B5VdO5yW.js → coq-DT3AMHFu.js} +1 -1
  48. package/dist/{core-Dg6XJzoA.js → core-CmPH7vLL.js} +5 -5
  49. package/dist/core-CmPH7vLL.js.gz +0 -0
  50. package/dist/{cpp-txFuWpY7.js → cpp-CQ-pe5ui.js} +1 -1
  51. package/dist/{crystal-DFslhpwl.js → crystal-Cj77G8Ld.js} +1 -1
  52. package/dist/{csharp-BKkuUQPC.js → csharp-Dl51Ep1f.js} +1 -1
  53. package/dist/{cshtml-BKkPotrO.js → cshtml-CAg8YEYX.js} +1 -1
  54. package/dist/{csp-BVh_wFwY.js → csp-39OZA2PM.js} +1 -1
  55. package/dist/{css-B0cT89OK.js → css-DIn1zz6a.js} +1 -1
  56. package/dist/{css-extras-BX2gr5vy.js → css-extras-Brjlwase.js} +1 -1
  57. package/dist/{csv-hcaUfsP_.js → csv-BpbSKsAp.js} +1 -1
  58. package/dist/{cypher-fegMnynU.js → cypher-DscyyMec.js} +1 -1
  59. package/dist/{d-Bfs_u4fE.js → d-C1EZ2EZL.js} +1 -1
  60. package/dist/{dart-DreLF1S4.js → dart-JdUHyJv7.js} +1 -1
  61. package/dist/{dataweave-M89r_Vr-.js → dataweave-DXTIe4CD.js} +1 -1
  62. package/dist/{dax-DdeRINzu.js → dax-DVgqWR1n.js} +1 -1
  63. package/dist/{dhall-CsbA-xWG.js → dhall-CP5iHdCT.js} +1 -1
  64. package/dist/{diff-DtFMBUrl.js → diff-C4gQYyG0.js} +1 -1
  65. package/dist/{django-QveZoXXV.js → django-DHWReC27.js} +1 -1
  66. package/dist/{dns-zone-file-Cnt-gby2.js → dns-zone-file-D-fyg3KQ.js} +1 -1
  67. package/dist/{docker-DH3PMGAt.js → docker-CkQ4b_L7.js} +1 -1
  68. package/dist/{dot-BUnixs1R.js → dot-CH1xQvzO.js} +1 -1
  69. package/dist/{ebnf-BE90pmSS.js → ebnf-C405wOVZ.js} +1 -1
  70. package/dist/{editorconfig-BMO2npzy.js → editorconfig-DjIDbo7D.js} +1 -1
  71. package/dist/{eiffel-B8F1R03L.js → eiffel-RFf-pAEv.js} +1 -1
  72. package/dist/{ejs-BAznWYTL.js → ejs-CvTQV3hv.js} +1 -1
  73. package/dist/{elixir-QxqicQpP.js → elixir-tVgoFz-U.js} +1 -1
  74. package/dist/{elm-Tiptl-J8.js → elm-CP54Ybys.js} +1 -1
  75. package/dist/{erb-BXQjlgoE.js → erb-CW-KxtHK.js} +1 -1
  76. package/dist/{erlang-DGXpQ9Ba.js → erlang-8cFKJP-5.js} +1 -1
  77. package/dist/{etlua-BEfaf9AA.js → etlua-BZGFIWEl.js} +1 -1
  78. package/dist/{excel-formula-06Wm4p7G.js → excel-formula-CVG4a5bl.js} +1 -1
  79. package/dist/{factor-s2wiGWrC.js → factor-DcWWwRJA.js} +1 -1
  80. package/dist/factor-DcWWwRJA.js.gz +0 -0
  81. package/dist/{false-B5UTDDxG.js → false-9RADPEzA.js} +1 -1
  82. package/dist/{firestore-security-rules-BWj1chbS.js → firestore-security-rules-C4K5xC56.js} +1 -1
  83. package/dist/{flow-Cvu5axD4.js → flow-8DYX0Nvq.js} +1 -1
  84. package/dist/{fortran-BKPWqrB2.js → fortran-B2BuPQ4m.js} +1 -1
  85. package/dist/{fsharp-CU_akejw.js → fsharp-DAK1YBtk.js} +1 -1
  86. package/dist/{ftl-BxtS7eE3.js → ftl-BaGhFPHr.js} +1 -1
  87. package/dist/{gap-CgGrGre0.js → gap-DjK9TJpL.js} +1 -1
  88. package/dist/{gcode-BH6FMQy0.js → gcode-Cnl7ZMOe.js} +1 -1
  89. package/dist/{gdscript-BEUgJ-Kq.js → gdscript-DWqFHACM.js} +1 -1
  90. package/dist/{gedcom-Dzflbsce.js → gedcom-BxM9KRh8.js} +1 -1
  91. package/dist/{gherkin-DzmJ5E-a.js → gherkin-BnXLv6PN.js} +1 -1
  92. package/dist/gherkin-BnXLv6PN.js.gz +0 -0
  93. package/dist/{git-CUT7_ECD.js → git-ortIwpfA.js} +1 -1
  94. package/dist/{glsl-wf4WijWV.js → glsl-BLhNiQAi.js} +1 -1
  95. package/dist/{gml-DkKH-toN.js → gml-CyeiBsva.js} +1 -1
  96. package/dist/{gn-GNfguBUz.js → gn-DfOKU9LE.js} +1 -1
  97. package/dist/{go-DXn5slnu.js → go-0gZjclLG.js} +1 -1
  98. package/dist/{go-module-DKP6O9jJ.js → go-module-C_q5qVEE.js} +1 -1
  99. package/dist/{graphql-B9_0nvff.js → graphql-wziT7Hl-.js} +1 -1
  100. package/dist/{groovy-BY2VjRdH.js → groovy-B6U_Kt_o.js} +1 -1
  101. package/dist/{haml-BkxgEuvh.js → haml-B8L2mMFZ.js} +1 -1
  102. package/dist/{handlebars-pMLUwgpo.js → handlebars-B68nDwSK.js} +1 -1
  103. package/dist/{haskell-YHkiiqkE.js → haskell-Al3N_zff.js} +1 -1
  104. package/dist/{haxe-CMo-UuaH.js → haxe-uRdOMl2P.js} +1 -1
  105. package/dist/{hcl-BZESvLBr.js → hcl-DBWmdAA9.js} +1 -1
  106. package/dist/{hlsl-bxmr9lmO.js → hlsl-bwelwyLE.js} +1 -1
  107. package/dist/{hoon-BYLlr0tU.js → hoon-B3sKUPFf.js} +1 -1
  108. package/dist/{hpkp-BKF8zIpe.js → hpkp-dh_ck-qD.js} +1 -1
  109. package/dist/{hsts-DV2sc0lZ.js → hsts-BW9LEo-8.js} +1 -1
  110. package/dist/{http-CjipvCzG.js → http-B-FAZGAp.js} +1 -1
  111. package/dist/{ichigojam-C2fyXlFN.js → ichigojam-BZ_5d7IO.js} +1 -1
  112. package/dist/{icon-TCwlBu0o.js → icon-BtteQ0HD.js} +1 -1
  113. package/dist/{icu-message-format-BvfrwILU.js → icu-message-format-53DrikvO.js} +1 -1
  114. package/dist/{idris-Ch9Pl-5L.js → idris-kLxLIxwd.js} +1 -1
  115. package/dist/{iecst-B57xtrrg.js → iecst-CyjLz1MV.js} +1 -1
  116. package/dist/{ignore-eaR7JVr_.js → ignore-DOfoI9SY.js} +1 -1
  117. package/dist/{index-3z0MotHm.js → index-TB0vqwVF.js} +281 -278
  118. package/dist/{index-3z0MotHm.js.gz → index-TB0vqwVF.js.gz} +0 -0
  119. package/dist/{inform7-CfieiMoq.js → inform7-CbAbRibB.js} +1 -1
  120. package/dist/{ini-DA7YdkT6.js → ini-CMBhfxVG.js} +1 -1
  121. package/dist/{io-zwomuUfP.js → io-pHrXMyqA.js} +1 -1
  122. package/dist/{j-Btbc0HTh.js → j-lir4NcPO.js} +1 -1
  123. package/dist/{java-BqFgBVLy.js → java-D5HTxd6K.js} +1 -1
  124. package/dist/{javadoc-CS2wFzYr.js → javadoc-Dpdu_n5j.js} +1 -1
  125. package/dist/{javadoclike-BWrTEF19.js → javadoclike-ILQgo-k1.js} +1 -1
  126. package/dist/{javascript-aZIclCQh.js → javascript-CENkad4h.js} +1 -1
  127. package/dist/{javastacktrace-DMaXuZkT.js → javastacktrace-B-PZ8lUj.js} +1 -1
  128. package/dist/{jexl-DHq06-Km.js → jexl-u8bGW3l8.js} +1 -1
  129. package/dist/{jolie-HNBk2igP.js → jolie-BY65dSmP.js} +1 -1
  130. package/dist/{jq-CSpAc6pk.js → jq-BbgGBIYH.js} +1 -1
  131. package/dist/{js-extras-BAw4sjY2.js → js-extras-mJaUWyhT.js} +1 -1
  132. package/dist/{js-templates-D7JHowl6.js → js-templates-pUlQci6i.js} +1 -1
  133. package/dist/{jsdoc-DCWAeNzk.js → jsdoc-1da5ijxE.js} +1 -1
  134. package/dist/{json-CW-2Beif.js → json-B-6E7CwB.js} +1 -1
  135. package/dist/{json5-1tvpSLrV.js → json5-BraKxRJt.js} +1 -1
  136. package/dist/{jsonp-DI3PU1C6.js → jsonp-k7JqtB57.js} +1 -1
  137. package/dist/{jsstacktrace-Bl1aYR-M.js → jsstacktrace-C9wUX17s.js} +1 -1
  138. package/dist/{jsx-BoOKkiWg.js → jsx-D2YysIFR.js} +1 -1
  139. package/dist/{julia-DfRVgWNp.js → julia-DUicT8Vx.js} +1 -1
  140. package/dist/{keepalived-BHZjFrYc.js → keepalived-bXd4LVaE.js} +1 -1
  141. package/dist/{keyman-zUhLbxFl.js → keyman-C2zXqp9r.js} +1 -1
  142. package/dist/knowledge-card.es.js +1 -1
  143. package/dist/knowledge-card.umd.js +1 -1
  144. package/dist/knowledge-card.umd.js.gz +0 -0
  145. package/dist/{kotlin-BIGNNsBu.js → kotlin-CAAU5Lu6.js} +1 -1
  146. package/dist/{kumir-BoNw4d_o.js → kumir-CtJB7Pbr.js} +1 -1
  147. package/dist/{kusto-Qi7ZVDG7.js → kusto-Bk_EnRYh.js} +1 -1
  148. package/dist/{latex-By6XoStL.js → latex-Bu_WBmut.js} +1 -1
  149. package/dist/{latte-CH0WKrFy.js → latte-DnAPR4Cv.js} +1 -1
  150. package/dist/{less-jISig-Ub.js → less-BTdbCal8.js} +1 -1
  151. package/dist/{lilypond-2vZXgAJb.js → lilypond-CnLLiTTs.js} +1 -1
  152. package/dist/{liquid-Bkw2_6Ef.js → liquid-BEM3kC68.js} +1 -1
  153. package/dist/{lisp-DMOm0exk.js → lisp-DpGaLbeh.js} +1 -1
  154. package/dist/{livescript-KCNCzVxy.js → livescript-CbJJVnqf.js} +1 -1
  155. package/dist/{llvm-Dw71HAh9.js → llvm-CzHsAVW9.js} +1 -1
  156. package/dist/{log-CgX1D-oB.js → log-DHjsPhP_.js} +1 -1
  157. package/dist/{lolcode-I1eEp4DX.js → lolcode-ChOTzo0U.js} +1 -1
  158. package/dist/{lua-DutoaGCJ.js → lua-DAVg5scH.js} +1 -1
  159. package/dist/{magma-Yv8RMDVp.js → magma-DQHkjWCA.js} +1 -1
  160. package/dist/{makefile-B02IlapN.js → makefile-Bg4ELfFS.js} +1 -1
  161. package/dist/{markdown-Dssi2Hrb.js → markdown-DLeBWHJF.js} +1 -1
  162. package/dist/markdown-DLeBWHJF.js.gz +0 -0
  163. package/dist/{markup-D9229VgJ.js → markup-CzXoyFd6.js} +1 -1
  164. package/dist/{markup-templating-DaGR3YrY.js → markup-templating-CHTh8Fce.js} +1 -1
  165. package/dist/{matlab-yaI4HoBt.js → matlab-B4eeFQYD.js} +1 -1
  166. package/dist/{maxscript-DefL2IzR.js → maxscript-BGwmYQOn.js} +1 -1
  167. package/dist/{mel-BR0nXdkT.js → mel-DdVO70dX.js} +1 -1
  168. package/dist/mel-DdVO70dX.js.gz +0 -0
  169. package/dist/{mermaid-DO7RKowp.js → mermaid-Dextkvz4.js} +1 -1
  170. package/dist/{mizar-tx0_wzLK.js → mizar-B1jxaKNb.js} +1 -1
  171. package/dist/{mongodb-BOSzi5t-.js → mongodb-DeR5MRE9.js} +1 -1
  172. package/dist/{monkey-D-U0h_LC.js → monkey-DgpZY07X.js} +1 -1
  173. package/dist/{moonscript-BfeGTi7u.js → moonscript-CnCwKaVV.js} +1 -1
  174. package/dist/{n1ql-Bv_AqTgg.js → n1ql-BTLkFJFM.js} +1 -1
  175. package/dist/{n4js-CJOSNBJU.js → n4js-B98JrgNl.js} +1 -1
  176. package/dist/{nand2tetris-hdl-CeH9oHMU.js → nand2tetris-hdl-Bt-JeGAJ.js} +1 -1
  177. package/dist/{naniscript-CwRLuheF.js → naniscript-BfElPYSG.js} +1 -1
  178. package/dist/{nasm-BQvca8YQ.js → nasm-DU2QIz1Q.js} +1 -1
  179. package/dist/{neon-CerLsWWo.js → neon-DahQQq3-.js} +1 -1
  180. package/dist/{nevod-B7TEXkWO.js → nevod-D4Lr-qis.js} +1 -1
  181. package/dist/{nginx-DgCRE4Tq.js → nginx-Dib0yHeq.js} +1 -1
  182. package/dist/{nim-BhEMqQ8s.js → nim-B97ix8AG.js} +1 -1
  183. package/dist/{nix-7NfZcIX6.js → nix-BSaT5IMT.js} +1 -1
  184. package/dist/{nsis-DzGff6uI.js → nsis-DDg9uWQh.js} +1 -1
  185. package/dist/{objectivec-Cyio4v6a.js → objectivec-DEFDLqUA.js} +1 -1
  186. package/dist/{ocaml-YOIqTVHJ.js → ocaml-CNlQyP47.js} +1 -1
  187. package/dist/{opencl-CkUu8V02.js → opencl-C1Ud62_0.js} +1 -1
  188. package/dist/opencl-C1Ud62_0.js.gz +0 -0
  189. package/dist/{openqasm-BKZCoEfv.js → openqasm-DEz3ttPk.js} +1 -1
  190. package/dist/{oz-DaAcC-3R.js → oz-ChEvds7K.js} +1 -1
  191. package/dist/{parigp-DnxyfXOW.js → parigp-evsqOZ_h.js} +1 -1
  192. package/dist/{parser-YmLHAYAE.js → parser-bmMhSfem.js} +1 -1
  193. package/dist/{pascal-D55E5FyS.js → pascal-4-_8PY25.js} +1 -1
  194. package/dist/{pascaligo-TQDDQa8f.js → pascaligo-QGOjRaj5.js} +1 -1
  195. package/dist/{pcaxis-BEUsuvno.js → pcaxis-C7_4rplb.js} +1 -1
  196. package/dist/{peoplecode-DtcMGf5T.js → peoplecode-CiukZ2Yl.js} +1 -1
  197. package/dist/{perl-COUMTAmu.js → perl-OwCNK_1i.js} +1 -1
  198. package/dist/{php-BtQVIP9b.js → php-DeV1eZnh.js} +1 -1
  199. package/dist/{php-extras-kot-GVDK.js → php-extras-BZSYH7a4.js} +1 -1
  200. package/dist/{phpdoc-BzwQSEew.js → phpdoc-Czj1O39Z.js} +1 -1
  201. package/dist/{plsql-DBDYOo-r.js → plsql-BUNFDN04.js} +1 -1
  202. package/dist/{powerquery-DNzaALdJ.js → powerquery-DPar8RfF.js} +1 -1
  203. package/dist/{powershell-BSKvMPjb.js → powershell-C3kS0UsE.js} +1 -1
  204. package/dist/{processing-Cx5-qr5b.js → processing-4m9oIJfa.js} +1 -1
  205. package/dist/{prolog-DePlsCB9.js → prolog-Fj3rVbB2.js} +1 -1
  206. package/dist/{promql-Dv3JxLZH.js → promql-BovBNAR1.js} +1 -1
  207. package/dist/{properties-CRRaTlBT.js → properties-CC_wDndN.js} +1 -1
  208. package/dist/{protobuf-zOihXk8n.js → protobuf-B0fxh9cq.js} +1 -1
  209. package/dist/{psl-DUi7_t7Y.js → psl-CYfuXZOP.js} +1 -1
  210. package/dist/{pug-BkKd7bgE.js → pug-ubve6cZA.js} +1 -1
  211. package/dist/{puppet-B333ZJV9.js → puppet-DAm27jPp.js} +1 -1
  212. package/dist/{pure-BQCDRwEl.js → pure-C3IY7fLA.js} +1 -1
  213. package/dist/{purebasic-DWcuEHF_.js → purebasic-BEe4QKvG.js} +1 -1
  214. package/dist/{purescript-Bcq5naYh.js → purescript-C5iaRltf.js} +1 -1
  215. package/dist/{python-DioWua5r.js → python-BX0Xj47o.js} +1 -1
  216. package/dist/{q-Bk-02QIq.js → q-xVOqRNAJ.js} +1 -1
  217. package/dist/{qml-C_MvUr7s.js → qml-BrKO4uMv.js} +1 -1
  218. package/dist/{qore-CSOKCT8W.js → qore-Ck8hYIai.js} +1 -1
  219. package/dist/{qsharp-pqNxxCqq.js → qsharp-BZvD2Sse.js} +1 -1
  220. package/dist/{r-BtknrVZb.js → r-DnonM-2s.js} +1 -1
  221. package/dist/{racket-CUUnrOpS.js → racket-3OI29-Mp.js} +1 -1
  222. package/dist/{reason-Apqca_Ba.js → reason-bqpTyxnB.js} +1 -1
  223. package/dist/{regex-Cl4fCZmj.js → regex-D32GbkyS.js} +1 -1
  224. package/dist/{rego-C3A4bSe5.js → rego-BFVSteRP.js} +1 -1
  225. package/dist/{renpy-DpOVtNQS.js → renpy-BCzoNXzn.js} +1 -1
  226. package/dist/{rest-CVNJByNg.js → rest-qU1jJqU3.js} +1 -1
  227. package/dist/{rip-BxFO6CXQ.js → rip-CR-UydM7.js} +1 -1
  228. package/dist/{roboconf-BRp4NRuH.js → roboconf-BksuoiAa.js} +1 -1
  229. package/dist/{robotframework-DclqI6_r.js → robotframework-D4u19M7l.js} +1 -1
  230. package/dist/{ruby-sNdkt-V6.js → ruby-D8nVa4UL.js} +1 -1
  231. package/dist/{rust-8LrAJErN.js → rust-BRJFiXLZ.js} +1 -1
  232. package/dist/{sas-BFcmHAYS.js → sas-BmlbOuig.js} +1 -1
  233. package/dist/sas-BmlbOuig.js.gz +0 -0
  234. package/dist/{sass-D6pNAdDp.js → sass-BzJyqzCo.js} +1 -1
  235. package/dist/{scala-BlMEnK6R.js → scala-o2oxukiG.js} +1 -1
  236. package/dist/{scheme-CUgVvWOW.js → scheme-CtLR4Bz4.js} +1 -1
  237. package/dist/{scss-1V3_igRe.js → scss-Jtmuwtmj.js} +1 -1
  238. package/dist/{shell-session-BVvNnDh5.js → shell-session-WiSH--1x.js} +1 -1
  239. package/dist/{smali-BWpBK5Cx.js → smali-D7H8D4FC.js} +1 -1
  240. package/dist/{smalltalk-DQHtnZ8I.js → smalltalk-CAumslCJ.js} +1 -1
  241. package/dist/{smarty-mz5SubSz.js → smarty-BJj8K-0d.js} +1 -1
  242. package/dist/{sml-C65D9d_E.js → sml-BGPSI63x.js} +1 -1
  243. package/dist/{solidity-C2Osuylb.js → solidity-p9IrM7B8.js} +1 -1
  244. package/dist/{solution-file-DQbC7PNS.js → solution-file-cEllGvXm.js} +1 -1
  245. package/dist/{soy-DDgEcu3Y.js → soy-BhOponpt.js} +1 -1
  246. package/dist/{sparql-BmNIcJzX.js → sparql-AbM9WQLe.js} +1 -1
  247. package/dist/{splunk-spl-Co6GEaIj.js → splunk-spl-Cqps3vmf.js} +1 -1
  248. package/dist/{sqf-D-K5NDn4.js → sqf-BC5Wtby1.js} +1 -1
  249. package/dist/sqf-BC5Wtby1.js.gz +0 -0
  250. package/dist/{sql-DybOHrmc.js → sql-CcJ5qVMr.js} +1 -1
  251. package/dist/{squirrel-BXyGw8Hc.js → squirrel-DTyCj0lV.js} +1 -1
  252. package/dist/{stan-DSK2GEbR.js → stan-pLSJ-D2z.js} +1 -1
  253. package/dist/style.css +1 -1
  254. package/dist/style.css.gz +0 -0
  255. package/dist/{stylus-Dy7r3Fhv.js → stylus-BzDWPxX6.js} +1 -1
  256. package/dist/{swift-CZQnDco-.js → swift-DJOIqwh7.js} +1 -1
  257. package/dist/{systemd-BbFwE1Gr.js → systemd-DEm0ZtD7.js} +1 -1
  258. package/dist/{t4-cs-C1-tBAj_.js → t4-cs-cAJH0GmO.js} +1 -1
  259. package/dist/{t4-templating-rJYzeo3v.js → t4-templating-B8-Ks0oC.js} +1 -1
  260. package/dist/{t4-vb-DvjbvIIp.js → t4-vb-DpTjVL6f.js} +1 -1
  261. package/dist/{tap-ChlhBlC-.js → tap-CVj4VvpU.js} +1 -1
  262. package/dist/{tcl-BuLjZpld.js → tcl-CH8WDh_p.js} +1 -1
  263. package/dist/{textile-BEKSDoYq.js → textile-BEo2_T-Y.js} +1 -1
  264. package/dist/textile-BEo2_T-Y.js.gz +0 -0
  265. package/dist/{toml-DzcFJMfD.js → toml-KkfbvHjL.js} +1 -1
  266. package/dist/{tremor-DBrgzBj2.js → tremor-Dyh4VOWP.js} +1 -1
  267. package/dist/{tsx-DpCrb0HE.js → tsx-B1DMjQVs.js} +1 -1
  268. package/dist/{tt2-C-1BZhSa.js → tt2-Bd0laFfn.js} +1 -1
  269. package/dist/{turtle-BNPiwdFu.js → turtle-DTpyPlpQ.js} +1 -1
  270. package/dist/{twig-DtrEwgVG.js → twig-D-c3jZ13.js} +1 -1
  271. package/dist/{typescript-DZk7MyPH.js → typescript-C1FUJeGx.js} +1 -1
  272. package/dist/{typoscript-DLkfxdKL.js → typoscript-C5qinGRV.js} +1 -1
  273. package/dist/{unrealscript-vZ6oXUs1.js → unrealscript-uRKLgOZF.js} +1 -1
  274. package/dist/{uorazor-CaZ8CsJp.js → uorazor-BQ491h5z.js} +1 -1
  275. package/dist/{uri-Cundbr9Z.js → uri-DALVKR76.js} +1 -1
  276. package/dist/{v-B7nY_j80.js → v-BIpUV2A3.js} +1 -1
  277. package/dist/{vala-XjzS5rGV.js → vala-CgGCinYF.js} +1 -1
  278. package/dist/{vbnet-CMdtmEmX.js → vbnet-D0rAw3DJ.js} +1 -1
  279. package/dist/{velocity-C_abwxuO.js → velocity-BCk0gVgX.js} +1 -1
  280. package/dist/{verilog-BF1dh7YL.js → verilog-BJtkSz6V.js} +1 -1
  281. package/dist/{vhdl-CWiI31FZ.js → vhdl-CVV4QLy2.js} +1 -1
  282. package/dist/{vim-CCdcDwJp.js → vim-DZ6XeeX_.js} +1 -1
  283. package/dist/vim-DZ6XeeX_.js.gz +0 -0
  284. package/dist/{visual-basic-BfsEoK3k.js → visual-basic-CLFidj7d.js} +1 -1
  285. package/dist/{warpscript-DptSK0sO.js → warpscript-CzwpGnkh.js} +1 -1
  286. package/dist/{wasm-Cf8KADIq.js → wasm-FBvKn5W0.js} +1 -1
  287. package/dist/{web-idl-C-c0zFJY.js → web-idl-HSuI_tH_.js} +1 -1
  288. package/dist/{wiki-DwqmawcQ.js → wiki-BOGEB84E.js} +1 -1
  289. package/dist/{wolfram-D246EQsj.js → wolfram-C6IjHSeT.js} +1 -1
  290. package/dist/{wren-BcvKR8Uv.js → wren-BgI5MWFz.js} +1 -1
  291. package/dist/{xeora-DZjyR20V.js → xeora-DAQ7Vhro.js} +1 -1
  292. package/dist/{xml-doc-CgRmY15q.js → xml-doc-CXO4V7uY.js} +1 -1
  293. package/dist/{xojo-BKEENiP-.js → xojo-CiHEs6r_.js} +1 -1
  294. package/dist/{xquery-RoSalBCk.js → xquery-DGjnerog.js} +1 -1
  295. package/dist/{yaml-BEmRqdhR.js → yaml-o8OU1c8E.js} +1 -1
  296. package/dist/{yang--_CT_kbS.js → yang-X_nKdfMX.js} +1 -1
  297. package/dist/{zig-CAplUJ5A.js → zig-BJbAMIBg.js} +1 -1
  298. package/package.json +1 -1
  299. package/dist/autohotkey-wZF7I2Fb.js.gz +0 -0
  300. package/dist/cmake-DnTECu1B.js.gz +0 -0
  301. package/dist/core-Dg6XJzoA.js.gz +0 -0
  302. package/dist/factor-s2wiGWrC.js.gz +0 -0
  303. package/dist/gherkin-DzmJ5E-a.js.gz +0 -0
  304. package/dist/markdown-Dssi2Hrb.js.gz +0 -0
  305. package/dist/mel-BR0nXdkT.js.gz +0 -0
  306. package/dist/opencl-CkUu8V02.js.gz +0 -0
  307. package/dist/sas-BFcmHAYS.js.gz +0 -0
  308. package/dist/sqf-D-K5NDn4.js.gz +0 -0
  309. package/dist/textile-BEKSDoYq.js.gz +0 -0
  310. package/dist/vim-CCdcDwJp.js.gz +0 -0
@@ -208,7 +208,7 @@ var kse=function(){return kse=Object.assign||function(e){for(var t,r=1,n=argumen
208
208
  Copyright (c) 2018 Jed Watson.
209
209
  Licensed under the MIT License (MIT), see
210
210
  http://jedwatson.github.io/classnames
211
- */!function(e){!function(){var t={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=i(e,n(r)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var n="";for(var o in e)t.call(e,o)&&e[o]&&(n=i(n,o));return n}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):window.classNames=r}()}(classnames);var classnamesExports=classnames.exports;const classNames=getDefaultExportFromCjs(classnamesExports),Show=e=>{const{height:t="300px",value:r,maskTip:n=!1,maskClick:i}=e,o=React.useRef(null),a=React.useRef(null);React.useEffect(()=>(o.current&&l(o.current),()=>{var e;null==(e=a.current)||e.dispose()}),[]);const s=React.useRef(null);React.useEffect(()=>{var e,t;return(null==r?void 0:r.cells)&&(null==(e=a.current)||e.fromJSON(r.cells),null==(t=a.current)||t.centerContent(),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var e;null==(e=a.current)||e.zoomToFit({maxScale:1,padding:20})},500)),()=>{s.current&&clearTimeout(s.current)}},[r]);const l=e=>{a.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:!1})};return jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-show"),style:{height:t},children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:o,className:"drawx6-container"})}),!!n&&jsxRuntimeExports.jsx("div",{className:"drawx6-show-mask",onClick:i,children:"string"==typeof n&&jsxRuntimeExports.jsxs("div",{className:"drawx6-center drawx6-show-mask-tip",children:[n,jsxRuntimeExports.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.00477 7.0309L2.00977 7.0949L2.02377 7.2249C2.12977 7.9959 2.61077 8.2449 4.92477 8.9539L6.42377 9.4079L6.59977 9.4679C6.6472 9.48276 6.69282 9.50289 6.73577 9.5279L6.75177 9.5419L6.77077 9.5659C6.79377 9.6029 6.82377 9.6759 6.87377 9.8329L6.96077 10.1149L7.39277 11.5389L7.55677 12.0599C8.12777 13.8389 8.39877 14.1999 9.13677 14.2799L9.19777 14.2849C10.1658 14.3669 10.4048 13.9549 11.3768 11.2969L13.4548 5.5859L13.6278 5.0929C14.1158 3.6729 14.1238 3.2479 13.6518 2.7489L13.5998 2.6949C13.0028 2.0989 12.5648 2.1669 10.5338 2.9019L4.64877 5.0459L3.98577 5.2959C2.27677 5.9549 1.95477 6.2519 2.00477 7.0309ZM5.11877 6.1719L11.0628 4.0079C12.3268 3.5549 12.6708 3.4909 12.7368 3.5569L12.7488 3.5769L12.7568 3.6069C12.7768 3.7509 12.6618 4.1899 12.2348 5.3749L10.1218 11.1749L9.86377 11.8509C9.49577 12.7919 9.33777 13.0729 9.30177 13.0709L9.28477 13.0509L9.25677 13.0109C9.19758 12.9171 9.14511 12.8192 9.09977 12.7179L9.01777 12.5329L8.96177 12.3959C8.81703 12.0073 8.68595 11.6137 8.56877 11.2159L8.08877 9.6349C7.92877 9.1119 7.83877 8.9049 7.61377 8.6799C7.58752 8.65373 7.56016 8.62871 7.53177 8.6049L7.43677 8.5299C7.28077 8.4159 7.12077 8.3499 6.76877 8.2399L4.72477 7.6159L4.34077 7.4909C4.133 7.42316 3.92815 7.34676 3.72677 7.2619L3.65577 7.2319C3.31577 7.0799 3.22377 6.9949 3.22377 6.9919L3.22877 6.9809L3.24777 6.9639C3.35177 6.8809 3.83277 6.6509 5.11977 6.1719H5.11877Z"}),jsxRuntimeExports.jsx("path",{d:"M7.24609 9.07483L9.69727 6.8866",strokeLinecap:"round"})]})]})})]})},content$4=".x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n";var __decorate$b=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Dnd2;class Dnd extends View{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},Dnd.defaults),e),this.init()}init(){ensure(this.name,content$4),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new Graph(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),append(this.container,this.draggingGraph.container)}start(e,t){const r=t;r.preventDefault(),this.targetModel.startBatch("dnd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,r.clientX,r.clientY);const n=this.updateNodePosition(r.clientX,r.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:r,node:e,cell:e,view:this.draggingView,x:n.x,y:n.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Dnd.documentEvents,r.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,r){const n=this.draggingGraph,i=n.model,o=this.options.getDragNode(e,{sourceNode:e,draggingGraph:n,targetGraph:this.targetGraph});o.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const e=this.targetGraph.transform.getScale();n.scale(e.sx,e.sy),a*=Math.max(e.sx,e.sy)}else n.scale(1,1);this.clearDragging(),i.resetCells([o]);const s=n.findViewByCell(o);s.undelegateEvents(),s.cell.off("changed"),n.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const l=s.getBBox();this.geometryBBox=s.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=o,this.draggingView=s,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,r)}updateGraphPosition(e,t){const r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,s={left:e-i.x-o.width/2-a+n,top:t-i.y-o.height/2-a+r};return this.draggingGraph&&css$3(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const r=this.targetGraph.clientToLocal(e,t),n=this.draggingBBox;return r.x-=n.width/2,r.y-=n.height/2,this.draggingNode.position(r.x,r.y),r}snap({cell:e,current:t,options:r}){const n=e;if(r.snapped){const e=this.draggingBBox;n.position(e.x+r.tx,e.y+r.ty,{silent:!0}),this.draggingView.translate(),n.position(t.x,t.y,{silent:!0}),this.snapOffset={x:r.tx,y:r.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const r=this.normalizeEvent(e),n=r.clientX,i=r.clientY;this.updateGraphPosition(n,i);const o=this.updateNodePosition(n,i),a=this.targetGraph.options.embedding.enabled,s=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:n,y:i});if(a){t.setEventData(r,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const e=t.getEventData(r);s?t.processEmbedding(r,e):t.clearEmbedding(e),this.candidateEmbedView=e.candidateEmbedView}this.isSnaplineEnabled()&&(s?this.snapline.snapOnMoving({e:r,view:t,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const r=this.normalizeEvent(e),n=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,s=i.y;o&&(a+=o.x,s+=o.y),t.position(a,s,{silent:!0});const l=this.drop(t,{x:r.clientX,y:r.clientY}),c=e=>{e?(this.onDropped(t),this.targetGraph.options.embedding.enabled&&n&&(n.setEventData(r,{cell:e,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),n.finalizeEmbedding(r,n.getEventData(r)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};isAsync(l)?(this.undelegateDocumentEvents(),l.then(c)):c(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(e){this.draggingNode===e&&(this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,r=null;const n=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(r=this.getDropArea(this.options.dndContainer));const o=r&&r.containsPoint(e);if(i)if(i.options.autoResize)t=this.getDropArea(i.container);else{const e=this.getDropArea(i.container);t=this.getDropArea(n.container).intersectsWithRect(e)}else t=this.getDropArea(n.container);return!o&&t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css$3(e,"border-left-width"),10)-n,y:t.top+parseInt(css$3(e,"border-top-width"),10)-r,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const r=this.targetGraph,n=r.model,i=r.clientToLocal(t),o=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:o,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),s=a.getBBox();i.x+=s.x-s.width/2,i.y+=s.y-s.height/2;const l=this.snapOffset?1:r.getGridSize();a.position(GeometryUtil.snapToGrid(i.x,l),GeometryUtil.snapToGrid(i.y,l)),a.removeZIndex();const c=this.options.validateNode,u=!c||c(a,{sourceNode:o,draggingNode:e,droppingNode:a,targetGraph:r,draggingGraph:this.draggingGraph});return"boolean"==typeof u?u?(n.addCell(a,{stencil:this.cid}),a):null:toDeferredBoolean(u).then(e=>e?(n.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}}__decorate$b([View.dispose()],Dnd.prototype,"dispose",null),Dnd2=Dnd||(Dnd={}),Dnd2.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},Dnd2.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"},Graph.prototype.toSVG=function(e,t){const r=this.getPlugin("export");r&&r.toSVG(e,t)},Graph.prototype.toPNG=function(e,t){const r=this.getPlugin("export");r&&r.toPNG(e,t)},Graph.prototype.toJPEG=function(e,t){const r=this.getPlugin("export");r&&r.toJPEG(e,t)},Graph.prototype.exportPNG=function(e,t){const r=this.getPlugin("export");r&&r.exportPNG(e,t)},Graph.prototype.exportJPEG=function(e,t){const r=this.getPlugin("export");r&&r.exportJPEG(e,t)},Graph.prototype.exportSVG=function(e,t){const r=this.getPlugin("export");r&&r.exportSVG(e,t)};var __decorate$a=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};class Export extends Basecoat{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportSVG(e="chart",t={}){this.toSVG(t=>{DataUri.downloadDataUri(DataUri.svgToDataUrl(t),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const r=this.view.svg,n=Vector.create(r).clone();let i=n.node;const o=n.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),s=t.preserveDimensions;if(s){const e="boolean"==typeof s?a:s;n.attr({width:e.width,height:e.height})}if(n.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),!1!==t.copyStyles){const e=r.ownerDocument,t=Array.from(r.querySelectorAll("*")),n=Array.from(i.querySelectorAll("*")),o=e.styleSheets.length,a=[];for(let r=o-1;r>=0;r-=1)a[r]=e.styleSheets[r],e.styleSheets[r].disabled=!0;const s={};t.forEach((e,t)=>{const r=window.getComputedStyle(e,null),n={};Object.keys(r).forEach(e=>{n[e]=r.getPropertyValue(e)}),s[t]=n}),o!==e.styleSheets.length&&a.forEach((t,r)=>{e.styleSheets[r]=t});for(let r=0;r<o;r+=1)e.styleSheets[r].disabled=!1;const l={};t.forEach((e,t)=>{const r=window.getComputedStyle(e,null),n=s[t],i={};Object.keys(r).forEach(e=>{isNumber(e)||r.getPropertyValue(e)===n[e]||(i[e]=r.getPropertyValue(e))}),l[t]=i}),n.forEach((e,t)=>{css$3(e,l[t])})}const l=t.stylesheet;if("string"==typeof l){const e=r.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(l);n.prepend(Vector.create("style",{type:"text/css"},[e]))}const c=()=>{const r=t.beforeSerialize;if("function"==typeof r){const e=call$1(r,this.graph,i);e instanceof SVGSVGElement&&(i=e)}const n=(new XMLSerializer).serializeToString(i).replace(/&nbsp;/g," ");this.notify("after:export",t),e(n)};if(t.serializeImages){const e=n.find("image").map(e=>new Promise(t=>{const r=e.attr("xlink:href")||e.attr("href");DataUri.imageToDataUri(r,(r,n)=>{!r&&n&&e.attr("xlink:href",n),t()})}));Promise.all(e).then(c)}else c()}toDataURL(e,t){let r=t.viewBox||this.graph.getContentBBox();const n=normalizeSides(t.padding);t.width&&t.height&&(n.left+n.right>=t.width&&(n.left=n.right=0),n.top+n.bottom>=t.height&&(n.top=n.bottom=0));const i=new Rectangle(-n.left,-n.top,n.left+n.right,n.top+n.bottom);if(t.width&&t.height){const e=r.width+n.left+n.right,o=r.height+n.top+n.bottom;i.scale(e/t.width,o/t.height)}r=Rectangle.create(r).moveAndExpand(i);const o="number"==typeof t.width&&"number"==typeof t.height?{width:t.width,height:t.height}:r;let a=t.ratio?parseFloat(t.ratio):1;Number.isFinite(a)&&0!==a||(a=1);const s={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const e=document.createElement("canvas"),t=e.getContext("2d");e.width=s.width,e.height=s.height;const r=s.width-1,n=s.height-1;t.fillStyle="rgb(1,1,1)",t.fillRect(r,n,1,1);const i=t.getImageData(r,n,1,1).data;if(1!==i[0]||1!==i[1]||1!==i[2])throw new Error("size exceeded")}const l=new Image;l.onload=()=>{const r=document.createElement("canvas");r.width=s.width,r.height=s.height;const n=r.getContext("2d");n.fillStyle=t.backgroundColor||"white",n.fillRect(0,0,s.width,s.height);try{n.drawImage(l,0,0,s.width,s.height);const i=r.toDataURL(t.type,t.quality);e(i)}catch(i){}},this.toSVG(e=>{l.src=`data:image/svg+xml,${encodeURIComponent(e)}`},Object.assign(Object.assign({},t),{viewBox:r,serializeImages:!0,preserveDimensions:Object.assign({},s)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}__decorate$a([Basecoat.dispose()],Export.prototype,"dispose",null);var __decorate$9=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Private$1;class TransformImpl extends View{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(e,t,r){super(),this.node=t,this.graph=r,this.options=Object.assign(Object.assign({},Private$1.defaultOptions),e),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const e=document.createElement("div");attr(e,"draggable","false");const t=e.cloneNode(!0);addClass(t,this.rotateClassName);const r=Private$1.POSITIONS.map(t=>{const r=e.cloneNode(!0);return addClass(r,this.resizeClassName),attr(r,"data-position",t),r});this.empty(),append(this.container,[...r,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(Private$1.NODE_CLS),addClass(this.container,this.containerClassName),toggleClass(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),toggleClass(this.container,"no-resize",!this.options.resizable),toggleClass(this.container,"no-rotate",!this.options.rotatable),this.options.className&&addClass(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const r=Angle.normalize(this.node.getAngle()),n=0!==r?`rotate(${r}deg)`:"";return css$3(this.container,{transform:n,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(Private$1.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=Angle.normalize(this.node.getAngle()),t=Math.floor(e*(Private$1.DIRECTIONS.length/360));if(t!==this.prevShift){const e=Private$1.DIRECTIONS.slice(t).concat(Private$1.DIRECTIONS.slice(0,t)),r=e=>`${this.containerClassName}-cursor-${e}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((t,n)=>{removeClass(t,Private$1.DIRECTIONS.map(e=>r(e)).join(" ")),addClass(t,r(e[n]))}),this.prevShift=t}}getTrueDirection(e){const t=Angle.normalize(this.node.getAngle());let r=Private$1.POSITIONS.indexOf(e);return r+=Math.floor(t*(Private$1.POSITIONS.length/360)),r%=Private$1.POSITIONS.length,Private$1.POSITIONS[r]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=attr(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const r=this.getTrueDirection(t);let n=0,i=0;t.split("-").forEach(e=>{n={left:-1,right:1}[e]||n,i={top:-1,bottom:1}[e]||i});const o=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],s=Angle.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:o,trueDirection:r,relativeDirection:t,angle:s,resizeX:n,resizeY:i,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),r=this.normalizeEvent(e),n=this.graph.snapToGrid(r.clientX,r.clientY);this.setEventData(e,{center:t,action:"rotating",angle:Angle.normalize(this.node.getAngle()),start:Point.create(n).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let r=this.getEventData(e);if(r.action){const n=this.normalizeEvent(e);let i=n.clientX,o=n.clientY;const a=this.graph.getPlugin("scroller"),s=this.options.restrictedResizing;if(!0===s||"number"==typeof s){const e=!0===s?0:s,t=a?Math.max(e,8):e,r=this.graph.container.getBoundingClientRect();i=clamp(i,r.left+t,r.right-t),o=clamp(o,r.top+t,r.bottom-t)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const l=this.graph.snapToGrid(i,o),c=this.graph.getGridSize(),u=this.node,d=this.options;if("resizing"===r.action){r.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),r.resized=!0);const n=u.getBBox(),i=Point.create(l).rotate(r.angle,n.getCenter()).diff(n[r.selector]);let o=r.resizeX?i.x*r.resizeX:n.width,a=r.resizeY?i.y*r.resizeY:n.height;const s=o,p=a;if(o=GeometryUtil.snapToGrid(o,c),a=GeometryUtil.snapToGrid(a,c),o=Math.max(o,d.minWidth||c),a=Math.max(a,d.minHeight||c),o=Math.min(o,d.maxWidth||1/0),a=Math.min(a,d.maxHeight||1/0),d.preserveAspectRatio){const e=n.width*a/n.height,t=n.height*o/n.width;o<e?a=t:o=e}const h=r.relativeDirection;if(d.allowReverse&&(s<=-o||p<=-a)){let t;"left"===h?s<=-o&&(t="right"):"right"===h?s<=-o&&(t="left"):"top"===h?p<=-a&&(t="bottom"):"bottom"===h?p<=-a&&(t="top"):"top-left"===h?s<=-o&&p<=-a?t="bottom-right":s<=-o?t="top-right":p<=-a&&(t="bottom-left"):"top-right"===h?s<=-o&&p<=-a?t="bottom-left":s<=-o?t="top-left":p<=-a&&(t="bottom-right"):"bottom-left"===h?s<=-o&&p<=-a?t="top-right":s<=-o?t="bottom-right":p<=-a&&(t="top-left"):"bottom-right"===h&&(s<=-o&&p<=-a?t="top-left":s<=-o?t="bottom-left":p<=-a&&(t="top-right"));const r=t;this.stopHandle();const n=this.container.querySelector(`.${this.resizeClassName}[data-position="${r}"]`);this.startHandle(n),this.prepareResizing(e,r),this.onMouseMove(e)}if(n.width!==o||n.height!==a){const n={ui:!0,direction:r.direction,relativeDirection:r.relativeDirection,trueDirection:r.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:!0===d.preserveAspectRatio};u.resize(o,a,n),this.notify("node:resizing",e,t)}}else if("rotating"===r.action){r.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),r.rotated=!0);const n=u.getAngle(),i=r.start-Point.create(l).theta(r.center);let o=r.angle+i;d.rotateGrid&&(o=GeometryUtil.snapToGrid(o,d.rotateGrid)),o=Angle.normalize(o),n!==o&&(u.rotate(o,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch("resizing"===t.action?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,addClass(this.container,`${this.containerClassName}-active`),e){addClass(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const e=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(t)];addClass(this.container,`${this.containerClassName}-cursor-${e}`)}}}stopHandle(){if(removeClass(this.container,`${this.containerClassName}-active`),this.handle){removeClass(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(e)];removeClass(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(Private$1.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),r=this.getEventData(e);t&&(t.removeClass(`node-${r.action}`),"resizing"===r.action&&r.resized?this.notify("node:resized",e,t):"rotating"===r.action&&r.rotated&&this.notify("node:rotated",e,t))}notify(e,t,r,n={}){if(r){const i=r.graph,o=i.view.normalizeEvent(t),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(e,Object.assign({e:o,view:r,node:r.cell,cell:r.cell,x:a.x,y:a.y},n))}}dispose(){this.stopListening(),this.remove(),this.off()}}__decorate$9([View.dispose()],TransformImpl.prototype,"dispose",null),function(e){e.NODE_CLS="has-widget-transform",e.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],e.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],e.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},e.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}}(Private$1||(Private$1={}));const content$3=".x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n";Graph.prototype.createTransformWidget=function(e){const t=this.getPlugin("transform");return t&&t.createWidget(e),this},Graph.prototype.clearTransformWidgets=function(){const e=this.getPlugin("transform");return e&&e.clearWidgets(),this};var __decorate$8=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Transform2;class Transform extends Basecoat{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,ensure(this.name,content$3)}init(e){this.graph=e,this.disabled||this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new TransformImpl(t,e,this.graph):null}getTransformOptions(e){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),"boolean"==typeof this.options.resizing&&(this.options.resizing={enabled:this.options.resizing}),"boolean"==typeof this.options.rotating&&(this.options.rotating={enabled:this.options.rotating});const t=Transform.parseOptionGroup(this.graph,e,this.options.resizing),r=Transform.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:"boolean"!=typeof t.orthogonal||t.orthogonal,restrictedResizing:!!t.restrict,autoScrollOnResizing:"boolean"!=typeof t.autoScroll||t.autoScroll,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:"boolean"!=typeof t.allowReverse||t.allowReverse,rotatable:!!r.enabled,rotateGrid:r.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),clean(this.name)}}__decorate$8([Basecoat.dispose()],Transform.prototype,"dispose",null),Transform2=Transform||(Transform={}),Transform2.parseOptionGroup=function(e,t,r){const n={};return Object.keys(r||{}).forEach(i=>{const o=r[i];n[i]="function"==typeof o?o.call(e,t):o}),n};var mousetrap={exports:{}};!function(e){!function(t,r){if(t){for(var n,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();m.prototype.bind=function(e,t,r){var n=this;return e=e instanceof Array?e:[e],n._bindMultiple.call(n,e,t,r),n},m.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},m.prototype.trigger=function(e,t){var r=this;return r._directMap[e+":"+t]&&r._directMap[e+":"+t]({},e),r},m.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},m.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var r=e.composedPath()[0];r!==e.target&&(t=r)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},m.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},m.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);n=null},m.init=function(){var e=m(r);for(var t in e)"_"!==t.charAt(0)&&(m[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},m.init(),t.Mousetrap=m,e.exports&&(e.exports=m)}function c(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r)}function u(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return i[e.which]?i[e.which]:o[e.which]?o[e.which]:String.fromCharCode(e.which).toLowerCase()}function d(e,t){return e.sort().join(",")===t.sort().join(",")}function p(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function h(e,t,r){return r||(r=function(){if(!n)for(var e in n={},i)e>95&&e<112||i.hasOwnProperty(e)&&(n[i[e]]=e);return n}()[e]?"keydown":"keypress"),"keypress"==r&&t.length&&(r="keydown"),r}function f(e,t){var r,n,i,o=[];for(r=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),i=0;i<r.length;++i)n=r[i],s[n]&&(n=s[n]),t&&"keypress"!=t&&a[n]&&(n=a[n],o.push("shift")),p(n)&&o.push(n);return{key:n,modifiers:o,action:t=h(n,o,t)}}function g(e,t){return null!==e&&e!==r&&(e===t||g(e.parentNode,t))}function m(e){var t=this;if(e=e||r,!(t instanceof m))return new m(e);t.target=e,t._callbacks={},t._directMap={};var n,i={},o=!1,a=!1,s=!1;function l(e){e=e||{};var t,r=!1;for(t in i)e[t]?r=!0:i[t]=0;r||(s=!1)}function h(e,r,n,o,a,s){var l,c,u=[],h=n.type;if(!t._callbacks[e])return[];for("keyup"==h&&p(e)&&(r=[e]),l=0;l<t._callbacks[e].length;++l)if(c=t._callbacks[e][l],(o||!c.seq||i[c.seq]==c.level)&&h==c.action&&("keypress"==h&&!n.metaKey&&!n.ctrlKey||d(r,c.modifiers))){var f=!o&&c.combo==a,g=o&&c.seq==o&&c.level==s;(f||g)&&t._callbacks[e].splice(l,1),u.push(c)}return u}function g(e,r,n,i){t.stopCallback(r,r.target||r.srcElement,n,i)||!1===e(r,n)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(r),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(r))}function v(e){"number"!=typeof e.which&&(e.which=e.keyCode);var r=u(e);r&&("keyup"!=e.type||o!==r?t.handleKey(r,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):o=!1)}function y(e,t,r,a){function c(t){return function(){s=t,++i[e],clearTimeout(n),n=setTimeout(l,1e3)}}function d(t){g(r,t,e),"keyup"!==a&&(o=u(t)),setTimeout(l,10)}i[e]=0;for(var p=0;p<t.length;++p){var h=p+1===t.length?d:c(a||f(t[p+1]).action);b(t[p],h,a,e,p)}}function b(e,r,n,i,o){t._directMap[e+":"+n]=r;var a,s=(e=e.replace(/\s+/g," ")).split(" ");s.length>1?y(e,s,r,n):(a=f(e,n),t._callbacks[a.key]=t._callbacks[a.key]||[],h(a.key,a.modifiers,{type:a.action},i,e,o),t._callbacks[a.key][i?"unshift":"push"]({callback:r,modifiers:a.modifiers,action:a.action,seq:i,level:o,combo:e}))}t._handleKey=function(e,t,r){var n,i=h(e,t,r),o={},c=0,u=!1;for(n=0;n<i.length;++n)i[n].seq&&(c=Math.max(c,i[n].level));for(n=0;n<i.length;++n)if(i[n].seq){if(i[n].level!=c)continue;u=!0,o[i[n].seq]=1,g(i[n].callback,r,i[n].combo,i[n].seq)}else u||g(i[n].callback,r,i[n].combo);var d="keypress"==r.type&&a;r.type!=s||p(e)||d||l(o),a=u&&"keydown"==r.type},t._bindMultiple=function(e,t,r){for(var n=0;n<e.length;++n)b(e[n],t,r)},c(e,"keypress",v),c(e,"keydown",v),c(e,"keyup",v)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(mousetrap);var mousetrapExports=mousetrap.exports;const Mousetrap=getDefaultExportFromCjs(mousetrapExports);var __decorate$7=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},KeyboardImpl2;class KeyboardImpl extends Disposable{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=KeyboardImpl.createMousetrap(this)}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(e,t,r){this.mousetrap.bind(this.getKeys(e),t,r)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(e=>this.formatkey(e))}formatkey(e){const t=e.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),r=this.options.format;return r?call$1(r,this.graph,t):t}isGraphEvent(e){const t=e.target,r=e.currentTarget;return!!t&&(t===this.target||r===this.target||t===document.body||contains(this.container,t))}isInputEvent(e){var t;const r=e.target,n=null===(t=null==r?void 0:r.tagName)||void 0===t?void 0:t.toLowerCase();let i=["input","textarea"].includes(n);return"true"===attr(r,"contenteditable")&&(i=!0),i}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),r=this.isInputEvent(e);if(t){if(r&&("Backspace"===e.key||"Delete"===e.key))return!1;if(this.options.guard)return call$1(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}__decorate$7([Disposable.dispose()],KeyboardImpl.prototype,"dispose",null),KeyboardImpl2=KeyboardImpl||(KeyboardImpl={}),KeyboardImpl2.createMousetrap=function(e){const t=new Mousetrap(e.target),r=t.stopCallback;return t.stopCallback=(n,i,o)=>!e.isEnabledForEvent(n)||!!r&&r.call(t,n,i,o),t},Graph.prototype.isKeyboardEnabled=function(){const e=this.getPlugin("keyboard");return!!e&&e.isEnabled()},Graph.prototype.enableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.enable(),this},Graph.prototype.disableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.disable(),this},Graph.prototype.toggleKeyboard=function(e){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(e),this},Graph.prototype.bindKey=function(e,t,r){const n=this.getPlugin("keyboard");return n&&n.bindKey(e,t,r),this},Graph.prototype.unbindKey=function(e,t){const r=this.getPlugin("keyboard");return r&&r.unbindKey(e,t),this},Graph.prototype.clearKeys=function(){const e=this.getPlugin("keyboard");return e&&e.clear(),this},Graph.prototype.triggerKey=function(e,t){const r=this.getPlugin("keyboard");return r&&r.trigger(e,t),this};var __decorate$6=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Storage;class Keyboard extends Disposable{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new KeyboardImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,r){return this.keyboardImpl.on(e,t,r),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}__decorate$6([Disposable.dispose()],Keyboard.prototype,"dispose",null);class ClipboardImpl{constructor(){this.cells=[]}copy(e,t,r={}){this.options=Object.assign({},r);const n=(Model.isModel(t)?t:t.model).cloneSubGraph(e,r);this.cells=sortBy(Object.keys(n).map(e=>n[e]),e=>e.isEdge()?2:1),this.serialize(r)}cut(e,t,r={}){this.copy(e,t,r);(Graph.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(e=>e.remove())})}paste(e,t={}){const r=Object.assign(Object.assign({},this.options),t),{offset:n,edgeProps:i,nodeProps:o}=r;let a=20,s=20;n&&(a="number"==typeof n?n:n.dx,s="number"==typeof n?n:n.dy),this.deserialize(r);const l=this.cells;l.forEach(e=>{e.model=null,e.removeProp("zIndex"),(a||s)&&e.translate(a,s),o&&e.isNode()&&e.prop(o),i&&e.isEdge()&&e.prop(i)});const c=Graph.isGraph(e)?e.model:e;return c.batchUpdate("paste",()=>{c.addCells(this.cells)}),this.copy(l,e,t),l}serialize(e){!1!==e.useLocalStorage&&Storage.save(this.cells)}deserialize(e){if(e.useLocalStorage){const e=Storage.fetch();e&&(this.cells=e)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],Storage.clean()}}!function(e){const t=`${Config.prefixCls}.clipboard.cells`;e.save=function(e){if(window.localStorage){const r=e.map(e=>e.toJSON());localStorage.setItem(t,JSON.stringify(r))}},e.fetch=function(){if(window.localStorage){const e=localStorage.getItem(t),r=e?JSON.parse(e):[];if(r)return Model.fromJSON(r)}},e.clean=function(){window.localStorage&&localStorage.removeItem(t)}}(Storage||(Storage={})),Graph.prototype.isClipboardEnabled=function(){const e=this.getPlugin("clipboard");return!!e&&e.isEnabled()},Graph.prototype.enableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.enable(),this},Graph.prototype.disableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.disable(),this},Graph.prototype.toggleClipboard=function(e){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(e),this},Graph.prototype.isClipboardEmpty=function(e){const t=this.getPlugin("clipboard");return!t||t.isEmpty(e)},Graph.prototype.getCellsInClipboard=function(){const e=this.getPlugin("clipboard");return e?e.getCellsInClipboard():[]},Graph.prototype.cleanClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.clean(),this},Graph.prototype.copy=function(e,t){const r=this.getPlugin("clipboard");return r&&r.copy(e,t),this},Graph.prototype.cut=function(e,t){const r=this.getPlugin("clipboard");return r&&r.cut(e,t),this},Graph.prototype.paste=function(e,t){const r=this.getPlugin("clipboard");return r?r.paste(e,t):[]};var __decorate$5=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},__rest$1=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};class Clipboard extends Basecoat{get disabled(){return!0!==this.options.enabled}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new ClipboardImpl,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return this.disabled&&!e||(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options,{enabled:t}=e;return __rest$1(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}__decorate$5([Basecoat.dispose()],Clipboard.prototype,"dispose",null),Graph.prototype.isHistoryEnabled=function(){const e=this.getPlugin("history");return!!e&&e.isEnabled()},Graph.prototype.enableHistory=function(){const e=this.getPlugin("history");return e&&e.enable(),this},Graph.prototype.disableHistory=function(){const e=this.getPlugin("history");return e&&e.disable(),this},Graph.prototype.toggleHistory=function(e){const t=this.getPlugin("history");return t&&t.toggleEnabled(e),this},Graph.prototype.undo=function(e){const t=this.getPlugin("history");return t&&t.undo(e),this},Graph.prototype.redo=function(e){const t=this.getPlugin("history");return t&&t.redo(e),this},Graph.prototype.undoAndCancel=function(e){const t=this.getPlugin("history");return t&&t.cancel(e),this},Graph.prototype.canUndo=function(){const e=this.getPlugin("history");return!!e&&e.canUndo()},Graph.prototype.canRedo=function(){const e=this.getPlugin("history");return!!e&&e.canRedo()},Graph.prototype.cleanHistory=function(e){const t=this.getPlugin("history");return t&&t.clean(e),this},Graph.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},Graph.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},Graph.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},Graph.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var __decorate$4=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Util;class History extends Basecoat{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Util.getOptions(e),this.validator=new History.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return!0!==this.options.enabled}validate(e,...t){return this.validator.validate(e,...t),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:!!e&&e.batch,data:{}}}revertCommand(e,t){this.freezed=!0;const r=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let n=r.length-1;n>=0;n-=1){const e=r[n],i=Object.assign(Object.assign({},t),pick(e.options,this.options.revertOptionsList||[]));this.executeCommand(e,!0,i)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const r=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let n=0;n<r.length;n+=1){const e=r[n],i=Object.assign(Object.assign({},t),pick(e.options,this.options.applyOptionsList||[]));this.executeCommand(e,!1,i)}this.freezed=!1}executeCommand(e,t,r){const n=this.model,i=n.getCell(e.data.id),o=e.event;if(Util.isAddEvent(o)&&t||Util.isRemoveEvent(o)&&!t)i&&i.remove(r);else if(Util.isAddEvent(o)&&!t||Util.isRemoveEvent(o)&&t){const t=e.data;t.node?n.addNode(t.props,r):t.edge&&n.addEdge(t.props,r)}else if(Util.isChangeEvent(o)){const n=e.data,o=n.key;if(o&&i){const e=t?n.prev[o]:n.next[o];if("attrs"===n.key){this.ensureUndefinedAttrs(e,t?n.next[o]:n.prev[o])&&(r.dirty=!0)}i.prop(o,e,r)}}else{const n=this.options.executeCommand;n&&call$1(n,this,e,t,r)}}addCommand(e,t){if(this.freezed||this.disabled)return;const r=t,n=r.options||{};if(n.dryrun)return;if(Util.isAddEvent(e)&&this.options.ignoreAdd||Util.isRemoveEvent(e)&&this.options.ignoreRemove||Util.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(null!=i&&!1===call$1(i,this,e,t))return;"cell:change:*"===e&&(e=`cell:change:${r.key}`);const o=r.cell,a=Model.isModel(o);let s;if(this.batchCommands){s=this.batchCommands[Math.max(this.lastBatchIndex,0)];const t=a&&!s.modelChange||s.data.id!==o.id,r=s.event!==e;if(this.lastBatchIndex>=0&&(t||r)){const t=this.batchCommands.findIndex(t=>(a&&t.modelChange||t.data.id===o.id)&&t.event===e);t<0||Util.isAddEvent(e)||Util.isRemoveEvent(e)?s=this.createCommand({batch:!0}):(s=this.batchCommands[t],this.batchCommands.splice(t,1)),this.batchCommands.push(s),this.lastBatchIndex=this.batchCommands.length-1}}else s=this.createCommand({batch:!1});if(Util.isAddEvent(e)||Util.isRemoveEvent(e)){const t=s.data;return s.event=e,s.options=n,t.id=o.id,t.props=cloneDeep(o.toJSON()),o.isEdge()?t.edge=!0:o.isNode()&&(t.node=!0),this.push(s,n)}if(Util.isChangeEvent(e)){const r=t.key,i=s.data;return s.batch&&s.event||(s.event=e,s.options=n,i.key=r,null==i.prev&&(i.prev={}),i.prev[r]=cloneDeep(o.previous(r)),a?s.modelChange=!0:i.id=o.id),null==i.next&&(i.next={}),i.next[r]=cloneDeep(o.prop(r)),this.push(s,n)}const l=this.options.afterAddCommand;l&&call$1(l,this,e,t,s),this.push(s,n)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const r=[];for(;t.length>0;){const e=t.shift(),n=e.event,i=e.data.id;if(null!=n&&(null!=i||e.modelChange)){if(Util.isAddEvent(n)){const e=t.findIndex(e=>Util.isRemoveEvent(e.event)&&e.data.id===i);if(e>=0){t=t.filter((t,r)=>e<r||t.data.id!==i);continue}}else if(Util.isRemoveEvent(n)){const e=t.findIndex(e=>Util.isAddEvent(e.event)&&e.data.id===i);if(e>=0){t.splice(e,1);continue}}else if(Util.isChangeEvent(n)){const t=e.data;if(isEqual(t.prev,t.next))continue}r.push(e)}}return r}notify(e,t,r){const n=null==t?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:n,options:r}),this.graph.trigger(`history:${e}`,{cmds:n,options:r}),this.emit("change",{cmds:n,options:r}),this.graph.trigger("history:change",{cmds:n,options:r})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],r=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const n=new Set(t.map(e=>e.event));if(2!==n.size||!n.has("cell:change:parent")||!n.has("cell:change:children"))return;if(!t.every(e=>{var t;return e.batch&&(null===(t=e.options)||void 0===t?void 0:t.ui)}))return;if(!Array.isArray(r)||1!==r.length)return;const i=r[0];"cell:change:position"===i.event&&(null===(e=i.options)||void 0===e?void 0:e.ui)&&(r.push(...t),this.undoStack.pop())}undoStackPush(e){0!==this.stackSize?(this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)):this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let r=!1;return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).forEach(n=>{void 0===e[n]&&void 0!==t[n]?(e[n]=void 0,r=!0):"object"==typeof e[n]&&"object"==typeof t[n]&&(r=this.ensureUndefinedAttrs(e[n],t[n]))}),r}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}__decorate$4([Basecoat.dispose()],History.prototype,"dispose",null),function(e){class t extends Basecoat{constructor(e){super(),this.map={},this.command=e.history,this.cancelInvalid=!1!==e.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:e}){return Array.isArray(e)?e.every(e=>this.isValidCommand(e)):this.isValidCommand(e)}isValidCommand(e){if(e.options&&!1===e.options.validation)return!0;const t=e.event&&this.map[e.event]||[];let r=null;return t.forEach(t=>{let n=0;const i=o=>{const a=t[n];n+=1;try{if(!a)return void(r=o);a(o,e,i)}catch(s){i(s)}};i(r)}),!r||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:r}),!1)}validate(e,...t){const r=Array.isArray(e)?e:e.split(/\s+/);return t.forEach(e=>{if("function"!=typeof e)throw new Error(`${r.join(" ")} requires callback functions.`)}),r.forEach(e=>{null==this.map[e]&&(this.map[e]=[]),this.map[e].push(t)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}__decorate$4([Basecoat.dispose()],t.prototype,"dispose",null),e.Validator=t}(History||(History={})),function(e){e.isAddEvent=function(e){return"cell:added"===e},e.isRemoveEvent=function(e){return"cell:removed"===e},e.isChangeEvent=function(e){return null!=e&&e.startsWith("cell:change:")},e.getOptions=function(t){const r=["cell:added","cell:removed","cell:change:*"],n=["batch:start","batch:stop"],i=t.eventNames?t.eventNames.filter(t=>!(e.isChangeEvent(t)||r.includes(t)||n.includes(t))):r;return Object.assign(Object.assign({enabled:!0},t),{eventNames:i,applyOptionsList:t.applyOptionsList||["propertyPath"],revertOptionsList:t.revertOptionsList||["propertyPath"]})},e.sortBatchCommands=function(t){const r=[];for(let n=0,i=t.length;n<i;n+=1){const i=t[n];let o=null;if(e.isAddEvent(i.event)){const e=i.data.id;for(let r=0;r<n;r+=1)if(t[r].data.id===e){o=r;break}}null!==o?r.splice(o,0,i):r.push(i)}return r}}(Util||(Util={}));var __decorate$3=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Private;class SelectionImpl extends View{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Private.classNames.box)}get $boxes(){return children(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Collection([],{comparator:Private.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:r,pointerEvents:n}=this.options,{ui:i,selection:o,translateBy:a,snapped:s}=t,l=(!0!==r||n&&"none"===this.getPointerEventsValue(n))&&!this.translating&&!o,c=i&&a&&e.id===a;if(l&&(c||s)){this.translating=!0;const r=e.position(),n=e.previous("position"),i=r.x-n.x,o=r.y-n.y;0===i&&0===o||this.translateSelectedNodes(i,o,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(r,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(r,Object.assign(Object.assign({},t),{ui:!0})),this}const r=this.cells,n=this.filter(Array.isArray(e)?e:[e]),i={},o={};r.forEach(e=>i[e.id]=e),n.forEach(e=>o[e.id]=e);const a=[],s=[];return n.forEach(e=>{i[e.id]||a.push(e)}),r.forEach(e=>{o[e.id]||s.push(e)}),s.length&&this.unselect(s,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),0===s.length&&0===a.length&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(!1===e.batch?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){let t,r;e=this.normalizeEvent(e),this.clean();const n=this.graph.container;if(null!=e.offsetX&&null!=e.offsetY&&n.contains(e.target))t=e.offsetX,r=e.offsetY;else{const i=offset$1(n),o=n.scrollLeft,a=n.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,r=e.clientY-i.top+window.pageYOffset+a}css$3(this.container,{top:r,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:r,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Private.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(e=>Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e))}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let e=width$1(this.container),r=height$1(this.container);const n=offset$1(this.container),i=t.pageToLocal(n.left,n.top),o=t.transform.getScale();e/=o.sx,r/=o.sy;const a=new Rectangle(i.x,i.y,e,r),s=this.getCellViewsInArea(a).map(e=>e.cell);this.reset(s,{batch:!0}),this.hideRubberband();break}case"translating":{const n=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const e=r;this.updateSelectedNodesPosition({dx:e.clientX-e.originX,dy:e.clientY-e.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,n.x,n.y);break}default:this.clean()}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const r=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:r});const n=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,n.x,n.y),this.delegateDocumentEvents(Private.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t="function"==typeof e?call$1(e,this.graph,null):e;return"number"==typeof t?this.graph.transform.getGraphArea().inflate(t):!0===t?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let r=e.x-t.clientX,n=e.y-t.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=Cell.getCellsBBox(o,{deep:!0})||Rectangle.create(),s=i.x-a.x,l=i.y-a.y,c=i.x+i.width-(a.x+a.width),u=i.y+i.height-(a.y+a.height);if(r<s&&(r=s),n<l&&(n=l),c<r&&(r=c),u<n&&(n=u),!this.options.following){const i=e.x-t.originX,o=e.y-t.originY;r=i<=s||i>=c?0:r,n=o<=l||o>=u?0:n}}return{dx:r,dy:n}}updateElementPosition(e,t,r){const n=css$3(e,"left"),i=css$3(e,"top"),o=n?parseFloat(n):0,a=i?parseFloat(i):0;css$3(e,"left",o+t),css$3(e,"top",a+r)}updateSelectedNodesPosition(e){const{dx:t,dy:r}=e;if(t||r)if(this.translateSelectedNodes(t,r),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const e=this.graph.transform.getScale();for(let n=0,i=this.$boxes,o=i.length;n<o;n+=1)this.updateElementPosition(i[n],t*e.sx,r*e.sy);this.updateElementPosition(this.selectionContainer,t*e.sx,r*e.sy)}}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");return r?r.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),r=this.getEventData(t);switch(r.action){case"selecting":{const e=r;!0!==e.moving&&(appendTo(this.container,this.graph.container),this.showRubberband(),e.moving=!0);const{scrollerX:n,scrollerY:i}=this.autoScrollGraph(t.clientX,t.clientY);e.scrollerX+=n,e.scrollerY+=i;const o=t.clientX-e.clientX+e.scrollerX,a=t.clientY-e.clientY+e.scrollerY,s=parseInt(css$3(this.container,"left")||"0",10),l=parseInt(css$3(this.container,"top")||"0",10);css$3(this.container,{left:o<0?e.offsetX+o:s,top:a<0?e.offsetY+a:l,width:Math.abs(o),height:Math.abs(a)});break}case"translating":{const n=this.graph.snapToGrid(t.clientX,t.clientY),i=r,o=this.getSelectionOffset(n,i);this.options.following?this.updateSelectedNodesPosition(o):this.updateContainerPosition(o),o.dx&&(i.clientX=n.x),o.dy&&(i.clientY=n.y),this.notifyBoxEvent("box:mousemove",e,n.x,n.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,r,n){const i={},o=[];if(r&&(i[r.id]=!0),this.collection.toArray().forEach(e=>{e.getDescendants({deep:!0}).forEach(e=>{i[e.id]=!0})}),n&&n.translateBy){const e=this.graph.getCellById(n.translateBy);e&&(i[e.id]=!0,e.getDescendants({deep:!0}).forEach(e=>{i[e.id]=!0}),o.push(e))}this.collection.toArray().forEach(r=>{if(!i[r.id]){const a=Object.assign(Object.assign({},n),{selection:this.cid,exclude:o});r.translate(e,t,a),this.graph.model.getConnectedEdges(r).forEach(r=>{i[r.id]||(r.translate(e,t,a),i[r.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,r={strict:this.options.strict};let n=[];return this.options.rubberNode&&(n=n.concat(t.model.getNodesInArea(e,r).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),this.options.rubberEdge&&(n=n.concat(t.model.getEdgesInArea(e,r).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),n}notifyBoxEvent(e,t,r,n){const i=this.getEventData(t).activeView;this.trigger(e,{e:t,view:i,x:r,y:n,cell:i.cell})}getSelectedClassName(e){return this.prefixClassName((e.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(remove(this.container.querySelector(`[data-cell-id="${e.id}"]`)),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),remove(this.$boxes),this.boxCount=0}hide(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband)),removeClass(this.container,this.prefixClassName(Private.classNames.selected))}showRubberband(){addClass(this.container,this.prefixClassName(Private.classNames.rubberband))}hideRubberband(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband))}showSelected(){removeAttribute(this.container,"style"),addClass(this.container,this.prefixClassName(Private.classNames.selected))}createContainer(){this.container=document.createElement("div"),addClass(this.container,this.prefixClassName(Private.classNames.root)),this.options.className&&addClass(this.container,this.options.className),this.selectionContainer=document.createElement("div"),addClass(this.selectionContainer,this.prefixClassName(Private.classNames.inner)),this.selectionContent=document.createElement("div"),addClass(this.selectionContent,this.prefixClassName(Private.classNames.content)),append(this.selectionContainer,this.selectionContent),attr(this.selectionContainer,"data-selection-length",this.collection.length),prepend(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(e=>this.canShowSelectionBox(e)).forEach(r=>{const n=this.graph.renderer.findViewByCell(r);if(n){const r=n.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,r.x),e.y=Math.min(e.y,r.y),t.x=Math.max(t.x,r.x+r.width),t.y=Math.max(t.y,r.y+r.height)}}),css$3(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),attr(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if("function"==typeof r){const e=call$1(r,this.graph,this,this.selectionContent);e&&(this.selectionContent.innerHTML=e)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?appendTo(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&!0===this.options.showNodeSelectionBox||e.isEdge()&&!0===this.options.showEdgeSelectionBox}getPointerEventsValue(e){return"string"==typeof e?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const r=t.getBBox({useCellGeometry:!0}),n=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;addClass(i,n),addClass(i,`${n}-${e.isNode()?"node":"edge"}`),attr(i,"data-cell-id",e.id),css$3(i,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),appendTo(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,r=t.length;e<r;e+=1){const r=t[e],n=attr(r,"data-cell-id");remove(r),this.boxCount-=1;const i=this.collection.get(n);i&&this.createSelectionBox(i)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const e=this.collection.get(t);if(e)return this.graph.renderer.findViewByCell(e)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(e=>{this.listenCellRemoveEvent(e),this.createSelectionBox(e)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:r}){e.forEach(e=>{this.trigger("cell:selected",{cell:e,options:r}),e.isNode()?this.trigger("node:selected",{cell:e,options:r,node:e}):e.isEdge()&&this.trigger("edge:selected",{cell:e,options:r,edge:e})}),t.forEach(e=>{this.trigger("cell:unselected",{cell:e,options:r}),e.isNode()?this.trigger("node:unselected",{cell:e,options:r,node:e}):e.isEdge()&&this.trigger("edge:unselected",{cell:e,options:r,edge:e})});const n={added:e,removed:t,options:r,selected:this.cells.filter(e=>!!this.graph.getCellById(e.id))};this.trigger("selection:changed",n)}dispose(){this.clean(),this.remove(),this.off()}}__decorate$3([View.dispose()],SelectionImpl.prototype,"dispose",null),function(e){const t="widget-selection";e.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},e.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},e.depthComparator=function(e){return e.getAncestors().length}}(Private||(Private={}));const content$2=".x6-widget-selection {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n";Graph.prototype.isSelectionEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isEnabled()},Graph.prototype.enableSelection=function(){const e=this.getPlugin("selection");return e&&e.enable(),this},Graph.prototype.disableSelection=function(){const e=this.getPlugin("selection");return e&&e.disable(),this},Graph.prototype.toggleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleEnabled(e),this},Graph.prototype.isMultipleSelection=function(){const e=this.getPlugin("selection");return!!e&&e.isMultipleSelection()},Graph.prototype.enableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.enableMultipleSelection(),this},Graph.prototype.disableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.disableMultipleSelection(),this},Graph.prototype.toggleMultipleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(e),this},Graph.prototype.isSelectionMovable=function(){const e=this.getPlugin("selection");return!!e&&e.isSelectionMovable()},Graph.prototype.enableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.enableSelectionMovable(),this},Graph.prototype.disableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.disableSelectionMovable(),this},Graph.prototype.toggleSelectionMovable=function(e){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(e),this},Graph.prototype.isRubberbandEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isRubberbandEnabled()},Graph.prototype.enableRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableRubberband(),this},Graph.prototype.disableRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableRubberband(),this},Graph.prototype.toggleRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleRubberband(e),this},Graph.prototype.isStrictRubberband=function(){const e=this.getPlugin("selection");return!!e&&e.isStrictRubberband()},Graph.prototype.enableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableStrictRubberband(),this},Graph.prototype.disableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableStrictRubberband(),this},Graph.prototype.toggleStrictRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(e),this},Graph.prototype.setRubberbandModifiers=function(e){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(e),this},Graph.prototype.setSelectionFilter=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(e),this},Graph.prototype.setSelectionDisplayContent=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(e),this},Graph.prototype.isSelectionEmpty=function(){const e=this.getPlugin("selection");return!e||e.isEmpty()},Graph.prototype.cleanSelection=function(e){const t=this.getPlugin("selection");return t&&t.clean(e),this},Graph.prototype.resetSelection=function(e,t){const r=this.getPlugin("selection");return r&&r.reset(e,t),this},Graph.prototype.getSelectedCells=function(){const e=this.getPlugin("selection");return e?e.getSelectedCells():[]},Graph.prototype.getSelectedCellCount=function(){const e=this.getPlugin("selection");return e?e.getSelectedCellCount():0},Graph.prototype.isSelected=function(e){const t=this.getPlugin("selection");return!!t&&t.isSelected(e)},Graph.prototype.select=function(e,t){const r=this.getPlugin("selection");return r&&r.select(e,t),this},Graph.prototype.unselect=function(e,t){const r=this.getPlugin("selection");return r&&r.unselect(e,t),this};var __decorate$2=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Selection2;class Selection extends Basecoat{get rubberbandDisabled(){return!0!==this.options.enabled||!0!==this.options.rubberband}get disabled(){return!0!==this.options.enabled}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},Selection.defaultOptions),e),ensure(this.name,content$2)}init(e){this.graph=e,this.selectionImpl=new SelectionImpl(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return null!=e?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.options.movable}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return null!=e?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return null!=e?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selectionImpl.options.strict}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return null!=e?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const r=this.getCells(e);return r.length&&(this.isMultiple()?this.selectionImpl.select(r,t):this.reset(r.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),r=this.graph.getPlugin("scroller"),n=r&&r.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!n&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(null==t?void 0:t.includes("leftMouseDown"))&&0===e.button||(null==t?void 0:t.includes("mouseWheelDown"))&&1===e.button}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&ModifierKey.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&ModifierKey.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e:e,cell:t}){const r=this.options;let n=this.disabled;!n&&this.movedMap.has(t)&&(n=!1===r.selectCellOnMoved,n||(n=!1===r.selectNodeOnMoved&&t.isNode()),n||(n=!1===r.selectEdgeOnMoved&&t.isEdge())),n||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e:e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(e=>"string"==typeof e?this.graph.getCellById(e):e).filter(e=>null!=e)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return!1!==this.options.multiple}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),clean(this.name)}}__decorate$2([Basecoat.dispose()],Selection.prototype,"dispose",null),Selection2=Selection||(Selection={}),Selection2.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};var __decorate$1=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};class SnaplineImpl extends View{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,r=__rest(e,["graph"]);this.graph=t,this.options=Object.assign({},r),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new Vector("svg"),t=this.horizontal=new Vector("line"),r=this.vertical=new Vector("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),r.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),r.setAttribute("display","none"),e.append([t,r]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){"resize"===e&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:r}){const n=e.getDelegatedView();if(n&&this.isNodeMovable(n)){const n=e.cell.getPosition();this.offset={x:t-n.x,y:r-n.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,r="function"==typeof t?call$1(t,this.graph,e):t;return"number"==typeof r?this.graph.transform.getGraphArea().inflate(r):!0===r?this.graph.transform.getGraphArea():r||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const r=this.graph.renderer.findViewByCell(e);if(r&&r.cell.isNode()){const n=e.getBBox(),i=n.bbox(e.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),s=Angle.normalize(e.getAngle()),l=this.options.tolerance||0;let c,u,d,p,h,f;const g={vertical:0,horizontal:0},m=t.direction,v=t.trueDirection,y=t.relativeDirection;-1!==v.indexOf("right")?g.vertical=a.x:g.vertical=o.x,-1!==v.indexOf("bottom")?g.horizontal=a.y:g.horizontal=o.y,this.model.getNodes().some(t=>{if(this.isIgnored(e,t))return!1;const r=t.getBBox().bbox(t.getAngle()),n=r.getTopLeft(),o=r.getBottomRight(),s={vertical:[n.x,o.x],horizontal:[n.y,o.y]},m={};return Object.keys(s).forEach(e=>{const t=e,r=s[t].map(e=>({position:e,distance:Math.abs(e-g[t])})).filter(e=>e.distance<=l);m[t]=sortBy(r,e=>e.distance)}),null==c&&m.vertical.length>0&&(c=m.vertical[0].position,u=Math.min(i.y,r.y),d=Math.max(a.y,o.y)-u),null==p&&m.horizontal.length>0&&(p=m.horizontal[0].position,h=Math.min(i.x,r.x),f=Math.max(a.x,o.x)-h),null!=c&&null!=p}),this.hide();let b=0,q=0;null==p&&null==c||(null!=c&&(b=-1!==v.indexOf("right")?c-a.x:o.x-c),null!=p&&(q=-1!==v.indexOf("bottom")?p-a.y:o.y-p));let S=0,E=0;if(s%90==0)90===s||270===s?(S=q,E=b):(S=b,E=q);else{const e=s>=0&&s<90?1:s>=90&&s<180?4:s>=180&&s<270?3:2;null!=p&&null!=c&&(b<q?(q=0,p=void 0):(b=0,c=void 0));const t=Angle.toRad(s%90);b&&(S=3===e?b/Math.cos(t):b/Math.sin(t)),q&&(E=3===e?q/Math.cos(t):q/Math.sin(t));const r=1===e||3===e;switch(y){case"top":case"bottom":E=q?q/(r?Math.cos(t):Math.sin(t)):b/(r?Math.sin(t):Math.cos(t));break;case"left":case"right":S=b?b/(r?Math.cos(t):Math.sin(t)):q/(r?Math.sin(t):Math.cos(t))}}switch(y){case"top":case"bottom":S=0;break;case"left":case"right":E=0}const V=this.graph.getGridSize();let C=Math.max(n.width+S,V),T=Math.max(n.height+E,V);t.minWidth&&t.minWidth>V&&(C=Math.max(C,t.minWidth)),t.minHeight&&t.minHeight>V&&(T=Math.max(T,t.minHeight)),t.maxWidth&&(C=Math.min(C,t.maxWidth)),t.maxHeight&&(T=Math.min(T,t.maxHeight)),t.preserveAspectRatio&&(E<S?T=C*(n.height/n.width):C=T*(n.width/n.height)),C===n.width&&T===n.height||(e.resize(C,T,{direction:m,relativeDirection:y,trueDirection:v,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(r)}),d&&(d+=T-n.height),f&&(f+=C-n.width));const A=e.getBBox().bbox(s);c&&Math.abs(A.x-c)>1&&Math.abs(A.width+A.x-c)>1&&(c=void 0),p&&Math.abs(A.y-p)>1&&Math.abs(A.height+A.y-p)>1&&(p=void 0),this.update({verticalLeft:c,verticalTop:u,verticalHeight:d,horizontalTop:p,horizontalLeft:h,horizontalWidth:f})}}}snapOnMoving({view:e,e:t,x:r,y:n}){const i=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),s=o.getPosition(),l=new Rectangle(r-this.offset.x,n-this.offset.y,a.width,a.height),c=o.getAngle(),u=l.getCenter(),d=l.bbox(c),p=d.getTopLeft(),h=d.getBottomRight(),f=this.options.tolerance||0;let g,m,v,y,b,q,S=0,E=0;if(this.model.getNodes().some(e=>{if(this.isIgnored(o,e))return!1;const t=e.getBBox().bbox(e.getAngle()),r=t.getCenter(),n=t.getTopLeft(),i=t.getBottomRight();return null==g&&(Math.abs(r.x-u.x)<f?(g=r.x,S=.5):Math.abs(n.x-p.x)<f?(g=n.x,S=0):Math.abs(n.x-h.x)<f?(g=n.x,S=1):Math.abs(i.x-h.x)<f?(g=i.x,S=1):Math.abs(i.x-p.x)<f&&(g=i.x),null!=g&&(m=Math.min(d.y,t.y),v=Math.max(h.y,i.y)-m)),null==y&&(Math.abs(r.y-u.y)<f?(y=r.y,E=.5):Math.abs(n.y-p.y)<f?y=n.y:Math.abs(n.y-h.y)<f?(y=n.y,E=1):Math.abs(i.y-h.y)<f?(y=i.y,E=1):Math.abs(i.y-p.y)<f&&(y=i.y),null!=y&&(b=Math.min(d.x,t.x),q=Math.max(h.x,i.x)-b)),null!=g&&null!=y}),this.hide(),null!=y||null!=g){null!=y&&(d.y=y-E*d.height),null!=g&&(d.x=g-S*d.width);const e=d.getCenter(),t=e.x-l.width/2,r=e.y-l.height/2,n=t-s.x,a=r-s.y;0===n&&0===a||(o.translate(n,a,{snapped:!0,restrict:this.getRestrictArea(i)}),q&&(q+=n),v&&(v+=a)),this.update({verticalLeft:g,verticalTop:m,verticalHeight:v,horizontalTop:y,horizontalLeft:b,horizontalWidth:q})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e)}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new Point(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new Point(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${r.x}`:"100%",y2:`${r.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${r.x}`,y2:this.options.sharp?`${r.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t="number"==typeof e?e:!1!==e?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}__decorate$1([View.dispose()],SnaplineImpl.prototype,"dispose",null);const content$1=".x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n";Graph.prototype.isSnaplineEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isEnabled()},Graph.prototype.enableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enable(),this},Graph.prototype.disableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disable(),this},Graph.prototype.toggleSnapline=function(){const e=this.getPlugin("snapline");return e&&e.toggleEnabled(),this},Graph.prototype.hideSnapline=function(){const e=this.getPlugin("snapline");return e&&e.hide(),this},Graph.prototype.setSnaplineFilter=function(e){const t=this.getPlugin("snapline");return t&&t.setFilter(e),this},Graph.prototype.isSnaplineOnResizingEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isOnResizingEnabled()},Graph.prototype.enableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.enableOnResizing(),this},Graph.prototype.disableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.disableOnResizing(),this},Graph.prototype.toggleSnaplineOnResizing=function(e){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(e),this},Graph.prototype.isSharpSnapline=function(){const e=this.getPlugin("snapline");return!!e&&e.isSharp()},Graph.prototype.enableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enableSharp(),this},Graph.prototype.disableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disableSharp(),this},Graph.prototype.toggleSharpSnapline=function(e){const t=this.getPlugin("snapline");return t&&t.toggleSharp(e),this},Graph.prototype.getSnaplineTolerance=function(){const e=this.getPlugin("snapline");if(e)return e.getTolerance()},Graph.prototype.setSnaplineTolerance=function(e){const t=this.getPlugin("snapline");return t&&t.setTolerance(e),this};var __decorate=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};class Snapline extends Disposable{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),ensure(this.name,content$1)}init(e){this.snaplineImpl=new SnaplineImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(null==e)return this.isEnabled()?this.disable():this.enable(),this;e!==this.isEnabled()&&(e?this.enable():this.disable())}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return!0===this.snaplineImpl.options.resizing}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return null!=e?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return!0===this.snaplineImpl.options.sharp}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return null!=e?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),clean(this.name)}}__decorate([Disposable.dispose()],Snapline.prototype,"dispose",null);let nanoid=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_","");const CellPanel=e=>{var t,r,n,i,o,a,s,l,c,u,d;const{cell:p,graph:h}=e,[f,g]=React.useState(p.prop());React.useEffect(()=>{},[f]),React.useEffect(()=>{g(p.prop());const e=e=>{const t={...e.cell.prop()};g(t)};return p.on("changed",e),()=>{p.off("changed",e)}},[p]);const m=(e,t)=>{p.prop(e,t)};let v=0,y=0;"edge"===f.shape&&([v,y]=calculateDistanceAndAngle([f.source.x,f.source.y],[f.target.x,f.target.y]));let b="";b="edge"===f.shape?(null==(i=null==(n=null==(r=null==(t=f.labels)?void 0:t[0])?void 0:r.attrs)?void 0:n.label)?void 0:i.text)||"":(null==(a=null==(o=f.attrs)?void 0:o.text)?void 0:a.text)||"";let q=0;return q="edge"===f.shape?(null==(u=null==(c=null==(l=null==(s=f.labels)?void 0:s[0])?void 0:l.attrs)?void 0:c.text)?void 0:u.fontSize)||14:null==(d=f.attrs)?void 0:d.text.fontSize,jsxRuntimeExports.jsxs("div",{className:"cell-panel",children:[jsxRuntimeExports.jsx(PanelOne,{title:"大小"}),"rect"===f.shape||"text"===f.shape?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Space,{size:20,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"宽"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:f.size.width,onChange:e=>{m("size/width",e)}})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"高"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:f.size.height,onChange:e=>{m("size/height",e)}})]})]})}):"circle"===f.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"半径"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:f.size.width,min:0,onChange:e=>{m("size",{width:e,height:e})}})]}):"edge"===f.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"长"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:v,min:0,onChange:e=>{const[t,r]=calculateEndPoint([f.source.x,f.source.y],y,e);m("target",{x:t,y:r})}})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsx(PanelOne,{title:"旋转"}),jsxRuntimeExports.jsx(PanelTwo,{title:"角度"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:"edge"===f.shape?y:f.angle,onChange:e=>{if("edge"===f.shape){const[t,r]=calculateEndPoint([f.source.x,f.source.y],e,v);return void m("target",{x:t,y:r})}m("angle",e)}}),jsxRuntimeExports.jsx(PanelOne,{title:"文本"}),jsxRuntimeExports.jsx(PanelTwo,{title:"内容"}),jsxRuntimeExports.jsx(Input.TextArea,{style:{resize:"none",height:"100px",marginBottom:"16px",background:"#f7f8fa"},value:b,onChange:e=>{const t=e.target.value;"edge"!==f.shape?m("attrs/text/text",t):f.labels?p.setLabelAt(0,t):p.appendLabel({attrs:{text:{text:t}}})}}),jsxRuntimeExports.jsx(PanelTwo,{title:"字号"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"16px"},value:q,min:0,onChange:e=>{"edge"!==f.shape||null==e?m("attrs/text/fontSize",e):f.labels?p.setLabelAt(0,{attrs:{label:{text:b},text:{fontSize:e}}}):p.appendLabel({attrs:{label:{text:b},text:{fontSize:e}}})}})]})},PanelOne=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-one",children:t})},PanelTwo=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-two",children:t})};function calculateDistanceAndAngle(e,t){const[r,n]=e,[i,o]=t,a=Math.sqrt(Math.pow(i-r,2)+Math.pow(o-n,2));let s=Math.atan2(o-n,i-r)*(180/Math.PI);s<0&&(s+=360);return[Math.floor(a),Math.floor(s)]}function calculateEndPoint(e,t,r){const[n,i]=e,o=t*(Math.PI/180),a=n+r*Math.cos(o),s=i+r*Math.sin(o);return[Math.round(a),Math.round(s)]}const{Text:Text$1}=Typography,KeyBordModal=e=>{const{children:t}=e;return jsxRuntimeExports.jsx(Popover,{arrow:!1,trigger:"click",rootClassName:"drawx6-keybordermodal-pop",content:jsxRuntimeExports.jsx("div",{className:"drawx6-keybordermodal-pop-content",children:jsxRuntimeExports.jsx(List,{bordered:!1,dataSource:[{key:["Ctrl","C"],desc:"拷贝"},{key:["Ctrl","V"],desc:"粘贴"},{key:["Ctrl","X"],desc:"剪切"},{key:["Ctrl","Z"],desc:"撤销"},{key:["Ctrl","Shift","Z"],desc:"重做"},{key:["BackSpace"],desc:"删除"},{key:["Ctrl","鼠标拖动"],desc:"平移"},{key:["Ctrl","鼠标滚轮"],desc:"缩放"}],renderItem:(e,t)=>jsxRuntimeExports.jsx(List.Item,{children:jsxRuntimeExports.jsxs(Space,{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[jsxRuntimeExports.jsx(Space,{size:6,children:e.key.map((e,t,r)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(Tag,{style:{marginRight:0},children:e}),t<r.length-1&&"+"]},t))}),jsxRuntimeExports.jsx(Text$1,{strong:!0,children:e.desc})]})},t)})}),children:t})},content=".x6-widget-edgednd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n }\n .x6-widget-edgednd.dragging {\n display: inline-block;\n }\n .x6-widget-edgednd.dragging * {\n pointer-events: none !important;\n }\n .x6-widget-edgednd .x6-graph {\n background: transparent;\n box-shadow: none;\n }\n ",_EdgeDnd=class e extends View{constructor(e){super(),__publicField(this,"name","edgednd"),__publicField(this,"options"),__publicField(this,"draggingGraph"),__publicField(this,"sourceEdge"),__publicField(this,"draggingEdge"),__publicField(this,"length",0),__publicField(this,"draggingBBox"),__publicField(this,"geometryBBox"),__publicField(this,"draggingView"),__publicField(this,"delta"),__publicField(this,"padding"),__publicField(this,"snapOffset"),__publicField(this,"originOffset"),this.options={...e,getDragEdge:e=>e.clone(),getDropEdge:e=>e.clone()},this.init()}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}init(){ensure(this.name,content),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-edgednd")),this.draggingGraph=new Graph({...this.options.delegateGraphOptions,container:document.createElement("div"),width:1,height:1,async:!1}),append(this.container,this.draggingGraph.container)}start(t,r,n){const i=n;i.preventDefault(),this.length=r,this.targetModel.startBatch("edgednd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceEdge=t,this.prepareDragging(t,i.clientX,i.clientY),this.updateNodePosition(i.clientX,i.clientY),this.delegateDocumentEvents(e.documentEvents,i.data)}prepareDragging(e,t,r){const n=this.draggingGraph,i=n.model,o=this.options.getDragEdge(e);o.setSource({x:0,y:0}),o.setTarget({x:0+this.length,y:0});n.scale(1,1),this.clearDragging(),i.resetCells([o]);const a=n.findViewByCell(o);a.undelegateEvents(),a.cell.off("changed"),n.fitToContent({padding:5,allowNewOrigin:"any",useCellGeometry:!1});const s=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(s.getTopLeft()),this.draggingEdge=o,this.draggingView=a,this.draggingBBox=o.getBBox(),this.padding=5,this.originOffset=this.updateGraphPosition(t,r)}clearDragging(){this.draggingEdge&&(this.sourceEdge=null,this.draggingEdge.remove(),this.draggingEdge=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}updateGraphPosition(e,t){const r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,s={left:e-i.x-o.width/2-a+n,top:t-i.y-o.height/2-a+r};return this.draggingGraph&&css$3(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const r=this.targetGraph.clientToLocal(e,t),n=this.draggingBBox;return r.x-=n.width/2,r.y-=n.height/2,this.draggingEdge.setSource({x:r.x,y:r.y}),this.draggingEdge.setTarget({x:r.x+this.length,y:r.y}),r}onDragging(e){if(this.draggingView){e.preventDefault();const t=this.normalizeEvent(e),r=t.clientX,n=t.clientY;this.updateGraphPosition(r,n),this.updateNodePosition(r,n)}}onDragEnd(e){const t=this.draggingEdge;if(t){const r=this.normalizeEvent(e);this.draggingView;const n=this.draggingBBox,i=this.snapOffset;let o=n.x,a=n.y;i&&(o+=i.x,a+=i.y),t.setSource({x:o,y:a}),t.setTarget({x:o+this.length,y:a});(e=>{e?this.onDropped(e):this.onDropInvalid(),this.targetModel.stopBatch("edgednd")})(this.drop(t,{x:r.clientX,y:r.clientY}))}}drop(e,t){if(this.isInsideValidArea(t)){const r=this.targetGraph,n=r.model,i=r.clientToLocal(t),o=this.options.getDropEdge(e),a=o.getBBox();i.x+=a.x-a.width/2,i.y+=a.y-a.height/2;const s=this.snapOffset?1:r.getGridSize(),l=GeometryUtil.snapToGrid(i.x,s),c=GeometryUtil.snapToGrid(i.y,s);return o.setSource({x:l,y:c}),o.setTarget({x:l+this.length,y:c}),o.removeZIndex(),n.addCell(o,{stencil:this.cid}),o}return null}isInsideValidArea(e){let t;const r=this.targetGraph;return t=this.getDropArea(r.container),t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css$3(e,"border-left-width"),10)-n,y:t.top+parseInt(css$3(e,"border-top-width"),10)-r,width:e.clientWidth,height:e.clientHeight})}onDropInvalid(){const e=this.draggingEdge;e&&this.onDropped(e)}onDropped(e){this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container)}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}};__publicField(_EdgeDnd,"documentEvents",{mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"});let EdgeDnd=_EdgeDnd;const activeColor="#1677ff",normalColor="#999999",ports={groups:{top:{position:"top",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},right:{position:"right",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},bottom:{position:"bottom",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},left:{position:"left",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}}},items:[{group:"top"},{group:"right"},{group:"bottom"},{group:"left"}]},Editor=React.forwardRef((e,t)=>{const{value:r,onSave:n,onExit:i,savePngType:o="url",editabled:a=!0,showSaveBtn:s=!0}=e,{topProps:l}=useQuestionContext(),{uploadImg:c}=l,u=React.useRef(null),d=React.useRef(null),p=React.useRef(null),h=React.useRef(null),[f,g]=React.useState(!1),[m,v]=React.useState(null),[y,b]=React.useState(!1);React.useEffect(()=>(u.current&&q(u.current),()=>{var e;null==(e=d.current)||e.dispose()}),[]),React.useEffect(()=>{var e;(null==r?void 0:r.cells)&&(null==(e=d.current)||e.fromJSON(r.cells))},[r]);const q=e=>{d.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:a,connecting:{createEdge:()=>new Edge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor"]})},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{"stroke-width":1,stroke:activeColor}}}}}),E(d.current),S(d.current),V(d.current),C(d.current)},S=e=>{e.use(new Export),e.use(new Transform({resizing:{enabled:!0,preserveAspectRatio:e=>"circle"===e.shape},rotating:!0})),e.use(new Selection({rubberband:!0,showNodeSelectionBox:!0})),e.use(new Snapline({className:"x6-snapline-color"})),e.use(new Keyboard),e.use(new Clipboard),e.use(new History)},E=e=>{p.current=new Dnd({target:e}),h.current=new EdgeDnd({target:e})},V=e=>{const t=(e,t)=>{for(let r=0,n=e.length;r<n;r+=1)e[r].style.visibility=t?"visible":"hidden"};e.on("node:mouseenter",({e:e,node:r,view:n})=>{const i=u.current.querySelectorAll(".x6-port-body");t(i,!0)}),e.on("node:mouseleave",({e:e,node:r,view:n})=>{const i=u.current.querySelectorAll(".x6-port-body");t(i,!1)}),e.on("cell:click",({e:e,x:t,y:r,cell:n,view:i})=>{"edge"!==n.shape&&(g(!0),v(n))}),e.on("blank:click",({e:e,x:t,y:r})=>{g(!1),v(null)})},C=e=>{e.bindKey(["meta+c","ctrl+c"],()=>{const t=e.getSelectedCells();return t.length&&e.copy(t,{deep:!0}),!1}),e.bindKey(["meta+x","ctrl+x"],()=>{const t=e.getSelectedCells();return t.length&&e.cut(t,{deep:!0}),!1}),e.bindKey(["meta+v","ctrl+v"],()=>{if(!e.isClipboardEmpty()){const t=e.paste({offset:32});e.cleanSelection(),e.select(t)}return!1}),e.bindKey(["meta+z","ctrl+z"],()=>(e.canUndo()&&e.undo(),!1)),e.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(e.canRedo()&&e.redo(),!1)),e.bindKey("backspace",()=>{const t=e.getSelectedCells();t.length&&e.removeCells(t)})},T=e=>{let t=null;switch(e.currentTarget.getAttribute("data-type")){case"rect":t=d.current.createNode({width:80,height:40,shape:"rect",label:"矩形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"circle":t=d.current.createNode({width:60,height:60,shape:"circle",label:"圆形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"text":t=d.current.createNode({width:80,height:40,shape:"text",tools:["node-editor"]});break;case"hori-line":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:null,sourceMarker:null}},tools:[{name:"edge-editor",args:{labelAddable:!0}},{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]});break;case"arrow":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor",{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]})}t&&(t.isNode()?p.current.start(t,e.nativeEvent):h.current.start(t,100,e.nativeEvent))},A=async()=>new Promise(e=>{var t,r;const n=null==(t=d.current)?void 0:t.toJSON();null==(r=d.current)||r.toPNG(t=>{e({json:n,png:t})},{padding:20,copyStyles:!1})}),x=async(e=!1)=>{if(e){b(!0);const e=await A();if("url"===o){const t=R(e.png),r=new FormData;r.append("file",t);const n=await(null==c?void 0:c({file:r}).catch(()=>{}));(null==n?void 0:n.url)&&(e.png=n.url)}null==n||n(e),b(!1)}null==i||i()},R=e=>{const t=e.replace(/^data:image\/png;base64,/,""),r=atob(t),n=r.length,i=new ArrayBuffer(n),o=new Uint8Array(i);for(let l=0;l<n;l++)o[l]=r.charCodeAt(l);const a=new Blob([i],{type:"image/png"}),s=`${nanoid()}.png`;return new File([a],s,{type:"image/png"})};return React.useImperativeHandle(t,()=>({getGraphInstance:()=>d.current,getData:async()=>{const e=await A();if("url"===o){const t=R(e.png),r=new FormData;r.append("file",t);const n=await(null==c?void 0:c({file:r}).catch(()=>{}));(null==n?void 0:n.url)&&(e.png=n.url)}return e}})),jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-editor"),children:[jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-header drawx6-space",children:[jsxRuntimeExports.jsx("div",{children:"画板"}),jsxRuntimeExports.jsxs(Space,{size:10,children:[jsxRuntimeExports.jsx(Button$1,{ghost:!0,type:"primary",onClick:()=>x(!1),children:"仅退出"}),s&&jsxRuntimeExports.jsx(Button$1,{loading:y,type:"primary",onClick:()=>x(!0),children:"保存并退出"})]})]}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container",children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:u,className:"drawx6-container"})}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container-nav drawx6-overflow-y",children:[jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"rect",onMouseDown:T,children:[jsxRuntimeExports.jsx("div",{className:"graph-rect"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"矩形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"circle",onMouseDown:T,children:[jsxRuntimeExports.jsx("div",{className:"graph-circle"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"圆形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"text",onMouseDown:T,children:[jsxRuntimeExports.jsx(TextSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"文本"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"hori-line",onMouseDown:T,children:[jsxRuntimeExports.jsx(LineSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"水平线"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"arrow",onMouseDown:T,children:[jsxRuntimeExports.jsx(ArrawSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"箭头"})]}),jsxRuntimeExports.jsx(KeyBordModal,{children:jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space",style:{cursor:"default"},children:[jsxRuntimeExports.jsx(KeyBoard,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"快捷键"})]})})]}),jsxRuntimeExports.jsx(Popconfirm,{title:null,description:jsxRuntimeExports.jsxs("div",{style:{marginTop:"-4px"},children:["确认清空画板?清空后无法恢复,",jsxRuntimeExports.jsx("br",{}),"请谨慎操作。"]}),onConfirm:()=>{var e;null==(e=d.current)||e.clearCells()},placement:"bottomRight",arrow:!1,children:jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-clear drawx6-center",style:{right:f?"220px":"20px"},children:jsxRuntimeExports.jsx(ClearSvg,{})})}),f&&jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-control drawx6-overflow-y",children:jsxRuntimeExports.jsx(CellPanel,{cell:m,graph:d.current})})]})]})}),TextSvg=()=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_6137_1319)",children:jsxRuntimeExports.jsx("path",{d:"M13.5394 28.9231H12.3086C11.9394 28.9231 11.6932 29.1692 11.6932 29.5385C11.6932 29.9077 11.9394 30.1539 12.3086 30.1539H13.5394C13.9086 30.1539 14.1547 29.9077 14.1547 29.5385C14.1547 29.1692 13.9086 28.9231 13.5394 28.9231ZM6.15475 28.9231H4.92398C4.8009 28.9231 4.67782 28.9846 4.61629 29.0462V28.3077C4.61629 27.8154 4.18552 27.3846 3.69321 27.3846H1.23167C0.739363 27.3846 0.308594 27.8154 0.308594 28.3077V30.7692C0.308594 31.2615 0.739363 31.6923 1.23167 31.6923H3.69321C4.18552 31.6923 4.61629 31.2615 4.61629 30.7692V30.0308C4.67782 30.0923 4.8009 30.1539 4.92398 30.1539H6.15475C6.52398 30.1539 6.77013 29.9077 6.77013 29.5385C6.77013 29.1692 6.52398 28.9231 6.15475 28.9231ZM3.07782 6.15385C3.07782 5.78462 2.83167 5.53846 2.46244 5.53846C2.09321 5.53846 1.84706 5.78462 1.84706 6.15385V7.38462C1.84706 7.75385 2.09321 8 2.46244 8C2.83167 8 3.07783 7.75385 3.07782 7.38462V6.15385ZM9.84706 28.9231H8.61629C8.24706 28.9231 8.0009 29.1692 8.0009 29.5385C8.0009 29.9077 8.24706 30.1539 8.61629 30.1539H9.84706C10.2163 30.1539 10.4624 29.9077 10.4624 29.5385C10.4624 29.1692 10.2163 28.9231 9.84706 28.9231ZM7.38552 1.84616H6.15475C5.78552 1.84616 5.53936 2.09231 5.53936 2.46154C5.53936 2.83077 5.78552 3.07692 6.15475 3.07692H7.38552C7.75475 3.07692 8.0009 2.83077 8.0009 2.46154C8.0009 2.09231 7.75475 1.84616 7.38552 1.84616ZM3.07782 17.2308C3.07782 16.8615 2.83167 16.6154 2.46244 16.6154C2.09321 16.6154 1.84706 16.8615 1.84706 17.2308V18.4615C1.84706 18.8308 2.09321 19.0769 2.46244 19.0769C2.83167 19.0769 3.07783 18.8308 3.07782 18.4615V17.2308ZM3.07782 20.9231C3.07782 20.5539 2.83167 20.3077 2.46244 20.3077C2.09321 20.3077 1.84706 20.5539 1.84706 20.9231V22.1539C1.84706 22.5231 2.09321 22.7692 2.46244 22.7692C2.83167 22.7692 3.07783 22.5231 3.07782 22.1539V20.9231ZM3.07782 9.84616C3.07782 9.47693 2.83167 9.23077 2.46244 9.23077C2.09321 9.23077 1.84706 9.47693 1.84706 9.84616V11.0769C1.84706 11.4462 2.09321 11.6923 2.46244 11.6923C2.83167 11.6923 3.07783 11.4462 3.07782 11.0769V9.84616ZM13.5394 3.07692H14.7701C15.1394 3.07692 15.3855 2.83077 15.3855 2.46154C15.3855 2.09231 15.1394 1.84616 14.7701 1.84616H13.5394C13.1701 1.84616 12.924 2.09231 12.924 2.46154C12.924 2.83077 13.1701 3.07692 13.5394 3.07692ZM2.46244 24C2.09321 24 1.84706 24.2462 1.84706 24.6154V25.8462C1.84706 26.2154 2.09321 26.4615 2.46244 26.4615C2.83167 26.4615 3.07783 26.2154 3.07782 25.8462V24.6154C3.07782 24.2462 2.83167 24 2.46244 24ZM3.07782 13.5385C3.07782 13.1692 2.83167 12.9231 2.46244 12.9231C2.09321 12.9231 1.84706 13.1692 1.84706 13.5385V14.7692C1.84706 15.1385 2.09321 15.3846 2.46244 15.3846C2.83167 15.3846 3.07783 15.1385 3.07782 14.7692V13.5385ZM20.924 3.07692H22.1548C22.524 3.07692 22.7701 2.83077 22.7701 2.46154C22.7701 2.09231 22.524 1.84616 22.1548 1.84616H20.924C20.5548 1.84616 20.3086 2.09231 20.3086 2.46154C20.3086 2.83077 20.5548 3.07692 20.924 3.07692ZM28.924 20.9231C28.924 21.2923 29.1701 21.5385 29.5394 21.5385C29.9086 21.5385 30.1548 21.2923 30.1548 20.9231V19.6923C30.1548 19.3231 29.9086 19.0769 29.5394 19.0769C29.1701 19.0769 28.924 19.3231 28.924 19.6923V20.9231ZM29.5394 10.4615C29.9086 10.4615 30.1548 10.2154 30.1548 9.84616V8.61539C30.1548 8.24616 29.9086 8 29.5394 8C29.1701 8 28.924 8.24616 28.924 8.61539V9.84616C28.924 10.2154 29.1701 10.4615 29.5394 10.4615ZM28.924 17.2308C28.924 17.6 29.1701 17.8462 29.5394 17.8462C29.9086 17.8462 30.1548 17.6 30.1548 17.2308V16C30.1548 15.6308 29.9086 15.3846 29.5394 15.3846C29.1701 15.3846 28.924 15.6308 28.924 16V17.2308ZM28.924 24.6154C28.924 24.9846 29.1701 25.2308 29.5394 25.2308C29.9086 25.2308 30.1548 24.9846 30.1548 24.6154V23.3846C30.1548 23.0154 29.9086 22.7692 29.5394 22.7692C29.1701 22.7692 28.924 23.0154 28.924 23.3846V24.6154ZM9.84706 3.07692H11.0778C11.4471 3.07692 11.6932 2.83077 11.6932 2.46154C11.6932 2.09231 11.4471 1.84616 11.0778 1.84616H9.84706C9.47783 1.84616 9.23167 2.09231 9.23167 2.46154C9.23167 2.83077 9.47783 3.07692 9.84706 3.07692ZM17.2317 28.9231H16.0009C15.6317 28.9231 15.3855 29.1692 15.3855 29.5385C15.3855 29.9077 15.6317 30.1539 16.0009 30.1539H17.2317C17.6009 30.1539 17.8471 29.9077 17.8471 29.5385C17.8471 29.1692 17.6009 28.9231 17.2317 28.9231ZM20.924 28.9231H19.6932C19.324 28.9231 19.0778 29.1692 19.0778 29.5385C19.0778 29.9077 19.324 30.1539 19.6932 30.1539H20.924C21.2932 30.1539 21.5394 29.9077 21.5394 29.5385C21.5394 29.1692 21.2932 28.9231 20.924 28.9231ZM24.6163 28.9231H23.3855C23.0163 28.9231 22.7701 29.1692 22.7701 29.5385C22.7701 29.9077 23.0163 30.1539 23.3855 30.1539H24.6163C24.9855 30.1539 25.2317 29.9077 25.2317 29.5385C25.2317 29.1692 24.9855 28.9231 24.6163 28.9231ZM17.2317 3.07692H18.4624C18.8317 3.07692 19.0778 2.83077 19.0778 2.46154C19.0778 2.09231 18.8317 1.84616 18.4624 1.84616H17.2317C16.8624 1.84616 16.6163 2.09231 16.6163 2.46154C16.6163 2.83077 16.8624 3.07692 17.2317 3.07692ZM28.924 13.5385C28.924 13.9077 29.1701 14.1538 29.5394 14.1538C29.9086 14.1538 30.1548 13.9077 30.1548 13.5385V12.3077C30.1548 11.9385 29.9086 11.6923 29.5394 11.6923C29.1701 11.6923 28.924 11.9385 28.924 12.3077V13.5385ZM25.8471 1.84616H24.6163C24.2471 1.84616 24.0009 2.09231 24.0009 2.46154C24.0009 2.83077 24.2471 3.07692 24.6163 3.07692H25.8471C26.2163 3.07692 26.4624 2.83077 26.4624 2.46154C26.4624 2.09231 26.2163 1.84616 25.8471 1.84616ZM17.6624 24V10.7692H22.7701V8H9.23167V10.7692H14.4624V24H17.6624ZM1.23167 4.61539H3.69321C4.18552 4.61539 4.61629 4.18462 4.61629 3.69231V1.23077C4.61629 0.738463 4.18552 0.307693 3.69321 0.307693H1.23167C0.739363 0.307693 0.308594 0.738463 0.308594 1.23077V3.69231C0.308594 4.18462 0.739363 4.61539 1.23167 4.61539ZM30.7701 0.307693H28.3086C27.8163 0.307693 27.3855 0.738463 27.3855 1.23077V3.69231C27.3855 4.18462 27.8163 4.61539 28.3086 4.61539H29.0471C28.9855 4.67692 28.924 4.8 28.924 4.92308V6.15385C28.924 6.52308 29.1701 6.76923 29.5394 6.76923C29.9086 6.76923 30.1548 6.52308 30.1548 6.15385V4.92308C30.1548 4.8 30.0932 4.67692 30.0317 4.61539H30.7701C31.2624 4.61539 31.6932 4.18462 31.6932 3.69231V1.23077C31.6932 0.738463 31.2624 0.307693 30.7701 0.307693ZM30.7701 27.3846H30.1548V27.0769C30.1548 26.7077 29.9086 26.4615 29.5394 26.4615C29.1701 26.4615 28.924 26.7077 28.924 27.0769V27.3846H28.3086C27.8163 27.3846 27.3855 27.8154 27.3855 28.3077V28.9231H27.0778C26.7086 28.9231 26.4624 29.1692 26.4624 29.5385C26.4624 29.9077 26.7086 30.1539 27.0778 30.1539H27.3855V30.7692C27.3855 31.2615 27.8163 31.6923 28.3086 31.6923H30.7701C31.2624 31.6923 31.6932 31.2615 31.6932 30.7692V28.3077C31.6932 27.8154 31.2624 27.3846 30.7701 27.3846Z",fill:"#999999"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_6137_1319",children:jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"})})})]}),LineSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M6.2069 18.6207V21.1034H0V14.8965H6.2069V17.3793H29.7931V14.8965H36V21.1034H29.7931V18.6207H6.2069Z",fill:"#999999"})}),ArrawSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.1875 17.9118L25.1875 11.3857V17.2H0.8125V18.8H25.1875V24.6143L35.1875 17.9118Z",fill:"#999999"})}),ClearSvg=()=>jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.884 12.8993C11.884 13.3639 11.5054 13.7425 11.0408 13.7425H4.96411C4.74038 13.7425 4.52579 13.6537 4.3675 13.4956C4.2092 13.3375 4.12014 13.123 4.11988 12.8993V3.94589H11.884V12.8993ZM5.80735 2.43241C5.80735 2.33553 5.88248 2.25941 5.98035 2.25941H10.0344C10.1323 2.25941 10.2074 2.33553 10.2074 2.43241V2.94053H5.80735V2.43241ZM14.4138 2.94053H11.2128V2.43241C11.2128 1.78391 10.6839 1.25404 10.0344 1.25404H5.98035C5.66807 1.25483 5.3688 1.37923 5.14798 1.60004C4.92717 1.82086 4.80277 2.12013 4.80198 2.43241V2.94053H1.59015C1.45539 2.94053 1.32615 2.99406 1.23086 3.08935C1.13557 3.18464 1.08203 3.31389 1.08203 3.44865C1.08203 3.58341 1.13557 3.71265 1.23086 3.80794C1.32615 3.90323 1.45539 3.95677 1.59015 3.95677H3.10364V12.8993C3.10364 13.9264 3.93699 14.7578 4.96411 14.7578H11.0398C11.284 14.7579 11.5258 14.7099 11.7515 14.6166C11.9771 14.5233 12.1822 14.3864 12.3549 14.2139C12.5277 14.0413 12.6648 13.8364 12.7583 13.6108C12.8519 13.3853 12.9001 13.1435 12.9003 12.8993V3.94589H14.4128C14.6945 3.94589 14.9219 3.71852 14.9219 3.43777C14.9218 3.37159 14.9085 3.30609 14.8827 3.2451C14.857 3.18411 14.8194 3.12886 14.7721 3.08257C14.7248 3.03628 14.6688 2.99987 14.6072 2.97549C14.5457 2.9511 14.4799 2.93921 14.4138 2.94053ZM8.00195 12.2182C8.28271 12.2182 8.51007 11.9908 8.51007 11.71V6.30262C8.51007 6.16786 8.45654 6.03862 8.36125 5.94333C8.26596 5.84804 8.13672 5.7945 8.00195 5.7945C7.86719 5.7945 7.73795 5.84804 7.64266 5.94333C7.54737 6.03862 7.49383 6.16786 7.49383 6.30262V11.71C7.49383 11.9908 7.7212 12.2182 8.00195 12.2182ZM5.63435 12.2182C5.9151 12.2182 6.14247 11.9908 6.14247 11.71V6.30262C6.14247 6.16786 6.08894 6.03862 5.99365 5.94333C5.89836 5.84804 5.76911 5.7945 5.63435 5.7945C5.49959 5.7945 5.37035 5.84804 5.27506 5.94333C5.17977 6.03862 5.12623 6.16786 5.12623 6.30262V11.71C5.13612 11.9908 5.36349 12.2182 5.63435 12.2182ZM10.3696 12.2182C10.6513 12.2182 10.8787 11.9908 10.8787 11.71V6.30262C10.8787 6.23583 10.8655 6.16969 10.8399 6.10798C10.8144 6.04628 10.7769 5.99021 10.7297 5.94298C10.6825 5.89575 10.6264 5.85828 10.5647 5.83272C10.503 5.80716 10.4368 5.79401 10.3701 5.79401C10.3033 5.79401 10.2371 5.80716 10.1754 5.83272C10.1137 5.85828 10.0576 5.89575 10.0104 5.94298C9.96318 5.99021 9.92571 6.04628 9.90015 6.10798C9.87459 6.16969 9.86144 6.23583 9.86144 6.30262V11.71C9.86144 11.9908 10.0888 12.2182 10.3696 12.2182Z"})}),KeyBoard=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M9.83398 4.15039C11.3405 4.15201 12.7852 4.75035 13.8506 5.81543C14.9161 6.88062 15.5156 8.32539 15.5176 9.83203V13.4824H20.4844V9.83594L20.4922 9.55371C20.5632 8.14986 21.152 6.81818 22.1504 5.81934C23.2155 4.75392 24.6596 4.15448 26.166 4.15234C27.6725 4.15384 29.1171 4.75238 30.1826 5.81738C31.2482 6.88257 31.8476 8.32733 31.8496 9.83398L31.8428 10.1152C31.7718 11.5193 31.1832 12.8516 30.1846 13.8506C29.1194 14.9161 27.6746 15.5156 26.168 15.5176H22.5176V20.4844H26.168C27.6743 20.4864 29.1185 21.0862 30.1836 22.1514C31.182 23.1499 31.7714 24.4812 31.8428 25.8848L31.8496 26.167C31.8479 27.6732 31.2494 29.1173 30.1846 30.1826C29.1194 31.2482 27.6746 31.8476 26.168 31.8496L25.8867 31.8428C24.4827 31.7718 23.1503 31.1832 22.1514 30.1846C21.0858 29.1194 20.4864 27.6746 20.4844 26.168V22.5176H15.5176V26.168L15.5098 26.4502C15.4383 27.8537 14.849 29.1851 13.8506 30.1836C12.7855 31.2486 11.3412 31.8466 9.83496 31.8486C8.32824 31.8474 6.88316 31.2496 5.81738 30.1846C4.75165 29.1194 4.15238 27.6748 4.15039 26.168L4.15723 25.8867C4.22817 24.4827 4.81682 23.1503 5.81543 22.1514C6.81394 21.1525 8.14594 20.5637 9.5498 20.4922L9.83203 20.4844H13.4824V15.5176H9.83594L9.55371 15.5098C8.14943 15.4392 6.81665 14.8511 5.81738 13.8525C4.75158 12.7874 4.15253 11.3427 4.15039 9.83594C4.15139 8.32878 4.74997 6.88336 5.81543 5.81738C6.81442 4.81806 8.14719 4.22829 9.55176 4.15723L9.83398 4.15039ZM9.68555 22.5225C7.74117 22.6014 6.18669 24.2064 6.18652 26.168C6.18652 28.1818 7.82394 29.8193 9.83594 29.8193C11.8497 29.8191 13.4863 28.1817 13.4863 26.168V22.5176H9.68555V22.5225ZM22.5176 26.168C22.5176 28.1817 24.1542 29.8192 26.168 29.8193C28.182 29.8193 29.8174 28.1817 29.8174 26.168C29.8172 24.1543 28.1799 22.5176 26.168 22.5176H22.5176V26.168ZM15.5176 20.4844H20.4844V15.5195H15.5176V20.4844ZM9.83594 6.18652C7.82195 6.18652 6.18652 7.82412 6.18652 9.83789C6.18673 11.8497 7.82412 13.4863 9.83594 13.4863H13.4863V9.83594C13.4863 7.82405 11.8496 6.18671 9.83594 6.18652ZM26.168 6.18652C24.1543 6.18669 22.5176 7.82404 22.5176 9.83594V13.4863H26.168C28.1818 13.4863 29.8172 11.8495 29.8174 9.83594C29.8174 7.82206 28.1818 6.18652 26.168 6.18652Z",fill:"#999999",stroke:"white",strokeWidth:"0.3"})}),Drawx6=React.forwardRef((e,t)=>{const{height:r="300px",maskTip:n="点击画板进入绘制",value:i,onSave:o,savePngType:a="url",showSaveBtn:s}=e,[l,c]=React.useState(!1),u=React.useRef(null);return React.useImperativeHandle(t,()=>{var e;return{getIsFullScreen:()=>l,getData:null==(e=u.current)?void 0:e.getData}}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Show,{height:r,value:i,maskTip:n,maskClick:()=>{c(!0)}}),l&&jsxRuntimeExports.jsx(Editor,{ref:u,value:i,savePngType:a,editabled:!0,onSave:o,onExit:()=>{c(!1)},showSaveBtn:s})]})}),Draw=e=>{const{status:t=QuestionStatus.EXAM,data:r,onSubmit:n}=e,[i,o]=React.useState(),a=React.useRef(null),s=(e,i=!0)=>{if("exam"!==t)return;const a={userAnswerOption:{content:null==e?void 0:e.json,photo:null==e?void 0:e.png},questionCode:null==r?void 0:r.questionCode};o(null==e?void 0:e.json),null==n||n(a),i&&staticMethods.success("保存成功")};return React.useEffect(()=>{if("exam"!==t)return;const e=async e=>{var t,r;const{type:n}=e.data??{};if("examTimeEnd5"===n&&(null==(t=a.current)?void 0:t.getIsFullScreen())){const e=await(null==(r=a.current)?void 0:r.getData());s(e,!1)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t]),React.useEffect(()=>{if(r){const{answerOption:e}=r;e&&!Array.isArray(e)&&o(null==e?void 0:e.content)}},[r,t]),jsxRuntimeExports.jsxs("div",{className:"draw-question",children:[jsxRuntimeExports.jsx("div",{className:"draw-question-title",children:jsxRuntimeExports.jsxs("div",{className:"draw-question-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("span",{className:"score",children:[null==r?void 0:r.score,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"画图题"}),((null==r?void 0:r.hasAutoScore)??(null==r?void 0:r.judgeMode)===CCMJudgeMode.AI_AGENT)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:null==r?void 0:r.topic,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"draw-question-content",children:[jsxRuntimeExports.jsx(Drawx6,{ref:a,value:i,showSaveBtn:"mark"!==t&&"view"!==t,onSave:s,maskTip:"mark"===t||"view"===t?"点击画板查看答题":"点击画板进入答题"}),["add","mark"].includes(t)&&!!(null==r?void 0:r.judgeNorm)&&jsxRuntimeExports.jsx(Collapse,{defaultActiveKey:"add"===t?["1"]:[],ghost:!0,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$i,{rotate:e?90:0}),items:[{key:"1",label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{style:{fontWeight:"bold"},children:"判分标准"}),jsxRuntimeExports.jsx("span",{style:{fontSize:"12px",color:"#999999"},children:"(学生不可见)"})]}),children:jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,readOnly:!0,defaultValue:r.judgeNorm,noPadding:!0,autoHeight:{min:0,max:1e4}})}]}),r.difficulty&&jsxRuntimeExports.jsx("div",{className:"draw-question-content-others",children:jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[r.difficulty]})]})})]})]},null==r?void 0:r.questionCode)},Composite=e=>{var t;const{data:r}=e,{children:n,difficulty:i,topic:o,score:a}=r,[s,l]=React.useState([]),c=React.useRef(null);return React.useEffect(()=>{const e=null==n?void 0:n.map((e,t)=>(null==e?void 0:e.questionCode)||t);l(e)},[null==(t=null==r?void 0:r.children)?void 0:t.length]),jsxRuntimeExports.jsxs("div",{className:"composite",children:[jsxRuntimeExports.jsx("div",{className:"composite-title",children:jsxRuntimeExports.jsxs("div",{className:"composite-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[a&&jsxRuntimeExports.jsxs("span",{className:"score",children:[a,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"组合题"}),(null==r?void 0:r.hasAutoScore)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:o,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"composite-content",children:[jsxRuntimeExports.jsx(Collapse,{activeKey:s,ghost:!0,ref:c,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$i,{rotate:e?90:0}),onChange:e=>{l(Array.isArray(e)?e:[e])},items:null==n?void 0:n.map((e,t)=>({key:(null==e?void 0:e.questionCode)||t,label:`第${t+1}小题(${questionTypesMap[null==e?void 0:e.type]})`,children:jsxRuntimeExports.jsx(QuestionRender,{data:e})}))}),jsxRuntimeExports.jsx("div",{className:"composite-content-others",children:i&&jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[i]})]})})]})]})},QuestionRender=React.forwardRef((e,t)=>{const{data:r,questionProps:n={},listeners:i}=e,{onSubmit:o,onNextQuestion:a,editable:s=!1,deleteable:l=!1,onDelete:c=()=>{},onEditOk:u=()=>{},buttonText:d="",showQuestionTip:p=!1,langList:h,showResult:f,status:g=QuestionStatus.PREVIEW,className:m="",styles:v={},uploadImg:y,codeTestURL:b,codeplayerURL:q,rightTopButtonArr:S,unknowQesutionRender:E,QuestionTopRender:V,QuestionBottomRender:C,onlyAdd:T,toRunCodeQuestion:A}=n,[x,R]=React.useState(!1),[w,k]=React.useState(!0),[N,_]=React.useState(!1),[O,I]=React.useState(""),P=React.useMemo(()=>{const e={...r},{optionJson:t,type:n}=r;return!t||n!==QuestionTypeEnum.ACM&&n!==QuestionTypeEnum.CCM||(e.lang=null==t?void 0:t.defaultLanguage),e},[r]);React.useImperativeHandle(t,()=>({setEditShow:e=>R(e),setShowOperateButton:k,addQuestion:()=>{_(!0)}}));const[D,F]=React.useState((e=>{switch(e){case QuestionTypeEnum.RADIO:return"";case QuestionTypeEnum.CHECKBOX:return[];case QuestionTypeEnum.ANSWER:case QuestionTypeEnum.JUDGE:return"";case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return{code:"",language:"javascript"};case QuestionTypeEnum.COMPLETION:return[];case QuestionTypeEnum.DRAW:case QuestionTypeEnum.COMPOSITE:return{};default:return null}})(P.type)),L=e=>jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:y}},children:jsxRuntimeExports.jsxs("div",{className:`question-wrapper ${m}`,style:{...v},children:[w&&jsxRuntimeExports.jsxs("div",{className:"operate-area",children:[s&&jsxRuntimeExports.jsx(Tooltip,{title:"编辑",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$a,{}),onClick:()=>R(!0)},"edit")}),l&&jsxRuntimeExports.jsx(Tooltip,{title:"删除",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$e,{}),onClick:()=>c(P)},"delete")}),(null==S?void 0:S.length)&&S.map(e=>{const{text:r,icon:n,needBindRef:o}=e,a={...e};return delete a.needBindRef,jsxRuntimeExports.jsx(Tooltip,{title:r,children:React.createElement(Button$1,{...a,ref:o?t:null,size:"small",key:r??(null==n?void 0:n.toString()),"data-cypress":o?"draggable-handle":"",...o?i:{}})},r??(null==n?void 0:n.toString()))})]}),V&&V(P),e,C&&C(P)]})}),U={data:P,onSubmit:o,buttonText:d,status:g,onNextQuestion:a};if(T)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:y}},children:N&&jsxRuntimeExports.jsx(Modal,{style:{top:"40%"},open:N,footer:null,title:"请选择题型",width:300,onCancel:()=>{_(!1),I("")},children:jsxRuntimeExports.jsx(Select,{style:{width:"100%"},placeholder:"请选择",onChange:e=>{_(!1),I(e),R(!0)},options:questionTypeSelectOptions})})})});switch(P.type){case QuestionTypeEnum.RADIO:case QuestionTypeEnum.CHECKBOX:return(()=>{const e=jsxRuntimeExports.jsx(ChoiceQuestion,{showQuestionTip:p,showResult:f,...U});return L(e)})();case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return(()=>{const e=jsxRuntimeExports.jsx(Preview,{codeTestURL:b,codeplayerURL:q,toRunCodeQuestion:A,...U});return L(e)})();case QuestionTypeEnum.COMPLETION:return(()=>{const e=jsxRuntimeExports.jsx(Completion,{showResult:f,...U});return L(e)})();case QuestionTypeEnum.ANSWER:return(()=>{const e=jsxRuntimeExports.jsx(AnswerQuestion,{...U});return L(e)})();case QuestionTypeEnum.DRAW:return(()=>{const e=jsxRuntimeExports.jsx(Draw,{...U});return L(e)})();case QuestionTypeEnum.COMPOSITE:return(()=>{const e=jsxRuntimeExports.jsx(Composite,{...U});return L(e)})();default:return E?E(P):jsxRuntimeExports.jsx("div",{children:"未知题型"})}}),useQuestionRender=()=>{const e=React.useRef(null);return{ref:e,setEditShow:t=>{var r,n;return null==(n=null==(r=e.current)?void 0:r.setEditShow)?void 0:n.call(r,t)},setShowOperateButton:t=>{var r,n;return null==(n=null==(r=e.current)?void 0:r.setShowOperateButton)?void 0:n.call(r,t)}}};function _getDefaults(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let _defaults=_getDefaults();function changeDefaults(e){_defaults=e}const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},getEscapeReplacement=e=>escapeReplacements[e];function escape$1(e,t){if(t){if(escapeTest.test(e))return e.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(e))return e.replace(escapeReplaceNoEncode,getEscapeReplacement);return e}const caret=/(^|[^\[])\^/g;function edit(e,t){let r="string"==typeof e?e:e.source;t=t||"";const n={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(caret,"$1"),r=r.replace(e,i),n},getRegex:()=>new RegExp(r,t)};return n}function cleanUrl(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const noopTest={exec:()=>null};function splitCells(e,t){const r=e.replace(/\|/g,(e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"}).split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function rtrim(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){if(e.charAt(n-i-1)!==t)break;i++}return e.slice(0,n-i)}function findClosingBracket(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}function outputLink(e,t,r,n){const i=t.href,o=t.title?escape$1(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:i,title:o,text:escape$1(a)}}function indentCodeCompensation(e,t){const r=e.match(/^(\s+)(?:```)/);if(null===r)return t;const n=r[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e}).join("\n")}class _Tokenizer{constructor(e){__publicField(this,"options"),__publicField(this,"rules"),__publicField(this,"lexer"),this.options=e||_defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rtrim(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=indentCodeCompensation(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=rtrim(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:rtrim(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=rtrim(t[0],"\n").split("\n"),r="",n="";const i=[];for(;e.length>0;){let t=!1;const o=[];let a;for(a=0;a<e.length;a++)if(/^ {0,3}>/.test(e[a]))o.push(e[a]),t=!0;else{if(t)break;o.push(e[a])}e=e.slice(a);const s=o.join("\n"),l=s.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");r=r?`${r}\n${s}`:s,n=n?`${n}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;const u=i[i.length-1];if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,o=t.raw+"\n"+e.join("\n"),a=this.blockquote(o);i[i.length-1]=a,r=r.substring(0,r.length-t.raw.length)+a.raw,n=n.substring(0,n.length-t.text.length)+a.text;break}if("list"===(null==u?void 0:u.type)){const t=u,o=t.raw+"\n"+e.join("\n"),a=this.list(o);i[i.length-1]=a,r=r.substring(0,r.length-u.raw.length)+a.raw,n=n.substring(0,n.length-t.raw.length)+a.raw,e=o.substring(i[i.length-1].raw.length).split("\n");continue}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a=!1;for(;e;){let r=!1,n="",s="";if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let l=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,s=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(/[^ ]/),d=d>4?1:d,s=l.slice(d),d+=t[1].length),u&&/^ *$/.test(c)&&(n+=c+"\n",e=e.substring(c.length+1),r=!0),!r){const t=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(r.test(e))break;if(c.search(/[^ ]/)>=d||!c.trim())s+="\n"+c.slice(d);else{if(u)break;if(l.search(/[^ ]/)>=4)break;if(i.test(l))break;if(o.test(l))break;if(r.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),n+=a+"\n",e=e.substring(a.length+1),l=c.slice(d)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(n)&&(a=!0));let p,h=null;this.options.gfm&&(h=/^\[[ xX]\] /.exec(s),h&&(p="[ ] "!==h[0],s=s.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:n,task:!!h,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=n}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter(e=>"space"===e.type),r=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const r=splitCells(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const e of n)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(const e of i)o.rows.push(splitCells(e,o.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:escape$1(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=rtrim(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=findClosingBracket(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),outputLink(t,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const e=t[(r[2]||r[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return outputLink(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n)return;if(n[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const r=[...n[0]].length-1;let i,o,a=r,s=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){s+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+s);const t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=escape$1(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=escape$1(t[1]),r="mailto:"+e):(e=escape$1(t[1]),r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){var t;let r;if(r=this.rules.inline.url.exec(e)){let e,n;if("@"===r[2])e=escape$1(r[0]),n="mailto:"+e;else{let i;do{i=r[0],r[0]=(null==(t=this.rules.inline._backpedal.exec(r[0]))?void 0:t[0])??""}while(i!==r[0]);e=escape$1(r[0]),n="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:escape$1(t[0]),{type:"text",raw:t[0],text:e}}}}const newline=/^(?: *(?:\n|$))+/,blockCode=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bullet=/(?:[*+-]|\d{1,9}[.)])/,lheading=edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,bullet).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),_paragraph=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,blockText=/^[^\n]+/,_blockLabel=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def=edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",_blockLabel).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list=edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet).getRegex(),_tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,html$3=edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",_comment).replace("tag",_tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph=edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockquote=edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph).getRegex(),blockNormal={blockquote:blockquote,code:blockCode,def:def,fences:fences,heading:heading,hr:hr,html:html$3,lheading:lheading,list:list,newline:newline,paragraph:paragraph,table:noopTest,text:blockText},gfmTable=edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockGfm={...blockNormal,table:gfmTable,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex()},blockPedantic={...blockNormal,html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",lheading).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,inlineCode=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,inlineText=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_punctuation="\\p{P}\\p{S}",punctuation=edit(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,_punctuation).getRegex(),blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,emStrongLDelim=edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,_punctuation).getRegex(),emStrongRDelimAst=edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,_punctuation).getRegex(),emStrongRDelimUnd=edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,_punctuation).getRegex(),anyPunctuation=edit(/\\([punct])/,"gu").replace(/punct/g,_punctuation).getRegex(),autolink=edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),_inlineComment=edit(_comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),tag=edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_inlineComment).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link=edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_inlineLabel).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink=edit(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel).replace("ref",_blockLabel).getRegex(),nolink=edit(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel).getRegex(),reflinkSearch=edit("reflink|nolink(?!\\()","g").replace("reflink",reflink).replace("nolink",nolink).getRegex(),inlineNormal={_backpedal:noopTest,anyPunctuation:anyPunctuation,autolink:autolink,blockSkip:blockSkip,br:br,code:inlineCode,del:noopTest,emStrongLDelim:emStrongLDelim,emStrongRDelimAst:emStrongRDelimAst,emStrongRDelimUnd:emStrongRDelimUnd,escape:escape$2,link:link,nolink:nolink,punctuation:punctuation,reflink:reflink,reflinkSearch:reflinkSearch,tag:tag,text:inlineText,url:noopTest},inlinePedantic={...inlineNormal,link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel).getRegex()},inlineGfm={...inlineNormal,escape:edit(escape$2).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},inlineBreaks={...inlineGfm,br:edit(br).replace("{2,}","*").getRegex(),text:edit(inlineGfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},block={normal:blockNormal,gfm:blockGfm,pedantic:blockPedantic},inline={normal:inlineNormal,gfm:inlineGfm,breaks:inlineBreaks,pedantic:inlinePedantic};class _Lexer{constructor(e){__publicField(this,"tokens"),__publicField(this,"options"),__publicField(this,"state"),__publicField(this,"tokenizer"),__publicField(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_defaults,this.options.tokenizer=this.options.tokenizer||new _Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:block.normal,inline:inline.normal};this.options.pedantic?(t.block=block.pedantic,t.inline=inline.pedantic):this.options.gfm&&(t.block=block.gfm,this.options.breaks?t.inline=inline.breaks:t.inline=inline.gfm),this.tokenizer.rules=t}static get rules(){return{block:block,inline:inline}}static lex(e,t){return new _Lexer(t).lex(e)}static lexInline(e,t){return new _Lexer(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){let n,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(e,t,r)=>t+" ".repeat(r.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?t.push(n):(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startBlock.forEach(e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))i=t[t.length-1],r&&"paragraph"===(null==i?void 0:i.type)?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,i,o,a,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,s))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startInline.forEach(e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}}class _Renderer{constructor(e){__publicField(this,"options"),__publicField(this,"parser"),this.options=e||_defaults}space(e){return""}code({text:e,lang:t,escaped:r}){var n;const i=null==(n=(t||"").match(/^\S*/))?void 0:n[0],o=e.replace(/\n$/,"")+"\n";return i?'<pre><code class="language-'+escape$1(i)+'">'+(r?o:escape$1(o,!0))+"</code></pre>\n":"<pre><code>"+(r?o:escape$1(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,r=e.start;let n="";for(let o=0;o<e.items.length;o++){const t=e.items[o];n+=this.listitem(t)}const i=t?"ol":"ul";return"<"+i+(t&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+i+">\n"}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",r="";for(let i=0;i<e.header.length;i++)r+=this.tablecell(e.header[i]);t+=this.tablerow({text:r});let n="";for(let i=0;i<e.rows.length;i++){const t=e.rows[i];r="";for(let e=0;e<t.length;e++)r+=this.tablecell(t[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),i=cleanUrl(e);if(null===i)return n;let o='<a href="'+(e=i)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r}){const n=cleanUrl(e);if(null===n)return r;let i=`<img src="${e=n}" alt="${r}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class _TextRenderer{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class _Parser{constructor(e){__publicField(this,"options"),__publicField(this,"renderer"),__publicField(this,"textRenderer"),this.options=e||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _TextRenderer}static parse(e,t){return new _Parser(t).parse(e)}static parseInline(e,t){return new _Parser(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}const o=i;switch(o.type){case"space":r+=this.renderer.space(o);continue;case"hr":r+=this.renderer.hr(o);continue;case"heading":r+=this.renderer.heading(o);continue;case"code":r+=this.renderer.code(o);continue;case"table":r+=this.renderer.table(o);continue;case"blockquote":r+=this.renderer.blockquote(o);continue;case"list":r+=this.renderer.list(o);continue;case"html":r+=this.renderer.html(o);continue;case"paragraph":r+=this.renderer.paragraph(o);continue;case"text":{let i=o,a=this.renderer.text(i);for(;n+1<e.length&&"text"===e[n+1].type;)i=e[++n],a+="\n"+this.renderer.text(i);r+=t?this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a}]}):a;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}const o=i;switch(o.type){case"escape":case"text":r+=t.text(o);break;case"html":r+=t.html(o);break;case"link":r+=t.link(o);break;case"image":r+=t.image(o);break;case"strong":r+=t.strong(o);break;case"em":r+=t.em(o);break;case"codespan":r+=t.codespan(o);break;case"br":r+=t.br(o);break;case"del":r+=t.del(o);break;default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return r}}class _Hooks{constructor(e){__publicField(this,"options"),this.options=e||_defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}__publicField(_Hooks,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Marked{constructor(...e){__publicField(this,"defaults",_getDefaults()),__publicField(this,"options",this.setOptions),__publicField(this,"parse",this.parseMarkdown(_Lexer.lex,_Parser.parse)),__publicField(this,"parseInline",this.parseMarkdown(_Lexer.lexInline,_Parser.parseInline)),__publicField(this,"Parser",_Parser),__publicField(this,"Renderer",_Renderer),__publicField(this,"TextRenderer",_TextRenderer),__publicField(this,"Lexer",_Lexer),__publicField(this,"Tokenizer",_Tokenizer),__publicField(this,"Hooks",_Hooks),this.use(...e)}walkTokens(e,t){var r,n;let i=[];for(const o of e)switch(i=i.concat(t.call(this,o)),o.type){case"table":{const e=o;for(const r of e.header)i=i.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=o;i=i.concat(this.walkTokens(e.items,t));break}default:{const e=o;(null==(n=null==(r=this.defaults.extensions)?void 0:r.childTokens)?void 0:n[e.type])?this.defaults.extensions.childTokens[e.type].forEach(r=>{const n=e[r].flat(1/0);i=i.concat(this.walkTokens(n,t))}):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){const t=this.defaults.renderer||new _Renderer(this.defaults);for(const r in e.renderer){if(!(r in t))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,i=e.renderer[n],o=t[n];t[n]=(...e)=>{let r=i.apply(t,e);return!1===r&&(r=o.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const r in e.tokenizer){if(!(r in t))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,i=e.tokenizer[n],o=t[n];t[n]=(...e)=>{let r=i.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new _Hooks;for(const r in e.hooks){if(!(r in t))throw new Error(`hook '${r}' does not exist`);if("options"===r)continue;const n=r,i=e.hooks[n],o=t[n];_Hooks.passThroughHooks.has(r)?t[n]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>o.call(t,e));const r=i.call(t,e);return o.call(t,r)}:t[n]=(...e)=>{let r=i.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _Lexer.lex(e,t??this.defaults)}parser(e,t){return _Parser.parse(e,t??this.defaults)}parseMarkdown(e,t){return(r,n)=>{const i={...n},o={...this.defaults,...i},a=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(t=>e(t,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>t(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let n=e(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e10){return a(e10)}}}onError(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+escape$1(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}}const markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;const CodePlayer$1=React.forwardRef((e,t)=>{const{envStatus:r,podName:n,runnerBaseUrl:i}=React.useContext(KnowledgeCardContext),{data:o,hasTitle:a=!0,toScore:s,errorHanle:l,codeChange:c}=e,u=React.useRef(null),[d,p]=React.useState(!0),[h,f]=React.useState(!1),g=debounce$2(e=>{null==c||c(e.code)}),m=React.useRef(null);return React.useEffect(()=>(f(!1),p(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{f(!0)},1e3),()=>{m.current&&clearTimeout(m.current)}),[o]),React.useImperativeHandle(t,()=>({toInstallPackage:e=>{var t,r;(null==(t=u.current)?void 0:t.contentWindow)&&postRobot.send(null==(r=u.current)?void 0:r.contentWindow,"vgenPackages",{packages:e})}})),jsxRuntimeExports.jsx(Spin,{spinning:d,children:jsxRuntimeExports.jsx("div",{className:"codePlayer",children:jsxRuntimeExports.jsx("div",{className:"codePlayerContent",style:{height:a?"":"100%"},children:h&&jsxRuntimeExports.jsx("iframe",{ref:u,allowFullScreen:!0,allow:"clipboard-write;clipboard-read",src:`${i||"https://run.cloudlab.top"}/embedded?fromVgen=true`,style:{border:"none"},title:"CodeRunner",className:"CodeRunner-iframe",onLoad:async()=>{var e,t,i,a;try{p(!1);const d=null==(e=u.current)?void 0:e.contentWindow,{topic:h="",content:f="",lang:m="",code:v="",cases:y=[]}=o;let b=f;try{b=marked.parse(f)}catch(c){}let q=[];if("html"===m)try{const e=JSON.parse(v);q=[e.html,e.css,e.js]}catch(c){}let S={...o};const E={title:h,content:b,lang:m,code:"html"===m?q:v,aiEnabled:!1,run:!1,cases:y,customButtons:s?[{name:"提交",value:"submit",style:{background:"#0064ff",color:"#ffffff"}}]:[]};r&&n&&(E.podName=n,E.nameSpace="pty-prod"),postRobot.send(d,"send",E),s&&postRobot.on("submit",{window:d},async function(e){var t,r;(null==(t=e.data)?void 0:t.code)?(staticMethods.success("提交成功,AI开始自动评分..."),s(null==(r=e.data)?void 0:r.code)):staticMethods.warning("请先作答!")}),postRobot.on("change",{window:null==(t=u.current)?void 0:t.contentWindow},async function(e){var t,r,n,i,o;if("html"===m)try{const i={html:(null==(t=e.data)?void 0:t[0])??"",css:(null==(r=e.data)?void 0:r[1])??"",js:(null==(n=e.data)?void 0:n[2])??""};S.code=JSON.stringify(i)}catch(c){S.code=(null==(i=e.data)?void 0:i[0])??""}else S.code=(null==(o=e.data)?void 0:o[0])??"";g(S)}),postRobot.on("errorHandle",{window:null==(i=u.current)?void 0:i.contentWindow},async function(e){var t,r,n;null==l||l({lang:null==(t=e.data)?void 0:t.lang,code:null==(r=e.data)?void 0:r.code,error:null==(n=e.data)?void 0:n.error})}),postRobot.on("getToken",{window:null==(a=u.current)?void 0:a.contentWindow},async e=>({token:localStorage.getItem("token")}))}catch(c){}}})})})})}),CodePlayer=e=>{const{data:t,hasTitle:r=!0,toScore:n,codeChange:i}=e,{quizBaseUrl:o}=React.useContext(KnowledgeCardContext),a=React.useRef(null),[s,l]=React.useState(!0),[c,u]=React.useState(!1),d=debounce$2(e=>{null==i||i(e.code)}),p=React.useRef(null);return React.useEffect(()=>(u(!1),l(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{u(!0)},1e3),()=>{p.current&&clearTimeout(p.current)}),[t]),jsxRuntimeExports.jsx(Spin,{spinning:s,children:jsxRuntimeExports.jsxs("div",{className:"codeQuiz",children:[r&&jsxRuntimeExports.jsx("div",{className:"codeQuizTitle",children:"CodeQuiz"}),jsxRuntimeExports.jsx("div",{className:"codeQuizContent",style:{height:r?"":"100%"},children:c&&jsxRuntimeExports.jsx("iframe",{ref:a,allowFullScreen:!0,allow:"clipboard-write;clipboard-read",src:`${o||"https://quiz.cloudlab.top"}`,style:{border:"none"},title:"CodeQuiz",className:"codeQuiz-iframe",onLoad:async()=>{var e,r,i;try{l(!1);const s=null==(e=a.current)?void 0:e.contentWindow,{topic:c="",content:u="",lang:p="",code:h="",cases:f=[]}=t;let g=f;g=f.map(e=>"string"==typeof e.input?{...e,input:tryParseJSON(e.input)||[]}:{...e});let m=u;try{m=marked.parse(u)}catch(o){}let v={...t};postRobot.send(s,"send",{title:c,content:m,lang:p,code:h,cases:g,aiEnabled:!1,run:!1,customButtons:n?[{name:"判分",value:"submit",style:{background:"#0064ff",color:"#ffffff"}}]:[]}),n&&postRobot.on("submit",{window:s},async function(e){var t,r;(null==(t=e.data)?void 0:t.code)?(staticMethods.success("提交成功,AI开始自动评分..."),n(null==(r=e.data)?void 0:r.code)):staticMethods.warning("请先作答!")}),postRobot.on("change",{window:null==(r=a.current)?void 0:r.contentWindow},async function(e){var t,r,n,i;if("html"===p)try{const i={html:(null==(t=e.data)?void 0:t[0])??"",css:(null==(r=e.data)?void 0:r[1])??"",js:(null==(n=e.data)?void 0:n[2])??""};v.code=JSON.stringify(i)}catch(o){v.code=(null==(i=e.data)?void 0:i[0])??""}else v.code=e.data??"";d(v)}),postRobot.on("getToken",{window:null==(i=a.current)?void 0:i.contentWindow},async e=>({token:localStorage.getItem("token")}))}catch(o){}}})})]})})},warnSvg="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='18px'%20height='18px'%20viewBox='0%200%2018%2018'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e注意%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='解析合集'%20transform='translate(-347.000000,%20-127.000000)'%20fill-rule='nonzero'%3e%3cg%20id='编组-5'%20transform='translate(347.000000,%20125.000000)'%3e%3cg%20id='注意'%20transform='translate(0.000000,%202.000000)'%3e%3cpath%20d='M0,9%20C0,12.2153903%201.71539025,15.1865334%204.5,16.7942286%20C7.28460967,18.4019238%2010.7153903,18.4019238%2013.5,16.7942286%20C16.2846097,15.1865334%2018,12.2153903%2018,9%20C18,4.02943722%2013.9705627,0%209,0%20C4.02943725,0%200,4.02943722%200,9%20Z'%20id='路径'%20fill='%230064FF'%3e%3c/path%3e%3cpath%20d='M9,13.090909%20C9.29230822,13.090909%209.56241216,13.2468535%209.70856628,13.4999999%20C9.8547204,13.7531462%209.8547204,14.0650354%209.70856628,14.3181817%20C9.56241216,14.5713281%209.29230822,14.7272726%209,14.7272726%20C8.54813066,14.7272726%208.18181818,14.3609601%208.18181818,13.9090908%20C8.18181818,13.4572215%208.54813066,13.090909%209,13.090909%20L9,13.090909%20Z%20M9,3.27272725%20C9.45186934,3.27272725%209.81818182,3.63903972%209.81818182,4.09090906%20L9.81818182,11.0454545%20C9.81818182,11.4973238%209.45186934,11.8636363%209,11.8636363%20C8.54813066,11.8636363%208.18181818,11.4973238%208.18181818,11.0454545%20L8.18181818,4.09090906%20C8.18181818,3.63903972%208.54813066,3.27272725%209,3.27272725%20L9,3.27272725%20Z'%20id='形状'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",VgenModal=e=>{const{title:t,content:r,cancelText:n,okText:i,onOk:o,onCancel:a,onCancelCallback:s,footer:l=!0,contentType:c="center",noIcon:u=!1,blackMode:d=!1}=e;return jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs(Modal,{...e,title:null,footer:null,classNames:{container:classNames("vgenModal","left"===c&&"modalLeft",d&&"blackMode")},className:classNames("modalWrapper",d&&"blackMode"),children:[jsxRuntimeExports.jsxs("div",{className:classNames("modalContent","center"===c&&"modalContentCenter"),children:[t&&jsxRuntimeExports.jsxs("div",{className:classNames("modalTitle","left"===c&&"modalTitleLeft"),children:[!u&&jsxRuntimeExports.jsx("img",{src:warnSvg}),t]}),jsxRuntimeExports.jsx("div",{className:classNames("modalContentText","center"===c&&"modalContentTextCenter"),children:r})]}),l&&jsxRuntimeExports.jsxs("div",{className:classNames("modalFooter",d&&"blackMode"),children:[jsxRuntimeExports.jsx(Button$1,{type:"primary",className:classNames("btnOk",d&&"blackMode"),onClick:o,children:i}),jsxRuntimeExports.jsx(Button$1,{className:classNames("btnCancel",d&&"blackMode"),onClick:()=>{null==a||a(),null==s||s()},children:n})]})]})})};function QuanPingIcon(e){return jsxRuntimeExports.jsx("svg",{style:e.style,className:e.className,width:e.width||16,height:e.height||16,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2200",children:jsxRuntimeExports.jsx("path",{d:"M256 170.666667a128 128 0 0 0-128 128v213.333333a42.666667 42.666667 0 1 0 85.333333 0V298.666667a42.666667 42.666667 0 0 1 42.666667-42.666667h213.333333a42.666667 42.666667 0 1 0 0-85.333333H256z m512 682.666666a128 128 0 0 0 128-128v-170.666666a42.666667 42.666667 0 1 0-85.333333 0v170.666666a42.666667 42.666667 0 0 1-42.666667 42.666667h-192a42.666667 42.666667 0 1 0 0 85.333333H768z",fill:e.fill||"#2c2c2c","p-id":"2201"})})}function TuiChuQuanPingIcon(e){return jsxRuntimeExports.jsx("svg",{style:e.style,className:e.className,width:e.width||16,height:e.height||16,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2410",children:jsxRuntimeExports.jsx("path",{d:"M384 512a128 128 0 0 0 128-128V170.666667a42.666667 42.666667 0 1 0-85.333333 0v213.333333a42.666667 42.666667 0 0 1-42.666667 42.666667H170.666667a42.666667 42.666667 0 1 0 0 85.333333h213.333333z m277.333333 42.666667a128 128 0 0 0-128 128v170.666666a42.666667 42.666667 0 1 0 85.333334 0v-170.666666a42.666667 42.666667 0 0 1 42.666666-42.666667H853.333333a42.666667 42.666667 0 1 0 0-85.333333h-192z",fill:e.fill||"#2c2c2c","p-id":"2411"})})}function AIAssistantIcon(e){return jsxRuntimeExports.jsx("svg",{style:e.style,className:e.className,width:e.width||16,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5049",children:jsxRuntimeExports.jsx("path",{d:"M492.288 37.632a486.2464 486.2464 0 0 1 202.3936 44.2368 479.9488 479.9488 0 0 1 115.712 75.264 468.48 468.48 0 0 1 99.9936 124.672 458.8032 458.8032 0 0 1 47.104 128.0512 451.5328 451.5328 0 0 1 4.0448 158.4128 42.496 42.496 0 0 1-14.7456 26.7776 42.3936 42.3936 0 0 1-28.5184 10.5472 42.1376 42.1376 0 0 1-30.9248-12.8 42.1376 42.1376 0 0 1-12.288-37.5296 366.08 366.08 0 0 0-7.3728-145.8176 365.1584 365.1584 0 0 0-43.264-101.5808 374.9376 374.9376 0 0 0-71.8848-85.1968 384.5632 384.5632 0 0 0-94.4128-61.3888 393.216 393.216 0 0 0-127.7952-34.4064 398.6944 398.6944 0 0 0-203.8784 34.4064 391.5264 391.5264 0 0 0-94.464 61.44 381.2352 381.2352 0 0 0-71.8336 85.1456 372.0192 372.0192 0 0 0-47.4112 119.5008 365.1584 365.1584 0 0 0 60.8256 285.7472 376.4736 376.4736 0 0 0 50.2784 57.5488l13.0048 12.1344 5.12 109.7728a6.144 6.144 0 0 0 3.072 5.0176 7.8336 7.8336 0 0 0 7.3728 0.768l114.7904-42.5472 13.8752 4.0448a399.9744 399.9744 0 0 0 40.7552 9.5744l7.0656 1.1776 4.4544 0.7168 2.3552 0.3584 7.168 0.9216 3.4304 0.4608 3.8912 0.4096a42.3424 42.3424 0 0 1 27.7504 14.336 42.3424 42.3424 0 0 1 11.1616 29.1328 42.1376 42.1376 0 0 1-12.8 30.9248 42.1376 42.1376 0 0 1-35.7888 12.544l-3.8912-0.4608-4.2496-0.512-8.2944-1.0752-3.3792-0.512-5.2736-0.8192-8.2944-1.3824a489.3696 489.3696 0 0 1-36.2496-7.936l-88.064 32.6144a90.9824 90.9824 0 0 1-85.1968-9.2672c-27.136-17.5616-41.472-42.3424-43.008-74.3936l-3.5328-74.752a467.4048 467.4048 0 0 1-74.0864-97.792 457.5232 457.5232 0 0 1-49.4592-130.9696 451.84 451.84 0 0 1 46.592-311.3472 459.264 459.264 0 0 1 83.1488-109.056A468.3264 468.3264 0 0 1 248.832 103.168 477.952 477.952 0 0 1 399.872 46.4896 484.6592 484.6592 0 0 1 492.3392 37.632z m165.7856 589.2608l79.872 245.1968h-71.168l-15.6672-56.832h-53.4016l-15.7184 56.832H512l77.6192-245.248h68.4544z m166.2464 0v245.248h-67.584v-245.248h67.584z m106.24 31.5904c5.0688 0 8.2432 2.56 9.6768 7.5776l9.984 36.0448c3.7376 13.4656 11.5712 22.272 23.552 26.368l32.6144 11.0592c4.608 1.536 6.9632 4.864 6.9632 9.9328 0 5.12-2.304 8.3968-6.9632 9.984l-32.5632 11.0592c-12.032 4.096-19.8656 12.8512-23.6032 26.368l-9.984 36.0448c-1.4336 5.0688-4.608 7.5776-9.6768 7.5776-5.0176 0-8.192-2.56-9.6256-7.5776l-9.984-36.0448c-3.7376-13.5168-11.6224-22.272-23.6032-26.368l-32.6144-11.0592c-4.608-1.536-6.912-4.864-6.912-9.984 0-5.0688 2.304-8.3968 6.912-9.9328l32.6144-11.0592c11.9808-4.096 19.8656-12.9024 23.552-26.368l10.0352-36.0448c1.3824-5.0688 4.608-7.5776 9.6256-7.5776z m-305.6128 29.4912c-4.9664 19.5072-10.24 38.9632-15.8208 58.368l-4.7104 18.8928h41.0112l-4.7104-18.8928a689.152 689.152 0 0 1-6.7072-24.6272 1065.8816 1065.8816 0 0 0-7.936-29.696 1275.2896 1275.2896 0 0 1-1.1264-4.0448zM343.04 334.336c15.7696 0 29.184 5.5808 40.3968 16.6912 11.1104 11.1616 16.6912 24.576 16.6912 40.3968V460.288c0 15.7696-5.5808 29.2352-16.6912 40.3968-11.1616 11.1616-24.6272 16.6912-40.3968 16.6912-15.7696 0-29.184-5.5296-40.3456-16.6912a54.9888 54.9888 0 0 1-16.7424-40.3968V391.424c0-15.7696 5.5808-29.2352 16.7424-40.3968 11.1104-11.1104 24.576-16.6912 40.3456-16.6912z m318.6688 0c15.7696 0 29.184 5.5808 40.3968 16.6912 11.1104 11.1616 16.6912 24.576 16.6912 40.3968V460.288c0 15.7696-5.5808 29.2352-16.6912 40.3968-11.1616 11.1616-24.576 16.6912-40.3968 16.6912-15.7696 0-29.184-5.5296-40.3456-16.6912a54.9888 54.9888 0 0 1-16.7424-40.3968V391.424c0-15.7696 5.632-29.2352 16.7424-40.3968 11.1616-11.1104 24.576-16.6912 40.3456-16.6912z",fill:e.fill||"#2c2c2c","p-id":"5050"})})}const QuestionPractice=({questionsList:e,questionOperations:t,submitQuestion:r,getCodeSaveAnswer:n,createQuestionCallback:i,saveQuetionCode:o,temScoreData:a,scoreData:s,problemSloving:l,createQuestionLoading:c,createQuestionLoadingText:u,toRunCodeQuestionCallback:d,runCodeErrorCallback:p,mode:h})=>{var f,g,m,v,y;const[b,q]=React.useState(0),[S,E]=React.useState(!1),[V,C]=React.useState(),[T,A]=React.useState(),[x,R]=React.useState(!1),[w,k]=React.useState(!1),[N,_]=React.useState(!1);React.useEffect(()=>{(null==D?void 0:D.userAnswer)?k(!0):k(!1)},[b,e]);const O=React.useRef(null),I=()=>{E(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{E(!1)},0)},P=e=>{const t=D,r=e||t.userAnswer,{answer:n,answerOption:i}=t;switch(t.type){case QuestionTypeEnum.CHECKBOX:case QuestionTypeEnum.RADIO:return r===n||r&&isArrayEqual(null==r?void 0:r.split(","),null==n?void 0:n.split(","));case QuestionTypeEnum.COMPLETION:return null==i?void 0:i.every((e,t)=>{var n;return(null==e?void 0:e.answer)===(null==(n=null==r?void 0:r[t])?void 0:n.answer)});default:return!0}},D=React.useMemo(()=>e?e[b]:{},[b,e]),F=e=>{r(V,e)},L=e=>{null==o||o(e,V)};return jsxRuntimeExports.jsx(Spin,{spinning:!0===c,tip:u||"题目生成中...",styles:{wrapper:{height:"vertical"===h?"calc(100% - 60px)":"100%"}},children:jsxRuntimeExports.jsxs("div",{className:"questionPractice",children:[(null==e?void 0:e.length)>0?jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",style:{height:"100%"},children:jsxRuntimeExports.jsxs(Splitter,{style:{maxHeight:"100%"},children:[jsxRuntimeExports.jsx(Splitter.Panel,{min:275,max:400,defaultSize:300,children:jsxRuntimeExports.jsx("div",{className:"mr",style:{height:"100%"},children:jsxRuntimeExports.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-sm overflow-y-auto h-full",children:[jsxRuntimeExports.jsx("h3",{className:"font-semibold text-gray-800 mb-4",children:"题目列表"}),(null==e?void 0:e.length)>0&&jsxRuntimeExports.jsx("div",{className:"space-y-3 pr-[12px] left-que-item",children:e.map((t,r)=>{var n,i,o;return jsxRuntimeExports.jsxs("button",{onClick:()=>{q(r),I()},className:"w-full text-left p-4 rounded-lg border-2 transition-all "+(b===r?"border-blue-500 bg-blue-50 shadow-md":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium "+(b===r?"bg-blue-600 text-white":"bg-gray-200 text-gray-600"),children:r+1}),jsxRuntimeExports.jsx("div",{className:"p-1 rounded "+(b===r?"bg-blue-100":"bg-gray-100"),children:getQuestionTypeIcon(t.type)}),e[r].userAnswer&&jsxRuntimeExports.jsx("div",{className:"text-xs px-2 py-1 rounded-1 font-medium text-green-500 bg-green-100}",children:"已完成"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${getDifficultyColor(t.difficulty||"")}`,children:"low"===t.difficulty?"简单":"middle"===t.difficulty?"中等":"困难"}),t.score?jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1 text-xs text-gray-500",children:[jsxRuntimeExports.jsx(Star,{className:"w-3 h-3"}),jsxRuntimeExports.jsx("span",{children:t.score})]}):null]})]}),jsxRuntimeExports.jsx(Tooltip,{title:(t.topic||t.content||"").replace(/<[^>]*>/g,""),children:jsxRuntimeExports.jsx("h4",{className:"font-medium text-sm mb-1 text-ellipsis line-clamp-2 "+(b===r?"text-blue-800":"text-gray-800"),children:jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:t.topic||t.content||""}})})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[(null==(n=null==t?void 0:t.labels)?void 0:n.length)?jsxRuntimeExports.jsx("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full",children:null==(o=null==(i=null==t?void 0:t.labels)?void 0:i[0])?void 0:o.labelName}):jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500",children:getQuestionTypeName(t.type)})]})]},t.content||""+r)})})]})})}),jsxRuntimeExports.jsx(Splitter.Panel,{children:jsxRuntimeExports.jsx("div",{className:"h-full",children:jsxRuntimeExports.jsxs("div",{className:"h-full bg-white rounded-lg pb-5 pt-4 relative",children:[!S&&D&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"flex justify-end ant-btn-important absolute top-0 right-0 z-10",children:null==t?void 0:t(D)}),jsxRuntimeExports.jsx(QuestionRender,{data:D,questionProps:{onSubmit:e=>{null==r||r(D,e)},toRunCodeQuestion:()=>(async e=>{var t,r;null==d||d(e),C(e);const{lang:i="",topic:o,content:a,title:s,exampleList:l,verifyMode:c,userAnswer:u,optionJson:p,code:h}=e;let f=u||(null==n?void 0:n(V))||h;A({lang:i||(null==(t=null==p?void 0:p.languages)?void 0:t[0]),topic:o||s,content:a,verifyMode:c||(null==p?void 0:p.verifyMode)||(null==(r=null==e?void 0:e.optionJson)?void 0:r.verifyMode),code:f,cases:l||e.testCaseList||e.exampleList}),R(!0)})(D),showResult:!0,onNextQuestion:()=>{b<e.length-1?(q(b+1),I(),k(!1)):staticMethods.warning("已经是最后一题了")}}})]},D.id+D.questionId+D.userAnswer),w&&(null==D?void 0:D.type)!==QuestionTypeEnum.CCM&&(null==D?void 0:D.type)!==QuestionTypeEnum.ACM&&jsxRuntimeExports.jsxs("div",{className:"question-result mt-6 p-4 rounded-lg "+(P()?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"),children:[[QuestionTypeEnum.RADIO,QuestionTypeEnum.CHECKBOX,QuestionTypeEnum.COMPLETION].includes(D.type)&&jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[P()?jsxRuntimeExports.jsx(CircleCheckBig,{className:"w-5 h-5 text-green-600"}):jsxRuntimeExports.jsx(CircleX,{className:"w-5 h-5 text-red-600"}),jsxRuntimeExports.jsx("span",{className:"font-medium "+(P()?"text-green-800":"text-red-800"),children:P()?"回答正确!":"回答错误"}),!P()&&jsxRuntimeExports.jsx("span",{className:"text-red-600 text-sm bg-red-100 px-2 py-1 rounded-full",children:"已加入错题本"})]}),jsxRuntimeExports.jsx("div",{className:"text-gray-700 text-sm",children:(null==D?void 0:D.analyze)&&jsxRuntimeExports.jsxs("div",{className:"analyze",children:[jsxRuntimeExports.jsx("div",{className:"analyzeTitle",children:"答案分析"}),jsxRuntimeExports.jsx("div",{className:"analyzeContent",children:"answer"===D.type?jsxRuntimeExports.jsx(MyReactMarkdown,{children:(null==(f=null==D?void 0:D.analyze)?void 0:f.answerAnalysis)||(null==(g=null==D?void 0:D.analyze)?void 0:g.answer)}):jsxRuntimeExports.jsx(MyReactMarkdown,{children:null==(m=null==D?void 0:D.analyze)?void 0:m.answerAnalysis})})]})})]})]})})})]})}):jsxRuntimeExports.jsx(Empty,{image:emptyImg,description:jsxRuntimeExports.jsxs("div",{className:"emptyDescription",children:["暂无相关题目 ",i&&jsxRuntimeExports.jsx("span",{onClick:()=>i(),children:"现在生成"})]})}),jsxRuntimeExports.jsx(VgenModal,{contentType:"left",open:x,onCancel:()=>{R(!1)},blackMode:(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT,maskClosable:!1,footer:!1,content:jsxRuntimeExports.jsxs("div",{className:"codePlayerModal",id:"codePlayerModal",style:{background:(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT?"black":"#ffffff"},children:[jsxRuntimeExports.jsx(Button$1,{className:"fullScreenBtn",icon:N?TuiChuQuanPingIcon({fill:"#919191"}):QuanPingIcon({fill:"#919191"}),type:"text",onClick:()=>{var e;_(e=>!e),N?null==document||document.exitFullscreen():null==(e=document.querySelector("#codePlayerModal"))||e.requestFullscreen()}}),jsxRuntimeExports.jsx("div",{className:"code",children:(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT?jsxRuntimeExports.jsx(CodePlayer,{data:T,hasTitle:!1,toScore:F,codeChange:L}):jsxRuntimeExports.jsx(CodePlayer$1,{data:T,hasTitle:!1,toScore:F,codeChange:L,errorHanle:p})}),(a||s)&&jsxRuntimeExports.jsx("div",{className:`${(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT&&"quiz-wrapper"}`,children:jsxRuntimeExports.jsxs("div",{className:`scoreArea ${(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT&&"quiz-theme"}`,children:[jsxRuntimeExports.jsx("div",{className:"header",children:"AI分析区"}),a?jsxRuntimeExports.jsx("div",{className:"content",children:jsxRuntimeExports.jsx(MyReactMarkdown,{children:a})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"content",children:[jsxRuntimeExports.jsxs(Row,{children:[jsxRuntimeExports.jsx(Col,{span:12,children:jsxRuntimeExports.jsx(Statistic,{title:"总分",value:(null==s?void 0:s.score)??10})}),jsxRuntimeExports.jsx(Col,{span:12,children:jsxRuntimeExports.jsx(Statistic,{title:"最终得分",value:(null==s?void 0:s.userScore)??0})})]}),jsxRuntimeExports.jsx(List,{header:"判分依据:",children:(null==(v=null==s?void 0:s.reasons)?void 0:v.length)&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==(y=null==s?void 0:s.reasons)?void 0:y.map(e=>jsxRuntimeExports.jsx(List.Item,{children:jsxRuntimeExports.jsx(List.Item.Meta,{title:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{children:["条目:",e.item]}),jsxRuntimeExports.jsxs("div",{children:["得分:",e.score]})]}),description:jsxRuntimeExports.jsxs("span",{children:["原因:",e.reason]})})},e.item))})})]}),l&&jsxRuntimeExports.jsxs("div",{className:"content",children:[jsxRuntimeExports.jsx("h3",{children:"思考过程&答题思路"}),jsxRuntimeExports.jsx(MyReactMarkdown,{children:l})]})]})]})})]})})]})})};var cryptoJs={exports:{}},core$2={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,function(e){var t;e.exports=(t=t||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==commonjsGlobal&&commonjsGlobal.crypto&&(r=commonjsGlobal.crypto),!r&&"function"==typeof commonjsRequire)try{r=require$$0$1}catch(err){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(err){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(err){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},a=o.lib={},s=a.Base=function(){return{extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var a=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new l.init(t,e)}}),c=o.enc={},u=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(r,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(r,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e10){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,o);if(c){for(var d=0;d<c;d+=a)this._doProcessBlock(i,d);r=i.splice(0,c),n.sigBytes-=u}return new l.init(r,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new f.HMAC.init(e,r).finalize(t)}}});var f=o.algo={};return o}(Math),t)}(core$2)),core$2.exports}var x64Core={exports:{}},hasRequiredX64Core;function requireX64Core(){return hasRequiredX64Core||(hasRequiredX64Core=1,function(e){var t;e.exports=(t=requireCore(),function(e){var r=t,n=r.lib,i=n.Base,o=n.WordArray,a=r.x64={};a.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=i.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})}(),t)}(x64Core)),x64Core.exports}var libTypedarrays={exports:{}},hasRequiredLibTypedarrays;function requireLibTypedarrays(){return hasRequiredLibTypedarrays||(hasRequiredLibTypedarrays=1,function(e){var t;e.exports=(t=requireCore(),function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,r=e.init,n=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,n=[],i=0;i<t;i++)n[i>>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)};n.prototype=e}}(),t.lib.WordArray)}(libTypedarrays)),libTypedarrays.exports}var encUtf16={exports:{}},hasRequiredEncUtf16;function requireEncUtf16(){return hasRequiredEncUtf16||(hasRequiredEncUtf16=1,function(e){var t;e.exports=(t=requireCore(),function(){var e=t,r=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var a=i(t[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return r.create(n,2*t)}}}(),t.enc.Utf16)}(encUtf16)),encUtf16.exports}var encBase64={exports:{}},hasRequiredEncBase64;function requireEncBase64(){return hasRequiredEncBase64||(hasRequiredEncBase64=1,function(e){var t;e.exports=(t=requireCore(),function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return r.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o<r;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<r;s++)i.push(n.charAt(a>>>6*(3-s)&63));var l=n.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(encBase64)),encBase64.exports}var encBase64url={exports:{}},hasRequiredEncBase64url;function requireEncBase64url(){return hasRequiredEncBase64url||(hasRequiredEncBase64url=1,function(e){var t;e.exports=(t=requireCore(),function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return r.create(i,o)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,l=0;l<4&&a+.75*l<n;l++)o.push(i.charAt(s>>>6*(3-l)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e,t){void 0===t&&(t=!0);var r=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a<i.length;a++)o[i.charCodeAt(a)]=a}var s=i.charAt(64);if(s){var l=e.indexOf(s);-1!==l&&(r=l)}return n(e,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),t.enc.Base64url)}(encBase64url)),encBase64url.exports}var md5={exports:{}},hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,function(e){var t;e.exports=(t=requireCore(),function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],l=e[t+1],h=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],q=e[t+9],S=e[t+10],E=e[t+11],V=e[t+12],C=e[t+13],T=e[t+14],A=e[t+15],x=o[0],R=o[1],w=o[2],k=o[3];x=c(x,R,w,k,a,7,s[0]),k=c(k,x,R,w,l,12,s[1]),w=c(w,k,x,R,h,17,s[2]),R=c(R,w,k,x,f,22,s[3]),x=c(x,R,w,k,g,7,s[4]),k=c(k,x,R,w,m,12,s[5]),w=c(w,k,x,R,v,17,s[6]),R=c(R,w,k,x,y,22,s[7]),x=c(x,R,w,k,b,7,s[8]),k=c(k,x,R,w,q,12,s[9]),w=c(w,k,x,R,S,17,s[10]),R=c(R,w,k,x,E,22,s[11]),x=c(x,R,w,k,V,7,s[12]),k=c(k,x,R,w,C,12,s[13]),w=c(w,k,x,R,T,17,s[14]),x=u(x,R=c(R,w,k,x,A,22,s[15]),w,k,l,5,s[16]),k=u(k,x,R,w,v,9,s[17]),w=u(w,k,x,R,E,14,s[18]),R=u(R,w,k,x,a,20,s[19]),x=u(x,R,w,k,m,5,s[20]),k=u(k,x,R,w,S,9,s[21]),w=u(w,k,x,R,A,14,s[22]),R=u(R,w,k,x,g,20,s[23]),x=u(x,R,w,k,q,5,s[24]),k=u(k,x,R,w,T,9,s[25]),w=u(w,k,x,R,f,14,s[26]),R=u(R,w,k,x,b,20,s[27]),x=u(x,R,w,k,C,5,s[28]),k=u(k,x,R,w,h,9,s[29]),w=u(w,k,x,R,y,14,s[30]),x=d(x,R=u(R,w,k,x,V,20,s[31]),w,k,m,4,s[32]),k=d(k,x,R,w,b,11,s[33]),w=d(w,k,x,R,E,16,s[34]),R=d(R,w,k,x,T,23,s[35]),x=d(x,R,w,k,l,4,s[36]),k=d(k,x,R,w,g,11,s[37]),w=d(w,k,x,R,y,16,s[38]),R=d(R,w,k,x,S,23,s[39]),x=d(x,R,w,k,C,4,s[40]),k=d(k,x,R,w,a,11,s[41]),w=d(w,k,x,R,f,16,s[42]),R=d(R,w,k,x,v,23,s[43]),x=d(x,R,w,k,q,4,s[44]),k=d(k,x,R,w,V,11,s[45]),w=d(w,k,x,R,A,16,s[46]),x=p(x,R=d(R,w,k,x,h,23,s[47]),w,k,a,6,s[48]),k=p(k,x,R,w,y,10,s[49]),w=p(w,k,x,R,T,15,s[50]),R=p(R,w,k,x,m,21,s[51]),x=p(x,R,w,k,V,6,s[52]),k=p(k,x,R,w,f,10,s[53]),w=p(w,k,x,R,S,15,s[54]),R=p(R,w,k,x,l,21,s[55]),x=p(x,R,w,k,b,6,s[56]),k=p(k,x,R,w,A,10,s[57]),w=p(w,k,x,R,v,15,s[58]),R=p(R,w,k,x,C,21,s[59]),x=p(x,R,w,k,g,6,s[60]),k=p(k,x,R,w,E,10,s[61]),w=p(w,k,x,R,h,15,s[62]),R=p(R,w,k,x,q,21,s[63]),o[0]=o[0]+x|0,o[1]=o[1]+R|0,o[2]=o[2]+w|0,o[3]=o[3]+k|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<<o|s>>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<<o|s>>>32-o)+t}function d(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<<o|s>>>32-o)+t}function p(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<<o|s>>>32-o)+t}r.MD5=o._createHelper(l),r.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5)}(md5)),md5.exports}var sha1={exports:{}},hasRequiredSha1;function requireSha1(){return hasRequiredSha1||(hasRequiredSha1=1,function(e){var t,r,n,i,o,a,s,l;e.exports=(l=requireCore(),r=(t=l).lib,n=r.WordArray,i=r.Hasher,o=t.algo,a=[],s=o.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],l=r[4],c=0;c<80;c++){if(c<16)a[c]=0|e[t+c];else{var u=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+l+a[c];d+=c<20?1518500249+(i&o|~i&s):c<40?1859775393+(i^o^s):c<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,l=s,s=o,o=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+l|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s),l.SHA1)}(sha1)),sha1.exports}var sha256={exports:{}},hasRequiredSha256;function requireSha256(){return hasRequiredSha256||(hasRequiredSha256=1,function(e){var t;e.exports=(t=requireCore(),function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[],l=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),l[i]=r(e.pow(n,1/3)),i++),n++}();var c=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],d=r[6],p=r[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var f=c[h-15],g=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,m=c[h-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[h]=g+c[h-7]+v+c[h-16]}var y=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),q=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&d)+l[h]+c[h];p=d,d=u,u=s,s=a+q|0,a=o,o=i,i=n,n=q+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+u|0,r[6]=r[6]+d|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(u),r.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256)}(sha256)),sha256.exports}var sha224={exports:{}},hasRequiredSha224;function requireSha224(){return hasRequiredSha224||(hasRequiredSha224=1,function(e){var t,r,n,i,o,a;e.exports=(a=requireCore(),requireSha256(),r=(t=a).lib.WordArray,n=t.algo,i=n.SHA256,o=n.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o),a.SHA224)}(sha224)),sha224.exports}var sha512={exports:{}},hasRequiredSha512;function requireSha512(){return hasRequiredSha512||(hasRequiredSha512=1,function(e){var t;e.exports=(t=requireCore(),requireX64Core(),function(){var e=t,r=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var u=a.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],d=r[6],p=r[7],h=n.high,f=n.low,g=i.high,m=i.low,v=o.high,y=o.low,b=a.high,q=a.low,S=s.high,E=s.low,V=u.high,C=u.low,T=d.high,A=d.low,x=p.high,R=p.low,w=h,k=f,N=g,_=m,O=v,I=y,P=b,D=q,F=S,L=E,U=V,M=C,B=T,W=A,j=x,K=R,G=0;G<80;G++){var H,z,X=c[G];if(G<16)z=X.high=0|e[t+2*G],H=X.low=0|e[t+2*G+1];else{var Y=c[G-15],Z=Y.high,Q=Y.low,J=(Z>>>1|Q<<31)^(Z>>>8|Q<<24)^Z>>>7,$=(Q>>>1|Z<<31)^(Q>>>8|Z<<24)^(Q>>>7|Z<<25),ee=c[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=c[G-7],ae=oe.high,se=oe.low,le=c[G-16],ce=le.high,ue=le.low;z=(z=(z=J+ae+((H=$+se)>>>0<$>>>0?1:0))+ne+((H+=ie)>>>0<ie>>>0?1:0))+ce+((H+=ue)>>>0<ue>>>0?1:0),X.high=z,X.low=H}var de,pe=F&U^~F&B,he=L&M^~L&W,fe=w&N^w&O^N&O,ge=k&_^k&I^_&I,me=(w>>>28|k<<4)^(w<<30|k>>>2)^(w<<25|k>>>7),ve=(k>>>28|w<<4)^(k<<30|w>>>2)^(k<<25|w>>>7),ye=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),be=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),qe=l[G],Se=qe.high,Ee=qe.low,Ve=j+ye+((de=K+be)>>>0<K>>>0?1:0),Ce=ve+ge;j=B,K=W,B=U,W=M,U=F,M=L,F=P+(Ve=(Ve=(Ve=Ve+pe+((de+=he)>>>0<he>>>0?1:0))+Se+((de+=Ee)>>>0<Ee>>>0?1:0))+z+((de+=H)>>>0<H>>>0?1:0))+((L=D+de|0)>>>0<D>>>0?1:0)|0,P=O,D=I,O=N,I=_,N=w,_=k,w=Ve+(me+fe+(Ce>>>0<ve>>>0?1:0))+((k=de+Ce|0)>>>0<de>>>0?1:0)|0}f=n.low=f+k,n.high=h+w+(f>>>0<k>>>0?1:0),m=i.low=m+_,i.high=g+N+(m>>>0<_>>>0?1:0),y=o.low=y+I,o.high=v+O+(y>>>0<I>>>0?1:0),q=a.low=q+D,a.high=b+P+(q>>>0<D>>>0?1:0),E=s.low=E+L,s.high=S+F+(E>>>0<L>>>0?1:0),C=u.low=C+M,u.high=V+U+(C>>>0<M>>>0?1:0),A=d.low=A+W,d.high=T+B+(A>>>0<W>>>0?1:0),R=p.low=R+K,p.high=x+j+(R>>>0<K>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=r._createHelper(u),e.HmacSHA512=r._createHmacHelper(u)}(),t.SHA512)}(sha512)),sha512.exports}var sha384={exports:{}},hasRequiredSha384;function requireSha384(){return hasRequiredSha384||(hasRequiredSha384=1,function(e){var t,r,n,i,o,a,s,l;e.exports=(l=requireCore(),requireX64Core(),requireSha512(),r=(t=l).x64,n=r.Word,i=r.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s),l.SHA384)}(sha384)),sha384.exports}var sha3={exports:{}},hasRequiredSha3;function requireSha3(){return hasRequiredSha3||(hasRequiredSha3=1,function(e){var t;e.exports=(t=requireCore(),requireX64Core(),function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.x64.Word,s=r.algo,l=[],c=[],u=[];!function(){for(var e=1,t=0,r=0;r<24;r++){l[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,d=0,p=0;p<7;p++){if(1&i){var h=(1<<p)-1;h<32?d^=1<<h:s^=1<<h-32}128&i?i=i<<1^113:i<<=1}u[o]=a.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=a.create()}();var p=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=e[t+2*i],a=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(R=r[i]).high^=a,R.low^=o}for(var s=0;s<24;s++){for(var p=0;p<5;p++){for(var h=0,f=0,g=0;g<5;g++)h^=(R=r[p+5*g]).high,f^=R.low;var m=d[p];m.high=h,m.low=f}for(p=0;p<5;p++){var v=d[(p+4)%5],y=d[(p+1)%5],b=y.high,q=y.low;for(h=v.high^(b<<1|q>>>31),f=v.low^(q<<1|b>>>31),g=0;g<5;g++)(R=r[p+5*g]).high^=h,R.low^=f}for(var S=1;S<25;S++){var E=(R=r[S]).high,V=R.low,C=l[S];C<32?(h=E<<C|V>>>32-C,f=V<<C|E>>>32-C):(h=V<<C-32|E>>>64-C,f=E<<C-32|V>>>64-C);var T=d[c[S]];T.high=h,T.low=f}var A=d[0],x=r[0];for(A.high=x.high,A.low=x.low,p=0;p<5;p++)for(g=0;g<5;g++){var R=r[S=p+5*g],w=d[S],k=d[(p+1)%5+5*g],N=d[(p+2)%5+5*g];R.high=w.high^~k.high&N.high,R.low=w.low^~k.low&N.low}R=r[0];var _=u[s];R.high^=_.high,R.low^=_.low}},_doFinalize:function(){var t=this._data,r=t.words;this._nDataBytes;var n=8*t.sigBytes,o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u<l;u++){var d=a[u],p=d.high,h=d.low;p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),c.push(h),c.push(p)}return new i.init(c,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(p),r.HmacSHA3=o._createHmacHelper(p)}(Math),t.SHA3)}(sha3)),sha3.exports}var ripemd160={exports:{}},hasRequiredRipemd160;function requireRipemd160(){return hasRequiredRipemd160||(hasRequiredRipemd160=1,function(e){var t;e.exports=(t=requireCore(),
211
+ */!function(e){!function(){var t={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=i(e,n(r)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var n="";for(var o in e)t.call(e,o)&&e[o]&&(n=i(n,o));return n}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):window.classNames=r}()}(classnames);var classnamesExports=classnames.exports;const classNames=getDefaultExportFromCjs(classnamesExports),Show=e=>{const{height:t="300px",value:r,maskTip:n=!1,maskClick:i}=e,o=React.useRef(null),a=React.useRef(null);React.useEffect(()=>(o.current&&l(o.current),()=>{var e;null==(e=a.current)||e.dispose()}),[]);const s=React.useRef(null);React.useEffect(()=>{var e,t;return(null==r?void 0:r.cells)&&(null==(e=a.current)||e.fromJSON(r.cells),null==(t=a.current)||t.centerContent(),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var e;null==(e=a.current)||e.zoomToFit({maxScale:1,padding:20})},500)),()=>{s.current&&clearTimeout(s.current)}},[r]);const l=e=>{a.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:!1})};return jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-show"),style:{height:t},children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:o,className:"drawx6-container"})}),!!n&&jsxRuntimeExports.jsx("div",{className:"drawx6-show-mask",onClick:i,children:"string"==typeof n&&jsxRuntimeExports.jsxs("div",{className:"drawx6-center drawx6-show-mask-tip",children:[n,jsxRuntimeExports.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.00477 7.0309L2.00977 7.0949L2.02377 7.2249C2.12977 7.9959 2.61077 8.2449 4.92477 8.9539L6.42377 9.4079L6.59977 9.4679C6.6472 9.48276 6.69282 9.50289 6.73577 9.5279L6.75177 9.5419L6.77077 9.5659C6.79377 9.6029 6.82377 9.6759 6.87377 9.8329L6.96077 10.1149L7.39277 11.5389L7.55677 12.0599C8.12777 13.8389 8.39877 14.1999 9.13677 14.2799L9.19777 14.2849C10.1658 14.3669 10.4048 13.9549 11.3768 11.2969L13.4548 5.5859L13.6278 5.0929C14.1158 3.6729 14.1238 3.2479 13.6518 2.7489L13.5998 2.6949C13.0028 2.0989 12.5648 2.1669 10.5338 2.9019L4.64877 5.0459L3.98577 5.2959C2.27677 5.9549 1.95477 6.2519 2.00477 7.0309ZM5.11877 6.1719L11.0628 4.0079C12.3268 3.5549 12.6708 3.4909 12.7368 3.5569L12.7488 3.5769L12.7568 3.6069C12.7768 3.7509 12.6618 4.1899 12.2348 5.3749L10.1218 11.1749L9.86377 11.8509C9.49577 12.7919 9.33777 13.0729 9.30177 13.0709L9.28477 13.0509L9.25677 13.0109C9.19758 12.9171 9.14511 12.8192 9.09977 12.7179L9.01777 12.5329L8.96177 12.3959C8.81703 12.0073 8.68595 11.6137 8.56877 11.2159L8.08877 9.6349C7.92877 9.1119 7.83877 8.9049 7.61377 8.6799C7.58752 8.65373 7.56016 8.62871 7.53177 8.6049L7.43677 8.5299C7.28077 8.4159 7.12077 8.3499 6.76877 8.2399L4.72477 7.6159L4.34077 7.4909C4.133 7.42316 3.92815 7.34676 3.72677 7.2619L3.65577 7.2319C3.31577 7.0799 3.22377 6.9949 3.22377 6.9919L3.22877 6.9809L3.24777 6.9639C3.35177 6.8809 3.83277 6.6509 5.11977 6.1719H5.11877Z"}),jsxRuntimeExports.jsx("path",{d:"M7.24609 9.07483L9.69727 6.8866",strokeLinecap:"round"})]})]})})]})},content$4=".x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n";var __decorate$b=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Dnd2;class Dnd extends View{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},Dnd.defaults),e),this.init()}init(){ensure(this.name,content$4),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new Graph(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),append(this.container,this.draggingGraph.container)}start(e,t){const r=t;r.preventDefault(),this.targetModel.startBatch("dnd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,r.clientX,r.clientY);const n=this.updateNodePosition(r.clientX,r.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:r,node:e,cell:e,view:this.draggingView,x:n.x,y:n.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Dnd.documentEvents,r.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,r){const n=this.draggingGraph,i=n.model,o=this.options.getDragNode(e,{sourceNode:e,draggingGraph:n,targetGraph:this.targetGraph});o.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const e=this.targetGraph.transform.getScale();n.scale(e.sx,e.sy),a*=Math.max(e.sx,e.sy)}else n.scale(1,1);this.clearDragging(),i.resetCells([o]);const s=n.findViewByCell(o);s.undelegateEvents(),s.cell.off("changed"),n.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const l=s.getBBox();this.geometryBBox=s.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=o,this.draggingView=s,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,r)}updateGraphPosition(e,t){const r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,s={left:e-i.x-o.width/2-a+n,top:t-i.y-o.height/2-a+r};return this.draggingGraph&&css$3(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const r=this.targetGraph.clientToLocal(e,t),n=this.draggingBBox;return r.x-=n.width/2,r.y-=n.height/2,this.draggingNode.position(r.x,r.y),r}snap({cell:e,current:t,options:r}){const n=e;if(r.snapped){const e=this.draggingBBox;n.position(e.x+r.tx,e.y+r.ty,{silent:!0}),this.draggingView.translate(),n.position(t.x,t.y,{silent:!0}),this.snapOffset={x:r.tx,y:r.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const r=this.normalizeEvent(e),n=r.clientX,i=r.clientY;this.updateGraphPosition(n,i);const o=this.updateNodePosition(n,i),a=this.targetGraph.options.embedding.enabled,s=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:n,y:i});if(a){t.setEventData(r,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const e=t.getEventData(r);s?t.processEmbedding(r,e):t.clearEmbedding(e),this.candidateEmbedView=e.candidateEmbedView}this.isSnaplineEnabled()&&(s?this.snapline.snapOnMoving({e:r,view:t,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const r=this.normalizeEvent(e),n=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,s=i.y;o&&(a+=o.x,s+=o.y),t.position(a,s,{silent:!0});const l=this.drop(t,{x:r.clientX,y:r.clientY}),c=e=>{e?(this.onDropped(t),this.targetGraph.options.embedding.enabled&&n&&(n.setEventData(r,{cell:e,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),n.finalizeEmbedding(r,n.getEventData(r)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};isAsync(l)?(this.undelegateDocumentEvents(),l.then(c)):c(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(e){this.draggingNode===e&&(this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,r=null;const n=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(r=this.getDropArea(this.options.dndContainer));const o=r&&r.containsPoint(e);if(i)if(i.options.autoResize)t=this.getDropArea(i.container);else{const e=this.getDropArea(i.container);t=this.getDropArea(n.container).intersectsWithRect(e)}else t=this.getDropArea(n.container);return!o&&t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css$3(e,"border-left-width"),10)-n,y:t.top+parseInt(css$3(e,"border-top-width"),10)-r,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const r=this.targetGraph,n=r.model,i=r.clientToLocal(t),o=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:o,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),s=a.getBBox();i.x+=s.x-s.width/2,i.y+=s.y-s.height/2;const l=this.snapOffset?1:r.getGridSize();a.position(GeometryUtil.snapToGrid(i.x,l),GeometryUtil.snapToGrid(i.y,l)),a.removeZIndex();const c=this.options.validateNode,u=!c||c(a,{sourceNode:o,draggingNode:e,droppingNode:a,targetGraph:r,draggingGraph:this.draggingGraph});return"boolean"==typeof u?u?(n.addCell(a,{stencil:this.cid}),a):null:toDeferredBoolean(u).then(e=>e?(n.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}}__decorate$b([View.dispose()],Dnd.prototype,"dispose",null),Dnd2=Dnd||(Dnd={}),Dnd2.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},Dnd2.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"},Graph.prototype.toSVG=function(e,t){const r=this.getPlugin("export");r&&r.toSVG(e,t)},Graph.prototype.toPNG=function(e,t){const r=this.getPlugin("export");r&&r.toPNG(e,t)},Graph.prototype.toJPEG=function(e,t){const r=this.getPlugin("export");r&&r.toJPEG(e,t)},Graph.prototype.exportPNG=function(e,t){const r=this.getPlugin("export");r&&r.exportPNG(e,t)},Graph.prototype.exportJPEG=function(e,t){const r=this.getPlugin("export");r&&r.exportJPEG(e,t)},Graph.prototype.exportSVG=function(e,t){const r=this.getPlugin("export");r&&r.exportSVG(e,t)};var __decorate$a=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};class Export extends Basecoat{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportSVG(e="chart",t={}){this.toSVG(t=>{DataUri.downloadDataUri(DataUri.svgToDataUrl(t),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const r=this.view.svg,n=Vector.create(r).clone();let i=n.node;const o=n.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),s=t.preserveDimensions;if(s){const e="boolean"==typeof s?a:s;n.attr({width:e.width,height:e.height})}if(n.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),!1!==t.copyStyles){const e=r.ownerDocument,t=Array.from(r.querySelectorAll("*")),n=Array.from(i.querySelectorAll("*")),o=e.styleSheets.length,a=[];for(let r=o-1;r>=0;r-=1)a[r]=e.styleSheets[r],e.styleSheets[r].disabled=!0;const s={};t.forEach((e,t)=>{const r=window.getComputedStyle(e,null),n={};Object.keys(r).forEach(e=>{n[e]=r.getPropertyValue(e)}),s[t]=n}),o!==e.styleSheets.length&&a.forEach((t,r)=>{e.styleSheets[r]=t});for(let r=0;r<o;r+=1)e.styleSheets[r].disabled=!1;const l={};t.forEach((e,t)=>{const r=window.getComputedStyle(e,null),n=s[t],i={};Object.keys(r).forEach(e=>{isNumber(e)||r.getPropertyValue(e)===n[e]||(i[e]=r.getPropertyValue(e))}),l[t]=i}),n.forEach((e,t)=>{css$3(e,l[t])})}const l=t.stylesheet;if("string"==typeof l){const e=r.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(l);n.prepend(Vector.create("style",{type:"text/css"},[e]))}const c=()=>{const r=t.beforeSerialize;if("function"==typeof r){const e=call$1(r,this.graph,i);e instanceof SVGSVGElement&&(i=e)}const n=(new XMLSerializer).serializeToString(i).replace(/&nbsp;/g," ");this.notify("after:export",t),e(n)};if(t.serializeImages){const e=n.find("image").map(e=>new Promise(t=>{const r=e.attr("xlink:href")||e.attr("href");DataUri.imageToDataUri(r,(r,n)=>{!r&&n&&e.attr("xlink:href",n),t()})}));Promise.all(e).then(c)}else c()}toDataURL(e,t){let r=t.viewBox||this.graph.getContentBBox();const n=normalizeSides(t.padding);t.width&&t.height&&(n.left+n.right>=t.width&&(n.left=n.right=0),n.top+n.bottom>=t.height&&(n.top=n.bottom=0));const i=new Rectangle(-n.left,-n.top,n.left+n.right,n.top+n.bottom);if(t.width&&t.height){const e=r.width+n.left+n.right,o=r.height+n.top+n.bottom;i.scale(e/t.width,o/t.height)}r=Rectangle.create(r).moveAndExpand(i);const o="number"==typeof t.width&&"number"==typeof t.height?{width:t.width,height:t.height}:r;let a=t.ratio?parseFloat(t.ratio):1;Number.isFinite(a)&&0!==a||(a=1);const s={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const e=document.createElement("canvas"),t=e.getContext("2d");e.width=s.width,e.height=s.height;const r=s.width-1,n=s.height-1;t.fillStyle="rgb(1,1,1)",t.fillRect(r,n,1,1);const i=t.getImageData(r,n,1,1).data;if(1!==i[0]||1!==i[1]||1!==i[2])throw new Error("size exceeded")}const l=new Image;l.onload=()=>{const r=document.createElement("canvas");r.width=s.width,r.height=s.height;const n=r.getContext("2d");n.fillStyle=t.backgroundColor||"white",n.fillRect(0,0,s.width,s.height);try{n.drawImage(l,0,0,s.width,s.height);const i=r.toDataURL(t.type,t.quality);e(i)}catch(i){}},this.toSVG(e=>{l.src=`data:image/svg+xml,${encodeURIComponent(e)}`},Object.assign(Object.assign({},t),{viewBox:r,serializeImages:!0,preserveDimensions:Object.assign({},s)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}__decorate$a([Basecoat.dispose()],Export.prototype,"dispose",null);var __decorate$9=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Private$1;class TransformImpl extends View{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(e,t,r){super(),this.node=t,this.graph=r,this.options=Object.assign(Object.assign({},Private$1.defaultOptions),e),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const e=document.createElement("div");attr(e,"draggable","false");const t=e.cloneNode(!0);addClass(t,this.rotateClassName);const r=Private$1.POSITIONS.map(t=>{const r=e.cloneNode(!0);return addClass(r,this.resizeClassName),attr(r,"data-position",t),r});this.empty(),append(this.container,[...r,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(Private$1.NODE_CLS),addClass(this.container,this.containerClassName),toggleClass(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),toggleClass(this.container,"no-resize",!this.options.resizable),toggleClass(this.container,"no-rotate",!this.options.rotatable),this.options.className&&addClass(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const r=Angle.normalize(this.node.getAngle()),n=0!==r?`rotate(${r}deg)`:"";return css$3(this.container,{transform:n,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(Private$1.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=Angle.normalize(this.node.getAngle()),t=Math.floor(e*(Private$1.DIRECTIONS.length/360));if(t!==this.prevShift){const e=Private$1.DIRECTIONS.slice(t).concat(Private$1.DIRECTIONS.slice(0,t)),r=e=>`${this.containerClassName}-cursor-${e}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((t,n)=>{removeClass(t,Private$1.DIRECTIONS.map(e=>r(e)).join(" ")),addClass(t,r(e[n]))}),this.prevShift=t}}getTrueDirection(e){const t=Angle.normalize(this.node.getAngle());let r=Private$1.POSITIONS.indexOf(e);return r+=Math.floor(t*(Private$1.POSITIONS.length/360)),r%=Private$1.POSITIONS.length,Private$1.POSITIONS[r]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=attr(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const r=this.getTrueDirection(t);let n=0,i=0;t.split("-").forEach(e=>{n={left:-1,right:1}[e]||n,i={top:-1,bottom:1}[e]||i});const o=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],s=Angle.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:o,trueDirection:r,relativeDirection:t,angle:s,resizeX:n,resizeY:i,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),r=this.normalizeEvent(e),n=this.graph.snapToGrid(r.clientX,r.clientY);this.setEventData(e,{center:t,action:"rotating",angle:Angle.normalize(this.node.getAngle()),start:Point.create(n).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let r=this.getEventData(e);if(r.action){const n=this.normalizeEvent(e);let i=n.clientX,o=n.clientY;const a=this.graph.getPlugin("scroller"),s=this.options.restrictedResizing;if(!0===s||"number"==typeof s){const e=!0===s?0:s,t=a?Math.max(e,8):e,r=this.graph.container.getBoundingClientRect();i=clamp(i,r.left+t,r.right-t),o=clamp(o,r.top+t,r.bottom-t)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const l=this.graph.snapToGrid(i,o),c=this.graph.getGridSize(),u=this.node,d=this.options;if("resizing"===r.action){r.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),r.resized=!0);const n=u.getBBox(),i=Point.create(l).rotate(r.angle,n.getCenter()).diff(n[r.selector]);let o=r.resizeX?i.x*r.resizeX:n.width,a=r.resizeY?i.y*r.resizeY:n.height;const s=o,p=a;if(o=GeometryUtil.snapToGrid(o,c),a=GeometryUtil.snapToGrid(a,c),o=Math.max(o,d.minWidth||c),a=Math.max(a,d.minHeight||c),o=Math.min(o,d.maxWidth||1/0),a=Math.min(a,d.maxHeight||1/0),d.preserveAspectRatio){const e=n.width*a/n.height,t=n.height*o/n.width;o<e?a=t:o=e}const h=r.relativeDirection;if(d.allowReverse&&(s<=-o||p<=-a)){let t;"left"===h?s<=-o&&(t="right"):"right"===h?s<=-o&&(t="left"):"top"===h?p<=-a&&(t="bottom"):"bottom"===h?p<=-a&&(t="top"):"top-left"===h?s<=-o&&p<=-a?t="bottom-right":s<=-o?t="top-right":p<=-a&&(t="bottom-left"):"top-right"===h?s<=-o&&p<=-a?t="bottom-left":s<=-o?t="top-left":p<=-a&&(t="bottom-right"):"bottom-left"===h?s<=-o&&p<=-a?t="top-right":s<=-o?t="bottom-right":p<=-a&&(t="top-left"):"bottom-right"===h&&(s<=-o&&p<=-a?t="top-left":s<=-o?t="bottom-left":p<=-a&&(t="top-right"));const r=t;this.stopHandle();const n=this.container.querySelector(`.${this.resizeClassName}[data-position="${r}"]`);this.startHandle(n),this.prepareResizing(e,r),this.onMouseMove(e)}if(n.width!==o||n.height!==a){const n={ui:!0,direction:r.direction,relativeDirection:r.relativeDirection,trueDirection:r.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:!0===d.preserveAspectRatio};u.resize(o,a,n),this.notify("node:resizing",e,t)}}else if("rotating"===r.action){r.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),r.rotated=!0);const n=u.getAngle(),i=r.start-Point.create(l).theta(r.center);let o=r.angle+i;d.rotateGrid&&(o=GeometryUtil.snapToGrid(o,d.rotateGrid)),o=Angle.normalize(o),n!==o&&(u.rotate(o,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch("resizing"===t.action?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,addClass(this.container,`${this.containerClassName}-active`),e){addClass(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const e=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(t)];addClass(this.container,`${this.containerClassName}-cursor-${e}`)}}}stopHandle(){if(removeClass(this.container,`${this.containerClassName}-active`),this.handle){removeClass(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(e)];removeClass(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(Private$1.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),r=this.getEventData(e);t&&(t.removeClass(`node-${r.action}`),"resizing"===r.action&&r.resized?this.notify("node:resized",e,t):"rotating"===r.action&&r.rotated&&this.notify("node:rotated",e,t))}notify(e,t,r,n={}){if(r){const i=r.graph,o=i.view.normalizeEvent(t),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(e,Object.assign({e:o,view:r,node:r.cell,cell:r.cell,x:a.x,y:a.y},n))}}dispose(){this.stopListening(),this.remove(),this.off()}}__decorate$9([View.dispose()],TransformImpl.prototype,"dispose",null),function(e){e.NODE_CLS="has-widget-transform",e.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],e.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],e.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},e.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}}(Private$1||(Private$1={}));const content$3=".x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n";Graph.prototype.createTransformWidget=function(e){const t=this.getPlugin("transform");return t&&t.createWidget(e),this},Graph.prototype.clearTransformWidgets=function(){const e=this.getPlugin("transform");return e&&e.clearWidgets(),this};var __decorate$8=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Transform2;class Transform extends Basecoat{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,ensure(this.name,content$3)}init(e){this.graph=e,this.disabled||this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new TransformImpl(t,e,this.graph):null}getTransformOptions(e){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),"boolean"==typeof this.options.resizing&&(this.options.resizing={enabled:this.options.resizing}),"boolean"==typeof this.options.rotating&&(this.options.rotating={enabled:this.options.rotating});const t=Transform.parseOptionGroup(this.graph,e,this.options.resizing),r=Transform.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:"boolean"!=typeof t.orthogonal||t.orthogonal,restrictedResizing:!!t.restrict,autoScrollOnResizing:"boolean"!=typeof t.autoScroll||t.autoScroll,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:"boolean"!=typeof t.allowReverse||t.allowReverse,rotatable:!!r.enabled,rotateGrid:r.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),clean(this.name)}}__decorate$8([Basecoat.dispose()],Transform.prototype,"dispose",null),Transform2=Transform||(Transform={}),Transform2.parseOptionGroup=function(e,t,r){const n={};return Object.keys(r||{}).forEach(i=>{const o=r[i];n[i]="function"==typeof o?o.call(e,t):o}),n};var mousetrap={exports:{}};!function(e){!function(t,r){if(t){for(var n,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();m.prototype.bind=function(e,t,r){var n=this;return e=e instanceof Array?e:[e],n._bindMultiple.call(n,e,t,r),n},m.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},m.prototype.trigger=function(e,t){var r=this;return r._directMap[e+":"+t]&&r._directMap[e+":"+t]({},e),r},m.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},m.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var r=e.composedPath()[0];r!==e.target&&(t=r)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},m.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},m.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);n=null},m.init=function(){var e=m(r);for(var t in e)"_"!==t.charAt(0)&&(m[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},m.init(),t.Mousetrap=m,e.exports&&(e.exports=m)}function c(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r)}function u(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return i[e.which]?i[e.which]:o[e.which]?o[e.which]:String.fromCharCode(e.which).toLowerCase()}function d(e,t){return e.sort().join(",")===t.sort().join(",")}function p(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function h(e,t,r){return r||(r=function(){if(!n)for(var e in n={},i)e>95&&e<112||i.hasOwnProperty(e)&&(n[i[e]]=e);return n}()[e]?"keydown":"keypress"),"keypress"==r&&t.length&&(r="keydown"),r}function f(e,t){var r,n,i,o=[];for(r=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),i=0;i<r.length;++i)n=r[i],s[n]&&(n=s[n]),t&&"keypress"!=t&&a[n]&&(n=a[n],o.push("shift")),p(n)&&o.push(n);return{key:n,modifiers:o,action:t=h(n,o,t)}}function g(e,t){return null!==e&&e!==r&&(e===t||g(e.parentNode,t))}function m(e){var t=this;if(e=e||r,!(t instanceof m))return new m(e);t.target=e,t._callbacks={},t._directMap={};var n,i={},o=!1,a=!1,s=!1;function l(e){e=e||{};var t,r=!1;for(t in i)e[t]?r=!0:i[t]=0;r||(s=!1)}function h(e,r,n,o,a,s){var l,c,u=[],h=n.type;if(!t._callbacks[e])return[];for("keyup"==h&&p(e)&&(r=[e]),l=0;l<t._callbacks[e].length;++l)if(c=t._callbacks[e][l],(o||!c.seq||i[c.seq]==c.level)&&h==c.action&&("keypress"==h&&!n.metaKey&&!n.ctrlKey||d(r,c.modifiers))){var f=!o&&c.combo==a,g=o&&c.seq==o&&c.level==s;(f||g)&&t._callbacks[e].splice(l,1),u.push(c)}return u}function g(e,r,n,i){t.stopCallback(r,r.target||r.srcElement,n,i)||!1===e(r,n)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(r),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(r))}function v(e){"number"!=typeof e.which&&(e.which=e.keyCode);var r=u(e);r&&("keyup"!=e.type||o!==r?t.handleKey(r,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):o=!1)}function y(e,t,r,a){function c(t){return function(){s=t,++i[e],clearTimeout(n),n=setTimeout(l,1e3)}}function d(t){g(r,t,e),"keyup"!==a&&(o=u(t)),setTimeout(l,10)}i[e]=0;for(var p=0;p<t.length;++p){var h=p+1===t.length?d:c(a||f(t[p+1]).action);b(t[p],h,a,e,p)}}function b(e,r,n,i,o){t._directMap[e+":"+n]=r;var a,s=(e=e.replace(/\s+/g," ")).split(" ");s.length>1?y(e,s,r,n):(a=f(e,n),t._callbacks[a.key]=t._callbacks[a.key]||[],h(a.key,a.modifiers,{type:a.action},i,e,o),t._callbacks[a.key][i?"unshift":"push"]({callback:r,modifiers:a.modifiers,action:a.action,seq:i,level:o,combo:e}))}t._handleKey=function(e,t,r){var n,i=h(e,t,r),o={},c=0,u=!1;for(n=0;n<i.length;++n)i[n].seq&&(c=Math.max(c,i[n].level));for(n=0;n<i.length;++n)if(i[n].seq){if(i[n].level!=c)continue;u=!0,o[i[n].seq]=1,g(i[n].callback,r,i[n].combo,i[n].seq)}else u||g(i[n].callback,r,i[n].combo);var d="keypress"==r.type&&a;r.type!=s||p(e)||d||l(o),a=u&&"keydown"==r.type},t._bindMultiple=function(e,t,r){for(var n=0;n<e.length;++n)b(e[n],t,r)},c(e,"keypress",v),c(e,"keydown",v),c(e,"keyup",v)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(mousetrap);var mousetrapExports=mousetrap.exports;const Mousetrap=getDefaultExportFromCjs(mousetrapExports);var __decorate$7=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},KeyboardImpl2;class KeyboardImpl extends Disposable{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=KeyboardImpl.createMousetrap(this)}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(e,t,r){this.mousetrap.bind(this.getKeys(e),t,r)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(e=>this.formatkey(e))}formatkey(e){const t=e.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),r=this.options.format;return r?call$1(r,this.graph,t):t}isGraphEvent(e){const t=e.target,r=e.currentTarget;return!!t&&(t===this.target||r===this.target||t===document.body||contains(this.container,t))}isInputEvent(e){var t;const r=e.target,n=null===(t=null==r?void 0:r.tagName)||void 0===t?void 0:t.toLowerCase();let i=["input","textarea"].includes(n);return"true"===attr(r,"contenteditable")&&(i=!0),i}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),r=this.isInputEvent(e);if(t){if(r&&("Backspace"===e.key||"Delete"===e.key))return!1;if(this.options.guard)return call$1(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}__decorate$7([Disposable.dispose()],KeyboardImpl.prototype,"dispose",null),KeyboardImpl2=KeyboardImpl||(KeyboardImpl={}),KeyboardImpl2.createMousetrap=function(e){const t=new Mousetrap(e.target),r=t.stopCallback;return t.stopCallback=(n,i,o)=>!e.isEnabledForEvent(n)||!!r&&r.call(t,n,i,o),t},Graph.prototype.isKeyboardEnabled=function(){const e=this.getPlugin("keyboard");return!!e&&e.isEnabled()},Graph.prototype.enableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.enable(),this},Graph.prototype.disableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.disable(),this},Graph.prototype.toggleKeyboard=function(e){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(e),this},Graph.prototype.bindKey=function(e,t,r){const n=this.getPlugin("keyboard");return n&&n.bindKey(e,t,r),this},Graph.prototype.unbindKey=function(e,t){const r=this.getPlugin("keyboard");return r&&r.unbindKey(e,t),this},Graph.prototype.clearKeys=function(){const e=this.getPlugin("keyboard");return e&&e.clear(),this},Graph.prototype.triggerKey=function(e,t){const r=this.getPlugin("keyboard");return r&&r.trigger(e,t),this};var __decorate$6=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Storage;class Keyboard extends Disposable{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new KeyboardImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,r){return this.keyboardImpl.on(e,t,r),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}__decorate$6([Disposable.dispose()],Keyboard.prototype,"dispose",null);class ClipboardImpl{constructor(){this.cells=[]}copy(e,t,r={}){this.options=Object.assign({},r);const n=(Model.isModel(t)?t:t.model).cloneSubGraph(e,r);this.cells=sortBy(Object.keys(n).map(e=>n[e]),e=>e.isEdge()?2:1),this.serialize(r)}cut(e,t,r={}){this.copy(e,t,r);(Graph.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(e=>e.remove())})}paste(e,t={}){const r=Object.assign(Object.assign({},this.options),t),{offset:n,edgeProps:i,nodeProps:o}=r;let a=20,s=20;n&&(a="number"==typeof n?n:n.dx,s="number"==typeof n?n:n.dy),this.deserialize(r);const l=this.cells;l.forEach(e=>{e.model=null,e.removeProp("zIndex"),(a||s)&&e.translate(a,s),o&&e.isNode()&&e.prop(o),i&&e.isEdge()&&e.prop(i)});const c=Graph.isGraph(e)?e.model:e;return c.batchUpdate("paste",()=>{c.addCells(this.cells)}),this.copy(l,e,t),l}serialize(e){!1!==e.useLocalStorage&&Storage.save(this.cells)}deserialize(e){if(e.useLocalStorage){const e=Storage.fetch();e&&(this.cells=e)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],Storage.clean()}}!function(e){const t=`${Config.prefixCls}.clipboard.cells`;e.save=function(e){if(window.localStorage){const r=e.map(e=>e.toJSON());localStorage.setItem(t,JSON.stringify(r))}},e.fetch=function(){if(window.localStorage){const e=localStorage.getItem(t),r=e?JSON.parse(e):[];if(r)return Model.fromJSON(r)}},e.clean=function(){window.localStorage&&localStorage.removeItem(t)}}(Storage||(Storage={})),Graph.prototype.isClipboardEnabled=function(){const e=this.getPlugin("clipboard");return!!e&&e.isEnabled()},Graph.prototype.enableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.enable(),this},Graph.prototype.disableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.disable(),this},Graph.prototype.toggleClipboard=function(e){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(e),this},Graph.prototype.isClipboardEmpty=function(e){const t=this.getPlugin("clipboard");return!t||t.isEmpty(e)},Graph.prototype.getCellsInClipboard=function(){const e=this.getPlugin("clipboard");return e?e.getCellsInClipboard():[]},Graph.prototype.cleanClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.clean(),this},Graph.prototype.copy=function(e,t){const r=this.getPlugin("clipboard");return r&&r.copy(e,t),this},Graph.prototype.cut=function(e,t){const r=this.getPlugin("clipboard");return r&&r.cut(e,t),this},Graph.prototype.paste=function(e,t){const r=this.getPlugin("clipboard");return r?r.paste(e,t):[]};var __decorate$5=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},__rest$1=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};class Clipboard extends Basecoat{get disabled(){return!0!==this.options.enabled}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new ClipboardImpl,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return this.disabled&&!e||(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options,{enabled:t}=e;return __rest$1(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}__decorate$5([Basecoat.dispose()],Clipboard.prototype,"dispose",null),Graph.prototype.isHistoryEnabled=function(){const e=this.getPlugin("history");return!!e&&e.isEnabled()},Graph.prototype.enableHistory=function(){const e=this.getPlugin("history");return e&&e.enable(),this},Graph.prototype.disableHistory=function(){const e=this.getPlugin("history");return e&&e.disable(),this},Graph.prototype.toggleHistory=function(e){const t=this.getPlugin("history");return t&&t.toggleEnabled(e),this},Graph.prototype.undo=function(e){const t=this.getPlugin("history");return t&&t.undo(e),this},Graph.prototype.redo=function(e){const t=this.getPlugin("history");return t&&t.redo(e),this},Graph.prototype.undoAndCancel=function(e){const t=this.getPlugin("history");return t&&t.cancel(e),this},Graph.prototype.canUndo=function(){const e=this.getPlugin("history");return!!e&&e.canUndo()},Graph.prototype.canRedo=function(){const e=this.getPlugin("history");return!!e&&e.canRedo()},Graph.prototype.cleanHistory=function(e){const t=this.getPlugin("history");return t&&t.clean(e),this},Graph.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},Graph.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},Graph.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},Graph.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var __decorate$4=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Util;class History extends Basecoat{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Util.getOptions(e),this.validator=new History.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return!0!==this.options.enabled}validate(e,...t){return this.validator.validate(e,...t),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:!!e&&e.batch,data:{}}}revertCommand(e,t){this.freezed=!0;const r=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let n=r.length-1;n>=0;n-=1){const e=r[n],i=Object.assign(Object.assign({},t),pick(e.options,this.options.revertOptionsList||[]));this.executeCommand(e,!0,i)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const r=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let n=0;n<r.length;n+=1){const e=r[n],i=Object.assign(Object.assign({},t),pick(e.options,this.options.applyOptionsList||[]));this.executeCommand(e,!1,i)}this.freezed=!1}executeCommand(e,t,r){const n=this.model,i=n.getCell(e.data.id),o=e.event;if(Util.isAddEvent(o)&&t||Util.isRemoveEvent(o)&&!t)i&&i.remove(r);else if(Util.isAddEvent(o)&&!t||Util.isRemoveEvent(o)&&t){const t=e.data;t.node?n.addNode(t.props,r):t.edge&&n.addEdge(t.props,r)}else if(Util.isChangeEvent(o)){const n=e.data,o=n.key;if(o&&i){const e=t?n.prev[o]:n.next[o];if("attrs"===n.key){this.ensureUndefinedAttrs(e,t?n.next[o]:n.prev[o])&&(r.dirty=!0)}i.prop(o,e,r)}}else{const n=this.options.executeCommand;n&&call$1(n,this,e,t,r)}}addCommand(e,t){if(this.freezed||this.disabled)return;const r=t,n=r.options||{};if(n.dryrun)return;if(Util.isAddEvent(e)&&this.options.ignoreAdd||Util.isRemoveEvent(e)&&this.options.ignoreRemove||Util.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(null!=i&&!1===call$1(i,this,e,t))return;"cell:change:*"===e&&(e=`cell:change:${r.key}`);const o=r.cell,a=Model.isModel(o);let s;if(this.batchCommands){s=this.batchCommands[Math.max(this.lastBatchIndex,0)];const t=a&&!s.modelChange||s.data.id!==o.id,r=s.event!==e;if(this.lastBatchIndex>=0&&(t||r)){const t=this.batchCommands.findIndex(t=>(a&&t.modelChange||t.data.id===o.id)&&t.event===e);t<0||Util.isAddEvent(e)||Util.isRemoveEvent(e)?s=this.createCommand({batch:!0}):(s=this.batchCommands[t],this.batchCommands.splice(t,1)),this.batchCommands.push(s),this.lastBatchIndex=this.batchCommands.length-1}}else s=this.createCommand({batch:!1});if(Util.isAddEvent(e)||Util.isRemoveEvent(e)){const t=s.data;return s.event=e,s.options=n,t.id=o.id,t.props=cloneDeep(o.toJSON()),o.isEdge()?t.edge=!0:o.isNode()&&(t.node=!0),this.push(s,n)}if(Util.isChangeEvent(e)){const r=t.key,i=s.data;return s.batch&&s.event||(s.event=e,s.options=n,i.key=r,null==i.prev&&(i.prev={}),i.prev[r]=cloneDeep(o.previous(r)),a?s.modelChange=!0:i.id=o.id),null==i.next&&(i.next={}),i.next[r]=cloneDeep(o.prop(r)),this.push(s,n)}const l=this.options.afterAddCommand;l&&call$1(l,this,e,t,s),this.push(s,n)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const r=[];for(;t.length>0;){const e=t.shift(),n=e.event,i=e.data.id;if(null!=n&&(null!=i||e.modelChange)){if(Util.isAddEvent(n)){const e=t.findIndex(e=>Util.isRemoveEvent(e.event)&&e.data.id===i);if(e>=0){t=t.filter((t,r)=>e<r||t.data.id!==i);continue}}else if(Util.isRemoveEvent(n)){const e=t.findIndex(e=>Util.isAddEvent(e.event)&&e.data.id===i);if(e>=0){t.splice(e,1);continue}}else if(Util.isChangeEvent(n)){const t=e.data;if(isEqual(t.prev,t.next))continue}r.push(e)}}return r}notify(e,t,r){const n=null==t?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:n,options:r}),this.graph.trigger(`history:${e}`,{cmds:n,options:r}),this.emit("change",{cmds:n,options:r}),this.graph.trigger("history:change",{cmds:n,options:r})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],r=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const n=new Set(t.map(e=>e.event));if(2!==n.size||!n.has("cell:change:parent")||!n.has("cell:change:children"))return;if(!t.every(e=>{var t;return e.batch&&(null===(t=e.options)||void 0===t?void 0:t.ui)}))return;if(!Array.isArray(r)||1!==r.length)return;const i=r[0];"cell:change:position"===i.event&&(null===(e=i.options)||void 0===e?void 0:e.ui)&&(r.push(...t),this.undoStack.pop())}undoStackPush(e){0!==this.stackSize?(this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)):this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let r=!1;return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).forEach(n=>{void 0===e[n]&&void 0!==t[n]?(e[n]=void 0,r=!0):"object"==typeof e[n]&&"object"==typeof t[n]&&(r=this.ensureUndefinedAttrs(e[n],t[n]))}),r}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}__decorate$4([Basecoat.dispose()],History.prototype,"dispose",null),function(e){class t extends Basecoat{constructor(e){super(),this.map={},this.command=e.history,this.cancelInvalid=!1!==e.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:e}){return Array.isArray(e)?e.every(e=>this.isValidCommand(e)):this.isValidCommand(e)}isValidCommand(e){if(e.options&&!1===e.options.validation)return!0;const t=e.event&&this.map[e.event]||[];let r=null;return t.forEach(t=>{let n=0;const i=o=>{const a=t[n];n+=1;try{if(!a)return void(r=o);a(o,e,i)}catch(s){i(s)}};i(r)}),!r||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:r}),!1)}validate(e,...t){const r=Array.isArray(e)?e:e.split(/\s+/);return t.forEach(e=>{if("function"!=typeof e)throw new Error(`${r.join(" ")} requires callback functions.`)}),r.forEach(e=>{null==this.map[e]&&(this.map[e]=[]),this.map[e].push(t)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}__decorate$4([Basecoat.dispose()],t.prototype,"dispose",null),e.Validator=t}(History||(History={})),function(e){e.isAddEvent=function(e){return"cell:added"===e},e.isRemoveEvent=function(e){return"cell:removed"===e},e.isChangeEvent=function(e){return null!=e&&e.startsWith("cell:change:")},e.getOptions=function(t){const r=["cell:added","cell:removed","cell:change:*"],n=["batch:start","batch:stop"],i=t.eventNames?t.eventNames.filter(t=>!(e.isChangeEvent(t)||r.includes(t)||n.includes(t))):r;return Object.assign(Object.assign({enabled:!0},t),{eventNames:i,applyOptionsList:t.applyOptionsList||["propertyPath"],revertOptionsList:t.revertOptionsList||["propertyPath"]})},e.sortBatchCommands=function(t){const r=[];for(let n=0,i=t.length;n<i;n+=1){const i=t[n];let o=null;if(e.isAddEvent(i.event)){const e=i.data.id;for(let r=0;r<n;r+=1)if(t[r].data.id===e){o=r;break}}null!==o?r.splice(o,0,i):r.push(i)}return r}}(Util||(Util={}));var __decorate$3=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Private;class SelectionImpl extends View{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Private.classNames.box)}get $boxes(){return children(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Collection([],{comparator:Private.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:r,pointerEvents:n}=this.options,{ui:i,selection:o,translateBy:a,snapped:s}=t,l=(!0!==r||n&&"none"===this.getPointerEventsValue(n))&&!this.translating&&!o,c=i&&a&&e.id===a;if(l&&(c||s)){this.translating=!0;const r=e.position(),n=e.previous("position"),i=r.x-n.x,o=r.y-n.y;0===i&&0===o||this.translateSelectedNodes(i,o,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(r,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(r,Object.assign(Object.assign({},t),{ui:!0})),this}const r=this.cells,n=this.filter(Array.isArray(e)?e:[e]),i={},o={};r.forEach(e=>i[e.id]=e),n.forEach(e=>o[e.id]=e);const a=[],s=[];return n.forEach(e=>{i[e.id]||a.push(e)}),r.forEach(e=>{o[e.id]||s.push(e)}),s.length&&this.unselect(s,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),0===s.length&&0===a.length&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(!1===e.batch?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){let t,r;e=this.normalizeEvent(e),this.clean();const n=this.graph.container;if(null!=e.offsetX&&null!=e.offsetY&&n.contains(e.target))t=e.offsetX,r=e.offsetY;else{const i=offset$1(n),o=n.scrollLeft,a=n.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,r=e.clientY-i.top+window.pageYOffset+a}css$3(this.container,{top:r,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:r,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Private.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(e=>Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e))}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let e=width$1(this.container),r=height$1(this.container);const n=offset$1(this.container),i=t.pageToLocal(n.left,n.top),o=t.transform.getScale();e/=o.sx,r/=o.sy;const a=new Rectangle(i.x,i.y,e,r),s=this.getCellViewsInArea(a).map(e=>e.cell);this.reset(s,{batch:!0}),this.hideRubberband();break}case"translating":{const n=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const e=r;this.updateSelectedNodesPosition({dx:e.clientX-e.originX,dy:e.clientY-e.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,n.x,n.y);break}default:this.clean()}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const r=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:r});const n=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,n.x,n.y),this.delegateDocumentEvents(Private.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t="function"==typeof e?call$1(e,this.graph,null):e;return"number"==typeof t?this.graph.transform.getGraphArea().inflate(t):!0===t?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let r=e.x-t.clientX,n=e.y-t.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=Cell.getCellsBBox(o,{deep:!0})||Rectangle.create(),s=i.x-a.x,l=i.y-a.y,c=i.x+i.width-(a.x+a.width),u=i.y+i.height-(a.y+a.height);if(r<s&&(r=s),n<l&&(n=l),c<r&&(r=c),u<n&&(n=u),!this.options.following){const i=e.x-t.originX,o=e.y-t.originY;r=i<=s||i>=c?0:r,n=o<=l||o>=u?0:n}}return{dx:r,dy:n}}updateElementPosition(e,t,r){const n=css$3(e,"left"),i=css$3(e,"top"),o=n?parseFloat(n):0,a=i?parseFloat(i):0;css$3(e,"left",o+t),css$3(e,"top",a+r)}updateSelectedNodesPosition(e){const{dx:t,dy:r}=e;if(t||r)if(this.translateSelectedNodes(t,r),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const e=this.graph.transform.getScale();for(let n=0,i=this.$boxes,o=i.length;n<o;n+=1)this.updateElementPosition(i[n],t*e.sx,r*e.sy);this.updateElementPosition(this.selectionContainer,t*e.sx,r*e.sy)}}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");return r?r.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),r=this.getEventData(t);switch(r.action){case"selecting":{const e=r;!0!==e.moving&&(appendTo(this.container,this.graph.container),this.showRubberband(),e.moving=!0);const{scrollerX:n,scrollerY:i}=this.autoScrollGraph(t.clientX,t.clientY);e.scrollerX+=n,e.scrollerY+=i;const o=t.clientX-e.clientX+e.scrollerX,a=t.clientY-e.clientY+e.scrollerY,s=parseInt(css$3(this.container,"left")||"0",10),l=parseInt(css$3(this.container,"top")||"0",10);css$3(this.container,{left:o<0?e.offsetX+o:s,top:a<0?e.offsetY+a:l,width:Math.abs(o),height:Math.abs(a)});break}case"translating":{const n=this.graph.snapToGrid(t.clientX,t.clientY),i=r,o=this.getSelectionOffset(n,i);this.options.following?this.updateSelectedNodesPosition(o):this.updateContainerPosition(o),o.dx&&(i.clientX=n.x),o.dy&&(i.clientY=n.y),this.notifyBoxEvent("box:mousemove",e,n.x,n.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,r,n){const i={},o=[];if(r&&(i[r.id]=!0),this.collection.toArray().forEach(e=>{e.getDescendants({deep:!0}).forEach(e=>{i[e.id]=!0})}),n&&n.translateBy){const e=this.graph.getCellById(n.translateBy);e&&(i[e.id]=!0,e.getDescendants({deep:!0}).forEach(e=>{i[e.id]=!0}),o.push(e))}this.collection.toArray().forEach(r=>{if(!i[r.id]){const a=Object.assign(Object.assign({},n),{selection:this.cid,exclude:o});r.translate(e,t,a),this.graph.model.getConnectedEdges(r).forEach(r=>{i[r.id]||(r.translate(e,t,a),i[r.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,r={strict:this.options.strict};let n=[];return this.options.rubberNode&&(n=n.concat(t.model.getNodesInArea(e,r).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),this.options.rubberEdge&&(n=n.concat(t.model.getEdgesInArea(e,r).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),n}notifyBoxEvent(e,t,r,n){const i=this.getEventData(t).activeView;this.trigger(e,{e:t,view:i,x:r,y:n,cell:i.cell})}getSelectedClassName(e){return this.prefixClassName((e.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(remove(this.container.querySelector(`[data-cell-id="${e.id}"]`)),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),remove(this.$boxes),this.boxCount=0}hide(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband)),removeClass(this.container,this.prefixClassName(Private.classNames.selected))}showRubberband(){addClass(this.container,this.prefixClassName(Private.classNames.rubberband))}hideRubberband(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband))}showSelected(){removeAttribute(this.container,"style"),addClass(this.container,this.prefixClassName(Private.classNames.selected))}createContainer(){this.container=document.createElement("div"),addClass(this.container,this.prefixClassName(Private.classNames.root)),this.options.className&&addClass(this.container,this.options.className),this.selectionContainer=document.createElement("div"),addClass(this.selectionContainer,this.prefixClassName(Private.classNames.inner)),this.selectionContent=document.createElement("div"),addClass(this.selectionContent,this.prefixClassName(Private.classNames.content)),append(this.selectionContainer,this.selectionContent),attr(this.selectionContainer,"data-selection-length",this.collection.length),prepend(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(e=>this.canShowSelectionBox(e)).forEach(r=>{const n=this.graph.renderer.findViewByCell(r);if(n){const r=n.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,r.x),e.y=Math.min(e.y,r.y),t.x=Math.max(t.x,r.x+r.width),t.y=Math.max(t.y,r.y+r.height)}}),css$3(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),attr(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if("function"==typeof r){const e=call$1(r,this.graph,this,this.selectionContent);e&&(this.selectionContent.innerHTML=e)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?appendTo(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&!0===this.options.showNodeSelectionBox||e.isEdge()&&!0===this.options.showEdgeSelectionBox}getPointerEventsValue(e){return"string"==typeof e?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const r=t.getBBox({useCellGeometry:!0}),n=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;addClass(i,n),addClass(i,`${n}-${e.isNode()?"node":"edge"}`),attr(i,"data-cell-id",e.id),css$3(i,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),appendTo(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,r=t.length;e<r;e+=1){const r=t[e],n=attr(r,"data-cell-id");remove(r),this.boxCount-=1;const i=this.collection.get(n);i&&this.createSelectionBox(i)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const e=this.collection.get(t);if(e)return this.graph.renderer.findViewByCell(e)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(e=>{this.listenCellRemoveEvent(e),this.createSelectionBox(e)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:r}){e.forEach(e=>{this.trigger("cell:selected",{cell:e,options:r}),e.isNode()?this.trigger("node:selected",{cell:e,options:r,node:e}):e.isEdge()&&this.trigger("edge:selected",{cell:e,options:r,edge:e})}),t.forEach(e=>{this.trigger("cell:unselected",{cell:e,options:r}),e.isNode()?this.trigger("node:unselected",{cell:e,options:r,node:e}):e.isEdge()&&this.trigger("edge:unselected",{cell:e,options:r,edge:e})});const n={added:e,removed:t,options:r,selected:this.cells.filter(e=>!!this.graph.getCellById(e.id))};this.trigger("selection:changed",n)}dispose(){this.clean(),this.remove(),this.off()}}__decorate$3([View.dispose()],SelectionImpl.prototype,"dispose",null),function(e){const t="widget-selection";e.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},e.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},e.depthComparator=function(e){return e.getAncestors().length}}(Private||(Private={}));const content$2=".x6-widget-selection {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n";Graph.prototype.isSelectionEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isEnabled()},Graph.prototype.enableSelection=function(){const e=this.getPlugin("selection");return e&&e.enable(),this},Graph.prototype.disableSelection=function(){const e=this.getPlugin("selection");return e&&e.disable(),this},Graph.prototype.toggleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleEnabled(e),this},Graph.prototype.isMultipleSelection=function(){const e=this.getPlugin("selection");return!!e&&e.isMultipleSelection()},Graph.prototype.enableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.enableMultipleSelection(),this},Graph.prototype.disableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.disableMultipleSelection(),this},Graph.prototype.toggleMultipleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(e),this},Graph.prototype.isSelectionMovable=function(){const e=this.getPlugin("selection");return!!e&&e.isSelectionMovable()},Graph.prototype.enableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.enableSelectionMovable(),this},Graph.prototype.disableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.disableSelectionMovable(),this},Graph.prototype.toggleSelectionMovable=function(e){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(e),this},Graph.prototype.isRubberbandEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isRubberbandEnabled()},Graph.prototype.enableRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableRubberband(),this},Graph.prototype.disableRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableRubberband(),this},Graph.prototype.toggleRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleRubberband(e),this},Graph.prototype.isStrictRubberband=function(){const e=this.getPlugin("selection");return!!e&&e.isStrictRubberband()},Graph.prototype.enableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableStrictRubberband(),this},Graph.prototype.disableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableStrictRubberband(),this},Graph.prototype.toggleStrictRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(e),this},Graph.prototype.setRubberbandModifiers=function(e){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(e),this},Graph.prototype.setSelectionFilter=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(e),this},Graph.prototype.setSelectionDisplayContent=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(e),this},Graph.prototype.isSelectionEmpty=function(){const e=this.getPlugin("selection");return!e||e.isEmpty()},Graph.prototype.cleanSelection=function(e){const t=this.getPlugin("selection");return t&&t.clean(e),this},Graph.prototype.resetSelection=function(e,t){const r=this.getPlugin("selection");return r&&r.reset(e,t),this},Graph.prototype.getSelectedCells=function(){const e=this.getPlugin("selection");return e?e.getSelectedCells():[]},Graph.prototype.getSelectedCellCount=function(){const e=this.getPlugin("selection");return e?e.getSelectedCellCount():0},Graph.prototype.isSelected=function(e){const t=this.getPlugin("selection");return!!t&&t.isSelected(e)},Graph.prototype.select=function(e,t){const r=this.getPlugin("selection");return r&&r.select(e,t),this},Graph.prototype.unselect=function(e,t){const r=this.getPlugin("selection");return r&&r.unselect(e,t),this};var __decorate$2=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Selection2;class Selection extends Basecoat{get rubberbandDisabled(){return!0!==this.options.enabled||!0!==this.options.rubberband}get disabled(){return!0!==this.options.enabled}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},Selection.defaultOptions),e),ensure(this.name,content$2)}init(e){this.graph=e,this.selectionImpl=new SelectionImpl(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return null!=e?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.options.movable}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return null!=e?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return null!=e?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selectionImpl.options.strict}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return null!=e?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const r=this.getCells(e);return r.length&&(this.isMultiple()?this.selectionImpl.select(r,t):this.reset(r.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),r=this.graph.getPlugin("scroller"),n=r&&r.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!n&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(null==t?void 0:t.includes("leftMouseDown"))&&0===e.button||(null==t?void 0:t.includes("mouseWheelDown"))&&1===e.button}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&ModifierKey.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&ModifierKey.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e:e,cell:t}){const r=this.options;let n=this.disabled;!n&&this.movedMap.has(t)&&(n=!1===r.selectCellOnMoved,n||(n=!1===r.selectNodeOnMoved&&t.isNode()),n||(n=!1===r.selectEdgeOnMoved&&t.isEdge())),n||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e:e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(e=>"string"==typeof e?this.graph.getCellById(e):e).filter(e=>null!=e)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return!1!==this.options.multiple}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),clean(this.name)}}__decorate$2([Basecoat.dispose()],Selection.prototype,"dispose",null),Selection2=Selection||(Selection={}),Selection2.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};var __decorate$1=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};class SnaplineImpl extends View{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,r=__rest(e,["graph"]);this.graph=t,this.options=Object.assign({},r),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new Vector("svg"),t=this.horizontal=new Vector("line"),r=this.vertical=new Vector("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),r.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),r.setAttribute("display","none"),e.append([t,r]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){"resize"===e&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:r}){const n=e.getDelegatedView();if(n&&this.isNodeMovable(n)){const n=e.cell.getPosition();this.offset={x:t-n.x,y:r-n.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,r="function"==typeof t?call$1(t,this.graph,e):t;return"number"==typeof r?this.graph.transform.getGraphArea().inflate(r):!0===r?this.graph.transform.getGraphArea():r||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const r=this.graph.renderer.findViewByCell(e);if(r&&r.cell.isNode()){const n=e.getBBox(),i=n.bbox(e.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),s=Angle.normalize(e.getAngle()),l=this.options.tolerance||0;let c,u,d,p,h,f;const g={vertical:0,horizontal:0},m=t.direction,v=t.trueDirection,y=t.relativeDirection;-1!==v.indexOf("right")?g.vertical=a.x:g.vertical=o.x,-1!==v.indexOf("bottom")?g.horizontal=a.y:g.horizontal=o.y,this.model.getNodes().some(t=>{if(this.isIgnored(e,t))return!1;const r=t.getBBox().bbox(t.getAngle()),n=r.getTopLeft(),o=r.getBottomRight(),s={vertical:[n.x,o.x],horizontal:[n.y,o.y]},m={};return Object.keys(s).forEach(e=>{const t=e,r=s[t].map(e=>({position:e,distance:Math.abs(e-g[t])})).filter(e=>e.distance<=l);m[t]=sortBy(r,e=>e.distance)}),null==c&&m.vertical.length>0&&(c=m.vertical[0].position,u=Math.min(i.y,r.y),d=Math.max(a.y,o.y)-u),null==p&&m.horizontal.length>0&&(p=m.horizontal[0].position,h=Math.min(i.x,r.x),f=Math.max(a.x,o.x)-h),null!=c&&null!=p}),this.hide();let b=0,q=0;null==p&&null==c||(null!=c&&(b=-1!==v.indexOf("right")?c-a.x:o.x-c),null!=p&&(q=-1!==v.indexOf("bottom")?p-a.y:o.y-p));let S=0,E=0;if(s%90==0)90===s||270===s?(S=q,E=b):(S=b,E=q);else{const e=s>=0&&s<90?1:s>=90&&s<180?4:s>=180&&s<270?3:2;null!=p&&null!=c&&(b<q?(q=0,p=void 0):(b=0,c=void 0));const t=Angle.toRad(s%90);b&&(S=3===e?b/Math.cos(t):b/Math.sin(t)),q&&(E=3===e?q/Math.cos(t):q/Math.sin(t));const r=1===e||3===e;switch(y){case"top":case"bottom":E=q?q/(r?Math.cos(t):Math.sin(t)):b/(r?Math.sin(t):Math.cos(t));break;case"left":case"right":S=b?b/(r?Math.cos(t):Math.sin(t)):q/(r?Math.sin(t):Math.cos(t))}}switch(y){case"top":case"bottom":S=0;break;case"left":case"right":E=0}const V=this.graph.getGridSize();let C=Math.max(n.width+S,V),T=Math.max(n.height+E,V);t.minWidth&&t.minWidth>V&&(C=Math.max(C,t.minWidth)),t.minHeight&&t.minHeight>V&&(T=Math.max(T,t.minHeight)),t.maxWidth&&(C=Math.min(C,t.maxWidth)),t.maxHeight&&(T=Math.min(T,t.maxHeight)),t.preserveAspectRatio&&(E<S?T=C*(n.height/n.width):C=T*(n.width/n.height)),C===n.width&&T===n.height||(e.resize(C,T,{direction:m,relativeDirection:y,trueDirection:v,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(r)}),d&&(d+=T-n.height),f&&(f+=C-n.width));const A=e.getBBox().bbox(s);c&&Math.abs(A.x-c)>1&&Math.abs(A.width+A.x-c)>1&&(c=void 0),p&&Math.abs(A.y-p)>1&&Math.abs(A.height+A.y-p)>1&&(p=void 0),this.update({verticalLeft:c,verticalTop:u,verticalHeight:d,horizontalTop:p,horizontalLeft:h,horizontalWidth:f})}}}snapOnMoving({view:e,e:t,x:r,y:n}){const i=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),s=o.getPosition(),l=new Rectangle(r-this.offset.x,n-this.offset.y,a.width,a.height),c=o.getAngle(),u=l.getCenter(),d=l.bbox(c),p=d.getTopLeft(),h=d.getBottomRight(),f=this.options.tolerance||0;let g,m,v,y,b,q,S=0,E=0;if(this.model.getNodes().some(e=>{if(this.isIgnored(o,e))return!1;const t=e.getBBox().bbox(e.getAngle()),r=t.getCenter(),n=t.getTopLeft(),i=t.getBottomRight();return null==g&&(Math.abs(r.x-u.x)<f?(g=r.x,S=.5):Math.abs(n.x-p.x)<f?(g=n.x,S=0):Math.abs(n.x-h.x)<f?(g=n.x,S=1):Math.abs(i.x-h.x)<f?(g=i.x,S=1):Math.abs(i.x-p.x)<f&&(g=i.x),null!=g&&(m=Math.min(d.y,t.y),v=Math.max(h.y,i.y)-m)),null==y&&(Math.abs(r.y-u.y)<f?(y=r.y,E=.5):Math.abs(n.y-p.y)<f?y=n.y:Math.abs(n.y-h.y)<f?(y=n.y,E=1):Math.abs(i.y-h.y)<f?(y=i.y,E=1):Math.abs(i.y-p.y)<f&&(y=i.y),null!=y&&(b=Math.min(d.x,t.x),q=Math.max(h.x,i.x)-b)),null!=g&&null!=y}),this.hide(),null!=y||null!=g){null!=y&&(d.y=y-E*d.height),null!=g&&(d.x=g-S*d.width);const e=d.getCenter(),t=e.x-l.width/2,r=e.y-l.height/2,n=t-s.x,a=r-s.y;0===n&&0===a||(o.translate(n,a,{snapped:!0,restrict:this.getRestrictArea(i)}),q&&(q+=n),v&&(v+=a)),this.update({verticalLeft:g,verticalTop:m,verticalHeight:v,horizontalTop:y,horizontalLeft:b,horizontalWidth:q})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e)}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new Point(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new Point(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${r.x}`:"100%",y2:`${r.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${r.x}`,y2:this.options.sharp?`${r.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t="number"==typeof e?e:!1!==e?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}__decorate$1([View.dispose()],SnaplineImpl.prototype,"dispose",null);const content$1=".x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n";Graph.prototype.isSnaplineEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isEnabled()},Graph.prototype.enableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enable(),this},Graph.prototype.disableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disable(),this},Graph.prototype.toggleSnapline=function(){const e=this.getPlugin("snapline");return e&&e.toggleEnabled(),this},Graph.prototype.hideSnapline=function(){const e=this.getPlugin("snapline");return e&&e.hide(),this},Graph.prototype.setSnaplineFilter=function(e){const t=this.getPlugin("snapline");return t&&t.setFilter(e),this},Graph.prototype.isSnaplineOnResizingEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isOnResizingEnabled()},Graph.prototype.enableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.enableOnResizing(),this},Graph.prototype.disableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.disableOnResizing(),this},Graph.prototype.toggleSnaplineOnResizing=function(e){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(e),this},Graph.prototype.isSharpSnapline=function(){const e=this.getPlugin("snapline");return!!e&&e.isSharp()},Graph.prototype.enableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enableSharp(),this},Graph.prototype.disableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disableSharp(),this},Graph.prototype.toggleSharpSnapline=function(e){const t=this.getPlugin("snapline");return t&&t.toggleSharp(e),this},Graph.prototype.getSnaplineTolerance=function(){const e=this.getPlugin("snapline");if(e)return e.getTolerance()},Graph.prototype.setSnaplineTolerance=function(e){const t=this.getPlugin("snapline");return t&&t.setTolerance(e),this};var __decorate=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};class Snapline extends Disposable{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),ensure(this.name,content$1)}init(e){this.snaplineImpl=new SnaplineImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(null==e)return this.isEnabled()?this.disable():this.enable(),this;e!==this.isEnabled()&&(e?this.enable():this.disable())}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return!0===this.snaplineImpl.options.resizing}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return null!=e?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return!0===this.snaplineImpl.options.sharp}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return null!=e?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),clean(this.name)}}__decorate([Disposable.dispose()],Snapline.prototype,"dispose",null);let nanoid=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_","");const CellPanel=e=>{var t,r,n,i,o,a,s,l,c,u,d;const{cell:p,graph:h}=e,[f,g]=React.useState(p.prop());React.useEffect(()=>{},[f]),React.useEffect(()=>{g(p.prop());const e=e=>{const t={...e.cell.prop()};g(t)};return p.on("changed",e),()=>{p.off("changed",e)}},[p]);const m=(e,t)=>{p.prop(e,t)};let v=0,y=0;"edge"===f.shape&&([v,y]=calculateDistanceAndAngle([f.source.x,f.source.y],[f.target.x,f.target.y]));let b="";b="edge"===f.shape?(null==(i=null==(n=null==(r=null==(t=f.labels)?void 0:t[0])?void 0:r.attrs)?void 0:n.label)?void 0:i.text)||"":(null==(a=null==(o=f.attrs)?void 0:o.text)?void 0:a.text)||"";let q=0;return q="edge"===f.shape?(null==(u=null==(c=null==(l=null==(s=f.labels)?void 0:s[0])?void 0:l.attrs)?void 0:c.text)?void 0:u.fontSize)||14:null==(d=f.attrs)?void 0:d.text.fontSize,jsxRuntimeExports.jsxs("div",{className:"cell-panel",children:[jsxRuntimeExports.jsx(PanelOne,{title:"大小"}),"rect"===f.shape||"text"===f.shape?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Space,{size:20,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"宽"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:f.size.width,onChange:e=>{m("size/width",e)}})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"高"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:f.size.height,onChange:e=>{m("size/height",e)}})]})]})}):"circle"===f.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"半径"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:f.size.width,min:0,onChange:e=>{m("size",{width:e,height:e})}})]}):"edge"===f.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"长"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:v,min:0,onChange:e=>{const[t,r]=calculateEndPoint([f.source.x,f.source.y],y,e);m("target",{x:t,y:r})}})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsx(PanelOne,{title:"旋转"}),jsxRuntimeExports.jsx(PanelTwo,{title:"角度"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:"edge"===f.shape?y:f.angle,onChange:e=>{if("edge"===f.shape){const[t,r]=calculateEndPoint([f.source.x,f.source.y],e,v);return void m("target",{x:t,y:r})}m("angle",e)}}),jsxRuntimeExports.jsx(PanelOne,{title:"文本"}),jsxRuntimeExports.jsx(PanelTwo,{title:"内容"}),jsxRuntimeExports.jsx(Input.TextArea,{style:{resize:"none",height:"100px",marginBottom:"16px",background:"#f7f8fa"},value:b,onChange:e=>{const t=e.target.value;"edge"!==f.shape?m("attrs/text/text",t):f.labels?p.setLabelAt(0,t):p.appendLabel({attrs:{text:{text:t}}})}}),jsxRuntimeExports.jsx(PanelTwo,{title:"字号"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"16px"},value:q,min:0,onChange:e=>{"edge"!==f.shape||null==e?m("attrs/text/fontSize",e):f.labels?p.setLabelAt(0,{attrs:{label:{text:b},text:{fontSize:e}}}):p.appendLabel({attrs:{label:{text:b},text:{fontSize:e}}})}})]})},PanelOne=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-one",children:t})},PanelTwo=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-two",children:t})};function calculateDistanceAndAngle(e,t){const[r,n]=e,[i,o]=t,a=Math.sqrt(Math.pow(i-r,2)+Math.pow(o-n,2));let s=Math.atan2(o-n,i-r)*(180/Math.PI);s<0&&(s+=360);return[Math.floor(a),Math.floor(s)]}function calculateEndPoint(e,t,r){const[n,i]=e,o=t*(Math.PI/180),a=n+r*Math.cos(o),s=i+r*Math.sin(o);return[Math.round(a),Math.round(s)]}const{Text:Text$1}=Typography,KeyBordModal=e=>{const{children:t}=e;return jsxRuntimeExports.jsx(Popover,{arrow:!1,trigger:"click",rootClassName:"drawx6-keybordermodal-pop",content:jsxRuntimeExports.jsx("div",{className:"drawx6-keybordermodal-pop-content",children:jsxRuntimeExports.jsx(List,{bordered:!1,dataSource:[{key:["Ctrl","C"],desc:"拷贝"},{key:["Ctrl","V"],desc:"粘贴"},{key:["Ctrl","X"],desc:"剪切"},{key:["Ctrl","Z"],desc:"撤销"},{key:["Ctrl","Shift","Z"],desc:"重做"},{key:["BackSpace"],desc:"删除"},{key:["Ctrl","鼠标拖动"],desc:"平移"},{key:["Ctrl","鼠标滚轮"],desc:"缩放"}],renderItem:(e,t)=>jsxRuntimeExports.jsx(List.Item,{children:jsxRuntimeExports.jsxs(Space,{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[jsxRuntimeExports.jsx(Space,{size:6,children:e.key.map((e,t,r)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(Tag,{style:{marginRight:0},children:e}),t<r.length-1&&"+"]},t))}),jsxRuntimeExports.jsx(Text$1,{strong:!0,children:e.desc})]})},t)})}),children:t})},content=".x6-widget-edgednd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n }\n .x6-widget-edgednd.dragging {\n display: inline-block;\n }\n .x6-widget-edgednd.dragging * {\n pointer-events: none !important;\n }\n .x6-widget-edgednd .x6-graph {\n background: transparent;\n box-shadow: none;\n }\n ",_EdgeDnd=class e extends View{constructor(e){super(),__publicField(this,"name","edgednd"),__publicField(this,"options"),__publicField(this,"draggingGraph"),__publicField(this,"sourceEdge"),__publicField(this,"draggingEdge"),__publicField(this,"length",0),__publicField(this,"draggingBBox"),__publicField(this,"geometryBBox"),__publicField(this,"draggingView"),__publicField(this,"delta"),__publicField(this,"padding"),__publicField(this,"snapOffset"),__publicField(this,"originOffset"),this.options={...e,getDragEdge:e=>e.clone(),getDropEdge:e=>e.clone()},this.init()}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}init(){ensure(this.name,content),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-edgednd")),this.draggingGraph=new Graph({...this.options.delegateGraphOptions,container:document.createElement("div"),width:1,height:1,async:!1}),append(this.container,this.draggingGraph.container)}start(t,r,n){const i=n;i.preventDefault(),this.length=r,this.targetModel.startBatch("edgednd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceEdge=t,this.prepareDragging(t,i.clientX,i.clientY),this.updateNodePosition(i.clientX,i.clientY),this.delegateDocumentEvents(e.documentEvents,i.data)}prepareDragging(e,t,r){const n=this.draggingGraph,i=n.model,o=this.options.getDragEdge(e);o.setSource({x:0,y:0}),o.setTarget({x:0+this.length,y:0});n.scale(1,1),this.clearDragging(),i.resetCells([o]);const a=n.findViewByCell(o);a.undelegateEvents(),a.cell.off("changed"),n.fitToContent({padding:5,allowNewOrigin:"any",useCellGeometry:!1});const s=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(s.getTopLeft()),this.draggingEdge=o,this.draggingView=a,this.draggingBBox=o.getBBox(),this.padding=5,this.originOffset=this.updateGraphPosition(t,r)}clearDragging(){this.draggingEdge&&(this.sourceEdge=null,this.draggingEdge.remove(),this.draggingEdge=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}updateGraphPosition(e,t){const r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,s={left:e-i.x-o.width/2-a+n,top:t-i.y-o.height/2-a+r};return this.draggingGraph&&css$3(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const r=this.targetGraph.clientToLocal(e,t),n=this.draggingBBox;return r.x-=n.width/2,r.y-=n.height/2,this.draggingEdge.setSource({x:r.x,y:r.y}),this.draggingEdge.setTarget({x:r.x+this.length,y:r.y}),r}onDragging(e){if(this.draggingView){e.preventDefault();const t=this.normalizeEvent(e),r=t.clientX,n=t.clientY;this.updateGraphPosition(r,n),this.updateNodePosition(r,n)}}onDragEnd(e){const t=this.draggingEdge;if(t){const r=this.normalizeEvent(e);this.draggingView;const n=this.draggingBBox,i=this.snapOffset;let o=n.x,a=n.y;i&&(o+=i.x,a+=i.y),t.setSource({x:o,y:a}),t.setTarget({x:o+this.length,y:a});(e=>{e?this.onDropped(e):this.onDropInvalid(),this.targetModel.stopBatch("edgednd")})(this.drop(t,{x:r.clientX,y:r.clientY}))}}drop(e,t){if(this.isInsideValidArea(t)){const r=this.targetGraph,n=r.model,i=r.clientToLocal(t),o=this.options.getDropEdge(e),a=o.getBBox();i.x+=a.x-a.width/2,i.y+=a.y-a.height/2;const s=this.snapOffset?1:r.getGridSize(),l=GeometryUtil.snapToGrid(i.x,s),c=GeometryUtil.snapToGrid(i.y,s);return o.setSource({x:l,y:c}),o.setTarget({x:l+this.length,y:c}),o.removeZIndex(),n.addCell(o,{stencil:this.cid}),o}return null}isInsideValidArea(e){let t;const r=this.targetGraph;return t=this.getDropArea(r.container),t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),r=document.body.scrollTop||document.documentElement.scrollTop,n=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css$3(e,"border-left-width"),10)-n,y:t.top+parseInt(css$3(e,"border-top-width"),10)-r,width:e.clientWidth,height:e.clientHeight})}onDropInvalid(){const e=this.draggingEdge;e&&this.onDropped(e)}onDropped(e){this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container)}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}};__publicField(_EdgeDnd,"documentEvents",{mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"});let EdgeDnd=_EdgeDnd;const activeColor="#1677ff",normalColor="#999999",ports={groups:{top:{position:"top",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},right:{position:"right",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},bottom:{position:"bottom",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},left:{position:"left",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}}},items:[{group:"top"},{group:"right"},{group:"bottom"},{group:"left"}]},Editor=React.forwardRef((e,t)=>{const{value:r,onSave:n,onExit:i,savePngType:o="url",editabled:a=!0,showSaveBtn:s=!0}=e,{topProps:l}=useQuestionContext(),{uploadImg:c}=l,u=React.useRef(null),d=React.useRef(null),p=React.useRef(null),h=React.useRef(null),[f,g]=React.useState(!1),[m,v]=React.useState(null),[y,b]=React.useState(!1);React.useEffect(()=>(u.current&&q(u.current),()=>{var e;null==(e=d.current)||e.dispose()}),[]),React.useEffect(()=>{var e;(null==r?void 0:r.cells)&&(null==(e=d.current)||e.fromJSON(r.cells))},[r]);const q=e=>{d.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:a,connecting:{createEdge:()=>new Edge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor"]})},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{"stroke-width":1,stroke:activeColor}}}}}),E(d.current),S(d.current),V(d.current),C(d.current)},S=e=>{e.use(new Export),e.use(new Transform({resizing:{enabled:!0,preserveAspectRatio:e=>"circle"===e.shape},rotating:!0})),e.use(new Selection({rubberband:!0,showNodeSelectionBox:!0})),e.use(new Snapline({className:"x6-snapline-color"})),e.use(new Keyboard),e.use(new Clipboard),e.use(new History)},E=e=>{p.current=new Dnd({target:e}),h.current=new EdgeDnd({target:e})},V=e=>{const t=(e,t)=>{for(let r=0,n=e.length;r<n;r+=1)e[r].style.visibility=t?"visible":"hidden"};e.on("node:mouseenter",({e:e,node:r,view:n})=>{const i=u.current.querySelectorAll(".x6-port-body");t(i,!0)}),e.on("node:mouseleave",({e:e,node:r,view:n})=>{const i=u.current.querySelectorAll(".x6-port-body");t(i,!1)}),e.on("cell:click",({e:e,x:t,y:r,cell:n,view:i})=>{"edge"!==n.shape&&(g(!0),v(n))}),e.on("blank:click",({e:e,x:t,y:r})=>{g(!1),v(null)})},C=e=>{e.bindKey(["meta+c","ctrl+c"],()=>{const t=e.getSelectedCells();return t.length&&e.copy(t,{deep:!0}),!1}),e.bindKey(["meta+x","ctrl+x"],()=>{const t=e.getSelectedCells();return t.length&&e.cut(t,{deep:!0}),!1}),e.bindKey(["meta+v","ctrl+v"],()=>{if(!e.isClipboardEmpty()){const t=e.paste({offset:32});e.cleanSelection(),e.select(t)}return!1}),e.bindKey(["meta+z","ctrl+z"],()=>(e.canUndo()&&e.undo(),!1)),e.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(e.canRedo()&&e.redo(),!1)),e.bindKey("backspace",()=>{const t=e.getSelectedCells();t.length&&e.removeCells(t)})},T=e=>{let t=null;switch(e.currentTarget.getAttribute("data-type")){case"rect":t=d.current.createNode({width:80,height:40,shape:"rect",label:"矩形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"circle":t=d.current.createNode({width:60,height:60,shape:"circle",label:"圆形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"text":t=d.current.createNode({width:80,height:40,shape:"text",tools:["node-editor"]});break;case"hori-line":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:null,sourceMarker:null}},tools:[{name:"edge-editor",args:{labelAddable:!0}},{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]});break;case"arrow":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor",{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]})}t&&(t.isNode()?p.current.start(t,e.nativeEvent):h.current.start(t,100,e.nativeEvent))},A=async()=>new Promise(e=>{var t,r;const n=null==(t=d.current)?void 0:t.toJSON();null==(r=d.current)||r.toPNG(t=>{e({json:n,png:t})},{padding:20,copyStyles:!1})}),x=async(e=!1)=>{if(e){b(!0);const e=await A();if("url"===o){const t=R(e.png),r=new FormData;r.append("file",t);const n=await(null==c?void 0:c({file:r}).catch(()=>{}));(null==n?void 0:n.url)&&(e.png=n.url)}null==n||n(e),b(!1)}null==i||i()},R=e=>{const t=e.replace(/^data:image\/png;base64,/,""),r=atob(t),n=r.length,i=new ArrayBuffer(n),o=new Uint8Array(i);for(let l=0;l<n;l++)o[l]=r.charCodeAt(l);const a=new Blob([i],{type:"image/png"}),s=`${nanoid()}.png`;return new File([a],s,{type:"image/png"})};return React.useImperativeHandle(t,()=>({getGraphInstance:()=>d.current,getData:async()=>{const e=await A();if("url"===o){const t=R(e.png),r=new FormData;r.append("file",t);const n=await(null==c?void 0:c({file:r}).catch(()=>{}));(null==n?void 0:n.url)&&(e.png=n.url)}return e}})),jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-editor"),children:[jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-header drawx6-space",children:[jsxRuntimeExports.jsx("div",{children:"画板"}),jsxRuntimeExports.jsxs(Space,{size:10,children:[jsxRuntimeExports.jsx(Button$1,{ghost:!0,type:"primary",onClick:()=>x(!1),children:"仅退出"}),s&&jsxRuntimeExports.jsx(Button$1,{loading:y,type:"primary",onClick:()=>x(!0),children:"保存并退出"})]})]}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container",children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:u,className:"drawx6-container"})}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container-nav drawx6-overflow-y",children:[jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"rect",onMouseDown:T,children:[jsxRuntimeExports.jsx("div",{className:"graph-rect"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"矩形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"circle",onMouseDown:T,children:[jsxRuntimeExports.jsx("div",{className:"graph-circle"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"圆形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"text",onMouseDown:T,children:[jsxRuntimeExports.jsx(TextSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"文本"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"hori-line",onMouseDown:T,children:[jsxRuntimeExports.jsx(LineSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"水平线"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"arrow",onMouseDown:T,children:[jsxRuntimeExports.jsx(ArrawSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"箭头"})]}),jsxRuntimeExports.jsx(KeyBordModal,{children:jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space",style:{cursor:"default"},children:[jsxRuntimeExports.jsx(KeyBoard,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"快捷键"})]})})]}),jsxRuntimeExports.jsx(Popconfirm,{title:null,description:jsxRuntimeExports.jsxs("div",{style:{marginTop:"-4px"},children:["确认清空画板?清空后无法恢复,",jsxRuntimeExports.jsx("br",{}),"请谨慎操作。"]}),onConfirm:()=>{var e;null==(e=d.current)||e.clearCells()},placement:"bottomRight",arrow:!1,children:jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-clear drawx6-center",style:{right:f?"220px":"20px"},children:jsxRuntimeExports.jsx(ClearSvg,{})})}),f&&jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-control drawx6-overflow-y",children:jsxRuntimeExports.jsx(CellPanel,{cell:m,graph:d.current})})]})]})}),TextSvg=()=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_6137_1319)",children:jsxRuntimeExports.jsx("path",{d:"M13.5394 28.9231H12.3086C11.9394 28.9231 11.6932 29.1692 11.6932 29.5385C11.6932 29.9077 11.9394 30.1539 12.3086 30.1539H13.5394C13.9086 30.1539 14.1547 29.9077 14.1547 29.5385C14.1547 29.1692 13.9086 28.9231 13.5394 28.9231ZM6.15475 28.9231H4.92398C4.8009 28.9231 4.67782 28.9846 4.61629 29.0462V28.3077C4.61629 27.8154 4.18552 27.3846 3.69321 27.3846H1.23167C0.739363 27.3846 0.308594 27.8154 0.308594 28.3077V30.7692C0.308594 31.2615 0.739363 31.6923 1.23167 31.6923H3.69321C4.18552 31.6923 4.61629 31.2615 4.61629 30.7692V30.0308C4.67782 30.0923 4.8009 30.1539 4.92398 30.1539H6.15475C6.52398 30.1539 6.77013 29.9077 6.77013 29.5385C6.77013 29.1692 6.52398 28.9231 6.15475 28.9231ZM3.07782 6.15385C3.07782 5.78462 2.83167 5.53846 2.46244 5.53846C2.09321 5.53846 1.84706 5.78462 1.84706 6.15385V7.38462C1.84706 7.75385 2.09321 8 2.46244 8C2.83167 8 3.07783 7.75385 3.07782 7.38462V6.15385ZM9.84706 28.9231H8.61629C8.24706 28.9231 8.0009 29.1692 8.0009 29.5385C8.0009 29.9077 8.24706 30.1539 8.61629 30.1539H9.84706C10.2163 30.1539 10.4624 29.9077 10.4624 29.5385C10.4624 29.1692 10.2163 28.9231 9.84706 28.9231ZM7.38552 1.84616H6.15475C5.78552 1.84616 5.53936 2.09231 5.53936 2.46154C5.53936 2.83077 5.78552 3.07692 6.15475 3.07692H7.38552C7.75475 3.07692 8.0009 2.83077 8.0009 2.46154C8.0009 2.09231 7.75475 1.84616 7.38552 1.84616ZM3.07782 17.2308C3.07782 16.8615 2.83167 16.6154 2.46244 16.6154C2.09321 16.6154 1.84706 16.8615 1.84706 17.2308V18.4615C1.84706 18.8308 2.09321 19.0769 2.46244 19.0769C2.83167 19.0769 3.07783 18.8308 3.07782 18.4615V17.2308ZM3.07782 20.9231C3.07782 20.5539 2.83167 20.3077 2.46244 20.3077C2.09321 20.3077 1.84706 20.5539 1.84706 20.9231V22.1539C1.84706 22.5231 2.09321 22.7692 2.46244 22.7692C2.83167 22.7692 3.07783 22.5231 3.07782 22.1539V20.9231ZM3.07782 9.84616C3.07782 9.47693 2.83167 9.23077 2.46244 9.23077C2.09321 9.23077 1.84706 9.47693 1.84706 9.84616V11.0769C1.84706 11.4462 2.09321 11.6923 2.46244 11.6923C2.83167 11.6923 3.07783 11.4462 3.07782 11.0769V9.84616ZM13.5394 3.07692H14.7701C15.1394 3.07692 15.3855 2.83077 15.3855 2.46154C15.3855 2.09231 15.1394 1.84616 14.7701 1.84616H13.5394C13.1701 1.84616 12.924 2.09231 12.924 2.46154C12.924 2.83077 13.1701 3.07692 13.5394 3.07692ZM2.46244 24C2.09321 24 1.84706 24.2462 1.84706 24.6154V25.8462C1.84706 26.2154 2.09321 26.4615 2.46244 26.4615C2.83167 26.4615 3.07783 26.2154 3.07782 25.8462V24.6154C3.07782 24.2462 2.83167 24 2.46244 24ZM3.07782 13.5385C3.07782 13.1692 2.83167 12.9231 2.46244 12.9231C2.09321 12.9231 1.84706 13.1692 1.84706 13.5385V14.7692C1.84706 15.1385 2.09321 15.3846 2.46244 15.3846C2.83167 15.3846 3.07783 15.1385 3.07782 14.7692V13.5385ZM20.924 3.07692H22.1548C22.524 3.07692 22.7701 2.83077 22.7701 2.46154C22.7701 2.09231 22.524 1.84616 22.1548 1.84616H20.924C20.5548 1.84616 20.3086 2.09231 20.3086 2.46154C20.3086 2.83077 20.5548 3.07692 20.924 3.07692ZM28.924 20.9231C28.924 21.2923 29.1701 21.5385 29.5394 21.5385C29.9086 21.5385 30.1548 21.2923 30.1548 20.9231V19.6923C30.1548 19.3231 29.9086 19.0769 29.5394 19.0769C29.1701 19.0769 28.924 19.3231 28.924 19.6923V20.9231ZM29.5394 10.4615C29.9086 10.4615 30.1548 10.2154 30.1548 9.84616V8.61539C30.1548 8.24616 29.9086 8 29.5394 8C29.1701 8 28.924 8.24616 28.924 8.61539V9.84616C28.924 10.2154 29.1701 10.4615 29.5394 10.4615ZM28.924 17.2308C28.924 17.6 29.1701 17.8462 29.5394 17.8462C29.9086 17.8462 30.1548 17.6 30.1548 17.2308V16C30.1548 15.6308 29.9086 15.3846 29.5394 15.3846C29.1701 15.3846 28.924 15.6308 28.924 16V17.2308ZM28.924 24.6154C28.924 24.9846 29.1701 25.2308 29.5394 25.2308C29.9086 25.2308 30.1548 24.9846 30.1548 24.6154V23.3846C30.1548 23.0154 29.9086 22.7692 29.5394 22.7692C29.1701 22.7692 28.924 23.0154 28.924 23.3846V24.6154ZM9.84706 3.07692H11.0778C11.4471 3.07692 11.6932 2.83077 11.6932 2.46154C11.6932 2.09231 11.4471 1.84616 11.0778 1.84616H9.84706C9.47783 1.84616 9.23167 2.09231 9.23167 2.46154C9.23167 2.83077 9.47783 3.07692 9.84706 3.07692ZM17.2317 28.9231H16.0009C15.6317 28.9231 15.3855 29.1692 15.3855 29.5385C15.3855 29.9077 15.6317 30.1539 16.0009 30.1539H17.2317C17.6009 30.1539 17.8471 29.9077 17.8471 29.5385C17.8471 29.1692 17.6009 28.9231 17.2317 28.9231ZM20.924 28.9231H19.6932C19.324 28.9231 19.0778 29.1692 19.0778 29.5385C19.0778 29.9077 19.324 30.1539 19.6932 30.1539H20.924C21.2932 30.1539 21.5394 29.9077 21.5394 29.5385C21.5394 29.1692 21.2932 28.9231 20.924 28.9231ZM24.6163 28.9231H23.3855C23.0163 28.9231 22.7701 29.1692 22.7701 29.5385C22.7701 29.9077 23.0163 30.1539 23.3855 30.1539H24.6163C24.9855 30.1539 25.2317 29.9077 25.2317 29.5385C25.2317 29.1692 24.9855 28.9231 24.6163 28.9231ZM17.2317 3.07692H18.4624C18.8317 3.07692 19.0778 2.83077 19.0778 2.46154C19.0778 2.09231 18.8317 1.84616 18.4624 1.84616H17.2317C16.8624 1.84616 16.6163 2.09231 16.6163 2.46154C16.6163 2.83077 16.8624 3.07692 17.2317 3.07692ZM28.924 13.5385C28.924 13.9077 29.1701 14.1538 29.5394 14.1538C29.9086 14.1538 30.1548 13.9077 30.1548 13.5385V12.3077C30.1548 11.9385 29.9086 11.6923 29.5394 11.6923C29.1701 11.6923 28.924 11.9385 28.924 12.3077V13.5385ZM25.8471 1.84616H24.6163C24.2471 1.84616 24.0009 2.09231 24.0009 2.46154C24.0009 2.83077 24.2471 3.07692 24.6163 3.07692H25.8471C26.2163 3.07692 26.4624 2.83077 26.4624 2.46154C26.4624 2.09231 26.2163 1.84616 25.8471 1.84616ZM17.6624 24V10.7692H22.7701V8H9.23167V10.7692H14.4624V24H17.6624ZM1.23167 4.61539H3.69321C4.18552 4.61539 4.61629 4.18462 4.61629 3.69231V1.23077C4.61629 0.738463 4.18552 0.307693 3.69321 0.307693H1.23167C0.739363 0.307693 0.308594 0.738463 0.308594 1.23077V3.69231C0.308594 4.18462 0.739363 4.61539 1.23167 4.61539ZM30.7701 0.307693H28.3086C27.8163 0.307693 27.3855 0.738463 27.3855 1.23077V3.69231C27.3855 4.18462 27.8163 4.61539 28.3086 4.61539H29.0471C28.9855 4.67692 28.924 4.8 28.924 4.92308V6.15385C28.924 6.52308 29.1701 6.76923 29.5394 6.76923C29.9086 6.76923 30.1548 6.52308 30.1548 6.15385V4.92308C30.1548 4.8 30.0932 4.67692 30.0317 4.61539H30.7701C31.2624 4.61539 31.6932 4.18462 31.6932 3.69231V1.23077C31.6932 0.738463 31.2624 0.307693 30.7701 0.307693ZM30.7701 27.3846H30.1548V27.0769C30.1548 26.7077 29.9086 26.4615 29.5394 26.4615C29.1701 26.4615 28.924 26.7077 28.924 27.0769V27.3846H28.3086C27.8163 27.3846 27.3855 27.8154 27.3855 28.3077V28.9231H27.0778C26.7086 28.9231 26.4624 29.1692 26.4624 29.5385C26.4624 29.9077 26.7086 30.1539 27.0778 30.1539H27.3855V30.7692C27.3855 31.2615 27.8163 31.6923 28.3086 31.6923H30.7701C31.2624 31.6923 31.6932 31.2615 31.6932 30.7692V28.3077C31.6932 27.8154 31.2624 27.3846 30.7701 27.3846Z",fill:"#999999"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_6137_1319",children:jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"})})})]}),LineSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M6.2069 18.6207V21.1034H0V14.8965H6.2069V17.3793H29.7931V14.8965H36V21.1034H29.7931V18.6207H6.2069Z",fill:"#999999"})}),ArrawSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.1875 17.9118L25.1875 11.3857V17.2H0.8125V18.8H25.1875V24.6143L35.1875 17.9118Z",fill:"#999999"})}),ClearSvg=()=>jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.884 12.8993C11.884 13.3639 11.5054 13.7425 11.0408 13.7425H4.96411C4.74038 13.7425 4.52579 13.6537 4.3675 13.4956C4.2092 13.3375 4.12014 13.123 4.11988 12.8993V3.94589H11.884V12.8993ZM5.80735 2.43241C5.80735 2.33553 5.88248 2.25941 5.98035 2.25941H10.0344C10.1323 2.25941 10.2074 2.33553 10.2074 2.43241V2.94053H5.80735V2.43241ZM14.4138 2.94053H11.2128V2.43241C11.2128 1.78391 10.6839 1.25404 10.0344 1.25404H5.98035C5.66807 1.25483 5.3688 1.37923 5.14798 1.60004C4.92717 1.82086 4.80277 2.12013 4.80198 2.43241V2.94053H1.59015C1.45539 2.94053 1.32615 2.99406 1.23086 3.08935C1.13557 3.18464 1.08203 3.31389 1.08203 3.44865C1.08203 3.58341 1.13557 3.71265 1.23086 3.80794C1.32615 3.90323 1.45539 3.95677 1.59015 3.95677H3.10364V12.8993C3.10364 13.9264 3.93699 14.7578 4.96411 14.7578H11.0398C11.284 14.7579 11.5258 14.7099 11.7515 14.6166C11.9771 14.5233 12.1822 14.3864 12.3549 14.2139C12.5277 14.0413 12.6648 13.8364 12.7583 13.6108C12.8519 13.3853 12.9001 13.1435 12.9003 12.8993V3.94589H14.4128C14.6945 3.94589 14.9219 3.71852 14.9219 3.43777C14.9218 3.37159 14.9085 3.30609 14.8827 3.2451C14.857 3.18411 14.8194 3.12886 14.7721 3.08257C14.7248 3.03628 14.6688 2.99987 14.6072 2.97549C14.5457 2.9511 14.4799 2.93921 14.4138 2.94053ZM8.00195 12.2182C8.28271 12.2182 8.51007 11.9908 8.51007 11.71V6.30262C8.51007 6.16786 8.45654 6.03862 8.36125 5.94333C8.26596 5.84804 8.13672 5.7945 8.00195 5.7945C7.86719 5.7945 7.73795 5.84804 7.64266 5.94333C7.54737 6.03862 7.49383 6.16786 7.49383 6.30262V11.71C7.49383 11.9908 7.7212 12.2182 8.00195 12.2182ZM5.63435 12.2182C5.9151 12.2182 6.14247 11.9908 6.14247 11.71V6.30262C6.14247 6.16786 6.08894 6.03862 5.99365 5.94333C5.89836 5.84804 5.76911 5.7945 5.63435 5.7945C5.49959 5.7945 5.37035 5.84804 5.27506 5.94333C5.17977 6.03862 5.12623 6.16786 5.12623 6.30262V11.71C5.13612 11.9908 5.36349 12.2182 5.63435 12.2182ZM10.3696 12.2182C10.6513 12.2182 10.8787 11.9908 10.8787 11.71V6.30262C10.8787 6.23583 10.8655 6.16969 10.8399 6.10798C10.8144 6.04628 10.7769 5.99021 10.7297 5.94298C10.6825 5.89575 10.6264 5.85828 10.5647 5.83272C10.503 5.80716 10.4368 5.79401 10.3701 5.79401C10.3033 5.79401 10.2371 5.80716 10.1754 5.83272C10.1137 5.85828 10.0576 5.89575 10.0104 5.94298C9.96318 5.99021 9.92571 6.04628 9.90015 6.10798C9.87459 6.16969 9.86144 6.23583 9.86144 6.30262V11.71C9.86144 11.9908 10.0888 12.2182 10.3696 12.2182Z"})}),KeyBoard=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M9.83398 4.15039C11.3405 4.15201 12.7852 4.75035 13.8506 5.81543C14.9161 6.88062 15.5156 8.32539 15.5176 9.83203V13.4824H20.4844V9.83594L20.4922 9.55371C20.5632 8.14986 21.152 6.81818 22.1504 5.81934C23.2155 4.75392 24.6596 4.15448 26.166 4.15234C27.6725 4.15384 29.1171 4.75238 30.1826 5.81738C31.2482 6.88257 31.8476 8.32733 31.8496 9.83398L31.8428 10.1152C31.7718 11.5193 31.1832 12.8516 30.1846 13.8506C29.1194 14.9161 27.6746 15.5156 26.168 15.5176H22.5176V20.4844H26.168C27.6743 20.4864 29.1185 21.0862 30.1836 22.1514C31.182 23.1499 31.7714 24.4812 31.8428 25.8848L31.8496 26.167C31.8479 27.6732 31.2494 29.1173 30.1846 30.1826C29.1194 31.2482 27.6746 31.8476 26.168 31.8496L25.8867 31.8428C24.4827 31.7718 23.1503 31.1832 22.1514 30.1846C21.0858 29.1194 20.4864 27.6746 20.4844 26.168V22.5176H15.5176V26.168L15.5098 26.4502C15.4383 27.8537 14.849 29.1851 13.8506 30.1836C12.7855 31.2486 11.3412 31.8466 9.83496 31.8486C8.32824 31.8474 6.88316 31.2496 5.81738 30.1846C4.75165 29.1194 4.15238 27.6748 4.15039 26.168L4.15723 25.8867C4.22817 24.4827 4.81682 23.1503 5.81543 22.1514C6.81394 21.1525 8.14594 20.5637 9.5498 20.4922L9.83203 20.4844H13.4824V15.5176H9.83594L9.55371 15.5098C8.14943 15.4392 6.81665 14.8511 5.81738 13.8525C4.75158 12.7874 4.15253 11.3427 4.15039 9.83594C4.15139 8.32878 4.74997 6.88336 5.81543 5.81738C6.81442 4.81806 8.14719 4.22829 9.55176 4.15723L9.83398 4.15039ZM9.68555 22.5225C7.74117 22.6014 6.18669 24.2064 6.18652 26.168C6.18652 28.1818 7.82394 29.8193 9.83594 29.8193C11.8497 29.8191 13.4863 28.1817 13.4863 26.168V22.5176H9.68555V22.5225ZM22.5176 26.168C22.5176 28.1817 24.1542 29.8192 26.168 29.8193C28.182 29.8193 29.8174 28.1817 29.8174 26.168C29.8172 24.1543 28.1799 22.5176 26.168 22.5176H22.5176V26.168ZM15.5176 20.4844H20.4844V15.5195H15.5176V20.4844ZM9.83594 6.18652C7.82195 6.18652 6.18652 7.82412 6.18652 9.83789C6.18673 11.8497 7.82412 13.4863 9.83594 13.4863H13.4863V9.83594C13.4863 7.82405 11.8496 6.18671 9.83594 6.18652ZM26.168 6.18652C24.1543 6.18669 22.5176 7.82404 22.5176 9.83594V13.4863H26.168C28.1818 13.4863 29.8172 11.8495 29.8174 9.83594C29.8174 7.82206 28.1818 6.18652 26.168 6.18652Z",fill:"#999999",stroke:"white",strokeWidth:"0.3"})}),Drawx6=React.forwardRef((e,t)=>{const{height:r="300px",maskTip:n="点击画板进入绘制",value:i,onSave:o,savePngType:a="url",showSaveBtn:s}=e,[l,c]=React.useState(!1),u=React.useRef(null);return React.useImperativeHandle(t,()=>{var e;return{getIsFullScreen:()=>l,getData:null==(e=u.current)?void 0:e.getData}}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Show,{height:r,value:i,maskTip:n,maskClick:()=>{c(!0)}}),l&&jsxRuntimeExports.jsx(Editor,{ref:u,value:i,savePngType:a,editabled:!0,onSave:o,onExit:()=>{c(!1)},showSaveBtn:s})]})}),Draw=e=>{const{status:t=QuestionStatus.EXAM,data:r,onSubmit:n}=e,[i,o]=React.useState(),a=React.useRef(null),s=(e,i=!0)=>{if("exam"!==t)return;const a={userAnswerOption:{content:null==e?void 0:e.json,photo:null==e?void 0:e.png},questionCode:null==r?void 0:r.questionCode};o(null==e?void 0:e.json),null==n||n(a),i&&staticMethods.success("保存成功")};return React.useEffect(()=>{if("exam"!==t)return;const e=async e=>{var t,r;const{type:n}=e.data??{};if("examTimeEnd5"===n&&(null==(t=a.current)?void 0:t.getIsFullScreen())){const e=await(null==(r=a.current)?void 0:r.getData());s(e,!1)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t]),React.useEffect(()=>{if(r){const{answerOption:e}=r;e&&!Array.isArray(e)&&o(null==e?void 0:e.content)}},[r,t]),jsxRuntimeExports.jsxs("div",{className:"draw-question",children:[jsxRuntimeExports.jsx("div",{className:"draw-question-title",children:jsxRuntimeExports.jsxs("div",{className:"draw-question-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("span",{className:"score",children:[null==r?void 0:r.score,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"画图题"}),((null==r?void 0:r.hasAutoScore)??(null==r?void 0:r.judgeMode)===CCMJudgeMode.AI_AGENT)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:null==r?void 0:r.topic,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"draw-question-content",children:[jsxRuntimeExports.jsx(Drawx6,{ref:a,value:i,showSaveBtn:"mark"!==t&&"view"!==t,onSave:s,maskTip:"mark"===t||"view"===t?"点击画板查看答题":"点击画板进入答题"}),["add","mark"].includes(t)&&!!(null==r?void 0:r.judgeNorm)&&jsxRuntimeExports.jsx(Collapse,{defaultActiveKey:"add"===t?["1"]:[],ghost:!0,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$i,{rotate:e?90:0}),items:[{key:"1",label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{style:{fontWeight:"bold"},children:"判分标准"}),jsxRuntimeExports.jsx("span",{style:{fontSize:"12px",color:"#999999"},children:"(学生不可见)"})]}),children:jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,readOnly:!0,defaultValue:r.judgeNorm,noPadding:!0,autoHeight:{min:0,max:1e4}})}]}),r.difficulty&&jsxRuntimeExports.jsx("div",{className:"draw-question-content-others",children:jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[r.difficulty]})]})})]})]},null==r?void 0:r.questionCode)},Composite=e=>{var t;const{data:r}=e,{children:n,difficulty:i,topic:o,score:a}=r,[s,l]=React.useState([]),c=React.useRef(null);return React.useEffect(()=>{const e=null==n?void 0:n.map((e,t)=>(null==e?void 0:e.questionCode)||t);l(e)},[null==(t=null==r?void 0:r.children)?void 0:t.length]),jsxRuntimeExports.jsxs("div",{className:"composite",children:[jsxRuntimeExports.jsx("div",{className:"composite-title",children:jsxRuntimeExports.jsxs("div",{className:"composite-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[a&&jsxRuntimeExports.jsxs("span",{className:"score",children:[a,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"组合题"}),(null==r?void 0:r.hasAutoScore)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:o,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"composite-content",children:[jsxRuntimeExports.jsx(Collapse,{activeKey:s,ghost:!0,ref:c,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$i,{rotate:e?90:0}),onChange:e=>{l(Array.isArray(e)?e:[e])},items:null==n?void 0:n.map((e,t)=>({key:(null==e?void 0:e.questionCode)||t,label:`第${t+1}小题(${questionTypesMap[null==e?void 0:e.type]})`,children:jsxRuntimeExports.jsx(QuestionRender,{data:e})}))}),jsxRuntimeExports.jsx("div",{className:"composite-content-others",children:i&&jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[i]})]})})]})]})},QuestionRender=React.forwardRef((e,t)=>{const{data:r,questionProps:n={},listeners:i}=e,{onSubmit:o,onNextQuestion:a,editable:s=!1,deleteable:l=!1,onDelete:c=()=>{},onEditOk:u=()=>{},buttonText:d="",showQuestionTip:p=!1,langList:h,showResult:f,status:g=QuestionStatus.PREVIEW,className:m="",styles:v={},uploadImg:y,codeTestURL:b,codeplayerURL:q,rightTopButtonArr:S,unknowQesutionRender:E,QuestionTopRender:V,QuestionBottomRender:C,onlyAdd:T,toRunCodeQuestion:A}=n,[x,R]=React.useState(!1),[w,k]=React.useState(!0),[N,_]=React.useState(!1),[O,I]=React.useState(""),P=React.useMemo(()=>{const e={...r},{optionJson:t,type:n}=r;return!t||n!==QuestionTypeEnum.ACM&&n!==QuestionTypeEnum.CCM||(e.lang=null==t?void 0:t.defaultLanguage),e},[r]);React.useImperativeHandle(t,()=>({setEditShow:e=>R(e),setShowOperateButton:k,addQuestion:()=>{_(!0)}}));const[D,F]=React.useState((e=>{switch(e){case QuestionTypeEnum.RADIO:return"";case QuestionTypeEnum.CHECKBOX:return[];case QuestionTypeEnum.ANSWER:case QuestionTypeEnum.JUDGE:return"";case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return{code:"",language:"javascript"};case QuestionTypeEnum.COMPLETION:return[];case QuestionTypeEnum.DRAW:case QuestionTypeEnum.COMPOSITE:return{};default:return null}})(P.type)),L=e=>jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:y}},children:jsxRuntimeExports.jsxs("div",{className:`question-wrapper ${m}`,style:{...v},children:[w&&jsxRuntimeExports.jsxs("div",{className:"operate-area",children:[s&&jsxRuntimeExports.jsx(Tooltip,{title:"编辑",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$a,{}),onClick:()=>R(!0)},"edit")}),l&&jsxRuntimeExports.jsx(Tooltip,{title:"删除",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$e,{}),onClick:()=>c(P)},"delete")}),(null==S?void 0:S.length)&&S.map(e=>{const{text:r,icon:n,needBindRef:o}=e,a={...e};return delete a.needBindRef,jsxRuntimeExports.jsx(Tooltip,{title:r,children:React.createElement(Button$1,{...a,ref:o?t:null,size:"small",key:r??(null==n?void 0:n.toString()),"data-cypress":o?"draggable-handle":"",...o?i:{}})},r??(null==n?void 0:n.toString()))})]}),V&&V(P),e,C&&C(P)]})}),U={data:P,onSubmit:o,buttonText:d,status:g,onNextQuestion:a};if(T)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:y}},children:N&&jsxRuntimeExports.jsx(Modal,{style:{top:"40%"},open:N,footer:null,title:"请选择题型",width:300,onCancel:()=>{_(!1),I("")},children:jsxRuntimeExports.jsx(Select,{style:{width:"100%"},placeholder:"请选择",onChange:e=>{_(!1),I(e),R(!0)},options:questionTypeSelectOptions})})})});switch(P.type){case QuestionTypeEnum.RADIO:case QuestionTypeEnum.CHECKBOX:return(()=>{const e=jsxRuntimeExports.jsx(ChoiceQuestion,{showQuestionTip:p,showResult:f,...U});return L(e)})();case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return(()=>{const e=jsxRuntimeExports.jsx(Preview,{codeTestURL:b,codeplayerURL:q,toRunCodeQuestion:A,...U});return L(e)})();case QuestionTypeEnum.COMPLETION:return(()=>{const e=jsxRuntimeExports.jsx(Completion,{showResult:f,...U});return L(e)})();case QuestionTypeEnum.ANSWER:return(()=>{const e=jsxRuntimeExports.jsx(AnswerQuestion,{...U});return L(e)})();case QuestionTypeEnum.DRAW:return(()=>{const e=jsxRuntimeExports.jsx(Draw,{...U});return L(e)})();case QuestionTypeEnum.COMPOSITE:return(()=>{const e=jsxRuntimeExports.jsx(Composite,{...U});return L(e)})();default:return E?E(P):jsxRuntimeExports.jsx("div",{children:"未知题型"})}}),useQuestionRender=()=>{const e=React.useRef(null);return{ref:e,setEditShow:t=>{var r,n;return null==(n=null==(r=e.current)?void 0:r.setEditShow)?void 0:n.call(r,t)},setShowOperateButton:t=>{var r,n;return null==(n=null==(r=e.current)?void 0:r.setShowOperateButton)?void 0:n.call(r,t)}}};function _getDefaults(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let _defaults=_getDefaults();function changeDefaults(e){_defaults=e}const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},getEscapeReplacement=e=>escapeReplacements[e];function escape$1(e,t){if(t){if(escapeTest.test(e))return e.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(e))return e.replace(escapeReplaceNoEncode,getEscapeReplacement);return e}const caret=/(^|[^\[])\^/g;function edit(e,t){let r="string"==typeof e?e:e.source;t=t||"";const n={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(caret,"$1"),r=r.replace(e,i),n},getRegex:()=>new RegExp(r,t)};return n}function cleanUrl(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const noopTest={exec:()=>null};function splitCells(e,t){const r=e.replace(/\|/g,(e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"}).split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function rtrim(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){if(e.charAt(n-i-1)!==t)break;i++}return e.slice(0,n-i)}function findClosingBracket(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}function outputLink(e,t,r,n){const i=t.href,o=t.title?escape$1(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:i,title:o,text:escape$1(a)}}function indentCodeCompensation(e,t){const r=e.match(/^(\s+)(?:```)/);if(null===r)return t;const n=r[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e}).join("\n")}class _Tokenizer{constructor(e){__publicField(this,"options"),__publicField(this,"rules"),__publicField(this,"lexer"),this.options=e||_defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rtrim(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=indentCodeCompensation(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=rtrim(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:rtrim(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=rtrim(t[0],"\n").split("\n"),r="",n="";const i=[];for(;e.length>0;){let t=!1;const o=[];let a;for(a=0;a<e.length;a++)if(/^ {0,3}>/.test(e[a]))o.push(e[a]),t=!0;else{if(t)break;o.push(e[a])}e=e.slice(a);const s=o.join("\n"),l=s.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");r=r?`${r}\n${s}`:s,n=n?`${n}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;const u=i[i.length-1];if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,o=t.raw+"\n"+e.join("\n"),a=this.blockquote(o);i[i.length-1]=a,r=r.substring(0,r.length-t.raw.length)+a.raw,n=n.substring(0,n.length-t.text.length)+a.text;break}if("list"===(null==u?void 0:u.type)){const t=u,o=t.raw+"\n"+e.join("\n"),a=this.list(o);i[i.length-1]=a,r=r.substring(0,r.length-u.raw.length)+a.raw,n=n.substring(0,n.length-t.raw.length)+a.raw,e=o.substring(i[i.length-1].raw.length).split("\n");continue}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a=!1;for(;e;){let r=!1,n="",s="";if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let l=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,s=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(/[^ ]/),d=d>4?1:d,s=l.slice(d),d+=t[1].length),u&&/^ *$/.test(c)&&(n+=c+"\n",e=e.substring(c.length+1),r=!0),!r){const t=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(r.test(e))break;if(c.search(/[^ ]/)>=d||!c.trim())s+="\n"+c.slice(d);else{if(u)break;if(l.search(/[^ ]/)>=4)break;if(i.test(l))break;if(o.test(l))break;if(r.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),n+=a+"\n",e=e.substring(a.length+1),l=c.slice(d)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(n)&&(a=!0));let p,h=null;this.options.gfm&&(h=/^\[[ xX]\] /.exec(s),h&&(p="[ ] "!==h[0],s=s.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:n,task:!!h,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=n}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter(e=>"space"===e.type),r=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const r=splitCells(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const e of n)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(const e of i)o.rows.push(splitCells(e,o.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:escape$1(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=rtrim(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=findClosingBracket(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),outputLink(t,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const e=t[(r[2]||r[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return outputLink(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n)return;if(n[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const r=[...n[0]].length-1;let i,o,a=r,s=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){s+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+s);const t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=escape$1(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=escape$1(t[1]),r="mailto:"+e):(e=escape$1(t[1]),r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){var t;let r;if(r=this.rules.inline.url.exec(e)){let e,n;if("@"===r[2])e=escape$1(r[0]),n="mailto:"+e;else{let i;do{i=r[0],r[0]=(null==(t=this.rules.inline._backpedal.exec(r[0]))?void 0:t[0])??""}while(i!==r[0]);e=escape$1(r[0]),n="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:escape$1(t[0]),{type:"text",raw:t[0],text:e}}}}const newline=/^(?: *(?:\n|$))+/,blockCode=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bullet=/(?:[*+-]|\d{1,9}[.)])/,lheading=edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,bullet).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),_paragraph=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,blockText=/^[^\n]+/,_blockLabel=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def=edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",_blockLabel).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list=edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet).getRegex(),_tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,html$3=edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",_comment).replace("tag",_tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph=edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockquote=edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph).getRegex(),blockNormal={blockquote:blockquote,code:blockCode,def:def,fences:fences,heading:heading,hr:hr,html:html$3,lheading:lheading,list:list,newline:newline,paragraph:paragraph,table:noopTest,text:blockText},gfmTable=edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockGfm={...blockNormal,table:gfmTable,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex()},blockPedantic={...blockNormal,html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",lheading).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,inlineCode=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,inlineText=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_punctuation="\\p{P}\\p{S}",punctuation=edit(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,_punctuation).getRegex(),blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,emStrongLDelim=edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,_punctuation).getRegex(),emStrongRDelimAst=edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,_punctuation).getRegex(),emStrongRDelimUnd=edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,_punctuation).getRegex(),anyPunctuation=edit(/\\([punct])/,"gu").replace(/punct/g,_punctuation).getRegex(),autolink=edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),_inlineComment=edit(_comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),tag=edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_inlineComment).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link=edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_inlineLabel).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink=edit(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel).replace("ref",_blockLabel).getRegex(),nolink=edit(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel).getRegex(),reflinkSearch=edit("reflink|nolink(?!\\()","g").replace("reflink",reflink).replace("nolink",nolink).getRegex(),inlineNormal={_backpedal:noopTest,anyPunctuation:anyPunctuation,autolink:autolink,blockSkip:blockSkip,br:br,code:inlineCode,del:noopTest,emStrongLDelim:emStrongLDelim,emStrongRDelimAst:emStrongRDelimAst,emStrongRDelimUnd:emStrongRDelimUnd,escape:escape$2,link:link,nolink:nolink,punctuation:punctuation,reflink:reflink,reflinkSearch:reflinkSearch,tag:tag,text:inlineText,url:noopTest},inlinePedantic={...inlineNormal,link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel).getRegex()},inlineGfm={...inlineNormal,escape:edit(escape$2).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},inlineBreaks={...inlineGfm,br:edit(br).replace("{2,}","*").getRegex(),text:edit(inlineGfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},block={normal:blockNormal,gfm:blockGfm,pedantic:blockPedantic},inline={normal:inlineNormal,gfm:inlineGfm,breaks:inlineBreaks,pedantic:inlinePedantic};class _Lexer{constructor(e){__publicField(this,"tokens"),__publicField(this,"options"),__publicField(this,"state"),__publicField(this,"tokenizer"),__publicField(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_defaults,this.options.tokenizer=this.options.tokenizer||new _Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:block.normal,inline:inline.normal};this.options.pedantic?(t.block=block.pedantic,t.inline=inline.pedantic):this.options.gfm&&(t.block=block.gfm,this.options.breaks?t.inline=inline.breaks:t.inline=inline.gfm),this.tokenizer.rules=t}static get rules(){return{block:block,inline:inline}}static lex(e,t){return new _Lexer(t).lex(e)}static lexInline(e,t){return new _Lexer(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){let n,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(e,t,r)=>t+" ".repeat(r.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?t.push(n):(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startBlock.forEach(e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))i=t[t.length-1],r&&"paragraph"===(null==i?void 0:i.type)?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,i,o,a,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,s))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startInline.forEach(e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}}class _Renderer{constructor(e){__publicField(this,"options"),__publicField(this,"parser"),this.options=e||_defaults}space(e){return""}code({text:e,lang:t,escaped:r}){var n;const i=null==(n=(t||"").match(/^\S*/))?void 0:n[0],o=e.replace(/\n$/,"")+"\n";return i?'<pre><code class="language-'+escape$1(i)+'">'+(r?o:escape$1(o,!0))+"</code></pre>\n":"<pre><code>"+(r?o:escape$1(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,r=e.start;let n="";for(let o=0;o<e.items.length;o++){const t=e.items[o];n+=this.listitem(t)}const i=t?"ol":"ul";return"<"+i+(t&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+i+">\n"}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",r="";for(let i=0;i<e.header.length;i++)r+=this.tablecell(e.header[i]);t+=this.tablerow({text:r});let n="";for(let i=0;i<e.rows.length;i++){const t=e.rows[i];r="";for(let e=0;e<t.length;e++)r+=this.tablecell(t[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),i=cleanUrl(e);if(null===i)return n;let o='<a href="'+(e=i)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r}){const n=cleanUrl(e);if(null===n)return r;let i=`<img src="${e=n}" alt="${r}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class _TextRenderer{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class _Parser{constructor(e){__publicField(this,"options"),__publicField(this,"renderer"),__publicField(this,"textRenderer"),this.options=e||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _TextRenderer}static parse(e,t){return new _Parser(t).parse(e)}static parseInline(e,t){return new _Parser(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}const o=i;switch(o.type){case"space":r+=this.renderer.space(o);continue;case"hr":r+=this.renderer.hr(o);continue;case"heading":r+=this.renderer.heading(o);continue;case"code":r+=this.renderer.code(o);continue;case"table":r+=this.renderer.table(o);continue;case"blockquote":r+=this.renderer.blockquote(o);continue;case"list":r+=this.renderer.list(o);continue;case"html":r+=this.renderer.html(o);continue;case"paragraph":r+=this.renderer.paragraph(o);continue;case"text":{let i=o,a=this.renderer.text(i);for(;n+1<e.length&&"text"===e[n+1].type;)i=e[++n],a+="\n"+this.renderer.text(i);r+=t?this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a}]}):a;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}const o=i;switch(o.type){case"escape":case"text":r+=t.text(o);break;case"html":r+=t.html(o);break;case"link":r+=t.link(o);break;case"image":r+=t.image(o);break;case"strong":r+=t.strong(o);break;case"em":r+=t.em(o);break;case"codespan":r+=t.codespan(o);break;case"br":r+=t.br(o);break;case"del":r+=t.del(o);break;default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return r}}class _Hooks{constructor(e){__publicField(this,"options"),this.options=e||_defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}__publicField(_Hooks,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Marked{constructor(...e){__publicField(this,"defaults",_getDefaults()),__publicField(this,"options",this.setOptions),__publicField(this,"parse",this.parseMarkdown(_Lexer.lex,_Parser.parse)),__publicField(this,"parseInline",this.parseMarkdown(_Lexer.lexInline,_Parser.parseInline)),__publicField(this,"Parser",_Parser),__publicField(this,"Renderer",_Renderer),__publicField(this,"TextRenderer",_TextRenderer),__publicField(this,"Lexer",_Lexer),__publicField(this,"Tokenizer",_Tokenizer),__publicField(this,"Hooks",_Hooks),this.use(...e)}walkTokens(e,t){var r,n;let i=[];for(const o of e)switch(i=i.concat(t.call(this,o)),o.type){case"table":{const e=o;for(const r of e.header)i=i.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=o;i=i.concat(this.walkTokens(e.items,t));break}default:{const e=o;(null==(n=null==(r=this.defaults.extensions)?void 0:r.childTokens)?void 0:n[e.type])?this.defaults.extensions.childTokens[e.type].forEach(r=>{const n=e[r].flat(1/0);i=i.concat(this.walkTokens(n,t))}):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){const t=this.defaults.renderer||new _Renderer(this.defaults);for(const r in e.renderer){if(!(r in t))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,i=e.renderer[n],o=t[n];t[n]=(...e)=>{let r=i.apply(t,e);return!1===r&&(r=o.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const r in e.tokenizer){if(!(r in t))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,i=e.tokenizer[n],o=t[n];t[n]=(...e)=>{let r=i.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new _Hooks;for(const r in e.hooks){if(!(r in t))throw new Error(`hook '${r}' does not exist`);if("options"===r)continue;const n=r,i=e.hooks[n],o=t[n];_Hooks.passThroughHooks.has(r)?t[n]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>o.call(t,e));const r=i.call(t,e);return o.call(t,r)}:t[n]=(...e)=>{let r=i.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _Lexer.lex(e,t??this.defaults)}parser(e,t){return _Parser.parse(e,t??this.defaults)}parseMarkdown(e,t){return(r,n)=>{const i={...n},o={...this.defaults,...i},a=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(t=>e(t,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>t(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let n=e(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e10){return a(e10)}}}onError(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+escape$1(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}}const markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;const CodePlayer$1=React.forwardRef((e,t)=>{const{envStatus:r,podName:n,runnerBaseUrl:i}=React.useContext(KnowledgeCardContext),{data:o,hasTitle:a=!0,toScore:s,errorHanle:l,codeChange:c}=e,u=React.useRef(null),[d,p]=React.useState(!0),[h,f]=React.useState(!1),g=debounce$2(e=>{null==c||c(e.code)}),m=React.useRef(null);return React.useEffect(()=>(f(!1),p(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{f(!0)},1e3),()=>{m.current&&clearTimeout(m.current)}),[o]),React.useImperativeHandle(t,()=>({toInstallPackage:e=>{var t,r;(null==(t=u.current)?void 0:t.contentWindow)&&postRobot.send(null==(r=u.current)?void 0:r.contentWindow,"vgenPackages",{packages:e})}})),jsxRuntimeExports.jsx(Spin,{spinning:d,children:jsxRuntimeExports.jsx("div",{className:"codePlayer",children:jsxRuntimeExports.jsx("div",{className:"codePlayerContent",style:{height:a?"":"100%"},children:h&&jsxRuntimeExports.jsx("iframe",{ref:u,allowFullScreen:!0,allow:"clipboard-write;clipboard-read",src:`${i||"https://run.cloudlab.top"}/embedded?fromVgen=true`,style:{border:"none"},title:"CodeRunner",className:"CodeRunner-iframe",onLoad:async()=>{var e,t,i,a;try{p(!1);const d=null==(e=u.current)?void 0:e.contentWindow,{topic:h="",content:f="",lang:m="",code:v="",cases:y=[]}=o;let b=f;try{b=marked.parse(f)}catch(c){}let q=[];if("html"===m)try{const e=JSON.parse(v);q=[e.html,e.css,e.js]}catch(c){}"html"!==m||q.length||(q=[v,"",""]);let S={...o};const E={title:h,content:b,lang:m,code:"html"===m?q:v,aiEnabled:!1,run:!1,cases:y,customButtons:s?[{name:"提交",value:"submit",style:{background:"#0064ff",color:"#ffffff"}}]:[]};r&&n&&(E.podName=n,E.nameSpace="pty-prod"),postRobot.send(d,"send",E),s&&postRobot.on("submit",{window:d},async function(e){var t,r;(null==(t=e.data)?void 0:t.code)?(staticMethods.success("提交成功,AI开始自动评分..."),s(null==(r=e.data)?void 0:r.code)):staticMethods.warning("请先作答!")}),postRobot.on("change",{window:null==(t=u.current)?void 0:t.contentWindow},async function(e){var t,r,n,i,o;if("html"===m)try{const i={html:(null==(t=e.data)?void 0:t[0])??"",css:(null==(r=e.data)?void 0:r[1])??"",js:(null==(n=e.data)?void 0:n[2])??""};S.code=JSON.stringify(i)}catch(c){S.code=(null==(i=e.data)?void 0:i[0])??""}else S.code=(null==(o=e.data)?void 0:o[0])??"";g(S)}),postRobot.on("errorHandle",{window:null==(i=u.current)?void 0:i.contentWindow},async function(e){var t,r,n;null==l||l({lang:null==(t=e.data)?void 0:t.lang,code:null==(r=e.data)?void 0:r.code,error:null==(n=e.data)?void 0:n.error})}),postRobot.on("getToken",{window:null==(a=u.current)?void 0:a.contentWindow},async e=>({token:localStorage.getItem("token")}))}catch(c){}}})})})})}),CodePlayer=e=>{const{data:t,hasTitle:r=!0,toScore:n,codeChange:i}=e,{quizBaseUrl:o}=React.useContext(KnowledgeCardContext),a=React.useRef(null),[s,l]=React.useState(!0),[c,u]=React.useState(!1),d=debounce$2(e=>{null==i||i(e.code)}),p=React.useRef(null);return React.useEffect(()=>(u(!1),l(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{u(!0)},1e3),()=>{p.current&&clearTimeout(p.current)}),[t]),jsxRuntimeExports.jsx(Spin,{spinning:s,children:jsxRuntimeExports.jsxs("div",{className:"codeQuiz",children:[r&&jsxRuntimeExports.jsx("div",{className:"codeQuizTitle",children:"CodeQuiz"}),jsxRuntimeExports.jsx("div",{className:"codeQuizContent",style:{height:r?"":"100%"},children:c&&jsxRuntimeExports.jsx("iframe",{ref:a,allowFullScreen:!0,allow:"clipboard-write;clipboard-read",src:`${o||"https://quiz.cloudlab.top"}`,style:{border:"none"},title:"CodeQuiz",className:"codeQuiz-iframe",onLoad:async()=>{var e,r,i;try{l(!1);const s=null==(e=a.current)?void 0:e.contentWindow,{topic:c="",content:u="",lang:p="",code:h="",cases:f=[]}=t;let g=f;g=f.map(e=>"string"==typeof e.input?{...e,input:tryParseJSON(e.input)||[]}:{...e});let m=u;try{m=marked.parse(u)}catch(o){}let v={...t};postRobot.send(s,"send",{title:c,content:m,lang:p,code:h,cases:g,aiEnabled:!1,run:!1,customButtons:n?[{name:"判分",value:"submit",style:{background:"#0064ff",color:"#ffffff"}}]:[]}),n&&postRobot.on("submit",{window:s},async function(e){var t,r;(null==(t=e.data)?void 0:t.code)?(staticMethods.success("提交成功,AI开始自动评分..."),n(null==(r=e.data)?void 0:r.code)):staticMethods.warning("请先作答!")}),postRobot.on("change",{window:null==(r=a.current)?void 0:r.contentWindow},async function(e){var t,r,n,i;if("html"===p)try{const i={html:(null==(t=e.data)?void 0:t[0])??"",css:(null==(r=e.data)?void 0:r[1])??"",js:(null==(n=e.data)?void 0:n[2])??""};v.code=JSON.stringify(i)}catch(o){v.code=(null==(i=e.data)?void 0:i[0])??""}else v.code=e.data??"";d(v)}),postRobot.on("getToken",{window:null==(i=a.current)?void 0:i.contentWindow},async e=>({token:localStorage.getItem("token")}))}catch(o){}}})})]})})},warnSvg="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='18px'%20height='18px'%20viewBox='0%200%2018%2018'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e注意%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='解析合集'%20transform='translate(-347.000000,%20-127.000000)'%20fill-rule='nonzero'%3e%3cg%20id='编组-5'%20transform='translate(347.000000,%20125.000000)'%3e%3cg%20id='注意'%20transform='translate(0.000000,%202.000000)'%3e%3cpath%20d='M0,9%20C0,12.2153903%201.71539025,15.1865334%204.5,16.7942286%20C7.28460967,18.4019238%2010.7153903,18.4019238%2013.5,16.7942286%20C16.2846097,15.1865334%2018,12.2153903%2018,9%20C18,4.02943722%2013.9705627,0%209,0%20C4.02943725,0%200,4.02943722%200,9%20Z'%20id='路径'%20fill='%230064FF'%3e%3c/path%3e%3cpath%20d='M9,13.090909%20C9.29230822,13.090909%209.56241216,13.2468535%209.70856628,13.4999999%20C9.8547204,13.7531462%209.8547204,14.0650354%209.70856628,14.3181817%20C9.56241216,14.5713281%209.29230822,14.7272726%209,14.7272726%20C8.54813066,14.7272726%208.18181818,14.3609601%208.18181818,13.9090908%20C8.18181818,13.4572215%208.54813066,13.090909%209,13.090909%20L9,13.090909%20Z%20M9,3.27272725%20C9.45186934,3.27272725%209.81818182,3.63903972%209.81818182,4.09090906%20L9.81818182,11.0454545%20C9.81818182,11.4973238%209.45186934,11.8636363%209,11.8636363%20C8.54813066,11.8636363%208.18181818,11.4973238%208.18181818,11.0454545%20L8.18181818,4.09090906%20C8.18181818,3.63903972%208.54813066,3.27272725%209,3.27272725%20L9,3.27272725%20Z'%20id='形状'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",VgenModal=e=>{const{title:t,content:r,cancelText:n,okText:i,onOk:o,onCancel:a,onCancelCallback:s,footer:l=!0,contentType:c="center",noIcon:u=!1,blackMode:d=!1}=e;return jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs(Modal,{...e,title:null,footer:null,classNames:{container:classNames("vgenModal","left"===c&&"modalLeft",d&&"blackMode")},className:classNames("modalWrapper",d&&"blackMode"),children:[jsxRuntimeExports.jsxs("div",{className:classNames("modalContent","center"===c&&"modalContentCenter"),children:[t&&jsxRuntimeExports.jsxs("div",{className:classNames("modalTitle","left"===c&&"modalTitleLeft"),children:[!u&&jsxRuntimeExports.jsx("img",{src:warnSvg}),t]}),jsxRuntimeExports.jsx("div",{className:classNames("modalContentText","center"===c&&"modalContentTextCenter"),children:r})]}),l&&jsxRuntimeExports.jsxs("div",{className:classNames("modalFooter",d&&"blackMode"),children:[jsxRuntimeExports.jsx(Button$1,{type:"primary",className:classNames("btnOk",d&&"blackMode"),onClick:o,children:i}),jsxRuntimeExports.jsx(Button$1,{className:classNames("btnCancel",d&&"blackMode"),onClick:()=>{null==a||a(),null==s||s()},children:n})]})]})})};function QuanPingIcon(e){return jsxRuntimeExports.jsx("svg",{style:e.style,className:e.className,width:e.width||16,height:e.height||16,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2200",children:jsxRuntimeExports.jsx("path",{d:"M256 170.666667a128 128 0 0 0-128 128v213.333333a42.666667 42.666667 0 1 0 85.333333 0V298.666667a42.666667 42.666667 0 0 1 42.666667-42.666667h213.333333a42.666667 42.666667 0 1 0 0-85.333333H256z m512 682.666666a128 128 0 0 0 128-128v-170.666666a42.666667 42.666667 0 1 0-85.333333 0v170.666666a42.666667 42.666667 0 0 1-42.666667 42.666667h-192a42.666667 42.666667 0 1 0 0 85.333333H768z",fill:e.fill||"#2c2c2c","p-id":"2201"})})}function TuiChuQuanPingIcon(e){return jsxRuntimeExports.jsx("svg",{style:e.style,className:e.className,width:e.width||16,height:e.height||16,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2410",children:jsxRuntimeExports.jsx("path",{d:"M384 512a128 128 0 0 0 128-128V170.666667a42.666667 42.666667 0 1 0-85.333333 0v213.333333a42.666667 42.666667 0 0 1-42.666667 42.666667H170.666667a42.666667 42.666667 0 1 0 0 85.333333h213.333333z m277.333333 42.666667a128 128 0 0 0-128 128v170.666666a42.666667 42.666667 0 1 0 85.333334 0v-170.666666a42.666667 42.666667 0 0 1 42.666666-42.666667H853.333333a42.666667 42.666667 0 1 0 0-85.333333h-192z",fill:e.fill||"#2c2c2c","p-id":"2411"})})}function AIAssistantIcon(e){return jsxRuntimeExports.jsx("svg",{style:e.style,className:e.className,width:e.width||16,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5049",children:jsxRuntimeExports.jsx("path",{d:"M492.288 37.632a486.2464 486.2464 0 0 1 202.3936 44.2368 479.9488 479.9488 0 0 1 115.712 75.264 468.48 468.48 0 0 1 99.9936 124.672 458.8032 458.8032 0 0 1 47.104 128.0512 451.5328 451.5328 0 0 1 4.0448 158.4128 42.496 42.496 0 0 1-14.7456 26.7776 42.3936 42.3936 0 0 1-28.5184 10.5472 42.1376 42.1376 0 0 1-30.9248-12.8 42.1376 42.1376 0 0 1-12.288-37.5296 366.08 366.08 0 0 0-7.3728-145.8176 365.1584 365.1584 0 0 0-43.264-101.5808 374.9376 374.9376 0 0 0-71.8848-85.1968 384.5632 384.5632 0 0 0-94.4128-61.3888 393.216 393.216 0 0 0-127.7952-34.4064 398.6944 398.6944 0 0 0-203.8784 34.4064 391.5264 391.5264 0 0 0-94.464 61.44 381.2352 381.2352 0 0 0-71.8336 85.1456 372.0192 372.0192 0 0 0-47.4112 119.5008 365.1584 365.1584 0 0 0 60.8256 285.7472 376.4736 376.4736 0 0 0 50.2784 57.5488l13.0048 12.1344 5.12 109.7728a6.144 6.144 0 0 0 3.072 5.0176 7.8336 7.8336 0 0 0 7.3728 0.768l114.7904-42.5472 13.8752 4.0448a399.9744 399.9744 0 0 0 40.7552 9.5744l7.0656 1.1776 4.4544 0.7168 2.3552 0.3584 7.168 0.9216 3.4304 0.4608 3.8912 0.4096a42.3424 42.3424 0 0 1 27.7504 14.336 42.3424 42.3424 0 0 1 11.1616 29.1328 42.1376 42.1376 0 0 1-12.8 30.9248 42.1376 42.1376 0 0 1-35.7888 12.544l-3.8912-0.4608-4.2496-0.512-8.2944-1.0752-3.3792-0.512-5.2736-0.8192-8.2944-1.3824a489.3696 489.3696 0 0 1-36.2496-7.936l-88.064 32.6144a90.9824 90.9824 0 0 1-85.1968-9.2672c-27.136-17.5616-41.472-42.3424-43.008-74.3936l-3.5328-74.752a467.4048 467.4048 0 0 1-74.0864-97.792 457.5232 457.5232 0 0 1-49.4592-130.9696 451.84 451.84 0 0 1 46.592-311.3472 459.264 459.264 0 0 1 83.1488-109.056A468.3264 468.3264 0 0 1 248.832 103.168 477.952 477.952 0 0 1 399.872 46.4896 484.6592 484.6592 0 0 1 492.3392 37.632z m165.7856 589.2608l79.872 245.1968h-71.168l-15.6672-56.832h-53.4016l-15.7184 56.832H512l77.6192-245.248h68.4544z m166.2464 0v245.248h-67.584v-245.248h67.584z m106.24 31.5904c5.0688 0 8.2432 2.56 9.6768 7.5776l9.984 36.0448c3.7376 13.4656 11.5712 22.272 23.552 26.368l32.6144 11.0592c4.608 1.536 6.9632 4.864 6.9632 9.9328 0 5.12-2.304 8.3968-6.9632 9.984l-32.5632 11.0592c-12.032 4.096-19.8656 12.8512-23.6032 26.368l-9.984 36.0448c-1.4336 5.0688-4.608 7.5776-9.6768 7.5776-5.0176 0-8.192-2.56-9.6256-7.5776l-9.984-36.0448c-3.7376-13.5168-11.6224-22.272-23.6032-26.368l-32.6144-11.0592c-4.608-1.536-6.912-4.864-6.912-9.984 0-5.0688 2.304-8.3968 6.912-9.9328l32.6144-11.0592c11.9808-4.096 19.8656-12.9024 23.552-26.368l10.0352-36.0448c1.3824-5.0688 4.608-7.5776 9.6256-7.5776z m-305.6128 29.4912c-4.9664 19.5072-10.24 38.9632-15.8208 58.368l-4.7104 18.8928h41.0112l-4.7104-18.8928a689.152 689.152 0 0 1-6.7072-24.6272 1065.8816 1065.8816 0 0 0-7.936-29.696 1275.2896 1275.2896 0 0 1-1.1264-4.0448zM343.04 334.336c15.7696 0 29.184 5.5808 40.3968 16.6912 11.1104 11.1616 16.6912 24.576 16.6912 40.3968V460.288c0 15.7696-5.5808 29.2352-16.6912 40.3968-11.1616 11.1616-24.6272 16.6912-40.3968 16.6912-15.7696 0-29.184-5.5296-40.3456-16.6912a54.9888 54.9888 0 0 1-16.7424-40.3968V391.424c0-15.7696 5.5808-29.2352 16.7424-40.3968 11.1104-11.1104 24.576-16.6912 40.3456-16.6912z m318.6688 0c15.7696 0 29.184 5.5808 40.3968 16.6912 11.1104 11.1616 16.6912 24.576 16.6912 40.3968V460.288c0 15.7696-5.5808 29.2352-16.6912 40.3968-11.1616 11.1616-24.576 16.6912-40.3968 16.6912-15.7696 0-29.184-5.5296-40.3456-16.6912a54.9888 54.9888 0 0 1-16.7424-40.3968V391.424c0-15.7696 5.632-29.2352 16.7424-40.3968 11.1616-11.1104 24.576-16.6912 40.3456-16.6912z",fill:e.fill||"#2c2c2c","p-id":"5050"})})}const QuestionPractice=({questionsList:e,questionOperations:t,submitQuestion:r,getCodeSaveAnswer:n,createQuestionCallback:i,saveQuetionCode:o,temScoreData:a,scoreData:s,problemSloving:l,createQuestionLoading:c,createQuestionLoadingText:u,toRunCodeQuestionCallback:d,runCodeErrorCallback:p,mode:h})=>{var f,g,m,v,y;const[b,q]=React.useState(0),[S,E]=React.useState(!1),[V,C]=React.useState(),[T,A]=React.useState(),[x,R]=React.useState(!1),[w,k]=React.useState(!1),[N,_]=React.useState(!1);React.useEffect(()=>{(null==D?void 0:D.userAnswer)?k(!0):k(!1)},[b,e]);const O=React.useRef(null),I=()=>{E(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{E(!1)},0)},P=e=>{const t=D,r=e||t.userAnswer,{answer:n,answerOption:i}=t;switch(t.type){case QuestionTypeEnum.CHECKBOX:case QuestionTypeEnum.RADIO:return r===n||r&&isArrayEqual(null==r?void 0:r.split(","),null==n?void 0:n.split(","));case QuestionTypeEnum.COMPLETION:return null==i?void 0:i.every((e,t)=>{var n;return(null==e?void 0:e.answer)===(null==(n=null==r?void 0:r[t])?void 0:n.answer)});default:return!0}},D=React.useMemo(()=>e?e[b]:{},[b,e]),F=e=>{r(V,e)},L=e=>{null==o||o(e,V)};return jsxRuntimeExports.jsx(Spin,{spinning:!0===c,tip:u||"题目生成中...",styles:{wrapper:{height:"vertical"===h?"calc(100% - 60px)":"100%"}},children:jsxRuntimeExports.jsxs("div",{className:"questionPractice",children:[(null==e?void 0:e.length)>0?jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",style:{height:"100%"},children:jsxRuntimeExports.jsxs(Splitter,{style:{maxHeight:"100%"},children:[jsxRuntimeExports.jsx(Splitter.Panel,{min:275,max:400,defaultSize:300,children:jsxRuntimeExports.jsx("div",{className:"mr",style:{height:"100%"},children:jsxRuntimeExports.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-sm overflow-y-auto h-full",children:[jsxRuntimeExports.jsx("h3",{className:"font-semibold text-gray-800 mb-4",children:"题目列表"}),(null==e?void 0:e.length)>0&&jsxRuntimeExports.jsx("div",{className:"space-y-3 pr-[12px] left-que-item",children:e.map((t,r)=>{var n,i,o;return jsxRuntimeExports.jsxs("button",{onClick:()=>{q(r),I()},className:"w-full text-left p-4 rounded-lg border-2 transition-all "+(b===r?"border-blue-500 bg-blue-50 shadow-md":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium "+(b===r?"bg-blue-600 text-white":"bg-gray-200 text-gray-600"),children:r+1}),jsxRuntimeExports.jsx("div",{className:"p-1 rounded "+(b===r?"bg-blue-100":"bg-gray-100"),children:getQuestionTypeIcon(t.type)}),e[r].userAnswer&&jsxRuntimeExports.jsx("div",{className:"text-xs px-2 py-1 rounded-1 font-medium text-green-500 bg-green-100}",children:"已完成"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${getDifficultyColor(t.difficulty||"")}`,children:"low"===t.difficulty?"简单":"middle"===t.difficulty?"中等":"困难"}),t.score?jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1 text-xs text-gray-500",children:[jsxRuntimeExports.jsx(Star,{className:"w-3 h-3"}),jsxRuntimeExports.jsx("span",{children:t.score})]}):null]})]}),jsxRuntimeExports.jsx(Tooltip,{title:(t.topic||t.content||"").replace(/<[^>]*>/g,""),children:jsxRuntimeExports.jsx("h4",{className:"font-medium text-sm mb-1 text-ellipsis line-clamp-2 "+(b===r?"text-blue-800":"text-gray-800"),children:jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:t.topic||t.content||""}})})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[(null==(n=null==t?void 0:t.labels)?void 0:n.length)?jsxRuntimeExports.jsx("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full",children:null==(o=null==(i=null==t?void 0:t.labels)?void 0:i[0])?void 0:o.labelName}):jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500",children:getQuestionTypeName(t.type)})]})]},t.content||""+r)})})]})})}),jsxRuntimeExports.jsx(Splitter.Panel,{children:jsxRuntimeExports.jsx("div",{className:"h-full",children:jsxRuntimeExports.jsxs("div",{className:"h-full bg-white rounded-lg pb-5 pt-4 relative",children:[!S&&D&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"flex justify-end ant-btn-important absolute top-0 right-0 z-10",children:null==t?void 0:t(D)}),jsxRuntimeExports.jsx(QuestionRender,{data:D,questionProps:{onSubmit:e=>{null==r||r(D,e)},toRunCodeQuestion:()=>(async e=>{var t,r;null==d||d(e),C(e);const{lang:i="",topic:o,content:a,title:s,exampleList:l,verifyMode:c,userAnswer:u,optionJson:p,code:h}=e;let f=u||(null==n?void 0:n(V))||h;A({lang:i||(null==(t=null==p?void 0:p.languages)?void 0:t[0]),topic:o||s,content:a,verifyMode:c||(null==p?void 0:p.verifyMode)||(null==(r=null==e?void 0:e.optionJson)?void 0:r.verifyMode),code:f,cases:l||e.testCaseList||e.exampleList}),R(!0)})(D),showResult:!0,onNextQuestion:()=>{b<e.length-1?(q(b+1),I(),k(!1)):staticMethods.warning("已经是最后一题了")}}})]},D.id+D.questionId+D.userAnswer),w&&(null==D?void 0:D.type)!==QuestionTypeEnum.CCM&&(null==D?void 0:D.type)!==QuestionTypeEnum.ACM&&jsxRuntimeExports.jsxs("div",{className:"question-result mt-6 p-4 rounded-lg "+(P()?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"),children:[[QuestionTypeEnum.RADIO,QuestionTypeEnum.CHECKBOX,QuestionTypeEnum.COMPLETION].includes(D.type)&&jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[P()?jsxRuntimeExports.jsx(CircleCheckBig,{className:"w-5 h-5 text-green-600"}):jsxRuntimeExports.jsx(CircleX,{className:"w-5 h-5 text-red-600"}),jsxRuntimeExports.jsx("span",{className:"font-medium "+(P()?"text-green-800":"text-red-800"),children:P()?"回答正确!":"回答错误"}),!P()&&jsxRuntimeExports.jsx("span",{className:"text-red-600 text-sm bg-red-100 px-2 py-1 rounded-full",children:"已加入错题本"})]}),jsxRuntimeExports.jsx("div",{className:"text-gray-700 text-sm",children:(null==D?void 0:D.analyze)&&jsxRuntimeExports.jsxs("div",{className:"analyze",children:[jsxRuntimeExports.jsx("div",{className:"analyzeTitle",children:"答案分析"}),jsxRuntimeExports.jsx("div",{className:"analyzeContent",children:"answer"===D.type?jsxRuntimeExports.jsx(MyReactMarkdown,{children:(null==(f=null==D?void 0:D.analyze)?void 0:f.answerAnalysis)||(null==(g=null==D?void 0:D.analyze)?void 0:g.answer)}):jsxRuntimeExports.jsx(MyReactMarkdown,{children:null==(m=null==D?void 0:D.analyze)?void 0:m.answerAnalysis})})]})})]})]})})})]})}):jsxRuntimeExports.jsx(Empty,{image:emptyImg,description:jsxRuntimeExports.jsxs("div",{className:"emptyDescription",children:["暂无相关题目 ",i&&jsxRuntimeExports.jsx("span",{onClick:()=>i(),children:"现在生成"})]})}),jsxRuntimeExports.jsx(VgenModal,{contentType:"left",open:x,onCancel:()=>{R(!1)},blackMode:(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT,maskClosable:!1,footer:!1,content:jsxRuntimeExports.jsxs("div",{className:"codePlayerModal",id:"codePlayerModal",style:{background:(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT?"black":"#ffffff"},children:[jsxRuntimeExports.jsx(Button$1,{className:"fullScreenBtn",icon:N?TuiChuQuanPingIcon({fill:"#919191"}):QuanPingIcon({fill:"#919191"}),type:"text",onClick:()=>{var e;_(e=>!e),N?null==document||document.exitFullscreen():null==(e=document.querySelector("#codePlayerModal"))||e.requestFullscreen()}}),jsxRuntimeExports.jsx("div",{className:"code",children:(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT?jsxRuntimeExports.jsx(CodePlayer,{data:T,hasTitle:!1,toScore:F,codeChange:L}):jsxRuntimeExports.jsx(CodePlayer$1,{data:T,hasTitle:!1,toScore:F,codeChange:L,errorHanle:p})}),(a||s)&&jsxRuntimeExports.jsx("div",{className:`${(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT&&"quiz-wrapper"}`,children:jsxRuntimeExports.jsxs("div",{className:`scoreArea ${(null==T?void 0:T.verifyMode)===CCMVerifyMode.INPUT_OUTPUT&&"quiz-theme"}`,children:[jsxRuntimeExports.jsx("div",{className:"header",children:"AI分析区"}),a?jsxRuntimeExports.jsx("div",{className:"content",children:jsxRuntimeExports.jsx(MyReactMarkdown,{children:a})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"content",children:[jsxRuntimeExports.jsxs(Row,{children:[jsxRuntimeExports.jsx(Col,{span:12,children:jsxRuntimeExports.jsx(Statistic,{title:"总分",value:(null==s?void 0:s.score)??10})}),jsxRuntimeExports.jsx(Col,{span:12,children:jsxRuntimeExports.jsx(Statistic,{title:"最终得分",value:(null==s?void 0:s.userScore)??0})})]}),jsxRuntimeExports.jsx(List,{header:"判分依据:",children:(null==(v=null==s?void 0:s.reasons)?void 0:v.length)&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==(y=null==s?void 0:s.reasons)?void 0:y.map(e=>jsxRuntimeExports.jsx(List.Item,{children:jsxRuntimeExports.jsx(List.Item.Meta,{title:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{children:["条目:",e.item]}),jsxRuntimeExports.jsxs("div",{children:["得分:",e.score]})]}),description:jsxRuntimeExports.jsxs("span",{children:["原因:",e.reason]})})},e.item))})})]}),l&&jsxRuntimeExports.jsxs("div",{className:"content",children:[jsxRuntimeExports.jsx("h3",{children:"思考过程&答题思路"}),jsxRuntimeExports.jsx(MyReactMarkdown,{children:l})]})]})]})})]})})]})})};var cryptoJs={exports:{}},core$2={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,function(e){var t;e.exports=(t=t||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==commonjsGlobal&&commonjsGlobal.crypto&&(r=commonjsGlobal.crypto),!r&&"function"==typeof commonjsRequire)try{r=require$$0$1}catch(err){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(err){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(err){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},a=o.lib={},s=a.Base=function(){return{extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var a=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new l.init(t,e)}}),c=o.enc={},u=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(r,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(r,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e10){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,o);if(c){for(var d=0;d<c;d+=a)this._doProcessBlock(i,d);r=i.splice(0,c),n.sigBytes-=u}return new l.init(r,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new f.HMAC.init(e,r).finalize(t)}}});var f=o.algo={};return o}(Math),t)}(core$2)),core$2.exports}var x64Core={exports:{}},hasRequiredX64Core;function requireX64Core(){return hasRequiredX64Core||(hasRequiredX64Core=1,function(e){var t;e.exports=(t=requireCore(),function(e){var r=t,n=r.lib,i=n.Base,o=n.WordArray,a=r.x64={};a.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=i.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})}(),t)}(x64Core)),x64Core.exports}var libTypedarrays={exports:{}},hasRequiredLibTypedarrays;function requireLibTypedarrays(){return hasRequiredLibTypedarrays||(hasRequiredLibTypedarrays=1,function(e){var t;e.exports=(t=requireCore(),function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,r=e.init,n=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,n=[],i=0;i<t;i++)n[i>>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)};n.prototype=e}}(),t.lib.WordArray)}(libTypedarrays)),libTypedarrays.exports}var encUtf16={exports:{}},hasRequiredEncUtf16;function requireEncUtf16(){return hasRequiredEncUtf16||(hasRequiredEncUtf16=1,function(e){var t;e.exports=(t=requireCore(),function(){var e=t,r=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var a=i(t[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return r.create(n,2*t)}}}(),t.enc.Utf16)}(encUtf16)),encUtf16.exports}var encBase64={exports:{}},hasRequiredEncBase64;function requireEncBase64(){return hasRequiredEncBase64||(hasRequiredEncBase64=1,function(e){var t;e.exports=(t=requireCore(),function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return r.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o<r;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<r;s++)i.push(n.charAt(a>>>6*(3-s)&63));var l=n.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(encBase64)),encBase64.exports}var encBase64url={exports:{}},hasRequiredEncBase64url;function requireEncBase64url(){return hasRequiredEncBase64url||(hasRequiredEncBase64url=1,function(e){var t;e.exports=(t=requireCore(),function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return r.create(i,o)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,l=0;l<4&&a+.75*l<n;l++)o.push(i.charAt(s>>>6*(3-l)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e,t){void 0===t&&(t=!0);var r=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a<i.length;a++)o[i.charCodeAt(a)]=a}var s=i.charAt(64);if(s){var l=e.indexOf(s);-1!==l&&(r=l)}return n(e,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),t.enc.Base64url)}(encBase64url)),encBase64url.exports}var md5={exports:{}},hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,function(e){var t;e.exports=(t=requireCore(),function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],l=e[t+1],h=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],q=e[t+9],S=e[t+10],E=e[t+11],V=e[t+12],C=e[t+13],T=e[t+14],A=e[t+15],x=o[0],R=o[1],w=o[2],k=o[3];x=c(x,R,w,k,a,7,s[0]),k=c(k,x,R,w,l,12,s[1]),w=c(w,k,x,R,h,17,s[2]),R=c(R,w,k,x,f,22,s[3]),x=c(x,R,w,k,g,7,s[4]),k=c(k,x,R,w,m,12,s[5]),w=c(w,k,x,R,v,17,s[6]),R=c(R,w,k,x,y,22,s[7]),x=c(x,R,w,k,b,7,s[8]),k=c(k,x,R,w,q,12,s[9]),w=c(w,k,x,R,S,17,s[10]),R=c(R,w,k,x,E,22,s[11]),x=c(x,R,w,k,V,7,s[12]),k=c(k,x,R,w,C,12,s[13]),w=c(w,k,x,R,T,17,s[14]),x=u(x,R=c(R,w,k,x,A,22,s[15]),w,k,l,5,s[16]),k=u(k,x,R,w,v,9,s[17]),w=u(w,k,x,R,E,14,s[18]),R=u(R,w,k,x,a,20,s[19]),x=u(x,R,w,k,m,5,s[20]),k=u(k,x,R,w,S,9,s[21]),w=u(w,k,x,R,A,14,s[22]),R=u(R,w,k,x,g,20,s[23]),x=u(x,R,w,k,q,5,s[24]),k=u(k,x,R,w,T,9,s[25]),w=u(w,k,x,R,f,14,s[26]),R=u(R,w,k,x,b,20,s[27]),x=u(x,R,w,k,C,5,s[28]),k=u(k,x,R,w,h,9,s[29]),w=u(w,k,x,R,y,14,s[30]),x=d(x,R=u(R,w,k,x,V,20,s[31]),w,k,m,4,s[32]),k=d(k,x,R,w,b,11,s[33]),w=d(w,k,x,R,E,16,s[34]),R=d(R,w,k,x,T,23,s[35]),x=d(x,R,w,k,l,4,s[36]),k=d(k,x,R,w,g,11,s[37]),w=d(w,k,x,R,y,16,s[38]),R=d(R,w,k,x,S,23,s[39]),x=d(x,R,w,k,C,4,s[40]),k=d(k,x,R,w,a,11,s[41]),w=d(w,k,x,R,f,16,s[42]),R=d(R,w,k,x,v,23,s[43]),x=d(x,R,w,k,q,4,s[44]),k=d(k,x,R,w,V,11,s[45]),w=d(w,k,x,R,A,16,s[46]),x=p(x,R=d(R,w,k,x,h,23,s[47]),w,k,a,6,s[48]),k=p(k,x,R,w,y,10,s[49]),w=p(w,k,x,R,T,15,s[50]),R=p(R,w,k,x,m,21,s[51]),x=p(x,R,w,k,V,6,s[52]),k=p(k,x,R,w,f,10,s[53]),w=p(w,k,x,R,S,15,s[54]),R=p(R,w,k,x,l,21,s[55]),x=p(x,R,w,k,b,6,s[56]),k=p(k,x,R,w,A,10,s[57]),w=p(w,k,x,R,v,15,s[58]),R=p(R,w,k,x,C,21,s[59]),x=p(x,R,w,k,g,6,s[60]),k=p(k,x,R,w,E,10,s[61]),w=p(w,k,x,R,h,15,s[62]),R=p(R,w,k,x,q,21,s[63]),o[0]=o[0]+x|0,o[1]=o[1]+R|0,o[2]=o[2]+w|0,o[3]=o[3]+k|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<<o|s>>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<<o|s>>>32-o)+t}function d(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<<o|s>>>32-o)+t}function p(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<<o|s>>>32-o)+t}r.MD5=o._createHelper(l),r.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5)}(md5)),md5.exports}var sha1={exports:{}},hasRequiredSha1;function requireSha1(){return hasRequiredSha1||(hasRequiredSha1=1,function(e){var t,r,n,i,o,a,s,l;e.exports=(l=requireCore(),r=(t=l).lib,n=r.WordArray,i=r.Hasher,o=t.algo,a=[],s=o.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],l=r[4],c=0;c<80;c++){if(c<16)a[c]=0|e[t+c];else{var u=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+l+a[c];d+=c<20?1518500249+(i&o|~i&s):c<40?1859775393+(i^o^s):c<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,l=s,s=o,o=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+l|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s),l.SHA1)}(sha1)),sha1.exports}var sha256={exports:{}},hasRequiredSha256;function requireSha256(){return hasRequiredSha256||(hasRequiredSha256=1,function(e){var t;e.exports=(t=requireCore(),function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[],l=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),l[i]=r(e.pow(n,1/3)),i++),n++}();var c=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],d=r[6],p=r[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var f=c[h-15],g=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,m=c[h-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[h]=g+c[h-7]+v+c[h-16]}var y=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),q=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&d)+l[h]+c[h];p=d,d=u,u=s,s=a+q|0,a=o,o=i,i=n,n=q+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+u|0,r[6]=r[6]+d|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(u),r.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256)}(sha256)),sha256.exports}var sha224={exports:{}},hasRequiredSha224;function requireSha224(){return hasRequiredSha224||(hasRequiredSha224=1,function(e){var t,r,n,i,o,a;e.exports=(a=requireCore(),requireSha256(),r=(t=a).lib.WordArray,n=t.algo,i=n.SHA256,o=n.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o),a.SHA224)}(sha224)),sha224.exports}var sha512={exports:{}},hasRequiredSha512;function requireSha512(){return hasRequiredSha512||(hasRequiredSha512=1,function(e){var t;e.exports=(t=requireCore(),requireX64Core(),function(){var e=t,r=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var u=a.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],d=r[6],p=r[7],h=n.high,f=n.low,g=i.high,m=i.low,v=o.high,y=o.low,b=a.high,q=a.low,S=s.high,E=s.low,V=u.high,C=u.low,T=d.high,A=d.low,x=p.high,R=p.low,w=h,k=f,N=g,_=m,O=v,I=y,P=b,D=q,F=S,L=E,U=V,M=C,B=T,W=A,j=x,K=R,G=0;G<80;G++){var H,z,X=c[G];if(G<16)z=X.high=0|e[t+2*G],H=X.low=0|e[t+2*G+1];else{var Y=c[G-15],Z=Y.high,Q=Y.low,J=(Z>>>1|Q<<31)^(Z>>>8|Q<<24)^Z>>>7,$=(Q>>>1|Z<<31)^(Q>>>8|Z<<24)^(Q>>>7|Z<<25),ee=c[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=c[G-7],ae=oe.high,se=oe.low,le=c[G-16],ce=le.high,ue=le.low;z=(z=(z=J+ae+((H=$+se)>>>0<$>>>0?1:0))+ne+((H+=ie)>>>0<ie>>>0?1:0))+ce+((H+=ue)>>>0<ue>>>0?1:0),X.high=z,X.low=H}var de,pe=F&U^~F&B,he=L&M^~L&W,fe=w&N^w&O^N&O,ge=k&_^k&I^_&I,me=(w>>>28|k<<4)^(w<<30|k>>>2)^(w<<25|k>>>7),ve=(k>>>28|w<<4)^(k<<30|w>>>2)^(k<<25|w>>>7),ye=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),be=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),qe=l[G],Se=qe.high,Ee=qe.low,Ve=j+ye+((de=K+be)>>>0<K>>>0?1:0),Ce=ve+ge;j=B,K=W,B=U,W=M,U=F,M=L,F=P+(Ve=(Ve=(Ve=Ve+pe+((de+=he)>>>0<he>>>0?1:0))+Se+((de+=Ee)>>>0<Ee>>>0?1:0))+z+((de+=H)>>>0<H>>>0?1:0))+((L=D+de|0)>>>0<D>>>0?1:0)|0,P=O,D=I,O=N,I=_,N=w,_=k,w=Ve+(me+fe+(Ce>>>0<ve>>>0?1:0))+((k=de+Ce|0)>>>0<de>>>0?1:0)|0}f=n.low=f+k,n.high=h+w+(f>>>0<k>>>0?1:0),m=i.low=m+_,i.high=g+N+(m>>>0<_>>>0?1:0),y=o.low=y+I,o.high=v+O+(y>>>0<I>>>0?1:0),q=a.low=q+D,a.high=b+P+(q>>>0<D>>>0?1:0),E=s.low=E+L,s.high=S+F+(E>>>0<L>>>0?1:0),C=u.low=C+M,u.high=V+U+(C>>>0<M>>>0?1:0),A=d.low=A+W,d.high=T+B+(A>>>0<W>>>0?1:0),R=p.low=R+K,p.high=x+j+(R>>>0<K>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=r._createHelper(u),e.HmacSHA512=r._createHmacHelper(u)}(),t.SHA512)}(sha512)),sha512.exports}var sha384={exports:{}},hasRequiredSha384;function requireSha384(){return hasRequiredSha384||(hasRequiredSha384=1,function(e){var t,r,n,i,o,a,s,l;e.exports=(l=requireCore(),requireX64Core(),requireSha512(),r=(t=l).x64,n=r.Word,i=r.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s),l.SHA384)}(sha384)),sha384.exports}var sha3={exports:{}},hasRequiredSha3;function requireSha3(){return hasRequiredSha3||(hasRequiredSha3=1,function(e){var t;e.exports=(t=requireCore(),requireX64Core(),function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.x64.Word,s=r.algo,l=[],c=[],u=[];!function(){for(var e=1,t=0,r=0;r<24;r++){l[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,d=0,p=0;p<7;p++){if(1&i){var h=(1<<p)-1;h<32?d^=1<<h:s^=1<<h-32}128&i?i=i<<1^113:i<<=1}u[o]=a.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=a.create()}();var p=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=e[t+2*i],a=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(R=r[i]).high^=a,R.low^=o}for(var s=0;s<24;s++){for(var p=0;p<5;p++){for(var h=0,f=0,g=0;g<5;g++)h^=(R=r[p+5*g]).high,f^=R.low;var m=d[p];m.high=h,m.low=f}for(p=0;p<5;p++){var v=d[(p+4)%5],y=d[(p+1)%5],b=y.high,q=y.low;for(h=v.high^(b<<1|q>>>31),f=v.low^(q<<1|b>>>31),g=0;g<5;g++)(R=r[p+5*g]).high^=h,R.low^=f}for(var S=1;S<25;S++){var E=(R=r[S]).high,V=R.low,C=l[S];C<32?(h=E<<C|V>>>32-C,f=V<<C|E>>>32-C):(h=V<<C-32|E>>>64-C,f=E<<C-32|V>>>64-C);var T=d[c[S]];T.high=h,T.low=f}var A=d[0],x=r[0];for(A.high=x.high,A.low=x.low,p=0;p<5;p++)for(g=0;g<5;g++){var R=r[S=p+5*g],w=d[S],k=d[(p+1)%5+5*g],N=d[(p+2)%5+5*g];R.high=w.high^~k.high&N.high,R.low=w.low^~k.low&N.low}R=r[0];var _=u[s];R.high^=_.high,R.low^=_.low}},_doFinalize:function(){var t=this._data,r=t.words;this._nDataBytes;var n=8*t.sigBytes,o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u<l;u++){var d=a[u],p=d.high,h=d.low;p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),c.push(h),c.push(p)}return new i.init(c,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(p),r.HmacSHA3=o._createHmacHelper(p)}(Math),t.SHA3)}(sha3)),sha3.exports}var ripemd160={exports:{}},hasRequiredRipemd160;function requireRipemd160(){return hasRequiredRipemd160||(hasRequiredRipemd160=1,function(e){var t;e.exports=(t=requireCore(),
212
212
  /** @preserve
213
213
  (c) 2012 by Cédric Mesnil. All rights reserved.
214
214