@nocobase/plugin-field-markdown-vditor 2.2.0-alpha.10 → 2.2.0-alpha.12
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.
package/dist/client-v2/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@ant-design/cssinjs"),require("react"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-markdown-vditor/client-v2",["@formily/react","@nocobase/flow-engine","@nocobase/client-v2","@ant-design/cssinjs","react","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-field-markdown-vditor/client-v2"]=t(require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@ant-design/cssinjs"),require("react"),require("antd")):e["@nocobase/plugin-field-markdown-vditor/client-v2"]=t(e["@formily/react"],e["@nocobase/flow-engine"],e["@nocobase/client-v2"],e["@ant-design/cssinjs"],e.react,e.antd)}(self,function(e,t,n,r,o,i){return function(){var a={925:function(e,t,n){"use strict";var r=n(168),o=n.n(r),i=n(433),a=n.n(i),l=n(220),s=n.n(l),c=new URL(n(573),n.b),d=a()(o()),u=s()(c);d.push([e.id,'/*!\n * Vditor v3.11.2 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n/*!\n * Vditor v3.11.2 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\n animation-name: tooltip-appear;\n animation-duration: 0.15s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\n animation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: -webkit-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: -moz-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\n animation-duration: 0.15s;\n animation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\n animation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: -webkit-zoom-out;\n cursor: -moz-zoom-out;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url('+u+');\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-smiles,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-math .katex-display > .katex > .katex-html > .tag {\n display: inline-block;\n font-size: 1.21rem;\n right: 2px;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 1em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: normal;\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n\n',""]),t.A=d},433:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]&&(d[1]="@media ".concat(d[2]," {").concat(d[1],"}")),d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},220:function(e){"use strict";e.exports=function(e,t){return(t||(t={}),e&&(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes))?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e}},168:function(e){"use strict";e.exports=function(e){return e[1]}},673:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var l=e[a],s=r.base?l[0]+r.base:l[0],c=o[s]||0,d="".concat(s," ").concat(c);o[s]=c+1;var u=n(d),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var f=function(e,t){var n=t.domAPI(t);return n.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&n.update(e=t):n.remove()}}(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:f,references:1})}i.push(d)}return i}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var l=n(i[a]);t[l].references--}for(var s=r(e,o),c=0;c<i.length;c++){var d=n(i[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=s}}},262:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},738:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},657:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},598:function(e){"use strict";e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){var r,o,i;r="",n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {")),(o=void 0!==n.layer)&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}"),(i=n.sourceMap)&&"u">typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},626:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},131:function(e){e.exports=function(){var e={173:e=>{var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var i=o;if(null==e||null==n)throw Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var a=r,l=this.diff_commonPrefix(e,n),s=e.substring(0,l);e=e.substring(l),n=n.substring(l),l=this.diff_commonSuffix(e,n);var c=e.substring(e.length-l);e=e.substring(0,e.length-l),n=n.substring(0,n.length-l);var d=this.diff_compute_(e,n,a,i);return s&&d.unshift(new t.Diff(0,s)),c&&d.push(new t.Diff(0,c)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(e,n,r,o){if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var i,a=e.length>n.length?e:n,l=e.length>n.length?n:e,s=a.indexOf(l);if(-1!=s)return i=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>n.length&&(i[0][0]=i[2][0]=-1),i;if(1==l.length)return[new t.Diff(-1,e),new t.Diff(1,n)];var c=this.diff_halfMatch_(e,n);if(c){var d=c[0],u=c[1],p=c[2],f=c[3],m=c[4],v=this.diff_main(d,p,r,o),h=this.diff_main(u,f,r,o);return v.concat([new t.Diff(0,m)],h)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,o):this.diff_bisect_(e,n,o)},t.prototype.diff_lineMode_=function(e,n,r){var o=this.diff_linesToChars_(e,n);e=o.chars1,n=o.chars2;var i=o.lineArray,a=this.diff_main(e,n,!1,r);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,c=0,d="",u="";l<a.length;){switch(a[l][0]){case 1:c++,u+=a[l][1];break;case -1:s++,d+=a[l][1];break;case 0:if(s>=1&&c>=1){a.splice(l-s-c,s+c),l=l-s-c;for(var p=this.diff_main(d,u,!1,r),f=p.length-1;f>=0;f--)a.splice(l,0,p[f]);l+=p.length}c=0,s=0,d="",u=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,n,r){for(var o=e.length,i=n.length,a=Math.ceil((o+i)/2),l=2*a,s=Array(l),c=Array(l),d=0;d<l;d++)s[d]=-1,c[d]=-1;s[a+1]=0,c[a+1]=0;for(var u=o-i,p=u%2!=0,f=0,m=0,v=0,h=0,g=0;g<a&&!(new Date().getTime()>r);g++){for(var b=-g+f;b<=g-m;b+=2){for(var y,w=a+b,k=(y=b==-g||b!=g&&s[w-1]<s[w+1]?s[w+1]:s[w-1]+1)-b;y<o&&k<i&&e.charAt(y)==n.charAt(k);)y++,k++;if(s[w]=y,y>o)m+=2;else if(k>i)f+=2;else if(p){var E=a+u-b;if(E>=0&&E<l&&-1!=c[E]){var x=o-c[E];if(y>=x)return this.diff_bisectSplit_(e,n,y,k,r)}}}for(var S=-g+v;S<=g-h;S+=2){for(var x,E=a+S,_=(x=S==-g||S!=g&&c[E-1]<c[E+1]?c[E+1]:c[E-1]+1)-S;x<o&&_<i&&e.charAt(o-x-1)==n.charAt(i-_-1);)x++,_++;if(c[E]=x,x>o)h+=2;else if(_>i)v+=2;else if(!p){var w=a+u-S;if(w>=0&&w<l&&-1!=s[w]){var y=s[w],k=a+y-w;if(y>=(x=o-x))return this.diff_bisectSplit_(e,n,y,k,r)}}}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,o){var i=e.substring(0,n),a=t.substring(0,r),l=e.substring(n),s=t.substring(r),c=this.diff_main(i,a,!1,o),d=this.diff_main(l,s,!1,o);return c.concat(d)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function o(e){for(var t="",o=0,a=-1,l=n.length;a<e.length-1;){-1==(a=e.indexOf("\n",o))&&(a=e.length-1);var s=e.substring(o,a+1);(r.hasOwnProperty?r.hasOwnProperty(s):void 0!==r[s])?t+=String.fromCharCode(r[s]):(l==i&&(s=e.substring(o),a=e.length),t+=String.fromCharCode(l),r[s]=l,n[l++]=s),o=a+1}return t}n[0]="";var i=4e4,a=o(e);return i=65535,{chars1:a,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],o=[],i=0;i<r.length;i++)o[i]=t[r.charCodeAt(i)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(i,o)==t.substring(i,o)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(e.length-o,e.length-i)==t.substring(t.length-o,t.length-i)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var o=Math.min(n,r);if(e==t)return o;for(var i=0,a=1;;){var l=e.substring(o-a),s=t.indexOf(l);if(-1==s)return i;a+=s,(0==s||e.substring(o-a)==t.substring(0,a))&&(i=a,a++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n,r,o,i,a,l=e.length>t.length?e:t,s=e.length>t.length?t:e;if(l.length<4||2*s.length<l.length)return null;var c=this;function d(e,t,n){for(var r,o,i,a,l=e.substring(n,n+Math.floor(e.length/4)),s=-1,d="";-1!=(s=t.indexOf(l,s+1));){var u=c.diff_commonPrefix(e.substring(n),t.substring(s)),p=c.diff_commonSuffix(e.substring(0,n),t.substring(0,s));d.length<p+u&&(d=t.substring(s-p,s)+t.substring(s,s+u),r=e.substring(0,n-p),o=e.substring(n+u),i=t.substring(0,s-p),a=t.substring(s+u))}return 2*d.length>=e.length?[r,o,i,a,d]:null}var u=d(l,s,Math.ceil(l.length/4)),p=d(l,s,Math.ceil(l.length/2));return u||p?(n=p?u&&u[4].length>p[4].length?u:p:u,e.length>t.length?(r=n[0],o=n[1],i=n[2],a=n[3]):(i=n[0],a=n[1],r=n[2],o=n[3]),[r,o,i,a,n[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=0,s=0,c=0,d=0;a<e.length;)0==e[a][0]?(r[o++]=a,l=c,s=d,c=0,d=0,i=e[a][1]):(1==e[a][0]?c+=e[a][1].length:d+=e[a][1].length,i&&i.length<=Math.max(l,s)&&i.length<=Math.max(c,d)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,a=--o>0?r[o-1]:-1,l=0,s=0,c=0,d=0,i=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(-1==e[a-1][0]&&1==e[a][0]){var u=e[a-1][1],p=e[a][1],f=this.diff_commonOverlap_(u,p),m=this.diff_commonOverlap_(p,u);f>=m?(f>=u.length/2||f>=p.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,f))),e[a-1][1]=u.substring(0,u.length-f),e[a+1][1]=p.substring(f),a++):(m>=u.length/2||m>=p.length/2)&&(e.splice(a,0,new t.Diff(0,u.substring(0,m))),e[a-1][0]=1,e[a-1][1]=p.substring(0,p.length-m),e[a+1][0]=-1,e[a+1][1]=u.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),o=n.charAt(0),i=r.match(t.nonAlphaNumericRegex_),a=o.match(t.nonAlphaNumericRegex_),l=i&&r.match(t.whitespaceRegex_),s=a&&o.match(t.whitespaceRegex_),c=l&&r.match(t.linebreakRegex_),d=s&&o.match(t.linebreakRegex_),u=c&&e.match(t.blanklineEndRegex_),p=d&&n.match(t.blanklineStartRegex_);if(u||p)return 5;if(c||d)return 4;if(i&&!l&&s)return 3;if(l||s)return 2;if(i||a)return 1;return 0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var o=e[r-1][1],i=e[r][1],a=e[r+1][1],l=this.diff_commonSuffix(o,i);if(l){var s=i.substring(i.length-l);o=o.substring(0,o.length-l),i=s+i.substring(0,i.length-l),a=s+a}for(var c=o,d=i,u=a,p=n(o,i)+n(i,a);i.charAt(0)===a.charAt(0);){o+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var f=n(o,i)+n(i,a);f>=p&&(p=f,c=o,d=i,u=a)}e[r-1][1]!=c&&(c?e[r-1][1]=c:(e.splice(r-1,1),r--),e[r][1]=d,u?e[r+1][1]=u:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=!1,s=!1,c=!1,d=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(c||d)?(r[o++]=a,l=c,s=d,i=e[a][1]):(o=0,i=null),c=d=!1):(-1==e[a][0]?d=!0:c=!0,i&&(l&&s&&c&&d||i.length<this.Diff_EditCost/2&&l+s+c+d==3)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,i=null,l&&s?(c=d=!0,o=0):(a=--o>0?r[o-1]:-1,c=d=!1),n=!0)),a++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var n,r=0,o=0,i=0,a="",l="";r<e.length;)switch(e[r][0]){case 1:i++,l+=e[r][1],r++;break;case -1:o++,a+=e[r][1],r++;break;case 0:o+i>1?(0!==o&&0!==i&&(0!==(n=this.diff_commonPrefix(l,a))&&(r-o-i>0&&0==e[r-o-i-1][0]?e[r-o-i-1][1]+=l.substring(0,n):(e.splice(0,0,new t.Diff(0,l.substring(0,n))),r++),l=l.substring(n),a=a.substring(n)),0!==(n=this.diff_commonSuffix(l,a))&&(e[r][1]=l.substring(l.length-n)+e[r][1],l=l.substring(0,l.length-n),a=a.substring(0,a.length-n))),r-=o+i,e.splice(r,o+i),a.length&&(e.splice(r,0,new t.Diff(-1,a)),r++),l.length&&(e.splice(r,0,new t.Diff(1,l)),r++),r++):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(r=1;r<e.length-1;)0==e[r-1][0]&&0==e[r+1][0]&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),s=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),s=!0)),r++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,o=0,i=0,a=0;for(n=0;n<e.length&&(1!==e[n][0]&&(r+=e[n][1].length),-1!==e[n][0]&&(o+=e[n][1].length),!(r>t));n++)i=r,a=o;return e.length!=n&&-1===e[n][0]?a:a+(t-i)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,o=/>/g,i=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(n,"&").replace(r,"<").replace(o,">").replace(i,"¶<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case -1:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,o=0;o<e.length;o++){var i=e[o][0],a=e[o][1];switch(i){case 1:n+=a.length;break;case -1:r+=a.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]="+"+encodeURI(e[n][1]);break;case -1:t[n]="-"+e[n][1].length;break;case 0:t[n]="="+e[n][1].length}return t.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,n){for(var r=[],o=0,i=0,a=n.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{r[o++]=new t.Diff(1,decodeURI(s))}catch(e){throw Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var c=parseInt(s,10);if(isNaN(c)||c<0)throw Error("Invalid number in diff_fromDelta: "+s);var d=e.substring(i,i+=c);"="==a[l].charAt(0)?r[o++]=new t.Diff(0,d):r[o++]=new t.Diff(-1,d);break;default:if(a[l])throw Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(i!=e.length)throw Error("Delta length ("+i+") does not equal source text length ("+e.length+").");return r},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw Error("Null input. (match_main)");return(n=Math.max(0,Math.min(n,e.length)),e==t)?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var r,o,i,a=this.match_alphabet_(t),l=this;function s(e,r){var o=e/t.length,i=Math.abs(n-r);return l.Match_Distance?o+i/l.Match_Distance:i?1:o}var c=this.Match_Threshold,d=e.indexOf(t,n);-1!=d&&(c=Math.min(s(0,d),c),-1!=(d=e.lastIndexOf(t,n+t.length))&&(c=Math.min(s(0,d),c)));var u=1<<t.length-1;d=-1;for(var p=t.length+e.length,f=0;f<t.length;f++){for(r=0,o=p;r<o;)s(f,n+o)<=c?r=o:p=o,o=Math.floor((p-r)/2+r);p=o;var m=Math.max(1,n-o+1),v=Math.min(n+o,e.length)+t.length,h=Array(v+2);h[v+1]=(1<<f)-1;for(var g=v;g>=m;g--){var b=a[e.charAt(g-1)];if(0===f?h[g]=(h[g+1]<<1|1)&b:h[g]=(h[g+1]<<1|1)&b|((i[g+1]|i[g])<<1|1)|i[g+1],h[g]&u){var y=s(f,g-1);if(y<=c)if(c=y,(d=g-1)>n)m=Math.max(1,2*n-d);else break}}if(s(f+1,n)>c)break;i=h}return d},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,r=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var i=n.substring(e.start2-o,e.start2);i&&e.diffs.unshift(new t.Diff(0,i));var a=n.substring(e.start2+e.length1,e.start2+e.length1+o);a&&e.diffs.push(new t.Diff(0,a)),e.start1-=i.length,e.start2-=i.length,e.length1+=i.length+a.length,e.length2+=i.length+a.length}},t.prototype.patch_make=function(e,n,r){if("string"==typeof e&&"string"==typeof n&&void 0===r)o=e,(i=this.diff_main(o,n,!0)).length>2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&"object"==typeof e&&void 0===n&&void 0===r)i=e,o=this.diff_text1(i);else if("string"==typeof e&&n&&"object"==typeof n&&void 0===r)o=e,i=n;else if("string"==typeof e&&"string"==typeof n&&r&&"object"==typeof r)o=e,i=r;else throw Error("Unknown call format to patch_make.");if(0===i.length)return[];for(var o,i,a=[],l=new t.patch_obj,s=0,c=0,d=0,u=o,p=o,f=0;f<i.length;f++){var m=i[f][0],v=i[f][1];switch(!s&&0!==m&&(l.start1=c,l.start2=d),m){case 1:l.diffs[s++]=i[f],l.length2+=v.length,p=p.substring(0,d)+v+p.substring(d);break;case -1:l.length1+=v.length,l.diffs[s++]=i[f],p=p.substring(0,d)+p.substring(d+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&i.length!=f+1?(l.diffs[s++]=i[f],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,u),a.push(l),l=new t.patch_obj,s=0,u=p,c=d)}1!==m&&(c+=v.length),-1!==m&&(d+=v.length)}return s&&(this.patch_addContext_(l,u),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=new t.patch_obj;i.diffs=[];for(var a=0;a<o.diffs.length;a++)i.diffs[a]=new t.Diff(o.diffs[a][0],o.diffs[a][1]);i.start1=o.start1,i.start2=o.start2,i.length1=o.length1,i.length2=o.length2,n[r]=i}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,o=[],i=0;i<e.length;i++){var a=e[i].start2+r,l=this.diff_text1(e[i].diffs),s=-1;if(l.length>this.Match_MaxBits?-1!=(d=this.match_main(t,l.substring(0,this.Match_MaxBits),a))&&(-1==(s=this.match_main(t,l.substring(l.length-this.Match_MaxBits),a+l.length-this.Match_MaxBits))||d>=s)&&(d=-1):d=this.match_main(t,l,a),-1==d)o[i]=!1,r-=e[i].length2-e[i].length1;else if(o[i]=!0,r=d-a,u=-1==s?t.substring(d,d+l.length):t.substring(d,s+this.Match_MaxBits),l==u)t=t.substring(0,d)+this.diff_text2(e[i].diffs)+t.substring(d+l.length);else{var c=this.diff_main(l,u,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(c)/l.length>this.Patch_DeleteThreshold)o[i]=!1;else{this.diff_cleanupSemanticLossless(c);for(var d,u,p,f=0,m=0;m<e[i].diffs.length;m++){var v=e[i].diffs[m];0!==v[0]&&(p=this.diff_xIndex(c,f)),1===v[0]?t=t.substring(0,d+p)+v[1]+t.substring(d+p):-1===v[0]&&(t=t.substring(0,d+p)+t.substring(d+this.diff_xIndex(c,f+v[1].length))),-1!==v[0]&&(f+=v[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",o=1;o<=n;o++)r+=String.fromCharCode(o);for(var o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var i=e[0],a=i.diffs;if(0==a.length||0!=a[0][0])a.unshift(new t.Diff(0,r)),i.start1-=n,i.start2-=n,i.length1+=n,i.length2+=n;else if(n>a[0][1].length){var l=n-a[0][1].length;a[0][1]=r.substring(a[0][1].length)+a[0][1],i.start1-=l,i.start2-=l,i.length1+=l,i.length2+=l}if(0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0])a.push(new t.Diff(0,r)),i.length1+=n,i.length2+=n;else if(n>a[a.length-1][1].length){var l=n-a[a.length-1][1].length;a[a.length-1][1]+=r.substring(0,l),i.length1+=l,i.length2+=l}return r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var o=e[r];e.splice(r--,1);for(var i=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,c=!0;for(s.start1=i-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<n-this.Patch_Margin;){var d=o.diffs[0][0],u=o.diffs[0][1];1===d?(s.length2+=u.length,a+=u.length,s.diffs.push(o.diffs.shift()),c=!1):-1===d&&1==s.diffs.length&&0==s.diffs[0][0]&&u.length>2*n?(s.length1+=u.length,i+=u.length,c=!1,s.diffs.push(new t.Diff(d,u)),o.diffs.shift()):(u=u.substring(0,n-s.length1-this.Patch_Margin),s.length1+=u.length,i+=u.length,0===d?(s.length2+=u.length,a+=u.length):c=!1,s.diffs.push(new t.Diff(d,u)),u==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(u.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==p&&(s.length1+=p.length,s.length2+=p.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=p:s.diffs.push(new t.Diff(0,p))),c||e.splice(++r,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split("\n"),o=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<r.length;){var a=r[o].match(i);if(!a)throw Error("Invalid patch string: "+r[o]);var l=new t.patch_obj;for(n.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<r.length;){var s=r[o].charAt(0);try{var c=decodeURI(r[o].substring(1))}catch(e){throw Error("Illegal escape in patch_fromText: "+c)}if("-"==s)l.diffs.push(new t.Diff(-1,c));else if("+"==s)l.diffs.push(new t.Diff(1,c));else if(" "==s)l.diffs.push(new t.Diff(0,c));else if("@"==s)break;else if(""===s);else throw Error('Invalid patch mode "'+s+'" in: '+c);o++}}return n},t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},t.patch_obj.prototype.toString=function(){e=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;for(var e,t,n=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2,r=["@@ -"+e+" +"+n+" @@\n"],o=0;o<this.diffs.length;o++){switch(this.diffs[o][0]){case 1:t="+";break;case -1:t="-";break;case 0:t=" "}r[o+1]=t+encodeURI(this.diffs[o][1])+"\n"}return r.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},408:(e,t,n)=>{"use strict";n.d(t,{default:()=>D});var r=n(135),o=n(840),i=n(775),a=n(428),l=n(325),s=n(483),c=n(999),d=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||!(t.naturalHeight>t.naturalWidth)||!(t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40))||!(t.naturalHeight>window.innerHeight-40)||(e.style.height=window.innerHeight-40+"px"),e.src=t.src}),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach(function(e){e.getAttribute("data-src")&&t(e)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)}))},u=n(472),p=n(280),f=n(637),m=n(825),v=n(11),h=n(194),g=n(436),b=n(229),y=n(145),w=n(538),k=n(413),E=n(106),x=n(673),S=function(e){document.querySelectorAll(".vditor-anchor").forEach(function(t){1===e&&t.classList.add("vditor-anchor--left"),t.onclick=function(){var e=t.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+e).offsetTop;document.querySelector("html").scrollTop=n}}),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}},_=n(214),T=n(810),L=function(e,t){if(void 0===t&&(t="zh_CN"),"u">typeof speechSynthesis&&"u">typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach(function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)}),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',o='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',o='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");i||((i=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",i),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var a=n(),l=new SpeechSynthesisUtterance;l.voice=a,l.onend=l.onerror=function(){i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech")){i.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=o):(speechSynthesis.pause(),i.innerHTML=r)):(l.text=i.getAttribute("data-text"),speechSynthesis.speak(l),i.classList.add("vditor-speech--current"),i.innerHTML=o),(0,T.Hc)(window.vditorSpeechRange),e.focus();return}if(i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r,0!==getSelection().rangeCount){var a=getSelection().getRangeAt(0),s=a.toString().trim();if(s){window.vditorSpeechRange=a.cloneRange();var c=a.getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=c.top+c.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?i.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":i.style.left=t.clientX+2+"px",i.setAttribute("data-text",s)}}})}},M=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},C=function(e){var t,n={anchor:0,cdn:y.g.CDN,customEmoji:{},emojiPath:"".concat(y.g.CDN,"/dist/images/emoji"),hljs:y.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:y.g.MARKDOWN_OPTIONS,math:y.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:y.g.THEME_OPTIONS};return e.cdn&&((null==(t=e.theme)?void 0:t.path)||(n.theme.path="".concat(e.cdn,"/dist/css/content-theme")),e.emojiPath||(n.emojiPath="".concat(e.cdn,"/dist/images/emoji"))),(0,x.T)(n,e)},A=function(e,t){var n=C(t);return(0,k.G)("".concat(n.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var r=(0,_.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.SetHeadingID(!0),r.Md2HTML(e)})},O=function(e,t,n){var o,g,y,x;return o=void 0,g=void 0,y=void 0,x=function(){var o,g,y;return M(this,function(x){switch(x.label){case 0:return[4,A(t,o=C(n))];case 1:if(g=x.sent(),o.transform&&(g=o.transform(g)),e.innerHTML=g,e.classList.add("vditor-reset"),o.i18n)return[3,5];if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(o.lang))return[3,2];throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return y="vditorI18nScript"+o.lang,document.querySelectorAll('head script[id^="'.concat("vditorI18nScript",'"]')).forEach(function(e){e.id!==y&&document.head.removeChild(e)}),[4,(0,k.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),y)];case 3:x.sent(),x.label=4;case 4:return[3,6];case 5:window.VditorI18n=o.i18n,x.label=6;case 6:if(!o.icon)return[3,8];return[4,(0,k.G)("".concat(o.cdn,"/dist/js/icons/").concat(o.icon,".js"),"vditorIconScript")];case 7:x.sent(),x.label=8;case 8:return(0,w.Z)(o.theme.current,o.theme.path),1===o.anchor&&e.classList.add("vditor-reset--anchor"),(0,a.O)(e,o.hljs),(0,c.s)(o.hljs,e,o.cdn),(0,u.H)(e,{cdn:o.cdn,math:o.math}),(0,f.i)(e,o.cdn,o.mode),(0,m.J)(e,o.cdn,o.mode),(0,v.K)(e,o.cdn),(0,l.P)(e,o.cdn),(0,s.v)(e,o.cdn),(0,i.p)(e,o.cdn,o.mode),(0,h.P)(e,o.cdn,o.mode),(0,b.B)(e,o.cdn),(0,r.Q)(e,o.cdn),o.render.media.enable&&(0,p.Y)(e),o.speech.enable&&L(e),0!==o.anchor&&S(o.anchor),o.after&&o.after(),o.lazyLoadImage&&d(e),e.addEventListener("click",function(t){var n=(0,E.lG)(t.target,"SPAN");if(n&&(0,E.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop);return}}),[2]}})},new(y||(y=Promise))(function(e,t){function n(e){try{i(x.next(e))}catch(e){t(e)}}function r(e){try{i(x.throw(e))}catch(e){t(e)}}function i(t){var o;t.done?e(t.value):((o=t.value)instanceof y?o:new y(function(e){e(o)})).then(n,r)}i((x=x.apply(o,g||[])).next())})},H=n(190),N=n(580);let D=function(){function e(){}return e.adapterRender=o,e.previewImage=H.E,e.codeRender=a.O,e.graphvizRender=s.v,e.highlightRender=c.s,e.mathRender=u.H,e.mermaidRender=f.i,e.SMILESRender=m.J,e.markmapRender=v.K,e.flowchartRender=l.P,e.chartRender=i.p,e.abcRender=r.Q,e.mindmapRender=h.P,e.plantumlRender=b.B,e.outlineRender=g.k,e.mediaRender=p.Y,e.speechRender=L,e.lazyLoadImageRender=d,e.md2html=A,e.preview=O,e.setCodeTheme=N.Y,e.setContentTheme=w.Z,e}()},145:(e,t,n)=>{"use strict";n.d(t,{H:()=>r,g:()=>o});var r="3.11.2",o=function(){function e(){}return e.ZWSP="",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atelier-heath","base16/atelier-lakeside","base16/atelier-plateau","base16/atelier-savanna","base16/atelier-seaside","base16/atelier-sulphurpool","base16/atlas","base16/bespin","base16/black-metal","base16/black-metal-bathory","base16/black-metal-burzum","base16/black-metal-dark-funeral","base16/black-metal-gorgoroth","base16/black-metal-immortal","base16/black-metal-khold","base16/black-metal-marduk","base16/black-metal-mayhem","base16/black-metal-nile","base16/black-metal-venom","base16/brewer","base16/bright","base16/brogrammer","base16/brush-trees-dark","base16/chalk","base16/circus","base16/classic-dark","base16/codeschool","base16/colors","base16/danqing","base16/darcula","base16/dark-violet","base16/darkmoss","base16/darktooth","base16/decaf","base16/default-dark","base16/dracula","base16/edge-dark","base16/eighties","base16/embers","base16/equilibrium-dark","base16/equilibrium-gray-dark","base16/espresso","base16/eva","base16/eva-dim","base16/flat","base16/framer","base16/gigavolt","base16/google-dark","base16/grayscale-dark","base16/green-screen","base16/gruvbox-dark-hard","base16/gruvbox-dark-medium","base16/gruvbox-dark-pale","base16/gruvbox-dark-soft","base16/hardcore","base16/harmonic16-dark","base16/heetch-dark","base16/helios","base16/hopscotch","base16/horizon-dark","base16/humanoid-dark","base16/ia-dark","base16/icy-dark","base16/ir-black","base16/isotope","base16/kimber","base16/london-tube","base16/macintosh","base16/marrakesh","base16/materia","base16/material","base16/material-darker","base16/material-palenight","base16/material-vivid","base16/mellow-purple","base16/mocha","base16/monokai","base16/nebula","base16/nord","base16/nova","base16/ocean","base16/oceanicnext","base16/onedark","base16/outrun-dark","base16/papercolor-dark","base16/paraiso","base16/pasque","base16/phd","base16/pico","base16/pop","base16/porple","base16/qualia","base16/railscasts","base16/rebecca","base16/ros-pine","base16/ros-pine-moon","base16/sandcastle","base16/seti-ui","base16/silk-dark","base16/snazzy","base16/solar-flare","base16/solarized-dark","base16/spacemacs","base16/summercamp","base16/summerfruit-dark","base16/synth-midnight-terminal-dark","base16/tango","base16/tender","base16/tomorrow-night","base16/twilight","base16/unikitty-dark","base16/vulcan","base16/windows-10","base16/windows-95","base16/windows-high-contrast","base16/windows-nt","base16/woodland","base16/xcode-dusk","base16/zenburn","codepen-embed","dark","devibeans","far","felipec","github-dark","github-dark-dimmed","gml","gradient-dark","hybrid","ir-black","isbl-editor-dark","kimbie-dark","lioshi","monokai","monokai-sublime","night-owl","nnfx-dark","nord","obsidian","panda-syntax-dark","paraiso-dark","pojoaque","qtcreator-dark","rainbow","shades-of-purple","srcery","stackoverflow-dark","sunburst","tomorrow-night-blue","tomorrow-night-bright","tokyo-night-dark","vs2015","xt256","ant-design","a11y-light","arduino-light","ascetic","atom-one-light","base16/atelier-cave-light","base16/atelier-dune-light","base16/atelier-estuary-light","base16/atelier-forest-light","base16/atelier-heath-light","base16/atelier-lakeside-light","base16/atelier-plateau-light","base16/atelier-savanna-light","base16/atelier-seaside-light","base16/atelier-sulphurpool-light","base16/brush-trees","base16/classic-light","base16/cupcake","base16/cupertino","base16/default-light","base16/dirtysea","base16/edge-light","base16/equilibrium-gray-light","base16/equilibrium-light","base16/fruit-soda","base16/github","base16/google-light","base16/grayscale-light","base16/gruvbox-light-hard","base16/gruvbox-light-medium","base16/gruvbox-light-soft","base16/harmonic16-light","base16/heetch-light","base16/humanoid-light","base16/horizon-light","base16/ia-light","base16/material-lighter","base16/mexico-light","base16/one-light","base16/papercolor-light","base16/ros-pine-dawn","base16/sagelight","base16/shapeshifter","base16/silk-light","base16/solar-flare-light","base16/solarized-light","base16/summerfruit-light","base16/synth-midnight-terminal-light","base16/tomorrow","base16/unikitty-light","base16/windows-10-light","base16/windows-95-light","base16/windows-high-contrast-light","brown-paper","base16/windows-nt-light","color-brewer","docco","foundation","github","googlecode","gradient-light","grayscale","idea","intellij-light","isbl-editor-light","kimbie-light","lightfair","magula","mono-blue","nnfx-light","panda-syntax-light","paraiso-light","purebasic","qtcreator-light","routeros","school-book","stackoverflow-light","tokyo-night-light","vs","xcode","default"],e.ALIAS_CODE_LANGUAGES=["abc","plantuml","mermaid","flowchart","echarts","mindmap","graphviz","math","markmap","smiles","js","ts","html","toml","c#","bat"],e.CDN="https://unpkg.com/vditor@".concat("3.11.2"),e.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(e.CDN,"/dist/css/content-theme")},e}()},825:(e,t,n)=>{"use strict";n.d(t,{J:()=>l});var r=n(145),o=n(413),i=n(840),a=n(494),l=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var l=i.SMILESRenderAdapter.getElements(e);l.length>0&&(0,o.G)("".concat(t,"/dist/js/smiles-drawer/smiles-drawer.min.js?v=2.1.7"),"vditorAbcjsScript").then(function(){var e=new SmiDrawer({},{});l.forEach(function(t){var r=i.SMILESRenderAdapter.getCode(t).trim();if("true"!==t.getAttribute("data-processed")&&""!==r.trim()){var o="smiles"+(0,a.Wb)();t.innerHTML='<svg id="'.concat(o,'"></svg>'),e.draw(r,"#"+o,"dark"===n?"dark":void 0),t.setAttribute("data-processed","true")}})})}},135:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.abcRenderAdapter.getElements(e);n.length>0&&(0,o.G)("".concat(t,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){n.forEach(function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,i.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},840:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mathRenderAdapter:()=>r,SMILESRenderAdapter:()=>o,mermaidRenderAdapter:()=>i,markmapRenderAdapter:()=>a,mindmapRenderAdapter:()=>l,chartRenderAdapter:()=>s,abcRenderAdapter:()=>c,graphvizRenderAdapter:()=>d,flowchartRenderAdapter:()=>u,plantumlRenderAdapter:()=>p});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-smiles")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},a={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},l={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},s={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},u={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},p={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},775:(e,t,n)=>{"use strict";n.d(t,{p:()=>s});var r=n(145),o=n(413),i=n(840),a=n(494),l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=i.chartRenderAdapter.getElements(e);s.length>0&&(0,o.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.forEach(function(e){var t,r,o,s;return t=void 0,r=void 0,o=void 0,s=function(){var t,r,o;return l(this,function(l){switch(l.label){case 0:if(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||!(t=i.chartRenderAdapter.getCode(e).trim()))return[2];l.label=1;case 1:if(l.trys.push([1,3,,4]),"true"===e.getAttribute("data-processed"))return[2];return[4,(0,a.Qf)(t)];case 2:return r=l.sent(),echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true"),[3,4];case 3:return o=l.sent(),e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>".concat(o),[3,4];case 4:return[2]}})},new(o||(o=Promise))(function(e,n){function i(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof o?n:new o(function(e){e(n)})).then(i,a)}l((s=s.apply(t,r||[])).next())})})})}},428:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(105),o=n(145),i=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter(function(t,n){return!(t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.parentElement.classList.contains("vditor-ir__marker--pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.classList.contains("language-smiles")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&n>5)}).forEach(function(e){var n,i,a,l=e.innerText;if(e.classList.contains("highlight-chroma")){var s=e.cloneNode(!0);s.querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),l=s.innerText}else l.endsWith("\n")&&(l=l.substr(0,l.length-1));var c='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(c='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var d=document.createElement("div");d.className="vditor-copy",d.innerHTML='<span aria-label="'.concat((null==(n=window.VditorI18n)?void 0:n.copy)||"复制","\"\nonmouseover=\"this.setAttribute('aria-label', '").concat((null==(i=window.VditorI18n)?void 0:i.copy)||"复制","')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '").concat((null==(a=window.VditorI18n)?void 0:a.copied)||"已复制","');this.previousElementSibling.blur()\">").concat(c,"</span>");var u=document.createElement("textarea");u.value=(0,r.X)(l),d.insertAdjacentElement("afterbegin",u),t&&t.renderMenu&&t.renderMenu(e,d),e.before(d),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(o.g.ZWSP,"</span>"))})}},325:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){n.forEach(function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(i.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}})})}},483:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){n.forEach(function(e){var t=i.graphvizRenderAdapter.getCode(e);if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),o=new Worker(r);new Viz({worker:o}).renderSVGElement(t).then(function(t){e.innerHTML=t.outerHTML}).catch(function(t){e.innerHTML="graphviz render error: <br>".concat(t),e.className="vditor-reset--error"})}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}})})}},999:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(145),o=n(413),i=n(290),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var a=e.style;r.g.CODE_THEME.includes(a)||(a="github");var l=document.getElementById("vditorHljsStyle"),s="".concat(n,"/dist/js/highlight.js/styles/").concat(a,".min.css");l&&l.getAttribute("href")!==s&&l.remove(),(0,i.c)("".concat(n,"/dist/js/highlight.js/styles/").concat(a,".min.css"),"vditorHljsStyle"),!1===e.enable||0!==t.querySelectorAll("pre > code").length&&(0,o.G)("".concat(n,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,o.G)("".concat(n,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){t.querySelectorAll("pre > code").forEach(function(t){if(!(t.parentElement.classList.contains("vditor-ir__marker--pre")||t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-smiles")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))){""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang);var n=t.className.replace("language-","");if(window.hljs.getLanguage(n)||(n="plaintext"),t.innerHTML=window.hljs.highlight(t.textContent,{language:n,ignoreIllegals:!0}).value,t.classList.add("hljs"),e.lineNumber){t.classList.add("vditor-linenumber");var r=t.querySelector(".vditor-linenumber__temp");r||((r=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",r));var o=getComputedStyle(t).whiteSpace,i=!1;("pre-wrap"===o||"pre-line"===o)&&(i=!0);var a="",l=t.textContent.split(/\r\n|\r|\n/g);l.pop(),l.map(function(e){var t="";i&&(r.textContent=e||"\n",t=' style="height:'.concat(r.getBoundingClientRect().height,'px"')),a+="<span".concat(t,"></span>")}),r.style.display="none",a='<span class="vditor-linenumber__rows">'.concat(a,"</span>"),t.insertAdjacentHTML("beforeend",a)}}})})})}},11:(e,t,n)=>{"use strict";n.d(t,{K:()=>c});var r=n(145),o=n(413),i=n(840),a={},l=function(e,t){var n=e.transform(t),r=Object.keys(n.features).filter(function(e){return!a[e]});r.forEach(function(e){a[e]=!0});var o=e.getAssets(r),i=o.styles,l=o.scripts,s=window.markmap;return i&&s.loadCSS(i),l&&s.loadJS(l),n},s=function(e,t){var n=window.markmap,r=n.Transformer,o=n.Markmap,i=n.deriveOptions;n.globalCSS;var a=new r;e.innerHTML='<svg style="width:100%"></svg>';var s=e.firstChild,c=o.create(s,null),d=l(a,t),u=d.root,p=d.frontmatter,f=i(null==p?void 0:p.markmap);c.setData(u,f),c.fit()},c=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.markmapRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){n.forEach(function(e){var t=i.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),s(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}})})}},472:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var r=n(145),o=n(413),i=n(290),a=n(105),l=n(840),s=function(e,t){void 0===e&&(e=document);var n=l.mathRenderAdapter.getElements(e);if(0!==n.length){var s={cdn:r.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},s.math,t.math)),"KaTeX"===(t=Object.assign({},s,t)).math.engine)(0,i.c)("".concat(t.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,o.G)("".concat(t.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,o.G)("".concat(t.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){n.forEach(function(e){if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))&&!e.getAttribute("data-math")){var n=(0,a.X)(l.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))})}})})});else if("MathJax"===t.math.engine){var c=function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var o=e[t++];o===n?o():o(r)};r()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(t.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:t.math.macros}},Object.assign(window.MathJax,t.math.mathJaxOptions)),(0,o.J)("".concat(t.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var d=function(e,t){var n=(0,a.X)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then(function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var o=r.querySelector('[data-mml-node="merror"]');o&&""!==o.textContent.trim()&&(e.innerHTML=o.textContent.trim(),e.className="vditor-reset--error"),t&&t()})};window.MathJax.startup.promise.then(function(){for(var e=[],t=function(t){var r=n[t];!r.parentElement.classList.contains("vditor-wysiwyg__pre")&&!r.parentElement.classList.contains("vditor-ir__marker--pre")&&!r.getAttribute("data-math")&&(0,a.X)(r.textContent).trim()&&e.push(function(e){t===n.length-1?d(r):d(r,e)})},r=0;r<n.length;r++)t(r);c(e)})}}}},280:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var r=n(494),o=function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(t,'"></video>')),e.remove()},i=function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(t,'"></audio>')),e.remove()},a=function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),o=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),l=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),c=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),d=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(n&&11===n[1].length)e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(n[1]+(n[2]?"?start="+n[2]:""),'"></iframe>')),e.remove();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(o[1],'"></iframe>')),e.remove();else if(i&&i[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(i[1],'"></iframe>')),e.remove();else if(a&&a[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'.concat(a[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),e.remove();else if(l&&l[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='.concat(encodeURIComponent(l[0]),'"></iframe>')),e.remove();else if(s&&s[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'.concat(s[2],'"></iframe>')),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||c&&c[1])){var u={bvid:(0,r.on)("bvid",t)||c&&c[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach(function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");u[n[0]]=n[1]}});var p="https://player.bilibili.com/player.html?",f=Object.keys(u);f.forEach(function(e,t){p+="".concat(e,"=").concat(u[e]),t<f.length-1&&(p+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(p,'"></iframe>')),e.remove()}else d&&d[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(d[1],'"></iframe>')),e.remove())},l=function(e){e&&e.querySelectorAll("a").forEach(function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?o(e,t):t.match(/^.+.(mp3|wav|flac)$/)?i(e,t):a(e,t))})}},637:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(145),o=n(413),i=n(840),a=n(494),l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=i.mermaidRenderAdapter.getElements(e);0!==s.length&&(0,o.G)("".concat(t,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),s.forEach(function(e){var t,n,r,o;return t=void 0,n=void 0,r=void 0,o=function(){var t,n,r,o;return l(this,function(l){switch(l.label){case 0:if(t=i.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,a.Wb)(),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return e.innerHTML=l.sent().svg,[3,4];case 3:return r=l.sent(),o=document.querySelector("#"+n),e.innerHTML="".concat(o.outerHTML,'<br>\n<div style="text-align: left"><small>').concat(r.message.replace(/\n/,"<br>"),"</small></div>"),o.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}})},new(r||(r=Promise))(function(e,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,l)}s((o=o.apply(t,n||[])).next())})})})}},194:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.mindmapRenderAdapter.getElements(e);a.length>0&&(0,o.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){a.forEach(function(e){if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))){var t=i.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var n;return(null==(n=null==t?void 0:t.data)?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>".concat(t)}}})})}},436:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(771),o=n(472),i=function(e,t,n){var i="",a=[];if(Array.from(e.children).forEach(function(e,t){if((0,r.W)(e)){if(n){var o=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===o?void 0:o)+"_"+t}a.push(e.id),i+=e.outerHTML.replace("<wbr>","")}}),""===i)return t.innerHTML="","";var l=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?l.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+i),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var s=Lute.New();s.SetToC(!0),l.innerHTML=s.HTML2VditorDOM("<p>[ToC]</p>"+i)}var c=l.firstElementChild.querySelectorAll("li > span[data-target-id]");return(c.forEach(function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML="".concat(n,"<span>").concat(e.innerHTML,"</span>")}else e.innerHTML="<svg></svg><span>".concat(e.innerHTML,"</span>");e.setAttribute("data-target-id",a[t])}),i=l.firstElementChild.innerHTML,0===c.length)?t.innerHTML="":(t.innerHTML=i,n&&(0,o.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",function(r){for(var o=r.target;o&&!o.isEqualNode(t);){if(o.classList.contains("vditor-outline__action")){o.classList.contains("vditor-outline__action--close")?(o.classList.remove("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:block")):(o.classList.add("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(o.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var i=document.getElementById(o.getAttribute("data-target-id"));if(!i)return;if(n)if("auto"===n.options.height){var a=i.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(a+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,a)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=i.offsetTop:e.scrollTop=i.offsetTop;else window.scrollTo(window.scrollX,i.offsetTop);break}o=o.parentElement}})),i}},229:(e,t,n)=>{"use strict";n.d(t,{B:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){n.forEach(function(e){if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))){var t=i.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(t),'"/>')}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>".concat(t)}}})})}},214:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},190:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});var r=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var r=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat("dark"===n?" vditor--dark":"",'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n ').concat(window.VditorI18n.spin,"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X ").concat(window.VditorI18n.close,'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: ').concat(e.width,"px;height:").concat(e.height,"px;transform: translate3d(").concat(r.left,"px, ").concat(r.top-36,'px, 0)" src="').concat(e.getAttribute("src"),'">\n </div>\n</div>')),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),i="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-e.naturalHeight)/2,"px, 0)");setTimeout(function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(i)),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)});var a=document.querySelector(".vditor-img__btn");a.addEventListener("click",function(){var t=parseInt(a.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(e.naturalWidth/2-e.naturalHeight/2,"px, 0) rotateZ(").concat(t,"deg)"):o.style.transform="".concat(i," rotateZ(").concat(t,"deg)"),a.setAttribute("data-deg",t.toString()),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)})}},580:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(145),o=n(290),i=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),i="".concat(t,"/dist/js/highlight.js/styles/").concat(e,".min.css");n?n.getAttribute("href")!==i&&(n.remove(),(0,o.c)(i,"vditorHljsStyle")):(0,o.c)(i,"vditorHljsStyle")}},538:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(290),o=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),o="".concat(t,"/").concat(e,".css");n?n.getAttribute("href")!==o&&(n.remove(),(0,r.c)(o,"vditorContentTheme")):(0,r.c)(o,"vditorContentTheme")}}},413:(e,t,n)=>{"use strict";n.d(t,{J:()=>r,G:()=>o});var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},o=function(e,t){return new Promise(function(n,r){if(document.getElementById(t))return n(!0),!1;var o=document.createElement("script");o.src=e,o.async=!0,document.head.appendChild(o),o.onerror=function(e){r(e)},o.onload=function(){if(document.getElementById(t))return o.remove(),n(!0),!1;o.id=t,n(!0)}})}},290:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},105:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){return e.replace(/\u00a0/g," ")}},410:(e,t,n)=>{"use strict";n.d(t,{G6:()=>r,vU:()=>o,pK:()=>i,Le:()=>a,yl:()=>l,ns:()=>s,i7:()=>c});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},o=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},i=function(){try{return"u">typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},l=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!e.metaKey&&!e.ctrlKey:!e.metaKey&&!!e.ctrlKey},s=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&o()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},c=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:(e,t,n)=>{"use strict";n.d(t,{Wb:()=>r,on:()=>o,Qf:()=>i});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},o=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)},i=function(e){return Function('"use strict";return ('.concat(e,")"))()}},106:(e,t,n)=>{"use strict";n.d(t,{JQ:()=>o,E2:()=>i,O9:()=>a,a1:()=>l,F9:()=>s,lG:()=>c,fb:()=>d,DX:()=>u});var r=n(771),o=function(e,t){for(var n=d(e,t),r=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(r=d(n.parentElement,t))?n=r:o=!0;return n||!1},i=function(e,t){for(var n=(0,r.S)(e,t),o=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(o=(0,r.S)(n.parentElement,t))?n=o:i=!0;return n||!1},a=function(e){var t=i(e,"UL"),n=i(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},l=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,o=!1;r&&!o&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?o=!0:r=r.parentElement;return o&&r},s=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=l(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},d=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},u=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},771:(e,t,n)=>{"use strict";n.d(t,{S:()=>r,W:()=>o});var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},o=function(e){var t=r(e,"H");return!!t&&2===t.tagName.length&&"HR"!==t.tagName&&t}},673:(e,t,n)=>{"use strict";n.d(t,{T:()=>r});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},o=0;o<e.length;o++){var i=e[o];for(var a in i)i.hasOwnProperty(a)&&("[object Object]"===Object.prototype.toString.call(i[a])?n[a]=r(n[a],i[a]):n[a]=i[a])}return n}},810:(e,t,n)=>{"use strict";n.d(t,{zh:()=>a,Ny:()=>l,Gb:()=>s,Hc:()=>c,im:()=>d,$j:()=>u,ib:()=>p,oC:()=>f});var r=n(145),o=n(410),i=n(106),a=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},l=function(e){var t,n=window.getSelection().getRangeAt(0);if(!e.contains(n.startContainer)&&!(0,i.fb)(n.startContainer,"vditor-panel--none"))return{left:0,top:0};var r=e.parentElement.getBoundingClientRect();if(0===n.getClientRects().length)if(3===n.startContainer.nodeType){var o=n.startContainer.parentElement;if(!o||!(o.getClientRects().length>0))return{left:0,top:0};t=o.getClientRects()[0]}else{var a=n.startContainer.children;if(a[n.startOffset]&&a[n.startOffset].getClientRects().length>0)t=a[n.startOffset].getClientRects()[0];else if(n.startContainer.childNodes.length>0){var l=n.cloneRange();n.selectNode(n.startContainer.childNodes[Math.max(0,n.startOffset-1)]),t=n.getClientRects()[0],n.setEnd(l.endContainer,l.endOffset),n.setStart(l.startContainer,l.startOffset)}else t=n.startContainer.getClientRects()[0];if(!t){for(var s=n.startContainer.childNodes[n.startOffset];!s.getClientRects||s.getClientRects&&0===s.getClientRects().length;)s=s.parentElement;t=s.getClientRects()[0]}}else t=n.getClientRects()[0];return{left:t.left-r.left,top:t.top-r.top}},s=function(e,t){if(!t)if(0===getSelection().rangeCount)return!1;else t=getSelection().getRangeAt(0);var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},c=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},d=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(s(t,n)){var o=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?o.setStart(e.childNodes[0].childNodes[0],0):o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),r.start=o.toString().length,r.end=r.start+n.toString().length}return r},u=function(e,t,n){var r=0,o=0,i=n.childNodes[o],a=!1,l=!1;e=Math.max(0,e),t=Math.max(0,t);var s=n.ownerDocument.createRange();for(s.setStart(i||n,0),s.collapse(!0);!l&&i;){var d=r+i.textContent.length;if(!a&&e>=r&&e<=d&&(0===e?s.setStart(i,0):3===i.childNodes[0].nodeType?s.setStart(i.childNodes[0],e-r):i.nextSibling?s.setStartBefore(i.nextSibling):s.setStartAfter(i),a=!0,e===t)){l=!0;break}a&&t>=r&&t<=d&&(0===t?s.setEnd(i,0):3===i.childNodes[0].nodeType?s.setEnd(i.childNodes[0],t-r):i.nextSibling?s.setEndBefore(i.nextSibling):s.setEndAfter(i),l=!0),r=d,i=n.childNodes[++o]}return!l&&n.childNodes[o-1]&&s.setStartBefore(n.childNodes[o-1]),c(s),s},p=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling))if(n.previousElementSibling.lastChild){t.setStartBefore(n),t.collapse(!0),c(t),(0,o.i7)()&&("EM"===n.previousElementSibling.tagName||"STRONG"===n.previousElementSibling.tagName||"S"===n.previousElementSibling.tagName)&&(t.insertNode(document.createTextNode(r.g.ZWSP)),t.collapse(!1)),n.remove();return}else t.setStartAfter(n.previousElementSibling);else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),c(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1!==r.length||r[0].previousSibling||r[0].nextSibling||!(t[t.currentMode].element.children.length>0)||"P"!==n.firstElementChild.tagName||(e=r[0].innerHTML.trim());var o=document.createElement("div");o.innerHTML=e;var l=a(t);if(""!==l.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),o.firstElementChild&&"0"===o.firstElementChild.getAttribute("data-block")){o.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var s=(0,i.F9)(l.startContainer);if(s){var d=(0,i.lG)(l.startContainer,"LI");d&&"UL"===o.firstElementChild.tagName?d.insertAdjacentHTML("afterend",o.firstElementChild.innerHTML):s.insertAdjacentHTML("afterend",o.innerHTML)}else t[t.currentMode].element.insertAdjacentHTML("beforeend",o.innerHTML);p(t[t.currentMode].element,l)}else{var u=document.createElement("template");u.innerHTML=e,l.insertNode(u.content.cloneNode(!0)),l.collapse(!1),c(l)}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>ro});var e,t,o,i,a,l,s,c,d,u,p,f,m,v,h,g,b,y,w,k,E,x,S,_,T,L=n(408),M=n(145),C=n(105),A=function(e){return"sv"===e.currentMode?(0,C.X)("".concat(e.sv.element.textContent,"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},O=n(413),H=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(e){var t=this;"block"===e.devtools.element.style.display&&(0,O.G)("".concat(e.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(A(e))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),t.ASTChart.resize()}catch(e){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=e}})},e}(),N=n(410),D=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}})},I=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}})},j=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(M.g.CLASS_MENU_DISABLED)&&n.classList.remove(M.g.CLASS_MENU_DISABLED)}})},R=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(M.g.CLASS_MENU_DISABLED)&&n.classList.add(M.g.CLASS_MENU_DISABLED)}})},P=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="none")})},q=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="block")})},B=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},z=function(e,t,n,r){n.addEventListener((0,N.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(M.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===t.style.display?t.style.display="none":(B(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},V=n(106),U=n(771),F=function(e,t,n,r){r&&console.log("".concat(e," - ").concat(n,": ").concat(t))},W=n(135),G=n(775),K=n(428),J=n(325),Z=n(483),X=n(999),Y=n(472),$=n(637),Q=n(11),ee=n(194),et=n(229),en=n(825),er=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var o=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(o=!0);var i=r.querySelectorAll("pre");if(1===r.childElementCount&&1===i.length&&"vditor-wysiwyg"!==i[0].className&&"vditor-sv"!==i[0].className&&(o=!0),0===e.indexOf('\n<p class="p1">')&&(o=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(o=!0),o){var a=t||e;return/\n/.test(a)||1===i.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(a.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+a.replace(/&/g,"&").replace(/</g,"<")+"\n```":"wysiwyg"===n?"<code>".concat(a.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(a,"`")}return!1},eo=function(e,t){if(e){if("html-block"===e.parentElement.getAttribute("data-type"))return void e.setAttribute("data-render","1");var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,W.Q)(e,t.options.cdn):"mermaid"===n?(0,$.i)(e,t.options.cdn,t.options.theme):"smiles"===n?(0,en.J)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,Q.K)(e,t.options.cdn):"flowchart"===n?(0,J.P)(e,t.options.cdn):"echarts"===n?(0,G.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,ee.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,et.B)(e,t.options.cdn):"graphviz"===n?(0,Z.v)(e,t.options.cdn):"math"===n?(0,Y.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(r){if(r.language===n)return r.render(e,t),!0})||((0,X.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,K.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}},ei=n(810),ea=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=n,(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})}},el=function(e,t){var n=(0,V.lG)(e.target,"SPAN");if(n&&(0,V.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if("auto"===t.options.height){var o=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(o+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop;return}},es=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,ei.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),tR(t),!0;if(tA(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,ei.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),tR(t),!0;if(tC(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var o=(0,V.fb)(r.startContainer,"vditor-toc");if(o)return o.remove(),tR(t),!0}},ec=function(e,t,n,r){void 0===n&&(n=!1);var o,i,a=(0,V.F9)(t.startContainer);if(a&&!n&&"code-block"!==a.getAttribute("data-type")){if(tI(a.innerHTML)&&a.previousElementSibling||tj(a.innerHTML))return;for(var l=(0,ei.im)(a,e.ir.element,t).start,s=!0,c=l-1;c>a.textContent.substr(0,l).lastIndexOf("\n");c--)if(" "!==a.textContent.charAt(c)&&" "!==a.textContent.charAt(c)){s=!1;break}0===l&&(s=!1);for(var d=!0,c=l-1;c<a.textContent.length;c++)if(" "!==a.textContent.charAt(c)&&"\n"!==a.textContent.charAt(c)){d=!1;break}if(s){"function"==typeof e.options.input&&e.options.input(A(e));return}if(d&&/^#{1,6} $/.test(a.textContent)&&(d=!1),d)if((0,V.fb)(t.startContainer,"vditor-ir__marker"));else{var u=t.startContainer.previousSibling;u&&3!==u.nodeType&&u.classList.contains("vditor-ir__node--expand")&&u.classList.remove("vditor-ir__node--expand"),"function"==typeof e.options.input&&e.options.input(A(e));return}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),a||(a=e.ir.element),!a.querySelector("wbr")){var p=(0,V.fb)(t.startContainer,"vditor-ir__preview");p?p.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}a.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),"link-ref-defs-block"===a.getAttribute("data-type")&&(a=e.ir.element);var f=a.isEqualNode(e.ir.element),m=(0,V.a1)(a,"data-type","footnotes-block"),v="";if(f)v=a.innerHTML;else{var h=(0,U.S)(t.startContainer,"BLOCKQUOTE"),g=(0,V.O9)(t.startContainer);if(g&&(a=g),h&&(!g||g&&!h.contains(g))&&(a=h),m&&(a=m),v=a.outerHTML,"UL"===a.tagName||"OL"===a.tagName){var b=a.previousElementSibling,y=a.nextElementSibling;b&&("UL"===b.tagName||"OL"===b.tagName)&&(v=b.outerHTML+v,b.remove()),y&&("UL"===y.tagName||"OL"===y.tagName)&&(v+=y.outerHTML,y.remove()),v=v.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else a.previousElementSibling&&""!==a.previousElementSibling.textContent.replace(M.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(v=a.previousElementSibling.outerHTML+v,a.previousElementSibling.remove());a.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!a.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!a.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}))}if(F("SpinVditorIRDOM",v,"argument",e.options.debugger),F("SpinVditorIRDOM",v=e.lute.SpinVditorIRDOM(v),"result",e.options.debugger),f)a.innerHTML=v;else if(a.outerHTML=v,m){var w=(0,V.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(w){var k=w.textContent,E=k.substring(1,k.indexOf("]:")),x=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(E,'"]'));x&&x.setAttribute("aria-label",k.substr(E.length+3).trim().substr(0,24))}}var S=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");S.forEach(function(e,t){0===t?o=e:(o.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),S.length>0&&e.ir.element.insertAdjacentElement("beforeend",S[0]);var _=e.ir.element.querySelectorAll("[data-type='footnotes-block']");_.forEach(function(e,t){0===t?i=e:(i.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),_.length>0&&e.ir.element.insertAdjacentElement("beforeend",_[0]),(0,ei.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){eo(t,e)}),ea(e),t6(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},ed=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&t.code===e;if("⇧Tab"===e)return!(0,N.yl)(t)&&!t.altKey&&!!t.shiftKey&&"Tab"===t.code;var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return(3===n.length?!!(0,N.yl)(t):!(0,N.yl)(t))&&!!t.altKey&&!t.shiftKey&&t.code===(/^[0-9]$/.test(r)?"Digit":"Key")+r}"⌘Enter"===e&&(n=["⌘","Enter"]);var o=n.length>2&&"⇧"===n[0],i=o?n[2]:n[1];return o&&((0,N.vU)()||!/Mac/.test(navigator.platform))&&("-"===i?i="_":"="===i&&(i="+")),!!(0,N.yl)(t)&&t.key.toLowerCase()===i.toLowerCase()&&!t.altKey&&(!o&&!t.shiftKey||!!o&&!!t.shiftKey)},eu=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(n){if(n&&3!==n.nodeType&&n.classList.contains("vditor-ir__node")&&!n.getAttribute("data-block"))return n}else{var r=(0,V.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var o=t.parentElement.parentElement.nextSibling;if(o&&3!==o.nodeType&&o.classList.contains("vditor-ir__node"))return o}}return!1},ep=function(e){var t=e.startContainer,n=t.previousSibling;return!(!(3===t.nodeType&&0===e.startOffset&&n&&3!==n.nodeType&&n.classList.contains("vditor-ir__node"))||n.getAttribute("data-block"))&&n},ef=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var n=(0,V.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,V.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,ei.Hc)(e));var o=eu(e);if(o){o.classList.add("vditor-ir__node--expand"),o.classList.remove("vditor-ir__node--hidden");return}var i=ep(e);if(i){i.classList.add("vditor-ir__node--expand"),i.classList.remove("vditor-ir__node--hidden");return}}},em=function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,ei.zh)(e),r=n.startContainer;if(!tE(t,e,r)||(tx(n,e,t),tY(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,N.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var o=(0,V.a1)(r,"data-newline","1");if(!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&o&&n.startOffset<o.textContent.length){var i=o.previousElementSibling;i&&(n.insertNode(document.createTextNode(i.textContent)),n.collapse(!1));var a=o.nextSibling;a&&(n.insertNode(document.createTextNode(a.textContent)),n.collapse(!0))}var l=(0,V.lG)(r,"P");if(tB(t,e,l,n)||tP(n,e,l,t)||tJ(e,n,t,l))return!0;var s=(0,V.fb)(r,"vditor-ir__marker--pre");if(s&&"PRE"===s.tagName){var c=s.firstChild;if(tK(e,t,s,n)||("math-block"===c.getAttribute("data-type")||"html-block"===c.getAttribute("data-type"))&&tA(e,t,n,c,s.parentElement)||tC(e,t,n,c,s.parentElement))return!0}var d=(0,V.a1)(r,"data-type","code-block-info");if(d){if("Enter"===t.key||"Tab"===t.key)return n.selectNodeContents(d.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),B(e,["hint"]),!0;if("Backspace"===t.key){var u=(0,ei.im)(d,e.ir.element).start;1===u&&n.setStart(r,0),2===u&&(e.hint.recentLanguage="")}if(tA(e,t,n,d,d.parentElement))return B(e,["hint"]),!0}var p=(0,V.lG)(r,"TD")||(0,V.lG)(r,"TH");if(t.key.indexOf("Arrow")>-1&&p){var f=tT(p);if(f&&tA(e,t,n,p,f))return!0;var m=tL(p);if(m&&tC(e,t,n,p,m))return!0}if(tG(e,t,n)||tZ(e,n,t)||tq(e,n,t))return!0;var v=(0,U.W)(r);if(v){if(ed("⌘=",t)){var h=v.querySelector(".vditor-ir__marker--heading");return h&&h.textContent.trim().length>1&&t3(e,h.textContent.substr(1)),t.preventDefault(),!0}if(ed("⌘-",t)){var h=v.querySelector(".vditor-ir__marker--heading");return h&&h.textContent.trim().length<6&&t3(e,h.textContent.trim()+"# "),t.preventDefault(),!0}}var g=(0,V.F9)(r);if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(tX(e,n,t,l))return!0;if(g&&g.previousElementSibling&&"UL"!==g.tagName&&"OL"!==g.tagName&&("code-block"===g.previousElementSibling.getAttribute("data-type")||"math-block"===g.previousElementSibling.getAttribute("data-type"))){var b=(0,ei.im)(g,e.ir.element,n).start;if(0===b||1===b&&g.innerText.startsWith(M.g.ZWSP))return n.selectNodeContents(g.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),ef(n,e),""===g.textContent.trim().replace(M.g.ZWSP,"")&&(g.remove(),t6(e)),t.preventDefault(),!0}if(v){var y=v.firstElementChild.textContent.length;(0,ei.im)(v,e.ir.element).start===y&&0!==y&&(n.setStart(v.firstElementChild.firstChild,y-1),n.collapse(!0),(0,ei.Hc)(n))}}return!!(("ArrowUp"===t.key||"ArrowDown"===t.key)&&g&&(g.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(r)||e.classList.add("vditor-ir__node--hidden")}),t$(t,g,n)))||(tS(n,t.key),!!(g&&es(g,e,t,n))&&(t.preventDefault(),!0))},ev=n(190),eh=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var n=e.parentElement,r=n.nextSibling;r;)if(r.textContent.startsWith(" ")){var o=r;o.childNodes.forEach(function(e){n.append(e.cloneNode(!0))}),r=r.nextSibling,o.remove()}else break;t&&t(n)})},eg=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),o=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(o=r.startContainer.childNodes[r.startOffset-1]);var i=(0,V.a1)(o,"data-block","0");if(i&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var a=(0,ei.im)(i,e.sv.element,r).start,l=!0,s=a-1;s>i.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==i.textContent.charAt(s)&&" "!==i.textContent.charAt(s)){l=!1;break}if(0===a&&(l=!1),l)return void tc(e);if("deleteContentBackward"===t.inputType){var c=(0,V.a1)(o,"data-type","code-block-open-marker")||(0,V.a1)(o,"data-type","code-block-close-marker");if(c){if("code-block-close-marker"===c.getAttribute("data-type")){var d=ta(o,"code-block-open-marker");if(d){d.textContent=c.textContent,tc(e);return}}if("code-block-open-marker"===c.getAttribute("data-type")){var d=ta(o,"code-block-close-marker",!1);if(d){d.textContent=c.textContent,tc(e);return}}}var u=(0,V.a1)(o,"data-type","math-block-open-marker");if(u){var p=u.nextElementSibling.nextElementSibling;p&&"math-block-close-marker"===p.getAttribute("data-type")&&(p.remove(),tc(e));return}i.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),i.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var f=(0,V.a1)(o,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void tc(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,V.a1)(o,"data-type","padding")||(0,V.a1)(o,"data-type","li-marker")||(0,V.a1)(o,"data-type","task-marker")||(0,V.a1)(o,"data-type","blockquote-marker")))return void tc(e)}if(i&&"$$"===i.textContent.trimRight())return void tc(e);i||(i=e.sv.element),(null==(n=i.firstElementChild)?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(i=e.sv.element),(0,V.a1)(o,"data-type","footnotes-link")&&(i=e.sv.element),-1===i.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML});var m=i.textContent,v=i.isEqualNode(e.sv.element);if(v)m=i.textContent;else{i.previousElementSibling&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove()),i.previousElementSibling&&0===m.indexOf("---\n")&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove());var h="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),m=h+m}m=tl(m,e),v?i.innerHTML=m:i.outerHTML=m,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)}),eh(e.sv.element,function(t){e.sv.element.insertAdjacentElement("beforeend",t)}),(0,ei.ib)(e.sv.element,r),tn(e),tc(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},eb=function(e,t){if(e.sv.composingLock=t.isComposing,t.isComposing||(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,N.yl)(t)&&"Escape"!==t.key))return!1;var n,r,o,i,a,l=(0,ei.zh)(e),s=l.startContainer;3!==l.startContainer.nodeType&&"DIV"===l.startContainer.tagName&&(s=l.startContainer.childNodes[l.startOffset-1]);var c=(0,V.a1)(s,"data-type","text"),d=(0,V.a1)(s,"data-type","blockquote-marker");if(!d&&0===l.startOffset&&c&&c.previousElementSibling&&"blockquote-marker"===c.previousElementSibling.getAttribute("data-type")&&(d=c.previousElementSibling),d&&"Enter"===t.key&&!(0,N.yl)(t)&&!t.altKey&&""===d.nextElementSibling.textContent.trim()&&(0,ei.im)(d,e.sv.element,l).start===d.textContent.length)return(null==(n=d.previousElementSibling)?void 0:n.getAttribute("data-type"))==="padding"&&d.previousElementSibling.setAttribute("data-action","enter-remove"),d.remove(),tc(e),t.preventDefault(),!0;var u=(0,V.a1)(s,"data-type","li-marker"),p=(0,V.a1)(s,"data-type","task-marker"),f=u;if(!f&&p&&"task-marker"!==p.nextElementSibling.getAttribute("data-type")&&(f=p),!f&&0===l.startOffset&&c&&c.previousElementSibling&&("li-marker"===c.previousElementSibling.getAttribute("data-type")||"task-marker"===c.previousElementSibling.getAttribute("data-type"))&&(f=c.previousElementSibling),f){var m=(0,ei.im)(f,e.sv.element,l).start,v="task-marker"===f.getAttribute("data-type"),h=f;if(v&&(h=f.previousElementSibling.previousElementSibling.previousElementSibling),m===f.textContent.length){if("Enter"===t.key&&!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&""===f.nextElementSibling.textContent.trim())return(null==(r=h.previousElementSibling)?void 0:r.getAttribute("data-type"))==="padding"?(h.previousElementSibling.remove(),eg(e)):(v&&(h.remove(),f.previousElementSibling.previousElementSibling.remove(),f.previousElementSibling.remove()),f.nextElementSibling.remove(),f.remove(),tc(e)),t.preventDefault(),!0;if("Tab"===t.key)return t.shiftKey?"padding"===h.previousElementSibling.getAttribute("data-type")&&h.previousElementSibling.remove():h.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(h.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(h.textContent)&&(h.textContent=h.textContent.replace(/^\d{1,}/,"1"),l.selectNodeContents(f.firstChild),l.collapse(!1)),eg(e),t.preventDefault(),!0}}if(tq(e,l,t))return!0;var g=(0,V.a1)(s,"data-block","0"),b=(0,U.S)(s,"SPAN");if("Enter"===t.key&&!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&g){var y=!1,w=g.textContent.match(/^\n+/);(0,ei.im)(g,e.sv.element).start<=(w?w[0].length:0)&&(y=!0);var k="\n";if(b)if((null==(o=b.previousElementSibling)?void 0:o.getAttribute("data-action"))==="enter-remove")return b.previousElementSibling.remove(),tc(e),t.preventDefault(),!0;else k+=ts(b);return l.insertNode(document.createTextNode(k)),l.collapse(!1),g&&""!==g.textContent.trim()&&!y?eg(e):tc(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey){if(b&&(null==(i=b.previousElementSibling)?void 0:i.getAttribute("data-type"))==="newline"&&1===(0,ei.im)(b,e.sv.element,l).start&&-1===b.getAttribute("data-type").indexOf("code-block-"))return l.setStart(b,0),l.extractContents(),""!==b.textContent.trim()?eg(e):tc(e),t.preventDefault(),!0;if(g&&0===(0,ei.im)(g,e.sv.element,l).start&&g.previousElementSibling){l.extractContents();var E=g.previousElementSibling.lastElementChild;return"newline"===E.getAttribute("data-type")&&(E.remove(),E=g.previousElementSibling.lastElementChild),"newline"!==E.getAttribute("data-type")&&(E.insertAdjacentHTML("afterend",g.innerHTML),g.remove()),""===g.textContent.trim()||(null==(a=g.previousElementSibling)?void 0:a.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==E.getAttribute("data-type")&&(l.selectNodeContents(E.lastChild),l.collapse(!1)),tc(e)):eg(e),t.preventDefault(),!0}}return!1},ey=n(538),ew=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},ek=function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),ew(e),(0,ey.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){B(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),e6(e,e.options.mode,e_(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame(function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, ".concat(-t.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}},eE=function(e){var t=window.innerWidth<=M.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px ".concat(Math.max(t,n),"px")}if("none"!==e.ir.element.parentElement.style.display){var n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.ir.element.style.padding="10px ".concat(Math.max(t,n),"px")}"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},ex=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function eS(){window.removeEventListener("resize",_)}var e_=function(e){ex(e),eS(),window.addEventListener("resize",_=function(){eE(e),ex(e)});var t=(0,N.pK)()&&localStorage.getItem(e.options.cache.id);return e.options.cache.enable&&t||(e.options.value?t=e.options.value:e.originalInnerHTML?t=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(t="")),t||""},eT=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,ei.Gb)(e[e.currentMode].element)){D(e.toolbar.elements,M.g.EDIT_TOOLBARS),j(e.toolbar.elements,M.g.EDIT_TOOLBARS);var t=(0,ei.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,V.a1)(n,"data-type","heading"):(0,U.W)(n))&&I(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,V.a1)(n,"data-type","blockquote"):(0,V.lG)(n,"BLOCKQUOTE"))&&I(e.toolbar.elements,["quote"]),(0,V.a1)(n,"data-type","strong")&&I(e.toolbar.elements,["bold"]),(0,V.a1)(n,"data-type","em")&&I(e.toolbar.elements,["italic"]),(0,V.a1)(n,"data-type","s")&&I(e.toolbar.elements,["strike"]),(0,V.a1)(n,"data-type","a")&&I(e.toolbar.elements,["link"]);var r=(0,V.lG)(n,"LI");r?(r.classList.contains("vditor-task")?I(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?I(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&I(e.toolbar.elements,["list"]),j(e.toolbar.elements,["outdent","indent"])):R(e.toolbar.elements,["outdent","indent"]),(0,V.a1)(n,"data-type","code-block")&&(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),I(e.toolbar.elements,["code"])),(0,V.a1)(n,"data-type","code")&&(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),I(e.toolbar.elements,["inline-code"])),(0,V.a1)(n,"data-type","table")&&R(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},eL=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=A(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,N.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},eM=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(M.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1},eC=function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!!t&&3!==t.nodeType&&("CODE"===t.tagName||"math-inline"===t.getAttribute("data-type")||"html-entity"===t.getAttribute("data-type")||"html-inline"===t.getAttribute("data-type"))},eA=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},eO=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},eH=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling},eN=function(e){var t=eO(e.startContainer),n=eA(e.startContainer),r=e.startContainer.textContent,o=e.startOffset,i="",a="";return(""!==r.substr(0,o)&&r.substr(0,o)!==M.g.ZWSP||t)&&(i="".concat(t).concat(r.substr(0,o))),(""!==r.substr(o)&&r.substr(o)!==M.g.ZWSP||n)&&(a="".concat(r.substr(o)).concat(n)),{afterHTML:a,beforeHTML:i}},eD=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var o=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,o)),t.collapse(!0),(0,ei.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>")):"BR"===n.tagName?n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"<wbr></p>"):(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"</p>")),(0,ei.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},eI=function(e,t){var n=(0,ei.zh)(e),r=(0,V.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"):r.outerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"),(0,ei.ib)(e.wysiwyg.element,n),ea(e))},ej=function(e){var t=getSelection().getRangeAt(0),n=(0,V.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,ei.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},eR=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,o=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?o.setStart(r.firstChild,1):o.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),o.selectNodeContents(r.firstChild)),n?o.collapse(!0):o.collapse(!1),(0,ei.Hc)(o),e.firstElementChild.classList.contains("language-mindmap")||tn(t)},eP=function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,ei.zh)(e),r=n.startContainer;if(!tE(t,e,r)||(tx(n,e,t),tY(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,N.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var o=(0,V.F9)(r),i=(0,V.lG)(r,"P");if(tB(t,e,i,n)||tP(n,e,i,t)||tG(e,t,n))return!0;var a=(0,V.fb)(r,"vditor-wysiwyg__block");if(a){if("Escape"===t.key&&2===a.children.length)return e.wysiwyg.popover.style.display="none",a.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,N.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===a.getAttribute("data-type")){var l=e.wysiwyg.popover.querySelector(".vditor-input");return l.focus(),l.select(),t.preventDefault(),!0}if("0"===a.getAttribute("data-block")&&(tK(e,t,a.firstElementChild,n)||tC(e,t,n,a.firstElementChild,a)||"yaml-front-matter"!==a.getAttribute("data-type")&&tA(e,t,n,a.firstElementChild,a)))return!0}if(tJ(e,n,t,i))return!0;var s=(0,V.E2)(r,"BLOCKQUOTE");if(s&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,N.yl)(t)?n.setStartBefore(s):n.setStartAfter(s),(0,ei.Hc)(n);var c=document.createElement("p");return c.setAttribute("data-block","0"),c.innerHTML="\n",n.insertNode(c),n.collapse(!0),(0,ei.Hc)(n),eL(e),tn(e),t.preventDefault(),!0}var d=(0,U.W)(r);if(d){if("H6"===d.tagName&&r.textContent.length===n.startOffset&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var u=document.createElement("p");return u.textContent="\n",u.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",u),n.setStart(u,0),(0,ei.Hc)(n),eL(e),tn(e),t.preventDefault(),!0}if(ed("⌘=",t)){var p=parseInt(d.tagName.substr(1),10)-1;return p>0&&(eI(e,"h".concat(p)),eL(e)),t.preventDefault(),!0}if(ed("⌘-",t)){var p=parseInt(d.tagName.substr(1),10)+1;return p<7&&(eI(e,"h".concat(p)),eL(e)),t.preventDefault(),!0}"Backspace"!==t.key||(0,N.yl)(t)||t.shiftKey||t.altKey||1!==d.textContent.length||ej(e)}if(tZ(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,N.yl)(t)&&!t.shiftKey){var f=(0,V.lG)(r,"A"),m=(0,V.a1)(r,"data-type","link-ref"),v=(0,V.a1)(r,"data-type","footnotes-ref");if(f||m||v||d&&2===d.tagName.length){var h=e.wysiwyg.popover.querySelector("input");h.focus(),h.select()}}if(eq(e,t))return!0;if(ed("⇧⌘U",t)){var g=e.wysiwyg.popover.querySelector('[data-type="up"]');if(g)return g.click(),t.preventDefault(),!0}if(ed("⇧⌘D",t)){var g=e.wysiwyg.popover.querySelector('[data-type="down"]');if(g)return g.click(),t.preventDefault(),!0}if(tq(e,n,t))return!0;if(!(0,N.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+M.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,ei.Hc)(n),eL(e),tn(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(tX(e,n,t,i))return!0;if(o){if(o.previousElementSibling&&o.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===o.previousElementSibling.getAttribute("data-block")&&"UL"!==o.tagName&&"OL"!==o.tagName){var b=(0,ei.im)(o,e.wysiwyg.element,n).start;if(0===b&&0===n.startOffset||1===b&&o.innerText.startsWith(M.g.ZWSP))return eR(o.previousElementSibling.lastElementChild,e,!1),""===o.innerHTML.trim().replace(M.g.ZWSP,"")&&(o.remove(),eL(e)),t.preventDefault(),!0}var y=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(y-2)&&r.textContent.charAt(y-1)!==M.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,y-1)+M.g.ZWSP,n.setStart(r,y),n.collapse(!0),eL(e),t.preventDefault(),!0;r.textContent===M.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&eC(n)&&(r.textContent=""),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}if((0,N.vU)()&&1===n.startOffset&&r.textContent.indexOf(M.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(t$(t,o,n))return t.preventDefault(),!0;if(tS(n,t.key),"ArrowDown"===t.key){var w=r.nextSibling;w&&3!==w.nodeType&&"math-inline"===w.getAttribute("data-type")&&n.setStartAfter(w)}return!!(o&&es(o,e,t,n))&&(t.preventDefault(),!0)},eq=function(e,t){if(ed("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},eB=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,ei.Gb)(e.wysiwyg.element)){D(e.toolbar.elements,M.g.EDIT_TOOLBARS),j(e.toolbar.elements,M.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,V.a1)(n,"data-type","footnotes-block");if(r){e.wysiwyg.popover.innerHTML="",eW(r,e),eX(e,"footnotes-block"),ez(e,r);return}var o=(0,V.lG)(n,"LI");o?(o.classList.contains("vditor-task")?I(e.toolbar.elements,["check"]):"OL"===o.parentElement.tagName?I(e.toolbar.elements,["ordered-list"]):"UL"===o.parentElement.tagName&&I(e.toolbar.elements,["list"]),j(e.toolbar.elements,["outdent","indent"])):R(e.toolbar.elements,["outdent","indent"]),(0,V.lG)(n,"BLOCKQUOTE")&&I(e.toolbar.elements,["quote"]),((0,V.lG)(n,"B")||(0,V.lG)(n,"STRONG"))&&I(e.toolbar.elements,["bold"]),((0,V.lG)(n,"I")||(0,V.lG)(n,"EM"))&&I(e.toolbar.elements,["italic"]),((0,V.lG)(n,"STRIKE")||(0,V.lG)(n,"S"))&&I(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")});var i=(0,V.fb)(n,"vditor-comment");if(i){var a=i.getAttribute("data-cmtids").split(" ");if(a.length>1&&i.nextSibling.isSameNode(i.nextElementSibling)){var l=i.nextElementSibling.getAttribute("data-cmtids").split(" ");a.find(function(e){if(l.includes(e))return a=[e],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){e.getAttribute("data-cmtids").indexOf(a[0])>-1&&e.classList.add("vditor-comment--focus")})}var s=(0,V.lG)(n,"A");s&&I(e.toolbar.elements,["link"]);var c=(0,V.lG)(n,"TABLE"),d=(0,U.W)(n);(0,V.lG)(n,"CODE")?(0,V.lG)(n,"PRE")?(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),I(e.toolbar.elements,["code"])):(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),I(e.toolbar.elements,["inline-code"])):d?(R(e.toolbar.elements,["bold"]),I(e.toolbar.elements,["headings"])):c&&R(e.toolbar.elements,["table"]);var u=(0,V.fb)(n,"vditor-toc");if(u){e.wysiwyg.popover.innerHTML="",eW(u,e),eX(e,"vditor-toc"),ez(e,u);return}var p=(0,U.S)(n,"BLOCKQUOTE");if(p&&(e.wysiwyg.popover.innerHTML="",eU(t,p,e),eF(t,p,e),eW(p,e),eX(e,"blockquote"),ez(e,p)),o&&(e.wysiwyg.popover.innerHTML="",eU(t,o,e),eF(t,o,e),eW(o,e),eX(e,"li"),ez(e,o)),c){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var f=function(){var t=c.rows.length,n=c.rows[0].cells.length,r=parseInt(C.value,10)||t,o=parseInt(H.value,10)||n;if(r!==t||n!==o){if(n!==o)for(var i=o-n,a=0;a<c.rows.length;a++)if(i>0)for(var l=0;l<i;l++)0===a?c.rows[a].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):c.rows[a].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var s=n-1;s>=o;s--)c.rows[a].cells[s].remove();if(t!==r){var d=r-t;if(d>0){for(var u="<tr>",p=0;p<o;p++)u+="<td> </td>";for(var f=0;f<d;f++)c.querySelector("tbody")?c.querySelector("tbody").insertAdjacentHTML("beforeend",u):c.querySelector("thead").insertAdjacentHTML("afterend",u+"</tr>")}else for(var p=t-1;p>=r;p--)c.rows[p].remove(),1===c.rows.length&&c.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(A(e))}},m=function(n){tD(c,n),"right"===n?(b.classList.remove("vditor-icon--current"),y.classList.remove("vditor-icon--current"),w.classList.add("vditor-icon--current")):"center"===n?(b.classList.remove("vditor-icon--current"),w.classList.remove("vditor-icon--current"),y.classList.add("vditor-icon--current")):(y.classList.remove("vditor-icon--current"),w.classList.remove("vditor-icon--current"),b.classList.add("vditor-icon--current")),(0,ei.Hc)(t),eL(e)},v=(0,V.lG)(n,"TD"),h=(0,V.lG)(n,"TH"),g="left";v?g=v.getAttribute("align")||"left":h&&(g=h.getAttribute("align")||"center");var b=document.createElement("button");b.setAttribute("type","button"),b.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,N.ns)("⇧⌘L")+">"),b.setAttribute("data-type","left"),b.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',b.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===g?" vditor-icon--current":""),b.onclick=function(){m("left")};var y=document.createElement("button");y.setAttribute("type","button"),y.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,N.ns)("⇧⌘C")+">"),y.setAttribute("data-type","center"),y.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',y.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===g?" vditor-icon--current":""),y.onclick=function(){m("center")};var w=document.createElement("button");w.setAttribute("type","button"),w.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,N.ns)("⇧⌘R")+">"),w.setAttribute("data-type","right"),w.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',w.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===g?" vditor-icon--current":""),w.onclick=function(){m("right")};var k=document.createElement("button");k.setAttribute("type","button"),k.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,N.ns)("⌘=")+">"),k.setAttribute("data-type","insertRow"),k.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',k.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",k.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tz(e,t,r)};var E=document.createElement("button");E.setAttribute("type","button"),E.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,N.ns)("⇧⌘F")+">"),E.setAttribute("data-type","insertRow"),E.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',E.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",E.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tV(e,t,r)};var x=document.createElement("button");x.setAttribute("type","button"),x.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,N.ns)("⇧⌘=")+">"),x.setAttribute("data-type","insertColumn"),x.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',x.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",x.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,V.lG)(t,"TD")||(0,V.lG)(t,"TH");n&&tU(e,c,n)};var S=document.createElement("button");S.setAttribute("type","button"),S.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,N.ns)("⇧⌘G")+">"),S.setAttribute("data-type","insertColumn"),S.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',S.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",S.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,V.lG)(t,"TD")||(0,V.lG)(t,"TH");n&&tU(e,c,n,"beforebegin")};var _=document.createElement("button");_.setAttribute("type","button"),_.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,N.ns)("⌘-")+">"),_.setAttribute("data-type","deleteRow"),_.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',_.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",_.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tF(e,t,r)};var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,N.ns)("⇧⌘-")+">"),T.setAttribute("data-type","deleteColumn"),T.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",T.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tW(e,t,c,r)};var L=document.createElement("span");L.setAttribute("aria-label",window.VditorI18n.row),L.className="vditor-tooltipped vditor-tooltipped__n";var C=document.createElement("input");L.appendChild(C),C.type="number",C.min="1",C.className="vditor-input",C.style.width="42px",C.style.textAlign="center",C.setAttribute("placeholder",window.VditorI18n.row),C.value=c.rows.length.toString(),C.oninput=function(){f()},C.onkeydown=function(n){if(!n.isComposing){if("Tab"===n.key){H.focus(),H.select(),n.preventDefault();return}if(!eq(e,n)&&eZ(n,t))return}};var O=document.createElement("span");O.setAttribute("aria-label",window.VditorI18n.column),O.className="vditor-tooltipped vditor-tooltipped__n";var H=document.createElement("input");O.appendChild(H),H.type="number",H.min="1",H.className="vditor-input",H.style.width="42px",H.style.textAlign="center",H.setAttribute("placeholder",window.VditorI18n.column),H.value=c.rows[0].cells.length.toString(),H.oninput=function(){f()},H.onkeydown=function(n){if(!n.isComposing){if("Tab"===n.key){C.focus(),C.select(),n.preventDefault();return}if(!eq(e,n)&&eZ(n,t))return}},eU(t,c,e),eF(t,c,e),eW(c,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",b),e.wysiwyg.popover.insertAdjacentElement("beforeend",y),e.wysiwyg.popover.insertAdjacentElement("beforeend",w),e.wysiwyg.popover.insertAdjacentElement("beforeend",E),e.wysiwyg.popover.insertAdjacentElement("beforeend",k),e.wysiwyg.popover.insertAdjacentElement("beforeend",S),e.wysiwyg.popover.insertAdjacentElement("beforeend",x),e.wysiwyg.popover.insertAdjacentElement("beforeend",_),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",O),eX(e,"table"),ez(e,c)}var P=(0,V.a1)(n,"data-type","link-ref");P&&eV(e,P,t);var q=(0,V.a1)(n,"data-type","footnotes-ref");if(q){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var L=document.createElement("span");L.setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,N.ns)("⌥Enter")+">"),L.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");L.appendChild(B),B.className="vditor-input",B.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,N.ns)("⌥Enter")+">"),B.style.width="120px",B.value=q.getAttribute("data-footnotes-label"),B.oninput=function(){""!==B.value.trim()&&q.setAttribute("data-footnotes-label",B.value),"function"==typeof e.options.input&&e.options.input(A(e))},B.onkeydown=function(n){if(!n.isComposing&&!eq(e,n)&&eZ(n,t))return},eW(q,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),eX(e,"footnotes-ref"),ez(e,q)}var z=(0,V.fb)(n,"vditor-wysiwyg__block"),F=!!z&&z.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){(!z||z&&F&&!z.contains(e))&&(e.previousElementSibling.style.display="none")}),z&&F){if(e.wysiwyg.popover.innerHTML="",eU(t,z,e),eF(t,z,e),eW(z,e),"code-block"===z.getAttribute("data-type")){var W=document.createElement("span");W.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,N.ns)("⌥Enter")+">"),W.className="vditor-tooltipped vditor-tooltipped__n";var G=document.createElement("input");W.appendChild(G);var K=z.firstElementChild.firstElementChild;G.className="vditor-input",G.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,N.ns)("⌥Enter")+">"),G.value=K.className.indexOf("language-")>-1?K.className.split("-")[1].split(" ")[0]:"",G.oninput=function(n){""!==G.value.trim()?K.className="language-".concat(G.value):(K.className="",e.hint.recentLanguage=""),z.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(z.lastElementChild.innerHTML=z.firstElementChild.innerHTML,eo(z.lastElementChild,e)),eL(e),1===n.detail&&(t.setStart(K.firstChild,0),t.collapse(!0),(0,ei.Hc)(t))},G.onkeydown=function(n){if(!n.isComposing&&!eq(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display){e.hint.element.style.display="none",n.preventDefault();return}e.hint.select(n,e),eZ(n,t)}},G.onkeyup=function(t){if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var n,r,o=[],i=G.value.substring(0,G.selectionStart);(e.options.preview.hljs.langs||M.g.ALIAS_CODE_LANGUAGES.concat((null!=(r=null==(n=window.hljs)?void 0:n.listLanguages())?r:[]).sort())).forEach(function(e){e.indexOf(i.toLowerCase())>-1&&o.push({html:e,value:e})}),e.hint.genHTML(o,i,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",W),eX(e,"code-block")}else eX(e,"block");ez(e,z)}else z=void 0;if(d){e.wysiwyg.popover.innerHTML="";var L=document.createElement("span");L.setAttribute("aria-label","ID<"+(0,N.ns)("⌥Enter")+">"),L.className="vditor-tooltipped vditor-tooltipped__n";var J=document.createElement("input");L.appendChild(J),J.className="vditor-input",J.setAttribute("placeholder","ID<"+(0,N.ns)("⌥Enter")+">"),J.style.width="120px",J.value=d.getAttribute("data-id")||"",J.oninput=function(){d.setAttribute("data-id",J.value),"function"==typeof e.options.input&&e.options.input(A(e))},J.onkeydown=function(n){if(!n.isComposing&&!eq(e,n)&&eZ(n,t))return},eU(t,d,e),eF(t,d,e),eW(d,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),eX(e,"heading"),ez(e,d)}if(s&&eK(e,s,t),!p&&!o&&!c&&!z&&!s&&!P&&!q&&!d&&!u){var Z=(0,V.a1)(n,"data-block","0");Z&&Z.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",eU(t,Z,e),eF(t,Z,e),eW(Z,e),eX(e,"block"),ez(e,Z)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"});var X=(0,V.a1)(t.startContainer,"data-type","backslash");X&&(X.querySelector("span").style.display="inline")}},200)},ez=function(e,t){var n=t,r=(0,V.lG)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},eV=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",i.value):t.textContent=i.value),""!==l.value.trim()&&t.setAttribute("data-link-label",l.value),"function"==typeof e.options.input&&e.options.input(A(e))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.getAttribute("alt")||t.textContent,i.oninput=function(){r()},i.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.linkRef),l.value=t.getAttribute("data-link-label"),l.oninput=function(){r()},l.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,i)},eW(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),eX(e,"link-ref"),ez(e,t)},eU=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","up"),o.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,N.ns)("⇧⌘U")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,ei.ib)(n.wysiwyg.element,e),eL(n),eB(n),tn(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eF=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","down"),o.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,N.ns)("⇧⌘D")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,ei.ib)(n.wysiwyg.element,e),eL(n),eB(n),tn(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eW=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,N.ns)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var n=(0,ei.zh)(t);n.setStartAfter(e),(0,ei.Hc)(n),e.remove(),eL(t),eB(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&ea(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},eG=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key){r.focus(),r.select(),n.preventDefault();return}if(!(0,N.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var o=(0,ei.zh)(e);t.insertAdjacentHTML("afterend",M.g.ZWSP),o.setStartAfter(t.nextSibling),o.collapse(!0),(0,ei.Hc)(o),n.preventDefault()}}},eK=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&(t.innerHTML=i.value),t.setAttribute("href",l.value),t.setAttribute("title",c.value),eL(e)};t.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.innerHTML||"",i.oninput=function(){r()},i.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.link),l.value=t.getAttribute("href")||"",l.oninput=function(){r()},l.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,c)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.tooltipText),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.tooltipText),c.style.width="60px",c.value=t.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,i)},eW(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),eX(e,"a"),ez(e,t)},eJ=function(e,t){var n=e.target;t.wysiwyg.popover.innerHTML="";var r=function(){n.setAttribute("src",i.value),n.setAttribute("alt",l.value),n.setAttribute("title",c.value),"function"==typeof t.options.input&&t.options.input(A(t))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.imageURL),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.imageURL),i.value=n.getAttribute("src")||"",i.oninput=function(){r()},i.onkeydown=function(e){eq(t,e)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.alternateText),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.alternateText),l.style.width="52px",l.value=n.getAttribute("alt")||"",l.oninput=function(){r()},l.onkeydown=function(e){eq(t,e)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.title),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.title),c.value=n.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(e){eq(t,e)},eW(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",o),t.wysiwyg.popover.insertAdjacentElement("beforeend",a),t.wysiwyg.popover.insertAdjacentElement("beforeend",s),eX(t,"image"),ez(t,n)},eZ=function(e,t){if(!(0,N.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,ei.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},eX=function(e,t){e.options.customWysiwygToolbar(t,e.wysiwyg.popover)},eY=function(e){"wysiwyg"===e.currentMode?eB(e):"ir"===e.currentMode&&eT(e)},e$=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){eo(t,e),t.previousElementSibling.setAttribute("style","display:none")}),eL(e,n)},eQ=function(e,t,n){for(var r=e.startContainer.parentElement,o=!1,i="",a="",l=eN(e),s=l.beforeHTML,c=l.afterHTML;r&&!o;){var d=r.tagName;if("STRIKE"===d&&(d="S"),"I"===d&&(d="EM"),"B"===d&&(d="STRONG"),"S"===d||"STRONG"===d||"EM"===d){var u="",p="",f="";"0"!==r.parentElement.getAttribute("data-block")&&(p=eO(r),f=eA(r)),(s||p)&&(s=u="".concat(p,"<").concat(d,">").concat(s,"</").concat(d,">")),("bold"===n&&"STRONG"===d||"italic"===n&&"EM"===d||"strikeThrough"===n&&"S"===d)&&(u+="".concat(i).concat(M.g.ZWSP,"<wbr>").concat(a),o=!0),(c||f)&&(u+=c="<".concat(d,">").concat(c,"</").concat(d,">").concat(f)),"0"!==r.parentElement.getAttribute("data-block")?(r=r.parentElement).innerHTML=u:(r.outerHTML=u,r=r.parentElement),i="<".concat(d,">")+i,a="</".concat(d,">")+a}else o=!0}(0,ei.ib)(t.wysiwyg.element,e)},e0=function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,o=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var i=(0,ei.zh)(e),a=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if("strike"===a&&(a="strikeThrough"),"quote"===a){var l=(0,V.lG)(i.startContainer,"BLOCKQUOTE");l||(l=i.startContainer.childNodes[i.startOffset]),l&&(r=!1,t.classList.remove("vditor-menu--current"),i.insertNode(document.createElement("wbr")),l.outerHTML=""===l.innerHTML.trim()?'<p data-block="0">'.concat(l.innerHTML,"</p>"):l.innerHTML,(0,ei.ib)(e.wysiwyg.element,i))}else if("inline-code"===a){var s=(0,V.lG)(i.startContainer,"CODE");s||(s=i.startContainer.childNodes[i.startOffset]),s&&(s.outerHTML=s.innerHTML.replace(M.g.ZWSP,"")+"<wbr>",(0,ei.ib)(e.wysiwyg.element,i))}else"link"===a?(i.collapsed&&i.selectNode(i.startContainer.parentElement),document.execCommand("unlink",!1,"")):"check"===a||"list"===a||"ordered-list"===a?(tO(e,i,a),(0,ei.ib)(e.wysiwyg.element,i),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===i.toString()?eQ(i,e,a):document.execCommand(a,!1,""));else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,ei.ib)(e.wysiwyg.element,i));var c=(0,V.F9)(i.startContainer);if("quote"===a){if(c||(c=i.startContainer.childNodes[i.startOffset]),c){r=!1,t.classList.add("vditor-menu--current"),i.insertNode(document.createElement("wbr"));var d=(0,V.lG)(i.startContainer,"LI");d&&c.contains(d)?d.innerHTML='<blockquote data-block="0">'.concat(d.innerHTML,"</blockquote>"):c.outerHTML='<blockquote data-block="0">'.concat(c.outerHTML,"</blockquote>"),(0,ei.ib)(e.wysiwyg.element,i)}}else if("check"===a||"list"===a||"ordered-list"===a)tO(e,i,a,!1),(0,ei.ib)(e.wysiwyg.element,i),r=!1,D(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===a){if(""===i.toString()){var u=document.createElement("code");u.textContent=M.g.ZWSP,i.insertNode(u),i.setStart(u.firstChild,1),i.collapse(!0),(0,ei.Hc)(i)}else if(3===i.startContainer.nodeType){var u=document.createElement("code");i.surroundContents(u),i.insertNode(u),(0,ei.Hc)(i)}t.classList.add("vditor-menu--current")}else if("code"===a){var u=document.createElement("div");u.className="vditor-wysiwyg__block",u.setAttribute("data-type","code-block"),u.setAttribute("data-block","0"),u.setAttribute("data-marker","```"),""===i.toString()?u.innerHTML="<pre><code><wbr>\n</code></pre>":(u.innerHTML="<pre><code>".concat(i.toString(),"<wbr></code></pre>"),i.deleteContents()),i.insertNode(u),c&&(c.outerHTML=e.lute.SpinVditorDOM(c.outerHTML)),(0,ei.ib)(e.wysiwyg.element,i),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){eo(t,e)}),t.classList.add("vditor-menu--disabled")}else if("link"===a){if(""===i.toString()){var p=document.createElement("a");p.innerText=M.g.ZWSP,i.insertNode(p),i.setStart(p.firstChild,1),i.collapse(!0),eK(e,p,i);var f=e.wysiwyg.popover.querySelector("input");f.value="",f.focus(),o=!1}else{var u=document.createElement("a");u.setAttribute("href",""),u.innerHTML=i.toString(),i.surroundContents(u),i.insertNode(u),(0,ei.Hc)(i),eK(e,u,i);var m=e.wysiwyg.popover.querySelectorAll("input");m[0].value=u.innerText,m[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===a){var v='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(""===i.toString().trim())c&&""===c.innerHTML.trim().replace(M.g.ZWSP,"")?c.outerHTML=v:document.execCommand("insertHTML",!1,v),i.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,ei.Hc)(i);else{v='<table data-block="0"><thead><tr>';var h=i.toString().split("\n"),g=h[0].split(",").length>h[0].split(" ").length?",":" ";h.forEach(function(e,t){0===t?(e.split(g).forEach(function(e,t){0===t?v+="<th>".concat(e,"<wbr></th>"):v+="<th>".concat(e,"</th>")}),v+="</tr></thead>"):(1===t?v+="<tbody><tr>":v+="<tr>",e.split(g).forEach(function(e){v+="<td>".concat(e,"</td>")}),v+="</tr>")}),v+="</tbody></table>",document.execCommand("insertHTML",!1,v),(0,ei.ib)(e.wysiwyg.element,i)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===a){if(c){var b='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===c.innerHTML.trim()?c.outerHTML=b:c.insertAdjacentHTML("afterend",b),(0,ei.ib)(e.wysiwyg.element,i)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===a&&(a="strikeThrough"),""===i.toString()&&("bold"===a||"italic"===a||"strikeThrough"===a)){var y="strong";"italic"===a?y="em":"strikeThrough"===a&&(y="s");var u=document.createElement(y);u.textContent=M.g.ZWSP,i.insertNode(u),u.previousSibling&&u.previousSibling.textContent===M.g.ZWSP&&(u.previousSibling.textContent=""),i.setStart(u.firstChild,1),i.collapse(!0),(0,ei.Hc)(i)}else document.execCommand(a,!1,"")}r&&eB(e),o&&eL(e)}},e1=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var o=t.hotkey?" <".concat((0,N.ns)(t.hotkey),">"):"";2===t.level&&(o=t.hotkey?" <".concat((0,N.ns)(t.hotkey),">"):"");var i=t.tip?t.tip+o:"".concat(window.VditorI18n[t.name]).concat(o),a="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<".concat(a,' data-type="').concat(t.name,'">').concat(i,"</").concat(a,">");else{this.element.classList.add("vditor-toolbar__item");var l=document.createElement(a);l.setAttribute("data-type",t.name),l.className="vditor-tooltipped vditor-tooltipped__".concat(t.tipPosition),l.setAttribute("aria-label",i),l.innerHTML=t.icon,this.element.appendChild(l)}t.prefix&&this.element.children[0].addEventListener((0,N.Le)(),function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?e0(e,r.element.children[0],n):"ir"===e.currentMode?t4(e,r.element.children[0],t.prefix||"",t.suffix||""):tu(e,r.element.children[0],t.prefix||"",t.suffix||""))})},e2=(e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),e6=function(e,t,n){var r;if("string"!=typeof n?(B(e,["subToolbar","hint"]),n.preventDefault(),r=A(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",j(e.toolbar.elements,M.g.EDIT_TOOLBARS),D(e.toolbar.elements,M.g.EDIT_TOOLBARS),R(e.toolbar.elements,["outdent","indent"]),"ir"===t)P(e.toolbar.elements,["both"]),q(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),t6(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),eE(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){eo(t,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})});else if("wysiwyg"===t)P(e.toolbar.elements,["both"]),q(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",eE(e),e$(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if("sv"===t){q(e.toolbar.elements,["both"]),P(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none","both"===e.options.preview.mode?e.sv.element.style.display="block":"editor"===e.options.preview.mode&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var o=tl(r,e);"<div data-block='0'></div>"===o&&(o=""),e.sv.element.innerHTML=o,eh(e.sv.element),tc(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),eE(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),eY(e)),ea(e),ex(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(e.currentMode,'"]')).classList.add("vditor-menu--current")),e.outline.toggle(e,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},e3=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," <").concat((0,N.ns)("⌥⌘7"),'></button>\n<button data-mode="ir">').concat(window.VditorI18n.instantRendering," <").concat((0,N.ns)("⌥⌘8"),'></button>\n<button data-mode="sv">').concat(window.VditorI18n.splitView," <").concat((0,N.ns)("⌥⌘9"),"></button>"),r.element.appendChild(o),r._bindEvent(t,o,n),r}return e2(t,e),t.prototype._bindEvent=function(e,t,n){z(e,t,this.element.children[0],n.level),t.children.item(0).addEventListener((0,N.Le)(),function(t){e6(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()}),t.children.item(1).addEventListener((0,N.Le)(),function(t){e6(e,"ir",t),t.preventDefault(),t.stopPropagation()}),t.children.item(2).addEventListener((0,N.Le)(),function(t){e6(e,"sv",t),t.preventDefault(),t.stopPropagation()})},t}(e1),e5=function(e,t){return(0,ei.Gb)(e,t)?getSelection().toString():""},e4=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(A(e)),B(e,["subToolbar","hint"])})},e8=function(e,t){t.addEventListener("dblclick",function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,ev.E)(t.target,e.options.lang,e.options.theme))})},e9=function(e,t){t.addEventListener("blur",function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,ei.zh)(e),e.options.blur&&e.options.blur(A(e))})},e7=function(e,t){t.addEventListener("dragstart",function(e){e.dataTransfer.setData(M.g.DROP_EDITOR,M.g.DROP_EDITOR)}),t.addEventListener("drop",function(t){t.dataTransfer.getData(M.g.DROP_EDITOR)?tR(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&tQ(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},te=function(e,t,n){t.addEventListener("copy",function(t){return n(t,e)})},tt=function(e,t,n){t.addEventListener("cut",function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")})},tn=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,ei.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},tr=function(e,t){t.addEventListener("keydown",function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!((e.options.hint.extend.length>1||e.toolbar.elements.emoji)&&e.hint.select(t,e))){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||ed("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(eb(e,t))return}else if("wysiwyg"===e.currentMode){if(eP(e,t))return}else if("ir"===e.currentMode&&em(e,t))return;if(e.options.ctrlEnter&&ed("⌘Enter",t)){e.options.ctrlEnter(A(e)),t.preventDefault();return}if(ed("⌘Z",t)&&!e.toolbar.elements.undo){e.undo.undo(e),t.preventDefault();return}if(ed("⌘Y",t)&&!e.toolbar.elements.redo){e.undo.redo(e),t.preventDefault();return}if("Escape"===t.key){"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(A(e)),t.preventDefault();return}if((0,N.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,V.lG)(getSelection().getRangeAt(0).startContainer,n)?ej(e):eI(e,n),eL(e)}else"sv"===e.currentMode?td(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&t3(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,N.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?e6(e,"wysiwyg",t):"Digit8"===t.code?e6(e,"ir",t):"Digit9"===t.code&&e6(e,"sv",t),!0;e.options.toolbar.find(function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find(function(n){return!!n.hotkey&&(ed(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,N.Le)())),t.preventDefault(),!0):void 0)}):ed(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,N.Le)())),t.preventDefault(),!0):void 0})}})},to=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var t=e5(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,V.a1)(n.target,"data-type","footnotes-block")||(0,V.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment(),"function"==typeof e.options.unSelect&&e.options.unSelect())})}})},ti=function(e,t){var n=(0,ei.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,V.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var o=e.lute.SpinVditorSVDOM(r.textContent);o="<div data-block='0'>"+o.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=o:r.outerHTML=o,eh(e.sv.element),(0,ei.ib)(e.sv.element,n),tn(e)},ta=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},tl=function(e,t){return F("SpinVditorSVDOM",e,"argument",t.options.debugger),F("SpinVditorSVDOM",e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>","result",t.options.debugger),e},ts=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=t&&"text"!==t&&"table"!==t&&"heading-marker"!==t&&"newline"!==t&&"yaml-front-matter-open-marker"!==t&&"yaml-front-matter-close-marker"!==t&&"code-block-info"!==t&&"code-block-close-marker"!==t&&"code-block-open-marker"!==t?e.textContent:"",o=!1;for("newline"===t&&(o=!0);n&&!o;){var i=n.getAttribute("data-type");if("li-marker"===i||"blockquote-marker"===i||"task-marker"===i||"padding"===i){var a=n.textContent;if("li-marker"===i&&("code-block-open-marker"===t||"code-block-info"===t))r=a.replace(/\S/g," ")+r;else if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var l=ta(e,"code-block-open-marker");l&&l.previousElementSibling&&(n=l.previousElementSibling,r=a+r)}else r=a+r}else"newline"===i&&(o=!0);n=n.previousElementSibling}return r},tc=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=A(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,N.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},td=function(e,t){var n=(0,ei.zh)(e),r=(0,U.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},tu=function(e,t,n,r){var o=(0,ei.zh)(e),i=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(e.sv.element.innerHTML='<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">\n</span></span>',(0,ei.ib)(e.sv.element,o));var a=(0,V.F9)(o.startContainer),l=(0,U.S)(o.startContainer,"SPAN");if(a){if("link"===i){var s=void 0;s=""===o.toString()?"".concat(n).concat(Lute.Caret).concat(r):"".concat(n).concat(o.toString()).concat(r.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,s);return}if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i||"line"===i){var s=void 0;s=""===o.toString()?"".concat(n).concat(Lute.Caret).concat("code"===i?"":r):"".concat(n).concat(o.toString()).concat(Lute.Caret).concat("code"===i?"":r),"table"===i||"code"===i&&l&&""!==l.textContent?s="\n\n"+s:"line"===i&&(s="\n\n".concat(n,"\n").concat(Lute.Caret)),document.execCommand("insertHTML",!1,s);return}if(("check"===i||"list"===i||"ordered-list"===i||"quote"===i)&&l){var c="* ";"check"===i?c="* [ ] ":"ordered-list"===i?c="1. ":"quote"===i&&(c="> ");var d=ta(l,"newline");d?d.insertAdjacentText("afterend",c):a.insertAdjacentText("afterbegin",c),eg(e);return}(0,ei.ib)(e.sv.element,o),tc(e)}},tp=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},tf=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},tm=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},tv=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},th=function(e,t){e.tip.hide();var n=[],r="",o="";e.options.lang,e.options;for(var i=t.length,a=0;a<i;a++)!function(i){var a=t[i],l=!0;a.name||(r+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),l=!1),a.size>e.options.upload.max&&(r+="<li>".concat(a.name," ").concat(window.VditorI18n.over," ").concat(e.options.upload.max/1024/1024,"M</li>"),l=!1);var s=a.name.lastIndexOf("."),c=a.name.substr(s),d=e.options.upload.filename(a.name.substr(0,s))+c;e.options.upload.accept&&(e.options.upload.accept.split(",").some(function(e){var t=e.trim();if(0===t.indexOf(".")){if(c.toLowerCase()===t.toLowerCase())return!0}else if(a.type.split("/")[0]===t.split("/")[0])return!0;return!1})||(r+="<li>".concat(a.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),l=!1)),l&&(n.push(a),o+="<li>".concat(d," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))}(a);if(e.tip.show("<ul>".concat(r).concat(o,"</ul>")),e.options.upload.cancel){var l=e.tip.element.querySelector(".vditorCancelUpload");l&&l.addEventListener("click",function(){e.options.upload.cancel(n),e.tip.hide(),e.upload.isUploading=!1})}return n},tg=function(e,t){tp(t).focus();var n=JSON.parse(e),r="";1===n.code&&(r="".concat(n.msg)),n.data.errFiles&&n.data.errFiles.length>0&&(r="<ul><li>".concat(r,"</li>"),n.data.errFiles.forEach(function(e){var n=e.lastIndexOf("."),o=t.options.upload.filename(e.substr(0,n))+e.substr(n);r+="<li>".concat(o," ").concat(window.VditorI18n.uploadError,"</li>")}),r+="</ul>"),r?t.tip.show(r):t.tip.hide();var o="";Object.keys(n.data.succMap).forEach(function(e){var r=n.data.succMap[e],i=e.lastIndexOf("."),a=e.substr(i),l=t.options.upload.filename(e.substr(0,i))+a;0===(a=a.toLowerCase()).indexOf(".wav")||0===a.indexOf(".mp3")||0===a.indexOf(".ogg")?"wysiwyg"===t.currentMode?o+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code><audio controls="controls" src="'.concat(r,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(r,'"></audio></pre></div>\n'):"ir"===t.currentMode?o+='<audio controls="controls" src="'.concat(r,'"></audio>\n'):o+="[".concat(l,"](").concat(r,")\n"):0===a.indexOf(".apng")||0===a.indexOf(".bmp")||0===a.indexOf(".gif")||0===a.indexOf(".ico")||0===a.indexOf(".cur")||0===a.indexOf(".jpg")||0===a.indexOf(".jpeg")||0===a.indexOf(".jfif")||0===a.indexOf(".pjp")||0===a.indexOf(".pjpeg")||0===a.indexOf(".png")||0===a.indexOf(".svg")||0===a.indexOf(".webp")?"wysiwyg"===t.currentMode?o+='<img alt="'.concat(l,'" src="').concat(r,'">\n'):o+=".concat(r,")\n"):"wysiwyg"===t.currentMode?o+='<a href="'.concat(r,'">').concat(l,"</a>\n"):o+="[".concat(l,"](").concat(r,")\n")}),(0,ei.Hc)(t.upload.range),document.execCommand("insertHTML",!1,o),t.upload.range=getSelection().getRangeAt(0).cloneRange()},tb=function(e,t,n){var r,o,i,a;return r=void 0,o=void 0,i=void 0,a=function(){var r,o,i,a,l,s,c,d,u,p,f,m,v,h;return tm(this,function(g){switch(g.label){case 0:for(i=0,r=[],o=!0===e.options.upload.multiple?t.length:1;i<o;i++)(a=t[i])instanceof DataTransferItem&&(a=a.getAsFile()),r.push(a);if(!e.options.upload.handler)return[3,2];return[4,e.options.upload.handler(r)];case 1:return l=g.sent(),n&&(n.value=""),"string"==typeof l&&e.tip.show(l),[2];case 2:if(!e.options.upload.url||!e.upload)return n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2];if(!e.options.upload.file)return[3,4];return[4,e.options.upload.file(r)];case 3:r=g.sent(),g.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(l=e.options.upload.validate(r)))return e.tip.show(l),[2];if(s=tp(e),e.upload.range=(0,ei.zh)(e),0===(c=th(e,r)).length)return n&&(n.value=""),[2];for(p=0,d=new FormData,f=Object.keys(u=e.options.upload.extraData);p<f.length;p++)m=f[p],d.append(m,u[m]);for(i=0,v=c.length;i<v;i++)d.append(e.options.upload.fieldName,c[i]);return h=new XMLHttpRequest,e.upload.xhr=h,h.open("POST",e.options.upload.url),e.options.upload.token&&h.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(h.withCredentials=!0),tf(e,h),e.upload.isUploading=!0,s.setAttribute("contenteditable","false"),h.onreadystatechange=function(){if(h.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,s.setAttribute("contenteditable","true"),h.status>=200&&h.status<300)if(e.options.upload.success)e.options.upload.success(s,h.responseText);else{var r=h.responseText;e.options.upload.format&&(r=e.options.upload.format(t,h.responseText)),tg(r,e)}else e.options.upload.error?e.options.upload.error(h.responseText):e.tip.show(h.responseText);n&&(n.value=""),e.upload.element.style.display="none",e.upload.xhr=void 0}},h.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},h.send(d),[2]}})},new(i||(i=Promise))(function(e,t){function n(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(n,l)}s((a=a.apply(r,o||[])).next())})},ty=function(e,t,n){var r=(0,V.F9)(t.startContainer);if(r||(r=e.wysiwyg.element),n&&"formatItalic"!==n.inputType&&"deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&"formatBold"!==n.inputType&&"formatRemove"!==n.inputType&&"formatStrikeThrough"!==n.inputType&&"insertUnorderedList"!==n.inputType&&"insertOrderedList"!==n.inputType&&"formatOutdent"!==n.inputType&&"formatIndent"!==n.inputType&&""!==n.inputType||!n){var o,i,a,l=eM(t.startContainer);l&&l.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),r.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null==(o=r.previousElementSibling)||o.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))});var s="";"link-ref-defs-block"===r.getAttribute("data-type")&&(r=e.wysiwyg.element);var c=r.isEqualNode(e.wysiwyg.element),d=(0,V.a1)(r,"data-type","footnotes-block");if(c)s=r.innerHTML;else{var u=(0,V.O9)(t.startContainer);if(u&&!d&&(r=(0,U.S)(t.startContainer,"BLOCKQUOTE")?(0,V.F9)(t.startContainer)||r:u),d&&(r=d),s=r.outerHTML,"UL"===r.tagName||"OL"===r.tagName){var p=r.previousElementSibling,f=r.nextElementSibling;p&&("UL"===p.tagName||"OL"===p.tagName)&&(s=p.outerHTML+s,p.remove()),f&&("UL"===f.tagName||"OL"===f.tagName)&&(s+=f.outerHTML,f.remove()),s=s.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}r.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!r.isEqualNode(e)&&(s+=e.outerHTML,e.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!r.isEqualNode(e)&&(s+=e.outerHTML,e.remove())}))}if('<p data-block="0">```<wbr></p>'===(s=s.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))&&e.hint.recentLanguage&&(s='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),F("SpinVditorDOM",s,"argument",e.options.debugger),F("SpinVditorDOM",s=e.lute.SpinVditorDOM(s),"result",e.options.debugger),c)r.innerHTML=s;else if(r.outerHTML=s,d){var m=(0,V.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(m){var v=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(m.getAttribute("data-marker"),'"]'));v&&v.setAttribute("aria-label",m.textContent.trim().substr(0,24))}}var h=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");h.forEach(function(e,t){0===t?i=e:(i.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),h.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",h[0]);var g=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");g.forEach(function(e,t){0===t?a=e:(a.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),g.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",g[0]),(0,ei.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){eo(t,e)}),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}ea(e),eL(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},tw=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})},tk=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},tE=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,V.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},tx=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,N.yl)(n))&&"Escape"!==n.key&&!n.shiftKey&&!n.altKey){var r=(0,V.lG)(e.startContainer,"P")||(0,V.lG)(e.startContainer,"LI");if(r&&0===(0,ei.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var o=document.createTextNode(M.g.ZWSP);e.insertNode(o),e.setStartAfter(o)}}},tS=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,V.a1)(e.startContainer,"data-type","math-inline")||(0,V.a1)(e.startContainer,"data-type","html-entity")||(0,V.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},t_=function(e,t){var n=(0,ei.zh)(e),r=(0,V.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'.concat(M.g.ZWSP,"<wbr>\n</p>")),(0,ei.ib)(e[e.currentMode].element,n),eY(e),tR(e))},tT=function(e){var t=(0,V.lG)(e,"TABLE");return!!(t&&t.rows[0].cells[0].isSameNode(e))&&t},tL=function(e){var t=(0,V.lG)(e,"TABLE");return!!(t&&t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},tM=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,ei.Hc)(t)),r},tC=function(e,t,n,r,o){var i=(0,ei.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(i.start).indexOf("\n")||"ArrowRight"===t.key&&i.start>=r.textContent.trimRight().length){var a=o.nextElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!0),(0,ei.Hc)(n)),t.preventDefault(),!0}return!1},tA=function(e,t,n,r,o){var i=(0,ei.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,i.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===i.start){var a=o.previousElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!1),(0,ei.Hc)(n)),t.preventDefault(),!0}return!1},tO=function(e,t,n,r){void 0===r&&(r=!0);var o=(0,V.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r&&o){for(var i="",a=0;a<o.parentElement.childElementCount;a++){var l=o.parentElement.children[a].querySelector("input");l&&l.remove(),i+='<p data-block="0">'.concat(o.parentElement.children[a].innerHTML.trimLeft(),"</p>")}o.parentElement.insertAdjacentHTML("beforebegin",i),o.parentElement.remove()}else if(o)if("check"===n)o.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")});else{o.querySelector("input")&&o.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")});var s=void 0;"list"===n?(s=document.createElement("ul")).setAttribute("data-marker","*"):(s=document.createElement("ol")).setAttribute("data-marker","1."),s.setAttribute("data-block","0"),s.setAttribute("data-tight",o.parentElement.getAttribute("data-tight")),s.innerHTML=o.parentElement.innerHTML,o.parentElement.parentNode.replaceChild(s,o.parentElement)}else{var c=(0,V.a1)(t.startContainer,"data-block","0");c||(e[e.currentMode].element.querySelector("wbr").remove(),(c=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(c.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(c.innerHTML,"</li></ul>")),c.remove()):"list"===n?(c.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(c.innerHTML,"</li></ul>")),c.remove()):"ordered-list"===n&&(c.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(c.innerHTML,"</li></ol>")),c.remove())}},tH=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var o=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&o.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=r.parentElement,a="";o.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1".concat(t.slice(-1))),a+='<li data-node-id="'.concat(e.getAttribute("data-node-id"),'" data-marker="').concat(t,'">').concat(e.innerHTML,"</li>"),e.remove()}),r.insertAdjacentHTML("beforeend","<".concat(i.tagName,' data-block="0">').concat(a,"</").concat(i.tagName,">")),"wysiwyg"===e.currentMode?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,ei.ib)(e[e.currentMode].element,n);var l=(0,V.O9)(n.startContainer);l&&l.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){eo(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),tR(e),eY(e)}else e[e.currentMode].element.focus()},tN=function(e,t,n,r){var o=(0,V.lG)(t.parentElement,"LI");if(o){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=t.parentElement,a=i.cloneNode(),l=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&l.push(t),t=t.nextElementSibling)});var s=!1,c="";i.querySelectorAll("li").forEach(function(e){s&&(c+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(l[l.length-1])&&(s=!0)}),l.reverse().forEach(function(e){o.insertAdjacentElement("afterend",e)}),c&&(a.innerHTML=c,l[0].insertAdjacentElement("beforeend",a)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,ei.ib)(e[e.currentMode].element,n);var d=(0,V.O9)(n.startContainer);d&&d.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){eo(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),tR(e),eY(e)}else e[e.currentMode].element.focus()},tD=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,o=e.rows.length,i=0,a=0;a<o;a++)for(var l=0;l<r;l++)if(e.rows[a].cells[l].isSameNode(n)){i=l;break}for(var s=0;s<o;s++)e.rows[s].cells[i].setAttribute("align",t)},tI=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&!!(t.replace(/ /g,"").length>2)&&(!(t.indexOf("-")>-1)||-1!==t.trimLeft().indexOf(" ")||!(e.trimRight().split("\n").length>1))&&0!==t.indexOf(" ")&&0!==t.indexOf(" ")},tj=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf(" ")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},tR=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?eL(e,t):"ir"===e.currentMode?t6(e,t):"sv"===e.currentMode&&tc(e,t)},tP=function(e,t,n,r){var o,i=e.startContainer,a=(0,V.lG)(i,"LI");if(a){if(!(0,N.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&a.contains(n)&&n.nextElementSibling)return a&&!a.textContent.endsWith("\n")&&a.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),tR(t),r.preventDefault(),!0;if(!(0,N.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&!a.previousElementSibling&&""===e.toString()&&0===(0,ei.im)(a,t[t.currentMode].element,e).start)return a.nextElementSibling?(a.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>")),a.remove()):a.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>"),(0,ei.ib)(t[t.currentMode].element,e),tR(t),r.preventDefault(),!0;if(!(0,N.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===a.textContent.trim().replace(M.g.ZWSP,"")&&""===e.toString()&&(null==(o=a.previousElementSibling)?void 0:o.tagName)==="LI")return a.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(a.previousElementSibling),e.collapse(!1),a.remove(),(0,ei.ib)(t[t.currentMode].element,e),tR(t),r.preventDefault(),!0;if(!(0,N.yl)(r)&&!r.altKey&&"Tab"===r.key){var l=!1;if(0!==e.startOffset||(3!==i.nodeType||i.previousSibling)&&(3===i.nodeType||"LI"!==i.nodeName)?a.classList.contains("vditor-task")&&1===e.startOffset&&3!==i.previousSibling.nodeType&&"INPUT"===i.previousSibling.tagName&&(l=!0):l=!0,l||""!==e.toString())return r.shiftKey?tN(t,a,e,a.parentElement):tH(t,a,e),r.preventDefault(),!0}}return!1},tq=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""===t.toString()||t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)),(0,ei.Hc)(t),tR(e),n.preventDefault(),!0},tB=function(e,t,n,r){if(n){if(!(0,N.yl)(e)&&!e.altKey&&"Enter"===e.key){var o,i,a=String.raw(T||(o=["",""],i=["",""],Object.defineProperty?Object.defineProperty(o,"raw",{value:i}):o.raw=i,T=o),n.textContent).replace(/\\\|/g,"").trim(),l=a.split("|");if(a.startsWith("|")&&a.endsWith("|")&&l.length>3){var s=l.map(function(){return"---"}).join("|");return s=n.textContent+"\n"+s.substring(3,s.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(s),(0,ei.ib)(t[t.currentMode].element,r),tR(t),tn(t),e.preventDefault(),!0}if(tI(n.innerHTML)&&n.previousElementSibling){var c="",d=n.innerHTML.trimRight().split("\n");return d.length>1&&(d.pop(),c='<p data-block="0">'.concat(d.join("\n"),"</p>")),n.insertAdjacentHTML("afterend","".concat(c,'<hr data-block="0"><p data-block="0"><wbr>\n</p>')),n.remove(),(0,ei.ib)(t[t.currentMode].element,r),tR(t),tn(t),e.preventDefault(),!0}if(tj(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,ei.ib)(t[t.currentMode].element,r),tR(t),tn(t),e.preventDefault(),!0}if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,N.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,ei.im)(n,t[t.currentMode].element,r).start){var u=(0,V.DX)(n.previousElementSibling);u.textContent.endsWith("\n")||(u.textContent=u.textContent+"\n"),u.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,ei.ib)(t[t.currentMode].element,r)}return!1}},tz=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)r+='<td align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </td>');"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(r,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(r,"</tr>")),tR(e)},tV=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)"TH"===n.tagName?r+='<th align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </th>'):r+='<td align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </td>');if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr"));var i=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",i),n.parentElement.parentElement.remove(),(0,ei.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>"));tR(e)},tU=function(e,t,n,r){void 0===r&&(r="afterend");for(var o=0,i=n.previousElementSibling;i;)o++,i=i.previousElementSibling;for(var a=0;a<t.rows.length;a++)0===a?t.rows[a].cells[o].insertAdjacentHTML(r,"<th> </th>"):t.rows[a].cells[o].insertAdjacentHTML(r,"<td> </td>");tR(e)},tF=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,ei.Hc)(t),tR(e)}},tW=function(e,t,n,r){for(var o=0,i=r.previousElementSibling;i;)o++,i=i.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var l=n.rows[a].cells;if(1===l.length){n.remove(),eY(e);break}l[o].remove()}(0,ei.Hc)(t),tR(e)},tG=function(e,t,n){var r=n.startContainer,o=(0,V.lG)(r,"TD")||(0,V.lG)(r,"TH");if(o){if(!(0,N.yl)(t)&&!t.altKey&&"Enter"===t.key){o.lastElementChild&&(!o.lastElementChild||o.lastElementChild.isSameNode(o.lastChild)&&"BR"===o.lastElementChild.tagName)||o.insertAdjacentHTML("beforeend","<br>");var i=document.createElement("br");return n.insertNode(i),n.setStartAfter(i),tR(e),tn(e),t.preventDefault(),!0}if("Tab"===t.key){if(t.shiftKey)return tM(o,n),t.preventDefault(),!0;var a=o.nextElementSibling;return a||(a=o.parentElement.nextElementSibling?o.parentElement.nextElementSibling.firstElementChild:"THEAD"===o.parentElement.parentElement.tagName&&o.parentElement.parentElement.nextElementSibling?o.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),a&&(n.selectNodeContents(a),(0,ei.Hc)(n)),t.preventDefault(),!0}var l=o.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===o.tagName)return l.previousElementSibling?(n.selectNodeContents(l.previousElementSibling),n.collapse(!1),(0,ei.Hc)(n)):t_(e,"beforebegin"),!0;for(var s=0,c=o.parentElement;s<c.cells.length&&!c.cells[s].isSameNode(o);s++);var d=c.previousElementSibling;return d||(d=c.parentElement.previousElementSibling.firstChild),n.selectNodeContents(d.cells[s]),n.collapse(!1),(0,ei.Hc)(n),!0}if("ArrowDown"===t.key){t.preventDefault();var c=o.parentElement;if(!c.nextElementSibling&&"TD"===o.tagName)return l.nextElementSibling?(n.selectNodeContents(l.nextElementSibling),n.collapse(!0),(0,ei.Hc)(n)):t_(e,"afterend"),!0;for(var s=0;s<c.cells.length&&!c.cells[s].isSameNode(o);s++);var a=c.nextElementSibling;return a||(a=c.parentElement.nextElementSibling.firstChild),n.selectNodeContents(a.cells[s]),n.collapse(!0),(0,ei.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,N.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var u=e.wysiwyg.popover.querySelector(".vditor-input");return u.focus(),u.select(),t.preventDefault(),!0}if(!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!tM(o,n,!1)&&l&&(""===l.textContent.trim()?(l.outerHTML='<p data-block="0"><wbr>\n</p>',(0,ei.ib)(e[e.currentMode].element,n)):(n.setStartBefore(l),n.collapse(!0)),tR(e)),t.preventDefault(),!0;if(ed("⇧⌘F",t))return tV(e,n,o),t.preventDefault(),!0;if(ed("⌘=",t))return tz(e,n,o),t.preventDefault(),!0;if(ed("⇧⌘G",t))return tU(e,l,o,"beforebegin"),t.preventDefault(),!0;if(ed("⇧⌘=",t))return tU(e,l,o),t.preventDefault(),!0;if(ed("⌘-",t))return tF(e,n,o),t.preventDefault(),!0;if(ed("⇧⌘-",t))return tW(e,n,l,o),t.preventDefault(),!0;if(ed("⇧⌘L",t))if("ir"===e.currentMode)return tD(l,"left"),tR(e),t.preventDefault(),!0;else{var p=e.wysiwyg.popover.querySelector('[data-type="left"]');if(p)return p.click(),t.preventDefault(),!0}if(ed("⇧⌘C",t))if("ir"===e.currentMode)return tD(l,"center"),tR(e),t.preventDefault(),!0;else{var p=e.wysiwyg.popover.querySelector('[data-type="center"]');if(p)return p.click(),t.preventDefault(),!0}if(ed("⇧⌘R",t))if("ir"===e.currentMode)return tD(l,"right"),tR(e),t.preventDefault(),!0;else{var p=e.wysiwyg.popover.querySelector('[data-type="right"]');if(p)return p.click(),t.preventDefault(),!0}}return!1},tK=function(e,t,n,r){if("PRE"===n.tagName&&ed("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),tR(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey){var o=(0,ei.im)(n,e[e.currentMode].element,r);if((0===o.start||1===o.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,ei.ib)(e[e.currentMode].element,r),tR(e),t.preventDefault(),!0}return!(0,N.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,ei.Hc)(r),(0,N.vU)()||("wysiwyg"===e.currentMode?ty(e,r):ec(e,r)),tn(e),t.preventDefault(),!0)},tJ=function(e,t,n,r){var o=t.startContainer,i=(0,V.lG)(o,"BLOCKQUOTE");if(i&&""===t.toString()){if("Backspace"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,ei.im)(i,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),i.outerHTML=i.innerHTML,(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var a=!1;if("\n"===r.innerHTML.replace(M.g.ZWSP,"")||""===r.innerHTML.replace(M.g.ZWSP,"")?(a=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,ei.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),a=!0),a)return i.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr>\n</p>")),(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0}var l=(0,V.F9)(o);if("wysiwyg"===e.currentMode&&l&&ed("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),l.outerHTML='<blockquote data-block="0">'.concat(l.outerHTML,"</blockquote>"),(0,ei.ib)(e.wysiwyg.element,t),eL(e),n.preventDefault(),!0;if(tC(e,n,t,i,i)||tA(e,n,t,i,i))return!0}return!1},tZ=function(e,t,n){var r=t.startContainer,o=(0,V.lG)(r,"LI");if(o&&o.classList.contains("vditor-task")){if(ed("⇧⌘J",n)){var i=o.firstElementChild;return i.checked?i.removeAttribute("checked"):i.setAttribute("checked","checked"),tR(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var a=o.previousElementSibling;return o.querySelector("input").remove(),a?((0,V.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+o.innerHTML.trim()),o.remove()):(o.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(o.innerHTML.trim()||"\n","</p>")),o.nextElementSibling?o.remove():o.parentElement.remove()),(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===o.textContent.trim())if((0,V.fb)(o.parentElement,"vditor-task")){var l=(0,V.O9)(r);l&&tN(e,o,t,l)}else if(o.nextElementSibling){var s="",c="",d=!1;Array.from(o.parentElement.children).forEach(function(e){o.isSameNode(e)?d=!0:d?s+=e.outerHTML:c+=e.outerHTML});var u=o.parentElement.tagName,p="OL"===o.parentElement.tagName?"":' data-marker="'.concat(o.parentElement.getAttribute("data-marker"),'"'),f="";c&&(f="UL"===o.parentElement.tagName?"":' start="1"',c="<".concat(u,' data-tight="true"').concat(p,' data-block="0">').concat(c,"</").concat(u,">")),o.parentElement.outerHTML="".concat(c,'<p data-block="0"><wbr>\n</p><').concat(u,'\n data-tight="true"').concat(p,' data-block="0"').concat(f,">").concat(s,"</").concat(u,">")}else o.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===o.parentElement.querySelectorAll("li").length?o.parentElement.remove():o.remove();else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(o.lastChild),o.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(o.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents()));return(0,ei.ib)(e[e.currentMode].element,t),tR(e),tn(e),n.preventDefault(),!0}}return!1},tX=function(e,t,n,r){if(3!==t.startContainer.nodeType){var o=t.startContainer.children[t.startOffset];if(o&&"HR"===o.tagName)return t.selectNodeContents(o.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var i=r.previousElementSibling;if(i&&0===(0,ei.im)(r,e[e.currentMode].element,t).start&&((0,N.vU)()&&"HR"===i.tagName||"TABLE"===i.tagName)){if("TABLE"===i.tagName){var a=i.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else i.remove();return(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0}}return!1},tY=function(e){(0,N.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},t$=function(e,t,n){var r,o;if(!(0,N.vU)())return!1;if("ArrowUp"===e.key&&t&&(null==(r=t.previousElementSibling)?void 0:r.tagName)==="TABLE"){var i=t.previousElementSibling;return n.selectNodeContents(i.rows[i.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return"ArrowDown"===e.key&&!!t&&(null==(o=t.nextElementSibling)?void 0:o.tagName)==="TABLE"&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},tQ=function(e,t,n){return tw(void 0,void 0,void 0,function(){var r,o,i,a,l,s,c,d,u,p,f,m,v,h,g,b;return tk(this,function(y){switch(y.label){case 0:if("true"!==e[e.currentMode].element.getAttribute("contenteditable"))return[2];if(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),o=t.clipboardData.getData("text/plain"),i=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),o=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(i=t.dataTransfer.items)),a={},l=function(t,n){if(!n)return["",Lute.WalkContinue];if(e.options.upload.renderLinkDest)return e.options.upload.renderLinkDest(e,t,n);var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&o.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(o.withCredentials=!0),tf(e,o),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status){var t=o.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(o.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===r&&(e.textContent=n.data.url)});else{var i=e[e.currentMode].element.querySelector('img[src="'.concat(r,'"]'));i.src=n.data.url,"ir"===e.currentMode&&(i.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}tR(e)}else e.tip.show(o.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(o.responseText)}},o.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]},(r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(o,'">').concat(o,"</a>")||r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='\x3c!--StartFragment--\x3e<a href="'.concat(o,'">').concat(o,"</a>\x3c!--EndFragment--\x3e"))&&(r=""),(s=new DOMParser().parseFromString(r,"text/html")).body&&(r=s.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),c=e[e.currentMode].element.scrollHeight,d=er(r,o,e.currentMode),!(u="sv"===e.currentMode?(0,V.a1)(t.target,"data-type","code-block"):(0,V.lG)(t.target,"CODE")))return[3,1];return"sv"===e.currentMode?document.execCommand("insertHTML",!1,o.replace(/&/g,"&").replace(/</g,"<")):(p=(0,ei.im)(t.target,e[e.currentMode].element),"PRE"!==u.parentElement.tagName&&(o+=M.g.ZWSP),u.textContent=u.textContent.substring(0,p.start)+o+u.textContent.substring(p.end),(0,ei.$j)(p.start+o.length,p.start+o.length,u.parentElement),(null==(b=u.parentElement)?void 0:b.nextElementSibling.classList.contains("vditor-".concat(e.currentMode,"__preview")))&&(u.parentElement.nextElementSibling.innerHTML=u.outerHTML,eo(u.parentElement.nextElementSibling,e))),[3,10];case 1:if(!d)return[3,2];return n.pasteCode(d),[3,10];case 2:if(""===r.trim())return[3,5];if((f=document.createElement("div")).innerHTML=r,e.options.upload.base64ToLink)return[3,4];return[4,t0(e,f,("clipboardData"in t?t.clipboardData:t.dataTransfer).getData("text/rtf"))];case 3:y.sent(),y.label=4;case 4:return f.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),f.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===e.currentMode?(a.HTML2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(e.lute.HTML2VditorIRDOM(f.innerHTML),e)):"wysiwyg"===e.currentMode?(a.HTML2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(e.lute.HTML2VditorDOM(f.innerHTML),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),ti(e,e.lute.HTML2Md(f.innerHTML).trimRight())),e.outline.render(e),[3,10];case 5:if(!(i.length>0))return[3,9];if(!(e.options.upload.url||e.options.upload.handler))return[3,7];return[4,tb(e,i)];case 6:return y.sent(),[3,8];case 7:m=new FileReader,"clipboardData"in t?v=(i=t.clipboardData.files)[0]:t.dataTransfer.types.includes("Files")&&(v=(i=t.dataTransfer.items)[0].getAsFile()),v&&v.type.startsWith("image")&&(m.readAsDataURL(v),m.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'.concat(v.name,'" src="').concat(m.result.toString(),'">\n'):t+=".concat(m.result.toString(),")\n"),document.execCommand("insertHTML",!1,t)}),y.label=8;case 8:return[3,10];case 9:""!==o.trim()&&0===i.length&&(""!==(h=(0,ei.zh)(e)).toString()&&e.lute.IsValidLinkDest(o)&&(o="[".concat(h.toString(),"](").concat(o,")")),"ir"===e.currentMode?(a.Md2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(Lute.Sanitize(e.lute.Md2VditorIRDOM(o)),e)):"wysiwyg"===e.currentMode?(a.Md2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(Lute.Sanitize(e.lute.Md2VditorDOM(o)),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),ti(e,o)),e.outline.render(e)),y.label=10;case 10:return"sv"!==e.currentMode&&((g=(0,V.F9)((0,ei.zh)(e).startContainer))&&(h=(0,ei.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),h.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?g.outerHTML=e.lute.SpinVditorDOM(g.outerHTML):g.outerHTML=e.lute.SpinVditorIRDOM(g.outerHTML),(0,ei.ib)(e[e.currentMode].element,h)),e[e.currentMode].element.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){eo(t,e)})),e.wysiwyg.triggerRemoveComment(e),tR(e),e[e.currentMode].element.scrollHeight-c>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&tn(e),[2]}})})},t0=function(e,t,n){return tw(void 0,void 0,void 0,function(){var r,o,i,a,l,s,c,d,u,p,f,m,v,h;return tk(this,function(g){switch(g.label){case 0:if(!n)return[2];if(o=RegExp("(?:("+(r=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/).source+"))([\\da-fA-F\\s]+)\\}","g"),i=n.match(o),a=[],i)for(l=0,s=i;l<s.length;l++)c=s[l],d=void 0,c.includes("\\pngblip")?d="image/png":c.includes("\\jpegblip")&&(d="image/jpeg"),d&&a.push({hex:c.replace(r,"").replace(/[^\da-fA-F]/g,""),type:d});for(u=[],t1(t,function(e){if("V:SHAPE"===e.tagName)return t1(e,function(t){"V:IMAGEDATA"===t.tagName&&u.push({shape:e,img:t})}),!1}),p=0;p<u.length;p++)(f=document.createElement("img")).src="data:"+a[p].type+";base64,"+btoa((a[p].hex.match(/\w{2}/g)||[]).map(function(e){return String.fromCharCode(parseInt(e,16))}).join("")),f.title=u[p].img.getAttribute("title"),u[p].shape.parentNode.replaceChild(f,u[p].shape);m=t.querySelectorAll("img"),p=0,g.label=1;case 1:if(!(p<m.length))return[3,4];if(!(v=m[p].src||""))return[3,3];return h=m[p],[4,e.options.upload.base64ToLink(v)];case 2:h.src=g.sent(),g.label=3;case 3:return p++,[3,1];case 4:return[2]}})})},t1=function(e,t){if(!1!==t(e))for(var n=0;n<e.children.length;n++)t1(e.children[n],t)},t2=function(e){e.hint.render(e);var t,n,r=(0,ei.zh)(e).startContainer,o=(0,V.a1)(r,"data-type","code-block-info");if(o)if(""===o.textContent.replace(M.g.ZWSP,"")&&e.hint.recentLanguage)o.textContent=M.g.ZWSP+e.hint.recentLanguage,(0,ei.zh)(e).selectNodeContents(o);else{var i=[],a=o.textContent.substring(0,(0,ei.im)(o,e.ir.element).start).replace(M.g.ZWSP,"");(e.options.preview.hljs.langs||M.g.ALIAS_CODE_LANGUAGES.concat((null!=(n=null==(t=window.hljs)?void 0:t.listLanguages())?n:[]).sort())).forEach(function(e){e.indexOf(a.toLowerCase())>-1&&i.push({html:e,value:e})}),e.hint.genHTML(i,a,e)}},t6=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&t2(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=A(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,N.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},t3=function(e,t){var n=(0,ei.zh)(e),r=(0,V.F9)(n.startContainer)||n.startContainer;if(r){var o=r.querySelector(".vditor-ir__marker--heading");o?o.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),ec(e,n.cloneRange()),eT(e)}},t5=function(e,t,n){var r=(0,V.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var o=document.createElement("div");o.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=o.firstElementChild.innerHTML.trim()}},t4=function(e,t,n,r){var o=(0,ei.zh)(e),i=t.getAttribute("data-type"),a=o.startContainer;3===a.nodeType&&(a=a.parentElement);var l=!0;if(t.classList.contains("vditor-menu--current"))if("quote"===i){var s=(0,V.lG)(a,"BLOCKQUOTE");s&&(o.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'.concat(s.innerHTML,"</p>"):s.innerHTML)}else if("link"===i){var c=(0,V.a1)(o.startContainer,"data-type","a");if(c){var d=(0,V.fb)(o.startContainer,"vditor-ir__link");d?(o.insertNode(document.createElement("wbr")),c.outerHTML=d.innerHTML):c.outerHTML=c.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===i?t5(o,e,"em"):"bold"===i?t5(o,e,"strong"):"strike"===i?t5(o,e,"s"):"inline-code"===i?t5(o,e,"code"):("check"===i||"list"===i||"ordered-list"===i)&&(tO(e,o,i),l=!1,t.classList.remove("vditor-menu--current"));else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,ei.ib)(e.ir.element,o));var u=(0,V.F9)(o.startContainer);if("line"===i){if(u){var p='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===u.innerHTML.trim()?u.outerHTML=p:u.insertAdjacentHTML("afterend",p)}}else if("quote"===i)u&&(o.insertNode(document.createElement("wbr")),u.outerHTML='<blockquote data-block="0">'.concat(u.outerHTML,"</blockquote>"),l=!1,t.classList.add("vditor-menu--current"));else if("link"===i){var f=void 0;f=""===o.toString()?"".concat(n,"<wbr>").concat(r):"".concat(n).concat(o.toString()).concat(r.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,f),l=!1,t.classList.add("vditor-menu--current")}else if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i){var f=void 0;""===o.toString()?f="".concat(n,"<wbr>").concat(r):(f="code"===i?"".concat(n,"\n").concat(o.toString(),"<wbr>").concat(r):"table"===i?"".concat(n).concat(o.toString(),"<wbr>").concat(r):"".concat(n).concat(o.toString()).concat(r,"<wbr>"),o.deleteContents()),("table"===i||"code"===i)&&(f="\n"+f+"\n\n");var m=document.createElement("span");m.innerHTML=f,o.insertNode(m),ec(e,o),"table"===i&&(o.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,ei.Hc)(o))}else("check"===i||"list"===i||"ordered-list"===i)&&(tO(e,o,i,!1),l=!1,D(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,ei.ib)(e.ir.element,o),t6(e),l&&eT(e)},t8=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},t9=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r=decodeURIComponent(e.getAttribute("data-value")),o=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var i=(0,V.a1)(o.startContainer,"data-type","code-block-info");if(i){i.textContent=M.g.ZWSP+r.trimRight(),o.selectNodeContents(i),o.collapse(!1),t6(n),i.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+r.trimRight()}),eo(i.parentElement.querySelector(".vditor-ir__preview"),n),t.recentLanguage=r.trimRight();return}}if("wysiwyg"===n.currentMode&&3!==o.startContainer.nodeType){var a=o.startContainer,l=void 0;if((l=a.classList.contains("vditor-input")?a:a.firstElementChild)&&l.classList.contains("vditor-input")){l.value=r.trimRight(),o.selectNodeContents(l),o.collapse(!1),l.dispatchEvent(new CustomEvent("input",{detail:1})),t.recentLanguage=r.trimRight();return}}if(o.setStart(o.startContainer,t.lastIndex),o.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,ei.oC)(n.lute.SpinVditorSVDOM(r),n):"wysiwyg"===n.currentMode?(0,ei.oC)(n.lute.SpinVditorDOM(r),n):(0,ei.oC)(n.lute.SpinVditorIRDOM(r),n):(0,ei.oC)(r,n),":"===t.splitChar&&r.indexOf(":")>-1&&"sv"!==n.currentMode&&o.insertNode(document.createTextNode(" ")),o.collapse(!1),(0,ei.Hc)(o),"wysiwyg"===n.currentMode){var s=(0,V.fb)(o.startContainer,"vditor-wysiwyg__block");s&&s.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(s.lastElementChild.innerHTML=s.firstElementChild.innerHTML,eo(s.lastElementChild,n))}else if("ir"===n.currentMode){var s=(0,V.fb)(o.startContainer,"vditor-ir__marker--pre");s&&s.nextElementSibling.classList.contains("vditor-ir__preview")&&(s.nextElementSibling.innerHTML=s.innerHTML,eo(s.nextElementSibling,n))}tR(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t,n=this;if(window.getSelection().focusNode){var r=getSelection().getRangeAt(0);t=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(t,e.options.hint.extend);if(void 0===o)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var i=""===o?e.options.hint.emoji:e.lute.GetEmojis(),a=[];Object.keys(i).forEach(function(e){0===e.indexOf(o.toLowerCase())&&(i[e].indexOf(".")>-1?a.push({html:'<img src="'.concat(i[e],'" title=":').concat(e,':"/> :').concat(e,":"),value:":".concat(e,":")}):a.push({html:'<span class="vditor-hint__emoji">'.concat(i[e],"</span>").concat(e),value:i[e]}))}),this.genHTML(a,o,e)}else e.options.hint.extend.forEach(function(t){t.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){var r,i,a;return r=void 0,i=void 0,a=function(){var n;return t8(this,function(r){switch(r.label){case 0:return n=this.genHTML,[4,t.hint(o)];case 1:return n.apply(this,[r.sent(),o,e]),[2]}})},new(i||(i=Promise))(function(e,t){function o(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(o,l)}s((a=a.apply(n,r||[])).next())})},e.options.hint.delay))})}},e.prototype.genHTML=function(e,t,n){var r=this;if(0===e.length){this.element.style.display="none";return}var o=n[n.currentMode].element,i=(0,ei.Ny)(o),a=i.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),l=i.top,s="";e.forEach(function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var o=r.lastIndexOf(">")+1,i=r.substr(o),a=i.toLowerCase().indexOf(t.toLowerCase());a>-1&&(i=i.substring(0,a)+"<b>"+i.substring(a,a+t.length)+"</b>"+i.substring(a+t.length),r=r.substr(0,o)+i)}s+='<button type="button" data-value="'.concat(encodeURIComponent(e.value),' "\n').concat(0===n?"class='vditor-hint--current'":"","> ").concat(r,"</button>")}}),this.element.innerHTML=s;var c=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(l+(c||22),"px"),this.element.style.left="".concat(a,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(e){e.addEventListener("click",function(t){r.fillEmoji(e,n),t.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(l-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},e.prototype.select=function(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!(0,N.yl)(e)&&!e.shiftKey&&!e.altKey&&"Enter"===e.key&&!e.isComposing&&(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),!0)},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach(function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)}),-1===this.lastIndex)return n;var o=e.split(this.splitChar),i=o[o.length-1];if(o.length>1&&i.trim()===i)if(2===o.length&&""===o[0]&&o[1].length<32)n=o[1];else{var a=o[o.length-2].slice(-1);" "===(0,C.X)(a)&&i.length<32&&(n=i)}return n},e}(),t7=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>'),this.element=t.firstElementChild,this.bindEvent(e),e4(e,this.element),e8(e,this.element),e9(e,this.element),tr(e,this.element),to(e,this.element),e7(e,this.element),te(e,this.element,this.copy),tt(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tQ(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){B(e,["hint"])}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,N.vU)()||ec(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput){t.preventInput=!1,t6(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||ec(e,getSelection().getRangeAt(0).cloneRange(),!1,n)}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,t6(e);return}var r=(0,ei.zh)(e),o=(0,V.fb)(n.target,"vditor-ir__preview");if(o||(o=(0,V.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,ei.Hc)(r),tn(e)),"IMG"===n.target.tagName){var i=n.target.parentElement.querySelector(".vditor-ir__marker--link");i&&(r.selectNode(i),(0,ei.Hc)(r))}var a=(0,V.a1)(n.target,"data-type","a");if(a&&!a.classList.contains("vditor-ir__node--expand"))return void(e.options.link.click?e.options.link.click(a.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(a.querySelector(":scope > .vditor-ir__marker--link").textContent));if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var l=t.element.lastElementChild.getBoundingClientRect();n.y>l.top+l.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(M.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(t.element,r)))}""===r.toString()?ef(r,e):setTimeout(function(){ef((0,ei.zh)(e),e)}),el(n,e),eT(e)}),this.element.addEventListener("keyup",function(n){if(!(n.isComposing||(0,N.yl)(n))){if("Enter"===n.key&&tn(e),eT(e),("Backspace"===n.key||"Delete"===n.key)&&""!==e.ir.element.innerHTML&&1===e.ir.element.childNodes.length&&e.ir.element.firstElementChild&&"P"===e.ir.element.firstElementChild.tagName&&0===e.ir.element.firstElementChild.childElementCount&&(""===e.ir.element.textContent||"\n"===e.ir.element.textContent)){e.ir.element.innerHTML="";return}var r=(0,ei.zh)(e);"Backspace"===n.key?((0,N.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",ef(r,e)),t.element.querySelectorAll(".language-math").forEach(function(e){var t=e.querySelector("br");t&&t.remove()})):n.key.indexOf("Arrow")>-1?(("ArrowLeft"===n.key||"ArrowRight"===n.key)&&t2(e),ef(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&ef(r,e);var o=(0,V.fb)(r.startContainer,"vditor-ir__preview");if(o){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===o.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===o.parentElement.getAttribute("data-type")?(o.parentElement.insertAdjacentText("afterend",M.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}})},e}(),ne=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(A(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},nt=n(214),nn=n(436),nr=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(e,'</div>\n<div class="vditor-outline__content"></div>')}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,nn.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,nn.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);var r,o=null==(r=e.toolbar.elements.outline)?void 0:r.firstElementChild;if(t&&window.innerWidth>=M.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==o||o.classList.add("vditor-menu--current")):(this.element.style.display="none",null==o||o.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var i=getSelection().getRangeAt(0);e[e.currentMode].element.contains(i.startContainer)&&(0,ei.Hc)(i)}eE(e)},e}(),no=n(280),ni=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}}),this.previewElement.addEventListener("click",function(n){var r=(0,V.lG)(n.target,"SPAN");if(r&&(0,V.fb)(r,"vditor-toc")){var o=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));o&&(t.element.scrollTop=o.offsetTop);return}if("A"===n.target.tagName){e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),n.preventDefault();return}"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,ev.E)(n.target,e.options.lang,e.options.theme))}),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],i=0;i<n.length;i++){var a=n[i];if("object"==typeof a){o.push('<button type="button" data-type="'.concat(a.key,'" class="').concat(a.className,'"').concat(a.tooltip?' aria-label="'.concat(a.tooltip,'"'):"",'">').concat(a.text,"</button>"));continue}switch(a){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}}r.innerHTML=o.join(""),r.addEventListener((0,N.Le)(),function(o){var i=(0,U.S)(o.target,"BUTTON");if(i){var a=i.getAttribute("data-type"),l=n.find(function(e){return(null==e?void 0:e.key)===a});if(l)return void l.click(a);if("mp-wechat"===a||"zhihu"===a)return void t.copyToX(e,t.previewElement.cloneNode(!0),a);"desktop"===a?t.previewElement.style.width="auto":"tablet"===a?t.previewElement.style.width="780px":t.previewElement.style.width="360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),i.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"===this.element.style.display){"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide();return}if(t){this.previewElement.innerHTML=t;return}if(""===A(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){this.previewElement.innerHTML="";return}var r=new Date().getTime(),o=A(e);this.mdTimeoutId=window.setTimeout(function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE)if(200===t.status){var i=JSON.parse(t.responseText);if(0!==i.code)return void e.tip.show(i.msg);e.options.preview.transform&&(i.data=e.options.preview.transform(i.data)),n.previewElement.innerHTML=i.data,n.afterRender(e,r)}else{var a=e.lute.Md2HTML(o);e.options.preview.transform&&(a=e.options.preview.transform(a)),n.previewElement.innerHTML=a,n.afterRender(e,r)}},t.send(JSON.stringify({markdownText:o}))}else{var i=e.lute.Md2HTML(o);e.options.preview.transform&&(i=e.options.preview.transform(i)),n.previewElement.innerHTML=i,n.afterRender(e,r)}},e.options.preview.delay)},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=new Date().getTime()-t;new Date().getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,K.O)(e.preview.previewElement,e.options.preview.hljs),(0,X.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,$.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,Q.K)(e.preview.previewElement,e.options.cdn),(0,en.J)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,J.P)(e.preview.previewElement,e.options.cdn),(0,Z.v)(e.preview.previewElement,e.options.cdn),(0,G.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,ee.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,et.B)(e.preview.previewElement,e.options.cdn),(0,W.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,no.Y)(e.preview.previewElement),e.options.customRenders.forEach(function(t){t.render(e.preview.previewElement,e)});var o=e.preview.element,i=e.outline.render(e);""===i&&(i="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=i,(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),(0,Y.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(e.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,ei.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到".concat("zhihu"===n?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},e}(),na=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(e.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",function(n){var r=document,o=n.clientY,i=e.element.offsetHeight,a=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(a,i+(o-t.clientY))+"px":e.element.style.height=Math.max(a,i+(t.clientY-o))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-i),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}})},e}(),nl=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),e4(e,this.element),e9(e,this.element),tr(e,this.element),to(e,this.element),e7(e,this.element),te(e,this.element,this.copy),tt(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",e5(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tQ(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,o=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),i=e.preview.element;n/r>.5?i.scrollTop=(n+r)*i.scrollHeight/o-r:i.scrollTop=n*i.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,N.vU)()||eg(e,n),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data){if(t.preventInput){t.preventInput=!1,tc(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}eg(e,n)}}),this.element.addEventListener("keyup",function(t){if(!(t.isComposing||(0,N.yl)(t))){if(("Backspace"===t.key||"Delete"===t.key)&&""!==e.sv.element.innerHTML&&1===e.sv.element.childNodes.length&&e.sv.element.firstElementChild&&"DIV"===e.sv.element.firstElementChild.tagName&&2===e.sv.element.firstElementChild.childElementCount&&(""===e.sv.element.firstElementChild.textContent||"\n"===e.sv.element.textContent)){e.sv.element.innerHTML="";return}"Enter"===t.key&&tn(e)}})},e}(),ns=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,'\n<div class="vditor-tip__close">X</div></div>'),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,"</div>"),setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),nc=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),I(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",D(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},nd=(t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),nu=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,N.Le)(),function(e){r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?nc("editor",t):nc("both",t)))}),r}return nd(t,e),t}(e1),np=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},nf=n(580),nm=(o=function(e,t){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nv=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return M.g.CODE_THEME.forEach(function(e){a+="<button>".concat(e,"</button>")}),i.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),i.addEventListener((0,N.Le)(),function(e){"BUTTON"===e.target.tagName&&(B(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,nf.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(i),z(t,i,o,n.level),r}return nm(t,e),t}(e1),nh=(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ng=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return Object.keys(t.options.preview.theme.list).forEach(function(e){a+='<button data-type="'.concat(e,'">').concat(t.options.preview.theme.list[e],"</button>")}),i.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),i.addEventListener((0,N.Le)(),function(e){"BUTTON"===e.target.tagName&&(B(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,ey.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(i),z(t,i,o,n.level),r}return nh(t,e),t}(e1),nb=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(n,"/").concat(e.options.counter.max)):this.element.innerHTML="".concat(n),this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),ny=(a=function(e,t){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nw=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(M.g.CLASS_MENU_DISABLED)||n.click(e,t)}),r}return ny(t,e),t}(e1),nk=(l=function(e,t){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nE=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,N.Le)(),function(e){var n=r.element.firstElementChild;n.classList.contains(M.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",eE(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",eE(t),t.devtools.renderEchart(t)))}),r}return nk(t,e),t}(e1),nx=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},nS=(s=function(e,t){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n_=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var i="";return Object.keys(t.options.hint.emoji).forEach(function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?i+='<button data-value=":'.concat(e,': " data-key=":').concat(e,':"><img\ndata-value=":').concat(e,': " data-key=":').concat(e,':" class="vditor-emojis__icon" src="').concat(n,'"/></button>'):i+='<button data-value="'.concat(n,' "\n data-key="').concat(e,'"><span class="vditor-emojis__icon">').concat(n,"</span></button>")}),o.innerHTML='<div class="vditor-emojis" style="max-height: '.concat("auto"===t.options.height?"auto":t.options.height-80,'px">').concat(i,'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>').concat(t.options.hint.emojiTail||"","</span>\n</div>"),r.element.appendChild(o),z(t,o,r.element.firstElementChild,n.level),r.bindEvent(t),r}return nS(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,N.Le)(),function(n){var r=(0,U.S)(n.target,"BUTTON");if(r){n.preventDefault();var o=r.getAttribute("data-value"),i=(0,ei.zh)(e),a=o;if("wysiwyg"===e.currentMode?a=e.lute.SpinVditorDOM(o):"ir"===e.currentMode&&(a=e.lute.SpinVditorIRDOM(o)),o.indexOf(":")>-1&&"sv"!==e.currentMode){var l=document.createElement("div");l.innerHTML=a,a=l.firstElementChild.firstElementChild.outerHTML+" ",(0,ei.oC)(a,e)}else i.extractContents(),i.insertNode(document.createTextNode(o)),(0,V.F9)(i.startContainer)||eD(e,i);i.collapse(!1),(0,ei.Hc)(i),t.element.lastElementChild.style.display="none",tR(e)}}),this.element.lastElementChild.addEventListener("mouseover",function(e){var n=(0,U.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))})},t}(e1),nT=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},nL=function(e){var t=A(e);nT(e,t,t.substr(0,10)+".md")},nM=function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "').concat(e.options.cdn,'",\n markdown: {\n theme: ').concat(JSON.stringify(e.options.preview.theme),'\n },\n hljs: {\n style: "').concat(e.options.preview.hljs.style,'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>')),t.contentDocument.close(),setTimeout(function(){t.contentWindow.postMessage(A(e),"*")},200)},nC=function(e){var t=ne(e),n='<html><head><link rel="stylesheet" type="text/css" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,"/dist/js/i18n/").concat(e.options.lang,'.js"><\/script>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">').concat(t,"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('").concat(e.options.preview.theme.current,"', '").concat(e.options.preview.theme.path,"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender(").concat(JSON.stringify(e.options.preview.hljs),", previewElement, '").concat(e.options.cdn,"');\n Vditor.mathRender(previewElement, {\n cdn: '").concat(e.options.cdn,"',\n math: ").concat(JSON.stringify(e.options.preview.math),",\n });\n Vditor.mermaidRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.SMILESRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.markmapRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.flowchartRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.graphvizRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.chartRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.mindmapRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.abcRender(previewElement, '").concat(e.options.cdn,"');\n ").concat(e.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="').concat(e.options.cdn,"/dist/js/icons/").concat(e.options.icon,'.js"><\/script></body></html>');nT(e,n,t.substr(0,10)+".html")},nA=(c=function(e,t){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nO=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");return i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',i.addEventListener((0,N.Le)(),function(e){var n=e.target;if("BUTTON"===n.tagName){switch(n.getAttribute("data-type")){case"markdown":nL(t);break;case"pdf":nM(t);break;case"html":nC(t)}B(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),r.element.appendChild(i),z(t,i,o,n.level),r}return nA(t,e),t}(e1),nH=(d=function(e,t){return(d=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nN=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return nH(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,N.Le)(),function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__".concat(e.tipPosition))}))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),eE(e),ex(e)})},t}(e1),nD=(u=function(e,t){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nI=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,N.ns)("<⌥⌘1>"),'</button>\n<button data-tag="h2" data-value="## ">').concat(window.VditorI18n.heading2," <").concat((0,N.ns)("⌥⌘2"),'></button>\n<button data-tag="h3" data-value="### ">').concat(window.VditorI18n.heading3," <").concat((0,N.ns)("⌥⌘3"),'></button>\n<button data-tag="h4" data-value="#### ">').concat(window.VditorI18n.heading4," <").concat((0,N.ns)("⌥⌘4"),'></button>\n<button data-tag="h5" data-value="##### ">').concat(window.VditorI18n.heading5," <").concat((0,N.ns)("⌥⌘5"),'></button>\n<button data-tag="h6" data-value="###### ">').concat(window.VditorI18n.heading6," <").concat((0,N.ns)("⌥⌘6"),"></button>"),r.element.appendChild(o),r._bindEvent(t,o),r}return nD(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,N.Le)(),function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(M.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(ej(e),eL(e)):"ir"===e.currentMode&&t3(e,""),n.classList.remove("vditor-menu--current")):(B(e,["subToolbar"]),t.style.display="block"))});for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,N.Le)(),function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(eI(e,r.target.getAttribute("data-tag")),eL(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(t3(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):td(e,r.target.getAttribute("data-value")),t.style.display="none"})},t}(e1),nj=(p=function(e,t){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nR=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),r}return nj(t,e),t}(e1),nP=(f=function(e,t){return(f=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nq=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,ei.zh)(t),o=(0,V.lG)(n.startContainer,"LI");o&&tH(t,o,n)}}),r}return nP(t,e),t}(e1),nB=(m=function(e,t){return(m=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nz=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div> </div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'.concat(M.H," / Lute v").concat(Lute.Version,'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>'),0)}),r}return nB(t,e),t}(e1),nV=(v=function(e,t){return(v=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nU=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||t_(t,"afterend")}),r}return nV(t,e),t}(e1),nF=(h=function(e,t){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nW=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||t_(t,"beforebegin")}),r}return nF(t,e),t}(e1),nG=(g=function(e,t){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nK=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,ei.zh)(t),o=(0,V.lG)(n.startContainer,"LI");o&&tN(t,o,n,o.parentElement)}}),r}return nG(t,e),t}(e1),nJ=(b=function(e,t){return(b=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nZ=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),r}return nJ(t,e),t}(e1),nX=(y=function(e,t){return(y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nY=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nX(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,N.Le)(),function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(M.g.CLASS_MENU_DISABLED)){var o=M.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),j(e.toolbar.elements,o),e.outline.render(e)):(R(e.toolbar.elements,o),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),B(e,["subToolbar","hint","popover"]),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10)),eE(e)}})},t}(e1),n$=function(){function e(e){if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"u">typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var t,n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var o=44+2*n.length,i=new DataView(new ArrayBuffer(o));this.writeUTFBytes(i,0,"RIFF"),i.setUint32(4,o,!0),this.writeUTFBytes(i,8,"WAVE"),this.writeUTFBytes(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,this.SAMPLE_RATE,!0),i.setUint32(28,2*this.SAMPLE_RATE,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0);var a=2*n.length;this.writeUTFBytes(i,36,"data"),i.setUint32(40,a,!0);for(var l=n.length,s=44,c=0;c<l;c++)i.setInt16(s,32767*n[c],!0),s+=2;return new Blob([i],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE||t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=new Float32Array(Math.round(e.length/n)),o=0,i=0;o<r.length;){for(var a=Math.round((o+1)*n),l=0,s=0,c=i;c<a&&c<e.length;c++)l+=e[c],s++;r[o]=l/s,o++,i=a}return r},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,o=0;o<r;++o){var i=e[o];t.set(i,n),n+=i.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,o=0;o<r;o++)e.setUint8(t+o,n.charCodeAt(o))},e}(),nQ=(w=function(e,t){return(w=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n0=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nQ(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,N.Le)(),function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)){var o=e[e.currentMode].element;if(!t)return void navigator.mediaDevices.getUserMedia({audio:!0}).then(function(r){(t=new n$(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")}).catch(function(){e.tip.show(window.VditorI18n["record-tip"])});t.isRecording?(t.stopRecording(),e.tip.hide(),tb(e,[new File([t.buildWavFileBlob()],"record".concat(new Date().getTime(),".wav"),{type:"video/webm"})]),n.element.children[0].classList.remove("vditor-menu--current")):(e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current"))}})},t}(e1),n1=(k=function(e,t){return(k=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}k(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n2=function(e){function t(t,n){var r=e.call(this,t,n)||this;return R({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),r}return n1(t,e),t}(e1),n6=(E=function(e,t){return(E=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}E(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n3=function(e){function t(t,n){var r=e.call(this,t,n)||this;return R({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),r}return n6(t,e),t}(e1),n5=(x=function(e,t){return(x=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n4=function(e){function t(t,n){var r=e.call(this,t,n)||this,o='<input type="file"';return t.options.upload.multiple&&(o+=' multiple="multiple"'),t.options.upload.accept&&(o+=' accept="'.concat(t.options.upload.accept,'"')),r.element.children[0].innerHTML="".concat(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(o,">"),r._bindEvent(t),r}return n5(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,N.Le)(),function(e){if(t.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)){e.stopPropagation(),e.preventDefault();return}}),this.element.querySelector("input").addEventListener("change",function(n){if(t.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)){n.stopPropagation(),n.preventDefault();return}0!==n.target.files.length&&tb(e,n.target.files,n.target)})},t}(e1),n8=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach(function(n,r){var o=t.genItem(e,n,r);if(t.element.appendChild(o),n.toolbar){var i=document.createElement("div");i.className="vditor-hint vditor-panel--arrow",i.addEventListener((0,N.Le)(),function(e){i.style.display="none"}),n.toolbar.forEach(function(n,o){n.level=2,i.appendChild(t.genItem(e,n,r+o))}),o.appendChild(i),z(e,i,o.children[0],2)}}),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new nb(e),this.element.appendChild(e.counter.element))}return e.prototype.updateConfig=function(e,t){e.options.toolbarConfig=Object.assign({hide:!1,pin:!1},t),e.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),e.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},e.prototype.genItem=function(e,t,n){switch(t.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new e1(e,t);break;case"emoji":r=new n_(e,t);break;case"headings":r=new nI(e,t);break;case"|":r=new nx;break;case"br":r=new np;break;case"undo":r=new n3(e,t);break;case"redo":r=new n2(e,t);break;case"help":r=new nR(e,t);break;case"both":r=new nu(e,t);break;case"preview":r=new nY(e,t);break;case"fullscreen":r=new nN(e,t);break;case"upload":r=new n4(e,t);break;case"record":r=new n0(e,t);break;case"info":r=new nz(e,t);break;case"edit-mode":r=new e3(e,t);break;case"devtools":r=new nE(e,t);break;case"outdent":r=new nK(e,t);break;case"indent":r=new nq(e,t);break;case"outline":r=new nZ(e,t);break;case"insert-after":r=new nU(e,t);break;case"insert-before":r=new nW(e,t);break;case"code-theme":r=new nv(e,t);break;case"content-theme":r=new ng(e,t);break;case"export":r=new nO(e,t);break;default:r=new nw(e,t)}if(r){var r,o=t.name;return("br"===o||"|"===o)&&(o+=n),this.elements[o]=r.element,r.element}},e}(),n9=n(173),n7=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new n9}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?j(e.toolbar.elements,["undo"]):R(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?j(e.toolbar.elements,["redo"]):R(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,B(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(!(0===getSelection().rangeCount||1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,N.vU)()&&"Backspace"===t.key||(0,N.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);(0!==r.length||!(this[e.currentMode].undoStack.length>0))&&(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,R(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&j(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){if(void 0===n&&(n=!1),n){var r,o=this.dmp.patch_deepCopy(e).reverse();o.forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),r=this.dmp.patch_apply(o,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&(t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview")).forEach(function(e){e.parentElement.querySelector(".language-echarts")&&("ir"===t.currentMode?e.parentElement.outerHTML=t.lute.SpinVditorIRDOM(e.parentElement.outerHTML):e.parentElement.outerHTML=t.lute.SpinVditorDOM(e.parentElement.outerHTML))}),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){eo(e,t)})),t[t.currentMode].element.querySelector("wbr"))(0,ei.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),tn(t);else{var i=getSelection().getRangeAt(0);i.setEndBefore(t[t.currentMode].element),i.collapse(!1)}ea(t),tR(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),eY(t),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){eo(e,t)}),this[t.currentMode].undoStack.length>1?j(t.toolbar.elements,["undo"]):R(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?j(t.toolbar.elements,["redo"]):R(t.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(e,t){if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var n,r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}var i=e[e.currentMode].element.cloneNode(!0);i.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='1']")).forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var a=i.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,ei.Hc)(n),a.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),re=n(673),rt=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:M.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"\uD83D\uDC4D","-1":"\uD83D\uDC4E",confused:"\uD83D\uDE15",eyes:"\uD83D\uDC40️",heart:"❤️",rocket:"\uD83D\uDE80️",smile:"\uD83D\uDE04",tada:"\uD83C\uDF89️"},emojiPath:"".concat(M.g.CDN,"/dist/images/emoji"),extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:M.g.HLJS_OPTIONS,markdown:M.g.MARKDOWN_OPTIONS,math:M.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:M.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:0xa00000,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null==(t=null==(e=this.options.preview)?void 0:e.theme)?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null==(o=null==(r=null==(n=this.options.preview)?void 0:n.render)?void 0:r.media)?void 0:o.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null==(i=this.options.hint)?void 0:i.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null==(l=null==(a=this.options.preview)?void 0:a.theme)?void 0:l.path)||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),(null==(s=this.options.hint)?void 0:s.emojiPath)||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji"))));var e,t,n,r,o,i,a,l,s,c=(0,re.T)(this.defaultOptions,this.options);if(c.cache.enable&&!c.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return c},e.prototype.mergeToolbar=function(e){var t=this,n=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return e.forEach(function(e){var o=e;n.forEach(function(t){"string"==typeof e&&t.name===e&&(o=t),"object"==typeof e&&t.name===e.name&&(o=Object.assign({},t,e))}),e.toolbar&&(o.toolbar=t.mergeToolbar(e.toolbar)),r.push(o)}),r},e}(),rn=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="').concat(window.VditorI18n.comment,'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>'),this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),e4(e,this.element),e8(e,this.element),e9(e,this.element),tr(e,this.element),to(e,this.element),e7(e,this.element),te(e,this.element,this.copy),tt(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,o=Lute.NewNodeID(),i=getSelection().getRangeAt(0),a=i.cloneRange(),l=i.extractContents(),s=!1,c=!1;l.childNodes.forEach(function(e,t){var i=!1;if(3===e.nodeType?i=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+o):i=!0,i)if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&a.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===l.childNodes.length-1&&a.endOffset<a.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?s=!0:t===l.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>");else{var d=document.createElement("span");d.classList.add("vditor-comment"),d.setAttribute("data-cmtids",o),e.parentNode.insertBefore(d,e),d.appendChild(e)}});var d=(0,V.F9)(a.startContainer);d&&(n?(d.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===d.textContent.trim().replace(M.g.ZWSP,"")&&s&&d.remove());var u=(0,V.F9)(a.endContainer);u&&(r?(u.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===u.textContent.trim().replace(M.g.ZWSP,"")&&c&&u.remove()),i.insertNode(l),e.options.comment.add(o,i.toString(),t.getComments(e,!0)),eL(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];if(t)return this.commentIds.forEach(function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'.concat(e,'"]')).offsetTop})}),r},e.prototype.triggerRemoveComment=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var t,n=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var r=(t=new Set(this.commentIds),n.filter(function(e){return!t.has(e)}));r.length>0&&e.options.comment.remove(r)}},e.prototype.showComment=function(){var e=(0,ei.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(e.left,"px;display:block;top:").concat(Math.max(-8,e.top-21),"px"))},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,V.lG)(n.startContainer,"CODE"),o=(0,V.lG)(n.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var i="";i="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html","");return}var a=(0,V.lG)(n.startContainer,"A"),l=(0,V.lG)(n.endContainer,"A");if(a&&l&&l.isSameNode(a)){var s=a.getAttribute("title")||"";s&&(s=' "'.concat(s,'"')),e.clipboardData.setData("text/plain","[".concat(n.toString(),"](").concat(a.getAttribute("href")).concat(s,")")),e.clipboardData.setData("text/html","");return}var c=document.createElement("div");c.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(c.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(B(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"!==e.options.height){if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var r=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}return}if(e.options.toolbarConfig.pin){var o=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=o),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(B(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var o=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=o,t.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(t){tQ(e,t,{pasteCode:function(t){var n=(0,ei.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var o=(0,V.a1)(n.startContainer,"data-block","0");o?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,ei.ib)(e.wysiwyg.element,n)}})}),this.element.addEventListener("compositionstart",function(){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){var r=(0,U.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?ea(e):((0,N.vU)()||ty(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput){t.preventInput=!1,eL(e);return}if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)return void eL(e);var r=getSelection().getRangeAt(0),o=(0,V.F9)(r.startContainer);if(o||(eD(e,r),o=(0,V.F9)(r.startContainer)),o){for(var i=(0,ei.im)(o,e.wysiwyg.element,r).start,a=!0,l=i-1;l>o.textContent.substr(0,i).lastIndexOf("\n");l--)if(" "!==o.textContent.charAt(l)&&" "!==o.textContent.charAt(l)){a=!1;break}0===i&&(a=!1);for(var s=!0,l=i-1;l<o.textContent.length;l++)if(" "!==o.textContent.charAt(l)&&"\n"!==o.textContent.charAt(l)){s=!1;break}s&&/^#{1,6} $/.test(o.textContent)&&(s=!1);var c=(0,U.W)(getSelection().getRangeAt(0).startContainer);if(c&&""===c.textContent&&(ea(e),c.remove()),a&&"code-block"!==o.getAttribute("data-type")||s||tj(o.innerHTML)||tI(o.innerHTML)&&o.previousElementSibling){"function"==typeof e.options.input&&e.options.input(A(e));return}"insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&o.previousElementSibling.remove(),ty(e,r,n)}}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){var r=n.target;r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),t.preventInput=!0,getSelection().rangeCount>0&&(0,ei.Hc)(getSelection().getRangeAt(0)),eL(e);return}if("IMG"===n.target.tagName&&!n.target.parentElement.classList.contains("vditor-wysiwyg__preview"))return void("link-ref"===n.target.getAttribute("data-type")?eV(e,n.target):eJ(n,e));var o=(0,V.lG)(n.target,"A");if(o){e.options.link.click?e.options.link.click(o):e.options.link.isOpen&&window.open(o.getAttribute("href")),n.preventDefault();return}var i=(0,ei.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&i.collapsed){var a=t.element.lastElementChild.getBoundingClientRect();n.y>a.top+a.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(M.g.ZWSP,"")?(i.selectNodeContents(t.element.lastElementChild),i.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(t.element,i)))}eB(e);var l=(0,V.fb)(n.target,"vditor-wysiwyg__preview");l||(l=(0,V.fb)((0,ei.zh)(e).startContainer,"vditor-wysiwyg__preview")),l&&eR(l,e),el(n,e)}),this.element.addEventListener("keyup",function(t){if(!(t.isComposing||(0,N.yl)(t))){"Enter"===t.key&&tn(e),("Backspace"===t.key||"Delete"===t.key)&&""!==e.wysiwyg.element.innerHTML&&1===e.wysiwyg.element.childNodes.length&&e.wysiwyg.element.firstElementChild&&"P"===e.wysiwyg.element.firstElementChild.tagName&&0===e.wysiwyg.element.firstElementChild.childElementCount&&(""===e.wysiwyg.element.textContent||"\n"===e.wysiwyg.element.textContent)&&(e.wysiwyg.element.innerHTML="");var n=(0,ei.zh)(e);if("Backspace"===t.key&&(0,N.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),eD(e,n),eB(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){("ArrowLeft"===t.key||"ArrowRight"===t.key)&&e.hint.render(e);var r=(0,V.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0){var o=n.startContainer;o.classList.contains("vditor-wysiwyg__block")&&(r=o.lastElementChild)}if(r){if("none"===r.previousElementSibling.style.display)return void("ArrowDown"===t.key||"ArrowRight"===t.key?eR(r,e):eR(r,e,!1));var i=r.previousElementSibling;if("PRE"===i.tagName&&(i=i.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var o=r.parentElement,a=eH(o);if(a&&3!==a.nodeType){var l=a.querySelector(".vditor-wysiwyg__preview");if(l)return void eR(l,e)}if(3===a.nodeType){for(;0===a.textContent.length&&a.nextSibling;)a=a.nextSibling;n.setStart(a,1)}else n.setStart(a.firstChild,0)}else n.selectNodeContents(i),n.collapse(!1)}}}})},e}(),rr=(S=function(e,t){return(S=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});let ro=function(e){function t(t,n){var r=e.call(this)||this;if(r.isDestroyed=!1,r.version=M.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor".concat(t)):n.cache={id:"vditor".concat(t)}:n={cache:{id:"vditor".concat(t)}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: ".concat(t)),r;t=document.getElementById(t)}var o=new rt(n).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(t,o);else if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(o.lang)){var i="vditorI18nScript",a=i+o.lang;document.querySelectorAll('head script[id^="'.concat(i,'"]')).forEach(function(e){e.id!==a&&document.head.removeChild(e)}),(0,O.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),a).then(function(){r.init(t,o)}).catch(function(e){r.showErrorTip("GET ".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");return r}return rr(t,e),t.prototype.showErrorTip=function(e){var t=new ns;document.body.appendChild(t.element),t.show(e,0)},t.prototype.updateToolbarConfig=function(e){this.vditor.toolbar.updateConfig(this.vditor,e)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,ew(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,ey.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,nf.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return A(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){B(this.vditor,["subToolbar","hint","popover"]),R(this.vditor.toolbar.elements,M.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){j(this.vditor.toolbar.elements,M.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return"wysiwyg"===this.vditor.currentMode?e5(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?e5(this.vditor.sv.element):"ir"===this.vditor.currentMode?e5(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,ei.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){this.vditor.options.cache.enable&&(0,N.pK)()&&localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return ne(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){nc(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,ei.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&eg(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&ty(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&ec(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.insertMD=function(e){"ir"===this.vditor.currentMode?(0,ei.oC)(this.vditor.lute.Md2VditorIRDOM(e),this.vditor):"wysiwyg"===this.vditor.currentMode?(0,ei.oC)(this.vditor.lute.Md2VditorDOM(e),this.vditor):ti(this.vditor,e),this.vditor.outline.render(this.vditor),tR(this.vditor)},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(e),"</div>"),tc(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?e$(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){eo(e,n.vditor)}),t6(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(B(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&this.clearStack()},t.prototype.insertEmptyBlock=function(e){t_(this.vditor,e)},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),eS(),this.vditor.wysiwyg.unbindListener(),this.vditor.options.after=void 0,this.isDestroyed=!0},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find(function(e,t){if(e===n)return r.splice(t,1),!0}),0===r.length?(e.outerHTML=e.innerHTML,(0,ei.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach(function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)}),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)})}),eL(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.isDestroyed||(this.vditor={currentMode:t.mode,element:e,hint:new t9(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new nr(window.VditorI18n.outline),tip:new ns},this.vditor.sv=new nl(this.vditor),this.vditor.undo=new n7,this.vditor.wysiwyg=new rn(this.vditor),this.vditor.ir=new t7(this.vditor),this.vditor.toolbar=new n8(this.vditor),t.resize.enable&&(this.vditor.resize=new na(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new H),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new tv),(0,O.G)(t._lutePath||"".concat(t.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){n.vditor.lute=(0,nt.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new ni(n.vditor),ek(n.vditor),t.after&&t.after(),t.icon&&(0,O.J)("".concat(t.cdn,"/dist/js/icons/").concat(t.icon,".js"),"vditorIconScript")}))},t}(L.default)})(),r=r.default}()},573:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg=="},26:function(e,t,n){"use strict";n.r(t),n.d(t,{DisplayVditorFieldModel:function(){return m}});var r=n(694),o=n(485),i=n(155),a=n.n(i),l=n(143);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var f=function(e){var t,n=e.value,r=e.markdown,o=e.liquid,a=e.t,l=e.textOnly,d=e.ctx,u=e.overflowMode,p=e.parseLiquid,f=void 0!==p&&p,m=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return s(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),v=m[0],h=m[1];return(0,i.useEffect)(function(){if(n){var e;(e=function(){var e,t,i;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:if(s.trys.push([0,4,,5]),!f)return[3,2];return[4,o.renderWithFullContext(n,d)];case 1:return t=s.sent(),[3,3];case 2:t=n,s.label=3;case 3:return e=t,h(r.render(a(e),{ellipsis:"ellipsis"===u,textOnly:l})),[3,5];case 4:return i=s.sent(),h('<pre style="color:red;"> 渲染错误: '.concat(i.message,"</pre>")),[3,5];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,l,"next",e)}function l(e){c(i,r,o,a,l,"throw",e)}a(void 0)})})()}},[n,l,u]),v},m=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=d(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(e,t||[],d(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&u(n,e),t=[{key:"renderComponent",value:function(e){if(!e)return null;var t=this.context,n=t.markdownVditor,r=t.markdown,o=t.liquid,i=t.t,l=this.props,s=l.textOnly,c=l.overflowMode;return a().createElement(f,{value:e,markdown:n||r,liquid:o,t:i,textOnly:s,ctx:this.context,overflowMode:c})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(o.DisplayTitleFieldModel);m.define({label:(0,l.M)("MarkdownVditor")}),m.registerFlow({key:"markdownVditorSettings",title:(0,l.M)("Content settings"),sort:200,steps:{renderMode:{use:"renderMode"}}}),r.DisplayItemModel.bindModelToInterface("DisplayVditorFieldModel",["vditor","markdown"],{isDefault:!0})},284:function(e,t,n){"use strict";n.r(t),n.d(t,{VditorFieldModel:function(){return c}});var r=n(485),o=n(694),i=n(143);function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var c=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=a(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),t=[{key:"render",value:function(){var e,t;return(this.context.markdownVditor||this.context.markdown).edit((e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},this.props),t=t={mode:this.props.editMode||this.props.mode,enableContextSelect:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.FieldModel);(c=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([(0,o.largeField)()],c)).define({label:(0,i.M)("MarkdownVditor")}),c.registerFlow({key:"markdownVditorEditSettings",title:(0,i.M)("Content settings"),sort:200,steps:{editMode:{title:(0,i.M)("Default Edit Mode"),uiMode:{type:"select",key:"editMode",props:{options:[{label:(0,i.M)("What You See Is What You Get"),value:"wysiwyg"},{label:(0,i.M)("Instant Rendering"),value:"ir"},{label:(0,i.M)("Split View"),value:"sv"}]}},defaultParams:function(e){return{editMode:e.model.props.editMode||e.model.props.mode||"ir"}},handler:function(e,t){e.model.setProps({editMode:t.editMode,mode:t.editMode})}}}}),o.EditableItemModel.bindModelToInterface("VditorFieldModel",["vditor","markdown"],{isDefault:!0})},143:function(e,t,n){"use strict";n.d(t,{M:function(){return a},k:function(){return i}});var r=n(694),o=JSON.parse('{"UU":"@nocobase/plugin-field-markdown-vditor"}');function i(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[o.UU,"client"]},n))}}function a(e){return(0,r.tExpr)(e,{ns:[o.UU,"client"]})}},802:function(e){"use strict";e.exports=r},230:function(t){"use strict";t.exports=e},485:function(e){"use strict";e.exports=n},694:function(e){"use strict";e.exports=t},59:function(e){"use strict";e.exports=i},155:function(e){"use strict";e.exports=o}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,exports:{}};return a[e].call(n.exports,n,n.exports,s),n.exports}s.m=a,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0,s.g.importScripts&&(c=s.g.location+"");var c,d=s.g.document;if(!c&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(c=d.currentScript.src),!c)){var u=d.getElementsByTagName("script");if(u.length)for(var p=u.length-1;p>-1&&(!c||!/^http(s?):/.test(c));)c=u[p--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");s.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.b=document.baseURI||self.location.href;var f={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client-v2/"}s.p=e}(),!function(){"use strict";s.r(f),s.d(f,{MarkdownVditorFieldInterface:function(){return l},default:function(){return et},VditorFieldModel:function(){return c.VditorFieldModel},DisplayVditorFieldModel:function(){return d.DisplayVditorFieldModel}});var e=s(485),t=s(143);function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}var a=["headings","bold","italic","strike","link","list","ordered-list","check","quote","line","code","inline-code","upload","fullscreen"],l=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,o,s;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return o=l,s=arguments,o=r(o),n(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(o,s||[],r(this).constructor):o.apply(this,s)),"name","vditor"),n(e,"type","object"),n(e,"group","media"),n(e,"order",1),n(e,"title","Markdown(Vditor)"),n(e,"sortable",!1),n(e,"default",{interface:"vditor",type:"text",length:"long",uiSchema:{type:"string","x-component":"Input.TextArea"}}),n(e,"availableTypes",["text","json","string"]),n(e,"configure",{items:[{name:"uiSchema.x-component-props.fileCollection",title:(0,t.M)("File collection"),component:"Select",defaultValue:"attachments",description:(0,t.M)("Used to store files uploaded in the Markdown editor (default: attachments)"),schema:{enum:"{{fileCollections}}"}},{name:"uiSchema.x-component-props.toolbar",title:(0,t.M)("Toolbar"),component:"Select",componentProps:{mode:"multiple"},defaultValue:a,options:[{value:"emoji",label:(0,t.M)("Emoji")},{value:"headings",label:(0,t.M)("Headings")},{value:"bold",label:(0,t.M)("Bold")},{value:"italic",label:(0,t.M)("Italic")},{value:"strike",label:(0,t.M)("Strike")},{value:"line",label:(0,t.M)("Line")},{value:"quote",label:(0,t.M)("Quote")},{value:"list",label:(0,t.M)("List")},{value:"ordered-list",label:(0,t.M)("OrderedList")},{value:"check",label:(0,t.M)("Check")},{value:"outdent",label:(0,t.M)("Outdent")},{value:"indent",label:(0,t.M)("Indent")},{value:"code",label:(0,t.M)("Code")},{value:"inline-code",label:(0,t.M)("InlineCode")},{value:"insert-after",label:(0,t.M)("InsertAfter")},{value:"insert-before",label:(0,t.M)("InsertBefore")},{value:"undo",label:(0,t.M)("Undo")},{value:"redo",label:(0,t.M)("Redo")},{value:"upload",label:(0,t.M)("Upload")},{value:"link",label:(0,t.M)("Link")},{value:"record",label:(0,t.M)("Record")},{value:"table",label:(0,t.M)("Table")},{value:"edit-mode",label:(0,t.M)("EditMode")},{value:"both",label:(0,t.M)("Both")},{value:"preview",label:(0,t.M)("Preview")},{value:"fullscreen",label:(0,t.M)("Fullscreen")},{value:"outline",label:(0,t.M)("Outline")}]}]}),n(e,"filterable",{operators:"bigField"}),n(e,"titleUsable",!0),e}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&o(l,e),l}(e.CollectionFieldInterface),c=s(284),d=s(26),u=s(673),p=s.n(u),m=s(598),v=s.n(m),h=s(262),g=s.n(h),b=s(657),y=s.n(b),w=s(738),k=s.n(w),E=s(626),x=s.n(E),S=s(925),_={};_.styleTagTransform=x(),_.setAttributes=y(),_.insert=g().bind(null,"head"),_.domAPI=v(),_.insertStyleElement=k(),p()(S.A,_),S.A&&S.A.locals&&S.A.locals;var T=s(230),L=s(59),M=s(155),C=s.n(M),A=s(131),O=s.n(A),H=s(694),N=function(){var e=(0,H.useFlowContext)().app.pm.get("@nocobase/plugin-field-markdown-vditor");return e.dependencyLoaded||(e.initVditorDependency(),e.dependencyLoaded=!0),e.getCDN()},D=s(802),I="nb-field-markdown-vditor";function j(){var e=L.theme.useToken(),t=e.theme,n=e.token,r=e.hashId,o=(0,D.useStyleRegister)({theme:t,token:n,hashId:r,path:["field-markdown-vditor",I]},function(){var e,t,r;return e={},t=".".concat(I),r={position:"relative",overflow:"visible","&:hover, &:focus-within":{zIndex:1e3},".vditor-reset":{fontSize:"".concat(n.fontSize,"px !important"),color:"unset",padding:"10px !important"},".vditor":{borderRadius:8,overflow:"visible"},".vditor .vditor-content":{borderRadius:"0 0 8px 8px",overflow:"hidden"},".vditor .vditor-toolbar":{position:"relative",overflow:"visible",paddingLeft:" 16px !important",borderRadius:"8px 8px 0 0"},".vditor .vditor-tooltipped:hover, .vditor .vditor-tooltipped:focus, .vditor .vditor-tooltipped:active":{zIndex:1e3},".vditor .vditor-toolbar .vditor-tooltipped__n::after, .vditor .vditor-toolbar .vditor-tooltipped__ne::after, .vditor .vditor-toolbar .vditor-tooltipped__nw::after":{top:"100%",bottom:"auto",marginTop:5,marginBottom:0},".vditor .vditor-toolbar .vditor-tooltipped__n::before, .vditor .vditor-toolbar .vditor-tooltipped__ne::before, .vditor .vditor-toolbar .vditor-tooltipped__nw::before":{top:"auto",bottom:-5,borderTopColor:"transparent",borderBottomColor:"#3b3e43"},".vditor .vditor-content .vditor-ir .vditor-reset":{paddingLeft:" 16px !important"},".vditor-ir pre.vditor-reset":{backgroundColor:"".concat(n.colorBgContainer,"!important")}},t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e});return{wrapSSR:(0,M.useMemo)(function(){return o},[o,t,n,r]),hashId:r,componentCls:I}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var q=function(e){if(e){var t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}};function B(t){var n,r=(0,M.useRef)(null),o=j(),i=o.wrapSSR,a=o.componentCls,l=o.hashId,s=N();return(0,M.useEffect)(function(){var n;O().preview(r.current,null!=(n=t.value)?n:"",{mode:"light",cdn:s,markdown:{sanitize:!0},transform:e.stripMarkdownIframes}).then(function(){return(0,e.removeMarkdownIframes)(r.current)}).catch(function(){return(0,e.removeMarkdownIframes)(r.current)}),setTimeout(function(){var t;(0,e.removeMarkdownIframes)(r.current),null==(t=r.current)||t.querySelectorAll("img").forEach(function(e){e.style.cursor="zoom-in",e.addEventListener("click",function(){var t=e.src;if(!document.getElementById("custom-image-preview")){var n=document.createElement("span");n.id="custom-image-preview",Object.assign(n.style,{position:"fixed",inset:"0",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"9999",cursor:"zoom-out"});var r=document.createElement("img");r.src=t,Object.assign(r.style,{maxWidth:"90%",maxHeight:"90%",borderRadius:"8px",boxShadow:"0 0 20px rgba(0,0,0,0.5)",transition:"transform 0.2s",cursor:"zoom-out"}),n.addEventListener("click",function(){document.body.removeChild(n)}),n.appendChild(r),document.body.appendChild(n)}})})},0)},[t.value,s]),i(C().createElement("span",{className:"".concat(l," ").concat(a)},C().createElement("div",{ref:r,style:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({border:"none"},null!=(n=null==t?void 0:t.style)?n:{})})))}var z=function(t){var n=t.value,r=N(),o=(0,M.useRef)(null),i=P((0,M.useState)(!1),2),a=i[0],l=i[1],s=P((0,M.useState)(!1),2),c=s[0],d=s[1],u=P((0,M.useState)(""),2),p=u[0],f=u[1],m=(0,M.useRef)();(0,M.useEffect)(function(){n&&(t.ellipsis?O().md2html(n,{mode:"light",cdn:r,markdown:{sanitize:!0}}).then(function(t){var n,r,o;f((n=(0,e.stripMarkdownIframes)(t),(r=document.createElement("div")).innerHTML=n,o=r.innerText,r=null,(null==o?void 0:o.replace(/[\n\r]/g,""))||""))}).catch(function(){return f("")}):O().preview(o.current,n,{mode:"light",cdn:r,markdown:{sanitize:!0},transform:e.stripMarkdownIframes}).then(function(){return(0,e.removeMarkdownIframes)(o.current)}).catch(function(){return(0,e.removeMarkdownIframes)(o.current)}))},[n,t.ellipsis,r]);var v=(0,M.useCallback)(function(){var e;return!!m.current&&q(m.current)>(null==(e=m.current)?void 0:e.offsetWidth)},[m]);return t.ellipsis?C().createElement(L.Popover,{open:a,onOpenChange:function(e){l(c&&e)},content:C().createElement(B,{value:n,style:{maxWidth:500,maxHeight:400,overflowY:"auto"}})},C().createElement("div",{ref:m,style:{overflow:"hidden",overflowWrap:"break-word",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-all"},onMouseEnter:function(e){var t=e.target;v()&&d(t.scrollWidth>=t.clientWidth)}},p)):C().createElement(B,{value:n})};function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function U(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}var F=["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"],W=(0,T.connect)(function(n){var r,o,i,l=n.disabled,s=n.onChange,c=n.value,d=n.fileCollection,u=n.toolbar,p=n.editMode,f=n.mode,m=(0,H.useFlowContext)(),v=(0,t.k)(),h=function(e){if(Array.isArray(e))return e}(r=(0,M.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(r)||function(e){if(e){if("string"==typeof e)return V(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V(e,2)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=h[0],b=h[1],y=(0,M.useRef)(),w=(0,M.useRef)(!1),k=(0,M.useRef)(null),E=(0,M.useRef)(null),x=N(),S=j(),_=S.wrapSSR,T=S.hashId,L=S.componentCls,A=(null==(i=m.api)||null==(o=i.auth)?void 0:o.locale)||"en-US",D=m.app.pm.get("@nocobase/plugin-file-manager"),I=(0,M.useRef)(m.t.bind(m));I.current=m.t.bind(m);var R=f||(void 0===p?"ir":p),P=(0,M.useMemo)(function(){var e=A.replace(/-/g,"_");return F.includes(e)?e:"en_US"},[A]);return(0,M.useEffect)(function(){if(k.current){var t=null!=u?u:a,n=(0,e.stripMarkdownIframeTags)(null!=c?c:""),r=new(O())(k.current,{value:n,lang:P,cache:{enable:!1},undoDelay:0,preview:{markdown:{sanitize:!0},math:{engine:"KaTeX"},transform:e.stripMarkdownIframes},toolbar:t,fullscreen:{index:1200},cdn:x,minHeight:200,mode:R,after:function(){y.current=r,b(!0);var e=window.scrollX||window.pageXOffset,t=window.scrollY||window.pageYOffset;requestAnimationFrame(function(){window.scrollTo(e,t)}),l?r.disabled():r.enable()},input:function(t){var n=(0,e.stripMarkdownIframeTags)(t);n!==t&&r.setValue(n),s(n)},upload:{multiple:!1,fieldName:"file",handler:function(e){var t;return(t=function(){var t,n,o,i,a,l,s,c,u,p,f,h,g,b,y,w;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(k){switch(k.label){case 0:return c=e[0],r.focus(),[4,m.api.resource("vditor").check({fileCollectionName:d})];case 1:if(!(null==(u=k.sent().data)||null==(t=u.data)?void 0:t.isSupportToUploadFiles))return r.tip(v("vditor.uploadError.message",{storageTitle:null==u||null==(f=u.data)||null==(p=f.storage)?void 0:p.title}),0),[2];return r.tip(m.t("uploading"),0),[4,D.uploadFile({file:c,fileCollectionName:d,storageId:null==u||null==(o=u.data)||null==(n=o.storage)?void 0:n.id,storageType:null==u||null==(a=u.data)||null==(i=a.storage)?void 0:i.type,storageRules:null==u||null==(s=u.data)||null==(l=s.storage)?void 0:l.rules})];case 2:if(g=(h=k.sent()).data,b=h.errorMessage)return r.tip(I.current(b),3e3),[2];if(!g)return r.tip(v("Response data is empty"),3e3),[2];return y=g.filename,w=g.url,c.type.startsWith("image/")?r.insertValue(".concat(w,")")):r.insertValue("[".concat(y,"](").concat(w,")")),r.tip(v(""),10),[2,null]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){U(i,r,o,a,l,"next",e)}function l(e){U(i,r,o,a,l,"throw",e)}a(void 0)})})()}}}),o=k.current;if(o){var i=new MutationObserver(function(){var e=o.classList.contains("vditor--fullscreen"),t=o.querySelectorAll(".vditor-reset"),n=o.querySelectorAll(".vditor-toolbar");t.forEach(function(t){t.style.padding=e?"10px 200px":""}),n.forEach(function(t){t.style.paddingLeft=e?"200px":""})});return i.observe(o,{attributes:!0,attributeFilter:["class"]}),function(){var e;null==(e=y.current)||e.destroy(),y.current=void 0,i.disconnect()}}}},[null==u?void 0:u.join(","),R]),(0,M.useEffect)(function(){if(g&&y.current){var t=y.current,n=(0,e.stripMarkdownIframeTags)(null!=c?c:"");if(n!==t.getValue()){var r,o,i,a,l=window.scrollX||window.pageXOffset,s=window.scrollY||window.pageYOffset;t.setValue(n);var d=null==(r=k.current)?void 0:r.querySelector("div.vditor-content > div.vditor-ir > pre"),u=null==(o=k.current)?void 0:o.querySelector(".vditor-content"),p=d&&(document.activeElement===d||d.contains(document.activeElement)||(null==(a=document.activeElement)||null==(i=a.closest)?void 0:i.call(a,".vditor-content"))===u);if(d&&p){var f=document.createRange(),m=window.getSelection();m&&(f.selectNodeContents(d),f.collapse(!1),m.removeAllRanges(),m.addRange(f))}p||requestAnimationFrame(function(){window.scrollTo(l,s)})}}},[c,g]),(0,M.useEffect)(function(){g&&y.current&&(l?y.current.disabled():y.current.enable())},[l,g]),(0,M.useEffect)(function(){if(E.current){var e=new MutationObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,l=!0,s=!1,c=void 0;try{for(var d,u=Array.from(a.addedNodes)[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var p,f=d.value;p=HTMLElement,(null!=p&&"u">typeof Symbol&&p[Symbol.hasInstance]?!!p[Symbol.hasInstance](f):f instanceof p)&&f.classList.contains("vditor-img")&&(E.current.appendChild(f),f.style.zIndex=String(2200))}}catch(e){s=!0,c=e}finally{try{l||null==u.return||u.return()}finally{if(s)throw c}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}});return e.observe(document.body,{childList:!0}),function(){e.disconnect()}}},[2200]),(0,M.useLayoutEffect)(function(){var e=k.current;if(e){var t=new ResizeObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a,l=o.value.target;l.className.includes("vditor--fullscreen")?(document.body.appendChild(l),w.current=!0):w.current&&(null==(a=E.current)||a.appendChild(l),w.current=!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}});return t.observe(e),function(){t.unobserve(e)}}},[]),_(C().createElement("div",{ref:E,className:"".concat(T," ").concat(L)},C().createElement("div",{ref:k})))},(0,T.mapReadPretty)(z));function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(){var e;function t(e,n){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");G(this,"app",void 0),G(this,"getPublicPath",void 0),this.app=e,this.getPublicPath=n}return e=[{key:"dependencies",get:function(){return{cdn:this.getCDN()}}},{key:"getCDN",value:function(){return this.app.getCdnUrl()+"static/plugins/@nocobase/plugin-block-markdown/dist/client/vditor"}},{key:"initVditorDependency",value:function(){var e=this,t=this.getCDN();try{var n,r="plugin-field-markdown-vditor-dep",o=(n={},G(n,"".concat(r,".katex"),"".concat(t,"/dist/js/katex/katex.min.js?v=0.16.9")),G(n,"".concat(r,".ABCJS"),"".concat(t,"/dist/js/abcjs/abcjs_basic.min")),G(n,"".concat(r,".plantumlEncoder"),"".concat(t,"/dist/js/plantuml/plantuml-encoder.min")),G(n,"".concat(r,".echarts"),"".concat(t,"/dist/js/echarts/echarts.min")),G(n,"".concat(r,".flowchart"),"".concat(t,"/dist/js/flowchart.js/flowchart.min")),G(n,"".concat(r,".Viz"),"".concat(t,"/dist/js/graphviz/viz")),G(n,"".concat(r,".mermaid"),"".concat(t,"/dist/js/mermaid/mermaid.min")),n);this.app.requirejs.require.config({waitSeconds:120,paths:o}),Object.keys(o).forEach(function(t){e.app.requirejs.require([t],function(e){window[t.split(".")[1]]=e})})}catch(e){console.log("initVditorDependency failed",e)}}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?C().createElement(z,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){G(e,t,n[t])})}return e}({value:e},t)):null}},{key:"edit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return C().createElement(W,e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}();function J(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function Z(e,t,n){return(Z=ee()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&$(o,n.prototype),o}).apply(null,arguments)}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t){return($=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Q(e){var t="function"==typeof Map?new Map:void 0;return(Q=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Z(e,arguments,Y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$(n,e)})(e)}function ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ee=function(){return!!e})()}var et=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=Y(t),X(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ee()?Reflect.construct(t,r||[],Y(this).constructor):t.apply(this,r)),"dependencyLoaded",!1),X(e,"runtime",void 0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&$(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){return e=this,this.runtime=new K(this.app,function(){return e.app.getPublicPath()}),this.app.addComponents({MarkdownVditor:W}),this.app.addFieldInterfaces([l]),this.flowEngine.context.defineProperty("markdownVditor",{get:function(){return e.runtime}}),this.flowEngine.context.defineProperty("markdownVditorDependencies",{get:function(){return e.runtime.dependencies}}),this.flowEngine.registerModelLoaders({VditorFieldModel:{loader:function(){return Promise.resolve().then(s.bind(s,284))}},DisplayVditorFieldModel:{loader:function(){return Promise.resolve().then(s.bind(s,26))}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){J(i,r,o,a,l,"next",e)}function l(e){J(i,r,o,a,l,"throw",e)}a(void 0)})}).call(this)}},{key:"getCDN",value:function(){return this.runtime.getCDN()}},{key:"initVditorDependency",value:function(){return this.runtime.initVditorDependency()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(Q(e.Plugin))}(),f}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@ant-design/cssinjs"),require("react"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-markdown-vditor/client-v2",["@formily/react","@nocobase/flow-engine","@nocobase/client-v2","@ant-design/cssinjs","react","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-field-markdown-vditor/client-v2"]=t(require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@ant-design/cssinjs"),require("react"),require("antd")):e["@nocobase/plugin-field-markdown-vditor/client-v2"]=t(e["@formily/react"],e["@nocobase/flow-engine"],e["@nocobase/client-v2"],e["@ant-design/cssinjs"],e.react,e.antd)}(self,function(e,t,n,r,o,i){return function(){var a={925:function(e,t,n){"use strict";var r=n(168),o=n.n(r),i=n(433),a=n.n(i),l=n(220),s=n.n(l),c=new URL(n(573),n.b),d=a()(o()),u=s()(c);d.push([e.id,'/*!\n * Vditor v3.11.2 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n/*!\n * Vditor v3.11.2 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\n animation-name: tooltip-appear;\n animation-duration: 0.15s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\n animation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: -webkit-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: -moz-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\n animation-duration: 0.15s;\n animation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\n animation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: -webkit-zoom-out;\n cursor: -moz-zoom-out;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url('+u+');\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-smiles,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-math .katex-display > .katex > .katex-html > .tag {\n display: inline-block;\n font-size: 1.21rem;\n right: 2px;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 1em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: normal;\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n\n',""]),t.A=d},433:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]&&(d[1]="@media ".concat(d[2]," {").concat(d[1],"}")),d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},220:function(e){"use strict";e.exports=function(e,t){return(t||(t={}),e&&(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes))?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e}},168:function(e){"use strict";e.exports=function(e){return e[1]}},673:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var l=e[a],s=r.base?l[0]+r.base:l[0],c=o[s]||0,d="".concat(s," ").concat(c);o[s]=c+1;var u=n(d),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var f=function(e,t){var n=t.domAPI(t);return n.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&n.update(e=t):n.remove()}}(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:f,references:1})}i.push(d)}return i}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var l=n(i[a]);t[l].references--}for(var s=r(e,o),c=0;c<i.length;c++){var d=n(i[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=s}}},262:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},738:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},657:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},598:function(e){"use strict";e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){var r,o,i;r="",n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {")),(o=void 0!==n.layer)&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}"),(i=n.sourceMap)&&"u">typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},626:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},131:function(e){e.exports=function(){var e={173:e=>{var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var i=o;if(null==e||null==n)throw Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var a=r,l=this.diff_commonPrefix(e,n),s=e.substring(0,l);e=e.substring(l),n=n.substring(l),l=this.diff_commonSuffix(e,n);var c=e.substring(e.length-l);e=e.substring(0,e.length-l),n=n.substring(0,n.length-l);var d=this.diff_compute_(e,n,a,i);return s&&d.unshift(new t.Diff(0,s)),c&&d.push(new t.Diff(0,c)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(e,n,r,o){if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var i,a=e.length>n.length?e:n,l=e.length>n.length?n:e,s=a.indexOf(l);if(-1!=s)return i=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>n.length&&(i[0][0]=i[2][0]=-1),i;if(1==l.length)return[new t.Diff(-1,e),new t.Diff(1,n)];var c=this.diff_halfMatch_(e,n);if(c){var d=c[0],u=c[1],p=c[2],f=c[3],m=c[4],v=this.diff_main(d,p,r,o),h=this.diff_main(u,f,r,o);return v.concat([new t.Diff(0,m)],h)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,o):this.diff_bisect_(e,n,o)},t.prototype.diff_lineMode_=function(e,n,r){var o=this.diff_linesToChars_(e,n);e=o.chars1,n=o.chars2;var i=o.lineArray,a=this.diff_main(e,n,!1,r);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,c=0,d="",u="";l<a.length;){switch(a[l][0]){case 1:c++,u+=a[l][1];break;case -1:s++,d+=a[l][1];break;case 0:if(s>=1&&c>=1){a.splice(l-s-c,s+c),l=l-s-c;for(var p=this.diff_main(d,u,!1,r),f=p.length-1;f>=0;f--)a.splice(l,0,p[f]);l+=p.length}c=0,s=0,d="",u=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,n,r){for(var o=e.length,i=n.length,a=Math.ceil((o+i)/2),l=2*a,s=Array(l),c=Array(l),d=0;d<l;d++)s[d]=-1,c[d]=-1;s[a+1]=0,c[a+1]=0;for(var u=o-i,p=u%2!=0,f=0,m=0,v=0,h=0,g=0;g<a&&!(new Date().getTime()>r);g++){for(var b=-g+f;b<=g-m;b+=2){for(var y,w=a+b,k=(y=b==-g||b!=g&&s[w-1]<s[w+1]?s[w+1]:s[w-1]+1)-b;y<o&&k<i&&e.charAt(y)==n.charAt(k);)y++,k++;if(s[w]=y,y>o)m+=2;else if(k>i)f+=2;else if(p){var E=a+u-b;if(E>=0&&E<l&&-1!=c[E]){var x=o-c[E];if(y>=x)return this.diff_bisectSplit_(e,n,y,k,r)}}}for(var S=-g+v;S<=g-h;S+=2){for(var x,E=a+S,_=(x=S==-g||S!=g&&c[E-1]<c[E+1]?c[E+1]:c[E-1]+1)-S;x<o&&_<i&&e.charAt(o-x-1)==n.charAt(i-_-1);)x++,_++;if(c[E]=x,x>o)h+=2;else if(_>i)v+=2;else if(!p){var w=a+u-S;if(w>=0&&w<l&&-1!=s[w]){var y=s[w],k=a+y-w;if(y>=(x=o-x))return this.diff_bisectSplit_(e,n,y,k,r)}}}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,o){var i=e.substring(0,n),a=t.substring(0,r),l=e.substring(n),s=t.substring(r),c=this.diff_main(i,a,!1,o),d=this.diff_main(l,s,!1,o);return c.concat(d)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function o(e){for(var t="",o=0,a=-1,l=n.length;a<e.length-1;){-1==(a=e.indexOf("\n",o))&&(a=e.length-1);var s=e.substring(o,a+1);(r.hasOwnProperty?r.hasOwnProperty(s):void 0!==r[s])?t+=String.fromCharCode(r[s]):(l==i&&(s=e.substring(o),a=e.length),t+=String.fromCharCode(l),r[s]=l,n[l++]=s),o=a+1}return t}n[0]="";var i=4e4,a=o(e);return i=65535,{chars1:a,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],o=[],i=0;i<r.length;i++)o[i]=t[r.charCodeAt(i)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(i,o)==t.substring(i,o)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(e.length-o,e.length-i)==t.substring(t.length-o,t.length-i)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var o=Math.min(n,r);if(e==t)return o;for(var i=0,a=1;;){var l=e.substring(o-a),s=t.indexOf(l);if(-1==s)return i;a+=s,(0==s||e.substring(o-a)==t.substring(0,a))&&(i=a,a++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n,r,o,i,a,l=e.length>t.length?e:t,s=e.length>t.length?t:e;if(l.length<4||2*s.length<l.length)return null;var c=this;function d(e,t,n){for(var r,o,i,a,l=e.substring(n,n+Math.floor(e.length/4)),s=-1,d="";-1!=(s=t.indexOf(l,s+1));){var u=c.diff_commonPrefix(e.substring(n),t.substring(s)),p=c.diff_commonSuffix(e.substring(0,n),t.substring(0,s));d.length<p+u&&(d=t.substring(s-p,s)+t.substring(s,s+u),r=e.substring(0,n-p),o=e.substring(n+u),i=t.substring(0,s-p),a=t.substring(s+u))}return 2*d.length>=e.length?[r,o,i,a,d]:null}var u=d(l,s,Math.ceil(l.length/4)),p=d(l,s,Math.ceil(l.length/2));return u||p?(n=p?u&&u[4].length>p[4].length?u:p:u,e.length>t.length?(r=n[0],o=n[1],i=n[2],a=n[3]):(i=n[0],a=n[1],r=n[2],o=n[3]),[r,o,i,a,n[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=0,s=0,c=0,d=0;a<e.length;)0==e[a][0]?(r[o++]=a,l=c,s=d,c=0,d=0,i=e[a][1]):(1==e[a][0]?c+=e[a][1].length:d+=e[a][1].length,i&&i.length<=Math.max(l,s)&&i.length<=Math.max(c,d)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,a=--o>0?r[o-1]:-1,l=0,s=0,c=0,d=0,i=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(-1==e[a-1][0]&&1==e[a][0]){var u=e[a-1][1],p=e[a][1],f=this.diff_commonOverlap_(u,p),m=this.diff_commonOverlap_(p,u);f>=m?(f>=u.length/2||f>=p.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,f))),e[a-1][1]=u.substring(0,u.length-f),e[a+1][1]=p.substring(f),a++):(m>=u.length/2||m>=p.length/2)&&(e.splice(a,0,new t.Diff(0,u.substring(0,m))),e[a-1][0]=1,e[a-1][1]=p.substring(0,p.length-m),e[a+1][0]=-1,e[a+1][1]=u.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),o=n.charAt(0),i=r.match(t.nonAlphaNumericRegex_),a=o.match(t.nonAlphaNumericRegex_),l=i&&r.match(t.whitespaceRegex_),s=a&&o.match(t.whitespaceRegex_),c=l&&r.match(t.linebreakRegex_),d=s&&o.match(t.linebreakRegex_),u=c&&e.match(t.blanklineEndRegex_),p=d&&n.match(t.blanklineStartRegex_);if(u||p)return 5;if(c||d)return 4;if(i&&!l&&s)return 3;if(l||s)return 2;if(i||a)return 1;return 0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var o=e[r-1][1],i=e[r][1],a=e[r+1][1],l=this.diff_commonSuffix(o,i);if(l){var s=i.substring(i.length-l);o=o.substring(0,o.length-l),i=s+i.substring(0,i.length-l),a=s+a}for(var c=o,d=i,u=a,p=n(o,i)+n(i,a);i.charAt(0)===a.charAt(0);){o+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var f=n(o,i)+n(i,a);f>=p&&(p=f,c=o,d=i,u=a)}e[r-1][1]!=c&&(c?e[r-1][1]=c:(e.splice(r-1,1),r--),e[r][1]=d,u?e[r+1][1]=u:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=!1,s=!1,c=!1,d=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(c||d)?(r[o++]=a,l=c,s=d,i=e[a][1]):(o=0,i=null),c=d=!1):(-1==e[a][0]?d=!0:c=!0,i&&(l&&s&&c&&d||i.length<this.Diff_EditCost/2&&l+s+c+d==3)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,i=null,l&&s?(c=d=!0,o=0):(a=--o>0?r[o-1]:-1,c=d=!1),n=!0)),a++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var n,r=0,o=0,i=0,a="",l="";r<e.length;)switch(e[r][0]){case 1:i++,l+=e[r][1],r++;break;case -1:o++,a+=e[r][1],r++;break;case 0:o+i>1?(0!==o&&0!==i&&(0!==(n=this.diff_commonPrefix(l,a))&&(r-o-i>0&&0==e[r-o-i-1][0]?e[r-o-i-1][1]+=l.substring(0,n):(e.splice(0,0,new t.Diff(0,l.substring(0,n))),r++),l=l.substring(n),a=a.substring(n)),0!==(n=this.diff_commonSuffix(l,a))&&(e[r][1]=l.substring(l.length-n)+e[r][1],l=l.substring(0,l.length-n),a=a.substring(0,a.length-n))),r-=o+i,e.splice(r,o+i),a.length&&(e.splice(r,0,new t.Diff(-1,a)),r++),l.length&&(e.splice(r,0,new t.Diff(1,l)),r++),r++):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(r=1;r<e.length-1;)0==e[r-1][0]&&0==e[r+1][0]&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),s=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),s=!0)),r++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,o=0,i=0,a=0;for(n=0;n<e.length&&(1!==e[n][0]&&(r+=e[n][1].length),-1!==e[n][0]&&(o+=e[n][1].length),!(r>t));n++)i=r,a=o;return e.length!=n&&-1===e[n][0]?a:a+(t-i)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,o=/>/g,i=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(n,"&").replace(r,"<").replace(o,">").replace(i,"¶<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case -1:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,o=0;o<e.length;o++){var i=e[o][0],a=e[o][1];switch(i){case 1:n+=a.length;break;case -1:r+=a.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]="+"+encodeURI(e[n][1]);break;case -1:t[n]="-"+e[n][1].length;break;case 0:t[n]="="+e[n][1].length}return t.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,n){for(var r=[],o=0,i=0,a=n.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{r[o++]=new t.Diff(1,decodeURI(s))}catch(e){throw Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var c=parseInt(s,10);if(isNaN(c)||c<0)throw Error("Invalid number in diff_fromDelta: "+s);var d=e.substring(i,i+=c);"="==a[l].charAt(0)?r[o++]=new t.Diff(0,d):r[o++]=new t.Diff(-1,d);break;default:if(a[l])throw Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(i!=e.length)throw Error("Delta length ("+i+") does not equal source text length ("+e.length+").");return r},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw Error("Null input. (match_main)");return(n=Math.max(0,Math.min(n,e.length)),e==t)?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var r,o,i,a=this.match_alphabet_(t),l=this;function s(e,r){var o=e/t.length,i=Math.abs(n-r);return l.Match_Distance?o+i/l.Match_Distance:i?1:o}var c=this.Match_Threshold,d=e.indexOf(t,n);-1!=d&&(c=Math.min(s(0,d),c),-1!=(d=e.lastIndexOf(t,n+t.length))&&(c=Math.min(s(0,d),c)));var u=1<<t.length-1;d=-1;for(var p=t.length+e.length,f=0;f<t.length;f++){for(r=0,o=p;r<o;)s(f,n+o)<=c?r=o:p=o,o=Math.floor((p-r)/2+r);p=o;var m=Math.max(1,n-o+1),v=Math.min(n+o,e.length)+t.length,h=Array(v+2);h[v+1]=(1<<f)-1;for(var g=v;g>=m;g--){var b=a[e.charAt(g-1)];if(0===f?h[g]=(h[g+1]<<1|1)&b:h[g]=(h[g+1]<<1|1)&b|((i[g+1]|i[g])<<1|1)|i[g+1],h[g]&u){var y=s(f,g-1);if(y<=c)if(c=y,(d=g-1)>n)m=Math.max(1,2*n-d);else break}}if(s(f+1,n)>c)break;i=h}return d},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,r=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var i=n.substring(e.start2-o,e.start2);i&&e.diffs.unshift(new t.Diff(0,i));var a=n.substring(e.start2+e.length1,e.start2+e.length1+o);a&&e.diffs.push(new t.Diff(0,a)),e.start1-=i.length,e.start2-=i.length,e.length1+=i.length+a.length,e.length2+=i.length+a.length}},t.prototype.patch_make=function(e,n,r){if("string"==typeof e&&"string"==typeof n&&void 0===r)o=e,(i=this.diff_main(o,n,!0)).length>2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&"object"==typeof e&&void 0===n&&void 0===r)i=e,o=this.diff_text1(i);else if("string"==typeof e&&n&&"object"==typeof n&&void 0===r)o=e,i=n;else if("string"==typeof e&&"string"==typeof n&&r&&"object"==typeof r)o=e,i=r;else throw Error("Unknown call format to patch_make.");if(0===i.length)return[];for(var o,i,a=[],l=new t.patch_obj,s=0,c=0,d=0,u=o,p=o,f=0;f<i.length;f++){var m=i[f][0],v=i[f][1];switch(!s&&0!==m&&(l.start1=c,l.start2=d),m){case 1:l.diffs[s++]=i[f],l.length2+=v.length,p=p.substring(0,d)+v+p.substring(d);break;case -1:l.length1+=v.length,l.diffs[s++]=i[f],p=p.substring(0,d)+p.substring(d+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&i.length!=f+1?(l.diffs[s++]=i[f],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,u),a.push(l),l=new t.patch_obj,s=0,u=p,c=d)}1!==m&&(c+=v.length),-1!==m&&(d+=v.length)}return s&&(this.patch_addContext_(l,u),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=new t.patch_obj;i.diffs=[];for(var a=0;a<o.diffs.length;a++)i.diffs[a]=new t.Diff(o.diffs[a][0],o.diffs[a][1]);i.start1=o.start1,i.start2=o.start2,i.length1=o.length1,i.length2=o.length2,n[r]=i}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,o=[],i=0;i<e.length;i++){var a=e[i].start2+r,l=this.diff_text1(e[i].diffs),s=-1;if(l.length>this.Match_MaxBits?-1!=(d=this.match_main(t,l.substring(0,this.Match_MaxBits),a))&&(-1==(s=this.match_main(t,l.substring(l.length-this.Match_MaxBits),a+l.length-this.Match_MaxBits))||d>=s)&&(d=-1):d=this.match_main(t,l,a),-1==d)o[i]=!1,r-=e[i].length2-e[i].length1;else if(o[i]=!0,r=d-a,u=-1==s?t.substring(d,d+l.length):t.substring(d,s+this.Match_MaxBits),l==u)t=t.substring(0,d)+this.diff_text2(e[i].diffs)+t.substring(d+l.length);else{var c=this.diff_main(l,u,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(c)/l.length>this.Patch_DeleteThreshold)o[i]=!1;else{this.diff_cleanupSemanticLossless(c);for(var d,u,p,f=0,m=0;m<e[i].diffs.length;m++){var v=e[i].diffs[m];0!==v[0]&&(p=this.diff_xIndex(c,f)),1===v[0]?t=t.substring(0,d+p)+v[1]+t.substring(d+p):-1===v[0]&&(t=t.substring(0,d+p)+t.substring(d+this.diff_xIndex(c,f+v[1].length))),-1!==v[0]&&(f+=v[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",o=1;o<=n;o++)r+=String.fromCharCode(o);for(var o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var i=e[0],a=i.diffs;if(0==a.length||0!=a[0][0])a.unshift(new t.Diff(0,r)),i.start1-=n,i.start2-=n,i.length1+=n,i.length2+=n;else if(n>a[0][1].length){var l=n-a[0][1].length;a[0][1]=r.substring(a[0][1].length)+a[0][1],i.start1-=l,i.start2-=l,i.length1+=l,i.length2+=l}if(0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0])a.push(new t.Diff(0,r)),i.length1+=n,i.length2+=n;else if(n>a[a.length-1][1].length){var l=n-a[a.length-1][1].length;a[a.length-1][1]+=r.substring(0,l),i.length1+=l,i.length2+=l}return r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var o=e[r];e.splice(r--,1);for(var i=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,c=!0;for(s.start1=i-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<n-this.Patch_Margin;){var d=o.diffs[0][0],u=o.diffs[0][1];1===d?(s.length2+=u.length,a+=u.length,s.diffs.push(o.diffs.shift()),c=!1):-1===d&&1==s.diffs.length&&0==s.diffs[0][0]&&u.length>2*n?(s.length1+=u.length,i+=u.length,c=!1,s.diffs.push(new t.Diff(d,u)),o.diffs.shift()):(u=u.substring(0,n-s.length1-this.Patch_Margin),s.length1+=u.length,i+=u.length,0===d?(s.length2+=u.length,a+=u.length):c=!1,s.diffs.push(new t.Diff(d,u)),u==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(u.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==p&&(s.length1+=p.length,s.length2+=p.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=p:s.diffs.push(new t.Diff(0,p))),c||e.splice(++r,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split("\n"),o=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<r.length;){var a=r[o].match(i);if(!a)throw Error("Invalid patch string: "+r[o]);var l=new t.patch_obj;for(n.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<r.length;){var s=r[o].charAt(0);try{var c=decodeURI(r[o].substring(1))}catch(e){throw Error("Illegal escape in patch_fromText: "+c)}if("-"==s)l.diffs.push(new t.Diff(-1,c));else if("+"==s)l.diffs.push(new t.Diff(1,c));else if(" "==s)l.diffs.push(new t.Diff(0,c));else if("@"==s)break;else if(""===s);else throw Error('Invalid patch mode "'+s+'" in: '+c);o++}}return n},t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},t.patch_obj.prototype.toString=function(){e=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;for(var e,t,n=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2,r=["@@ -"+e+" +"+n+" @@\n"],o=0;o<this.diffs.length;o++){switch(this.diffs[o][0]){case 1:t="+";break;case -1:t="-";break;case 0:t=" "}r[o+1]=t+encodeURI(this.diffs[o][1])+"\n"}return r.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},408:(e,t,n)=>{"use strict";n.d(t,{default:()=>D});var r=n(135),o=n(840),i=n(775),a=n(428),l=n(325),s=n(483),c=n(999),d=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||!(t.naturalHeight>t.naturalWidth)||!(t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40))||!(t.naturalHeight>window.innerHeight-40)||(e.style.height=window.innerHeight-40+"px"),e.src=t.src}),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach(function(e){e.getAttribute("data-src")&&t(e)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)}))},u=n(472),p=n(280),f=n(637),m=n(825),v=n(11),h=n(194),g=n(436),b=n(229),y=n(145),w=n(538),k=n(413),E=n(106),x=n(673),S=function(e){document.querySelectorAll(".vditor-anchor").forEach(function(t){1===e&&t.classList.add("vditor-anchor--left"),t.onclick=function(){var e=t.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+e).offsetTop;document.querySelector("html").scrollTop=n}}),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}},_=n(214),T=n(810),L=function(e,t){if(void 0===t&&(t="zh_CN"),"u">typeof speechSynthesis&&"u">typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach(function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)}),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',o='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',o='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");i||((i=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",i),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var a=n(),l=new SpeechSynthesisUtterance;l.voice=a,l.onend=l.onerror=function(){i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech")){i.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=o):(speechSynthesis.pause(),i.innerHTML=r)):(l.text=i.getAttribute("data-text"),speechSynthesis.speak(l),i.classList.add("vditor-speech--current"),i.innerHTML=o),(0,T.Hc)(window.vditorSpeechRange),e.focus();return}if(i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r,0!==getSelection().rangeCount){var a=getSelection().getRangeAt(0),s=a.toString().trim();if(s){window.vditorSpeechRange=a.cloneRange();var c=a.getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=c.top+c.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?i.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":i.style.left=t.clientX+2+"px",i.setAttribute("data-text",s)}}})}},M=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},C=function(e){var t,n={anchor:0,cdn:y.g.CDN,customEmoji:{},emojiPath:"".concat(y.g.CDN,"/dist/images/emoji"),hljs:y.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:y.g.MARKDOWN_OPTIONS,math:y.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:y.g.THEME_OPTIONS};return e.cdn&&((null==(t=e.theme)?void 0:t.path)||(n.theme.path="".concat(e.cdn,"/dist/css/content-theme")),e.emojiPath||(n.emojiPath="".concat(e.cdn,"/dist/images/emoji"))),(0,x.T)(n,e)},A=function(e,t){var n=C(t);return(0,k.G)("".concat(n.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var r=(0,_.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.SetHeadingID(!0),r.Md2HTML(e)})},O=function(e,t,n){var o,g,y,x;return o=void 0,g=void 0,y=void 0,x=function(){var o,g,y;return M(this,function(x){switch(x.label){case 0:return[4,A(t,o=C(n))];case 1:if(g=x.sent(),o.transform&&(g=o.transform(g)),e.innerHTML=g,e.classList.add("vditor-reset"),o.i18n)return[3,5];if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(o.lang))return[3,2];throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return y="vditorI18nScript"+o.lang,document.querySelectorAll('head script[id^="'.concat("vditorI18nScript",'"]')).forEach(function(e){e.id!==y&&document.head.removeChild(e)}),[4,(0,k.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),y)];case 3:x.sent(),x.label=4;case 4:return[3,6];case 5:window.VditorI18n=o.i18n,x.label=6;case 6:if(!o.icon)return[3,8];return[4,(0,k.G)("".concat(o.cdn,"/dist/js/icons/").concat(o.icon,".js"),"vditorIconScript")];case 7:x.sent(),x.label=8;case 8:return(0,w.Z)(o.theme.current,o.theme.path),1===o.anchor&&e.classList.add("vditor-reset--anchor"),(0,a.O)(e,o.hljs),(0,c.s)(o.hljs,e,o.cdn),(0,u.H)(e,{cdn:o.cdn,math:o.math}),(0,f.i)(e,o.cdn,o.mode),(0,m.J)(e,o.cdn,o.mode),(0,v.K)(e,o.cdn),(0,l.P)(e,o.cdn),(0,s.v)(e,o.cdn),(0,i.p)(e,o.cdn,o.mode),(0,h.P)(e,o.cdn,o.mode),(0,b.B)(e,o.cdn),(0,r.Q)(e,o.cdn),o.render.media.enable&&(0,p.Y)(e),o.speech.enable&&L(e),0!==o.anchor&&S(o.anchor),o.after&&o.after(),o.lazyLoadImage&&d(e),e.addEventListener("click",function(t){var n=(0,E.lG)(t.target,"SPAN");if(n&&(0,E.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop);return}}),[2]}})},new(y||(y=Promise))(function(e,t){function n(e){try{i(x.next(e))}catch(e){t(e)}}function r(e){try{i(x.throw(e))}catch(e){t(e)}}function i(t){var o;t.done?e(t.value):((o=t.value)instanceof y?o:new y(function(e){e(o)})).then(n,r)}i((x=x.apply(o,g||[])).next())})},H=n(190),N=n(580);let D=function(){function e(){}return e.adapterRender=o,e.previewImage=H.E,e.codeRender=a.O,e.graphvizRender=s.v,e.highlightRender=c.s,e.mathRender=u.H,e.mermaidRender=f.i,e.SMILESRender=m.J,e.markmapRender=v.K,e.flowchartRender=l.P,e.chartRender=i.p,e.abcRender=r.Q,e.mindmapRender=h.P,e.plantumlRender=b.B,e.outlineRender=g.k,e.mediaRender=p.Y,e.speechRender=L,e.lazyLoadImageRender=d,e.md2html=A,e.preview=O,e.setCodeTheme=N.Y,e.setContentTheme=w.Z,e}()},145:(e,t,n)=>{"use strict";n.d(t,{H:()=>r,g:()=>o});var r="3.11.2",o=function(){function e(){}return e.ZWSP="",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atelier-heath","base16/atelier-lakeside","base16/atelier-plateau","base16/atelier-savanna","base16/atelier-seaside","base16/atelier-sulphurpool","base16/atlas","base16/bespin","base16/black-metal","base16/black-metal-bathory","base16/black-metal-burzum","base16/black-metal-dark-funeral","base16/black-metal-gorgoroth","base16/black-metal-immortal","base16/black-metal-khold","base16/black-metal-marduk","base16/black-metal-mayhem","base16/black-metal-nile","base16/black-metal-venom","base16/brewer","base16/bright","base16/brogrammer","base16/brush-trees-dark","base16/chalk","base16/circus","base16/classic-dark","base16/codeschool","base16/colors","base16/danqing","base16/darcula","base16/dark-violet","base16/darkmoss","base16/darktooth","base16/decaf","base16/default-dark","base16/dracula","base16/edge-dark","base16/eighties","base16/embers","base16/equilibrium-dark","base16/equilibrium-gray-dark","base16/espresso","base16/eva","base16/eva-dim","base16/flat","base16/framer","base16/gigavolt","base16/google-dark","base16/grayscale-dark","base16/green-screen","base16/gruvbox-dark-hard","base16/gruvbox-dark-medium","base16/gruvbox-dark-pale","base16/gruvbox-dark-soft","base16/hardcore","base16/harmonic16-dark","base16/heetch-dark","base16/helios","base16/hopscotch","base16/horizon-dark","base16/humanoid-dark","base16/ia-dark","base16/icy-dark","base16/ir-black","base16/isotope","base16/kimber","base16/london-tube","base16/macintosh","base16/marrakesh","base16/materia","base16/material","base16/material-darker","base16/material-palenight","base16/material-vivid","base16/mellow-purple","base16/mocha","base16/monokai","base16/nebula","base16/nord","base16/nova","base16/ocean","base16/oceanicnext","base16/onedark","base16/outrun-dark","base16/papercolor-dark","base16/paraiso","base16/pasque","base16/phd","base16/pico","base16/pop","base16/porple","base16/qualia","base16/railscasts","base16/rebecca","base16/ros-pine","base16/ros-pine-moon","base16/sandcastle","base16/seti-ui","base16/silk-dark","base16/snazzy","base16/solar-flare","base16/solarized-dark","base16/spacemacs","base16/summercamp","base16/summerfruit-dark","base16/synth-midnight-terminal-dark","base16/tango","base16/tender","base16/tomorrow-night","base16/twilight","base16/unikitty-dark","base16/vulcan","base16/windows-10","base16/windows-95","base16/windows-high-contrast","base16/windows-nt","base16/woodland","base16/xcode-dusk","base16/zenburn","codepen-embed","dark","devibeans","far","felipec","github-dark","github-dark-dimmed","gml","gradient-dark","hybrid","ir-black","isbl-editor-dark","kimbie-dark","lioshi","monokai","monokai-sublime","night-owl","nnfx-dark","nord","obsidian","panda-syntax-dark","paraiso-dark","pojoaque","qtcreator-dark","rainbow","shades-of-purple","srcery","stackoverflow-dark","sunburst","tomorrow-night-blue","tomorrow-night-bright","tokyo-night-dark","vs2015","xt256","ant-design","a11y-light","arduino-light","ascetic","atom-one-light","base16/atelier-cave-light","base16/atelier-dune-light","base16/atelier-estuary-light","base16/atelier-forest-light","base16/atelier-heath-light","base16/atelier-lakeside-light","base16/atelier-plateau-light","base16/atelier-savanna-light","base16/atelier-seaside-light","base16/atelier-sulphurpool-light","base16/brush-trees","base16/classic-light","base16/cupcake","base16/cupertino","base16/default-light","base16/dirtysea","base16/edge-light","base16/equilibrium-gray-light","base16/equilibrium-light","base16/fruit-soda","base16/github","base16/google-light","base16/grayscale-light","base16/gruvbox-light-hard","base16/gruvbox-light-medium","base16/gruvbox-light-soft","base16/harmonic16-light","base16/heetch-light","base16/humanoid-light","base16/horizon-light","base16/ia-light","base16/material-lighter","base16/mexico-light","base16/one-light","base16/papercolor-light","base16/ros-pine-dawn","base16/sagelight","base16/shapeshifter","base16/silk-light","base16/solar-flare-light","base16/solarized-light","base16/summerfruit-light","base16/synth-midnight-terminal-light","base16/tomorrow","base16/unikitty-light","base16/windows-10-light","base16/windows-95-light","base16/windows-high-contrast-light","brown-paper","base16/windows-nt-light","color-brewer","docco","foundation","github","googlecode","gradient-light","grayscale","idea","intellij-light","isbl-editor-light","kimbie-light","lightfair","magula","mono-blue","nnfx-light","panda-syntax-light","paraiso-light","purebasic","qtcreator-light","routeros","school-book","stackoverflow-light","tokyo-night-light","vs","xcode","default"],e.ALIAS_CODE_LANGUAGES=["abc","plantuml","mermaid","flowchart","echarts","mindmap","graphviz","math","markmap","smiles","js","ts","html","toml","c#","bat"],e.CDN="https://unpkg.com/vditor@".concat("3.11.2"),e.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(e.CDN,"/dist/css/content-theme")},e}()},825:(e,t,n)=>{"use strict";n.d(t,{J:()=>l});var r=n(145),o=n(413),i=n(840),a=n(494),l=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var l=i.SMILESRenderAdapter.getElements(e);l.length>0&&(0,o.G)("".concat(t,"/dist/js/smiles-drawer/smiles-drawer.min.js?v=2.1.7"),"vditorAbcjsScript").then(function(){var e=new SmiDrawer({},{});l.forEach(function(t){var r=i.SMILESRenderAdapter.getCode(t).trim();if("true"!==t.getAttribute("data-processed")&&""!==r.trim()){var o="smiles"+(0,a.Wb)();t.innerHTML='<svg id="'.concat(o,'"></svg>'),e.draw(r,"#"+o,"dark"===n?"dark":void 0),t.setAttribute("data-processed","true")}})})}},135:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.abcRenderAdapter.getElements(e);n.length>0&&(0,o.G)("".concat(t,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){n.forEach(function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,i.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},840:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mathRenderAdapter:()=>r,SMILESRenderAdapter:()=>o,mermaidRenderAdapter:()=>i,markmapRenderAdapter:()=>a,mindmapRenderAdapter:()=>l,chartRenderAdapter:()=>s,abcRenderAdapter:()=>c,graphvizRenderAdapter:()=>d,flowchartRenderAdapter:()=>u,plantumlRenderAdapter:()=>p});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-smiles")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},a={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},l={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},s={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},u={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},p={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},775:(e,t,n)=>{"use strict";n.d(t,{p:()=>s});var r=n(145),o=n(413),i=n(840),a=n(494),l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=i.chartRenderAdapter.getElements(e);s.length>0&&(0,o.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.forEach(function(e){var t,r,o,s;return t=void 0,r=void 0,o=void 0,s=function(){var t,r,o;return l(this,function(l){switch(l.label){case 0:if(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||!(t=i.chartRenderAdapter.getCode(e).trim()))return[2];l.label=1;case 1:if(l.trys.push([1,3,,4]),"true"===e.getAttribute("data-processed"))return[2];return[4,(0,a.Qf)(t)];case 2:return r=l.sent(),echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true"),[3,4];case 3:return o=l.sent(),e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>".concat(o),[3,4];case 4:return[2]}})},new(o||(o=Promise))(function(e,n){function i(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof o?n:new o(function(e){e(n)})).then(i,a)}l((s=s.apply(t,r||[])).next())})})})}},428:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(105),o=n(145),i=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter(function(t,n){return!(t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.parentElement.classList.contains("vditor-ir__marker--pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.classList.contains("language-smiles")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&n>5)}).forEach(function(e){var n,i,a,l=e.innerText;if(e.classList.contains("highlight-chroma")){var s=e.cloneNode(!0);s.querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),l=s.innerText}else l.endsWith("\n")&&(l=l.substr(0,l.length-1));var c='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(c='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var d=document.createElement("div");d.className="vditor-copy",d.innerHTML='<span aria-label="'.concat((null==(n=window.VditorI18n)?void 0:n.copy)||"复制","\"\nonmouseover=\"this.setAttribute('aria-label', '").concat((null==(i=window.VditorI18n)?void 0:i.copy)||"复制","')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '").concat((null==(a=window.VditorI18n)?void 0:a.copied)||"已复制","');this.previousElementSibling.blur()\">").concat(c,"</span>");var u=document.createElement("textarea");u.value=(0,r.X)(l),d.insertAdjacentElement("afterbegin",u),t&&t.renderMenu&&t.renderMenu(e,d),e.before(d),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(o.g.ZWSP,"</span>"))})}},325:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){n.forEach(function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(i.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}})})}},483:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){n.forEach(function(e){var t=i.graphvizRenderAdapter.getCode(e);if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),o=new Worker(r);new Viz({worker:o}).renderSVGElement(t).then(function(t){e.innerHTML=t.outerHTML}).catch(function(t){e.innerHTML="graphviz render error: <br>".concat(t),e.className="vditor-reset--error"})}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}})})}},999:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(145),o=n(413),i=n(290),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var a=e.style;r.g.CODE_THEME.includes(a)||(a="github");var l=document.getElementById("vditorHljsStyle"),s="".concat(n,"/dist/js/highlight.js/styles/").concat(a,".min.css");l&&l.getAttribute("href")!==s&&l.remove(),(0,i.c)("".concat(n,"/dist/js/highlight.js/styles/").concat(a,".min.css"),"vditorHljsStyle"),!1===e.enable||0!==t.querySelectorAll("pre > code").length&&(0,o.G)("".concat(n,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,o.G)("".concat(n,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){t.querySelectorAll("pre > code").forEach(function(t){if(!(t.parentElement.classList.contains("vditor-ir__marker--pre")||t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-smiles")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))){""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang);var n=t.className.replace("language-","");if(window.hljs.getLanguage(n)||(n="plaintext"),t.innerHTML=window.hljs.highlight(t.textContent,{language:n,ignoreIllegals:!0}).value,t.classList.add("hljs"),e.lineNumber){t.classList.add("vditor-linenumber");var r=t.querySelector(".vditor-linenumber__temp");r||((r=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",r));var o=getComputedStyle(t).whiteSpace,i=!1;("pre-wrap"===o||"pre-line"===o)&&(i=!0);var a="",l=t.textContent.split(/\r\n|\r|\n/g);l.pop(),l.map(function(e){var t="";i&&(r.textContent=e||"\n",t=' style="height:'.concat(r.getBoundingClientRect().height,'px"')),a+="<span".concat(t,"></span>")}),r.style.display="none",a='<span class="vditor-linenumber__rows">'.concat(a,"</span>"),t.insertAdjacentHTML("beforeend",a)}}})})})}},11:(e,t,n)=>{"use strict";n.d(t,{K:()=>c});var r=n(145),o=n(413),i=n(840),a={},l=function(e,t){var n=e.transform(t),r=Object.keys(n.features).filter(function(e){return!a[e]});r.forEach(function(e){a[e]=!0});var o=e.getAssets(r),i=o.styles,l=o.scripts,s=window.markmap;return i&&s.loadCSS(i),l&&s.loadJS(l),n},s=function(e,t){var n=window.markmap,r=n.Transformer,o=n.Markmap,i=n.deriveOptions;n.globalCSS;var a=new r;e.innerHTML='<svg style="width:100%"></svg>';var s=e.firstChild,c=o.create(s,null),d=l(a,t),u=d.root,p=d.frontmatter,f=i(null==p?void 0:p.markmap);c.setData(u,f),c.fit()},c=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.markmapRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){n.forEach(function(e){var t=i.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),s(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}})})}},472:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var r=n(145),o=n(413),i=n(290),a=n(105),l=n(840),s=function(e,t){void 0===e&&(e=document);var n=l.mathRenderAdapter.getElements(e);if(0!==n.length){var s={cdn:r.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},s.math,t.math)),"KaTeX"===(t=Object.assign({},s,t)).math.engine)(0,i.c)("".concat(t.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,o.G)("".concat(t.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,o.G)("".concat(t.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){n.forEach(function(e){if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))&&!e.getAttribute("data-math")){var n=(0,a.X)(l.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))})}})})});else if("MathJax"===t.math.engine){var c=function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var o=e[t++];o===n?o():o(r)};r()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(t.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:t.math.macros}},Object.assign(window.MathJax,t.math.mathJaxOptions)),(0,o.J)("".concat(t.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var d=function(e,t){var n=(0,a.X)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then(function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var o=r.querySelector('[data-mml-node="merror"]');o&&""!==o.textContent.trim()&&(e.innerHTML=o.textContent.trim(),e.className="vditor-reset--error"),t&&t()})};window.MathJax.startup.promise.then(function(){for(var e=[],t=function(t){var r=n[t];!r.parentElement.classList.contains("vditor-wysiwyg__pre")&&!r.parentElement.classList.contains("vditor-ir__marker--pre")&&!r.getAttribute("data-math")&&(0,a.X)(r.textContent).trim()&&e.push(function(e){t===n.length-1?d(r):d(r,e)})},r=0;r<n.length;r++)t(r);c(e)})}}}},280:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var r=n(494),o=function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(t,'"></video>')),e.remove()},i=function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(t,'"></audio>')),e.remove()},a=function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),o=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),l=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),c=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),d=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(n&&11===n[1].length)e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(n[1]+(n[2]?"?start="+n[2]:""),'"></iframe>')),e.remove();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(o[1],'"></iframe>')),e.remove();else if(i&&i[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(i[1],'"></iframe>')),e.remove();else if(a&&a[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'.concat(a[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),e.remove();else if(l&&l[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='.concat(encodeURIComponent(l[0]),'"></iframe>')),e.remove();else if(s&&s[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'.concat(s[2],'"></iframe>')),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||c&&c[1])){var u={bvid:(0,r.on)("bvid",t)||c&&c[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach(function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");u[n[0]]=n[1]}});var p="https://player.bilibili.com/player.html?",f=Object.keys(u);f.forEach(function(e,t){p+="".concat(e,"=").concat(u[e]),t<f.length-1&&(p+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(p,'"></iframe>')),e.remove()}else d&&d[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(d[1],'"></iframe>')),e.remove())},l=function(e){e&&e.querySelectorAll("a").forEach(function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?o(e,t):t.match(/^.+.(mp3|wav|flac)$/)?i(e,t):a(e,t))})}},637:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(145),o=n(413),i=n(840),a=n(494),l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=i.mermaidRenderAdapter.getElements(e);0!==s.length&&(0,o.G)("".concat(t,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),s.forEach(function(e){var t,n,r,o;return t=void 0,n=void 0,r=void 0,o=function(){var t,n,r,o;return l(this,function(l){switch(l.label){case 0:if(t=i.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,a.Wb)(),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return e.innerHTML=l.sent().svg,[3,4];case 3:return r=l.sent(),o=document.querySelector("#"+n),e.innerHTML="".concat(o.outerHTML,'<br>\n<div style="text-align: left"><small>').concat(r.message.replace(/\n/,"<br>"),"</small></div>"),o.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}})},new(r||(r=Promise))(function(e,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,l)}s((o=o.apply(t,n||[])).next())})})})}},194:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.mindmapRenderAdapter.getElements(e);a.length>0&&(0,o.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){a.forEach(function(e){if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))){var t=i.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var n;return(null==(n=null==t?void 0:t.data)?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>".concat(t)}}})})}},436:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(771),o=n(472),i=function(e,t,n){var i="",a=[];if(Array.from(e.children).forEach(function(e,t){if((0,r.W)(e)){if(n){var o=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===o?void 0:o)+"_"+t}a.push(e.id),i+=e.outerHTML.replace("<wbr>","")}}),""===i)return t.innerHTML="","";var l=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?l.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+i),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var s=Lute.New();s.SetToC(!0),l.innerHTML=s.HTML2VditorDOM("<p>[ToC]</p>"+i)}var c=l.firstElementChild.querySelectorAll("li > span[data-target-id]");return(c.forEach(function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML="".concat(n,"<span>").concat(e.innerHTML,"</span>")}else e.innerHTML="<svg></svg><span>".concat(e.innerHTML,"</span>");e.setAttribute("data-target-id",a[t])}),i=l.firstElementChild.innerHTML,0===c.length)?t.innerHTML="":(t.innerHTML=i,n&&(0,o.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",function(r){for(var o=r.target;o&&!o.isEqualNode(t);){if(o.classList.contains("vditor-outline__action")){o.classList.contains("vditor-outline__action--close")?(o.classList.remove("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:block")):(o.classList.add("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(o.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var i=document.getElementById(o.getAttribute("data-target-id"));if(!i)return;if(n)if("auto"===n.options.height){var a=i.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(a+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,a)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=i.offsetTop:e.scrollTop=i.offsetTop;else window.scrollTo(window.scrollX,i.offsetTop);break}o=o.parentElement}})),i}},229:(e,t,n)=>{"use strict";n.d(t,{B:()=>a});var r=n(145),o=n(413),i=n(840),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){n.forEach(function(e){if(!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))){var t=i.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(t),'"/>')}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>".concat(t)}}})})}},214:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},190:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});var r=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var r=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat("dark"===n?" vditor--dark":"",'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n ').concat(window.VditorI18n.spin,"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X ").concat(window.VditorI18n.close,'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: ').concat(e.width,"px;height:").concat(e.height,"px;transform: translate3d(").concat(r.left,"px, ").concat(r.top-36,'px, 0)" src="').concat(e.getAttribute("src"),'">\n </div>\n</div>')),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),i="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-e.naturalHeight)/2,"px, 0)");setTimeout(function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(i)),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)});var a=document.querySelector(".vditor-img__btn");a.addEventListener("click",function(){var t=parseInt(a.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(e.naturalWidth/2-e.naturalHeight/2,"px, 0) rotateZ(").concat(t,"deg)"):o.style.transform="".concat(i," rotateZ(").concat(t,"deg)"),a.setAttribute("data-deg",t.toString()),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)})}},580:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(145),o=n(290),i=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),i="".concat(t,"/dist/js/highlight.js/styles/").concat(e,".min.css");n?n.getAttribute("href")!==i&&(n.remove(),(0,o.c)(i,"vditorHljsStyle")):(0,o.c)(i,"vditorHljsStyle")}},538:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(290),o=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),o="".concat(t,"/").concat(e,".css");n?n.getAttribute("href")!==o&&(n.remove(),(0,r.c)(o,"vditorContentTheme")):(0,r.c)(o,"vditorContentTheme")}}},413:(e,t,n)=>{"use strict";n.d(t,{J:()=>r,G:()=>o});var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},o=function(e,t){return new Promise(function(n,r){if(document.getElementById(t))return n(!0),!1;var o=document.createElement("script");o.src=e,o.async=!0,document.head.appendChild(o),o.onerror=function(e){r(e)},o.onload=function(){if(document.getElementById(t))return o.remove(),n(!0),!1;o.id=t,n(!0)}})}},290:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},105:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){return e.replace(/\u00a0/g," ")}},410:(e,t,n)=>{"use strict";n.d(t,{G6:()=>r,vU:()=>o,pK:()=>i,Le:()=>a,yl:()=>l,ns:()=>s,i7:()=>c});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},o=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},i=function(){try{return"u">typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},l=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!e.metaKey&&!e.ctrlKey:!e.metaKey&&!!e.ctrlKey},s=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&o()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},c=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:(e,t,n)=>{"use strict";n.d(t,{Wb:()=>r,on:()=>o,Qf:()=>i});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},o=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)},i=function(e){return Function('"use strict";return ('.concat(e,")"))()}},106:(e,t,n)=>{"use strict";n.d(t,{JQ:()=>o,E2:()=>i,O9:()=>a,a1:()=>l,F9:()=>s,lG:()=>c,fb:()=>d,DX:()=>u});var r=n(771),o=function(e,t){for(var n=d(e,t),r=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(r=d(n.parentElement,t))?n=r:o=!0;return n||!1},i=function(e,t){for(var n=(0,r.S)(e,t),o=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(o=(0,r.S)(n.parentElement,t))?n=o:i=!0;return n||!1},a=function(e){var t=i(e,"UL"),n=i(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},l=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,o=!1;r&&!o&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?o=!0:r=r.parentElement;return o&&r},s=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=l(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},d=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},u=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},771:(e,t,n)=>{"use strict";n.d(t,{S:()=>r,W:()=>o});var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},o=function(e){var t=r(e,"H");return!!t&&2===t.tagName.length&&"HR"!==t.tagName&&t}},673:(e,t,n)=>{"use strict";n.d(t,{T:()=>r});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},o=0;o<e.length;o++){var i=e[o];for(var a in i)i.hasOwnProperty(a)&&("[object Object]"===Object.prototype.toString.call(i[a])?n[a]=r(n[a],i[a]):n[a]=i[a])}return n}},810:(e,t,n)=>{"use strict";n.d(t,{zh:()=>a,Ny:()=>l,Gb:()=>s,Hc:()=>c,im:()=>d,$j:()=>u,ib:()=>p,oC:()=>f});var r=n(145),o=n(410),i=n(106),a=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},l=function(e){var t,n=window.getSelection().getRangeAt(0);if(!e.contains(n.startContainer)&&!(0,i.fb)(n.startContainer,"vditor-panel--none"))return{left:0,top:0};var r=e.parentElement.getBoundingClientRect();if(0===n.getClientRects().length)if(3===n.startContainer.nodeType){var o=n.startContainer.parentElement;if(!o||!(o.getClientRects().length>0))return{left:0,top:0};t=o.getClientRects()[0]}else{var a=n.startContainer.children;if(a[n.startOffset]&&a[n.startOffset].getClientRects().length>0)t=a[n.startOffset].getClientRects()[0];else if(n.startContainer.childNodes.length>0){var l=n.cloneRange();n.selectNode(n.startContainer.childNodes[Math.max(0,n.startOffset-1)]),t=n.getClientRects()[0],n.setEnd(l.endContainer,l.endOffset),n.setStart(l.startContainer,l.startOffset)}else t=n.startContainer.getClientRects()[0];if(!t){for(var s=n.startContainer.childNodes[n.startOffset];!s.getClientRects||s.getClientRects&&0===s.getClientRects().length;)s=s.parentElement;t=s.getClientRects()[0]}}else t=n.getClientRects()[0];return{left:t.left-r.left,top:t.top-r.top}},s=function(e,t){if(!t)if(0===getSelection().rangeCount)return!1;else t=getSelection().getRangeAt(0);var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},c=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},d=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(s(t,n)){var o=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?o.setStart(e.childNodes[0].childNodes[0],0):o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),r.start=o.toString().length,r.end=r.start+n.toString().length}return r},u=function(e,t,n){var r=0,o=0,i=n.childNodes[o],a=!1,l=!1;e=Math.max(0,e),t=Math.max(0,t);var s=n.ownerDocument.createRange();for(s.setStart(i||n,0),s.collapse(!0);!l&&i;){var d=r+i.textContent.length;if(!a&&e>=r&&e<=d&&(0===e?s.setStart(i,0):3===i.childNodes[0].nodeType?s.setStart(i.childNodes[0],e-r):i.nextSibling?s.setStartBefore(i.nextSibling):s.setStartAfter(i),a=!0,e===t)){l=!0;break}a&&t>=r&&t<=d&&(0===t?s.setEnd(i,0):3===i.childNodes[0].nodeType?s.setEnd(i.childNodes[0],t-r):i.nextSibling?s.setEndBefore(i.nextSibling):s.setEndAfter(i),l=!0),r=d,i=n.childNodes[++o]}return!l&&n.childNodes[o-1]&&s.setStartBefore(n.childNodes[o-1]),c(s),s},p=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling))if(n.previousElementSibling.lastChild){t.setStartBefore(n),t.collapse(!0),c(t),(0,o.i7)()&&("EM"===n.previousElementSibling.tagName||"STRONG"===n.previousElementSibling.tagName||"S"===n.previousElementSibling.tagName)&&(t.insertNode(document.createTextNode(r.g.ZWSP)),t.collapse(!1)),n.remove();return}else t.setStartAfter(n.previousElementSibling);else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),c(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1!==r.length||r[0].previousSibling||r[0].nextSibling||!(t[t.currentMode].element.children.length>0)||"P"!==n.firstElementChild.tagName||(e=r[0].innerHTML.trim());var o=document.createElement("div");o.innerHTML=e;var l=a(t);if(""!==l.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),o.firstElementChild&&"0"===o.firstElementChild.getAttribute("data-block")){o.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var s=(0,i.F9)(l.startContainer);if(s){var d=(0,i.lG)(l.startContainer,"LI");d&&"UL"===o.firstElementChild.tagName?d.insertAdjacentHTML("afterend",o.firstElementChild.innerHTML):s.insertAdjacentHTML("afterend",o.innerHTML)}else t[t.currentMode].element.insertAdjacentHTML("beforeend",o.innerHTML);p(t[t.currentMode].element,l)}else{var u=document.createElement("template");u.innerHTML=e,l.insertNode(u.content.cloneNode(!0)),l.collapse(!1),c(l)}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>ro});var e,t,o,i,a,l,s,c,d,u,p,f,m,v,h,g,b,y,w,k,E,x,S,_,T,L=n(408),M=n(145),C=n(105),A=function(e){return"sv"===e.currentMode?(0,C.X)("".concat(e.sv.element.textContent,"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},O=n(413),H=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(e){var t=this;"block"===e.devtools.element.style.display&&(0,O.G)("".concat(e.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(A(e))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),t.ASTChart.resize()}catch(e){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=e}})},e}(),N=n(410),D=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}})},I=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}})},j=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(M.g.CLASS_MENU_DISABLED)&&n.classList.remove(M.g.CLASS_MENU_DISABLED)}})},R=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(M.g.CLASS_MENU_DISABLED)&&n.classList.add(M.g.CLASS_MENU_DISABLED)}})},P=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="none")})},q=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="block")})},B=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},z=function(e,t,n,r){n.addEventListener((0,N.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(M.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===t.style.display?t.style.display="none":(B(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},V=n(106),U=n(771),F=function(e,t,n,r){r&&console.log("".concat(e," - ").concat(n,": ").concat(t))},W=n(135),G=n(775),K=n(428),J=n(325),Z=n(483),X=n(999),Y=n(472),$=n(637),Q=n(11),ee=n(194),et=n(229),en=n(825),er=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var o=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(o=!0);var i=r.querySelectorAll("pre");if(1===r.childElementCount&&1===i.length&&"vditor-wysiwyg"!==i[0].className&&"vditor-sv"!==i[0].className&&(o=!0),0===e.indexOf('\n<p class="p1">')&&(o=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(o=!0),o){var a=t||e;return/\n/.test(a)||1===i.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(a.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+a.replace(/&/g,"&").replace(/</g,"<")+"\n```":"wysiwyg"===n?"<code>".concat(a.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(a,"`")}return!1},eo=function(e,t){if(e){if("html-block"===e.parentElement.getAttribute("data-type"))return void e.setAttribute("data-render","1");var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,W.Q)(e,t.options.cdn):"mermaid"===n?(0,$.i)(e,t.options.cdn,t.options.theme):"smiles"===n?(0,en.J)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,Q.K)(e,t.options.cdn):"flowchart"===n?(0,J.P)(e,t.options.cdn):"echarts"===n?(0,G.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,ee.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,et.B)(e,t.options.cdn):"graphviz"===n?(0,Z.v)(e,t.options.cdn):"math"===n?(0,Y.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(r){if(r.language===n)return r.render(e,t),!0})||((0,X.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,K.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}},ei=n(810),ea=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=n,(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})}},el=function(e,t){var n=(0,V.lG)(e.target,"SPAN");if(n&&(0,V.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if("auto"===t.options.height){var o=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(o+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop;return}},es=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,ei.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),tR(t),!0;if(tA(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,ei.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),tR(t),!0;if(tC(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var o=(0,V.fb)(r.startContainer,"vditor-toc");if(o)return o.remove(),tR(t),!0}},ec=function(e,t,n,r){void 0===n&&(n=!1);var o,i,a=(0,V.F9)(t.startContainer);if(a&&!n&&"code-block"!==a.getAttribute("data-type")){if(tI(a.innerHTML)&&a.previousElementSibling||tj(a.innerHTML))return;for(var l=(0,ei.im)(a,e.ir.element,t).start,s=!0,c=l-1;c>a.textContent.substr(0,l).lastIndexOf("\n");c--)if(" "!==a.textContent.charAt(c)&&" "!==a.textContent.charAt(c)){s=!1;break}0===l&&(s=!1);for(var d=!0,c=l-1;c<a.textContent.length;c++)if(" "!==a.textContent.charAt(c)&&"\n"!==a.textContent.charAt(c)){d=!1;break}if(s){"function"==typeof e.options.input&&e.options.input(A(e));return}if(d&&/^#{1,6} $/.test(a.textContent)&&(d=!1),d)if((0,V.fb)(t.startContainer,"vditor-ir__marker"));else{var u=t.startContainer.previousSibling;u&&3!==u.nodeType&&u.classList.contains("vditor-ir__node--expand")&&u.classList.remove("vditor-ir__node--expand"),"function"==typeof e.options.input&&e.options.input(A(e));return}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),a||(a=e.ir.element),!a.querySelector("wbr")){var p=(0,V.fb)(t.startContainer,"vditor-ir__preview");p?p.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}a.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),"link-ref-defs-block"===a.getAttribute("data-type")&&(a=e.ir.element);var f=a.isEqualNode(e.ir.element),m=(0,V.a1)(a,"data-type","footnotes-block"),v="";if(f)v=a.innerHTML;else{var h=(0,U.S)(t.startContainer,"BLOCKQUOTE"),g=(0,V.O9)(t.startContainer);if(g&&(a=g),h&&(!g||g&&!h.contains(g))&&(a=h),m&&(a=m),v=a.outerHTML,"UL"===a.tagName||"OL"===a.tagName){var b=a.previousElementSibling,y=a.nextElementSibling;b&&("UL"===b.tagName||"OL"===b.tagName)&&(v=b.outerHTML+v,b.remove()),y&&("UL"===y.tagName||"OL"===y.tagName)&&(v+=y.outerHTML,y.remove()),v=v.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else a.previousElementSibling&&""!==a.previousElementSibling.textContent.replace(M.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(v=a.previousElementSibling.outerHTML+v,a.previousElementSibling.remove());a.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!a.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!a.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}))}if(F("SpinVditorIRDOM",v,"argument",e.options.debugger),F("SpinVditorIRDOM",v=e.lute.SpinVditorIRDOM(v),"result",e.options.debugger),f)a.innerHTML=v;else if(a.outerHTML=v,m){var w=(0,V.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(w){var k=w.textContent,E=k.substring(1,k.indexOf("]:")),x=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(E,'"]'));x&&x.setAttribute("aria-label",k.substr(E.length+3).trim().substr(0,24))}}var S=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");S.forEach(function(e,t){0===t?o=e:(o.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),S.length>0&&e.ir.element.insertAdjacentElement("beforeend",S[0]);var _=e.ir.element.querySelectorAll("[data-type='footnotes-block']");_.forEach(function(e,t){0===t?i=e:(i.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),_.length>0&&e.ir.element.insertAdjacentElement("beforeend",_[0]),(0,ei.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){eo(t,e)}),ea(e),t6(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},ed=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&t.code===e;if("⇧Tab"===e)return!(0,N.yl)(t)&&!t.altKey&&!!t.shiftKey&&"Tab"===t.code;var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return(3===n.length?!!(0,N.yl)(t):!(0,N.yl)(t))&&!!t.altKey&&!t.shiftKey&&t.code===(/^[0-9]$/.test(r)?"Digit":"Key")+r}"⌘Enter"===e&&(n=["⌘","Enter"]);var o=n.length>2&&"⇧"===n[0],i=o?n[2]:n[1];return o&&((0,N.vU)()||!/Mac/.test(navigator.platform))&&("-"===i?i="_":"="===i&&(i="+")),!!(0,N.yl)(t)&&t.key.toLowerCase()===i.toLowerCase()&&!t.altKey&&(!o&&!t.shiftKey||!!o&&!!t.shiftKey)},eu=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(n){if(n&&3!==n.nodeType&&n.classList.contains("vditor-ir__node")&&!n.getAttribute("data-block"))return n}else{var r=(0,V.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var o=t.parentElement.parentElement.nextSibling;if(o&&3!==o.nodeType&&o.classList.contains("vditor-ir__node"))return o}}return!1},ep=function(e){var t=e.startContainer,n=t.previousSibling;return!(!(3===t.nodeType&&0===e.startOffset&&n&&3!==n.nodeType&&n.classList.contains("vditor-ir__node"))||n.getAttribute("data-block"))&&n},ef=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var n=(0,V.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,V.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,ei.Hc)(e));var o=eu(e);if(o){o.classList.add("vditor-ir__node--expand"),o.classList.remove("vditor-ir__node--hidden");return}var i=ep(e);if(i){i.classList.add("vditor-ir__node--expand"),i.classList.remove("vditor-ir__node--hidden");return}}},em=function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,ei.zh)(e),r=n.startContainer;if(!tE(t,e,r)||(tx(n,e,t),tY(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,N.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var o=(0,V.a1)(r,"data-newline","1");if(!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&o&&n.startOffset<o.textContent.length){var i=o.previousElementSibling;i&&(n.insertNode(document.createTextNode(i.textContent)),n.collapse(!1));var a=o.nextSibling;a&&(n.insertNode(document.createTextNode(a.textContent)),n.collapse(!0))}var l=(0,V.lG)(r,"P");if(tB(t,e,l,n)||tP(n,e,l,t)||tJ(e,n,t,l))return!0;var s=(0,V.fb)(r,"vditor-ir__marker--pre");if(s&&"PRE"===s.tagName){var c=s.firstChild;if(tK(e,t,s,n)||("math-block"===c.getAttribute("data-type")||"html-block"===c.getAttribute("data-type"))&&tA(e,t,n,c,s.parentElement)||tC(e,t,n,c,s.parentElement))return!0}var d=(0,V.a1)(r,"data-type","code-block-info");if(d){if("Enter"===t.key||"Tab"===t.key)return n.selectNodeContents(d.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),B(e,["hint"]),!0;if("Backspace"===t.key){var u=(0,ei.im)(d,e.ir.element).start;1===u&&n.setStart(r,0),2===u&&(e.hint.recentLanguage="")}if(tA(e,t,n,d,d.parentElement))return B(e,["hint"]),!0}var p=(0,V.lG)(r,"TD")||(0,V.lG)(r,"TH");if(t.key.indexOf("Arrow")>-1&&p){var f=tT(p);if(f&&tA(e,t,n,p,f))return!0;var m=tL(p);if(m&&tC(e,t,n,p,m))return!0}if(tG(e,t,n)||tZ(e,n,t)||tq(e,n,t))return!0;var v=(0,U.W)(r);if(v){if(ed("⌘=",t)){var h=v.querySelector(".vditor-ir__marker--heading");return h&&h.textContent.trim().length>1&&t3(e,h.textContent.substr(1)),t.preventDefault(),!0}if(ed("⌘-",t)){var h=v.querySelector(".vditor-ir__marker--heading");return h&&h.textContent.trim().length<6&&t3(e,h.textContent.trim()+"# "),t.preventDefault(),!0}}var g=(0,V.F9)(r);if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(tX(e,n,t,l))return!0;if(g&&g.previousElementSibling&&"UL"!==g.tagName&&"OL"!==g.tagName&&("code-block"===g.previousElementSibling.getAttribute("data-type")||"math-block"===g.previousElementSibling.getAttribute("data-type"))){var b=(0,ei.im)(g,e.ir.element,n).start;if(0===b||1===b&&g.innerText.startsWith(M.g.ZWSP))return n.selectNodeContents(g.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),ef(n,e),""===g.textContent.trim().replace(M.g.ZWSP,"")&&(g.remove(),t6(e)),t.preventDefault(),!0}if(v){var y=v.firstElementChild.textContent.length;(0,ei.im)(v,e.ir.element).start===y&&0!==y&&(n.setStart(v.firstElementChild.firstChild,y-1),n.collapse(!0),(0,ei.Hc)(n))}}return!!(("ArrowUp"===t.key||"ArrowDown"===t.key)&&g&&(g.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(r)||e.classList.add("vditor-ir__node--hidden")}),t$(t,g,n)))||(tS(n,t.key),!!(g&&es(g,e,t,n))&&(t.preventDefault(),!0))},ev=n(190),eh=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var n=e.parentElement,r=n.nextSibling;r;)if(r.textContent.startsWith(" ")){var o=r;o.childNodes.forEach(function(e){n.append(e.cloneNode(!0))}),r=r.nextSibling,o.remove()}else break;t&&t(n)})},eg=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),o=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(o=r.startContainer.childNodes[r.startOffset-1]);var i=(0,V.a1)(o,"data-block","0");if(i&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var a=(0,ei.im)(i,e.sv.element,r).start,l=!0,s=a-1;s>i.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==i.textContent.charAt(s)&&" "!==i.textContent.charAt(s)){l=!1;break}if(0===a&&(l=!1),l)return void tc(e);if("deleteContentBackward"===t.inputType){var c=(0,V.a1)(o,"data-type","code-block-open-marker")||(0,V.a1)(o,"data-type","code-block-close-marker");if(c){if("code-block-close-marker"===c.getAttribute("data-type")){var d=ta(o,"code-block-open-marker");if(d){d.textContent=c.textContent,tc(e);return}}if("code-block-open-marker"===c.getAttribute("data-type")){var d=ta(o,"code-block-close-marker",!1);if(d){d.textContent=c.textContent,tc(e);return}}}var u=(0,V.a1)(o,"data-type","math-block-open-marker");if(u){var p=u.nextElementSibling.nextElementSibling;p&&"math-block-close-marker"===p.getAttribute("data-type")&&(p.remove(),tc(e));return}i.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),i.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var f=(0,V.a1)(o,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void tc(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,V.a1)(o,"data-type","padding")||(0,V.a1)(o,"data-type","li-marker")||(0,V.a1)(o,"data-type","task-marker")||(0,V.a1)(o,"data-type","blockquote-marker")))return void tc(e)}if(i&&"$$"===i.textContent.trimRight())return void tc(e);i||(i=e.sv.element),(null==(n=i.firstElementChild)?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(i=e.sv.element),(0,V.a1)(o,"data-type","footnotes-link")&&(i=e.sv.element),-1===i.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML});var m=i.textContent,v=i.isEqualNode(e.sv.element);if(v)m=i.textContent;else{i.previousElementSibling&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove()),i.previousElementSibling&&0===m.indexOf("---\n")&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove());var h="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),m=h+m}m=tl(m,e),v?i.innerHTML=m:i.outerHTML=m,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)}),eh(e.sv.element,function(t){e.sv.element.insertAdjacentElement("beforeend",t)}),(0,ei.ib)(e.sv.element,r),tn(e),tc(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},eb=function(e,t){if(e.sv.composingLock=t.isComposing,t.isComposing||(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,N.yl)(t)&&"Escape"!==t.key))return!1;var n,r,o,i,a,l=(0,ei.zh)(e),s=l.startContainer;3!==l.startContainer.nodeType&&"DIV"===l.startContainer.tagName&&(s=l.startContainer.childNodes[l.startOffset-1]);var c=(0,V.a1)(s,"data-type","text"),d=(0,V.a1)(s,"data-type","blockquote-marker");if(!d&&0===l.startOffset&&c&&c.previousElementSibling&&"blockquote-marker"===c.previousElementSibling.getAttribute("data-type")&&(d=c.previousElementSibling),d&&"Enter"===t.key&&!(0,N.yl)(t)&&!t.altKey&&""===d.nextElementSibling.textContent.trim()&&(0,ei.im)(d,e.sv.element,l).start===d.textContent.length)return(null==(n=d.previousElementSibling)?void 0:n.getAttribute("data-type"))==="padding"&&d.previousElementSibling.setAttribute("data-action","enter-remove"),d.remove(),tc(e),t.preventDefault(),!0;var u=(0,V.a1)(s,"data-type","li-marker"),p=(0,V.a1)(s,"data-type","task-marker"),f=u;if(!f&&p&&"task-marker"!==p.nextElementSibling.getAttribute("data-type")&&(f=p),!f&&0===l.startOffset&&c&&c.previousElementSibling&&("li-marker"===c.previousElementSibling.getAttribute("data-type")||"task-marker"===c.previousElementSibling.getAttribute("data-type"))&&(f=c.previousElementSibling),f){var m=(0,ei.im)(f,e.sv.element,l).start,v="task-marker"===f.getAttribute("data-type"),h=f;if(v&&(h=f.previousElementSibling.previousElementSibling.previousElementSibling),m===f.textContent.length){if("Enter"===t.key&&!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&""===f.nextElementSibling.textContent.trim())return(null==(r=h.previousElementSibling)?void 0:r.getAttribute("data-type"))==="padding"?(h.previousElementSibling.remove(),eg(e)):(v&&(h.remove(),f.previousElementSibling.previousElementSibling.remove(),f.previousElementSibling.remove()),f.nextElementSibling.remove(),f.remove(),tc(e)),t.preventDefault(),!0;if("Tab"===t.key)return t.shiftKey?"padding"===h.previousElementSibling.getAttribute("data-type")&&h.previousElementSibling.remove():h.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(h.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(h.textContent)&&(h.textContent=h.textContent.replace(/^\d{1,}/,"1"),l.selectNodeContents(f.firstChild),l.collapse(!1)),eg(e),t.preventDefault(),!0}}if(tq(e,l,t))return!0;var g=(0,V.a1)(s,"data-block","0"),b=(0,U.S)(s,"SPAN");if("Enter"===t.key&&!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey&&g){var y=!1,w=g.textContent.match(/^\n+/);(0,ei.im)(g,e.sv.element).start<=(w?w[0].length:0)&&(y=!0);var k="\n";if(b)if((null==(o=b.previousElementSibling)?void 0:o.getAttribute("data-action"))==="enter-remove")return b.previousElementSibling.remove(),tc(e),t.preventDefault(),!0;else k+=ts(b);return l.insertNode(document.createTextNode(k)),l.collapse(!1),g&&""!==g.textContent.trim()&&!y?eg(e):tc(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.altKey&&!t.shiftKey){if(b&&(null==(i=b.previousElementSibling)?void 0:i.getAttribute("data-type"))==="newline"&&1===(0,ei.im)(b,e.sv.element,l).start&&-1===b.getAttribute("data-type").indexOf("code-block-"))return l.setStart(b,0),l.extractContents(),""!==b.textContent.trim()?eg(e):tc(e),t.preventDefault(),!0;if(g&&0===(0,ei.im)(g,e.sv.element,l).start&&g.previousElementSibling){l.extractContents();var E=g.previousElementSibling.lastElementChild;return"newline"===E.getAttribute("data-type")&&(E.remove(),E=g.previousElementSibling.lastElementChild),"newline"!==E.getAttribute("data-type")&&(E.insertAdjacentHTML("afterend",g.innerHTML),g.remove()),""===g.textContent.trim()||(null==(a=g.previousElementSibling)?void 0:a.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==E.getAttribute("data-type")&&(l.selectNodeContents(E.lastChild),l.collapse(!1)),tc(e)):eg(e),t.preventDefault(),!0}}return!1},ey=n(538),ew=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},ek=function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),ew(e),(0,ey.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){B(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),e6(e,e.options.mode,e_(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame(function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, ".concat(-t.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}},eE=function(e){var t=window.innerWidth<=M.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px ".concat(Math.max(t,n),"px")}if("none"!==e.ir.element.parentElement.style.display){var n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.ir.element.style.padding="10px ".concat(Math.max(t,n),"px")}"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},ex=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function eS(){window.removeEventListener("resize",_)}var e_=function(e){ex(e),eS(),window.addEventListener("resize",_=function(){eE(e),ex(e)});var t=(0,N.pK)()&&localStorage.getItem(e.options.cache.id);return e.options.cache.enable&&t||(e.options.value?t=e.options.value:e.originalInnerHTML?t=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(t="")),t||""},eT=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,ei.Gb)(e[e.currentMode].element)){D(e.toolbar.elements,M.g.EDIT_TOOLBARS),j(e.toolbar.elements,M.g.EDIT_TOOLBARS);var t=(0,ei.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,V.a1)(n,"data-type","heading"):(0,U.W)(n))&&I(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,V.a1)(n,"data-type","blockquote"):(0,V.lG)(n,"BLOCKQUOTE"))&&I(e.toolbar.elements,["quote"]),(0,V.a1)(n,"data-type","strong")&&I(e.toolbar.elements,["bold"]),(0,V.a1)(n,"data-type","em")&&I(e.toolbar.elements,["italic"]),(0,V.a1)(n,"data-type","s")&&I(e.toolbar.elements,["strike"]),(0,V.a1)(n,"data-type","a")&&I(e.toolbar.elements,["link"]);var r=(0,V.lG)(n,"LI");r?(r.classList.contains("vditor-task")?I(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?I(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&I(e.toolbar.elements,["list"]),j(e.toolbar.elements,["outdent","indent"])):R(e.toolbar.elements,["outdent","indent"]),(0,V.a1)(n,"data-type","code-block")&&(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),I(e.toolbar.elements,["code"])),(0,V.a1)(n,"data-type","code")&&(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),I(e.toolbar.elements,["inline-code"])),(0,V.a1)(n,"data-type","table")&&R(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},eL=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=A(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,N.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},eM=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(M.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1},eC=function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!!t&&3!==t.nodeType&&("CODE"===t.tagName||"math-inline"===t.getAttribute("data-type")||"html-entity"===t.getAttribute("data-type")||"html-inline"===t.getAttribute("data-type"))},eA=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},eO=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},eH=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling},eN=function(e){var t=eO(e.startContainer),n=eA(e.startContainer),r=e.startContainer.textContent,o=e.startOffset,i="",a="";return(""!==r.substr(0,o)&&r.substr(0,o)!==M.g.ZWSP||t)&&(i="".concat(t).concat(r.substr(0,o))),(""!==r.substr(o)&&r.substr(o)!==M.g.ZWSP||n)&&(a="".concat(r.substr(o)).concat(n)),{afterHTML:a,beforeHTML:i}},eD=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var o=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,o)),t.collapse(!0),(0,ei.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>")):"BR"===n.tagName?n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"<wbr></p>"):(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"</p>")),(0,ei.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},eI=function(e,t){var n=(0,ei.zh)(e),r=(0,V.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"):r.outerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"),(0,ei.ib)(e.wysiwyg.element,n),ea(e))},ej=function(e){var t=getSelection().getRangeAt(0),n=(0,V.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,ei.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},eR=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,o=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?o.setStart(r.firstChild,1):o.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),o.selectNodeContents(r.firstChild)),n?o.collapse(!0):o.collapse(!1),(0,ei.Hc)(o),e.firstElementChild.classList.contains("language-mindmap")||tn(t)},eP=function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,ei.zh)(e),r=n.startContainer;if(!tE(t,e,r)||(tx(n,e,t),tY(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,N.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var o=(0,V.F9)(r),i=(0,V.lG)(r,"P");if(tB(t,e,i,n)||tP(n,e,i,t)||tG(e,t,n))return!0;var a=(0,V.fb)(r,"vditor-wysiwyg__block");if(a){if("Escape"===t.key&&2===a.children.length)return e.wysiwyg.popover.style.display="none",a.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,N.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===a.getAttribute("data-type")){var l=e.wysiwyg.popover.querySelector(".vditor-input");return l.focus(),l.select(),t.preventDefault(),!0}if("0"===a.getAttribute("data-block")&&(tK(e,t,a.firstElementChild,n)||tC(e,t,n,a.firstElementChild,a)||"yaml-front-matter"!==a.getAttribute("data-type")&&tA(e,t,n,a.firstElementChild,a)))return!0}if(tJ(e,n,t,i))return!0;var s=(0,V.E2)(r,"BLOCKQUOTE");if(s&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,N.yl)(t)?n.setStartBefore(s):n.setStartAfter(s),(0,ei.Hc)(n);var c=document.createElement("p");return c.setAttribute("data-block","0"),c.innerHTML="\n",n.insertNode(c),n.collapse(!0),(0,ei.Hc)(n),eL(e),tn(e),t.preventDefault(),!0}var d=(0,U.W)(r);if(d){if("H6"===d.tagName&&r.textContent.length===n.startOffset&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var u=document.createElement("p");return u.textContent="\n",u.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",u),n.setStart(u,0),(0,ei.Hc)(n),eL(e),tn(e),t.preventDefault(),!0}if(ed("⌘=",t)){var p=parseInt(d.tagName.substr(1),10)-1;return p>0&&(eI(e,"h".concat(p)),eL(e)),t.preventDefault(),!0}if(ed("⌘-",t)){var p=parseInt(d.tagName.substr(1),10)+1;return p<7&&(eI(e,"h".concat(p)),eL(e)),t.preventDefault(),!0}"Backspace"!==t.key||(0,N.yl)(t)||t.shiftKey||t.altKey||1!==d.textContent.length||ej(e)}if(tZ(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,N.yl)(t)&&!t.shiftKey){var f=(0,V.lG)(r,"A"),m=(0,V.a1)(r,"data-type","link-ref"),v=(0,V.a1)(r,"data-type","footnotes-ref");if(f||m||v||d&&2===d.tagName.length){var h=e.wysiwyg.popover.querySelector("input");h.focus(),h.select()}}if(eq(e,t))return!0;if(ed("⇧⌘U",t)){var g=e.wysiwyg.popover.querySelector('[data-type="up"]');if(g)return g.click(),t.preventDefault(),!0}if(ed("⇧⌘D",t)){var g=e.wysiwyg.popover.querySelector('[data-type="down"]');if(g)return g.click(),t.preventDefault(),!0}if(tq(e,n,t))return!0;if(!(0,N.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+M.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,ei.Hc)(n),eL(e),tn(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(tX(e,n,t,i))return!0;if(o){if(o.previousElementSibling&&o.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===o.previousElementSibling.getAttribute("data-block")&&"UL"!==o.tagName&&"OL"!==o.tagName){var b=(0,ei.im)(o,e.wysiwyg.element,n).start;if(0===b&&0===n.startOffset||1===b&&o.innerText.startsWith(M.g.ZWSP))return eR(o.previousElementSibling.lastElementChild,e,!1),""===o.innerHTML.trim().replace(M.g.ZWSP,"")&&(o.remove(),eL(e)),t.preventDefault(),!0}var y=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(y-2)&&r.textContent.charAt(y-1)!==M.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,y-1)+M.g.ZWSP,n.setStart(r,y),n.collapse(!0),eL(e),t.preventDefault(),!0;r.textContent===M.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&eC(n)&&(r.textContent=""),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}if((0,N.vU)()&&1===n.startOffset&&r.textContent.indexOf(M.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(t$(t,o,n))return t.preventDefault(),!0;if(tS(n,t.key),"ArrowDown"===t.key){var w=r.nextSibling;w&&3!==w.nodeType&&"math-inline"===w.getAttribute("data-type")&&n.setStartAfter(w)}return!!(o&&es(o,e,t,n))&&(t.preventDefault(),!0)},eq=function(e,t){if(ed("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},eB=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,ei.Gb)(e.wysiwyg.element)){D(e.toolbar.elements,M.g.EDIT_TOOLBARS),j(e.toolbar.elements,M.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,V.a1)(n,"data-type","footnotes-block");if(r){e.wysiwyg.popover.innerHTML="",eW(r,e),eX(e,"footnotes-block"),ez(e,r);return}var o=(0,V.lG)(n,"LI");o?(o.classList.contains("vditor-task")?I(e.toolbar.elements,["check"]):"OL"===o.parentElement.tagName?I(e.toolbar.elements,["ordered-list"]):"UL"===o.parentElement.tagName&&I(e.toolbar.elements,["list"]),j(e.toolbar.elements,["outdent","indent"])):R(e.toolbar.elements,["outdent","indent"]),(0,V.lG)(n,"BLOCKQUOTE")&&I(e.toolbar.elements,["quote"]),((0,V.lG)(n,"B")||(0,V.lG)(n,"STRONG"))&&I(e.toolbar.elements,["bold"]),((0,V.lG)(n,"I")||(0,V.lG)(n,"EM"))&&I(e.toolbar.elements,["italic"]),((0,V.lG)(n,"STRIKE")||(0,V.lG)(n,"S"))&&I(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")});var i=(0,V.fb)(n,"vditor-comment");if(i){var a=i.getAttribute("data-cmtids").split(" ");if(a.length>1&&i.nextSibling.isSameNode(i.nextElementSibling)){var l=i.nextElementSibling.getAttribute("data-cmtids").split(" ");a.find(function(e){if(l.includes(e))return a=[e],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){e.getAttribute("data-cmtids").indexOf(a[0])>-1&&e.classList.add("vditor-comment--focus")})}var s=(0,V.lG)(n,"A");s&&I(e.toolbar.elements,["link"]);var c=(0,V.lG)(n,"TABLE"),d=(0,U.W)(n);(0,V.lG)(n,"CODE")?(0,V.lG)(n,"PRE")?(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),I(e.toolbar.elements,["code"])):(R(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),I(e.toolbar.elements,["inline-code"])):d?(R(e.toolbar.elements,["bold"]),I(e.toolbar.elements,["headings"])):c&&R(e.toolbar.elements,["table"]);var u=(0,V.fb)(n,"vditor-toc");if(u){e.wysiwyg.popover.innerHTML="",eW(u,e),eX(e,"vditor-toc"),ez(e,u);return}var p=(0,U.S)(n,"BLOCKQUOTE");if(p&&(e.wysiwyg.popover.innerHTML="",eU(t,p,e),eF(t,p,e),eW(p,e),eX(e,"blockquote"),ez(e,p)),o&&(e.wysiwyg.popover.innerHTML="",eU(t,o,e),eF(t,o,e),eW(o,e),eX(e,"li"),ez(e,o)),c){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var f=function(){var t=c.rows.length,n=c.rows[0].cells.length,r=parseInt(C.value,10)||t,o=parseInt(H.value,10)||n;if(r!==t||n!==o){if(n!==o)for(var i=o-n,a=0;a<c.rows.length;a++)if(i>0)for(var l=0;l<i;l++)0===a?c.rows[a].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):c.rows[a].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var s=n-1;s>=o;s--)c.rows[a].cells[s].remove();if(t!==r){var d=r-t;if(d>0){for(var u="<tr>",p=0;p<o;p++)u+="<td> </td>";for(var f=0;f<d;f++)c.querySelector("tbody")?c.querySelector("tbody").insertAdjacentHTML("beforeend",u):c.querySelector("thead").insertAdjacentHTML("afterend",u+"</tr>")}else for(var p=t-1;p>=r;p--)c.rows[p].remove(),1===c.rows.length&&c.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(A(e))}},m=function(n){tD(c,n),"right"===n?(b.classList.remove("vditor-icon--current"),y.classList.remove("vditor-icon--current"),w.classList.add("vditor-icon--current")):"center"===n?(b.classList.remove("vditor-icon--current"),w.classList.remove("vditor-icon--current"),y.classList.add("vditor-icon--current")):(y.classList.remove("vditor-icon--current"),w.classList.remove("vditor-icon--current"),b.classList.add("vditor-icon--current")),(0,ei.Hc)(t),eL(e)},v=(0,V.lG)(n,"TD"),h=(0,V.lG)(n,"TH"),g="left";v?g=v.getAttribute("align")||"left":h&&(g=h.getAttribute("align")||"center");var b=document.createElement("button");b.setAttribute("type","button"),b.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,N.ns)("⇧⌘L")+">"),b.setAttribute("data-type","left"),b.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',b.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===g?" vditor-icon--current":""),b.onclick=function(){m("left")};var y=document.createElement("button");y.setAttribute("type","button"),y.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,N.ns)("⇧⌘C")+">"),y.setAttribute("data-type","center"),y.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',y.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===g?" vditor-icon--current":""),y.onclick=function(){m("center")};var w=document.createElement("button");w.setAttribute("type","button"),w.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,N.ns)("⇧⌘R")+">"),w.setAttribute("data-type","right"),w.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',w.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===g?" vditor-icon--current":""),w.onclick=function(){m("right")};var k=document.createElement("button");k.setAttribute("type","button"),k.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,N.ns)("⌘=")+">"),k.setAttribute("data-type","insertRow"),k.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',k.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",k.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tz(e,t,r)};var E=document.createElement("button");E.setAttribute("type","button"),E.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,N.ns)("⇧⌘F")+">"),E.setAttribute("data-type","insertRow"),E.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',E.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",E.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tV(e,t,r)};var x=document.createElement("button");x.setAttribute("type","button"),x.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,N.ns)("⇧⌘=")+">"),x.setAttribute("data-type","insertColumn"),x.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',x.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",x.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,V.lG)(t,"TD")||(0,V.lG)(t,"TH");n&&tU(e,c,n)};var S=document.createElement("button");S.setAttribute("type","button"),S.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,N.ns)("⇧⌘G")+">"),S.setAttribute("data-type","insertColumn"),S.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',S.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",S.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,V.lG)(t,"TD")||(0,V.lG)(t,"TH");n&&tU(e,c,n,"beforebegin")};var _=document.createElement("button");_.setAttribute("type","button"),_.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,N.ns)("⌘-")+">"),_.setAttribute("data-type","deleteRow"),_.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',_.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",_.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tF(e,t,r)};var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,N.ns)("⇧⌘-")+">"),T.setAttribute("data-type","deleteColumn"),T.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",T.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,V.lG)(n,"TD")||(0,V.lG)(n,"TH");r&&tW(e,t,c,r)};var L=document.createElement("span");L.setAttribute("aria-label",window.VditorI18n.row),L.className="vditor-tooltipped vditor-tooltipped__n";var C=document.createElement("input");L.appendChild(C),C.type="number",C.min="1",C.className="vditor-input",C.style.width="42px",C.style.textAlign="center",C.setAttribute("placeholder",window.VditorI18n.row),C.value=c.rows.length.toString(),C.oninput=function(){f()},C.onkeydown=function(n){if(!n.isComposing){if("Tab"===n.key){H.focus(),H.select(),n.preventDefault();return}if(!eq(e,n)&&eZ(n,t))return}};var O=document.createElement("span");O.setAttribute("aria-label",window.VditorI18n.column),O.className="vditor-tooltipped vditor-tooltipped__n";var H=document.createElement("input");O.appendChild(H),H.type="number",H.min="1",H.className="vditor-input",H.style.width="42px",H.style.textAlign="center",H.setAttribute("placeholder",window.VditorI18n.column),H.value=c.rows[0].cells.length.toString(),H.oninput=function(){f()},H.onkeydown=function(n){if(!n.isComposing){if("Tab"===n.key){C.focus(),C.select(),n.preventDefault();return}if(!eq(e,n)&&eZ(n,t))return}},eU(t,c,e),eF(t,c,e),eW(c,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",b),e.wysiwyg.popover.insertAdjacentElement("beforeend",y),e.wysiwyg.popover.insertAdjacentElement("beforeend",w),e.wysiwyg.popover.insertAdjacentElement("beforeend",E),e.wysiwyg.popover.insertAdjacentElement("beforeend",k),e.wysiwyg.popover.insertAdjacentElement("beforeend",S),e.wysiwyg.popover.insertAdjacentElement("beforeend",x),e.wysiwyg.popover.insertAdjacentElement("beforeend",_),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",O),eX(e,"table"),ez(e,c)}var P=(0,V.a1)(n,"data-type","link-ref");P&&eV(e,P,t);var q=(0,V.a1)(n,"data-type","footnotes-ref");if(q){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var L=document.createElement("span");L.setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,N.ns)("⌥Enter")+">"),L.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");L.appendChild(B),B.className="vditor-input",B.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,N.ns)("⌥Enter")+">"),B.style.width="120px",B.value=q.getAttribute("data-footnotes-label"),B.oninput=function(){""!==B.value.trim()&&q.setAttribute("data-footnotes-label",B.value),"function"==typeof e.options.input&&e.options.input(A(e))},B.onkeydown=function(n){if(!n.isComposing&&!eq(e,n)&&eZ(n,t))return},eW(q,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),eX(e,"footnotes-ref"),ez(e,q)}var z=(0,V.fb)(n,"vditor-wysiwyg__block"),F=!!z&&z.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){(!z||z&&F&&!z.contains(e))&&(e.previousElementSibling.style.display="none")}),z&&F){if(e.wysiwyg.popover.innerHTML="",eU(t,z,e),eF(t,z,e),eW(z,e),"code-block"===z.getAttribute("data-type")){var W=document.createElement("span");W.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,N.ns)("⌥Enter")+">"),W.className="vditor-tooltipped vditor-tooltipped__n";var G=document.createElement("input");W.appendChild(G);var K=z.firstElementChild.firstElementChild;G.className="vditor-input",G.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,N.ns)("⌥Enter")+">"),G.value=K.className.indexOf("language-")>-1?K.className.split("-")[1].split(" ")[0]:"",G.oninput=function(n){""!==G.value.trim()?K.className="language-".concat(G.value):(K.className="",e.hint.recentLanguage=""),z.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(z.lastElementChild.innerHTML=z.firstElementChild.innerHTML,eo(z.lastElementChild,e)),eL(e),1===n.detail&&(t.setStart(K.firstChild,0),t.collapse(!0),(0,ei.Hc)(t))},G.onkeydown=function(n){if(!n.isComposing&&!eq(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display){e.hint.element.style.display="none",n.preventDefault();return}e.hint.select(n,e),eZ(n,t)}},G.onkeyup=function(t){if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var n,r,o=[],i=G.value.substring(0,G.selectionStart);(e.options.preview.hljs.langs||M.g.ALIAS_CODE_LANGUAGES.concat((null!=(r=null==(n=window.hljs)?void 0:n.listLanguages())?r:[]).sort())).forEach(function(e){e.indexOf(i.toLowerCase())>-1&&o.push({html:e,value:e})}),e.hint.genHTML(o,i,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",W),eX(e,"code-block")}else eX(e,"block");ez(e,z)}else z=void 0;if(d){e.wysiwyg.popover.innerHTML="";var L=document.createElement("span");L.setAttribute("aria-label","ID<"+(0,N.ns)("⌥Enter")+">"),L.className="vditor-tooltipped vditor-tooltipped__n";var J=document.createElement("input");L.appendChild(J),J.className="vditor-input",J.setAttribute("placeholder","ID<"+(0,N.ns)("⌥Enter")+">"),J.style.width="120px",J.value=d.getAttribute("data-id")||"",J.oninput=function(){d.setAttribute("data-id",J.value),"function"==typeof e.options.input&&e.options.input(A(e))},J.onkeydown=function(n){if(!n.isComposing&&!eq(e,n)&&eZ(n,t))return},eU(t,d,e),eF(t,d,e),eW(d,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),eX(e,"heading"),ez(e,d)}if(s&&eK(e,s,t),!p&&!o&&!c&&!z&&!s&&!P&&!q&&!d&&!u){var Z=(0,V.a1)(n,"data-block","0");Z&&Z.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",eU(t,Z,e),eF(t,Z,e),eW(Z,e),eX(e,"block"),ez(e,Z)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"});var X=(0,V.a1)(t.startContainer,"data-type","backslash");X&&(X.querySelector("span").style.display="inline")}},200)},ez=function(e,t){var n=t,r=(0,V.lG)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},eV=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",i.value):t.textContent=i.value),""!==l.value.trim()&&t.setAttribute("data-link-label",l.value),"function"==typeof e.options.input&&e.options.input(A(e))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.getAttribute("alt")||t.textContent,i.oninput=function(){r()},i.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.linkRef),l.value=t.getAttribute("data-link-label"),l.oninput=function(){r()},l.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,i)},eW(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),eX(e,"link-ref"),ez(e,t)},eU=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","up"),o.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,N.ns)("⇧⌘U")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,ei.ib)(n.wysiwyg.element,e),eL(n),eB(n),tn(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eF=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","down"),o.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,N.ns)("⇧⌘D")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,ei.ib)(n.wysiwyg.element,e),eL(n),eB(n),tn(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eW=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,N.ns)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var n=(0,ei.zh)(t);n.setStartAfter(e),(0,ei.Hc)(n),e.remove(),eL(t),eB(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&ea(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},eG=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key){r.focus(),r.select(),n.preventDefault();return}if(!(0,N.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var o=(0,ei.zh)(e);t.insertAdjacentHTML("afterend",M.g.ZWSP),o.setStartAfter(t.nextSibling),o.collapse(!0),(0,ei.Hc)(o),n.preventDefault()}}},eK=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&(t.innerHTML=i.value),t.setAttribute("href",l.value),t.setAttribute("title",c.value),eL(e)};t.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.innerHTML||"",i.oninput=function(){r()},i.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.link),l.value=t.getAttribute("href")||"",l.oninput=function(){r()},l.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,c)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.tooltipText),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.tooltipText),c.style.width="60px",c.value=t.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(r){eq(e,r)||eZ(r,n)||eG(e,t,r,i)},eW(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),eX(e,"a"),ez(e,t)},eJ=function(e,t){var n=e.target;t.wysiwyg.popover.innerHTML="";var r=function(){n.setAttribute("src",i.value),n.setAttribute("alt",l.value),n.setAttribute("title",c.value),"function"==typeof t.options.input&&t.options.input(A(t))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.imageURL),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.imageURL),i.value=n.getAttribute("src")||"",i.oninput=function(){r()},i.onkeydown=function(e){eq(t,e)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.alternateText),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.alternateText),l.style.width="52px",l.value=n.getAttribute("alt")||"",l.oninput=function(){r()},l.onkeydown=function(e){eq(t,e)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.title),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.title),c.value=n.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(e){eq(t,e)},eW(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",o),t.wysiwyg.popover.insertAdjacentElement("beforeend",a),t.wysiwyg.popover.insertAdjacentElement("beforeend",s),eX(t,"image"),ez(t,n)},eZ=function(e,t){if(!(0,N.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,ei.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},eX=function(e,t){e.options.customWysiwygToolbar(t,e.wysiwyg.popover)},eY=function(e){"wysiwyg"===e.currentMode?eB(e):"ir"===e.currentMode&&eT(e)},e$=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){eo(t,e),t.previousElementSibling.setAttribute("style","display:none")}),eL(e,n)},eQ=function(e,t,n){for(var r=e.startContainer.parentElement,o=!1,i="",a="",l=eN(e),s=l.beforeHTML,c=l.afterHTML;r&&!o;){var d=r.tagName;if("STRIKE"===d&&(d="S"),"I"===d&&(d="EM"),"B"===d&&(d="STRONG"),"S"===d||"STRONG"===d||"EM"===d){var u="",p="",f="";"0"!==r.parentElement.getAttribute("data-block")&&(p=eO(r),f=eA(r)),(s||p)&&(s=u="".concat(p,"<").concat(d,">").concat(s,"</").concat(d,">")),("bold"===n&&"STRONG"===d||"italic"===n&&"EM"===d||"strikeThrough"===n&&"S"===d)&&(u+="".concat(i).concat(M.g.ZWSP,"<wbr>").concat(a),o=!0),(c||f)&&(u+=c="<".concat(d,">").concat(c,"</").concat(d,">").concat(f)),"0"!==r.parentElement.getAttribute("data-block")?(r=r.parentElement).innerHTML=u:(r.outerHTML=u,r=r.parentElement),i="<".concat(d,">")+i,a="</".concat(d,">")+a}else o=!0}(0,ei.ib)(t.wysiwyg.element,e)},e0=function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,o=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var i=(0,ei.zh)(e),a=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if("strike"===a&&(a="strikeThrough"),"quote"===a){var l=(0,V.lG)(i.startContainer,"BLOCKQUOTE");l||(l=i.startContainer.childNodes[i.startOffset]),l&&(r=!1,t.classList.remove("vditor-menu--current"),i.insertNode(document.createElement("wbr")),l.outerHTML=""===l.innerHTML.trim()?'<p data-block="0">'.concat(l.innerHTML,"</p>"):l.innerHTML,(0,ei.ib)(e.wysiwyg.element,i))}else if("inline-code"===a){var s=(0,V.lG)(i.startContainer,"CODE");s||(s=i.startContainer.childNodes[i.startOffset]),s&&(s.outerHTML=s.innerHTML.replace(M.g.ZWSP,"")+"<wbr>",(0,ei.ib)(e.wysiwyg.element,i))}else"link"===a?(i.collapsed&&i.selectNode(i.startContainer.parentElement),document.execCommand("unlink",!1,"")):"check"===a||"list"===a||"ordered-list"===a?(tO(e,i,a),(0,ei.ib)(e.wysiwyg.element,i),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===i.toString()?eQ(i,e,a):document.execCommand(a,!1,""));else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,ei.ib)(e.wysiwyg.element,i));var c=(0,V.F9)(i.startContainer);if("quote"===a){if(c||(c=i.startContainer.childNodes[i.startOffset]),c){r=!1,t.classList.add("vditor-menu--current"),i.insertNode(document.createElement("wbr"));var d=(0,V.lG)(i.startContainer,"LI");d&&c.contains(d)?d.innerHTML='<blockquote data-block="0">'.concat(d.innerHTML,"</blockquote>"):c.outerHTML='<blockquote data-block="0">'.concat(c.outerHTML,"</blockquote>"),(0,ei.ib)(e.wysiwyg.element,i)}}else if("check"===a||"list"===a||"ordered-list"===a)tO(e,i,a,!1),(0,ei.ib)(e.wysiwyg.element,i),r=!1,D(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===a){if(""===i.toString()){var u=document.createElement("code");u.textContent=M.g.ZWSP,i.insertNode(u),i.setStart(u.firstChild,1),i.collapse(!0),(0,ei.Hc)(i)}else if(3===i.startContainer.nodeType){var u=document.createElement("code");i.surroundContents(u),i.insertNode(u),(0,ei.Hc)(i)}t.classList.add("vditor-menu--current")}else if("code"===a){var u=document.createElement("div");u.className="vditor-wysiwyg__block",u.setAttribute("data-type","code-block"),u.setAttribute("data-block","0"),u.setAttribute("data-marker","```"),""===i.toString()?u.innerHTML="<pre><code><wbr>\n</code></pre>":(u.innerHTML="<pre><code>".concat(i.toString(),"<wbr></code></pre>"),i.deleteContents()),i.insertNode(u),c&&(c.outerHTML=e.lute.SpinVditorDOM(c.outerHTML)),(0,ei.ib)(e.wysiwyg.element,i),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){eo(t,e)}),t.classList.add("vditor-menu--disabled")}else if("link"===a){if(""===i.toString()){var p=document.createElement("a");p.innerText=M.g.ZWSP,i.insertNode(p),i.setStart(p.firstChild,1),i.collapse(!0),eK(e,p,i);var f=e.wysiwyg.popover.querySelector("input");f.value="",f.focus(),o=!1}else{var u=document.createElement("a");u.setAttribute("href",""),u.innerHTML=i.toString(),i.surroundContents(u),i.insertNode(u),(0,ei.Hc)(i),eK(e,u,i);var m=e.wysiwyg.popover.querySelectorAll("input");m[0].value=u.innerText,m[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===a){var v='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(""===i.toString().trim())c&&""===c.innerHTML.trim().replace(M.g.ZWSP,"")?c.outerHTML=v:document.execCommand("insertHTML",!1,v),i.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,ei.Hc)(i);else{v='<table data-block="0"><thead><tr>';var h=i.toString().split("\n"),g=h[0].split(",").length>h[0].split(" ").length?",":" ";h.forEach(function(e,t){0===t?(e.split(g).forEach(function(e,t){0===t?v+="<th>".concat(e,"<wbr></th>"):v+="<th>".concat(e,"</th>")}),v+="</tr></thead>"):(1===t?v+="<tbody><tr>":v+="<tr>",e.split(g).forEach(function(e){v+="<td>".concat(e,"</td>")}),v+="</tr>")}),v+="</tbody></table>",document.execCommand("insertHTML",!1,v),(0,ei.ib)(e.wysiwyg.element,i)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===a){if(c){var b='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===c.innerHTML.trim()?c.outerHTML=b:c.insertAdjacentHTML("afterend",b),(0,ei.ib)(e.wysiwyg.element,i)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===a&&(a="strikeThrough"),""===i.toString()&&("bold"===a||"italic"===a||"strikeThrough"===a)){var y="strong";"italic"===a?y="em":"strikeThrough"===a&&(y="s");var u=document.createElement(y);u.textContent=M.g.ZWSP,i.insertNode(u),u.previousSibling&&u.previousSibling.textContent===M.g.ZWSP&&(u.previousSibling.textContent=""),i.setStart(u.firstChild,1),i.collapse(!0),(0,ei.Hc)(i)}else document.execCommand(a,!1,"")}r&&eB(e),o&&eL(e)}},e1=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var o=t.hotkey?" <".concat((0,N.ns)(t.hotkey),">"):"";2===t.level&&(o=t.hotkey?" <".concat((0,N.ns)(t.hotkey),">"):"");var i=t.tip?t.tip+o:"".concat(window.VditorI18n[t.name]).concat(o),a="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<".concat(a,' data-type="').concat(t.name,'">').concat(i,"</").concat(a,">");else{this.element.classList.add("vditor-toolbar__item");var l=document.createElement(a);l.setAttribute("data-type",t.name),l.className="vditor-tooltipped vditor-tooltipped__".concat(t.tipPosition),l.setAttribute("aria-label",i),l.innerHTML=t.icon,this.element.appendChild(l)}t.prefix&&this.element.children[0].addEventListener((0,N.Le)(),function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?e0(e,r.element.children[0],n):"ir"===e.currentMode?t4(e,r.element.children[0],t.prefix||"",t.suffix||""):tu(e,r.element.children[0],t.prefix||"",t.suffix||""))})},e2=(e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),e6=function(e,t,n){var r;if("string"!=typeof n?(B(e,["subToolbar","hint"]),n.preventDefault(),r=A(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",j(e.toolbar.elements,M.g.EDIT_TOOLBARS),D(e.toolbar.elements,M.g.EDIT_TOOLBARS),R(e.toolbar.elements,["outdent","indent"]),"ir"===t)P(e.toolbar.elements,["both"]),q(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),t6(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),eE(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){eo(t,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})});else if("wysiwyg"===t)P(e.toolbar.elements,["both"]),q(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",eE(e),e$(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if("sv"===t){q(e.toolbar.elements,["both"]),P(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none","both"===e.options.preview.mode?e.sv.element.style.display="block":"editor"===e.options.preview.mode&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var o=tl(r,e);"<div data-block='0'></div>"===o&&(o=""),e.sv.element.innerHTML=o,eh(e.sv.element),tc(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),eE(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),eY(e)),ea(e),ex(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(e.currentMode,'"]')).classList.add("vditor-menu--current")),e.outline.toggle(e,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},e3=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," <").concat((0,N.ns)("⌥⌘7"),'></button>\n<button data-mode="ir">').concat(window.VditorI18n.instantRendering," <").concat((0,N.ns)("⌥⌘8"),'></button>\n<button data-mode="sv">').concat(window.VditorI18n.splitView," <").concat((0,N.ns)("⌥⌘9"),"></button>"),r.element.appendChild(o),r._bindEvent(t,o,n),r}return e2(t,e),t.prototype._bindEvent=function(e,t,n){z(e,t,this.element.children[0],n.level),t.children.item(0).addEventListener((0,N.Le)(),function(t){e6(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()}),t.children.item(1).addEventListener((0,N.Le)(),function(t){e6(e,"ir",t),t.preventDefault(),t.stopPropagation()}),t.children.item(2).addEventListener((0,N.Le)(),function(t){e6(e,"sv",t),t.preventDefault(),t.stopPropagation()})},t}(e1),e5=function(e,t){return(0,ei.Gb)(e,t)?getSelection().toString():""},e4=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(A(e)),B(e,["subToolbar","hint"])})},e8=function(e,t){t.addEventListener("dblclick",function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,ev.E)(t.target,e.options.lang,e.options.theme))})},e9=function(e,t){t.addEventListener("blur",function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,ei.zh)(e),e.options.blur&&e.options.blur(A(e))})},e7=function(e,t){t.addEventListener("dragstart",function(e){e.dataTransfer.setData(M.g.DROP_EDITOR,M.g.DROP_EDITOR)}),t.addEventListener("drop",function(t){t.dataTransfer.getData(M.g.DROP_EDITOR)?tR(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&tQ(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},te=function(e,t,n){t.addEventListener("copy",function(t){return n(t,e)})},tt=function(e,t,n){t.addEventListener("cut",function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")})},tn=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,ei.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},tr=function(e,t){t.addEventListener("keydown",function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!((e.options.hint.extend.length>1||e.toolbar.elements.emoji)&&e.hint.select(t,e))){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||ed("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(eb(e,t))return}else if("wysiwyg"===e.currentMode){if(eP(e,t))return}else if("ir"===e.currentMode&&em(e,t))return;if(e.options.ctrlEnter&&ed("⌘Enter",t)){e.options.ctrlEnter(A(e)),t.preventDefault();return}if(ed("⌘Z",t)&&!e.toolbar.elements.undo){e.undo.undo(e),t.preventDefault();return}if(ed("⌘Y",t)&&!e.toolbar.elements.redo){e.undo.redo(e),t.preventDefault();return}if("Escape"===t.key){"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(A(e)),t.preventDefault();return}if((0,N.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,V.lG)(getSelection().getRangeAt(0).startContainer,n)?ej(e):eI(e,n),eL(e)}else"sv"===e.currentMode?td(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&t3(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,N.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?e6(e,"wysiwyg",t):"Digit8"===t.code?e6(e,"ir",t):"Digit9"===t.code&&e6(e,"sv",t),!0;e.options.toolbar.find(function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find(function(n){return!!n.hotkey&&(ed(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,N.Le)())),t.preventDefault(),!0):void 0)}):ed(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,N.Le)())),t.preventDefault(),!0):void 0})}})},to=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var t=e5(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,V.a1)(n.target,"data-type","footnotes-block")||(0,V.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment(),"function"==typeof e.options.unSelect&&e.options.unSelect())})}})},ti=function(e,t){var n=(0,ei.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,V.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var o=e.lute.SpinVditorSVDOM(r.textContent);o="<div data-block='0'>"+o.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=o:r.outerHTML=o,eh(e.sv.element),(0,ei.ib)(e.sv.element,n),tn(e)},ta=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},tl=function(e,t){return F("SpinVditorSVDOM",e,"argument",t.options.debugger),F("SpinVditorSVDOM",e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>","result",t.options.debugger),e},ts=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=t&&"text"!==t&&"table"!==t&&"heading-marker"!==t&&"newline"!==t&&"yaml-front-matter-open-marker"!==t&&"yaml-front-matter-close-marker"!==t&&"code-block-info"!==t&&"code-block-close-marker"!==t&&"code-block-open-marker"!==t?e.textContent:"",o=!1;for("newline"===t&&(o=!0);n&&!o;){var i=n.getAttribute("data-type");if("li-marker"===i||"blockquote-marker"===i||"task-marker"===i||"padding"===i){var a=n.textContent;if("li-marker"===i&&("code-block-open-marker"===t||"code-block-info"===t))r=a.replace(/\S/g," ")+r;else if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var l=ta(e,"code-block-open-marker");l&&l.previousElementSibling&&(n=l.previousElementSibling,r=a+r)}else r=a+r}else"newline"===i&&(o=!0);n=n.previousElementSibling}return r},tc=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=A(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,N.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},td=function(e,t){var n=(0,ei.zh)(e),r=(0,U.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},tu=function(e,t,n,r){var o=(0,ei.zh)(e),i=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(e.sv.element.innerHTML='<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">\n</span></span>',(0,ei.ib)(e.sv.element,o));var a=(0,V.F9)(o.startContainer),l=(0,U.S)(o.startContainer,"SPAN");if(a){if("link"===i){var s=void 0;s=""===o.toString()?"".concat(n).concat(Lute.Caret).concat(r):"".concat(n).concat(o.toString()).concat(r.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,s);return}if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i||"line"===i){var s=void 0;s=""===o.toString()?"".concat(n).concat(Lute.Caret).concat("code"===i?"":r):"".concat(n).concat(o.toString()).concat(Lute.Caret).concat("code"===i?"":r),"table"===i||"code"===i&&l&&""!==l.textContent?s="\n\n"+s:"line"===i&&(s="\n\n".concat(n,"\n").concat(Lute.Caret)),document.execCommand("insertHTML",!1,s);return}if(("check"===i||"list"===i||"ordered-list"===i||"quote"===i)&&l){var c="* ";"check"===i?c="* [ ] ":"ordered-list"===i?c="1. ":"quote"===i&&(c="> ");var d=ta(l,"newline");d?d.insertAdjacentText("afterend",c):a.insertAdjacentText("afterbegin",c),eg(e);return}(0,ei.ib)(e.sv.element,o),tc(e)}},tp=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},tf=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},tm=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},tv=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},th=function(e,t){e.tip.hide();var n=[],r="",o="";e.options.lang,e.options;for(var i=t.length,a=0;a<i;a++)!function(i){var a=t[i],l=!0;a.name||(r+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),l=!1),a.size>e.options.upload.max&&(r+="<li>".concat(a.name," ").concat(window.VditorI18n.over," ").concat(e.options.upload.max/1024/1024,"M</li>"),l=!1);var s=a.name.lastIndexOf("."),c=a.name.substr(s),d=e.options.upload.filename(a.name.substr(0,s))+c;e.options.upload.accept&&(e.options.upload.accept.split(",").some(function(e){var t=e.trim();if(0===t.indexOf(".")){if(c.toLowerCase()===t.toLowerCase())return!0}else if(a.type.split("/")[0]===t.split("/")[0])return!0;return!1})||(r+="<li>".concat(a.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),l=!1)),l&&(n.push(a),o+="<li>".concat(d," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))}(a);if(e.tip.show("<ul>".concat(r).concat(o,"</ul>")),e.options.upload.cancel){var l=e.tip.element.querySelector(".vditorCancelUpload");l&&l.addEventListener("click",function(){e.options.upload.cancel(n),e.tip.hide(),e.upload.isUploading=!1})}return n},tg=function(e,t){tp(t).focus();var n=JSON.parse(e),r="";1===n.code&&(r="".concat(n.msg)),n.data.errFiles&&n.data.errFiles.length>0&&(r="<ul><li>".concat(r,"</li>"),n.data.errFiles.forEach(function(e){var n=e.lastIndexOf("."),o=t.options.upload.filename(e.substr(0,n))+e.substr(n);r+="<li>".concat(o," ").concat(window.VditorI18n.uploadError,"</li>")}),r+="</ul>"),r?t.tip.show(r):t.tip.hide();var o="";Object.keys(n.data.succMap).forEach(function(e){var r=n.data.succMap[e],i=e.lastIndexOf("."),a=e.substr(i),l=t.options.upload.filename(e.substr(0,i))+a;0===(a=a.toLowerCase()).indexOf(".wav")||0===a.indexOf(".mp3")||0===a.indexOf(".ogg")?"wysiwyg"===t.currentMode?o+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code><audio controls="controls" src="'.concat(r,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(r,'"></audio></pre></div>\n'):"ir"===t.currentMode?o+='<audio controls="controls" src="'.concat(r,'"></audio>\n'):o+="[".concat(l,"](").concat(r,")\n"):0===a.indexOf(".apng")||0===a.indexOf(".bmp")||0===a.indexOf(".gif")||0===a.indexOf(".ico")||0===a.indexOf(".cur")||0===a.indexOf(".jpg")||0===a.indexOf(".jpeg")||0===a.indexOf(".jfif")||0===a.indexOf(".pjp")||0===a.indexOf(".pjpeg")||0===a.indexOf(".png")||0===a.indexOf(".svg")||0===a.indexOf(".webp")?"wysiwyg"===t.currentMode?o+='<img alt="'.concat(l,'" src="').concat(r,'">\n'):o+=".concat(r,")\n"):"wysiwyg"===t.currentMode?o+='<a href="'.concat(r,'">').concat(l,"</a>\n"):o+="[".concat(l,"](").concat(r,")\n")}),(0,ei.Hc)(t.upload.range),document.execCommand("insertHTML",!1,o),t.upload.range=getSelection().getRangeAt(0).cloneRange()},tb=function(e,t,n){var r,o,i,a;return r=void 0,o=void 0,i=void 0,a=function(){var r,o,i,a,l,s,c,d,u,p,f,m,v,h;return tm(this,function(g){switch(g.label){case 0:for(i=0,r=[],o=!0===e.options.upload.multiple?t.length:1;i<o;i++)(a=t[i])instanceof DataTransferItem&&(a=a.getAsFile()),r.push(a);if(!e.options.upload.handler)return[3,2];return[4,e.options.upload.handler(r)];case 1:return l=g.sent(),n&&(n.value=""),"string"==typeof l&&e.tip.show(l),[2];case 2:if(!e.options.upload.url||!e.upload)return n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2];if(!e.options.upload.file)return[3,4];return[4,e.options.upload.file(r)];case 3:r=g.sent(),g.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(l=e.options.upload.validate(r)))return e.tip.show(l),[2];if(s=tp(e),e.upload.range=(0,ei.zh)(e),0===(c=th(e,r)).length)return n&&(n.value=""),[2];for(p=0,d=new FormData,f=Object.keys(u=e.options.upload.extraData);p<f.length;p++)m=f[p],d.append(m,u[m]);for(i=0,v=c.length;i<v;i++)d.append(e.options.upload.fieldName,c[i]);return h=new XMLHttpRequest,e.upload.xhr=h,h.open("POST",e.options.upload.url),e.options.upload.token&&h.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(h.withCredentials=!0),tf(e,h),e.upload.isUploading=!0,s.setAttribute("contenteditable","false"),h.onreadystatechange=function(){if(h.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,s.setAttribute("contenteditable","true"),h.status>=200&&h.status<300)if(e.options.upload.success)e.options.upload.success(s,h.responseText);else{var r=h.responseText;e.options.upload.format&&(r=e.options.upload.format(t,h.responseText)),tg(r,e)}else e.options.upload.error?e.options.upload.error(h.responseText):e.tip.show(h.responseText);n&&(n.value=""),e.upload.element.style.display="none",e.upload.xhr=void 0}},h.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},h.send(d),[2]}})},new(i||(i=Promise))(function(e,t){function n(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(n,l)}s((a=a.apply(r,o||[])).next())})},ty=function(e,t,n){var r=(0,V.F9)(t.startContainer);if(r||(r=e.wysiwyg.element),n&&"formatItalic"!==n.inputType&&"deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&"formatBold"!==n.inputType&&"formatRemove"!==n.inputType&&"formatStrikeThrough"!==n.inputType&&"insertUnorderedList"!==n.inputType&&"insertOrderedList"!==n.inputType&&"formatOutdent"!==n.inputType&&"formatIndent"!==n.inputType&&""!==n.inputType||!n){var o,i,a,l=eM(t.startContainer);l&&l.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),r.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null==(o=r.previousElementSibling)||o.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))});var s="";"link-ref-defs-block"===r.getAttribute("data-type")&&(r=e.wysiwyg.element);var c=r.isEqualNode(e.wysiwyg.element),d=(0,V.a1)(r,"data-type","footnotes-block");if(c)s=r.innerHTML;else{var u=(0,V.O9)(t.startContainer);if(u&&!d&&(r=(0,U.S)(t.startContainer,"BLOCKQUOTE")?(0,V.F9)(t.startContainer)||r:u),d&&(r=d),s=r.outerHTML,"UL"===r.tagName||"OL"===r.tagName){var p=r.previousElementSibling,f=r.nextElementSibling;p&&("UL"===p.tagName||"OL"===p.tagName)&&(s=p.outerHTML+s,p.remove()),f&&("UL"===f.tagName||"OL"===f.tagName)&&(s+=f.outerHTML,f.remove()),s=s.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}r.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!r.isEqualNode(e)&&(s+=e.outerHTML,e.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!r.isEqualNode(e)&&(s+=e.outerHTML,e.remove())}))}if('<p data-block="0">```<wbr></p>'===(s=s.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))&&e.hint.recentLanguage&&(s='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),F("SpinVditorDOM",s,"argument",e.options.debugger),F("SpinVditorDOM",s=e.lute.SpinVditorDOM(s),"result",e.options.debugger),c)r.innerHTML=s;else if(r.outerHTML=s,d){var m=(0,V.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(m){var v=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(m.getAttribute("data-marker"),'"]'));v&&v.setAttribute("aria-label",m.textContent.trim().substr(0,24))}}var h=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");h.forEach(function(e,t){0===t?i=e:(i.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),h.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",h[0]);var g=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");g.forEach(function(e,t){0===t?a=e:(a.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),g.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",g[0]),(0,ei.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){eo(t,e)}),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}ea(e),eL(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},tw=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})},tk=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},tE=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,V.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},tx=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,N.yl)(n))&&"Escape"!==n.key&&!n.shiftKey&&!n.altKey){var r=(0,V.lG)(e.startContainer,"P")||(0,V.lG)(e.startContainer,"LI");if(r&&0===(0,ei.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var o=document.createTextNode(M.g.ZWSP);e.insertNode(o),e.setStartAfter(o)}}},tS=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,V.a1)(e.startContainer,"data-type","math-inline")||(0,V.a1)(e.startContainer,"data-type","html-entity")||(0,V.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},t_=function(e,t){var n=(0,ei.zh)(e),r=(0,V.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'.concat(M.g.ZWSP,"<wbr>\n</p>")),(0,ei.ib)(e[e.currentMode].element,n),eY(e),tR(e))},tT=function(e){var t=(0,V.lG)(e,"TABLE");return!!(t&&t.rows[0].cells[0].isSameNode(e))&&t},tL=function(e){var t=(0,V.lG)(e,"TABLE");return!!(t&&t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},tM=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,ei.Hc)(t)),r},tC=function(e,t,n,r,o){var i=(0,ei.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(i.start).indexOf("\n")||"ArrowRight"===t.key&&i.start>=r.textContent.trimRight().length){var a=o.nextElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!0),(0,ei.Hc)(n)),t.preventDefault(),!0}return!1},tA=function(e,t,n,r,o){var i=(0,ei.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,i.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===i.start){var a=o.previousElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!1),(0,ei.Hc)(n)),t.preventDefault(),!0}return!1},tO=function(e,t,n,r){void 0===r&&(r=!0);var o=(0,V.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r&&o){for(var i="",a=0;a<o.parentElement.childElementCount;a++){var l=o.parentElement.children[a].querySelector("input");l&&l.remove(),i+='<p data-block="0">'.concat(o.parentElement.children[a].innerHTML.trimLeft(),"</p>")}o.parentElement.insertAdjacentHTML("beforebegin",i),o.parentElement.remove()}else if(o)if("check"===n)o.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")});else{o.querySelector("input")&&o.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")});var s=void 0;"list"===n?(s=document.createElement("ul")).setAttribute("data-marker","*"):(s=document.createElement("ol")).setAttribute("data-marker","1."),s.setAttribute("data-block","0"),s.setAttribute("data-tight",o.parentElement.getAttribute("data-tight")),s.innerHTML=o.parentElement.innerHTML,o.parentElement.parentNode.replaceChild(s,o.parentElement)}else{var c=(0,V.a1)(t.startContainer,"data-block","0");c||(e[e.currentMode].element.querySelector("wbr").remove(),(c=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(c.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(c.innerHTML,"</li></ul>")),c.remove()):"list"===n?(c.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(c.innerHTML,"</li></ul>")),c.remove()):"ordered-list"===n&&(c.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(c.innerHTML,"</li></ol>")),c.remove())}},tH=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var o=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&o.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=r.parentElement,a="";o.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1".concat(t.slice(-1))),a+='<li data-node-id="'.concat(e.getAttribute("data-node-id"),'" data-marker="').concat(t,'">').concat(e.innerHTML,"</li>"),e.remove()}),r.insertAdjacentHTML("beforeend","<".concat(i.tagName,' data-block="0">').concat(a,"</").concat(i.tagName,">")),"wysiwyg"===e.currentMode?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,ei.ib)(e[e.currentMode].element,n);var l=(0,V.O9)(n.startContainer);l&&l.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){eo(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),tR(e),eY(e)}else e[e.currentMode].element.focus()},tN=function(e,t,n,r){var o=(0,V.lG)(t.parentElement,"LI");if(o){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=t.parentElement,a=i.cloneNode(),l=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&l.push(t),t=t.nextElementSibling)});var s=!1,c="";i.querySelectorAll("li").forEach(function(e){s&&(c+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(l[l.length-1])&&(s=!0)}),l.reverse().forEach(function(e){o.insertAdjacentElement("afterend",e)}),c&&(a.innerHTML=c,l[0].insertAdjacentElement("beforeend",a)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,ei.ib)(e[e.currentMode].element,n);var d=(0,V.O9)(n.startContainer);d&&d.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){eo(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),tR(e),eY(e)}else e[e.currentMode].element.focus()},tD=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,o=e.rows.length,i=0,a=0;a<o;a++)for(var l=0;l<r;l++)if(e.rows[a].cells[l].isSameNode(n)){i=l;break}for(var s=0;s<o;s++)e.rows[s].cells[i].setAttribute("align",t)},tI=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&!!(t.replace(/ /g,"").length>2)&&(!(t.indexOf("-")>-1)||-1!==t.trimLeft().indexOf(" ")||!(e.trimRight().split("\n").length>1))&&0!==t.indexOf(" ")&&0!==t.indexOf(" ")},tj=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf(" ")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},tR=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?eL(e,t):"ir"===e.currentMode?t6(e,t):"sv"===e.currentMode&&tc(e,t)},tP=function(e,t,n,r){var o,i=e.startContainer,a=(0,V.lG)(i,"LI");if(a){if(!(0,N.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&a.contains(n)&&n.nextElementSibling)return a&&!a.textContent.endsWith("\n")&&a.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),tR(t),r.preventDefault(),!0;if(!(0,N.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&!a.previousElementSibling&&""===e.toString()&&0===(0,ei.im)(a,t[t.currentMode].element,e).start)return a.nextElementSibling?(a.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>")),a.remove()):a.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>"),(0,ei.ib)(t[t.currentMode].element,e),tR(t),r.preventDefault(),!0;if(!(0,N.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===a.textContent.trim().replace(M.g.ZWSP,"")&&""===e.toString()&&(null==(o=a.previousElementSibling)?void 0:o.tagName)==="LI")return a.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(a.previousElementSibling),e.collapse(!1),a.remove(),(0,ei.ib)(t[t.currentMode].element,e),tR(t),r.preventDefault(),!0;if(!(0,N.yl)(r)&&!r.altKey&&"Tab"===r.key){var l=!1;if(0!==e.startOffset||(3!==i.nodeType||i.previousSibling)&&(3===i.nodeType||"LI"!==i.nodeName)?a.classList.contains("vditor-task")&&1===e.startOffset&&3!==i.previousSibling.nodeType&&"INPUT"===i.previousSibling.tagName&&(l=!0):l=!0,l||""!==e.toString())return r.shiftKey?tN(t,a,e,a.parentElement):tH(t,a,e),r.preventDefault(),!0}}return!1},tq=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""===t.toString()||t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)),(0,ei.Hc)(t),tR(e),n.preventDefault(),!0},tB=function(e,t,n,r){if(n){if(!(0,N.yl)(e)&&!e.altKey&&"Enter"===e.key){var o,i,a=String.raw(T||(o=["",""],i=["",""],Object.defineProperty?Object.defineProperty(o,"raw",{value:i}):o.raw=i,T=o),n.textContent).replace(/\\\|/g,"").trim(),l=a.split("|");if(a.startsWith("|")&&a.endsWith("|")&&l.length>3){var s=l.map(function(){return"---"}).join("|");return s=n.textContent+"\n"+s.substring(3,s.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(s),(0,ei.ib)(t[t.currentMode].element,r),tR(t),tn(t),e.preventDefault(),!0}if(tI(n.innerHTML)&&n.previousElementSibling){var c="",d=n.innerHTML.trimRight().split("\n");return d.length>1&&(d.pop(),c='<p data-block="0">'.concat(d.join("\n"),"</p>")),n.insertAdjacentHTML("afterend","".concat(c,'<hr data-block="0"><p data-block="0"><wbr>\n</p>')),n.remove(),(0,ei.ib)(t[t.currentMode].element,r),tR(t),tn(t),e.preventDefault(),!0}if(tj(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,ei.ib)(t[t.currentMode].element,r),tR(t),tn(t),e.preventDefault(),!0}if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,N.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,ei.im)(n,t[t.currentMode].element,r).start){var u=(0,V.DX)(n.previousElementSibling);u.textContent.endsWith("\n")||(u.textContent=u.textContent+"\n"),u.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,ei.ib)(t[t.currentMode].element,r)}return!1}},tz=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)r+='<td align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </td>');"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(r,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(r,"</tr>")),tR(e)},tV=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)"TH"===n.tagName?r+='<th align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </th>'):r+='<td align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </td>');if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr"));var i=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",i),n.parentElement.parentElement.remove(),(0,ei.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>"));tR(e)},tU=function(e,t,n,r){void 0===r&&(r="afterend");for(var o=0,i=n.previousElementSibling;i;)o++,i=i.previousElementSibling;for(var a=0;a<t.rows.length;a++)0===a?t.rows[a].cells[o].insertAdjacentHTML(r,"<th> </th>"):t.rows[a].cells[o].insertAdjacentHTML(r,"<td> </td>");tR(e)},tF=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,ei.Hc)(t),tR(e)}},tW=function(e,t,n,r){for(var o=0,i=r.previousElementSibling;i;)o++,i=i.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var l=n.rows[a].cells;if(1===l.length){n.remove(),eY(e);break}l[o].remove()}(0,ei.Hc)(t),tR(e)},tG=function(e,t,n){var r=n.startContainer,o=(0,V.lG)(r,"TD")||(0,V.lG)(r,"TH");if(o){if(!(0,N.yl)(t)&&!t.altKey&&"Enter"===t.key){o.lastElementChild&&(!o.lastElementChild||o.lastElementChild.isSameNode(o.lastChild)&&"BR"===o.lastElementChild.tagName)||o.insertAdjacentHTML("beforeend","<br>");var i=document.createElement("br");return n.insertNode(i),n.setStartAfter(i),tR(e),tn(e),t.preventDefault(),!0}if("Tab"===t.key){if(t.shiftKey)return tM(o,n),t.preventDefault(),!0;var a=o.nextElementSibling;return a||(a=o.parentElement.nextElementSibling?o.parentElement.nextElementSibling.firstElementChild:"THEAD"===o.parentElement.parentElement.tagName&&o.parentElement.parentElement.nextElementSibling?o.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),a&&(n.selectNodeContents(a),(0,ei.Hc)(n)),t.preventDefault(),!0}var l=o.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===o.tagName)return l.previousElementSibling?(n.selectNodeContents(l.previousElementSibling),n.collapse(!1),(0,ei.Hc)(n)):t_(e,"beforebegin"),!0;for(var s=0,c=o.parentElement;s<c.cells.length&&!c.cells[s].isSameNode(o);s++);var d=c.previousElementSibling;return d||(d=c.parentElement.previousElementSibling.firstChild),n.selectNodeContents(d.cells[s]),n.collapse(!1),(0,ei.Hc)(n),!0}if("ArrowDown"===t.key){t.preventDefault();var c=o.parentElement;if(!c.nextElementSibling&&"TD"===o.tagName)return l.nextElementSibling?(n.selectNodeContents(l.nextElementSibling),n.collapse(!0),(0,ei.Hc)(n)):t_(e,"afterend"),!0;for(var s=0;s<c.cells.length&&!c.cells[s].isSameNode(o);s++);var a=c.nextElementSibling;return a||(a=c.parentElement.nextElementSibling.firstChild),n.selectNodeContents(a.cells[s]),n.collapse(!0),(0,ei.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,N.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var u=e.wysiwyg.popover.querySelector(".vditor-input");return u.focus(),u.select(),t.preventDefault(),!0}if(!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!tM(o,n,!1)&&l&&(""===l.textContent.trim()?(l.outerHTML='<p data-block="0"><wbr>\n</p>',(0,ei.ib)(e[e.currentMode].element,n)):(n.setStartBefore(l),n.collapse(!0)),tR(e)),t.preventDefault(),!0;if(ed("⇧⌘F",t))return tV(e,n,o),t.preventDefault(),!0;if(ed("⌘=",t))return tz(e,n,o),t.preventDefault(),!0;if(ed("⇧⌘G",t))return tU(e,l,o,"beforebegin"),t.preventDefault(),!0;if(ed("⇧⌘=",t))return tU(e,l,o),t.preventDefault(),!0;if(ed("⌘-",t))return tF(e,n,o),t.preventDefault(),!0;if(ed("⇧⌘-",t))return tW(e,n,l,o),t.preventDefault(),!0;if(ed("⇧⌘L",t))if("ir"===e.currentMode)return tD(l,"left"),tR(e),t.preventDefault(),!0;else{var p=e.wysiwyg.popover.querySelector('[data-type="left"]');if(p)return p.click(),t.preventDefault(),!0}if(ed("⇧⌘C",t))if("ir"===e.currentMode)return tD(l,"center"),tR(e),t.preventDefault(),!0;else{var p=e.wysiwyg.popover.querySelector('[data-type="center"]');if(p)return p.click(),t.preventDefault(),!0}if(ed("⇧⌘R",t))if("ir"===e.currentMode)return tD(l,"right"),tR(e),t.preventDefault(),!0;else{var p=e.wysiwyg.popover.querySelector('[data-type="right"]');if(p)return p.click(),t.preventDefault(),!0}}return!1},tK=function(e,t,n,r){if("PRE"===n.tagName&&ed("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),tR(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,N.yl)(t)&&!t.shiftKey&&!t.altKey){var o=(0,ei.im)(n,e[e.currentMode].element,r);if((0===o.start||1===o.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,ei.ib)(e[e.currentMode].element,r),tR(e),t.preventDefault(),!0}return!(0,N.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,ei.Hc)(r),(0,N.vU)()||("wysiwyg"===e.currentMode?ty(e,r):ec(e,r)),tn(e),t.preventDefault(),!0)},tJ=function(e,t,n,r){var o=t.startContainer,i=(0,V.lG)(o,"BLOCKQUOTE");if(i&&""===t.toString()){if("Backspace"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,ei.im)(i,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),i.outerHTML=i.innerHTML,(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var a=!1;if("\n"===r.innerHTML.replace(M.g.ZWSP,"")||""===r.innerHTML.replace(M.g.ZWSP,"")?(a=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,ei.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),a=!0),a)return i.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr>\n</p>")),(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0}var l=(0,V.F9)(o);if("wysiwyg"===e.currentMode&&l&&ed("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),l.outerHTML='<blockquote data-block="0">'.concat(l.outerHTML,"</blockquote>"),(0,ei.ib)(e.wysiwyg.element,t),eL(e),n.preventDefault(),!0;if(tC(e,n,t,i,i)||tA(e,n,t,i,i))return!0}return!1},tZ=function(e,t,n){var r=t.startContainer,o=(0,V.lG)(r,"LI");if(o&&o.classList.contains("vditor-task")){if(ed("⇧⌘J",n)){var i=o.firstElementChild;return i.checked?i.removeAttribute("checked"):i.setAttribute("checked","checked"),tR(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var a=o.previousElementSibling;return o.querySelector("input").remove(),a?((0,V.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+o.innerHTML.trim()),o.remove()):(o.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(o.innerHTML.trim()||"\n","</p>")),o.nextElementSibling?o.remove():o.parentElement.remove()),(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,N.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===o.textContent.trim())if((0,V.fb)(o.parentElement,"vditor-task")){var l=(0,V.O9)(r);l&&tN(e,o,t,l)}else if(o.nextElementSibling){var s="",c="",d=!1;Array.from(o.parentElement.children).forEach(function(e){o.isSameNode(e)?d=!0:d?s+=e.outerHTML:c+=e.outerHTML});var u=o.parentElement.tagName,p="OL"===o.parentElement.tagName?"":' data-marker="'.concat(o.parentElement.getAttribute("data-marker"),'"'),f="";c&&(f="UL"===o.parentElement.tagName?"":' start="1"',c="<".concat(u,' data-tight="true"').concat(p,' data-block="0">').concat(c,"</").concat(u,">")),o.parentElement.outerHTML="".concat(c,'<p data-block="0"><wbr>\n</p><').concat(u,'\n data-tight="true"').concat(p,' data-block="0"').concat(f,">").concat(s,"</").concat(u,">")}else o.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===o.parentElement.querySelectorAll("li").length?o.parentElement.remove():o.remove();else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(o.lastChild),o.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(o.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents()));return(0,ei.ib)(e[e.currentMode].element,t),tR(e),tn(e),n.preventDefault(),!0}}return!1},tX=function(e,t,n,r){if(3!==t.startContainer.nodeType){var o=t.startContainer.children[t.startOffset];if(o&&"HR"===o.tagName)return t.selectNodeContents(o.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var i=r.previousElementSibling;if(i&&0===(0,ei.im)(r,e[e.currentMode].element,t).start&&((0,N.vU)()&&"HR"===i.tagName||"TABLE"===i.tagName)){if("TABLE"===i.tagName){var a=i.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else i.remove();return(0,ei.ib)(e[e.currentMode].element,t),tR(e),n.preventDefault(),!0}}return!1},tY=function(e){(0,N.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},t$=function(e,t,n){var r,o;if(!(0,N.vU)())return!1;if("ArrowUp"===e.key&&t&&(null==(r=t.previousElementSibling)?void 0:r.tagName)==="TABLE"){var i=t.previousElementSibling;return n.selectNodeContents(i.rows[i.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return"ArrowDown"===e.key&&!!t&&(null==(o=t.nextElementSibling)?void 0:o.tagName)==="TABLE"&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},tQ=function(e,t,n){return tw(void 0,void 0,void 0,function(){var r,o,i,a,l,s,c,d,u,p,f,m,v,h,g,b;return tk(this,function(y){switch(y.label){case 0:if("true"!==e[e.currentMode].element.getAttribute("contenteditable"))return[2];if(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),o=t.clipboardData.getData("text/plain"),i=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),o=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(i=t.dataTransfer.items)),a={},l=function(t,n){if(!n)return["",Lute.WalkContinue];if(e.options.upload.renderLinkDest)return e.options.upload.renderLinkDest(e,t,n);var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&o.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(o.withCredentials=!0),tf(e,o),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status){var t=o.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(o.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===r&&(e.textContent=n.data.url)});else{var i=e[e.currentMode].element.querySelector('img[src="'.concat(r,'"]'));i.src=n.data.url,"ir"===e.currentMode&&(i.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}tR(e)}else e.tip.show(o.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(o.responseText)}},o.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]},(r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(o,'">').concat(o,"</a>")||r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='\x3c!--StartFragment--\x3e<a href="'.concat(o,'">').concat(o,"</a>\x3c!--EndFragment--\x3e"))&&(r=""),(s=new DOMParser().parseFromString(r,"text/html")).body&&(r=s.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),c=e[e.currentMode].element.scrollHeight,d=er(r,o,e.currentMode),!(u="sv"===e.currentMode?(0,V.a1)(t.target,"data-type","code-block"):(0,V.lG)(t.target,"CODE")))return[3,1];return"sv"===e.currentMode?document.execCommand("insertHTML",!1,o.replace(/&/g,"&").replace(/</g,"<")):(p=(0,ei.im)(t.target,e[e.currentMode].element),"PRE"!==u.parentElement.tagName&&(o+=M.g.ZWSP),u.textContent=u.textContent.substring(0,p.start)+o+u.textContent.substring(p.end),(0,ei.$j)(p.start+o.length,p.start+o.length,u.parentElement),(null==(b=u.parentElement)?void 0:b.nextElementSibling.classList.contains("vditor-".concat(e.currentMode,"__preview")))&&(u.parentElement.nextElementSibling.innerHTML=u.outerHTML,eo(u.parentElement.nextElementSibling,e))),[3,10];case 1:if(!d)return[3,2];return n.pasteCode(d),[3,10];case 2:if(""===r.trim())return[3,5];if((f=document.createElement("div")).innerHTML=r,e.options.upload.base64ToLink)return[3,4];return[4,t0(e,f,("clipboardData"in t?t.clipboardData:t.dataTransfer).getData("text/rtf"))];case 3:y.sent(),y.label=4;case 4:return f.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),f.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===e.currentMode?(a.HTML2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(e.lute.HTML2VditorIRDOM(f.innerHTML),e)):"wysiwyg"===e.currentMode?(a.HTML2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(e.lute.HTML2VditorDOM(f.innerHTML),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),ti(e,e.lute.HTML2Md(f.innerHTML).trimRight())),e.outline.render(e),[3,10];case 5:if(!(i.length>0))return[3,9];if(!(e.options.upload.url||e.options.upload.handler))return[3,7];return[4,tb(e,i)];case 6:return y.sent(),[3,8];case 7:m=new FileReader,"clipboardData"in t?v=(i=t.clipboardData.files)[0]:t.dataTransfer.types.includes("Files")&&(v=(i=t.dataTransfer.items)[0].getAsFile()),v&&v.type.startsWith("image")&&(m.readAsDataURL(v),m.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'.concat(v.name,'" src="').concat(m.result.toString(),'">\n'):t+=".concat(m.result.toString(),")\n"),document.execCommand("insertHTML",!1,t)}),y.label=8;case 8:return[3,10];case 9:""!==o.trim()&&0===i.length&&(""!==(h=(0,ei.zh)(e)).toString()&&e.lute.IsValidLinkDest(o)&&(o="[".concat(h.toString(),"](").concat(o,")")),"ir"===e.currentMode?(a.Md2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(Lute.Sanitize(e.lute.Md2VditorIRDOM(o)),e)):"wysiwyg"===e.currentMode?(a.Md2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,ei.oC)(Lute.Sanitize(e.lute.Md2VditorDOM(o)),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),ti(e,o)),e.outline.render(e)),y.label=10;case 10:return"sv"!==e.currentMode&&((g=(0,V.F9)((0,ei.zh)(e).startContainer))&&(h=(0,ei.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),h.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?g.outerHTML=e.lute.SpinVditorDOM(g.outerHTML):g.outerHTML=e.lute.SpinVditorIRDOM(g.outerHTML),(0,ei.ib)(e[e.currentMode].element,h)),e[e.currentMode].element.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){eo(t,e)})),e.wysiwyg.triggerRemoveComment(e),tR(e),e[e.currentMode].element.scrollHeight-c>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&tn(e),[2]}})})},t0=function(e,t,n){return tw(void 0,void 0,void 0,function(){var r,o,i,a,l,s,c,d,u,p,f,m,v,h;return tk(this,function(g){switch(g.label){case 0:if(!n)return[2];if(o=RegExp("(?:("+(r=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/).source+"))([\\da-fA-F\\s]+)\\}","g"),i=n.match(o),a=[],i)for(l=0,s=i;l<s.length;l++)c=s[l],d=void 0,c.includes("\\pngblip")?d="image/png":c.includes("\\jpegblip")&&(d="image/jpeg"),d&&a.push({hex:c.replace(r,"").replace(/[^\da-fA-F]/g,""),type:d});for(u=[],t1(t,function(e){if("V:SHAPE"===e.tagName)return t1(e,function(t){"V:IMAGEDATA"===t.tagName&&u.push({shape:e,img:t})}),!1}),p=0;p<u.length;p++)(f=document.createElement("img")).src="data:"+a[p].type+";base64,"+btoa((a[p].hex.match(/\w{2}/g)||[]).map(function(e){return String.fromCharCode(parseInt(e,16))}).join("")),f.title=u[p].img.getAttribute("title"),u[p].shape.parentNode.replaceChild(f,u[p].shape);m=t.querySelectorAll("img"),p=0,g.label=1;case 1:if(!(p<m.length))return[3,4];if(!(v=m[p].src||""))return[3,3];return h=m[p],[4,e.options.upload.base64ToLink(v)];case 2:h.src=g.sent(),g.label=3;case 3:return p++,[3,1];case 4:return[2]}})})},t1=function(e,t){if(!1!==t(e))for(var n=0;n<e.children.length;n++)t1(e.children[n],t)},t2=function(e){e.hint.render(e);var t,n,r=(0,ei.zh)(e).startContainer,o=(0,V.a1)(r,"data-type","code-block-info");if(o)if(""===o.textContent.replace(M.g.ZWSP,"")&&e.hint.recentLanguage)o.textContent=M.g.ZWSP+e.hint.recentLanguage,(0,ei.zh)(e).selectNodeContents(o);else{var i=[],a=o.textContent.substring(0,(0,ei.im)(o,e.ir.element).start).replace(M.g.ZWSP,"");(e.options.preview.hljs.langs||M.g.ALIAS_CODE_LANGUAGES.concat((null!=(n=null==(t=window.hljs)?void 0:t.listLanguages())?n:[]).sort())).forEach(function(e){e.indexOf(a.toLowerCase())>-1&&i.push({html:e,value:e})}),e.hint.genHTML(i,a,e)}},t6=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&t2(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=A(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,N.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},t3=function(e,t){var n=(0,ei.zh)(e),r=(0,V.F9)(n.startContainer)||n.startContainer;if(r){var o=r.querySelector(".vditor-ir__marker--heading");o?o.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),ec(e,n.cloneRange()),eT(e)}},t5=function(e,t,n){var r=(0,V.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var o=document.createElement("div");o.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=o.firstElementChild.innerHTML.trim()}},t4=function(e,t,n,r){var o=(0,ei.zh)(e),i=t.getAttribute("data-type"),a=o.startContainer;3===a.nodeType&&(a=a.parentElement);var l=!0;if(t.classList.contains("vditor-menu--current"))if("quote"===i){var s=(0,V.lG)(a,"BLOCKQUOTE");s&&(o.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'.concat(s.innerHTML,"</p>"):s.innerHTML)}else if("link"===i){var c=(0,V.a1)(o.startContainer,"data-type","a");if(c){var d=(0,V.fb)(o.startContainer,"vditor-ir__link");d?(o.insertNode(document.createElement("wbr")),c.outerHTML=d.innerHTML):c.outerHTML=c.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===i?t5(o,e,"em"):"bold"===i?t5(o,e,"strong"):"strike"===i?t5(o,e,"s"):"inline-code"===i?t5(o,e,"code"):("check"===i||"list"===i||"ordered-list"===i)&&(tO(e,o,i),l=!1,t.classList.remove("vditor-menu--current"));else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,ei.ib)(e.ir.element,o));var u=(0,V.F9)(o.startContainer);if("line"===i){if(u){var p='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===u.innerHTML.trim()?u.outerHTML=p:u.insertAdjacentHTML("afterend",p)}}else if("quote"===i)u&&(o.insertNode(document.createElement("wbr")),u.outerHTML='<blockquote data-block="0">'.concat(u.outerHTML,"</blockquote>"),l=!1,t.classList.add("vditor-menu--current"));else if("link"===i){var f=void 0;f=""===o.toString()?"".concat(n,"<wbr>").concat(r):"".concat(n).concat(o.toString()).concat(r.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,f),l=!1,t.classList.add("vditor-menu--current")}else if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i){var f=void 0;""===o.toString()?f="".concat(n,"<wbr>").concat(r):(f="code"===i?"".concat(n,"\n").concat(o.toString(),"<wbr>").concat(r):"table"===i?"".concat(n).concat(o.toString(),"<wbr>").concat(r):"".concat(n).concat(o.toString()).concat(r,"<wbr>"),o.deleteContents()),("table"===i||"code"===i)&&(f="\n"+f+"\n\n");var m=document.createElement("span");m.innerHTML=f,o.insertNode(m),ec(e,o),"table"===i&&(o.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,ei.Hc)(o))}else("check"===i||"list"===i||"ordered-list"===i)&&(tO(e,o,i,!1),l=!1,D(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,ei.ib)(e.ir.element,o),t6(e),l&&eT(e)},t8=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},t9=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r=decodeURIComponent(e.getAttribute("data-value")),o=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var i=(0,V.a1)(o.startContainer,"data-type","code-block-info");if(i){i.textContent=M.g.ZWSP+r.trimRight(),o.selectNodeContents(i),o.collapse(!1),t6(n),i.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+r.trimRight()}),eo(i.parentElement.querySelector(".vditor-ir__preview"),n),t.recentLanguage=r.trimRight();return}}if("wysiwyg"===n.currentMode&&3!==o.startContainer.nodeType){var a=o.startContainer,l=void 0;if((l=a.classList.contains("vditor-input")?a:a.firstElementChild)&&l.classList.contains("vditor-input")){l.value=r.trimRight(),o.selectNodeContents(l),o.collapse(!1),l.dispatchEvent(new CustomEvent("input",{detail:1})),t.recentLanguage=r.trimRight();return}}if(o.setStart(o.startContainer,t.lastIndex),o.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,ei.oC)(n.lute.SpinVditorSVDOM(r),n):"wysiwyg"===n.currentMode?(0,ei.oC)(n.lute.SpinVditorDOM(r),n):(0,ei.oC)(n.lute.SpinVditorIRDOM(r),n):(0,ei.oC)(r,n),":"===t.splitChar&&r.indexOf(":")>-1&&"sv"!==n.currentMode&&o.insertNode(document.createTextNode(" ")),o.collapse(!1),(0,ei.Hc)(o),"wysiwyg"===n.currentMode){var s=(0,V.fb)(o.startContainer,"vditor-wysiwyg__block");s&&s.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(s.lastElementChild.innerHTML=s.firstElementChild.innerHTML,eo(s.lastElementChild,n))}else if("ir"===n.currentMode){var s=(0,V.fb)(o.startContainer,"vditor-ir__marker--pre");s&&s.nextElementSibling.classList.contains("vditor-ir__preview")&&(s.nextElementSibling.innerHTML=s.innerHTML,eo(s.nextElementSibling,n))}tR(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t,n=this;if(window.getSelection().focusNode){var r=getSelection().getRangeAt(0);t=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(t,e.options.hint.extend);if(void 0===o)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var i=""===o?e.options.hint.emoji:e.lute.GetEmojis(),a=[];Object.keys(i).forEach(function(e){0===e.indexOf(o.toLowerCase())&&(i[e].indexOf(".")>-1?a.push({html:'<img src="'.concat(i[e],'" title=":').concat(e,':"/> :').concat(e,":"),value:":".concat(e,":")}):a.push({html:'<span class="vditor-hint__emoji">'.concat(i[e],"</span>").concat(e),value:i[e]}))}),this.genHTML(a,o,e)}else e.options.hint.extend.forEach(function(t){t.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){var r,i,a;return r=void 0,i=void 0,a=function(){var n;return t8(this,function(r){switch(r.label){case 0:return n=this.genHTML,[4,t.hint(o)];case 1:return n.apply(this,[r.sent(),o,e]),[2]}})},new(i||(i=Promise))(function(e,t){function o(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(o,l)}s((a=a.apply(n,r||[])).next())})},e.options.hint.delay))})}},e.prototype.genHTML=function(e,t,n){var r=this;if(0===e.length){this.element.style.display="none";return}var o=n[n.currentMode].element,i=(0,ei.Ny)(o),a=i.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),l=i.top,s="";e.forEach(function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var o=r.lastIndexOf(">")+1,i=r.substr(o),a=i.toLowerCase().indexOf(t.toLowerCase());a>-1&&(i=i.substring(0,a)+"<b>"+i.substring(a,a+t.length)+"</b>"+i.substring(a+t.length),r=r.substr(0,o)+i)}s+='<button type="button" data-value="'.concat(encodeURIComponent(e.value),' "\n').concat(0===n?"class='vditor-hint--current'":"","> ").concat(r,"</button>")}}),this.element.innerHTML=s;var c=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(l+(c||22),"px"),this.element.style.left="".concat(a,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(e){e.addEventListener("click",function(t){r.fillEmoji(e,n),t.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(l-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},e.prototype.select=function(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!(0,N.yl)(e)&&!e.shiftKey&&!e.altKey&&"Enter"===e.key&&!e.isComposing&&(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),!0)},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach(function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)}),-1===this.lastIndex)return n;var o=e.split(this.splitChar),i=o[o.length-1];if(o.length>1&&i.trim()===i)if(2===o.length&&""===o[0]&&o[1].length<32)n=o[1];else{var a=o[o.length-2].slice(-1);" "===(0,C.X)(a)&&i.length<32&&(n=i)}return n},e}(),t7=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>'),this.element=t.firstElementChild,this.bindEvent(e),e4(e,this.element),e8(e,this.element),e9(e,this.element),tr(e,this.element),to(e,this.element),e7(e,this.element),te(e,this.element,this.copy),tt(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tQ(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){B(e,["hint"])}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,N.vU)()||ec(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput){t.preventInput=!1,t6(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||ec(e,getSelection().getRangeAt(0).cloneRange(),!1,n)}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,t6(e);return}var r=(0,ei.zh)(e),o=(0,V.fb)(n.target,"vditor-ir__preview");if(o||(o=(0,V.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,ei.Hc)(r),tn(e)),"IMG"===n.target.tagName){var i=n.target.parentElement.querySelector(".vditor-ir__marker--link");i&&(r.selectNode(i),(0,ei.Hc)(r))}var a=(0,V.a1)(n.target,"data-type","a");if(a&&!a.classList.contains("vditor-ir__node--expand"))return void(e.options.link.click?e.options.link.click(a.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(a.querySelector(":scope > .vditor-ir__marker--link").textContent));if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var l=t.element.lastElementChild.getBoundingClientRect();n.y>l.top+l.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(M.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(t.element,r)))}""===r.toString()?ef(r,e):setTimeout(function(){ef((0,ei.zh)(e),e)}),el(n,e),eT(e)}),this.element.addEventListener("keyup",function(n){if(!(n.isComposing||(0,N.yl)(n))){if("Enter"===n.key&&tn(e),eT(e),("Backspace"===n.key||"Delete"===n.key)&&""!==e.ir.element.innerHTML&&1===e.ir.element.childNodes.length&&e.ir.element.firstElementChild&&"P"===e.ir.element.firstElementChild.tagName&&0===e.ir.element.firstElementChild.childElementCount&&(""===e.ir.element.textContent||"\n"===e.ir.element.textContent)){e.ir.element.innerHTML="";return}var r=(0,ei.zh)(e);"Backspace"===n.key?((0,N.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",ef(r,e)),t.element.querySelectorAll(".language-math").forEach(function(e){var t=e.querySelector("br");t&&t.remove()})):n.key.indexOf("Arrow")>-1?(("ArrowLeft"===n.key||"ArrowRight"===n.key)&&t2(e),ef(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&ef(r,e);var o=(0,V.fb)(r.startContainer,"vditor-ir__preview");if(o){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===o.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===o.parentElement.getAttribute("data-type")?(o.parentElement.insertAdjacentText("afterend",M.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}})},e}(),ne=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(A(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},nt=n(214),nn=n(436),nr=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(e,'</div>\n<div class="vditor-outline__content"></div>')}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,nn.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,nn.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);var r,o=null==(r=e.toolbar.elements.outline)?void 0:r.firstElementChild;if(t&&window.innerWidth>=M.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==o||o.classList.add("vditor-menu--current")):(this.element.style.display="none",null==o||o.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var i=getSelection().getRangeAt(0);e[e.currentMode].element.contains(i.startContainer)&&(0,ei.Hc)(i)}eE(e)},e}(),no=n(280),ni=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}}),this.previewElement.addEventListener("click",function(n){var r=(0,V.lG)(n.target,"SPAN");if(r&&(0,V.fb)(r,"vditor-toc")){var o=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));o&&(t.element.scrollTop=o.offsetTop);return}if("A"===n.target.tagName){e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),n.preventDefault();return}"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,ev.E)(n.target,e.options.lang,e.options.theme))}),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],i=0;i<n.length;i++){var a=n[i];if("object"==typeof a){o.push('<button type="button" data-type="'.concat(a.key,'" class="').concat(a.className,'"').concat(a.tooltip?' aria-label="'.concat(a.tooltip,'"'):"",'">').concat(a.text,"</button>"));continue}switch(a){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}}r.innerHTML=o.join(""),r.addEventListener((0,N.Le)(),function(o){var i=(0,U.S)(o.target,"BUTTON");if(i){var a=i.getAttribute("data-type"),l=n.find(function(e){return(null==e?void 0:e.key)===a});if(l)return void l.click(a);if("mp-wechat"===a||"zhihu"===a)return void t.copyToX(e,t.previewElement.cloneNode(!0),a);"desktop"===a?t.previewElement.style.width="auto":"tablet"===a?t.previewElement.style.width="780px":t.previewElement.style.width="360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),i.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"===this.element.style.display){"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide();return}if(t){this.previewElement.innerHTML=t;return}if(""===A(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){this.previewElement.innerHTML="";return}var r=new Date().getTime(),o=A(e);this.mdTimeoutId=window.setTimeout(function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE)if(200===t.status){var i=JSON.parse(t.responseText);if(0!==i.code)return void e.tip.show(i.msg);e.options.preview.transform&&(i.data=e.options.preview.transform(i.data)),n.previewElement.innerHTML=i.data,n.afterRender(e,r)}else{var a=e.lute.Md2HTML(o);e.options.preview.transform&&(a=e.options.preview.transform(a)),n.previewElement.innerHTML=a,n.afterRender(e,r)}},t.send(JSON.stringify({markdownText:o}))}else{var i=e.lute.Md2HTML(o);e.options.preview.transform&&(i=e.options.preview.transform(i)),n.previewElement.innerHTML=i,n.afterRender(e,r)}},e.options.preview.delay)},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=new Date().getTime()-t;new Date().getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,K.O)(e.preview.previewElement,e.options.preview.hljs),(0,X.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,$.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,Q.K)(e.preview.previewElement,e.options.cdn),(0,en.J)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,J.P)(e.preview.previewElement,e.options.cdn),(0,Z.v)(e.preview.previewElement,e.options.cdn),(0,G.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,ee.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,et.B)(e.preview.previewElement,e.options.cdn),(0,W.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,no.Y)(e.preview.previewElement),e.options.customRenders.forEach(function(t){t.render(e.preview.previewElement,e)});var o=e.preview.element,i=e.outline.render(e);""===i&&(i="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=i,(0,Y.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),(0,Y.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(e.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,ei.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到".concat("zhihu"===n?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},e}(),na=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(e.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",function(n){var r=document,o=n.clientY,i=e.element.offsetHeight,a=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(a,i+(o-t.clientY))+"px":e.element.style.height=Math.max(a,i+(t.clientY-o))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-i),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}})},e}(),nl=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),e4(e,this.element),e9(e,this.element),tr(e,this.element),to(e,this.element),e7(e,this.element),te(e,this.element,this.copy),tt(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",e5(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tQ(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,o=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),i=e.preview.element;n/r>.5?i.scrollTop=(n+r)*i.scrollHeight/o-r:i.scrollTop=n*i.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,N.vU)()||eg(e,n),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data){if(t.preventInput){t.preventInput=!1,tc(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}eg(e,n)}}),this.element.addEventListener("keyup",function(t){if(!(t.isComposing||(0,N.yl)(t))){if(("Backspace"===t.key||"Delete"===t.key)&&""!==e.sv.element.innerHTML&&1===e.sv.element.childNodes.length&&e.sv.element.firstElementChild&&"DIV"===e.sv.element.firstElementChild.tagName&&2===e.sv.element.firstElementChild.childElementCount&&(""===e.sv.element.firstElementChild.textContent||"\n"===e.sv.element.textContent)){e.sv.element.innerHTML="";return}"Enter"===t.key&&tn(e)}})},e}(),ns=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,'\n<div class="vditor-tip__close">X</div></div>'),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,"</div>"),setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),nc=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),I(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",D(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},nd=(t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),nu=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,N.Le)(),function(e){r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?nc("editor",t):nc("both",t)))}),r}return nd(t,e),t}(e1),np=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},nf=n(580),nm=(o=function(e,t){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nv=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return M.g.CODE_THEME.forEach(function(e){a+="<button>".concat(e,"</button>")}),i.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),i.addEventListener((0,N.Le)(),function(e){"BUTTON"===e.target.tagName&&(B(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,nf.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(i),z(t,i,o,n.level),r}return nm(t,e),t}(e1),nh=(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ng=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return Object.keys(t.options.preview.theme.list).forEach(function(e){a+='<button data-type="'.concat(e,'">').concat(t.options.preview.theme.list[e],"</button>")}),i.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),i.addEventListener((0,N.Le)(),function(e){"BUTTON"===e.target.tagName&&(B(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,ey.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(i),z(t,i,o,n.level),r}return nh(t,e),t}(e1),nb=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(n,"/").concat(e.options.counter.max)):this.element.innerHTML="".concat(n),this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),ny=(a=function(e,t){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nw=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(M.g.CLASS_MENU_DISABLED)||n.click(e,t)}),r}return ny(t,e),t}(e1),nk=(l=function(e,t){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nE=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,N.Le)(),function(e){var n=r.element.firstElementChild;n.classList.contains(M.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",eE(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",eE(t),t.devtools.renderEchart(t)))}),r}return nk(t,e),t}(e1),nx=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},nS=(s=function(e,t){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n_=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var i="";return Object.keys(t.options.hint.emoji).forEach(function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?i+='<button data-value=":'.concat(e,': " data-key=":').concat(e,':"><img\ndata-value=":').concat(e,': " data-key=":').concat(e,':" class="vditor-emojis__icon" src="').concat(n,'"/></button>'):i+='<button data-value="'.concat(n,' "\n data-key="').concat(e,'"><span class="vditor-emojis__icon">').concat(n,"</span></button>")}),o.innerHTML='<div class="vditor-emojis" style="max-height: '.concat("auto"===t.options.height?"auto":t.options.height-80,'px">').concat(i,'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>').concat(t.options.hint.emojiTail||"","</span>\n</div>"),r.element.appendChild(o),z(t,o,r.element.firstElementChild,n.level),r.bindEvent(t),r}return nS(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,N.Le)(),function(n){var r=(0,U.S)(n.target,"BUTTON");if(r){n.preventDefault();var o=r.getAttribute("data-value"),i=(0,ei.zh)(e),a=o;if("wysiwyg"===e.currentMode?a=e.lute.SpinVditorDOM(o):"ir"===e.currentMode&&(a=e.lute.SpinVditorIRDOM(o)),o.indexOf(":")>-1&&"sv"!==e.currentMode){var l=document.createElement("div");l.innerHTML=a,a=l.firstElementChild.firstElementChild.outerHTML+" ",(0,ei.oC)(a,e)}else i.extractContents(),i.insertNode(document.createTextNode(o)),(0,V.F9)(i.startContainer)||eD(e,i);i.collapse(!1),(0,ei.Hc)(i),t.element.lastElementChild.style.display="none",tR(e)}}),this.element.lastElementChild.addEventListener("mouseover",function(e){var n=(0,U.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))})},t}(e1),nT=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},nL=function(e){var t=A(e);nT(e,t,t.substr(0,10)+".md")},nM=function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "').concat(e.options.cdn,'",\n markdown: {\n theme: ').concat(JSON.stringify(e.options.preview.theme),'\n },\n hljs: {\n style: "').concat(e.options.preview.hljs.style,'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>')),t.contentDocument.close(),setTimeout(function(){t.contentWindow.postMessage(A(e),"*")},200)},nC=function(e){var t=ne(e),n='<html><head><link rel="stylesheet" type="text/css" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,"/dist/js/i18n/").concat(e.options.lang,'.js"><\/script>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">').concat(t,"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('").concat(e.options.preview.theme.current,"', '").concat(e.options.preview.theme.path,"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender(").concat(JSON.stringify(e.options.preview.hljs),", previewElement, '").concat(e.options.cdn,"');\n Vditor.mathRender(previewElement, {\n cdn: '").concat(e.options.cdn,"',\n math: ").concat(JSON.stringify(e.options.preview.math),",\n });\n Vditor.mermaidRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.SMILESRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.markmapRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.flowchartRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.graphvizRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.chartRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.mindmapRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.abcRender(previewElement, '").concat(e.options.cdn,"');\n ").concat(e.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="').concat(e.options.cdn,"/dist/js/icons/").concat(e.options.icon,'.js"><\/script></body></html>');nT(e,n,t.substr(0,10)+".html")},nA=(c=function(e,t){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nO=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");return i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',i.addEventListener((0,N.Le)(),function(e){var n=e.target;if("BUTTON"===n.tagName){switch(n.getAttribute("data-type")){case"markdown":nL(t);break;case"pdf":nM(t);break;case"html":nC(t)}B(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),r.element.appendChild(i),z(t,i,o,n.level),r}return nA(t,e),t}(e1),nH=(d=function(e,t){return(d=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nN=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return nH(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,N.Le)(),function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__".concat(e.tipPosition))}))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),eE(e),ex(e)})},t}(e1),nD=(u=function(e,t){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nI=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,N.ns)("<⌥⌘1>"),'</button>\n<button data-tag="h2" data-value="## ">').concat(window.VditorI18n.heading2," <").concat((0,N.ns)("⌥⌘2"),'></button>\n<button data-tag="h3" data-value="### ">').concat(window.VditorI18n.heading3," <").concat((0,N.ns)("⌥⌘3"),'></button>\n<button data-tag="h4" data-value="#### ">').concat(window.VditorI18n.heading4," <").concat((0,N.ns)("⌥⌘4"),'></button>\n<button data-tag="h5" data-value="##### ">').concat(window.VditorI18n.heading5," <").concat((0,N.ns)("⌥⌘5"),'></button>\n<button data-tag="h6" data-value="###### ">').concat(window.VditorI18n.heading6," <").concat((0,N.ns)("⌥⌘6"),"></button>"),r.element.appendChild(o),r._bindEvent(t,o),r}return nD(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,N.Le)(),function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(M.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(ej(e),eL(e)):"ir"===e.currentMode&&t3(e,""),n.classList.remove("vditor-menu--current")):(B(e,["subToolbar"]),t.style.display="block"))});for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,N.Le)(),function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(eI(e,r.target.getAttribute("data-tag")),eL(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(t3(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):td(e,r.target.getAttribute("data-value")),t.style.display="none"})},t}(e1),nj=(p=function(e,t){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nR=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),r}return nj(t,e),t}(e1),nP=(f=function(e,t){return(f=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nq=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,ei.zh)(t),o=(0,V.lG)(n.startContainer,"LI");o&&tH(t,o,n)}}),r}return nP(t,e),t}(e1),nB=(m=function(e,t){return(m=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nz=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div> </div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'.concat(M.H," / Lute v").concat(Lute.Version,'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>'),0)}),r}return nB(t,e),t}(e1),nV=(v=function(e,t){return(v=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nU=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||t_(t,"afterend")}),r}return nV(t,e),t}(e1),nF=(h=function(e,t){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nW=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||t_(t,"beforebegin")}),r}return nF(t,e),t}(e1),nG=(g=function(e,t){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nK=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,N.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,ei.zh)(t),o=(0,V.lG)(n.startContainer,"LI");o&&tN(t,o,n,o.parentElement)}}),r}return nG(t,e),t}(e1),nJ=(b=function(e,t){return(b=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nZ=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),r}return nJ(t,e),t}(e1),nX=(y=function(e,t){return(y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nY=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nX(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,N.Le)(),function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(M.g.CLASS_MENU_DISABLED)){var o=M.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),j(e.toolbar.elements,o),e.outline.render(e)):(R(e.toolbar.elements,o),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),B(e,["subToolbar","hint","popover"]),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10)),eE(e)}})},t}(e1),n$=function(){function e(e){if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"u">typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var t,n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var o=44+2*n.length,i=new DataView(new ArrayBuffer(o));this.writeUTFBytes(i,0,"RIFF"),i.setUint32(4,o,!0),this.writeUTFBytes(i,8,"WAVE"),this.writeUTFBytes(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,this.SAMPLE_RATE,!0),i.setUint32(28,2*this.SAMPLE_RATE,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0);var a=2*n.length;this.writeUTFBytes(i,36,"data"),i.setUint32(40,a,!0);for(var l=n.length,s=44,c=0;c<l;c++)i.setInt16(s,32767*n[c],!0),s+=2;return new Blob([i],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE||t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=new Float32Array(Math.round(e.length/n)),o=0,i=0;o<r.length;){for(var a=Math.round((o+1)*n),l=0,s=0,c=i;c<a&&c<e.length;c++)l+=e[c],s++;r[o]=l/s,o++,i=a}return r},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,o=0;o<r;++o){var i=e[o];t.set(i,n),n+=i.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,o=0;o<r;o++)e.setUint8(t+o,n.charCodeAt(o))},e}(),nQ=(w=function(e,t){return(w=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n0=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nQ(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,N.Le)(),function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)){var o=e[e.currentMode].element;if(!t)return void navigator.mediaDevices.getUserMedia({audio:!0}).then(function(r){(t=new n$(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")}).catch(function(){e.tip.show(window.VditorI18n["record-tip"])});t.isRecording?(t.stopRecording(),e.tip.hide(),tb(e,[new File([t.buildWavFileBlob()],"record".concat(new Date().getTime(),".wav"),{type:"video/webm"})]),n.element.children[0].classList.remove("vditor-menu--current")):(e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current"))}})},t}(e1),n1=(k=function(e,t){return(k=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}k(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n2=function(e){function t(t,n){var r=e.call(this,t,n)||this;return R({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),r}return n1(t,e),t}(e1),n6=(E=function(e,t){return(E=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}E(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n3=function(e){function t(t,n){var r=e.call(this,t,n)||this;return R({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,N.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),r}return n6(t,e),t}(e1),n5=(x=function(e,t){return(x=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n4=function(e){function t(t,n){var r=e.call(this,t,n)||this,o='<input type="file"';return t.options.upload.multiple&&(o+=' multiple="multiple"'),t.options.upload.accept&&(o+=' accept="'.concat(t.options.upload.accept,'"')),r.element.children[0].innerHTML="".concat(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(o,">"),r._bindEvent(t),r}return n5(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,N.Le)(),function(e){if(t.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)){e.stopPropagation(),e.preventDefault();return}}),this.element.querySelector("input").addEventListener("change",function(n){if(t.element.firstElementChild.classList.contains(M.g.CLASS_MENU_DISABLED)){n.stopPropagation(),n.preventDefault();return}0!==n.target.files.length&&tb(e,n.target.files,n.target)})},t}(e1),n8=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach(function(n,r){var o=t.genItem(e,n,r);if(t.element.appendChild(o),n.toolbar){var i=document.createElement("div");i.className="vditor-hint vditor-panel--arrow",i.addEventListener((0,N.Le)(),function(e){i.style.display="none"}),n.toolbar.forEach(function(n,o){n.level=2,i.appendChild(t.genItem(e,n,r+o))}),o.appendChild(i),z(e,i,o.children[0],2)}}),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new nb(e),this.element.appendChild(e.counter.element))}return e.prototype.updateConfig=function(e,t){e.options.toolbarConfig=Object.assign({hide:!1,pin:!1},t),e.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),e.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},e.prototype.genItem=function(e,t,n){switch(t.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new e1(e,t);break;case"emoji":r=new n_(e,t);break;case"headings":r=new nI(e,t);break;case"|":r=new nx;break;case"br":r=new np;break;case"undo":r=new n3(e,t);break;case"redo":r=new n2(e,t);break;case"help":r=new nR(e,t);break;case"both":r=new nu(e,t);break;case"preview":r=new nY(e,t);break;case"fullscreen":r=new nN(e,t);break;case"upload":r=new n4(e,t);break;case"record":r=new n0(e,t);break;case"info":r=new nz(e,t);break;case"edit-mode":r=new e3(e,t);break;case"devtools":r=new nE(e,t);break;case"outdent":r=new nK(e,t);break;case"indent":r=new nq(e,t);break;case"outline":r=new nZ(e,t);break;case"insert-after":r=new nU(e,t);break;case"insert-before":r=new nW(e,t);break;case"code-theme":r=new nv(e,t);break;case"content-theme":r=new ng(e,t);break;case"export":r=new nO(e,t);break;default:r=new nw(e,t)}if(r){var r,o=t.name;return("br"===o||"|"===o)&&(o+=n),this.elements[o]=r.element,r.element}},e}(),n9=n(173),n7=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new n9}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?j(e.toolbar.elements,["undo"]):R(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?j(e.toolbar.elements,["redo"]):R(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,B(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(!(0===getSelection().rangeCount||1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,N.vU)()&&"Backspace"===t.key||(0,N.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);(0!==r.length||!(this[e.currentMode].undoStack.length>0))&&(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,R(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&j(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){if(void 0===n&&(n=!1),n){var r,o=this.dmp.patch_deepCopy(e).reverse();o.forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),r=this.dmp.patch_apply(o,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&(t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview")).forEach(function(e){e.parentElement.querySelector(".language-echarts")&&("ir"===t.currentMode?e.parentElement.outerHTML=t.lute.SpinVditorIRDOM(e.parentElement.outerHTML):e.parentElement.outerHTML=t.lute.SpinVditorDOM(e.parentElement.outerHTML))}),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){eo(e,t)})),t[t.currentMode].element.querySelector("wbr"))(0,ei.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),tn(t);else{var i=getSelection().getRangeAt(0);i.setEndBefore(t[t.currentMode].element),i.collapse(!1)}ea(t),tR(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),eY(t),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){eo(e,t)}),this[t.currentMode].undoStack.length>1?j(t.toolbar.elements,["undo"]):R(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?j(t.toolbar.elements,["redo"]):R(t.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(e,t){if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var n,r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}var i=e[e.currentMode].element.cloneNode(!0);i.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='1']")).forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var a=i.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,ei.Hc)(n),a.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),re=n(673),rt=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:M.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"\uD83D\uDC4D","-1":"\uD83D\uDC4E",confused:"\uD83D\uDE15",eyes:"\uD83D\uDC40️",heart:"❤️",rocket:"\uD83D\uDE80️",smile:"\uD83D\uDE04",tada:"\uD83C\uDF89️"},emojiPath:"".concat(M.g.CDN,"/dist/images/emoji"),extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:M.g.HLJS_OPTIONS,markdown:M.g.MARKDOWN_OPTIONS,math:M.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:M.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:0xa00000,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null==(t=null==(e=this.options.preview)?void 0:e.theme)?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null==(o=null==(r=null==(n=this.options.preview)?void 0:n.render)?void 0:r.media)?void 0:o.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null==(i=this.options.hint)?void 0:i.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null==(l=null==(a=this.options.preview)?void 0:a.theme)?void 0:l.path)||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),(null==(s=this.options.hint)?void 0:s.emojiPath)||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji"))));var e,t,n,r,o,i,a,l,s,c=(0,re.T)(this.defaultOptions,this.options);if(c.cache.enable&&!c.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return c},e.prototype.mergeToolbar=function(e){var t=this,n=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return e.forEach(function(e){var o=e;n.forEach(function(t){"string"==typeof e&&t.name===e&&(o=t),"object"==typeof e&&t.name===e.name&&(o=Object.assign({},t,e))}),e.toolbar&&(o.toolbar=t.mergeToolbar(e.toolbar)),r.push(o)}),r},e}(),rn=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="').concat(window.VditorI18n.comment,'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>'),this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),e4(e,this.element),e8(e,this.element),e9(e,this.element),tr(e,this.element),to(e,this.element),e7(e,this.element),te(e,this.element,this.copy),tt(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,o=Lute.NewNodeID(),i=getSelection().getRangeAt(0),a=i.cloneRange(),l=i.extractContents(),s=!1,c=!1;l.childNodes.forEach(function(e,t){var i=!1;if(3===e.nodeType?i=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+o):i=!0,i)if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&a.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===l.childNodes.length-1&&a.endOffset<a.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?s=!0:t===l.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>");else{var d=document.createElement("span");d.classList.add("vditor-comment"),d.setAttribute("data-cmtids",o),e.parentNode.insertBefore(d,e),d.appendChild(e)}});var d=(0,V.F9)(a.startContainer);d&&(n?(d.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===d.textContent.trim().replace(M.g.ZWSP,"")&&s&&d.remove());var u=(0,V.F9)(a.endContainer);u&&(r?(u.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===u.textContent.trim().replace(M.g.ZWSP,"")&&c&&u.remove()),i.insertNode(l),e.options.comment.add(o,i.toString(),t.getComments(e,!0)),eL(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];if(t)return this.commentIds.forEach(function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'.concat(e,'"]')).offsetTop})}),r},e.prototype.triggerRemoveComment=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var t,n=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var r=(t=new Set(this.commentIds),n.filter(function(e){return!t.has(e)}));r.length>0&&e.options.comment.remove(r)}},e.prototype.showComment=function(){var e=(0,ei.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(e.left,"px;display:block;top:").concat(Math.max(-8,e.top-21),"px"))},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,V.lG)(n.startContainer,"CODE"),o=(0,V.lG)(n.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var i="";i="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html","");return}var a=(0,V.lG)(n.startContainer,"A"),l=(0,V.lG)(n.endContainer,"A");if(a&&l&&l.isSameNode(a)){var s=a.getAttribute("title")||"";s&&(s=' "'.concat(s,'"')),e.clipboardData.setData("text/plain","[".concat(n.toString(),"](").concat(a.getAttribute("href")).concat(s,")")),e.clipboardData.setData("text/html","");return}var c=document.createElement("div");c.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(c.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(B(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"!==e.options.height){if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var r=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}return}if(e.options.toolbarConfig.pin){var o=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=o),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(B(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var o=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=o,t.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(t){tQ(e,t,{pasteCode:function(t){var n=(0,ei.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var o=(0,V.a1)(n.startContainer,"data-block","0");o?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,ei.ib)(e.wysiwyg.element,n)}})}),this.element.addEventListener("compositionstart",function(){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){var r=(0,U.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?ea(e):((0,N.vU)()||ty(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput){t.preventInput=!1,eL(e);return}if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)return void eL(e);var r=getSelection().getRangeAt(0),o=(0,V.F9)(r.startContainer);if(o||(eD(e,r),o=(0,V.F9)(r.startContainer)),o){for(var i=(0,ei.im)(o,e.wysiwyg.element,r).start,a=!0,l=i-1;l>o.textContent.substr(0,i).lastIndexOf("\n");l--)if(" "!==o.textContent.charAt(l)&&" "!==o.textContent.charAt(l)){a=!1;break}0===i&&(a=!1);for(var s=!0,l=i-1;l<o.textContent.length;l++)if(" "!==o.textContent.charAt(l)&&"\n"!==o.textContent.charAt(l)){s=!1;break}s&&/^#{1,6} $/.test(o.textContent)&&(s=!1);var c=(0,U.W)(getSelection().getRangeAt(0).startContainer);if(c&&""===c.textContent&&(ea(e),c.remove()),a&&"code-block"!==o.getAttribute("data-type")||s||tj(o.innerHTML)||tI(o.innerHTML)&&o.previousElementSibling){"function"==typeof e.options.input&&e.options.input(A(e));return}"insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&o.previousElementSibling.remove(),ty(e,r,n)}}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){var r=n.target;r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),t.preventInput=!0,getSelection().rangeCount>0&&(0,ei.Hc)(getSelection().getRangeAt(0)),eL(e);return}if("IMG"===n.target.tagName&&!n.target.parentElement.classList.contains("vditor-wysiwyg__preview"))return void("link-ref"===n.target.getAttribute("data-type")?eV(e,n.target):eJ(n,e));var o=(0,V.lG)(n.target,"A");if(o){e.options.link.click?e.options.link.click(o):e.options.link.isOpen&&window.open(o.getAttribute("href")),n.preventDefault();return}var i=(0,ei.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&i.collapsed){var a=t.element.lastElementChild.getBoundingClientRect();n.y>a.top+a.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(M.g.ZWSP,"")?(i.selectNodeContents(t.element.lastElementChild),i.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(M.g.ZWSP,"<wbr></p>")),(0,ei.ib)(t.element,i)))}eB(e);var l=(0,V.fb)(n.target,"vditor-wysiwyg__preview");l||(l=(0,V.fb)((0,ei.zh)(e).startContainer,"vditor-wysiwyg__preview")),l&&eR(l,e),el(n,e)}),this.element.addEventListener("keyup",function(t){if(!(t.isComposing||(0,N.yl)(t))){"Enter"===t.key&&tn(e),("Backspace"===t.key||"Delete"===t.key)&&""!==e.wysiwyg.element.innerHTML&&1===e.wysiwyg.element.childNodes.length&&e.wysiwyg.element.firstElementChild&&"P"===e.wysiwyg.element.firstElementChild.tagName&&0===e.wysiwyg.element.firstElementChild.childElementCount&&(""===e.wysiwyg.element.textContent||"\n"===e.wysiwyg.element.textContent)&&(e.wysiwyg.element.innerHTML="");var n=(0,ei.zh)(e);if("Backspace"===t.key&&(0,N.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),eD(e,n),eB(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){("ArrowLeft"===t.key||"ArrowRight"===t.key)&&e.hint.render(e);var r=(0,V.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0){var o=n.startContainer;o.classList.contains("vditor-wysiwyg__block")&&(r=o.lastElementChild)}if(r){if("none"===r.previousElementSibling.style.display)return void("ArrowDown"===t.key||"ArrowRight"===t.key?eR(r,e):eR(r,e,!1));var i=r.previousElementSibling;if("PRE"===i.tagName&&(i=i.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var o=r.parentElement,a=eH(o);if(a&&3!==a.nodeType){var l=a.querySelector(".vditor-wysiwyg__preview");if(l)return void eR(l,e)}if(3===a.nodeType){for(;0===a.textContent.length&&a.nextSibling;)a=a.nextSibling;n.setStart(a,1)}else n.setStart(a.firstChild,0)}else n.selectNodeContents(i),n.collapse(!1)}}}})},e}(),rr=(S=function(e,t){return(S=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});let ro=function(e){function t(t,n){var r=e.call(this)||this;if(r.isDestroyed=!1,r.version=M.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor".concat(t)):n.cache={id:"vditor".concat(t)}:n={cache:{id:"vditor".concat(t)}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: ".concat(t)),r;t=document.getElementById(t)}var o=new rt(n).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(t,o);else if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(o.lang)){var i="vditorI18nScript",a=i+o.lang;document.querySelectorAll('head script[id^="'.concat(i,'"]')).forEach(function(e){e.id!==a&&document.head.removeChild(e)}),(0,O.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),a).then(function(){r.init(t,o)}).catch(function(e){r.showErrorTip("GET ".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");return r}return rr(t,e),t.prototype.showErrorTip=function(e){var t=new ns;document.body.appendChild(t.element),t.show(e,0)},t.prototype.updateToolbarConfig=function(e){this.vditor.toolbar.updateConfig(this.vditor,e)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,ew(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,ey.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,nf.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return A(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){B(this.vditor,["subToolbar","hint","popover"]),R(this.vditor.toolbar.elements,M.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){j(this.vditor.toolbar.elements,M.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return"wysiwyg"===this.vditor.currentMode?e5(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?e5(this.vditor.sv.element):"ir"===this.vditor.currentMode?e5(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,ei.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){this.vditor.options.cache.enable&&(0,N.pK)()&&localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return ne(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){nc(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,ei.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&eg(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&ty(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&ec(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.insertMD=function(e){"ir"===this.vditor.currentMode?(0,ei.oC)(this.vditor.lute.Md2VditorIRDOM(e),this.vditor):"wysiwyg"===this.vditor.currentMode?(0,ei.oC)(this.vditor.lute.Md2VditorDOM(e),this.vditor):ti(this.vditor,e),this.vditor.outline.render(this.vditor),tR(this.vditor)},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(e),"</div>"),tc(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?e$(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){eo(e,n.vditor)}),t6(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(B(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&this.clearStack()},t.prototype.insertEmptyBlock=function(e){t_(this.vditor,e)},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),eS(),this.vditor.wysiwyg.unbindListener(),this.vditor.options.after=void 0,this.isDestroyed=!0},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find(function(e,t){if(e===n)return r.splice(t,1),!0}),0===r.length?(e.outerHTML=e.innerHTML,(0,ei.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach(function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)}),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)})}),eL(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.isDestroyed||(this.vditor={currentMode:t.mode,element:e,hint:new t9(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new nr(window.VditorI18n.outline),tip:new ns},this.vditor.sv=new nl(this.vditor),this.vditor.undo=new n7,this.vditor.wysiwyg=new rn(this.vditor),this.vditor.ir=new t7(this.vditor),this.vditor.toolbar=new n8(this.vditor),t.resize.enable&&(this.vditor.resize=new na(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new H),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new tv),(0,O.G)(t._lutePath||"".concat(t.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){n.vditor.lute=(0,nt.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new ni(n.vditor),ek(n.vditor),t.after&&t.after(),t.icon&&(0,O.J)("".concat(t.cdn,"/dist/js/icons/").concat(t.icon,".js"),"vditorIconScript")}))},t}(L.default)})(),r=r.default}()},573:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg=="},26:function(e,t,n){"use strict";n.r(t),n.d(t,{DisplayVditorFieldModel:function(){return m}});var r=n(694),o=n(485),i=n(155),a=n.n(i),l=n(143);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var f=function(e){var t,n=e.value,r=e.markdown,o=e.liquid,a=e.t,l=e.textOnly,d=e.ctx,u=e.overflowMode,p=e.parseLiquid,f=void 0!==p&&p,m=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return s(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),v=m[0],h=m[1];return(0,i.useEffect)(function(){if(n){var e;(e=function(){var e,t,i;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:if(s.trys.push([0,4,,5]),!f)return[3,2];return[4,o.renderWithFullContext(n,d)];case 1:return t=s.sent(),[3,3];case 2:t=n,s.label=3;case 3:return e=t,h(r.render(a(e),{ellipsis:"ellipsis"===u,textOnly:l})),[3,5];case 4:return i=s.sent(),h('<pre style="color:red;"> 渲染错误: '.concat(i.message,"</pre>")),[3,5];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,l,"next",e)}function l(e){c(i,r,o,a,l,"throw",e)}a(void 0)})})()}},[n,l,u]),v},m=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=d(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(e,t||[],d(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&u(n,e),t=[{key:"renderComponent",value:function(e){if(!e)return null;var t=this.context,n=t.markdownVditor,r=t.markdown,o=t.liquid,i=t.t,l=this.props,s=l.textOnly,c=l.overflowMode;return a().createElement(f,{value:e,markdown:n||r,liquid:o,t:i,textOnly:s,ctx:this.context,overflowMode:c})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(o.DisplayTitleFieldModel);m.define({label:(0,l.M)("MarkdownVditor")}),m.registerFlow({key:"markdownVditorSettings",title:(0,l.M)("Content settings"),sort:200,steps:{renderMode:{use:"renderMode"}}}),r.DisplayItemModel.bindModelToInterface("DisplayVditorFieldModel",["vditor","markdown"],{isDefault:!0})},284:function(e,t,n){"use strict";n.r(t),n.d(t,{VditorFieldModel:function(){return c}});var r=n(485),o=n(694),i=n(143);function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var c=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=a(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),t=[{key:"render",value:function(){var e,t;return(this.context.markdownVditor||this.context.markdown).edit((e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},this.props),t=t={mode:this.props.editMode||this.props.mode,enableContextSelect:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.FieldModel);(c=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([(0,o.largeField)()],c)).define({label:(0,i.M)("MarkdownVditor")}),c.registerFlow({key:"markdownVditorEditSettings",title:(0,i.M)("Content settings"),sort:200,steps:{editMode:{title:(0,i.M)("Default Edit Mode"),uiMode:{type:"select",key:"editMode",props:{options:[{label:(0,i.M)("What You See Is What You Get"),value:"wysiwyg"},{label:(0,i.M)("Instant Rendering"),value:"ir"},{label:(0,i.M)("Split View"),value:"sv"}]}},defaultParams:function(e){return{editMode:e.model.props.editMode||e.model.props.mode||"ir"}},handler:function(e,t){e.model.setProps({editMode:t.editMode,mode:t.editMode})}}}}),o.EditableItemModel.bindModelToInterface("VditorFieldModel",["vditor","markdown"],{isDefault:!0})},143:function(e,t,n){"use strict";n.d(t,{M:function(){return a},k:function(){return i}});var r=n(694),o=JSON.parse('{"UU":"@nocobase/plugin-field-markdown-vditor"}');function i(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[o.UU,"client"]},n))}}function a(e){return(0,r.tExpr)(e,{ns:[o.UU,"client"]})}},802:function(e){"use strict";e.exports=r},230:function(t){"use strict";t.exports=e},485:function(e){"use strict";e.exports=n},694:function(e){"use strict";e.exports=t},59:function(e){"use strict";e.exports=i},155:function(e){"use strict";e.exports=o}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,exports:{}};return a[e].call(n.exports,n,n.exports,s),n.exports}s.m=a,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0,s.g.importScripts&&(c=s.g.location+"");var c,d=s.g.document;if(!c&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(c=d.currentScript.src),!c)){var u=d.getElementsByTagName("script");if(u.length)for(var p=u.length-1;p>-1&&(!c||!/^http(s?):/.test(c));)c=u[p--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");s.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.b=document.baseURI||self.location.href;var f={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client-v2/"}s.p=e}(),!function(){"use strict";s.r(f),s.d(f,{MarkdownVditorFieldInterface:function(){return l},default:function(){return et},VditorFieldModel:function(){return c.VditorFieldModel},DisplayVditorFieldModel:function(){return d.DisplayVditorFieldModel}});var e=s(485),t=s(143);function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}var a=["headings","bold","italic","strike","link","list","ordered-list","check","quote","line","code","inline-code","upload","fullscreen"],l=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,o,s;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return o=l,s=arguments,o=r(o),n(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(o,s||[],r(this).constructor):o.apply(this,s)),"name","vditor"),n(e,"type","object"),n(e,"group","media"),n(e,"order",1),n(e,"title","Markdown(Vditor)"),n(e,"sortable",!1),n(e,"default",{interface:"vditor",type:"text",length:"long",uiSchema:{type:"string","x-component":"Input.TextArea"}}),n(e,"availableTypes",["text","json","string"]),n(e,"configure",{items:[{name:"uiSchema.x-component-props.fileCollection",title:(0,t.M)("File collection"),component:"Select",defaultValue:"attachments",description:(0,t.M)("Used to store files uploaded in the Markdown editor (default: attachments)"),schema:{enum:"{{fileCollections}}"}},{name:"uiSchema.x-component-props.toolbar",title:(0,t.M)("Toolbar"),component:"Select",componentProps:{mode:"multiple"},defaultValue:a,options:[{value:"emoji",label:(0,t.M)("Emoji")},{value:"headings",label:(0,t.M)("Headings")},{value:"bold",label:(0,t.M)("Bold")},{value:"italic",label:(0,t.M)("Italic")},{value:"strike",label:(0,t.M)("Strike")},{value:"line",label:(0,t.M)("Line")},{value:"quote",label:(0,t.M)("Quote")},{value:"list",label:(0,t.M)("List")},{value:"ordered-list",label:(0,t.M)("OrderedList")},{value:"check",label:(0,t.M)("Check")},{value:"outdent",label:(0,t.M)("Outdent")},{value:"indent",label:(0,t.M)("Indent")},{value:"code",label:(0,t.M)("Code")},{value:"inline-code",label:(0,t.M)("InlineCode")},{value:"insert-after",label:(0,t.M)("InsertAfter")},{value:"insert-before",label:(0,t.M)("InsertBefore")},{value:"undo",label:(0,t.M)("Undo")},{value:"redo",label:(0,t.M)("Redo")},{value:"upload",label:(0,t.M)("Upload")},{value:"link",label:(0,t.M)("Link")},{value:"record",label:(0,t.M)("Record")},{value:"table",label:(0,t.M)("Table")},{value:"edit-mode",label:(0,t.M)("EditMode")},{value:"both",label:(0,t.M)("Both")},{value:"preview",label:(0,t.M)("Preview")},{value:"fullscreen",label:(0,t.M)("Fullscreen")},{value:"outline",label:(0,t.M)("Outline")}]}]}),n(e,"filterable",{operators:"bigField"}),n(e,"titleUsable",!0),e}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&o(l,e),l}(e.CollectionFieldInterface),c=s(284),d=s(26),u=s(673),p=s.n(u),m=s(598),v=s.n(m),h=s(262),g=s.n(h),b=s(657),y=s.n(b),w=s(738),k=s.n(w),E=s(626),x=s.n(E),S=s(925),_={};_.styleTagTransform=x(),_.setAttributes=y(),_.insert=g().bind(null,"head"),_.domAPI=v(),_.insertStyleElement=k(),p()(S.A,_),S.A&&S.A.locals&&S.A.locals;var T=s(230),L=s(59),M=s(155),C=s.n(M),A=s(131),O=s.n(A),H=s(694),N=function(){var e=(0,H.useFlowContext)().app.pm.get("@nocobase/plugin-field-markdown-vditor");return e.dependencyLoaded||(e.initVditorDependency(),e.dependencyLoaded=!0),e.getCDN()},D=s(802),I="nb-field-markdown-vditor";function j(){var e=L.theme.useToken(),t=e.theme,n=e.token,r=e.hashId,o=(0,D.useStyleRegister)({theme:t,token:n,hashId:r,path:["field-markdown-vditor",I]},function(){var e,t,r;return e={},t=".".concat(I),r={position:"relative",overflow:"visible","&:hover, &:focus-within":{zIndex:1e3},".vditor-reset":{fontSize:"".concat(n.fontSize,"px !important"),color:"unset",padding:"10px !important"},".vditor":{borderRadius:8,overflow:"visible"},".vditor .vditor-content":{borderRadius:"0 0 8px 8px",overflow:"hidden"},".vditor .vditor-toolbar":{position:"relative",overflow:"visible",paddingLeft:" 16px !important",borderRadius:"8px 8px 0 0"},".vditor .vditor-tooltipped:hover, .vditor .vditor-tooltipped:focus, .vditor .vditor-tooltipped:active":{zIndex:1e3},".vditor .vditor-toolbar .vditor-tooltipped__n::after, .vditor .vditor-toolbar .vditor-tooltipped__ne::after, .vditor .vditor-toolbar .vditor-tooltipped__nw::after":{top:"100%",bottom:"auto",marginTop:5,marginBottom:0},".vditor .vditor-toolbar .vditor-tooltipped__n::before, .vditor .vditor-toolbar .vditor-tooltipped__ne::before, .vditor .vditor-toolbar .vditor-tooltipped__nw::before":{top:"auto",bottom:-5,borderTopColor:"transparent",borderBottomColor:"#3b3e43"},".vditor .vditor-content .vditor-ir .vditor-reset":{paddingLeft:" 16px !important"},".vditor-ir pre.vditor-reset":{backgroundColor:"".concat(n.colorBgContainer,"!important")}},t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e});return{wrapSSR:(0,M.useMemo)(function(){return o},[o,t,n,r]),hashId:r,componentCls:I}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var q=function(e){if(e){var t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}};function B(t){var n,r=(0,M.useRef)(null),o=j(),i=o.wrapSSR,a=o.componentCls,l=o.hashId,s=N();return(0,M.useEffect)(function(){var n;O().preview(r.current,null!=(n=t.value)?n:"",{mode:"light",cdn:s,markdown:{sanitize:!0},transform:e.stripMarkdownIframes}).then(function(){return(0,e.removeMarkdownIframes)(r.current)}).catch(function(){return(0,e.removeMarkdownIframes)(r.current)}),setTimeout(function(){var t;(0,e.removeMarkdownIframes)(r.current),null==(t=r.current)||t.querySelectorAll("img").forEach(function(e){e.style.cursor="zoom-in",e.addEventListener("click",function(){var t=e.src;if(!document.getElementById("custom-image-preview")){var n=document.createElement("span");n.id="custom-image-preview",Object.assign(n.style,{position:"fixed",inset:"0",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"9999",cursor:"zoom-out"});var r=document.createElement("img");r.src=t,Object.assign(r.style,{maxWidth:"90%",maxHeight:"90%",borderRadius:"8px",boxShadow:"0 0 20px rgba(0,0,0,0.5)",transition:"transform 0.2s",cursor:"zoom-out"}),n.addEventListener("click",function(){document.body.removeChild(n)}),n.appendChild(r),document.body.appendChild(n)}})})},0)},[t.value,s]),i(C().createElement("span",{className:"".concat(l," ").concat(a)},C().createElement("div",{ref:r,style:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({border:"none"},null!=(n=null==t?void 0:t.style)?n:{})})))}var z=function(t){var n=t.value,r=N(),o=(0,M.useRef)(null),i=P((0,M.useState)(!1),2),a=i[0],l=i[1],s=P((0,M.useState)(!1),2),c=s[0],d=s[1],u=P((0,M.useState)(""),2),p=u[0],f=u[1],m=(0,M.useRef)();(0,M.useEffect)(function(){n&&(t.ellipsis?O().md2html(n,{mode:"light",cdn:r,markdown:{sanitize:!0}}).then(function(t){var n,r,o;f((n=(0,e.stripMarkdownIframes)(t),(r=document.createElement("div")).innerHTML=n,o=r.innerText,r=null,(null==o?void 0:o.replace(/[\n\r]/g,""))||""))}).catch(function(){return f("")}):O().preview(o.current,n,{mode:"light",cdn:r,markdown:{sanitize:!0},transform:e.stripMarkdownIframes}).then(function(){return(0,e.removeMarkdownIframes)(o.current)}).catch(function(){return(0,e.removeMarkdownIframes)(o.current)}))},[n,t.ellipsis,r]);var v=(0,M.useCallback)(function(){var e;return!!m.current&&q(m.current)>(null==(e=m.current)?void 0:e.offsetWidth)},[m]);return t.ellipsis?C().createElement(L.Popover,{open:a,onOpenChange:function(e){l(c&&e)},content:C().createElement(B,{value:n,style:{maxWidth:500,maxHeight:400,overflowY:"auto"}})},C().createElement("div",{ref:m,style:{overflow:"hidden",overflowWrap:"break-word",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-all"},onMouseEnter:function(e){var t=e.target;v()&&d(t.scrollWidth>=t.clientWidth)}},p)):C().createElement(B,{value:n})};function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function U(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}var F=["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"],W=(0,T.connect)(function(n){var r,o,i,l=n.disabled,s=n.onChange,c=n.value,d=n.fileCollection,u=n.toolbar,p=n.editMode,f=n.mode,m=(0,H.useFlowContext)(),v=(0,t.k)(),h=function(e){if(Array.isArray(e))return e}(r=(0,M.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(r)||function(e){if(e){if("string"==typeof e)return V(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V(e,2)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=h[0],b=h[1],y=(0,M.useRef)(),w=(0,M.useRef)(!1),k=(0,M.useRef)(null),E=(0,M.useRef)(null),x=N(),S=j(),_=S.wrapSSR,T=S.hashId,L=S.componentCls,A=(null==(i=m.api)||null==(o=i.auth)?void 0:o.locale)||"en-US",D=m.app.pm.get("@nocobase/plugin-file-manager"),I=(0,M.useRef)(m.t.bind(m));I.current=m.t.bind(m);var R=f||(void 0===p?"ir":p),P=(0,M.useMemo)(function(){var e=A.replace(/-/g,"_");return F.includes(e)?e:"en_US"},[A]);return(0,M.useEffect)(function(){if(k.current){var t=null!=u?u:a,n=(0,e.stripMarkdownIframeTags)(null!=c?c:""),r=new(O())(k.current,{value:n,lang:P,cache:{enable:!1},undoDelay:0,preview:{markdown:{sanitize:!0},math:{engine:"KaTeX"},transform:e.stripMarkdownIframes},toolbar:t,fullscreen:{index:1200},cdn:x,minHeight:200,mode:R,after:function(){y.current=r,b(!0);var e=window.scrollX||window.pageXOffset,t=window.scrollY||window.pageYOffset;requestAnimationFrame(function(){window.scrollTo(e,t)}),l?r.disabled():r.enable()},input:function(t){var n=(0,e.stripMarkdownIframeTags)(t);n!==t&&r.setValue(n),s(n)},upload:{multiple:!1,fieldName:"file",handler:function(e){var t;return(t=function(){var t,n,o,i,a,l,s,c,u,p,f,h,g;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(b){switch(b.label){case 0:return s=e[0],r.focus(),[4,m.api.resource("vditor").check({fileCollectionName:d})];case 1:return c=b.sent().data,r.tip(m.t("uploading"),0),[4,D.uploadFile({file:s,fileCollectionName:d,storageId:null==c||null==(n=c.data)||null==(t=n.storage)?void 0:t.id,storageType:null==c||null==(i=c.data)||null==(o=i.storage)?void 0:o.type,storageRules:null==c||null==(l=c.data)||null==(a=l.storage)?void 0:a.rules})];case 2:if(p=(u=b.sent()).data,f=u.errorMessage)return r.tip(I.current(f),3e3),[2];if(!p)return r.tip(v("Response data is empty"),3e3),[2];return h=p.filename,g=p.url,s.type.startsWith("image/")?r.insertValue(".concat(g,")")):r.insertValue("[".concat(h,"](").concat(g,")")),r.tip(v(""),10),[2,null]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){U(i,r,o,a,l,"next",e)}function l(e){U(i,r,o,a,l,"throw",e)}a(void 0)})})()}}}),o=k.current;if(o){var i=new MutationObserver(function(){var e=o.classList.contains("vditor--fullscreen"),t=o.querySelectorAll(".vditor-reset"),n=o.querySelectorAll(".vditor-toolbar");t.forEach(function(t){t.style.padding=e?"10px 200px":""}),n.forEach(function(t){t.style.paddingLeft=e?"200px":""})});return i.observe(o,{attributes:!0,attributeFilter:["class"]}),function(){var e;null==(e=y.current)||e.destroy(),y.current=void 0,i.disconnect()}}}},[null==u?void 0:u.join(","),R]),(0,M.useEffect)(function(){if(g&&y.current){var t=y.current,n=(0,e.stripMarkdownIframeTags)(null!=c?c:"");if(n!==t.getValue()){var r,o,i,a,l=window.scrollX||window.pageXOffset,s=window.scrollY||window.pageYOffset;t.setValue(n);var d=null==(r=k.current)?void 0:r.querySelector("div.vditor-content > div.vditor-ir > pre"),u=null==(o=k.current)?void 0:o.querySelector(".vditor-content"),p=d&&(document.activeElement===d||d.contains(document.activeElement)||(null==(a=document.activeElement)||null==(i=a.closest)?void 0:i.call(a,".vditor-content"))===u);if(d&&p){var f=document.createRange(),m=window.getSelection();m&&(f.selectNodeContents(d),f.collapse(!1),m.removeAllRanges(),m.addRange(f))}p||requestAnimationFrame(function(){window.scrollTo(l,s)})}}},[c,g]),(0,M.useEffect)(function(){g&&y.current&&(l?y.current.disabled():y.current.enable())},[l,g]),(0,M.useEffect)(function(){if(E.current){var e=new MutationObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,l=!0,s=!1,c=void 0;try{for(var d,u=Array.from(a.addedNodes)[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var p,f=d.value;p=HTMLElement,(null!=p&&"u">typeof Symbol&&p[Symbol.hasInstance]?!!p[Symbol.hasInstance](f):f instanceof p)&&f.classList.contains("vditor-img")&&(E.current.appendChild(f),f.style.zIndex=String(2200))}}catch(e){s=!0,c=e}finally{try{l||null==u.return||u.return()}finally{if(s)throw c}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}});return e.observe(document.body,{childList:!0}),function(){e.disconnect()}}},[2200]),(0,M.useLayoutEffect)(function(){var e=k.current;if(e){var t=new ResizeObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a,l=o.value.target;l.className.includes("vditor--fullscreen")?(document.body.appendChild(l),w.current=!0):w.current&&(null==(a=E.current)||a.appendChild(l),w.current=!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}});return t.observe(e),function(){t.unobserve(e)}}},[]),_(C().createElement("div",{ref:E,className:"".concat(T," ").concat(L)},C().createElement("div",{ref:k})))},(0,T.mapReadPretty)(z));function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(){var e;function t(e,n){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");G(this,"app",void 0),G(this,"getPublicPath",void 0),this.app=e,this.getPublicPath=n}return e=[{key:"dependencies",get:function(){return{cdn:this.getCDN()}}},{key:"getCDN",value:function(){return this.app.getCdnUrl()+"static/plugins/@nocobase/plugin-block-markdown/dist/client/vditor"}},{key:"initVditorDependency",value:function(){var e=this,t=this.getCDN();try{var n,r="plugin-field-markdown-vditor-dep",o=(n={},G(n,"".concat(r,".katex"),"".concat(t,"/dist/js/katex/katex.min.js?v=0.16.9")),G(n,"".concat(r,".ABCJS"),"".concat(t,"/dist/js/abcjs/abcjs_basic.min")),G(n,"".concat(r,".plantumlEncoder"),"".concat(t,"/dist/js/plantuml/plantuml-encoder.min")),G(n,"".concat(r,".echarts"),"".concat(t,"/dist/js/echarts/echarts.min")),G(n,"".concat(r,".flowchart"),"".concat(t,"/dist/js/flowchart.js/flowchart.min")),G(n,"".concat(r,".Viz"),"".concat(t,"/dist/js/graphviz/viz")),G(n,"".concat(r,".mermaid"),"".concat(t,"/dist/js/mermaid/mermaid.min")),n);this.app.requirejs.require.config({waitSeconds:120,paths:o}),Object.keys(o).forEach(function(t){e.app.requirejs.require([t],function(e){window[t.split(".")[1]]=e})})}catch(e){console.log("initVditorDependency failed",e)}}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?C().createElement(z,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){G(e,t,n[t])})}return e}({value:e},t)):null}},{key:"edit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return C().createElement(W,e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}();function J(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function Z(e,t,n){return(Z=ee()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&$(o,n.prototype),o}).apply(null,arguments)}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t){return($=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Q(e){var t="function"==typeof Map?new Map:void 0;return(Q=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Z(e,arguments,Y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$(n,e)})(e)}function ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ee=function(){return!!e})()}var et=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=Y(t),X(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ee()?Reflect.construct(t,r||[],Y(this).constructor):t.apply(this,r)),"dependencyLoaded",!1),X(e,"runtime",void 0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&$(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){return e=this,this.runtime=new K(this.app,function(){return e.app.getPublicPath()}),this.app.addComponents({MarkdownVditor:W}),this.app.addFieldInterfaces([l]),this.flowEngine.context.defineProperty("markdownVditor",{get:function(){return e.runtime}}),this.flowEngine.context.defineProperty("markdownVditorDependencies",{get:function(){return e.runtime.dependencies}}),this.flowEngine.registerModelLoaders({VditorFieldModel:{loader:function(){return Promise.resolve().then(s.bind(s,284))}},DisplayVditorFieldModel:{loader:function(){return Promise.resolve().then(s.bind(s,26))}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){J(i,r,o,a,l,"next",e)}function l(e){J(i,r,o,a,l,"throw",e)}a(void 0)})}).call(this)}},{key:"getCDN",value:function(){return this.runtime.getCDN()}},{key:"initVditorDependency",value:function(){return this.runtime.initVditorDependency()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(Q(e.Plugin))}(),f}()});
|