punkweb-bb 0.2.2__py3-none-any.whl → 0.3.0__py3-none-any.whl

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 (110) hide show
  1. punkweb_bb/__pycache__/admin.cpython-311.pyc +0 -0
  2. punkweb_bb/__pycache__/admin_forms.cpython-311.pyc +0 -0
  3. punkweb_bb/__pycache__/forms.cpython-311.pyc +0 -0
  4. punkweb_bb/__pycache__/models.cpython-311.pyc +0 -0
  5. punkweb_bb/__pycache__/settings.cpython-311.pyc +0 -0
  6. punkweb_bb/__pycache__/sitemap.cpython-311.pyc +0 -0
  7. punkweb_bb/__pycache__/tests.cpython-311.pyc +0 -0
  8. punkweb_bb/__pycache__/urls.cpython-311.pyc +0 -0
  9. punkweb_bb/__pycache__/utils.cpython-311.pyc +0 -0
  10. punkweb_bb/__pycache__/views.cpython-311.pyc +0 -0
  11. punkweb_bb/__pycache__/widgets.cpython-311.pyc +0 -0
  12. punkweb_bb/admin.py +0 -4
  13. punkweb_bb/admin_forms.py +6 -5
  14. punkweb_bb/forms.py +13 -5
  15. punkweb_bb/migrations/0005_alter_thread_options.py +24 -0
  16. punkweb_bb/migrations/0006_remove_boardprofile__signature_rendered_and_more.py +60 -0
  17. punkweb_bb/migrations/__pycache__/0005_alter_thread_options.cpython-311.pyc +0 -0
  18. punkweb_bb/migrations/__pycache__/0006_remove_boardprofile__signature_rendered_and_more.cpython-311.pyc +0 -0
  19. punkweb_bb/models.py +12 -9
  20. punkweb_bb/settings.py +1 -0
  21. punkweb_bb/static/punkweb_bb/css/thread.css +45 -28
  22. punkweb_bb/static/punkweb_bb/editor/markdown-editor.js +23 -0
  23. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/.eslintrc.json +15 -0
  24. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/.gitignore +108 -0
  25. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/.prettierrc.json +1 -0
  26. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/LICENSE +21 -0
  27. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/README.md +240 -0
  28. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/babel.config.json +14 -0
  29. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/blank.html +18 -0
  30. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/demo.html +126 -0
  31. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/tiny-mde.css +231 -0
  32. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/tiny-mde.js +3086 -0
  33. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/tiny-mde.min.css +1 -0
  34. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/tiny-mde.min.js +1 -0
  35. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/dist/tiny-mde.tiny.js +1 -0
  36. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/docs/_config.yml +1 -0
  37. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/docs/_layouts/default.html +50 -0
  38. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/docs/index.md +174 -0
  39. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/globals.d.ts +172 -0
  40. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/gulpfile.mjs +226 -0
  41. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/block.test.js +696 -0
  42. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/commandbar.test.js +84 -0
  43. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/inline.test.js +486 -0
  44. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/interaction.test.js +31 -0
  45. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/setup.test.js +164 -0
  46. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/util/config.js +2 -0
  47. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/util/server.js +9 -0
  48. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/util/setup.js +1 -0
  49. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest/util/test-helpers.js +98 -0
  50. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest-puppeteer.config.js +8 -0
  51. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/jest.config.js +13 -0
  52. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/package-lock.json +16295 -0
  53. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/package.json +72 -0
  54. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/TinyMDE.js +1926 -0
  55. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/TinyMDECommandBar.js +256 -0
  56. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/commandbar.css +72 -0
  57. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/editor.css +157 -0
  58. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/index.css +3 -0
  59. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/grammar.js +300 -0
  60. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/html/blank.html +18 -0
  61. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/html/demo.html +126 -0
  62. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/index.js +4 -0
  63. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/blockquote.svg +1 -0
  64. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/bold.svg +1 -0
  65. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/clear_formatting.svg +1 -0
  66. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/code.svg +1 -0
  67. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/h1.svg +1 -0
  68. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/h2.svg +1 -0
  69. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/hr.svg +1 -0
  70. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/image.svg +1 -0
  71. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/italic.svg +1 -0
  72. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/link.svg +1 -0
  73. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/ol.svg +1 -0
  74. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/strikethrough.svg +1 -0
  75. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/svg.js +17 -0
  76. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/svg/ul.svg +1 -0
  77. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/tiny.js +3 -0
  78. punkweb_bb/templates/punkweb_bb/base_delete_modal.html +13 -0
  79. punkweb_bb/templates/punkweb_bb/index.html +2 -2
  80. punkweb_bb/templates/punkweb_bb/members.html +3 -1
  81. punkweb_bb/templates/punkweb_bb/partials/category_delete.html +4 -8
  82. punkweb_bb/templates/punkweb_bb/partials/post_delete.html +4 -8
  83. punkweb_bb/templates/punkweb_bb/partials/shout_delete.html +4 -8
  84. punkweb_bb/templates/punkweb_bb/partials/subcategory_delete.html +4 -8
  85. punkweb_bb/templates/punkweb_bb/partials/thread_delete.html +4 -8
  86. punkweb_bb/templates/punkweb_bb/partials/thread_move.html +24 -0
  87. punkweb_bb/templates/punkweb_bb/profile.html +8 -4
  88. punkweb_bb/templates/punkweb_bb/shoutbox/shout_list.html +3 -3
  89. punkweb_bb/templates/punkweb_bb/subcategory.html +1 -1
  90. punkweb_bb/templates/punkweb_bb/thread.html +89 -71
  91. punkweb_bb/templates/punkweb_bb/widgets/markdown-editor.html +3 -0
  92. punkweb_bb/templatetags/__pycache__/markdown.cpython-311.pyc +0 -0
  93. punkweb_bb/templatetags/__pycache__/render.cpython-311.pyc +0 -0
  94. punkweb_bb/templatetags/__pycache__/shoutbox_bbcode.cpython-311.pyc +0 -0
  95. punkweb_bb/templatetags/__pycache__/shoutbox_render.cpython-311.pyc +0 -0
  96. punkweb_bb/templatetags/__pycache__/styled_group_name.cpython-311.pyc +0 -0
  97. punkweb_bb/templatetags/render.py +48 -0
  98. punkweb_bb/templatetags/shoutbox_render.py +22 -0
  99. punkweb_bb/templatetags/styled_group_name.py +2 -2
  100. punkweb_bb/tests.py +3 -3
  101. punkweb_bb/urls.py +1 -0
  102. punkweb_bb/utils.py +23 -7
  103. punkweb_bb/views.py +36 -7
  104. punkweb_bb/widgets.py +20 -0
  105. {punkweb_bb-0.2.2.dist-info → punkweb_bb-0.3.0.dist-info}/METADATA +56 -41
  106. {punkweb_bb-0.2.2.dist-info → punkweb_bb-0.3.0.dist-info}/RECORD +109 -41
  107. punkweb_bb/templatetags/shoutbox_bbcode.py +0 -14
  108. {punkweb_bb-0.2.2.dist-info → punkweb_bb-0.3.0.dist-info}/LICENSE +0 -0
  109. {punkweb_bb-0.2.2.dist-info → punkweb_bb-0.3.0.dist-info}/WHEEL +0 -0
  110. {punkweb_bb-0.2.2.dist-info → punkweb_bb-0.3.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ .TinyMDE{background-color:#fff;border:1px solid var(--border);border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;color:var(--oc-gray-9);font-size:16px;line-height:1.5;min-height:12rem;outline:none;padding:.5rem 1rem}.TMBlankLine{height:1.5rem}.TMH1,.TMSetextH1{font-size:2rem;font-weight:700;line-height:32px;margin-bottom:8px}.TMSetextH1{margin-bottom:0}.TMSetextH1Marker{margin-bottom:8px}.TMH2,.TMSetextH2{font-size:20px;font-weight:700;line-height:28px;margin-bottom:4px}.TMMark_TMCode{font-family:monospace;font-size:.9em}.TMCode,.TMFencedCodeBacktick,.TMFencedCodeTilde,.TMIndentedCode{background-color:#e0e0e0;font-family:monospace;font-size:.9em}.TMCodeFenceBacktickOpen,.TMCodeFenceTildeOpen{border-bottom:1px solid silver;font-family:monospace;font-size:.9em}.TMCodeFenceBacktickClose,.TMCodeFenceTildeClose{border-top:1px solid silver;font-family:monospace;font-size:.9em}.TMInfoString{color:#00f}.TMCode{border:1px solid silver;border-radius:2px}.TMBlockquote{border-left:2px solid silver;font-style:italic;margin-left:10px;padding-left:10px}.TMMark{color:#a0a0a0}.TMMark_TMH1,.TMMark_TMH2,.TMMark_TMOL,.TMMark_TMUL{color:#ff8080}.TMImage{text-decoration:underline;text-decoration-color:#0f0}.TMLink{text-decoration:underline;text-decoration-color:#00f}.TMLinkLabel{font-family:monospace;text-decoration:underline}.TMLinkLabel_Definition,.TMLinkLabel_Valid{color:#40c040}.TMLinkLabel_Invalid{color:red}.TMLinkTitle{font-style:italic}.TMAutolink,.TMLinkDestination{color:#00f;text-decoration:underline}.TMHR{position:relative}.TMHR:before{border-bottom:2px solid grey;bottom:50%;content:"";left:40%;position:absolute;width:20%;z-index:0}.TMHTML,.TMHTMLBlock{color:#8000ff;font-family:monospace;font-size:.9em}.TMHTMLBlock{color:#6000c0}.TMCommandBar{-ms-overflow-style:none;background-color:var(--oc-gray-1);border:1px solid var(--border);border-bottom:none;border-top-left-radius:.25rem;border-top-right-radius:.25rem;display:flex;gap:.25rem;overflow-x:scroll;overflow-y:hidden;padding:.25rem;scrollbar-width:none;-webkit-user-select:none;user-select:none}.TMCommandBar::-webkit-scrollbar{display:none}.TMCommandButton{fill:var(--oc-gray-9);color:var(--oc-gray-9);cursor:pointer;display:inline-block;font-family:sans-serif;font-size:20px;height:24px;line-height:18px;text-align:center;vertical-align:middle;width:24px}.TMCommandDivider{border-left:2px solid var(--border);height:24px;margin:0 8px;width:0}.TMCommandButton_Active{fill:var(--primary-9);background-color:var(--primary-2);color:var(--primary-9);font-weight:700}.TMCommandButton_Inactive{background-color:var(--oc-gray-1)}.TMCommandButton_Disabled{fill:var(--oc-gray-7);color:var(--oc-gray-7)}@media (hover:hover){.TMCommandButton_Active:hover,.TMCommandButton_Disabled:hover,.TMCommandButton_Inactive:hover{fill:var(--oc-gray-9);background-color:var(--primary-1)}}
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyMDE={})}(this,(function(e){"use strict";const t={blockquote:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="m228-240 92-160q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 23-5.5 42.5T458-480L320-240h-92Zm360 0 92-160q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 23-5.5 42.5T818-480L680-240h-92ZM320-500q25 0 42.5-17.5T380-560q0-25-17.5-42.5T320-620q-25 0-42.5 17.5T260-560q0 25 17.5 42.5T320-500Zm360 0q25 0 42.5-17.5T740-560q0-25-17.5-42.5T680-620q-25 0-42.5 17.5T620-560q0 25 17.5 42.5T680-500Zm0-60Zm-360 0Z"/></svg>',bold:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"/></svg>',clear_formatting:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"/></svg>',code:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M320-240 80-480l240-240 57 57-184 184 183 183-56 56Zm320 0-57-57 184-184-183-183 56-56 240 240-240 240Z"/></svg>',h1:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M200-280v-400h80v160h160v-160h80v400h-80v-160H280v160h-80Zm480 0v-320h-80v-80h160v400h-80Z"/></svg>',h2:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M120-280v-400h80v160h160v-160h80v400h-80v-160H200v160h-80Zm400 0v-160q0-33 23.5-56.5T600-520h160v-80H520v-80h240q33 0 56.5 23.5T840-600v80q0 33-23.5 56.5T760-440H600v80h240v80H520Z"/></svg>',hr:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M160-440v-80h640v80H160Z"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/></svg>',italic:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>',ol:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"/></svg>',strikethrough:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M80-400v-80h800v80H80Zm340-160v-120H200v-120h560v120H540v120H420Zm0 400v-160h120v160H420Z"/></svg>',ul:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z"/></svg>'},n=/(Mac|iPhone|iPod|iPad)/i.test("undefined"!=typeof navigator?navigator.platform:""),s={bold:{name:"bold",action:"bold",innerHTML:t.bold,title:"Bold",hotkey:"Mod-B"},italic:{name:"italic",action:"italic",innerHTML:t.italic,title:"Italic",hotkey:"Mod-I"},strikethrough:{name:"strikethrough",action:"strikethrough",innerHTML:t.strikethrough,title:"Strikethrough",hotkey:"Mod2-Shift-5"},code:{name:"code",action:"code",innerHTML:t.code,title:"Format as code"},h1:{name:"h1",action:"h1",innerHTML:t.h1,title:"Level 1 heading",hotkey:"Mod-Shift-1"},h2:{name:"h2",action:"h2",innerHTML:t.h2,title:"Level 2 heading",hotkey:"Mod-Shift-2"},ul:{name:"ul",action:"ul",innerHTML:t.ul,title:"Bulleted list"},ol:{name:"ol",action:"ol",innerHTML:t.ol,title:"Numbered list"},blockquote:{name:"blockquote",action:"blockquote",innerHTML:t.blockquote,title:"Quote",hotkey:"Mod2-Shift-Q"},insertLink:{name:"insertLink",action:e=>{e.isInlineFormattingAllowed()&&e.wrapSelection("[","]()")},enabled:(e,t,n)=>!e.isInlineFormattingAllowed(t,n)&&null,innerHTML:t.link,title:"Insert link",hotkey:"Mod-K"},insertImage:{name:"insertImage",action:e=>{e.isInlineFormattingAllowed()&&e.wrapSelection("![","]()")},enabled:(e,t,n)=>!e.isInlineFormattingAllowed(t,n)&&null,innerHTML:t.image,title:"Insert image",hotkey:"Mod2-Shift-I"},hr:{name:"hr",action:e=>e.paste("\n***\n"),enabled:()=>!1,innerHTML:t.hr,title:"Insert horizontal line",hotkey:"Mod2-Shift-L"}};var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(e){return e&&e.Math===Math&&e},l=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof i&&i)||function(){return this}()||i||Function("return this")(),a=function(e){try{return!!e()}catch(e){return!0}},o=!a((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={},c={get exports(){return u},set exports(e){u=e}},h=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),p=h,d=Function.prototype,m=d.call,g=p&&d.bind.bind(m,m),f=p?g:function(e){return function(){return m.apply(e,arguments)}},T="object"==typeof document&&document.all,M={all:T,IS_HTMLDDA:void 0===T&&void 0!==T},F=M.all,D=M.IS_HTMLDDA?function(e){return"function"==typeof e||e===F}:function(e){return"function"==typeof e},C=function(e){return null==e},v=C,w=TypeError,k=function(e){if(v(e))throw new w("Can't call method on "+e);return e},y=Object,b=function(e){return y(k(e))},E=f({}.hasOwnProperty),$=Object.hasOwn||function(e,t){return E(b(e),t)},A=o,x=$,S=Function.prototype,L=A&&Object.getOwnPropertyDescriptor,B=x(S,"name"),H={EXISTS:B,PROPER:B&&"something"===function(){}.name,CONFIGURABLE:B&&(!A||A&&L(S,"name").configurable)},N=l,_=Object.defineProperty,q=function(e,t){try{_(N,e,{value:t,configurable:!0,writable:!0})}catch(n){N[e]=t}return t},O="__core-js_shared__",I=l[O]||q(O,{}),P=D,Z=I,j=f(Function.toString);P(Z.inspectSource)||(Z.inspectSource=function(e){return j(e)});var R,z,K=Z.inspectSource,U=D,V=l.WeakMap,W=U(V)&&/native code/.test(String(V)),X=D,G=M.all,Q=M.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:X(e)||e===G}:function(e){return"object"==typeof e?null!==e:X(e)},J={},Y=Q,ee=l.document,te=Y(ee)&&Y(ee.createElement),ne=function(e){return te?ee.createElement(e):{}},se=!o&&!a((function(){return 7!==Object.defineProperty(ne("div"),"a",{get:function(){return 7}}).a})),ie=o&&a((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),re=Q,le=String,ae=TypeError,oe=function(e){if(re(e))return e;throw new ae(le(e)+" is not an object")},ue=h,ce=Function.prototype.call,he=ue?ce.bind(ce):function(){return ce.apply(ce,arguments)},pe=l,de=D,me=f({}.isPrototypeOf),ge=l,fe="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Te=ge.process,Me=ge.Deno,Fe=Te&&Te.versions||Me&&Me.version,De=Fe&&Fe.v8;De&&(z=(R=De.split("."))[0]>0&&R[0]<4?1:+(R[0]+R[1])),!z&&fe&&(!(R=fe.match(/Edge\/(\d+)/))||R[1]>=74)&&(R=fe.match(/Chrome\/(\d+)/))&&(z=+R[1]);var Ce=z,ve=a,we=l.String,ke=!!Object.getOwnPropertySymbols&&!ve((function(){var e=Symbol("symbol detection");return!we(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ce&&Ce<41})),ye=ke&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,be=function(e,t){return arguments.length<2?(n=pe[e],de(n)?n:void 0):pe[e]&&pe[e][t];var n},Ee=D,$e=me,Ae=Object,xe=ye?function(e){return"symbol"==typeof e}:function(e){var t=be("Symbol");return Ee(t)&&$e(t.prototype,Ae(e))},Se=String,Le=D,Be=function(e){try{return Se(e)}catch(e){return"Object"}},He=TypeError,Ne=function(e){if(Le(e))return e;throw new He(Be(e)+" is not a function")},_e=C,qe=he,Oe=D,Ie=Q,Pe=TypeError,Ze={},je=I;({get exports(){return Ze},set exports(e){Ze=e}}.exports=function(e,t){return je[e]||(je[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Re=f,ze=0,Ke=Math.random(),Ue=Re(1..toString),Ve=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ue(++ze+Ke,36)},We=Ze,Xe=$,Ge=Ve,Qe=ke,Je=ye,Ye=l.Symbol,et=We("wks"),tt=Je?Ye.for||Ye:Ye&&Ye.withoutSetter||Ge,nt=he,st=Q,it=xe,rt=function(e,t){var n=e[t];return _e(n)?void 0:Ne(n)},lt=function(e,t){var n,s;if("string"===t&&Oe(n=e.toString)&&!Ie(s=qe(n,e)))return s;if(Oe(n=e.valueOf)&&!Ie(s=qe(n,e)))return s;if("string"!==t&&Oe(n=e.toString)&&!Ie(s=qe(n,e)))return s;throw new Pe("Can't convert object to primitive value")},at=TypeError,ot=function(e){return Xe(et,e)||(et[e]=Qe&&Xe(Ye,e)?Ye[e]:tt("Symbol."+e)),et[e]}("toPrimitive"),ut=function(e,t){if(!st(e)||it(e))return e;var n,s=rt(e,ot);if(s){if(void 0===t&&(t="default"),n=nt(s,e,t),!st(n)||it(n))return n;throw new at("Can't convert object to primitive value")}return void 0===t&&(t="number"),lt(e,t)},ct=xe,ht=o,pt=se,dt=ie,mt=oe,gt=function(e){var t=ut(e,"string");return ct(t)?t:t+""},ft=TypeError,Tt=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Ft="enumerable",Dt="configurable",Ct="writable";J.f=ht?dt?function(e,t,n){if(mt(e),t=gt(t),mt(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Ct in n&&!n[Ct]){var s=Mt(e,t);s&&s[Ct]&&(e[t]=n.value,n={configurable:Dt in n?n[Dt]:s[Dt],enumerable:Ft in n?n[Ft]:s[Ft],writable:!1})}return Tt(e,t,n)}:Tt:function(e,t,n){if(mt(e),t=gt(t),mt(n),pt)try{return Tt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new ft("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var vt,wt,kt,yt=J,bt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Et=o?function(e,t,n){return yt.f(e,t,bt(1,n))}:function(e,t,n){return e[t]=n,e},$t=Ve,At=Ze("keys"),xt=W,St=l,Lt=Q,Bt=Et,Ht=$,Nt=I,_t=function(e){return At[e]||(At[e]=$t(e))},qt="Object already initialized",Ot=St.TypeError,It=St.WeakMap;if(xt||Nt.state){var Pt=Nt.state||(Nt.state=new It);Pt.get=Pt.get,Pt.has=Pt.has,Pt.set=Pt.set,vt=function(e,t){if(Pt.has(e))throw new Ot(qt);return t.facade=e,Pt.set(e,t),t},wt=function(e){return Pt.get(e)||{}},kt=function(e){return Pt.has(e)}}else{var Zt=_t("state");vt=function(e,t){if(Ht(e,Zt))throw new Ot(qt);return t.facade=e,Bt(e,Zt,t),t},wt=function(e){return Ht(e,Zt)?e[Zt]:{}},kt=function(e){return Ht(e,Zt)}}var jt={set:vt,get:wt,has:kt,enforce:function(e){return kt(e)?wt(e):vt(e,{})},getterFor:function(e){return function(t){var n;if(!Lt(t)||(n=wt(t)).type!==e)throw new Ot("Incompatible receiver, "+e+" required");return n}}},Rt=f,zt=a,Kt=D,Ut=$,Vt=o,Wt=H.CONFIGURABLE,Xt=K,Gt=jt.enforce,Qt=jt.get,Jt=String,Yt=Object.defineProperty,en=Rt("".slice),tn=Rt("".replace),nn=Rt([].join),sn=Vt&&!zt((function(){return 8!==Yt((function(){}),"length",{value:8}).length})),rn=String(String).split("String"),ln=c.exports=function(e,t,n){"Symbol("===en(Jt(t),0,7)&&(t="["+tn(Jt(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!Ut(e,"name")||Wt&&e.name!==t)&&(Vt?Yt(e,"name",{value:t,configurable:!0}):e.name=t),sn&&n&&Ut(n,"arity")&&e.length!==n.arity&&Yt(e,"length",{value:n.arity});try{n&&Ut(n,"constructor")&&n.constructor?Vt&&Yt(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=Gt(e);return Ut(s,"source")||(s.source=nn(rn,"string"==typeof t?t:"")),e};Function.prototype.toString=ln((function(){return Kt(this)&&Qt(this).source||Xt(this)}),"toString");var an=u,on=J,un=oe,cn=o,hn=function(e,t,n){return n.get&&an(n.get,t,{getter:!0}),n.set&&an(n.set,t,{setter:!0}),on.f(e,t,n)},pn=function(){var e=un(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},dn=a,mn=l.RegExp,gn=mn.prototype;cn&&dn((function(){var e=!0;try{mn(".","d")}catch(t){e=!1}var t={},n="",s=e?"dgimsy":"gimsy",i=function(e,s){Object.defineProperty(t,e,{get:function(){return n+=s,!0}})},r={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var l in e&&(r.hasIndices="d"),r)i(l,r[l]);return Object.getOwnPropertyDescriptor(gn,"flags").get.call(t)!==s||n!==s}))&&hn(gn,"flags",{configurable:!0,get:pn});const fn={ASCIIPunctuation:/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~\\]/,NotTriggerChar:/[^`_*[\]()<>!~]/,Scheme:/[A-Za-z][A-Za-z0-9+.-]{1,31}/,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])?)*/,HTMLOpenTag:/<HTMLTagName(?:HTMLAttribute)*\s*\/?>/,HTMLCloseTag:/<\/HTMLTagName\s*>/,HTMLTagName:/[A-Za-z][A-Za-z0-9-]*/,HTMLComment:/<!--(?:[^>-]|(?:[^>-](?:[^-]|-[^-])*[^-]))-->/,HTMLPI:/<\?(?:|.|(?:[^?]|\?[^>])*)\?>/,HTMLDeclaration:/<![A-Z]+\s[^>]*>/,HTMLCDATA:/<!\[CDATA\[.*?\]\]>/,HTMLAttribute:/\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:HTMLAttValue)?/,HTMLAttValue:/\s*=\s*(?:(?:'[^']*')|(?:"[^"]*")|(?:[^\s"'=<>`]+))/,KnownTag:/address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul/},Tn=new RegExp(/^(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])/),Mn=new RegExp(/(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])$/),Fn={TMH1:{regexp:/^( {0,3}#\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH1">$1</span>$$2<span class="TMMark TMMark_TMH1">$3</span>'},TMH2:{regexp:/^( {0,3}##\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH2">$1</span>$$2<span class="TMMark TMMark_TMH2">$3</span>'},TMH3:{regexp:/^( {0,3}###\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH3">$1</span>$$2<span class="TMMark TMMark_TMH3">$3</span>'},TMH4:{regexp:/^( {0,3}####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH4">$1</span>$$2<span class="TMMark TMMark_TMH4">$3</span>'},TMH5:{regexp:/^( {0,3}#####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH5">$1</span>$$2<span class="TMMark TMMark_TMH5">$3</span>'},TMH6:{regexp:/^( {0,3}######\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH6">$1</span>$$2<span class="TMMark TMMark_TMH6">$3</span>'},TMBlockquote:{regexp:/^( {0,3}>[ ]?)(.*)$/,replacement:'<span class="TMMark TMMark_TMBlockquote">$1</span>$$2'},TMCodeFenceBacktickOpen:{regexp:/^( {0,3}(?<seq>````*)\s*)([^`]*?)(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceTildeOpen:{regexp:/^( {0,3}(?<seq>~~~~*)\s*)(.*?)(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceBacktickClose:{regexp:/^( {0,3}(?<seq>````*))(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span>$3'},TMCodeFenceTildeClose:{regexp:/^( {0,3}(?<seq>~~~~*))(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span>$3'},TMBlankLine:{regexp:/^([ \t]*)$/,replacement:"$0"},TMSetextH1Marker:{regexp:/^ {0,3}=+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMSetextH2Marker:{regexp:/^ {0,3}-+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMHR:{regexp:/^( {0,3}(\*[ \t]*\*[ \t]*\*[ \t*]*)|(-[ \t]*-[ \t]*-[ \t-]*)|(_[ \t]*_[ \t]*_[ \t_]*))$/,replacement:'<span class="TMMark TMMark_TMHR">$0</span>'},TMUL:{regexp:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMUL">$1</span>$$2'},TMOL:{regexp:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMOL">$1</span>$$2'},TMIndentedCode:{regexp:/^( {4}|\t)(.*)$/,replacement:'<span class="TMMark TMMark_TMIndentedCode">$1</span>$2'},TMLinkReferenceDefinition:{regexp:/^( {0,3}\[\s*)([^\s\]](?:[^\]]|\\\])*?)(\s*\]:\s*)((?:[^\s<>]+)|(?:<(?:[^<>\\]|\\.)*>))?(\s*)((?:\((?:[^()\\]|\\.)*\))|(?:"(?:[^"\\]|\\.)*")|(?:'(?:[^'\\]|\\.)*'))?(\s*)$/,replacement:'<span class="TMMark TMMark_TMLinkReferenceDefinition">$1</span><span class="TMLinkLabel TMLinkLabel_Definition">$2</span><span class="TMMark TMMark_TMLinkReferenceDefinition">$3</span><span class="TMLinkDestination">$4</span>$5<span class="TMLinkTitle">$6</span>$7',labelPlaceholder:2}};var Dn=[{start:/^ {0,3}<(?:script|pre|style)(?:\s|>|$)/i,end:/(?:<\/script>|<\/pre>|<\/style>)/i,paraInterrupt:!0},{start:/^ {0,3}<!--/,end:/-->/,paraInterrupt:!0},{start:/^ {0,3}<\?/,end:/\?>/,paraInterrupt:!0},{start:/^ {0,3}<![A-Z]/,end:/>/,paraInterrupt:!0},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/,paraInterrupt:!0},{start:/^ {0,3}(?:<|<\/)(?:KnownTag)(?:\s|>|\/>|$)/i,end:!1,paraInterrupt:!0},{start:/^ {0,3}(?:HTMLOpenTag|HTMLCloseTag)\s*$/,end:!1,paraInterrupt:!1}],Cn={escape:{regexp:/^\\(ASCIIPunctuation)/,replacement:'<span class="TMMark TMMark_TMEscape">\\</span>$1'},code:{regexp:/^(`+)((?:[^`])|(?:[^`].*?[^`]))(\1)/,replacement:'<span class="TMMark TMMark_TMCode">$1</span><code class="TMCode">$2</code><span class="TMMark TMMark_TMCode">$3</span>'},autolink:{regexp:/^<((?:Scheme:[^\s<>]*)|(?:Email))>/,replacement:'<span class="TMMark TMMark_TMAutolink">&lt;</span><span class="TMAutolink">$1</span><span class="TMMark TMMark_TMAutolink">&gt;</span>'},html:{regexp:/^((?:HTMLOpenTag)|(?:HTMLCloseTag)|(?:HTMLComment)|(?:HTMLPI)|(?:HTMLDeclaration)|(?:HTMLCDATA))/,replacement:'<span class="TMHTML">$1</span>'},linkOpen:{regexp:/^\[/,replacement:""},imageOpen:{regexp:/^!\[/,replacement:""},linkLabel:{regexp:/^(\[\s*)([^\]]*?)(\s*\])/,replacement:"",labelPlaceholder:2},default:{regexp:/^(.|(?:NotTriggerChar+))/,replacement:"$1"}};const vn=new RegExp(Object.keys(fn).join("|")),wn=[...Object.keys(Cn)];for(let e of wn){let t=Cn[e].regexp.source;for(;t.match(vn);)t=t.replace(vn,(e=>fn[e].source));Cn[e].regexp=new RegExp(t,Cn[e].regexp.flags)}for(let e of Dn){let t=e.start.source;for(;t.match(vn);)t=t.replace(vn,(e=>fn[e].source));e.start=new RegExp(t,e.start.flags)}function kn(e){return(e||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const yn={bold:{type:"inline",className:"TMStrong",set:{pre:"**",post:"**"},unset:{prePattern:/(?:\*\*|__)$/,postPattern:/^(?:\*\*|__)/}},italic:{type:"inline",className:"TMEm",set:{pre:"*",post:"*"},unset:{prePattern:/(?:\*|_)$/,postPattern:/^(?:\*|_)/}},code:{type:"inline",className:"TMCode",set:{pre:"`",post:"`"},unset:{prePattern:/`+$/,postPattern:/^`+/}},strikethrough:{type:"inline",className:"TMStrikethrough",set:{pre:"~~",post:"~~"},unset:{prePattern:/~~$/,postPattern:/^~~/}},h1:{type:"line",className:"TMH1",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"# $2"},unset:{pattern:/^( {0,3}#\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h2:{type:"line",className:"TMH2",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"## $2"},unset:{pattern:/^( {0,3}##\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h3:{type:"line",className:"TMH3",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"### $2"},unset:{pattern:/^( {0,3}###\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h4:{type:"line",className:"TMH4",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"#### $2"},unset:{pattern:/^( {0,3}####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h5:{type:"line",className:"TMH5",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"##### $2"},unset:{pattern:/^( {0,3}#####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h6:{type:"line",className:"TMH6",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"###### $2"},unset:{pattern:/^( {0,3}######\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},ul:{type:"line",className:"TMUL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"- $2"},unset:{pattern:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:"$2"}},ol:{type:"line",className:"TMOL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"$#. $2"},unset:{pattern:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:"$2"}},blockquote:{type:"line",className:"TMBlockquote",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"> $2"},unset:{pattern:/^( {0,3}>[ ]?)(.*)$/,replacement:"$2"}}};e.CommandBar=class{constructor(e){this.e=null,this.editor=null,this.commands=[],this.buttons={},this.state={},this.hotkeys=[];let t=e.element;t&&!t.tagName&&(t=document.getElementById(e.element)),t||(t=document.body),this.createCommandBarElement(t,e.commands||["bold","italic","strikethrough","|","code","|","h1","h2","|","ul","ol","|","blockquote","hr","|","insertLink","insertImage"]),document.addEventListener("keydown",(e=>this.handleKeydown(e))),e.editor&&this.setEditor(e.editor)}createCommandBarElement(e,t){this.e=document.createElement("div"),this.e.className="TMCommandBar";for(let e of t)if("|"==e){let e=document.createElement("div");e.className="TMCommandDivider",this.e.appendChild(e)}else{let t;if("string"==typeof e){if(!s[e])continue;t=e,this.commands[t]=s[t]}else{if("object"!=typeof e||!e.name)continue;t=e.name,this.commands[t]={},s[t]&&Object.assign(this.commands[t],s[t]),Object.assign(this.commands[t],e)}let i=this.commands[t].title||t;if(this.commands[t].hotkey){const e=this.commands[t].hotkey.split("-");let s=[],r=[];for(let t=0;t<e.length-1;t++)switch(e[t]){case"Ctrl":s.push("ctrlKey"),r.push("Ctrl");break;case"Cmd":s.push("metaKey"),r.push("⌘");break;case"Alt":s.push("altKey"),r.push("Alt");break;case"Option":s.push("altKey"),r.push("⌥");break;case"Win":s.push("metaKey"),r.push("⊞ Win");break;case"Shift":s.push("shiftKey"),r.push("⇧");break;case"Mod":n?(s.push("metaKey"),r.push("⌘")):(s.push("ctrlKey"),r.push("Ctrl"));break;case"Mod2":s.push("altKey"),n?r.push("⌥"):r.push("Alt")}r.push(e[e.length-1]);let l={modifiers:s,command:t};e[e.length-1].match(/^[0-9]$/)?l.code=`Digit${e[e.length-1]}`:l.key=e[e.length-1].toLowerCase(),this.hotkeys.push(l),i=i.concat(` (${r.join("+")})`)}this.buttons[t]=document.createElement("div"),this.buttons[t].className="TMCommandButton TMCommandButton_Disabled",this.buttons[t].title=i,this.buttons[t].innerHTML=this.commands[t].innerHTML,this.buttons[t].addEventListener("mousedown",(e=>this.handleClick(t,e))),this.e.appendChild(this.buttons[t])}e.appendChild(this.e)}handleClick(e,t){this.editor&&(t.preventDefault(),"string"==typeof this.commands[e].action?!1===this.state[e]?this.editor.setCommandState(e,!0):this.editor.setCommandState(e,!1):"function"==typeof this.commands[e].action&&this.commands[e].action(this.editor))}setEditor(e){this.editor=e,e.addEventListener("selection",(e=>this.handleSelection(e)))}handleSelection(e){if(e.commandState)for(let t in this.commands)void 0===e.commandState[t]?this.commands[t].enabled?this.state[t]=this.commands[t].enabled(this.editor,e.focus,e.anchor):this.state[t]=!e.focus&&null:this.state[t]=e.commandState[t],!0===this.state[t]?this.buttons[t].className="TMCommandButton TMCommandButton_Active":!1===this.state[t]?this.buttons[t].className="TMCommandButton TMCommandButton_Inactive":this.buttons[t].className="TMCommandButton TMCommandButton_Disabled"}handleKeydown(e){e:for(let t of this.hotkeys)if(t.key&&e.key.toLowerCase()==t.key||t.code&&e.code==t.code){for(let n of t.modifiers)if(!e[n])continue e;return void this.handleClick(t.command,e)}}},e.Editor=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.e=null,this.textarea=null,this.lines=[],this.lineElements=[],this.lineTypes=[],this.lineCaptures=[],this.lineReplacements=[],this.linkLabels=[],this.lineDirty=[],this.lastCommandState=null,this.listeners={change:[],selection:[]};let t=e.element;this.textarea=e.textarea,this.textarea&&(this.textarea.tagName||(this.textarea=document.getElementById(this.textarea)),t||(t=this.textarea)),t&&!t.tagName&&(t=document.getElementById(e.element)),t||(t=document.getElementsByTagName("body")[0]),"TEXTAREA"==t.tagName&&(this.textarea=t,t=this.textarea.parentNode),this.textarea&&(this.textarea.style.display="none"),this.createEditorElement(t),this.setContent(e.content||(this.textarea?this.textarea.value:"# Hello TinyMDE!\nEdit **here**"))}createEditorElement(e){this.e=document.createElement("div"),this.e.className="TinyMDE",this.e.contentEditable=!0,this.e.style.whiteSpace="pre-wrap",this.e.style.webkitUserModify="read-write-plaintext-only",this.textarea&&this.textarea.parentNode==e&&this.textarea.nextSibling?e.insertBefore(this.e,this.textarea.nextSibling):e.appendChild(this.e),this.e.addEventListener("input",(e=>this.handleInputEvent(e))),this.e.addEventListener("compositionend",(e=>this.handleInputEvent(e))),document.addEventListener("selectionchange",(e=>this.handleSelectionChangeEvent(e))),this.e.addEventListener("paste",(e=>this.handlePaste(e))),this.lineElements=this.e.childNodes}setContent(e){for(;this.e.firstChild;)this.e.removeChild(this.e.firstChild);this.lines=e.split(/(?:\r\n|\r|\n)/),this.lineDirty=[];for(let e=0;e<this.lines.length;e++){let e=document.createElement("div");this.e.appendChild(e),this.lineDirty.push(!0)}this.lineTypes=new Array(this.lines.length),this.updateFormatting(),this.fireChange()}getContent(){return this.lines.join("\n")}updateFormatting(){this.updateLineTypes(),this.updateLinkLabels(),this.applyLineTypes()}updateLinkLabels(){this.linkLabels=[];for(let e=0;e<this.lines.length;e++)"TMLinkReferenceDefinition"==this.lineTypes[e]&&this.linkLabels.push(this.lineCaptures[e][Fn.TMLinkReferenceDefinition.labelPlaceholder])}replace(e,t){return e.replace(/(\${1,2})([0-9])/g,((e,n,s)=>"$"==n?kn(t[s]):`<span class="TMInlineFormatted">${this.processInlineStyles(t[s])}</span>`))}applyLineTypes(){for(let e=0;e<this.lines.length;e++){if(this.lineDirty[e]){let t=this.replace(this.lineReplacements[e],this.lineCaptures[e]);this.lineElements[e].className=this.lineTypes[e],this.lineElements[e].removeAttribute("style"),this.lineElements[e].innerHTML=""==t?"<br />":t}this.lineElements[e].dataset.lineNum=e}}updateLineTypes(){let e=!1,t=0,n=!1;for(let s=0;s<this.lines.length;s++){let i="TMPara",r=[this.lines[s]],l="$$0";if("TMCodeFenceBacktickOpen"==e){let n=Fn.TMCodeFenceBacktickClose.regexp.exec(this.lines[s]);n&&n.groups.seq.length>=t?(i="TMCodeFenceBacktickClose",l=Fn.TMCodeFenceBacktickClose.replacement,r=n,e=!1):(i="TMFencedCodeBacktick",l='<span class="TMFencedCode">$0<br /></span>',r=[this.lines[s]])}else if("TMCodeFenceTildeOpen"==e){let n=Fn.TMCodeFenceTildeClose.regexp.exec(this.lines[s]);n&&n.groups.seq.length>=t?(i="TMCodeFenceTildeClose",l=Fn.TMCodeFenceTildeClose.replacement,r=n,e=!1):(i="TMFencedCodeTilde",l='<span class="TMFencedCode">$0<br /></span>',r=[this.lines[s]])}if("TMPara"==i&&!1===n)for(let e of Dn)if(this.lines[s].match(e.start)&&(e.paraInterrupt||0==s||"TMPara"!=this.lineTypes[s-1]&&"TMUL"!=this.lineTypes[s-1]&&"TMOL"!=this.lineTypes[s-1]&&"TMBlockquote"!=this.lineTypes[s-1])){n=e;break}if(!1!==n&&(i="TMHTMLBlock",l='<span class="TMHTMLContent">$0<br /></span>',r=[this.lines[s]],n.end?this.lines[s].match(n.end)&&(n=!1):(s==this.lines.length-1||this.lines[s+1].match(Fn.TMBlankLine.regexp))&&(n=!1)),"TMPara"==i)for(let e in Fn)if(Fn[e].regexp){let t=Fn[e].regexp.exec(this.lines[s]);if(t){i=e,l=Fn[e].replacement,r=t;break}}if("TMCodeFenceBacktickOpen"!=i&&"TMCodeFenceTildeOpen"!=i||(e=i,t=r.groups.seq.length),"TMIndentedCode"!=i&&"TMLinkReferenceDefinition"!=i||!(s>0)||"TMPara"!=this.lineTypes[s-1]&&"TMUL"!=this.lineTypes[s-1]&&"TMOL"!=this.lineTypes[s-1]&&"TMBlockquote"!=this.lineTypes[s-1]||(i="TMPara",r=[this.lines[s]],l="$$0"),"TMSetextH2Marker"==i){let e=Fn.TMUL.regexp.exec(this.lines[s]);e&&(i="TMUL",l=Fn.TMUL.replacement,r=e)}if("TMSetextH1Marker"==i||"TMSetextH2Marker"==i)if(0==s||"TMPara"!=this.lineTypes[s-1]){let e=Fn.TMHR.regexp.exec(this.lines[s]);e?(i="TMHR",r=e,l=Fn.TMHR.replacement):(i="TMPara",r=[this.lines[s]],l="$$0")}else{let e=s-1;const t="TMSetextH1Marker"==i?"TMSetextH1":"TMSetextH2";do{this.lineTypes[t]!=t&&(this.lineTypes[e]=t,this.lineDirty[t]=!0),this.lineReplacements[e]="$$0",this.lineCaptures[e]=[this.lines[e]],e--}while(e>=0&&"TMPara"==this.lineTypes[e])}this.lineTypes[s]!=i&&(this.lineTypes[s]=i,this.lineDirty[s]=!0),this.lineReplacements[s]=l,this.lineCaptures[s]=r}}updateLineContentsAndFormatting(){this.clearDirtyFlag(),this.updateLineContents(),this.updateFormatting()}parseLinkOrImage(e,t){let n=t?2:1,s=e.substr(0,n),i=t?"TMImage":"TMLink",r=n,l=1,a=!1,o=!1,u=[],c=[];e:for(;r<e.length&&!1===a;){let s=e.substr(r);for(let e of["escape","code","autolink","html"]){let t=Cn[e].regexp.exec(s);if(t){r+=t[0].length;continue e}}if(s.match(Cn.imageOpen.regexp))l++,r+=2;else if(s.match(Cn.linkOpen.regexp)){if(l++,!t&&this.parseLinkOrImage(s,!1))return!1;r+=1}else s.match(/^\]/)&&(l--,0==l)?(a=e.substr(n,r-n),r++):r++}if(!1===a)return!1;let h=r<e.length?e.substr(r,1):"";if("["==h){let t=e.substr(r),n=Cn.linkLabel.regexp.exec(t);if(!n)return!1;r+=n[0].length,u.push(n[1],n[2],n[3]),o=n[Cn.linkLabel.labelPlaceholder]?n[Cn.linkLabel.labelPlaceholder]:a.trim()}else if("("!=h)o=a.trim();else{r++;let t=1;for(;r<e.length&&t>0;){let n=e.substr(r),s=/^\s+/.exec(n);if(s){switch(c.length){case 0:case 1:c.push(s[0]);break;case 2:if(c[0].match(/</))c[1]=c[1].concat(s[0]);else{if(1!=t)return!1;c.push(""),c.push(s[0])}break;case 3:c.push(s[0]);break;case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(s[0]);break;case 7:c[6]=c[6].concat(s[0]);break;default:return!1}r+=s[0].length}else if(s=Cn.escape.regexp.exec(n),s){switch(c.length){case 0:c.push("");case 1:c.push(s[0]);break;case 2:c[1]=c[1].concat(s[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(s[0]);break;default:return!1}r+=s[0].length}else if(c.length<2&&n.match(/^</))0==c.length&&c.push(""),c[0]=c[0].concat("<"),r++;else if(1!=c.length&&2!=c.length||!n.match(/^>/))if(s=/^["']/.exec(n),!s||0!=c.length&&1!=c.length&&4!=c.length)if(!s||5!=c.length&&6!=c.length||c[4]!=s[0])if(n.match(/^\(/)){switch(c.length){case 0:c.push("");case 1:c.push("");case 2:c[1]=c[1].concat("("),c[0].match(/<$/)||t++;break;case 3:c.push("");case 4:c.push("(");break;case 5:c.push("");case 6:if("("==c[4])return!1;c[5]=c[5].concat("(");break;default:return!1}r++}else if(n.match(/^\)/)){if(c.length<=2){for(;c.length<2;)c.push("");c[0].match(/<$/)||t--,t>0&&(c[1]=c[1].concat(")"))}else 5==c.length||6==c.length?"("==c[4]?(5==c.length&&c.push(""),c.push(")")):5==c.length?c.push(")"):c[5]=c[5].concat(")"):t--;if(0==t)for(;c.length<7;)c.push("");r++}else{if(s=/^./.exec(n),!s)throw"Infinite loop";switch(c.length){case 0:c.push("");case 1:c.push(s[0]);break;case 2:c[1]=c[1].concat(s[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(s[0]);break;default:return!1}r+=s[0].length}else 5==c.length&&c.push(""),c.push(s[0]),r++;else{for(;c.length<4;)c.push("");c.push(s[0]),r++}else 1==c.length&&c.push(""),c.push(">"),r++}if(t>0)return!1}if(!1!==o){let e=!1;for(let t of this.linkLabels)if(t==o){e=!0;break}let t=e?"TMLinkLabel TMLinkLabel_Valid":"TMLinkLabel TMLinkLabel_Invalid",n=`<span class="TMMark TMMark_${i}">${s}</span><span class="${i} ${u.length<3||!u[1]?t:""}">${this.processInlineStyles(a)}</span><span class="TMMark TMMark_${i}">]</span>`;return u.length>=3&&(n=n.concat(`<span class="TMMark TMMark_${i}">${u[0]}</span>`,`<span class="${t}">${u[1]}</span>`,`<span class="TMMark TMMark_${i}">${u[2]}</span>`)),{output:n,charCount:r}}if(c){for(;c.length<7;)c.push("");return{output:`<span class="TMMark TMMark_${i}">${s}</span><span class="${i}">${this.processInlineStyles(a)}</span><span class="TMMark TMMark_${i}">](${c[0]}</span><span class="${i}Destination">${c[1]}</span><span class="TMMark TMMark_${i}">${c[2]}${c[3]}${c[4]}</span><span class="${i}Title">${c[5]}</span><span class="TMMark TMMark_${i}">${c[6]})</span>`,charCount:r}}return!1}processInlineStyles(e){let t="",n=[],s=0,i=e;e:for(;i;){for(let e of["escape","code","autolink","html"]){let n=Cn[e].regexp.exec(i);if(n){i=i.substr(n[0].length),s+=n[0].length,t+=Cn[e].replacement.replace(/\$([1-9])/g,((e,t)=>kn(n[t])));continue e}}let r=i.match(Cn.linkOpen.regexp),l=i.match(Cn.imageOpen.regexp);if(l||r){let e=this.parseLinkOrImage(i,l);if(e){t=`${t}${e.output}`,i=i.substr(e.charCount),s+=e.charCount;continue e}}let a=/(^\*+)|(^_+)/.exec(i);if(a){let r=a[0].length;const l=a[0],o=a[0][0];i=i.substr(a[0].length);const u=s>0?e.substr(0,s):" ",c=s+a[0].length<e.length?i:" ",h=c.match(Tn),p=u.match(Mn),d=c.match(/^\s/),m=u.match(/\s$/);let g=!(d||h&&!m&&!p),f=!(m||p&&!d&&!h);if("_"==o&&g&&f&&(g=p,f=h),f){let e=n.length-1;for(;r&&e>=0;)if(n[e].delimiter==o){for(;e<n.length-1;){const e=n.pop();t=`${e.output}${e.delimString.substr(0,e.count)}${t}`}if(r>=2&&n[e].count>=2?(t=`<span class="TMMark">${o}${o}</span><strong class="TMStrong">${t}</strong><span class="TMMark">${o}${o}</span>`,r-=2,n[e].count-=2):(t=`<span class="TMMark">${o}</span><em class="TMEm">${t}</em><span class="TMMark">${o}</span>`,r-=1,n[e].count-=1),0==n[e].count){t=`${n.pop().output}${t}`,e--}}else e--}r&&g&&(n.push({delimiter:o,delimString:l,count:r,output:t}),t="",r=0),r&&(t=`${t}${l.substr(0,r)}`),s+=a[0].length}else if(a=/^~~/.exec(i),a){let e=!1,r=n.length-1;for(;!e&&r>=0;)if("~"==n[r].delimiter){for(;r<n.length-1;){const e=n.pop();t=`${e.output}${e.delimString.substr(0,e.count)}${t}`}t=`<span class="TMMark">~~</span><del class="TMStrikethrough">${t}</del><span class="TMMark">~~</span>`,t=`${n.pop().output}${t}`,e=!0}else r--;e||(n.push({delimiter:"~",delimString:"~~",count:2,output:t}),t=""),s+=a[0].length,i=i.substr(a[0].length)}else{if(a=Cn.default.regexp.exec(i),!a)throw"Infinite loop!";i=i.substr(a[0].length),s+=a[0].length,t+=Cn.default.replacement.replace(/\$([1-9])/g,((e,t)=>kn(a[t])))}}for(;n.length;){const e=n.pop();t=`${e.output}${e.delimString.substr(0,e.count)}${t}`}return t}clearDirtyFlag(){this.lineDirty=new Array(this.lines.length);for(let e=0;e<this.lineDirty.length;e++)this.lineDirty[e]=!1}updateLineContents(){let e=this.e.childElementCount-this.lines.length;if(e){let t=0;for(;t<=this.lines.length&&t<=this.lineElements.length&&this.lineElements[t]&&this.lines[t]==this.lineElements[t].textContent;)t++;let n=-1;for(;-n<this.lines.length&&-n<this.lineElements.length&&this.lines[this.lines.length+n]==this.lineElements[this.lineElements.length+n].textContent;)n--;let s=this.lines.length+n+1-t;s<-e&&(s=-e),s<0&&(s=0);let i=[];for(let n=0;n<s+e;n++)i.push(this.lineElements[t+n].textContent);this.spliceLines(t,s,i,!1)}else for(let e=0;e<this.lineElements.length;e++){let t=this.lineElements[e].textContent;this.lines[e]!==t&&(this.lines[e]=t,this.lineDirty[e]=!0)}}processNewParagraph(e){if(!e)return;this.updateLineContents();let t=!1,n=e.col>0?e.row:e.row-1;switch(this.lineTypes[n]){case"TMUL":t="TMUL";break;case"TMOL":t="TMOL";break;case"TMIndentedCode":t="TMIndentedCode"}let s=this.lines[e.row].replace(/\n\n$/,"\n").split(/(?:\r\n|\n|\r)/);if(1!=s.length){if(this.spliceLines(e.row,1,s,!0),e.row++,e.col=0,t){let n=Fn[t].regexp.exec(this.lines[e.row-1]);n&&(n[2]?("TMOL"==t&&(n[1]=n[1].replace(/\d{1,9}/,(e=>parseInt(e[0])+1))),this.lines[e.row]=`${n[1]}${this.lines[e.row]}`,this.lineDirty[e.row]=!0,e.col=n[1].length):(this.lines[e.row-1]="",this.lineDirty[e.row-1]=!0))}this.updateFormatting()}else this.updateFormatting()}getSelection(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=window.getSelection();let n=e?t.anchorNode:t.focusNode;if(!n)return null;let s=e?t.anchorOffset:t.focusOffset;if(n==this.e)return s<this.lines.length?{row:s,col:0}:{row:s-1,col:this.lines[s-1].length};let i=this.computeColumn(n,s);if(null===i)return null;let r=n;for(;r.parentElement!=this.e;)r=r.parentElement;let l=0;if(!r.dataset||!r.dataset.lineNum||r.previousSibling&&r.previousSibling.dataset.lineNum==r.dataset.lineNum)for(;r.previousSibling;)l++,r=r.previousSibling;else l=parseInt(r.dataset.lineNum);return{row:l,col:i,node:n}}computeColumn(e,t){let n,s=e;for(;s&&s.parentNode!=this.e;)s=s.parentNode;if(null==s)return null;for(e.nodeType===Node.TEXT_NODE||0===t?(n=t,s=e):t>0&&(s=e.childNodes[t-1],n=s.textContent.length);s.parentNode!=this.e;)s.previousSibling?(s=s.previousSibling,n+=s.textContent.length):s=s.parentNode;return n}computeNodeAndOffset(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e>=this.lineElements.length&&(e=this.lineElements.length-1,t=this.lines[e].length),t>this.lines[e].length&&(t=this.lines[e].length);const s=this.lineElements[e];let i=s.firstChild,r=!1,l={node:s.firstChild?s.firstChild:s,offset:0};for(;i!=s;){if(!r&&i.nodeType===Node.TEXT_NODE)if(i.nodeValue.length>=t){if(!n||i.nodeValue.length!=t)return{node:i,offset:t};l={node:i,offset:t},t=0}else t-=i.nodeValue.length;!r&&i.firstChild?i=i.firstChild:i.nextSibling?(r=!1,i=i.nextSibling):(r=!0,i=i.parentNode)}return l}setSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return;let n=document.createRange(),{node:s,offset:i}=this.computeNodeAndOffset(e.row,e.col,t&&t.row==e.row&&t.col>e.col),r=null,l=null;if(t&&(t.row!=e.row||t.col!=e.col)){let{node:n,offset:s}=this.computeNodeAndOffset(t.row,t.col,e.row==t.row&&e.col>t.col);r=n,l=s}r?n.setStart(r,l):n.setStart(s,i),n.setEnd(s,i);let a=window.getSelection();a.removeAllRanges(),a.addRange(n)}handleInputEvent(e){if("insertCompositionText"==e.inputType)return;let t=this.getSelection();"insertParagraph"!=e.inputType&&"insertLineBreak"!=e.inputType||!t?(this.e.firstChild?this.fixNodeHierarchy():this.e.innerHTML='<div class="TMBlankLine"><br></div>',this.updateLineContentsAndFormatting()):(this.clearDirtyFlag(),this.processNewParagraph(t)),t&&this.setSelection(t),this.fireChange()}fixNodeHierarchy(){const e=Array.from(this.e.childNodes),t=function(e){const t=e.parentElement,n=e.nextSibling;t.removeChild(e);for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r<s;r++)i[r-1]=arguments[r];i.forEach((e=>n?t.insertBefore(e,n):t.appendChild(e)))};e.forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE||"DIV"!==e.tagName){const n=document.createElement("div");t(e,n),n.appendChild(e)}else if(0==e.childNodes.length)e.appendChild(document.createElement("br"));else{const n=Array.from(e.childNodes);if(n.some((e=>e.nodeType===Node.ELEMENT_NODE&&"DIV"===e.tagName)))return t(e,n)}}))}handleSelectionChangeEvent(){this.fireSelection()}spliceLines(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(s)for(let n=0;n<t;n++)this.e.removeChild(this.e.childNodes[e]);let i=[],r=[];for(let t=0;t<n.length;t++)i.push(""),r.push(!0),s&&(this.e.childNodes[e]?this.e.insertBefore(document.createElement("div"),this.e.childNodes[e]):this.e.appendChild(document.createElement("div")));this.lines.splice(e,t,...n),this.lineTypes.splice(e,t,...i),this.lineDirty.splice(e,t,...r)}handlePaste(e){e.preventDefault();let t=(e.originalEvent||e).clipboardData.getData("text/plain");this.paste(t)}paste(e){let t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;s||(s=this.getSelection(!0)),i||(i=this.getSelection(!1)),i||(i={row:this.lines.length-1,col:this.lines[this.lines.length-1].length}),s||(s=i),s.row<i.row||s.row==i.row&&s.col<=i.col?(t=s,n=i):(t=i,n=s);let r=e.split(/(?:\r\n|\r|\n)/),l=this.lines[t.row].substr(0,t.col),a=this.lines[n.row].substr(n.col);r[0]=l.concat(r[0]);let o=r[r.length-1].length;r[r.length-1]=r[r.length-1].concat(a),this.spliceLines(t.row,1+n.row-t.row,r),i.row=t.row+r.length-1,i.col=o,this.updateFormatting(),this.setSelection(i),this.fireChange()}computeCommonAncestor(e,t){if(!e||!t)return null;if(e==t)return e;const n=e=>{let t=[];for(;e;)t.unshift(e),e=e.parentNode;return t},s=n(e),i=n(t);if(s[0]!=i[0])return null;let r;for(r=0;s[r]==i[r];r++);return s[r-1]}computeEnclosingMarkupNode(e,t,n){let s=null;if(!e)return null;if(t){if(e.row!=t.row)return null;s=this.computeCommonAncestor(e.node,t.node)}else s=e.node;if(!s)return null;for(;s!=this.e;){if(s.className&&s.className.includes(n))return s;s=s.parentNode}return null}getCommandState(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={};if(n||(n=this.getSelection(!1)),s||(s=this.getSelection(!0)),!n){for(let e in yn)i[e]=null;return i}s||(s=n),s.row<n.row||s.row==n.row&&s.col<n.col?(e=s,t=n):(e=n,t=s),t.row>e.row&&0==t.col&&(t.row--,t.col=this.lines[t.row].length);for(let r in yn)if("inline"==yn[r].type&&(n&&n.row==s.row&&this.isInlineFormattingAllowed(n,s)?i[r]=!!this.computeEnclosingMarkupNode(n,s,yn[r].className)||n.col==s.col&&!!this.lines[n.row].substr(0,n.col).match(yn[r].unset.prePattern)&&!!this.lines[n.row].substr(n.col).match(yn[r].unset.postPattern):i[r]=null),"line"==yn[r].type)if(n){let n=this.lineTypes[e.row]==yn[r].className;for(let s=e.row;s<=t.row;s++)if(this.lineTypes[s]==yn[r].className!=n){n=null;break}i[r]=n}else i[r]=null;return i}setCommandState(e,t){if("inline"==yn[e].type){let t=this.getSelection(!0),n=this.getSelection(!1);if(t||(t=n),!t)return;if(t.row!=n.row)return;if(!this.isInlineFormattingAllowed(n,t))return;let s=this.computeEnclosingMarkupNode(n,t,yn[e].className);if(this.clearDirtyFlag(),s){this.lineDirty[n.row]=!0;const i=this.computeColumn(s,0),r=s.textContent.length,l=this.lines[n.row].substr(0,i).replace(yn[e].unset.prePattern,""),a=this.lines[n.row].substr(i,r),o=this.lines[n.row].substr(i+r).replace(yn[e].unset.postPattern,"");this.lines[n.row]=l.concat(a,o),t.col=l.length,n.col=t.col+r,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else if(n.col==t.col&&this.lines[n.row].substr(0,n.col).match(yn[e].unset.prePattern)&&this.lines[n.row].substr(n.col).match(yn[e].unset.postPattern)){this.lineDirty[n.row]=!0;const s=this.lines[n.row].substr(0,n.col).replace(yn[e].unset.prePattern,""),i=this.lines[n.row].substr(n.col).replace(yn[e].unset.postPattern,"");this.lines[n.row]=s.concat(i),n.col=t.col=s.length,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else{let{startCol:s,endCol:i}=n.col<t.col?{startCol:n.col,endCol:t.col}:{startCol:t.col,endCol:n.col},r=this.lines[n.row].substr(s,i-s).match(/^(?<leading>\s*).*\S(?<trailing>\s*)$/);r&&(s+=r.groups.leading.length,i-=r.groups.trailing.length),n.col=s,t.col=i,this.wrapSelection(yn[e].set.pre,yn[e].set.post,n,t),this.fireChange()}}else if("line"==yn[e].type){let n=this.getSelection(!0),s=this.getSelection(!1);if(n||(n=s),!s)return;this.clearDirtyFlag();let i=n.row>s.row?s:n,r=n.row>s.row?n:s;r.row>i.row&&0==r.col&&r.row--;for(let n=i.row;n<=r.row;n++)t&&this.lineTypes[n]!=yn[e].className&&(this.lines[n]=this.lines[n].replace(yn[e].set.pattern,yn[e].set.replacement.replace("$#",n-i.row+1)),this.lineDirty[n]=!0),t||this.lineTypes[n]!=yn[e].className||(this.lines[n]=this.lines[n].replace(yn[e].unset.pattern,yn[e].unset.replacement),this.lineDirty[n]=!0);this.updateFormatting(),this.setSelection({row:r.row,col:this.lines[r.row].length},{row:i.row,col:0}),this.fireChange()}}isInlineFormattingAllowed(){const e=window.getSelection();if(!e||!e.focusNode||!e.anchorNode)return!1;if(e.isCollapsed&&3==e.focusNode.nodeType&&e.focusOffset==e.focusNode.nodeValue.length){let t;for(t=e.focusNode;t&&null==t.nextSibling;t=t.parentNode);if(t&&t.nextSibling.className&&t.nextSibling.className.includes("TMInlineFormatted"))return!0}let t=this.computeCommonAncestor(e.focusNode,e.anchorNode);if(!t)return!1;for(;t&&t!=this.e;){if(t.className&&(t.className.includes("TMInlineFormatted")||t.className.includes("TMBlankLine")))return!0;t=t.parentNode}return!1}wrapSelection(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(n||(n=this.getSelection(!1)),s||(s=this.getSelection(!0)),!n||!s||n.row!=s.row)return;this.lineDirty[n.row]=!0;const i=n.col<s.col?n.col:s.col,r=n.col<s.col?s.col:n.col,l=this.lines[n.row].substr(0,i).concat(e),a=r==i?"":this.lines[n.row].substr(i,r-i),o=t.concat(this.lines[n.row].substr(r));this.lines[n.row]=l.concat(a,o),s.col=l.length,n.col=s.col+a.length,this.updateFormatting(),this.setSelection(n,s)}toggleCommandState(e){this.lastCommandState||(this.lastCommandState=this.getCommandState()),this.setCommandState(e,!this.lastCommandState[e])}fireChange(){if(!this.textarea&&!this.listeners.change.length)return;const e=this.getContent();this.textarea&&(this.textarea.value=e);for(let t of this.listeners.change)t({content:e,linesDirty:this.linesDirty})}fireSelection(){if(this.listeners.selection&&this.listeners.selection.length){let e=this.getSelection(!1),t=this.getSelection(!0),n=this.getCommandState(e,t);this.lastCommandState?Object.assign(this.lastCommandState,n):this.lastCommandState=Object.assign({},n);for(let n of this.listeners.selection)n({focus:e,anchor:t,commandState:this.lastCommandState})}}addEventListener(e,t){e.match(/^(?:change|input)$/i)&&this.listeners.change.push(t),e.match(/^(?:selection|selectionchange)$/i)&&this.listeners.selection.push(t)}},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyMDE={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(e){return e&&e.Math===Math&&e},s=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||t||Function("return this")(),r=function(e){try{return!!e()}catch(e){return!0}},i=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),l={},a={get exports(){return l},set exports(e){l=e}},u=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),o=u,c=Function.prototype,p=c.call,h=o&&c.bind.bind(p,p),d=o?h:function(e){return function(){return p.apply(e,arguments)}},g="object"==typeof document&&document.all,f={all:g,IS_HTMLDDA:void 0===g&&void 0!==g},M=f.all,m=f.IS_HTMLDDA?function(e){return"function"==typeof e||e===M}:function(e){return"function"==typeof e},T=function(e){return null==e},F=T,D=TypeError,C=function(e){if(F(e))throw new D("Can't call method on "+e);return e},E=Object,$=function(e){return E(C(e))},y=d({}.hasOwnProperty),k=Object.hasOwn||function(e,t){return y($(e),t)},A=i,b=k,w=Function.prototype,x=A&&Object.getOwnPropertyDescriptor,S=b(w,"name"),v={EXISTS:S,PROPER:S&&"something"===function(){}.name,CONFIGURABLE:S&&(!A||A&&x(w,"name").configurable)},L=s,B=Object.defineProperty,N=function(e,t){try{B(L,e,{value:t,configurable:!0,writable:!0})}catch(n){L[e]=t}return t},_="__core-js_shared__",H=s[_]||N(_,{}),O=m,P=H,I=d(Function.toString);O(P.inspectSource)||(P.inspectSource=function(e){return I(e)});var j,R,z=P.inspectSource,q=m,Z=s.WeakMap,U=q(Z)&&/native code/.test(String(Z)),V=m,X=f.all,G=f.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:V(e)||e===X}:function(e){return"object"==typeof e?null!==e:V(e)},K={},W=G,J=s.document,Q=W(J)&&W(J.createElement),Y=function(e){return Q?J.createElement(e):{}},ee=!i&&!r((function(){return 7!==Object.defineProperty(Y("div"),"a",{get:function(){return 7}}).a})),te=i&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ne=G,se=String,re=TypeError,ie=function(e){if(ne(e))return e;throw new re(se(e)+" is not an object")},le=u,ae=Function.prototype.call,ue=le?ae.bind(ae):function(){return ae.apply(ae,arguments)},oe=s,ce=m,pe=d({}.isPrototypeOf),he=s,de="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ge=he.process,fe=he.Deno,Me=ge&&ge.versions||fe&&fe.version,me=Me&&Me.v8;me&&(R=(j=me.split("."))[0]>0&&j[0]<4?1:+(j[0]+j[1])),!R&&de&&(!(j=de.match(/Edge\/(\d+)/))||j[1]>=74)&&(j=de.match(/Chrome\/(\d+)/))&&(R=+j[1]);var Te=R,Fe=r,De=s.String,Ce=!!Object.getOwnPropertySymbols&&!Fe((function(){var e=Symbol("symbol detection");return!De(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Te&&Te<41})),Ee=Ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,$e=function(e,t){return arguments.length<2?(n=oe[e],ce(n)?n:void 0):oe[e]&&oe[e][t];var n},ye=m,ke=pe,Ae=Object,be=Ee?function(e){return"symbol"==typeof e}:function(e){var t=$e("Symbol");return ye(t)&&ke(t.prototype,Ae(e))},we=String,xe=m,Se=function(e){try{return we(e)}catch(e){return"Object"}},ve=TypeError,Le=function(e){if(xe(e))return e;throw new ve(Se(e)+" is not a function")},Be=T,Ne=ue,_e=m,He=G,Oe=TypeError,Pe={},Ie=H;({get exports(){return Pe},set exports(e){Pe=e}}.exports=function(e,t){return Ie[e]||(Ie[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var je=d,Re=0,ze=Math.random(),qe=je(1..toString),Ze=function(e){return"Symbol("+(void 0===e?"":e)+")_"+qe(++Re+ze,36)},Ue=Pe,Ve=k,Xe=Ze,Ge=Ce,Ke=Ee,We=s.Symbol,Je=Ue("wks"),Qe=Ke?We.for||We:We&&We.withoutSetter||Xe,Ye=ue,et=G,tt=be,nt=function(e,t){var n=e[t];return Be(n)?void 0:Le(n)},st=function(e,t){var n,s;if("string"===t&&_e(n=e.toString)&&!He(s=Ne(n,e)))return s;if(_e(n=e.valueOf)&&!He(s=Ne(n,e)))return s;if("string"!==t&&_e(n=e.toString)&&!He(s=Ne(n,e)))return s;throw new Oe("Can't convert object to primitive value")},rt=TypeError,it=function(e){return Ve(Je,e)||(Je[e]=Ge&&Ve(We,e)?We[e]:Qe("Symbol."+e)),Je[e]}("toPrimitive"),lt=function(e,t){if(!et(e)||tt(e))return e;var n,s=nt(e,it);if(s){if(void 0===t&&(t="default"),n=Ye(s,e,t),!et(n)||tt(n))return n;throw new rt("Can't convert object to primitive value")}return void 0===t&&(t="number"),st(e,t)},at=be,ut=i,ot=ee,ct=te,pt=ie,ht=function(e){var t=lt(e,"string");return at(t)?t:t+""},dt=TypeError,gt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,Mt="enumerable",mt="configurable",Tt="writable";K.f=ut?ct?function(e,t,n){if(pt(e),t=ht(t),pt(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Tt in n&&!n[Tt]){var s=ft(e,t);s&&s[Tt]&&(e[t]=n.value,n={configurable:mt in n?n[mt]:s[mt],enumerable:Mt in n?n[Mt]:s[Mt],writable:!1})}return gt(e,t,n)}:gt:function(e,t,n){if(pt(e),t=ht(t),pt(n),ot)try{return gt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Ft,Dt,Ct,Et=K,$t=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},yt=i?function(e,t,n){return Et.f(e,t,$t(1,n))}:function(e,t,n){return e[t]=n,e},kt=Ze,At=Pe("keys"),bt=U,wt=s,xt=G,St=yt,vt=k,Lt=H,Bt=function(e){return At[e]||(At[e]=kt(e))},Nt="Object already initialized",_t=wt.TypeError,Ht=wt.WeakMap;if(bt||Lt.state){var Ot=Lt.state||(Lt.state=new Ht);Ot.get=Ot.get,Ot.has=Ot.has,Ot.set=Ot.set,Ft=function(e,t){if(Ot.has(e))throw new _t(Nt);return t.facade=e,Ot.set(e,t),t},Dt=function(e){return Ot.get(e)||{}},Ct=function(e){return Ot.has(e)}}else{var Pt=Bt("state");Ft=function(e,t){if(vt(e,Pt))throw new _t(Nt);return t.facade=e,St(e,Pt,t),t},Dt=function(e){return vt(e,Pt)?e[Pt]:{}},Ct=function(e){return vt(e,Pt)}}var It={set:Ft,get:Dt,has:Ct,enforce:function(e){return Ct(e)?Dt(e):Ft(e,{})},getterFor:function(e){return function(t){var n;if(!xt(t)||(n=Dt(t)).type!==e)throw new _t("Incompatible receiver, "+e+" required");return n}}},jt=d,Rt=r,zt=m,qt=k,Zt=i,Ut=v.CONFIGURABLE,Vt=z,Xt=It.enforce,Gt=It.get,Kt=String,Wt=Object.defineProperty,Jt=jt("".slice),Qt=jt("".replace),Yt=jt([].join),en=Zt&&!Rt((function(){return 8!==Wt((function(){}),"length",{value:8}).length})),tn=String(String).split("String"),nn=a.exports=function(e,t,n){"Symbol("===Jt(Kt(t),0,7)&&(t="["+Qt(Kt(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!qt(e,"name")||Ut&&e.name!==t)&&(Zt?Wt(e,"name",{value:t,configurable:!0}):e.name=t),en&&n&&qt(n,"arity")&&e.length!==n.arity&&Wt(e,"length",{value:n.arity});try{n&&qt(n,"constructor")&&n.constructor?Zt&&Wt(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=Xt(e);return qt(s,"source")||(s.source=Yt(tn,"string"==typeof t?t:"")),e};Function.prototype.toString=nn((function(){return zt(this)&&Gt(this).source||Vt(this)}),"toString");var sn=l,rn=K,ln=ie,an=i,un=function(e,t,n){return n.get&&sn(n.get,t,{getter:!0}),n.set&&sn(n.set,t,{setter:!0}),rn.f(e,t,n)},on=function(){var e=ln(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},cn=r,pn=s.RegExp,hn=pn.prototype;an&&cn((function(){var e=!0;try{pn(".","d")}catch(t){e=!1}var t={},n="",s=e?"dgimsy":"gimsy",r=function(e,s){Object.defineProperty(t,e,{get:function(){return n+=s,!0}})},i={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var l in e&&(i.hasIndices="d"),i)r(l,i[l]);return Object.getOwnPropertyDescriptor(hn,"flags").get.call(t)!==s||n!==s}))&&un(hn,"flags",{configurable:!0,get:on});const dn={ASCIIPunctuation:/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~\\]/,NotTriggerChar:/[^`_*[\]()<>!~]/,Scheme:/[A-Za-z][A-Za-z0-9+.-]{1,31}/,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])?)*/,HTMLOpenTag:/<HTMLTagName(?:HTMLAttribute)*\s*\/?>/,HTMLCloseTag:/<\/HTMLTagName\s*>/,HTMLTagName:/[A-Za-z][A-Za-z0-9-]*/,HTMLComment:/<!--(?:[^>-]|(?:[^>-](?:[^-]|-[^-])*[^-]))-->/,HTMLPI:/<\?(?:|.|(?:[^?]|\?[^>])*)\?>/,HTMLDeclaration:/<![A-Z]+\s[^>]*>/,HTMLCDATA:/<!\[CDATA\[.*?\]\]>/,HTMLAttribute:/\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:HTMLAttValue)?/,HTMLAttValue:/\s*=\s*(?:(?:'[^']*')|(?:"[^"]*")|(?:[^\s"'=<>`]+))/,KnownTag:/address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul/},gn=new RegExp(/^(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])/),fn=new RegExp(/(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])$/),Mn={TMH1:{regexp:/^( {0,3}#\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH1">$1</span>$$2<span class="TMMark TMMark_TMH1">$3</span>'},TMH2:{regexp:/^( {0,3}##\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH2">$1</span>$$2<span class="TMMark TMMark_TMH2">$3</span>'},TMH3:{regexp:/^( {0,3}###\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH3">$1</span>$$2<span class="TMMark TMMark_TMH3">$3</span>'},TMH4:{regexp:/^( {0,3}####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH4">$1</span>$$2<span class="TMMark TMMark_TMH4">$3</span>'},TMH5:{regexp:/^( {0,3}#####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH5">$1</span>$$2<span class="TMMark TMMark_TMH5">$3</span>'},TMH6:{regexp:/^( {0,3}######\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH6">$1</span>$$2<span class="TMMark TMMark_TMH6">$3</span>'},TMBlockquote:{regexp:/^( {0,3}>[ ]?)(.*)$/,replacement:'<span class="TMMark TMMark_TMBlockquote">$1</span>$$2'},TMCodeFenceBacktickOpen:{regexp:/^( {0,3}(?<seq>````*)\s*)([^`]*?)(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceTildeOpen:{regexp:/^( {0,3}(?<seq>~~~~*)\s*)(.*?)(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceBacktickClose:{regexp:/^( {0,3}(?<seq>````*))(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span>$3'},TMCodeFenceTildeClose:{regexp:/^( {0,3}(?<seq>~~~~*))(\s*)$/,replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span>$3'},TMBlankLine:{regexp:/^([ \t]*)$/,replacement:"$0"},TMSetextH1Marker:{regexp:/^ {0,3}=+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMSetextH2Marker:{regexp:/^ {0,3}-+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMHR:{regexp:/^( {0,3}(\*[ \t]*\*[ \t]*\*[ \t*]*)|(-[ \t]*-[ \t]*-[ \t-]*)|(_[ \t]*_[ \t]*_[ \t_]*))$/,replacement:'<span class="TMMark TMMark_TMHR">$0</span>'},TMUL:{regexp:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMUL">$1</span>$$2'},TMOL:{regexp:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMOL">$1</span>$$2'},TMIndentedCode:{regexp:/^( {4}|\t)(.*)$/,replacement:'<span class="TMMark TMMark_TMIndentedCode">$1</span>$2'},TMLinkReferenceDefinition:{regexp:/^( {0,3}\[\s*)([^\s\]](?:[^\]]|\\\])*?)(\s*\]:\s*)((?:[^\s<>]+)|(?:<(?:[^<>\\]|\\.)*>))?(\s*)((?:\((?:[^()\\]|\\.)*\))|(?:"(?:[^"\\]|\\.)*")|(?:'(?:[^'\\]|\\.)*'))?(\s*)$/,replacement:'<span class="TMMark TMMark_TMLinkReferenceDefinition">$1</span><span class="TMLinkLabel TMLinkLabel_Definition">$2</span><span class="TMMark TMMark_TMLinkReferenceDefinition">$3</span><span class="TMLinkDestination">$4</span>$5<span class="TMLinkTitle">$6</span>$7',labelPlaceholder:2}};var mn=[{start:/^ {0,3}<(?:script|pre|style)(?:\s|>|$)/i,end:/(?:<\/script>|<\/pre>|<\/style>)/i,paraInterrupt:!0},{start:/^ {0,3}<!--/,end:/-->/,paraInterrupt:!0},{start:/^ {0,3}<\?/,end:/\?>/,paraInterrupt:!0},{start:/^ {0,3}<![A-Z]/,end:/>/,paraInterrupt:!0},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/,paraInterrupt:!0},{start:/^ {0,3}(?:<|<\/)(?:KnownTag)(?:\s|>|\/>|$)/i,end:!1,paraInterrupt:!0},{start:/^ {0,3}(?:HTMLOpenTag|HTMLCloseTag)\s*$/,end:!1,paraInterrupt:!1}],Tn={escape:{regexp:/^\\(ASCIIPunctuation)/,replacement:'<span class="TMMark TMMark_TMEscape">\\</span>$1'},code:{regexp:/^(`+)((?:[^`])|(?:[^`].*?[^`]))(\1)/,replacement:'<span class="TMMark TMMark_TMCode">$1</span><code class="TMCode">$2</code><span class="TMMark TMMark_TMCode">$3</span>'},autolink:{regexp:/^<((?:Scheme:[^\s<>]*)|(?:Email))>/,replacement:'<span class="TMMark TMMark_TMAutolink">&lt;</span><span class="TMAutolink">$1</span><span class="TMMark TMMark_TMAutolink">&gt;</span>'},html:{regexp:/^((?:HTMLOpenTag)|(?:HTMLCloseTag)|(?:HTMLComment)|(?:HTMLPI)|(?:HTMLDeclaration)|(?:HTMLCDATA))/,replacement:'<span class="TMHTML">$1</span>'},linkOpen:{regexp:/^\[/,replacement:""},imageOpen:{regexp:/^!\[/,replacement:""},linkLabel:{regexp:/^(\[\s*)([^\]]*?)(\s*\])/,replacement:"",labelPlaceholder:2},default:{regexp:/^(.|(?:NotTriggerChar+))/,replacement:"$1"}};const Fn=new RegExp(Object.keys(dn).join("|")),Dn=[...Object.keys(Tn)];for(let e of Dn){let t=Tn[e].regexp.source;for(;t.match(Fn);)t=t.replace(Fn,(e=>dn[e].source));Tn[e].regexp=new RegExp(t,Tn[e].regexp.flags)}for(let e of mn){let t=e.start.source;for(;t.match(Fn);)t=t.replace(Fn,(e=>dn[e].source));e.start=new RegExp(t,e.start.flags)}function Cn(e){return(e||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const En={bold:{type:"inline",className:"TMStrong",set:{pre:"**",post:"**"},unset:{prePattern:/(?:\*\*|__)$/,postPattern:/^(?:\*\*|__)/}},italic:{type:"inline",className:"TMEm",set:{pre:"*",post:"*"},unset:{prePattern:/(?:\*|_)$/,postPattern:/^(?:\*|_)/}},code:{type:"inline",className:"TMCode",set:{pre:"`",post:"`"},unset:{prePattern:/`+$/,postPattern:/^`+/}},strikethrough:{type:"inline",className:"TMStrikethrough",set:{pre:"~~",post:"~~"},unset:{prePattern:/~~$/,postPattern:/^~~/}},h1:{type:"line",className:"TMH1",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"# $2"},unset:{pattern:/^( {0,3}#\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h2:{type:"line",className:"TMH2",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"## $2"},unset:{pattern:/^( {0,3}##\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h3:{type:"line",className:"TMH3",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"### $2"},unset:{pattern:/^( {0,3}###\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h4:{type:"line",className:"TMH4",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"#### $2"},unset:{pattern:/^( {0,3}####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h5:{type:"line",className:"TMH5",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"##### $2"},unset:{pattern:/^( {0,3}#####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h6:{type:"line",className:"TMH6",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"###### $2"},unset:{pattern:/^( {0,3}######\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},ul:{type:"line",className:"TMUL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"- $2"},unset:{pattern:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:"$2"}},ol:{type:"line",className:"TMOL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"$#. $2"},unset:{pattern:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:"$2"}},blockquote:{type:"line",className:"TMBlockquote",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"> $2"},unset:{pattern:/^( {0,3}>[ ]?)(.*)$/,replacement:"$2"}}};e.Editor=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.e=null,this.textarea=null,this.lines=[],this.lineElements=[],this.lineTypes=[],this.lineCaptures=[],this.lineReplacements=[],this.linkLabels=[],this.lineDirty=[],this.lastCommandState=null,this.listeners={change:[],selection:[]};let t=e.element;this.textarea=e.textarea,this.textarea&&(this.textarea.tagName||(this.textarea=document.getElementById(this.textarea)),t||(t=this.textarea)),t&&!t.tagName&&(t=document.getElementById(e.element)),t||(t=document.getElementsByTagName("body")[0]),"TEXTAREA"==t.tagName&&(this.textarea=t,t=this.textarea.parentNode),this.textarea&&(this.textarea.style.display="none"),this.createEditorElement(t),this.setContent(e.content||(this.textarea?this.textarea.value:"# Hello TinyMDE!\nEdit **here**"))}createEditorElement(e){this.e=document.createElement("div"),this.e.className="TinyMDE",this.e.contentEditable=!0,this.e.style.whiteSpace="pre-wrap",this.e.style.webkitUserModify="read-write-plaintext-only",this.textarea&&this.textarea.parentNode==e&&this.textarea.nextSibling?e.insertBefore(this.e,this.textarea.nextSibling):e.appendChild(this.e),this.e.addEventListener("input",(e=>this.handleInputEvent(e))),this.e.addEventListener("compositionend",(e=>this.handleInputEvent(e))),document.addEventListener("selectionchange",(e=>this.handleSelectionChangeEvent(e))),this.e.addEventListener("paste",(e=>this.handlePaste(e))),this.lineElements=this.e.childNodes}setContent(e){for(;this.e.firstChild;)this.e.removeChild(this.e.firstChild);this.lines=e.split(/(?:\r\n|\r|\n)/),this.lineDirty=[];for(let e=0;e<this.lines.length;e++){let e=document.createElement("div");this.e.appendChild(e),this.lineDirty.push(!0)}this.lineTypes=new Array(this.lines.length),this.updateFormatting(),this.fireChange()}getContent(){return this.lines.join("\n")}updateFormatting(){this.updateLineTypes(),this.updateLinkLabels(),this.applyLineTypes()}updateLinkLabels(){this.linkLabels=[];for(let e=0;e<this.lines.length;e++)"TMLinkReferenceDefinition"==this.lineTypes[e]&&this.linkLabels.push(this.lineCaptures[e][Mn.TMLinkReferenceDefinition.labelPlaceholder])}replace(e,t){return e.replace(/(\${1,2})([0-9])/g,((e,n,s)=>"$"==n?Cn(t[s]):`<span class="TMInlineFormatted">${this.processInlineStyles(t[s])}</span>`))}applyLineTypes(){for(let e=0;e<this.lines.length;e++){if(this.lineDirty[e]){let t=this.replace(this.lineReplacements[e],this.lineCaptures[e]);this.lineElements[e].className=this.lineTypes[e],this.lineElements[e].removeAttribute("style"),this.lineElements[e].innerHTML=""==t?"<br />":t}this.lineElements[e].dataset.lineNum=e}}updateLineTypes(){let e=!1,t=0,n=!1;for(let s=0;s<this.lines.length;s++){let r="TMPara",i=[this.lines[s]],l="$$0";if("TMCodeFenceBacktickOpen"==e){let n=Mn.TMCodeFenceBacktickClose.regexp.exec(this.lines[s]);n&&n.groups.seq.length>=t?(r="TMCodeFenceBacktickClose",l=Mn.TMCodeFenceBacktickClose.replacement,i=n,e=!1):(r="TMFencedCodeBacktick",l='<span class="TMFencedCode">$0<br /></span>',i=[this.lines[s]])}else if("TMCodeFenceTildeOpen"==e){let n=Mn.TMCodeFenceTildeClose.regexp.exec(this.lines[s]);n&&n.groups.seq.length>=t?(r="TMCodeFenceTildeClose",l=Mn.TMCodeFenceTildeClose.replacement,i=n,e=!1):(r="TMFencedCodeTilde",l='<span class="TMFencedCode">$0<br /></span>',i=[this.lines[s]])}if("TMPara"==r&&!1===n)for(let e of mn)if(this.lines[s].match(e.start)&&(e.paraInterrupt||0==s||"TMPara"!=this.lineTypes[s-1]&&"TMUL"!=this.lineTypes[s-1]&&"TMOL"!=this.lineTypes[s-1]&&"TMBlockquote"!=this.lineTypes[s-1])){n=e;break}if(!1!==n&&(r="TMHTMLBlock",l='<span class="TMHTMLContent">$0<br /></span>',i=[this.lines[s]],n.end?this.lines[s].match(n.end)&&(n=!1):(s==this.lines.length-1||this.lines[s+1].match(Mn.TMBlankLine.regexp))&&(n=!1)),"TMPara"==r)for(let e in Mn)if(Mn[e].regexp){let t=Mn[e].regexp.exec(this.lines[s]);if(t){r=e,l=Mn[e].replacement,i=t;break}}if("TMCodeFenceBacktickOpen"!=r&&"TMCodeFenceTildeOpen"!=r||(e=r,t=i.groups.seq.length),"TMIndentedCode"!=r&&"TMLinkReferenceDefinition"!=r||!(s>0)||"TMPara"!=this.lineTypes[s-1]&&"TMUL"!=this.lineTypes[s-1]&&"TMOL"!=this.lineTypes[s-1]&&"TMBlockquote"!=this.lineTypes[s-1]||(r="TMPara",i=[this.lines[s]],l="$$0"),"TMSetextH2Marker"==r){let e=Mn.TMUL.regexp.exec(this.lines[s]);e&&(r="TMUL",l=Mn.TMUL.replacement,i=e)}if("TMSetextH1Marker"==r||"TMSetextH2Marker"==r)if(0==s||"TMPara"!=this.lineTypes[s-1]){let e=Mn.TMHR.regexp.exec(this.lines[s]);e?(r="TMHR",i=e,l=Mn.TMHR.replacement):(r="TMPara",i=[this.lines[s]],l="$$0")}else{let e=s-1;const t="TMSetextH1Marker"==r?"TMSetextH1":"TMSetextH2";do{this.lineTypes[t]!=t&&(this.lineTypes[e]=t,this.lineDirty[t]=!0),this.lineReplacements[e]="$$0",this.lineCaptures[e]=[this.lines[e]],e--}while(e>=0&&"TMPara"==this.lineTypes[e])}this.lineTypes[s]!=r&&(this.lineTypes[s]=r,this.lineDirty[s]=!0),this.lineReplacements[s]=l,this.lineCaptures[s]=i}}updateLineContentsAndFormatting(){this.clearDirtyFlag(),this.updateLineContents(),this.updateFormatting()}parseLinkOrImage(e,t){let n=t?2:1,s=e.substr(0,n),r=t?"TMImage":"TMLink",i=n,l=1,a=!1,u=!1,o=[],c=[];e:for(;i<e.length&&!1===a;){let s=e.substr(i);for(let e of["escape","code","autolink","html"]){let t=Tn[e].regexp.exec(s);if(t){i+=t[0].length;continue e}}if(s.match(Tn.imageOpen.regexp))l++,i+=2;else if(s.match(Tn.linkOpen.regexp)){if(l++,!t&&this.parseLinkOrImage(s,!1))return!1;i+=1}else s.match(/^\]/)&&(l--,0==l)?(a=e.substr(n,i-n),i++):i++}if(!1===a)return!1;let p=i<e.length?e.substr(i,1):"";if("["==p){let t=e.substr(i),n=Tn.linkLabel.regexp.exec(t);if(!n)return!1;i+=n[0].length,o.push(n[1],n[2],n[3]),u=n[Tn.linkLabel.labelPlaceholder]?n[Tn.linkLabel.labelPlaceholder]:a.trim()}else if("("!=p)u=a.trim();else{i++;let t=1;for(;i<e.length&&t>0;){let n=e.substr(i),s=/^\s+/.exec(n);if(s){switch(c.length){case 0:case 1:c.push(s[0]);break;case 2:if(c[0].match(/</))c[1]=c[1].concat(s[0]);else{if(1!=t)return!1;c.push(""),c.push(s[0])}break;case 3:c.push(s[0]);break;case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(s[0]);break;case 7:c[6]=c[6].concat(s[0]);break;default:return!1}i+=s[0].length}else if(s=Tn.escape.regexp.exec(n),s){switch(c.length){case 0:c.push("");case 1:c.push(s[0]);break;case 2:c[1]=c[1].concat(s[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(s[0]);break;default:return!1}i+=s[0].length}else if(c.length<2&&n.match(/^</))0==c.length&&c.push(""),c[0]=c[0].concat("<"),i++;else if(1!=c.length&&2!=c.length||!n.match(/^>/))if(s=/^["']/.exec(n),!s||0!=c.length&&1!=c.length&&4!=c.length)if(!s||5!=c.length&&6!=c.length||c[4]!=s[0])if(n.match(/^\(/)){switch(c.length){case 0:c.push("");case 1:c.push("");case 2:c[1]=c[1].concat("("),c[0].match(/<$/)||t++;break;case 3:c.push("");case 4:c.push("(");break;case 5:c.push("");case 6:if("("==c[4])return!1;c[5]=c[5].concat("(");break;default:return!1}i++}else if(n.match(/^\)/)){if(c.length<=2){for(;c.length<2;)c.push("");c[0].match(/<$/)||t--,t>0&&(c[1]=c[1].concat(")"))}else 5==c.length||6==c.length?"("==c[4]?(5==c.length&&c.push(""),c.push(")")):5==c.length?c.push(")"):c[5]=c[5].concat(")"):t--;if(0==t)for(;c.length<7;)c.push("");i++}else{if(s=/^./.exec(n),!s)throw"Infinite loop";switch(c.length){case 0:c.push("");case 1:c.push(s[0]);break;case 2:c[1]=c[1].concat(s[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(s[0]);break;default:return!1}i+=s[0].length}else 5==c.length&&c.push(""),c.push(s[0]),i++;else{for(;c.length<4;)c.push("");c.push(s[0]),i++}else 1==c.length&&c.push(""),c.push(">"),i++}if(t>0)return!1}if(!1!==u){let e=!1;for(let t of this.linkLabels)if(t==u){e=!0;break}let t=e?"TMLinkLabel TMLinkLabel_Valid":"TMLinkLabel TMLinkLabel_Invalid",n=`<span class="TMMark TMMark_${r}">${s}</span><span class="${r} ${o.length<3||!o[1]?t:""}">${this.processInlineStyles(a)}</span><span class="TMMark TMMark_${r}">]</span>`;return o.length>=3&&(n=n.concat(`<span class="TMMark TMMark_${r}">${o[0]}</span>`,`<span class="${t}">${o[1]}</span>`,`<span class="TMMark TMMark_${r}">${o[2]}</span>`)),{output:n,charCount:i}}if(c){for(;c.length<7;)c.push("");return{output:`<span class="TMMark TMMark_${r}">${s}</span><span class="${r}">${this.processInlineStyles(a)}</span><span class="TMMark TMMark_${r}">](${c[0]}</span><span class="${r}Destination">${c[1]}</span><span class="TMMark TMMark_${r}">${c[2]}${c[3]}${c[4]}</span><span class="${r}Title">${c[5]}</span><span class="TMMark TMMark_${r}">${c[6]})</span>`,charCount:i}}return!1}processInlineStyles(e){let t="",n=[],s=0,r=e;e:for(;r;){for(let e of["escape","code","autolink","html"]){let n=Tn[e].regexp.exec(r);if(n){r=r.substr(n[0].length),s+=n[0].length,t+=Tn[e].replacement.replace(/\$([1-9])/g,((e,t)=>Cn(n[t])));continue e}}let i=r.match(Tn.linkOpen.regexp),l=r.match(Tn.imageOpen.regexp);if(l||i){let e=this.parseLinkOrImage(r,l);if(e){t=`${t}${e.output}`,r=r.substr(e.charCount),s+=e.charCount;continue e}}let a=/(^\*+)|(^_+)/.exec(r);if(a){let i=a[0].length;const l=a[0],u=a[0][0];r=r.substr(a[0].length);const o=s>0?e.substr(0,s):" ",c=s+a[0].length<e.length?r:" ",p=c.match(gn),h=o.match(fn),d=c.match(/^\s/),g=o.match(/\s$/);let f=!(d||p&&!g&&!h),M=!(g||h&&!d&&!p);if("_"==u&&f&&M&&(f=h,M=p),M){let e=n.length-1;for(;i&&e>=0;)if(n[e].delimiter==u){for(;e<n.length-1;){const e=n.pop();t=`${e.output}${e.delimString.substr(0,e.count)}${t}`}if(i>=2&&n[e].count>=2?(t=`<span class="TMMark">${u}${u}</span><strong class="TMStrong">${t}</strong><span class="TMMark">${u}${u}</span>`,i-=2,n[e].count-=2):(t=`<span class="TMMark">${u}</span><em class="TMEm">${t}</em><span class="TMMark">${u}</span>`,i-=1,n[e].count-=1),0==n[e].count){t=`${n.pop().output}${t}`,e--}}else e--}i&&f&&(n.push({delimiter:u,delimString:l,count:i,output:t}),t="",i=0),i&&(t=`${t}${l.substr(0,i)}`),s+=a[0].length}else if(a=/^~~/.exec(r),a){let e=!1,i=n.length-1;for(;!e&&i>=0;)if("~"==n[i].delimiter){for(;i<n.length-1;){const e=n.pop();t=`${e.output}${e.delimString.substr(0,e.count)}${t}`}t=`<span class="TMMark">~~</span><del class="TMStrikethrough">${t}</del><span class="TMMark">~~</span>`,t=`${n.pop().output}${t}`,e=!0}else i--;e||(n.push({delimiter:"~",delimString:"~~",count:2,output:t}),t=""),s+=a[0].length,r=r.substr(a[0].length)}else{if(a=Tn.default.regexp.exec(r),!a)throw"Infinite loop!";r=r.substr(a[0].length),s+=a[0].length,t+=Tn.default.replacement.replace(/\$([1-9])/g,((e,t)=>Cn(a[t])))}}for(;n.length;){const e=n.pop();t=`${e.output}${e.delimString.substr(0,e.count)}${t}`}return t}clearDirtyFlag(){this.lineDirty=new Array(this.lines.length);for(let e=0;e<this.lineDirty.length;e++)this.lineDirty[e]=!1}updateLineContents(){let e=this.e.childElementCount-this.lines.length;if(e){let t=0;for(;t<=this.lines.length&&t<=this.lineElements.length&&this.lineElements[t]&&this.lines[t]==this.lineElements[t].textContent;)t++;let n=-1;for(;-n<this.lines.length&&-n<this.lineElements.length&&this.lines[this.lines.length+n]==this.lineElements[this.lineElements.length+n].textContent;)n--;let s=this.lines.length+n+1-t;s<-e&&(s=-e),s<0&&(s=0);let r=[];for(let n=0;n<s+e;n++)r.push(this.lineElements[t+n].textContent);this.spliceLines(t,s,r,!1)}else for(let e=0;e<this.lineElements.length;e++){let t=this.lineElements[e].textContent;this.lines[e]!==t&&(this.lines[e]=t,this.lineDirty[e]=!0)}}processNewParagraph(e){if(!e)return;this.updateLineContents();let t=!1,n=e.col>0?e.row:e.row-1;switch(this.lineTypes[n]){case"TMUL":t="TMUL";break;case"TMOL":t="TMOL";break;case"TMIndentedCode":t="TMIndentedCode"}let s=this.lines[e.row].replace(/\n\n$/,"\n").split(/(?:\r\n|\n|\r)/);if(1!=s.length){if(this.spliceLines(e.row,1,s,!0),e.row++,e.col=0,t){let n=Mn[t].regexp.exec(this.lines[e.row-1]);n&&(n[2]?("TMOL"==t&&(n[1]=n[1].replace(/\d{1,9}/,(e=>parseInt(e[0])+1))),this.lines[e.row]=`${n[1]}${this.lines[e.row]}`,this.lineDirty[e.row]=!0,e.col=n[1].length):(this.lines[e.row-1]="",this.lineDirty[e.row-1]=!0))}this.updateFormatting()}else this.updateFormatting()}getSelection(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=window.getSelection();let n=e?t.anchorNode:t.focusNode;if(!n)return null;let s=e?t.anchorOffset:t.focusOffset;if(n==this.e)return s<this.lines.length?{row:s,col:0}:{row:s-1,col:this.lines[s-1].length};let r=this.computeColumn(n,s);if(null===r)return null;let i=n;for(;i.parentElement!=this.e;)i=i.parentElement;let l=0;if(!i.dataset||!i.dataset.lineNum||i.previousSibling&&i.previousSibling.dataset.lineNum==i.dataset.lineNum)for(;i.previousSibling;)l++,i=i.previousSibling;else l=parseInt(i.dataset.lineNum);return{row:l,col:r,node:n}}computeColumn(e,t){let n,s=e;for(;s&&s.parentNode!=this.e;)s=s.parentNode;if(null==s)return null;for(e.nodeType===Node.TEXT_NODE||0===t?(n=t,s=e):t>0&&(s=e.childNodes[t-1],n=s.textContent.length);s.parentNode!=this.e;)s.previousSibling?(s=s.previousSibling,n+=s.textContent.length):s=s.parentNode;return n}computeNodeAndOffset(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e>=this.lineElements.length&&(e=this.lineElements.length-1,t=this.lines[e].length),t>this.lines[e].length&&(t=this.lines[e].length);const s=this.lineElements[e];let r=s.firstChild,i=!1,l={node:s.firstChild?s.firstChild:s,offset:0};for(;r!=s;){if(!i&&r.nodeType===Node.TEXT_NODE)if(r.nodeValue.length>=t){if(!n||r.nodeValue.length!=t)return{node:r,offset:t};l={node:r,offset:t},t=0}else t-=r.nodeValue.length;!i&&r.firstChild?r=r.firstChild:r.nextSibling?(i=!1,r=r.nextSibling):(i=!0,r=r.parentNode)}return l}setSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return;let n=document.createRange(),{node:s,offset:r}=this.computeNodeAndOffset(e.row,e.col,t&&t.row==e.row&&t.col>e.col),i=null,l=null;if(t&&(t.row!=e.row||t.col!=e.col)){let{node:n,offset:s}=this.computeNodeAndOffset(t.row,t.col,e.row==t.row&&e.col>t.col);i=n,l=s}i?n.setStart(i,l):n.setStart(s,r),n.setEnd(s,r);let a=window.getSelection();a.removeAllRanges(),a.addRange(n)}handleInputEvent(e){if("insertCompositionText"==e.inputType)return;let t=this.getSelection();"insertParagraph"!=e.inputType&&"insertLineBreak"!=e.inputType||!t?(this.e.firstChild?this.fixNodeHierarchy():this.e.innerHTML='<div class="TMBlankLine"><br></div>',this.updateLineContentsAndFormatting()):(this.clearDirtyFlag(),this.processNewParagraph(t)),t&&this.setSelection(t),this.fireChange()}fixNodeHierarchy(){const e=Array.from(this.e.childNodes),t=function(e){const t=e.parentElement,n=e.nextSibling;t.removeChild(e);for(var s=arguments.length,r=new Array(s>1?s-1:0),i=1;i<s;i++)r[i-1]=arguments[i];r.forEach((e=>n?t.insertBefore(e,n):t.appendChild(e)))};e.forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE||"DIV"!==e.tagName){const n=document.createElement("div");t(e,n),n.appendChild(e)}else if(0==e.childNodes.length)e.appendChild(document.createElement("br"));else{const n=Array.from(e.childNodes);if(n.some((e=>e.nodeType===Node.ELEMENT_NODE&&"DIV"===e.tagName)))return t(e,n)}}))}handleSelectionChangeEvent(){this.fireSelection()}spliceLines(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(s)for(let n=0;n<t;n++)this.e.removeChild(this.e.childNodes[e]);let r=[],i=[];for(let t=0;t<n.length;t++)r.push(""),i.push(!0),s&&(this.e.childNodes[e]?this.e.insertBefore(document.createElement("div"),this.e.childNodes[e]):this.e.appendChild(document.createElement("div")));this.lines.splice(e,t,...n),this.lineTypes.splice(e,t,...r),this.lineDirty.splice(e,t,...i)}handlePaste(e){e.preventDefault();let t=(e.originalEvent||e).clipboardData.getData("text/plain");this.paste(t)}paste(e){let t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;s||(s=this.getSelection(!0)),r||(r=this.getSelection(!1)),r||(r={row:this.lines.length-1,col:this.lines[this.lines.length-1].length}),s||(s=r),s.row<r.row||s.row==r.row&&s.col<=r.col?(t=s,n=r):(t=r,n=s);let i=e.split(/(?:\r\n|\r|\n)/),l=this.lines[t.row].substr(0,t.col),a=this.lines[n.row].substr(n.col);i[0]=l.concat(i[0]);let u=i[i.length-1].length;i[i.length-1]=i[i.length-1].concat(a),this.spliceLines(t.row,1+n.row-t.row,i),r.row=t.row+i.length-1,r.col=u,this.updateFormatting(),this.setSelection(r),this.fireChange()}computeCommonAncestor(e,t){if(!e||!t)return null;if(e==t)return e;const n=e=>{let t=[];for(;e;)t.unshift(e),e=e.parentNode;return t},s=n(e),r=n(t);if(s[0]!=r[0])return null;let i;for(i=0;s[i]==r[i];i++);return s[i-1]}computeEnclosingMarkupNode(e,t,n){let s=null;if(!e)return null;if(t){if(e.row!=t.row)return null;s=this.computeCommonAncestor(e.node,t.node)}else s=e.node;if(!s)return null;for(;s!=this.e;){if(s.className&&s.className.includes(n))return s;s=s.parentNode}return null}getCommandState(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r={};if(n||(n=this.getSelection(!1)),s||(s=this.getSelection(!0)),!n){for(let e in En)r[e]=null;return r}s||(s=n),s.row<n.row||s.row==n.row&&s.col<n.col?(e=s,t=n):(e=n,t=s),t.row>e.row&&0==t.col&&(t.row--,t.col=this.lines[t.row].length);for(let i in En)if("inline"==En[i].type&&(n&&n.row==s.row&&this.isInlineFormattingAllowed(n,s)?r[i]=!!this.computeEnclosingMarkupNode(n,s,En[i].className)||n.col==s.col&&!!this.lines[n.row].substr(0,n.col).match(En[i].unset.prePattern)&&!!this.lines[n.row].substr(n.col).match(En[i].unset.postPattern):r[i]=null),"line"==En[i].type)if(n){let n=this.lineTypes[e.row]==En[i].className;for(let s=e.row;s<=t.row;s++)if(this.lineTypes[s]==En[i].className!=n){n=null;break}r[i]=n}else r[i]=null;return r}setCommandState(e,t){if("inline"==En[e].type){let t=this.getSelection(!0),n=this.getSelection(!1);if(t||(t=n),!t)return;if(t.row!=n.row)return;if(!this.isInlineFormattingAllowed(n,t))return;let s=this.computeEnclosingMarkupNode(n,t,En[e].className);if(this.clearDirtyFlag(),s){this.lineDirty[n.row]=!0;const r=this.computeColumn(s,0),i=s.textContent.length,l=this.lines[n.row].substr(0,r).replace(En[e].unset.prePattern,""),a=this.lines[n.row].substr(r,i),u=this.lines[n.row].substr(r+i).replace(En[e].unset.postPattern,"");this.lines[n.row]=l.concat(a,u),t.col=l.length,n.col=t.col+i,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else if(n.col==t.col&&this.lines[n.row].substr(0,n.col).match(En[e].unset.prePattern)&&this.lines[n.row].substr(n.col).match(En[e].unset.postPattern)){this.lineDirty[n.row]=!0;const s=this.lines[n.row].substr(0,n.col).replace(En[e].unset.prePattern,""),r=this.lines[n.row].substr(n.col).replace(En[e].unset.postPattern,"");this.lines[n.row]=s.concat(r),n.col=t.col=s.length,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else{let{startCol:s,endCol:r}=n.col<t.col?{startCol:n.col,endCol:t.col}:{startCol:t.col,endCol:n.col},i=this.lines[n.row].substr(s,r-s).match(/^(?<leading>\s*).*\S(?<trailing>\s*)$/);i&&(s+=i.groups.leading.length,r-=i.groups.trailing.length),n.col=s,t.col=r,this.wrapSelection(En[e].set.pre,En[e].set.post,n,t),this.fireChange()}}else if("line"==En[e].type){let n=this.getSelection(!0),s=this.getSelection(!1);if(n||(n=s),!s)return;this.clearDirtyFlag();let r=n.row>s.row?s:n,i=n.row>s.row?n:s;i.row>r.row&&0==i.col&&i.row--;for(let n=r.row;n<=i.row;n++)t&&this.lineTypes[n]!=En[e].className&&(this.lines[n]=this.lines[n].replace(En[e].set.pattern,En[e].set.replacement.replace("$#",n-r.row+1)),this.lineDirty[n]=!0),t||this.lineTypes[n]!=En[e].className||(this.lines[n]=this.lines[n].replace(En[e].unset.pattern,En[e].unset.replacement),this.lineDirty[n]=!0);this.updateFormatting(),this.setSelection({row:i.row,col:this.lines[i.row].length},{row:r.row,col:0}),this.fireChange()}}isInlineFormattingAllowed(){const e=window.getSelection();if(!e||!e.focusNode||!e.anchorNode)return!1;if(e.isCollapsed&&3==e.focusNode.nodeType&&e.focusOffset==e.focusNode.nodeValue.length){let t;for(t=e.focusNode;t&&null==t.nextSibling;t=t.parentNode);if(t&&t.nextSibling.className&&t.nextSibling.className.includes("TMInlineFormatted"))return!0}let t=this.computeCommonAncestor(e.focusNode,e.anchorNode);if(!t)return!1;for(;t&&t!=this.e;){if(t.className&&(t.className.includes("TMInlineFormatted")||t.className.includes("TMBlankLine")))return!0;t=t.parentNode}return!1}wrapSelection(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(n||(n=this.getSelection(!1)),s||(s=this.getSelection(!0)),!n||!s||n.row!=s.row)return;this.lineDirty[n.row]=!0;const r=n.col<s.col?n.col:s.col,i=n.col<s.col?s.col:n.col,l=this.lines[n.row].substr(0,r).concat(e),a=i==r?"":this.lines[n.row].substr(r,i-r),u=t.concat(this.lines[n.row].substr(i));this.lines[n.row]=l.concat(a,u),s.col=l.length,n.col=s.col+a.length,this.updateFormatting(),this.setSelection(n,s)}toggleCommandState(e){this.lastCommandState||(this.lastCommandState=this.getCommandState()),this.setCommandState(e,!this.lastCommandState[e])}fireChange(){if(!this.textarea&&!this.listeners.change.length)return;const e=this.getContent();this.textarea&&(this.textarea.value=e);for(let t of this.listeners.change)t({content:e,linesDirty:this.linesDirty})}fireSelection(){if(this.listeners.selection&&this.listeners.selection.length){let e=this.getSelection(!1),t=this.getSelection(!0),n=this.getCommandState(e,t);this.lastCommandState?Object.assign(this.lastCommandState,n):this.lastCommandState=Object.assign({},n);for(let n of this.listeners.selection)n({focus:e,anchor:t,commandState:this.lastCommandState})}}addEventListener(e,t){e.match(/^(?:change|input)$/i)&&this.listeners.change.push(t),e.match(/^(?:selection|selectionchange)$/i)&&this.listeners.selection.push(t)}},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-cayman
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ site.lang | default: "en-US" }}">
3
+ <head>
4
+
5
+ {% if site.google_analytics %}
6
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
7
+ <script>
8
+ window.dataLayer = window.dataLayer || [];
9
+ function gtag(){dataLayer.push(arguments);}
10
+ gtag('js', new Date());
11
+ gtag('config', '{{ site.google_analytics }}');
12
+ </script>
13
+ {% endif %}
14
+ <meta charset="UTF-8">
15
+
16
+ {% seo %}
17
+ <meta name="viewport" content="width=device-width, initial-scale=1">
18
+ <meta name="theme-color" content="#157878">
19
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
20
+ <link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
21
+ <script src="https://unpkg.com/tiny-markdown-editor/dist/tiny-mde.min.js"></script>
22
+ <link rel="stylesheet" type="text/css" href="https://unpkg.com/tiny-markdown-editor/dist/tiny-mde.min.css" />
23
+ </head>
24
+ <body>
25
+ <a id="skip-to-content" href="#content">Skip to the content.</a>
26
+
27
+ <header class="page-header" role="banner">
28
+ <h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
29
+ <h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
30
+ {% if site.github.is_project_page %}
31
+ <a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
32
+ {% endif %}
33
+ {% if site.show_downloads %}
34
+ <a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
35
+ <a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
36
+ {% endif %}
37
+ </header>
38
+
39
+ <main id="content" class="main-content" role="main">
40
+ {{ content }}
41
+
42
+ <footer class="site-footer">
43
+ {% if site.github.is_project_page %}
44
+ <span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
45
+ {% endif %}
46
+ <span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
47
+ </footer>
48
+ </main>
49
+ </body>
50
+ </html>
@@ -0,0 +1,174 @@
1
+ ## TinyMDE demo
2
+ This is a demo page for [TinyMDE](https://github.com/jefago/tiny-markdown-editor/).
3
+
4
+ ### Simple setup
5
+ This is a very basic setup with two containers for command bar and editor.
6
+
7
+ ```html
8
+ <div id="tinymde_commandbar1"></div>
9
+ <div id="tinymde1" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
10
+ <script>
11
+ var tinyMDE1 = new TinyMDE.Editor({element: 'tinymde1'});
12
+ var commandBar1 = new TinyMDE.CommandBar({element: 'tinymde_commandbar1', editor: tinyMDE1});
13
+ </script>
14
+ ```
15
+
16
+ <div id="tinymde_commandbar1"></div>
17
+ <div id="tinymde1" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
18
+ <script>
19
+ var tinyMDE1 = new TinyMDE.Editor({element: 'tinymde1'});
20
+ var commandBar1 = new TinyMDE.CommandBar({element: 'tinymde_commandbar1', editor: tinyMDE1});
21
+ </script>
22
+
23
+ ### Editor without command bar
24
+ An even simpler setup can be achieved if you don't need a command bar.
25
+
26
+ ```html
27
+ <div id="tinymde2" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
28
+ <script>
29
+ var tinyMDE2 = new TinyMDE.Editor({element: 'tinymde2'});
30
+ </script>
31
+ ```
32
+
33
+ <div id="tinymde2" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
34
+ <script>
35
+ var tinyMDE2 = new TinyMDE.Editor({element: 'tinymde2'});
36
+ </script>
37
+
38
+
39
+ ### Editor from text field
40
+ This example shows how you can use TinyMDE as a drop-in textarea replacement. The editor content is synced to the textarea.
41
+
42
+ ```html
43
+ <div style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0">
44
+ <textarea id="txt3" style="height:100%"># Textarea
45
+ This is a <textarea> formatted in **Markdown**.</textarea>
46
+ </div>
47
+ <script>
48
+ var tinyMDE3 = new TinyMDE.Editor({textarea: 'txt3'});
49
+ </script>
50
+ ```
51
+
52
+ <div style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0">
53
+ <textarea id="txt3"># Textarea
54
+ This is a &lt;textarea&gt; formatted in **Markdown**.</textarea>
55
+ </div>
56
+ <script>
57
+ var tinyMDE3 = new TinyMDE.Editor({textarea: 'txt3'});
58
+ </script>
59
+
60
+
61
+ ### Custom command bar
62
+ This example shows how the command bar can be customized—showing only a subset of commands, customizing existing commands, and even adding completely new commands.
63
+
64
+ ```html
65
+ <div id="tinymde_commandbar4"></div>
66
+ <div id="tinymde4" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
67
+ <script>
68
+ var tinyMDE4 = new TinyMDE.Editor({element: 'tinymde4'});
69
+ var commandBar4 = new TinyMDE.CommandBar({
70
+ element: 'tinymde_commandbar4',
71
+ editor: tinyMDE4,
72
+ commands: [
73
+ 'bold',
74
+ 'italic',
75
+ 'strikethrough',
76
+ '|',
77
+ {
78
+ name: 'insertLink',
79
+ action: editor => {
80
+ let dest = window.prompt('Link destination');
81
+ if (dest) editor.wrapSelection('[', `](<${dest}>)`);
82
+ }
83
+ },
84
+ {
85
+ name: 'moreInfo',
86
+ title: 'More information about TinyMDE',
87
+ innerHTML: '<b>?</b>',
88
+ action: editor => window.open('https://github.com/jefago/tiny-markdown-editor', '_blank')
89
+ }
90
+ ]
91
+ });
92
+ ```
93
+
94
+ <div id="tinymde_commandbar4"></div>
95
+ <div id="tinymde4" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
96
+ <script>
97
+ var tinyMDE4 = new TinyMDE.Editor({element: 'tinymde4'});
98
+ var commandBar4 = new TinyMDE.CommandBar({
99
+ element: 'tinymde_commandbar4',
100
+ editor: tinyMDE4,
101
+ commands: [
102
+ 'bold',
103
+ 'italic',
104
+ 'strikethrough',
105
+ '|',
106
+ {
107
+ name: 'insertLink',
108
+ action: editor => {
109
+ let dest = window.prompt('Link destination');
110
+ if (dest) editor.wrapSelection('[', `](<${dest}>)`);
111
+ }
112
+ },
113
+ {
114
+ name: 'moreInfo',
115
+ title: 'More information about TinyMDE',
116
+ innerHTML: '<b>?</b>',
117
+ action: editor => window.open('https://github.com/jefago/tiny-markdown-editor', '_blank')
118
+ }
119
+ ]
120
+ });
121
+ </script>
122
+
123
+ ### Using event listeners
124
+ This demo uses event listeners to display a status bar.
125
+
126
+ ```html
127
+ <div id="tinymde_commandbar5"></div>
128
+ <div id="tinymde5" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
129
+ <div id="tinymde_status5" style="display:flex">
130
+ <div id="wc" style="box-sizing:border-box; width:50%; padding:4px 0px; text-align:left"></div>
131
+ <div id="pos" style="box-sizing:border-box; width:50%; padding:4px 0px; text-align:right">– : –</div>
132
+ </div>
133
+ <script>
134
+ var tinyMDE5 = new TinyMDE.Editor({element: 'tinymde5', content: '# Event listener demo\nThis is a demo for TinyMDE event listeners'});
135
+ var commandBar5 = new TinyMDE.CommandBar({
136
+ element: 'tinymde_commandbar5',
137
+ editor: tinyMDE5,
138
+ });
139
+ tinyMDE5.addEventListener('selection', e => {
140
+ let st = `${e.focus ? e.focus.row : '–'} : ${e.focus ? e.focus.col : '–'}`;
141
+ for (let command in e.commandState) {
142
+ if (e.commandState[command]) st = command.concat(' ', st);
143
+ }
144
+ document.getElementById('pos').innerHTML = st;
145
+ });
146
+ tinyMDE5.addEventListener('change', e => {
147
+ document.getElementById('wc').innerHTML = `${e.content.length} characters, ${e.content.split(/\s+/).length} words`;
148
+ });
149
+ </script>
150
+ ```
151
+
152
+ <div id="tinymde_commandbar5"></div>
153
+ <div id="tinymde5" style="height:300px; overflow-y:scroll; border:1px solid #c0c0c0"></div>
154
+ <div id="tinymde_status5" style="display:flex">
155
+ <div id="wc" style="box-sizing:border-box; width:50%; padding:4px 0px; text-align:left"></div>
156
+ <div id="pos" style="box-sizing:border-box; width:50%; padding:4px 0px; text-align:right">– : –</div>
157
+ </div>
158
+ <script>
159
+ var tinyMDE5 = new TinyMDE.Editor({element: 'tinymde5', content: '# Event listener demo\nThis is a demo for TinyMDE event listeners'});
160
+ var commandBar5 = new TinyMDE.CommandBar({
161
+ element: 'tinymde_commandbar5',
162
+ editor: tinyMDE5,
163
+ });
164
+ tinyMDE5.addEventListener('selection', e => {
165
+ let st = `${e.focus ? e.focus.row : '–'} : ${e.focus ? e.focus.col : '–'}`;
166
+ for (let command in e.commandState) {
167
+ if (e.commandState[command]) st = command.concat(' ', st);
168
+ }
169
+ document.getElementById('pos').innerHTML = st;
170
+ });
171
+ tinyMDE5.addEventListener('change', e => {
172
+ document.getElementById('wc').innerHTML = `${e.content.length} characters, ${e.content.split(/\s+/).length} words`;
173
+ });
174
+ </script>