@ones-editor/editor 0.0.3-beta.205 → 0.0.3-beta.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +18 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@keyframes ones-editor-blink{0%,to{background-color:transparent}50%{background-color:var(--primary-color)}}*{--link-color: #338fe5;--color-0: #e52727;--color-1: #eb6414;--color-2: #f0a100;--color-3: #24b47e;--color-4: #338fe5;--color-5: #9678d3;--color-6: #909090;--background-color-0: #fad4d4;--background-color-1: #fbe0d0;--background-color-2: #fceccc;--background-color-3: #d3f0e5;--background-color-4: #d6e9fa;--background-color-5: #eae4f6;--background-color-6: #dedede;--background-color-7: #e52727;--background-color-8: #eb6414;--background-color-9: #f0a100;--background-color-10: #24b47e;--background-color-11: #338fe5;--background-color-12: #9678d3;--background-color-13: #909090;--background-color-14: #e8e8e8;--font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif}div.editor-root{--text-color: #303030;--primary-color: #338fe5;--background-selection: #338fe533;--background-code: #cdcdcd40}div.editor-root{color:var(--text-color);position:relative;box-sizing:border-box;min-height:100%;width:100%;z-index:1}div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span.text.link{cursor:pointer}div.editor-root *{box-sizing:border-box;font-family:var(--font-family)}div.editor-root button{outline:none}div.editor-root.active div.editor-content .editor-cursor{opacity:1}div.editor-root .safari.mobile div.editor-content .editor-input{pointer-events:all;width:8px}div.editor-root div.editor-content{height:100%;width:100%;padding:0 30px 30px}div.editor-root div.editor-content .editor-cursor{position:absolute;background:var(--primary-color);width:2px;transition:top .1s ease-in,left .1s linear;animation:ones-editor-blink 1s ease-in-out infinite;opacity:0;pointer-events:none}div.editor-root div.editor-content .editor-input{position:absolute;opacity:0;pointer-events:none;width:16px;height:20px;font-size:16px}div.editor-root div.editor-content div[data-type=editor-container]{position:relative}div.editor-root div.editor-content div[data-type=editor-container].root{user-select:none;width:100%;cursor:text}div.editor-root div.editor-content div[data-type=editor-container].root>.container-blocks>*+*{margin-top:1em}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block]:not(:first-of-type){background-color:var(--background-selection)}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block]:not(:first-of-type) div[data-type=block-background]>.editor-selection-background{background-color:transparent!important}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block].embed-block>div[data-type=block-content]:before,div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block].embed-block .embed-selected-content:before{display:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]+div[data-type=editor-block][data-style-quoted]{margin-top:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block]{font-size:var(--font-size);line-height:var(--line-height);position:relative;--font-size: 15px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=center] div[data-type=block-content]{text-align:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=right] div[data-type=block-content]{text-align:end}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].block-hidden{display:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=text]{cursor:text}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]{word-break:break-word;position:relative}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span{cursor:text}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text{white-space:pre-wrap}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.link{color:var(--link-color)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.link:hover{text-decoration:underline}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.link.style-strikethrough:hover{text-decoration:underline line-through}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-bold{font-weight:700}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-italic{font-style:italic}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-underline{text-decoration:underline}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-strikethrough{text-decoration:line-through}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-underline.style-strikethrough{text-decoration:underline line-through}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-code{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:var(--background-code);padding:4px;font:.8em Monaco,Consolas,"Andale Mono",DejaVu Sans Mono,monospace}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-sub{vertical-align:sub;font-size:70%}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-super{vertical-align:super;font-size:70%}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="0"]{color:var(--color-0)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="1"]{color:var(--color-1)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="2"]{color:var(--color-2)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="3"]{color:var(--color-3)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="4"]{color:var(--color-4)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="5"]{color:var(--color-5)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="6"]{color:var(--color-6)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="0"]{background-color:var(--background-color-0)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="1"]{background-color:var(--background-color-1)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="2"]{background-color:var(--background-color-2)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="3"]{background-color:var(--background-color-3)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="4"]{background-color:var(--background-color-4)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="5"]{background-color:var(--background-color-5)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="6"]{background-color:var(--background-color-6)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="7"]{background-color:var(--background-color-7)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="8"]{background-color:var(--background-color-8)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="9"]{background-color:var(--background-color-9)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="10"]{background-color:var(--background-color-10)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="11"]{background-color:var(--background-color-11)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="12"]{background-color:var(--background-color-12)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="13"]{background-color:var(--background-color-13)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="14"]{background-color:var(--background-color-14)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].inputting-insertion>span[data-type=insertion-content]{border-bottom:1px solid var(--primary-color)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion{width:0px;position:relative;display:inline-block;vertical-align:text-bottom;overflow:visible;height:1em}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion>span[data-type=insertion-content]{position:absolute;color:transparent;width:3px;left:-3px;border-right:var(--cursor-color) 1px solid;text-overflow:clip;display:inline-block;top:-5px;bottom:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion>span[data-type=insertion-content] span[data-cursor-name]{display:inline-block;width:8px;background-color:transparent;border:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion>span[data-type=insertion-content] span[data-cursor-name]:hover:before,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion.active>span[data-type=insertion-content] span[data-cursor-name]:before{content:attr(data-cursor-name);position:absolute;top:-12px;height:1.1em;background-color:var(--cursor-color);z-index:27;left:0px;color:#fff;white-space:nowrap;font-size:12px;display:flex;align-items:center;padding:1px 4px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span[data-type=box-content]{border-radius:2px;margin-left:8px;margin-right:8px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span[data-type=editor-box].br-box>span[data-type=box-content] img{vertical-align:middle;max-width:1em}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span[data-type=editor-box][data-box-type=image].image-box span[data-type=box-content]{user-select:none;margin-left:0;margin-right:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-tools] .editor-block-anchor{position:absolute}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-background] .editor-selection-background{position:absolute;background-color:var(--background-selection);z-index:1;pointer-events:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block{cursor:default}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.hover>div[data-type=block-content],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block.hover>div[data-type=block-content]{outline:1px solid #338fe5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block>div[data-type=block-content],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block>div[data-type=block-content]{display:flex}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.hover .embed-hover-content{outline:1px solid #338fe5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected>div[data-type=block-content],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected .embed-selected-content{position:relative}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected>div[data-type=block-content]:before,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected .embed-selected-content:before{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#338fe5;opacity:.1}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block{color:#909090;font-size:12px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block>div[data-type=block-content]{padding:5px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]{border-left:4px solid #e8e8e8;color:#909090}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]:not([data-list-level]){padding-left:8px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="1"]{--font-size: 28px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="1"]:not(:first-child){margin-top:24px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="2"]{--font-size: 26px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="2"]:not(:first-child){margin-top:24px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="3"]{--font-size: 24px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="3"]:not(:first-child){margin-top:20px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="4"]{--font-size: 22px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="4"]:not(:first-child){margin-top:20px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="5"]{--font-size: 20px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="5"]:not(:first-child){margin-top:16px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="6"]{--font-size: 18px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="6"]:not(:first-child){margin-top:16px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="7"]{--font-size: 16px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="8"]{--font-size: 14px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading]{font-size:var(--font-size);line-height:var(--line-height);font-weight:700}.editor-disable-scroll{position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:9900;overflow:hidden}div:not(.comment-editor-root)>div.editor-root>div.editor-content>div[data-type=editor-container]>div.container-blocks>div[data-type=editor-block]:first-of-type{font-size:30px;line-height:1.3}div.comment-editor-root div.root.select-all>.container-blocks>div[data-type=editor-block]:first-of-type{background-color:var(--background-selection)}div.comment-editor-root div.root.select-all>.container-blocks>div[data-type=editor-block]:first-of-type div[data-type=block-background]>.editor-selection-background{background-color:transparent!important}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-anchor{position:absolute;pointer-events:none;z-index:-1}.editor-command-bar.toolbar .color-button{width:24px;height:24px;display:flex;padding:0;margin:0;align-items:center;justify-content:center;background-color:transparent;border:0;outline:0;border-radius:3px;cursor:pointer}.editor-command-bar.toolbar .color-button[data-color="0"]{color:var(--color-0)}.editor-command-bar.toolbar .color-button[data-color="1"]{color:var(--color-1)}.editor-command-bar.toolbar .color-button[data-color="2"]{color:var(--color-2)}.editor-command-bar.toolbar .color-button[data-color="3"]{color:var(--color-3)}.editor-command-bar.toolbar .color-button[data-color="4"]{color:var(--color-4)}.editor-command-bar.toolbar .color-button[data-color="5"]{color:var(--color-5)}.editor-command-bar.toolbar .color-button[data-color="6"]{color:var(--color-6)}.editor-command-bar.toolbar .color-button[data-background-color="0"]{background-color:var(--background-color-0)}.editor-command-bar.toolbar .color-button[data-background-color="1"]{background-color:var(--background-color-1)}.editor-command-bar.toolbar .color-button[data-background-color="2"]{background-color:var(--background-color-2)}.editor-command-bar.toolbar .color-button[data-background-color="3"]{background-color:var(--background-color-3)}.editor-command-bar.toolbar .color-button[data-background-color="4"]{background-color:var(--background-color-4)}.editor-command-bar.toolbar .color-button[data-background-color="5"]{background-color:var(--background-color-5)}.editor-command-bar.toolbar .color-button[data-background-color="6"]{background-color:var(--background-color-6)}.editor-command-bar.toolbar .color-button[data-background-color="7"]{background-color:var(--background-color-7)}.editor-command-bar.toolbar .color-button[data-background-color="8"]{background-color:var(--background-color-8)}.editor-command-bar.toolbar .color-button[data-background-color="9"]{background-color:var(--background-color-9)}.editor-command-bar.toolbar .color-button[data-background-color="10"]{background-color:var(--background-color-10)}.editor-command-bar.toolbar .color-button[data-background-color="11"]{background-color:var(--background-color-11)}.editor-command-bar.toolbar .color-button[data-background-color="12"]{background-color:var(--background-color-12)}.editor-command-bar.toolbar .color-button[data-background-color="13"]{background-color:var(--background-color-13)}.editor-command-bar.toolbar .color-button[data-background-color="14"]{background-color:var(--background-color-14)}.tippy-content{white-space:pre-line}.editor-button{min-height:26px;min-width:46px;font-size:12px;font-weight:400;outline:none;background-color:#fff;color:#606060;border:1px solid #c7c7c7;padding:4px 8px;border-radius:4px;margin-right:8px;cursor:pointer}.editor-button:disabled{cursor:not-allowed;opacity:.5;background-color:#e8e8e8}.editor-button:not(:disabled):hover{border:1px solid #338fe5;background-color:#eaf3fc;color:#338fe5}.editor-button.primary{font-weight:500;border:1px solid rgba(0,0,0,0);background-color:var(--editor-button-bg-color, #338fe5);color:var(--editor-button-color, #fff)}.editor-button.primary:not(:disabled):hover{background-color:#5ca5ea;border:1px solid rgba(0,0,0,0);color:var(--editor-button-color, #fff)}.editor-button.primary:disabled{cursor:not-allowed;opacity:.5}.editor-button.primary:not(:disabled):active{background-color:#2872b7;color:#fff;border-color:#2872b7}.editor-button:last-child{margin-right:0}.editor-button:not(:disabled):active{background-color:#d6e9fa;color:#2872b7;border-color:#2872b7}@keyframes editorLoadingCircle{0%{transform-origin:50% 50%;transform:rotate(0)}to{transform-origin:50% 50%;transform:rotate(360deg)}}.editor-loading svg{color:#338fe5;font-size:1em;animation:editorLoadingCircle .8s linear infinite}.editor-checkbox-wrapper{display:flex;height:14px;width:14px;border:none;background-color:transparent;outline:none;padding:0;overflow:visible;box-sizing:border-box;cursor:pointer}.editor-checkbox-wrapper .editor-checkbox{display:block;width:100%;height:100%}.editor-checkbox-wrapper .editor-checkbox>.editor-checkbox-inner{display:block;box-sizing:border-box;border:1px solid #c7c7c7;border-radius:3px;height:100%;width:100%;position:relative;left:0;top:0;transition:all .3s}.editor-checkbox-wrapper:not(.checked)>span.editor-checkbox:hover>span.editor-checkbox-inner{border-color:#338fe5}.editor-checkbox-wrapper.checked>.editor-checkbox{position:relative}.editor-checkbox-wrapper.checked>.editor-checkbox:after{animation:editorCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;border:1px solid #338fe5;border-radius:3px;content:"";height:100%;left:0;position:absolute;top:0;width:100%;box-sizing:border-box}.editor-checkbox-wrapper.checked>.editor-checkbox>span.editor-checkbox-inner{border-color:#338fe5;background-color:#338fe5}.editor-checkbox-wrapper.checked>.editor-checkbox>span.editor-checkbox-inner:after{width:5px;height:10px;left:2px;top:5px;border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;box-sizing:border-box;transform:rotate(45deg) scale(1) translate(-50%,-50%)}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}[data-theme=dropdown-list]{border-radius:4px;background:white;position:relative;max-width:calc(100vw - 24px);box-shadow:#0f0f0f0d 0 0 0 1px,#0f0f0f1a 0 3px 6px,#0f0f0f33 0 9px 24px;overflow:hidden}[data-theme=dropdown-list] .tippy-content{padding:0;background:white;color:#303030}[data-theme=dropdown-list] .tippy-content .editor-command-bar{max-height:50vh}[data-theme=dropdown-list] .filterable-list{min-width:100px;max-width:300px;display:flex;flex-direction:column;max-height:100%}[data-theme=dropdown-list] .filterable-list .filter{padding:8px}[data-theme=dropdown-list] .filterable-list .filter .filter-container{width:100%;font-size:14px;line-height:20px;padding:3px 6px;position:relative;border-radius:3px;box-shadow:#0f0f0f1a 0 0 0 1px inset;background:rgba(242,241,238,.6);cursor:text;height:28px;box-sizing:border-box;display:flex;align-items:center}[data-theme=dropdown-list] .filterable-list .filter .filter-container input.filter-input{border:none;outline:none;flex-grow:1;background:transparent}[data-theme=dropdown-list] .filterable-list .list{max-height:60vh;overflow-y:auto;padding:8px 0}[data-theme=dropdown-list] .filterable-list .list .list-item{user-select:none;transition:background 20ms ease-in 0s;cursor:pointer;width:calc(100% - 8px);margin-left:4px;margin-right:4px;border-radius:3px;height:24px;padding:4px 8px;display:flex;align-items:center;box-sizing:border-box}[data-theme=dropdown-list] .filterable-list .list .list-item .list-text{white-space:nowrap}[data-theme=dropdown-list] .filterable-list .list .list-item.selected{background-color:#eee}[data-theme=dropdown-list] .filterable-list .list .list-item.disabled{color:#c1c1c1}::placeholder{color:#bbb}.toast{font-family:Avenir,Helvetica,Arial,sans-serif;visibility:hidden;min-width:250px;margin-left:-125px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:8px;position:fixed;z-index:1;left:50%;bottom:30px}.toast.show{visibility:visible;animation:toast_fade_in .5s,toast_fade_out .5s 2.5s}.toast.positioned.show{animation:toast_fade_in_positioned .5s,toast_fade_out_positioned .5s 2.5s}.toast.positioned{bottom:unset}@keyframes toast_fade_in{0%{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@keyframes toast_fade_out{0%{bottom:30px;opacity:1}to{bottom:0;opacity:0}}@keyframes toast_fade_in_positioned{0%{opacity:0}to{opacity:1}}@keyframes toast_fade_out_positioned{0%{opacity:1}to{opacity:0}}div.tippy-box[data-theme=toolbar] .tippy-content,div.tippy-box[data-theme=menu] .tippy-content{padding:0}div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu{min-width:180px}div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar-root,div.tippy-box[data-theme=toolbar] .tippy-content .editor-command-bar-root{box-shadow:0 0 1px #30303040,0 12px 24px #30303026}div.tippy-box button{outline:none}.editor-command-bar-root{display:flex;flex-direction:column;align-items:flex-start;background:#ffffff;border-radius:2px;max-height:50vh;overflow:auto}.editor-command-bar-root.scrollable-bar>.editor-command-bar.menu{overflow-y:auto}.editor-command-bar{pointer-events:all;display:flex;box-sizing:border-box;--text-color: #606060;--primary-color: #338fe5;--selected-color: #f8f8f8;--separator-color: #e8e8e8;--warn-color: #fdf4f4}.editor-command-bar.fixed.toolbar{box-shadow:none}.editor-command-bar.menu{flex:1;width:100%;display:flex;flex-direction:column;align-items:flex-start;padding:5px 0}.editor-command-bar.menu .command-item.standard{color:#303030;user-select:none;transition:background 20ms ease-in 0s;cursor:pointer;width:100%;height:32px;padding:6px 10px;display:flex;align-items:center;box-sizing:border-box}.editor-command-bar.menu .command-item.standard .menu-item-icon{align-items:center;height:24px;width:24px;margin-right:5px;margin-top:-2px;display:flex;flex-direction:column;justify-content:center}.editor-command-bar.menu .command-item.standard .menu-item-name{white-space:nowrap;flex-grow:1;display:flex;align-items:center}.editor-command-bar.menu .command-item.standard .item-subtext{color:#b2bccd}.editor-command-bar.menu .command-item.standard .menu-item-sub-indicator{display:flex;align-items:center;justify-content:center}.editor-command-bar.menu .command-item.standard .menu-item-sub-indicator svg{width:16px;height:16px}.editor-command-bar.menu .command-item.standard.disabled{color:#c7c7c7;cursor:not-allowed}.editor-command-bar.menu .command-item.separator{height:1px;margin:4px 0;background-color:var(--separator-color);width:100%}.editor-command-bar.menu .command-item.section{font-size:.8em;color:#ccc;padding:5px 5px 5px 10px}.editor-command-bar.menu .command-item.selected{background-color:var(--selected-color)}.editor-command-bar.menu .command-item.selected[data-id=delete]{color:#e52727;background-color:var(--warn-color)}.editor-command-bar.menu .command-item.selected.disabled{background-color:transparent}.editor-command-bar.menu .command-item.checked{color:var(--primary-color)}.editor-command-bar.menu .command-item.checked .menu-item-checked-icon{display:flex;align-items:center;justify-content:center;margin-left:10px}.editor-command-bar.menu .command-item.checked.disabled{color:#c7c7c7}.editor-command-bar.menu .command-item span.highlight{color:#e52727}.editor-command-bar.toolbar{display:flex;flex-direction:row;align-items:flex-start;padding:5px 10px;gap:5px;background:#ffffff;box-shadow:0 0 1px #30303033,0 8px 16px #30303026;border-radius:3px}.editor-command-bar.toolbar .command-item{background:transparent;border:none;display:flex;align-items:center;justify-content:center;color:var(--text-color);height:24px;padding:0;cursor:pointer;border-radius:3px;min-width:24px}.editor-command-bar.toolbar .command-item.selected:not(.disabled){background-color:var(--selected-color)}.editor-command-bar.toolbar .command-item.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.checked{color:var(--primary-color)}.editor-command-bar.toolbar .command-item.checked.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.separator{margin:auto 2px;height:20px;min-width:1px;width:1px;background-color:var(--separator-color);padding:0;pointer-events:none;cursor:default}.editor-command-bar.toolbar .command-item .toolbar-item-name-container,.editor-command-bar.toolbar .command-item .toolbar-item-icon-container{display:flex}.editor-command-bar.toolbar .command-item[data-dropdown=true]{padding-left:4px;padding-right:4px}.editor-command-bar.toolbar .command-item[data-dropdown=true] .toolbar-item-icon-container{width:24px;height:24px;align-items:center;justify-content:center}.editor-command-bar.toolbar .command-item .toolbar-item-dropdown-container{display:flex}.editor-command-bar.toolbar .command-item .toolbar-item-dropdown-container svg{transform:rotate(360deg);transition:transform .2s linear}.editor-command-bar.toolbar .command-item.active .toolbar-item-dropdown-container svg{transform:rotate(180deg)}.editor-command-bar.toolbar .editor-button+.editor-button{margin-left:5px}.editor-command-bar.footer{width:100%}.reference-hidden .tippy-box[data-reference-hidden]{opacity:0;pointer-events:none;transition:none}.tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.editor-dropdown{display:flex;align-items:center;border:1px solid #C7C7C7;border-radius:3px;font-size:14px;width:200px;height:30px}.editor-dropdown *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.editor-dropdown .dropdown-text,.editor-dropdown .dropdown-input{flex-grow:1;padding:2px 8px;border:none;outline:none;background:transparent;font-size:14px;color:#333;min-width:0;flex-shrink:1}.editor-dropdown .dropdown-text{margin-right:4.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:100%;cursor:text;line-height:24px}.editor-dropdown:hover{border-color:#338fe5}.editor-dropdown.active{border-color:#338fe5;box-shadow:0 0 0 2px #338fe533}.editor-dropdown.active .dropdown-text{display:none}.editor-dropdown:not(.active) .dropdown-input{display:none}.editor-dropdown .dropdown-labels{display:flex;align-items:center;flex-shrink:0}.editor-dropdown .dropdown-labels .dropdown-label{color:#338fe5;background-color:#eaf3fc;height:20px;padding:0 5px;border-radius:3px;display:flex;align-items:center}.editor-dropdown .dropdown-labels .dropdown-label+.dropdown-label{margin-left:5px}.editor-dropdown .dropdown-clear-icon,.editor-dropdown .dropdown-icon{flex-shrink:0;width:16px;height:16px;margin-left:4px;display:flex;align-items:center;justify-content:center;cursor:pointer}.editor-dropdown .dropdown-clear-icon{color:#909090}.editor-dropdown .dropdown-clear-icon:hover{color:#338fe5}.editor-dropdown.empty .dropdown-clear-icon,.editor-dropdown:not(:hover) .dropdown-clear-icon{display:none}.editor-dropdown.empty .dropdown-text{color:#909090}.editor-dropdown .dropdown-icon{margin-right:4px}.scale-border:after,.color-palette .palette-container-row .background-color-button.selected:after,.color-palette .palette-container-row .background-color-button:hover:after{content:"";outline:1px solid #d6e9fa;border-radius:3px;position:absolute;left:0;right:0;top:0;bottom:0;transform:scale(1.1)}.color-palette{display:flex;flex-direction:column;align-items:center;padding-top:5px;background-color:#fff;--active-color: #2872b7}.color-palette .bar-desc{box-sizing:border-box;width:100%;height:24px;padding-left:10px;margin-bottom:10px;line-height:24px;font-size:12px;font-weight:500;background:#F8F8F8;color:#909090}.color-palette .palette-container{padding:0 10px}.color-palette .background-color .palette-container-row:first-child{margin-bottom:5px}.color-palette .palette-container-row{display:flex;flex-direction:row;margin-bottom:20px}.color-palette .palette-container-row .color-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;background-color:#fff;border:1px solid #f0f0f0;display:flex;margin:0;padding:0;align-items:center;justify-content:center}.color-palette .palette-container-row .color-button:hover{border:1px solid #d6e9fa}.color-palette .palette-container-row .color-button.selected{border:1px solid var(--primary-color)}.color-palette .palette-container-row .color-button[data-color-index="-1"]{color:var(--text-color)}.color-palette .palette-container-row .color-button[data-color-index="0"]{color:var(--color-0)}.color-palette .palette-container-row .color-button[data-color-index="1"]{color:var(--color-1)}.color-palette .palette-container-row .color-button[data-color-index="2"]{color:var(--color-2)}.color-palette .palette-container-row .color-button[data-color-index="3"]{color:var(--color-3)}.color-palette .palette-container-row .color-button[data-color-index="4"]{color:var(--color-4)}.color-palette .palette-container-row .color-button[data-color-index="5"]{color:var(--color-5)}.color-palette .palette-container-row .color-button[data-color-index="6"]{color:var(--color-6)}.color-palette .palette-container-row .background-color-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;position:relative}.color-palette .palette-container-row .background-color-button.selected:after{outline:1px solid var(--primary-color)}.color-palette .palette-container-row .background-color-button[data-color-index="-1"]{position:relative;background-color:#fff;border:1px solid #e8e8e8}.color-palette .palette-container-row .background-color-button[data-color-index="-1"]:after{transform:scale(1.2)}.color-palette .palette-container-row .background-color-button[data-color-index="-1"]:before{content:"";position:absolute;width:1px;height:56px;top:2px;left:22px;background-color:#c7c7c7;transform:rotate(45deg) scale(.5);transform-origin:-1px -2px}.color-palette .palette-container-row .background-color-button[data-color-index="0"]{background-color:var(--background-color-0)}.color-palette .palette-container-row .background-color-button[data-color-index="1"]{background-color:var(--background-color-1)}.color-palette .palette-container-row .background-color-button[data-color-index="2"]{background-color:var(--background-color-2)}.color-palette .palette-container-row .background-color-button[data-color-index="3"]{background-color:var(--background-color-3)}.color-palette .palette-container-row .background-color-button[data-color-index="4"]{background-color:var(--background-color-4)}.color-palette .palette-container-row .background-color-button[data-color-index="5"]{background-color:var(--background-color-5)}.color-palette .palette-container-row .background-color-button[data-color-index="6"]{background-color:var(--background-color-6)}.color-palette .palette-container-row .background-color-button[data-color-index="7"]{background-color:var(--background-color-7)}.color-palette .palette-container-row .background-color-button[data-color-index="8"]{background-color:var(--background-color-8)}.color-palette .palette-container-row .background-color-button[data-color-index="9"]{background-color:var(--background-color-9)}.color-palette .palette-container-row .background-color-button[data-color-index="10"]{background-color:var(--background-color-10)}.color-palette .palette-container-row .background-color-button[data-color-index="11"]{background-color:var(--background-color-11)}.color-palette .palette-container-row .background-color-button[data-color-index="12"]{background-color:var(--background-color-12)}.color-palette .palette-container-row .background-color-button[data-color-index="13"]{background-color:var(--background-color-13)}.color-palette .palette-container-row .background-color-button[data-color-index="14"]{background-color:var(--background-color-14)}.color-palette .palette-container-row .color-button+.color-button{margin-left:5px}.color-palette .palette-container-row .background-color-button+.background-color-button{margin-left:5px}.color-palette .clear-button-container{box-sizing:border-box;width:100%;margin-bottom:5px;padding:0 10px}.color-palette .clear-button-container .clear-button{box-sizing:border-box;padding:3px 10px;width:100%;height:26px;background:#ffffff;color:#606060;border:1px solid #c7c7c7;border-radius:3px;cursor:pointer}.color-palette .clear-button-container .clear-button:hover{border-color:var(--primary-color);color:var(--primary-color)}.color-palette .clear-button-container .clear-button:active{border-color:var(--active-color);color:var(--active-color);background-color:#d6e9fa}.editor-input-wrap .editor-input-label{margin-top:8px;margin-bottom:8px;position:relative}.editor-input-wrap .editor-input-label.required:before{content:"*";color:#e82100;position:absolute;left:-8px;top:3px}.editor-input-wrap .editor-input-label .span{font-size:14px;line-height:1.4;font-weight:700;color:#303030}.editor-input-wrap .editor-input-container{display:flex;border:none;border-radius:4px;padding:4px;background-color:#fff}.editor-input-wrap .editor-input-container .editor-input{outline:none;border:1px solid #c7c7c7;border-radius:3px;padding:4px 10px;font-size:14px;line-height:1.4;color:#000;width:100%}.editor-input-wrap .editor-input-container .editor-input:focus{border-color:#338fe5;box-shadow:0 0 0 2px #338fe533}.editor-input-wrap.error .editor-input-container{border:1px solid #e82100}.editor-input-wrap.error .editor-input-container .editor-input{border:none;outline:none;box-shadow:unset}.editor-input-wrap.error .editor-input-error{margin-top:8px;color:red;display:block}.editor-input-wrap .editor-input-error{display:none}div.scroll-container-root{position:relative}div.scroll-container-root>div.scroll-container{position:relative;overflow-x:auto;overflow-y:hidden;box-sizing:border-box;line-height:0px}div.scroll-container-root>div.scroll-container>.scroll-area{position:relative;display:inline-block;overflow:hidden;line-height:normal}div.scroll-container-root>div.scroll-container{scrollbar-width:none}div.scroll-container-root>div.scroll-container::-webkit-scrollbar{height:0;opacity:0}div.scroll-container-root>div.container-scroll-tool .container-border-shadow{position:absolute;top:0;opacity:0;width:0;border:none;pointer-events:none;transition:opacity 50ms ease-in;z-index:1}div.scroll-container-root>div.container-scroll-tool .container-right-border-shadow{right:0;background:linear-gradient(90deg,rgba(31,35,41,0) 0,rgba(31,35,41,.1));border-right:0px solid #dee0e3}div.scroll-container-root>div.container-scroll-tool .container-left-border-shadow{left:0;background:linear-gradient(270deg,rgba(31,35,41,0) 0,rgba(31,35,41,.1));border-left:0px solid #dee0e3}div.scroll-container-root>div.container-scroll-tool .container-border-shadow.active{width:8px;opacity:1}div.scroll-container-root>div.container-scroll-tool .container-right-border-shadow.active{border-right-width:1px}div.scroll-container-root>div.container-scroll-tool .container-left-border-shadow.active{border-left-width:1px}div.scroll-container-root>div.container-scroll-tool .container-scrollbar{position:absolute;left:0;z-index:1000;visibility:visible;overflow-x:auto;overflow-y:hidden;cursor:auto}div.scroll-container-root>div.container-scroll-tool .container-scrollbar div{height:1px}div.scroll-container-root>div.container-scroll-tool div.container-scrollbar.fixed{position:fixed}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar{opacity:.6;transition:opacity .1s ease-in-out}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar{height:8px}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar-track{background-color:transparent}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar-thumb{background-color:#646a73cc;border-radius:8px}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar-button{display:none}[data-tippy-root]{font-family:Avenir,Helvetica,Arial,sans-serif}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text]{height:32px;width:unset}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text].selected:hover{background-color:transparent}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text] .link-href-button{max-width:275px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#303030;text-decoration:none}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text] .link-href-button:hover{text-decoration:underline}[data-command-bar-id=editor-toolbar] .command-item[data-id=edit-link],[data-command-bar-id=editor-toolbar] .command-item[data-id=remove-link]{height:32px}[data-command-bar-id=editor-toolbar] .command-item[data-id=edit-link] svg,[data-command-bar-id=editor-toolbar] .command-item[data-id=remove-link] svg{stroke-width:2}[data-command-bar-id=editor-toolbar] .command-item[data-id=edit-link].selected:hover,[data-command-bar-id=editor-toolbar] .command-item[data-id=remove-link].selected:hover{background-color:transparent;color:#338fe5}[data-command-bar-id=quick-menu],[data-command-bar-id=empty-block-menu]{box-sizing:border-box;width:240px}[data-command-bar-id=quick-menu] .command-item.menu-item,[data-command-bar-id=empty-block-menu] .command-item.menu-item{width:100%;cursor:pointer}[data-command-bar-id=quick-menu] .command-item.menu-item.section,[data-command-bar-id=empty-block-menu] .command-item.menu-item.section{height:24px;padding:0 10px;font-weight:500;font-size:12px;line-height:24px;color:#909090;background:#f8f8f8;min-height:initial;box-sizing:border-box;margin:5px 0}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item{color:#303030;display:flex;width:100%;padding:6px 10px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container{display:flex;align-items:center;justify-content:center;padding-right:6px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container .quick-menu-item-icon,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container .quick-menu-item-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1{display:flex;align-items:center}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-name,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-name{flex-grow:1;font-size:14px;line-height:22px;color:#303030}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-subtext,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-subtext{color:#b2bccd}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .quick-menu-item-submenu-icon,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .quick-menu-item-submenu-icon{display:flex;align-items:center;margin-left:12px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2{margin-top:5px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2 .item-markdown,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2 .item-markdown{color:#b2bccd}[data-command-bar-id=quick-menu] .command-item.menu-item[data-id=placeholder] .quick-menu-item-icon-container,[data-command-bar-id=empty-block-menu] .command-item.menu-item[data-id=placeholder] .quick-menu-item-icon-container{display:none}[data-command-bar-id=quick-menu] .command-item.menu-item[data-id=placeholder] .item-name.text,[data-command-bar-id=empty-block-menu] .command-item.menu-item[data-id=placeholder] .item-name.text{color:#909090!important;padding:5px 0}[data-command-bar-id=block-menu]{width:240px}[data-command-bar-id=quick-menu] div.command-item>div.menu-item-name{color:#303030}[data-command-bar-id=quick-menu] div.command-item>div.menu-item-icon{color:#606060}[data-command-bar-id=quick-menu] div.command-item.section:first-of-type{margin-top:0}div.tippy-box[data-theme=editor-tooltip]{background-color:#303030;opacity:.8;font-size:12px;border-radius:3px}div.tippy-box[data-theme=editor-tooltip] .editor-tooltip-desc{display:block;margin-top:2px;color:#fff;opacity:.5}div.tippy-box[data-theme=editor-tooltip]>.tippy-arrow:before{transform:scale(.8)}div.tippy-box[data-theme=editor-tooltip]>.tippy-content{padding:4px 10px}:root div.tippy-box[data-theme=editor-tooltip]>.tippy-content{font-weight:500}:root div.tippy-box[data-theme=editor-tooltip]>.tippy-content>div>span:nth-of-type(2){font-weight:400}.link-popup-content{padding:10px 7px}.link-popup-content .link-popup-gap{margin-top:16px}.link-popup-content .editor-input-container{padding:4px 0}.link-popup-content .editor-input-container .editor-input{width:330px;line-height:1.5}.link-popup-content .editor-input-wrap .editor-input-label{margin-bottom:4px}.link-popup-content .link-popup-footer{margin:10px 0 5px;text-align:right}.link-popup-content .link-popup-footer button{min-height:30px;border-radius:3px;font-size:14px}:root{--mindmap-bg-color: #f0f2f4}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.focused [data-type=block-tools] .editor-mindmap-svg{border-radius:3px;outline:1px solid #338FE5}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.editor-in-mindmap-first{height:600px;min-width:150px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-content]{margin-right:24px;transition:background-color .25s linear}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .editor-mindmap-svg{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2;font-size:14px;background-color:var(--mindmap-bg-color)}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .mindmap-toolbar{position:absolute;top:8px;right:8px;height:24px;z-index:3}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .mindmap-toolbar .editor-button.mindmap-button{background-color:transparent;outline:none;border:none;fill:none;color:#c1c1c1;cursor:pointer;min-width:initial;margin-right:0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .mindmap-toolbar .editor-button.mindmap-button:hover{color:#5587f0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.to-mindmap-highlight [data-type=block-content],.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.to-mindmap-highlight:hover [data-type=block-content]{background-color:#eaf3fc}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap{position:absolute;right:0;top:2px;display:flex;align-items:center;height:calc(var(--font-size) * var(--line-height))}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-to-mindmap],.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button]{flex-grow:0;flex-shrink:0;width:24px;height:24px;min-width:24px;min-height:24px;padding:0;border:0;outline:0;display:flex;align-items:center;justify-content:end;background-color:transparent;color:#07142a;margin-right:8px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-to-mindmap] svg,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button] svg{width:16px;height:16px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-block-mention]:hover>svg{cursor:initial;background-color:#eee}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button+button[data-button-id=list-block-mention]{right:20px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="1"]{padding-left:24px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="1"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="2"]{padding-left:48px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="2"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="3"]{padding-left:72px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="3"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="4"]{padding-left:96px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="4"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="5"]{padding-left:120px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="5"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="6"]{padding-left:144px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="6"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="7"]{padding-left:168px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="7"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="8"]{padding-left:192px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="8"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="9"]{padding-left:216px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="9"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="10"]{padding-left:240px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="10"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="11"]{padding-left:264px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="11"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="12"]{padding-left:288px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="12"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=list][data-list-level="1"]{padding-left:0}div.editor-root div.editor-content div[data-block-type=list][data-list-level="2"]{padding-left:24px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="3"]{padding-left:48px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="4"]{padding-left:72px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="5"]{padding-left:96px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="6"]{padding-left:120px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="7"]{padding-left:144px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="8"]{padding-left:168px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="9"]{padding-left:192px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="10"]{padding-left:216px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="11"]{padding-left:240px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="12"]{padding-left:264px}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="1"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="2"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="3"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="4"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="5"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="6"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="7"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="8"]>div.list-container>button.list-marker{font-weight:700}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block+div[data-type=editor-block].list-block{margin-top:0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block{display:flex;padding-bottom:2px;padding-top:2px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=text-only] .list-container{pointer-events:none}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] div[data-type=block-content] span.text{color:#c7c7c7}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unordered] .list-container .list-marker{font-family:PingFangSC-Regular,PingFang SC;justify-content:space-around}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:var(--gray-120);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper>span.editor-check-box>span.editor-check-box-inner,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper>span.editor-check-box>span.editor-check-box-inner{border:1px solid #c7c7c7;border-collapse:initial;border-radius:3px;direction:ltr;display:block;height:14px;left:0;position:relative;top:0;transition:all .3s;width:14px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box{position:relative}@keyframes editorCheckboxEffect{0%{transform:scale(1);opacity:.5}to{transform:scale(1.6);opacity:0}}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box:after,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box:after{animation:editorCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;border:1px solid #338fe5;border-radius:3px;content:"";height:100%;left:0;position:absolute;top:0;width:100%;box-sizing:border-box}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner{border-color:#338fe5;background-color:#338fe5}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner:after,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner:after{width:5px;height:10px;left:2px;top:5px;border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;box-sizing:border-box;transform:rotate(45deg) scale(1) translate(-50%,-50%)}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper:not(.editor-check-list-wrapper-checked)>span.editor-check-box:hover>span.editor-check-box-inner,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper:not(.editor-check-list-wrapper-checked)>span.editor-check-box:hover>span.editor-check-box-inner{border-color:#338fe5}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-content]{position:relative;flex-grow:1;padding-left:2px;margin-right:29px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-container{display:flex;min-width:24px;align-items:center;justify-content:center;flex-shrink:0;border-radius:3px;height:calc(var(--font-size) * var(--line-height))}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-container .list-marker{min-width:16px;border:none;background-color:transparent;outline:none;display:flex;align-items:center;justify-content:flex-end;padding:0;overflow:visible;color:var(--primary-color);font-size:var(--font-size)}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block div[data-type=block-tools] .block-helper{top:2px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=center]{justify-content:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=center]>div[data-type=block-content]{flex-grow:initial}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=right]{justify-content:flex-end}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=right]>div[data-type=block-content]{flex-grow:initial}.editor-root.readonly button[data-button-id=mindmap-close]{display:none}.editor-root:not(.readonly) div[data-type=editor-block].list-block.active,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover{background-color:#f8f8f8}.editor-root:not(.readonly) div[data-type=editor-block].list-block.active .list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover .list-container{cursor:pointer}.editor-root:not(.readonly) div[data-type=editor-block].list-block .list-container:hover .list-marker{cursor:pointer}.editor-root:not(.readonly) div[data-type=editor-block].list-block:not([data-list-type=unchecked]):not([data-list-type=checked]):not([data-list-type=unordered]) .list-container:hover{background-color:var(--background-selection)}.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=unordered] .list-container:hover .list-marker{cursor:initial}.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container:hover .list-marker svg>*{fill:var(--background-selection)}[data-tippy-root] .customize-start-panel{max-width:350px;padding:0 16px;color:#333;font-size:14px;line-height:21px;user-select:none;background-color:#fff!important}[data-tippy-root] .customize-start-panel-input{width:64px;margin:0 8px;border:1px solid #cfd6e1;height:24px;border-radius:3px;padding:1px 0 1px 8px;outline:none;color:inherit;background-color:#fff}[data-tippy-root] .customize-start-panel-button{min-width:40px;font-size:12px;min-height:30px;margin:0 8px 0 0;background-color:var(--primary-color);color:#fff;outline:none;border:none;padding:4px 8px;border-radius:4px;cursor:pointer}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block].list-block [data-type=block-content][data-content-placeholder]:before{left:2px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.math-box{display:inline-flex}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.math-box .mathjax-tex-text.mathjax-error{color:var(--color-0)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax{max-width:100%}div.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=math]>div[data-type=block-content]{align-items:center;justify-content:center;min-height:40px}div.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=math]>div[data-type=block-content] img{margin:auto;padding:8px}.mathjax-editor-textarea{border:none;outline:none;width:400px;height:128px}.editor-text-button{border:0;color:var(--text-button-color, #c1c1c1);background-color:var(--text-button-bg-color, transparent);cursor:pointer;border-radius:var(--editor-border-radius, 3px);font-size:14px;padding:1px 6px;display:flex;align-items:center}.editor-text-button:hover{color:var(--text-button-color-hover, #5587F0);background-color:var(--text-button-bg-color-hover, transparent)}div[data-type=editor-block].table-block{--table-bar-width: 6px;--table-bar-left: -6px;--table-bar-top: -6px}div[data-type=editor-block].table-block>div[data-type=block-content]{position:relative;left:-26px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-resize-gripper,div[data-type=editor-block].table-block div[data-type=table-tools] .table-resize-gripper{position:absolute;background-color:transparent;cursor:col-resize;padding:0 2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-resize-gripper>.table-resize-gripper-indicator,div[data-type=editor-block].table-block div[data-type=table-tools] .table-resize-gripper>.table-resize-gripper-indicator{pointer-events:none;background-color:var(--primary-color);width:100%;height:100%}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container{position:absolute;background-color:transparent;z-index:10}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container.top{left:0;top:var(--table-bar-top);right:0;height:var(--table-bar-width);flex-direction:row}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container.left{top:20px;left:var(--table-bar-left);width:var(--table-bar-width);bottom:0;flex-direction:column}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar{position:absolute;left:0;top:0;right:0;bottom:0;cursor:pointer;display:flex}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar.left{flex-direction:column}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell{background-color:#e8e8e8;position:relative;flex-grow:0;flex-shrink:0}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.corner,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.corner{width:var(--table-bar-width);height:var(--table-bar-width)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.top{height:100%}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell:hover,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell:hover{background-color:#dedede}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.selected,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.selected{background-color:var(--primary-color)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.danger,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.danger{background-color:#e52727}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root{position:relative}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.top{max-width:0;width:0;overflow:visible}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.top:last-child,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.top:last-child{margin-left:-2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.left{max-height:0;height:0;overflow:visible}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.left:last-child,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.left:last-child{margin-top:-2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container{position:absolute;width:26px;height:26px;display:flex;align-items:center;justify-content:center;z-index:1}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container.top{right:-14px;top:-22px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container.left{transform:rotate(270deg);left:-22px;bottom:-14px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .insert-indicator,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .insert-indicator{position:absolute;width:3px;height:3px;background:#e8e8e8;border-radius:50%;margin-top:6px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-indicator,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-indicator{display:none}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button{display:unset}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button span.icon,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button span.icon{margin-top:2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .drop-marker,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .drop-marker{opacity:1;transform:scale(.7)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker{width:26px;height:26px;border-radius:3px;background:var(--primary-color);cursor:pointer;opacity:0;transform:scale(.4);transition:transform .2s ease-in,opacity .2s ease-in}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:after,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:after{content:"";display:block;width:10px;height:2px;background-color:#fff;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:before,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:before{content:"";display:block;width:2px;height:10px;background-color:#fff;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}div[data-type=editor-block].table-block div[data-type=block-tools] .editor-table-chart,div[data-type=editor-block].table-block div[data-type=table-tools] .editor-table-chart{padding-top:16px}div[data-type=editor-block].table-block div[data-type=table-content]{position:relative}div[data-type=editor-block].table-block div[data-type=table-content]>.error{color:red;border:1px solid red;padding:8px}div[data-type=editor-block].table-block div[data-type=table-content]>table{border-collapse:collapse;width:max-content;border-spacing:0}div[data-type=editor-block].table-block div[data-type=table-content]>table colgroup col{min-width:40px}div[data-type=editor-block].table-block div[data-type=table-content]>table,div[data-type=editor-block].table-block div[data-type=table-content]>table td,div[data-type=editor-block].table-block div[data-type=table-content]>table th{border:1px solid #c7c7c7;background-color:transparent;background-clip:padding-box}div[data-type=editor-block].table-block div[data-type=table-content]>table tr td.danger{background-color:#fce9e9!important}div[data-type=editor-block].table-block div[data-type=table-content]>table td{min-width:40px;padding:0;position:relative}div[data-type=editor-block].table-block div[data-type=table-content]>table td .table-cell-menu-btn{display:none;position:absolute;right:2px;top:2px;padding:0;width:16px;height:16px;border:none;border-radius:3px;cursor:pointer;transform:rotate(0);transition:transform .2s;background-color:transparent;color:#909090}div[data-type=editor-block].table-block div[data-type=table-content]>table td .table-cell-menu-btn:hover{background-color:#e8e8e8}div[data-type=editor-block].table-block div[data-type=table-content]>table td .table-cell-menu-btn.active{transform:rotate(180deg);color:#338fe5;background:#eaf3fc}div[data-type=editor-block].table-block div[data-type=table-content]>table td>div[data-type=editor-container].child>div.container-blocks>*+*{margin-top:5px}div[data-type=editor-block].table-block div[data-type=table-content] .child{padding:8px}div[data-type=editor-block].table-block div[data-type=table-content] .child div[data-type=editor-block].table-block>div[data-type=block-content]{pointer-events:none}div[data-type=editor-block].table-block div[data-type=table-content] .child div[data-type=editor-block].table-block>div[data-type=block-content] div[data-type=table-content]{pointer-events:auto}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-0{background-color:var(--background-color-0)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-1{background-color:var(--background-color-1)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-2{background-color:var(--background-color-2)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-3{background-color:var(--background-color-3)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-4{background-color:var(--background-color-4)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-5{background-color:var(--background-color-5)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-6{background-color:var(--background-color-6)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-7{background-color:var(--background-color-7)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-8{background-color:var(--background-color-8)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-9{background-color:var(--background-color-9)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-10{background-color:var(--background-color-10)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-11{background-color:var(--background-color-11)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-12{background-color:var(--background-color-12)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-13{background-color:var(--background-color-13)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-14{background-color:var(--background-color-14)}div[data-type=editor-block].table-block div[data-type=table-content]>table.row-title>tbody>tr:first-child>td,div[data-type=editor-block].table-block div[data-type=table-content]>table.col-title td.col-title-item{background-color:#f8f8f8}div[data-type=editor-block].table-block div[data-type=table-content]>table.stripe:not(.row-title)>tbody>tr:nth-of-type(2n),div[data-type=editor-block].table-block div[data-type=table-content]>table.stripe.row-title>tbody>tr:nth-of-type(2n + 1){background-color:#f5f8fb}div[data-type=editor-block].table-block div[data-type=table-content]>table.no-border,div[data-type=editor-block].table-block div[data-type=table-content]>.no-border>tbody>tr>td{border:1px dashed;border-color:transparent}div[data-type=editor-block].table-block.focused div[data-type=table-content]>table.no-border,div[data-type=editor-block].table-block.focused div[data-type=table-content]>table.no-border>tbody>tr>td,div[data-type=editor-block].table-block.child-focused div[data-type=table-content]>table.no-border,div[data-type=editor-block].table-block.child-focused div[data-type=table-content]>table.no-border>tbody>tr>td{border-color:#b9bfc8}div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table{background-color:var(--background-selection)}div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table td,div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table th,div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table tr{background-color:transparent}div[data-type=editor-block].table-block div[data-type=table-content]>table tbody tr td.selected,div[data-type=editor-block].table-block div[data-type=table-content]>table.row-title tbody tr td.selected,div[data-type=editor-block].table-block div[data-type=table-content]>table.col-title tbody tr td.selected{background-color:var(--background-selection)}div[data-type=editor-block].table-block div[data-type=table-content]>table td div[data-type=editor-block].table-block div[data-type=table-content]>table{max-width:100%}.command-item.menu-item .table-creator{background-color:#fff;padding:0 5px}.command-item.menu-item .table-creator .table-creator-row{display:flex}.command-item.menu-item .table-creator .table-creator-row .table-creator-cell{width:16px;height:16px;margin:3px;border:solid 1px #ddd}.command-item.menu-item .table-creator .table-creator-row .table-creator-cell.active{background-color:#99c7f2}div.editor-root div.editor-content div[data-type=editor-container].root div[data-type=editor-block].table-block{margin-top:0}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color]{width:100%}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .bar-desc{display:none}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item{box-sizing:border-box;width:100%;height:32px;padding:5px 10px;display:flex;align-items:center;justify-content:space-between;color:var(--text-color)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-sub-indicator{display:flex;align-items:center;margin-left:5px}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-sub-indicator svg{height:16px;width:16px}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;position:relative;margin-left:auto}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="-1"]{position:relative;background-color:#fff;border:1px solid #e8e8e8}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="-1"]:after{transform:scale(1.2)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="-1"]:before{content:"";position:absolute;width:1px;height:56px;top:2px;left:22px;background-color:#c7c7c7;transform:rotate(45deg) scale(.5);transform-origin:-1px -2px}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="0"]{background-color:var(--background-color-0)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="1"]{background-color:var(--background-color-1)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="2"]{background-color:var(--background-color-2)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="3"]{background-color:var(--background-color-3)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="4"]{background-color:var(--background-color-4)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="5"]{background-color:var(--background-color-5)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="6"]{background-color:var(--background-color-6)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="7"]{background-color:var(--background-color-7)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="8"]{background-color:var(--background-color-8)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="9"]{background-color:var(--background-color-9)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="10"]{background-color:var(--background-color-10)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="11"]{background-color:var(--background-color-11)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="12"]{background-color:var(--background-color-12)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="13"]{background-color:var(--background-color-13)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="14"]{background-color:var(--background-color-14)}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table]{background-color:transparent}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.row-title>tbody>tr:first-child>td,div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.col-title td.col-title-item{background-color:transparent}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.stripe:not(.row-title)>tbody>tr:nth-of-type(2n),div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.stripe.row-title>tbody>tr:nth-of-type(2n + 1){background-color:transparent}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment{box-shadow:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment table{box-shadow:0 2px #f8e6ab}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment table table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment table table{box-shadow:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment.active,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment.active{outline:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment.active table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment.active table{border-bottom:none;outline:4px solid #f8e6ab}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment.active table table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment.active table table{box-shadow:none;outline:none}div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-self>[data-type=block-content]:after,div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-others>[data-type=block-content]:after{display:none}div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-self>[data-type=block-content] div[data-type=table-content],div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-others>[data-type=block-content] div[data-type=table-content]{position:relative}div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-self>[data-type=block-content] div[data-type=table-content]:after,div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-others>[data-type=block-content] div[data-type=table-content]:after{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#303030;opacity:.1}.editor-root .editor-content div[data-type=editor-block].table-block div[data-type=block-tools] .block-helper{right:calc(100% + 5px);top:35px}[data-command-bar-id=table-row-column-toolbar] .editor-command-bar.toolbar{padding:4px}div.comment-editor-root div[data-type=editor-block].table-block>div[data-type=block-content]{left:0px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block{min-width:360px;counter-reset:code-line}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.full-selected{background-color:var(--background-selection)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.editing-language div[data-type=block-tools] .code-block-header,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.child-focused div[data-type=block-tools] .code-block-header,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:hover div[data-type=block-tools] .code-block-header{opacity:1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.wrap>div[data-type=block-tools] .code-block-header button[data-id=wrap] *{color:var(--primary-color)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child{overflow-x:auto}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child div[data-type=block-content]{word-break:keep-all;overflow:visible;white-space:pre}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child div[data-type=block-content]>span.text,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child div[data-type=block-content]>span.inputting-insertion{white-space:pre}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header{opacity:0;transition:opacity .3s ease-in 0s;position:absolute;top:0;display:flex;padding-left:16px;padding-right:4px;align-items:center;left:0;right:0;height:32px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .language-select{font-size:14px;color:#999;cursor:pointer;display:flex;align-items:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .language-select .arrow-icon{width:16px;height:16px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-spacer{flex-grow:1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button{display:flex;justify-content:center;align-items:center;border:none;border-radius:2px;margin-left:4px;padding:0;background:none;outline:none;color:#c1c1c1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button:not(.disabled){cursor:pointer}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button:not(.disabled):hover{color:#5587f0}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button.disabled{cursor:not-allowed}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button[data-id=caption]{margin-right:4px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button .button-icon{height:24px;display:flex;align-items:center;justify-content:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button .button-icon>svg{width:24px;height:24px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button .button-label{margin-left:4px;font-size:14px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button[data-id=caption]{display:none}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.full-selected>div[data-type=block-content]>div.editor-code-root>div.code-text-root{background-color:unset}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root{background-color:var(--background-code)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container]{padding-left:32px;padding-top:32px;padding-bottom:24px;border-radius:4px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container].selected{background-color:var(--background-selection)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] *{font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:14px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block+div.text-block{margin-top:4px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block:before{content:counter(code-line);counter-increment:code-line;position:absolute;left:-48px;top:10px;z-index:1;margin-top:-4px;display:block;width:48px;padding-right:8px;text-align:right;color:#aaa;box-sizing:border-box;font-size:12px;font-weight:400;line-height:12px;letter-spacing:0;white-space:nowrap;opacity:1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-comment,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-prolog,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-doctype,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-cdata{color:#708090}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-punctuation{color:#999}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-namespace{opacity:.7}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-property,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-tag,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-boolean,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-number,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-constant,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-symbol,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-deleted{color:#905}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-selector,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-attr-name,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-string,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-char,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-builtin,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-inserted{color:#690}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-operator,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-entity,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-url,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-string{color:#9a6e3a}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-atrule,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-attr-value,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-keyword{color:#07a}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-function,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-class-name{color:#dd4a68}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-regex,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-important,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-variable{color:#e90}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-important,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-bold{font-weight:700}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-italic{font-style:italic}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-entity{cursor:help}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-caption-root{padding:8px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-caption-root *{color:#aaa}div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .code-header-button[data-id=wrap],div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .code-header-button[data-id=caption]{display:none}div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .language-select{cursor:default!important}div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .language-select .arrow-icon{display:none}div.editor-root div.editor-content div[data-type=editor-container].root.select-all div[data-type=block-content]>div.editor-code-root>div.code-text-root{background-color:unset}div.comment-editor-root [data-type=editor-container].root div[data-type=editor-block].code-block{min-width:0}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=center] [data-type=block-content][data-content-placeholder]:before{justify-content:center}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=right] [data-type=block-content][data-content-placeholder]:before{justify-content:right}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-title-placeholder]:before{position:absolute;left:0;top:0;right:0;bottom:0;content:attr(data-title-placeholder);color:#c7c7c7}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-content-placeholder]:before{position:absolute;left:0;top:0;right:0;bottom:0;content:attr(data-content-placeholder);color:#c7c7c7;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-tools] .block-placeholder-container{position:absolute;left:0;top:0;right:0}div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-title-placeholder]:before{position:absolute;left:0;top:0;right:0;bottom:0;content:attr(data-title-placeholder-readonly);color:#c7c7c7}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer{position:absolute;background-color:transparent;border:1px solid #338FE5;pointer-events:none;z-index:1;display:none}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer.active{display:block}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper{position:absolute;width:16px;height:16px;border:2px solid white;background-color:#338fe5;border-radius:50%;pointer-events:all}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom{left:calc(50% - 8px);bottom:-8px;cursor:ns-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-left{left:-8px;top:-8px;cursor:nwse-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-right{right:-8px;top:-8px;cursor:nesw-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-left{left:-8px;bottom:-8px;cursor:nesw-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-right{right:-8px;bottom:-8px;cursor:nwse-resize}div.editor-root.readonly div.editor-content div[data-type=editor-block]>[data-type=block-tools] .block-resizer{display:none}.before-content,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content] .images .image-container.active:before,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected:not(.focused) [data-type=block-content] .images .image-container:before{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#338fe5;opacity:.1}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image]{display:flex}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].block-hidden{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image][data-style-align=left]{justify-content:flex-start}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image][data-style-align=center]{justify-content:center}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image][data-style-align=right]{justify-content:flex-end}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].hover [data-type=block-content]{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].hover [data-type=block-content] .images .image-container.empty:hover,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].hover [data-type=block-content] .images .image-container.error:hover{outline:1px solid #338FE5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content]:before{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content]{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content] .images .image-container.active .image-warning{opacity:0;z-index:-1}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].multi [data-type=block-tools] .block-resizer{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image]:not(.multi) [data-type=block-content] .images.empty{min-height:400px}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content]{cursor:default}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images{width:100%;display:flex;align-items:flex-start}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter{width:10px;flex-grow:0;flex-shrink:0;padding:0 4px;cursor:col-resize;height:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter .image-splitter-indicator{width:100%;height:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter:active .image-splitter-indicator,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter:hover .image-splitter-indicator{background-color:#d9d9d9}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container{position:relative;flex:1;background-color:#f8f8f8;display:flex;min-height:inherit;overflow:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container img{max-width:100%;width:100%;height:auto}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.empty .upload-image-icon{display:flex;color:#c7c7c7}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.error{height:100%;outline:1px solid #DEDEDE;border-radius:3px}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.error img{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;z-index:1}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-icon,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-icon{display:flex;color:#c7c7c7}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message{display:flex;flex-direction:column;align-items:center;overflow:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-1,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-1{margin-top:10px;font-size:18px;font-weight:500;color:#303030;height:26px;vertical-align:middle;line-height:26px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-2,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-3,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-2,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-3{font-size:14px;color:#606060;vertical-align:middle;height:22px;line-height:22px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-2 a,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-3 a,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-2 a,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-3 a{text-decoration:none;color:#338fe5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .line-3 a{display:inline-flex;align-items:center;text-decoration:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .line-3 a:after{content:" ";display:inline-block;width:16px;height:16px;margin-left:5px;background-image:url("data:image/svg+xml,%3Csvg width='17' height='16' viewBox='0 0 17 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 2H3.5C2.94772 2 2.5 2.44772 2.5 3V13C2.5 13.5523 2.94772 14 3.5 14H13.5C14.0523 14 14.5 13.5523 14.5 13V10' stroke='%23338FE5'/%3E%3Cpath d='M14.5 2L9 7.5' stroke='%23338FE5'/%3E%3Cpath d='M8.5 2H14.5V8' stroke='%23338FE5'/%3E%3C/svg%3E%0A")}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .uploading-progress-mask{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#303030;opacity:.8;display:flex;align-items:center;justify-content:center}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .uploading-progress-mask .uploading-progress-bar{width:75%;height:6px;border-radius:3px;display:flex;background-color:#fff}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .uploading-progress-mask .uploading-progress-bar .uploading-progress-bar-value{background-color:#338fe5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .image-warning{position:absolute;right:5px;top:5px;color:#fff;background-color:#333;width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:3px;z-index:2;transition:opacity linear .2s;opacity:.7}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.empty{display:flex;flex-direction:column;align-items:center;outline:1px solid #DEDEDE;border-radius:3px;justify-content:center;height:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.empty svg{width:48px;height:48px}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-tools] .drag-container{display:flex;box-sizing:content-box;pointer-events:none;position:fixed;z-index:100;background-color:#fff;border:1px solid #338FE5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-tools] .drag-container .drag-target{width:100%}.editor-root[readonly=true] .image-splitter{visibility:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment{box-shadow:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment [data-type=block-content]{box-shadow:0 2px #f8e6ab}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment.active{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment.active [data-type=block-content]{box-shadow:none;outline:4px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block].dragging div[data-type=block-tools] .block-helper{opacity:0}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper{position:absolute;right:100%;top:0;padding-right:5px;display:flex;align-items:center}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .helper-sizer{width:0;opacity:0;pointer-events:none}div[data-type=editor-block].block-exclusive:after{content:attr(data-exclusive-tips);position:absolute;top:0px;left:0px;width:100%;background:#f8f8f8;border-radius:var(--editor-border-radius);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:22px;color:#909090;text-align:center;padding:9px 0;z-index:1000}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self>[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others>[data-type=block-content]{position:relative}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others>[data-type=block-content]:after{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;z-index:1;background-color:#303030;opacity:.1}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self.text-block>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self.locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others.text-block>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others.locked-by-self>[data-type=block-content]:after{pointer-events:none}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self.text-block>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others.text-block>[data-type=block-content]:after{outline:2px solid #303030}.editor-root{--selected-color: #e8e8e8}.editor-root .editor-content.dragging *{cursor:grabbing!important}.editor-root .editor-content.dragging div[data-type=editor-block] iframe{pointer-events:none}.editor-root .editor-content .editor-drop-indicator{position:absolute;background-color:var(--primary-color);pointer-events:none;transition:top .2s linear,left .2s linear,width .2s linear}.editor-root .editor-content div[data-type=editor-block].text-block.highlighted{outline:2px solid var(--background-selection);background-color:var(--background-selection)}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button{width:24px;height:24px;cursor:pointer;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;border-radius:3px}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button[data-type=move]{cursor:grab}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button:hover{background-color:var(--selected-color)}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button svg{width:16px;height:16px;color:#909090}.drag-image-container{position:fixed;z-index:100;box-shadow:0 3px 20px #00000026;background-color:#fff;opacity:.4}.drag-image-container.drag-placeholder{width:500px;height:200px;border:1px solid #dedede;border-radius:3px;background:#e8e8e8}.drag-image-container .drag-image{width:100%;display:none}.drag-image-container[data-status=loaded] .drag-image{display:block}.drag-image-container[data-status=loaded] .drag-loading{display:none}.editor-command-bar-root .editor-command-bar .command-item.menu-item{display:flex;align-items:center;flex:none}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles{padding:5px 10px;background-color:#fff}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section+.text-style-section{margin-top:5px}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section{display:grid;grid-template-columns:repeat(7,24px);grid-row-gap:10px;grid-column-gap:5px}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section .style-icon{height:24px;padding:0;margin:0;display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;outline:none;cursor:pointer;border-radius:3px;color:#606060}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section .style-icon:hover{background-color:var(--selected-color)}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section .style-icon.active{color:#338fe5}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-anchor[data-id=paste-special-button-anchor]{z-index:unset}[data-command-bar-id=paste-special-button] .editor-command-bar.toolbar{padding:0}[data-command-bar-id=paste-special-button] .editor-command-bar.toolbar .command-item[data-dropdown=true]{padding-left:5px;padding-right:5px}.editor-find-dialog{--popover-input-border: 1px solid #CFD6E1;--editor-find-dialog-input-container-border-color: #CFD6E1;--editor-find-dialog-input-container-bg-color: transparent;--editor-border-radius-big: 3px;--editor-color: #07142A;--button-black-text-color: #333;--editor-find-dialog-button-color: #333;--editor-find-dialog-icon-button-color: #333;--editor-find-dialog-button-border-bg-color: rgba(255, 255, 255, .56);--editor-find-dialog-input-placeholder-color: #b9bfc8;--editor-find-dialog-button-disabled-color: #ccc !important;--editor-find-dialog-button-hover-color: rgba(150, 150, 150, .2);--editor-find-dialog-button-border: solid 1px #ccc;box-sizing:border-box;width:400px;background-color:var(--editor-find-dialog-bg-color);border:var(--editor-find-dialog-border);border-radius:var(--editor-border-radius-big);display:flex;padding:8px 8px 0 16px;align-items:flex-start;font-size:14px;font-family:var(--editor-font-family)}.editor-find-dialog .editor-find-content{display:flex;flex-direction:column;flex-grow:1;font-family:inherit}.editor-find-dialog .editor-find-dialog-row{display:flex;margin-bottom:8px;align-items:center}.editor-find-dialog .editor-find-dialog-label{width:80px;flex-grow:0;flex-shrink:0;align-self:center}.editor-find-dialog .editor-find-dialog-input-container{border:var(--popover-input-border);border-color:var(--editor-find-dialog-input-container-border-color);background-color:var(--editor-find-dialog-input-container-bg-color);border-radius:var(--editor-border-radius-big);flex-grow:1;display:flex;padding:2px;align-items:center;height:32px;box-sizing:border-box}.editor-find-dialog .editor-find-dialog-input{border:none;flex-grow:1;width:80px;outline:none;background-color:transparent;color:var(--editor-color)}.editor-find-dialog .editor-find-dialog-input::placeholder{color:var(--editor-find-dialog-input-placeholder-color);opacity:1}.editor-find-dialog .editor-find-dialog-prev{width:24px}.editor-find-dialog .editor-find-dialog-curr{flex-grow:0;text-align:center;flex-shrink:1;display:flex;align-items:center;margin-bottom:2px}.editor-find-dialog .editor-find-dialog-next{width:24px}.editor-find-dialog .editor-find-dialog-icon-button{cursor:pointer;border-radius:4px;color:var(--editor-find-dialog-icon-button-color);background-color:var(--editor-find-dialog-button-border-bg-color);border:none;display:flex;padding:0}.editor-find-dialog .editor-find-dialog-button{padding:6px 16px;cursor:pointer;border-radius:4px;color:var(--editor-find-dialog-button-color);background-color:var(--editor-find-dialog-button-border-bg-color);margin:0 4px;border:none;font-family:inherit;line-height:21px}.editor-find-dialog .editor-find-dialog-button.icon-button{width:32px;height:32px}.editor-find-dialog .editor-find-dialog-button.active,.editor-find-dialog .editor-find-dialog-button:hover{background-color:var(--editor-find-dialog-button-hover-color)}.editor-find-dialog .editor-find-dialog-button:disabled{color:var(--editor-find-dialog-button-disabled-color);cursor:default}.editor-find-dialog .editor-find-dialog-button:disabled:hover{background-color:transparent}.editor-find-dialog .editor-find-dialog-button svg{fill:currentColor}.editor-find-dialog .editor-find-dialog-space{flex-grow:1}.editor-find-dialog .editor-find-dialog-icon-button-border{margin:0 0 0 8px;cursor:pointer;border-radius:4px;color:var(--button-black-text-color);border:var(--editor-find-dialog-button-border);background-color:var(--editor-find-dialog-button-border-bg-color);padding:0;width:32px;display:flex;justify-content:center;align-items:center}.editor-find-dialog .editor-find-dialog-button-close{margin:0 0 0 8px;cursor:pointer;border-radius:4px;color:var(--button-black-text-color);background-color:var(--editor-find-dialog-button-border-bg-color);border:none;padding:0;width:32px;height:32px;display:flex;justify-content:center;align-items:center}.editor-find-dialog .editor-find-dialog-icon-button-border svg,.editor-find-dialog .editor-find-dialog-button-close svg{fill:currentColor}.editor-find-dialog .editor-highlight{opacity:.6;pointer-events:none}.editor-find-dialog .editor-highlight .editor-highlight-child{position:absolute;background-color:bisque}.editor-find-dialog .editor-highlight.active .editor-highlight-child{position:absolute;background-color:tomato}.editor-find-dialog .editor-search-result-highlight{opacity:.6;pointer-events:none}.editor-find-dialog .editor-search-result-highlight .editor-highlight-child{position:absolute;background-color:#40e0d0}.editor-find-dialog .editor-find-dialog-status{display:flex}.editor-highlight{opacity:.6;pointer-events:none}.editor-highlight .editor-highlight-child{position:absolute;background-color:bisque}.editor-highlight.active .editor-highlight-child{position:absolute;background-color:tomato}.editor-search-result-highlight{opacity:.6;pointer-events:none}.editor-search-result-highlight .editor-highlight-child{position:absolute;background-color:#40e0d0}.editor-find-dialog-status{display:flex}.comment-editor{font-size:14px;border:1px solid #c7c7c7;border-radius:3px;padding:1px 10px;margin:6px 10px 0}.comment-editor:after{content:"";height:0;display:block;clear:both}.comment-editor-root{display:inline-block;min-width:calc(100% - 40px);padding-top:2px}.comment-editor-root div.editor-root div.editor-content{padding:0}.comment-editor-root div.editor-root div.editor-content>div[data-type=editor-container].root>div.container-blocks>*+*{margin-top:0}.comment-editor-img{float:right;color:#c1c1c1;padding:0;margin-top:2px;width:24px;height:24px;justify-content:center}.comment-editor-root:not(.comment-editor-readonly) .editor-root .editor-content [data-type=editor-block]:not([data-block-type=text]){width:248px}.comment-editor-editing{border:1px solid #338fe5}.comment-editor-readonly{border:none;padding-left:37px;margin:0}.comment-editor-readonly .comment-editor-img{display:none}.comment-item-root{position:relative;margin-top:10px}.comment-item-root:not(.last-comment-item):before{content:" ";display:block;position:absolute;left:20px;width:1px;background-color:var(--editor-border-color, #e8e8e8);overflow:hidden;opacity:.8;top:21px;bottom:-12px;transform:scaleX(.5)}.comment-item-root .item-head{padding:0 10px;position:relative;display:flex;align-items:center}.comment-item-root .item-head-avatar{margin-right:5px;width:var(--editor-comment-avatar-width, 21px);height:var(--editor-comment-avatar-width, 21px);border-radius:100%}.comment-item-root .item-head-avatar-string{display:flex;align-items:center;justify-content:center;font-size:12px;color:#fff;background-color:var(--comment-avatar-color);flex-shrink:0}.comment-item-root .item-head-username{font-size:var(--editor-comment-username-font-size, 12px);color:var(--editor-comment-username-color, #07142a);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-item-root .item-head-modified{margin-left:8px;font-size:12px;color:var(--editor-comment-modified-color, #808080);flex-grow:1;white-space:nowrap}.comment-item-root .item-head-tools{display:flex;align-items:center;visibility:hidden}.comment-item-root .item-head-tools .editor-text-button svg{width:20px;height:20px}.comment-item-root .item-head-tools.active{visibility:visible}.comment-item-root .item-actions{margin-top:10px;display:flex;justify-content:flex-end;padding:0 10px}.comment-item-root .item-actions.hidden{display:none}.comment-item-root:hover:not(.comment-item-editing) .item-head-tools{visibility:visible}.comment-item-root.readonly .item-head-tools{display:none}.mobile-comment-item{margin-top:4px;background-color:var(--editor-comment-layer-bg-color);padding-bottom:20px;color:var(--editor-comment-username-color)}.mobile-comment-item .item-head{padding:12px;display:flex;align-items:center}.mobile-comment-item .item-head-avatar{width:var(--editor-comment-avatar-size);height:var(--editor-comment-avatar-size);flex-grow:0}.mobile-comment-item .item-head-username{margin-left:12px}.mobile-comment-item .item-head-modified{margin-left:12px;color:#999}.mobile-comment-item .item-editor .comment-editor-readonly{padding-left:18px}.mini-comment-item{position:relative;line-height:16px;width:20px;height:16px;text-align:center;font-size:12px;border-radius:1px;background-color:var(--editor-comment-active-color, #FFC328);color:var(--editor-comment-mini-text-color, #ffffff);cursor:pointer}.mini-comment-item:after{content:"";position:absolute;left:50%;bottom:-4px;width:6px;height:6px;background-color:var(--editor-comment-active-color, #FFC328);border-radius:1px;transform:matrix(.71,.61,.82,-.71,0,0) translate(-50%);z-index:-1}.comment-quick-reply .quick-reply-button{position:absolute;left:8px;bottom:3px;z-index:2;color:var(--editor-comment-quick-reply-color, #7084A4);font-size:12px}.comment-quick-reply .quick-reply-button.editor-text-button:hover{color:var(--text-button-color-hover, #5587F0);background-color:var(--text-button-bg-color-hover, transparent)}.comment-quick-reply .quick-reply-editor{display:none}.comment-quick-reply .quick-reply-editor .reply-editor-actions{display:flex;justify-content:flex-end;margin-top:10px;padding:0 10px}.comment-quick-reply.hidden,.comment-quick-reply.reply-editor-editing .quick-reply-button{display:none}.comment-quick-reply.reply-editor-editing .quick-reply-editor{display:block}:root{--editor-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Robot, "Helvetica Neue", Helvetica, Arial, sans-serif;--editor-comment-layer-bg-color:#ffffff;--editor-comment-group-bg-color: #ffffff;--comment-root-border-color: #eaeaea;--editor-comment-layer-active-border-color: #cecece;--editor-box-shadow: 0px 3px 20px rgba(0, 0, 0, .15);--wiz-editor-z-comment-group-active-top-before: 29;--editor-comment-quote-color: #909090;--editor-comment-quote-before-bg-color: #909090;--editor-comment-switch-button-width: 12px;--editor-comment-active-color: #FFC328;--editor-bg-color: #ffffff;--wiz-editor-z-comment-head:11;--text-button-color-hover:#5587f0;--editor-comment-username-color:#07142A;--editor-comment-avatar-size: 32px}.disabled-scroll{overflow:hidden}.editor-root .editor-content div[data-type=editor-block].text-block.comment{box-shadow:none}.editor-root .editor-content div[data-type=editor-block].text-block.comment>div[data-type=block-content]>span{border-bottom:2px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block].text-block.comment.active{box-shadow:none;outline:none}.editor-root .editor-content div[data-type=editor-block].text-block.comment.active>div[data-type=block-content] span{background-color:#f8e6ab}.editor-root .editor-content div[data-type=editor-block] span.text.comment{border-bottom:2px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block] span.text.comment.active{background-color:#faf1d1}.editor-root .editor-content div[data-type=editor-block].comment{box-shadow:0 2px #f8e6ab}.editor-root .editor-content div[data-type=editor-block].comment.active{box-shadow:none;outline:4px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-comment-button{all:unset;position:absolute;right:-28px;top:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;padding:0;border-radius:3px;color:#07142a;cursor:pointer}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-comment-button:hover{background:#eaeaea}.editor-web-comment-root{position:absolute;right:0;width:300px;top:0;bottom:0;transition:width .16s ease-in;will-change:width;font-family:var(--editor-font-family)}.editor-web-comment-root .comment-groups-container .comment-group-item-root{position:absolute;left:50%;right:0;width:290px;transform:translate(-50%);background-color:var(--editor-comment-group-bg-color);border-radius:2px;border-color:var(--editor-comment-layer-active-border-color);box-shadow:var(--editor-box-shadow);padding-bottom:18px}.editor-web-comment-root .comment-groups-container .comment-group-item-root:not(.no-animation){transition:top .2s ease-in,opacity .35s ease-in}.editor-web-comment-root .comment-groups-container .comment-group-item-root:before{content:"";position:absolute;left:0;right:0;height:6px;background-color:#fff;border-radius:2px 2px 0 0;z-index:var(--wiz-editor-z-comment-group-active-top-before)}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head{display:flex;align-items:center}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-quote{box-sizing:content-box;font-size:12px;line-height:12px;height:12px;color:var(--editor-comment-quote-color);padding:18px 12px 10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%;max-width:calc(100% - 80px)}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-quote:before{content:"";display:block;width:2px;height:100%;background-color:var(--editor-comment-quote-before-bg-color);margin-right:6px;float:left;border-radius:10px}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch{display:flex;align-items:center;height:22px;padding-top:6px;visibility:hidden}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button{padding:0;width:var(--editor-comment-switch-button-width);margin:3px 0;color:#606060}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=switch-up]{margin-right:16px}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button:not(.disabled):hover{color:var(--text-button-color-hover)}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button.disabled{color:#60606080;cursor:not-allowed}.editor-web-comment-root .comment-groups-container .comment-group-item-root.active:before{background-color:var(--editor-comment-active-color)}.editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch{visibility:visible}.editor-web-comment-root .comment-groups-container .comment-group-item-root.readonly .comment-quick-reply{display:none}.editor-mobile-comments-root{position:fixed;left:0;right:0;bottom:0;top:0;overflow:hidden;z-index:11}.editor-mobile-comments-root .mobile-comment-mask{position:absolute;left:0;right:0;bottom:0;top:0;background-color:#00000073}.editor-mobile-comments-root .mobile-comment-groups-container{position:absolute;width:100%;height:100vh;z-index:1;overflow:hidden}.editor-mobile-comments-root .mobile-comment-groups-container .mobile-comment-groups-scroll-container{padding:0 12px}.editor-mobile-comments-root .mobile-comment-pull-info-container{position:absolute;right:0;left:0;bottom:100px;z-index:2;text-align:center;display:none}.editor-mobile-comments-root .mobile-comment-pull-info-container .mobile-comment-pull-info{display:inline-block;padding:12px;border-radius:36px;margin:0 auto;background-color:#000c;color:#fff;font-size:12px;opacity:0;transition:opacity .25s cubic-bezier(.65,.05,.36,1)}.editor-mobile-comments-root .mobile-comment-pull-info-container.active{display:block}.editor-mobile-comments-root .mobile-comment-pull-info-container.active .mobile-comment-pull-info{opacity:1}.editor-mobile-comments-root .mobile-group-item-root{margin:0 auto;width:100%;height:100vh;overflow:hidden}.editor-mobile-comments-root .mobile-group-item-root .mobile-group-item{min-height:calc(100vh + 1px);padding-bottom:50px}.editor-mobile-comments-root .mobile-group-item-root .mobile-group-item-space{height:50vh}.editor-mobile-comments-root .mobile-group-item-root .mobile-group-item-abstract{background-color:var(--editor-comment-layer-bg-color);padding:12px;color:#999;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editor-mini-comment-root{position:absolute;right:0;top:0;bottom:0;width:48px;border-left:1px solid #f0f0f0;transition:width .16s ease-in;will-change:width;font-family:var(--editor-font-family);border:none;background-color:transparent;z-index:11}.editor-mini-comment-root .comment-groups-container{width:100%;height:100%}.editor-mini-comment-root .comment-groups-container .mini-group-item{position:absolute;top:0;left:50%;margin-left:-10px;transition:top .2s cubic-bezier(.65,.05,.36,1)}:is(.editor-web-comment-root,.editor-mobile-comments-root,.editor-mini-comment-root).hidden{display:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=file] span[data-type=box-content]{margin:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=file] span[data-type=box-content] span.file-icon{display:inline-flex;vertical-align:text-bottom}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=file] span[data-type=box-content] .file-name{color:var(--primary-color);padding:0;border-radius:12px;margin-right:4px;white-space:wrap;word-break:break-all;cursor:pointer}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office]{justify-content:start}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office].hover [data-type=block-content]{border-radius:3px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content]{max-width:360px;min-width:360px;height:48px;cursor:pointer}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root{display:flex;align-items:center;min-width:360px;max-width:100%;background-color:#f5f6f7;border-radius:3px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root:before{border-radius:3px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details{display:flex;flex-direction:column;justify-content:center;font-size:14px;flex-grow:1}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name{color:#1f2329;max-width:185px;display:flex;flex-direction:row;align-items:center;white-space:nowrap}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-size{color:#646a73;font-size:12px;margin-top:2px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name-pre{text-overflow:ellipsis;overflow:hidden}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button{width:34px;height:34px;background-color:#fff;border:1px solid #dee0e3;border-radius:50%;margin:0 8px;padding:0;background-repeat:no-repeat;background-position:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button svg{width:16px;height:16px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-icon{display:flex;width:36px;height:36px;margin:6px 6px 6px 12px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-icon>svg{width:100%;height:100%}:root{--editor-version-button-border: black;--editor-bg-color: #ffffff;--editor-version-list-bg-color: white;--editor-version-select-bg-color: #F5F9FD}.version-dialog{display:flex;background-color:var(--editor-bg-color);width:100%;height:100%;color:var(--editor-color)}.version-dialog *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;box-sizing:border-box}.version-dialog.loading .version-viewer .version-info-container{display:none}.version-dialog .version-loading{display:flex;flex:1;align-items:center;justify-content:center}.version-dialog .version-loading svg{width:28px;height:28px}.version-dialog .version-item-latest{color:#338fe5;background-color:#eaf3fc;height:20px;padding:0 5px;border-radius:3px;display:inline-flex;align-items:center;font-size:12px;font-weight:400;margin-left:10px}.version-dialog .version-viewer{flex:1;display:flex;flex-direction:column;width:0;padding:0}.version-dialog .version-viewer .version-dialog-editor{display:flex;flex-grow:1;overflow-y:auto}.version-dialog .version-viewer .version-info-container{height:50px;border-bottom:#E8E8E8 1px solid;display:flex;align-items:center;flex-shrink:0;padding-left:20px;font-size:14px;color:#303030}.version-dialog .version-viewer .version-info-container .version-info-right .text-3{color:#909090}.version-dialog .version-viewer .version-info-container .version-info-left{display:flex;align-items:center}.version-dialog .version-viewer .version-info-container .version-info-left .text-1,.version-dialog .version-viewer .version-info-container .version-info-left .text-2{color:#909090}.version-dialog .version-viewer .version-info-container .version-info-left .name{padding-left:5px;padding-right:10px;font-weight:500}.version-dialog .version-viewer .version-info-container .version-info-left .name .version-item-latest{margin-left:5px}.version-dialog .version-viewer .version-info-container .editor-dropdown{margin-left:10px;margin-right:10px}.version-dialog .version-viewer .version-info-container .command-item[data-id=current-version]{min-width:200px;border:1px solid #f0f0f0}.version-dialog .version-viewer .version-info-container .command-item[data-id=current-version] .toolbar-item-name-container{flex-grow:1}.version-dialog .version-viewer .dialog-button-text{margin-top:1px;margin-left:-4px}.version-dialog .version-viewer .dialog-text-button{outline:none;background:transparent;border:none;display:flex;align-items:center;color:var(--editor-color);font-size:16px;font-weight:500;padding:4px 0;cursor:pointer}.version-dialog .version-viewer .dialog-text-button .dialog-button-icon{margin-right:0;width:24px;height:24px}.version-dialog .version-viewer .dialog-text-button .dialog-button-icon svg{fill:currentColor}.editor-root.history .root-container .editor-block .text-element .inline-plugin.editor-box-loading{display:none}.editor-root.history .editor-content{padding:30px 75px}.editor-root.history .history-inserted-block[data-type=editor-block] [data-type=block-content]{border:4px solid var(--op-selected-color)}.editor-root.history .history-inserted-block[data-type=editor-block]{position:relative}.editor-root.history .history-inserted-block[data-type=editor-block]:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-inserted-block[data-type=editor-block].table-block table{border:4px solid var(--op-selected-color)}.editor-root.history .history-inserted-block[data-type=editor-block].table-block table .child{pointer-events:none}.editor-root.history .history-inserted-block[data-type=editor-block].table-block{position:relative}.editor-root.history .history-inserted-block[data-type=editor-block].table-block:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-inserted-block[data-type=editor-block].table-block:hover:after{top:0}.editor-root.history .history-deleted-block [data-type=block-content]{border:4px solid var(--op-selected-color)}.editor-root.history .history-deleted-block [data-type=block-content]{position:relative}.editor-root.history .history-deleted-block [data-type=block-content]:after,.editor-root.history .history-deleted-block [data-type=block-content]:before{content:" ";position:absolute;display:flex;z-index:var(--wiz-editor-z-history-delete-marker);color:var(--op-color);justify-items:center;align-items:center;justify-content:center;align-content:center;pointer-events:none;overflow:visible;max-width:100%;max-height:100%;left:calc(50% - 16px);top:calc(50% - 2px);width:32px;height:4px;background-color:var(--op-color);transform:rotate(45deg);opacity:1}.editor-root.history .history-deleted-block [data-type=block-content]:before{transform:rotate(135deg)}.editor-root.history .history-deleted-block{position:relative}.editor-root.history .history-deleted-block:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-deleted-block .history-deleted-box{background-color:unset!important;text-decoration:unset!important}.editor-root.history .history-deleted-block .history-deleted-box:hover:after{opacity:0}.editor-root.history .history-inserted-text{line-height:revert!important;background-color:var(--op-selected-color)}.editor-root.history .history-inserted-text{position:relative}.editor-root.history .history-inserted-text:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-deleted-box{background-color:var(--op-selected-color);text-decoration:line-through}.editor-root.history .history-deleted-box{position:relative}.editor-root.history .history-deleted-box:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history [data-box-type=history-deleted-box]>span[data-type=box-content]{border:none!important;margin:0!important}.editor-root.history [data-type=editor-block].table-block div[data-type=block-content]{overflow-x:revert}.editor-dialog-root{position:absolute;left:0;top:0;bottom:0;right:0;background-color:#639;z-index:100}.size-limit-textarea{display:inline-block;position:relative}.size-limit-textarea .size-limit-textarea-input{width:100%;resize:none;overflow:hidden;color:#303030;outline:none;border:1px solid #f0f0f0;border-radius:3px}.size-limit-textarea .size-limit-textarea-input:focus,.size-limit-textarea .size-limit-textarea-input:hover{border-color:#338fe5}.size-limit-textarea .size-limit-textarea-input:focus{box-shadow:0 0 0 2px #338fe533}.size-limit-textarea .size-limit-textarea-warning{position:absolute;right:0;bottom:10px;color:#909090;z-index:1;font-size:12px;pointer-events:none}.version-list-root{width:350px;background:var(--editor-version-list-bg-color);overflow-y:auto;padding:0;border-left:#E8E8E8 1px solid;display:flex;flex-direction:column}.version-list-root .version-list-header{padding:0 6px 0 20px;font-size:14px;display:flex;align-items:center;margin-top:8px;margin-bottom:8px;flex-shrink:0;color:#909090}.version-list-root .version-list-header .version-count{flex-grow:1}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item{cursor:pointer}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item:not(.disabled):hover{color:#338fe5}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item.selected:not(.disabled){background-color:transparent}.version-list-root .version-list-empty{height:100%;display:flex;align-items:center;justify-content:center;font-size:14px;color:#909090}.version-list-root .version-list-content{flex-grow:1;overflow-y:auto}.version-list-root .version-list-content .version-item{padding:15px 10px;cursor:pointer}.version-list-root .version-list-content .version-item:not(:last-child):after{content:"";display:block;position:relative;top:15px;border-bottom:1px solid #E8E8E8}.version-list-root .version-list-content .version-item:not(:last-child):hover:after,.version-list-root .version-list-content .version-item:not(:last-child).active:after{left:-10px;width:106%}.version-list-root .version-list-content .version-item.child{padding-left:32px}.version-list-root .version-list-content .version-item:not(.active):hover{background:#F8F8F8}.version-list-root .version-list-content .version-item.active{background-color:var(--editor-version-select-bg-color)}.version-list-root .version-list-content .version-item.active .version-item-title .version-actions{display:flex}.version-list-root .version-list-content .version-item.active .version-item-title .version-item-date{color:#338fe5}.version-list-root .version-list-content .version-item.editing .version-item-memo{display:none}.version-list-root .version-list-content .version-item.active .version-item-memo{cursor:text}.version-list-root .version-list-content .version-item.active .version-item-memo:hover{outline:1px solid #338FE5}.version-list-root .version-list-content .version-item .version-item-restore-from{color:#909090;font-size:12px;line-height:1.5em;height:20px;padding:0 10px 10px}.version-list-root .version-list-content .version-item .version-item-restore-from:empty{display:none}.version-list-root .version-list-content .version-item .memo-input.size-limit-textarea{width:100%;min-height:60px;display:flex}.version-list-root .version-list-content .version-item .memo-input.size-limit-textarea textarea{padding:4px 10px;box-sizing:border-box;font-size:14px}.version-list-root .version-list-content .version-item .version-item-title{display:flex;align-items:center;padding-left:10px;padding-right:10px;height:24px}.version-list-root .version-list-content .version-item .version-item-title .version-item-date{font-size:14px;font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#303030}.version-list-root .version-list-content .version-item .version-item-title .spacer{flex-grow:1}.version-list-root .version-list-content .version-item .version-item-title .version-actions{display:none}.version-list-root .version-list-content .version-item .version-item-title .version-actions button{display:flex;align-items:center;justify-content:center;height:16px;cursor:pointer;border:none;outline:none;background:transparent;padding:0 0 0 10px;color:#909090}.version-list-root .version-list-content .version-item .version-item-title .version-actions button:hover{color:#338fe5}.version-list-root .version-list-content .version-item .version-item-title .version-actions button.disabled,.version-list-root .version-list-content .version-item .version-item-title .version-actions button.disabled:hover{color:#c7c7c7}.version-list-root .version-list-content .version-item .version-item-title .version-actions .revert-button{border-left:1px solid #E8E8E8;margin-left:10px}.version-list-root .version-list-content .version-item .version-item-authors{list-style:none;margin:0;font-size:12px;padding-left:10px}.version-list-root .version-list-content .version-item .version-item-author{display:flex;align-items:center;margin-top:10px;color:#606060}.version-list-root .version-list-content .version-item .version-item-author-mark{width:6px;height:6px;border-radius:3px;margin-right:5px}.version-list-root .version-list-content .version-item .version-item-memo{font-size:14px;color:#303030;padding:5px 10px;border-radius:3px}.version-list-root .version-list-content .version-item .version-item-memo:empty{display:none}.versions-dropdown-header{color:var(--text-color);padding:10px;border-bottom:1px solid #f0f0f0}.versions-dropdown-header .versions-dropdown-header-info{color:#909090}.versions-dropdown-header .versions-dropdown-header-icon{display:inline-flex;vertical-align:middle;height:19px;padding-left:5px;padding-right:5px;cursor:pointer;color:#909090}.versions-dropdown-header .versions-dropdown-header-icon svg{vertical-align:baseline}.editor-command-bar.menu .command-item.standard[data-id=prev-version]{height:44px}[data-command-bar-id=versions-dropdown-popup]{width:320px}[data-command-bar-id=versions-dropdown-popup] .tippy-box{color:var(--text-color)}[data-command-bar-id=versions-dropdown-popup] .tippy-box .version-item-empty{width:100%}[data-command-bar-id=versions-dropdown-popup] .tippy-box .version-item-name{color:var(--text-color)}[data-command-bar-id=versions-dropdown-popup] .tippy-box .editor-command-bar.menu .command-item.standard.disabled{color:#909090}[data-command-bar-id=versions-dropdown-popup] .tippy-box .editor-command-bar{--text-color: #303030}[data-command-bar-id=versions-dropdown-popup] .tippy-box .editor-command-bar.menu .command-item.section{padding:0;font-size:inherit;color:inherit}[data-command-bar-id=versions-dropdown-popup] *{box-sizing:border-box}[data-command-bar-id=versions-dropdown-popup] .editor-command-bar-header{width:100%;margin-bottom:5px}[data-command-bar-id=versions-dropdown-popup] .command-item{width:100%;cursor:pointer}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container{padding:6px 10px;width:100%}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container .version-item-memo{font-size:12px;color:#909090;line-height:20px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container .version-item-line1{line-height:22px;display:flex;align-items:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container .version-item-line1 .version-item-latest{color:#338fe5;background-color:#eaf3fc;height:20px;padding:0 5px;margin-left:10px;border-radius:3px;font-size:12px;display:inline-flex;align-items:center}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-empty{display:flex;height:34px;color:#909090;padding-left:10px;justify-content:left;align-items:center}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item{width:100%}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-info{height:24px;color:#909090;display:flex;align-items:center;padding-left:10px;background-color:#f8f8f8;width:100%;box-sizing:border-box;margin:5px 0}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container{height:34px;display:flex;align-items:center;padding-left:10px;color:#303030}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container .editor-checkbox-wrapper{margin-right:4px}.editor-root.readonly .editor-content div[data-type=editor-block].focused div[data-type=block-tools] .block-helper .heading-marker,.editor-root.readonly .editor-content div[data-type=editor-block].highlighted div[data-type=block-tools] .block-helper .heading-marker{display:flex}.editor-root .editor-content div[data-type=editor-block].heading-collapsed div[data-type=block-tools] .block-helper .heading-collapse-button svg{transform:rotate(270deg)}.editor-root .editor-content div[data-type=editor-block].focused div[data-type=block-tools] .block-helper .heading-marker,.editor-root .editor-content div[data-type=editor-block].highlighted div[data-type=block-tools] .block-helper .heading-marker{display:none}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button{width:24px;height:24px;cursor:grab;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;border-radius:3px;box-sizing:content-box}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker:hover,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button:hover{background-color:var(--selected-color)}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker svg,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button svg{transform:rotate(360deg);transition:transform .2s linear}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker svg,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button svg{width:16px;height:16px}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker{color:#c7c7c7}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker:hover{background-color:transparent}.embed-block div[data-type=block-content] .editor-toc-container{display:block;width:100%;background-color:#f0f0f0;padding:20px;text-align:start}.embed-block div[data-type=block-content] .editor-toc-container.loading{margin:0;min-height:100px}.embed-block div[data-type=block-content] .editor-toc-container .toc-node+.toc-node{margin-top:10px}.embed-block div[data-type=block-content] .editor-toc-container .toc-node .toc-text{cursor:pointer;color:var(--primary-color)}.embed-block div[data-type=block-content] .editor-toc-container .toc-node .toc-children{margin-top:10px;padding-left:20px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=mention] span[data-type=box-content]{margin:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=mention] span[data-type=box-content] .mention-name{color:var(--primary-color);padding:0;border-radius:12px;margin-left:4px;margin-right:4px;white-space:wrap;word-break:break-all;cursor:pointer}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-icon{width:20px;height:20px;border-radius:50%;overflow:hidden}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-icon img{width:100%;height:100%}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-icon .mention-user-avatar-string{align-items:center;display:flex;justify-content:center;overflow:hidden;height:100%;width:100%;font-size:12px;color:#fff;flex-shrink:0}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-name{flex-grow:0;margin-right:5px}.editor-root .editor-templates{position:fixed;bottom:26px;height:256px;width:auto;max-width:100%;padding-left:30px;padding-right:44px;overflow:hidden}.editor-root .editor-templates .editor-templates-title{color:#909090;font-size:14px;margin-left:0;margin-bottom:20px;line-height:19.6px}.editor-root .editor-templates .editor-templates-cards{display:flex;margin-left:0}.editor-root .editor-templates .editor-templates-cards .editor-template-card{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;cursor:pointer;flex-shrink:0;height:192px;width:188px;background:none;border:1px solid #e8e8e8;border-radius:3px;margin:0 0 0 15px;padding:0;align-items:revert}.editor-root .editor-templates .editor-templates-cards .editor-template-card:first-child{margin-left:0}.editor-root .editor-templates .editor-templates-cards .editor-template-card:hover{box-shadow:0 0 1px #30303033,0 8px 16px #30303026}.editor-root .editor-templates .editor-templates-cards .editor-template-card:hover>.editor-template-name{color:#338fe5}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-name{display:flex;align-items:center;height:40px;width:100%;border-top:1px solid #dedede;padding-left:20px;padding-right:20px;flex:0 0 50px;font-size:14px;font-weight:500;line-height:22px;color:#303030}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-name span{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-name{border-top:none}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-name span{padding-left:0;text-align:center}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-thumb-container{display:flex;align-items:center;justify-content:center;padding:16px 39px 14px}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-thumb-container>img{width:110px;height:112px;max-width:revert}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-thumb-container{flex:1;position:relative;padding:10px 5px 0;height:142px;margin:0;overflow:revert}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-thumb-container>img{max-width:100%}:root div[data-command-bar-id=webpage]>div.tippy-box{max-width:500px}:root div[data-command-bar-id=webpage]>div.tippy-box div.tippy-content{width:500px;padding:0}.editor-dialog-container{width:500px}.editor-dialog-container .dialog-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 20px;height:50px;border-bottom:1px solid #e8e8e8;margin-bottom:20px}.editor-dialog-container .dialog-header .close-icon{display:flex;cursor:pointer}.editor-dialog-container .dialog-header .dialog-header-title{padding:8px 0 11px;font-size:18px;font-weight:700;flex-grow:1}.editor-dialog-container .dialog-content{padding:0 20px 20px;border-bottom:1px solid #e8e8e8}.editor-dialog-container .dialog-footer{margin:10px 0;padding:0 20px;text-align:right}.editor-dialog-container .dialog-footer button{min-height:30px;border-radius:3px;font-size:14px}.editor-disable-scroll.editor-disable-scroll-dark{background-color:#00000080}.embed-block[data-embed-type=webpage]{height:400px;min-height:100px;max-height:1000px}.embed-block[data-embed-type=webpage] .webpage-mask{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1;background-color:transparent}.embed-block[data-embed-type=webpage].resizing [data-type=block-tools] .block-resizer{pointer-events:all!important}.embed-block[data-embed-type=webpage].hover>div[data-type=block-content]{outline:none!important}.embed-block[data-embed-type=webpage].selected>div[data-type=block-content]{outline:none!important}.embed-block[data-embed-type=webpage]>div[data-type=block-content]{justify-content:center;height:100%}.embed-block[data-embed-type=webpage]>div[data-type=block-content]>.editor-embed{width:100%}.embed-block[data-embed-type=webpage]>div[data-type=block-content]>.editor-embed .editor-preview-iframe{width:100%;max-height:500px;height:100%;border:none;position:relative}.embed-block[data-embed-type=webpage]>div[data-type=block-content]>.editor-embed .editor-preview-iframe-loading{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;justify-content:center;align-items:center;background-color:#fff}.webpage-content .help-container{color:#303030;border:1px solid #dedede;padding:10px;border-radius:4px;border-left:4px solid #338fe5;margin-top:16px;margin-bottom:16px}.webpage-content .help-container .help-content{display:flex;align-items:center}.webpage-content .help-container .help-content .help-icon{display:flex;align-items:center;height:20px;color:#338fe5;margin-right:12px}.webpage-content .help-link-container{margin-top:8px;display:flex;align-items:center}.webpage-content .help-link-container .help-link-content{display:flex;align-items:center;color:#338fe5;text-decoration:none}.webpage-content .help-link-container .help-link-content .help-link-icon{width:16px;height:16px;margin-left:8px}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-embed-type=webpage]>div[data-type=block-content]:before{display:block}:root{--editor-quoted-color: #7084a4;--editor-drawio-empty-svg: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zOC43MjAzIDI4LjcwOTdIMjUuOTIzM0MyNS4yMTY1IDI4LjcwOTcgMjQuNjQzNSAyOC4xNDgxIDI0LjY0MzUgMjcuNDU1MlYyNS43MzMzSDIwLjUyODNDMjAuNDk4NiAyNS43Njk2IDIwLjQ2NjkgMjUuODA0MiAyMC40MzMzIDI1LjgzN0wxNS45MTkyIDMwLjI2MjFWMzQuNzU1NkgyNC42NDM1VjMzLjcyNzZDMjQuNjQzNSAzMy4wMzQ4IDI1LjIxNjUgMzIuNDczMiAyNS45MjMzIDMyLjQ3MzJIMzguNzIwM0MzOS40MjcgMzIuNDczMiA0MCAzMy4wMzQ4IDQwIDMzLjcyNzZWMzguNzQ1NUM0MCAzOS40MzgzIDM5LjQyNyA0MCAzOC43MjAzIDQwSDI1LjkyMzNDMjUuMjE2NSA0MCAyNC42NDM1IDM5LjQzODMgMjQuNjQzNSAzOC43NDU1VjM3LjMzMzNIMTQuNjI2M0MxMy45MTIyIDM3LjMzMzMgMTMuMzMzMyAzNi43NTYyIDEzLjMzMzMgMzYuMDQ0NFYzMC42OTQxTDguMzc4NTIgMjUuODM3QzguMTM2MjYgMjUuNjAxNCA4IDI1LjI4MDggOCAyNC45NDYzQzggMjQuNjExOCA4LjEzNjI2IDI0LjI5MTEgOC4zNzg1MiAyNC4wNTU2TDEzLjMzMzMgMTkuMTk4NVYxNS43NzJDMTEuNzc5OCAxNS4yMjI5IDEwLjY2NjcgMTMuNzQxNiAxMC42NjY3IDEyQzEwLjY2NjcgOS43OTA4NSAxMi40NTc1IDggMTQuNjY2NyA4QzE2Ljg3NTggOCAxOC42NjY2IDkuNzkwODUgMTguNjY2NiAxMkMxOC42NjY2IDEzLjcyNjUgMTcuNTU4OCAxNS4yNTgxIDE1LjkxOTEgMTUuNzk4OFYxOS4yODg4QzE1LjkxOTEgMTkuMzkxOCAxNS45MDY4IDE5LjQ5NDMgMTUuODgyMyAxOS41OTQzTDE5LjUxNTEgMjMuMTU1NUgyNC42NDM1VjIyLjQzNzNDMjQuNjQzNSAyMS43NDQ1IDI1LjIxNjUgMjEuMTgyOSAyNS45MjMzIDIxLjE4MjlIMzguNzIwM0MzOS40MjcgMjEuMTgyOSA0MCAyMS43NDQ1IDQwIDIyLjQzNzNWMjcuNDU1MkM0MCAyOC4xNDgxIDM5LjQyNyAyOC43MDk3IDM4LjcyMDMgMjguNzA5N1pNMjcuMjAzIDM3LjQ5MUgzNy40NDA2VjM0Ljk4MjFIMjcuMjAzVjM3LjQ5MVpNMTQuNDA1OSAyOC4xOTU0TDExLjA5MTUgMjQuOTQ2M0wxNC40MDU5IDIxLjY5NzJMMTcuNzIwNCAyNC45NDYzTDE0LjQwNTkgMjguMTk1NFpNMjcuMjAzIDI2LjIwMDhIMzcuNDQwNlYyMy42OTE4SDI3LjIwM1YyNi4yMDA4WiIgZmlsbD0iIzA3MTQyQSIvPgo8L3N2Zz4K)}.flex-center,.editor-drawio-iframe-container.loading:before{display:flex;align-items:center;justify-content:center}.full-screen,.editor-drawio-iframe-container.loading:before,.drawio-iframe-element,.editor-drawio-iframe-container{width:100%;height:100%}.editor-drawio-iframe-container{position:fixed;top:0;left:0;z-index:1000}div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content]{outline:1px solid #dedede}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio].drawio-load-error>div[data-type=block-content]{padding:0;min-height:200px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio].drawio-load-error>div[data-type=block-content] .editor-drawio-content{width:100%;height:100%}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content]{justify-content:center;border-radius:3px;padding:10px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content{display:flex;flex-direction:column;align-items:center;justify-content:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content{width:100%;height:100%;background-color:#f8f8f8;display:flex;flex-direction:column;justify-content:center;text-align:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-brand-icon>svg{width:48px;height:48px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-title{font-weight:500;font-size:18px;line-height:26px;text-align:center;color:#303030;margin:23px 0 5px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-sub-title{font-size:14px;line-height:22px;text-align:center;color:#606060}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-sub-title>span.drawio-error-retry-button{cursor:pointer;margin-left:4px;color:#338fe5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .drawio-empty-content{display:flex;flex-direction:column;align-items:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .drawio-empty-content>span{font-size:14px;line-height:22px;text-align:center;color:#606060;margin-top:23px}.embed-block .editor-empty-drawio.editor-drawio-content.editor-embed{width:240px;height:80px;display:inline-block;text-align:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-embed-type=drawio].embed-block>div[data-type=block-content] img{max-width:100%;max-height:100%}.editor-drawio-iframe-container.loading:before{content:attr(data-placeholder);position:absolute;top:0;left:0;background-color:#f7f6f3;z-index:2}.editor-content .editing{background-color:#cdcdcd40}.editor-content div[data-type=block-tools] .embed-code-editor-container{position:absolute;top:0;left:0px;right:0px;bottom:0;background-color:#cdcdcd40;z-index:var(--wiz-editor-z-embed-code-editor-mask);padding:8px}.editor-content div[data-type=block-tools] .embed-code-editor-container textarea{width:100%;height:100%;resize:none;outline:none;padding:12px;border:1px solid #b9bfc8;border-radius:4px;background-color:#fff;color:#333}.flex-row-center,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=mermaid] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=mermaid],.embed-block[data-embed-type=flowchart],.embed-block[data-embed-type=plantuml]{display:flex;flex-direction:row;align-items:center;justify-content:center}.embed-block[data-embed-type=mermaid] div[data-type=block-content],.embed-block[data-embed-type=flowchart] div[data-type=block-content],.embed-block[data-embed-type=plantuml] div[data-type=block-content]{width:100%;position:relative;border:1px solid #e5e5e5;border-radius:3px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .empty-embed,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .empty-embed,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .empty-embed{width:100%;min-height:106px;background-color:#cdcdcd40}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .empty-embed:after{content:attr(data-empty-tips);position:absolute;top:0;right:0;width:100%;height:100%;color:#07142a;white-space:nowrap}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed){width:100%;height:100px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed) img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed) img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed) img{display:none}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed):after,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed):after,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed):after{content:attr(data-invalid-text);position:absolute;top:0;right:0;width:100%;height:100%;outline:1px solid red;display:flex;flex-direction:row;align-items:center;justify-content:center;color:red}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-img-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-img-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-img-content{width:100%;text-align:center}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .mermaid-embed-img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .mermaid-embed-img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .mermaid-embed-img{max-width:100%;min-width:200px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .editor-plantuml-img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .editor-plantuml-img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .editor-plantuml-img{max-width:100%}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-img-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-img-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-img-content{width:100%;text-align:center;padding:10px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-img-content img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-img-content img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-img-content img{max-width:100%}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed{width:100%}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content{width:100%;height:100%;min-height:200px;background-color:#f8f8f8;display:flex;flex-direction:column;justify-content:center;text-align:center}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-brand-icon>svg{width:48px;height:48px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-title,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-title{font-weight:500;font-size:18px;line-height:26px;text-align:center;color:#303030;margin:23px 0 5px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title{font-size:14px;line-height:22px;text-align:center;color:#606060}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title>span.graph-error-retry-button{cursor:pointer;margin-left:4px;color:#338fe5}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content{background-color:#fff}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-brand-icon>svg,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-brand-icon>svg,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-brand-icon>svg{width:48px;height:48px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-empty-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-empty-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-empty-title{font-weight:400;font-size:14px;line-height:22px;text-align:center;color:#606060;margin-top:23px}.hr-transition,.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-content] .editor-embed-container .editor-embed-hr{transition:border-top ease-in-out .4s}.embed-block[data-type=editor-block][data-embed-type=hr].hover>div[data-type=block-content]{outline:none!important}.embed-block[data-type=editor-block][data-embed-type=hr].selected>div[data-type=block-content]{outline:none!important}.embed-block[data-type=editor-block][data-embed-type=hr]:is(.focused) div[data-type=block-content] .editor-embed-container .editor-embed-hr{caret-color:transparent}.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-content] .editor-embed-container{display:flex;align-items:center;width:100%;height:24px;cursor:pointer}.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-content] .editor-embed-container .editor-embed-hr{display:block;width:100%;border:none;margin:0;border-top:2px dashed #cccccc}.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-tools]>div.block-helper{height:100%}:root{--hover-color: #40a9ff}.flex-column-center,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error{display:flex;justify-content:center;align-items:center;flex-flow:column}.common{width:400px;height:180px;background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;transition:border-color .3s}.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error{height:200px}.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty .media-error-icon,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .media-error-icon{display:flex}.editor-root .editor-content div[data-type=editor-block].embed-block.media-block-uploading div[data-type=block-tools] .block-helper{display:none}.embed-block[data-embed-type=video]{display:flex}.embed-block[data-embed-type=video][data-style-align=left]>div[data-type=block-content]{justify-content:flex-start}.embed-block[data-embed-type=video][data-style-align=center]>div[data-type=block-content]{justify-content:center}.embed-block[data-embed-type=video][data-style-align=right]>div[data-type=block-content]{justify-content:flex-end}.embed-block[data-embed-type=video]>div[data-type=block-content]{border:none}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error{height:400px}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty .media-error-icon,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .media-error-icon{display:flex}.embed-block[data-embed-type=video].hover>div[data-type=block-content],.embed-block[data-embed-type=audio].hover>div[data-type=block-content]{outline:none!important}.embed-block[data-embed-type=video].selected>div[data-type=block-content]:before,.embed-block[data-embed-type=audio].selected>div[data-type=block-content]:before{display:none}.embed-block[data-embed-type=video]>div[data-type=block-content],.embed-block[data-embed-type=audio]>div[data-type=block-content]{justify-content:center;width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media.full-screen,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media.full-screen{width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media{display:flex;justify-content:center}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress{position:relative;width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress audio,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress audio{display:block;width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress video,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress video{display:block;max-width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress .uploading-progress-mask,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress .uploading-progress-mask{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#303030;opacity:.8;display:flex;align-items:center;justify-content:center}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar{width:75%;height:6px;border-radius:3px;display:flex;background-color:#fff;overflow:hidden}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar .uploading-progress-bar-value,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar .uploading-progress-bar-value{background-color:#338fe5}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error{width:100%;background:#F8F8F8;outline:1px solid #DEDEDE;border-radius:3px}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error-icon svg,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error-icon svg{width:48px;height:48px;color:#c7c7c7}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .line-1,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .line-1{margin-top:10px;font-size:18px;text-align:center;color:#303030}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .line-2,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .line-2{margin-top:5px;font-size:14px;text-align:center;color:#606060}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .retry-upload,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .retry-upload{margin-left:4px;color:#338fe5;cursor:pointer;text-decoration:none}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty{width:100%;background:#FFFFFF;outline:1px solid #DEDEDE;border-radius:3px}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty svg,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty svg{width:48px;height:48px;color:#c7c7c7}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element{width:100%;display:flex;justify-content:center}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element .video-container video,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element .video-container video{display:block;min-width:50px;max-width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element .audio-container,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element .audio-container{width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element .audio-container audio,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element .audio-container audio{display:block;width:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment{box-shadow:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment .media,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment .media{box-shadow:0 2px #f8e6ab}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment.active,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment.active{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment.active .media,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment.active .media{box-shadow:none;outline:4px solid #f8e6ab}.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-others>[data-type=block-content]:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-others>[data-type=block-content]:after{display:none}.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-self>[data-type=block-content] .media,.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-others>[data-type=block-content] .media,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-self>[data-type=block-content] .media,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-others>[data-type=block-content] .media{position:relative}.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-self>[data-type=block-content] .media:after,.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-others>[data-type=block-content] .media:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-self>[data-type=block-content] .media:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-others>[data-type=block-content] .media:after{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#303030;opacity:.1}`)),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@keyframes ones-editor-blink{0%,to{background-color:transparent}50%{background-color:var(--primary-color)}}*{--link-color: #338fe5;--color-0: #e52727;--color-1: #eb6414;--color-2: #f0a100;--color-3: #24b47e;--color-4: #338fe5;--color-5: #9678d3;--color-6: #909090;--background-color-0: #fad4d4;--background-color-1: #fbe0d0;--background-color-2: #fceccc;--background-color-3: #d3f0e5;--background-color-4: #d6e9fa;--background-color-5: #eae4f6;--background-color-6: #dedede;--background-color-7: #e52727;--background-color-8: #eb6414;--background-color-9: #f0a100;--background-color-10: #24b47e;--background-color-11: #338fe5;--background-color-12: #9678d3;--background-color-13: #909090;--background-color-14: #e8e8e8;--font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif}div.editor-root{--text-color: #303030;--primary-color: #338fe5;--background-selection: #338fe533;--background-code: #cdcdcd40}div.editor-root{color:var(--text-color);position:relative;box-sizing:border-box;min-height:100%;width:100%;z-index:1}div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span.text.link{cursor:pointer}div.editor-root *{box-sizing:border-box;font-family:var(--font-family)}div.editor-root button{outline:none}div.editor-root.active div.editor-content .editor-cursor{opacity:1}div.editor-root .safari.mobile div.editor-content .editor-input{pointer-events:all;width:8px}div.editor-root div.editor-content{height:100%;width:100%;padding:0 30px 30px}div.editor-root div.editor-content .editor-cursor{position:absolute;background:var(--primary-color);width:2px;transition:top .1s ease-in,left .1s linear;animation:ones-editor-blink 1s ease-in-out infinite;opacity:0;pointer-events:none}div.editor-root div.editor-content .editor-input{position:absolute;opacity:0;pointer-events:none;width:16px;height:20px;font-size:16px}div.editor-root div.editor-content div[data-type=editor-container]{position:relative}div.editor-root div.editor-content div[data-type=editor-container].root{user-select:none;width:100%;cursor:text}div.editor-root div.editor-content div[data-type=editor-container].root>.container-blocks>*+*{margin-top:1em}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block]:not(:first-of-type){background-color:var(--background-selection)}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block]:not(:first-of-type) div[data-type=block-background]>.editor-selection-background{background-color:transparent!important}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block].embed-block>div[data-type=block-content]:before,div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block].embed-block .embed-selected-content:before{display:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]+div[data-type=editor-block][data-style-quoted]{margin-top:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block]{font-size:var(--font-size);line-height:var(--line-height);position:relative;--font-size: 15px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=center] div[data-type=block-content]{text-align:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=right] div[data-type=block-content]{text-align:end}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].block-hidden{display:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=text]{cursor:text}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]{word-break:break-word;position:relative}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span{cursor:text}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text{white-space:pre-wrap}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.link{color:var(--link-color)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.link:hover{text-decoration:underline}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.link.style-strikethrough:hover{text-decoration:underline line-through}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-bold{font-weight:700}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-italic{font-style:italic}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-underline{text-decoration:underline}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-strikethrough{text-decoration:line-through}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-underline.style-strikethrough{text-decoration:underline line-through}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-code{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:var(--background-code);padding:4px;font:.8em Monaco,Consolas,"Andale Mono",DejaVu Sans Mono,monospace}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-sub{vertical-align:sub;font-size:70%}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text.style-super{vertical-align:super;font-size:70%}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="0"]{color:var(--color-0)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="1"]{color:var(--color-1)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="2"]{color:var(--color-2)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="3"]{color:var(--color-3)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="4"]{color:var(--color-4)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="5"]{color:var(--color-5)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-color="6"]{color:var(--color-6)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="0"]{background-color:var(--background-color-0)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="1"]{background-color:var(--background-color-1)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="2"]{background-color:var(--background-color-2)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="3"]{background-color:var(--background-color-3)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="4"]{background-color:var(--background-color-4)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="5"]{background-color:var(--background-color-5)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="6"]{background-color:var(--background-color-6)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="7"]{background-color:var(--background-color-7)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="8"]{background-color:var(--background-color-8)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="9"]{background-color:var(--background-color-9)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="10"]{background-color:var(--background-color-10)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="11"]{background-color:var(--background-color-11)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="12"]{background-color:var(--background-color-12)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="13"]{background-color:var(--background-color-13)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.text[data-style-bg-color="14"]{background-color:var(--background-color-14)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].inputting-insertion>span[data-type=insertion-content]{border-bottom:1px solid var(--primary-color)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion{width:0px;position:relative;display:inline-block;vertical-align:text-bottom;overflow:visible;height:1em}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion>span[data-type=insertion-content]{position:absolute;color:transparent;width:3px;left:-3px;border-right:var(--cursor-color) 1px solid;text-overflow:clip;display:inline-block;top:-5px;bottom:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion>span[data-type=insertion-content] span[data-cursor-name]{display:inline-block;width:8px;background-color:transparent;border:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion>span[data-type=insertion-content] span[data-cursor-name]:hover:before,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span[data-type=editor-insertion].remote-cursor-insertion.active>span[data-type=insertion-content] span[data-cursor-name]:before{content:attr(data-cursor-name);position:absolute;top:-12px;height:1.1em;background-color:var(--cursor-color);z-index:27;left:0px;color:#fff;white-space:nowrap;font-size:12px;display:flex;align-items:center;padding:1px 4px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span[data-type=box-content]{border-radius:2px;margin-left:8px;margin-right:8px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span[data-type=editor-box].br-box>span[data-type=box-content] img{vertical-align:middle;max-width:1em}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] span[data-type=editor-box][data-box-type=image].image-box span[data-type=box-content]{user-select:none;margin-left:0;margin-right:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-tools] .editor-block-anchor{position:absolute}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-background] .editor-selection-background{position:absolute;background-color:var(--background-selection);z-index:1;pointer-events:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block{cursor:default}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.hover>div[data-type=block-content],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block.hover>div[data-type=block-content]{outline:1px solid #338fe5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block>div[data-type=block-content],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block>div[data-type=block-content]{display:flex}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.hover .embed-hover-content{outline:1px solid #338fe5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected>div[data-type=block-content],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected .embed-selected-content{position:relative}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected>div[data-type=block-content]:before,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block.selected .embed-selected-content:before{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#338fe5;opacity:.1}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block{color:#909090;font-size:12px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].unknown-block>div[data-type=block-content]{padding:5px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]{border-left:4px solid #e8e8e8;color:#909090}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]:not([data-list-level]){padding-left:8px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="1"]{--font-size: 28px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="1"]:not(:first-child){margin-top:24px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="2"]{--font-size: 26px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="2"]:not(:first-child){margin-top:24px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="3"]{--font-size: 24px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="3"]:not(:first-child){margin-top:20px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="4"]{--font-size: 22px;--line-height: 1.5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="4"]:not(:first-child){margin-top:20px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="5"]{--font-size: 20px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="5"]:not(:first-child){margin-top:16px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="6"]{--font-size: 18px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="6"]:not(:first-child){margin-top:16px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="7"]{--font-size: 16px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="8"]{--font-size: 14px;--line-height: 1.6}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading]{font-size:var(--font-size);line-height:var(--line-height);font-weight:700}.editor-disable-scroll{position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:9900;overflow:hidden}div:not(.comment-editor-root)>div.editor-root>div.editor-content>div[data-type=editor-container]>div.container-blocks>div[data-type=editor-block]:first-of-type{font-size:30px;line-height:1.3}div.comment-editor-root div.root.select-all>.container-blocks>div[data-type=editor-block]:first-of-type{background-color:var(--background-selection)}div.comment-editor-root div.root.select-all>.container-blocks>div[data-type=editor-block]:first-of-type div[data-type=block-background]>.editor-selection-background{background-color:transparent!important}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-anchor{position:absolute;pointer-events:none;z-index:-1}.editor-command-bar.toolbar .color-button{width:24px;height:24px;display:flex;padding:0;margin:0;align-items:center;justify-content:center;background-color:transparent;border:0;outline:0;border-radius:3px;cursor:pointer}.editor-command-bar.toolbar .color-button[data-color="0"]{color:var(--color-0)}.editor-command-bar.toolbar .color-button[data-color="1"]{color:var(--color-1)}.editor-command-bar.toolbar .color-button[data-color="2"]{color:var(--color-2)}.editor-command-bar.toolbar .color-button[data-color="3"]{color:var(--color-3)}.editor-command-bar.toolbar .color-button[data-color="4"]{color:var(--color-4)}.editor-command-bar.toolbar .color-button[data-color="5"]{color:var(--color-5)}.editor-command-bar.toolbar .color-button[data-color="6"]{color:var(--color-6)}.editor-command-bar.toolbar .color-button[data-background-color="0"]{background-color:var(--background-color-0)}.editor-command-bar.toolbar .color-button[data-background-color="1"]{background-color:var(--background-color-1)}.editor-command-bar.toolbar .color-button[data-background-color="2"]{background-color:var(--background-color-2)}.editor-command-bar.toolbar .color-button[data-background-color="3"]{background-color:var(--background-color-3)}.editor-command-bar.toolbar .color-button[data-background-color="4"]{background-color:var(--background-color-4)}.editor-command-bar.toolbar .color-button[data-background-color="5"]{background-color:var(--background-color-5)}.editor-command-bar.toolbar .color-button[data-background-color="6"]{background-color:var(--background-color-6)}.editor-command-bar.toolbar .color-button[data-background-color="7"]{background-color:var(--background-color-7)}.editor-command-bar.toolbar .color-button[data-background-color="8"]{background-color:var(--background-color-8)}.editor-command-bar.toolbar .color-button[data-background-color="9"]{background-color:var(--background-color-9)}.editor-command-bar.toolbar .color-button[data-background-color="10"]{background-color:var(--background-color-10)}.editor-command-bar.toolbar .color-button[data-background-color="11"]{background-color:var(--background-color-11)}.editor-command-bar.toolbar .color-button[data-background-color="12"]{background-color:var(--background-color-12)}.editor-command-bar.toolbar .color-button[data-background-color="13"]{background-color:var(--background-color-13)}.editor-command-bar.toolbar .color-button[data-background-color="14"]{background-color:var(--background-color-14)}.tippy-content{white-space:pre-line}.editor-button{min-height:26px;min-width:46px;font-size:12px;font-weight:400;outline:none;background-color:#fff;color:#606060;border:1px solid #c7c7c7;padding:4px 8px;border-radius:4px;margin-right:8px;cursor:pointer}.editor-button:disabled{cursor:not-allowed;opacity:.5;background-color:#e8e8e8}.editor-button:not(:disabled):hover{border:1px solid #338fe5;background-color:#eaf3fc;color:#338fe5}.editor-button.primary{font-weight:500;border:1px solid rgba(0,0,0,0);background-color:var(--editor-button-bg-color, #338fe5);color:var(--editor-button-color, #fff)}.editor-button.primary:not(:disabled):hover{background-color:#5ca5ea;border:1px solid rgba(0,0,0,0);color:var(--editor-button-color, #fff)}.editor-button.primary:disabled{cursor:not-allowed;opacity:.5}.editor-button.primary:not(:disabled):active{background-color:#2872b7;color:#fff;border-color:#2872b7}.editor-button:last-child{margin-right:0}.editor-button:not(:disabled):active{background-color:#d6e9fa;color:#2872b7;border-color:#2872b7}@keyframes editorLoadingCircle{0%{transform-origin:50% 50%;transform:rotate(0)}to{transform-origin:50% 50%;transform:rotate(360deg)}}.editor-loading svg{color:#338fe5;font-size:1em;animation:editorLoadingCircle .8s linear infinite}.editor-checkbox-wrapper{display:flex;height:14px;width:14px;border:none;background-color:transparent;outline:none;padding:0;overflow:visible;box-sizing:border-box;cursor:pointer}.editor-checkbox-wrapper .editor-checkbox{display:block;width:100%;height:100%}.editor-checkbox-wrapper .editor-checkbox>.editor-checkbox-inner{display:block;box-sizing:border-box;border:1px solid #c7c7c7;border-radius:3px;height:100%;width:100%;position:relative;left:0;top:0;transition:all .3s}.editor-checkbox-wrapper:not(.checked)>span.editor-checkbox:hover>span.editor-checkbox-inner{border-color:#338fe5}.editor-checkbox-wrapper.checked>.editor-checkbox{position:relative}.editor-checkbox-wrapper.checked>.editor-checkbox:after{animation:editorCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;border:1px solid #338fe5;border-radius:3px;content:"";height:100%;left:0;position:absolute;top:0;width:100%;box-sizing:border-box}.editor-checkbox-wrapper.checked>.editor-checkbox>span.editor-checkbox-inner{border-color:#338fe5;background-color:#338fe5}.editor-checkbox-wrapper.checked>.editor-checkbox>span.editor-checkbox-inner:after{width:5px;height:10px;left:2px;top:5px;border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;box-sizing:border-box;transform:rotate(45deg) scale(1) translate(-50%,-50%)}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}[data-theme=dropdown-list]{border-radius:4px;background:white;position:relative;max-width:calc(100vw - 24px);box-shadow:#0f0f0f0d 0 0 0 1px,#0f0f0f1a 0 3px 6px,#0f0f0f33 0 9px 24px;overflow:hidden}[data-theme=dropdown-list] .tippy-content{padding:0;background:white;color:#303030}[data-theme=dropdown-list] .tippy-content .editor-command-bar{max-height:50vh}[data-theme=dropdown-list] .filterable-list{min-width:100px;max-width:300px;display:flex;flex-direction:column;max-height:100%}[data-theme=dropdown-list] .filterable-list .filter{padding:8px}[data-theme=dropdown-list] .filterable-list .filter .filter-container{width:100%;font-size:14px;line-height:20px;padding:3px 6px;position:relative;border-radius:3px;box-shadow:#0f0f0f1a 0 0 0 1px inset;background:rgba(242,241,238,.6);cursor:text;height:28px;box-sizing:border-box;display:flex;align-items:center}[data-theme=dropdown-list] .filterable-list .filter .filter-container input.filter-input{border:none;outline:none;flex-grow:1;background:transparent}[data-theme=dropdown-list] .filterable-list .list{max-height:60vh;overflow-y:auto;padding:8px 0}[data-theme=dropdown-list] .filterable-list .list .list-item{user-select:none;transition:background 20ms ease-in 0s;cursor:pointer;width:calc(100% - 8px);margin-left:4px;margin-right:4px;border-radius:3px;height:24px;padding:4px 8px;display:flex;align-items:center;box-sizing:border-box}[data-theme=dropdown-list] .filterable-list .list .list-item .list-text{white-space:nowrap}[data-theme=dropdown-list] .filterable-list .list .list-item.selected{background-color:#eee}[data-theme=dropdown-list] .filterable-list .list .list-item.disabled{color:#c1c1c1}::placeholder{color:#bbb}.toast{font-family:Avenir,Helvetica,Arial,sans-serif;visibility:hidden;min-width:250px;margin-left:-125px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:8px;position:fixed;z-index:1;left:50%;bottom:30px}.toast.show{visibility:visible;animation:toast_fade_in .5s,toast_fade_out .5s 2.5s}.toast.positioned.show{animation:toast_fade_in_positioned .5s,toast_fade_out_positioned .5s 2.5s}.toast.positioned{bottom:unset}@keyframes toast_fade_in{0%{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@keyframes toast_fade_out{0%{bottom:30px;opacity:1}to{bottom:0;opacity:0}}@keyframes toast_fade_in_positioned{0%{opacity:0}to{opacity:1}}@keyframes toast_fade_out_positioned{0%{opacity:1}to{opacity:0}}div.tippy-box[data-theme=toolbar] .tippy-content,div.tippy-box[data-theme=menu] .tippy-content{padding:0}div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu{min-width:180px}div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar-root,div.tippy-box[data-theme=toolbar] .tippy-content .editor-command-bar-root{box-shadow:0 0 1px #30303040,0 12px 24px #30303026}div.tippy-box button{outline:none}.editor-command-bar-root{display:flex;flex-direction:column;align-items:flex-start;background:#ffffff;border-radius:2px;max-height:50vh;overflow:auto}.editor-command-bar-root.scrollable-bar>.editor-command-bar.menu{overflow-y:auto}.editor-command-bar{pointer-events:all;display:flex;box-sizing:border-box;--text-color: #606060;--primary-color: #338fe5;--selected-color: #f8f8f8;--separator-color: #e8e8e8;--warn-color: #fdf4f4}.editor-command-bar.fixed.toolbar{box-shadow:none}.editor-command-bar.menu{flex:1;width:100%;display:flex;flex-direction:column;align-items:flex-start;padding:5px 0}.editor-command-bar.menu .command-item.standard{color:#303030;user-select:none;transition:background 20ms ease-in 0s;cursor:pointer;width:100%;height:32px;padding:6px 10px;display:flex;align-items:center;box-sizing:border-box}.editor-command-bar.menu .command-item.standard .menu-item-icon{align-items:center;height:24px;width:24px;margin-right:5px;margin-top:-2px;display:flex;flex-direction:column;justify-content:center}.editor-command-bar.menu .command-item.standard .menu-item-name{white-space:nowrap;flex-grow:1;display:flex;align-items:center}.editor-command-bar.menu .command-item.standard .item-subtext{color:#b2bccd}.editor-command-bar.menu .command-item.standard .menu-item-sub-indicator{display:flex;align-items:center;justify-content:center}.editor-command-bar.menu .command-item.standard .menu-item-sub-indicator svg{width:16px;height:16px}.editor-command-bar.menu .command-item.standard.disabled{color:#c7c7c7;cursor:not-allowed}.editor-command-bar.menu .command-item.separator{height:1px;margin:4px 0;background-color:var(--separator-color);width:100%}.editor-command-bar.menu .command-item.section{font-size:.8em;color:#ccc;padding:5px 5px 5px 10px}.editor-command-bar.menu .command-item.selected{background-color:var(--selected-color)}.editor-command-bar.menu .command-item.selected[data-id=delete]{color:#e52727;background-color:var(--warn-color)}.editor-command-bar.menu .command-item.selected.disabled{background-color:transparent}.editor-command-bar.menu .command-item.checked{color:var(--primary-color)}.editor-command-bar.menu .command-item.checked .menu-item-checked-icon{display:flex;align-items:center;justify-content:center;margin-left:10px}.editor-command-bar.menu .command-item.checked.disabled{color:#c7c7c7}.editor-command-bar.menu .command-item span.highlight{color:#e52727}.editor-command-bar.toolbar{display:flex;flex-direction:row;align-items:flex-start;padding:5px 10px;gap:5px;background:#ffffff;box-shadow:0 0 1px #30303033,0 8px 16px #30303026;border-radius:3px}.editor-command-bar.toolbar .command-item{background:transparent;border:none;display:flex;align-items:center;justify-content:center;color:var(--text-color);height:24px;padding:0;cursor:pointer;border-radius:3px;min-width:24px}.editor-command-bar.toolbar .command-item.selected:not(.disabled){background-color:var(--selected-color)}.editor-command-bar.toolbar .command-item.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.checked{color:var(--primary-color)}.editor-command-bar.toolbar .command-item.checked.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.separator{margin:auto 2px;height:20px;min-width:1px;width:1px;background-color:var(--separator-color);padding:0;pointer-events:none;cursor:default}.editor-command-bar.toolbar .command-item .toolbar-item-name-container,.editor-command-bar.toolbar .command-item .toolbar-item-icon-container{display:flex}.editor-command-bar.toolbar .command-item[data-dropdown=true]{padding-left:4px;padding-right:4px}.editor-command-bar.toolbar .command-item[data-dropdown=true] .toolbar-item-icon-container{width:24px;height:24px;align-items:center;justify-content:center}.editor-command-bar.toolbar .command-item .toolbar-item-dropdown-container{display:flex}.editor-command-bar.toolbar .command-item .toolbar-item-dropdown-container svg{transform:rotate(360deg);transition:transform .2s linear}.editor-command-bar.toolbar .command-item.active .toolbar-item-dropdown-container svg{transform:rotate(180deg)}.editor-command-bar.toolbar .editor-button+.editor-button{margin-left:5px}.editor-command-bar.footer{width:100%}.reference-hidden .tippy-box[data-reference-hidden]{opacity:0;pointer-events:none;transition:none}.tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.editor-dropdown{display:flex;align-items:center;border:1px solid #C7C7C7;border-radius:3px;font-size:14px;width:200px;height:30px}.editor-dropdown *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.editor-dropdown .dropdown-text,.editor-dropdown .dropdown-input{flex-grow:1;padding:2px 8px;border:none;outline:none;background:transparent;font-size:14px;color:#333;min-width:0;flex-shrink:1}.editor-dropdown .dropdown-text{margin-right:4.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:100%;cursor:text;line-height:24px}.editor-dropdown:hover{border-color:#338fe5}.editor-dropdown.active{border-color:#338fe5;box-shadow:0 0 0 2px #338fe533}.editor-dropdown.active .dropdown-text{display:none}.editor-dropdown:not(.active) .dropdown-input{display:none}.editor-dropdown .dropdown-labels{display:flex;align-items:center;flex-shrink:0}.editor-dropdown .dropdown-labels .dropdown-label{color:#338fe5;background-color:#eaf3fc;height:20px;padding:0 5px;border-radius:3px;display:flex;align-items:center}.editor-dropdown .dropdown-labels .dropdown-label+.dropdown-label{margin-left:5px}.editor-dropdown .dropdown-clear-icon,.editor-dropdown .dropdown-icon{flex-shrink:0;width:16px;height:16px;margin-left:4px;display:flex;align-items:center;justify-content:center;cursor:pointer}.editor-dropdown .dropdown-clear-icon{color:#909090}.editor-dropdown .dropdown-clear-icon:hover{color:#338fe5}.editor-dropdown.empty .dropdown-clear-icon,.editor-dropdown:not(:hover) .dropdown-clear-icon{display:none}.editor-dropdown.empty .dropdown-text{color:#909090}.editor-dropdown .dropdown-icon{margin-right:4px}.scale-border:after,.color-palette .palette-container-row .background-color-button.selected:after,.color-palette .palette-container-row .background-color-button:hover:after{content:"";outline:1px solid #d6e9fa;border-radius:3px;position:absolute;left:0;right:0;top:0;bottom:0;transform:scale(1.1)}.color-palette{display:flex;flex-direction:column;align-items:center;padding-top:5px;background-color:#fff;--active-color: #2872b7}.color-palette .bar-desc{box-sizing:border-box;width:100%;height:24px;padding-left:10px;margin-bottom:10px;line-height:24px;font-size:12px;font-weight:500;background:#F8F8F8;color:#909090}.color-palette .palette-container{padding:0 10px}.color-palette .background-color .palette-container-row:first-child{margin-bottom:5px}.color-palette .palette-container-row{display:flex;flex-direction:row;margin-bottom:20px}.color-palette .palette-container-row .color-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;background-color:#fff;border:1px solid #f0f0f0;display:flex;margin:0;padding:0;align-items:center;justify-content:center}.color-palette .palette-container-row .color-button:hover{border:1px solid #d6e9fa}.color-palette .palette-container-row .color-button.selected{border:1px solid var(--primary-color)}.color-palette .palette-container-row .color-button[data-color-index="-1"]{color:var(--text-color)}.color-palette .palette-container-row .color-button[data-color-index="0"]{color:var(--color-0)}.color-palette .palette-container-row .color-button[data-color-index="1"]{color:var(--color-1)}.color-palette .palette-container-row .color-button[data-color-index="2"]{color:var(--color-2)}.color-palette .palette-container-row .color-button[data-color-index="3"]{color:var(--color-3)}.color-palette .palette-container-row .color-button[data-color-index="4"]{color:var(--color-4)}.color-palette .palette-container-row .color-button[data-color-index="5"]{color:var(--color-5)}.color-palette .palette-container-row .color-button[data-color-index="6"]{color:var(--color-6)}.color-palette .palette-container-row .background-color-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;position:relative}.color-palette .palette-container-row .background-color-button.selected:after{outline:1px solid var(--primary-color)}.color-palette .palette-container-row .background-color-button[data-color-index="-1"]{position:relative;background-color:#fff;border:1px solid #e8e8e8}.color-palette .palette-container-row .background-color-button[data-color-index="-1"]:after{transform:scale(1.2)}.color-palette .palette-container-row .background-color-button[data-color-index="-1"]:before{content:"";position:absolute;width:1px;height:56px;top:2px;left:22px;background-color:#c7c7c7;transform:rotate(45deg) scale(.5);transform-origin:-1px -2px}.color-palette .palette-container-row .background-color-button[data-color-index="0"]{background-color:var(--background-color-0)}.color-palette .palette-container-row .background-color-button[data-color-index="1"]{background-color:var(--background-color-1)}.color-palette .palette-container-row .background-color-button[data-color-index="2"]{background-color:var(--background-color-2)}.color-palette .palette-container-row .background-color-button[data-color-index="3"]{background-color:var(--background-color-3)}.color-palette .palette-container-row .background-color-button[data-color-index="4"]{background-color:var(--background-color-4)}.color-palette .palette-container-row .background-color-button[data-color-index="5"]{background-color:var(--background-color-5)}.color-palette .palette-container-row .background-color-button[data-color-index="6"]{background-color:var(--background-color-6)}.color-palette .palette-container-row .background-color-button[data-color-index="7"]{background-color:var(--background-color-7)}.color-palette .palette-container-row .background-color-button[data-color-index="8"]{background-color:var(--background-color-8)}.color-palette .palette-container-row .background-color-button[data-color-index="9"]{background-color:var(--background-color-9)}.color-palette .palette-container-row .background-color-button[data-color-index="10"]{background-color:var(--background-color-10)}.color-palette .palette-container-row .background-color-button[data-color-index="11"]{background-color:var(--background-color-11)}.color-palette .palette-container-row .background-color-button[data-color-index="12"]{background-color:var(--background-color-12)}.color-palette .palette-container-row .background-color-button[data-color-index="13"]{background-color:var(--background-color-13)}.color-palette .palette-container-row .background-color-button[data-color-index="14"]{background-color:var(--background-color-14)}.color-palette .palette-container-row .color-button+.color-button{margin-left:5px}.color-palette .palette-container-row .background-color-button+.background-color-button{margin-left:5px}.color-palette .clear-button-container{box-sizing:border-box;width:100%;margin-bottom:5px;padding:0 10px}.color-palette .clear-button-container .clear-button{box-sizing:border-box;padding:3px 10px;width:100%;height:26px;background:#ffffff;color:#606060;border:1px solid #c7c7c7;border-radius:3px;cursor:pointer}.color-palette .clear-button-container .clear-button:hover{border-color:var(--primary-color);color:var(--primary-color)}.color-palette .clear-button-container .clear-button:active{border-color:var(--active-color);color:var(--active-color);background-color:#d6e9fa}.editor-input-wrap .editor-input-label{margin-top:8px;margin-bottom:8px;position:relative}.editor-input-wrap .editor-input-label.required:before{content:"*";color:#e82100;position:absolute;left:-8px;top:3px}.editor-input-wrap .editor-input-label .span{font-size:14px;line-height:1.4;font-weight:700;color:#303030}.editor-input-wrap .editor-input-container{display:flex;border:none;border-radius:4px;padding:4px;background-color:#fff}.editor-input-wrap .editor-input-container .editor-input{outline:none;border:1px solid #c7c7c7;border-radius:3px;padding:4px 10px;font-size:14px;line-height:1.4;color:#000;width:100%}.editor-input-wrap .editor-input-container .editor-input:focus{border-color:#338fe5;box-shadow:0 0 0 2px #338fe533}.editor-input-wrap.error .editor-input-container{border:1px solid #e82100}.editor-input-wrap.error .editor-input-container .editor-input{border:none;outline:none;box-shadow:unset}.editor-input-wrap.error .editor-input-error{margin-top:8px;color:red;display:block}.editor-input-wrap .editor-input-error{display:none}div.scroll-container-root{position:relative}div.scroll-container-root>div.scroll-container{position:relative;overflow-x:auto;overflow-y:hidden;box-sizing:border-box;line-height:0px}div.scroll-container-root>div.scroll-container>.scroll-area{position:relative;display:inline-block;overflow:hidden;line-height:normal}div.scroll-container-root>div.scroll-container{scrollbar-width:none}div.scroll-container-root>div.scroll-container::-webkit-scrollbar{height:0;opacity:0}div.scroll-container-root>div.container-scroll-tool .container-border-shadow{position:absolute;top:0;opacity:0;width:0;border:none;pointer-events:none;transition:opacity 50ms ease-in;z-index:1}div.scroll-container-root>div.container-scroll-tool .container-right-border-shadow{right:0;background:linear-gradient(90deg,rgba(31,35,41,0) 0,rgba(31,35,41,.1));border-right:0px solid #dee0e3}div.scroll-container-root>div.container-scroll-tool .container-left-border-shadow{left:0;background:linear-gradient(270deg,rgba(31,35,41,0) 0,rgba(31,35,41,.1));border-left:0px solid #dee0e3}div.scroll-container-root>div.container-scroll-tool .container-border-shadow.active{width:8px;opacity:1}div.scroll-container-root>div.container-scroll-tool .container-right-border-shadow.active{border-right-width:1px}div.scroll-container-root>div.container-scroll-tool .container-left-border-shadow.active{border-left-width:1px}div.scroll-container-root>div.container-scroll-tool .container-scrollbar{position:absolute;left:0;z-index:1000;visibility:visible;overflow-x:auto;overflow-y:hidden;cursor:auto}div.scroll-container-root>div.container-scroll-tool .container-scrollbar div{height:1px}div.scroll-container-root>div.container-scroll-tool div.container-scrollbar.fixed{position:fixed}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar{opacity:.6;transition:opacity .1s ease-in-out}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar{height:8px}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar-track{background-color:transparent}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar-thumb{background-color:#646a73cc;border-radius:8px}div.scroll-container-root.mac>div.container-scroll-tool .container-scrollbar::-webkit-scrollbar-button{display:none}[data-tippy-root]{font-family:Avenir,Helvetica,Arial,sans-serif}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text]{height:32px;width:unset}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text].selected:hover{background-color:transparent}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text] .link-href-button{max-width:275px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#303030;text-decoration:none}[data-command-bar-id=editor-toolbar] .command-item[data-id=link-text] .link-href-button:hover{text-decoration:underline}[data-command-bar-id=editor-toolbar] .command-item[data-id=edit-link],[data-command-bar-id=editor-toolbar] .command-item[data-id=remove-link]{height:32px}[data-command-bar-id=editor-toolbar] .command-item[data-id=edit-link] svg,[data-command-bar-id=editor-toolbar] .command-item[data-id=remove-link] svg{stroke-width:2}[data-command-bar-id=editor-toolbar] .command-item[data-id=edit-link].selected:hover,[data-command-bar-id=editor-toolbar] .command-item[data-id=remove-link].selected:hover{background-color:transparent;color:#338fe5}[data-command-bar-id=quick-menu],[data-command-bar-id=empty-block-menu]{box-sizing:border-box;width:240px}[data-command-bar-id=quick-menu] .command-item.menu-item,[data-command-bar-id=empty-block-menu] .command-item.menu-item{width:100%;cursor:pointer}[data-command-bar-id=quick-menu] .command-item.menu-item.section,[data-command-bar-id=empty-block-menu] .command-item.menu-item.section{height:24px;padding:0 10px;font-weight:500;font-size:12px;line-height:24px;color:#909090;background:#f8f8f8;min-height:initial;box-sizing:border-box;margin:5px 0}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item{color:#303030;display:flex;width:100%;padding:6px 10px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container{display:flex;align-items:center;justify-content:center;padding-right:6px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container .quick-menu-item-icon,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-icon-container .quick-menu-item-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1{display:flex;align-items:center}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-name,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-name{flex-grow:1;font-size:14px;line-height:22px;color:#303030}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-subtext,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .item-subtext{color:#b2bccd}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .quick-menu-item-submenu-icon,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-1 .quick-menu-item-submenu-icon{display:flex;align-items:center;margin-left:12px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2{margin-top:5px}[data-command-bar-id=quick-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2 .item-markdown,[data-command-bar-id=empty-block-menu] .command-item.menu-item .quick-menu-item .quick-menu-item-content .item-line-2 .item-markdown{color:#b2bccd}[data-command-bar-id=quick-menu] .command-item.menu-item[data-id=placeholder] .quick-menu-item-icon-container,[data-command-bar-id=empty-block-menu] .command-item.menu-item[data-id=placeholder] .quick-menu-item-icon-container{display:none}[data-command-bar-id=quick-menu] .command-item.menu-item[data-id=placeholder] .item-name.text,[data-command-bar-id=empty-block-menu] .command-item.menu-item[data-id=placeholder] .item-name.text{color:#909090!important;padding:5px 0}[data-command-bar-id=block-menu]{width:240px}[data-command-bar-id=quick-menu] div.command-item>div.menu-item-name{color:#303030}[data-command-bar-id=quick-menu] div.command-item>div.menu-item-icon{color:#606060}[data-command-bar-id=quick-menu] div.command-item.section:first-of-type{margin-top:0}div.tippy-box[data-theme=editor-tooltip]{background-color:#303030;opacity:.8;font-size:12px;border-radius:3px}div.tippy-box[data-theme=editor-tooltip] .editor-tooltip-desc{display:block;margin-top:2px;color:#fff;opacity:.5}div.tippy-box[data-theme=editor-tooltip]>.tippy-arrow:before{transform:scale(.8)}div.tippy-box[data-theme=editor-tooltip]>.tippy-content{padding:4px 10px}:root div.tippy-box[data-theme=editor-tooltip]>.tippy-content{font-weight:500}:root div.tippy-box[data-theme=editor-tooltip]>.tippy-content>div>span:nth-of-type(2){font-weight:400}.link-popup-content{padding:10px 7px}.link-popup-content .link-popup-gap{margin-top:16px}.link-popup-content .editor-input-container{padding:4px 0}.link-popup-content .editor-input-container .editor-input{width:330px;line-height:1.5}.link-popup-content .editor-input-wrap .editor-input-label{margin-bottom:4px}.link-popup-content .link-popup-footer{margin:10px 0 5px;text-align:right}.link-popup-content .link-popup-footer button{min-height:30px;border-radius:3px;font-size:14px}:root{--mindmap-bg-color: #f0f2f4}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.focused [data-type=block-tools] .editor-mindmap-svg{border-radius:3px;outline:1px solid #338FE5}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.editor-in-mindmap-first{height:600px;min-width:150px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-content]{margin-right:24px;transition:background-color .25s linear}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .editor-mindmap-svg{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2;font-size:14px;background-color:var(--mindmap-bg-color)}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .mindmap-toolbar{position:absolute;top:8px;right:8px;height:24px;z-index:3}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .mindmap-toolbar .editor-button.mindmap-button{background-color:transparent;outline:none;border:none;fill:none;color:#c1c1c1;cursor:pointer;min-width:initial;margin-right:0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-tools] .mindmap-toolbar .editor-button.mindmap-button:hover{color:#5587f0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.to-mindmap-highlight [data-type=block-content],.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block.to-mindmap-highlight:hover [data-type=block-content]{background-color:#eaf3fc}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap{position:absolute;right:0;top:2px;display:flex;align-items:center;height:calc(var(--font-size) * var(--line-height))}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-to-mindmap],.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button]{flex-grow:0;flex-shrink:0;width:24px;height:24px;min-width:24px;min-height:24px;padding:0;border:0;outline:0;display:flex;align-items:center;justify-content:end;background-color:transparent;color:#07142a;margin-right:8px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-to-mindmap] svg,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button] svg{width:16px;height:16px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-block-mention]:hover>svg{cursor:initial;background-color:#eee}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button+button[data-button-id=list-block-mention]{right:20px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="1"]{padding-left:24px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="1"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="2"]{padding-left:48px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="2"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="3"]{padding-left:72px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="3"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="4"]{padding-left:96px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="4"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="5"]{padding-left:120px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="5"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="6"]{padding-left:144px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="6"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="7"]{padding-left:168px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="7"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="8"]{padding-left:192px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="8"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="9"]{padding-left:216px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="9"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="10"]{padding-left:240px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="10"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="11"]{padding-left:264px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="11"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="12"]{padding-left:288px}div.editor-root div.editor-content div[data-block-type=text][block-padding-level="12"]>div[data-type=block-content]{position:relative}div.editor-root div.editor-content div[data-block-type=list][data-list-level="1"]{padding-left:0}div.editor-root div.editor-content div[data-block-type=list][data-list-level="2"]{padding-left:24px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="3"]{padding-left:48px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="4"]{padding-left:72px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="5"]{padding-left:96px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="6"]{padding-left:120px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="7"]{padding-left:144px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="8"]{padding-left:168px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="9"]{padding-left:192px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="10"]{padding-left:216px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="11"]{padding-left:240px}div.editor-root div.editor-content div[data-block-type=list][data-list-level="12"]{padding-left:264px}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="1"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="2"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="3"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="4"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="5"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="6"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="7"]>div.list-container>button.list-marker{font-weight:700}div.editor-root div.editor-content div[data-block-type=list][data-style-heading="8"]>div.list-container>button.list-marker{font-weight:700}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block+div[data-type=editor-block].list-block{margin-top:0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block{display:flex;padding-bottom:2px;padding-top:2px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=text-only] .list-container{pointer-events:none}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] div[data-type=block-content] span.text{color:#c7c7c7}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unordered] .list-container .list-marker{font-family:PingFangSC-Regular,PingFang SC;justify-content:space-around}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:var(--gray-120);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper>span.editor-check-box>span.editor-check-box-inner,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper>span.editor-check-box>span.editor-check-box-inner{border:1px solid #c7c7c7;border-collapse:initial;border-radius:3px;direction:ltr;display:block;height:14px;left:0;position:relative;top:0;transition:all .3s;width:14px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box{position:relative}@keyframes editorCheckboxEffect{0%{transform:scale(1);opacity:.5}to{transform:scale(1.6);opacity:0}}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box:after,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box:after{animation:editorCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;border:1px solid #338fe5;border-radius:3px;content:"";height:100%;left:0;position:absolute;top:0;width:100%;box-sizing:border-box}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner{border-color:#338fe5;background-color:#338fe5}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner:after,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper.editor-check-list-wrapper-checked>span.editor-check-box>span.editor-check-box-inner:after{width:5px;height:10px;left:2px;top:5px;border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;box-sizing:border-box;transform:rotate(45deg) scale(1) translate(-50%,-50%)}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper:not(.editor-check-list-wrapper-checked)>span.editor-check-box:hover>span.editor-check-box-inner,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper:not(.editor-check-list-wrapper-checked)>span.editor-check-box:hover>span.editor-check-box-inner{border-color:#338fe5}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block [data-type=block-content]{position:relative;flex-grow:1;padding-left:2px;margin-right:29px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-container{display:flex;min-width:24px;align-items:center;justify-content:center;flex-shrink:0;border-radius:3px;height:calc(var(--font-size) * var(--line-height))}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-container .list-marker{min-width:16px;border:none;background-color:transparent;outline:none;display:flex;align-items:center;justify-content:flex-end;padding:0;overflow:visible;color:var(--primary-color);font-size:var(--font-size)}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block div[data-type=block-tools] .block-helper{top:2px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=center]{justify-content:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=center]>div[data-type=block-content]{flex-grow:initial}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=right]{justify-content:flex-end}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block[data-style-align=right]>div[data-type=block-content]{flex-grow:initial}.editor-root.readonly button[data-button-id=mindmap-close]{display:none}.editor-root:not(.readonly) div[data-type=editor-block].list-block.active,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover{background-color:#f8f8f8}.editor-root:not(.readonly) div[data-type=editor-block].list-block.active .list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover .list-container{cursor:pointer}.editor-root:not(.readonly) div[data-type=editor-block].list-block .list-container:hover .list-marker{cursor:pointer}.editor-root:not(.readonly) div[data-type=editor-block].list-block:not([data-list-type=unchecked]):not([data-list-type=checked]):not([data-list-type=unordered]) .list-container:hover{background-color:var(--background-selection)}.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=unordered] .list-container:hover .list-marker{cursor:initial}.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container:hover .list-marker svg>*{fill:var(--background-selection)}[data-tippy-root] .customize-start-panel{max-width:350px;padding:0 16px;color:#333;font-size:14px;line-height:21px;user-select:none;background-color:#fff!important}[data-tippy-root] .customize-start-panel-input{width:64px;margin:0 8px;border:1px solid #cfd6e1;height:24px;border-radius:3px;padding:1px 0 1px 8px;outline:none;color:inherit;background-color:#fff}[data-tippy-root] .customize-start-panel-button{min-width:40px;font-size:12px;min-height:30px;margin:0 8px 0 0;background-color:var(--primary-color);color:#fff;outline:none;border:none;padding:4px 8px;border-radius:4px;cursor:pointer}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block].list-block [data-type=block-content][data-content-placeholder]:before{left:2px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.math-box{display:inline-flex}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.math-box .mathjax-tex-text.mathjax-error{color:var(--color-0)}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax{max-width:100%}div.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=math]>div[data-type=block-content]{align-items:center;justify-content:center;min-height:40px}div.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=math]>div[data-type=block-content] img{margin:auto;padding:8px}.mathjax-editor-textarea{border:none;outline:none;width:400px;height:128px}.editor-text-button{border:0;color:var(--text-button-color, #c1c1c1);background-color:var(--text-button-bg-color, transparent);cursor:pointer;border-radius:var(--editor-border-radius, 3px);font-size:14px;padding:1px 6px;display:flex;align-items:center}.editor-text-button:hover{color:var(--text-button-color-hover, #5587F0);background-color:var(--text-button-bg-color-hover, transparent)}div[data-type=editor-block].table-block{--table-bar-width: 6px;--table-bar-left: -6px;--table-bar-top: -6px}div[data-type=editor-block].table-block>div[data-type=block-content]{position:relative;left:-26px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-resize-gripper,div[data-type=editor-block].table-block div[data-type=table-tools] .table-resize-gripper{position:absolute;background-color:transparent;cursor:col-resize;padding:0 2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-resize-gripper>.table-resize-gripper-indicator,div[data-type=editor-block].table-block div[data-type=table-tools] .table-resize-gripper>.table-resize-gripper-indicator{pointer-events:none;background-color:var(--primary-color);width:100%;height:100%}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container{position:absolute;background-color:transparent;z-index:10}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container.top{left:0;top:var(--table-bar-top);right:0;height:var(--table-bar-width);flex-direction:row}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container.left{top:20px;left:var(--table-bar-left);width:var(--table-bar-width);bottom:0;flex-direction:column}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar{position:absolute;left:0;top:0;right:0;bottom:0;cursor:pointer;display:flex}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar.left{flex-direction:column}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell{background-color:#e8e8e8;position:relative;flex-grow:0;flex-shrink:0}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.corner,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.corner{width:var(--table-bar-width);height:var(--table-bar-width)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.top{height:100%}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell:hover,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell:hover{background-color:#dedede}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.selected,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.selected{background-color:var(--primary-color)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.danger,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .table-border-bar-cell.danger{background-color:#e52727}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root{position:relative}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.top{max-width:0;width:0;overflow:visible}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.top:last-child,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.top:last-child{margin-left:-2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.left{max-height:0;height:0;overflow:visible}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root.left:last-child,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root.left:last-child{margin-top:-2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container{position:absolute;width:26px;height:26px;display:flex;align-items:center;justify-content:center;z-index:1}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container.top,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container.top{right:-14px;top:-22px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container.left,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container.left{transform:rotate(270deg);left:-22px;bottom:-14px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .insert-indicator,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .insert-indicator{position:absolute;width:3px;height:3px;background:#e8e8e8;border-radius:50%;margin-top:6px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-indicator,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-indicator{display:none}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button{display:unset}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button span.icon,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .insert-column-button span.icon{margin-top:2px}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .drop-marker,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container:hover .drop-marker{opacity:1;transform:scale(.7)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker{width:26px;height:26px;border-radius:3px;background:var(--primary-color);cursor:pointer;opacity:0;transform:scale(.4);transition:transform .2s ease-in,opacity .2s ease-in}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:after,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:after{content:"";display:block;width:10px;height:2px;background-color:#fff;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:before,div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root .button-container .drop-marker:before{content:"";display:block;width:2px;height:10px;background-color:#fff;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}div[data-type=editor-block].table-block div[data-type=block-tools] .editor-table-chart,div[data-type=editor-block].table-block div[data-type=table-tools] .editor-table-chart{padding-top:16px}div[data-type=editor-block].table-block div[data-type=table-content]{position:relative}div[data-type=editor-block].table-block div[data-type=table-content]>.error{color:red;border:1px solid red;padding:8px}div[data-type=editor-block].table-block div[data-type=table-content]>table{border-collapse:collapse;width:max-content;border-spacing:0}div[data-type=editor-block].table-block div[data-type=table-content]>table colgroup col{min-width:40px}div[data-type=editor-block].table-block div[data-type=table-content]>table,div[data-type=editor-block].table-block div[data-type=table-content]>table td,div[data-type=editor-block].table-block div[data-type=table-content]>table th{border:1px solid #c7c7c7;background-color:transparent;background-clip:padding-box}div[data-type=editor-block].table-block div[data-type=table-content]>table tr td.danger{background-color:#fce9e9!important}div[data-type=editor-block].table-block div[data-type=table-content]>table td{min-width:40px;padding:0;position:relative}div[data-type=editor-block].table-block div[data-type=table-content]>table td .table-cell-menu-btn{display:none;position:absolute;right:2px;top:2px;padding:0;width:16px;height:16px;border:none;border-radius:3px;cursor:pointer;transform:rotate(0);transition:transform .2s;background-color:transparent;color:#909090}div[data-type=editor-block].table-block div[data-type=table-content]>table td .table-cell-menu-btn:hover{background-color:#e8e8e8}div[data-type=editor-block].table-block div[data-type=table-content]>table td .table-cell-menu-btn.active{transform:rotate(180deg);color:#338fe5;background:#eaf3fc}div[data-type=editor-block].table-block div[data-type=table-content]>table td>div[data-type=editor-container].child>div.container-blocks>*+*{margin-top:5px}div[data-type=editor-block].table-block div[data-type=table-content] .child{padding:8px}div[data-type=editor-block].table-block div[data-type=table-content] .child div[data-type=editor-block].table-block>div[data-type=block-content]{pointer-events:none}div[data-type=editor-block].table-block div[data-type=table-content] .child div[data-type=editor-block].table-block>div[data-type=block-content] div[data-type=table-content]{pointer-events:auto}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-0{background-color:var(--background-color-0)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-1{background-color:var(--background-color-1)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-2{background-color:var(--background-color-2)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-3{background-color:var(--background-color-3)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-4{background-color:var(--background-color-4)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-5{background-color:var(--background-color-5)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-6{background-color:var(--background-color-6)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-7{background-color:var(--background-color-7)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-8{background-color:var(--background-color-8)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-9{background-color:var(--background-color-9)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-10{background-color:var(--background-color-10)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-11{background-color:var(--background-color-11)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-12{background-color:var(--background-color-12)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-13{background-color:var(--background-color-13)}div[data-type=editor-block].table-block div[data-type=table-content]>table td.style-bg-color-14{background-color:var(--background-color-14)}div[data-type=editor-block].table-block div[data-type=table-content]>table.row-title>tbody>tr:first-child>td,div[data-type=editor-block].table-block div[data-type=table-content]>table.col-title td.col-title-item{background-color:#f8f8f8}div[data-type=editor-block].table-block div[data-type=table-content]>table.stripe:not(.row-title)>tbody>tr:nth-of-type(2n),div[data-type=editor-block].table-block div[data-type=table-content]>table.stripe.row-title>tbody>tr:nth-of-type(2n + 1){background-color:#f5f8fb}div[data-type=editor-block].table-block div[data-type=table-content]>table.no-border,div[data-type=editor-block].table-block div[data-type=table-content]>.no-border>tbody>tr>td{border:1px dashed;border-color:transparent}div[data-type=editor-block].table-block.focused div[data-type=table-content]>table.no-border,div[data-type=editor-block].table-block.focused div[data-type=table-content]>table.no-border>tbody>tr>td,div[data-type=editor-block].table-block.child-focused div[data-type=table-content]>table.no-border,div[data-type=editor-block].table-block.child-focused div[data-type=table-content]>table.no-border>tbody>tr>td{border-color:#b9bfc8}div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table{background-color:var(--background-selection)}div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table td,div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table th,div[data-type=editor-block].table-block.full-selected>div[data-type=block-content]>.scroll-container-root>.scroll-container>.scroll-area>div[data-type=table-content]>table tr{background-color:transparent}div[data-type=editor-block].table-block div[data-type=table-content]>table tbody tr td.selected,div[data-type=editor-block].table-block div[data-type=table-content]>table.row-title tbody tr td.selected,div[data-type=editor-block].table-block div[data-type=table-content]>table.col-title tbody tr td.selected{background-color:var(--background-selection)}div[data-type=editor-block].table-block div[data-type=table-content]>table td div[data-type=editor-block].table-block div[data-type=table-content]>table{max-width:100%}.command-item.menu-item .table-creator{background-color:#fff;padding:0 5px}.command-item.menu-item .table-creator .table-creator-row{display:flex}.command-item.menu-item .table-creator .table-creator-row .table-creator-cell{width:16px;height:16px;margin:3px;border:solid 1px #ddd}.command-item.menu-item .table-creator .table-creator-row .table-creator-cell.active{background-color:#99c7f2}div.editor-root div.editor-content div[data-type=editor-container].root div[data-type=editor-block].table-block{margin-top:0}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color]{width:100%}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .bar-desc{display:none}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item{box-sizing:border-box;width:100%;height:32px;padding:5px 10px;display:flex;align-items:center;justify-content:space-between;color:var(--text-color)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-sub-indicator{display:flex;align-items:center;margin-left:5px}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-sub-indicator svg{height:16px;width:16px}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;position:relative;margin-left:auto}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="-1"]{position:relative;background-color:#fff;border:1px solid #e8e8e8}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="-1"]:after{transform:scale(1.2)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="-1"]:before{content:"";position:absolute;width:1px;height:56px;top:2px;left:22px;background-color:#c7c7c7;transform:rotate(45deg) scale(.5);transform-origin:-1px -2px}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="0"]{background-color:var(--background-color-0)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="1"]{background-color:var(--background-color-1)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="2"]{background-color:var(--background-color-2)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="3"]{background-color:var(--background-color-3)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="4"]{background-color:var(--background-color-4)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="5"]{background-color:var(--background-color-5)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="6"]{background-color:var(--background-color-6)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="7"]{background-color:var(--background-color-7)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="8"]{background-color:var(--background-color-8)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="9"]{background-color:var(--background-color-9)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="10"]{background-color:var(--background-color-10)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="11"]{background-color:var(--background-color-11)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="12"]{background-color:var(--background-color-12)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="13"]{background-color:var(--background-color-13)}div.tippy-box[data-theme=menu] .tippy-content div[data-id=cell-background-color] .cell-background-color-item .item-button[data-color-index="14"]{background-color:var(--background-color-14)}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table]{background-color:transparent}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.row-title>tbody>tr:first-child>td,div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.col-title td.col-title-item{background-color:transparent}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.stripe:not(.row-title)>tbody>tr:nth-of-type(2n),div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-block-type=table] table.stripe.row-title>tbody>tr:nth-of-type(2n + 1){background-color:transparent}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment{box-shadow:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment table{box-shadow:0 2px #f8e6ab}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment table table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment table table{box-shadow:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment.active,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment.active{outline:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment.active table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment.active table{border-bottom:none;outline:4px solid #f8e6ab}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-block-type=table].comment.active table table,div.editor-root div.editor-content div[data-type=editor-container].child div[data-type=editor-block][data-block-type=table].comment.active table table{box-shadow:none;outline:none}div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-self>[data-type=block-content]:after,div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-others>[data-type=block-content]:after{display:none}div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-self>[data-type=block-content] div[data-type=table-content],div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-others>[data-type=block-content] div[data-type=table-content]{position:relative}div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-self>[data-type=block-content] div[data-type=table-content]:after,div.editor-root:not(.readonly) div[data-type=editor-block].table-block.locked-by-others>[data-type=block-content] div[data-type=table-content]:after{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#303030;opacity:.1}.editor-root .editor-content div[data-type=editor-block].table-block div[data-type=block-tools] .block-helper{right:calc(100% + 5px);top:35px}[data-command-bar-id=table-row-column-toolbar] .editor-command-bar.toolbar{padding:4px}div.comment-editor-root div[data-type=editor-block].table-block>div[data-type=block-content]{left:0px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block{min-width:360px;counter-reset:code-line}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.full-selected{background-color:var(--background-selection)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.editing-language div[data-type=block-tools] .code-block-header,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.child-focused div[data-type=block-tools] .code-block-header,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:hover div[data-type=block-tools] .code-block-header{opacity:1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.wrap>div[data-type=block-tools] .code-block-header button[data-id=wrap] *{color:var(--primary-color)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child{overflow-x:auto}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child div[data-type=block-content]{word-break:keep-all;overflow:visible;white-space:pre}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child div[data-type=block-content]>span.text,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block:not(.wrap)>div[data-type=block-content] div[data-type=editor-container].child div[data-type=block-content]>span.inputting-insertion{white-space:pre}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header{opacity:0;transition:opacity .3s ease-in 0s;position:absolute;top:0;display:flex;padding-left:16px;padding-right:4px;align-items:center;left:0;right:0;height:32px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .language-select{font-size:14px;color:#999;cursor:pointer;display:flex;align-items:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .language-select .arrow-icon{width:16px;height:16px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-spacer{flex-grow:1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button{display:flex;justify-content:center;align-items:center;border:none;border-radius:2px;margin-left:4px;padding:0;background:none;outline:none;color:#c1c1c1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button:not(.disabled){cursor:pointer}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button:not(.disabled):hover{color:#5587f0}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button.disabled{cursor:not-allowed}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button[data-id=caption]{margin-right:4px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button .button-icon{height:24px;display:flex;align-items:center;justify-content:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button .button-icon>svg{width:24px;height:24px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button .button-label{margin-left:4px;font-size:14px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-tools] .code-block-header .code-header-button[data-id=caption]{display:none}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block.full-selected>div[data-type=block-content]>div.editor-code-root>div.code-text-root{background-color:unset}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root{background-color:var(--background-code)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container]{padding-left:32px;padding-top:32px;padding-bottom:24px;border-radius:4px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container].selected{background-color:var(--background-selection)}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] *{font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:14px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block+div.text-block{margin-top:4px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block:before{content:counter(code-line);counter-increment:code-line;position:absolute;left:-48px;top:10px;z-index:1;margin-top:-4px;display:block;width:48px;padding-right:8px;text-align:right;color:#aaa;box-sizing:border-box;font-size:12px;font-weight:400;line-height:12px;letter-spacing:0;white-space:nowrap;opacity:1}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-comment,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-prolog,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-doctype,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-cdata{color:#708090}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-punctuation{color:#999}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-namespace{opacity:.7}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-property,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-tag,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-boolean,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-number,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-constant,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-symbol,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-deleted{color:#905}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-selector,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-attr-name,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-string,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-char,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-builtin,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-inserted{color:#690}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-operator,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-entity,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-url,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-string{color:#9a6e3a}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-atrule,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-attr-value,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-keyword{color:#07a}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-function,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-class-name{color:#dd4a68}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-regex,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-important,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-variable{color:#e90}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-important,.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-bold{font-weight:700}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-italic{font-style:italic}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-text-root>div.child[data-type=editor-container] div.text-block>div[data-type=block-content] span.style-code-entity{cursor:help}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-caption-root{padding:8px}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block>div[data-type=block-content]>div.editor-code-root>div.code-caption-root *{color:#aaa}div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .code-header-button[data-id=wrap],div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .code-header-button[data-id=caption]{display:none}div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .language-select{cursor:default!important}div.editor-root.readonly .container-blocks div[data-block-type=code] div[data-type=block-tools] .code-block-header .language-select .arrow-icon{display:none}div.editor-root div.editor-content div[data-type=editor-container].root.select-all div[data-type=block-content]>div.editor-code-root>div.code-text-root{background-color:unset}div.comment-editor-root [data-type=editor-container].root div[data-type=editor-block].code-block{min-width:0}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=center] [data-type=block-content][data-content-placeholder]:before{justify-content:center}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=right] [data-type=block-content][data-content-placeholder]:before{justify-content:right}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-title-placeholder]:before{position:absolute;left:0;top:0;right:0;bottom:0;content:attr(data-title-placeholder);color:#c7c7c7}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-content-placeholder]:before{position:absolute;left:0;top:0;right:0;bottom:0;content:attr(data-content-placeholder);color:#c7c7c7;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center}div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-tools] .block-placeholder-container{position:absolute;left:0;top:0;right:0}div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-title-placeholder]:before{position:absolute;left:0;top:0;right:0;bottom:0;content:attr(data-title-placeholder-readonly);color:#c7c7c7}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer{position:absolute;background-color:transparent;border:1px solid #338FE5;pointer-events:none;z-index:1;display:none}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer.active{display:block}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper{position:absolute;width:16px;height:16px;border:2px solid white;background-color:#338fe5;border-radius:50%;pointer-events:all}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom{left:calc(50% - 8px);bottom:-8px;cursor:ns-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-left{left:-8px;top:-8px;cursor:nwse-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-right{right:-8px;top:-8px;cursor:nesw-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-left{left:-8px;bottom:-8px;cursor:nesw-resize}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-right{right:-8px;bottom:-8px;cursor:nwse-resize}div.editor-root.readonly div.editor-content div[data-type=editor-block]>[data-type=block-tools] .block-resizer{display:none}.before-content,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content] .images .image-container.active:before,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected:not(.focused) [data-type=block-content] .images .image-container:before{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#338fe5;opacity:.1}.editor-root.readonly div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter{visibility:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image]{display:flex}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].block-hidden{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image][data-style-align=left]{justify-content:flex-start}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image][data-style-align=center]{justify-content:center}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image][data-style-align=right]{justify-content:flex-end}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].hover [data-type=block-content]{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].hover [data-type=block-content] .images .image-container.empty:hover,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].hover [data-type=block-content] .images .image-container.error:hover{outline:1px solid #338fe5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content]:before{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content]{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content] .images .image-container.active .image-warning{opacity:0;z-index:-1}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].multi [data-type=block-tools] .block-resizer{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image]:not(.multi) [data-type=block-content] .images.empty{min-height:400px}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content]{cursor:default}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images{width:100%;display:flex;align-items:flex-start}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter{width:10px;flex-grow:0;flex-shrink:0;padding:0 4px;cursor:col-resize;height:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter .image-splitter-indicator{width:100%;height:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter:active .image-splitter-indicator,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-splitter:hover .image-splitter-indicator{background-color:#d9d9d9}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container{position:relative;flex:1;background-color:#f8f8f8;display:flex;min-height:inherit;overflow:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container img{max-width:100%;width:100%;height:auto}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.empty .upload-image-icon{display:flex;color:#c7c7c7}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.error{height:100%;outline:1px solid #dedede;border-radius:3px}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.error img{display:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;z-index:1}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-icon,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-icon{display:flex;color:#c7c7c7}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message{display:flex;flex-direction:column;align-items:center;overflow:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-1,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-1{margin-top:10px;font-size:18px;font-weight:500;color:#303030;height:26px;vertical-align:middle;line-height:26px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-2,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-3,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-2,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-3{font-size:14px;color:#606060;vertical-align:middle;height:22px;line-height:22px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-2 a,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .error-message .line-3 a,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-2 a,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .upload-error .error-message .line-3 a{text-decoration:none;color:#338fe5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .line-3 a{display:inline-flex;align-items:center;text-decoration:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .load-error .line-3 a:after{content:" ";display:inline-block;width:16px;height:16px;margin-left:5px;background-image:url("data:image/svg+xml,%3Csvg width='17' height='16' viewBox='0 0 17 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 2H3.5C2.94772 2 2.5 2.44772 2.5 3V13C2.5 13.5523 2.94772 14 3.5 14H13.5C14.0523 14 14.5 13.5523 14.5 13V10' stroke='%23338FE5'/%3E%3Cpath d='M14.5 2L9 7.5' stroke='%23338FE5'/%3E%3Cpath d='M8.5 2H14.5V8' stroke='%23338FE5'/%3E%3C/svg%3E%0A")}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .uploading-progress-mask{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#303030;opacity:.8;display:flex;align-items:center;justify-content:center}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .uploading-progress-mask .uploading-progress-bar{width:75%;height:6px;border-radius:3px;display:flex;background-color:#fff}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .uploading-progress-mask .uploading-progress-bar .uploading-progress-bar-value{background-color:#338fe5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container .image-warning{position:absolute;right:5px;top:5px;color:#fff;background-color:#333;width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:3px;z-index:2;transition:opacity linear .2s;opacity:.7}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.empty{display:flex;flex-direction:column;align-items:center;outline:1px solid #dedede;border-radius:3px;justify-content:center;height:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container.empty svg{width:48px;height:48px}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-tools] .drag-container{display:flex;box-sizing:content-box;pointer-events:none;position:fixed;z-index:100;background-color:#fff;border:1px solid #338fe5}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-tools] .drag-container .drag-target{width:100%}.editor-root[readonly=true] .image-splitter{visibility:hidden}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment{box-shadow:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment [data-type=block-content]{box-shadow:0 2px #f8e6ab}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment.active{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].comment.active [data-type=block-content]{box-shadow:none;outline:4px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block].dragging div[data-type=block-tools] .block-helper{opacity:0}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper{position:absolute;right:100%;top:0;padding-right:5px;display:flex;align-items:center}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .helper-sizer{width:0;opacity:0;pointer-events:none}div[data-type=editor-block].block-exclusive:after{content:attr(data-exclusive-tips);position:absolute;top:0px;left:0px;width:100%;background:#f8f8f8;border-radius:var(--editor-border-radius);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:22px;color:#909090;text-align:center;padding:9px 0;z-index:1000}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self>[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others>[data-type=block-content]{position:relative}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others>[data-type=block-content]:after{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;z-index:1;background-color:#303030;opacity:.1}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self.text-block>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self.locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others.text-block>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others.locked-by-self>[data-type=block-content]:after{pointer-events:none}.editor-root:not(.readonly) div[data-type=editor-block].locked-by-self.text-block>[data-type=block-content]:after,.editor-root:not(.readonly) div[data-type=editor-block].locked-by-others.text-block>[data-type=block-content]:after{outline:2px solid #303030}.editor-root{--selected-color: #e8e8e8}.editor-root .editor-content.dragging *{cursor:grabbing!important}.editor-root .editor-content.dragging div[data-type=editor-block] iframe{pointer-events:none}.editor-root .editor-content .editor-drop-indicator{position:absolute;background-color:var(--primary-color);pointer-events:none;transition:top .2s linear,left .2s linear,width .2s linear}.editor-root .editor-content div[data-type=editor-block].text-block.highlighted{outline:2px solid var(--background-selection);background-color:var(--background-selection)}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button{width:24px;height:24px;cursor:pointer;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;border-radius:3px}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button[data-type=move]{cursor:grab}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button:hover{background-color:var(--selected-color)}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .block-button svg{width:16px;height:16px;color:#909090}.drag-image-container{position:fixed;z-index:100;box-shadow:0 3px 20px #00000026;background-color:#fff;opacity:.4}.drag-image-container.drag-placeholder{width:500px;height:200px;border:1px solid #dedede;border-radius:3px;background:#e8e8e8}.drag-image-container .drag-image{width:100%;display:none}.drag-image-container[data-status=loaded] .drag-image{display:block}.drag-image-container[data-status=loaded] .drag-loading{display:none}.editor-command-bar-root .editor-command-bar .command-item.menu-item{display:flex;align-items:center;flex:none}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles{padding:5px 10px;background-color:#fff}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section+.text-style-section{margin-top:5px}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section{display:grid;grid-template-columns:repeat(7,24px);grid-row-gap:10px;grid-column-gap:5px}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section .style-icon{height:24px;padding:0;margin:0;display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;outline:none;cursor:pointer;border-radius:3px;color:#606060}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section .style-icon:hover{background-color:var(--selected-color)}.editor-command-bar-root .editor-command-bar .command-item.menu-item .text-styles .text-style-section .style-icon.active{color:#338fe5}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-anchor[data-id=paste-special-button-anchor]{z-index:unset}[data-command-bar-id=paste-special-button] .editor-command-bar.toolbar{padding:0}[data-command-bar-id=paste-special-button] .editor-command-bar.toolbar .command-item[data-dropdown=true]{padding-left:5px;padding-right:5px}.editor-find-dialog{--popover-input-border: 1px solid #CFD6E1;--editor-find-dialog-input-container-border-color: #CFD6E1;--editor-find-dialog-input-container-bg-color: transparent;--editor-border-radius-big: 3px;--editor-color: #07142A;--button-black-text-color: #333;--editor-find-dialog-button-color: #333;--editor-find-dialog-icon-button-color: #333;--editor-find-dialog-button-border-bg-color: rgba(255, 255, 255, .56);--editor-find-dialog-input-placeholder-color: #b9bfc8;--editor-find-dialog-button-disabled-color: #ccc !important;--editor-find-dialog-button-hover-color: rgba(150, 150, 150, .2);--editor-find-dialog-button-border: solid 1px #ccc;box-sizing:border-box;width:400px;background-color:var(--editor-find-dialog-bg-color);border:var(--editor-find-dialog-border);border-radius:var(--editor-border-radius-big);display:flex;padding:8px 8px 0 16px;align-items:flex-start;font-size:14px;font-family:var(--editor-font-family)}.editor-find-dialog .editor-find-content{display:flex;flex-direction:column;flex-grow:1;font-family:inherit}.editor-find-dialog .editor-find-dialog-row{display:flex;margin-bottom:8px;align-items:center}.editor-find-dialog .editor-find-dialog-label{width:80px;flex-grow:0;flex-shrink:0;align-self:center}.editor-find-dialog .editor-find-dialog-input-container{border:var(--popover-input-border);border-color:var(--editor-find-dialog-input-container-border-color);background-color:var(--editor-find-dialog-input-container-bg-color);border-radius:var(--editor-border-radius-big);flex-grow:1;display:flex;padding:2px;align-items:center;height:32px;box-sizing:border-box}.editor-find-dialog .editor-find-dialog-input{border:none;flex-grow:1;width:80px;outline:none;background-color:transparent;color:var(--editor-color)}.editor-find-dialog .editor-find-dialog-input::placeholder{color:var(--editor-find-dialog-input-placeholder-color);opacity:1}.editor-find-dialog .editor-find-dialog-prev{width:24px}.editor-find-dialog .editor-find-dialog-curr{flex-grow:0;text-align:center;flex-shrink:1;display:flex;align-items:center;margin-bottom:2px}.editor-find-dialog .editor-find-dialog-next{width:24px}.editor-find-dialog .editor-find-dialog-icon-button{cursor:pointer;border-radius:4px;color:var(--editor-find-dialog-icon-button-color);background-color:var(--editor-find-dialog-button-border-bg-color);border:none;display:flex;padding:0}.editor-find-dialog .editor-find-dialog-button{padding:6px 16px;cursor:pointer;border-radius:4px;color:var(--editor-find-dialog-button-color);background-color:var(--editor-find-dialog-button-border-bg-color);margin:0 4px;border:none;font-family:inherit;line-height:21px}.editor-find-dialog .editor-find-dialog-button.icon-button{width:32px;height:32px}.editor-find-dialog .editor-find-dialog-button.active,.editor-find-dialog .editor-find-dialog-button:hover{background-color:var(--editor-find-dialog-button-hover-color)}.editor-find-dialog .editor-find-dialog-button:disabled{color:var(--editor-find-dialog-button-disabled-color);cursor:default}.editor-find-dialog .editor-find-dialog-button:disabled:hover{background-color:transparent}.editor-find-dialog .editor-find-dialog-button svg{fill:currentColor}.editor-find-dialog .editor-find-dialog-space{flex-grow:1}.editor-find-dialog .editor-find-dialog-icon-button-border{margin:0 0 0 8px;cursor:pointer;border-radius:4px;color:var(--button-black-text-color);border:var(--editor-find-dialog-button-border);background-color:var(--editor-find-dialog-button-border-bg-color);padding:0;width:32px;display:flex;justify-content:center;align-items:center}.editor-find-dialog .editor-find-dialog-button-close{margin:0 0 0 8px;cursor:pointer;border-radius:4px;color:var(--button-black-text-color);background-color:var(--editor-find-dialog-button-border-bg-color);border:none;padding:0;width:32px;height:32px;display:flex;justify-content:center;align-items:center}.editor-find-dialog .editor-find-dialog-icon-button-border svg,.editor-find-dialog .editor-find-dialog-button-close svg{fill:currentColor}.editor-find-dialog .editor-highlight{opacity:.6;pointer-events:none}.editor-find-dialog .editor-highlight .editor-highlight-child{position:absolute;background-color:bisque}.editor-find-dialog .editor-highlight.active .editor-highlight-child{position:absolute;background-color:tomato}.editor-find-dialog .editor-search-result-highlight{opacity:.6;pointer-events:none}.editor-find-dialog .editor-search-result-highlight .editor-highlight-child{position:absolute;background-color:#40e0d0}.editor-find-dialog .editor-find-dialog-status{display:flex}.editor-highlight{opacity:.6;pointer-events:none}.editor-highlight .editor-highlight-child{position:absolute;background-color:bisque}.editor-highlight.active .editor-highlight-child{position:absolute;background-color:tomato}.editor-search-result-highlight{opacity:.6;pointer-events:none}.editor-search-result-highlight .editor-highlight-child{position:absolute;background-color:#40e0d0}.editor-find-dialog-status{display:flex}.comment-editor{font-size:14px;border:1px solid #c7c7c7;border-radius:3px;padding:1px 10px;margin:6px 10px 0}.comment-editor:after{content:"";height:0;display:block;clear:both}.comment-editor-root{display:inline-block;min-width:calc(100% - 40px);padding-top:2px}.comment-editor-root div.editor-root div.editor-content{padding:0}.comment-editor-root div.editor-root div.editor-content>div[data-type=editor-container].root>div.container-blocks>*+*{margin-top:0}.comment-editor-img{float:right;color:#c1c1c1;padding:0;margin-top:2px;width:24px;height:24px;justify-content:center}.comment-editor-root:not(.comment-editor-readonly) .editor-root .editor-content [data-type=editor-block]:not([data-block-type=text]){width:248px}.comment-editor-editing{border:1px solid #338fe5}.comment-editor-readonly{border:none;padding-left:37px;margin:0}.comment-editor-readonly .comment-editor-img{display:none}.comment-item-root{position:relative;margin-top:10px}.comment-item-root:not(.last-comment-item):before{content:" ";display:block;position:absolute;left:20px;width:1px;background-color:var(--editor-border-color, #e8e8e8);overflow:hidden;opacity:.8;top:21px;bottom:-12px;transform:scaleX(.5)}.comment-item-root .item-head{padding:0 10px;position:relative;display:flex;align-items:center}.comment-item-root .item-head-avatar{margin-right:5px;width:var(--editor-comment-avatar-width, 21px);height:var(--editor-comment-avatar-width, 21px);border-radius:100%}.comment-item-root .item-head-avatar-string{display:flex;align-items:center;justify-content:center;font-size:12px;color:#fff;background-color:var(--comment-avatar-color);flex-shrink:0}.comment-item-root .item-head-username{font-size:var(--editor-comment-username-font-size, 12px);color:var(--editor-comment-username-color, #07142a);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-item-root .item-head-modified{margin-left:8px;font-size:12px;color:var(--editor-comment-modified-color, #808080);flex-grow:1;white-space:nowrap}.comment-item-root .item-head-tools{display:flex;align-items:center;visibility:hidden}.comment-item-root .item-head-tools .editor-text-button svg{width:20px;height:20px}.comment-item-root .item-head-tools.active{visibility:visible}.comment-item-root .item-actions{margin-top:10px;display:flex;justify-content:flex-end;padding:0 10px}.comment-item-root .item-actions.hidden{display:none}.comment-item-root:hover:not(.comment-item-editing) .item-head-tools{visibility:visible}.comment-item-root.readonly .item-head-tools{display:none}.mobile-comment-item{margin-top:4px;background-color:var(--editor-comment-layer-bg-color);padding-bottom:20px;color:var(--editor-comment-username-color)}.mobile-comment-item .item-head{padding:12px;display:flex;align-items:center}.mobile-comment-item .item-head-avatar{width:var(--editor-comment-avatar-size);height:var(--editor-comment-avatar-size);flex-grow:0}.mobile-comment-item .item-head-username{margin-left:12px}.mobile-comment-item .item-head-modified{margin-left:12px;color:#999}.mobile-comment-item .item-editor .comment-editor-readonly{padding-left:18px}.mini-comment-item{position:relative;line-height:16px;width:20px;height:16px;text-align:center;font-size:12px;border-radius:1px;background-color:var(--editor-comment-active-color, #FFC328);color:var(--editor-comment-mini-text-color, #ffffff);cursor:pointer}.mini-comment-item:after{content:"";position:absolute;left:50%;bottom:-4px;width:6px;height:6px;background-color:var(--editor-comment-active-color, #FFC328);border-radius:1px;transform:matrix(.71,.61,.82,-.71,0,0) translate(-50%);z-index:-1}.comment-quick-reply .quick-reply-button{position:absolute;left:8px;bottom:3px;z-index:2;color:var(--editor-comment-quick-reply-color, #7084A4);font-size:12px}.comment-quick-reply .quick-reply-button.editor-text-button:hover{color:var(--text-button-color-hover, #5587F0);background-color:var(--text-button-bg-color-hover, transparent)}.comment-quick-reply .quick-reply-editor{display:none}.comment-quick-reply .quick-reply-editor .reply-editor-actions{display:flex;justify-content:flex-end;margin-top:10px;padding:0 10px}.comment-quick-reply.hidden,.comment-quick-reply.reply-editor-editing .quick-reply-button{display:none}.comment-quick-reply.reply-editor-editing .quick-reply-editor{display:block}:root{--editor-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Robot, "Helvetica Neue", Helvetica, Arial, sans-serif;--editor-comment-layer-bg-color:#ffffff;--editor-comment-group-bg-color: #ffffff;--comment-root-border-color: #eaeaea;--editor-comment-layer-active-border-color: #cecece;--editor-box-shadow: 0px 3px 20px rgba(0, 0, 0, .15);--wiz-editor-z-comment-group-active-top-before: 29;--editor-comment-quote-color: #909090;--editor-comment-quote-before-bg-color: #909090;--editor-comment-switch-button-width: 12px;--editor-comment-active-color: #FFC328;--editor-bg-color: #ffffff;--wiz-editor-z-comment-head:11;--text-button-color-hover:#5587f0;--editor-comment-username-color:#07142A;--editor-comment-avatar-size: 32px}.disabled-scroll{overflow:hidden}.editor-root .editor-content div[data-type=editor-block].text-block.comment{box-shadow:none}.editor-root .editor-content div[data-type=editor-block].text-block.comment>div[data-type=block-content]>span{border-bottom:2px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block].text-block.comment.active{box-shadow:none;outline:none}.editor-root .editor-content div[data-type=editor-block].text-block.comment.active>div[data-type=block-content] span{background-color:#f8e6ab}.editor-root .editor-content div[data-type=editor-block] span.text.comment{border-bottom:2px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block] span.text.comment.active{background-color:#faf1d1}.editor-root .editor-content div[data-type=editor-block].comment{box-shadow:0 2px #f8e6ab}.editor-root .editor-content div[data-type=editor-block].comment.active{box-shadow:none;outline:4px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-comment-button{all:unset;position:absolute;right:-28px;top:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;padding:0;border-radius:3px;color:#07142a;cursor:pointer}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-comment-button:hover{background:#eaeaea}.editor-web-comment-root{position:absolute;right:0;width:300px;top:0;bottom:0;transition:width .16s ease-in;will-change:width;font-family:var(--editor-font-family)}.editor-web-comment-root .comment-groups-container .comment-group-item-root{position:absolute;left:50%;right:0;width:290px;transform:translate(-50%);background-color:var(--editor-comment-group-bg-color);border-radius:2px;border-color:var(--editor-comment-layer-active-border-color);box-shadow:var(--editor-box-shadow);padding-bottom:18px}.editor-web-comment-root .comment-groups-container .comment-group-item-root:not(.no-animation){transition:top .2s ease-in,opacity .35s ease-in}.editor-web-comment-root .comment-groups-container .comment-group-item-root:before{content:"";position:absolute;left:0;right:0;height:6px;background-color:#fff;border-radius:2px 2px 0 0;z-index:var(--wiz-editor-z-comment-group-active-top-before)}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head{display:flex;align-items:center}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-quote{box-sizing:content-box;font-size:12px;line-height:12px;height:12px;color:var(--editor-comment-quote-color);padding:18px 12px 10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%;max-width:calc(100% - 80px)}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-quote:before{content:"";display:block;width:2px;height:100%;background-color:var(--editor-comment-quote-before-bg-color);margin-right:6px;float:left;border-radius:10px}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch{display:flex;align-items:center;height:22px;padding-top:6px;visibility:hidden}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button{padding:0;width:var(--editor-comment-switch-button-width);margin:3px 0;color:#606060}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=switch-up]{margin-right:16px}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button:not(.disabled):hover{color:var(--text-button-color-hover)}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button.disabled{color:#60606080;cursor:not-allowed}.editor-web-comment-root .comment-groups-container .comment-group-item-root.active:before{background-color:var(--editor-comment-active-color)}.editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch{visibility:visible}.editor-web-comment-root .comment-groups-container .comment-group-item-root.readonly .comment-quick-reply{display:none}.editor-mobile-comments-root{position:fixed;left:0;right:0;bottom:0;top:0;overflow:hidden;z-index:11}.editor-mobile-comments-root .mobile-comment-mask{position:absolute;left:0;right:0;bottom:0;top:0;background-color:#00000073}.editor-mobile-comments-root .mobile-comment-groups-container{position:absolute;width:100%;height:100vh;z-index:1;overflow:hidden}.editor-mobile-comments-root .mobile-comment-groups-container .mobile-comment-groups-scroll-container{padding:0 12px}.editor-mobile-comments-root .mobile-comment-pull-info-container{position:absolute;right:0;left:0;bottom:100px;z-index:2;text-align:center;display:none}.editor-mobile-comments-root .mobile-comment-pull-info-container .mobile-comment-pull-info{display:inline-block;padding:12px;border-radius:36px;margin:0 auto;background-color:#000c;color:#fff;font-size:12px;opacity:0;transition:opacity .25s cubic-bezier(.65,.05,.36,1)}.editor-mobile-comments-root .mobile-comment-pull-info-container.active{display:block}.editor-mobile-comments-root .mobile-comment-pull-info-container.active .mobile-comment-pull-info{opacity:1}.editor-mobile-comments-root .mobile-group-item-root{margin:0 auto;width:100%;height:100vh;overflow:hidden}.editor-mobile-comments-root .mobile-group-item-root .mobile-group-item{min-height:calc(100vh + 1px);padding-bottom:50px}.editor-mobile-comments-root .mobile-group-item-root .mobile-group-item-space{height:50vh}.editor-mobile-comments-root .mobile-group-item-root .mobile-group-item-abstract{background-color:var(--editor-comment-layer-bg-color);padding:12px;color:#999;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editor-mini-comment-root{position:absolute;right:0;top:0;bottom:0;width:48px;border-left:1px solid #f0f0f0;transition:width .16s ease-in;will-change:width;font-family:var(--editor-font-family);border:none;background-color:transparent;z-index:11}.editor-mini-comment-root .comment-groups-container{width:100%;height:100%}.editor-mini-comment-root .comment-groups-container .mini-group-item{position:absolute;top:0;left:50%;margin-left:-10px;transition:top .2s cubic-bezier(.65,.05,.36,1)}:is(.editor-web-comment-root,.editor-mobile-comments-root,.editor-mini-comment-root).hidden{display:none}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=file] span[data-type=box-content]{margin:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=file] span[data-type=box-content] span.file-icon{color:#5587f0;display:inline-flex;vertical-align:text-bottom}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=file] span[data-type=box-content] .file-name{color:var(--primary-color);padding:0;border-radius:12px;margin-right:4px;white-space:wrap;word-break:break-all;cursor:pointer}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office]{justify-content:start}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office].hover [data-type=block-content]{border-radius:3px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content]{max-width:360px;min-width:360px;height:48px;cursor:pointer}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root{display:flex;align-items:center;min-width:360px;max-width:100%;background-color:#f5f6f7;border-radius:3px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root:before{border-radius:3px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details{display:flex;flex-direction:column;justify-content:center;font-size:14px;flex-grow:1}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name{color:#1f2329;max-width:185px;display:flex;flex-direction:row;align-items:center;white-space:nowrap}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-size{color:#646a73;font-size:12px;margin-top:2px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name-pre{text-overflow:ellipsis;overflow:hidden}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button{width:34px;height:34px;background-color:#fff;border:1px solid #dee0e3;border-radius:50%;margin:0 8px;padding:0;background-repeat:no-repeat;background-position:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button svg{width:16px;height:16px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-icon{display:flex;width:36px;height:36px;margin:6px 6px 6px 12px}div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-icon>svg{width:100%;height:100%}:root{--editor-version-button-border: black;--editor-bg-color: #ffffff;--editor-version-list-bg-color: white;--editor-version-select-bg-color: #F5F9FD}.version-dialog{display:flex;background-color:var(--editor-bg-color);width:100%;height:100%;color:var(--editor-color)}.version-dialog *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;box-sizing:border-box}.version-dialog.loading .version-viewer .version-info-container{display:none}.version-dialog .version-loading{display:flex;flex:1;align-items:center;justify-content:center}.version-dialog .version-loading svg{width:28px;height:28px}.version-dialog .version-item-latest{color:#338fe5;background-color:#eaf3fc;height:20px;padding:0 5px;border-radius:3px;display:inline-flex;align-items:center;font-size:12px;font-weight:400;margin-left:10px}.version-dialog .version-viewer{flex:1;display:flex;flex-direction:column;width:0;padding:0}.version-dialog .version-viewer .version-dialog-editor{display:flex;flex-grow:1;overflow-y:auto}.version-dialog .version-viewer .version-info-container{height:50px;border-bottom:#E8E8E8 1px solid;display:flex;align-items:center;flex-shrink:0;padding-left:20px;font-size:14px;color:#303030}.version-dialog .version-viewer .version-info-container .version-info-right .text-3{color:#909090}.version-dialog .version-viewer .version-info-container .version-info-left{display:flex;align-items:center}.version-dialog .version-viewer .version-info-container .version-info-left .text-1,.version-dialog .version-viewer .version-info-container .version-info-left .text-2{color:#909090}.version-dialog .version-viewer .version-info-container .version-info-left .name{padding-left:5px;padding-right:10px;font-weight:500}.version-dialog .version-viewer .version-info-container .version-info-left .name .version-item-latest{margin-left:5px}.version-dialog .version-viewer .version-info-container .editor-dropdown{margin-left:10px;margin-right:10px}.version-dialog .version-viewer .version-info-container .command-item[data-id=current-version]{min-width:200px;border:1px solid #f0f0f0}.version-dialog .version-viewer .version-info-container .command-item[data-id=current-version] .toolbar-item-name-container{flex-grow:1}.version-dialog .version-viewer .dialog-button-text{margin-top:1px;margin-left:-4px}.version-dialog .version-viewer .dialog-text-button{outline:none;background:transparent;border:none;display:flex;align-items:center;color:var(--editor-color);font-size:16px;font-weight:500;padding:4px 0;cursor:pointer}.version-dialog .version-viewer .dialog-text-button .dialog-button-icon{margin-right:0;width:24px;height:24px}.version-dialog .version-viewer .dialog-text-button .dialog-button-icon svg{fill:currentColor}.editor-root.history .root-container .editor-block .text-element .inline-plugin.editor-box-loading{display:none}.editor-root.history .editor-content{padding:30px 75px}.editor-root.history .history-inserted-block[data-type=editor-block] [data-type=block-content]{border:4px solid var(--op-selected-color)}.editor-root.history .history-inserted-block[data-type=editor-block]{position:relative}.editor-root.history .history-inserted-block[data-type=editor-block]:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-inserted-block[data-type=editor-block].table-block table{border:4px solid var(--op-selected-color)}.editor-root.history .history-inserted-block[data-type=editor-block].table-block table .child{pointer-events:none}.editor-root.history .history-inserted-block[data-type=editor-block].table-block{position:relative}.editor-root.history .history-inserted-block[data-type=editor-block].table-block:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-inserted-block[data-type=editor-block].table-block:hover:after{top:0}.editor-root.history .history-deleted-block [data-type=block-content]{border:4px solid var(--op-selected-color)}.editor-root.history .history-deleted-block [data-type=block-content]{position:relative}.editor-root.history .history-deleted-block [data-type=block-content]:after,.editor-root.history .history-deleted-block [data-type=block-content]:before{content:" ";position:absolute;display:flex;z-index:var(--wiz-editor-z-history-delete-marker);color:var(--op-color);justify-items:center;align-items:center;justify-content:center;align-content:center;pointer-events:none;overflow:visible;max-width:100%;max-height:100%;left:calc(50% - 16px);top:calc(50% - 2px);width:32px;height:4px;background-color:var(--op-color);transform:rotate(45deg);opacity:1}.editor-root.history .history-deleted-block [data-type=block-content]:before{transform:rotate(135deg)}.editor-root.history .history-deleted-block{position:relative}.editor-root.history .history-deleted-block:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-deleted-block .history-deleted-box{background-color:unset!important;text-decoration:unset!important}.editor-root.history .history-deleted-block .history-deleted-box:hover:after{opacity:0}.editor-root.history .history-inserted-text{line-height:revert!important;background-color:var(--op-selected-color)}.editor-root.history .history-inserted-text{position:relative}.editor-root.history .history-inserted-text:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history .history-deleted-box{background-color:var(--op-selected-color);text-decoration:line-through}.editor-root.history .history-deleted-box{position:relative}.editor-root.history .history-deleted-box:hover:after{content:attr(data-op-description);position:absolute;top:-26px;left:0;line-height:24px;background-color:var(--op-color);min-width:20px;opacity:1;color:#fff;padding:0 8px;z-index:var(--wiz-editor-z-history-op-description, 10);font-size:14px;font-weight:400;white-space:nowrap;border-radius:3px}.editor-root.history [data-box-type=history-deleted-box]>span[data-type=box-content]{border:none!important;margin:0!important}.editor-root.history [data-type=editor-block].table-block div[data-type=block-content]{overflow-x:revert}.editor-dialog-root{position:absolute;left:0;top:0;bottom:0;right:0;background-color:#639;z-index:100}.size-limit-textarea{display:inline-block;position:relative}.size-limit-textarea .size-limit-textarea-input{width:100%;resize:none;overflow:hidden;color:#303030;outline:none;border:1px solid #f0f0f0;border-radius:3px}.size-limit-textarea .size-limit-textarea-input:focus,.size-limit-textarea .size-limit-textarea-input:hover{border-color:#338fe5}.size-limit-textarea .size-limit-textarea-input:focus{box-shadow:0 0 0 2px #338fe533}.size-limit-textarea .size-limit-textarea-warning{position:absolute;right:0;bottom:10px;color:#909090;z-index:1;font-size:12px;pointer-events:none}.version-list-root{width:350px;background:var(--editor-version-list-bg-color);overflow-y:auto;padding:0;border-left:#E8E8E8 1px solid;display:flex;flex-direction:column}.version-list-root .version-list-header{padding:0 6px 0 20px;font-size:14px;display:flex;align-items:center;margin-top:8px;margin-bottom:8px;flex-shrink:0;color:#909090}.version-list-root .version-list-header .version-count{flex-grow:1}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item{cursor:pointer}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item:not(.disabled):hover{color:#338fe5}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item.selected:not(.disabled){background-color:transparent}.version-list-root .version-list-empty{height:100%;display:flex;align-items:center;justify-content:center;font-size:14px;color:#909090}.version-list-root .version-list-content{flex-grow:1;overflow-y:auto}.version-list-root .version-list-content .version-item{padding:15px 10px;cursor:pointer}.version-list-root .version-list-content .version-item:not(:last-child):after{content:"";display:block;position:relative;top:15px;border-bottom:1px solid #E8E8E8}.version-list-root .version-list-content .version-item:not(:last-child):hover:after,.version-list-root .version-list-content .version-item:not(:last-child).active:after{left:-10px;width:106%}.version-list-root .version-list-content .version-item.child{padding-left:32px}.version-list-root .version-list-content .version-item:not(.active):hover{background:#F8F8F8}.version-list-root .version-list-content .version-item.active{background-color:var(--editor-version-select-bg-color)}.version-list-root .version-list-content .version-item.active .version-item-title .version-actions{display:flex}.version-list-root .version-list-content .version-item.active .version-item-title .version-item-date{color:#338fe5}.version-list-root .version-list-content .version-item.editing .version-item-memo{display:none}.version-list-root .version-list-content .version-item.active .version-item-memo{cursor:text}.version-list-root .version-list-content .version-item.active .version-item-memo:hover{outline:1px solid #338FE5}.version-list-root .version-list-content .version-item .version-item-restore-from{color:#909090;font-size:12px;line-height:1.5em;height:20px;padding:0 10px 10px}.version-list-root .version-list-content .version-item .version-item-restore-from:empty{display:none}.version-list-root .version-list-content .version-item .memo-input.size-limit-textarea{width:100%;min-height:60px;display:flex}.version-list-root .version-list-content .version-item .memo-input.size-limit-textarea textarea{padding:4px 10px;box-sizing:border-box;font-size:14px}.version-list-root .version-list-content .version-item .version-item-title{display:flex;align-items:center;padding-left:10px;padding-right:10px;height:24px}.version-list-root .version-list-content .version-item .version-item-title .version-item-date{font-size:14px;font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#303030}.version-list-root .version-list-content .version-item .version-item-title .spacer{flex-grow:1}.version-list-root .version-list-content .version-item .version-item-title .version-actions{display:none}.version-list-root .version-list-content .version-item .version-item-title .version-actions button{display:flex;align-items:center;justify-content:center;height:16px;cursor:pointer;border:none;outline:none;background:transparent;padding:0 0 0 10px;color:#909090}.version-list-root .version-list-content .version-item .version-item-title .version-actions button:hover{color:#338fe5}.version-list-root .version-list-content .version-item .version-item-title .version-actions button.disabled,.version-list-root .version-list-content .version-item .version-item-title .version-actions button.disabled:hover{color:#c7c7c7}.version-list-root .version-list-content .version-item .version-item-title .version-actions .revert-button{border-left:1px solid #E8E8E8;margin-left:10px}.version-list-root .version-list-content .version-item .version-item-authors{list-style:none;margin:0;font-size:12px;padding-left:10px}.version-list-root .version-list-content .version-item .version-item-author{display:flex;align-items:center;margin-top:10px;color:#606060}.version-list-root .version-list-content .version-item .version-item-author-mark{width:6px;height:6px;border-radius:3px;margin-right:5px}.version-list-root .version-list-content .version-item .version-item-memo{font-size:14px;color:#303030;padding:5px 10px;border-radius:3px}.version-list-root .version-list-content .version-item .version-item-memo:empty{display:none}.versions-dropdown-header{color:var(--text-color);padding:10px;border-bottom:1px solid #f0f0f0}.versions-dropdown-header .versions-dropdown-header-info{color:#909090}.versions-dropdown-header .versions-dropdown-header-icon{display:inline-flex;vertical-align:middle;height:19px;padding-left:5px;padding-right:5px;cursor:pointer;color:#909090}.versions-dropdown-header .versions-dropdown-header-icon svg{vertical-align:baseline}.editor-command-bar.menu .command-item.standard[data-id=prev-version]{height:44px}[data-command-bar-id=versions-dropdown-popup]{width:320px}[data-command-bar-id=versions-dropdown-popup] .tippy-box{color:var(--text-color)}[data-command-bar-id=versions-dropdown-popup] .tippy-box .version-item-empty{width:100%}[data-command-bar-id=versions-dropdown-popup] .tippy-box .version-item-name{color:var(--text-color)}[data-command-bar-id=versions-dropdown-popup] .tippy-box .editor-command-bar.menu .command-item.standard.disabled{color:#909090}[data-command-bar-id=versions-dropdown-popup] .tippy-box .editor-command-bar{--text-color: #303030}[data-command-bar-id=versions-dropdown-popup] .tippy-box .editor-command-bar.menu .command-item.section{padding:0;font-size:inherit;color:inherit}[data-command-bar-id=versions-dropdown-popup] *{box-sizing:border-box}[data-command-bar-id=versions-dropdown-popup] .editor-command-bar-header{width:100%;margin-bottom:5px}[data-command-bar-id=versions-dropdown-popup] .command-item{width:100%;cursor:pointer}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container{padding:6px 10px;width:100%}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container .version-item-memo{font-size:12px;color:#909090;line-height:20px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container .version-item-line1{line-height:22px;display:flex;align-items:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-container .version-item-line1 .version-item-latest{color:#338fe5;background-color:#eaf3fc;height:20px;padding:0 5px;margin-left:10px;border-radius:3px;font-size:12px;display:inline-flex;align-items:center}[data-command-bar-id=versions-dropdown-popup] .command-item .version-item-empty{display:flex;height:34px;color:#909090;padding-left:10px;justify-content:left;align-items:center}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item{width:100%}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-info{height:24px;color:#909090;display:flex;align-items:center;padding-left:10px;background-color:#f8f8f8;width:100%;box-sizing:border-box;margin:5px 0}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container{height:34px;display:flex;align-items:center;padding-left:10px;color:#303030}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container .editor-checkbox-wrapper{margin-right:4px}.editor-root.readonly .editor-content div[data-type=editor-block].focused div[data-type=block-tools] .block-helper .heading-marker,.editor-root.readonly .editor-content div[data-type=editor-block].highlighted div[data-type=block-tools] .block-helper .heading-marker{display:flex}.editor-root .editor-content div[data-type=editor-block].heading-collapsed div[data-type=block-tools] .block-helper .heading-collapse-button svg{transform:rotate(270deg)}.editor-root .editor-content div[data-type=editor-block].focused div[data-type=block-tools] .block-helper .heading-marker,.editor-root .editor-content div[data-type=editor-block].highlighted div[data-type=block-tools] .block-helper .heading-marker{display:none}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button{width:24px;height:24px;cursor:grab;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;border-radius:3px;box-sizing:content-box}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker:hover,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button:hover{background-color:var(--selected-color)}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker svg,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button svg{transform:rotate(360deg);transition:transform .2s linear}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker svg,.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-collapse-button svg{width:16px;height:16px}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker{color:#c7c7c7}.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-helper .heading-marker:hover{background-color:transparent}.embed-block div[data-type=block-content] .editor-toc-container{display:block;width:100%;background-color:#f0f0f0;padding:20px;text-align:start}.embed-block div[data-type=block-content] .editor-toc-container.loading{margin:0;min-height:100px}.embed-block div[data-type=block-content] .editor-toc-container .toc-node+.toc-node{margin-top:10px}.embed-block div[data-type=block-content] .editor-toc-container .toc-node .toc-text{cursor:pointer;color:var(--primary-color)}.embed-block div[data-type=block-content] .editor-toc-container .toc-node .toc-children{margin-top:10px;padding-left:20px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=mention] span[data-type=box-content]{margin:0}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] [data-box-type=mention] span[data-type=box-content] .mention-name{color:var(--primary-color);padding:0;border-radius:12px;margin-left:4px;margin-right:4px;white-space:wrap;word-break:break-all;cursor:pointer}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-icon{width:20px;height:20px;border-radius:50%;overflow:hidden}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-icon img{width:100%;height:100%}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-icon .mention-user-avatar-string{align-items:center;display:flex;justify-content:center;overflow:hidden;height:100%;width:100%;font-size:12px;color:#fff;flex-shrink:0}[data-command-bar-id=editor-mention] .editor-command-bar.menu .command-item.menu-item .menu-item-name{flex-grow:0;margin-right:5px}.editor-root .editor-templates{position:fixed;bottom:26px;height:256px;width:auto;max-width:100%;padding-left:30px;padding-right:44px;overflow:hidden}.editor-root .editor-templates .editor-templates-title{color:#909090;font-size:14px;margin-left:0;margin-bottom:20px;line-height:19.6px}.editor-root .editor-templates .editor-templates-cards{display:flex;margin-left:0}.editor-root .editor-templates .editor-templates-cards .editor-template-card{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;cursor:pointer;flex-shrink:0;height:192px;width:188px;background:none;border:1px solid #e8e8e8;border-radius:3px;margin:0 0 0 15px;padding:0;align-items:revert}.editor-root .editor-templates .editor-templates-cards .editor-template-card:first-child{margin-left:0}.editor-root .editor-templates .editor-templates-cards .editor-template-card:hover{box-shadow:0 0 1px #30303033,0 8px 16px #30303026}.editor-root .editor-templates .editor-templates-cards .editor-template-card:hover>.editor-template-name{color:#338fe5}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-name{display:flex;align-items:center;height:40px;width:100%;border-top:1px solid #dedede;padding-left:20px;padding-right:20px;flex:0 0 50px;font-size:14px;font-weight:500;line-height:22px;color:#303030}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-name span{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-name{border-top:none}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-name span{padding-left:0;text-align:center}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-thumb-container{display:flex;align-items:center;justify-content:center;padding:16px 39px 14px}.editor-root .editor-templates .editor-templates-cards .editor-template-card.more .editor-template-thumb-container>img{width:110px;height:112px;max-width:revert}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-thumb-container{flex:1;position:relative;padding:10px 5px 0;height:142px;margin:0;overflow:revert}.editor-root .editor-templates .editor-templates-cards .editor-template-card .editor-template-thumb-container>img{max-width:100%}:root div[data-command-bar-id=webpage]>div.tippy-box{max-width:500px}:root div[data-command-bar-id=webpage]>div.tippy-box div.tippy-content{width:500px;padding:0}.editor-dialog-container{width:500px}.editor-dialog-container .dialog-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 20px;height:50px;border-bottom:1px solid #e8e8e8;margin-bottom:20px}.editor-dialog-container .dialog-header .close-icon{display:flex;cursor:pointer}.editor-dialog-container .dialog-header .dialog-header-title{padding:8px 0 11px;font-size:18px;font-weight:700;flex-grow:1}.editor-dialog-container .dialog-content{padding:0 20px 20px;border-bottom:1px solid #e8e8e8}.editor-dialog-container .dialog-footer{margin:10px 0;padding:0 20px;text-align:right}.editor-dialog-container .dialog-footer button{min-height:30px;border-radius:3px;font-size:14px}.editor-disable-scroll.editor-disable-scroll-dark{background-color:#00000080}.embed-block[data-embed-type=webpage]{height:400px;min-height:100px;max-height:1000px}.embed-block[data-embed-type=webpage] .webpage-mask{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1;background-color:transparent}.embed-block[data-embed-type=webpage].resizing [data-type=block-tools] .block-resizer{pointer-events:all!important}.embed-block[data-embed-type=webpage].hover>div[data-type=block-content]{outline:none!important}.embed-block[data-embed-type=webpage].selected>div[data-type=block-content]{outline:none!important}.embed-block[data-embed-type=webpage]>div[data-type=block-content]{justify-content:center;height:100%}.embed-block[data-embed-type=webpage]>div[data-type=block-content]>.editor-embed{width:100%}.embed-block[data-embed-type=webpage]>div[data-type=block-content]>.editor-embed .editor-preview-iframe{width:100%;max-height:500px;height:100%;border:none;position:relative}.embed-block[data-embed-type=webpage]>div[data-type=block-content]>.editor-embed .editor-preview-iframe-loading{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;justify-content:center;align-items:center;background-color:#fff}.webpage-content .help-container{color:#303030;border:1px solid #dedede;padding:10px;border-radius:4px;border-left:4px solid #338fe5;margin-top:16px;margin-bottom:16px}.webpage-content .help-container .help-content{display:flex;align-items:center}.webpage-content .help-container .help-content .help-icon{display:flex;align-items:center;height:20px;color:#338fe5;margin-right:12px}.webpage-content .help-link-container{margin-top:8px;display:flex;align-items:center}.webpage-content .help-link-container .help-link-content{display:flex;align-items:center;color:#338fe5;text-decoration:none}.webpage-content .help-link-container .help-link-content .help-link-icon{width:16px;height:16px;margin-left:8px}div.editor-root div.editor-content div[data-type=editor-container].root.select-all>.container-blocks>div[data-type=editor-block][data-embed-type=webpage]>div[data-type=block-content]:before{display:block}:root{--editor-quoted-color: #7084a4;--editor-drawio-empty-svg: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zOC43MjAzIDI4LjcwOTdIMjUuOTIzM0MyNS4yMTY1IDI4LjcwOTcgMjQuNjQzNSAyOC4xNDgxIDI0LjY0MzUgMjcuNDU1MlYyNS43MzMzSDIwLjUyODNDMjAuNDk4NiAyNS43Njk2IDIwLjQ2NjkgMjUuODA0MiAyMC40MzMzIDI1LjgzN0wxNS45MTkyIDMwLjI2MjFWMzQuNzU1NkgyNC42NDM1VjMzLjcyNzZDMjQuNjQzNSAzMy4wMzQ4IDI1LjIxNjUgMzIuNDczMiAyNS45MjMzIDMyLjQ3MzJIMzguNzIwM0MzOS40MjcgMzIuNDczMiA0MCAzMy4wMzQ4IDQwIDMzLjcyNzZWMzguNzQ1NUM0MCAzOS40MzgzIDM5LjQyNyA0MCAzOC43MjAzIDQwSDI1LjkyMzNDMjUuMjE2NSA0MCAyNC42NDM1IDM5LjQzODMgMjQuNjQzNSAzOC43NDU1VjM3LjMzMzNIMTQuNjI2M0MxMy45MTIyIDM3LjMzMzMgMTMuMzMzMyAzNi43NTYyIDEzLjMzMzMgMzYuMDQ0NFYzMC42OTQxTDguMzc4NTIgMjUuODM3QzguMTM2MjYgMjUuNjAxNCA4IDI1LjI4MDggOCAyNC45NDYzQzggMjQuNjExOCA4LjEzNjI2IDI0LjI5MTEgOC4zNzg1MiAyNC4wNTU2TDEzLjMzMzMgMTkuMTk4NVYxNS43NzJDMTEuNzc5OCAxNS4yMjI5IDEwLjY2NjcgMTMuNzQxNiAxMC42NjY3IDEyQzEwLjY2NjcgOS43OTA4NSAxMi40NTc1IDggMTQuNjY2NyA4QzE2Ljg3NTggOCAxOC42NjY2IDkuNzkwODUgMTguNjY2NiAxMkMxOC42NjY2IDEzLjcyNjUgMTcuNTU4OCAxNS4yNTgxIDE1LjkxOTEgMTUuNzk4OFYxOS4yODg4QzE1LjkxOTEgMTkuMzkxOCAxNS45MDY4IDE5LjQ5NDMgMTUuODgyMyAxOS41OTQzTDE5LjUxNTEgMjMuMTU1NUgyNC42NDM1VjIyLjQzNzNDMjQuNjQzNSAyMS43NDQ1IDI1LjIxNjUgMjEuMTgyOSAyNS45MjMzIDIxLjE4MjlIMzguNzIwM0MzOS40MjcgMjEuMTgyOSA0MCAyMS43NDQ1IDQwIDIyLjQzNzNWMjcuNDU1MkM0MCAyOC4xNDgxIDM5LjQyNyAyOC43MDk3IDM4LjcyMDMgMjguNzA5N1pNMjcuMjAzIDM3LjQ5MUgzNy40NDA2VjM0Ljk4MjFIMjcuMjAzVjM3LjQ5MVpNMTQuNDA1OSAyOC4xOTU0TDExLjA5MTUgMjQuOTQ2M0wxNC40MDU5IDIxLjY5NzJMMTcuNzIwNCAyNC45NDYzTDE0LjQwNTkgMjguMTk1NFpNMjcuMjAzIDI2LjIwMDhIMzcuNDQwNlYyMy42OTE4SDI3LjIwM1YyNi4yMDA4WiIgZmlsbD0iIzA3MTQyQSIvPgo8L3N2Zz4K)}.flex-center,.editor-drawio-iframe-container.loading:before{display:flex;align-items:center;justify-content:center}.full-screen,.editor-drawio-iframe-container.loading:before,.drawio-iframe-element,.editor-drawio-iframe-container{width:100%;height:100%}.editor-drawio-iframe-container{position:fixed;top:0;left:0;z-index:1000}div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content]{outline:1px solid #dedede}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio].drawio-load-error>div[data-type=block-content]{padding:0;min-height:200px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio].drawio-load-error>div[data-type=block-content] .editor-drawio-content{width:100%;height:100%}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content]{justify-content:center;border-radius:3px;padding:10px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content{display:flex;flex-direction:column;align-items:center;justify-content:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content{width:100%;height:100%;background-color:#f8f8f8;display:flex;flex-direction:column;justify-content:center;text-align:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-brand-icon>svg{width:48px;height:48px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-title{font-weight:500;font-size:18px;line-height:26px;text-align:center;color:#303030;margin:23px 0 5px}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-sub-title{font-size:14px;line-height:22px;text-align:center;color:#606060}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .editor-drawio-content>div.drawio-error-content>div.drawio-error-sub-title>span.drawio-error-retry-button{cursor:pointer;margin-left:4px;color:#338fe5}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .drawio-empty-content{display:flex;flex-direction:column;align-items:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block].embed-block[data-embed-type=drawio]>div[data-type=block-content] .drawio-empty-content>span{font-size:14px;line-height:22px;text-align:center;color:#606060;margin-top:23px}.embed-block .editor-empty-drawio.editor-drawio-content.editor-embed{width:240px;height:80px;display:inline-block;text-align:center}div.editor-root div.editor-content div[data-type=editor-container] div[data-embed-type=drawio].embed-block>div[data-type=block-content] img{max-width:100%;max-height:100%}.editor-drawio-iframe-container.loading:before{content:attr(data-placeholder);position:absolute;top:0;left:0;background-color:#f7f6f3;z-index:2}.editor-content .editing{background-color:#cdcdcd40}.editor-content div[data-type=block-tools] .embed-code-editor-container{position:absolute;top:0;left:0px;right:0px;bottom:0;background-color:#cdcdcd40;z-index:var(--wiz-editor-z-embed-code-editor-mask);padding:8px}.editor-content div[data-type=block-tools] .embed-code-editor-container textarea{width:100%;height:100%;resize:none;outline:none;padding:12px;border:1px solid #b9bfc8;border-radius:4px;background-color:#fff;color:#333}.flex-row-center,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=mermaid] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=mermaid],.embed-block[data-embed-type=flowchart],.embed-block[data-embed-type=plantuml]{display:flex;flex-direction:row;align-items:center;justify-content:center}.embed-block[data-embed-type=mermaid] div[data-type=block-content],.embed-block[data-embed-type=flowchart] div[data-type=block-content],.embed-block[data-embed-type=plantuml] div[data-type=block-content]{width:100%;position:relative;border:1px solid #e5e5e5;border-radius:3px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .empty-embed,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .empty-embed,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .empty-embed{width:100%;min-height:106px;background-color:#cdcdcd40}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .empty-embed:after,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .empty-embed:after{content:attr(data-empty-tips);position:absolute;top:0;right:0;width:100%;height:100%;color:#07142a;white-space:nowrap}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed),.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed){width:100%;height:100px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed) img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed) img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed) img{display:none}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .invalid-code:not(.empty-embed):after,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .invalid-code:not(.empty-embed):after,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .invalid-code:not(.empty-embed):after{content:attr(data-invalid-text);position:absolute;top:0;right:0;width:100%;height:100%;outline:1px solid red;display:flex;flex-direction:row;align-items:center;justify-content:center;color:red}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-img-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-img-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-img-content{width:100%;text-align:center}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .mermaid-embed-img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .mermaid-embed-img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .mermaid-embed-img{max-width:100%;min-width:200px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .editor-plantuml-img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .editor-plantuml-img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .editor-plantuml-img{max-width:100%}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-img-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-img-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-img-content{width:100%;text-align:center;padding:10px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-img-content img,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-img-content img,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-img-content img{max-width:100%}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed{width:100%}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content{width:100%;height:100%;min-height:200px;background-color:#f8f8f8;display:flex;flex-direction:column;justify-content:center;text-align:center}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-brand-icon>svg,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-brand-icon>svg{width:48px;height:48px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-title,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-title{font-weight:500;font-size:18px;line-height:26px;text-align:center;color:#303030;margin:23px 0 5px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title{font-size:14px;line-height:22px;text-align:center;color:#606060}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-error-content>div.graph-error-sub-title>span.graph-error-retry-button,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-error-sub-title>span.graph-error-retry-button{cursor:pointer;margin-left:4px;color:#338fe5}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content{background-color:#fff}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-brand-icon>svg,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-brand-icon>svg,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-brand-icon>svg{width:48px;height:48px}.embed-block[data-embed-type=mermaid] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-empty-title,.embed-block[data-embed-type=flowchart] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-empty-title,.embed-block[data-embed-type=plantuml] div[data-type=block-content] .graph-embed>div.graph-empty-content>div.graph-empty-title{font-weight:400;font-size:14px;line-height:22px;text-align:center;color:#606060;margin-top:23px}.hr-transition,.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-content] .editor-embed-container .editor-embed-hr{transition:border-top ease-in-out .4s}.embed-block[data-type=editor-block][data-embed-type=hr].hover>div[data-type=block-content]{outline:none!important}.embed-block[data-type=editor-block][data-embed-type=hr].selected>div[data-type=block-content]{outline:none!important}.embed-block[data-type=editor-block][data-embed-type=hr]:is(.focused) div[data-type=block-content] .editor-embed-container .editor-embed-hr{caret-color:transparent}.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-content] .editor-embed-container{display:flex;align-items:center;width:100%;height:24px;cursor:pointer}.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-content] .editor-embed-container .editor-embed-hr{display:block;width:100%;border:none;margin:0;border-top:2px dashed #cccccc}.embed-block[data-type=editor-block][data-embed-type=hr] div[data-type=block-tools]>div.block-helper{height:100%}:root{--hover-color: #40a9ff}.flex-column-center,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error{display:flex;justify-content:center;align-items:center;flex-flow:column}.common{width:400px;height:180px;background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;transition:border-color .3s}.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error{height:200px}.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty .media-error-icon,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .media-error-icon{display:flex}.editor-root .editor-content div[data-type=editor-block].embed-block.media-block-uploading div[data-type=block-tools] .block-helper{display:none}.embed-block[data-embed-type=video]{display:flex}.embed-block[data-embed-type=video][data-style-align=left]>div[data-type=block-content]{justify-content:flex-start}.embed-block[data-embed-type=video][data-style-align=center]>div[data-type=block-content]{justify-content:center}.embed-block[data-embed-type=video][data-style-align=right]>div[data-type=block-content]{justify-content:flex-end}.embed-block[data-embed-type=video]>div[data-type=block-content]{border:none}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error{height:400px}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty .media-error-icon,.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .media-error-icon{display:flex}.embed-block[data-embed-type=video].hover>div[data-type=block-content],.embed-block[data-embed-type=audio].hover>div[data-type=block-content]{outline:none!important}.embed-block[data-embed-type=video].selected>div[data-type=block-content]:before,.embed-block[data-embed-type=audio].selected>div[data-type=block-content]:before{display:none}.embed-block[data-embed-type=video]>div[data-type=block-content],.embed-block[data-embed-type=audio]>div[data-type=block-content]{justify-content:center;width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media.full-screen,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media.full-screen{width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media{display:flex;justify-content:center}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress{position:relative;width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress audio,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress audio{display:block;width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress video,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress video{display:block;max-width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress .uploading-progress-mask,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress .uploading-progress-mask{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#303030;opacity:.8;display:flex;align-items:center;justify-content:center}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar{width:75%;height:6px;border-radius:3px;display:flex;background-color:#fff;overflow:hidden}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar .uploading-progress-bar-value,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-progress .uploading-progress-mask .uploading-progress-bar .uploading-progress-bar-value{background-color:#338fe5}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error{width:100%;background:#F8F8F8;outline:1px solid #DEDEDE;border-radius:3px}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error-icon svg,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error-icon svg{width:48px;height:48px;color:#c7c7c7}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .line-1,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .line-1{margin-top:10px;font-size:18px;text-align:center;color:#303030}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .line-2,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .line-2{margin-top:5px;font-size:14px;text-align:center;color:#606060}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-error .retry-upload,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-error .retry-upload{margin-left:4px;color:#338fe5;cursor:pointer;text-decoration:none}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty{width:100%;background:#FFFFFF;outline:1px solid #DEDEDE;border-radius:3px}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-empty svg,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-empty svg{width:48px;height:48px;color:#c7c7c7}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element{width:100%;display:flex;justify-content:center}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element .video-container video,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element .video-container video{display:block;min-width:50px;max-width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element .audio-container,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element .audio-container{width:100%}.embed-block[data-embed-type=video]>div[data-type=block-content] .media-element .audio-container audio,.embed-block[data-embed-type=audio]>div[data-type=block-content] .media-element .audio-container audio{display:block;width:100%}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment{box-shadow:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment .media,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment .media{box-shadow:0 2px #f8e6ab}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment.active,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment.active{outline:none}.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=video].comment.active .media,.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=audio].comment.active .media{box-shadow:none;outline:4px solid #f8e6ab}.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-others>[data-type=block-content]:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-self>[data-type=block-content]:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-others>[data-type=block-content]:after{display:none}.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-self>[data-type=block-content] .media,.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-others>[data-type=block-content] .media,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-self>[data-type=block-content] .media,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-others>[data-type=block-content] .media{position:relative}.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-self>[data-type=block-content] .media:after,.editor-root:not(.readonly) .embed-block[data-embed-type=video].locked-by-others>[data-type=block-content] .media:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-self>[data-type=block-content] .media:after,.editor-root:not(.readonly) .embed-block[data-embed-type=audio].locked-by-others>[data-type=block-content] .media:after{content:" ";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:1;background-color:#303030;opacity:.1}`)),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
2
  (function(b,Un){typeof exports=="object"&&typeof module<"u"?Un(exports,require("kiwi-intl"),require("lodash.merge"),require("string-template"),require("nanoid"),require("events"),require("query-string"),require("js-base64"),require("snabbdom"),require("lodash.clonedeep"),require("lodash.isequal"),require("quill-delta"),require("tiny-typed-emitter"),require("lodash.intersection"),require("ot-json1"),require("axios"),require("lodash.findlastindex"),require("reconnecting-websocket"),require("fast-sha256"),require("lodash.debounce"),require("tippy.js"),require("blueimp-md5"),require("css-color-converter"),require("markmap-view"),require("lodash.throttle"),require("prismjs"),require("prismjs/components/prism-c"),require("prismjs/components/prism-cpp"),require("prismjs/components/prism-abap"),require("prismjs/components/prism-arduino"),require("prismjs/components/prism-bash"),require("prismjs/components/prism-basic"),require("prismjs/components/prism-clojure"),require("prismjs/components/prism-coffeescript"),require("prismjs/components/prism-csharp"),require("prismjs/components/prism-css"),require("prismjs/components/prism-dart"),require("prismjs/components/prism-diff"),require("prismjs/components/prism-docker"),require("prismjs/components/prism-elixir"),require("prismjs/components/prism-elm"),require("prismjs/components/prism-erlang"),require("prismjs/components/prism-flow"),require("prismjs/components/prism-fortran"),require("prismjs/components/prism-fsharp"),require("prismjs/components/prism-gherkin"),require("prismjs/components/prism-glsl"),require("prismjs/components/prism-go"),require("prismjs/components/prism-graphql"),require("prismjs/components/prism-groovy"),require("prismjs/components/prism-haskell"),require("prismjs/components/prism-java"),require("prismjs/components/prism-javascript"),require("prismjs/components/prism-json"),require("prismjs/components/prism-julia"),require("prismjs/components/prism-kotlin"),require("prismjs/components/prism-latex"),require("prismjs/components/prism-less"),require("prismjs/components/prism-lisp"),require("prismjs/components/prism-livescript"),require("prismjs/components/prism-lua"),require("prismjs/components/prism-makefile"),require("prismjs/components/prism-markdown"),require("prismjs/components/prism-markup"),require("prismjs/components/prism-matlab"),require("prismjs/components/prism-mermaid"),require("prismjs/components/prism-nix"),require("prismjs/components/prism-objectivec"),require("prismjs/components/prism-ocaml"),require("prismjs/components/prism-pascal"),require("prismjs/components/prism-perl"),require("prismjs/components/prism-php"),require("prismjs/components/prism-powershell"),require("prismjs/components/prism-prolog"),require("prismjs/components/prism-protobuf"),require("prismjs/components/prism-python"),require("prismjs/components/prism-r"),require("prismjs/components/prism-reason"),require("prismjs/components/prism-ruby"),require("prismjs/components/prism-rust"),require("prismjs/components/prism-sass"),require("prismjs/components/prism-scala"),require("prismjs/components/prism-scheme"),require("prismjs/components/prism-scss"),require("prismjs/components/prism-solidity"),require("prismjs/components/prism-sql"),require("prismjs/components/prism-swift"),require("prismjs/components/prism-typescript"),require("prismjs/components/prism-vbnet"),require("prismjs/components/prism-verilog"),require("prismjs/components/prism-vhdl"),require("prismjs/components/prism-visual-basic"),require("prismjs/components/prism-wasm"),require("prismjs/components/prism-yaml"),require("mime-db"),require("dom-to-image"),require("@guyplusplus/turndown-plugin-gfm"),require("turndown"),require("marked"),require("@better-scroll/core"),require("plantuml-encoder"),require("docx")):typeof define=="function"&&define.amd?define(["exports","kiwi-intl","lodash.merge","string-template","nanoid","events","query-string","js-base64","snabbdom","lodash.clonedeep","lodash.isequal","quill-delta","tiny-typed-emitter","lodash.intersection","ot-json1","axios","lodash.findlastindex","reconnecting-websocket","fast-sha256","lodash.debounce","tippy.js","blueimp-md5","css-color-converter","markmap-view","lodash.throttle","prismjs","prismjs/components/prism-c","prismjs/components/prism-cpp","prismjs/components/prism-abap","prismjs/components/prism-arduino","prismjs/components/prism-bash","prismjs/components/prism-basic","prismjs/components/prism-clojure","prismjs/components/prism-coffeescript","prismjs/components/prism-csharp","prismjs/components/prism-css","prismjs/components/prism-dart","prismjs/components/prism-diff","prismjs/components/prism-docker","prismjs/components/prism-elixir","prismjs/components/prism-elm","prismjs/components/prism-erlang","prismjs/components/prism-flow","prismjs/components/prism-fortran","prismjs/components/prism-fsharp","prismjs/components/prism-gherkin","prismjs/components/prism-glsl","prismjs/components/prism-go","prismjs/components/prism-graphql","prismjs/components/prism-groovy","prismjs/components/prism-haskell","prismjs/components/prism-java","prismjs/components/prism-javascript","prismjs/components/prism-json","prismjs/components/prism-julia","prismjs/components/prism-kotlin","prismjs/components/prism-latex","prismjs/components/prism-less","prismjs/components/prism-lisp","prismjs/components/prism-livescript","prismjs/components/prism-lua","prismjs/components/prism-makefile","prismjs/components/prism-markdown","prismjs/components/prism-markup","prismjs/components/prism-matlab","prismjs/components/prism-mermaid","prismjs/components/prism-nix","prismjs/components/prism-objectivec","prismjs/components/prism-ocaml","prismjs/components/prism-pascal","prismjs/components/prism-perl","prismjs/components/prism-php","prismjs/components/prism-powershell","prismjs/components/prism-prolog","prismjs/components/prism-protobuf","prismjs/components/prism-python","prismjs/components/prism-r","prismjs/components/prism-reason","prismjs/components/prism-ruby","prismjs/components/prism-rust","prismjs/components/prism-sass","prismjs/components/prism-scala","prismjs/components/prism-scheme","prismjs/components/prism-scss","prismjs/components/prism-solidity","prismjs/components/prism-sql","prismjs/components/prism-swift","prismjs/components/prism-typescript","prismjs/components/prism-vbnet","prismjs/components/prism-verilog","prismjs/components/prism-vhdl","prismjs/components/prism-visual-basic","prismjs/components/prism-wasm","prismjs/components/prism-yaml","mime-db","dom-to-image","@guyplusplus/turndown-plugin-gfm","turndown","marked","@better-scroll/core","plantuml-encoder","docx"],Un):(b=typeof globalThis<"u"?globalThis:b||self,Un(b["oneseditor-editor"]={},b.KiwiIntl,b.merge,b.stringFormat,b.nanoid$1,b.events,b.queryString,b.jsBase64,b.snabbdom,b.cloneDeep,b.isEqual,b.Delta,b.tinyTypedEmitter,b.intersection,b.json1,b.axios,b.findLastIndex,b.ReconnectingWebSocket,b.sha256,b.debounce,b.tippy$1,b.md5,b.cssColorConverter,b.markmap,b.throttle,b.Prism,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,b.mime,b.domToImage,b.turndownPluginGfm,b.TurndownService,b.marked,b.BetterScroll,b.plantumlEncoder,b.docx))})(this,function(b,Un,ps,uB,dB,qC,hB,ca,Di,fB,mB,gB,ve,pB,CB,AB,bB,vB,yB,kB,dm,wB,hm,BB,EB,xB,Ktt,Xtt,tet,eet,net,oet,ret,iet,set,cet,aet,uet,det,het,fet,met,get,pet,Cet,Aet,bet,vet,yet,ket,wet,Bet,Eet,xet,Iet,Tet,Det,Let,Met,Ret,Oet,_et,Fet,Pet,Net,$et,Het,jet,Uet,zet,Vet,Wet,qet,Get,Zet,Qet,Yet,Jet,Ket,Xet,tnt,ent,nnt,ont,rnt,int,snt,lnt,cnt,ant,unt,dnt,hnt,fnt,IB,TB,DB,SB,GC,LB,MB,gt){"use strict";var Ytt=Object.defineProperty;var Jtt=(b,Un,ps)=>Un in b?Ytt(b,Un,{enumerable:!0,configurable:!0,writable:!0,value:ps}):b[Un]=ps;var m=(b,Un,ps)=>(Jtt(b,typeof Un!="symbol"?Un+"":Un,ps),ps);const xe=n=>n&&typeof n=="object"&&"default"in n?n:{default:n};function Fd(n){if(n&&n.__esModule)return n;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const RB=xe(Un),fm=xe(ps),OB=xe(uB),ZC=xe(qC),mt=xe(fB),aa=xe(mB),on=xe(gB),mm=xe(pB),Pd=Fd(CB),_B=xe(AB),FB=xe(bB),PB=xe(vB),NB=Fd(yB),Le=xe(kB),$B=xe(dm),HB=Fd(dm),Nd=xe(wB),jB=Fd(BB),UB=xe(EB),ua=xe(xB),gm=xe(IB),QC=xe(TB),zB=xe(SB),YC=xe(LB),VB=xe(MB);function WB(n){const t=o=>o<10?`0${String(o)}`:String(o),e=o=>o<10?`00${String(o)}`:o<100?`0${String(o)}`:String(o);return`${n.getFullYear()}-${t(n.getMonth()+1)}-${t(n.getDate())} ${t(n.getHours())}:${t(n.getMinutes())}:${t(n.getSeconds())}.${e(n.getMilliseconds())}`}var da=(n=>(n.DEBUG="DEBUG",n.INFO="INFO ",n.WARN="WARN ",n.ERROR="ERROR",n))(da||{});const JC=new Map,_c=class{constructor(t){m(this,"times",new Map);this.category=t}shouldLog(t){const e=Object.values(da).indexOf(t),o=Object.values(da).indexOf(_c.level);return e>=o}_log(t,e,o,r){var B;if(!this.shouldLog(t))return;const i=typeof process>"u"?{}:process;let s="";if(typeof e=="object")try{s="message"in e?e.message:JSON.stringify(e,null,4)}catch{s=""}else typeof e=="string"?e&&(s=e):s=JSON.stringify(e);s=r?`${s} - ${r}`:s;const l=`${this.category}`;let a=console.log;t==="WARN "&&(a=console.warn),t==="ERROR"&&(a=console.error);const d=`${WB(new Date)}`,h=t,p=l,A=_c.extParams?"[{date}] {level}: [{module} {extParams}] - {msg}":"[{date}] {level}: [{module}] - {msg}",v=[OB.default(((B=i.env)==null?void 0:B.LOG_TEMPLATE)||A,{date:d,level:h,module:p,msg:s,extParams:_c.extParams})];if(typeof e=="object"){const D=e.stack;D&&v.push(D)}if(a===console.error&&_c.debugMode){const D=new Error().stack;D&&v.push(D)}a(...v),o&&this._log(t,o)}log(t,e){this._log("INFO ",t,void 0,e)}debug(t,e){this._log("DEBUG",t,void 0,e)}info(t,e){this._log("INFO ",t,void 0,e)}warn(t,e,o){this._log("WARN ",t,e,o)}error(t,e,o){this._log("ERROR",t,e,o)}time(t){this.times.set(t,Date.now())}timeEnd(t){this.timeLog(t),this.times.delete(t)}timeLog(t){const e=this.times.get(t);if(!e){this.warn(`no time label: ${t}`);return}this.debug(`${t}: ${Date.now()-e}`)}static setExtParams(t){this.extParams=t}};let Si=_c;m(Si,"debugMode",!1),m(Si,"level","DEBUG"),m(Si,"extParams","");function S(n){const t=JC.get(n);if(t)return t;const e=new Si(n);return JC.set(n,e),e}const qB={name:"ONES Editor",date:{dateFromFuture:"From the future",dateJustNow:"Just now",dateYesterday:"Yesterday",dateMinutesAgo:"{num} minutes ago",date1HourAgo:"1 hour ago",dateHoursAgo:"{num} hours ago",dateDaysAgo:"{num} days ago",dateWeeksAgo:"{num} weeks ago"},common:{cancel:"Cancel"},docx:{imageExportFailed:"Failed to load image"}},GB={name:"Ones Editor",date:{dateFromFuture:"\u6765\u81EA\u672A\u6765",dateJustNow:"\u521A\u521A",dateYesterday:"\u6628\u5929",dateMinutesAgo:"{num}\u5206\u949F\u524D",date1HourAgo:"1\u5C0F\u65F6\u524D",dateHoursAgo:"{num}\u5C0F\u65F6\u524D",dateDaysAgo:"{num}\u5929\u524D",dateWeeksAgo:"{num}\u5468\u524D"},common:{cancel:"\u53D6\u6D88"},docx:{imageExportFailed:"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25"}},ZB={name:"ONES \u30A8\u30C7\u30A3\u30BF\u30FC",date:{dateFromFuture:"\u672A\u6765\u304B\u3089",dateJustNow:"\u305F\u3060\u4ECA",dateYesterday:"\u6628\u65E5",dateMinutesAgo:"{num}\u5206\u524D",date1HourAgo:"1\u6642\u9593\u524D",dateHoursAgo:"{num}\u6642\u9593\u524D",dateDaysAgo:"{num}\u65E5\u524D",dateWeeksAgo:"{num}\u9031\u524D"},common:{cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"},docx:{imageExportFailed:"\u753B\u50CF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"}},QB=S("i18n"),YB={"en-US":qB,"zh-CN":GB,"ja-JP":ZB},$d=RB.default.init("en-US",YB);function JB(n=void 0){$d.setLang&&$d.setLang(n||"en-US")}function KB(n){fm.default($d.__metas__,n)}function XB(n,t){const e=$d.get(n,t);return e===n&&QB.warn(`no locale value for key ${n}`),e}const L=Object.freeze(Object.defineProperty({__proto__:null,setLang:JB,mergeLang:KB,t:XB},Symbol.toStringTag,{value:"Module"})),mnt="";class KC{constructor(t,e){this.editor=t,this.data=e}getData(){return this.data}getEditor(){return this.editor}destroy(){}}class tE extends Error{constructor(t){if(super(t),this.code="Assert",this.stack){const e=this.stack.split(`
3
3
  `);if(e.length>1)if(this.lineNumber&&this.columnNumber){const o=e[1].match(/(.*)@(.*):(\d+):(\d+)/);o&&(this.lineNumber=+o[3],this.columnNumber=+o[4],this.fileName=o[2]),e.splice(0,1)}else e.splice(1,1);this.stack=e.join(`
4
4
  `)}}}function g(n,t,e){if(!t)throw n.error(`assert failed: ${e}`),new tE(e)}const eE=dB.customAlphabet("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_",8),XC="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function nE(){return XC[Date.now()%XC.length]}const K=()=>`${nE()}${eE()}`;class t5 extends ZC.default.EventEmitter{constructor(e=60){super();m(this,"cache",new Map);m(this,"expiredSeconds");this.expiredSeconds=e,this.startAutoClear()}delete(e){const o=this.cache.get(e);o&&this.emit("delete",o.data),this.cache.delete(e)}getSync(e,o){const r=this.cache.get(e),i=Date.now();if(r&&(i-r.lastRead)/1e3<this.expiredSeconds)return r.lastRead=i,r.data;const s=o(e);return this.cache.set(e,{lastRead:i,data:s}),s}async get(e,o){const r=this.cache.get(e),i=Date.now();if(r&&(i-r.lastRead)/1e3<this.expiredSeconds)return r.lastRead=i,r.data;const s=await o(e);return this.cache.set(e,{lastRead:i,data:s}),s}startAutoClear(){setInterval(()=>{const e=Date.now();Array.from(this.cache.entries()).forEach(([o,r])=>{(e-r.lastRead)/1e3>this.expiredSeconds&&this.delete(o)})},10*1e3)}}class ha{constructor(){m(this,"_callbacks",new Set)}get callbacks(){return Array.from(this._callbacks)}registerCallback(t){this._callbacks.add(t)}unregisterCallback(t){this._callbacks.delete(t)}clearCallbacks(){this._callbacks.clear()}}const oE=S("await-locker");class rE{constructor(){m(this,"_acquired",!1);m(this,"_waitingResolvers",[]);this._acquired=!1,this._waitingResolvers=[]}acquireAsync(t){return this._acquired?new Promise((e,o)=>{this._waitingResolvers.push(e),t&&t>0&&setTimeout(()=>{const r=this._waitingResolvers.indexOf(e);if(r!==-1){this._waitingResolvers.splice(r,1);const i=new Error(`lock timeout: ${t}, waiting resolves: ${this._waitingResolvers.length}`);o(i)}},t)}):(this._acquired=!0,Promise.resolve())}tryAcquire(){return this._acquired?!1:(this._acquired=!0,!0)}release(){if(!this._acquired)throw new Error("Cannot release an unacquired lock");if(this._waitingResolvers.length>0){const t=this._waitingResolvers.shift();g(oE,t,"Resolver missing"),t(void 0)}else this._acquired=!1}acquired(){return this._acquired}debug(){const t=this._waitingResolvers.length;return console.log(`waiting resolves: ${t}`),{waitingCount:t}}}class iE{constructor(){m(this,"_map");this._map=new Map}getLocker(t){let e=this._map.get(t);return e||(e=new rE,this._map.set(t,e)),e}async lock(t,e){await this.getLocker(t).acquireAsync(e)}release(t){this.getLocker(t).release()}remove(t){this.isLocking(t)||this._map.delete(t)}isLocking(t){return this._map.has(t)?this.getLocker(t).acquired():!1}}const xo=new iE;/**
@@ -384,34 +384,34 @@ xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
384
384
  <path d="M0 8a8 8 0 1 1 16 0h-1a7 7 0 1 0-7 7v1a8 8 0 0 1-8-8Z" fill="url(#Loading_svg_kdeabj_a)" transform="matrix(1 0 0 -1 0 16)"></path><path d="M8 0v1a7 7 0 0 1 7 7h1a8 8 0 0 0-8-8Z" fill="currentColor">
385
385
  </path>
386
386
  </g>
387
- </svg>`;function hv(){const n=k("span",["editor-loading"],null);return n.innerHTML=QL,n}const bnt="";function YL(n,t){const e=k("button",["editor-checkbox-wrapper"],null);e.setAttribute("data-button-id",n),t!=null&&t.includes("checked")&&W(e,"checked"),t!=null&&t.includes("disabled")&&(e.disabled=!0);const o=k("span",["editor-checkbox"],e);return k("span",["editor-checkbox-inner"],o),e}const vnt="",ec=S("ui-command-bar-base"),JL={itemElementTag:"div",tippyArrow:!1},K2=class extends ve.TypedEmitter{constructor(e,o,r){var i,s;super();m(this,"content");m(this,"items");m(this,"subBar",null);m(this,"parentItem",null);m(this,"closeable",null);m(this,"closeReason",null);m(this,"options");m(this,"id");m(this,"header",null);m(this,"footer",null);m(this,"handleDocumentKeydown",e=>{if(!!this.isVisible&&!e.isComposing&&!Ds(e.target)){if(this.subBar){this.subBar.handleDocumentKeydown(e);return}if(this.items.length!==0){if(e.key==="Escape"){this.close("cancelBar");return}if(e.key==="ArrowUp"){const o=this.getPrevItemIndex(this.getSelectedItemIndex());this.startPauseMouseEnter(),this.selectItem(this.items[o].id),e.preventDefault(),e.stopPropagation()}else if(e.key==="ArrowDown"){const o=this.getNextItemIndex(this.getSelectedItemIndex());this.startPauseMouseEnter(),this.selectItem(this.items[o].id),e.preventDefault(),e.stopPropagation()}else if(e.key==="ArrowRight"){const o=this.getSelectedItem();o&&o.children&&this.showSubCommandBar(o.childrenMenuId)}else if(e.key==="ArrowLeft")this.parentItem&&this.close("switchItem");else if(e.key==="Enter"){const o=this.getSelectedItemIndex();if(o===-1)return;const r=this.items[o],i=this.getItemElementById(r.id);i&&this.emit("click",this,r,i)}}}});m(this,"handleDocumentMouseDown",e=>{if(e.target instanceof Element&&!this.isInCommandBar(e.target)){const o=this.listeners("closing");for(let r=0;r<o.length;r++)if(o[r](this,e)===!1)return;this.close("clickBackground")}});m(this,"handleHidden",()=>{this.closeReason!=="fromHover"&&this.emit("close",this),this.close(null),E5(this.id)});m(this,"handleShow",()=>{this.popper&&(this.popper.setAttribute("data-command-bar-id",this.id),this.options.classes&&W(this.popper,...this.options.classes),this.options.refuseOverflow&&this.popper.classList.add("reference-hidden")),this.emit("show",this),this.options.disablePageScroll&&B5(this.id)});m(this,"lastEnterPauseTime",0);m(this,"startPauseMouseEnter",()=>{this.lastEnterPauseTime=Date.now()});m(this,"handleItemMouseEnter",e=>{if(Date.now()-this.lastEnterPauseTime<100)return;const o=this.getParentCommandItemElement(e.target);if(!o)return;const r=this.getItemElementId(o),i=this.getItemById(r);if(this.selectItem(r),i.manualShowChildren)return;const s=i.childrenMenuId||"";this.showSubCommandBar(s)});m(this,"handleItemMouseLeave",e=>{var r,i;const o=this.getParentCommandItemElement(e.target);!o||((i=(r=this.subBar)==null?void 0:r.parentItem)==null?void 0:i.id)!==this.getItemElementId(o)&&(ot(o,"selected"),this.emit("selectionChange",this,""))});m(this,"handleItemClick",e=>{const o=this.getParentCommandItemElement(e.target);if(!o)return;const r=this.getItemElementId(o),i=this.items.find(s=>s.id===r);if(!!i&&!(i.states&&i.states.indexOf("disabled")!==-1)){if(i.children&&i.children.length>0&&i.manualShowChildren){this.showSubCommandBar(i.childrenMenuId);return}i.element||(this.emit("click",this,i,o),this.options.autoClose&&this.close("clickItem"))}});m(this,"handleWheel",e=>{if(!this.options.disablePageScroll&&!document.querySelector(".editor-disable-scroll"))return;const o=e.target;if(!o||!(o instanceof Node))return;const r=o instanceof HTMLElement?o:o.parentElement;if(!r)return;const i=io(r);if(!Xt(this.content,i)){e.stopPropagation(),e.preventDefault();return}e.deltaY<0?i.scrollTop===0&&(e.stopPropagation(),e.preventDefault()):e.deltaY>0&&i.scrollTop+i.clientHeight>=i.scrollHeight&&(e.stopPropagation(),e.preventDefault())});this.id=(i=r==null?void 0:r.id)!=null?i:K(),this.options={...JL,...r},this.items=e,this.parentItem=(s=r==null?void 0:r.parentItem)!=null?s:null,this.closeable=o!=null?o:null,this.content=this.createCommandBarContent(e)}close(e){this.closeReason=e,this.subBar&&this.subBar.close(e),document.removeEventListener("keydown",this.handleDocumentKeydown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}click(e,o){this.emit("click",this,e,o)}createPopperOptions(){var r,i;const e={modifiers:[]},o=this.options.overflowBoundary;return o&&((r=e==null?void 0:e.modifiers)==null||r.push({name:"flip",options:{boundary:o,fallbackPlacements:["top","bottom"]}})),this.options.padding&&((i=e==null?void 0:e.modifiers)==null||i.push({name:"preventOverflow",options:{padding:this.options.padding}})),e}destroy(){var e;this.close(null),this.removeAllListeners(),(e=this.subBar)==null||e.destroy(),this.subBar=null,this.closeable=null,this.content.removeEventListener("wheel",this.handleWheel)}get isSubCommandBar(){return!!this.parentItem}updateItems(e){var r;this.subBar&&e.findIndex(s=>{var l,a;return s.id===((a=(l=this.subBar)==null?void 0:l.parentItem)==null?void 0:a.id)})===-1&&((r=this.subBar)==null||r.destroy(),this.subBar=null),this.items=e;const o=this.createCommandBarContent(e);this.content.innerHTML="",Array.from(o.children).forEach(i=>{this.content.appendChild(i)})}get popper(){return this.content.closest("[data-tippy-root]")}getSelectedItemIndex(){const e=this.getSelectedItem();return e?this.items.indexOf(e):-1}getPrevItemIndex(e){if(e<=0)return this.items.length-1;let o=e-1;for(;;){const r=this.items[o],i=r.type,l=!(r.states&&r.states.indexOf("disabled")!==-1);if(i!=="separator"&&i!=="section"&&l)return o;if(o-=1,o<=0)return this.items.length-1}}getNextItemIndex(e){let o=e+1;for(;;){if(!this.items[o])return this.getNextItemIndex(-1);const r=this.items[o],i=r.type,l=!(r.states&&r.states.indexOf("disabled")!==-1);if(i!=="separator"&&i!=="section"&&l)return o;if(o+=1,o>this.items.length-1)return 0}}clearSelectedItem(){const e=this.getSelectedItem();if(!e)return;const o=this.getItemElementById(e.id);o&&ot(o,"selected")}selectItem(e){const o=this.getSelectedItem();if(o){if(o.id===e)return;const i=o.id,s=this.getItemElementById(i);s&&ot(s,"selected")}const r=this.getItemElementById(e);r?(W(r,"selected"),this.emit("selectionChange",this,r.getAttribute("data-id")||""),r.scrollIntoView({block:"nearest"})):this.emit("selectionChange",this,"")}showSubCommandBar(e){var s,l;const o=this.getSelectedItem();if(!o)return;if(this.subBar){if(((s=this.subBar.parentItem)==null?void 0:s.id)===o.id){o.manualShowChildren&&this.subBar.close("switchItem");return}this.subBar.destroy(),this.subBar=null}if(!o.children)return;const r=this.getItemElementById(o.id);if(!r)return;const i=K2.createSubCommandBar(o,(l=this.closeable)!=null?l:this,e?{id:e}:{});this.subBar=i,this.subBar.on("click",(a,d,h)=>{this.emit("click",a,d,h)}),this.subBar.on("close",()=>{var a;(a=this.subBar)==null||a.destroy(),this.subBar=null,ot(r,"active")}),o.beforePopup&&o.beforePopup(i),this.subBar.manualShow(r,this.getSubBarOptions(o)),W(r,"active")}isInCommandBar(e){if(!e||!(e instanceof Node))return!1;const o=this.getCommandBarRoot();return o&&Xt(o,e)||Xt(this.content,e)?!0:this.subBar?this.subBar.isInCommandBar(e):!1}createCommandItem(e){var i,s,l,a;let o=(i=this.options.itemElementTag)!=null?i:"div";e.element&&(o="div");const r=k(o,["command-item"],null);return r.setAttribute("data-id",e.id),e.type==="separator"?r.classList.add("separator"):e.type==="section"?(r.classList.add("section","text"),e.element&&(typeof e.element=="function"?r.appendChild(e.element(e)):r.appendChild(e.element))):((s=e.states)!=null&&s.includes("selected")&&r.classList.add("selected"),(l=e.states)!=null&&l.includes("checked")&&r.classList.add("checked"),(a=e.states)!=null&&a.includes("disabled")&&r.classList.add("disabled"),r.onclick=this.handleItemClick,r.onmouseenter=this.handleItemMouseEnter,r.onmouseleave=this.handleItemMouseLeave,e.element?typeof e.element=="function"?r.appendChild(e.element(e)):r.appendChild(e.element):r.classList.add("standard")),this.initItemElement(e,r),r}getItemById(e){const o=this.items.find(r=>r.id===e);return g(ec,o,`can not find command item for id: ${e}`),o}getSelectedItem(){const e=this.content.querySelector(":scope >.editor-command-bar >.command-item.selected");if(e){const o=this.getItemElementId(e),r=this.items.find(i=>i.id===o);return g(ec,r,`can not find command item for id: ${o}`),r}return null}getItemElementId(e){const o=e.getAttribute("data-id");return g(ec,o,"no data-id attribute"),o}getItemElementById(e){const o=this.content.querySelector(`:scope >.editor-command-bar > .command-item[data-id="${e}"]`);return g(ec,o,`no exists command item, id=${e}`),o}getParentCommandItemElement(e){if(!e||!(e instanceof Element))return null;if(xt(e,"command-item"))return e;const o=e.closest(".command-item");return o||null}createCommandBarContent(e){this.content&&this.content.removeEventListener("wheel",this.handleWheel);const o=k("div",["editor-command-bar-root"],null);if(this.options.header){const i=k("div",["editor-command-bar-header"],null);if(this.options.header instanceof Function){const s=this.options.header();s&&i.appendChild(s)}else i.appendChild(this.options.header);this.header=i,this.header&&o.appendChild(this.header)}const r=k("div",["editor-command-bar"],o);if(e.forEach(i=>{var l;const s=this.createCommandItem(i);r.appendChild(s),i.element&&i.setCloseable&&i.setCloseable((l=this.closeable)!=null?l:this)}),this.options.footer){const i=k("div",["menu-item","editor-command-bar","footer"],null);if(this.options.footer instanceof Function){const s=this.options.footer();s&&i.appendChild(s)}else i.appendChild(this.options.footer);this.footer=i,this.footer&&o.appendChild(this.footer)}return(this.options.header||this.options.footer)&&W(o,"scrollable-bar"),this.initCommandBarElement(r),o.addEventListener("wheel",this.handleWheel,{passive:!1}),o}getSubBarOptions(e){var o;return{placement:(o=e.childrenPlacement)!=null?o:"right-start"}}static registerManualCommandBar(e,o){this.commandBarCreators.set(e,o)}static createSubCommandBar(e,o,r){var l;g(ec,e.children&&e.children.length>0,"no item children");const i=(l=e.childrenType)!=null?l:"menu",s=this.commandBarCreators.get(i);return g(ec,s,`no creator for command type: ${i}`),s(e,o,r)}static hasExistsCommandBar(){return!!document.querySelector("[data-command-bar-id]")}};let Ui=K2;m(Ui,"commandBarCreators",new Map),S("ui-command-bar");class Yh extends Ui{constructor(){super(...arguments);m(this,"tippyInstance",null)}manualShow(e,o){var r,i;if(!this.isVisible){if(this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.tippyInstance=$B.default(e,{interactive:!0,content:this.content,trigger:"manual",triggerTarget:null,hideOnClick:!1,placement:(r=o==null?void 0:o.placement)!=null?r:"bottom-start",maxWidth:650,arrow:this.options.tippyArrow,appendTo:document.body,onShow:this.handleShow,onHidden:this.handleHidden,theme:o==null?void 0:o.theme,getReferenceClientRect:o==null?void 0:o.getReferenceClientRect,offset:(i=o==null?void 0:o.offset)!=null?i:[0,0],popperOptions:this.createPopperOptions()}),o!=null&&o.point){const{x:s,y:l}=o.point;this.tippyInstance.setProps({getReferenceClientRect:()=>new DOMRect(s,l,0,0)})}this.clearSelectedItem(),this.tippyInstance.show(),this.parentItem||(document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("mousedown",this.handleDocumentMouseDown)),this.popper&&this.options.id&&this.popper.setAttribute("data-command-bar-id",this.options.id)}}close(e){var o;super.close(e),this.isVisible&&((o=this.tippyInstance)==null||o.hide())}destroy(){var e;(e=this.tippyInstance)==null||e.destroy(),this.tippyInstance=null,super.destroy()}getCommandBarRoot(){return this.content.closest("[data-tippy-root]")}get isVisible(){var e,o;return(o=(e=this.tippyInstance)==null?void 0:e.state.isVisible)!=null?o:!1}get popper(){return this.content.closest("[data-tippy-root]")}}const fv=S("ui-base");class ou extends Yh{constructor(t,e){var i;const r=[{id:(i=e==null?void 0:e.id)!=null?i:`popup-${K()}`,name:"",element:t}];super(r,void 0,{disablePageScroll:!0})}initCommandBarElement(t){W(t,"popper")}initItemElement(t,e){}get popupContent(){const t=this.items[0];g(fv,t,"no dialog item");const e=typeof t.element=="function"?t.element(t):t.element;return g(fv,e,"no item element"),e}}const zi=S("filterable-list");function mv(n){var e,o;const t=k("div",["list-item"],null);return t.setAttribute("data-id",n.id),t.appendChild(k("div",["list-item-text"],null,n.name)),(e=n.states)!=null&&e.includes("selected")&&W(t,"selected"),(o=n.states)!=null&&o.includes("disabled")&&W(t,"disabled"),t}function gv(n){const t=k("div",["list-root"],null);return n.forEach(e=>{t.appendChild(mv(e))}),n.length||t.appendChild(mv({id:"placeholder",states:["disabled"],name:L.t("search.emptyTips")})),t}function pv(n,t){let e=n;return t&&(e=n.map(o=>({...o,states:o.id===t?["selected"]:void 0}))),e}function KL(n,t){const e=k("div",["filterable-list"],null),o=k("div",["filter"],e),r=k("div",["filter-container"],o),i=k("input",["filter-input"],r);t&&t.placeholder&&(i.placeholder=t.placeholder);const s=k("div",["list"],e),l=gv(pv(n,t==null?void 0:t.initialSelectedId));return s.appendChild(l),e}function Cv(n,t,e){const o=n.querySelector(".list");g(zi,o,"no list root");const r=gv(pv(t,e)),i=o.querySelector(".list-root");if(g(zi,i,"no exists menu"),Ca(i,r),e){const s=o.querySelector(".list-item.selected");s&&(g(zi,s,"no selected menu item"),s.scrollIntoView({block:"nearest"}))}}class XL{constructor(t,e){m(this,"root");m(this,"visibleItems");m(this,"selectedId");m(this,"filter","");m(this,"onSelected",null);m(this,"handleKeydown",t=>{this.processKeyDown(t)});m(this,"handleInputChanged",()=>{const t=this.root.querySelector(".filter-input");g(zi,t,"no input");const e=t.value.toLocaleLowerCase();this.setFilter(e)});m(this,"handleClick",t=>{this.processClick(t)});var o;this.items=t,this.options=e,this.root=KL(t,e),this.bindEvents(),this.selectedId=(o=e==null?void 0:e.initialSelectedId)!=null?o:"",this.visibleItems=t}bindEvents(){const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.addEventListener("keyup",this.handleInputChanged),t.addEventListener("keydown",this.handleKeydown),this.root.addEventListener("click",this.handleClick)}unbindEvents(){const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.removeEventListener("keyup",this.handleInputChanged),t.removeEventListener("keydown",this.handleKeydown),this.root.removeEventListener("click",this.handleClick)}destroy(){this.unbindEvents(),this.onSelected=null}getSelectedIndex(){return this.selectedId?this.visibleItems.findIndex(t=>t.id===this.selectedId):-1}setSelectedId(t){this.selectedId=t,Cv(this.root,this.visibleItems,t)}focus(){const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.focus()}reset(){this.setFilter("");const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.value=""}setFilter(t){this.filter!==t&&(this.filter=t,this.visibleItems=this.items.filter(e=>e.name.toLocaleLowerCase().includes(t)),Cv(this.root,this.visibleItems,this.selectedId))}processClick(t){var s,l;const e=t.target;if(!(e instanceof HTMLElement))return;const o=e.closest(".list-item");if(!o)return;const r=(s=o.getAttribute("data-id"))!=null?s:"",i=(l=this.visibleItems.find(a=>a.id===r))!=null?l:null;this.onSelected&&this.onSelected(this,i)}processKeyDown(t){var e;if(t.key==="ArrowUp"){let o=this.getSelectedIndex();o===-1?o=this.visibleItems.length-1:o>0&&(o-=1);let r="";o!==-1&&(r=this.visibleItems[o].id),this.setSelectedId(r);return}if(t.key==="ArrowDown"){let o=this.getSelectedIndex();o===-1?o=0:o<this.visibleItems.length-1&&(o+=1);let r="";o!==-1&&(r=this.visibleItems[o].id),this.setSelectedId(r);return}if(t.key==="Enter"){const o=(e=this.visibleItems.find(r=>r.id===this.selectedId))!=null?e:null;this.onSelected&&this.onSelected(this,o)}}}class tM extends XL{constructor(e,o,r){super(e,r);m(this,"popup");m(this,"onShow",null);m(this,"onHide",null);m(this,"custom",null);m(this,"handleShow",()=>{this.onShow&&this.onShow(this)});m(this,"handleHide",()=>{this.onHide&&this.onHide(this)});m(this,"handleShown",()=>{this.focus()});this.popup=new ou(this.root)}destroy(){super.destroy(),this.onShow=null,this.onHide=null}show(e){this.reset(),this.popup.manualShow(e,{theme:"dropdown-list"}),this.focus()}processKeyDown(e){super.processKeyDown(e),(e.key==="Esc"||e.key==="Enter")&&this.popup.close("cancelBar")}processClick(e){super.processClick(e);const o=e.target;!(o instanceof HTMLElement)||!o.closest(".list-item")||this.popup.close("clickItem")}}const ynt="",knt="";function eM(n,t){const e=document.createElement("div");e.classList.add("toast","show"),t!=null&&t.theme&&e.setAttribute("data-theme",t.theme),t!=null&&t.id&&e.setAttribute("data-id",t.id),t!=null&&t.html?e.innerHTML=n:e.textContent=n,t!=null&&t.position&&(e.style.left=`${t.position.x}px`,e.style.top=`${t.position.y}px`,e.classList.add("positioned")),document.body.appendChild(e),setTimeout(()=>{e.classList.remove("show"),setTimeout(()=>{e.remove()},500)},(t==null?void 0:t.duration)||3e3)}function nM(n,t){var e,o;if(W(t,"menu-item"),!n.element){if(n.type==="section"){const r=k("div",["section-name"],null,n.name);t.appendChild(r)}else if(n.type!=="separator"){if(n.icon){const s=k("div",["menu-item-icon"],null);n.icon&&(s.innerHTML=n.icon),t.appendChild(s)}const r=k("div",["menu-item-name","text"],null),i=k("span",[],r,n.name);if(n.ellipsisTooltip&&(i.setAttribute("data-editor-tooltip-allow-markdown","true"),i.setAttribute("data-editor-tooltip-offset-y","25"),i.setAttribute("data-editor-tooltip-placement","right"),i.setAttribute("data-editor-tooltip-common",`<div style="word-break: break-word;">${n.ellipsisTooltip}</div>`)),((e=n.states)==null?void 0:e.includes("disabled"))&&n.disableReason&&(i.setAttribute("data-editor-tooltip-offset-y","25"),i.setAttribute("data-editor-tooltip-maxwidth","800"),i.setAttribute("data-editor-tooltip-placement","right"),i.setAttribute("data-editor-tooltip-common",n.disableReason)),t.appendChild(r),n.subText&&k("div",["item-subtext","text"],t,n.subText),n.children&&!n.element){const s=k("div",["menu-item-sub-indicator"],null);s.innerHTML=ev,t.appendChild(s)}if((o=n.states)!=null&&o.includes("checked")){const s=k("div",["menu-item-checked-icon"],null);s.innerHTML=xL,t.appendChild(s)}}}}class Us extends Yh{constructor(t,e,o){super(t,e,{autoClose:!0,disablePageScroll:!0,...o})}manualShow(t,e){const o={theme:"menu",...e};super.manualShow(t,o)}initCommandBarElement(t){W(t,"menu")}initItemElement(t,e){nM(t,e)}}function oM(n,t,e){var o;return new Us((o=n.children)!=null?o:[],t,{...e,parentItem:n})}function Av(n,t,e){t.setAttribute("data-button-id",n.id),e.tooltipId&&n.name&&!n.disableTooltip&&(t.setAttribute(`data-editor-tooltip-${e.tooltipId}`,n.name),n.desc&&t.setAttribute(`data-editor-tooltip-desc-${e.tooltipId}`,n.desc));const o=t;if(!n.element)if(n.icon){const r=k("span",["toolbar-item-icon-container"],o);n.icon.trim().startsWith("<")?r.innerHTML=n.icon:r.innerText=n.icon}else{const r=k("span",["toolbar-item-name-container"],o);r.innerText=n.name}if(n.dropdown){t.setAttribute("data-dropdown","true");const r=k("span",["toolbar-item-dropdown-container"],o);r.innerHTML=Qh}n.states&&(n.states.indexOf("checked")!==-1&&W(o,"checked"),n.states.indexOf("disabled")!==-1&&(o.disabled=!0))}class ru extends Yh{constructor(t,e,o){super(t,e,{itemElementTag:"button",tippyArrow:!1,...o})}getSubBarOptions(t){var r,i;const e=()=>{const s=this.getItemElementById(t.id),a=this.content.getBoundingClientRect(),d=s.getBoundingClientRect();return new DOMRect(d.left,a.top,d.width,a.height)};return{placement:(r=t.childrenPlacement)!=null?r:"top",getReferenceClientRect:e,offset:(i=t.childrenOffset)!=null?i:[0,4]}}manualShow(t,e){const o={theme:"toolbar",...e};super.manualShow(t,o)}initCommandBarElement(t){W(t,"toolbar")}initItemElement(t,e){Av(t,e,this.options)}}function rM(n,t,e){var o;return new ru((o=n.children)!=null?o:[],t,{...e,parentItem:n})}class iM extends Ui{constructor(t,e,o){super(e,void 0,o),t.appendChild(this.content),document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}initCommandBarElement(t){W(t,"toolbar","fixed")}initItemElement(t,e){Av(t,e,this.options)}close(){this.clearSelectedItem(),this.subBar&&(this.subBar.close("cancelBar"),this.subBar=null)}destroy(){this.content.remove(),super.destroy(),document.removeEventListener("keydown",this.handleDocumentKeydown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}getCommandBarRoot(){return this.content.parentElement}get isVisible(){return!0}}const wnt="";Ui.registerManualCommandBar("menu",oM),Ui.registerManualCommandBar("toolbar",rM);const Bnt="",bv=S("ui-base");class iu extends Yh{constructor(e,o){super(iu.getCommandItems(e,o),void 0,{disablePageScroll:!0,...o});m(this,"handleDocumentMouseDown",e=>{})}initCommandBarElement(e){W(e,"dialog","manual")}initItemElement(e,o){}show(e,o){this.manualShow(e,{...o,theme:"light"})}get dialogContent(){const e=this.items[0];g(bv,e,"no dialog item");const o=e.element;return g(bv,o,"no item element"),o}static getCommandItems(e,o){var s;return[{id:(s=o==null?void 0:o.id)!=null?s:`manual-dialog-${K()}`,name:"",element:e}]}}const Ent="",sM=S("ui-base");class vv{constructor(t){m(this,"menu");m(this,"currentText","");m(this,"handleSearchText");m(this,"handleClick",Le.default((t,e)=>{this.options.onClickItem(this,e)},3e3,{leading:!0,trailing:!1}));m(this,"handleShow",t=>{});m(this,"handleClose",()=>{var t,e;(e=(t=this.options).onClose)==null||e.call(t)});m(this,"handleKeydown",t=>{this.menu.handleDocumentKeydown(t)});this.options=t,this.menu=new Us([],void 0,{id:t.id,header:t.header,footer:t.footer}),this.menu.addListener("click",this.handleClick),this.menu.addListener("close",this.handleClose),this.menu.addListener("show",this.handleShow),this.options.wait?this.handleSearchText=Le.default(async e=>{this.handleSearchTextPure(e)},this.options.wait):this.handleSearchText=this.handleSearchTextPure}setItems(t){if(this.menu.updateItems(t),t.length>0){const e=t.find(o=>o.type!=="section"&&o.type!=="separator");e&&this.menu.selectItem(e.id)}}async popup(t,e){var r,i;if(!(e!=null&&e.noEvent)&&((i=(r=this.options).onShow)==null?void 0:i.call(r,this))===!1)return;this.menu.manualShow(t),this.options.placeholder&&this.showPlaceholder();const o=await this.options.queryItems(this,"");this.highlightText("",o),this.setItems(o)}showLoading(){!this.options.showLoading||(this.options.loadingElement?this.setItems([{id:"loading",name:"",element:this.options.loadingElement,states:["disabled"]}]):this.setItems([{id:"loading",name:"loading",states:["disabled"]}]))}showPlaceholder(){this.setItems([{id:"placeholder",name:"enter text to search",states:["disabled"]}])}showNoResultMessage(t){if(this.options.noResultMessage){const e={name:"",id:"placeholder",states:["disabled"]};typeof this.options.noResultMessage=="string"?e.name=this.options.noResultMessage:(this.options.noResultMessage instanceof HTMLElement||typeof this.options.noResultMessage=="function")&&(e.element=this.options.noResultMessage),this.setItems([e])}else this.setItems([{id:"placeholder",name:this.options.emptyPlaceholder||L.t("search.emptyTips"),states:["disabled"]}])}close(){this.menu.close("cancelBar")}get isVisible(){return this.menu.isVisible}destroy(){this.menu.close("cancelBar"),this.menu.removeAllListeners(),this.menu.destroy()}async handleSearchTextPure(t){this.currentText=t;const e="auto-suggest";try{await xo.lock(e),this.showLoading();const o=this.currentText,r=await this.options.queryItems(this,o);if(this.currentText===o&&(this.currentText=""),r.length===0){this.showNoResultMessage(t);return}this.setItems(r),this.options.highlight&&this.highlightText(o.replace(/^\s+|\s+$/g,""),r)}finally{xo.release(e)}}highlightText(t,e){sM.debug(`highlight menu text: ${t}`);const o=this.menu.content,r=(s,l)=>{if(!l)return s;let a="";const d=l.length,h=l.toLocaleLowerCase();let p=0;for(p=0;p<=s.length-d;p){let A=s.substring(p,p+d);if(A.toLocaleLowerCase()===h){p+=d;const v=s.charAt(p);let B=!1;A.endsWith(" ")&&(B=!0,A=A.trimEnd()),a+=`<span class="highlight">${A}${v===" "||B?"&nbsp":""}</span>`}else a+=s.charAt(p),p++}return p<s.length&&(a+=s.substring(p)),a},i=s=>{if(xt(s,"text")){const l=e==null?void 0:e.find(h=>h.id===s.getAttribute("data-id"));if(l&&l.element)return;const a=s.textContent;if(!a)return;const d=r(a,t);s.innerHTML=d;return}Array.from(s.children).forEach(i)};i(o)}}class Rp{constructor(t,e){m(this,"root");m(this,"input");m(this,"text");m(this,"dropdownIcon");m(this,"clearIcon");m(this,"autoSuggest");m(this,"labels");m(this,"items",[]);m(this,"handleClick",()=>{this.autoSuggest.popup(this.root),this.input.focus()});m(this,"handleClickItem",(t,e)=>{var o,r;(r=(o=this.options)==null?void 0:o.onClickItem)==null||r.call(o,e)});m(this,"handleInput",()=>{this.autoSuggest.handleSearchText(this.input.value),this.updatePlaceholder()});m(this,"handleClear",t=>{var e,o;this.clear(),this.autoSuggest.handleSearchText(""),t.preventDefault(),t.stopPropagation(),(o=(e=this.options)==null?void 0:e.onClear)==null||o.call(e)});m(this,"handleQueryItems",async(t,e)=>this.items.filter(r=>{var i;return(i=this.options)!=null&&i.filter?this.options.filter(r,e):!0}));m(this,"handleShow",()=>{W(this.root,"active"),this.input.focus()});m(this,"handleClose",()=>{var t,e;(e=(t=this.options)==null?void 0:t.onClose)==null||e.call(t),ot(this.root,"active")});var a,d,h,p,A;this.options=e,this.labels=(d=(a=this.options)==null?void 0:a.labels)!=null?d:[];const{root:o,input:r,text:i,clearIcon:s,dropdownIcon:l}=Rp.createDropdown(t,this.labels);this.root=o,this.input=r,this.text=i,this.clearIcon=s,this.dropdownIcon=l,this.autoSuggest=new vv({id:(e==null?void 0:e.popupId)||"dropdown-auto-suggest",header:(h=this.options)==null?void 0:h.header,onClickItem:this.handleClickItem,queryItems:this.handleQueryItems,onClose:this.handleClose,onShow:this.handleShow,highlight:e==null?void 0:e.highlight,emptyPlaceholder:e==null?void 0:e.emptyPlaceholder}),this.items=(A=(p=this.options)==null?void 0:p.items)!=null?A:[],this.root.addEventListener("click",this.handleClick),this.input.addEventListener("input",this.handleInput),this.clearIcon.addEventListener("click",this.handleClear)}close(){this.autoSuggest.close()}destroy(){this.input.removeEventListener("input",this.handleInput),this.root.removeEventListener("click",this.handleClick),this.clearIcon.removeEventListener("click",this.handleClear),this.autoSuggest.destroy()}updateItems(t){this.items=t,this.autoSuggest.handleSearchText("")}setText(t){this.text.innerText=t,this.input.value=t,this.updatePlaceholder()}clear(){this.setText(""),this.setLabels([])}setLabels(t){this.labels=t,this.updateLabels()}static createDropdown(t,e){const o=k("div",["editor-dropdown","empty"],t),r=k("input",["dropdown-input"],o),i=k("div",["dropdown-text"],o),s=k("div",["dropdown-labels"],o);for(let d=0;d<e.length;d+=1){const h=e[d];k("span",["dropdown-label"],s,h)}const l=k("div",["dropdown-clear-icon"],o);l.innerHTML=qL;const a=k("div",["dropdown-icon"],o);return a.innerHTML=Qh,{root:o,input:r,text:i,clearIcon:l,dropdownIcon:a}}updateLabels(){const t=this.root.querySelector(".dropdown-labels");if(t){t.innerHTML="";for(let e=0;e<this.labels.length;e+=1){const o=this.labels[e];k("span",["dropdown-label"],t,o)}}}updatePlaceholder(){var t;if(this.input.value===""){const e=(t=this.options)==null?void 0:t.placeholder;e&&(this.input.placeholder=e,this.text.textContent=e),W(this.root,"empty")}else ot(this.root,"empty")}}const lM=[-1,6,0,1,2,3,4,5],cM=[-1,6,0,1,2,3,4,5,14,13,7,8,9,10,11,12],yv=S("color-palette");function kv(n,t,e,o){g(yv,n>0,"no color in palette");const r=t||1;g(yv,r>0,`invalid palette rows: ${r}`);const i=n/r,s=k("div",["palette-container",o],null);for(let l=0;l<r;l++){const a=k("div",["palette-container-row"],s);for(let d=0;d<i;d++){const h=e(l*i+d);a.appendChild(h)}}return s}function aM(n){const t=k("button",["color-button"],null),e=lM[n];return t.setAttribute("data-color-index",`${e}`),t.innerHTML=tv,t}function uM(n){const t=k("button",["background-color-button"],null),e=cM[n];return t.setAttribute("data-color-index",`${e}`),t}function dM(){const n=k("div",["clear-button-container"],null),t=k("button",["clear-button"],n);return t.innerText=L.t("colorPalette.reset"),n}function hM(n){const t=k("div",["color-palette"],null);return n.color!==!1&&(k("div",["bar-desc"],t,L.t("colorPalette.colorDesc")),t.appendChild(kv(8,1,aM,"color"))),n.backgroundColor!==!1&&(k("div",["bar-desc"],t,L.t("colorPalette.backgroundDesc")),t.appendChild(kv(16,2,uM,"background-color"))),n.clearColorButton!==!1&&t.appendChild(dM()),t}function fM(n,t,e){const o=t==="color"?"color":"background-color",r=n.querySelector(`.${o} button.selected`);r&&ot(r,"selected"),e===null&&(e=-1);const i=n.querySelector(`.${o} button[data-color-index="${e}"]`);i&&W(i,"selected")}const xnt="",mM={};class gM extends ve.TypedEmitter{constructor(e=mM){super();m(this,"root");m(this,"handleClick",e=>{const o=e.target;if(!o||!(o instanceof Element))return;const r=o.closest("button");if(!r)return;if(xt(r,"clear-button")){this.setColor("backgroundColor",null),this.setColor("color",null),this.emit("onClick","clearColor",0);return}const i=r.getAttribute("data-color-index");if(!i)return;const s=Number.parseInt(i,10);Number.isNaN(s)||(xt(r,"color-button")?s===-1?(this.setColor("color",null),this.emit("onClick","clearColor",1)):(this.setColor("color",s),this.emit("onClick","color",s)):s===-1?(this.setColor("backgroundColor",null),this.emit("onClick","clearColor",2)):(this.setColor("backgroundColor",s),this.emit("onClick","backgroundColor",s)))});this.options=e,this.root=hM(e),this.root.addEventListener("click",this.handleClick)}destroy(){this.removeAllListeners(),this.root.removeEventListener("click",this.handleClick)}setColor(e,o){fM(this.root,e,o)}}class wv{constructor(t,e){m(this,"name","Color Palette");m(this,"element");m(this,"palette");m(this,"closeable",null);this.id=t,this.palette=new gM(e),this.element=this.palette.root}setCloseable(t){this.closeable=t}destroy(){this.palette.destroy(),this.closeable=null}}function pM(){const n=k("button",["color-button"],null);return n.innerHTML=tv,n}function Op(n,t){const[e,o]=t;e===null?n.removeAttribute("data-color"):n.setAttribute("data-color",`${e}`),o===null?n.removeAttribute("data-background-color"):n.setAttribute("data-background-color",`${o}`)}class CM extends ve.TypedEmitter{constructor(e){super();m(this,"id","text-color-item");m(this,"name",L.t("colorPalette.name"));m(this,"dropdown",!0);m(this,"manualShowChildren",!0);m(this,"children",[]);m(this,"element");m(this,"colorPaletteItem");m(this,"latestColors",[null,null]);m(this,"handlePaletteClick",(e,o)=>{this.emit("onClick",e,o),e==="color"||e==="backgroundColor"?e==="color"?this.latestColors[0]=o:this.latestColors[1]=o:this.latestColors=[null,null],Op(this.element,this.latestColors)});m(this,"beforePopup",()=>{this.emit("beforePopup")});this.editor=e,this.colorPaletteItem=new wv("text-color-palette-item"),this.colorPaletteItem.palette.addListener("onClick",this.handlePaletteClick),this.children.push(this.colorPaletteItem),this.element=pM()}destroy(){this.colorPaletteItem.destroy()}updatePaletteColor(e){this.colorPaletteItem.palette.setColor("color",e[0]),this.colorPaletteItem.palette.setColor("backgroundColor",e[1]),this.latestColors=e,Op(this.element,this.latestColors)}updateButtonColor(e){this.latestColors=e,Op(this.element,this.latestColors)}}const Int="";function _p(n,t){const e=k("div",["editor-input-wrap"],n);t!=null&&t.className&&W(e,t==null?void 0:t.className);const o=k("div",["editor-input-label"],e);k("span",[],o,t.label),t.required&&W(o,"required");const r=k("div",["editor-input-container"],e),i=k("input",["editor-input"],r);t.placeholder&&(i.placeholder=t.placeholder),t.defaultValue&&(i.value=t.defaultValue);const s=k("div",["editor-input-error"],e);return i.addEventListener("input",l=>{var a;(a=t.onChange)==null||a.call(t,l),ot(e,"error")}),i.addEventListener("keydown",l=>{var a;(a=t.onKeyDown)==null||a.call(t,l)}),{getField:()=>i,getInputValue:()=>i.value,setFieldError:l=>{W(e,"error"),s.innerText=l},focus:()=>{setTimeout(()=>{i.focus()})}}}function Fp(n){const t=document.getSelection();if(!t)return!0;const e=t.focusNode;if(!e)return!0;const o=t.focusOffset,r=e.childNodes[o];if(!r)return!0;if(r instanceof HTMLElement){const i=r.tagName.toLowerCase();if(r===n.input.inputElement)return!0;if(i==="input"||i==="textarea")return!1}return!0}class AM extends vv{constructor(e,o){super(o);m(this,"handleClose",()=>{var e,o;Fp(this.editor)&&this.editor.focus(),(o=(e=this.options).onClose)==null||o.call(e)});this.editor=e,this.editorOptions=o}async popupInEditor(e,o,r){var d,h;if(((h=(d=this.editorOptions).onShow)==null?void 0:h.call(d,this,e,o,r))===!1)return;this.options.showLoading&&this.showLoading();const i=this.editor.getBlockByIndex(e,o);if(!Xt(this.editor.rootContainer,i)||ut(this.editor,i)<r)return;const s=$r(this.editor,i,ke(this.editor,i,r));if(s.length===0)return;const l=s[0],a=Vr(this.editor,i,"editor-auto-suggest-menu",l);super.popup(a,{noEvent:!0})}}const Pp=S("auto-suggest-menu");class Np{constructor(t,e){m(this,"order",100);m(this,"menu");m(this,"anchor",null);m(this,"close",()=>{this.menu.close()});m(this,"handleSelectionChanged",t=>{var o,r;if(!((o=this.menu)!=null&&o.isVisible))return;const e=t.selection.range.start;if(e.isSimple()&&e.blockId===((r=this.anchor)==null?void 0:r.blockId)&&e.offset>=this.anchor.offset){const i=t.getBlockById(e.blockId);if(ie(Tn(pn(t,i),e.offset).left).startsWith(this.anchor.leftText))return}this.menu.close()});m(this,"deleteTrigger",()=>{const t=this.editor,e=t.selection.range.start;if(!e.isSimple()||!this.anchor)return!1;const{blockId:o,offset:r}=e,i=t.getBlockById(o),s=ie(bh(t,i,r));if(g(Pp,this.anchor,"no anchor"),!s.startsWith(this.anchor.leftText))return!1;const l=this.anchor.offset-this.anchor.trigger.length,a=r-l;return t.selection.selectBlock(i,l),a&&(t.deleteTextFromBlock(i,l,a),this.anchor.offset-=this.anchor.trigger.length),this.anchor.trigger.length||this.menu.close(),!0});m(this,"onClose",()=>{var t,e;(e=(t=this.options).onClose)==null||e.call(t)});m(this,"onShow",(t,e,o,r)=>{var i;if((i=this.options)!=null&&i.onShow)return this.options.onShow(this,e,o,r)});m(this,"onClickItem",(t,e)=>{!this.anchor||(this.options.autoDeleteTrigger&&this.deleteTrigger(),this.options.onClickItem(this,e,this.anchor))});m(this,"queryItems",(t,e)=>this.options.queryItems(this,e));m(this,"renderMenuItem",(t,e)=>{var r,i;return(i=(r=this.options).renderMenuItem)==null?void 0:i.call(r,this,e)});this.editor=t,this.options=e,this.menu=new AM(t,{id:e.id,showLoading:e.showLoading,loadingElement:e.loadingElement,placeholder:e.placeholder,header:e.header,footer:e.footer,wait:e.wait,noResultMessage:e.noResultMessage,highlight:e.highlight,onClose:this.onClose,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems,renderMenuItem:this.renderMenuItem}),t.input.addHandler(this),t.addListener("selectionChanged",this.handleSelectionChanged)}handleBeforeKeyDown(t,e){var o;return!((o=this.menu)!=null&&o.isVisible)||Em(e.key)?!1:y5(e)&&!ks(e)?(setTimeout(()=>{this.resetItems()}),!1):xm(e)?(this.menu.close(),!0):(this.menu.handleKeydown(e),!0)}popup(t,e,o,r){this.anchor={blockId:it(t),offset:e,leftText:o,trigger:r};const i=ct(nt(t)),s=bt(t);this.menu.popupInEditor(i,s,e)}handleAfterInsertText(t,e,o,r,i){var h,p;const s=t.selection.range.start;if(!s.isSimple()||!this.options.enableFirstBlock&&e==="root"&&o===0)return!1;const{blockId:l,offset:a}=s,d=t.getBlockByIndex(e,o);if(it(d)!==l)return!1;if((h=this.menu)!=null&&h.isVisible)this.resetItems();else if(this.options.trigger.indexOf(i)!==-1){if(r>0&&this.options.needSpaceBeforeTrigger&&(((p=t.getBlockData(d).text)==null?void 0:p.reduce((D,x)=>D+x.insert,""))||"")[r-1]!==" "||Ui.hasExistsCommandBar())return!1;const A=ie(bh(t,d,a));this.popup(d,a,A,i)}return!1}handleUpdateCompositionText(t,e,o,r,i){var d;const s=t.selection.range.start;if(!s.isSimple())return!1;const{blockId:l}=s,a=t.getBlockByIndex(e,o);return it(a)!==l||(d=this.menu)!=null&&d.isVisible&&this.resetItems(),!1}resetItems(){var l;if(!((l=this.menu)!=null&&l.isVisible))return;const t=this.editor,e=t.selection.range.start;if(!e.isSimple())return;const{blockId:o,offset:r}=e,i=t.getBlockById(o),s=ie(bh(t,i,r));if(g(Pp,this.anchor,"no anchor"),s.startsWith(this.anchor.leftText)){const a=s.substring(this.anchor.leftText.length);Pp.debug(`search text: ${a}`),this.menu.handleSearchText(a)}}destroy(){var t;this.editor.input.removeHandler(this),this.editor.removeListener("selectionChanged",this.handleSelectionChanged),(t=this.menu)==null||t.destroy()}}function bM(){const n={};for(let t=1;t<=8;t++)n[`heading-${t}`]={shortcut:`/h${t}`};return n}const vM={"insert-hr":{shortcut:"/hr"},"insert-uml":{shortcut:"/uml"},"insert-table":{shortcut:"/table"},"insert-image":{shortcut:"/image"},"insert-code":{shortcut:"/code"},"insert-link":{shortcut:"/link"},"insert-drawio":{shortcut:"/uml"},"insert-video":{shortcut:"/video"},"insert-audio":{shortcut:"/audio"},"insert-math":{shortcut:"/math"},"insert-webPage":{shortcut:"/web"},"insert-bilibili":{shortcut:"/bilibili"},"insert-youku":{shortcut:"/youku"},"insert-figma":{shortcut:"/figma"},"insert-modao":{shortcut:"/modao"},"insert-tencent":{shortcut:"/tencent"},"insert-unordered":{shortcut:"/bl"},"insert-ordered":{shortcut:"/nu"},"insert-checkbox":{shortcut:"/todo"},"insert-quote":{shortcut:"/quote"},...bM()};function An(n){var t;return(t=vM[n])==null?void 0:t.shortcut}function yM(n){var t;return(t=n.subText)!=null?t:""}const fr=S("table-dom");function mr(n){return`${it(n)}_scroll`}function _e(n){const t=n.querySelector("div[data-type=table-content] >table");return g(fr,t instanceof HTMLTableElement,"invalid table"),t}function gr(n,t){const o=n.getCustom(mr(t)).contentElement.firstElementChild;g(fr,o instanceof HTMLElement,"invalid table content");let r=o.querySelector(":scope >div[data-type=table-tools]");return r||(r=k("div",[],o),r.setAttribute("data-type","table-tools"),n.domEvents.addEventListener(r,"dblclick",(i,s)=>s.stopPropagation()),n.domEvents.addEventListener(r,"click",(i,s)=>{s.detail===3&&s.stopPropagation()})),g(fr,r,"no table tools"),r}function kM(n,t){return n.findCustom(mr(t))?gr(n,t):null}function Bv(n){const t=[];return Array.from(n.rows).forEach(e=>{t.push(...Array.from(e.cells))}),t}function su(n){const t=n.querySelector(":scope div[data-type=editor-container]");return g(fr,t,"no child container in cell"),t}function wM(n){const o=Bv(n).map(r=>{const i=su(r),s=ct(i),l=r.colSpan,a=r.rowSpan;return`${s}/${l}/${a}`}).join();return Nd.default(o)}function Ve(n){return Dt(n)==="table"}function $p(n){const t=nt(n);if(Gt(t))return null;const e=tt(t);return g(fr,e,"no parent block"),Ve(e)?t:$p(e)}function Jr(n){if(Ve(n))return n;const t=nt(n);if(Gt(t))return null;const e=tt(t);return g(fr,e,"no parent block"),Ve(e)?e:Jr(e)}function BM(n,t){const e=n.querySelector("colgroup");g(fr,e,"no colgroup");const o=e.children[t];return g(fr,o,"no col"),g(fr,o instanceof HTMLTableColElement,`invalid col: ${o.tagName}`),o}function Ev(n){try{return _e(n),!0}catch{return!1}}function EM(n){return te(n).querySelector(":scope > .block-helper")}function xv(n){const t=tt(n.contentElement);g(fr,t,"no block");const e=EM(t);if(e){const i=Math.min(n.contentElement.offsetLeft+29,n.rootElement.scrollLeft),s=t.getBoundingClientRect().width;e.style.right=`${i+s+5}px`}}const Gn=S("doc-table-grid");class xM{constructor(t){m(this,"_cells",[]);for(let e=0;e<t;e++)this._cells.push(void 0)}cols(){return this._cells.length}setCell(t,e){g(Gn,t>=0&&t<this.cols(),`set cell, invalid col: ${t}`),this._cells[t]=e}getCell(t){g(Gn,t>=0&&t<this.cols(),`get cell, invalid col: ${t}`);const e=this._cells[t];return g(Gn,e,"get cell, no cell"),e}getCellAllowEmpty(t){return g(Gn,t>=0&&t<this.cols(),`get cell, invalid col, ${t}`),this._cells[t]}getNextNonVirtualCell(t){return this._cells.slice(t+1).find(e=>!e.virtual)}forEach(t){this._cells.forEach(t)}}class Jh{constructor(t){m(this,"_data");m(this,"_rows");this._data=t,this._rows=[];for(let e=0;e<this.rowCount;e++)this._rows.push(new xM(this.colCount));this.fillGrid(),g(Gn,t.colsWidth,"no colsWidth"),g(Gn,this.colCount===t.colsWidth.length,"invalid col count")}get rowCount(){return this._data.rows}get colCount(){return this._data.cols}getNextEmptyCell(t,e){let o=t,r=e;for(;;){if(o+=1,o===this.colCount&&(o=0,r+=1),r>=this.rowCount)return null;if(this._rows[r].getCellAllowEmpty(o)===void 0)return{col:o,row:r}}}fillGrid(){const t=this._data.children;g(Gn,t,"no children");let e=0,o=0;t.forEach((r,i)=>{const s=this._data[`${r}_colSpan`]||1,l=this._data[`${r}_rowSpan`]||1;for(let d=0;d<l;d++)for(let h=0;h<s;h++)this._rows[o+d].setCell(e+h,{col:e,row:o,containerId:r,virtual:h!==0||d!==0,colSpan:s,rowSpan:l});const a=this.getNextEmptyCell(e,o);a?(e=a.col,o=a.row):g(Gn,i===t.length-1,`invalid table data, no next empty cell: ${JSON.stringify(this._data)}`)}),this._rows.forEach(r=>{r.forEach(i=>{g(Gn,i,"no cell"),g(Gn,i.containerId,"no containerId")})})}getCell(t){const{col:e,row:o}=t,r=this._rows[o];g(Gn,r,`get cell, no row: ${o}`);const i=r.getCell(e);return g(Gn,i,`get cell, no cell: ${e}`),i}getRow(t){const e=this._rows[t];return g(Gn,e,`get row, no row: ${t}`),e}forEach(t){this._rows.forEach(t)}}const Kh=S("table-data");function IM(n){const t=n.firstElementChild;return g(Kh,t,"no child element for cell"),g(Kh,Nr(t),"cell first child is not a container"),g(Kh,Lo(t),"cell first child is not a container"),t}function TM(n){const t=tt(n);g(Kh,t,"no parent block for table");const e=[],o={};Array.from(n.rows).forEach(l=>{Array.from(l.cells).forEach(a=>{const d=IM(a),h=ct(d);e.push(h),(a.colSpan>1||a.rowSpan>1)&&(o[`${h}_colSpan`]=a.colSpan,o[`${h}_rowSpan`]=a.rowSpan)})});const r=n.rows.length,i=Array.from(n.rows[0].cells).map(l=>l.colSpan).reduce((l,a)=>l+a,0);return{id:it(t),type:Dt(t),rows:r,cols:i,children:e,colsWidth:Array(i).fill(100),...o}}function zs(n){return new Jh(n)}function DM(n){return zs(TM(n))}const We=S("table-grid"),SM=60;class LM{constructor(t,e){m(this,"containerId");m(this,"row");m(this,"col");m(this,"colSpan");m(this,"rowSpan");m(this,"virtual");m(this,"table");this.table=t,this.containerId=e.containerId,this.row=e.row,this.col=e.col,this.colSpan=e.colSpan,this.rowSpan=e.rowSpan,this.virtual=e.virtual}get cell(){const e=this.container.closest("td");return g(We,e,"no parent cell for child container"),e}get container(){const t=this.table.querySelectorAll(`[data-container-id=${this.containerId}]`);g(We,t.length===1,"containers !== 1"),g(We,Nr(t[0]),"not a container");const e=t[0];return g(We,Lo(e),"not a child container"),e}}class MM{constructor(t,e){m(this,"_cells",[]);e.forEach(o=>{this._cells.push(new LM(t,o))})}get cells(){return this._cells}getCell(t){return g(We,t<this._cells.length,"get cell, invalid col"),this._cells[t]}getNextNonVirtualCell(t){return this._cells.slice(t+1).find(e=>!e.virtual)}getSpannedCell(){return this._cells.find(t=>t.virtual||t.colSpan>1||t.rowSpan>1)}}const X2=class{constructor(t){m(this,"_rows",[]);this.table=t,DM(t).forEach(r=>{this._rows.push(new MM(t,r))});const o=this.colCount;this._rows.forEach(r=>{g(We,r.cells.length===o,"row.cells.length !== colCount")})}get rowCount(){return this._rows.length}get colCount(){return this._rows.length===0?0:(g(We,this.rowCount>0,"rowCount <= 0"),this.getRow(0).cells.length)}getRow(t){return this._rows[t]}getCell(t){const e=this.getRow(t.row);return g(We,e,"no row"),e.getCell(t.col)}getCellContainer(t){return this.getCell(t).container}getFirstCellContainer(){return this.getCellContainer({row:0,col:0})}getLastCellContainer(){const t=this.rowCount-1,e=this.colCount-1;return this.getCellContainer({row:t,col:e})}getColumnCells(t){g(We,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount,o=[];for(let r=0;r<e;r++){const i=this.getCell({row:r,col:t});o.push(i)}return o}toRealCells(t){const e=[];return t.forEach(o=>{const r=this.getRealCell(o);e.findIndex(i=>i.containerId===r.containerId)===-1&&e.push(r)}),e}getColumnRealCells(t){const e=this.getColumnCells(t);return this.toRealCells(e)}getRowRealCells(t){const e=this.getRow(t).cells;return this.toRealCells(e)}getFirstSpannedCell(t){g(We,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount;for(let o=0;o<e;o++){const r=this.getCell({row:o,col:t});if(r.virtual||r.colSpan>1||r.rowSpan>1)return r}}getRealCell(t){const e=this.getCell(t);if(!e.virtual)return e;const o=this.getCellById(e.containerId);return g(We,!o.virtual,"found a virtual cell"),o}getColumnSpannedRange(t){const e=this.getColumnRealCells(t);let o=1e5,r=-1;return e.forEach(i=>{o=Math.min(i.col,o),r=Math.max(i.col+i.colSpan-1,r)}),g(We,o<=r,"min > max"),g(We,o>=0,"min < 0"),g(We,r<this.colCount,"max >= colCount"),[o,r]}getRowSpannedRange(t){const e=this.getRowRealCells(t);let o=1e5,r=-1;return e.forEach(i=>{o=Math.min(i.row,o),r=Math.max(i.row+i.rowSpan-1,r)}),g(We,o<=r,"min > max"),g(We,o>=0,"min < 0"),g(We,r<this.rowCount,"max >= rowCount"),[o,r]}getSpannedRange(t,e){const o=Math.min(t.row,e.row),r=Math.max(t.row,e.row),i=Math.min(t.col,e.col),s=Math.max(t.col,e.col),l=[];for(let v=o;v<=r;v++)for(let B=i;B<=s;B++)l.push(this.getCell({row:v,col:B}));const a=this.toRealCells(l);let d=1e4,h=1e4,p=-1,A=-1;return a.forEach(v=>{h=Math.min(v.col,h),d=Math.min(v.row,d),A=Math.max(v.col+v.colSpan-1,A),p=Math.max(v.row+v.rowSpan-1,p)}),[{row:d,col:h},{row:p,col:A}]}getAllCells(){return this.getCells({col:0,row:0},{col:this.colCount-1,row:this.rowCount-1})}sub(t,e){const o=[];for(let r=t.row;r<=e.row;r++){const i=[];for(let s=t.col;s<=e.col;s++){const l=this.getCell({row:r,col:s});i.push(l)}o.push(i)}return o}getAllContainers(){return this.getAllCells().map(e=>e.container)}getCells(t,e){const o=[],r=this.getSpannedRange(t,e),i=r[0],s=r[1],l=Math.min(i.row,s.row),a=Math.max(i.row,s.row),d=Math.min(i.col,s.col),h=Math.max(i.col,s.col);for(let p=l;p<=a;p++)for(let A=d;A<=h;A++){const v=this.getCell({row:p,col:A});v.virtual||o.push(v)}return o}map(t){const e=[];for(let o=0;o<this.rowCount;o++){const r=[];for(let i=0;i<this.colCount;i++){const s=this.getCell({row:o,col:i});r.push(t(s))}e.push(r)}return e}getBottomCell(t){const e=this.rowCount;let o=t,r=t.row;for(;o.containerId===t.containerId;){if(r+=1,r>=e)return null;o=this.getCell({row:r,col:t.col})}return this.getRealCell(o)}getTopCell(t){let e=t,o=t.row;for(;e.containerId===t.containerId;){if(o-=1,o<0)return null;e=this.getCell({row:o,col:t.col})}return this.getRealCell(e)}get cells(){let t=[];return this._rows.forEach(e=>{t=t.concat(e.cells)}),t}getVirtualCellContainersGrid(){return this.map(t=>t.containerId)}static virtualCellContainersGridToChildren(t){const e=t,o=[];return e.forEach(r=>{r.forEach(i=>{o.indexOf(i)===-1&&o.push(i)})}),o}getCellById(t){const o=this.cells.find(r=>r.containerId===t);return g(We,o,"cell not found"),o}getCellByCellElement(t){const e=su(t);return this.getCellByContainerId(ct(e))}getCellByContainerId(t){return this.getCellById(t)}static fromTable(t){const e=wM(t),o=this.caches.getSync(e,()=>(We.debug("create table grid"),new X2(t)));return o.table!==t?(this.caches.delete(e),this.fromTable(t)):o}static fromBlock(t){return this.fromTable(_e(t))}};let Tt=X2;m(Tt,"caches",new t5(SM));function Xh(n,t){Object.entries(n).forEach(([e])=>{e.startsWith(`${t}/`)&&delete n[e]})}const RM=S("table-selection-range");function Uo(n,t,e){var R,H,z,q;const o=Tt.fromBlock(n),r=t,i=e,s=o.getCellByContainerId(r.childContainerId),l=o.getCellByContainerId(i.childContainerId),a=r.custom,d=i.custom,h=(R=a==null?void 0:a.rowIndex)!=null?R:s.row,p=(H=a==null?void 0:a.colIndex)!=null?H:s.col,A=(z=d==null?void 0:d.rowIndex)!=null?z:l.row+l.rowSpan-1,v=(q=d==null?void 0:d.colIndex)!=null?q:l.col+l.colSpan-1,B=Math.min(h,A),D=Math.max(h,A),x=Math.min(p,v),_=Math.max(p,v);return{fromRow:B,toRow:D,fromCol:x,toCol:_}}function Hp(n,t){const e=new Set,o=new Set,r=n.selection.range;if(!r.isSimple()&&r.start.blockId===it(t)){const i=Tt.fromBlock(t),{start:s,end:l}=r;g(RM,!s.isSimple()&&!l.isSimple(),"invalid range");const{fromCol:a,toCol:d,fromRow:h,toRow:p}=Uo(t,s,l);if(h===0&&p===i.rowCount-1)for(let A=a;A<=d;A++)o.add(A);if(a===0&&d===i.colCount-1)for(let A=h;A<=p;A++)e.add(A)}return{selectedRows:e,selectedColumns:o}}function lu(n,t){let e=null;if(t.isCollapsed()&&t.isSimple()){const o=n.getBlockById(t.start.blockId);if(Ve(o)){const r=nt(o),i=tt(r);i&&(e=Jr(i))}else e=Jr(o)}else{const o=n.getBlockById(t.start.blockId),r=Jr(o),i=n.getBlockById(t.end.blockId),s=Jr(i);r===s&&(e=r)}return e}const nc=S("delete-columns");function Iv(n,t,e){const{start:o,end:r}=e;if(o.blockId!==r.blockId||e.isSimple()||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{fromRow:s,toRow:l}=Uo(t,e.start,e.end),a=Tt.fromBlock(t);return s===0&&l===a.rowCount-1}function jp(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{var H;const e=t.getBlockById(n.start.blockId);if(!Iv(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromCol:o,toCol:r}=Uo(e,n.start,n.end),i=Tt.fromBlock(e);if(o===0&&r===i.colCount-1){t.deleteBlock(e);return}const s=new Set,l=i.map(z=>z.containerId);for(let z=0;z<l.length;z++){const q=l[z];for(let rt=o;rt<=r;rt++){const ft=q[rt];s.add(ft)}q.splice(o,r-o+1)}const a=new Set(l.flat()),d=new Set(Array.from(s).filter(z=>!a.has(z))),h=r-o+1,p=new Map,A=new Map;s.forEach(z=>{if(d.has(z))return;const q=i.getCellByContainerId(z);if(g(nc,q.colSpan>1,"invalid effected cell, colSpan === 1"),q.col<o){g(nc,a.has(z),"invalid effected cell, not exists");let ne=q.col+q.colSpan-1;ne>r&&(ne=r);const qe=ne-o+1,Yn=q.colSpan-qe;p.set(z,Yn);return}g(nc,q.col<=r,"invalid effected cell, col > endCol");const rt=q.col,ft=q.col+q.colSpan-1,Bt=q.col-o,jt=ft-rt+1-h+Bt;g(nc,jt>0,"invalid effected cell, newSpanned <= 0");const Ut=Gr(t.doc);A.set(z,{newContainerId:Ut,colSpan:jt})});for(let z=0;z<l.length;z++){const q=l[z];for(let rt=o;rt<q.length;rt++){const ft=q[rt],Bt=A.get(ft);Bt&&(q[rt]=Bt.newContainerId)}}const v=mt.default(t.getBlockData(e));v.colsWidth.splice(o,r-o+1),d.forEach(z=>{Xh(v,z)}),p.forEach((z,q)=>{g(nc,z>=1,"invalid modified colSpan, colSpan < 1"),z===1?v[`${q}_colSpan`]=void 0:v[`${q}_colSpan`]=z}),A.forEach((z,q)=>{Xh(v,q);const{newContainerId:rt,colSpan:ft}=z;g(nc,ft>=1,"invalid newContainerData, colSpan < 1"),ft>1&&(v[`${rt}_colSpan`]=ft);const Bt=i.getCellByContainerId(q).rowSpan;Bt>1&&(v[`${rt}_rowSpan`]=Bt)});const D=(H=l[0][o])!=null?H:l[0][o-1],x=t.getChildContainerData(D)[0],_=Tt.virtualCellContainersGridToChildren(l),R={...v,cols:v.cols-h,children:_};zs(R),t.updateBlockData(e,R,ke(t,x.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(A.keys()))})}const oc=S("delete-rows");function Tv(n,t,e){const{start:o,end:r}=e;if(o.blockId!==r.blockId||e.isSimple()||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{fromCol:s,toCol:l}=Uo(t,e.start,e.end),a=Tt.fromBlock(t);return s===0&&l===a.colCount-1}function Up(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{const e=t.getBlockById(n.start.blockId);if(!Tv(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromRow:o,toRow:r}=Uo(e,n.start,n.end),i=Tt.fromBlock(e);if(o===0&&r===i.rowCount-1){t.deleteBlock(e);return}const s=new Set,l=i.map(R=>R.containerId);for(let R=r;R>=o;R--)l[R].forEach(z=>s.add(z)),l.splice(R,1);const a=new Set(l.flat()),d=new Set(Array.from(s).filter(R=>!a.has(R))),h=r-o+1,p=new Map,A=new Map;s.forEach(R=>{if(d.has(R))return;const H=i.getCellByContainerId(R);if(g(oc,H.rowSpan>1,"invalid effected cell, rowSpan === 1"),H.row<o){g(oc,a.has(R),"invalid effected cell, not exists");let jt=H.row+H.rowSpan-1;jt>r&&(jt=r);const Ut=jt-o+1,ne=H.rowSpan-Ut;p.set(R,ne);return}g(oc,H.row<=r,"invalid effected cell, col > endCol");const z=H.row,q=H.row+H.rowSpan-1,rt=H.row-o,ft=q-z+1-h+rt;g(oc,ft>0,"invalid effected cell, newSpanned <= 0");const Bt=Gr(t.doc);A.set(R,{newContainerId:Bt,rowSpan:ft})});for(let R=o;R<l.length;R++){const H=l[R];for(let z=0;z<H.length;z++){const q=H[z],rt=A.get(q);rt&&(H[z]=rt.newContainerId)}}const v=mt.default(t.getBlockData(e));d.forEach(R=>{Xh(v,R)}),p.forEach((R,H)=>{g(oc,R>=1,"invalid modified rowSpan, rowSpan < 1"),R===1?v[`${H}_rowSpan`]=void 0:v[`${H}_rowSpan`]=R}),A.forEach((R,H)=>{Xh(v,H);const{newContainerId:z,rowSpan:q}=R;g(oc,q>=1,"invalid newContainerData, rowSpan < 1"),q>1&&(v[`${z}_rowSpan`]=q);const rt=i.getCellByContainerId(H).colSpan;rt>1&&(v[`${z}_colSpan`]=rt)});const B=l[o]?l[o][0]:l[o-1][0],D=t.getChildContainerData(B)[0],x=Tt.virtualCellContainersGridToChildren(l),_={...v,rows:v.rows-h,children:x};zs(_),t.updateBlockData(e,_,ke(t,D.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(A.keys()))})}const cu=S("table-range");function tf(n){g(cu,!n.isSimple(),"must be complex selection range");const{anchor:t,focus:e}=n;g(cu,!t.isSimple(),"invalid start pos type"),g(cu,!e.isSimple(),"invalid end pos type");const o=n.getEditor();g(cu,t.blockId===e.blockId,"invalid range, not same block");const r=o.getBlockById(t.blockId);g(cu,Dt(r)==="table","invalid block type, not a table block");const i=_e(r),s=Tt.fromTable(i),l=s.getCellByContainerId(t.childContainerId),a=s.getCellByContainerId(e.childContainerId),d=Math.min(l.row,a.row),h=Math.max(l.row,a.row),p=Math.min(l.col,a.col),A=Math.max(l.col,a.col),v=s.getCell({row:d,col:p}),B=s.getCell({row:h,col:A});return{editor:o,block:r,table:i,startCell:v,endCell:B,startRow:d,startCol:p,endRow:h,endCol:A}}const zp=S("split-cell");function Vp(n,t,e){n.undoManager.runInGroup(()=>{const o=Tt.fromBlock(t),r=o.getRealCell(e);g(zp,!r.virtual,"should not split virtual cell"),g(zp,r.colSpan>1||r.rowSpan>1,"cell does not has span data");const i=o.getVirtualCellContainersGrid();for(let p=0;p<r.rowSpan;p++)for(let A=0;A<r.colSpan;A++){if(p===0&&A===0)continue;const v=p+r.row,B=A+r.col,D=Gr(n.doc);i[v][B]=D}const s=n.getBlockData(t),l=mt.default(s);l[`${r.containerId}_colSpan`]=null,l[`${r.containerId}_rowSpan`]=null,l.children=Tt.virtualCellContainersGridToChildren(i);const d=n.getChildContainerData(r.containerId)[0];g(zp,d,"no child block");const h=ke(n,d.id,0);zs(l),n.updateBlockData(t,l,h)})}function OM(n,t,e){e.forEach(o=>{const r=Tt.fromBlock(t).getCell(o);(r.virtual||r.colSpan>1||r.rowSpan>1)&&Vp(n,t,o)})}function Dv(n,t,e){if(e.isSimple())return!1;const{start:o,end:r}=e;if(o.blockId!==r.blockId||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=tf(e);return!(s.cell!==l.cell||s.colSpan===1&&s.rowSpan===1)}function Wp(n){const{editor:t,block:e,startRow:o,startCol:r,endRow:i,endCol:s}=tf(n),l=[];for(let a=o;a<=i;a++)for(let d=r;d<=s;d++)l.push({row:a,col:d});return OM(t,e,l),!0}const rc=S("merge-cells");function Sv(n,t,e){if(e.isSimple())return!1;const{start:o,end:r}=e;if(o.blockId!==r.blockId||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=tf(e);return s.cell!==l.cell}function Lv(n){const t=tf(n),e=t.editor;e.undoManager.runInGroup(()=>{const o=t.endCell,r=o.row+o.rowSpan-1,i=o.col+o.colSpan-1,s=it(t.block);Wp(n);const l=e.getBlockById(s),a=_e(l),{startRow:d,startCol:h}=t,p=mt.default(e.getBlockData(l));g(rc,p.children,"no table children");const A=Tt.fromTable(a),v=[];for(let jt=d;jt<=r;jt++)for(let Ut=h;Ut<=i;Ut++){const ne=A.getCell({row:jt,col:Ut});g(rc,!ne.virtual,"cell is virtual"),v.push(ne)}g(rc,v.length>0,"no selected cells");const B=v[0],D=v.slice(1),x=A.getCellByContainerId(B.containerId).container,_=[];D.forEach(jt=>{const Ut=A.getCellByContainerId(jt.containerId).container,ne=ct(Ut);if(!Ba(e,Ut)){const qe=FA(e,ne);if(Ba(e,x)){const Yn=fe(x)[0];e.insertDocAt(x,0,qe),e.deleteBlock(Yn)}else e.insertDocAt(x,Io(x),qe)}_.push(ne)});const R=ct(x),H=i-h+1,z=r-d+1;p[`${R}_colSpan`]=H,p[`${R}_rowSpan`]=z,_.forEach(jt=>{g(rc,p.children,"no table children");const Ut=p.children.indexOf(jt);g(rc,Ut>0,"no deleted container"),p.children.splice(Ut,1)});const q=p,ft=e.getChildContainerData(R)[0];g(rc,ft,"no child block");const Bt=ke(e,ft.id,0);zs(q),e.updateBlockData(l,q,Bt),e.deleteChildContainers(_)})}const qp=10,_M=["table/merge-cells","table/split-cell","table/insert-column","table/insert-row","table/delete-rows","table/delete-columns","table/delete"];class ef{constructor(){m(this,"id","TableBlockCommandProvider")}getAvailableCommands(t,e,o){if(Dt(e)!=="table")return[];const r={blockId:it(e),blockKind:Do(t,e),blockType:Dt(e)},i=[];Sv(t,e,o)&&i.push({id:"table/merge-cells",name:L.t("table.mergeCell"),icon:dL,groupIndex:qp,...r}),Dv(t,e,o)&&i.push({id:"table/split-cell",name:L.t("table.splitCell"),icon:hL,groupIndex:qp,...r});const s=Iv(t,e,o),l=Tv(t,e,o);return s&&l&&i.push({id:"table/delete",name:L.t("table.deleteTable"),icon:fL,groupIndex:qp,...r}),i}executeCommand(t,e,o,r,i,s){return Dt(e)!=="table"||!new Set(_M).has(r.id)?!1:r.id==="table/merge-cells"?(Lv(o),!0):r.id==="table/split-cell"?(Wp(o),!0):r.id==="table/delete-columns"?(jp(o),!0):r.id==="table/delete-rows"?(Up(o),!0):r.id==="table/delete"?(t.deleteBlock(e),!0):!1}}var Mv=(n=>(n.COL_TITLE_TABLE="col-title-table",n.COL_TITLE_ITEM="col-title-item",n.STRIPE_STYLE_TABLE="stripe-style-table",n.NO_BORDER="table-no-border",n))(Mv||{});const ic=6,au=20,Gp="table-cell-menu-btn";function FM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasColTitle:!0};n.updateBlockData(t,o)}function PM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasColTitle:!1};n.updateBlockData(t,o)}function NM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasRowTitle:!0};n.updateBlockData(t,o)}function $M(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasRowTitle:!1};n.updateBlockData(t,o)}function HM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),isStripeStyle:!0};n.updateBlockData(t,o)}function jM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),isStripeStyle:!1};n.updateBlockData(t,o)}function UM(n,t,e){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),noBorder:!e};n.updateBlockData(t,r)}const Zp=S("get-selected-containers");function Qp(n,t,e,o){g(Zp,e.blockId===o.blockId,"only allow select in single table block"),g(Zp,it(t)===e.blockId,"only allow select in single table block");const r=Tt.fromBlock(t),i=r.getCellByContainerId(e.childContainerId),s=r.getCellByContainerId(o.childContainerId);if(e.custom===void 0||o.custom===void 0)return r.getCells(i,s).map(x=>r.getCellContainer(x));const{fromCol:l,toCol:a,fromRow:d,toRow:h}=Uo(t,e,o),p=new Set,A=[];return r.sub({row:d,col:l},{row:h,col:a}).forEach(B=>{B.forEach(D=>{const x=r.getCellByContainerId(D.containerId);x.col<l||x.row<d||x.col+x.colSpan-1>a||x.row+x.rowSpan-1>h||p.has(D.containerId)||(p.add(D.containerId),A.push(x.container))})}),A}function zM(n,t,e){g(Zp,t.blockId===e.blockId,"only allow select in single table block");const o=n.getBlockById(t.blockId);return Qp(n,o,t,e)}const Vs=S("table-cell-dom");function VM(n,t,e){let o=n.getBlockById(e);for(;o;){const r=o.closest("td");g(Vs,r,"no parent cell");const i=tt(r);if(g(Vs,i,"no parent block"),i===t)return r;o=i}return g(Vs,!1,"filed to get cell by child block id"),null}function Kr(n,t,e){if(n.getBlockById(e.blockId)===t&&!e.isSimple())return g(Vs,e.childContainerId,"block position must have childContainerId attribute"),e;const r=VM(n,t,e.blockId),i=ct(su(r));return me(t,i)}function Yp(n,t){const e=n.selection.range,o=Kr(n,t,e.start),r=Kr(n,t,e.end);return Uo(t,o,r)}function Rv(n,t,e,o){g(Vs,Ve(t),"invalid table block");const r=gr(n,t),i=te(t),s=()=>{const a=r.querySelector(".table-border-bar-container.top");g(Vs,a,"no top border bar container"),a.querySelectorAll(".table-border-bar-cell.top").forEach(h=>{const p=parseInt(h.getAttribute("data-top-index")||"0",10);o.includes(p)?W(h,"danger"):ot(h,"danger")})},l=()=>{const a=i.querySelector(".table-border-bar-container.left");g(Vs,a,"no left border bar container"),a.querySelectorAll(".table-border-bar-cell.left").forEach(h=>{const p=parseInt(h.getAttribute("data-left-index")||"0",10);e.includes(p)?W(h,"danger"):ot(h,"danger")})};s(),l()}function Vi(n,t,e=!0,o){const i=Tt.fromBlock(t).map(h=>h),{fromCol:s,toCol:l,fromRow:a,toRow:d}=Yp(n,t);for(let h=0;h<i.length;h++){const p=i[h];for(let A=0;A<p.length;A++){const v=p[A],B=o?A>=s&&A+v.colSpan-1<=l:h>=a&&h+v.rowSpan-1<=d;e&&B?v.virtual||W(v.cell,"danger"):v.virtual||ot(v.cell,"danger")}}}function Wi(n,t,e=!0,o){const r=new Set,i=new Set;if(!e){Rv(n,t,Array.from(r),Array.from(i));return}const{fromCol:s,toCol:l,fromRow:a,toRow:d}=Yp(n,t);if(o)for(let h=s;h<=l;h++)i.add(h);else for(let h=a;h<=d;h++)r.add(h);Rv(n,t,Array.from(r),Array.from(i))}function Ov(n,t,e){const{fromCol:o,toCol:r,fromRow:i,toRow:s}=Yp(n,t),l=Tt.fromBlock(t);let a=null,d=null;return e?(a=l.getCell({col:o,row:0}),d=l.getCell({col:r,row:l.rowCount-1}),Ue(n,{anchor:me(t,a.containerId,{colIndex:o,rowIndex:0}),focus:me(t,d.containerId,{colIndex:r,rowIndex:l.rowCount-1})})):(a=l.getCell({col:0,row:i}),d=l.getCell({col:l.colCount-1,row:s}),Ue(n,{anchor:me(t,a.containerId,{colIndex:0,rowIndex:i}),focus:me(t,d.containerId,{colIndex:l.colCount-1,rowIndex:s})}))}function WM(n,t){const e=n.selection.range,o=Kr(n,t,e.start),r=Kr(n,t,e.end);return Qp(n,t,o,r)}const _v=["style-bg-color-0","style-bg-color-1","style-bg-color-2","style-bg-color-3","style-bg-color-4","style-bg-color-5","style-bg-color-6","style-bg-color-7","style-bg-color-8","style-bg-color-9","style-bg-color-10","style-bg-color-11","style-bg-color-12","style-bg-color-13"];function Fv(n){return`style-bg-color-${n}`}function uu(n){return`${n}_background`}function qM(n,t,e){const o=_e(n),s=(e!=null?e:Tt.fromTable(o)).getCell(t).cell;for(let l=0;l<_v.length;l++){const a=_v[l];if(xt(s,a))return a}}function Pv(n,t,e){if(!n.isBlockWritable(t))return;const o=n.selection.range,i={...mt.default(n.getBlockData(t))},s=Kr(n,t,o.start),l=Kr(n,t,o.end);if(o.isSimple()){const a=s.childContainerId;e===-1?i[uu(a)]=void 0:i[uu(a)]=Fv(e)}else{const a=Tt.fromBlock(t),d=Uo(t,s,l),h=new Set;for(let p=d.fromRow;p<=d.toRow;p++)for(let A=d.fromCol;A<=d.toCol;A++){const v=a.getCell({row:p,col:A});!h.has(v.containerId)&&v.col>=d.fromCol&&v.row>=d.fromRow&&v.col+v.colSpan-1<=d.toCol&&v.row+v.rowSpan-1<=d.toRow&&(h.add(v.containerId),e===-1?i[uu(v.containerId)]=void 0:i[uu(v.containerId)]=Fv(e))}}n.updateBlockData(t,i)}function GM(n,t,e){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),chart:e};n.updateBlockData(t,r)}const Nv=S("table-chart");function ZM(n,t){const e=kM(n,t);if(e){const o=e.querySelector(".editor-table-chart");if(o){const r=o.chartObject;r&&r.destroy(),o.remove()}}}async function QM(n,t){if(!n.isBlockWritable(t))return;if(!!!n.getBlockData(t).chart){ZM(n,t);return}const r=[],i=Tt.fromBlock(t),s=["line","bar","pie","radar"];let l=i.getCell({row:0,col:0}).container.innerText.trim().toLowerCase();new Set(s).has(l)||(l=s[0]);const a=[];for(let D=1;D<i.colCount;D++)a.push(i.getCell({row:0,col:D}).container.innerText);for(let D=1;D<i.rowCount;D++){const x=i.getCell({row:D,col:0}),R=x.container.innerText,H=[];for(let qe=1;qe<i.colCount;qe++){const Yn=i.getCell({row:D,col:qe}).container.innerText,$e=Number.parseFloat(Yn)||0;H.push($e)}let z;const q=qM(t,x,i);q?z=window.getComputedStyle(n.rootElement).getPropertyValue(`--${q}`).trim():z=window.getComputedStyle(n.rootElement).getPropertyValue("--background-color").trim();let[rt,ft,Bt,jt]=z?hm.fromString(z).toRgbaArray():[];if(!rt&&!ft&&!Bt&&!jt){const qe=(D-1)%n.options.colors.length;z=n.options.colors[qe],[rt,ft,Bt,jt]=hm.fromString(z).toRgbaArray()}const Ut=z,ne=hm.fromRgba([rt,ft,Bt,jt/3]).toHexString();r.push({label:R,data:H,borderColor:Ut,backgroundColor:ne,borderWidth:2})}const d=gr(n,t);let h=null,p=d.querySelector(".editor-table-chart");p?h=p.chartObject:p=k("div",["editor-table-chart"],d);const A=p;g(Nv,A,"no chart container");const v=n.getComponentOptions("table"),B=(v==null?void 0:v.chartCdn)||"https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js";try{await bs(B,"editor-chartjs");let D=!1;(h&&h.config.data.datasets.length>r.length||h&&h.config.data.datasets[0].data.length>r[0].data.length)&&(D=!0),h&&(l!==h.config.type||D)&&(h.destroy(),h=null,Array.from(p.querySelectorAll(".editor-chartjs-canvas")).forEach(R=>{R.remove()}));const x=fm.default({},{type:l,data:{datasets:r,labels:a},options:{onClick:()=>{n.selection.selectBlock(t,0,0)}}});if(h)fm.default(h.config,x),h.update();else{const R=k("canvas",["editor-chartjs-canvas"],A).getContext("2d");h=new window.Chart(R,x),p.chartObject=h}}catch(D){Nv.error(`failed to resolve chart cdn: ${JSON.stringify(D)}`)}}async function $v(n,t){await xo.lock("updateTableChart");try{await QM(n,t)}finally{xo.release("updateTableChart")}}const Hv=Le.default($v,1e3);let jv=null;function Jp(n,t,e){if(jv!==t&&(Hv.flush(),jv=t),e.updateNow){$v(n,t);return}Hv(n,t)}function Kp(n,t){Ve(t)&&Jp(n,t,{updateNow:!1})}function YM(n,t){Ve(t)&&Jp(n,t,{updateNow:!0})}const fo={SCROLL:"container-scroll-tool",COMMON:"container-border-shadow",RIGHT:"container-right-border-shadow",LEFT:"container-left-border-shadow",LAYOUT_SIGN:"container-layout-border-shadow",ACTIVE:"active"},nf={SCROLL_BAR:"container-scrollbar",FIXED:"fixed"},qi={SCROLL_CONTAINER:"scroll-container",TOOL:"container-scroll-tool",CONTAINER:"scroll-container-root",MAC:"mac",SCROLL_AREA:"scroll-area"};function du(n,t){return n.containers.get(t)}function Uv(n){return n.closest(`.${qi.SCROLL_CONTAINER}`)}function zo(n){return n.firstElementChild}function bn(n){return n.closest(`.${qi.CONTAINER}`)}function hu(n){const t=bn(n);let e=t.querySelector(`:scope >.${qi.TOOL}`);return e||(e=k("div",[qi.TOOL],t)),e}function JM(n){return bn(n).firstElementChild}function KM(n,t){const e=du(n,bn(t));return e!=null&&e.barFloatWindowBottom?typeof e.barFloatWindowBottom=="function"?e.barFloatWindowBottom():e.barFloatWindowBottom:0}function mo(n,t){const e=vs(n);return t/e}function fu(n){const t=window.getComputedStyle(n),e=vs(n);return{paddingBottom:parseFloat(t.paddingBottom)*e,paddingTop:parseFloat(t.paddingTop)*e,paddingLeft:parseFloat(t.paddingLeft)*e,paddingRight:parseFloat(t.paddingRight)*e}}function sc(n){const t=vs(n);return{scrollLeft:n.scrollLeft*t,scrollWidth:n.scrollWidth*t,clientWidth:n.clientWidth*t,clientHeight:n.clientHeight*t}}function XM(n,t){const e=vs(n);return n[t]*e}function Xp(n,t){const e=bn(t),o=du(n,e),r=(o==null?void 0:o.safeRightSpace)||0,i=(o==null?void 0:o.safeLeftSpace)||0,l=(o==null?void 0:o.locatingContainer).getBoundingClientRect(),a=e.getBoundingClientRect(),d=a.width;let h=Math.floor(a.left-l.left-i);h<0&&(h=0);let p=l.right;p-=r;let A=p-a.right;return A<0&&(A=0),h=Math.round(h),A=Math.round(A),{originWidth:d,maxLeft:h,maxRight:A}}function tR(n,t){const e=Xp(n,t),{maxLeft:o}=e;t.style.marginLeft=`${mo(t,0-o)}px`,t.style.paddingLeft=`${mo(t,o)}px`}function eR(n,t){const e=Xp(n,t);t.style.marginRight=`${mo(t,0-e.maxRight)}px`}function nR(n){if(n!==document.documentElement&&n!==document.body)return n.getBoundingClientRect();const t=0,e=0,o=document.documentElement.clientWidth,r=document.documentElement.clientHeight;return new DOMRect(t,e,o,r)}const zv=S("scroll-bar-handle"),oR=2;function lc(n){const t=hu(n);let e=t.querySelector(`.${nf.SCROLL_BAR}`);return e||(e=k("div",[nf.SCROLL_BAR],t)),g(zv,e instanceof HTMLDivElement,"invalid child for container tools"),e.firstElementChild||k("div",[],e),e}function of(n,t){const e=Uv(t),o=lc(e),{scrollWidth:r,clientWidth:i}=sc(e),{paddingLeft:s,paddingRight:l}=fu(t),a=Xp(n,e),{originWidth:d,maxRight:h}=a;eR(n,e),tR(n,e);const p=r-i;g(zv,o.firstElementChild instanceof HTMLDivElement,"invalid child for scroll bar"),o.style.width=`${mo(e,d+h-s-l)}px`,o.firstElementChild.style.width=`${mo(e,d+h+p-s-l)}px`}function rR(n,t){const e=zo(n),{paddingLeft:o}=fu(e);if(xt(t,"fixed")){const i=bn(n).getBoundingClientRect();t.style.left=`${mo(n,i.left+o)}px`}else t.style.left=`${mo(n,o)}px`}function cc(n,t){var R;const e=n.getParentScrollContainer(),o=nR(e),r=t.getBoundingClientRect(),i=lc(t),s=i.getBoundingClientRect(),l=du(n,bn(t)),a=KM(n,t),d=zo(t),{paddingTop:h,paddingBottom:p}=fu(d),{scrollWidth:A,clientWidth:v}=sc(t),B=document.documentElement.clientHeight-a,D=o.top+sc(e).clientHeight-B,x=B+Math.min(0,D);if(A>v&&r.top+h<x-s.height&&r.bottom>x-s.height+p&&!((R=l==null?void 0:l.isSetScale)!=null&&R.call(l))){l!=null&&l.allowScrollBarFixed&&W(i,nf.FIXED);const H=D>0?a:0;i.style.bottom=`${Math.max(document.documentElement.clientHeight-o.bottom,0)+oR+H}px`}else ot(i,nf.FIXED),i.style.bottom=`${mo(t,p-s.height)}px`;rR(t,i)}class iR{constructor(t,e){m(this,"intersectionObserver");m(this,"handleIntersection",t=>{t.forEach(e=>{this.containers.get(bn(e.target))?(this.handleIntersectionEntry(e),this.callback(e)):this.intersectionObserver.unobserve(e.target)})});m(this,"handleIntersectionEntry",t=>{const e=t.target;cc(this.scrollCore,e);const o=zo(e);of(this.scrollCore,o)});this.scrollCore=t,this.callback=e;const r={root:this.scrollCore.getParentScrollContainer(),rootMargin:"20px",threshold:0};this.intersectionObserver=new IntersectionObserver(this.handleIntersection,r)}get containers(){return this.scrollCore.containers}bind(t){this.unbind(t),this.intersectionObserver.observe(t)}unbind(t){this.intersectionObserver.unobserve(t)}destroy(){this.intersectionObserver.disconnect()}}const Ws=S("container-scroll-shadow");function Vv(n,t,e){const o=n,r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),{paddingTop:s,paddingBottom:l}=fu(e);o.style.top=`${mo(t,i.top-r.top+s)}px`,o.style.bottom=`${mo(t,r.bottom-i.bottom+l)}px`}function Wv(n,t){const e=n;t<24?e.style.width=`${(t/3).toFixed(2)}px`:e.style.width=""}function sR(n){const t=hu(n);g(Ws,t,"no container tools");let e=t.querySelector(`.${fo.LEFT}`);if(!e){const l=zo(n),a=[fo.COMMON,fo.LEFT];e=k("div",a,t),g(Ws,e instanceof HTMLDivElement,"invalid child for container tools"),Vv(e,n,l)}g(Ws,e instanceof HTMLElement,"invalid child for container tools");const r=bn(n).getBoundingClientRect(),i=n.getBoundingClientRect();e.style.left=`${mo(n,i.left-r.left)}px`;const s=sc(n).scrollLeft;g(Ws,e instanceof HTMLDivElement,"invalid child for container tools"),Wv(e,s),W(e,fo.ACTIVE)}function lR(n){const t=hu(n);let e=t.querySelector(`.${fo.RIGHT}`);if(!e){const h=zo(n),p=[fo.COMMON,fo.RIGHT];e=k("div",p,t),g(Ws,e instanceof HTMLDivElement,"no div, create shadow failed"),Vv(e,n,h)}g(Ws,e instanceof HTMLElement,"");const r=bn(n).getBoundingClientRect(),i=n.getBoundingClientRect();e.style.right=`${mo(n,r.right-i.right)}px`;const{scrollWidth:s,scrollLeft:l,clientWidth:a}=sc(n),d=s-l-a;g(Ws,e instanceof HTMLDivElement,"no shadow element"),Wv(e,d),W(e,fo.ACTIVE)}function cR(n){const e=hu(n).querySelector(`.${fo.LEFT}`);e&&ot(e,fo.ACTIVE)}function aR(n){const e=hu(n).querySelector(`.${fo.RIGHT}`);e&&ot(e,fo.ACTIVE)}function mu(n){const{scrollLeft:t,scrollWidth:e,clientWidth:o}=sc(n),r=zo(n),{paddingLeft:i,paddingRight:s}=fu(r),l=XM(r,"offsetLeft");e-i<=o-s||e-i<=t+o-s?aR(n):lR(n),r&&t>=l+i?sR(n):cR(n)}class uR{constructor(t,e){m(this,"resizeObserver");m(this,"handleResizeEntry",t=>{const e=t.target,o=zo(e);mu(e),of(this.scrollCore,o),cc(this.scrollCore,e),this.callback(e)});m(this,"handleContentResize",t=>{t.forEach(e=>{this.containers.get(bn(e.target))?this.handleResizeEntry(e):this.unbind(e.target)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new ResizeObserver(this.handleContentResize)}get containers(){return this.scrollCore.containers}bind(t){this.unbind(t),this.resizeObserver.observe(t)}unbind(t){this.resizeObserver.unobserve(t)}destroy(){this.resizeObserver.disconnect()}}const qv=S("container-scroll-observer");class dR{constructor(t,e){m(this,"handleContentScroll",t=>{const e=t.target;g(qv,e instanceof Element,"invalid target for scroll event");const o=lc(e);o.removeEventListener("scroll",this.handleScroll);const r=!0;this.fixScrollXPos(e,e.scrollLeft,r),this.bind(o),mu(e),this.callback(e)});m(this,"handleScroll",t=>{const e=t.target;g(qv,e instanceof HTMLElement,"");const o=e.scrollLeft,r=!1,i=JM(e);this.unbindContentScroll(i),this.fixScrollXPos(i,o,r),this.bindContentScroll(i),mu(i),this.callback(i)});m(this,"handlePrevent",t=>{t.stopPropagation()});m(this,"bindContentScrollCore",t=>{this.unbindContentScroll(t),t.addEventListener("scroll",this.handleContentScroll)});m(this,"unbindContentScroll",t=>{t.removeEventListener("scroll",this.handleContentScroll)});m(this,"bindContentScroll",Le.default(this.bindContentScrollCore,300));m(this,"bind",Le.default(this.bindCore,200));this.scrollCore=t,this.callback=e}fixScrollXPos(t,e,o){const r=lc(t);o||(t.scrollLeft=e),o&&r.scrollLeft!==e&&(r.scrollLeft=e)}bindCore(t){this.unbind(t),t.addEventListener("scroll",this.handleScroll),t.addEventListener("mousedown",this.handlePrevent)}unbind(t){t.removeEventListener("scroll",this.handleScroll),t.removeEventListener("mousedown",this.handlePrevent)}}class hR{constructor(t){m(this,"scrollContainers",new Set);m(this,"handleParentContainerScroll",()=>{this.scrollContainers.forEach(t=>{cc(this.scrollCore,t)})});m(this,"bindScrollContainer",t=>{const e=this.scrollContainers.size===0;this.scrollContainers.add(t),e&&this.eventTarget.addEventListener("scroll",this.handleParentContainerScroll)});m(this,"unbindScrollContainer",t=>{let e=!1;this.scrollContainers.has(t)&&(this.scrollContainers.delete(t),e=this.scrollContainers.size===0),e&&this.eventTarget.removeEventListener("scroll",this.handleParentContainerScroll)});this.scrollCore=t}get eventTarget(){const t=this.scrollCore.getParentScrollContainer();return t===document.documentElement?document:t}destroy(){this.eventTarget.removeEventListener("scroll",this.handleParentContainerScroll),this.scrollContainers.clear()}}const fR=S("scroll-wrap-resize-observer");class mR{constructor(t){m(this,"resizeObserver");m(this,"handleScrollWrapResize",t=>{t.forEach(e=>{this.containers.get(bn(e.target))?this.handleScrollWrapResizeEntry(e):this.unbind(e.target)})});m(this,"handleScrollWrapResizeEntry",t=>{const e=t.target;g(fR,e instanceof HTMLElement,"invalid target for observer entry");const o=Uv(e);of(this.scrollCore,e),mu(o),cc(this.scrollCore,o)});this.scrollCore=t,this.resizeObserver=new ResizeObserver(this.handleScrollWrapResize)}get containers(){return this.scrollCore.containers}bind(t){this.unbind(t),this.resizeObserver.observe(t)}unbind(t){this.resizeObserver.unobserve(t)}destroy(){this.resizeObserver.disconnect()}}class gR{constructor(t,e){m(this,"resizeObserver");m(this,"scrollContainersMap",new Map);m(this,"handleResizeEntry",t=>{t==null||t.forEach(e=>{const o=zo(e);mu(e),of(this.scrollCore,o),cc(this.scrollCore,e),this.callback(e)})});m(this,"handleResize",t=>{t.forEach(e=>{const o=this.scrollContainersMap.get(e.target);o!=null&&o.length&&this.handleResizeEntry(o)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new ResizeObserver(this.handleResize)}bind(t){var r,i;const e=bn(t),o=(r=du(this.scrollCore,e))==null?void 0:r.locatingContainer;this.scrollContainersMap.has(o)?(i=this.scrollContainersMap.get(o))==null||i.push(t):(this.scrollContainersMap.set(o,[t]),this.resizeObserver.observe(o))}unbind(t){var i,s;const e=bn(t),o=(i=du(this.scrollCore,e))==null?void 0:i.locatingContainer;if(!o)return;const r=this.scrollContainersMap.get(o);this.scrollContainersMap.set(o,(r==null?void 0:r.filter(l=>l!==t))||[]),(s=this.scrollContainersMap.get(o))!=null&&s.length||(this.resizeObserver.unobserve(o),this.scrollContainersMap.delete(o))}destroy(){this.scrollContainersMap.clear(),this.resizeObserver.disconnect()}}const Tnt="";class pR extends ve.TypedEmitter{constructor(e){super();m(this,"containerIntersectionObserver",null);m(this,"containerResizeObserver",null);m(this,"containerScrollObserver",null);m(this,"parentContainerScrollObserver",null);m(this,"scrollWrapResizeObserve",null);m(this,"locatingContainerResizeObserver",null);m(this,"isWindowEventBind",!1);m(this,"containers",new Map);m(this,"handleScrollContainerScroll",e=>{this.emit("scroll",this,e)});m(this,"handleResize",e=>{this.emit("resize",this,e)});m(this,"handleIntersection",e=>{const o=e.target,r=zo(o);e.isIntersecting?(this.load(),this.bindCore(o,r)):this.unbindCore(o,r)});m(this,"handleWindowEffect",()=>{var e;(e=this.getScrollContainerInViewable())==null||e.forEach(o=>{cc(this,o)})});this.parentContainer=e}load(){this.containerResizeObserver||(this.containerResizeObserver=new uR(this,this.handleResize)),this.containerScrollObserver||(this.containerScrollObserver=new dR(this,this.handleScrollContainerScroll)),this.parentContainerScrollObserver||(this.parentContainerScrollObserver=new hR(this)),this.scrollWrapResizeObserve||(this.scrollWrapResizeObserve=new mR(this)),this.locatingContainerResizeObserver||(this.locatingContainerResizeObserver=new gR(this,this.handleResize)),this.isWindowEventBind||(window.addEventListener("resize",this.handleWindowEffect),this.getParentScrollContainer()!==document.documentElement&&window.addEventListener("scroll",this.handleWindowEffect))}getParentScrollContainer(){return this.parentContainer}getScrollContainerInViewable(){var e;return(e=this.parentContainerScrollObserver)==null?void 0:e.scrollContainers}unbindCore(e,o){var i,s,l,a,d,h;const r=lc(e);(i=this.containerScrollObserver)==null||i.unbindContentScroll(e),(s=this.containerScrollObserver)==null||s.unbind(r),(l=this.scrollWrapResizeObserve)==null||l.unbind(o),(a=this.containerResizeObserver)==null||a.unbind(e),(d=this.parentContainerScrollObserver)==null||d.unbindScrollContainer(e),(h=this.locatingContainerResizeObserver)==null||h.unbind(e)}bindCore(e,o){var s,l,a,d,h,p;if(this.unbindCore(e,o),!e.closest("body"))return;const r=lc(e);(s=this.containerScrollObserver)==null||s.bindContentScrollCore(e),(l=this.containerScrollObserver)==null||l.bindCore(r),(a=this.scrollWrapResizeObserve)==null||a.bind(o),(d=this.containerResizeObserver)==null||d.bind(e);const i=this.containers.get(bn(e));i!=null&&i.allowScrollBarFixed&&((h=this.parentContainerScrollObserver)==null||h.bindScrollContainer(e)),(p=this.locatingContainerResizeObserver)==null||p.bind(e)}bind(e,o){this.containers.set(e,o);const r=e.firstElementChild;this.containerIntersectionObserver||(this.containerIntersectionObserver=new iR(this,this.handleIntersection)),this.containerIntersectionObserver.bind(r)}unbind(e){var i;const o=e.firstElementChild,r=zo(o);this.unbindCore(o,r),this.containers.delete(e),(i=this.containerIntersectionObserver)==null||i.unbind(o),this.containers.size||this.destroy()}destroy(){var e,o,r,i,s;this.containers.forEach((l,a)=>{this.unbind(a)}),this.containers.clear(),(e=this.parentContainerScrollObserver)==null||e.destroy(),(o=this.containerIntersectionObserver)==null||o.destroy(),(r=this.containerResizeObserver)==null||r.destroy(),(i=this.scrollWrapResizeObserve)==null||i.destroy(),(s=this.locatingContainerResizeObserver)==null||s.destroy(),window.removeEventListener("resize",this.handleWindowEffect),window.removeEventListener("scroll",this.handleWindowEffect)}}const Gv=S("scroll-container"),rf=new Map;class CR extends ve.TypedEmitter{constructor(){super(...arguments);m(this,"scrollListener");m(this,"options");m(this,"scrollContainerElement");m(this,"init",e=>{this.options=e;const o=k("div",[qi.CONTAINER],e.parentElement);Ze.isMac&&W(o,qi.MAC);const r=k("div",[qi.SCROLL_CONTAINER],o),i=k("div",[qi.SCROLL_AREA],r);i.style.paddingLeft=e.paddingLeft?`${e.paddingLeft}px`:"",i.style.paddingTop=e.paddingTop?`${e.paddingTop}px`:"",i.style.paddingBottom=e.paddingBottom?`${e.paddingBottom}px`:"",i.style.paddingRight=e.paddingRight?`${e.paddingRight}px`:"",i.appendChild(e.childElement);const s=e.parentContainer;this.scrollListener=rf.get(s),this.scrollListener||(this.scrollListener=new pR(s),rf.set(s,this.scrollListener)),this.scrollListener.unbind(o),this.scrollListener.bind(o,e),this.scrollListener.on("scroll",this.handleContainerScroll),this.scrollListener.on("resize",this.handleResize),this.scrollContainerElement=r});m(this,"handleContainerScroll",(e,o)=>{o===this.scrollContainerElement&&this.emit("scroll",this)});m(this,"handleResize",(e,o)=>{o===this.scrollContainerElement&&this.emit("scroll",this)})}get rootElement(){return this.scrollContainerElement}get contentElement(){return g(Gv,this.scrollContainerElement,"scrollContainerElement cannot be undefined"),zo(this.scrollContainerElement)}get scrollOptions(){return g(Gv,this.options,"options cannot be undefined"),{...this.options}}handleBaseListenerDestroy(e){e.destroy()}destroy(){var o;(o=this.scrollListener)==null||o.off("scroll",this.handleContainerScroll);const e=bn(this.contentElement);e&&rf.forEach((r,i)=>{r.unbind(e),r.containers.size===0&&(this.handleBaseListenerDestroy(r),rf.delete(i))})}}function AR(){return new CR}const t0=S("column-width");function bR(n,t,e){BM(n,t).style.width=`${e}px`}function vR(n){const e=Array.from(n.querySelector("colgroup").children).map(a=>a.getBoundingClientRect().width);if(e[0]!==0)return e;const o=Tt.fromTable(n),r=Array(o.colCount).fill(-1),i=n.getBoundingClientRect().left;o.toRealCells(o.cells).forEach(a=>{const d=a.col+a.colSpan-1;r[d]===-1&&(r[d]=a.cell.getBoundingClientRect().right-i)}),t0.debug(`cellRightOffsets1: ${r.join()}`);for(let a=0;a<r.length;a++){const d=r[a];if(d===-1||a===0)continue;let h=a-1;for(;r[h]===-1&&(h--,h!==-1););const p=h===-1?0:r[h],v=(d-p)/(a-h);for(let B=h+1;B<a;B++)r[B]=p+v*(B-h)}t0.debug(`cellRightOffsets2: ${r.join()}`);const s=[];let l=0;for(let a=0;a<r.length;a++){const d=r[a];s.push(d-l),l=d}return t0.debug(`widths: ${s.join()}`),s}function gu(n){return Array.from(n.querySelector("colgroup").children).map(o=>o.getBoundingClientRect().width||Number.parseInt(o.style.width,10))}const e0=200,yR=40,kR=S("table-resize-gripper"),Zv=7,n0=(Zv-1)/2,wR=3;function BR(n,t,e){const{rows:o}=n;for(let r=0;r<o.length;r++){const i=o[r],s=Array.from(i.cells);for(let l=0;l<s.length;l++){const a=s[l],d=a.getBoundingClientRect(),h=Math.round(d.right);if(Math.abs(t-h)<=n0&&d.top<=e&&e<=d.bottom)return a}}return null}function ER(n){return!!n.rootContainer.querySelector(".table-resize-gripper")}function o0(n,t){return gr(n,t).querySelector(".table-resize-gripper")}function Qv(n,t){const e=o0(n,t);g(kR,!e,"resize gripper has already exists");const o=gr(n,t),r=k("div",["table-resize-gripper","table-indicator"],o);return k("div",["table-resize-gripper-indicator"],r),r}function Yv(n,t,e){let o=o0(n,t);o||(o=Qv(n,t));const i=_e(t).getBoundingClientRect(),s=e.getBoundingClientRect(),l=0,a=i.height,d=n.getCustom(mr(t)).contentElement.getBoundingClientRect(),h=s.right-d.left;o.style.left=`${h-n0-ic-au}px`,o.style.top=`${l}px`,o.style.height=`${a}px`,o.style.width=`${Zv}px`}function r0(n){n.rootContainer.querySelectorAll(".table-resize-gripper").forEach(t=>{t.remove()})}function xR(n,t,e){const r={...n.getBlockData(t),colsWidth:e};n.updateBlockData(t,r)}function IR(n,t,e,o){const r=t,i=Tt.fromTable(e),s=i.getCellByCellElement(r),l=s.col+s.colSpan-1,a=gu(e);let d=o;const h=(A,v)=>{const B=v+1,D=A.col+A.colSpan;return a.slice(B,D).reduce((_,R)=>_+R,0)},p=new Set;for(let A=0;A<i.rowCount;A++){const v=i.getCell({row:A,col:l});if(p.has(v.cell))continue;p.add(v.cell);const B=v.cell,D=B.getBoundingClientRect();let x=o-D.left+n0-wR;const _=su(B),R=Zm(n,_)||yR*v.colSpan,H=h(v,l),z=R-H;x<z&&(x=z);const q=D.left+x;d=Math.max(d,q)}return d}const TR=S("table-resize-drag-drop");class DR{constructor(t,e,o,r){m(this,"cursor","col-resize");this.editor=t,this.elem=e,this.data=o,this.onEnd=r}onDragStart(t,e,o){}onDragging(t,e,o,r,i){const{table:s,block:l,draggingRefCell:a}=t.data,h=IR(this.editor,a,s,e.x-t.dragOffsetX)-s.getBoundingClientRect().left;g(TR,a,"no dragging cell");const A=Tt.fromTable(s).getCellByCellElement(a),v=A.col+A.colSpan-1,D=gu(s).slice(0,v).reduce((_,R)=>_+R,0),x=h-D;bR(s,v,x),Yv(this.editor,l,a),this.editor.selection.caret.update()}onDragEnd(t,e,o,r,i){const s=gu(t.data.table);xR(this.editor,t.data.block,s),r0(this.editor),this.onEnd&&(this.onEnd(e),this.onEnd=null)}}function SR(n,t){const e=document.elementFromPoint(t.x,t.y);if(!e)return null;const o=tt(e);return!o||!n.contains(o)||!Ve(o)?null:o}S("table-resize");class LR{constructor(t){m(this,"draggingRefCell",null);m(this,"handleMouseMove",(t,e)=>{if(t.readonly||t.selectionHandler.isSelecting()&&!this.draggingRefCell||this.draggingRefCell)return;const o=e.target;if(!(o instanceof Element)||o.closest(".table-indicator"))return;const i=e,s=SR(t,i);if(!s||!Ev(s)||!t.isBlockWritable(s)){r0(t);return}this.updateGripper(s,i.x,i.y)});this.editor=t,t.domEvents.addEventListener(document,"mousemove",this.handleMouseMove)}destroy(){this.editor.domEvents.removeEventListener(document,"mousemove",this.handleMouseMove)}updateGripper(t,e,o){const r=_e(t),i=BR(r,e,o);if(i){if(!o0(this.editor,t)){if(ER(this.editor))return;const l=Qv(this.editor,t),a={block:t,table:r,draggingRefCell:i};wm(new DR(this.editor,l,a,d=>{this.updateGripper(t,d.x,d.y)}))}Yv(this.editor,t,i)}else r0(this.editor)}}function Jv(n){n.addCustom("table-mouse-event-handler",t=>new LR(t))}const Kv=S("table-insert-column");function Xv(n,t,e){n.undoManager.runInGroup(()=>{const o=_e(t),r=Tt.fromTable(o),i=r.colCount;g(Kv,e>=0&&e<=i,`insert index ${e} is out of range [0, ${i}]`);const s=r.map(A=>A.containerId),l=new Set;n.doc.beginBatchUpdate();for(let A=0;A<s.length;A++){const v=s[A],B=v[e-1],D=v[e];if(e===0||e===v.length||B!==D){const x=Gr(n.doc);v.splice(e,0,x)}else v.splice(e,0,B),l.add(B)}n.doc.endBatchUpdate();const a=mt.default(n.getBlockData(t));l.forEach(A=>{const v=`${A}_colSpan`,B=a[v];g(Kv,typeof B=="number"&&B>1,`no colSpan for containerId ${A}, ${B}`),a[v]=B+1});const d=a.colsWidth.concat();d.splice(e,0,e0);const h=Tt.virtualCellContainersGridToChildren(s),p={...a,cols:a.cols+1,children:h,colsWidth:d};zs(p),n.updateBlockData(t,p)})}const sf=S("table-insert-row");function t7(n,t,e){n.undoManager.runInGroup(()=>{const o=_e(t),r=Tt.fromTable(o),i=r.rowCount;g(sf,e>=0&&e<=i,`insert index ${e} is out of range [0, ${i}]`);const s=r.map(A=>A.containerId),l=new Set;n.doc.beginBatchUpdate();const a=[];for(let A=0;A<r.colCount;A++){const v=e>0&&s[e-1][A],B=e<r.rowCount&&s[e][A];if(g(sf,v||B,"no top and bottom cell"),e===0||e===r.rowCount||v!==B){const D=Gr(n.doc);a.push(D)}else g(sf,v,"no top cell"),a.push(v),l.add(v)}n.doc.endBatchUpdate(),s.splice(e,0,a);const d=mt.default(n.getBlockData(t));l.forEach(A=>{const v=`${A}_rowSpan`,B=d[v];g(sf,typeof B=="number"&&B>1,`no rowSpan for containerId ${A}, ${B}`),d[v]=B+1});const h=Tt.virtualCellContainersGridToChildren(s),p={...d,rows:d.rows+1,children:h};zs(p),n.updateBlockData(t,p)})}const i0=S("paste-table-in-table-block");function MR(n,t,e,o){let r=Tt.fromBlock(e);const i=t.blocks.root[0];g(i0,i,"no table data"),g(i0,i.type==="table",`table data type is not table, but ${i.type}`);const s=i,l=r.getCellByCellElement(o),a=s.cols,d=s.rows,h=l.col,p=l.row,A=h+a,v=p+d,B=[];for(let D=h;D<A&&D<r.colCount;D++)for(let x=p;x<v&&x<r.rowCount;x++){const _=r.getCell({col:D,row:x});_.virtual?_.virtual&&B.push({col:D,row:x}):(_.colSpan>1||_.rowSpan>1)&&B.push({col:D,row:x})}n.undoManager.runInGroup(()=>{if(B.forEach(R=>{const H=Tt.fromBlock(e).getCell(R);(H.colSpan>1||H.rowSpan>1)&&Vp(n,e,R)}),A>r.colCount)for(let R=r.colCount;R<A;R++)Xv(n,e,R);if(v>r.rowCount)for(let R=r.rowCount;R<v;R++)t7(n,e,R);r=Tt.fromBlock(e);const D=new Jh(s);let x;for(let R=0;R<D.colCount;R++)for(let H=0;H<D.rowCount;H++){const z=D.getCell({col:R,row:H});if(!z.virtual){const q=Fg(n.editorBlocks,t,z.containerId),rt=h+R,ft=p+H,Bt={col:rt,row:ft},jt=r.getCellContainer(Bt);q6(n,jt,q),x=jt}}g(i0,x,"no last container");const _=Qe(x);n.selection.selectBlock(_,ut(n,_))})}const e7=S("paste-in-table-block");class RR{constructor(t){this.editor=t,setTimeout(()=>{t.input.addHandler(this)})}destroy(){}async handleBeforePasteDoc(t,e){if(!t.selection.range.isSimple()||t.selection.range.start.offset!==0)return!1;const r=t.selection.startBlock,i=nt(r);if(Gt(i)||!Ba(t,i))return!1;const s=tt(i);if(g(e7,s,"no parent block"),!Ve(s)||e.blocks.root.length!==1||e.blocks.root[0].type!=="table")return!1;e7.debug("paste child table in table");const d=Tt.fromBlock(s).getCellByContainerId(ct(i)).cell;return MR(t,e,s,d),!0}}function n7(n){n.addCustom("table-block-paste-event",t=>new RR(t))}const s0=S("table-select-columns");function OR(n,t,e,o,r){g(s0,Ve(t),"is not a table block");const i=Tt.fromBlock(t);g(s0,e>=0&&e<i.colCount,"invalid from"),g(s0,o>0&&e+o<=i.colCount,"invalid count");const s=i.getCell({row:0,col:e}),l=i.getCell({row:i.rowCount-1,col:e+o-1}),a=me(t,s.containerId,{colIndex:e,rowIndex:0}),d=me(t,l.containerId,{colIndex:e+o-1,rowIndex:i.rowCount-1});r!=null&&r.reverse?n.selection.setSelection(d,a):n.selection.setSelection(a,d)}const l0=S("table-select-columns");function _R(n,t,e,o,r){g(l0,Ve(t),"is not a table block");const i=Tt.fromBlock(t);g(l0,e>=0&&e<i.rowCount,"invalid from"),g(l0,o>0&&e+o<=i.rowCount,"invalid count");const s=i.getCell({row:e,col:0}),l=i.getCell({row:e+o-1,col:i.colCount-1}),a=me(t,s.containerId,{rowIndex:e,colIndex:0}),d=me(t,l.containerId,{rowIndex:e+o-1,colIndex:i.colCount-1});r!=null&&r.reverse?n.selection.setSelection(d,a):n.selection.setSelection(a,d)}const Dnt="",o7=S("get-toolbar-reference-client");function FR(n,t){const e=n.selection.range;if(!e.isSimple()){g(o7,e.start.blockId===e.end.blockId,"invalid selection range");const s=n.getBlockById(e.start.blockId);g(o7,Mt(n,s),"not a complex block");const l=Yt(n,s);if(l.getTextToolbarReferenceClient){const a=l.getTextToolbarReferenceClient(n,s);if(a)return a}}const o=e.isReverse()?t.start:t.end,r=Ue(n,{anchor:o,focus:o}),i=$r(n,t.block,r);if(i.length!==0)return i[0]}function PR(n){var t,e;if(n.children){let o=!1;const r=[];for(const i of n.children){if((t=i.states)!=null&&t.includes("checked")){o=!0;break}(e=n.defaultCheckedChildren)!=null&&e.includes(i.id)&&r.push(i)}if(!o&&(r==null?void 0:r.length))for(const i of r)Array.isArray(i.states)?i.states.push("checked"):i.states=["checked"]}}function lf(n){const t=(r,i)=>{const s=r.findIndex(a=>a.id===i.id);if(s===-1){r.push(i);return}const l=r[s];if(l.value!==i.value&&delete l.value,!!l.states){if(!i.states){l.states=[];return}l.states=mm.default(l.states,i.states)}},e=[],o=new Map;return n.forEach(r=>{var i,s;(i=r.children)!=null&&i.length&&(o.has(r.id)?(s=o.get(r.id))==null||s.push(...r.children):o.set(r.id,[...r.children])),t(e,r)}),o.forEach((r,i)=>{const s=e.find(l=>l.id===i);s&&(s.children=lf(r),PR(s))}),e}function cf(n){return n.findCustom("toolbar-handler")}const Snt="";class NR{constructor(){m(this,"linkPopup",null);m(this,"form",{});m(this,"onFinished",null);m(this,"onClose",null);m(this,"handleOk",async()=>{var t;try{await this.checkValue();const{linkText:e,linkUrl:o}=this.form,r=this.formatUrl(o.getInputValue());(t=this.onFinished)==null||t.call(this,e.getInputValue()||r,r),this._destroy()}catch{}});m(this,"handleClose",()=>{var t;(t=this.onClose)==null||t.call(this),this._destroy()});m(this,"onShow",()=>{setTimeout(()=>{var t;(t=this.form.linkText)==null||t.getField().focus()},400)});m(this,"onChange",()=>{var e;const t=(e=this.linkPopup)==null?void 0:e.content.querySelector('[data-button-id="submit-button"]');t.disabled=!1});m(this,"handleTextKeyboard",t=>{var e;if(!t.isComposing){if(t.key==="Enter"){(e=this.form.linkUrl)==null||e.getField().focus(),t.stopPropagation();return}t.key==="Escape"&&this.handleClose()}});m(this,"handleUrlKeyboard",t=>{if(!t.isComposing){if(t.key==="Enter"){this.handleOk(),t.preventDefault();return}t.key==="Escape"&&this.handleClose()}})}async checkValue(){const{linkUrl:t}=this.form;if(!t.getInputValue())throw t.setFieldError(L.t("link.urlPlaceholder")),new Error(L.t("link.urlPlaceholder"))}formatUrl(t){if(!t)return"";try{new URL(t)}catch{return`${window.location.protocol}//${t}`}return t}editLink(t){var h,p;const{target:e,linkText:o,linkUrl:r,onFinished:i,onClose:s,placement:l="bottom-start"}=t;this.linkPopup=new ou(this.createPopupContent(o,r)),this.linkPopup.addListener("show",this.onShow),this.linkPopup.manualShow(e,{theme:"light",placement:l}),this.onFinished=i,s&&(this.onClose=s);const a=(h=this.linkPopup)==null?void 0:h.content.querySelector('[data-button-id="submit-button"]'),d=(p=this.linkPopup)==null?void 0:p.content.querySelector('[data-button-id="cancel-button"]');a==null||a.addEventListener("click",this.handleOk),d==null||d.addEventListener("click",this.handleClose)}createPopupContent(t,e){const o=k("div",["link-popup-content"],null);this.form.linkText=_p(o,{label:L.t("link.textLabel"),required:!1,placeholder:L.t("link.textPlaceholder"),defaultValue:t,onChange:this.onChange,onKeyDown:this.handleTextKeyboard}),this.form.linkUrl=_p(o,{className:"link-popup-gap",label:L.t("link.urlLabel"),required:!0,placeholder:L.t("link.urlPlaceholder"),defaultValue:e,onChange:this.onChange,onKeyDown:this.handleUrlKeyboard});const r=k("div",["link-popup-footer"],o),i=ho("cancel-button",L.t("link.cancelText"));r.appendChild(i);const s=ho("submit-button",L.t("link.submitText"),void 0,["disabled","primary"]);return r.appendChild(s),o}_destroy(){var o,r,i,s;const t=(o=this.linkPopup)==null?void 0:o.content.querySelector('[data-button-id="submit-button"]'),e=(r=this.linkPopup)==null?void 0:r.content.querySelector('[data-button-id="cancel-button"]');t==null||t.removeEventListener("click",this.handleOk),e==null||e.removeEventListener("click",this.handleClose),this.onFinished=null,this.onClose=null,this.form={},(i=this.linkPopup)==null||i.removeAllListeners(),(s=this.linkPopup)==null||s.destroy()}destroy(){this._destroy()}}function pu(n,t){n.addCustom("link-editor",()=>new NR).editLink(t)}const $R=S("link-popup");function HR(n){return xt(n,"link")}function Cu(n){var t,e;return(e=(t=n.getAttribute("link"))!=null?t:n.textContent)!=null?e:""}function jR(n,t,e){var r,i,s,l;if(n.isBlockWritable(t)&&e&&lo(e)){const a=e,d=(i=(r=n.editorBoxes.getBoxClass(va(a))).getBoxProperties)==null?void 0:i.call(r,n,a);if(d!=null&&d.boxCommands){const h=(l=(s=d.boxCommands["hovering-toolbar"])==null?void 0:s.commands)!=null?l:[];return{element:e,commands:h}}return{element:null,commands:[]}}if(n.isWritable()&&e&&et(n,t)&&HR(e)){const a=k("a",["link-href-button"],null,Cu(e));a.href=Cu(e),a.target="_blank",a.rel="noopener noreferrer";const d=[{id:"link-text",name:Cu(e),disableTooltip:!0,element:a},{id:"edit-link",name:L.t("link.edit"),icon:Lp},{id:"remove-link",name:L.t("link.remove"),icon:kL}];return{element:e,commands:d}}return c4(n,t,"hovering-toolbar")}function r7(n,t,e){var l;const o=Os(t,e),r=n.getBlockText(t),i={start:0,end:0};let s=(l=e.textContent)!=null?l:"";for(let a=0;a<r.length;a++){const d=r[a];if(i.end+d.insert.length>=o.end){i.end+=d.insert.length,s=d.insert;break}i.start<o.start&&(i.start+=d.insert.length,i.end=i.start)}return[i,s]}function UR(n,t,e){const[o,r]=r7(n,t,e);n.selection.selectBlock(t,o.start,o.end);const i=Cu(e),s=(h,p)=>{try{const A=n.getBlockText(t),v=ag(A,o.start,o.end-o.start),B=Wr(v,o.start,h,{link:p});n.setBlockText(t,B),n.selection.selectBlock(t,o.start+h.length),n.focus()}catch(A){$R.error(A)}},l=()=>{n.selection.selectBlock(t,o.end),n.focus()},a=$r(n,t,n.selection.range)[0];if(!a)return;const d=Vr(n,t,"link-button-anchor",a);pu(n,{target:d,linkText:r,linkUrl:i,onFinished:s,onClose:l})}function zR(n,t,e){const[o]=r7(n,t,e),r=n.getBlockText(t),i=Cu(e),s=Wl(o.start,o.end-o.start,r,"link",i);n.setBlockText(t,s),n.selection.selectBlock(t,o.end)}function VR(n,t,e,o){var s,l,a;if(e){if(n.isBlockWritable(t)&&lo(e)){const h=e,p=(l=(s=n.editorBoxes.getBoxClass(va(h))).getBoxProperties)==null?void 0:l.call(s,n,h);if(p!=null&&p.boxCommands){p.boxCommands["hovering-toolbar"].executeCommand(n,t,h,o);return}return}const d=cf(n);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},400),o.id==="edit-link"?UR(n,t,e):o.id==="remove-link"&&zR(n,t,e);return}const r=l4(n,t);if(!r)return;const i=(a=r.blockCommands)==null?void 0:a["hovering-toolbar"];!i||i.executeCommand(n,t,o)}function af(){let n=8;for(;n>0&&!document.querySelector(`div[data-style-heading='${n}']`);)n--;return n}const WR=[yp,kp,wp,Bp,Ep,xp,Ip,Tp];class qR{constructor(t){m(this,"id","BlockTurnIntoCommandProvider");this.editor=t}getHeadingIndex(){let t=af();return t<=4?t=5:t<8&&(t+=1),t}getAvailableCommands(t,e,o){if(et(t,e)){const r=it(e),i=Dt(e),s=Do(t,e),a=t.getBlockData(e).heading,d=[];for(let p=0;p<this.getHeadingIndex();p++)d.push({id:`heading-${p+1}`,name:L.t("commands.heading",{name:`${p+1}`}),icon:WR[p],states:a===p+1?["checked"]:[],value:`${p+1}`});const h=p=>{var v;const A=k("span",["toolbar-item-name-container"],null);for(const B of p.children)if((v=B.states)!=null&&v.includes("checked"))return A.innerHTML=B.icon||nu,A;return A.innerHTML=nu,A};return[{id:"turn-into",name:L.t("commands.headingGroup"),blockId:r,blockType:i,blockKind:s,element:h,groupIndex:200,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["text"],children:[{id:"text",name:L.t("commands.text"),icon:nu,states:a?[]:["checked"]},...d],childrenType:"menu"}]}return[]}applyHeadingStyle(t,e,o){t.updateBlockData(e,{heading:o})}executeCommand(t,e,o,r){if(et(t,e)&&(r.id.startsWith("heading-")||r.id==="text")){const i=r.value?Number(r.value):null;return this.applyHeadingStyle(t,e,i),t.focus(),!0}return!1}}const GR=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
387
+ </svg>`;function hv(){const n=k("span",["editor-loading"],null);return n.innerHTML=QL,n}const bnt="";function YL(n,t){const e=k("button",["editor-checkbox-wrapper"],null);e.setAttribute("data-button-id",n),t!=null&&t.includes("checked")&&W(e,"checked"),t!=null&&t.includes("disabled")&&(e.disabled=!0);const o=k("span",["editor-checkbox"],e);return k("span",["editor-checkbox-inner"],o),e}const vnt="",ec=S("ui-command-bar-base"),JL={itemElementTag:"div",tippyArrow:!1},K2=class extends ve.TypedEmitter{constructor(e,o,r){var i,s;super();m(this,"content");m(this,"items");m(this,"subBar",null);m(this,"parentItem",null);m(this,"closeable",null);m(this,"closeReason",null);m(this,"options");m(this,"id");m(this,"header",null);m(this,"footer",null);m(this,"handleDocumentKeydown",e=>{if(!!this.isVisible&&!e.isComposing&&!Ds(e.target)){if(this.subBar){this.subBar.handleDocumentKeydown(e);return}if(this.items.length!==0){if(e.key==="Escape"){this.close("cancelBar");return}if(e.key==="ArrowUp"){const o=this.getPrevItemIndex(this.getSelectedItemIndex());this.startPauseMouseEnter(),this.selectItem(this.items[o].id),e.preventDefault(),e.stopPropagation()}else if(e.key==="ArrowDown"){const o=this.getNextItemIndex(this.getSelectedItemIndex());this.startPauseMouseEnter(),this.selectItem(this.items[o].id),e.preventDefault(),e.stopPropagation()}else if(e.key==="ArrowRight"){const o=this.getSelectedItem();o&&o.children&&this.showSubCommandBar(o.childrenMenuId)}else if(e.key==="ArrowLeft")this.parentItem&&this.close("switchItem");else if(e.key==="Enter"){const o=this.getSelectedItemIndex();if(o===-1)return;const r=this.items[o],i=this.getItemElementById(r.id);i&&this.emit("click",this,r,i)}}}});m(this,"handleDocumentMouseDown",e=>{if(e.target instanceof Element&&!this.isInCommandBar(e.target)){const o=this.listeners("closing");for(let r=0;r<o.length;r++)if(o[r](this,e)===!1)return;this.close("clickBackground")}});m(this,"handleHidden",()=>{this.closeReason!=="fromHover"&&this.emit("close",this),this.close(null),E5(this.id)});m(this,"handleShow",()=>{this.popper&&(this.popper.setAttribute("data-command-bar-id",this.id),this.options.classes&&W(this.popper,...this.options.classes),this.options.refuseOverflow&&this.popper.classList.add("reference-hidden")),this.emit("show",this),this.options.disablePageScroll&&B5(this.id)});m(this,"lastEnterPauseTime",0);m(this,"startPauseMouseEnter",()=>{this.lastEnterPauseTime=Date.now()});m(this,"handleItemMouseEnter",e=>{if(Date.now()-this.lastEnterPauseTime<100)return;const o=this.getParentCommandItemElement(e.target);if(!o)return;const r=this.getItemElementId(o),i=this.getItemById(r);if(this.selectItem(r),i.manualShowChildren)return;const s=i.childrenMenuId||"";this.showSubCommandBar(s)});m(this,"handleItemMouseLeave",e=>{var r,i;const o=this.getParentCommandItemElement(e.target);!o||((i=(r=this.subBar)==null?void 0:r.parentItem)==null?void 0:i.id)!==this.getItemElementId(o)&&(ot(o,"selected"),this.emit("selectionChange",this,""))});m(this,"handleItemClick",e=>{const o=this.getParentCommandItemElement(e.target);if(!o)return;const r=this.getItemElementId(o),i=this.items.find(s=>s.id===r);if(!!i&&!(i.states&&i.states.indexOf("disabled")!==-1)){if(i.children&&i.children.length>0&&i.manualShowChildren){this.showSubCommandBar(i.childrenMenuId);return}i.element||(this.emit("click",this,i,o),this.options.autoClose&&this.close("clickItem"))}});m(this,"handleWheel",e=>{if(!this.options.disablePageScroll&&!document.querySelector(".editor-disable-scroll"))return;const o=e.target;if(!o||!(o instanceof Node))return;const r=o instanceof HTMLElement?o:o.parentElement;if(!r)return;const i=io(r);if(!Xt(this.content,i)){e.stopPropagation(),e.preventDefault();return}e.deltaY<0?i.scrollTop===0&&(e.stopPropagation(),e.preventDefault()):e.deltaY>0&&i.scrollTop+i.clientHeight>=i.scrollHeight&&(e.stopPropagation(),e.preventDefault())});this.id=(i=r==null?void 0:r.id)!=null?i:K(),this.options={...JL,...r},this.items=e,this.parentItem=(s=r==null?void 0:r.parentItem)!=null?s:null,this.closeable=o!=null?o:null,this.content=this.createCommandBarContent(e)}close(e){this.closeReason=e,this.subBar&&this.subBar.close(e),document.removeEventListener("keydown",this.handleDocumentKeydown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}click(e,o){this.emit("click",this,e,o)}createPopperOptions(){var r,i;const e={modifiers:[]},o=this.options.overflowBoundary;return o&&((r=e==null?void 0:e.modifiers)==null||r.push({name:"flip",options:{boundary:o,fallbackPlacements:["top","bottom"]}})),this.options.padding&&((i=e==null?void 0:e.modifiers)==null||i.push({name:"preventOverflow",options:{padding:this.options.padding}})),e}destroy(){var e;this.close(null),this.removeAllListeners(),(e=this.subBar)==null||e.destroy(),this.subBar=null,this.closeable=null,this.content.removeEventListener("wheel",this.handleWheel)}get isSubCommandBar(){return!!this.parentItem}updateItems(e){var r;this.subBar&&e.findIndex(s=>{var l,a;return s.id===((a=(l=this.subBar)==null?void 0:l.parentItem)==null?void 0:a.id)})===-1&&((r=this.subBar)==null||r.destroy(),this.subBar=null),this.items=e;const o=this.createCommandBarContent(e);this.content.innerHTML="",Array.from(o.children).forEach(i=>{this.content.appendChild(i)})}get popper(){return this.content.closest("[data-tippy-root]")}getSelectedItemIndex(){const e=this.getSelectedItem();return e?this.items.indexOf(e):-1}getPrevItemIndex(e){if(e<=0)return this.items.length-1;let o=e-1;for(;;){const r=this.items[o],i=r.type,l=!(r.states&&r.states.indexOf("disabled")!==-1);if(i!=="separator"&&i!=="section"&&l)return o;if(o-=1,o<=0)return this.items.length-1}}getNextItemIndex(e){let o=e+1;for(;;){if(!this.items[o])return this.getNextItemIndex(-1);const r=this.items[o],i=r.type,l=!(r.states&&r.states.indexOf("disabled")!==-1);if(i!=="separator"&&i!=="section"&&l)return o;if(o+=1,o>this.items.length-1)return 0}}clearSelectedItem(){const e=this.getSelectedItem();if(!e)return;const o=this.getItemElementById(e.id);o&&ot(o,"selected")}selectItem(e){const o=this.getSelectedItem();if(o){if(o.id===e)return;const i=o.id,s=this.getItemElementById(i);s&&ot(s,"selected")}const r=this.getItemElementById(e);r?(W(r,"selected"),this.emit("selectionChange",this,r.getAttribute("data-id")||""),r.scrollIntoView({block:"nearest"})):this.emit("selectionChange",this,"")}showSubCommandBar(e){var s,l;const o=this.getSelectedItem();if(!o)return;if(this.subBar){if(((s=this.subBar.parentItem)==null?void 0:s.id)===o.id){o.manualShowChildren&&this.subBar.close("switchItem");return}this.subBar.destroy(),this.subBar=null}if(!o.children)return;const r=this.getItemElementById(o.id);if(!r)return;const i=K2.createSubCommandBar(o,(l=this.closeable)!=null?l:this,e?{id:e}:{});this.subBar=i,this.subBar.on("click",(a,d,h)=>{this.emit("click",a,d,h)}),this.subBar.on("close",()=>{var a;(a=this.subBar)==null||a.destroy(),this.subBar=null,ot(r,"active")}),o.beforePopup&&o.beforePopup(i),this.subBar.manualShow(r,this.getSubBarOptions(o)),W(r,"active")}isInCommandBar(e){if(!e||!(e instanceof Node))return!1;const o=this.getCommandBarRoot();return o&&Xt(o,e)||Xt(this.content,e)?!0:this.subBar?this.subBar.isInCommandBar(e):!1}createCommandItem(e){var i,s,l,a;let o=(i=this.options.itemElementTag)!=null?i:"div";e.element&&(o="div");const r=k(o,["command-item"],null);return r.setAttribute("data-id",e.id),e.type==="separator"?r.classList.add("separator"):e.type==="section"?(r.classList.add("section","text"),e.element&&(typeof e.element=="function"?r.appendChild(e.element(e)):r.appendChild(e.element))):((s=e.states)!=null&&s.includes("selected")&&r.classList.add("selected"),(l=e.states)!=null&&l.includes("checked")&&r.classList.add("checked"),(a=e.states)!=null&&a.includes("disabled")&&r.classList.add("disabled"),r.onclick=this.handleItemClick,r.onmouseenter=this.handleItemMouseEnter,r.onmouseleave=this.handleItemMouseLeave,e.element?typeof e.element=="function"?r.appendChild(e.element(e)):r.appendChild(e.element):r.classList.add("standard")),this.initItemElement(e,r),r}getItemById(e){const o=this.items.find(r=>r.id===e);return g(ec,o,`can not find command item for id: ${e}`),o}getSelectedItem(){const e=this.content.querySelector(":scope >.editor-command-bar >.command-item.selected");if(e){const o=this.getItemElementId(e),r=this.items.find(i=>i.id===o);return g(ec,r,`can not find command item for id: ${o}`),r}return null}getItemElementId(e){const o=e.getAttribute("data-id");return g(ec,o,"no data-id attribute"),o}getItemElementById(e){const o=this.content.querySelector(`:scope >.editor-command-bar > .command-item[data-id="${e}"]`);return g(ec,o,`no exists command item, id=${e}`),o}getParentCommandItemElement(e){if(!e||!(e instanceof Element))return null;if(xt(e,"command-item"))return e;const o=e.closest(".command-item");return o||null}createCommandBarContent(e){this.content&&this.content.removeEventListener("wheel",this.handleWheel);const o=k("div",["editor-command-bar-root"],null);if(this.options.header){const i=k("div",["editor-command-bar-header"],null);if(this.options.header instanceof Function){const s=this.options.header();s&&i.appendChild(s)}else i.appendChild(this.options.header);this.header=i,this.header&&o.appendChild(this.header)}const r=k("div",["editor-command-bar"],o);if(e.forEach(i=>{var l;const s=this.createCommandItem(i);r.appendChild(s),i.element&&i.setCloseable&&i.setCloseable((l=this.closeable)!=null?l:this)}),this.options.footer){const i=k("div",["menu-item","editor-command-bar","footer"],null);if(this.options.footer instanceof Function){const s=this.options.footer();s&&i.appendChild(s)}else i.appendChild(this.options.footer);this.footer=i,this.footer&&o.appendChild(this.footer)}return(this.options.header||this.options.footer)&&W(o,"scrollable-bar"),this.initCommandBarElement(r),o.addEventListener("wheel",this.handleWheel,{passive:!1}),o}getSubBarOptions(e){var o;return{placement:(o=e.childrenPlacement)!=null?o:"right-start"}}static registerManualCommandBar(e,o){this.commandBarCreators.set(e,o)}static createSubCommandBar(e,o,r){var l;g(ec,e.children&&e.children.length>0,"no item children");const i=(l=e.childrenType)!=null?l:"menu",s=this.commandBarCreators.get(i);return g(ec,s,`no creator for command type: ${i}`),s(e,o,r)}static hasExistsCommandBar(){return!!document.querySelector("[data-command-bar-id]")}};let Ui=K2;m(Ui,"commandBarCreators",new Map),S("ui-command-bar");class Yh extends Ui{constructor(){super(...arguments);m(this,"tippyInstance",null)}manualShow(e,o){var r,i;if(!this.isVisible){if(this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.tippyInstance=$B.default(e,{interactive:!0,content:this.content,trigger:"manual",triggerTarget:null,hideOnClick:!1,placement:(r=o==null?void 0:o.placement)!=null?r:"bottom-start",maxWidth:650,arrow:this.options.tippyArrow,appendTo:document.body,onShow:this.handleShow,onHidden:this.handleHidden,theme:o==null?void 0:o.theme,getReferenceClientRect:o==null?void 0:o.getReferenceClientRect,offset:(i=o==null?void 0:o.offset)!=null?i:[0,0],popperOptions:this.createPopperOptions()}),o!=null&&o.point){const{x:s,y:l}=o.point;this.tippyInstance.setProps({getReferenceClientRect:()=>new DOMRect(s,l,0,0)})}this.clearSelectedItem(),this.tippyInstance.show(),this.parentItem||(document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("mousedown",this.handleDocumentMouseDown)),this.popper&&this.options.id&&this.popper.setAttribute("data-command-bar-id",this.options.id)}}close(e){var o;super.close(e),this.isVisible&&((o=this.tippyInstance)==null||o.hide())}destroy(){var e;(e=this.tippyInstance)==null||e.destroy(),this.tippyInstance=null,super.destroy()}getCommandBarRoot(){return this.content.closest("[data-tippy-root]")}get isVisible(){var e,o;return(o=(e=this.tippyInstance)==null?void 0:e.state.isVisible)!=null?o:!1}get popper(){return this.content.closest("[data-tippy-root]")}}const fv=S("ui-base");class ou extends Yh{constructor(t,e){var i;const r=[{id:(i=e==null?void 0:e.id)!=null?i:`popup-${K()}`,name:"",element:t}];super(r,void 0,{disablePageScroll:!0})}initCommandBarElement(t){W(t,"popper")}initItemElement(t,e){}get popupContent(){const t=this.items[0];g(fv,t,"no dialog item");const e=typeof t.element=="function"?t.element(t):t.element;return g(fv,e,"no item element"),e}}const zi=S("filterable-list");function mv(n){var e,o;const t=k("div",["list-item"],null);return t.setAttribute("data-id",n.id),t.appendChild(k("div",["list-item-text"],null,n.name)),(e=n.states)!=null&&e.includes("selected")&&W(t,"selected"),(o=n.states)!=null&&o.includes("disabled")&&W(t,"disabled"),t}function gv(n){const t=k("div",["list-root"],null);return n.forEach(e=>{t.appendChild(mv(e))}),n.length||t.appendChild(mv({id:"placeholder",states:["disabled"],name:L.t("search.emptyTips")})),t}function pv(n,t){let e=n;return t&&(e=n.map(o=>({...o,states:o.id===t?["selected"]:void 0}))),e}function KL(n,t){const e=k("div",["filterable-list"],null),o=k("div",["filter"],e),r=k("div",["filter-container"],o),i=k("input",["filter-input"],r);t&&t.placeholder&&(i.placeholder=t.placeholder);const s=k("div",["list"],e),l=gv(pv(n,t==null?void 0:t.initialSelectedId));return s.appendChild(l),e}function Cv(n,t,e){const o=n.querySelector(".list");g(zi,o,"no list root");const r=gv(pv(t,e)),i=o.querySelector(".list-root");if(g(zi,i,"no exists menu"),Ca(i,r),e){const s=o.querySelector(".list-item.selected");s&&(g(zi,s,"no selected menu item"),s.scrollIntoView({block:"nearest"}))}}class XL{constructor(t,e){m(this,"root");m(this,"visibleItems");m(this,"selectedId");m(this,"filter","");m(this,"onSelected",null);m(this,"handleKeydown",t=>{this.processKeyDown(t)});m(this,"handleInputChanged",()=>{const t=this.root.querySelector(".filter-input");g(zi,t,"no input");const e=t.value.toLocaleLowerCase();this.setFilter(e)});m(this,"handleClick",t=>{this.processClick(t)});var o;this.items=t,this.options=e,this.root=KL(t,e),this.bindEvents(),this.selectedId=(o=e==null?void 0:e.initialSelectedId)!=null?o:"",this.visibleItems=t}bindEvents(){const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.addEventListener("keyup",this.handleInputChanged),t.addEventListener("keydown",this.handleKeydown),this.root.addEventListener("click",this.handleClick)}unbindEvents(){const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.removeEventListener("keyup",this.handleInputChanged),t.removeEventListener("keydown",this.handleKeydown),this.root.removeEventListener("click",this.handleClick)}destroy(){this.unbindEvents(),this.onSelected=null}getSelectedIndex(){return this.selectedId?this.visibleItems.findIndex(t=>t.id===this.selectedId):-1}setSelectedId(t){this.selectedId=t,Cv(this.root,this.visibleItems,t)}focus(){const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.focus()}reset(){this.setFilter("");const t=this.root.querySelector(".filter-input");g(zi,t,"no input"),t.value=""}setFilter(t){this.filter!==t&&(this.filter=t,this.visibleItems=this.items.filter(e=>e.name.toLocaleLowerCase().includes(t)),Cv(this.root,this.visibleItems,this.selectedId))}processClick(t){var s,l;const e=t.target;if(!(e instanceof HTMLElement))return;const o=e.closest(".list-item");if(!o)return;const r=(s=o.getAttribute("data-id"))!=null?s:"",i=(l=this.visibleItems.find(a=>a.id===r))!=null?l:null;this.onSelected&&this.onSelected(this,i)}processKeyDown(t){var e;if(t.key==="ArrowUp"){let o=this.getSelectedIndex();o===-1?o=this.visibleItems.length-1:o>0&&(o-=1);let r="";o!==-1&&(r=this.visibleItems[o].id),this.setSelectedId(r);return}if(t.key==="ArrowDown"){let o=this.getSelectedIndex();o===-1?o=0:o<this.visibleItems.length-1&&(o+=1);let r="";o!==-1&&(r=this.visibleItems[o].id),this.setSelectedId(r);return}if(t.key==="Enter"){const o=(e=this.visibleItems.find(r=>r.id===this.selectedId))!=null?e:null;this.onSelected&&this.onSelected(this,o)}}}class tM extends XL{constructor(e,o,r){super(e,r);m(this,"popup");m(this,"onShow",null);m(this,"onHide",null);m(this,"custom",null);m(this,"handleShow",()=>{this.onShow&&this.onShow(this)});m(this,"handleHide",()=>{this.onHide&&this.onHide(this)});m(this,"handleShown",()=>{this.focus()});this.popup=new ou(this.root)}destroy(){super.destroy(),this.onShow=null,this.onHide=null}show(e){this.reset(),this.popup.manualShow(e,{theme:"dropdown-list"}),this.focus()}processKeyDown(e){super.processKeyDown(e),(e.key==="Esc"||e.key==="Enter")&&this.popup.close("cancelBar")}processClick(e){super.processClick(e);const o=e.target;!(o instanceof HTMLElement)||!o.closest(".list-item")||this.popup.close("clickItem")}}const ynt="",knt="";function eM(n,t){const e=document.createElement("div");e.classList.add("toast","show"),t!=null&&t.theme&&e.setAttribute("data-theme",t.theme),t!=null&&t.id&&e.setAttribute("data-id",t.id),t!=null&&t.html?e.innerHTML=n:e.textContent=n,t!=null&&t.position&&(e.style.left=`${t.position.x}px`,e.style.top=`${t.position.y}px`,e.classList.add("positioned")),document.body.appendChild(e),setTimeout(()=>{e.classList.remove("show"),setTimeout(()=>{e.remove()},500)},(t==null?void 0:t.duration)||3e3)}function nM(n,t){var e,o;if(W(t,"menu-item"),!n.element){if(n.type==="section"){const r=k("div",["section-name"],null,n.name);t.appendChild(r)}else if(n.type!=="separator"){if(n.icon){const s=k("div",["menu-item-icon"],null);n.icon&&(s.innerHTML=n.icon),t.appendChild(s)}const r=k("div",["menu-item-name","text"],null),i=k("span",[],r,n.name);if(n.ellipsisTooltip&&(i.setAttribute("data-editor-tooltip-allow-markdown","true"),i.setAttribute("data-editor-tooltip-offset-y","25"),i.setAttribute("data-editor-tooltip-placement","right"),i.setAttribute("data-editor-tooltip-common",`<div style="word-break: break-word;">${n.ellipsisTooltip}</div>`)),((e=n.states)==null?void 0:e.includes("disabled"))&&n.disableReason&&(i.setAttribute("data-editor-tooltip-offset-y","25"),i.setAttribute("data-editor-tooltip-maxwidth","800"),i.setAttribute("data-editor-tooltip-placement","right"),i.setAttribute("data-editor-tooltip-common",n.disableReason)),t.appendChild(r),n.subText&&k("div",["item-subtext","text"],t,n.subText),n.children&&!n.element){const s=k("div",["menu-item-sub-indicator"],null);s.innerHTML=ev,t.appendChild(s)}if((o=n.states)!=null&&o.includes("checked")){const s=k("div",["menu-item-checked-icon"],null);s.innerHTML=xL,t.appendChild(s)}}}}class Us extends Yh{constructor(t,e,o){super(t,e,{autoClose:!0,disablePageScroll:!0,...o})}manualShow(t,e){const o={theme:"menu",...e};super.manualShow(t,o)}initCommandBarElement(t){W(t,"menu")}initItemElement(t,e){nM(t,e)}}function oM(n,t,e){var o;return new Us((o=n.children)!=null?o:[],t,{...e,parentItem:n})}function Av(n,t,e){t.setAttribute("data-button-id",n.id),e.tooltipId&&n.name&&!n.disableTooltip&&(t.setAttribute(`data-editor-tooltip-${e.tooltipId}`,n.name),n.desc&&t.setAttribute(`data-editor-tooltip-desc-${e.tooltipId}`,n.desc));const o=t;if(!n.element)if(n.icon){const r=k("span",["toolbar-item-icon-container"],o);n.icon.trim().startsWith("<")?r.innerHTML=n.icon:r.innerText=n.icon}else{const r=k("span",["toolbar-item-name-container"],o);r.innerText=n.name}if(n.dropdown){t.setAttribute("data-dropdown","true");const r=k("span",["toolbar-item-dropdown-container"],o);r.innerHTML=Qh}n.states&&(n.states.indexOf("checked")!==-1&&W(o,"checked"),n.states.indexOf("disabled")!==-1&&(o.disabled=!0))}class ru extends Yh{constructor(t,e,o){super(t,e,{itemElementTag:"button",tippyArrow:!1,...o})}getSubBarOptions(t){var r,i;const e=()=>{const s=this.getItemElementById(t.id),a=this.content.getBoundingClientRect(),d=s.getBoundingClientRect();return new DOMRect(d.left,a.top,d.width,a.height)};return{placement:(r=t.childrenPlacement)!=null?r:"top",getReferenceClientRect:e,offset:(i=t.childrenOffset)!=null?i:[0,4]}}manualShow(t,e){const o={theme:"toolbar",...e};super.manualShow(t,o)}initCommandBarElement(t){W(t,"toolbar")}initItemElement(t,e){Av(t,e,this.options)}}function rM(n,t,e){var o;return new ru((o=n.children)!=null?o:[],t,{...e,parentItem:n})}class iM extends Ui{constructor(t,e,o){super(e,void 0,o),t.appendChild(this.content),document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}initCommandBarElement(t){W(t,"toolbar","fixed")}initItemElement(t,e){Av(t,e,this.options)}close(){this.clearSelectedItem(),this.subBar&&(this.subBar.close("cancelBar"),this.subBar=null)}destroy(){this.content.remove(),super.destroy(),document.removeEventListener("keydown",this.handleDocumentKeydown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}getCommandBarRoot(){return this.content.parentElement}get isVisible(){return!0}}const wnt="";Ui.registerManualCommandBar("menu",oM),Ui.registerManualCommandBar("toolbar",rM);const Bnt="",bv=S("ui-base");class iu extends Yh{constructor(e,o){super(iu.getCommandItems(e,o),void 0,{disablePageScroll:!0,...o});m(this,"handleDocumentMouseDown",e=>{})}initCommandBarElement(e){W(e,"dialog","manual")}initItemElement(e,o){}show(e,o){this.manualShow(e,{...o,theme:"light"})}get dialogContent(){const e=this.items[0];g(bv,e,"no dialog item");const o=e.element;return g(bv,o,"no item element"),o}static getCommandItems(e,o){var s;return[{id:(s=o==null?void 0:o.id)!=null?s:`manual-dialog-${K()}`,name:"",element:e}]}}const Ent="",sM=S("ui-base");class vv{constructor(t){m(this,"menu");m(this,"currentText","");m(this,"handleSearchText");m(this,"handleClick",Le.default((t,e)=>{this.options.onClickItem(this,e)},3e3,{leading:!0,trailing:!1}));m(this,"handleShow",t=>{});m(this,"handleClose",()=>{var t,e;(e=(t=this.options).onClose)==null||e.call(t)});m(this,"handleKeydown",t=>{this.menu.handleDocumentKeydown(t)});this.options=t,this.menu=new Us([],void 0,{id:t.id,header:t.header,footer:t.footer}),this.menu.addListener("click",this.handleClick),this.menu.addListener("close",this.handleClose),this.menu.addListener("show",this.handleShow),this.options.wait?this.handleSearchText=Le.default(async e=>{this.handleSearchTextPure(e)},this.options.wait):this.handleSearchText=this.handleSearchTextPure}setItems(t){if(this.menu.updateItems(t),t.length>0){const e=t.find(o=>o.type!=="section"&&o.type!=="separator");e&&this.menu.selectItem(e.id)}}async popup(t,e){var r,i;if(!(e!=null&&e.noEvent)&&((i=(r=this.options).onShow)==null?void 0:i.call(r,this))===!1)return;this.menu.manualShow(t),this.options.placeholder&&this.showPlaceholder();const o=await this.options.queryItems(this,"");this.highlightText("",o),this.setItems(o)}showLoading(){!this.options.showLoading||(this.options.loadingElement?this.setItems([{id:"loading",name:"",element:this.options.loadingElement,states:["disabled"]}]):this.setItems([{id:"loading",name:"loading",states:["disabled"]}]))}showPlaceholder(){this.setItems([{id:"placeholder",name:"enter text to search",states:["disabled"]}])}showNoResultMessage(t){if(this.options.noResultMessage){const e={name:"",id:"placeholder",states:["disabled"]};typeof this.options.noResultMessage=="string"?e.name=this.options.noResultMessage:(this.options.noResultMessage instanceof HTMLElement||typeof this.options.noResultMessage=="function")&&(e.element=this.options.noResultMessage),this.setItems([e])}else this.setItems([{id:"placeholder",name:this.options.emptyPlaceholder||L.t("search.emptyTips"),states:["disabled"]}])}close(){this.menu.close("cancelBar")}get isVisible(){return this.menu.isVisible}destroy(){this.menu.close("cancelBar"),this.menu.removeAllListeners(),this.menu.destroy()}async handleSearchTextPure(t){this.currentText=t;const e="auto-suggest";try{await xo.lock(e),this.showLoading();const o=this.currentText,r=await this.options.queryItems(this,o);if(this.currentText===o&&(this.currentText=""),r.length===0){this.showNoResultMessage(t);return}this.setItems(r),this.options.highlight&&this.highlightText(o.replace(/^\s+|\s+$/g,""),r)}finally{xo.release(e)}}highlightText(t,e){sM.debug(`highlight menu text: ${t}`);const o=this.menu.content,r=(s,l)=>{if(!l)return s;let a="";const d=l.length,h=l.toLocaleLowerCase();let p=0;for(p=0;p<=s.length-d;p){let A=s.substring(p,p+d);if(A.toLocaleLowerCase()===h){p+=d;const v=s.charAt(p);let B=!1;A.endsWith(" ")&&(B=!0,A=A.trimEnd()),a+=`<span class="highlight">${A}${v===" "||B?"&nbsp":""}</span>`}else a+=s.charAt(p),p++}return p<s.length&&(a+=s.substring(p)),a},i=s=>{if(xt(s,"text")){const l=e==null?void 0:e.find(h=>h.id===s.getAttribute("data-id"));if(l&&l.element)return;const a=s.textContent;if(!a)return;const d=r(a,t);s.innerHTML=d;return}Array.from(s.children).forEach(i)};i(o)}}class Rp{constructor(t,e){m(this,"root");m(this,"input");m(this,"text");m(this,"dropdownIcon");m(this,"clearIcon");m(this,"autoSuggest");m(this,"labels");m(this,"items",[]);m(this,"handleClick",()=>{this.autoSuggest.popup(this.root),this.input.focus()});m(this,"handleClickItem",(t,e)=>{var o,r;(r=(o=this.options)==null?void 0:o.onClickItem)==null||r.call(o,e)});m(this,"handleInput",()=>{this.autoSuggest.handleSearchText(this.input.value),this.updatePlaceholder()});m(this,"handleClear",t=>{var e,o;this.clear(),this.autoSuggest.handleSearchText(""),t.preventDefault(),t.stopPropagation(),(o=(e=this.options)==null?void 0:e.onClear)==null||o.call(e)});m(this,"handleQueryItems",async(t,e)=>this.items.filter(r=>{var i;return(i=this.options)!=null&&i.filter?this.options.filter(r,e):!0}));m(this,"handleShow",()=>{W(this.root,"active"),this.input.focus()});m(this,"handleClose",()=>{var t,e;(e=(t=this.options)==null?void 0:t.onClose)==null||e.call(t),ot(this.root,"active")});var a,d,h,p,A;this.options=e,this.labels=(d=(a=this.options)==null?void 0:a.labels)!=null?d:[];const{root:o,input:r,text:i,clearIcon:s,dropdownIcon:l}=Rp.createDropdown(t,this.labels);this.root=o,this.input=r,this.text=i,this.clearIcon=s,this.dropdownIcon=l,this.autoSuggest=new vv({id:(e==null?void 0:e.popupId)||"dropdown-auto-suggest",header:(h=this.options)==null?void 0:h.header,onClickItem:this.handleClickItem,queryItems:this.handleQueryItems,onClose:this.handleClose,onShow:this.handleShow,highlight:e==null?void 0:e.highlight,emptyPlaceholder:e==null?void 0:e.emptyPlaceholder}),this.items=(A=(p=this.options)==null?void 0:p.items)!=null?A:[],this.root.addEventListener("click",this.handleClick),this.input.addEventListener("input",this.handleInput),this.clearIcon.addEventListener("click",this.handleClear)}close(){this.autoSuggest.close()}destroy(){this.input.removeEventListener("input",this.handleInput),this.root.removeEventListener("click",this.handleClick),this.clearIcon.removeEventListener("click",this.handleClear),this.autoSuggest.destroy()}updateItems(t){this.items=t,this.autoSuggest.handleSearchText("")}setText(t){this.text.innerText=t,this.input.value=t,this.updatePlaceholder()}clear(){this.setText(""),this.setLabels([])}setLabels(t){this.labels=t,this.updateLabels()}static createDropdown(t,e){const o=k("div",["editor-dropdown","empty"],t),r=k("input",["dropdown-input"],o),i=k("div",["dropdown-text"],o),s=k("div",["dropdown-labels"],o);for(let d=0;d<e.length;d+=1){const h=e[d];k("span",["dropdown-label"],s,h)}const l=k("div",["dropdown-clear-icon"],o);l.innerHTML=qL;const a=k("div",["dropdown-icon"],o);return a.innerHTML=Qh,{root:o,input:r,text:i,clearIcon:l,dropdownIcon:a}}updateLabels(){const t=this.root.querySelector(".dropdown-labels");if(t){t.innerHTML="";for(let e=0;e<this.labels.length;e+=1){const o=this.labels[e];k("span",["dropdown-label"],t,o)}}}updatePlaceholder(){var t;if(this.input.value===""){const e=(t=this.options)==null?void 0:t.placeholder;e&&(this.input.placeholder=e,this.text.textContent=e),W(this.root,"empty")}else ot(this.root,"empty")}}const lM=[-1,6,0,1,2,3,4,5],cM=[-1,6,0,1,2,3,4,5,14,13,7,8,9,10,11,12],yv=S("color-palette");function kv(n,t,e,o){g(yv,n>0,"no color in palette");const r=t||1;g(yv,r>0,`invalid palette rows: ${r}`);const i=n/r,s=k("div",["palette-container",o],null);for(let l=0;l<r;l++){const a=k("div",["palette-container-row"],s);for(let d=0;d<i;d++){const h=e(l*i+d);a.appendChild(h)}}return s}function aM(n){const t=k("button",["color-button"],null),e=lM[n];return t.setAttribute("data-color-index",`${e}`),t.innerHTML=tv,t}function uM(n){const t=k("button",["background-color-button"],null),e=cM[n];return t.setAttribute("data-color-index",`${e}`),t}function dM(){const n=k("div",["clear-button-container"],null),t=k("button",["clear-button"],n);return t.innerText=L.t("colorPalette.reset"),n}function hM(n){const t=k("div",["color-palette"],null);return n.color!==!1&&(k("div",["bar-desc"],t,L.t("colorPalette.colorDesc")),t.appendChild(kv(8,1,aM,"color"))),n.backgroundColor!==!1&&(k("div",["bar-desc"],t,L.t("colorPalette.backgroundDesc")),t.appendChild(kv(16,2,uM,"background-color"))),n.clearColorButton!==!1&&t.appendChild(dM()),t}function fM(n,t,e){const o=t==="color"?"color":"background-color",r=n.querySelector(`.${o} button.selected`);r&&ot(r,"selected"),e===null&&(e=-1);const i=n.querySelector(`.${o} button[data-color-index="${e}"]`);i&&W(i,"selected")}const xnt="",mM={};class gM extends ve.TypedEmitter{constructor(e=mM){super();m(this,"root");m(this,"handleClick",e=>{const o=e.target;if(!o||!(o instanceof Element))return;const r=o.closest("button");if(!r)return;if(xt(r,"clear-button")){this.setColor("backgroundColor",null),this.setColor("color",null),this.emit("onClick","clearColor",0);return}const i=r.getAttribute("data-color-index");if(!i)return;const s=Number.parseInt(i,10);Number.isNaN(s)||(xt(r,"color-button")?s===-1?(this.setColor("color",null),this.emit("onClick","clearColor",1)):(this.setColor("color",s),this.emit("onClick","color",s)):s===-1?(this.setColor("backgroundColor",null),this.emit("onClick","clearColor",2)):(this.setColor("backgroundColor",s),this.emit("onClick","backgroundColor",s)))});this.options=e,this.root=hM(e),this.root.addEventListener("click",this.handleClick)}destroy(){this.removeAllListeners(),this.root.removeEventListener("click",this.handleClick)}setColor(e,o){fM(this.root,e,o)}}class wv{constructor(t,e){m(this,"name","Color Palette");m(this,"element");m(this,"palette");m(this,"closeable",null);this.id=t,this.palette=new gM(e),this.element=this.palette.root}setCloseable(t){this.closeable=t}destroy(){this.palette.destroy(),this.closeable=null}}function pM(){const n=k("button",["color-button"],null);return n.innerHTML=tv,n}function Op(n,t){const[e,o]=t;e===null?n.removeAttribute("data-color"):n.setAttribute("data-color",`${e}`),o===null?n.removeAttribute("data-background-color"):n.setAttribute("data-background-color",`${o}`)}class CM extends ve.TypedEmitter{constructor(e){super();m(this,"id","text-color-item");m(this,"name",L.t("colorPalette.name"));m(this,"dropdown",!0);m(this,"manualShowChildren",!0);m(this,"children",[]);m(this,"element");m(this,"colorPaletteItem");m(this,"latestColors",[null,null]);m(this,"handlePaletteClick",(e,o)=>{this.emit("onClick",e,o),e==="color"||e==="backgroundColor"?e==="color"?this.latestColors[0]=o:this.latestColors[1]=o:this.latestColors=[null,null],Op(this.element,this.latestColors)});m(this,"beforePopup",()=>{this.emit("beforePopup")});this.editor=e,this.colorPaletteItem=new wv("text-color-palette-item"),this.colorPaletteItem.palette.addListener("onClick",this.handlePaletteClick),this.children.push(this.colorPaletteItem),this.element=pM()}destroy(){this.colorPaletteItem.destroy()}updatePaletteColor(e){this.colorPaletteItem.palette.setColor("color",e[0]),this.colorPaletteItem.palette.setColor("backgroundColor",e[1]),this.latestColors=e,Op(this.element,this.latestColors)}updateButtonColor(e){this.latestColors=e,Op(this.element,this.latestColors)}}const Int="";function _p(n,t){const e=k("div",["editor-input-wrap"],n);t!=null&&t.className&&W(e,t==null?void 0:t.className);const o=k("div",["editor-input-label"],e);k("span",[],o,t.label),t.required&&W(o,"required");const r=k("div",["editor-input-container"],e),i=k("input",["editor-input"],r);t.placeholder&&(i.placeholder=t.placeholder),t.defaultValue&&(i.value=t.defaultValue);const s=k("div",["editor-input-error"],e);return i.addEventListener("input",l=>{var a;(a=t.onChange)==null||a.call(t,l),ot(e,"error")}),i.addEventListener("keydown",l=>{var a;(a=t.onKeyDown)==null||a.call(t,l)}),{getField:()=>i,getInputValue:()=>i.value,setFieldError:l=>{W(e,"error"),s.innerText=l},focus:()=>{setTimeout(()=>{i.focus()})}}}function Fp(n){const t=document.getSelection();if(!t)return!0;const e=t.focusNode;if(!e)return!0;const o=t.focusOffset,r=e.childNodes[o];if(!r)return!0;if(r instanceof HTMLElement){const i=r.tagName.toLowerCase();if(r===n.input.inputElement)return!0;if(i==="input"||i==="textarea")return!1}return!0}class AM extends vv{constructor(e,o){super(o);m(this,"handleClose",()=>{var e,o;Fp(this.editor)&&this.editor.focus(),(o=(e=this.options).onClose)==null||o.call(e)});this.editor=e,this.editorOptions=o}async popupInEditor(e,o,r){var d,h;if(((h=(d=this.editorOptions).onShow)==null?void 0:h.call(d,this,e,o,r))===!1)return;this.options.showLoading&&this.showLoading();const i=this.editor.getBlockByIndex(e,o);if(!Xt(this.editor.rootContainer,i)||ut(this.editor,i)<r)return;const s=$r(this.editor,i,ke(this.editor,i,r));if(s.length===0)return;const l=s[0],a=Vr(this.editor,i,"editor-auto-suggest-menu",l);super.popup(a,{noEvent:!0})}}const Pp=S("auto-suggest-menu");class Np{constructor(t,e){m(this,"order",100);m(this,"menu");m(this,"anchor",null);m(this,"close",()=>{this.menu.close()});m(this,"handleSelectionChanged",t=>{var o,r;if(!((o=this.menu)!=null&&o.isVisible))return;const e=t.selection.range.start;if(e.isSimple()&&e.blockId===((r=this.anchor)==null?void 0:r.blockId)&&e.offset>=this.anchor.offset){const i=t.getBlockById(e.blockId);if(ie(Tn(pn(t,i),e.offset).left).startsWith(this.anchor.leftText))return}this.menu.close()});m(this,"deleteTrigger",()=>{const t=this.editor,e=t.selection.range.start;if(!e.isSimple()||!this.anchor)return!1;const{blockId:o,offset:r}=e,i=t.getBlockById(o),s=ie(bh(t,i,r));if(g(Pp,this.anchor,"no anchor"),!s.startsWith(this.anchor.leftText))return!1;const l=this.anchor.offset-this.anchor.trigger.length,a=r-l;return t.selection.selectBlock(i,l),a&&(t.deleteTextFromBlock(i,l,a),this.anchor.offset-=this.anchor.trigger.length),this.anchor.trigger.length||this.menu.close(),!0});m(this,"onClose",()=>{var t,e;(e=(t=this.options).onClose)==null||e.call(t)});m(this,"onShow",(t,e,o,r)=>{var i;if((i=this.options)!=null&&i.onShow)return this.options.onShow(this,e,o,r)});m(this,"onClickItem",(t,e)=>{!this.anchor||(this.options.autoDeleteTrigger&&this.deleteTrigger(),this.options.onClickItem(this,e,this.anchor))});m(this,"queryItems",(t,e)=>this.options.queryItems(this,e));m(this,"renderMenuItem",(t,e)=>{var r,i;return(i=(r=this.options).renderMenuItem)==null?void 0:i.call(r,this,e)});this.editor=t,this.options=e,this.menu=new AM(t,{id:e.id,showLoading:e.showLoading,loadingElement:e.loadingElement,placeholder:e.placeholder,header:e.header,footer:e.footer,wait:e.wait,noResultMessage:e.noResultMessage,highlight:e.highlight,onClose:this.onClose,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems,renderMenuItem:this.renderMenuItem}),t.input.addHandler(this),t.addListener("selectionChanged",this.handleSelectionChanged)}handleBeforeKeyDown(t,e){var o;return!((o=this.menu)!=null&&o.isVisible)||Em(e.key)?!1:y5(e)&&!ks(e)?(setTimeout(()=>{this.resetItems()}),!1):xm(e)?(this.menu.close(),!0):(this.menu.handleKeydown(e),!0)}popup(t,e,o,r){this.anchor={blockId:it(t),offset:e,leftText:o,trigger:r};const i=ct(nt(t)),s=bt(t);this.menu.popupInEditor(i,s,e)}handleAfterInsertText(t,e,o,r,i){var h,p;const s=t.selection.range.start;if(!s.isSimple()||!this.options.enableFirstBlock&&e==="root"&&o===0)return!1;const{blockId:l,offset:a}=s,d=t.getBlockByIndex(e,o);if(it(d)!==l)return!1;if((h=this.menu)!=null&&h.isVisible)this.resetItems();else if(this.options.trigger.indexOf(i)!==-1){if(r>0&&this.options.needSpaceBeforeTrigger&&(((p=t.getBlockData(d).text)==null?void 0:p.reduce((D,x)=>D+x.insert,""))||"")[r-1]!==" "||Ui.hasExistsCommandBar())return!1;const A=ie(bh(t,d,a));this.popup(d,a,A,i)}return!1}handleUpdateCompositionText(t,e,o,r,i){var d;const s=t.selection.range.start;if(!s.isSimple())return!1;const{blockId:l}=s,a=t.getBlockByIndex(e,o);return it(a)!==l||(d=this.menu)!=null&&d.isVisible&&this.resetItems(),!1}resetItems(){var l;if(!((l=this.menu)!=null&&l.isVisible))return;const t=this.editor,e=t.selection.range.start;if(!e.isSimple())return;const{blockId:o,offset:r}=e,i=t.getBlockById(o),s=ie(bh(t,i,r));if(g(Pp,this.anchor,"no anchor"),s.startsWith(this.anchor.leftText)){const a=s.substring(this.anchor.leftText.length);Pp.debug(`search text: ${a}`),this.menu.handleSearchText(a)}}destroy(){var t;this.editor.input.removeHandler(this),this.editor.removeListener("selectionChanged",this.handleSelectionChanged),(t=this.menu)==null||t.destroy()}}function bM(){const n={};for(let t=1;t<=8;t++)n[`heading-${t}`]={shortcut:`/h${t}`};return n}const vM={"insert-hr":{shortcut:"/hr"},"insert-uml":{shortcut:"/uml"},"insert-table":{shortcut:"/table"},"insert-image":{shortcut:"/image"},"insert-code":{shortcut:"/code"},"insert-link":{shortcut:"/link"},"insert-drawio":{shortcut:"/uml"},"insert-video":{shortcut:"/video"},"insert-audio":{shortcut:"/audio"},"insert-math":{shortcut:"/math"},"insert-webPage":{shortcut:"/web"},"insert-bilibili":{shortcut:"/bilibili"},"insert-youku":{shortcut:"/youku"},"insert-figma":{shortcut:"/figma"},"insert-modao":{shortcut:"/modao"},"insert-tencent":{shortcut:"/tencent"},"insert-unordered":{shortcut:"/bl"},"insert-ordered":{shortcut:"/nu"},"insert-checkbox":{shortcut:"/todo"},"insert-quote":{shortcut:"/quote"},...bM()};function An(n){var t;return(t=vM[n])==null?void 0:t.shortcut}function yM(n){var t;return(t=n.subText)!=null?t:""}const fr=S("table-dom");function mr(n){return`${it(n)}_scroll`}function _e(n){const t=n.querySelector("div[data-type=table-content] >table");return g(fr,t instanceof HTMLTableElement,"invalid table"),t}function gr(n,t){const o=n.getCustom(mr(t)).contentElement.firstElementChild;g(fr,o instanceof HTMLElement,"invalid table content");let r=o.querySelector(":scope >div[data-type=table-tools]");return r||(r=k("div",[],o),r.setAttribute("data-type","table-tools"),n.domEvents.addEventListener(r,"dblclick",(i,s)=>s.stopPropagation()),n.domEvents.addEventListener(r,"click",(i,s)=>{s.detail===3&&s.stopPropagation()})),g(fr,r,"no table tools"),r}function kM(n,t){return n.findCustom(mr(t))?gr(n,t):null}function Bv(n){const t=[];return Array.from(n.rows).forEach(e=>{t.push(...Array.from(e.cells))}),t}function su(n){const t=n.querySelector(":scope div[data-type=editor-container]");return g(fr,t,"no child container in cell"),t}function wM(n){const o=Bv(n).map(r=>{const i=su(r),s=ct(i),l=r.colSpan,a=r.rowSpan;return`${s}/${l}/${a}`}).join();return Nd.default(o)}function Ve(n){return Dt(n)==="table"}function $p(n){const t=nt(n);if(Gt(t))return null;const e=tt(t);return g(fr,e,"no parent block"),Ve(e)?t:$p(e)}function Jr(n){if(Ve(n))return n;const t=nt(n);if(Gt(t))return null;const e=tt(t);return g(fr,e,"no parent block"),Ve(e)?e:Jr(e)}function BM(n,t){const e=n.querySelector("colgroup");g(fr,e,"no colgroup");const o=e.children[t];return g(fr,o,"no col"),g(fr,o instanceof HTMLTableColElement,`invalid col: ${o.tagName}`),o}function Ev(n){try{return _e(n),!0}catch{return!1}}function EM(n){return te(n).querySelector(":scope > .block-helper")}function xv(n){const t=tt(n.contentElement);g(fr,t,"no block");const e=EM(t);if(e){const i=Math.min(n.contentElement.offsetLeft+29,n.rootElement.scrollLeft),s=t.getBoundingClientRect().width;e.style.right=`${i+s+5}px`}}const Gn=S("doc-table-grid");class xM{constructor(t){m(this,"_cells",[]);for(let e=0;e<t;e++)this._cells.push(void 0)}cols(){return this._cells.length}setCell(t,e){g(Gn,t>=0&&t<this.cols(),`set cell, invalid col: ${t}`),this._cells[t]=e}getCell(t){g(Gn,t>=0&&t<this.cols(),`get cell, invalid col: ${t}`);const e=this._cells[t];return g(Gn,e,"get cell, no cell"),e}getCellAllowEmpty(t){return g(Gn,t>=0&&t<this.cols(),`get cell, invalid col, ${t}`),this._cells[t]}getNextNonVirtualCell(t){return this._cells.slice(t+1).find(e=>!e.virtual)}forEach(t){this._cells.forEach(t)}}class Jh{constructor(t){m(this,"_data");m(this,"_rows");this._data=t,this._rows=[];for(let e=0;e<this.rowCount;e++)this._rows.push(new xM(this.colCount));this.fillGrid(),g(Gn,t.colsWidth,"no colsWidth"),g(Gn,this.colCount===t.colsWidth.length,"invalid col count")}get rowCount(){return this._data.rows}get colCount(){return this._data.cols}getNextEmptyCell(t,e){let o=t,r=e;for(;;){if(o+=1,o===this.colCount&&(o=0,r+=1),r>=this.rowCount)return null;if(this._rows[r].getCellAllowEmpty(o)===void 0)return{col:o,row:r}}}fillGrid(){const t=this._data.children;g(Gn,t,"no children");let e=0,o=0;t.forEach((r,i)=>{const s=this._data[`${r}_colSpan`]||1,l=this._data[`${r}_rowSpan`]||1;for(let d=0;d<l;d++)for(let h=0;h<s;h++)this._rows[o+d].setCell(e+h,{col:e,row:o,containerId:r,virtual:h!==0||d!==0,colSpan:s,rowSpan:l});const a=this.getNextEmptyCell(e,o);a?(e=a.col,o=a.row):g(Gn,i===t.length-1,`invalid table data, no next empty cell: ${JSON.stringify(this._data)}`)}),this._rows.forEach(r=>{r.forEach(i=>{g(Gn,i,"no cell"),g(Gn,i.containerId,"no containerId")})})}getCell(t){const{col:e,row:o}=t,r=this._rows[o];g(Gn,r,`get cell, no row: ${o}`);const i=r.getCell(e);return g(Gn,i,`get cell, no cell: ${e}`),i}getRow(t){const e=this._rows[t];return g(Gn,e,`get row, no row: ${t}`),e}forEach(t){this._rows.forEach(t)}}const Kh=S("table-data");function IM(n){const t=n.firstElementChild;return g(Kh,t,"no child element for cell"),g(Kh,Nr(t),"cell first child is not a container"),g(Kh,Lo(t),"cell first child is not a container"),t}function TM(n){const t=tt(n);g(Kh,t,"no parent block for table");const e=[],o={};Array.from(n.rows).forEach(l=>{Array.from(l.cells).forEach(a=>{const d=IM(a),h=ct(d);e.push(h),(a.colSpan>1||a.rowSpan>1)&&(o[`${h}_colSpan`]=a.colSpan,o[`${h}_rowSpan`]=a.rowSpan)})});const r=n.rows.length,i=Array.from(n.rows[0].cells).map(l=>l.colSpan).reduce((l,a)=>l+a,0);return{id:it(t),type:Dt(t),rows:r,cols:i,children:e,colsWidth:Array(i).fill(100),...o}}function zs(n){return new Jh(n)}function DM(n){return zs(TM(n))}const We=S("table-grid"),SM=60;class LM{constructor(t,e){m(this,"containerId");m(this,"row");m(this,"col");m(this,"colSpan");m(this,"rowSpan");m(this,"virtual");m(this,"table");this.table=t,this.containerId=e.containerId,this.row=e.row,this.col=e.col,this.colSpan=e.colSpan,this.rowSpan=e.rowSpan,this.virtual=e.virtual}get cell(){const e=this.container.closest("td");return g(We,e,"no parent cell for child container"),e}get container(){const t=this.table.querySelectorAll(`[data-container-id=${this.containerId}]`);g(We,t.length===1,"containers !== 1"),g(We,Nr(t[0]),"not a container");const e=t[0];return g(We,Lo(e),"not a child container"),e}}class MM{constructor(t,e){m(this,"_cells",[]);e.forEach(o=>{this._cells.push(new LM(t,o))})}get cells(){return this._cells}getCell(t){return g(We,t<this._cells.length,"get cell, invalid col"),this._cells[t]}getNextNonVirtualCell(t){return this._cells.slice(t+1).find(e=>!e.virtual)}getSpannedCell(){return this._cells.find(t=>t.virtual||t.colSpan>1||t.rowSpan>1)}}const X2=class{constructor(t){m(this,"_rows",[]);this.table=t,DM(t).forEach(r=>{this._rows.push(new MM(t,r))});const o=this.colCount;this._rows.forEach(r=>{g(We,r.cells.length===o,"row.cells.length !== colCount")})}get rowCount(){return this._rows.length}get colCount(){return this._rows.length===0?0:(g(We,this.rowCount>0,"rowCount <= 0"),this.getRow(0).cells.length)}getRow(t){return this._rows[t]}getCell(t){const e=this.getRow(t.row);return g(We,e,"no row"),e.getCell(t.col)}getCellContainer(t){return this.getCell(t).container}getFirstCellContainer(){return this.getCellContainer({row:0,col:0})}getLastCellContainer(){const t=this.rowCount-1,e=this.colCount-1;return this.getCellContainer({row:t,col:e})}getColumnCells(t){g(We,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount,o=[];for(let r=0;r<e;r++){const i=this.getCell({row:r,col:t});o.push(i)}return o}toRealCells(t){const e=[];return t.forEach(o=>{const r=this.getRealCell(o);e.findIndex(i=>i.containerId===r.containerId)===-1&&e.push(r)}),e}getColumnRealCells(t){const e=this.getColumnCells(t);return this.toRealCells(e)}getRowRealCells(t){const e=this.getRow(t).cells;return this.toRealCells(e)}getFirstSpannedCell(t){g(We,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount;for(let o=0;o<e;o++){const r=this.getCell({row:o,col:t});if(r.virtual||r.colSpan>1||r.rowSpan>1)return r}}getRealCell(t){const e=this.getCell(t);if(!e.virtual)return e;const o=this.getCellById(e.containerId);return g(We,!o.virtual,"found a virtual cell"),o}getColumnSpannedRange(t){const e=this.getColumnRealCells(t);let o=1e5,r=-1;return e.forEach(i=>{o=Math.min(i.col,o),r=Math.max(i.col+i.colSpan-1,r)}),g(We,o<=r,"min > max"),g(We,o>=0,"min < 0"),g(We,r<this.colCount,"max >= colCount"),[o,r]}getRowSpannedRange(t){const e=this.getRowRealCells(t);let o=1e5,r=-1;return e.forEach(i=>{o=Math.min(i.row,o),r=Math.max(i.row+i.rowSpan-1,r)}),g(We,o<=r,"min > max"),g(We,o>=0,"min < 0"),g(We,r<this.rowCount,"max >= rowCount"),[o,r]}getSpannedRange(t,e){const o=Math.min(t.row,e.row),r=Math.max(t.row,e.row),i=Math.min(t.col,e.col),s=Math.max(t.col,e.col),l=[];for(let v=o;v<=r;v++)for(let B=i;B<=s;B++)l.push(this.getCell({row:v,col:B}));const a=this.toRealCells(l);let d=1e4,h=1e4,p=-1,A=-1;return a.forEach(v=>{h=Math.min(v.col,h),d=Math.min(v.row,d),A=Math.max(v.col+v.colSpan-1,A),p=Math.max(v.row+v.rowSpan-1,p)}),[{row:d,col:h},{row:p,col:A}]}getAllCells(){return this.getCells({col:0,row:0},{col:this.colCount-1,row:this.rowCount-1})}sub(t,e){const o=[];for(let r=t.row;r<=e.row;r++){const i=[];for(let s=t.col;s<=e.col;s++){const l=this.getCell({row:r,col:s});i.push(l)}o.push(i)}return o}getAllContainers(){return this.getAllCells().map(e=>e.container)}getCells(t,e){const o=[],r=this.getSpannedRange(t,e),i=r[0],s=r[1],l=Math.min(i.row,s.row),a=Math.max(i.row,s.row),d=Math.min(i.col,s.col),h=Math.max(i.col,s.col);for(let p=l;p<=a;p++)for(let A=d;A<=h;A++){const v=this.getCell({row:p,col:A});v.virtual||o.push(v)}return o}map(t){const e=[];for(let o=0;o<this.rowCount;o++){const r=[];for(let i=0;i<this.colCount;i++){const s=this.getCell({row:o,col:i});r.push(t(s))}e.push(r)}return e}getBottomCell(t){const e=this.rowCount;let o=t,r=t.row;for(;o.containerId===t.containerId;){if(r+=1,r>=e)return null;o=this.getCell({row:r,col:t.col})}return this.getRealCell(o)}getTopCell(t){let e=t,o=t.row;for(;e.containerId===t.containerId;){if(o-=1,o<0)return null;e=this.getCell({row:o,col:t.col})}return this.getRealCell(e)}get cells(){let t=[];return this._rows.forEach(e=>{t=t.concat(e.cells)}),t}getVirtualCellContainersGrid(){return this.map(t=>t.containerId)}static virtualCellContainersGridToChildren(t){const e=t,o=[];return e.forEach(r=>{r.forEach(i=>{o.indexOf(i)===-1&&o.push(i)})}),o}getCellById(t){const o=this.cells.find(r=>r.containerId===t);return g(We,o,"cell not found"),o}getCellByCellElement(t){const e=su(t);return this.getCellByContainerId(ct(e))}getCellByContainerId(t){return this.getCellById(t)}static fromTable(t){const e=wM(t),o=this.caches.getSync(e,()=>(We.debug("create table grid"),new X2(t)));return o.table!==t?(this.caches.delete(e),this.fromTable(t)):o}static fromBlock(t){return this.fromTable(_e(t))}};let Tt=X2;m(Tt,"caches",new t5(SM));function Xh(n,t){Object.entries(n).forEach(([e])=>{e.startsWith(`${t}/`)&&delete n[e]})}const RM=S("table-selection-range");function Uo(n,t,e){var R,H,z,q;const o=Tt.fromBlock(n),r=t,i=e,s=o.getCellByContainerId(r.childContainerId),l=o.getCellByContainerId(i.childContainerId),a=r.custom,d=i.custom,h=(R=a==null?void 0:a.rowIndex)!=null?R:s.row,p=(H=a==null?void 0:a.colIndex)!=null?H:s.col,A=(z=d==null?void 0:d.rowIndex)!=null?z:l.row+l.rowSpan-1,v=(q=d==null?void 0:d.colIndex)!=null?q:l.col+l.colSpan-1,B=Math.min(h,A),D=Math.max(h,A),x=Math.min(p,v),_=Math.max(p,v);return{fromRow:B,toRow:D,fromCol:x,toCol:_}}function Hp(n,t){const e=new Set,o=new Set,r=n.selection.range;if(!r.isSimple()&&r.start.blockId===it(t)){const i=Tt.fromBlock(t),{start:s,end:l}=r;g(RM,!s.isSimple()&&!l.isSimple(),"invalid range");const{fromCol:a,toCol:d,fromRow:h,toRow:p}=Uo(t,s,l);if(h===0&&p===i.rowCount-1)for(let A=a;A<=d;A++)o.add(A);if(a===0&&d===i.colCount-1)for(let A=h;A<=p;A++)e.add(A)}return{selectedRows:e,selectedColumns:o}}function lu(n,t){let e=null;if(t.isCollapsed()&&t.isSimple()){const o=n.getBlockById(t.start.blockId);if(Ve(o)){const r=nt(o),i=tt(r);i&&(e=Jr(i))}else e=Jr(o)}else{const o=n.getBlockById(t.start.blockId),r=Jr(o),i=n.getBlockById(t.end.blockId),s=Jr(i);r===s&&(e=r)}return e}const nc=S("delete-columns");function Iv(n,t,e){const{start:o,end:r}=e;if(o.blockId!==r.blockId||e.isSimple()||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{fromRow:s,toRow:l}=Uo(t,e.start,e.end),a=Tt.fromBlock(t);return s===0&&l===a.rowCount-1}function jp(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{var H;const e=t.getBlockById(n.start.blockId);if(!Iv(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromCol:o,toCol:r}=Uo(e,n.start,n.end),i=Tt.fromBlock(e);if(o===0&&r===i.colCount-1){t.deleteBlock(e);return}const s=new Set,l=i.map(z=>z.containerId);for(let z=0;z<l.length;z++){const q=l[z];for(let rt=o;rt<=r;rt++){const ft=q[rt];s.add(ft)}q.splice(o,r-o+1)}const a=new Set(l.flat()),d=new Set(Array.from(s).filter(z=>!a.has(z))),h=r-o+1,p=new Map,A=new Map;s.forEach(z=>{if(d.has(z))return;const q=i.getCellByContainerId(z);if(g(nc,q.colSpan>1,"invalid effected cell, colSpan === 1"),q.col<o){g(nc,a.has(z),"invalid effected cell, not exists");let ne=q.col+q.colSpan-1;ne>r&&(ne=r);const qe=ne-o+1,Yn=q.colSpan-qe;p.set(z,Yn);return}g(nc,q.col<=r,"invalid effected cell, col > endCol");const rt=q.col,ft=q.col+q.colSpan-1,Bt=q.col-o,jt=ft-rt+1-h+Bt;g(nc,jt>0,"invalid effected cell, newSpanned <= 0");const Ut=Gr(t.doc);A.set(z,{newContainerId:Ut,colSpan:jt})});for(let z=0;z<l.length;z++){const q=l[z];for(let rt=o;rt<q.length;rt++){const ft=q[rt],Bt=A.get(ft);Bt&&(q[rt]=Bt.newContainerId)}}const v=mt.default(t.getBlockData(e));v.colsWidth.splice(o,r-o+1),d.forEach(z=>{Xh(v,z)}),p.forEach((z,q)=>{g(nc,z>=1,"invalid modified colSpan, colSpan < 1"),z===1?v[`${q}_colSpan`]=void 0:v[`${q}_colSpan`]=z}),A.forEach((z,q)=>{Xh(v,q);const{newContainerId:rt,colSpan:ft}=z;g(nc,ft>=1,"invalid newContainerData, colSpan < 1"),ft>1&&(v[`${rt}_colSpan`]=ft);const Bt=i.getCellByContainerId(q).rowSpan;Bt>1&&(v[`${rt}_rowSpan`]=Bt)});const D=(H=l[0][o])!=null?H:l[0][o-1],x=t.getChildContainerData(D)[0],_=Tt.virtualCellContainersGridToChildren(l),R={...v,cols:v.cols-h,children:_};zs(R),t.updateBlockData(e,R,ke(t,x.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(A.keys()))})}const oc=S("delete-rows");function Tv(n,t,e){const{start:o,end:r}=e;if(o.blockId!==r.blockId||e.isSimple()||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{fromCol:s,toCol:l}=Uo(t,e.start,e.end),a=Tt.fromBlock(t);return s===0&&l===a.colCount-1}function Up(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{const e=t.getBlockById(n.start.blockId);if(!Tv(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromRow:o,toRow:r}=Uo(e,n.start,n.end),i=Tt.fromBlock(e);if(o===0&&r===i.rowCount-1){t.deleteBlock(e);return}const s=new Set,l=i.map(R=>R.containerId);for(let R=r;R>=o;R--)l[R].forEach(z=>s.add(z)),l.splice(R,1);const a=new Set(l.flat()),d=new Set(Array.from(s).filter(R=>!a.has(R))),h=r-o+1,p=new Map,A=new Map;s.forEach(R=>{if(d.has(R))return;const H=i.getCellByContainerId(R);if(g(oc,H.rowSpan>1,"invalid effected cell, rowSpan === 1"),H.row<o){g(oc,a.has(R),"invalid effected cell, not exists");let jt=H.row+H.rowSpan-1;jt>r&&(jt=r);const Ut=jt-o+1,ne=H.rowSpan-Ut;p.set(R,ne);return}g(oc,H.row<=r,"invalid effected cell, col > endCol");const z=H.row,q=H.row+H.rowSpan-1,rt=H.row-o,ft=q-z+1-h+rt;g(oc,ft>0,"invalid effected cell, newSpanned <= 0");const Bt=Gr(t.doc);A.set(R,{newContainerId:Bt,rowSpan:ft})});for(let R=o;R<l.length;R++){const H=l[R];for(let z=0;z<H.length;z++){const q=H[z],rt=A.get(q);rt&&(H[z]=rt.newContainerId)}}const v=mt.default(t.getBlockData(e));d.forEach(R=>{Xh(v,R)}),p.forEach((R,H)=>{g(oc,R>=1,"invalid modified rowSpan, rowSpan < 1"),R===1?v[`${H}_rowSpan`]=void 0:v[`${H}_rowSpan`]=R}),A.forEach((R,H)=>{Xh(v,H);const{newContainerId:z,rowSpan:q}=R;g(oc,q>=1,"invalid newContainerData, rowSpan < 1"),q>1&&(v[`${z}_rowSpan`]=q);const rt=i.getCellByContainerId(H).colSpan;rt>1&&(v[`${z}_colSpan`]=rt)});const B=l[o]?l[o][0]:l[o-1][0],D=t.getChildContainerData(B)[0],x=Tt.virtualCellContainersGridToChildren(l),_={...v,rows:v.rows-h,children:x};zs(_),t.updateBlockData(e,_,ke(t,D.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(A.keys()))})}const cu=S("table-range");function tf(n){g(cu,!n.isSimple(),"must be complex selection range");const{anchor:t,focus:e}=n;g(cu,!t.isSimple(),"invalid start pos type"),g(cu,!e.isSimple(),"invalid end pos type");const o=n.getEditor();g(cu,t.blockId===e.blockId,"invalid range, not same block");const r=o.getBlockById(t.blockId);g(cu,Dt(r)==="table","invalid block type, not a table block");const i=_e(r),s=Tt.fromTable(i),l=s.getCellByContainerId(t.childContainerId),a=s.getCellByContainerId(e.childContainerId),d=Math.min(l.row,a.row),h=Math.max(l.row,a.row),p=Math.min(l.col,a.col),A=Math.max(l.col,a.col),v=s.getCell({row:d,col:p}),B=s.getCell({row:h,col:A});return{editor:o,block:r,table:i,startCell:v,endCell:B,startRow:d,startCol:p,endRow:h,endCol:A}}const zp=S("split-cell");function Vp(n,t,e){n.undoManager.runInGroup(()=>{const o=Tt.fromBlock(t),r=o.getRealCell(e);g(zp,!r.virtual,"should not split virtual cell"),g(zp,r.colSpan>1||r.rowSpan>1,"cell does not has span data");const i=o.getVirtualCellContainersGrid();for(let p=0;p<r.rowSpan;p++)for(let A=0;A<r.colSpan;A++){if(p===0&&A===0)continue;const v=p+r.row,B=A+r.col,D=Gr(n.doc);i[v][B]=D}const s=n.getBlockData(t),l=mt.default(s);l[`${r.containerId}_colSpan`]=null,l[`${r.containerId}_rowSpan`]=null,l.children=Tt.virtualCellContainersGridToChildren(i);const d=n.getChildContainerData(r.containerId)[0];g(zp,d,"no child block");const h=ke(n,d.id,0);zs(l),n.updateBlockData(t,l,h)})}function OM(n,t,e){e.forEach(o=>{const r=Tt.fromBlock(t).getCell(o);(r.virtual||r.colSpan>1||r.rowSpan>1)&&Vp(n,t,o)})}function Dv(n,t,e){if(e.isSimple())return!1;const{start:o,end:r}=e;if(o.blockId!==r.blockId||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=tf(e);return!(s.cell!==l.cell||s.colSpan===1&&s.rowSpan===1)}function Wp(n){const{editor:t,block:e,startRow:o,startCol:r,endRow:i,endCol:s}=tf(n),l=[];for(let a=o;a<=i;a++)for(let d=r;d<=s;d++)l.push({row:a,col:d});return OM(t,e,l),!0}const rc=S("merge-cells");function Sv(n,t,e){if(e.isSimple())return!1;const{start:o,end:r}=e;if(o.blockId!==r.blockId||n.getBlockById(o.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=tf(e);return s.cell!==l.cell}function Lv(n){const t=tf(n),e=t.editor;e.undoManager.runInGroup(()=>{const o=t.endCell,r=o.row+o.rowSpan-1,i=o.col+o.colSpan-1,s=it(t.block);Wp(n);const l=e.getBlockById(s),a=_e(l),{startRow:d,startCol:h}=t,p=mt.default(e.getBlockData(l));g(rc,p.children,"no table children");const A=Tt.fromTable(a),v=[];for(let jt=d;jt<=r;jt++)for(let Ut=h;Ut<=i;Ut++){const ne=A.getCell({row:jt,col:Ut});g(rc,!ne.virtual,"cell is virtual"),v.push(ne)}g(rc,v.length>0,"no selected cells");const B=v[0],D=v.slice(1),x=A.getCellByContainerId(B.containerId).container,_=[];D.forEach(jt=>{const Ut=A.getCellByContainerId(jt.containerId).container,ne=ct(Ut);if(!Ba(e,Ut)){const qe=FA(e,ne);if(Ba(e,x)){const Yn=fe(x)[0];e.insertDocAt(x,0,qe),e.deleteBlock(Yn)}else e.insertDocAt(x,Io(x),qe)}_.push(ne)});const R=ct(x),H=i-h+1,z=r-d+1;p[`${R}_colSpan`]=H,p[`${R}_rowSpan`]=z,_.forEach(jt=>{g(rc,p.children,"no table children");const Ut=p.children.indexOf(jt);g(rc,Ut>0,"no deleted container"),p.children.splice(Ut,1)});const q=p,ft=e.getChildContainerData(R)[0];g(rc,ft,"no child block");const Bt=ke(e,ft.id,0);zs(q),e.updateBlockData(l,q,Bt),e.deleteChildContainers(_)})}const qp=10,_M=["table/merge-cells","table/split-cell","table/insert-column","table/insert-row","table/delete-rows","table/delete-columns","table/delete"];class ef{constructor(){m(this,"id","TableBlockCommandProvider")}getAvailableCommands(t,e,o){if(Dt(e)!=="table")return[];const r={blockId:it(e),blockKind:Do(t,e),blockType:Dt(e)},i=[];Sv(t,e,o)&&i.push({id:"table/merge-cells",name:L.t("table.mergeCell"),icon:dL,groupIndex:qp,...r}),Dv(t,e,o)&&i.push({id:"table/split-cell",name:L.t("table.splitCell"),icon:hL,groupIndex:qp,...r});const s=Iv(t,e,o),l=Tv(t,e,o);return s&&l&&i.push({id:"table/delete",name:L.t("table.deleteTable"),icon:fL,groupIndex:qp,...r}),i}executeCommand(t,e,o,r,i,s){return Dt(e)!=="table"||!new Set(_M).has(r.id)?!1:r.id==="table/merge-cells"?(Lv(o),!0):r.id==="table/split-cell"?(Wp(o),!0):r.id==="table/delete-columns"?(jp(o),!0):r.id==="table/delete-rows"?(Up(o),!0):r.id==="table/delete"?(t.deleteBlock(e),!0):!1}}var Mv=(n=>(n.COL_TITLE_TABLE="col-title-table",n.COL_TITLE_ITEM="col-title-item",n.STRIPE_STYLE_TABLE="stripe-style-table",n.NO_BORDER="table-no-border",n))(Mv||{});const ic=6,au=20,Gp="table-cell-menu-btn";function FM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasColTitle:!0};n.updateBlockData(t,o)}function PM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasColTitle:!1};n.updateBlockData(t,o)}function NM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasRowTitle:!0};n.updateBlockData(t,o)}function $M(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),hasRowTitle:!1};n.updateBlockData(t,o)}function HM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),isStripeStyle:!0};n.updateBlockData(t,o)}function jM(n,t){if(!n.isBlockWritable(t))return;const o={...mt.default(n.getBlockData(t)),isStripeStyle:!1};n.updateBlockData(t,o)}function UM(n,t,e){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),noBorder:!e};n.updateBlockData(t,r)}const Zp=S("get-selected-containers");function Qp(n,t,e,o){g(Zp,e.blockId===o.blockId,"only allow select in single table block"),g(Zp,it(t)===e.blockId,"only allow select in single table block");const r=Tt.fromBlock(t),i=r.getCellByContainerId(e.childContainerId),s=r.getCellByContainerId(o.childContainerId);if(e.custom===void 0||o.custom===void 0)return r.getCells(i,s).map(x=>r.getCellContainer(x));const{fromCol:l,toCol:a,fromRow:d,toRow:h}=Uo(t,e,o),p=new Set,A=[];return r.sub({row:d,col:l},{row:h,col:a}).forEach(B=>{B.forEach(D=>{const x=r.getCellByContainerId(D.containerId);x.col<l||x.row<d||x.col+x.colSpan-1>a||x.row+x.rowSpan-1>h||p.has(D.containerId)||(p.add(D.containerId),A.push(x.container))})}),A}function zM(n,t,e){g(Zp,t.blockId===e.blockId,"only allow select in single table block");const o=n.getBlockById(t.blockId);return Qp(n,o,t,e)}const Vs=S("table-cell-dom");function VM(n,t,e){let o=n.getBlockById(e);for(;o;){const r=o.closest("td");g(Vs,r,"no parent cell");const i=tt(r);if(g(Vs,i,"no parent block"),i===t)return r;o=i}return g(Vs,!1,"filed to get cell by child block id"),null}function Kr(n,t,e){if(n.getBlockById(e.blockId)===t&&!e.isSimple())return g(Vs,e.childContainerId,"block position must have childContainerId attribute"),e;const r=VM(n,t,e.blockId),i=ct(su(r));return me(t,i)}function Yp(n,t){const e=n.selection.range,o=Kr(n,t,e.start),r=Kr(n,t,e.end);return Uo(t,o,r)}function Rv(n,t,e,o){g(Vs,Ve(t),"invalid table block");const r=gr(n,t),i=te(t),s=()=>{const a=r.querySelector(".table-border-bar-container.top");g(Vs,a,"no top border bar container"),a.querySelectorAll(".table-border-bar-cell.top").forEach(h=>{const p=parseInt(h.getAttribute("data-top-index")||"0",10);o.includes(p)?W(h,"danger"):ot(h,"danger")})},l=()=>{const a=i.querySelector(".table-border-bar-container.left");g(Vs,a,"no left border bar container"),a.querySelectorAll(".table-border-bar-cell.left").forEach(h=>{const p=parseInt(h.getAttribute("data-left-index")||"0",10);e.includes(p)?W(h,"danger"):ot(h,"danger")})};s(),l()}function Vi(n,t,e=!0,o){const i=Tt.fromBlock(t).map(h=>h),{fromCol:s,toCol:l,fromRow:a,toRow:d}=Yp(n,t);for(let h=0;h<i.length;h++){const p=i[h];for(let A=0;A<p.length;A++){const v=p[A],B=o?A>=s&&A+v.colSpan-1<=l:h>=a&&h+v.rowSpan-1<=d;e&&B?v.virtual||W(v.cell,"danger"):v.virtual||ot(v.cell,"danger")}}}function Wi(n,t,e=!0,o){const r=new Set,i=new Set;if(!e){Rv(n,t,Array.from(r),Array.from(i));return}const{fromCol:s,toCol:l,fromRow:a,toRow:d}=Yp(n,t);if(o)for(let h=s;h<=l;h++)i.add(h);else for(let h=a;h<=d;h++)r.add(h);Rv(n,t,Array.from(r),Array.from(i))}function Ov(n,t,e){const{fromCol:o,toCol:r,fromRow:i,toRow:s}=Yp(n,t),l=Tt.fromBlock(t);let a=null,d=null;return e?(a=l.getCell({col:o,row:0}),d=l.getCell({col:r,row:l.rowCount-1}),Ue(n,{anchor:me(t,a.containerId,{colIndex:o,rowIndex:0}),focus:me(t,d.containerId,{colIndex:r,rowIndex:l.rowCount-1})})):(a=l.getCell({col:0,row:i}),d=l.getCell({col:l.colCount-1,row:s}),Ue(n,{anchor:me(t,a.containerId,{colIndex:0,rowIndex:i}),focus:me(t,d.containerId,{colIndex:l.colCount-1,rowIndex:s})}))}function WM(n,t){const e=n.selection.range,o=Kr(n,t,e.start),r=Kr(n,t,e.end);return Qp(n,t,o,r)}const _v=["style-bg-color-0","style-bg-color-1","style-bg-color-2","style-bg-color-3","style-bg-color-4","style-bg-color-5","style-bg-color-6","style-bg-color-7","style-bg-color-8","style-bg-color-9","style-bg-color-10","style-bg-color-11","style-bg-color-12","style-bg-color-13"];function Fv(n){return`style-bg-color-${n}`}function uu(n){return`${n}_background`}function qM(n,t,e){const o=_e(n),s=(e!=null?e:Tt.fromTable(o)).getCell(t).cell;for(let l=0;l<_v.length;l++){const a=_v[l];if(xt(s,a))return a}}function Pv(n,t,e){if(!n.isBlockWritable(t))return;const o=n.selection.range,i={...mt.default(n.getBlockData(t))},s=Kr(n,t,o.start),l=Kr(n,t,o.end);if(o.isSimple()){const a=s.childContainerId;e===-1?i[uu(a)]=void 0:i[uu(a)]=Fv(e)}else{const a=Tt.fromBlock(t),d=Uo(t,s,l),h=new Set;for(let p=d.fromRow;p<=d.toRow;p++)for(let A=d.fromCol;A<=d.toCol;A++){const v=a.getCell({row:p,col:A});!h.has(v.containerId)&&v.col>=d.fromCol&&v.row>=d.fromRow&&v.col+v.colSpan-1<=d.toCol&&v.row+v.rowSpan-1<=d.toRow&&(h.add(v.containerId),e===-1?i[uu(v.containerId)]=void 0:i[uu(v.containerId)]=Fv(e))}}n.updateBlockData(t,i)}function GM(n,t,e){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),chart:e};n.updateBlockData(t,r)}const Nv=S("table-chart");function ZM(n,t){const e=kM(n,t);if(e){const o=e.querySelector(".editor-table-chart");if(o){const r=o.chartObject;r&&r.destroy(),o.remove()}}}async function QM(n,t){if(!n.isBlockWritable(t))return;if(!!!n.getBlockData(t).chart){ZM(n,t);return}const r=[],i=Tt.fromBlock(t),s=["line","bar","pie","radar"];let l=i.getCell({row:0,col:0}).container.innerText.trim().toLowerCase();new Set(s).has(l)||(l=s[0]);const a=[];for(let D=1;D<i.colCount;D++)a.push(i.getCell({row:0,col:D}).container.innerText);for(let D=1;D<i.rowCount;D++){const x=i.getCell({row:D,col:0}),R=x.container.innerText,H=[];for(let qe=1;qe<i.colCount;qe++){const Yn=i.getCell({row:D,col:qe}).container.innerText,$e=Number.parseFloat(Yn)||0;H.push($e)}let z;const q=qM(t,x,i);q?z=window.getComputedStyle(n.rootElement).getPropertyValue(`--${q}`).trim():z=window.getComputedStyle(n.rootElement).getPropertyValue("--background-color").trim();let[rt,ft,Bt,jt]=z?hm.fromString(z).toRgbaArray():[];if(!rt&&!ft&&!Bt&&!jt){const qe=(D-1)%n.options.colors.length;z=n.options.colors[qe],[rt,ft,Bt,jt]=hm.fromString(z).toRgbaArray()}const Ut=z,ne=hm.fromRgba([rt,ft,Bt,jt/3]).toHexString();r.push({label:R,data:H,borderColor:Ut,backgroundColor:ne,borderWidth:2})}const d=gr(n,t);let h=null,p=d.querySelector(".editor-table-chart");p?h=p.chartObject:p=k("div",["editor-table-chart"],d);const A=p;g(Nv,A,"no chart container");const v=n.getComponentOptions("table"),B=(v==null?void 0:v.chartCdn)||"https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js";try{await bs(B,"editor-chartjs");let D=!1;(h&&h.config.data.datasets.length>r.length||h&&h.config.data.datasets[0].data.length>r[0].data.length)&&(D=!0),h&&(l!==h.config.type||D)&&(h.destroy(),h=null,Array.from(p.querySelectorAll(".editor-chartjs-canvas")).forEach(R=>{R.remove()}));const x=fm.default({},{type:l,data:{datasets:r,labels:a},options:{onClick:()=>{n.selection.selectBlock(t,0,0)}}});if(h)fm.default(h.config,x),h.update();else{const R=k("canvas",["editor-chartjs-canvas"],A).getContext("2d");h=new window.Chart(R,x),p.chartObject=h}}catch(D){Nv.error(`failed to resolve chart cdn: ${JSON.stringify(D)}`)}}async function $v(n,t){await xo.lock("updateTableChart");try{await QM(n,t)}finally{xo.release("updateTableChart")}}const Hv=Le.default($v,1e3);let jv=null;function Jp(n,t,e){if(jv!==t&&(Hv.flush(),jv=t),e.updateNow){$v(n,t);return}Hv(n,t)}function Kp(n,t){Ve(t)&&Jp(n,t,{updateNow:!1})}function YM(n,t){Ve(t)&&Jp(n,t,{updateNow:!0})}const fo={SCROLL:"container-scroll-tool",COMMON:"container-border-shadow",RIGHT:"container-right-border-shadow",LEFT:"container-left-border-shadow",LAYOUT_SIGN:"container-layout-border-shadow",ACTIVE:"active"},nf={SCROLL_BAR:"container-scrollbar",FIXED:"fixed"},qi={SCROLL_CONTAINER:"scroll-container",TOOL:"container-scroll-tool",CONTAINER:"scroll-container-root",MAC:"mac",SCROLL_AREA:"scroll-area"};function du(n,t){return n.containers.get(t)}function Uv(n){return n.closest(`.${qi.SCROLL_CONTAINER}`)}function zo(n){return n.firstElementChild}function bn(n){return n.closest(`.${qi.CONTAINER}`)}function hu(n){const t=bn(n);let e=t.querySelector(`:scope >.${qi.TOOL}`);return e||(e=k("div",[qi.TOOL],t)),e}function JM(n){return bn(n).firstElementChild}function KM(n,t){const e=du(n,bn(t));return e!=null&&e.barFloatWindowBottom?typeof e.barFloatWindowBottom=="function"?e.barFloatWindowBottom():e.barFloatWindowBottom:0}function mo(n,t){const e=vs(n);return t/e}function fu(n){const t=window.getComputedStyle(n),e=vs(n);return{paddingBottom:parseFloat(t.paddingBottom)*e,paddingTop:parseFloat(t.paddingTop)*e,paddingLeft:parseFloat(t.paddingLeft)*e,paddingRight:parseFloat(t.paddingRight)*e}}function sc(n){const t=vs(n);return{scrollLeft:n.scrollLeft*t,scrollWidth:n.scrollWidth*t,clientWidth:n.clientWidth*t,clientHeight:n.clientHeight*t}}function XM(n,t){const e=vs(n);return n[t]*e}function Xp(n,t){const e=bn(t),o=du(n,e),r=(o==null?void 0:o.safeRightSpace)||0,i=(o==null?void 0:o.safeLeftSpace)||0,l=(o==null?void 0:o.locatingContainer).getBoundingClientRect(),a=e.getBoundingClientRect(),d=a.width;let h=Math.floor(a.left-l.left-i);h<0&&(h=0);let p=l.right;p-=r;let A=p-a.right;return A<0&&(A=0),h=Math.round(h),A=Math.round(A),{originWidth:d,maxLeft:h,maxRight:A}}function tR(n,t){const e=Xp(n,t),{maxLeft:o}=e;t.style.marginLeft=`${mo(t,0-o)}px`,t.style.paddingLeft=`${mo(t,o)}px`}function eR(n,t){const e=Xp(n,t);t.style.marginRight=`${mo(t,0-e.maxRight)}px`}function nR(n){if(n!==document.documentElement&&n!==document.body)return n.getBoundingClientRect();const t=0,e=0,o=document.documentElement.clientWidth,r=document.documentElement.clientHeight;return new DOMRect(t,e,o,r)}const zv=S("scroll-bar-handle"),oR=2;function lc(n){const t=hu(n);let e=t.querySelector(`.${nf.SCROLL_BAR}`);return e||(e=k("div",[nf.SCROLL_BAR],t)),g(zv,e instanceof HTMLDivElement,"invalid child for container tools"),e.firstElementChild||k("div",[],e),e}function of(n,t){const e=Uv(t),o=lc(e),{scrollWidth:r,clientWidth:i}=sc(e),{paddingLeft:s,paddingRight:l}=fu(t),a=Xp(n,e),{originWidth:d,maxRight:h}=a;eR(n,e),tR(n,e);const p=r-i;g(zv,o.firstElementChild instanceof HTMLDivElement,"invalid child for scroll bar"),o.style.width=`${mo(e,d+h-s-l)}px`,o.firstElementChild.style.width=`${mo(e,d+h+p-s-l)}px`}function rR(n,t){const e=zo(n),{paddingLeft:o}=fu(e);if(xt(t,"fixed")){const i=bn(n).getBoundingClientRect();t.style.left=`${mo(n,i.left+o)}px`}else t.style.left=`${mo(n,o)}px`}function cc(n,t){var R;const e=n.getParentScrollContainer(),o=nR(e),r=t.getBoundingClientRect(),i=lc(t),s=i.getBoundingClientRect(),l=du(n,bn(t)),a=KM(n,t),d=zo(t),{paddingTop:h,paddingBottom:p}=fu(d),{scrollWidth:A,clientWidth:v}=sc(t),B=document.documentElement.clientHeight-a,D=o.top+sc(e).clientHeight-B,x=B+Math.min(0,D);if(A>v&&r.top+h<x-s.height&&r.bottom>x-s.height+p&&!((R=l==null?void 0:l.isSetScale)!=null&&R.call(l))){l!=null&&l.allowScrollBarFixed&&W(i,nf.FIXED);const H=D>0?a:0;i.style.bottom=`${Math.max(document.documentElement.clientHeight-o.bottom,0)+oR+H}px`}else ot(i,nf.FIXED),i.style.bottom=`${mo(t,p-s.height)}px`;rR(t,i)}class iR{constructor(t,e){m(this,"intersectionObserver");m(this,"handleIntersection",t=>{t.forEach(e=>{this.containers.get(bn(e.target))?(this.handleIntersectionEntry(e),this.callback(e)):this.intersectionObserver.unobserve(e.target)})});m(this,"handleIntersectionEntry",t=>{const e=t.target;cc(this.scrollCore,e);const o=zo(e);of(this.scrollCore,o)});this.scrollCore=t,this.callback=e;const r={root:this.scrollCore.getParentScrollContainer(),rootMargin:"20px",threshold:0};this.intersectionObserver=new IntersectionObserver(this.handleIntersection,r)}get containers(){return this.scrollCore.containers}bind(t){this.unbind(t),this.intersectionObserver.observe(t)}unbind(t){this.intersectionObserver.unobserve(t)}destroy(){this.intersectionObserver.disconnect()}}const Ws=S("container-scroll-shadow");function Vv(n,t,e){const o=n,r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),{paddingTop:s,paddingBottom:l}=fu(e);o.style.top=`${mo(t,i.top-r.top+s)}px`,o.style.bottom=`${mo(t,r.bottom-i.bottom+l)}px`}function Wv(n,t){const e=n;t<24?e.style.width=`${(t/3).toFixed(2)}px`:e.style.width=""}function sR(n){const t=hu(n);g(Ws,t,"no container tools");let e=t.querySelector(`.${fo.LEFT}`);if(!e){const l=zo(n),a=[fo.COMMON,fo.LEFT];e=k("div",a,t),g(Ws,e instanceof HTMLDivElement,"invalid child for container tools"),Vv(e,n,l)}g(Ws,e instanceof HTMLElement,"invalid child for container tools");const r=bn(n).getBoundingClientRect(),i=n.getBoundingClientRect();e.style.left=`${mo(n,i.left-r.left)}px`;const s=sc(n).scrollLeft;g(Ws,e instanceof HTMLDivElement,"invalid child for container tools"),Wv(e,s),W(e,fo.ACTIVE)}function lR(n){const t=hu(n);let e=t.querySelector(`.${fo.RIGHT}`);if(!e){const h=zo(n),p=[fo.COMMON,fo.RIGHT];e=k("div",p,t),g(Ws,e instanceof HTMLDivElement,"no div, create shadow failed"),Vv(e,n,h)}g(Ws,e instanceof HTMLElement,"");const r=bn(n).getBoundingClientRect(),i=n.getBoundingClientRect();e.style.right=`${mo(n,r.right-i.right)}px`;const{scrollWidth:s,scrollLeft:l,clientWidth:a}=sc(n),d=s-l-a;g(Ws,e instanceof HTMLDivElement,"no shadow element"),Wv(e,d),W(e,fo.ACTIVE)}function cR(n){const e=hu(n).querySelector(`.${fo.LEFT}`);e&&ot(e,fo.ACTIVE)}function aR(n){const e=hu(n).querySelector(`.${fo.RIGHT}`);e&&ot(e,fo.ACTIVE)}function mu(n){const{scrollLeft:t,scrollWidth:e,clientWidth:o}=sc(n),r=zo(n),{paddingLeft:i,paddingRight:s}=fu(r),l=XM(r,"offsetLeft");e-i<=o-s||e-i<=t+o-s?aR(n):lR(n),r&&t>=l+i?sR(n):cR(n)}class uR{constructor(t,e){m(this,"resizeObserver");m(this,"handleResizeEntry",t=>{const e=t.target,o=zo(e);mu(e),of(this.scrollCore,o),cc(this.scrollCore,e),this.callback(e)});m(this,"handleContentResize",t=>{t.forEach(e=>{this.containers.get(bn(e.target))?this.handleResizeEntry(e):this.unbind(e.target)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new ResizeObserver(this.handleContentResize)}get containers(){return this.scrollCore.containers}bind(t){this.unbind(t),this.resizeObserver.observe(t)}unbind(t){this.resizeObserver.unobserve(t)}destroy(){this.resizeObserver.disconnect()}}const qv=S("container-scroll-observer");class dR{constructor(t,e){m(this,"handleContentScroll",t=>{const e=t.target;g(qv,e instanceof Element,"invalid target for scroll event");const o=lc(e);o.removeEventListener("scroll",this.handleScroll);const r=!0;this.fixScrollXPos(e,e.scrollLeft,r),this.bind(o),mu(e),this.callback(e)});m(this,"handleScroll",t=>{const e=t.target;g(qv,e instanceof HTMLElement,"");const o=e.scrollLeft,r=!1,i=JM(e);this.unbindContentScroll(i),this.fixScrollXPos(i,o,r),this.bindContentScroll(i),mu(i),this.callback(i)});m(this,"handlePrevent",t=>{t.stopPropagation()});m(this,"bindContentScrollCore",t=>{this.unbindContentScroll(t),t.addEventListener("scroll",this.handleContentScroll)});m(this,"unbindContentScroll",t=>{t.removeEventListener("scroll",this.handleContentScroll)});m(this,"bindContentScroll",Le.default(this.bindContentScrollCore,300));m(this,"bind",Le.default(this.bindCore,200));this.scrollCore=t,this.callback=e}fixScrollXPos(t,e,o){const r=lc(t);o||(t.scrollLeft=e),o&&r.scrollLeft!==e&&(r.scrollLeft=e)}bindCore(t){this.unbind(t),t.addEventListener("scroll",this.handleScroll),t.addEventListener("mousedown",this.handlePrevent)}unbind(t){t.removeEventListener("scroll",this.handleScroll),t.removeEventListener("mousedown",this.handlePrevent)}}class hR{constructor(t){m(this,"scrollContainers",new Set);m(this,"handleParentContainerScroll",()=>{this.scrollContainers.forEach(t=>{cc(this.scrollCore,t)})});m(this,"bindScrollContainer",t=>{const e=this.scrollContainers.size===0;this.scrollContainers.add(t),e&&this.eventTarget.addEventListener("scroll",this.handleParentContainerScroll)});m(this,"unbindScrollContainer",t=>{let e=!1;this.scrollContainers.has(t)&&(this.scrollContainers.delete(t),e=this.scrollContainers.size===0),e&&this.eventTarget.removeEventListener("scroll",this.handleParentContainerScroll)});this.scrollCore=t}get eventTarget(){const t=this.scrollCore.getParentScrollContainer();return t===document.documentElement?document:t}destroy(){this.eventTarget.removeEventListener("scroll",this.handleParentContainerScroll),this.scrollContainers.clear()}}const fR=S("scroll-wrap-resize-observer");class mR{constructor(t){m(this,"resizeObserver");m(this,"handleScrollWrapResize",t=>{t.forEach(e=>{this.containers.get(bn(e.target))?this.handleScrollWrapResizeEntry(e):this.unbind(e.target)})});m(this,"handleScrollWrapResizeEntry",t=>{const e=t.target;g(fR,e instanceof HTMLElement,"invalid target for observer entry");const o=Uv(e);of(this.scrollCore,e),mu(o),cc(this.scrollCore,o)});this.scrollCore=t,this.resizeObserver=new ResizeObserver(this.handleScrollWrapResize)}get containers(){return this.scrollCore.containers}bind(t){this.unbind(t),this.resizeObserver.observe(t)}unbind(t){this.resizeObserver.unobserve(t)}destroy(){this.resizeObserver.disconnect()}}class gR{constructor(t,e){m(this,"resizeObserver");m(this,"scrollContainersMap",new Map);m(this,"handleResizeEntry",t=>{t==null||t.forEach(e=>{const o=zo(e);mu(e),of(this.scrollCore,o),cc(this.scrollCore,e),this.callback(e)})});m(this,"handleResize",t=>{t.forEach(e=>{const o=this.scrollContainersMap.get(e.target);o!=null&&o.length&&this.handleResizeEntry(o)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new ResizeObserver(this.handleResize)}bind(t){var r,i;const e=bn(t),o=(r=du(this.scrollCore,e))==null?void 0:r.locatingContainer;this.scrollContainersMap.has(o)?(i=this.scrollContainersMap.get(o))==null||i.push(t):(this.scrollContainersMap.set(o,[t]),this.resizeObserver.observe(o))}unbind(t){var i,s;const e=bn(t),o=(i=du(this.scrollCore,e))==null?void 0:i.locatingContainer;if(!o)return;const r=this.scrollContainersMap.get(o);this.scrollContainersMap.set(o,(r==null?void 0:r.filter(l=>l!==t))||[]),(s=this.scrollContainersMap.get(o))!=null&&s.length||(this.resizeObserver.unobserve(o),this.scrollContainersMap.delete(o))}destroy(){this.scrollContainersMap.clear(),this.resizeObserver.disconnect()}}const Tnt="";class pR extends ve.TypedEmitter{constructor(e){super();m(this,"containerIntersectionObserver",null);m(this,"containerResizeObserver",null);m(this,"containerScrollObserver",null);m(this,"parentContainerScrollObserver",null);m(this,"scrollWrapResizeObserve",null);m(this,"locatingContainerResizeObserver",null);m(this,"isWindowEventBind",!1);m(this,"containers",new Map);m(this,"handleScrollContainerScroll",e=>{this.emit("scroll",this,e)});m(this,"handleResize",e=>{this.emit("resize",this,e)});m(this,"handleIntersection",e=>{const o=e.target,r=zo(o);e.isIntersecting?(this.load(),this.bindCore(o,r)):this.unbindCore(o,r)});m(this,"handleWindowEffect",()=>{var e;(e=this.getScrollContainerInViewable())==null||e.forEach(o=>{cc(this,o)})});this.parentContainer=e}load(){this.containerResizeObserver||(this.containerResizeObserver=new uR(this,this.handleResize)),this.containerScrollObserver||(this.containerScrollObserver=new dR(this,this.handleScrollContainerScroll)),this.parentContainerScrollObserver||(this.parentContainerScrollObserver=new hR(this)),this.scrollWrapResizeObserve||(this.scrollWrapResizeObserve=new mR(this)),this.locatingContainerResizeObserver||(this.locatingContainerResizeObserver=new gR(this,this.handleResize)),this.isWindowEventBind||(window.addEventListener("resize",this.handleWindowEffect),this.getParentScrollContainer()!==document.documentElement&&window.addEventListener("scroll",this.handleWindowEffect))}getParentScrollContainer(){return this.parentContainer}getScrollContainerInViewable(){var e;return(e=this.parentContainerScrollObserver)==null?void 0:e.scrollContainers}unbindCore(e,o){var i,s,l,a,d,h;const r=lc(e);(i=this.containerScrollObserver)==null||i.unbindContentScroll(e),(s=this.containerScrollObserver)==null||s.unbind(r),(l=this.scrollWrapResizeObserve)==null||l.unbind(o),(a=this.containerResizeObserver)==null||a.unbind(e),(d=this.parentContainerScrollObserver)==null||d.unbindScrollContainer(e),(h=this.locatingContainerResizeObserver)==null||h.unbind(e)}bindCore(e,o){var s,l,a,d,h,p;if(this.unbindCore(e,o),!e.closest("body"))return;const r=lc(e);(s=this.containerScrollObserver)==null||s.bindContentScrollCore(e),(l=this.containerScrollObserver)==null||l.bindCore(r),(a=this.scrollWrapResizeObserve)==null||a.bind(o),(d=this.containerResizeObserver)==null||d.bind(e);const i=this.containers.get(bn(e));i!=null&&i.allowScrollBarFixed&&((h=this.parentContainerScrollObserver)==null||h.bindScrollContainer(e)),(p=this.locatingContainerResizeObserver)==null||p.bind(e)}bind(e,o){this.containers.set(e,o);const r=e.firstElementChild;this.containerIntersectionObserver||(this.containerIntersectionObserver=new iR(this,this.handleIntersection)),this.containerIntersectionObserver.bind(r)}unbind(e){var i;const o=e.firstElementChild,r=zo(o);this.unbindCore(o,r),this.containers.delete(e),(i=this.containerIntersectionObserver)==null||i.unbind(o),this.containers.size||this.destroy()}destroy(){var e,o,r,i,s;this.containers.forEach((l,a)=>{this.unbind(a)}),this.containers.clear(),(e=this.parentContainerScrollObserver)==null||e.destroy(),(o=this.containerIntersectionObserver)==null||o.destroy(),(r=this.containerResizeObserver)==null||r.destroy(),(i=this.scrollWrapResizeObserve)==null||i.destroy(),(s=this.locatingContainerResizeObserver)==null||s.destroy(),window.removeEventListener("resize",this.handleWindowEffect),window.removeEventListener("scroll",this.handleWindowEffect)}}const Gv=S("scroll-container"),rf=new Map;class CR extends ve.TypedEmitter{constructor(){super(...arguments);m(this,"scrollListener");m(this,"options");m(this,"scrollContainerElement");m(this,"init",e=>{this.options=e;const o=k("div",[qi.CONTAINER],e.parentElement);Ze.isMac&&W(o,qi.MAC);const r=k("div",[qi.SCROLL_CONTAINER],o),i=k("div",[qi.SCROLL_AREA],r);i.style.paddingLeft=e.paddingLeft?`${e.paddingLeft}px`:"",i.style.paddingTop=e.paddingTop?`${e.paddingTop}px`:"",i.style.paddingBottom=e.paddingBottom?`${e.paddingBottom}px`:"",i.style.paddingRight=e.paddingRight?`${e.paddingRight}px`:"",i.appendChild(e.childElement);const s=e.parentContainer;this.scrollListener=rf.get(s),this.scrollListener||(this.scrollListener=new pR(s),rf.set(s,this.scrollListener)),this.scrollListener.unbind(o),this.scrollListener.bind(o,e),this.scrollListener.on("scroll",this.handleContainerScroll),this.scrollListener.on("resize",this.handleResize),this.scrollContainerElement=r});m(this,"handleContainerScroll",(e,o)=>{o===this.scrollContainerElement&&this.emit("scroll",this)});m(this,"handleResize",(e,o)=>{o===this.scrollContainerElement&&this.emit("scroll",this)})}get rootElement(){return this.scrollContainerElement}get contentElement(){return g(Gv,this.scrollContainerElement,"scrollContainerElement cannot be undefined"),zo(this.scrollContainerElement)}get scrollOptions(){return g(Gv,this.options,"options cannot be undefined"),{...this.options}}handleBaseListenerDestroy(e){e.destroy()}destroy(){var o;(o=this.scrollListener)==null||o.off("scroll",this.handleContainerScroll);const e=bn(this.contentElement);e&&rf.forEach((r,i)=>{r.unbind(e),r.containers.size===0&&(this.handleBaseListenerDestroy(r),rf.delete(i))})}}function AR(){return new CR}const t0=S("column-width");function bR(n,t,e){BM(n,t).style.width=`${e}px`}function vR(n){const e=Array.from(n.querySelector("colgroup").children).map(a=>a.getBoundingClientRect().width);if(e[0]!==0)return e;const o=Tt.fromTable(n),r=Array(o.colCount).fill(-1),i=n.getBoundingClientRect().left;o.toRealCells(o.cells).forEach(a=>{const d=a.col+a.colSpan-1;r[d]===-1&&(r[d]=a.cell.getBoundingClientRect().right-i)}),t0.debug(`cellRightOffsets1: ${r.join()}`);for(let a=0;a<r.length;a++){const d=r[a];if(d===-1||a===0)continue;let h=a-1;for(;r[h]===-1&&(h--,h!==-1););const p=h===-1?0:r[h],v=(d-p)/(a-h);for(let B=h+1;B<a;B++)r[B]=p+v*(B-h)}t0.debug(`cellRightOffsets2: ${r.join()}`);const s=[];let l=0;for(let a=0;a<r.length;a++){const d=r[a];s.push(d-l),l=d}return t0.debug(`widths: ${s.join()}`),s}function gu(n){return Array.from(n.querySelector("colgroup").children).map(o=>o.getBoundingClientRect().width||Number.parseInt(o.style.width,10))}const e0=200,yR=40,kR=S("table-resize-gripper"),Zv=7,n0=(Zv-1)/2,wR=3;function BR(n,t,e){const{rows:o}=n;for(let r=0;r<o.length;r++){const i=o[r],s=Array.from(i.cells);for(let l=0;l<s.length;l++){const a=s[l],d=a.getBoundingClientRect(),h=Math.round(d.right);if(Math.abs(t-h)<=n0&&d.top<=e&&e<=d.bottom)return a}}return null}function ER(n){return!!n.rootContainer.querySelector(".table-resize-gripper")}function o0(n,t){return gr(n,t).querySelector(".table-resize-gripper")}function Qv(n,t){const e=o0(n,t);g(kR,!e,"resize gripper has already exists");const o=gr(n,t),r=k("div",["table-resize-gripper","table-indicator"],o);return k("div",["table-resize-gripper-indicator"],r),r}function Yv(n,t,e){let o=o0(n,t);o||(o=Qv(n,t));const i=_e(t).getBoundingClientRect(),s=e.getBoundingClientRect(),l=0,a=i.height,d=n.getCustom(mr(t)).contentElement.getBoundingClientRect(),h=s.right-d.left;o.style.left=`${h-n0-ic-au}px`,o.style.top=`${l}px`,o.style.height=`${a}px`,o.style.width=`${Zv}px`}function r0(n){n.rootContainer.querySelectorAll(".table-resize-gripper").forEach(t=>{t.remove()})}function xR(n,t,e){const r={...n.getBlockData(t),colsWidth:e};n.updateBlockData(t,r)}function IR(n,t,e,o){const r=t,i=Tt.fromTable(e),s=i.getCellByCellElement(r),l=s.col+s.colSpan-1,a=gu(e);let d=o;const h=(A,v)=>{const B=v+1,D=A.col+A.colSpan;return a.slice(B,D).reduce((_,R)=>_+R,0)},p=new Set;for(let A=0;A<i.rowCount;A++){const v=i.getCell({row:A,col:l});if(p.has(v.cell))continue;p.add(v.cell);const B=v.cell,D=B.getBoundingClientRect();let x=o-D.left+n0-wR;const _=su(B),R=Zm(n,_)||yR*v.colSpan,H=h(v,l),z=R-H;x<z&&(x=z);const q=D.left+x;d=Math.max(d,q)}return d}const TR=S("table-resize-drag-drop");class DR{constructor(t,e,o,r){m(this,"cursor","col-resize");this.editor=t,this.elem=e,this.data=o,this.onEnd=r}onDragStart(t,e,o){}onDragging(t,e,o,r,i){const{table:s,block:l,draggingRefCell:a}=t.data,h=IR(this.editor,a,s,e.x-t.dragOffsetX)-s.getBoundingClientRect().left;g(TR,a,"no dragging cell");const A=Tt.fromTable(s).getCellByCellElement(a),v=A.col+A.colSpan-1,D=gu(s).slice(0,v).reduce((_,R)=>_+R,0),x=h-D;bR(s,v,x),Yv(this.editor,l,a),this.editor.selection.caret.update()}onDragEnd(t,e,o,r,i){const s=gu(t.data.table);xR(this.editor,t.data.block,s),r0(this.editor),this.onEnd&&(this.onEnd(e),this.onEnd=null)}}function SR(n,t){const e=document.elementFromPoint(t.x,t.y);if(!e)return null;const o=tt(e);return!o||!n.contains(o)||!Ve(o)?null:o}S("table-resize");class LR{constructor(t){m(this,"draggingRefCell",null);m(this,"handleMouseMove",(t,e)=>{if(t.readonly||t.selectionHandler.isSelecting()&&!this.draggingRefCell||this.draggingRefCell)return;const o=e.target;if(!(o instanceof Element)||o.closest(".table-indicator"))return;const i=e,s=SR(t,i);if(!s||!Ev(s)||!t.isBlockWritable(s)){r0(t);return}this.updateGripper(s,i.x,i.y)});this.editor=t,t.domEvents.addEventListener(document,"mousemove",this.handleMouseMove)}destroy(){this.editor.domEvents.removeEventListener(document,"mousemove",this.handleMouseMove)}updateGripper(t,e,o){const r=_e(t),i=BR(r,e,o);if(i){if(!o0(this.editor,t)){if(ER(this.editor))return;const l=Qv(this.editor,t),a={block:t,table:r,draggingRefCell:i};wm(new DR(this.editor,l,a,d=>{this.updateGripper(t,d.x,d.y)}))}Yv(this.editor,t,i)}else r0(this.editor)}}function Jv(n){n.addCustom("table-mouse-event-handler",t=>new LR(t))}const Kv=S("table-insert-column");function Xv(n,t,e){n.undoManager.runInGroup(()=>{const o=_e(t),r=Tt.fromTable(o),i=r.colCount;g(Kv,e>=0&&e<=i,`insert index ${e} is out of range [0, ${i}]`);const s=r.map(A=>A.containerId),l=new Set;n.doc.beginBatchUpdate();for(let A=0;A<s.length;A++){const v=s[A],B=v[e-1],D=v[e];if(e===0||e===v.length||B!==D){const x=Gr(n.doc);v.splice(e,0,x)}else v.splice(e,0,B),l.add(B)}n.doc.endBatchUpdate();const a=mt.default(n.getBlockData(t));l.forEach(A=>{const v=`${A}_colSpan`,B=a[v];g(Kv,typeof B=="number"&&B>1,`no colSpan for containerId ${A}, ${B}`),a[v]=B+1});const d=a.colsWidth.concat();d.splice(e,0,e0);const h=Tt.virtualCellContainersGridToChildren(s),p={...a,cols:a.cols+1,children:h,colsWidth:d};zs(p),n.updateBlockData(t,p)})}const sf=S("table-insert-row");function t9(n,t,e){n.undoManager.runInGroup(()=>{const o=_e(t),r=Tt.fromTable(o),i=r.rowCount;g(sf,e>=0&&e<=i,`insert index ${e} is out of range [0, ${i}]`);const s=r.map(A=>A.containerId),l=new Set;n.doc.beginBatchUpdate();const a=[];for(let A=0;A<r.colCount;A++){const v=e>0&&s[e-1][A],B=e<r.rowCount&&s[e][A];if(g(sf,v||B,"no top and bottom cell"),e===0||e===r.rowCount||v!==B){const D=Gr(n.doc);a.push(D)}else g(sf,v,"no top cell"),a.push(v),l.add(v)}n.doc.endBatchUpdate(),s.splice(e,0,a);const d=mt.default(n.getBlockData(t));l.forEach(A=>{const v=`${A}_rowSpan`,B=d[v];g(sf,typeof B=="number"&&B>1,`no rowSpan for containerId ${A}, ${B}`),d[v]=B+1});const h=Tt.virtualCellContainersGridToChildren(s),p={...d,rows:d.rows+1,children:h};zs(p),n.updateBlockData(t,p)})}const i0=S("paste-table-in-table-block");function MR(n,t,e,o){let r=Tt.fromBlock(e);const i=t.blocks.root[0];g(i0,i,"no table data"),g(i0,i.type==="table",`table data type is not table, but ${i.type}`);const s=i,l=r.getCellByCellElement(o),a=s.cols,d=s.rows,h=l.col,p=l.row,A=h+a,v=p+d,B=[];for(let D=h;D<A&&D<r.colCount;D++)for(let x=p;x<v&&x<r.rowCount;x++){const _=r.getCell({col:D,row:x});_.virtual?_.virtual&&B.push({col:D,row:x}):(_.colSpan>1||_.rowSpan>1)&&B.push({col:D,row:x})}n.undoManager.runInGroup(()=>{if(B.forEach(R=>{const H=Tt.fromBlock(e).getCell(R);(H.colSpan>1||H.rowSpan>1)&&Vp(n,e,R)}),A>r.colCount)for(let R=r.colCount;R<A;R++)Xv(n,e,R);if(v>r.rowCount)for(let R=r.rowCount;R<v;R++)t9(n,e,R);r=Tt.fromBlock(e);const D=new Jh(s);let x;for(let R=0;R<D.colCount;R++)for(let H=0;H<D.rowCount;H++){const z=D.getCell({col:R,row:H});if(!z.virtual){const q=Fg(n.editorBlocks,t,z.containerId),rt=h+R,ft=p+H,Bt={col:rt,row:ft},jt=r.getCellContainer(Bt);q6(n,jt,q),x=jt}}g(i0,x,"no last container");const _=Qe(x);n.selection.selectBlock(_,ut(n,_))})}const e9=S("paste-in-table-block");class RR{constructor(t){this.editor=t,setTimeout(()=>{t.input.addHandler(this)})}destroy(){}async handleBeforePasteDoc(t,e){if(!t.selection.range.isSimple()||t.selection.range.start.offset!==0)return!1;const r=t.selection.startBlock,i=nt(r);if(Gt(i)||!Ba(t,i))return!1;const s=tt(i);if(g(e9,s,"no parent block"),!Ve(s)||e.blocks.root.length!==1||e.blocks.root[0].type!=="table")return!1;e9.debug("paste child table in table");const d=Tt.fromBlock(s).getCellByContainerId(ct(i)).cell;return MR(t,e,s,d),!0}}function n9(n){n.addCustom("table-block-paste-event",t=>new RR(t))}const s0=S("table-select-columns");function OR(n,t,e,o,r){g(s0,Ve(t),"is not a table block");const i=Tt.fromBlock(t);g(s0,e>=0&&e<i.colCount,"invalid from"),g(s0,o>0&&e+o<=i.colCount,"invalid count");const s=i.getCell({row:0,col:e}),l=i.getCell({row:i.rowCount-1,col:e+o-1}),a=me(t,s.containerId,{colIndex:e,rowIndex:0}),d=me(t,l.containerId,{colIndex:e+o-1,rowIndex:i.rowCount-1});r!=null&&r.reverse?n.selection.setSelection(d,a):n.selection.setSelection(a,d)}const l0=S("table-select-columns");function _R(n,t,e,o,r){g(l0,Ve(t),"is not a table block");const i=Tt.fromBlock(t);g(l0,e>=0&&e<i.rowCount,"invalid from"),g(l0,o>0&&e+o<=i.rowCount,"invalid count");const s=i.getCell({row:e,col:0}),l=i.getCell({row:e+o-1,col:i.colCount-1}),a=me(t,s.containerId,{rowIndex:e,colIndex:0}),d=me(t,l.containerId,{rowIndex:e+o-1,colIndex:i.colCount-1});r!=null&&r.reverse?n.selection.setSelection(d,a):n.selection.setSelection(a,d)}const Dnt="",o9=S("get-toolbar-reference-client");function FR(n,t){const e=n.selection.range;if(!e.isSimple()){g(o9,e.start.blockId===e.end.blockId,"invalid selection range");const s=n.getBlockById(e.start.blockId);g(o9,Mt(n,s),"not a complex block");const l=Yt(n,s);if(l.getTextToolbarReferenceClient){const a=l.getTextToolbarReferenceClient(n,s);if(a)return a}}const o=e.isReverse()?t.start:t.end,r=Ue(n,{anchor:o,focus:o}),i=$r(n,t.block,r);if(i.length!==0)return i[0]}function PR(n){var t,e;if(n.children){let o=!1;const r=[];for(const i of n.children){if((t=i.states)!=null&&t.includes("checked")){o=!0;break}(e=n.defaultCheckedChildren)!=null&&e.includes(i.id)&&r.push(i)}if(!o&&(r==null?void 0:r.length))for(const i of r)Array.isArray(i.states)?i.states.push("checked"):i.states=["checked"]}}function lf(n){const t=(r,i)=>{const s=r.findIndex(a=>a.id===i.id);if(s===-1){r.push(i);return}const l=r[s];if(l.value!==i.value&&delete l.value,!!l.states){if(!i.states){l.states=[];return}l.states=mm.default(l.states,i.states)}},e=[],o=new Map;return n.forEach(r=>{var i,s;(i=r.children)!=null&&i.length&&(o.has(r.id)?(s=o.get(r.id))==null||s.push(...r.children):o.set(r.id,[...r.children])),t(e,r)}),o.forEach((r,i)=>{const s=e.find(l=>l.id===i);s&&(s.children=lf(r),PR(s))}),e}function cf(n){return n.findCustom("toolbar-handler")}const Snt="";class NR{constructor(){m(this,"linkPopup",null);m(this,"form",{});m(this,"onFinished",null);m(this,"onClose",null);m(this,"handleOk",async()=>{var t;try{await this.checkValue();const{linkText:e,linkUrl:o}=this.form,r=this.formatUrl(o.getInputValue());(t=this.onFinished)==null||t.call(this,e.getInputValue()||r,r),this._destroy()}catch{}});m(this,"handleClose",()=>{var t;(t=this.onClose)==null||t.call(this),this._destroy()});m(this,"onShow",()=>{setTimeout(()=>{var t;(t=this.form.linkText)==null||t.getField().focus()},400)});m(this,"onChange",()=>{var e;const t=(e=this.linkPopup)==null?void 0:e.content.querySelector('[data-button-id="submit-button"]');t.disabled=!1});m(this,"handleTextKeyboard",t=>{var e;if(!t.isComposing){if(t.key==="Enter"){(e=this.form.linkUrl)==null||e.getField().focus(),t.stopPropagation();return}t.key==="Escape"&&this.handleClose()}});m(this,"handleUrlKeyboard",t=>{if(!t.isComposing){if(t.key==="Enter"){this.handleOk(),t.preventDefault();return}t.key==="Escape"&&this.handleClose()}})}async checkValue(){const{linkUrl:t}=this.form;if(!t.getInputValue())throw t.setFieldError(L.t("link.urlPlaceholder")),new Error(L.t("link.urlPlaceholder"))}formatUrl(t){if(!t)return"";try{new URL(t)}catch{return`${window.location.protocol}//${t}`}return t}editLink(t){var h,p;const{target:e,linkText:o,linkUrl:r,onFinished:i,onClose:s,placement:l="bottom-start"}=t;this.linkPopup=new ou(this.createPopupContent(o,r)),this.linkPopup.addListener("show",this.onShow),this.linkPopup.manualShow(e,{theme:"light",placement:l}),this.onFinished=i,s&&(this.onClose=s);const a=(h=this.linkPopup)==null?void 0:h.content.querySelector('[data-button-id="submit-button"]'),d=(p=this.linkPopup)==null?void 0:p.content.querySelector('[data-button-id="cancel-button"]');a==null||a.addEventListener("click",this.handleOk),d==null||d.addEventListener("click",this.handleClose)}createPopupContent(t,e){const o=k("div",["link-popup-content"],null);this.form.linkText=_p(o,{label:L.t("link.textLabel"),required:!1,placeholder:L.t("link.textPlaceholder"),defaultValue:t,onChange:this.onChange,onKeyDown:this.handleTextKeyboard}),this.form.linkUrl=_p(o,{className:"link-popup-gap",label:L.t("link.urlLabel"),required:!0,placeholder:L.t("link.urlPlaceholder"),defaultValue:e,onChange:this.onChange,onKeyDown:this.handleUrlKeyboard});const r=k("div",["link-popup-footer"],o),i=ho("cancel-button",L.t("link.cancelText"));r.appendChild(i);const s=ho("submit-button",L.t("link.submitText"),void 0,["disabled","primary"]);return r.appendChild(s),o}_destroy(){var o,r,i,s;const t=(o=this.linkPopup)==null?void 0:o.content.querySelector('[data-button-id="submit-button"]'),e=(r=this.linkPopup)==null?void 0:r.content.querySelector('[data-button-id="cancel-button"]');t==null||t.removeEventListener("click",this.handleOk),e==null||e.removeEventListener("click",this.handleClose),this.onFinished=null,this.onClose=null,this.form={},(i=this.linkPopup)==null||i.removeAllListeners(),(s=this.linkPopup)==null||s.destroy()}destroy(){this._destroy()}}function pu(n,t){n.addCustom("link-editor",()=>new NR).editLink(t)}const $R=S("link-popup");function HR(n){return xt(n,"link")}function Cu(n){var t,e;return(e=(t=n.getAttribute("link"))!=null?t:n.textContent)!=null?e:""}function jR(n,t,e){var r,i,s,l;if(n.isBlockWritable(t)&&e&&lo(e)){const a=e,d=(i=(r=n.editorBoxes.getBoxClass(va(a))).getBoxProperties)==null?void 0:i.call(r,n,a);if(d!=null&&d.boxCommands){const h=(l=(s=d.boxCommands["hovering-toolbar"])==null?void 0:s.commands)!=null?l:[];return{element:e,commands:h}}return{element:null,commands:[]}}if(n.isWritable()&&e&&et(n,t)&&HR(e)){const a=k("a",["link-href-button"],null,Cu(e));a.href=Cu(e),a.target="_blank",a.rel="noopener noreferrer";const d=[{id:"link-text",name:Cu(e),disableTooltip:!0,element:a},{id:"edit-link",name:L.t("link.edit"),icon:Lp},{id:"remove-link",name:L.t("link.remove"),icon:kL}];return{element:e,commands:d}}return c4(n,t,"hovering-toolbar")}function r9(n,t,e){var l;const o=Os(t,e),r=n.getBlockText(t),i={start:0,end:0};let s=(l=e.textContent)!=null?l:"";for(let a=0;a<r.length;a++){const d=r[a];if(i.end+d.insert.length>=o.end){i.end+=d.insert.length,s=d.insert;break}i.start<o.start&&(i.start+=d.insert.length,i.end=i.start)}return[i,s]}function UR(n,t,e){const[o,r]=r9(n,t,e);n.selection.selectBlock(t,o.start,o.end);const i=Cu(e),s=(h,p)=>{try{const A=n.getBlockText(t),v=ag(A,o.start,o.end-o.start),B=Wr(v,o.start,h,{link:p});n.setBlockText(t,B),n.selection.selectBlock(t,o.start+h.length),n.focus()}catch(A){$R.error(A)}},l=()=>{n.selection.selectBlock(t,o.end),n.focus()},a=$r(n,t,n.selection.range)[0];if(!a)return;const d=Vr(n,t,"link-button-anchor",a);pu(n,{target:d,linkText:r,linkUrl:i,onFinished:s,onClose:l})}function zR(n,t,e){const[o]=r9(n,t,e),r=n.getBlockText(t),i=Cu(e),s=Wl(o.start,o.end-o.start,r,"link",i);n.setBlockText(t,s),n.selection.selectBlock(t,o.end)}function VR(n,t,e,o){var s,l,a;if(e){if(n.isBlockWritable(t)&&lo(e)){const h=e,p=(l=(s=n.editorBoxes.getBoxClass(va(h))).getBoxProperties)==null?void 0:l.call(s,n,h);if(p!=null&&p.boxCommands){p.boxCommands["hovering-toolbar"].executeCommand(n,t,h,o);return}return}const d=cf(n);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},400),o.id==="edit-link"?UR(n,t,e):o.id==="remove-link"&&zR(n,t,e);return}const r=l4(n,t);if(!r)return;const i=(a=r.blockCommands)==null?void 0:a["hovering-toolbar"];!i||i.executeCommand(n,t,o)}function af(){let n=8;for(;n>0&&!document.querySelector(`div[data-style-heading='${n}']`);)n--;return n}const WR=[yp,kp,wp,Bp,Ep,xp,Ip,Tp];class qR{constructor(t){m(this,"id","BlockTurnIntoCommandProvider");this.editor=t}getHeadingIndex(){let t=af();return t<=4?t=5:t<8&&(t+=1),t}getAvailableCommands(t,e,o){if(et(t,e)){const r=it(e),i=Dt(e),s=Do(t,e),a=t.getBlockData(e).heading,d=[];for(let p=0;p<this.getHeadingIndex();p++)d.push({id:`heading-${p+1}`,name:L.t("commands.heading",{name:`${p+1}`}),icon:WR[p],states:a===p+1?["checked"]:[],value:`${p+1}`});const h=p=>{var v;const A=k("span",["toolbar-item-name-container"],null);for(const B of p.children)if((v=B.states)!=null&&v.includes("checked"))return A.innerHTML=B.icon||nu,A;return A.innerHTML=nu,A};return[{id:"turn-into",name:L.t("commands.headingGroup"),blockId:r,blockType:i,blockKind:s,element:h,groupIndex:200,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["text"],children:[{id:"text",name:L.t("commands.text"),icon:nu,states:a?[]:["checked"]},...d],childrenType:"menu"}]}return[]}applyHeadingStyle(t,e,o){t.updateBlockData(e,{heading:o})}executeCommand(t,e,o,r){if(et(t,e)&&(r.id.startsWith("heading-")||r.id==="text")){const i=r.value?Number(r.value):null;return this.applyHeadingStyle(t,e,i),t.focus(),!0}return!1}}const GR=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
388
388
  <path d="M8 8H15" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"></path>
389
389
  <path d="M8 14H15" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"></path>
390
390
  <path d="M8 2H15" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"></path>
391
391
  <path d="M4 8H0C0 8 0.552283 8 1.33333 8M4 14C2 13.1429 3.33333 8 1.33333 8M4 2C2 2.85714 3.33333 8 1.33333 8" stroke="currentColor" stroke-linecap="square"></path>
392
392
  </svg>
393
- `,ZR=8,we=S("list-block"),uf=S("list-block");function Ht(n){return Dt(n)==="list"}function Fe(n){g(uf,Ht(n),"not a list block")}function Zn(n){Fe(n);const t=n.getAttribute("data-list-type");return g(uf,t,"no list type"),t}function df(n){return Ht(n)&&Zn(n)==="text-only"}function go(n){var t,e;return Fe(n),(e=Number.parseInt((t=n.getAttribute("data-list-start"))!=null?t:"1",10))!=null?e:1}function vn(n){var t,e;return Fe(n),(e=Number.parseInt((t=n.getAttribute("data-list-level"))!=null?t:"1",10))!=null?e:1}function ac(n){Fe(n);const t=n.getAttribute("data-list-group-id");return g(uf,t,"no group id"),t}function Gi(n){var i,s,l,a,d;Fe(n);const t=(i=n.getAttribute("data-list-type"))!=null?i:"ordered",e=(l=Number.parseInt((s=n.getAttribute("data-list-start"))!=null?s:"1",10))!=null?l:1,o=(d=Number.parseInt((a=n.getAttribute("data-list-level"))!=null?a:"1",10))!=null?d:1,r=n.getAttribute("data-list-group-id");return g(uf,r,"no group id"),{type:t,start:e,level:o,groupId:r}}function c0(n){switch(n){case"ordered":return{ordered:!0,checkbox:null,textOnly:null};case"unordered":return{ordered:!1,checkbox:null,textOnly:null};case"checked":return{checkbox:"checked",ordered:!1,textOnly:null};case"unchecked":return{checkbox:"unchecked",ordered:!1,textOnly:null};case"text-only":return{checkbox:null,ordered:!1,textOnly:!0};default:return{checkbox:null,ordered:!0,textOnly:!1}}}function QR(n){const t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1};let e="",o=n;return Object.entries(t).forEach(([r,i])=>{for(;o>=i;)e+=r,o-=i}),e.toLowerCase()}const YR="abcdefghijklmnopqrstuvwxyz";function i7(n){if(n<=0)return`${n}`;const t=(n-1)%26,e=Math.floor((n-1)/26),o=YR[t];return e?i7(e)+o:o}function JR(n){return`${n}`}const s7=[JR,i7,QR];function KR(n,t){const e=s7[(n-1)%s7.length];return e(t)}function XR(n){return["\u2022","\u25E6","\u25AA"][(n-1)%3]}function Zi(n,t){Fe(n);const{level:e,groupId:o,type:r}=Gi(n);let i=ce(n);for(;i;){if(!Ht(i))return null;const{level:s,groupId:l,type:a}=Gi(i);if(s<e)return null;if(e===s&&((t==null?void 0:t.ignoreGroupId)||o===l)&&(a==="text-only"||r==="text-only"||r===a))return i;i=ce(i)}return null}function l7(n){return Zi(n,{ignoreGroupId:!0})}function qs(n){Fe(n);const{level:t,groupId:e,type:o}=Gi(n);let r=Qt(n);for(;r;){if(Ht(r)){const{level:i,groupId:s,type:l}=Gi(r);if(t===i&&e===s&&(l==="text-only"||o==="text-only"||o===l))return r;if(i<t)return null}r=Qt(r)}return null}function c7(n){Fe(n);const t=[];let e=Zi(n);for(;e;)t.unshift(e),e=Zi(e);return t}function uc(n){Fe(n);const t=[];let e=qs(n);for(;e;)t.push(e),e=qs(e);return t}function Au(n){Fe(n);let t=Zi(n);for(;t;){const e=Zi(t);if(!e)return t;t=e}return n}function tO(n){Fe(n);let t=qs(n);for(;t;){const e=qs(t);if(!e)return t;t=e}return null}function a7(n,t){const e=c7(n),o=uc(n);return t.withSelf?[...e,n,...o]:[...e,...o]}function a0(n){Fe(n);let t=n;const e=c7(n);e.length>0&&(t=e[0]);const o=ce(t);return!o||!Ht(o)?null:vn(o)<vn(t)?o:null}function eO(n){let t=Au(n);for(;;){const e=a0(t);if(!e)return t;t=Au(e)}}class nO{constructor(){m(this,"nodeMap",new Map);m(this,"rootNodes",[])}addNode(t,e){const o={block:e,children:[]};if(this.nodeMap.set(e,o),t){const r=this.nodeMap.get(t);g(we,r,"no parent node"),r.children.push(o)}else this.rootNodes.push(o)}}function u7(n,t){const e=eO(t),o=new nO;o.addNode(null,e);let r=Qt(e);for(;r&&Ht(r);){if(df(r)){o.addNode(null,r),r=Qt(r);continue}if(vn(r)===0&&Zn(r)!==Zn(e))break;const s=a0(r);o.addNode(s,r),r=Qt(r)}return o.rootNodes}const oO=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
393
+ `,ZR=8,we=S("list-block"),uf=S("list-block");function Ht(n){return Dt(n)==="list"}function Fe(n){g(uf,Ht(n),"not a list block")}function Zn(n){Fe(n);const t=n.getAttribute("data-list-type");return g(uf,t,"no list type"),t}function df(n){return Ht(n)&&Zn(n)==="text-only"}function go(n){var t,e;return Fe(n),(e=Number.parseInt((t=n.getAttribute("data-list-start"))!=null?t:"1",10))!=null?e:1}function vn(n){var t,e;return Fe(n),(e=Number.parseInt((t=n.getAttribute("data-list-level"))!=null?t:"1",10))!=null?e:1}function ac(n){Fe(n);const t=n.getAttribute("data-list-group-id");return g(uf,t,"no group id"),t}function Gi(n){var i,s,l,a,d;Fe(n);const t=(i=n.getAttribute("data-list-type"))!=null?i:"ordered",e=(l=Number.parseInt((s=n.getAttribute("data-list-start"))!=null?s:"1",10))!=null?l:1,o=(d=Number.parseInt((a=n.getAttribute("data-list-level"))!=null?a:"1",10))!=null?d:1,r=n.getAttribute("data-list-group-id");return g(uf,r,"no group id"),{type:t,start:e,level:o,groupId:r}}function c0(n){switch(n){case"ordered":return{ordered:!0,checkbox:null,textOnly:null};case"unordered":return{ordered:!1,checkbox:null,textOnly:null};case"checked":return{checkbox:"checked",ordered:!1,textOnly:null};case"unchecked":return{checkbox:"unchecked",ordered:!1,textOnly:null};case"text-only":return{checkbox:null,ordered:!1,textOnly:!0};default:return{checkbox:null,ordered:!0,textOnly:!1}}}function QR(n){const t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1};let e="",o=n;return Object.entries(t).forEach(([r,i])=>{for(;o>=i;)e+=r,o-=i}),e.toLowerCase()}const YR="abcdefghijklmnopqrstuvwxyz";function i9(n){if(n<=0)return`${n}`;const t=(n-1)%26,e=Math.floor((n-1)/26),o=YR[t];return e?i9(e)+o:o}function JR(n){return`${n}`}const s9=[JR,i9,QR];function KR(n,t){const e=s9[(n-1)%s9.length];return e(t)}function XR(n){return["\u2022","\u25E6","\u25AA"][(n-1)%3]}function Zi(n,t){Fe(n);const{level:e,groupId:o,type:r}=Gi(n);let i=ce(n);for(;i;){if(!Ht(i))return null;const{level:s,groupId:l,type:a}=Gi(i);if(s<e)return null;if(e===s&&((t==null?void 0:t.ignoreGroupId)||o===l)&&(a==="text-only"||r==="text-only"||r===a))return i;i=ce(i)}return null}function l9(n){return Zi(n,{ignoreGroupId:!0})}function qs(n){Fe(n);const{level:t,groupId:e,type:o}=Gi(n);let r=Qt(n);for(;r;){if(Ht(r)){const{level:i,groupId:s,type:l}=Gi(r);if(t===i&&e===s&&(l==="text-only"||o==="text-only"||o===l))return r;if(i<t)return null}r=Qt(r)}return null}function c9(n){Fe(n);const t=[];let e=Zi(n);for(;e;)t.unshift(e),e=Zi(e);return t}function uc(n){Fe(n);const t=[];let e=qs(n);for(;e;)t.push(e),e=qs(e);return t}function Au(n){Fe(n);let t=Zi(n);for(;t;){const e=Zi(t);if(!e)return t;t=e}return n}function tO(n){Fe(n);let t=qs(n);for(;t;){const e=qs(t);if(!e)return t;t=e}return null}function a9(n,t){const e=c9(n),o=uc(n);return t.withSelf?[...e,n,...o]:[...e,...o]}function a0(n){Fe(n);let t=n;const e=c9(n);e.length>0&&(t=e[0]);const o=ce(t);return!o||!Ht(o)?null:vn(o)<vn(t)?o:null}function eO(n){let t=Au(n);for(;;){const e=a0(t);if(!e)return t;t=Au(e)}}class nO{constructor(){m(this,"nodeMap",new Map);m(this,"rootNodes",[])}addNode(t,e){const o={block:e,children:[]};if(this.nodeMap.set(e,o),t){const r=this.nodeMap.get(t);g(we,r,"no parent node"),r.children.push(o)}else this.rootNodes.push(o)}}function u9(n,t){const e=eO(t),o=new nO;o.addNode(null,e);let r=Qt(e);for(;r&&Ht(r);){if(df(r)){o.addNode(null,r),r=Qt(r);continue}if(vn(r)===0&&Zn(r)!==Zn(e))break;const s=a0(r);o.addNode(s,r),r=Qt(r)}return o.rootNodes}const oO=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
394
394
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.59414 14L2 12.4059L6.40586 8L2 3.59414L3.59414 2L8 6.40586L12.4059 2L14 3.59414L9.59414 8L14 12.4059L12.4059 14L8 9.59414L3.59414 14Z" fill="currentColor"/>
395
395
  </svg>`,rO=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
396
396
  <path d="M2 6V2H14V14H10M2 8H8V14H2V8Z" stroke="currentColor" stroke-width="2"/>
397
- </svg>`,d7=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
397
+ </svg>`,d9=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
398
398
  <path d="M1.99978 13.996L6.5 9.49597" stroke="currentColor" stroke-width="2"/>
399
399
  <path d="M13.9973 1.99986L9.49707 6.49988" stroke="currentColor" stroke-width="2"/>
400
400
  <path d="M7 13.9961H2L2.00129 9" stroke="currentColor" stroke-width="2"/>
401
401
  <path d="M9 1.99998H13.9974L13.9961 7" stroke="currentColor" stroke-width="2"/>
402
- </svg>`;function iO(n){const t=document.fullscreenEnabled||document.mozFullScreenEnabled||document.documentElement.webkitRequestFullScreen,e=o=>{if(o.requestFullscreen)return o.requestFullscreen();if(o.mozRequestFullScreen)return o.mozRequestFullScreen();if(o.webkitRequestFullScreen){try{document.fullscreenElement=n}catch{}return o.webkitRequestFullScreen()}return Promise.resolve(0)};return t?e(n):Promise.resolve(0)}function h7(){const e=(document.exitFullscreen||document.webkitExitFullscreen).bind(document)();try{document.fullscreenElement=null}catch{}return e}function f7(n){if(g(we,Ht(n),"not a list block"),xt(n,"editor-in-mindmap-first")||!Xd(n))return!0;const t=n.classList,e="editor-mindmap-root-";return!!Array.from(t).find(r=>{if(r.startsWith(e))return r})}function sO(n,t,e){const o=nt(n);if(t){const s=nt(t);g(we,o===s,"invalid block container")}const r=bt(n);if(t){const s=bt(t);g(we,r<=s,"invalid block index")}if(W(n,...e),!t||t===n)return;let i=Qt(n);for(;i!==t;)g(we,i,"no next button"),W(i,...e),i=Qt(i);i&&W(i,...e)}const lO=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
402
+ </svg>`;function iO(n){const t=document.fullscreenEnabled||document.mozFullScreenEnabled||document.documentElement.webkitRequestFullScreen,e=o=>{if(o.requestFullscreen)return o.requestFullscreen();if(o.mozRequestFullScreen)return o.mozRequestFullScreen();if(o.webkitRequestFullScreen){try{document.fullscreenElement=n}catch{}return o.webkitRequestFullScreen()}return Promise.resolve(0)};return t?e(n):Promise.resolve(0)}function h9(){const e=(document.exitFullscreen||document.webkitExitFullscreen).bind(document)();try{document.fullscreenElement=null}catch{}return e}function f9(n){if(g(we,Ht(n),"not a list block"),xt(n,"editor-in-mindmap-first")||!Xd(n))return!0;const t=n.classList,e="editor-mindmap-root-";return!!Array.from(t).find(r=>{if(r.startsWith(e))return r})}function sO(n,t,e){const o=nt(n);if(t){const s=nt(t);g(we,o===s,"invalid block container")}const r=bt(n);if(t){const s=bt(t);g(we,r<=s,"invalid block index")}if(W(n,...e),!t||t===n)return;let i=Qt(n);for(;i!==t;)g(we,i,"no next button"),W(i,...e),i=Qt(i);i&&W(i,...e)}const lO=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
403
403
  <path d="M5.99729 10.0039L1.49707 14.5039" stroke="currentColor" stroke-width="2"/>
404
404
  <path d="M9.99978 5.99611L14.5 1.49609" stroke="currentColor" stroke-width="2"/>
405
405
  <path d="M1 10.0039H5.99738L5.99608 15" stroke="currentColor" stroke-width="2"/>
406
406
  <path d="M14.9971 5.99611H9.99969L10.001 1" stroke="currentColor" stroke-width="2"/>
407
- </svg>`;async function cO(n,t,e){const o=te(t),r=o.querySelector('[data-button-id="mindmap-fullscreen"]');g(we,r,"no full screen button");const i=()=>{setTimeout(()=>{e.toMindmap(n,t,{},{reset:!0,mindmapTools:e})},300)},s=()=>{ot(o,"fullscreen"),r.innerHTML=d7,Jb(r,"Full screen",n.clientId),f7(t)&&setTimeout(()=>{i()},300)};if(document.fullscreenElement===o){try{await h7()}catch(l){we.error(l)}s()}else{try{W(o,"fullscreen"),await iO(o),i()}catch(l){we.error(l)}r.innerHTML=lO,Jb(r,L.t("mindmap.exitFullscreen"),n.clientId)}o.onfullscreenchange=()=>{document.fullscreenElement||s()}}function u0(n,t,e,o,r){if(t.querySelector(`[data-button-id="${e}"]`))return null;const s=ho(e,o,r,[],n.clientId);return W(s,"mindmap-button"),t.appendChild(s),s}function d0(n,t){return n.querySelector(`[data-button-id="${t}"]`)}function aO(n){return d0(n,"mindmap-fullscreen")}function uO(n){return d0(n,"mindmap-fit")}function dO(n){return d0(n,"mindmap-close")}function hO(n,t,e,o){const r=u0(n,t,"mindmap-close",L.t("mindmap.close"),oO);!r||n.domEvents.addEventListener(r,"click",()=>{o.closeMindmap(n,e)})}function fO(n,t,e,o){const r=u0(n,t,"mindmap-fit",L.t("mindmap.autoFit"),rO);!r||n.domEvents.addEventListener(r,"click",()=>{o.fitMindmap(n,e)})}function mO(n,t,e,o){if(navigator.userAgent.includes("Mobile")&&!navigator.userAgent.includes("iPad"))return;const i=u0(n,t,"mindmap-fullscreen",L.t("mindmap.fullScreen"),d7);!i||n.domEvents.addEventListener(i,"click",()=>{cO(n,e,o)})}function gO(n,t){const e=th(t);if(!e)return;const o=uO(e);o&&(o.remove(),n.domEvents.removeAllListeners(o));const r=dO(e);r&&(r.remove(),n.domEvents.removeAllListeners(r));const i=aO(e);i&&(i.remove(),n.domEvents.removeAllListeners(i))}const dc=new Map;function h0(n,t,e){const o=(s,l)=>{s.forEach(a=>{l?W(a.block,"to-mindmap-highlight"):ot(a.block,"to-mindmap-highlight"),o(a.children,l)})},r=u7(n,t);if(r.length===0)return;const i=r[0].block;if(e){const s=dc.get(i);s&&(s.forEach(l=>l.cancel()),dc.delete(i)),o(r,!0)}else{const s=setTimeout(()=>{o(r,!1),dc.delete(i)},300),l=()=>{clearTimeout(s),dc.delete(i)},a=dc.get(i);a?a.push({cancel:l}):dc.set(i,[{cancel:l}])}}const{Markmap:pO}=jB;function CO(n,t){Fe(t);const e=u7(n,t),o=e[0].block,r=d=>({t:"text",v:Lt(d.block).textContent,d:1,c:d.children.length>0?d.children.map(p=>r(p)):void 0});let i=null;e.length>1?i={t:"root",v:"root",d:0,c:e.length>0?e.map(d=>r(d)):void 0}:i=r(e[0]);const l=d=>{if(d.length===0)return null;const h=d[d.length-1];return h.children&&h.children.length>0?l(h.children):h},a=l(e);return{root:i,block:o,nodes:e,last:a}}function hf(n,t,e,o){const{root:r,block:i,last:s}=CO(n,t);o.selectBlock&&n.selection.selectBlock(i,0,0),h0(n,i,!1),o.saveData&&n.updateBlockData(i,{viewAsMindmap:!0});const l=te(i);let a=l.querySelector(".editor-mindmap-svg");if(o.reset&&(a&&a.remove(),a=null),a)a.innerHTML="";else{const _="http://www.w3.org/2000/svg",R=l.getBoundingClientRect(),H=document.fullscreenElement===l,z=H?`${R.width}`:`${t.getBoundingClientRect().width}`,q=H?`${R.height}`:"600",rt=document.createElementNS(_,"svg");rt.setAttributeNS(null,"viewBox",`0 0 ${z} ${q}`),rt.setAttributeNS(null,"width","100%"),rt.setAttributeNS(null,"height",q),rt.style.display="block",rt.style.width="100%",rt.style.height=`${q}px`,rt.classList.add("editor-mindmap-svg"),l.appendChild(rt),a=rt}const d=i,p=`editor-mindmap-root-${it(i)}`;W(d,"editor-in-mindmap-first",p,"readonly"),d.contentEditable="false";const A=Qt(i);A&&bt(A)<=bt(s.block)&&sO(A,s.block,["block-hidden",p]);const v=(_,R)=>{if(R.length>0){const H=R[0].parentElement;H&&(H.style.width="100vw",H.style.maxWidth="200px")}R.forEach(H=>{W(H,"editor-mindmap-node")})},B=new pO(a,{...e,autoFit:!0});B.viewHooks.transformHtml.tap(v),B.setData(r),B.fit();const D=te(i);let x=D.querySelector(".mindmap-toolbar");x||(x=k("div",["mindmap-toolbar"],D)),fO(n,x,d,o.mindmapTools),mO(n,x,d,o.mindmapTools),hO(n,x,d,o.mindmapTools),n.domEvents.addEventListener(a,"click",()=>{n.selection.selectBlock(i,0),n.input.focus()}),d.mindMap=B}function AO(n){const t=k("div",["list-to-mindmap-wrap"],null),e=ho("list-to-mindmap",L.t("mindmap.viewAsMindMap"),GR,[],n.clientId);return t.appendChild(e),t}async function m7(n,t){const e=`editor-mindmap-root-${t.id}`,o=nt(t);fe(o).forEach(l=>{xt(l,e)&&ot(l,e,"editor-in-mindmap-first","block-hidden")});const i=te(t);document.fullscreenElement===i&&await h7();const s=i.querySelector(".editor-mindmap-svg");!s||(g(we,s,"no mindmap svg"),s.remove(),n.domEvents.removeAllListeners(s),gO(n,t))}function bO(n){const t=n.classList,e="editor-mindmap-root-";return Array.from(t).find(r=>{if(r.startsWith(e))return r})}async function g7(n,t){!bO(t)||(n.updateBlockData(t,{viewAsMindmap:null}),m7(n,t),n.selection.selectBlock(t,0))}function vO(n,t){const e=t.mindMap;e&&e.fit()}const f0={toMindmap:hf,closeMindmap:g7,fitMindmap:vO},Lnt="";class ff{constructor(t){m(this,"toMindmapButton");m(this,"currentBlock",null);m(this,"handleHoveringBlock",t=>{!this.editor.isWritable()||(t&&Ht(t)&&Zn(t)!=="unchecked"&&Zn(t)!=="checked"?te(t).appendChild(this.toMindmapButton):this.toMindmapButton.remove())});m(this,"handleMouseEnter",()=>{const t=tt(this.toMindmapButton);g(we,t&&Ht(t),"no parent list"),h0(this.editor,t,!0),this.currentBlock=t});m(this,"handleMouseLeave",()=>{this.currentBlock&&(h0(this.editor,this.currentBlock,!1),this.currentBlock=null)});m(this,"handleClick",()=>{const t=tt(this.toMindmapButton);g(we,t&&Ht(t),"no parent list"),hf(this.editor,t,{},{saveData:!0,selectBlock:!0,mindmapTools:f0})});this.editor=t,Ce.get(this.editor).addListener("change",this.handleHoveringBlock),this.toMindmapButton=AO(t),t.domEvents.addEventListener(this.toMindmapButton,"mouseenter",this.handleMouseEnter),t.domEvents.addEventListener(this.toMindmapButton,"mouseleave",this.handleMouseLeave),t.domEvents.addEventListener(this.toMindmapButton,"click",this.handleClick)}static get(t){return t.findCustomByType(ff)}destroy(){Ce.get(this.editor).removeListener("change",this.handleHoveringBlock)}hide(){this.currentBlock&&(this.currentBlock=null),this.toMindmapButton.remove()}}function yO(n,t,e){var o;t==="beginDrag"&&((o=ff.get(n))==null||o.hide())}function hc(n,t,e,o){var i;const r=(i=o==null?void 0:o.groupId)!=null?i:K();t.forEach(s=>{const l=n.getBlockData(s);if(l.start!==e||(o==null?void 0:o.resetGroupId)){const a={...l,start:e};o!=null&&o.resetGroupId&&(a.groupId=r),n.updateBlockData(s,a)}l.textOnly||(e+=1)})}function m0(n,t,e,o){const r=a7(t,{withSelf:!0});r.length!==0&&hc(n,r,e,o)}class mf{constructor(t,e){m(this,"listStart",0);m(this,"listBrother",null);if(this.editor=t,df(e))return;const o=Au(e),r=go(o);this.listStart=r,o===e?this.listBrother=qs(o):this.listBrother=o}fix(){!this.listBrother||m0(this.editor,this.listBrother,this.listStart)}}class Gs{constructor(t,e,o){m(this,"listStart");m(this,"listBrother",null);this.editor=t,this.options=o;const r=Au(e),i=go(r);this.listStart=i,this.listBrother=r,o!=null&&o.resetStart&&(this.listStart=1)}fix(){!this.listBrother||m0(this.editor,this.listBrother,this.listStart,this.options)}}class kO{constructor(t,e,o){m(this,"listStart");m(this,"listNextBrothers",[]);this.editor=t,this.listNextBrothers=uc(e);const{start:r,resetStart:i}=o||{};this.listStart=i?1:r!=null?r:1}fix(){!this.listNextBrothers.length||hc(this.editor,this.listNextBrothers,this.listStart)}}function wO(n,t,e){n.getBlockData(t).quoted&&(e.quoted=!0)}function g0(n,t,e,o){if(we.debug("drag a block on a list block"),!et(n,t))return!1;g(we,Ht(e),"target is not a list block");const{type:r,start:i,level:s,groupId:l}=Gi(e),a=o==="after"?i+1:i,d=n.getBlockData(t),h={id:K(),type:"list",groupId:l,level:s,start:a,text:d.text,...c0(r)};wO(n,e,h);let p=bt(e);const A=nt(e);o==="after"&&(p+=1);let v=null;Ht(t)&&(v=new mf(n,t));const B=n.insertBlock(ct(A),p,h,Ch(h.id,0));return n.deleteBlock(t),new Gs(n,B).fix(),v==null||v.fix(),!0}function BO(n,t,e,o){if(we.debug("drag a list between text blocks"),o==="after"){const d=Qt(e);if(d&&Ht(d))return g0(n,t,d,"before")}if(o==="before"){const d=ce(e);if(d&&Ht(d))return g0(n,t,d,"after")}const i={...n.getBlockData(t),groupId:K(),start:1,level:1};let s=bt(e);const l=nt(e);o==="after"&&(s+=1),n.insertBlock(ct(l),s,i,Ch(i.id,0));const a=new mf(n,t);return n.deleteBlock(t),a.fix(),!0}function EO(n,t,e,o,r){if(Zd(e))return!1;const{blockId:i}=e,s=n.getBlockById(i);g(we,s,"no dragged block");const{isSourceBlock:l,targetBlock:a}=r;return!l&&a?(g(we,t===a,"block !== target block"),g(we,Ht(a),"target is not a list block"),g0(n,s,a,o)):BO(n,s,a,o)}function gf(n){const t=n.getAttribute("block-padding-level");return t?Number(t):null}function xO(n,t){let e;const o=gf(t);if(!o)e=1;else{if(o>=12)return e=12,!1;e=o+1}return n.updateBlockData(t,{...n.getBlockData(t),padding:e}),!0}function p7(n,t){const e=gf(t);if(!e)return!1;const o=n.getBlockData(t);return e>1?(n.updateBlockData(t,{...o,padding:e-1}),!0):(n.updateBlockData(t,{...o,padding:null}),!0)}function p0(n){return n.readonly||!n.isWritable()}function IO(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const o=e.block;et(n,o)&&xO(n,o)}),!0}function TO(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const o=e.block;et(n,o)&&p7(n,o)}),!0}function DO(n){return p0(n)?!1:n.undoManager.runInGroup(()=>(IO(n),!0))}function SO(n){return p0(n)?!1:n.undoManager.runInGroup(()=>(TO(n),!0))}function LO(n){if(p0(n))return!1;if(!n.selection.range.isCollapsed())return;const t=n.selection.focusedBlock;if(!et(n,t))return;const e=n.selection.range.focus;if(!(!e.isSimple()||e.offset!==0||!gf(t)))return p7(n,t),!0}class C0{renderBlock(t,e,o){const{padding:r}=o;return r?{attributes:{"block-padding-level":r}}:{}}}const Mnt="",MO={Tab:DO,"Shift+Tab":SO,Backspace:LO};function RO(n,t,e=1){if(!t)return null;let o=ce(n);for(;o;){const r=o.getAttribute("data-style-heading"),i=Number(o.getAttribute("data-list-level"));if(r){if(r<t)return null;if(r===t&&i===e)return Ht(o)?o:null}o=ce(o)}return null}function OO(n,t){const e=n.getAttribute("data-style-heading"),o=RO(n,e);if(o)return o;const r=ce(n);if(r&&Ht(r)&&Zn(r)===t)return r;const i=Qt(n);return i&&Ht(i)&&Zn(i)===t?i:null}function _O(n,t,e){var D,x,_;const o=(D=e.data)!=null?D:{};let r=1;if(Ht(t))r=vn(t);else{const R=gf(t);R&&(r=R+1),r>8&&(r=8)}const i=(x=o.listType)!=null?x:"ordered";if(i==="text-only")return null;const s=n.getBlockData(t);let l=(_=s.text)!=null?_:[],d=ie(l);const h=e.offset||0;h<=rn(l)&&(l=Tn(l,h).right,d=d.substring(0,h));let p=1;i==="ordered"&&(p=Number.parseInt(d,10)||1);let A=K();const v=OO(t,i);if(v){if(bt(t)>bt(v))p=go(v)+1;else{const H=go(v);H>1&&(p=H-1)}A=ac(v),new kO(n,v,{start:p+1}).fix()}const B={id:K(),type:"list",level:r,start:p,groupId:A,ordered:!1,text:l};return s.quoted&&(B.quoted=!0),s.heading&&(B.heading=s.heading),i==="ordered"?B.ordered=!0:(i==="checked"||i==="unchecked")&&(B.checkbox=i),{blockData:B,onConverted:(R,H)=>{new Gs(R,H).fix()}}}function fc(n){return n.textOnly?"text-only":n.checkbox?n.checkbox:n.ordered?"ordered":"unordered"}function FO(n){var e,o;if(n.checkbox||n.textOnly)return"";const t=(e=n.level)!=null?e:1;return n.ordered?`${KR(t,(o=n.start)!=null?o:1)}.`:XR(t)}function pf(n){return n==="checked"||n==="unchecked"}function C7(n,t,e,o){const r=t,{containerId:i,blockIndex:s}=o[o.length-1];if(s===0)return!0;const l=e.blocks[i][s-1];if(l.type!=="list")return!0;const a=fc(r),d=fc(l);return a!==d&&(!pf(a)||!pf(d))||r.level>l.level}function A7(n,t,e,o){const r=t,{containerId:i,blockIndex:s}=o[o.length-1];if(s===e.blocks[i].length-1)return!0;const l=e.blocks[i][s+1];if(l.type!=="list")return!0;const a=fc(r),d=fc(l);return a!==d&&(!pf(a)||!pf(d))||r.level>l.level}function PO(n,t,e,o,r){var s,l,a;const i=t;if(o==="text")return((s=Dn.convertTo)==null?void 0:s.call(Dn,n,t,e,"text",r))||"";if(o==="markdown"){let d=((l=Dn.convertTo)==null?void 0:l.call(Dn,n,t,e,"markdown",r))||"";i.checkbox==="checked"?d=`[x] ${d}`:i.checkbox==="unchecked"&&(d=`[ ] ${d}`),i.ordered?d=`${i.start}. ${d}`:d=`- ${d}`;const h=i.level||0;return d=(h>0?" ".repeat(h-1):"")+d,C7(n,t,e,r)&&(d=`${d}`),A7(n,t,e,r)&&(d=`${d}`,h<=1&&(d+=`
408
- `)),d}if(o==="html"){let d=((a=Dn.convertTo)==null?void 0:a.call(Dn,n,t,e,"html",r))||"";d=d.replace("<p>","").replace("</p>",""),i.checkbox==="checked"?d=`<input type="checkbox" checked="checked" disabled="disabled" /> ${d}`:i.checkbox==="unchecked"&&(d=`<input type="checkbox" disabled="disabled" /> ${d}`);let h="ul";return i.ordered?(d=`<li value="${i.start}">${d}</li>`,h="ol"):d=`<li>${d}</li>`,C7(n,t,e,r)&&(d=`<${h}>${d}`),A7(n,t,e,r)&&(d=`${d}</${h}>`),d}return""}function b7(n){const t=k("label",["editor-check-list-wrapper"],null);n&&W(t,"editor-check-list-wrapper-checked");const e=k("span",["editor-check-box"],t);return k("span",["editor-check-box-inner"],e),t}function NO(n,t){const e=fc(t);if(e!=="text-only"){if(e==="checked"){n.append(b7(!0));return}if(e==="unchecked"){n.append(b7(!1));return}n.innerText=FO(t)}}function $O(n){const t=k("div",["list-container"],null),e=k("button",["list-marker"],t);return NO(e,n),t}function v7(n){let t=Qt(n);if(!t)return null;const e=qs(n);for(;t!==e;){if(g(we,t,"no next block"),Ht(t))return vn(t)>vn(n)?t:null;if(t=Qt(t),!t)return null}return null}function A0(n){const t=[];let e=v7(n);if(!e)return t;for(;e;){const o=qs(e);t.push({block:e,children:A0(e)}),e=o}return t}function HO(n){const t=(o,r)=>{r.push(o.block),o.children.forEach(i=>t(i,r))},e=[];return n.forEach(o=>t(o,e)),e}function y7(n,t){return vn(t)!==1}function k7(n,t,e){t.forEach(o=>{const r=n.getBlockData(o.block);n.updateBlockData(o.block,{...r,groupId:e,level:r.level-1}),o.children.length&&k7(n,o.children,r.groupId)})}function b0(n,t){if(!y7(n,t))return!1;const e=vn(t);if(e===1)return!1;let o=K(),r=1,i=Zn(t);const s=e-1,l=a0(t);l&&(o=ac(l),r=go(l)+1,i!=="text-only"&&(i=Zn(l)));const a=A0(t),d=n.getBlockData(t),h={...d,groupId:o,level:s,start:r,...c0(i)};n.updateBlockData(t,h),n.doc.beginBatchUpdate(),k7(n,a,d.groupId),n.doc.endBatchUpdate(),new Gs(n,t).fix();const A=v7(t);return A&&new Gs(n,A,{resetStart:!0,resetGroupId:!0}).fix(),!0}function mc(n,t){Fe(t);const e=n.getBlockData(t),o={id:K(),type:"text",text:e.text};e.heading&&(o.heading=e.heading),e.heading&&(o.heading=e.heading);const r=new mf(n,t),i=nt(t),s=bt(t);n.deleteBlock(t);const l=Ch(o.id,0);if(Ba(n,i)&&!Gt(i)){const a=ye(i);n.insertBlock(ct(i),s,o,l),n.deleteBlock(a)}else n.insertBlock(ct(i),s,o,l);r.fix()}function jO(n){if(!n.selection.range.isCollapsed())return!1;const t=n.selection.focusedBlock;if(!Ht(t))return!1;const e=n.selection.range.focus;return!e.isSimple()||e.offset!==0?!1:vn(t)===1?(mc(n,t),!0):(b0(n,t),!0)}const UO=S("list-block");function zO(n,t,e){g(UO,Ht(t),"not a list block");const o={...n.getBlockData(t),id:K()};return e!=null&&e.level&&(o.level=e.level),e!=null&&e.start&&(o.start=e.start),e!=null&&e.keepText||delete o.text,(o==null?void 0:o.checkbox)==="checked"&&(o.checkbox="unchecked"),o}function VO(n){if(Fe(n),!df(n))return n;let t=Zi(n);for(;t;){if(!df(t))return t;t=Zi(t)}return null}function WO(n,t,e,o){const r=new Gs(n,o),i=go(o)+1;Ql(n,t,e,{forceInsertAfter:!0,newBlockData:zO(n,o,{start:i})}),r.fix()}function qO(n){var s;if(n.selection.range.isCollapsed()){const l=n.selection.focusedBlock;if(Ht(l)&&ut(n,l)===0)return mc(n,l),!0}n.clearSelectedContents();const t=n.selection.focusedBlock;if(!Ht(t))return!1;const e=n.selection.range.focus;if(!e.isSimple())return!1;const o=e.offset,i=(s=o===ut(n,t)?VO(t):t)!=null?s:t;return WO(n,t,o,i),!0}function w7(n){g(we,Ht(n),"not a list block");const{level:t}=Gi(n);let e=ce(n);for(;e;){if(Ht(e)){const{level:o}=Gi(e);if(t===o)return e;if(o<t)return null}e=ce(e)}return null}function B7(n,t){return Fe(t),w7(t)?vn(t)<ZR:!1}function GO(n,t,e){let o=ce(t);g(we,o,"no prev brother");const r=vn(e);for(;o;){if(o===e)return null;if(Ht(o)&&vn(o)===r+1)return o;o=ce(o)}return null}function E7(n,t){if(!B7(n,t))return!1;Fe(t);const e=w7(t);g(we,e,"no list prev brother");const o=e,r=GO(n,t,o),i=vn(o)+1;let s=K(),l=1,a=Zn(t);r&&(s=ac(r),l=go(r)+1,a=Zn(r));const d=A0(t),p={...n.getBlockData(t),groupId:s,level:i,start:l,...c0(a)};return n.updateBlockData(t,p),n.doc.beginBatchUpdate(),HO(d).forEach(v=>{const B=n.getBlockData(v);n.updateBlockData(v,{...B,level:B.level+1})}),n.doc.endBatchUpdate(),!0}function ZO(n,t,e){return t.length===0||!t.every(o=>Ht(o.block))?!1:e==="increase"?B7(n,t[0].block):y7(n,t[0].block)}function x7(n,t,e){if(!ZO(n,t,e))return!1;const o=t[0].block,r=vn(o),i=t.filter(d=>vn(d.block)<=r),s=a7(o,{withSelf:!1}),l=new Set(i.map(d=>d.block)),a=s.filter(d=>!l.has(d));return n.undoManager.runInGroup(()=>{let d=null;a.length>0&&(d=new Gs(n,a[0])),i.forEach(h=>{e==="increase"?E7(n,h.block):b0(n,h.block)}),d==null||d.fix()}),!0}function QO(n,t){return E7(n,t)}function YO(n,t){return b0(n,t)}function JO(n){const t=n.selection.range.getSelectedBlocks();if(t.length>1)return x7(n,t,"increase"),!0;const e=t[0].block;if(!Ht(e))return!1;const o=new mf(n,e);return QO(n,e)&&(o.fix(),new Gs(n,e).fix()),!0}function KO(n){const t=n.selection.range.getSelectedBlocks();if(t.length>1)return x7(n,t,"decrease"),!0;const e=t[0].block;return Ht(e)?(YO(n,e),!0):!1}class XO{constructor(t){this.editor=t}handleBeforeKeyDown(t,e){const o=t.selection.range.getSelectedBlocks();if(o.length===0||!o.some(i=>Ht(i.block)))return!1;switch(e.key){case"Enter":return this.handleEnter(e);case"Backspace":return this.handleBackspace();case"Tab":return this.handleTab(e);default:return!1}}handleEnter(t){const e=this.editor.selection.range.getSelectedBlocks()[0];return!e.block||!Ht(e.block)||or(t,"Shift+Enter")?!1:this.editor.undoManager.runInGroup(()=>qO(this.editor))}handleBackspace(){return this.editor.undoManager.runInGroup(()=>jO(this.editor))}handleTab(t){return or(t,"Shift+Tab")?this.editor.undoManager.runInGroup(()=>KO(this.editor)):this.editor.undoManager.runInGroup(()=>JO(this.editor))}}class t_{constructor(t){m(this,"effectedBlockIds",new Map);m(this,"handleBeforeClearSelection",()=>{this.effectedBlockIds.clear();const t=this.editor.selection.range.getSelectedBlocks();if(t.length===0)return;const e=new Set;t.forEach(r=>{const i=r.block;Ht(i)&&e.add(i)});const o=new Map;Array.from(e.values()).forEach(r=>{var a;const i=Au(r),{start:s}=Gi(i);o.set(it(i),s);const l=(a=tO(r))!=null?a:r;o.set(it(l),s)}),this.effectedBlockIds=o});m(this,"handleAfterClearSelection",()=>{Array.from(this.effectedBlockIds.entries()).forEach(([t,e])=>{const o=this.editor.findBlockById(t);!o||m0(this.editor,o,e)}),this.effectedBlockIds.clear()});this.editor=t,this.editor.addListener("beforeClearSelection",this.handleBeforeClearSelection),this.editor.addListener("afterClearSelection",this.handleAfterClearSelection)}destroy(){this.editor.removeListener("beforeClearSelection",this.handleBeforeClearSelection),this.editor.removeListener("afterClearSelection",this.handleAfterClearSelection)}}const e_=S("customize-list-start-menu");class n_{constructor(t){m(this,"popup");m(this,"block",null);m(this,"show",(t,e)=>{const o=e.querySelector("div.list-container");g(e_,o,"list-block mark does not exist"),this.block=e,this.popup.manualShow(o,{theme:"light"})});m(this,"createDialogContent",()=>{const t=k("div",["customize-start-panel"],null);k("span",["customize-start-panel-title"],t,L.t("list.numberLabel"));const e=this.createNumericInput();t.appendChild(e);const o=k("button",["customize-start-panel-button"],t,L.t("list.confirm"));return this.editor.domEvents.addEventListener(t,"keydown",this.handleKeydown),this.editor.domEvents.addEventListener(o,"click",this.handleOk),t});m(this,"handleDialogShow",()=>{const t=this.block;if(!t)return;const e=this.popup.popupContent,o=e.querySelector("button.customize-start-panel-button"),r=e.querySelector("input.customize-start-panel-input"),i=go(t);!o||!r||requestAnimationFrame(()=>{r.focus(),r.value=String(i)})});m(this,"handleOk",()=>{const e=this.popup.popupContent.querySelector("input.customize-start-panel-input"),o=this.block;if(!o)return;const r=Number(e.value);!r||(this.editor.undoManager.runInGroup(()=>{hc(this.editor,[o,...uc(o)],r,{resetGroupId:!0})}),this.popup.close("clickItem"))});m(this,"handleKeydown",(t,e)=>{const o=e;o.isComposing||(o.key==="Escape"?this.popup.close("cancelBar"):o.key==="Enter"&&this.handleOk())});this.editor=t,this.popup=new ou(this.createDialogContent()),this.popup.on("show",this.handleDialogShow)}destroy(){this.popup.destroy()}createNumericInput(){const t=k("input",["customize-start-panel-input"],null);t.type="number",t.min="1";const e=()=>{const r=t.value.replace(/[^\d]/g,"").replace(/^0+/,""),i=parseInt(r,10);i<=0||Number.isNaN(i)?t.value="":t.value=r};return this.editor.domEvents.addEventListener(t,"input",e),t}}function o_(n,t){return ac(n)===ac(t)}function r_(n,t){const e=l7(t);return e?o_(e,t)?go(e)!==go(t)-1:!0:!1}function i_(n,t){return Zi(t)?!0:go(t)!==1}function s_(n,t){return Fe(t),[{id:"continue-numbering",name:L.t("list.continueList"),states:r_(n,t)?[]:["disabled"]},{id:"start-new-list",name:L.t("list.restartList"),states:i_(n,t)?[]:["disabled"]},{id:"set-numbering-value",name:L.t("list.changeNumber")}]}function l_(n,t,e){var o,r;if(Fe(t),e.id==="continue-numbering"){const i=l7(t);i&&hc(n,[t,...uc(t)],go(i)+1,{resetGroupId:!0,groupId:ac(i)})}if(e.id==="start-new-list"&&n.undoManager.runInGroup(()=>{hc(n,[t,...uc(t)],1,{resetGroupId:!0})}),e.id==="set-numbering-value"){const i=(o=n.options.componentsOptions)==null?void 0:o.list;if((r=i==null?void 0:i.onChangeStart)!=null&&r.call(i,n,t,e))return;n.addCustom("list-customize-start-dialog",()=>new n_(n)).show(n,t)}}class c_{constructor(t){m(this,"menu");m(this,"handleClick",(t,e)=>{const o=Hl(e,"div.list-container");if(o&&this.editor.isWritable()){const r=tt(o);g(we,r,"no parent block"),Fe(r);const i=t.getBlockData(r);if(i&&i.checkbox){t.updateBlockData(r,{...i,checkbox:i.checkbox==="checked"?"unchecked":"checked"});return}if(Zn(r)==="unordered")return;this.menu.updateItems(this.getCommandItems(r)),this.menu.manualShow(o),this.activeList(o,!0)}});m(this,"handleMenuClose",()=>{var e;const t=(e=this.menu.tippyInstance)==null?void 0:e.reference;t&&this.activeList(t,!1)});m(this,"handleMenuClick",(t,e)=>{var r;const o=(r=this.menu.tippyInstance)==null?void 0:r.reference;if(o){const i=tt(o);i&&l_(this.editor,i,e)}});this.editor=t,this.editor.addListener("click",this.handleClick),this.menu=new Us([]),this.menu.addListener("close",this.handleMenuClose),this.menu.addListener("click",this.handleMenuClick)}destroy(){this.editor.removeListener("click",this.handleClick),this.menu.removeListener("close",this.handleMenuClose)}getCommandItems(t){return s_(this.editor,t)}activeList(t,e){const o=tt(t);!o||(e?(W(t,"active"),W(o,"active")):(ot(t,"active"),ot(o,"active")))}}class a_{constructor(t){this.editor=t}handleBeforeKeyDown(t,e){const o=t.selection.range.getSelectedBlocks();if(o.length===0)return!1;const r=o[0].block;if(!Ht(r)||!f7(r))return!1;if(e.key==="ArrowUp"||e.key==="ArrowLeft"){const i=Is(r);return i&&t.selection.selectBlock(i,ut(t,i)),!0}if(e.key==="ArrowDown"||e.key==="ArrowRight"){const i=Ts(r);return i&&t.selection.selectBlock(i,0),!0}return(e.key==="Delete"||e.key==="Backspace"||e.key==="Escape")&&g7(t,r),!0}}function u_(n,t,e,o,r){np(n,"list-block-init",()=>{setTimeout(()=>{n.input.addHandler(new a_(n)),n.input.addHandler(new XO(n)),n.addCustom("list-clear-selection-handler",()=>new t_(n)),n.addCustom("list-marker-menu",()=>new c_(n))})});const i=Dn.createBlockContent(n,t,e,o,r),s=r,{level:l,start:a,groupId:d}=s,h=fc(s);o.setAttribute("data-list-level",`${l}`),o.setAttribute("data-list-start",`${a||1}`),o.setAttribute("data-list-group-id",`${d}`),o.setAttribute("data-list-type",h);const p=$O(s);return o.insertBefore(p,i),s.viewAsMindmap?setTimeout(()=>{const A=n.getBlockById(r.id);A&&hf(n,A,{},{mindmapTools:f0,saveData:!1})}):setTimeout(()=>{const A=n.getBlockById(r.id);A&&m7(n,A)}),i}const d_={list:{confirm:"\u786E\u5B9A",setStart:"\u8BBE\u7F6E\u7F16\u53F7",continueList:"\u7EE7\u7EED\u7F16\u53F7",restartList:"\u5F00\u59CB\u65B0\u5217\u8868",changeNumber:"\u4FEE\u6539\u7F16\u53F7\u503C",numberLabel:"\u7F16\u53F7\u987A\u5E8F",mention:{tooltip:"\u63D0\u53CA\u4EBA\u5458\u5E76\u901A\u77E5"}},mindmap:{viewAsMindMap:"\u663E\u793A\u4E3A\u8111\u56FE",autoFit:"\u81EA\u52A8\u7F29\u653E",fullScreen:"\u5168\u5C4F\u67E5\u770B",close:"\u5173\u95ED",exitFullscreen:"\u9000\u51FA\u5168\u5C4F"}},h_={list:{confirm:"Confirm",setStart:"Set number",continueList:"Continue numbering",restartList:"Start a new list",changeNumber:"Set numbering value",numberLabel:"Numbering order",mention:{tooltip:"Mention and notify users"}},mindmap:{viewAsMindMap:"View as MindMap",autoFit:"Auto zoom",fullScreen:"Full screen",close:"Close",exitFullscreen:"Exit full screen"}},f_={list:{confirm:"OK",setStart:"\u756A\u53F7\u3092\u8A2D\u5B9A",continueList:"\u9023\u756A\u3092\u8A2D\u5B9A",restartList:"\u65B0\u3057\u3044\u30EA\u30B9\u30C8\u3092\u4F5C\u6210",changeNumber:"\u756A\u53F7\u3092\u7DE8\u96C6",numberLabel:"\u756A\u53F7",mention:{tooltip:"\u30E1\u30F3\u30B7\u30E7\u30F3\u304A\u3088\u3073\u901A\u77E5"}},mindmap:{viewAsMindMap:"\u30DE\u30A4\u30F3\u30C9\u30DE\u30C3\u30D7\u3067\u8868\u793A",autoFit:"\u81EA\u52D5\u30D5\u30A3\u30C3\u30C8",fullScreen:"\u5168\u753B\u9762\u8868\u793A\u306E\u30AA\u30F3",close:"\u9589\u3058\u308B",exitFullscreen:"\u5168\u753B\u9762\u8868\u793A\u306E\u30AA\u30D5"}};L.mergeLang({"zh-CN":d_,"en-US":h_,"ja-JP":f_});const Rnt="",I7={...Dn,blockType:"list",createBlockContent:u_,convertFrom:_O,convertTo:PO,handleDrop:EO,notify:yO},v0=S("paragraph");class m_{constructor(t){m(this,"id","BlockParagraphProvider");this.editor=t}isChecked(t,e){return!!(t[e]||t.level&&(t.ordered===!0&&!t.checkbox&&e==="ordered-list"||t.ordered===!1&&!t.checkbox&&e==="unordered-list")||e==="check-list"&&t.checkbox)}getAvailableCommands(t,e){const o=[],r={"unordered-list":[L.t("commands.unordered"),ro("CtrlOrCmd+Shift+L"),gL],"ordered-list":[L.t("commands.ordered"),ro("CtrlOrCmd+Shift+U"),mL],"check-list":[L.t("commands.check"),void 0,pL],link:[L.t("commands.link"),ro("CtrlOrCmd+K"),sv],quoted:[L.t("commands.quote"),void 0,CL]};if(et(t,e)){const i=it(e),s=Dt(e),l=Do(t,e),a=t.getBlockData(e);Object.entries(r).forEach(([d,[h,p,A]])=>{const v=[];if(this.isChecked(a,d)&&v.push("checked"),d==="link"){if(!t.selection.range.isSimple())return;t.selection.range.getSelectedBlocks().length!==1&&v.push("disabled")}o.push({blockId:i,blockType:s,blockKind:l,id:d,name:h,desc:p,states:v,icon:A,groupIndex:600})})}return o}convertLink(t,e,o){g(v0,zr(e.start),""),g(v0,zr(e.start),"");const r="bottom-start",i=e.start.offset,s=e.end.offset,l=(v,B)=>{t.undoManager.runInGroup(()=>{try{const D=t.selection.range.isCollapsed();let x;if(D){x=Wr(t.getBlockText(o),s,v,{link:B}),t.setBlockText(o,x);return}x=mh(t.getBlockText(o),i,s,v),x=Ta(i,v.length,x,"link",B),t.setBlockText(o,x),t.selection.selectBlock(o,i+v.length),t.focus()}catch(D){v0.error(D)}})},a=()=>{t.selection.selectBlock(o,s),t.focus()},d=$r(t,o,e)[0];if(!d)return;const h=Vr(t,o,"link-button-anchor",d),p=t.getBlockText(o),A=Da(p,i);pu(t,{target:h,linkText:t.getSelectedText(),linkUrl:(A==null?void 0:A.link)||"",onFinished:l,onClose:a,placement:r})}convertToList(t,e,o){const r=eh(t,e,"list",{offset:0,data:{listType:o}});r&&t.undoManager.runInGroup(()=>{const i=bt(e),s=nt(e);t.insertBlock(ct(s),i,r.blockData),t.deleteBlock(e),t.focus()})}executeCommand(t,e,o,r){var a;if(!et(t,e))return!1;const i=r.id,s=(a=r.states)==null?void 0:a.includes("checked");let l=!1;if(i==="unordered-list"&&(s?mc(t,e):this.convertToList(t,e,"unordered"),l=!0),i==="ordered-list"&&(s?mc(t,e):this.convertToList(t,e,"ordered"),l=!0),i==="check-list"&&(s?mc(t,e):this.convertToList(t,e,"unchecked"),l=!0),i==="quoted"){const h=t.getBlockData(e).quoted;t.updateBlockData(e,{quoted:h?void 0:!0}),t.focus(),l=!0}if(i==="link"){const d=cf(t);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},1e3),this.convertLink(t,o,e),l=!0}return l}}const g_={left:tu,right:Dp,center:Sp};class p_{constructor(t){m(this,"id","BlockAlignProvider");this.editor=t}applyAlignStyle(t,e,o){Object.keys(g_).includes(o)?t.updateBlockData(e,{align:o}):t.updateBlockData(e,{align:null})}isChecked(t,e){return t.align===e}getAvailableCommands(t,e,o){if(et(t,e)){const r=it(e),i=Dt(e),s=Do(t,e),l=t.getBlockData(e),a=d=>{var p;const h=k("span",["toolbar-item-name-container"],null);for(const A of d.children)if((p=A.states)!=null&&p.includes("checked"))return h.innerHTML=A.icon||tu,h;return h.innerHTML=tu,h};return[{id:"align",name:L.t("commands.alignGroup"),blockId:r,blockType:i,blockKind:s,groupIndex:700,dropdown:!0,element:a,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["align-left"],children:[{id:"align-left",name:L.t("commands.alignLeft"),icon:tu,states:this.isChecked(l,"left")?["checked"]:[]},{id:"align-center",name:L.t("commands.alignCenter"),icon:Sp,states:this.isChecked(l,"center")?["checked"]:[]},{id:"align-right",name:L.t("commands.alignRight"),icon:Dp,states:this.isChecked(l,"right")?["checked"]:[]}],childrenType:"menu"}]}return[]}executeCommand(t,e,o,r){if(!et(t,e))return!1;if(r.id.startsWith("align")){const i=r.id.replace(/^align-/,"");return this.applyAlignStyle(t,e,i),this.editor.focus(),!0}return!1}}function C_(n){const e=n.selection.range;if(e.isCollapsed()||e.start.blockId!==e.end.blockId||!e.start.isSimple()||!e.end.isSimple()||e.end.offset-e.start.offset!==1)return!1;const o=n.getBlockById(e.start.blockId);return La(n,o,e.start.offset).charType==="box"}const A_=S("toolbar-handler"),b_={id:"",name:"",type:"separator"};class gc{constructor(t){m(this,"toolbar");m(this,"toolbarType","object");m(this,"mouseDown",!1);m(this,"oldRange",null);m(this,"hoveringBlock",null);m(this,"hoveringTextChild",null);m(this,"_disableTextToolbar",!1);m(this,"handleButtonClick",(t,e)=>{this.toolbarType==="text"?(this.editor.editorCommandProviders.executeCommand(this.editor.selection.range,e,{}),this.showTextToolbar("click")):this.hoveringBlock&&VR(this.editor,this.hoveringBlock,this.hoveringTextChild,e)});m(this,"handleClose",()=>{Fp(this.editor)&&this.editor.focus()});m(this,"handleClosing",(t,e)=>{if(this.toolbarType==="object"){const o=i5(e);if(this.hoveringBlock===o)return!1}return!0});m(this,"handleDocumentMouseDown",t=>{t.button===0&&(document.addEventListener("mouseup",this.handleDocumentMouseUp),this.mouseDown=!0)});m(this,"handleDocumentMouseUp",()=>{document.removeEventListener("mouseup",this.handleDocumentMouseUp),this.mouseDown=!1,this.handleSelectionChange(this.editor)});m(this,"handleHoveringBlockChildChange",(t,e,o,r)=>{if(!(this.hoveringBlock===t&&this.hoveringTextChild===e)&&(this.hoveringBlock=t,this.hoveringTextChild=e,!(this.toolbar.isVisible&&this.toolbarType==="text"))){if(!t){this.toolbar.close("fromHover");return}this.showObjectToolbar(r)}});m(this,"handleSelectionChange",Le.default(t=>{var o;if(g(A_,t===this.editor,"editor mismatch"),t.selection.range.isCollapsed()||this.mouseDown){if(this.toolbarType==="object"){const r=(o=this.toolbar.tippyInstance)==null?void 0:o.reference,i=this.editor.selection.focusedBlock;if(r&&Xt(r,i))return}this.toolbar.close("selectionChange"),this.oldRange=null;return}if(!this.editor.isWritable()){this.toolbar.close("selectionChange"),this.oldRange=null;return}if(t.selection.range.getSelectedBlocks().length===0){this.toolbar.close("selectionChange"),this.oldRange=null;return}this.oldRange&&this.oldRange.isEqual(t.selection.range)||(this.oldRange=t.selection.range,this.showTextToolbar("selectionChange"))},50));this.editor=t;const e=t.options.componentsOptions.popover;this.toolbar=new ru([],void 0,{tooltipId:t.clientId,id:"editor-toolbar",overflowBoundary:e==null?void 0:e.overflowBoundary,refuseOverflow:!0,padding:20}),this.toolbar.on("click",this.handleButtonClick),this.toolbar.on("close",this.handleClose),this.toolbar.on("closing",this.handleClosing),this.bindEvents(),t.addListener("selectionChanged",this.handleSelectionChange),Ce.get(t).addListener("childChange",this.handleHoveringBlockChildChange),Ce.get(t).addFilter(this),t.editorCommandProviders.registerCommandProvider(new qR(t)),t.editorCommandProviders.registerCommandProvider(new m_(t)),t.editorCommandProviders.registerCommandProvider(new p_(t))}disableTextToolbar(){this._disableTextToolbar=!0}enableTextToolbar(){this._disableTextToolbar=!1}hide(){this.toolbar.close("selectionChange")}destroy(){this.unbindEvents(),this.toolbar.destroy(),this.editor.removeListener("selectionChanged",this.handleSelectionChange),Ce.get(this.editor).removeListener("childChange",this.handleHoveringBlockChildChange)}isInBlock(t,e){return t!==this.hoveringBlock?!1:!!(e.target&&e.target instanceof Node&&this.toolbar.popper&&Xt(this.toolbar.popper,e.target))}bindEvents(){document.addEventListener("mousedown",this.handleDocumentMouseDown)}unbindEvents(){document.removeEventListener("mousedown",this.handleDocumentMouseDown)}update(t){this.showTextToolbar(t)}showTextToolbar(t){var D,x;if(this._disableTextToolbar||!this.editor.isWritable())return;const o=this.editor.selection.range.getSelectedBlocks();if(o.length===0)return;const r=o[0];if(!r)return;if(o.length===1&&Me(r.block)){t==="click"&&this.showObjectToolbar(null);return}if(C_(this.editor))return;if(nt(r.block)===this.editor.rootContainer&&bt(r.block)===0){this.toolbar.close("selectionChange");return}const i=this.editor.editorCommandProviders.getCommands(this.editor.selection.range),s=new Map;i.forEach(_=>{const R=_.groupIndex,H=s.get(R);H?H.push(_):s.set(R,[_])});const l=[[]],a=Array.from(s.entries()).sort((_,R)=>_[0]-R[0]);for(let _=0;_<a.length;_++){const[,R]=a[_];if(R.length===0)continue;let H=l[l.length-1];H.length>0&&H[H.length-1].groupIndex!==R[R.length-1].groupIndex&&(H=[],l.push(H)),H.push(...lf(R))}if(l.length===0){this.toolbar.close("selectionChange");return}this.toolbarType="text";const d=[];if(l.forEach((_,R)=>{const H=_.sort((z,q)=>{var rt,ft;return((rt=z.order)!=null?rt:0)-((ft=q.order)!=null?ft:0)});d.push(...H),R!==l.length-1&&d.push(b_)}),d.length===0){this.toolbar.close("selectionChange");return}this.toolbar.updateItems(d);const h=o[o.length-1],p=!this.editor.selection.range.isReverse()&&h!==r,A=p?h:r,v=FR(this.editor,A),B=Vr(this.editor,A.block,"editor-quick-menu",v);this.toolbar.manualShow(B,{placement:p?"bottom":"top",offset:[0,p?5:10]}),(x=(D=this.toolbar.tippyInstance)==null?void 0:D.popperInstance)==null||x.update()}showObjectToolbar(t){var l,a,d;if(!this.hoveringBlock||this.mouseDown)return;const e=this.hoveringBlock,o=this.hoveringTextChild,{commands:r,element:i}=jR(this.editor,e,o);if(!r.length||!i){this.toolbar.close("fromHover");return}this.toolbarType="object",this.toolbar.isVisible&&((a=(l=this.toolbar)==null?void 0:l.tippyInstance)==null?void 0:a.reference)!==i&&this.toolbar.close("fromHover");const s=()=>{let h;const p=i.getClientRects();if(p.length>1){if(h=o?p[p.length-1]:p[0],t)for(let A=0;A<p.length;A++){const v=p[A],B=new DOMRect(v.x-4,v.y-4,v.width+8,v.height+8);if(B.x<t.clientX&&t.clientX<B.right&&B.y<t.clientY&&t.clientY<B.bottom){h=v;break}}}else{if(h=i.getBoundingClientRect(),o){const A=o.getBoundingClientRect();return new DOMRect(A.x,A.y,A.width,A.height)}return new DOMRect(p[0].x,p[0].y,p[0].width,p[0].height)}if(t){const A=h.y,v=t.clientX;return new DOMRect(v,A,10,h.height)}return h};this.toolbar.updateItems(r),this.toolbar.isVisible||(this.toolbar.manualShow(i,{placement:o?"bottom":"top",getReferenceClientRect:s}),(d=this.toolbar.tippyInstance)!=null&&d.popper&&(this.toolbar.tippyInstance.popper.style.paddingTop="10px",this.toolbar.tippyInstance.popper.style.paddingBottom="5px"))}static register(t){return t.addCustom("toolbar-handler",e=>new gc(e))}static get(t){return t.getCustom("toolbar-handler")}}function Cf(n,t,e){n.getBlockData(t).heading===e?n.updateBlockData(t,{heading:null}):n.updateBlockData(t,{heading:e})}function T7(n,t,e){["left","center","right"].includes(e)?n.updateBlockData(t,{align:e}):n.updateBlockData(t,{align:null})}function y0(n,t){const o=n.getBlockData(t).quoted;n.updateBlockData(t,{quoted:o?void 0:!0})}function k0(n,t){return!!(n[t]||n.level&&(n.ordered===!0&&!n.checkbox&&t==="ordered-list"||n.ordered===!1&&!n.checkbox&&t==="unordered-list")||t==="check-list"&&n.checkbox)}function w0(n,t,e){if(!n.selection.range.focus.isSimple())return;const r=n.getBlockData(t);let i;switch(e){case"unordered-list":i=k0(r,"unordered-list")?void 0:"unordered";break;case"ordered-list":i=k0(r,"ordered-list")?void 0:"ordered";break;case"check-list":i=k0(r,"check-list")?void 0:"unchecked";break}if(i){const s=eh(n,t,"list",{offset:0,data:{listType:i}});s&&n.undoManager.runInGroup(()=>{const l=bt(t),a=nt(t);n.deleteBlock(t),n.insertBlock(ct(a),l,s.blockData)})}else mc(n,t)}const v_=Object.freeze(Object.defineProperty({__proto__:null,applyHeadingStyle:Cf,applyAlignStyle:T7,applyQuoteStyle:y0,applyList:w0},Symbol.toStringTag,{value:"Module"})),y_=[yp,kp,wp,Bp,Ep,xp,Ip,Tp],k_={Unordered:av,Ordered:uv,Checkbox:lv,Quote:cv};function D7(n,t){const e=n;e.blockOptions=t,e.itemType="insert-block",n.children&&n.children.forEach(o=>D7(o,t))}function w_(){return{name:"basic",insertBlockCommandItems:[{id:"text",icon:nu,name:L.t("commands.text"),order:0,group:"basics",value:"text"}]}}function B0(n=1){var r;const t={name:"basic",insertBlockCommandItems:[]};let e=af();e<=4?e=5:e<8&&(e+=1);let o=n;for(;o<=e;){const i=`heading-${o}`;(r=t.insertBlockCommandItems)==null||r.push({id:i,icon:y_[o-1],name:L.t("quickMenu.basic.heading.title",{heading:String(o)}),order:o,group:"basics",value:String(o),subText:An(i)}),o++}return t}function B_(){const n={name:"basic",insertBlockCommandItems:[]};return["Unordered","Ordered","Checkbox","Quote"].forEach((e,o)=>{var i;const r=`insert-${e.toLocaleLowerCase()}`;(i=n.insertBlockCommandItems)==null||i.push({id:r,name:L.t(`quickMenu.basic.${e.toLocaleLowerCase()}`),icon:k_[e],value:e.toLocaleLowerCase(),group:"basics",order:10+o,subText:An(r)})}),n}class S7{constructor(t){this.withPlainText=t}getCommands(){const t=w_(),e=B0(),o=B_();return[...this.withPlainText?t.insertBlockCommandItems||[]:[],...e.insertBlockCommandItems||[],...o.insertBlockCommandItems||[]]}updateBlock(t,e,o,r){const{value:i,id:s}=r;return s.startsWith("heading-")?Cf(t,o,Number.parseInt(i!=null?i:"1",10)||1):i==="ordered"||i==="unordered"||i==="checkbox"?w0(t,o,{ordered:"ordered-list",unordered:"unordered-list",checkbox:"check-list"}[i]):i==="quote"&&y0(t,o),null}async handleUpdateBlockCore(t,e){const o=t.getBlockByIndex(e.containerId,e.blockIndex);return this.updateBlock(t,e.containerId,o,e.item)}async handleInsertEmptyBlockCore(t,e){const{containerId:o,blockIndex:r}=e,i=t.insertTextBlock(void 0,o,r);return this.updateBlock(t,e.containerId,i,e.item)}async executeCommand(t,e,o){if(o.from==="quick-menu"){const r=t.getBlockById(o.blockId),i=t.getParentContainer(r),s=ct(i),l=t.getBlockIndex(r);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:s,blockIndex:l})),t.focus()}else o.from==="block-menu"&&(t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:o.containerId,blockIndex:o.blockIndex})),t.focus());return null}}const L7={basics:100,system:200,common:300,thirdParty:400};class E0{constructor(){m(this,"dataUrl","");m(this,"error",null)}destroy(){}setDataUrl(t){this.error=null,this.dataUrl=t}setError(t){this.dataUrl="",this.error=t}}const E_=S("mathjax-converter"),x_="MathJax-script";async function I_(n){var o;window.MathJax||(window.MathJax={options:{skipHtmlTags:["script","noscript","style","textarea","pre","code","annotation","annotation-xml","body"]}});const t=n.getComponentOptions("mathjax"),e=((o=t==null?void 0:t.cdn)==null?void 0:o.mathjax)||"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js";await bs(e,x_)}function T_(){try{window.MathJax&&window.MathJax.texReset()}catch{}}async function M7(n,t){const e="mathjax2Svg";try{await xo.lock(e),T_(),await I_(n);const o=await window.MathJax.tex2svgPromise(t),r=o.querySelector("merror");if(r)throw new Error(r.textContent);return o.querySelector("svg").outerHTML}catch(o){throw E_.error(o),o}finally{xo.release(e)}}async function R7(n,t){const e=await M7(n,t);return e?await Dm(e,"image/svg+xml"):""}async function x0(n,t){const o=await M7(n,t),r=new File([o],"math.svg");return(await n.doc.uploadResource(r)).resourceId}const O7=S("edit-mathjax");class D_{constructor(){m(this,"editMathjaxPopup",null);m(this,"onChange",null);m(this,"tex","");m(this,"observer",null);m(this,"handleClose",t=>{var o;const e=t.content.querySelector("textarea");if(e){const r=e.value;r!==this.tex&&((o=this.onChange)==null||o.call(this,r,!0))}});m(this,"handleKeyup",t=>{var e;t.isComposing||(t.key==="Escape"&&((e=this.editMathjaxPopup)==null||e.close("cancelBar")),this.handleChange(t.target.value))});m(this,"handleChange",Le.default(t=>{var e;(e=this.onChange)==null||e.call(this,t,!1)},300))}editMathjax(t,e,o){if(!this.editMathjaxPopup)this.editMathjaxPopup=new ou(this.createPopupContent(e));else{const r=this.getTextarea();r.value=e}this.tex=e,this.editMathjaxPopup.manualShow(t,{theme:"light"}),this.editMathjaxPopup.removeAllListeners("close"),this.editMathjaxPopup.addListener("close",this.handleClose),this.onChange=o}createPopupContent(t){const e=k("textarea",["mathjax-editor-textarea"],null);return e.value=t,e.addEventListener("keyup",this.handleKeyup),this.textareaWatcher(e),e}textareaWatcher(t){const e=t;e.onblur=()=>{var r;(r=this.editMathjaxPopup)!=null&&r.isVisible&&t.focus()};const o=()=>{setTimeout(()=>{t.focus()})};this.observer=new IntersectionObserver(o,{}),this.observer.observe(t)}getTextarea(){g(O7,this.editMathjaxPopup,"no exists mathjax editor popup");const t=this.editMathjaxPopup.content.querySelector("textarea");return g(O7,t,"no textarea"),t}destroy(){var t,e;this.onChange=null,(t=this.observer)==null||t.disconnect(),(e=this.editMathjaxPopup)==null||e.removeAllListeners()}}function _7(n,t,e,o){n.addCustom("mathjax-editor",()=>new D_).editMathjax(t,e.trim(),o)}function F7(){return{insert:" ",attributes:{id:K(),box:!0,type:"math",tex:" ",src:"",created:Date.now()}}}function Af(n,t){const e=n.getBoxData(t),o=tt(t);if(!o)return;const r=Os(o,t);n.selection.selectBlock(o,r.start,r.end);const i=async(s,l)=>{if(!s.trim()){n.updateBoxData({...e,tex:s,src:null});return}try{await xo.lock("convertAndUploadMathjax");const a=await x0(n,s);n.updateBoxData({...e,tex:s,src:a})}catch(a){const d=n.getBoxData(t);n.addCustom(`mathjax-box-${d.id}`,()=>new E0).setError(a),n.updateBoxData({...e,tex:s,src:""})}finally{xo.release("convertAndUploadMathjax"),l&&n.focus()}};_7(n,t,e.tex,i)}const P7=S("mathjax-box");function I0(n,t){n.selection.updateSelection(null);const e=t.target;!e||!(e instanceof HTMLElement)||n.domEvents.removeEventListener(e,null,I0)}async function S_(n,t,e){try{if(!t.tex.trim())return;const o=await R7(n,t.tex),r=n.findBoxById(t.id);if(!r)return;const i=$m(r);i.innerHTML="";const s=k("img",["mathjax"],i);s.src=o,e.setDataUrl(o),n.domEvents.addEventListener(s,"load",I0)}catch(o){e.setError(o);const r=n.findBoxById(t.id);if(!r)return;const i=r.querySelector(".mathjax-tex-text");W(i,"mathjax-error"),i.innerText=o.message,n.selection.updateSelection(null)}}function L_(n,t,e,o){const r=o,i=n.addCustom(`mathjax-box-${r.id}`,()=>new E0);if(r.src||i.dataUrl){const a=k("img",["mathjax"],e);a.src=n.doc.buildResourceUrl(r.src||i.dataUrl),n.domEvents.addEventListener(a,"load",I0);return}const s=["mathjax-tex-text"];let l=r.tex;l.trim()?i.error&&(l=i.error.message,s.push("mathjax-error")):l=L.t("mathjax.emptyText"),k("span",s,e,l),S_(n,r,i)}function M_(n,t){const e={id:K(),box:!0,type:"math",tex:t,src:"",created:Date.now()};return x0(n,t).then(o=>{if(!n.findBoxById(e.id))return;const i={...e,src:o};n.updateBoxData(i)}).catch(o=>{P7.error(`failed to convert and upload mathjax: ${JSON.stringify(o)}`)}),e}function R_(n,t,e,o){const r=t;return o==="text"?r.tex:o==="markdown"?` $${r.tex}$ `:r.src?`<img src="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" />`:`<code>$${r.tex}$</code>`}function O_(n,t,e){const o=tt(t);g(P7,o,"failed to get block"),!(n.readonly||!n.isBlockWritable(o))&&Af(n,t)}function __(){return{abstract:L.t("mathjax.abstract")}}const N7={boxType:"math",updateBoxContent:L_,convertFrom:M_,convertTo:R_,handleClickBox:O_,getBoxProperties:__};async function F_(n,t,e){try{const o=t.embedData,r=await R7(n,o.mathjaxText),i=n.findBlockById(t.id);if(!i)return;const s=Lt(i);s.innerHTML="";const l=k("img",["mathjax"],s);l.src=r,e.setDataUrl(r)}catch(o){e.setError(o)}}function P_(n,t){if(n.readonly||!t.target||!(t.target instanceof Node))return;const e=tt(t.target);if(!e||!Me(e)||fn(e)!=="math")return;const o=Lt(e),r=o.querySelector("img")||o.querySelector("span.mathjax-tex-text");if(!r||!Xt(r,t.target))return;const s=n.getBlockData(e).embedData;_7(n,r,s.mathjaxText,async l=>{const a=await x0(n,l),d={mathjaxText:l,src:a};n.updateEmbedData(e,d)})}function N_(n,t,e){const o=e.embedData,r=n.addCustom(`mathjax-block-${e.id}`,()=>new E0);if(n.domEvents.addEventListener(t,"click",P_),!o.mathjaxText.trim()){k("span",["mathjax-tex-text"],t,L.t("mathjax.emptyText"));return}if(o.src||r.dataUrl){const i=k("img",["mathjax"],t);i.src=n.doc.buildResourceUrl(o.src||r.dataUrl);return}r.error,k("span",["mathjax-tex-text"],t,o.mathjaxText),F_(n,e,r)}function $_(n,t,e){if(!et(n,t))return null;const o=n.getBlockString(t).trim();if(!o||!o.startsWith("$$")||!o.endsWith("$$"))return null;const r=Bm(o,"$");if(!r)return null;const i={mathjaxText:r,src:""};return{blockData:{id:K(),type:"embed",embedType:"math",embedData:i}}}function H_(n){return{name:"Mathjax"}}function j_(n,t){var o;const e=Lt(t);n.domEvents.removeAllListeners(e),n.findCustom("mathjax-editor")&&((o=n.getCustom("mathjax-editor").editMathjaxPopup)==null||o.close("cancelBar"))}function U_(n,t,e,o){const r=t.embedData;return o==="html"?`<img src="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" />`:o==="markdown"?`
407
+ </svg>`;async function cO(n,t,e){const o=te(t),r=o.querySelector('[data-button-id="mindmap-fullscreen"]');g(we,r,"no full screen button");const i=()=>{setTimeout(()=>{e.toMindmap(n,t,{},{reset:!0,mindmapTools:e})},300)},s=()=>{ot(o,"fullscreen"),r.innerHTML=d9,Jb(r,"Full screen",n.clientId),f9(t)&&setTimeout(()=>{i()},300)};if(document.fullscreenElement===o){try{await h9()}catch(l){we.error(l)}s()}else{try{W(o,"fullscreen"),await iO(o),i()}catch(l){we.error(l)}r.innerHTML=lO,Jb(r,L.t("mindmap.exitFullscreen"),n.clientId)}o.onfullscreenchange=()=>{document.fullscreenElement||s()}}function u0(n,t,e,o,r){if(t.querySelector(`[data-button-id="${e}"]`))return null;const s=ho(e,o,r,[],n.clientId);return W(s,"mindmap-button"),t.appendChild(s),s}function d0(n,t){return n.querySelector(`[data-button-id="${t}"]`)}function aO(n){return d0(n,"mindmap-fullscreen")}function uO(n){return d0(n,"mindmap-fit")}function dO(n){return d0(n,"mindmap-close")}function hO(n,t,e,o){const r=u0(n,t,"mindmap-close",L.t("mindmap.close"),oO);!r||n.domEvents.addEventListener(r,"click",()=>{o.closeMindmap(n,e)})}function fO(n,t,e,o){const r=u0(n,t,"mindmap-fit",L.t("mindmap.autoFit"),rO);!r||n.domEvents.addEventListener(r,"click",()=>{o.fitMindmap(n,e)})}function mO(n,t,e,o){if(navigator.userAgent.includes("Mobile")&&!navigator.userAgent.includes("iPad"))return;const i=u0(n,t,"mindmap-fullscreen",L.t("mindmap.fullScreen"),d9);!i||n.domEvents.addEventListener(i,"click",()=>{cO(n,e,o)})}function gO(n,t){const e=th(t);if(!e)return;const o=uO(e);o&&(o.remove(),n.domEvents.removeAllListeners(o));const r=dO(e);r&&(r.remove(),n.domEvents.removeAllListeners(r));const i=aO(e);i&&(i.remove(),n.domEvents.removeAllListeners(i))}const dc=new Map;function h0(n,t,e){const o=(s,l)=>{s.forEach(a=>{l?W(a.block,"to-mindmap-highlight"):ot(a.block,"to-mindmap-highlight"),o(a.children,l)})},r=u9(n,t);if(r.length===0)return;const i=r[0].block;if(e){const s=dc.get(i);s&&(s.forEach(l=>l.cancel()),dc.delete(i)),o(r,!0)}else{const s=setTimeout(()=>{o(r,!1),dc.delete(i)},300),l=()=>{clearTimeout(s),dc.delete(i)},a=dc.get(i);a?a.push({cancel:l}):dc.set(i,[{cancel:l}])}}const{Markmap:pO}=jB;function CO(n,t){Fe(t);const e=u9(n,t),o=e[0].block,r=d=>({t:"text",v:Lt(d.block).textContent,d:1,c:d.children.length>0?d.children.map(p=>r(p)):void 0});let i=null;e.length>1?i={t:"root",v:"root",d:0,c:e.length>0?e.map(d=>r(d)):void 0}:i=r(e[0]);const l=d=>{if(d.length===0)return null;const h=d[d.length-1];return h.children&&h.children.length>0?l(h.children):h},a=l(e);return{root:i,block:o,nodes:e,last:a}}function hf(n,t,e,o){const{root:r,block:i,last:s}=CO(n,t);o.selectBlock&&n.selection.selectBlock(i,0,0),h0(n,i,!1),o.saveData&&n.updateBlockData(i,{viewAsMindmap:!0});const l=te(i);let a=l.querySelector(".editor-mindmap-svg");if(o.reset&&(a&&a.remove(),a=null),a)a.innerHTML="";else{const _="http://www.w3.org/2000/svg",R=l.getBoundingClientRect(),H=document.fullscreenElement===l,z=H?`${R.width}`:`${t.getBoundingClientRect().width}`,q=H?`${R.height}`:"600",rt=document.createElementNS(_,"svg");rt.setAttributeNS(null,"viewBox",`0 0 ${z} ${q}`),rt.setAttributeNS(null,"width","100%"),rt.setAttributeNS(null,"height",q),rt.style.display="block",rt.style.width="100%",rt.style.height=`${q}px`,rt.classList.add("editor-mindmap-svg"),l.appendChild(rt),a=rt}const d=i,p=`editor-mindmap-root-${it(i)}`;W(d,"editor-in-mindmap-first",p,"readonly"),d.contentEditable="false";const A=Qt(i);A&&bt(A)<=bt(s.block)&&sO(A,s.block,["block-hidden",p]);const v=(_,R)=>{if(R.length>0){const H=R[0].parentElement;H&&(H.style.width="100vw",H.style.maxWidth="200px")}R.forEach(H=>{W(H,"editor-mindmap-node")})},B=new pO(a,{...e,autoFit:!0});B.viewHooks.transformHtml.tap(v),B.setData(r),B.fit();const D=te(i);let x=D.querySelector(".mindmap-toolbar");x||(x=k("div",["mindmap-toolbar"],D)),fO(n,x,d,o.mindmapTools),mO(n,x,d,o.mindmapTools),hO(n,x,d,o.mindmapTools),n.domEvents.addEventListener(a,"click",()=>{n.selection.selectBlock(i,0),n.input.focus()}),d.mindMap=B}function AO(n){const t=k("div",["list-to-mindmap-wrap"],null),e=ho("list-to-mindmap",L.t("mindmap.viewAsMindMap"),GR,[],n.clientId);return t.appendChild(e),t}async function m9(n,t){const e=`editor-mindmap-root-${t.id}`,o=nt(t);fe(o).forEach(l=>{xt(l,e)&&ot(l,e,"editor-in-mindmap-first","block-hidden")});const i=te(t);document.fullscreenElement===i&&await h9();const s=i.querySelector(".editor-mindmap-svg");!s||(g(we,s,"no mindmap svg"),s.remove(),n.domEvents.removeAllListeners(s),gO(n,t))}function bO(n){const t=n.classList,e="editor-mindmap-root-";return Array.from(t).find(r=>{if(r.startsWith(e))return r})}async function g9(n,t){!bO(t)||(n.updateBlockData(t,{viewAsMindmap:null}),m9(n,t),n.selection.selectBlock(t,0))}function vO(n,t){const e=t.mindMap;e&&e.fit()}const f0={toMindmap:hf,closeMindmap:g9,fitMindmap:vO},Lnt="";class ff{constructor(t){m(this,"toMindmapButton");m(this,"currentBlock",null);m(this,"handleHoveringBlock",t=>{!this.editor.isWritable()||(t&&Ht(t)&&Zn(t)!=="unchecked"&&Zn(t)!=="checked"?te(t).appendChild(this.toMindmapButton):this.toMindmapButton.remove())});m(this,"handleMouseEnter",()=>{const t=tt(this.toMindmapButton);g(we,t&&Ht(t),"no parent list"),h0(this.editor,t,!0),this.currentBlock=t});m(this,"handleMouseLeave",()=>{this.currentBlock&&(h0(this.editor,this.currentBlock,!1),this.currentBlock=null)});m(this,"handleClick",()=>{const t=tt(this.toMindmapButton);g(we,t&&Ht(t),"no parent list"),hf(this.editor,t,{},{saveData:!0,selectBlock:!0,mindmapTools:f0})});this.editor=t,Ce.get(this.editor).addListener("change",this.handleHoveringBlock),this.toMindmapButton=AO(t),t.domEvents.addEventListener(this.toMindmapButton,"mouseenter",this.handleMouseEnter),t.domEvents.addEventListener(this.toMindmapButton,"mouseleave",this.handleMouseLeave),t.domEvents.addEventListener(this.toMindmapButton,"click",this.handleClick)}static get(t){return t.findCustomByType(ff)}destroy(){Ce.get(this.editor).removeListener("change",this.handleHoveringBlock)}hide(){this.currentBlock&&(this.currentBlock=null),this.toMindmapButton.remove()}}function yO(n,t,e){var o;t==="beginDrag"&&((o=ff.get(n))==null||o.hide())}function hc(n,t,e,o){var i;const r=(i=o==null?void 0:o.groupId)!=null?i:K();t.forEach(s=>{const l=n.getBlockData(s);if(l.start!==e||(o==null?void 0:o.resetGroupId)){const a={...l,start:e};o!=null&&o.resetGroupId&&(a.groupId=r),n.updateBlockData(s,a)}l.textOnly||(e+=1)})}function m0(n,t,e,o){const r=a9(t,{withSelf:!0});r.length!==0&&hc(n,r,e,o)}class mf{constructor(t,e){m(this,"listStart",0);m(this,"listBrother",null);if(this.editor=t,df(e))return;const o=Au(e),r=go(o);this.listStart=r,o===e?this.listBrother=qs(o):this.listBrother=o}fix(){!this.listBrother||m0(this.editor,this.listBrother,this.listStart)}}class Gs{constructor(t,e,o){m(this,"listStart");m(this,"listBrother",null);this.editor=t,this.options=o;const r=Au(e),i=go(r);this.listStart=i,this.listBrother=r,o!=null&&o.resetStart&&(this.listStart=1)}fix(){!this.listBrother||m0(this.editor,this.listBrother,this.listStart,this.options)}}class kO{constructor(t,e,o){m(this,"listStart");m(this,"listNextBrothers",[]);this.editor=t,this.listNextBrothers=uc(e);const{start:r,resetStart:i}=o||{};this.listStart=i?1:r!=null?r:1}fix(){!this.listNextBrothers.length||hc(this.editor,this.listNextBrothers,this.listStart)}}function wO(n,t,e){n.getBlockData(t).quoted&&(e.quoted=!0)}function g0(n,t,e,o){if(we.debug("drag a block on a list block"),!et(n,t))return!1;g(we,Ht(e),"target is not a list block");const{type:r,start:i,level:s,groupId:l}=Gi(e),a=o==="after"?i+1:i,d=n.getBlockData(t),h={id:K(),type:"list",groupId:l,level:s,start:a,text:d.text,...c0(r)};wO(n,e,h);let p=bt(e);const A=nt(e);o==="after"&&(p+=1);let v=null;Ht(t)&&(v=new mf(n,t));const B=n.insertBlock(ct(A),p,h,Ch(h.id,0));return n.deleteBlock(t),new Gs(n,B).fix(),v==null||v.fix(),!0}function BO(n,t,e,o){if(we.debug("drag a list between text blocks"),o==="after"){const d=Qt(e);if(d&&Ht(d))return g0(n,t,d,"before")}if(o==="before"){const d=ce(e);if(d&&Ht(d))return g0(n,t,d,"after")}const i={...n.getBlockData(t),groupId:K(),start:1,level:1};let s=bt(e);const l=nt(e);o==="after"&&(s+=1),n.insertBlock(ct(l),s,i,Ch(i.id,0));const a=new mf(n,t);return n.deleteBlock(t),a.fix(),!0}function EO(n,t,e,o,r){if(Zd(e))return!1;const{blockId:i}=e,s=n.getBlockById(i);g(we,s,"no dragged block");const{isSourceBlock:l,targetBlock:a}=r;return!l&&a?(g(we,t===a,"block !== target block"),g(we,Ht(a),"target is not a list block"),g0(n,s,a,o)):BO(n,s,a,o)}function gf(n){const t=n.getAttribute("block-padding-level");return t?Number(t):null}function xO(n,t){let e;const o=gf(t);if(!o)e=1;else{if(o>=12)return e=12,!1;e=o+1}return n.updateBlockData(t,{...n.getBlockData(t),padding:e}),!0}function p9(n,t){const e=gf(t);if(!e)return!1;const o=n.getBlockData(t);return e>1?(n.updateBlockData(t,{...o,padding:e-1}),!0):(n.updateBlockData(t,{...o,padding:null}),!0)}function p0(n){return n.readonly||!n.isWritable()}function IO(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const o=e.block;et(n,o)&&xO(n,o)}),!0}function TO(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const o=e.block;et(n,o)&&p9(n,o)}),!0}function DO(n){return p0(n)?!1:n.undoManager.runInGroup(()=>(IO(n),!0))}function SO(n){return p0(n)?!1:n.undoManager.runInGroup(()=>(TO(n),!0))}function LO(n){if(p0(n))return!1;if(!n.selection.range.isCollapsed())return;const t=n.selection.focusedBlock;if(!et(n,t))return;const e=n.selection.range.focus;if(!(!e.isSimple()||e.offset!==0||!gf(t)))return p9(n,t),!0}class C0{renderBlock(t,e,o){const{padding:r}=o;return r?{attributes:{"block-padding-level":r}}:{}}}const Mnt="",MO={Tab:DO,"Shift+Tab":SO,Backspace:LO};function RO(n,t,e=1){if(!t)return null;let o=ce(n);for(;o;){const r=o.getAttribute("data-style-heading"),i=Number(o.getAttribute("data-list-level"));if(r){if(r<t)return null;if(r===t&&i===e)return Ht(o)?o:null}o=ce(o)}return null}function OO(n,t){const e=n.getAttribute("data-style-heading"),o=RO(n,e);if(o)return o;const r=ce(n);if(r&&Ht(r)&&Zn(r)===t)return r;const i=Qt(n);return i&&Ht(i)&&Zn(i)===t?i:null}function _O(n,t,e){var D,x,_;const o=(D=e.data)!=null?D:{};let r=1;if(Ht(t))r=vn(t);else{const R=gf(t);R&&(r=R+1),r>8&&(r=8)}const i=(x=o.listType)!=null?x:"ordered";if(i==="text-only")return null;const s=n.getBlockData(t);let l=(_=s.text)!=null?_:[],d=ie(l);const h=e.offset||0;h<=rn(l)&&(l=Tn(l,h).right,d=d.substring(0,h));let p=1;i==="ordered"&&(p=Number.parseInt(d,10)||1);let A=K();const v=OO(t,i);if(v){if(bt(t)>bt(v))p=go(v)+1;else{const H=go(v);H>1&&(p=H-1)}A=ac(v),new kO(n,v,{start:p+1}).fix()}const B={id:K(),type:"list",level:r,start:p,groupId:A,ordered:!1,text:l};return s.quoted&&(B.quoted=!0),s.heading&&(B.heading=s.heading),i==="ordered"?B.ordered=!0:(i==="checked"||i==="unchecked")&&(B.checkbox=i),{blockData:B,onConverted:(R,H)=>{new Gs(R,H).fix()}}}function fc(n){return n.textOnly?"text-only":n.checkbox?n.checkbox:n.ordered?"ordered":"unordered"}function FO(n){var e,o;if(n.checkbox||n.textOnly)return"";const t=(e=n.level)!=null?e:1;return n.ordered?`${KR(t,(o=n.start)!=null?o:1)}.`:XR(t)}function pf(n){return n==="checked"||n==="unchecked"}function C9(n,t,e,o){const r=t,{containerId:i,blockIndex:s}=o[o.length-1];if(s===0)return!0;const l=e.blocks[i][s-1];if(l.type!=="list")return!0;const a=fc(r),d=fc(l);return a!==d&&(!pf(a)||!pf(d))||r.level>l.level}function A9(n,t,e,o){const r=t,{containerId:i,blockIndex:s}=o[o.length-1];if(s===e.blocks[i].length-1)return!0;const l=e.blocks[i][s+1];if(l.type!=="list")return!0;const a=fc(r),d=fc(l);return a!==d&&(!pf(a)||!pf(d))||r.level>l.level}function PO(n,t,e,o,r){var s,l,a;const i=t;if(o==="text")return((s=Dn.convertTo)==null?void 0:s.call(Dn,n,t,e,"text",r))||"";if(o==="markdown"){let d=((l=Dn.convertTo)==null?void 0:l.call(Dn,n,t,e,"markdown",r))||"";i.checkbox==="checked"?d=`[x] ${d}`:i.checkbox==="unchecked"&&(d=`[ ] ${d}`),i.ordered?d=`${i.start}. ${d}`:d=`- ${d}`;const h=i.level||0;return d=(h>0?" ".repeat(h-1):"")+d,C9(n,t,e,r)&&(d=`${d}`),A9(n,t,e,r)&&(d=`${d}`,h<=1&&(d+=`
408
+ `)),d}if(o==="html"){let d=((a=Dn.convertTo)==null?void 0:a.call(Dn,n,t,e,"html",r))||"";d=d.replace("<p>","").replace("</p>",""),i.checkbox==="checked"?d=`<input type="checkbox" checked="checked" disabled="disabled" /> ${d}`:i.checkbox==="unchecked"&&(d=`<input type="checkbox" disabled="disabled" /> ${d}`);let h="ul";return i.ordered?(d=`<li value="${i.start}">${d}</li>`,h="ol"):d=`<li>${d}</li>`,C9(n,t,e,r)&&(d=`<${h}>${d}`),A9(n,t,e,r)&&(d=`${d}</${h}>`),d}return""}function b9(n){const t=k("label",["editor-check-list-wrapper"],null);n&&W(t,"editor-check-list-wrapper-checked");const e=k("span",["editor-check-box"],t);return k("span",["editor-check-box-inner"],e),t}function NO(n,t){const e=fc(t);if(e!=="text-only"){if(e==="checked"){n.append(b9(!0));return}if(e==="unchecked"){n.append(b9(!1));return}n.innerText=FO(t)}}function $O(n){const t=k("div",["list-container"],null),e=k("button",["list-marker"],t);return NO(e,n),t}function v9(n){let t=Qt(n);if(!t)return null;const e=qs(n);for(;t!==e;){if(g(we,t,"no next block"),Ht(t))return vn(t)>vn(n)?t:null;if(t=Qt(t),!t)return null}return null}function A0(n){const t=[];let e=v9(n);if(!e)return t;for(;e;){const o=qs(e);t.push({block:e,children:A0(e)}),e=o}return t}function HO(n){const t=(o,r)=>{r.push(o.block),o.children.forEach(i=>t(i,r))},e=[];return n.forEach(o=>t(o,e)),e}function y9(n,t){return vn(t)!==1}function k9(n,t,e){t.forEach(o=>{const r=n.getBlockData(o.block);n.updateBlockData(o.block,{...r,groupId:e,level:r.level-1}),o.children.length&&k9(n,o.children,r.groupId)})}function b0(n,t){if(!y9(n,t))return!1;const e=vn(t);if(e===1)return!1;let o=K(),r=1,i=Zn(t);const s=e-1,l=a0(t);l&&(o=ac(l),r=go(l)+1,i!=="text-only"&&(i=Zn(l)));const a=A0(t),d=n.getBlockData(t),h={...d,groupId:o,level:s,start:r,...c0(i)};n.updateBlockData(t,h),n.doc.beginBatchUpdate(),k9(n,a,d.groupId),n.doc.endBatchUpdate(),new Gs(n,t).fix();const A=v9(t);return A&&new Gs(n,A,{resetStart:!0,resetGroupId:!0}).fix(),!0}function mc(n,t){Fe(t);const e=n.getBlockData(t),o={id:K(),type:"text",text:e.text};e.heading&&(o.heading=e.heading),e.heading&&(o.heading=e.heading);const r=new mf(n,t),i=nt(t),s=bt(t);n.deleteBlock(t);const l=Ch(o.id,0);if(Ba(n,i)&&!Gt(i)){const a=ye(i);n.insertBlock(ct(i),s,o,l),n.deleteBlock(a)}else n.insertBlock(ct(i),s,o,l);r.fix()}function jO(n){if(!n.selection.range.isCollapsed())return!1;const t=n.selection.focusedBlock;if(!Ht(t))return!1;const e=n.selection.range.focus;return!e.isSimple()||e.offset!==0?!1:vn(t)===1?(mc(n,t),!0):(b0(n,t),!0)}const UO=S("list-block");function zO(n,t,e){g(UO,Ht(t),"not a list block");const o={...n.getBlockData(t),id:K()};return e!=null&&e.level&&(o.level=e.level),e!=null&&e.start&&(o.start=e.start),e!=null&&e.keepText||delete o.text,(o==null?void 0:o.checkbox)==="checked"&&(o.checkbox="unchecked"),o}function VO(n){if(Fe(n),!df(n))return n;let t=Zi(n);for(;t;){if(!df(t))return t;t=Zi(t)}return null}function WO(n,t,e,o){const r=new Gs(n,o),i=go(o)+1;Ql(n,t,e,{forceInsertAfter:!0,newBlockData:zO(n,o,{start:i})}),r.fix()}function qO(n){var s;if(n.selection.range.isCollapsed()){const l=n.selection.focusedBlock;if(Ht(l)&&ut(n,l)===0)return mc(n,l),!0}n.clearSelectedContents();const t=n.selection.focusedBlock;if(!Ht(t))return!1;const e=n.selection.range.focus;if(!e.isSimple())return!1;const o=e.offset,i=(s=o===ut(n,t)?VO(t):t)!=null?s:t;return WO(n,t,o,i),!0}function w9(n){g(we,Ht(n),"not a list block");const{level:t}=Gi(n);let e=ce(n);for(;e;){if(Ht(e)){const{level:o}=Gi(e);if(t===o)return e;if(o<t)return null}e=ce(e)}return null}function B9(n,t){return Fe(t),w9(t)?vn(t)<ZR:!1}function GO(n,t,e){let o=ce(t);g(we,o,"no prev brother");const r=vn(e);for(;o;){if(o===e)return null;if(Ht(o)&&vn(o)===r+1)return o;o=ce(o)}return null}function E9(n,t){if(!B9(n,t))return!1;Fe(t);const e=w9(t);g(we,e,"no list prev brother");const o=e,r=GO(n,t,o),i=vn(o)+1;let s=K(),l=1,a=Zn(t);r&&(s=ac(r),l=go(r)+1,a=Zn(r));const d=A0(t),p={...n.getBlockData(t),groupId:s,level:i,start:l,...c0(a)};return n.updateBlockData(t,p),n.doc.beginBatchUpdate(),HO(d).forEach(v=>{const B=n.getBlockData(v);n.updateBlockData(v,{...B,level:B.level+1})}),n.doc.endBatchUpdate(),!0}function ZO(n,t,e){return t.length===0||!t.every(o=>Ht(o.block))?!1:e==="increase"?B9(n,t[0].block):y9(n,t[0].block)}function x9(n,t,e){if(!ZO(n,t,e))return!1;const o=t[0].block,r=vn(o),i=t.filter(d=>vn(d.block)<=r),s=a9(o,{withSelf:!1}),l=new Set(i.map(d=>d.block)),a=s.filter(d=>!l.has(d));return n.undoManager.runInGroup(()=>{let d=null;a.length>0&&(d=new Gs(n,a[0])),i.forEach(h=>{e==="increase"?E9(n,h.block):b0(n,h.block)}),d==null||d.fix()}),!0}function QO(n,t){return E9(n,t)}function YO(n,t){return b0(n,t)}function JO(n){const t=n.selection.range.getSelectedBlocks();if(t.length>1)return x9(n,t,"increase"),!0;const e=t[0].block;if(!Ht(e))return!1;const o=new mf(n,e);return QO(n,e)&&(o.fix(),new Gs(n,e).fix()),!0}function KO(n){const t=n.selection.range.getSelectedBlocks();if(t.length>1)return x9(n,t,"decrease"),!0;const e=t[0].block;return Ht(e)?(YO(n,e),!0):!1}class XO{constructor(t){this.editor=t}handleBeforeKeyDown(t,e){const o=t.selection.range.getSelectedBlocks();if(o.length===0||!o.some(i=>Ht(i.block)))return!1;switch(e.key){case"Enter":return this.handleEnter(e);case"Backspace":return this.handleBackspace();case"Tab":return this.handleTab(e);default:return!1}}handleEnter(t){const e=this.editor.selection.range.getSelectedBlocks()[0];return!e.block||!Ht(e.block)||or(t,"Shift+Enter")?!1:this.editor.undoManager.runInGroup(()=>qO(this.editor))}handleBackspace(){return this.editor.undoManager.runInGroup(()=>jO(this.editor))}handleTab(t){return or(t,"Shift+Tab")?this.editor.undoManager.runInGroup(()=>KO(this.editor)):this.editor.undoManager.runInGroup(()=>JO(this.editor))}}class t_{constructor(t){m(this,"effectedBlockIds",new Map);m(this,"handleBeforeClearSelection",()=>{this.effectedBlockIds.clear();const t=this.editor.selection.range.getSelectedBlocks();if(t.length===0)return;const e=new Set;t.forEach(r=>{const i=r.block;Ht(i)&&e.add(i)});const o=new Map;Array.from(e.values()).forEach(r=>{var a;const i=Au(r),{start:s}=Gi(i);o.set(it(i),s);const l=(a=tO(r))!=null?a:r;o.set(it(l),s)}),this.effectedBlockIds=o});m(this,"handleAfterClearSelection",()=>{Array.from(this.effectedBlockIds.entries()).forEach(([t,e])=>{const o=this.editor.findBlockById(t);!o||m0(this.editor,o,e)}),this.effectedBlockIds.clear()});this.editor=t,this.editor.addListener("beforeClearSelection",this.handleBeforeClearSelection),this.editor.addListener("afterClearSelection",this.handleAfterClearSelection)}destroy(){this.editor.removeListener("beforeClearSelection",this.handleBeforeClearSelection),this.editor.removeListener("afterClearSelection",this.handleAfterClearSelection)}}const e_=S("customize-list-start-menu");class n_{constructor(t){m(this,"popup");m(this,"block",null);m(this,"show",(t,e)=>{const o=e.querySelector("div.list-container");g(e_,o,"list-block mark does not exist"),this.block=e,this.popup.manualShow(o,{theme:"light"})});m(this,"createDialogContent",()=>{const t=k("div",["customize-start-panel"],null);k("span",["customize-start-panel-title"],t,L.t("list.numberLabel"));const e=this.createNumericInput();t.appendChild(e);const o=k("button",["customize-start-panel-button"],t,L.t("list.confirm"));return this.editor.domEvents.addEventListener(t,"keydown",this.handleKeydown),this.editor.domEvents.addEventListener(o,"click",this.handleOk),t});m(this,"handleDialogShow",()=>{const t=this.block;if(!t)return;const e=this.popup.popupContent,o=e.querySelector("button.customize-start-panel-button"),r=e.querySelector("input.customize-start-panel-input"),i=go(t);!o||!r||requestAnimationFrame(()=>{r.focus(),r.value=String(i)})});m(this,"handleOk",()=>{const e=this.popup.popupContent.querySelector("input.customize-start-panel-input"),o=this.block;if(!o)return;const r=Number(e.value);!r||(this.editor.undoManager.runInGroup(()=>{hc(this.editor,[o,...uc(o)],r,{resetGroupId:!0})}),this.popup.close("clickItem"))});m(this,"handleKeydown",(t,e)=>{const o=e;o.isComposing||(o.key==="Escape"?this.popup.close("cancelBar"):o.key==="Enter"&&this.handleOk())});this.editor=t,this.popup=new ou(this.createDialogContent()),this.popup.on("show",this.handleDialogShow)}destroy(){this.popup.destroy()}createNumericInput(){const t=k("input",["customize-start-panel-input"],null);t.type="number",t.min="1";const e=()=>{const r=t.value.replace(/[^\d]/g,"").replace(/^0+/,""),i=parseInt(r,10);i<=0||Number.isNaN(i)?t.value="":t.value=r};return this.editor.domEvents.addEventListener(t,"input",e),t}}function o_(n,t){return ac(n)===ac(t)}function r_(n,t){const e=l9(t);return e?o_(e,t)?go(e)!==go(t)-1:!0:!1}function i_(n,t){return Zi(t)?!0:go(t)!==1}function s_(n,t){return Fe(t),[{id:"continue-numbering",name:L.t("list.continueList"),states:r_(n,t)?[]:["disabled"]},{id:"start-new-list",name:L.t("list.restartList"),states:i_(n,t)?[]:["disabled"]},{id:"set-numbering-value",name:L.t("list.changeNumber")}]}function l_(n,t,e){var o,r;if(Fe(t),e.id==="continue-numbering"){const i=l9(t);i&&hc(n,[t,...uc(t)],go(i)+1,{resetGroupId:!0,groupId:ac(i)})}if(e.id==="start-new-list"&&n.undoManager.runInGroup(()=>{hc(n,[t,...uc(t)],1,{resetGroupId:!0})}),e.id==="set-numbering-value"){const i=(o=n.options.componentsOptions)==null?void 0:o.list;if((r=i==null?void 0:i.onChangeStart)!=null&&r.call(i,n,t,e))return;n.addCustom("list-customize-start-dialog",()=>new n_(n)).show(n,t)}}class c_{constructor(t){m(this,"menu");m(this,"handleClick",(t,e)=>{const o=Hl(e,"div.list-container");if(o&&this.editor.isWritable()){const r=tt(o);g(we,r,"no parent block"),Fe(r);const i=t.getBlockData(r);if(i&&i.checkbox){t.updateBlockData(r,{...i,checkbox:i.checkbox==="checked"?"unchecked":"checked"});return}if(Zn(r)==="unordered")return;this.menu.updateItems(this.getCommandItems(r)),this.menu.manualShow(o),this.activeList(o,!0)}});m(this,"handleMenuClose",()=>{var e;const t=(e=this.menu.tippyInstance)==null?void 0:e.reference;t&&this.activeList(t,!1)});m(this,"handleMenuClick",(t,e)=>{var r;const o=(r=this.menu.tippyInstance)==null?void 0:r.reference;if(o){const i=tt(o);i&&l_(this.editor,i,e)}});this.editor=t,this.editor.addListener("click",this.handleClick),this.menu=new Us([]),this.menu.addListener("close",this.handleMenuClose),this.menu.addListener("click",this.handleMenuClick)}destroy(){this.editor.removeListener("click",this.handleClick),this.menu.removeListener("close",this.handleMenuClose)}getCommandItems(t){return s_(this.editor,t)}activeList(t,e){const o=tt(t);!o||(e?(W(t,"active"),W(o,"active")):(ot(t,"active"),ot(o,"active")))}}class a_{constructor(t){this.editor=t}handleBeforeKeyDown(t,e){const o=t.selection.range.getSelectedBlocks();if(o.length===0)return!1;const r=o[0].block;if(!Ht(r)||!f9(r))return!1;if(e.key==="ArrowUp"||e.key==="ArrowLeft"){const i=Is(r);return i&&t.selection.selectBlock(i,ut(t,i)),!0}if(e.key==="ArrowDown"||e.key==="ArrowRight"){const i=Ts(r);return i&&t.selection.selectBlock(i,0),!0}return(e.key==="Delete"||e.key==="Backspace"||e.key==="Escape")&&g9(t,r),!0}}function u_(n,t,e,o,r){np(n,"list-block-init",()=>{setTimeout(()=>{n.input.addHandler(new a_(n)),n.input.addHandler(new XO(n)),n.addCustom("list-clear-selection-handler",()=>new t_(n)),n.addCustom("list-marker-menu",()=>new c_(n))})});const i=Dn.createBlockContent(n,t,e,o,r),s=r,{level:l,start:a,groupId:d}=s,h=fc(s);o.setAttribute("data-list-level",`${l}`),o.setAttribute("data-list-start",`${a||1}`),o.setAttribute("data-list-group-id",`${d}`),o.setAttribute("data-list-type",h);const p=$O(s);return o.insertBefore(p,i),s.viewAsMindmap?setTimeout(()=>{const A=n.getBlockById(r.id);A&&hf(n,A,{},{mindmapTools:f0,saveData:!1})}):setTimeout(()=>{const A=n.getBlockById(r.id);A&&m9(n,A)}),i}const d_={list:{confirm:"\u786E\u5B9A",setStart:"\u8BBE\u7F6E\u7F16\u53F7",continueList:"\u7EE7\u7EED\u7F16\u53F7",restartList:"\u5F00\u59CB\u65B0\u5217\u8868",changeNumber:"\u4FEE\u6539\u7F16\u53F7\u503C",numberLabel:"\u7F16\u53F7\u987A\u5E8F",mention:{tooltip:"\u63D0\u53CA\u4EBA\u5458\u5E76\u901A\u77E5"}},mindmap:{viewAsMindMap:"\u663E\u793A\u4E3A\u8111\u56FE",autoFit:"\u81EA\u52A8\u7F29\u653E",fullScreen:"\u5168\u5C4F\u67E5\u770B",close:"\u5173\u95ED",exitFullscreen:"\u9000\u51FA\u5168\u5C4F"}},h_={list:{confirm:"Confirm",setStart:"Set number",continueList:"Continue numbering",restartList:"Start a new list",changeNumber:"Set numbering value",numberLabel:"Numbering order",mention:{tooltip:"Mention and notify users"}},mindmap:{viewAsMindMap:"View as MindMap",autoFit:"Auto zoom",fullScreen:"Full screen",close:"Close",exitFullscreen:"Exit full screen"}},f_={list:{confirm:"OK",setStart:"\u756A\u53F7\u3092\u8A2D\u5B9A",continueList:"\u9023\u756A\u3092\u8A2D\u5B9A",restartList:"\u65B0\u3057\u3044\u30EA\u30B9\u30C8\u3092\u4F5C\u6210",changeNumber:"\u756A\u53F7\u3092\u7DE8\u96C6",numberLabel:"\u756A\u53F7",mention:{tooltip:"\u30E1\u30F3\u30B7\u30E7\u30F3\u304A\u3088\u3073\u901A\u77E5"}},mindmap:{viewAsMindMap:"\u30DE\u30A4\u30F3\u30C9\u30DE\u30C3\u30D7\u3067\u8868\u793A",autoFit:"\u81EA\u52D5\u30D5\u30A3\u30C3\u30C8",fullScreen:"\u5168\u753B\u9762\u8868\u793A\u306E\u30AA\u30F3",close:"\u9589\u3058\u308B",exitFullscreen:"\u5168\u753B\u9762\u8868\u793A\u306E\u30AA\u30D5"}};L.mergeLang({"zh-CN":d_,"en-US":h_,"ja-JP":f_});const Rnt="",I9={...Dn,blockType:"list",createBlockContent:u_,convertFrom:_O,convertTo:PO,handleDrop:EO,notify:yO},v0=S("paragraph");class m_{constructor(t){m(this,"id","BlockParagraphProvider");this.editor=t}isChecked(t,e){return!!(t[e]||t.level&&(t.ordered===!0&&!t.checkbox&&e==="ordered-list"||t.ordered===!1&&!t.checkbox&&e==="unordered-list")||e==="check-list"&&t.checkbox)}getAvailableCommands(t,e){const o=[],r={"unordered-list":[L.t("commands.unordered"),ro("CtrlOrCmd+Shift+L"),gL],"ordered-list":[L.t("commands.ordered"),ro("CtrlOrCmd+Shift+U"),mL],"check-list":[L.t("commands.check"),void 0,pL],link:[L.t("commands.link"),ro("CtrlOrCmd+K"),sv],quoted:[L.t("commands.quote"),void 0,CL]};if(et(t,e)){const i=it(e),s=Dt(e),l=Do(t,e),a=t.getBlockData(e);Object.entries(r).forEach(([d,[h,p,A]])=>{const v=[];if(this.isChecked(a,d)&&v.push("checked"),d==="link"){if(!t.selection.range.isSimple())return;t.selection.range.getSelectedBlocks().length!==1&&v.push("disabled")}o.push({blockId:i,blockType:s,blockKind:l,id:d,name:h,desc:p,states:v,icon:A,groupIndex:600})})}return o}convertLink(t,e,o){g(v0,zr(e.start),""),g(v0,zr(e.start),"");const r="bottom-start",i=e.start.offset,s=e.end.offset,l=(v,B)=>{t.undoManager.runInGroup(()=>{try{const D=t.selection.range.isCollapsed();let x;if(D){x=Wr(t.getBlockText(o),s,v,{link:B}),t.setBlockText(o,x);return}x=mh(t.getBlockText(o),i,s,v),x=Ta(i,v.length,x,"link",B),t.setBlockText(o,x),t.selection.selectBlock(o,i+v.length),t.focus()}catch(D){v0.error(D)}})},a=()=>{t.selection.selectBlock(o,s),t.focus()},d=$r(t,o,e)[0];if(!d)return;const h=Vr(t,o,"link-button-anchor",d),p=t.getBlockText(o),A=Da(p,i);pu(t,{target:h,linkText:t.getSelectedText(),linkUrl:(A==null?void 0:A.link)||"",onFinished:l,onClose:a,placement:r})}convertToList(t,e,o){const r=eh(t,e,"list",{offset:0,data:{listType:o}});r&&t.undoManager.runInGroup(()=>{const i=bt(e),s=nt(e);t.insertBlock(ct(s),i,r.blockData),t.deleteBlock(e),t.focus()})}executeCommand(t,e,o,r){var a;if(!et(t,e))return!1;const i=r.id,s=(a=r.states)==null?void 0:a.includes("checked");let l=!1;if(i==="unordered-list"&&(s?mc(t,e):this.convertToList(t,e,"unordered"),l=!0),i==="ordered-list"&&(s?mc(t,e):this.convertToList(t,e,"ordered"),l=!0),i==="check-list"&&(s?mc(t,e):this.convertToList(t,e,"unchecked"),l=!0),i==="quoted"){const h=t.getBlockData(e).quoted;t.updateBlockData(e,{quoted:h?void 0:!0}),t.focus(),l=!0}if(i==="link"){const d=cf(t);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},1e3),this.convertLink(t,o,e),l=!0}return l}}const g_={left:tu,right:Dp,center:Sp};class p_{constructor(t){m(this,"id","BlockAlignProvider");this.editor=t}applyAlignStyle(t,e,o){Object.keys(g_).includes(o)?t.updateBlockData(e,{align:o}):t.updateBlockData(e,{align:null})}isChecked(t,e){return t.align===e}getAvailableCommands(t,e,o){if(et(t,e)){const r=it(e),i=Dt(e),s=Do(t,e),l=t.getBlockData(e),a=d=>{var p;const h=k("span",["toolbar-item-name-container"],null);for(const A of d.children)if((p=A.states)!=null&&p.includes("checked"))return h.innerHTML=A.icon||tu,h;return h.innerHTML=tu,h};return[{id:"align",name:L.t("commands.alignGroup"),blockId:r,blockType:i,blockKind:s,groupIndex:700,dropdown:!0,element:a,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["align-left"],children:[{id:"align-left",name:L.t("commands.alignLeft"),icon:tu,states:this.isChecked(l,"left")?["checked"]:[]},{id:"align-center",name:L.t("commands.alignCenter"),icon:Sp,states:this.isChecked(l,"center")?["checked"]:[]},{id:"align-right",name:L.t("commands.alignRight"),icon:Dp,states:this.isChecked(l,"right")?["checked"]:[]}],childrenType:"menu"}]}return[]}executeCommand(t,e,o,r){if(!et(t,e))return!1;if(r.id.startsWith("align")){const i=r.id.replace(/^align-/,"");return this.applyAlignStyle(t,e,i),this.editor.focus(),!0}return!1}}function C_(n){const e=n.selection.range;if(e.isCollapsed()||e.start.blockId!==e.end.blockId||!e.start.isSimple()||!e.end.isSimple()||e.end.offset-e.start.offset!==1)return!1;const o=n.getBlockById(e.start.blockId);return La(n,o,e.start.offset).charType==="box"}const A_=S("toolbar-handler"),b_={id:"",name:"",type:"separator"};class gc{constructor(t){m(this,"toolbar");m(this,"toolbarType","object");m(this,"mouseDown",!1);m(this,"oldRange",null);m(this,"hoveringBlock",null);m(this,"hoveringTextChild",null);m(this,"_disableTextToolbar",!1);m(this,"handleButtonClick",(t,e)=>{this.toolbarType==="text"?(this.editor.editorCommandProviders.executeCommand(this.editor.selection.range,e,{}),this.showTextToolbar("click")):this.hoveringBlock&&VR(this.editor,this.hoveringBlock,this.hoveringTextChild,e)});m(this,"handleClose",()=>{Fp(this.editor)&&this.editor.focus()});m(this,"handleClosing",(t,e)=>{if(this.toolbarType==="object"){const o=i5(e);if(this.hoveringBlock===o)return!1}return!0});m(this,"handleDocumentMouseDown",t=>{t.button===0&&(document.addEventListener("mouseup",this.handleDocumentMouseUp),this.mouseDown=!0)});m(this,"handleDocumentMouseUp",()=>{document.removeEventListener("mouseup",this.handleDocumentMouseUp),this.mouseDown=!1,this.handleSelectionChange(this.editor)});m(this,"handleHoveringBlockChildChange",(t,e,o,r)=>{if(!(this.hoveringBlock===t&&this.hoveringTextChild===e)&&(this.hoveringBlock=t,this.hoveringTextChild=e,!(this.toolbar.isVisible&&this.toolbarType==="text"))){if(!t){this.toolbar.close("fromHover");return}this.showObjectToolbar(r)}});m(this,"handleSelectionChange",Le.default(t=>{var o;if(g(A_,t===this.editor,"editor mismatch"),t.selection.range.isCollapsed()||this.mouseDown){if(this.toolbarType==="object"){const r=(o=this.toolbar.tippyInstance)==null?void 0:o.reference,i=this.editor.selection.focusedBlock;if(r&&Xt(r,i))return}this.toolbar.close("selectionChange"),this.oldRange=null;return}if(!this.editor.isWritable()){this.toolbar.close("selectionChange"),this.oldRange=null;return}if(t.selection.range.getSelectedBlocks().length===0){this.toolbar.close("selectionChange"),this.oldRange=null;return}this.oldRange&&this.oldRange.isEqual(t.selection.range)||(this.oldRange=t.selection.range,this.showTextToolbar("selectionChange"))},50));this.editor=t;const e=t.options.componentsOptions.popover;this.toolbar=new ru([],void 0,{tooltipId:t.clientId,id:"editor-toolbar",overflowBoundary:e==null?void 0:e.overflowBoundary,refuseOverflow:!0,padding:20}),this.toolbar.on("click",this.handleButtonClick),this.toolbar.on("close",this.handleClose),this.toolbar.on("closing",this.handleClosing),this.bindEvents(),t.addListener("selectionChanged",this.handleSelectionChange),Ce.get(t).addListener("childChange",this.handleHoveringBlockChildChange),Ce.get(t).addFilter(this),t.editorCommandProviders.registerCommandProvider(new qR(t)),t.editorCommandProviders.registerCommandProvider(new m_(t)),t.editorCommandProviders.registerCommandProvider(new p_(t))}disableTextToolbar(){this._disableTextToolbar=!0}enableTextToolbar(){this._disableTextToolbar=!1}hide(){this.toolbar.close("selectionChange")}destroy(){this.unbindEvents(),this.toolbar.destroy(),this.editor.removeListener("selectionChanged",this.handleSelectionChange),Ce.get(this.editor).removeListener("childChange",this.handleHoveringBlockChildChange)}isInBlock(t,e){return t!==this.hoveringBlock?!1:!!(e.target&&e.target instanceof Node&&this.toolbar.popper&&Xt(this.toolbar.popper,e.target))}bindEvents(){document.addEventListener("mousedown",this.handleDocumentMouseDown)}unbindEvents(){document.removeEventListener("mousedown",this.handleDocumentMouseDown)}update(t){this.showTextToolbar(t)}showTextToolbar(t){var D,x;if(this._disableTextToolbar||!this.editor.isWritable())return;const o=this.editor.selection.range.getSelectedBlocks();if(o.length===0)return;const r=o[0];if(!r)return;if(o.length===1&&Me(r.block)){t==="click"&&this.showObjectToolbar(null);return}if(C_(this.editor))return;if(nt(r.block)===this.editor.rootContainer&&bt(r.block)===0){this.toolbar.close("selectionChange");return}const i=this.editor.editorCommandProviders.getCommands(this.editor.selection.range),s=new Map;i.forEach(_=>{const R=_.groupIndex,H=s.get(R);H?H.push(_):s.set(R,[_])});const l=[[]],a=Array.from(s.entries()).sort((_,R)=>_[0]-R[0]);for(let _=0;_<a.length;_++){const[,R]=a[_];if(R.length===0)continue;let H=l[l.length-1];H.length>0&&H[H.length-1].groupIndex!==R[R.length-1].groupIndex&&(H=[],l.push(H)),H.push(...lf(R))}if(l.length===0){this.toolbar.close("selectionChange");return}this.toolbarType="text";const d=[];if(l.forEach((_,R)=>{const H=_.sort((z,q)=>{var rt,ft;return((rt=z.order)!=null?rt:0)-((ft=q.order)!=null?ft:0)});d.push(...H),R!==l.length-1&&d.push(b_)}),d.length===0){this.toolbar.close("selectionChange");return}this.toolbar.updateItems(d);const h=o[o.length-1],p=!this.editor.selection.range.isReverse()&&h!==r,A=p?h:r,v=FR(this.editor,A),B=Vr(this.editor,A.block,"editor-quick-menu",v);this.toolbar.manualShow(B,{placement:p?"bottom":"top",offset:[0,p?5:10]}),(x=(D=this.toolbar.tippyInstance)==null?void 0:D.popperInstance)==null||x.update()}showObjectToolbar(t){var l,a,d;if(!this.hoveringBlock||this.mouseDown)return;const e=this.hoveringBlock,o=this.hoveringTextChild,{commands:r,element:i}=jR(this.editor,e,o);if(!r.length||!i){this.toolbar.close("fromHover");return}this.toolbarType="object",this.toolbar.isVisible&&((a=(l=this.toolbar)==null?void 0:l.tippyInstance)==null?void 0:a.reference)!==i&&this.toolbar.close("fromHover");const s=()=>{let h;const p=i.getClientRects();if(p.length>1){if(h=o?p[p.length-1]:p[0],t)for(let A=0;A<p.length;A++){const v=p[A],B=new DOMRect(v.x-4,v.y-4,v.width+8,v.height+8);if(B.x<t.clientX&&t.clientX<B.right&&B.y<t.clientY&&t.clientY<B.bottom){h=v;break}}}else{if(h=i.getBoundingClientRect(),o){const A=o.getBoundingClientRect();return new DOMRect(A.x,A.y,A.width,A.height)}return new DOMRect(p[0].x,p[0].y,p[0].width,p[0].height)}if(t){const A=h.y,v=t.clientX;return new DOMRect(v,A,10,h.height)}return h};this.toolbar.updateItems(r),this.toolbar.isVisible||(this.toolbar.manualShow(i,{placement:o?"bottom":"top",getReferenceClientRect:s}),(d=this.toolbar.tippyInstance)!=null&&d.popper&&(this.toolbar.tippyInstance.popper.style.paddingTop="10px",this.toolbar.tippyInstance.popper.style.paddingBottom="5px"))}static register(t){return t.addCustom("toolbar-handler",e=>new gc(e))}static get(t){return t.getCustom("toolbar-handler")}}function Cf(n,t,e){n.getBlockData(t).heading===e?n.updateBlockData(t,{heading:null}):n.updateBlockData(t,{heading:e})}function T9(n,t,e){["left","center","right"].includes(e)?n.updateBlockData(t,{align:e}):n.updateBlockData(t,{align:null})}function y0(n,t){const o=n.getBlockData(t).quoted;n.updateBlockData(t,{quoted:o?void 0:!0})}function k0(n,t){return!!(n[t]||n.level&&(n.ordered===!0&&!n.checkbox&&t==="ordered-list"||n.ordered===!1&&!n.checkbox&&t==="unordered-list")||t==="check-list"&&n.checkbox)}function w0(n,t,e){if(!n.selection.range.focus.isSimple())return;const r=n.getBlockData(t);let i;switch(e){case"unordered-list":i=k0(r,"unordered-list")?void 0:"unordered";break;case"ordered-list":i=k0(r,"ordered-list")?void 0:"ordered";break;case"check-list":i=k0(r,"check-list")?void 0:"unchecked";break}if(i){const s=eh(n,t,"list",{offset:0,data:{listType:i}});s&&n.undoManager.runInGroup(()=>{const l=bt(t),a=nt(t);n.deleteBlock(t),n.insertBlock(ct(a),l,s.blockData)})}else mc(n,t)}const v_=Object.freeze(Object.defineProperty({__proto__:null,applyHeadingStyle:Cf,applyAlignStyle:T9,applyQuoteStyle:y0,applyList:w0},Symbol.toStringTag,{value:"Module"})),y_=[yp,kp,wp,Bp,Ep,xp,Ip,Tp],k_={Unordered:av,Ordered:uv,Checkbox:lv,Quote:cv};function D9(n,t){const e=n;e.blockOptions=t,e.itemType="insert-block",n.children&&n.children.forEach(o=>D9(o,t))}function w_(){return{name:"basic",insertBlockCommandItems:[{id:"text",icon:nu,name:L.t("commands.text"),order:0,group:"basics",value:"text"}]}}function B0(n=1){var r;const t={name:"basic",insertBlockCommandItems:[]};let e=af();e<=4?e=5:e<8&&(e+=1);let o=n;for(;o<=e;){const i=`heading-${o}`;(r=t.insertBlockCommandItems)==null||r.push({id:i,icon:y_[o-1],name:L.t("quickMenu.basic.heading.title",{heading:String(o)}),order:o,group:"basics",value:String(o),subText:An(i)}),o++}return t}function B_(){const n={name:"basic",insertBlockCommandItems:[]};return["Unordered","Ordered","Checkbox","Quote"].forEach((e,o)=>{var i;const r=`insert-${e.toLocaleLowerCase()}`;(i=n.insertBlockCommandItems)==null||i.push({id:r,name:L.t(`quickMenu.basic.${e.toLocaleLowerCase()}`),icon:k_[e],value:e.toLocaleLowerCase(),group:"basics",order:10+o,subText:An(r)})}),n}class S9{constructor(t){this.withPlainText=t}getCommands(){const t=w_(),e=B0(),o=B_();return[...this.withPlainText?t.insertBlockCommandItems||[]:[],...e.insertBlockCommandItems||[],...o.insertBlockCommandItems||[]]}updateBlock(t,e,o,r){const{value:i,id:s}=r;return s.startsWith("heading-")?Cf(t,o,Number.parseInt(i!=null?i:"1",10)||1):i==="ordered"||i==="unordered"||i==="checkbox"?w0(t,o,{ordered:"ordered-list",unordered:"unordered-list",checkbox:"check-list"}[i]):i==="quote"&&y0(t,o),null}async handleUpdateBlockCore(t,e){const o=t.getBlockByIndex(e.containerId,e.blockIndex);return this.updateBlock(t,e.containerId,o,e.item)}async handleInsertEmptyBlockCore(t,e){const{containerId:o,blockIndex:r}=e,i=t.insertTextBlock(void 0,o,r);return this.updateBlock(t,e.containerId,i,e.item)}async executeCommand(t,e,o){if(o.from==="quick-menu"){const r=t.getBlockById(o.blockId),i=t.getParentContainer(r),s=ct(i),l=t.getBlockIndex(r);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:s,blockIndex:l})),t.focus()}else o.from==="block-menu"&&(t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:o.containerId,blockIndex:o.blockIndex})),t.focus());return null}}const L9={basics:100,system:200,common:300,thirdParty:400};class E0{constructor(){m(this,"dataUrl","");m(this,"error",null)}destroy(){}setDataUrl(t){this.error=null,this.dataUrl=t}setError(t){this.dataUrl="",this.error=t}}const E_=S("mathjax-converter"),x_="MathJax-script";async function I_(n){var o;window.MathJax||(window.MathJax={options:{skipHtmlTags:["script","noscript","style","textarea","pre","code","annotation","annotation-xml","body"]}});const t=n.getComponentOptions("mathjax"),e=((o=t==null?void 0:t.cdn)==null?void 0:o.mathjax)||"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js";await bs(e,x_)}function T_(){try{window.MathJax&&window.MathJax.texReset()}catch{}}async function M9(n,t){const e="mathjax2Svg";try{await xo.lock(e),T_(),await I_(n);const o=await window.MathJax.tex2svgPromise(t),r=o.querySelector("merror");if(r)throw new Error(r.textContent);return o.querySelector("svg").outerHTML}catch(o){throw E_.error(o),o}finally{xo.release(e)}}async function R9(n,t){const e=await M9(n,t);return e?await Dm(e,"image/svg+xml"):""}async function x0(n,t){const o=await M9(n,t),r=new File([o],"math.svg");return(await n.doc.uploadResource(r)).resourceId}const O9=S("edit-mathjax");class D_{constructor(){m(this,"editMathjaxPopup",null);m(this,"onChange",null);m(this,"tex","");m(this,"observer",null);m(this,"handleClose",t=>{var o;const e=t.content.querySelector("textarea");if(e){const r=e.value;r!==this.tex&&((o=this.onChange)==null||o.call(this,r,!0))}});m(this,"handleKeyup",t=>{var e;t.isComposing||(t.key==="Escape"&&((e=this.editMathjaxPopup)==null||e.close("cancelBar")),this.handleChange(t.target.value))});m(this,"handleChange",Le.default(t=>{var e;(e=this.onChange)==null||e.call(this,t,!1)},300))}editMathjax(t,e,o){if(!this.editMathjaxPopup)this.editMathjaxPopup=new ou(this.createPopupContent(e));else{const r=this.getTextarea();r.value=e}this.tex=e,this.editMathjaxPopup.manualShow(t,{theme:"light"}),this.editMathjaxPopup.removeAllListeners("close"),this.editMathjaxPopup.addListener("close",this.handleClose),this.onChange=o}createPopupContent(t){const e=k("textarea",["mathjax-editor-textarea"],null);return e.value=t,e.addEventListener("keyup",this.handleKeyup),this.textareaWatcher(e),e}textareaWatcher(t){const e=t;e.onblur=()=>{var r;(r=this.editMathjaxPopup)!=null&&r.isVisible&&t.focus()};const o=()=>{setTimeout(()=>{t.focus()})};this.observer=new IntersectionObserver(o,{}),this.observer.observe(t)}getTextarea(){g(O9,this.editMathjaxPopup,"no exists mathjax editor popup");const t=this.editMathjaxPopup.content.querySelector("textarea");return g(O9,t,"no textarea"),t}destroy(){var t,e;this.onChange=null,(t=this.observer)==null||t.disconnect(),(e=this.editMathjaxPopup)==null||e.removeAllListeners()}}function _9(n,t,e,o){n.addCustom("mathjax-editor",()=>new D_).editMathjax(t,e.trim(),o)}function F9(){return{insert:" ",attributes:{id:K(),box:!0,type:"math",tex:" ",src:"",created:Date.now()}}}function Af(n,t){const e=n.getBoxData(t),o=tt(t);if(!o)return;const r=Os(o,t);n.selection.selectBlock(o,r.start,r.end);const i=async(s,l)=>{if(!s.trim()){n.updateBoxData({...e,tex:s,src:null});return}try{await xo.lock("convertAndUploadMathjax");const a=await x0(n,s);n.updateBoxData({...e,tex:s,src:a})}catch(a){const d=n.getBoxData(t);n.addCustom(`mathjax-box-${d.id}`,()=>new E0).setError(a),n.updateBoxData({...e,tex:s,src:""})}finally{xo.release("convertAndUploadMathjax"),l&&n.focus()}};_9(n,t,e.tex,i)}const P9=S("mathjax-box");function I0(n,t){n.selection.updateSelection(null);const e=t.target;!e||!(e instanceof HTMLElement)||n.domEvents.removeEventListener(e,null,I0)}async function S_(n,t,e){try{if(!t.tex.trim())return;const o=await R9(n,t.tex),r=n.findBoxById(t.id);if(!r)return;const i=$m(r);i.innerHTML="";const s=k("img",["mathjax"],i);s.src=o,e.setDataUrl(o),n.domEvents.addEventListener(s,"load",I0)}catch(o){e.setError(o);const r=n.findBoxById(t.id);if(!r)return;const i=r.querySelector(".mathjax-tex-text");W(i,"mathjax-error"),i.innerText=o.message,n.selection.updateSelection(null)}}function L_(n,t,e,o){const r=o,i=n.addCustom(`mathjax-box-${r.id}`,()=>new E0);if(r.src||i.dataUrl){const a=k("img",["mathjax"],e);a.src=n.doc.buildResourceUrl(r.src||i.dataUrl),n.domEvents.addEventListener(a,"load",I0);return}const s=["mathjax-tex-text"];let l=r.tex;l.trim()?i.error&&(l=i.error.message,s.push("mathjax-error")):l=L.t("mathjax.emptyText"),k("span",s,e,l),S_(n,r,i)}function M_(n,t){const e={id:K(),box:!0,type:"math",tex:t,src:"",created:Date.now()};return x0(n,t).then(o=>{if(!n.findBoxById(e.id))return;const i={...e,src:o};n.updateBoxData(i)}).catch(o=>{P9.error(`failed to convert and upload mathjax: ${JSON.stringify(o)}`)}),e}function R_(n,t,e,o){const r=t;return o==="text"?r.tex:o==="markdown"?` $${r.tex}$ `:r.src?`<img src="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" />`:`<code>$${r.tex}$</code>`}function O_(n,t,e){const o=tt(t);g(P9,o,"failed to get block"),!(n.readonly||!n.isBlockWritable(o))&&Af(n,t)}function __(){return{abstract:L.t("mathjax.abstract")}}const N9={boxType:"math",updateBoxContent:L_,convertFrom:M_,convertTo:R_,handleClickBox:O_,getBoxProperties:__};async function F_(n,t,e){try{const o=t.embedData,r=await R9(n,o.mathjaxText),i=n.findBlockById(t.id);if(!i)return;const s=Lt(i);s.innerHTML="";const l=k("img",["mathjax"],s);l.src=r,e.setDataUrl(r)}catch(o){e.setError(o)}}function P_(n,t){if(n.readonly||!t.target||!(t.target instanceof Node))return;const e=tt(t.target);if(!e||!Me(e)||fn(e)!=="math")return;const o=Lt(e),r=o.querySelector("img")||o.querySelector("span.mathjax-tex-text");if(!r||!Xt(r,t.target))return;const s=n.getBlockData(e).embedData;_9(n,r,s.mathjaxText,async l=>{const a=await x0(n,l),d={mathjaxText:l,src:a};n.updateEmbedData(e,d)})}function N_(n,t,e){const o=e.embedData,r=n.addCustom(`mathjax-block-${e.id}`,()=>new E0);if(n.domEvents.addEventListener(t,"click",P_),!o.mathjaxText.trim()){k("span",["mathjax-tex-text"],t,L.t("mathjax.emptyText"));return}if(o.src||r.dataUrl){const i=k("img",["mathjax"],t);i.src=n.doc.buildResourceUrl(o.src||r.dataUrl);return}r.error,k("span",["mathjax-tex-text"],t,o.mathjaxText),F_(n,e,r)}function $_(n,t,e){if(!et(n,t))return null;const o=n.getBlockString(t).trim();if(!o||!o.startsWith("$$")||!o.endsWith("$$"))return null;const r=Bm(o,"$");if(!r)return null;const i={mathjaxText:r,src:""};return{blockData:{id:K(),type:"embed",embedType:"math",embedData:i}}}function H_(n){return{name:"Mathjax"}}function j_(n,t){var o;const e=Lt(t);n.domEvents.removeAllListeners(e),n.findCustom("mathjax-editor")&&((o=n.getCustom("mathjax-editor").editMathjaxPopup)==null||o.close("cancelBar"))}function U_(n,t,e,o){const r=t.embedData;return o==="html"?`<img src="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" />`:o==="markdown"?`
409
409
  $$${r.mathjaxText}$$
410
- `:r.mathjaxText}function z_(){return{abstract:L.t("mathjax.abstract")}}const V_={embedType:"math",createEmbedContent:N_,getOptions:H_,convertFrom:$_,handleDeleteBlock:j_,convertTo:U_,getBlockProperties:z_},Ont="",W_={mathjax:{emptyText:"\u7A7A\u7684\u516C\u5F0F",abstract:"\u516C\u5F0F"}},q_={mathjax:{emptyText:"Empty formula",abstract:"Formula"}},G_={mathjax:{emptyText:"\u6570\u5F0F\u306A\u3057",abstract:"\u6570\u5F0F"}};L.mergeLang({"zh-CN":W_,"en-US":q_,"ja-JP":G_});function Z_(n,t,e,o){const r=n.getBlockByIndex(t,e),i=n.getBlockText(r),{left:s}=Tn(i,o);if(!ie(s).endsWith("$$$$"))return!1;const a=o-4,d=o,h={id:K(),box:!0,type:"math",tex:" ",src:"",created:Date.now()};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,a,d-a),n.insertBoxToBlock(r,a,h),setTimeout(()=>{const p=n.getBoxById(h.id);Af(n,p)})}),!0}class Q_{handleAfterInsertText(t,e,o,r,i){return!!(i===" "&&Z_(t,e,o,r))}}const pc=S("inline-box-items");function Y_(n,t,e){return n.undoManager.runInGroup(()=>{var s;let o=n.getBlockByIndex(t,e);ae(n,o)||(o=n.insertTextBlock([],t,e));const r=F7();n.setBlockText(o,[r]);const i=(s=r.attributes)==null?void 0:s.id;return g(pc,i,"mathjax box id is empty"),setTimeout(()=>{const l=n.getBoxById(i);Af(n,l)},100),o})}function J_(n,t,e){let o=n.getBlockByIndex(t,e),r="bottom-start";return ae(n,o)||(r="top-start"),pu(n,{target:o,linkText:"",linkUrl:"",onFinished:(l,a)=>{n.undoManager.runInGroup(()=>{try{ae(n,o)||(o=n.insertTextBlock([],t,e));const d=ao(l,{link:a}),h=ao(" ",null),p=[d,h];n.insertTextToBlock(o,0,p),n.selection.selectBlock(o,rn(p)),n.focus()}catch(d){pc.error(d)}})},onClose:()=>{n.focus()},placement:r}),o}function K_(n,t,e){return n.undoManager.runInGroup(()=>{var l;const o=n.getBlockByIndex(t,e),r=n.selection.range;g(pc,zr(r.start),"invalid block position");const i=F7();n.insertBoxToBlock(o,r.start.offset,i.attributes);const s=(l=i.attributes)==null?void 0:l.id;return g(pc,s,"mathjax box id is empty"),setTimeout(()=>{const a=n.getBoxById(s);Af(n,a)},100),o})}function X_(n,t,e){const o=n.getBlockByIndex(t,e),r=n.selection.range;g(pc,zr(r.start),"invalid block position");const i=$r(n,o,r);if(i.length===0)return;const s=i[0],l=Vr(n,o,"quick-menu-inline-link",s);pu(n,{target:l,linkText:"",linkUrl:"",onFinished:(h,p)=>{n.undoManager.runInGroup(()=>{try{const A=n.getBlockText(o),v=Wr(A,r.start.offset,h,{link:p});n.setBlockText(o,v),n.selection.selectBlock(o,r.start.offset+h.length),n.focus()}catch(A){pc.error(A)}})},onClose:()=>{n.focus()},placement:"bottom-start"})}class $7{getCommands(){return[{id:"insert-math",name:L.t("quickMenu.inlineBox.math"),icon:wL,order:900,group:"common",subText:An("insert-math")},{id:"insert-link",name:L.t("quickMenu.inlineBox.link"),icon:sv,order:400,group:"common",subText:An("insert-link")}]}async handleUpdateBlockCore(t,e){switch(e.item.id){case"insert-math":return K_(t,e.containerId,e.blockIndex);case"insert-link":return X_(t,e.containerId,e.blockIndex);default:return null}}async handleInsertEmptyBlockCore(t,e){switch(e.item.id){case"insert-math":return Y_(t,e.containerId,e.blockIndex);case"insert-link":return J_(t,e.containerId,e.blockIndex);default:return null}}async executeCommand(t,e,o){if(o.from==="quick-menu"){const r=t.getBlockById(o.blockId),i=t.getParentContainer(r),s=ct(i),l=t.getBlockIndex(r);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:s,blockIndex:l}))}else o.from==="block-menu"&&t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:o.containerId,blockIndex:o.blockIndex}));return null}}function tF(n,t={withPlainText:!1}){var i,s;const{withPlainText:e}=t,o=(s=(i=n.options.componentsOptions)==null?void 0:i.quickMenu)==null?void 0:s.commandProviders;if(!o)return[];const r=[];return[...o,new S7(e),new $7].forEach(l=>{const a=l.getCommands(n);r.push(...a.map(d=>({...d,itemType:"insert-block",commandProvider:l})))}),r}function eF(n,t={withPlainText:!1}){const e=[];return n.editorBlocks.forEach(o=>{if(!o.getOptions)return;const r=o.getOptions(n);!r.insertBlockCommandItems||(r.insertBlockCommandItems.forEach(i=>{D7(i,r)}),e.push(...r.insertBlockCommandItems))}),e.push(...tF(n,t)),e}function T0(n,t={withPlainText:!1}){const e=eF(n,t),o=new Map;e.forEach(s=>{var d;const l=(d=s.group)!=null?d:"";let a=o.get(l);a?a.items.push(s):(a={group:l,order:s.groupOrder||L7[l]||1e3,items:[s]},o.set(l,a))});const r=Array.from(o.values());r.sort((s,l)=>s.order-l.order),r.forEach(s=>{s.items.sort((l,a)=>{var d,h;return((d=l.order)!=null?d:0)-((h=a.order)!=null?h:0)})});const i=[];return r.forEach((s,l)=>{const a=`blockMenu.section.${s.group||"common"}`,d=L.t(a),h=d===a?s.group:d;i.push({id:`section-${l}`,name:h,type:"section",group:s.group,itemType:"insert-block"}),i.push(...s.items.map(p=>({...p})))}),i}function nF(n,t,e){const o=n.getFocusedBlock();if(!o)return;const r=n.getParentContainer(o),i=ct(r);let l=n.getBlockIndex(o);if(ae(n,o)||(l+=1),t.commandProvider){t.commandProvider.executeCommand(n,t,{from:"quick-menu",...e});return}!t.blockOptions||!t.blockOptions.handleInsertEmptyBlock||t.blockOptions.handleInsertEmptyBlock(n,{containerId:i,blockIndex:l,item:t})}const H7=S("quick-menu"),oF={id:"quick-menu",trigger:["/"]},rF=5;class bf{constructor(t,e=oF){m(this,"suggest");m(this,"items");m(this,"maxHeading");m(this,"firstEmptyOffset",-1);m(this,"queryItems",async(t,e)=>{if(this.items.length===0?this.initMenuItems():this.refreshMenuItems(),e){const o=new Set,r=e.toLocaleLowerCase().replace(/^\s+|\s+$/g,""),i=this.items.filter(s=>{if(s.type==="section")return!0;if(s.name.toLocaleLowerCase().indexOf(r)!==-1||yM(s).toLocaleLowerCase().indexOf(r)!==-1)return o.add(s.group),!0;const l=`blockMenu.section.${s.group||"common"}`,a=L.t(l),d=a===l?s.group:a;return(d==null?void 0:d.toLocaleLowerCase().indexOf(r))!==-1?(o.add(s.group),!0):!1}).filter(s=>s.type==="section"?o.has(s.group):!0);return i.length?this.firstEmptyOffset=-1:this.handleEmptySearch(),i}return this.items});m(this,"onClose",()=>{this.firstEmptyOffset=-1});m(this,"onShow",(t,e,o,r)=>{const i=this.editor.getBlockByIndex(e,o);if(!so(i)){const s=tt(nt(i));if(s&&Dt(s)==="code")return!1}return!0});m(this,"onClickItem",(t,e)=>{const o=e;o.itemType==="insert-block"&&(g(H7,o.blockOptions||o.commandProvider,"invalid quick item, no block options or command provider"),g(H7,this.suggest.anchor,"invalid suggest, no anchor"),this.options.id==="empty-block-menu"&&this.editor.focus(),nF(this.editor,o,this.suggest.anchor))});this.editor=t,this.options=e,this.items=[],this.maxHeading=af(),this.suggest=new Np(t,{id:e.id||"quick-menu",trigger:e.trigger,needSpaceBeforeTrigger:!0,autoDeleteTrigger:!0,highlight:!0,onClose:this.onClose,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems})}get menu(){return this.suggest.menu.menu}destroy(){this.suggest.destroy()}initMenuItems(){const t=T0(this.editor);this.items=t}refreshMenuItems(){let t=null,e=0;const o=af();if(o!==this.maxHeading){const r=new S7,s=r.getCommands().map(l=>({...l,itemType:"insert-block",commandProvider:r}));for(let l=0;l<this.items.length;l++)this.items[l].group==="basics"&&(t||(t=l),t&&e++);t&&e&&this.items.splice(t,e,...s),this.maxHeading=o}}handleEmptySearch(){const t=this.editor.selection.getFocusedPos();if(this.firstEmptyOffset===-1){if(t.isSimple()){const{offset:e}=t;this.firstEmptyOffset=e-1}}else if(t.isSimple()){const{offset:e}=t;e-this.firstEmptyOffset>rF&&(this.suggest.close(),this.firstEmptyOffset=-1)}}}class vf{constructor(t){m(this,"instance");m(this,"mousedown",!1);m(this,"currentInstance",null);m(this,"attributeName",[]);m(this,"attributeDesc","");m(this,"observer",null);m(this,"observerCallback",null);m(this,"createContent",t=>{let e="",o=0;for(;o<this.attributeName.length&&!e;)t.hasAttribute(this.attributeName[o])&&(e=t.getAttribute(this.attributeName[o])||""),o++;const r=t.getAttribute(this.attributeDesc);if(!r)return e;const i=k("div",[],null);return k("span",[],i,e),r&&k("span",["editor-tooltip-desc"],i,r),i});m(this,"handleDocumentMouseDown",()=>{this.mousedown=!0,this.editor.domEvents.addEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleDocumentMouseUp",()=>{this.mousedown=!1,this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleShown",t=>{this.currentInstance&&this.hide(),this.currentInstance=t,this.createObserver()});m(this,"handleHidden",()=>{this.destroyObserver(),this.currentInstance=null});m(this,"handleShow",t=>{var r;const e=t.reference;if(!e||!Xt(document.body,e)||window.isDragging||this.mousedown)return!1;const o=Number.parseInt((r=e.getAttribute("data-tooltip-hide-at"))!=null?r:"",10);if(o&&Date.now()-o<1e3)return!1;if(t.reference){const i={};if(t.reference.hasAttribute("data-editor-tooltip-placement")&&(i.placement=t.reference.getAttribute("data-editor-tooltip-placement")||"top"),t.reference.hasAttribute("data-editor-tooltip-offset-x")||t.reference.hasAttribute("data-editor-tooltip-offset-y")){const s=t.reference.getAttribute("data-editor-tooltip-offset-x"),l=t.reference.getAttribute("data-editor-tooltip-offset-y");i.offset=[s?Number.parseInt(s,10):0,l?Number.parseInt(l,10):0]}if(t.reference.hasAttribute("data-editor-tooltip-maxwidth")&&(i.maxWidth=Number.parseInt(t.reference.getAttribute("data-editor-tooltip-maxwidth")||"350",10)),t.reference.hasAttribute("data-editor-tooltip-allow-markdown")&&(i.allowHTML=!0),Object.keys(i).length&&t.setProps(i),t.reference.hasAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`)){const s=t.reference.getAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`);t.setContent(s||"")}}return!0});this.editor=t;const e=t.clientId;this.attributeName=[`data-editor-tooltip-${e}`,`data-editor-tooltip-${e}-dynamic`,"data-editor-tooltip-common"],this.attributeDesc=`data-editor-tooltip-desc-${e}`,this.instance=dm.delegate(document.body,{theme:"editor-tooltip",maxWidth:400,delay:200,target:this.attributeName.map(o=>`[${o}]`).join(","),content:this.createContent,onShow:this.handleShow,onShown:this.handleShown,onHide:this.handleHidden}),t.domEvents.addEventListener(document,"mousedown",this.handleDocumentMouseDown)}visible(){var t;return(t=this.currentInstance)==null?void 0:t.state.isVisible}hide(){var t;(t=this.currentInstance)!=null&&t.state.isVisible&&this.currentInstance.hide()}destroy(){this.destroyObserver(),this.instance.destroy(),this.editor.domEvents.removeEventListener(document,"mousedown",this.handleDocumentMouseDown),this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)}createObserver(){this.destroyObserver();const t=this.currentInstance;if(!t||!t.reference)return;this.observerCallback=Le.default(()=>{t.reference.closest("body")||(t.hide(),this.destroyObserver())},200),this.observer=new MutationObserver(this.observerCallback);const e=document.body,o={childList:!0,attributes:!1,subtree:!0};this.observer.observe(e,o)}destroyObserver(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observerCallback&&(this.observerCallback.cancel(),this.observerCallback=null)}}const iF={"text/style-bold":"bold","text/style-italic":"italic","text/style-underline":"underline","text/style-strikethrough":"line-through","text/style-code":"code","text/style-sub":"subscript","text/style-super":"superscript"};function sF(n,t){const e=new Set(Object.keys(iF)),o=t.filter(i=>e.has(i.id));return lf(o)}function yf(n,t){if(!n.isWritable())return!1;const e=n.selection.range,o=n.editorCommandProviders.getCommands(e),i=sF(n,o).find(s=>s.id===`text/${t}`);return i?(n.editorCommandProviders.executeCommand(e,i,{}),gc.get(n).update("selectionChange"),!0):!1}const D0={"CtrlOrCmd+B":n=>yf(n,"style-bold"),"CtrlOrCmd+I":n=>yf(n,"style-italic"),"CtrlOrCmd+U":n=>yf(n,"style-underline"),"CtrlOrCmd+D":n=>yf(n,"style-strikethrough")},lF={quickMenu:{basic:{heading:{title:"\u6807\u9898 {heading}",space:"{markdown}\u7A7A\u683C"},unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",checkbox:"\u5F85\u529E\u4E8B\u9879",quote:"\u5F15\u7528"},inlineBox:{math:"\u516C\u5F0F",link:"\u94FE\u63A5"}},link:{textLabel:"\u6587\u672C",urlLabel:"\u94FE\u63A5\u5730\u5740",textPlaceholder:"\u8BF7\u8F93\u5165\u6587\u672C",urlPlaceholder:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740",submitText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",edit:"\u7F16\u8F91",remove:"\u53D6\u6D88\u94FE\u63A5"},commands:{unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",check:"\u5F85\u529E\u5217\u8868",link:"\u94FE\u63A5",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u5BF9\u9F50",alignRight:"\u53F3\u5BF9\u9F50",alignCenter:"\u5C45\u4E2D\u5BF9\u9F50",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u6807\u9898 {name}",headingGroup:"\u6807\u9898\u6837\u5F0F",text:"\u6B63\u6587"}},cF={quickMenu:{basic:{heading:{title:"Title {heading}",space:"{markdown}space"},unordered:"Bulleted list",ordered:"Numbered list",checkbox:"To-do list",quote:"Quote"},inlineBox:{math:"Formula",link:"Link"}},link:{textLabel:"Text",urlLabel:"Link address",textPlaceholder:"Please enter text",urlPlaceholder:"Please enter link",submitText:"Confirm",cancelText:"Cancel",edit:"Edit",remove:"Remove link"},commands:{unordered:"Bulleted list",ordered:"Numberer list",check:"To-do list",link:"Link",quote:"Quote",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Center text",alignGroup:"Alignment",heading:"Title {name}",headingGroup:"Text style",text:"Text"}},aF={quickMenu:{basic:{heading:{title:"\u898B\u51FA\u3057{heading}",space:"{markdown}\u30B9\u30DA\u30FC\u30B9"},unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",checkbox:"\u30D0\u30C3\u30AF\u30ED\u30B0",quote:"\u5F15\u7528"},inlineBox:{math:"\u6570\u5F0F",link:"URL"}},link:{textLabel:"\u30C6\u30AD\u30B9\u30C8",urlLabel:"URL",textPlaceholder:"\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",urlPlaceholder:"URL \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submitText:"OK",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB",edit:"\u7DE8\u96C6",remove:"\u30EA\u30F3\u30AF\u3092\u89E3\u9664"},commands:{unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",check:"\u30D0\u30C3\u30AF\u30ED\u30B0",link:"URL",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u63C3\u3048",alignRight:"\u53F3\u63C3\u3048",alignCenter:"\u4E2D\u592E\u63C3\u3048",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u898B\u51FA\u3057{name}",headingGroup:"\u30BF\u30A4\u30C8\u30EB\u30B9\u30BF\u30A4\u30EB",text:"\u672C\u6587"}};L.mergeLang({"zh-CN":lF,"en-US":cF,"ja-JP":aF});const _nt="";function Zs(n,...t){const e=ho(...t);return e.classList.remove("editor-button"),e.classList.add("editor-text-button"),n.append(e),e}function j7(n){const t=cf(n);t==null||t.hide();const e=n.findCustom("table-border-bar");e==null||e.closeToolbar()}function uF(n){return k("div",["insert-column-button","drop-marker"],n)}const dF=S("row-height");function U7(n){const t=Tt.fromTable(n),e=n.rows;g(dF,e.length===t.rowCount,"row count mismatch");const o=Array(t.rowCount).fill(0);for(let r=0;r<e.length;){let i=1,l=e[r].getBoundingClientRect().height,a=r+1;for(;a<e.length;){const d=e[a];if(d.cells.length!==0)break;i++,a++,l+=d.getBoundingClientRect().height}for(let d=0;d<i;d++)o[r+d]=l/i;r=a}return o}const hF=S("table-border-bar-dom");function z7(n){var a;const t=tt(n.contentElement);g(hF,t,"no block");const o=te(t).querySelector(".table-border-bar-container.left"),i=Lt(t).offsetLeft-ic,s=((a=n.scrollOptions.paddingLeft)!=null?a:0)+i,l=Math.min(n.contentElement.offsetLeft-i,n.rootElement.scrollLeft-s);o&&(o.style.left=`${-l}px`)}const Qi=S("table-border-bar-dom");function Cc(n,t){g(Qi,Ve(t),"invalid table block");const e=_e(t),o=gr(n,t),r=te(t),i=(p,A,v)=>{const B=k("div",["button-root",A],p),D=k("div",["button-container",A],B);B.setAttribute(`data-${A}-index`,`${v}`),D.setAttribute(`data-editor-tooltip-${n.clientId}`,A==="left"?L.t("table.insertRow"):L.t("table.insertCol")),k("span",["insert-indicator"],D),uF(D)},{selectedRows:s,selectedColumns:l}=Hp(n,t),a=()=>{const p=o.querySelector(".table-border-bar-container.top");g(Qi,p,"no top border bar container");const A=k("div",["table-border-bar-container","top"],null),v=k("div",["table-border-bar","top"],A),B=vR(e),x=Tt.fromTable(e).colCount;n.selection.range.isSimple()&&i(v,"top",0);for(let _=0;_<x;_++){const R=_===x-1?B[_]+2:B[_],H=k("span",["table-border-bar-cell","top"],v);l.has(_)&&H.classList.add("selected"),H.setAttribute("data-top-index",`${_}`),H.style.width=`${R}px`,n.selection.range.isSimple()&&i(v,"top",_+1)}Ca(p,A)},d=()=>{const p=r.querySelector(".table-border-bar-container.left");g(Qi,p,"no left border bar container");const A=k("div",["table-border-bar-container","left"],null),v=k("div",["table-border-bar","left"],A);k("span",["table-border-bar-cell","corner"],v);const B=U7(e);n.selection.range.isSimple()&&i(v,"left",0),Array.from(e.rows).forEach((D,x,_)=>{const R=k("span",["table-border-bar-cell","left"],v);s.has(x)&&R.classList.add("selected"),R.setAttribute("data-left-index",`${x}`);const H=x===_.length-1?B[x]+2:B[x];R.style.height=`${H}px`,n.selection.range.isSimple()&&i(v,"left",x+1)}),Ca(p,A)};a(),d();const h=n.findCustom(mr(t));h&&z7(h)}function V7(n,t){const e=t.target;if(!(e instanceof Element))return;const o=tt(e);g(Qi,o&&Ve(o),"invalid table block"),Cc(n,o),n.selection.caret.update()}function kf(n,t){const e=t.target;if(!(e instanceof Element))return;const o=tt(e);g(Qi,o&&Ve(o),"invalid table block");const r=e.closest(".button-root");if(r){if(r.classList.contains("top")){const i=parseInt(r.getAttribute("data-top-index")||"0",10);Xv(n,o,i),Cc(n,o)}else if(r.classList.contains("left")){const i=parseInt(r.getAttribute("data-left-index")||"0",10);t7(n,o,i),Cc(n,o)}}}function wf(n,t){var s;j7(n),t.preventDefault(),t.stopPropagation();let e=null,o,r;const i=l=>{var a;if(l.target instanceof HTMLElement&&o&&e&&r!==void 0){const d=tt(l.target),h=l.target.closest(".table-border-bar");if(d===e&&h){const p=parseInt((a=l.target.getAttribute(`data-${o}-index`))!=null?a:"0",10),A=Math.min(r,p),v=Math.abs(r-p)+1;xt(l.target,"top")&&o==="top"?OR(n,d,A,v,{reverse:!0}):xt(l.target,"left")&&o==="left"&&_R(n,d,A,v,{reverse:!0})}}l.type==="mouseup"&&(e=null,r=void 0,o=void 0,document.body.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",i))};t.target instanceof HTMLElement&&xt(t.target,"table-border-bar-cell")&&(e=tt(t.target),xt(t.target,"top")?o="top":xt(t.target,"left")&&(o="left"),o&&e&&(r=parseInt((s=t.target.getAttribute(`data-${o}-index`))!=null?s:"0",10),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",i)))}function W7(n){const t=n.selection.range,e=lu(n,t);e&&Cc(n,e)}function fF(n,t){g(Qi,Ve(t),"invalid table block");const e=gr(n,t),o=te(t),r=k("div",["table-border-bar-container","top"],e),i=k("div",["table-border-bar-container","left"],o);Cc(n,t),n.domEvents.addEventListener(Lt(t),"scroll",V7),n.domEvents.addEventListener(r,"click",kf),n.domEvents.addEventListener(i,"click",kf),n.domEvents.addEventListener(r,"mousedown",wf),n.domEvents.addEventListener(i,"mousedown",wf),n.addListener("afterClearSelection",W7)}function q7(n,t){if(!n.isWritable())return;if(gr(n,t).querySelector(".table-border-bar-container")){Cc(n,t);return}fF(n,t)}function G7(n,t){g(Qi,Ve(t),"invalid table block");const e=gr(n,t),o=te(t),r=e.querySelectorAll(".table-border-bar-container"),i=o.querySelectorAll(".table-border-bar-container");r.forEach(s=>{n.domEvents.removeEventListener(s,"click",kf),n.domEvents.removeEventListener(s,"mousedown",wf),s.remove()}),i.forEach(s=>{n.domEvents.removeEventListener(s,"click",kf),n.domEvents.removeEventListener(s,"mousedown",wf),s.remove()}),n.domEvents.removeEventListener(Lt(t),"scroll",V7),n.addListener("afterClearSelection",W7)}function mF(n,t){g(Qi,Ve(t),"invalid table block");const o=gr(n,t).querySelector(".table-border-bar-container.top");return o?o.getBoundingClientRect().height:0}class gF{constructor(t,e){m(this,"toolbar");m(this,"handleSelectionChange",(t,e)=>{!t.isVisible||(e==="delete-columns"?(Vi(this.editor,this.tableBlock,!0,!0),Wi(this.editor,this.tableBlock,!0,!0)):e==="delete-rows"?(Vi(this.editor,this.tableBlock,!0,!1),Wi(this.editor,this.tableBlock,!0,!1)):(Vi(this.editor,this.tableBlock,!1),Wi(this.editor,this.tableBlock,!1)))});m(this,"handleClick",(t,e,o)=>{e.id==="delete-columns"?jp(this.editor.selection.range):e.id==="delete-rows"&&Up(this.editor.selection.range)});m(this,"handleToolbarClose",()=>{this.tableBlock&&lu(this.editor,this.editor.selection.range)===this.tableBlock&&(Vi(this.editor,this.tableBlock,!1),Wi(this.editor,this.tableBlock,!1))});this.editor=t,this.tableBlock=e;const o=t.options.componentsOptions.popover;this.toolbar=new ru([],void 0,{id:"table-row-column-toolbar",overflowBoundary:o==null?void 0:o.overflowBoundary,refuseOverflow:!0,tooltipId:this.editor.clientId}),this.toolbar.addListener("selectionChange",this.handleSelectionChange),this.toolbar.addListener("click",this.handleClick),this.toolbar.addListener("close",this.handleToolbarClose)}close(){this.toolbar.close("cancelBar")}update(){var r,i,s;const{selectedColumns:t,selectedRows:e}=Hp(this.editor,this.tableBlock);if(!this.editor.isWritable())return;if(t.size>0&&e.size>0){this.toolbar.close("cancelBar");return}if(t.size===0&&e.size===0){this.toolbar.close("cancelBar");return}const o=$r(this.editor,this.tableBlock,this.editor.selection.range)[0];if(!o){this.toolbar.close("cancelBar");return}if(t.size>0){const l={id:"delete-columns",name:L.t("table.deleteCol"),icon:uL};this.toolbar.updateItems([l]);const a=Vr(this.editor,this.tableBlock,"table-row-column-delete",o);this.toolbar.manualShow(a,{placement:"top",offset:[0,5]})}else{const l={id:"delete-rows",name:L.t("table.deleteRow"),icon:aL};this.toolbar.updateItems([l]);const h=te(this.tableBlock).querySelector(".table-border-bar-container.left").getBoundingClientRect(),p=new DOMRect(Math.max(h.left,o.left-ic),o.top,ic,o.height),A=Vr(this.editor,this.tableBlock,"table-row-column-delete",p);this.toolbar.manualShow(A,{placement:"left",offset:[0,5]});const v=this.editor.options.componentsOptions.popover;(r=this.toolbar.tippyInstance)==null||r.setProps({popperOptions:{modifiers:[{name:"flip",options:{boundary:v==null?void 0:v.overflowBoundary,fallbackPlacements:["left","right"]}}]}})}(s=(i=this.toolbar.tippyInstance)==null?void 0:i.popperInstance)==null||s.update()}destroy(){this.toolbar.destroy(),this.toolbar.removeAllListeners()}}const S0=S("table-border-bar");class pF{constructor(t,e){m(this,"toolbar");m(this,"resizeObserver");m(this,"handleReadonlyChanged",t=>{t.isWritable()?this.update():G7(this.editor,this.tableBlock)});m(this,"handleBlockUpdated",()=>{this.resizeObserver.disconnect(),setTimeout(()=>{const t=this.editor.getBlockById(it(this.tableBlock));this.resizeObserver.observe(_e(t))})});m(this,"handleScroll",()=>{var t;(t=this.toolbar)==null||t.update()});m(this,"handleTableResize",()=>{!this.editor.isWritable()||(console.log("resize"),this.update())});this.editor=t,this.tableBlock=e,g(S0,this.tableBlock,"no table block"),S0.debug("create table border bar"),q7(this.editor,this.tableBlock),this.resizeObserver=new ResizeObserver(this.handleTableResize),this.resizeObserver.observe(_e(this.tableBlock));const o=t.getComponentOptions("table");o!=null&&o.hideToolbar||(this.toolbar=new gF(this.editor,this.tableBlock)),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}close(){var t;(t=this.toolbar)==null||t.close()}destroy(){var t;S0.debug("destroy table border bar"),this.resizeObserver.disconnect(),G7(this.editor,this.tableBlock),(t=this.toolbar)==null||t.destroy(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}update(){var t;q7(this.editor,this.tableBlock),(t=this.toolbar)==null||t.update()}}const CF=S("table-border-bar");class AF{constructor(t){m(this,"activeTableBar",null);m(this,"handleBlockDeleted",(t,e)=>{!this.activeTableBar||(e===this.activeTableBar.tableBlock||Xt(e,this.activeTableBar.tableBlock))&&(this.activeTableBar.destroy(),this.activeTableBar=null)});m(this,"handleSelectionChanged",t=>{var r;const e=t.selection.range,o=lu(t,e);((r=this.activeTableBar)==null?void 0:r.tableBlock)!==o&&this.activeTableBar&&this.hide(),o&&this.show(o)});m(this,"handleScroll",()=>{var t;(t=this.activeTableBar)==null||t.handleScroll()});this.editor=t,this.editor.addListener("blockDeleted",this.handleBlockDeleted),this.editor.addListener("selectionChanged",this.handleSelectionChanged)}destroy(){this.editor.removeListener("blockDeleted",this.handleBlockDeleted),this.editor.removeListener("selectionChanged",this.handleSelectionChanged)}show(t){this.activeTableBar?(this.activeTableBar.tableBlock!==t&&this.hide(),this.activeTableBar.update()):this.activeTableBar=new pF(this.editor,t)}update(){var t;(t=this.activeTableBar)==null||t.handleBlockUpdated()}closeToolbar(){var t;(t=this.activeTableBar)==null||t.close()}hide(){!this.activeTableBar||(g(CF,this.activeTableBar,"no active table bar"),this.activeTableBar.destroy(),this.activeTableBar=null)}}function Z7(n,t){const e=n.addCustom("table-border-bar",o=>new AF(o));t==="update"&&e.update()}const Mn=S("table-cell-menu"),bF="style-bg-color-";class vF{constructor(t){m(this,"activeTableBlock",null);m(this,"targetButton",null);m(this,"manualMenu",null);m(this,"colorPaletteItem",null);m(this,"handlePrevent",(t,e)=>{e.stopPropagation()});m(this,"handleReadonlyChanged",t=>{t.isWritable()||this.hide()});m(this,"handleSelectionChanged",t=>{const e=t.selection.range,o=lu(t,e);if(this.hide(),this.activeTableBlock!==o&&(this.activeTableBlock=o),this.activeTableBlock){const r=Tt.fromBlock(this.activeTableBlock),i=e.isReverse()?e.start:e.end;let s=null;i instanceof Mo?t.getBlockById(i.blockId)===this.activeTableBlock?s=r.getCellByContainerId(i.childContainerId):s=this.getCellByChildBlockId(r,i.blockId):i.blockId!==this.activeTableBlock.id&&(s=this.getCellByChildBlockId(r,i.blockId)),s&&this.editor.isWritable()&&this.showCellMenuButton(s)}});m(this,"handleBeforePopupPalette",()=>{var e;const t=this.getSelectedBkgColorIndex();(e=this.colorPaletteItem)==null||e.palette.setColor("backgroundColor",t)});m(this,"createBkgColorItem",()=>{const t=k("div",["cell-background-color-item"],null);k("span",[],t,L.t("table.cellBackground"));const e=this.getSelectedBkgColorIndex();k("button",["item-button"],t).setAttribute("data-color-index",`${e}`);const r=k("span",["item-sub-indicator"],t);return r.innerHTML=ev,t});m(this,"handleCommand",t=>{var r;g(Mn,this.activeTableBlock,"no target table block");const e=((r=t.states)==null?void 0:r.includes("checked"))||!1,o=t.value;switch(t.id){case"delete-select-row":Up(Ov(this.editor,this.activeTableBlock,!1));break;case"delete-select-col":jp(Ov(this.editor,this.activeTableBlock,!0));break;case"merge-cell":Lv(this.editor.selection.range);break;case"split-cell":this.handleSplitCell();break;case"row-title":this.handleRowTitle(e);break;case"col-title":this.handleColTitle(e);break;case"stripe-style":this.handleStripeStyle(e);break;case"hide-border":UM(this.editor,this.activeTableBlock,o==="show-border");break;case"show-chart":GM(this.editor,this.activeTableBlock,o==="show-chart"),Jp(this.editor,this.activeTableBlock,{updateNow:!0});break}});m(this,"handleToolbarClose",()=>{this.targetButton&&ot(this.targetButton,"active"),this.activeTableBlock&&lu(this.editor,this.editor.selection.range)===this.activeTableBlock&&(Vi(this.editor,this.activeTableBlock,!1),Wi(this.editor,this.activeTableBlock,!1)),this.editor.focus()});m(this,"handleSelectionChange",(t,e)=>{!t.isVisible||(g(Mn,this.activeTableBlock,"no target table block"),e==="cell-background-color"&&this.handleBeforePopupPalette(),e==="delete-select-row"?(Vi(this.editor,this.activeTableBlock,!0,!1),Wi(this.editor,this.activeTableBlock,!0,!1)):e==="delete-select-col"?(Vi(this.editor,this.activeTableBlock,!0,!0),Wi(this.editor,this.activeTableBlock,!0,!0)):(Vi(this.editor,this.activeTableBlock,!1),Wi(this.editor,this.activeTableBlock,!1)))});m(this,"handleClick",(t,e)=>{var o;g(Mn,this.activeTableBlock,"no target table block"),g(Mn,this.targetButton,"no target button"),j7(this.editor),xt(this.targetButton,"active")?(ot(this.targetButton,"active"),(o=this.manualMenu)==null||o.close("clickItem")):(W(this.targetButton,"active"),this.manualMenu?this.manualMenu.updateItems(this.createCommandMenu()):(this.manualMenu=new Us(this.createCommandMenu()),this.manualMenu.on("click",(r,i)=>{var s;this.handleCommand(i),(s=this.manualMenu)==null||s.close("clickItem")}),this.manualMenu.on("selectionChange",this.handleSelectionChange),this.manualMenu.on("close",this.handleToolbarClose)),this.manualMenu.manualShow(this.targetButton,{placement:"right-start"})),e.stopPropagation()});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}destroy(){var t,e;this.activeTableBlock=null,this.targetButton=null,this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged),(t=this.manualMenu)==null||t.destroy(),(e=this.colorPaletteItem)==null||e.destroy()}hide(){var t;(t=this.manualMenu)==null||t.close("cancelBar"),this.targetButton&&(ot(this.targetButton,"active"),this.targetButton.style.display="none")}getCellByChildBlockId(t,e){let o=this.editor.getBlockById(e);for(;o;){const r=o.closest("td");g(Mn,r,"no parent cell");const i=tt(r);if(g(Mn,i,"no parent block"),_e(i)===t.table)return t.getCellByCellElement(r);o=i}return g(Mn,!1,"filed to get cell by child block id"),null}createTargetButton(t){this.targetButton?t.querySelector(`:scope > .${Gp}`)||t.appendChild(this.targetButton):(this.targetButton=k("button",[Gp],t),this.targetButton.innerHTML=Qh,this.editor.domEvents.addEventListener(this.targetButton,"click",this.handleClick),this.editor.domEvents.addEventListener(this.targetButton,"mousedown",this.handlePrevent),this.editor.domEvents.addEventListener(this.targetButton,"dblclick",this.handlePrevent))}showCellMenuButton(t){this.createTargetButton(t.cell),g(Mn,this.targetButton,"no target button"),this.targetButton.style.display="inline-block"}handleSplitCell(){if(this.activeTableBlock){const t=Tt.fromBlock(this.activeTableBlock),e=this.editor.selection.range;if(e.isSimple()){const{col:o,row:r}=this.getCellByChildBlockId(t,e.start.blockId);Vp(this.editor,this.activeTableBlock,{col:o,row:r})}else Wp(this.editor.selection.range)}}getSelectedBkgColorIndex(){var r;g(Mn,this.activeTableBlock,"no target table block");const t=WM(this.editor,this.activeTableBlock),e=this.editor.getBlockData(this.activeTableBlock),o=new Set;for(const i of t){if(o.size>1)break;const s=ct(i),l=e[`${s}_background`];if(l)o.add(Number.parseInt((r=l.substring(bF.length))!=null?r:"0",10));else{o.add(-1);break}}return o.size===1&&[...o][0]!==-1?[...o][0]:-1}createCommandMenu(){g(Mn,this.activeTableBlock,"no target table block");const t=this.editor.getBlockData(this.activeTableBlock),e=Sv(this.editor,this.activeTableBlock,this.editor.selection.range);let o=this.editor.selection.range;if(o.isSimple()){const h=Kr(this.editor,this.activeTableBlock,o.start);o=Ue(this.editor,{anchor:h,focus:h})}const r=Dv(this.editor,this.activeTableBlock,o),i=t.hasRowTitle,s=t.hasColTitle,l=t.isStripeStyle,a=t.noBorder,d=t.chart;return this.colorPaletteItem=new wv("cell-background-color",{color:!1}),this.colorPaletteItem.palette.on("onClick",(h,p)=>{var A;switch(g(Mn,this.activeTableBlock,"no target table block"),h){case"clearColor":Pv(this.editor,this.activeTableBlock,-1);break;case"backgroundColor":Pv(this.editor,this.activeTableBlock,p);break}(A=this.manualMenu)==null||A.close("clickItem")}),[{id:"cell-background-color",name:L.t("table.cellBackground"),element:this.createBkgColorItem(),children:[this.colorPaletteItem]},{id:"separator",name:"",type:"separator"},{id:"merge-cell",name:L.t("table.mergeCell"),states:e?[]:["disabled"]},{id:"split-cell",name:L.t("table.splitCell"),states:r?[]:["disabled"]},{id:"separator",name:"",type:"separator"},{id:"delete-select-row",name:L.t("table.deleteSelectRow")},{id:"delete-select-col",name:L.t("table.deleteSelectCol")},{id:"separator",name:"",type:"separator"},{id:"table-config",name:L.t("table.tableConfigKey"),children:[{id:"row-title",name:L.t("table.tableConfig.rowTitle"),states:i?["checked"]:[]},{id:"col-title",name:L.t("table.tableConfig.colTitle"),states:s?["checked"]:[]},{id:"stripe-style",name:L.t("table.tableConfig.stripeStyle"),states:l?["checked"]:[]},{id:"hide-border",name:a?L.t("table.tableConfig.showBorder"):L.t("table.tableConfig.hideBorder"),value:a?"show-border":"hide-border"},{id:"show-chart",name:d?L.t("table.tableConfig.hideChart"):L.t("table.tableConfig.showChart"),value:d?"hide-chart":"show-chart"}]}]}handleRowTitle(t){g(Mn,this.activeTableBlock,"no target table block"),t?$M(this.editor,this.activeTableBlock):NM(this.editor,this.activeTableBlock)}handleColTitle(t){g(Mn,this.activeTableBlock,"no target table block"),t?PM(this.editor,this.activeTableBlock):FM(this.editor,this.activeTableBlock)}handleStripeStyle(t){g(Mn,this.activeTableBlock,"no target table block"),t?jM(this.editor,this.activeTableBlock):HM(this.editor,this.activeTableBlock)}}function Q7(n){n.addCustom("table-cell-menu",t=>new vF(t))}const Bf=S("table-container");function L0(n){const t=n.closest("td");return g(Bf,t,"no parent cell for a table cell container"),t}function Y7(n){const t=_e(n);return Array.from(t.querySelectorAll(':scope > tbody > tr > td > [data-type="editor-container"].child'))}function M0(n,t,e,o){const r=Tt.fromBlock(n),i=r.getCellByContainerId(ct(t));if(e==="ArrowDown"){const s=r.getBottomCell(i);return s?s.container:null}if(e==="ArrowUp"){const s=r.getTopCell(i);return s?s.container:null}if(e==="ArrowLeft"){const s=r.getAllContainers(),l=s.indexOf(t);if(g(Bf,l>=0,"not a valid child container"),l===0)return null;const a=s[l-1];return o!=null&&o.noWrap&&r.getCellByContainerId(ct(a)).row!==i.row?null:a}if(e==="ArrowRight"){const s=r.getAllContainers(),l=s.indexOf(t);if(g(Bf,l>=0,"not a valid child container"),l===s.length-1)return null;const a=s[l+1];return o!=null&&o.noWrap&&r.getCellByContainerId(ct(a)).row!==i.row?null:a}g(Bf,!1,`invalid navigation type: ${e}`)}const yF=12,kF=90,Ef=23,J7=2;class wF{constructor(t){m(this,"scrollTableBlock",null);m(this,"autoScrollDir",null);m(this,"autoScrollTimer",null);m(this,"handleMouseDown",t=>{const e=document.elementFromPoint(t.clientX,t.clientY);if(e&&e instanceof HTMLElement){const o=tt(e);if(o&&Xt(this.editor.rootContainer,o)){const r=Jr(o);r&&(this.scrollTableBlock=r,document.addEventListener("mousemove",this.handleAutoScroll))}}});m(this,"handleAutoScroll",UB.default(t=>{if(this.scrollTableBlock){const e=this.editor.getCustom(mr(this.scrollTableBlock)),o=e.rootElement,r=e.scrollOptions.parentContainer,i=o.getBoundingClientRect(),s=window.innerHeight-this.getBarFloatWindowBottom(e),l=r.getBoundingClientRect(),a=Math.min(l.bottom,s),d=Math.max(l.top,0);i.bottom>a&&t.clientY>=a?this.setAutoScroll("bottom"):i.top<d&&t.clientY<=d?this.setAutoScroll("top"):o.scrollLeft>0&&t.clientX<i.left?this.setAutoScroll("left"):o.scrollLeft<o.scrollWidth-o.offsetWidth&&t.clientX>i.right?this.setAutoScroll("right"):this.clearAutoScroll()}},15));m(this,"handleMouseUp",()=>{document.removeEventListener("mousemove",this.handleAutoScroll),setTimeout(()=>{this.scrollTableBlock=null})});m(this,"handleSelectionChanged",t=>{const e=t.selection.range;if(e.isCollapsed()&&e.isSimple()){const o=t.getBlockById(e.start.blockId),r=Jr(o);if(r){const i=t.getCustom(mr(r)),s=i.rootElement.getBoundingClientRect(),l=So(t,o,e.start);if(s.left>l.left){const a=e.start.offset===0?yF:J7;i.rootElement.scrollLeft-=s.left-l.left+a}else if(l.right>s.right){const a=e.start.offset===0?kF:J7;i.rootElement.scrollLeft+=l.right-s.right+a}}}else{const o=t.getBlockById(e.start.blockId),r=Jr(o),i=t.getBlockById(e.end.blockId),s=Jr(i);if(r&&r===s){const l=t.getCustom(mr(r)),a=l.rootElement.getBoundingClientRect();let d=null;if(e.isSimple())d=e.isReverse()?So(t,o,e.start):So(t,i,e.end);else{const h=L0(Ur(t,e.start.childContainerId)),p=L0(Ur(t,e.end.childContainerId));d=e.isReverse()?h.getBoundingClientRect():p.getBoundingClientRect()}a.left>d.left&&e.isReverse()?l.rootElement.scrollLeft-=a.left-d.left:a.right<d.right&&!e.isReverse()&&(l.rootElement.scrollLeft+=d.right-a.right)}}});m(this,"handleScroll",t=>{xv(t),this.editor.selection.caret.update()});m(this,"handleReset",t=>{xv(t),this.editor.selection.caret.update();const e=this.editor.findCustom("table-border-bar");e&&e.handleScroll(),z7(t)});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),document.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mouseup",this.handleMouseUp)}getBarFloatWindowBottom(t){return t.scrollOptions.barFloatWindowBottom?typeof t.scrollOptions.barFloatWindowBottom=="number"?t.scrollOptions.barFloatWindowBottom:t.scrollOptions.barFloatWindowBottom():0}clearAutoScroll(){this.autoScrollTimer&&(clearInterval(this.autoScrollTimer),this.autoScrollTimer=null,this.autoScrollDir=null)}setAutoScroll(t){this.autoScrollDir&&this.autoScrollDir!==t&&this.clearAutoScroll(),this.autoScrollTimer||(this.autoScrollDir=t,this.autoScrollTimer=window.setInterval(()=>{if(this.scrollTableBlock){const e=this.editor.getCustom(mr(this.scrollTableBlock)),o=e.rootElement,r=e.scrollOptions.parentContainer,i=o.getBoundingClientRect(),s=r===document.documentElement?window.innerHeight:r.offsetHeight,l=window.innerHeight-this.getBarFloatWindowBottom(e),a=r.getBoundingClientRect(),d=Math.min(a.bottom,l),h=Math.max(a.top,0);this.autoScrollDir==="left"&&(o.scrollLeft-=Ef,o.scrollLeft<=0&&this.clearAutoScroll()),this.autoScrollDir==="right"&&(o.scrollLeft+=Ef,o.scrollLeft>=o.scrollWidth-o.offsetWidth&&this.clearAutoScroll()),this.autoScrollDir==="bottom"&&(r.scrollTop+=Ef,(r.scrollTop>=r.scrollHeight-s||i.bottom<=d)&&this.clearAutoScroll()),this.autoScrollDir==="top"&&(r.scrollTop-=Ef,(r.scrollTop<=0||i.top>=h)&&this.clearAutoScroll())}},100))}destroy(){document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mouseup",this.handleMouseUp),this.editor.removeListener("selectionChanged",this.handleSelectionChanged)}}function K7(n){return n.addCustom("table-scroll-events",t=>new wF(t))}const pr=S("create-content");function X7(n,t,e){const o=new Jh(e),r=e.rows,i=e.cols;g(pr,r>=1,`invalid rows: ${r}`),g(pr,i>=1,`invalid cols: ${i}`),g(pr,e.children,"no table children");const s=k("table",[],null),l=e.colsWidth,a=k("colgroup",[],s);for(let p=0;p<o.colCount;p++){const A=k("col",[],a);l[p]&&(A.style.width=`${l[p]}px`)}const d=k("tbody",[],s);let h=0;for(let p=0;p<r;p++){const A=k("tr",[],d);for(let v=0;v<i;v++){const B=o.getCell({col:v,row:p});if(B.virtual)g(pr,B.colSpan>1||B.rowSpan>1,"virtual cell should have colSpan or rowSpan");else{const D=e.children[h],x=k("td",[],A);B.colSpan>1&&(x.colSpan=B.colSpan),B.rowSpan>1&&(x.rowSpan=B.rowSpan);const _=e[uu(D)];_&&W(x,_),v===0&&e.hasColTitle&&W(x,Mv.COL_TITLE_ITEM),n.createChildContainer(t,x,D),h+=1}}}return g(pr,h===e.children.length,"container count mismatch"),e.noBorder&&W(s,"no-border"),e.chart&&W(s,"editor-table-chart"),e.isStripeStyle&&W(s,"stripe"),e.hasRowTitle&&W(s,"row-title"),e.hasColTitle&&W(s,"col-title"),s}function BF(n,t,e,o,r){g(pr,r.type==="table","not table data"),g(pr,ct(e)===t[t.length-1].containerId,"invalid path");const i=r,s=xs(o,"div");try{const l=k("div",[],null);l.setAttribute("data-type","table-content");const a=X7(n,t,i);a.classList.add("drag-preview-element"),l.appendChild(a);const d=n.getComponentOptions("table");Jv(n),n7(n),Z7(n,"create"),d!=null&&d.hideCellMenu||Q7(n),nL(n,Kp);const h=n.addCustom(mr(o),()=>AR());h.init({parentElement:s,childElement:l,safeRightSpace:50,safeLeftSpace:40,parentContainer:Gt(e)?n.scrollContainer:e,locatingContainer:Gt(e)?(d==null?void 0:d.locatingContainer)||n.parent:e,paddingLeft:ic+au,paddingTop:ic+au,paddingBottom:au/2,paddingRight:au/2,barFloatWindowBottom:d==null?void 0:d.barFloatWindowBottom,allowScrollBarFixed:d==null?void 0:d.allowScrollBarFixed,isSetScale:d==null?void 0:d.isSetScale});const p=K7(n);h.on("scroll",p.handleReset),h.on("resize",p.handleReset),setTimeout(()=>{YM(n,o)})}catch{const a=`invalid table data: ${JSON.stringify(i)}`;pr.error(a);const d=k("div",["error"],s);d.innerText=a}return s}function EF(n,t,e){g(pr,e.type==="table","not table data");const o=e,r=Lt(t);try{const i=_e(t),s=Mi(t),l=X7(n,s,o);l.classList.add("drag-preview-element"),i.insertAdjacentElement("afterend",l),i.remove();const a=n.getComponentOptions("table");Jv(n),n7(n),Z7(n,"update"),a!=null&&a.hideCellMenu||Q7(n),Kp(n,t)}catch{const s=`invalid table data: ${JSON.stringify(o)}`;pr.error(s);const l=k("div",["error"],r);l.innerText=s}}function xF(n,t){let e,o,r=!1;if([...t].every(A=>A==="|")?(o=t.length,e=Array(o).fill(""),r=!0):(e=Bm(t,"|").split("|"),o=e.length),o<2)return null;const i=3,s=o,l=[];for(let A=0;A<3;A++)e.forEach(v=>{l.push(Gr(n.doc,A===0?v:""))});const a=Array(s).fill(e0),d=l[r?0:s],h=n.doc.getContainerBlocks(d)[0].id;return{blockData:{id:K(),type:"table",rows:i,cols:s,children:l,colsWidth:a},focusBlockId:h}}function IF(n,t){const e=t.rows,o=t.cols;if(e<1||o<1)return null;const r=[];for(let d=0;d<e;d++)for(let h=0;h<o;h++)r.push(Gr(n.doc));const i=Array(o).fill(e0),s=r[0],l=n.doc.getContainerBlocks(s)[0].id;return{blockData:{id:K(),type:"table",rows:e,cols:o,children:r,colsWidth:i},focusBlockId:l}}const t9=S("table-selection-to-doc");function TF(n,t){const{start:e,end:o,block:r}=t,i=Dt(r);g(t9,i==="table",`invalid block type: ${i}`);const s=n.getBlockData(r);if(e.isSimple()&&o.isSimple())return Pi(n.editorBlocks,n.doc.toJSON(),s);g(t9,!e.isSimple()&&!o.isSimple(),"invalid block pos type");const l=Tt.fromBlock(r),{fromCol:a,toCol:d,fromRow:h,toRow:p}=Uo(r,e,o),A={},v=[],B=n.doc.toJSON();let D={};l.sub({row:h,col:a},{row:p,col:d}).forEach((rt,ft)=>{rt.forEach((Bt,jt)=>{const Ut=Bt.containerId;if(v.indexOf(Ut)!==-1)return;v.push(Ut);let ne;if(Bt.virtual){const $e=l.getCellByContainerId(Bt.containerId),Rn=a+jt;let Br=$e.col+$e.colSpan-1;Br>d&&(Br=d);const kn=Br-Rn+1;kn>1&&(A[`${Ut}_colSpan`]=kn);const an=h+ft;let Er=$e.row+$e.rowSpan-1;Er>p&&(Er=p);const ri=Er-an+1;ri>1&&(A[`${Ut}_rowSpan`]=ri),ne=qr()}else{if(ne=Fg(n.editorBlocks,B,Ut),Bt.col+Bt.colSpan>d+1){const $e=d-Bt.col+1;$e>1&&(A[`${Ut}_colSpan`]=$e)}else Bt.colSpan>1&&(A[`${Ut}_colSpan`]=Bt.colSpan);if(Bt.row+Bt.rowSpan>p+1){const $e=p-Bt.row+1;$e>1&&(A[`${Ut}_rowSpan`]=$e)}else Bt.rowSpan>1&&(A[`${Ut}_rowSpan`]=Bt.rowSpan)}const{root:qe,...Yn}=ne.blocks;D={...D,...Yn,[Ut]:qe}})});const _=gu(_e(r)).slice(a,d+1);return{blocks:{root:[{id:K(),type:i,children:v,colsWidth:_,rows:p-h+1,cols:d-a+1,...A}],...D},meta:{},comments:{}}}function DF(n,t){if(t.top===0)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.top-1][e]===n[t.top][e])return!1;return!0}function SF(n,t){if(t.left===0)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.left-1]===n[e][t.left])return!1;return!0}function LF(n,t){if(t.bottom===n.length-1)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.bottom][e]===n[t.bottom+1][e])return!1;return!0}function MF(n,t){if(t.right===n[0].length-1)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.right]===n[e][t.right+1])return!1;return!0}function RF(n,t,e){const o=t.col,r=t.row,i=e.col,s=e.row,l={left:o,top:r,right:i,bottom:s};let a=!1;do{if(a=!1,!DF(n,l)){l.top--,a=!0;continue}if(!SF(n,l)){l.left--,a=!0;continue}if(!LF(n,l)){l.bottom++,a=!0;continue}if(!MF(n,l)){l.right++,a=!0;continue}}while(a);return l}function OF(n,t,e,o){if(e.custom!==void 0||o.custom!==void 0)return{anchor:e,focus:o};const r=Tt.fromBlock(t),i=r.map(H=>H.containerId),s=r.getCellByContainerId(e.childContainerId),l=r.getCellByContainerId(o.childContainerId),a=Math.min(s.row,l.row),d=Math.max(s.row,l.row),h=Math.min(s.col,l.col),p=Math.max(s.col,l.col),A=RF(i,{row:a,col:h},{row:d,col:p}),v=r.getCell({row:A.top,col:A.left}),B=r.getCell({row:A.bottom,col:A.right}),D=r.getCell({row:A.top,col:A.right}),x=r.getCell({row:A.bottom,col:A.left});let _,R;return s.row<=l.row?s.col<=l.col?(_=v,R=B):(_=D,R=x):s.col<l.col?(_=x,R=D):(_=B,R=v),console.log(`move ${_.col}, ${_.row}, -> ${R.col}, ${R.row}`),{anchor:me(t,_.containerId),focus:me(t,R.containerId)}}function e9(n,t,e){if(e.isSimple())return[_e(t).getBoundingClientRect()];const o=_e(t),r=o.getBoundingClientRect(),{fromCol:i,fromRow:s,toCol:l,toRow:a}=Uo(t,e.start,e.end),d=gu(o),h=d.slice(0,i).reduce((D,x)=>D+x,0),p=h+d.slice(i,l+1).reduce((D,x)=>D+x,0),A=U7(o);let v=A.slice(0,s).reduce((D,x)=>D+x,0);const B=v+A.slice(s,a+1).reduce((D,x)=>D+x,0);if(s===0){const D=mF(n,t);v-=D}return[new DOMRect(r.left+h,r.top+v,p-h,B-v)]}S("table-size");const _F=40;function xf(n){const t=n.querySelector("td");if(!t)return 0;const e=window.getComputedStyle(t),o=Number.parseInt(e.borderLeft,10),r=Number.parseInt(e.borderRight,10);return(o+r)/2}function FF(n,t,e){const o=Zm(n,e.container);return o!==void 0?o+xf(t):_F*e.colSpan-xf(t)}function PF(n,t,e,o){let r=0;const i=e.colCount;for(let s=0;s<i;s++){const l=e.getCell({col:s,row:o});if(l.virtual)continue;let a=FF(n,t,l);const d=v4(l.container,{withPadding:!0});d&&d>a&&(a=d),r+=a+xf(t)}return r}function NF(n,t){const e=_e(t),o=Tt.fromTable(e);let r=0;for(let s=0;s<o.rowCount;s++)r=Math.max(r,PF(n,e,o,s));const i=xf(e);return r+=i,r}const Xr=S("table-creator");async function $F(n,t){return n.undoManager.runInGroup(()=>{var a,d;const e=t.item,o=(a=e.colCount)!=null?a:5,r=(d=e.rowCount)!=null?d:3,i=IF(n,{cols:o,rows:r});if(!i)return null;const{blockData:s,focusBlockId:l}=i;return n.insertBlock(t.containerId,t.blockIndex,s,ke(n,l,0))})}class HF{constructor(){m(this,"id","insert-table");m(this,"name","Create table");m(this,"element");m(this,"closeable",null);m(this,"colCount");m(this,"rowCount");m(this,"setCloseable",t=>{this.closeable=t});m(this,"destroy",()=>{this.closeable=null});m(this,"getTableCreatorCellId",(t,e)=>`table-creator-cell-${t}-${e}`);m(this,"handleTableCreatorClick",t=>{var A,v;t.preventDefault(),t.stopPropagation();const e=t.target;g(Xr,e instanceof HTMLElement,"invalid event target");const o=e.closest(".table-creator");g(Xr,o,"no table creator");const r=o.querySelectorAll(".active");if(r.length===0)return;const s=r[r.length-1].id;g(Xr,s,"no cell id");const l="table-creator-cell-";if(!s.startsWith(l))return;const d=s.substring(l.length).split("-");g(Xr,d.length===2,"invalid cell id");const h=Number.parseInt(d[0],10)+1,p=Number.parseInt(d[1],10)+1;Xr.debug(`${h}, ${p}`),this.colCount=p,this.rowCount=h,(A=this.closeable)==null||A.click(this,this.element),(v=this.closeable)==null||v.close("clickItem"),this.handleTableCreatorLeave()});m(this,"handleTableCreatorLeave",()=>{for(let t=0;t<9;t++)for(let e=0;e<9;e++){const o=this.getTableCreatorCellId(t,e),r=document.getElementById(o);r&&ot(r,"active")}});m(this,"handleTableCreatorCellEnter",t=>{const e=t.target;g(Xr,e instanceof HTMLElement,"invalid event target");const o=e.id,r="table-creator-cell-";g(Xr,o.startsWith(r),"invalid cell id");const s=o.substring(r.length).split("-");g(Xr,s.length===2,"invalid cell id");let l=Number.parseInt(s[0],10),a=Number.parseInt(s[1],10);l===0&&a===0&&(l=-1,a=-1);for(let d=0;d<9;d++)for(let h=0;h<9;h++){const p=this.getTableCreatorCellId(d,h),A=document.getElementById(p);g(Xr,A,"no cell"),d<=l&&h<=a?W(A,"active"):ot(A,"active")}});this.element=this.createTableCreatorElement()}createTableCreatorElement(){const t=k("div",["table-creator"],null),e=(o,r,i)=>{const s=k("div",["table-creator-cell"],o);return s.id=this.getTableCreatorCellId(r,i),s};t.addEventListener("click",this.handleTableCreatorClick),t.addEventListener("mouseleave",this.handleTableCreatorLeave);for(let o=0;o<9;o++){const r=k("div",["table-creator-row"],t);for(let i=0;i<9;i++)e(r,o,i).addEventListener("mouseenter",this.handleTableCreatorCellEnter)}return t}}function jF(){return new HF}function UF(n){const t=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g,e=n.match(t);return e?e.length:0}function n9(n){const t=UF(n);return n.length+t}function zF(n,t){const e=n9(n),o=t-e;return o>0?n+" ".repeat(o):n}function VF(n,t,e,o,r){const i=t,s=new Jh(i);if(o==="markdown"||o==="text"){const l=x=>e.blocks[x].map((H,z)=>o==="markdown"?xg(n,H,e,[...r,{containerId:x,blockIndex:z}]):yh(n,H,e,[...r,{containerId:x,blockIndex:z}])),a=x=>l(x).join(" ").replace(/\n/g," ").trim(),d=new Map,h=new Map;for(let x=0;x<s.colCount;x++){let _=0;for(let R=0;R<s.rowCount;R++){const H=s.getCell({row:R,col:x});let z="";H.virtual||(z=a(H.containerId)),d.set(`${R},${x}`,z),_=Math.max(_,n9(z))}h.set(x,_)}const p=x=>{const _=d.get(`${x.row},${x.col}`)||"",R=h.get(x.col)||0;return zF(_,R)},A=[];let v="|",B="|";for(let x=0;x<s.colCount;x++){const _=p({row:0,col:x});v+=` ${_} |`;const R="-".repeat((h.get(x)||0)+2);B+=`${R}|`}A.push(v),A.push(B);for(let x=1;x<s.rowCount;x++){let _="|";for(let R=0;R<s.colCount;R++){const H=p({row:x,col:R});_+=` ${H} |`}A.push(_)}return`${A.join(`
410
+ `:r.mathjaxText}function z_(){return{abstract:L.t("mathjax.abstract")}}const V_={embedType:"math",createEmbedContent:N_,getOptions:H_,convertFrom:$_,handleDeleteBlock:j_,convertTo:U_,getBlockProperties:z_},Ont="",W_={mathjax:{emptyText:"\u7A7A\u7684\u516C\u5F0F",abstract:"\u516C\u5F0F"}},q_={mathjax:{emptyText:"Empty formula",abstract:"Formula"}},G_={mathjax:{emptyText:"\u6570\u5F0F\u306A\u3057",abstract:"\u6570\u5F0F"}};L.mergeLang({"zh-CN":W_,"en-US":q_,"ja-JP":G_});function Z_(n,t,e,o){const r=n.getBlockByIndex(t,e),i=n.getBlockText(r),{left:s}=Tn(i,o);if(!ie(s).endsWith("$$$$"))return!1;const a=o-4,d=o,h={id:K(),box:!0,type:"math",tex:" ",src:"",created:Date.now()};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,a,d-a),n.insertBoxToBlock(r,a,h),setTimeout(()=>{const p=n.getBoxById(h.id);Af(n,p)})}),!0}class Q_{handleAfterInsertText(t,e,o,r,i){return!!(i===" "&&Z_(t,e,o,r))}}const pc=S("inline-box-items");function Y_(n,t,e){return n.undoManager.runInGroup(()=>{var s;let o=n.getBlockByIndex(t,e);ae(n,o)||(o=n.insertTextBlock([],t,e));const r=F9();n.setBlockText(o,[r]);const i=(s=r.attributes)==null?void 0:s.id;return g(pc,i,"mathjax box id is empty"),setTimeout(()=>{const l=n.getBoxById(i);Af(n,l)},100),o})}function J_(n,t,e){let o=n.getBlockByIndex(t,e),r="bottom-start";return ae(n,o)||(r="top-start"),pu(n,{target:o,linkText:"",linkUrl:"",onFinished:(l,a)=>{n.undoManager.runInGroup(()=>{try{ae(n,o)||(o=n.insertTextBlock([],t,e));const d=ao(l,{link:a}),h=ao(" ",null),p=[d,h];n.insertTextToBlock(o,0,p),n.selection.selectBlock(o,rn(p)),n.focus()}catch(d){pc.error(d)}})},onClose:()=>{n.focus()},placement:r}),o}function K_(n,t,e){return n.undoManager.runInGroup(()=>{var l;const o=n.getBlockByIndex(t,e),r=n.selection.range;g(pc,zr(r.start),"invalid block position");const i=F9();n.insertBoxToBlock(o,r.start.offset,i.attributes);const s=(l=i.attributes)==null?void 0:l.id;return g(pc,s,"mathjax box id is empty"),setTimeout(()=>{const a=n.getBoxById(s);Af(n,a)},100),o})}function X_(n,t,e){const o=n.getBlockByIndex(t,e),r=n.selection.range;g(pc,zr(r.start),"invalid block position");const i=$r(n,o,r);if(i.length===0)return;const s=i[0],l=Vr(n,o,"quick-menu-inline-link",s);pu(n,{target:l,linkText:"",linkUrl:"",onFinished:(h,p)=>{n.undoManager.runInGroup(()=>{try{const A=n.getBlockText(o),v=Wr(A,r.start.offset,h,{link:p});n.setBlockText(o,v),n.selection.selectBlock(o,r.start.offset+h.length),n.focus()}catch(A){pc.error(A)}})},onClose:()=>{n.focus()},placement:"bottom-start"})}class $9{getCommands(){return[{id:"insert-math",name:L.t("quickMenu.inlineBox.math"),icon:wL,order:900,group:"common",subText:An("insert-math")},{id:"insert-link",name:L.t("quickMenu.inlineBox.link"),icon:sv,order:400,group:"common",subText:An("insert-link")}]}async handleUpdateBlockCore(t,e){switch(e.item.id){case"insert-math":return K_(t,e.containerId,e.blockIndex);case"insert-link":return X_(t,e.containerId,e.blockIndex);default:return null}}async handleInsertEmptyBlockCore(t,e){switch(e.item.id){case"insert-math":return Y_(t,e.containerId,e.blockIndex);case"insert-link":return J_(t,e.containerId,e.blockIndex);default:return null}}async executeCommand(t,e,o){if(o.from==="quick-menu"){const r=t.getBlockById(o.blockId),i=t.getParentContainer(r),s=ct(i),l=t.getBlockIndex(r);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:s,blockIndex:l}))}else o.from==="block-menu"&&t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:o.containerId,blockIndex:o.blockIndex}));return null}}function tF(n,t={withPlainText:!1}){var i,s;const{withPlainText:e}=t,o=(s=(i=n.options.componentsOptions)==null?void 0:i.quickMenu)==null?void 0:s.commandProviders;if(!o)return[];const r=[];return[...o,new S9(e),new $9].forEach(l=>{const a=l.getCommands(n);r.push(...a.map(d=>({...d,itemType:"insert-block",commandProvider:l})))}),r}function eF(n,t={withPlainText:!1}){const e=[];return n.editorBlocks.forEach(o=>{if(!o.getOptions)return;const r=o.getOptions(n);!r.insertBlockCommandItems||(r.insertBlockCommandItems.forEach(i=>{D9(i,r)}),e.push(...r.insertBlockCommandItems))}),e.push(...tF(n,t)),e}function T0(n,t={withPlainText:!1}){const e=eF(n,t),o=new Map;e.forEach(s=>{var d;const l=(d=s.group)!=null?d:"";let a=o.get(l);a?a.items.push(s):(a={group:l,order:s.groupOrder||L9[l]||1e3,items:[s]},o.set(l,a))});const r=Array.from(o.values());r.sort((s,l)=>s.order-l.order),r.forEach(s=>{s.items.sort((l,a)=>{var d,h;return((d=l.order)!=null?d:0)-((h=a.order)!=null?h:0)})});const i=[];return r.forEach((s,l)=>{const a=`blockMenu.section.${s.group||"common"}`,d=L.t(a),h=d===a?s.group:d;i.push({id:`section-${l}`,name:h,type:"section",group:s.group,itemType:"insert-block"}),i.push(...s.items.map(p=>({...p})))}),i}function nF(n,t,e){const o=n.getFocusedBlock();if(!o)return;const r=n.getParentContainer(o),i=ct(r);let l=n.getBlockIndex(o);if(ae(n,o)||(l+=1),t.commandProvider){t.commandProvider.executeCommand(n,t,{from:"quick-menu",...e});return}!t.blockOptions||!t.blockOptions.handleInsertEmptyBlock||t.blockOptions.handleInsertEmptyBlock(n,{containerId:i,blockIndex:l,item:t})}const H9=S("quick-menu"),oF={id:"quick-menu",trigger:["/"]},rF=5;class bf{constructor(t,e=oF){m(this,"suggest");m(this,"items");m(this,"maxHeading");m(this,"firstEmptyOffset",-1);m(this,"queryItems",async(t,e)=>{if(this.items.length===0?this.initMenuItems():this.refreshMenuItems(),e){const o=new Set,r=e.toLocaleLowerCase().replace(/^\s+|\s+$/g,""),i=this.items.filter(s=>{if(s.type==="section")return!0;if(s.name.toLocaleLowerCase().indexOf(r)!==-1||yM(s).toLocaleLowerCase().indexOf(r)!==-1)return o.add(s.group),!0;const l=`blockMenu.section.${s.group||"common"}`,a=L.t(l),d=a===l?s.group:a;return(d==null?void 0:d.toLocaleLowerCase().indexOf(r))!==-1?(o.add(s.group),!0):!1}).filter(s=>s.type==="section"?o.has(s.group):!0);return i.length?this.firstEmptyOffset=-1:this.handleEmptySearch(),i}return this.items});m(this,"onClose",()=>{this.firstEmptyOffset=-1});m(this,"onShow",(t,e,o,r)=>{const i=this.editor.getBlockByIndex(e,o);if(!so(i)){const s=tt(nt(i));if(s&&Dt(s)==="code")return!1}return!0});m(this,"onClickItem",(t,e)=>{const o=e;o.itemType==="insert-block"&&(g(H9,o.blockOptions||o.commandProvider,"invalid quick item, no block options or command provider"),g(H9,this.suggest.anchor,"invalid suggest, no anchor"),this.options.id==="empty-block-menu"&&this.editor.focus(),nF(this.editor,o,this.suggest.anchor))});this.editor=t,this.options=e,this.items=[],this.maxHeading=af(),this.suggest=new Np(t,{id:e.id||"quick-menu",trigger:e.trigger,needSpaceBeforeTrigger:!0,autoDeleteTrigger:!0,highlight:!0,onClose:this.onClose,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems})}get menu(){return this.suggest.menu.menu}destroy(){this.suggest.destroy()}initMenuItems(){const t=T0(this.editor);this.items=t}refreshMenuItems(){let t=null,e=0;const o=af();if(o!==this.maxHeading){const r=new S9,s=r.getCommands().map(l=>({...l,itemType:"insert-block",commandProvider:r}));for(let l=0;l<this.items.length;l++)this.items[l].group==="basics"&&(t||(t=l),t&&e++);t&&e&&this.items.splice(t,e,...s),this.maxHeading=o}}handleEmptySearch(){const t=this.editor.selection.getFocusedPos();if(this.firstEmptyOffset===-1){if(t.isSimple()){const{offset:e}=t;this.firstEmptyOffset=e-1}}else if(t.isSimple()){const{offset:e}=t;e-this.firstEmptyOffset>rF&&(this.suggest.close(),this.firstEmptyOffset=-1)}}}class vf{constructor(t){m(this,"instance");m(this,"mousedown",!1);m(this,"currentInstance",null);m(this,"attributeName",[]);m(this,"attributeDesc","");m(this,"observer",null);m(this,"observerCallback",null);m(this,"createContent",t=>{let e="",o=0;for(;o<this.attributeName.length&&!e;)t.hasAttribute(this.attributeName[o])&&(e=t.getAttribute(this.attributeName[o])||""),o++;const r=t.getAttribute(this.attributeDesc);if(!r)return e;const i=k("div",[],null);return k("span",[],i,e),r&&k("span",["editor-tooltip-desc"],i,r),i});m(this,"handleDocumentMouseDown",()=>{this.mousedown=!0,this.editor.domEvents.addEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleDocumentMouseUp",()=>{this.mousedown=!1,this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleShown",t=>{this.currentInstance&&this.hide(),this.currentInstance=t,this.createObserver()});m(this,"handleHidden",()=>{this.destroyObserver(),this.currentInstance=null});m(this,"handleShow",t=>{var r;const e=t.reference;if(!e||!Xt(document.body,e)||window.isDragging||this.mousedown)return!1;const o=Number.parseInt((r=e.getAttribute("data-tooltip-hide-at"))!=null?r:"",10);if(o&&Date.now()-o<1e3)return!1;if(t.reference){const i={};if(t.reference.hasAttribute("data-editor-tooltip-placement")&&(i.placement=t.reference.getAttribute("data-editor-tooltip-placement")||"top"),t.reference.hasAttribute("data-editor-tooltip-offset-x")||t.reference.hasAttribute("data-editor-tooltip-offset-y")){const s=t.reference.getAttribute("data-editor-tooltip-offset-x"),l=t.reference.getAttribute("data-editor-tooltip-offset-y");i.offset=[s?Number.parseInt(s,10):0,l?Number.parseInt(l,10):0]}if(t.reference.hasAttribute("data-editor-tooltip-maxwidth")&&(i.maxWidth=Number.parseInt(t.reference.getAttribute("data-editor-tooltip-maxwidth")||"350",10)),t.reference.hasAttribute("data-editor-tooltip-allow-markdown")&&(i.allowHTML=!0),Object.keys(i).length&&t.setProps(i),t.reference.hasAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`)){const s=t.reference.getAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`);t.setContent(s||"")}}return!0});this.editor=t;const e=t.clientId;this.attributeName=[`data-editor-tooltip-${e}`,`data-editor-tooltip-${e}-dynamic`,"data-editor-tooltip-common"],this.attributeDesc=`data-editor-tooltip-desc-${e}`,this.instance=dm.delegate(document.body,{theme:"editor-tooltip",maxWidth:400,delay:200,target:this.attributeName.map(o=>`[${o}]`).join(","),content:this.createContent,onShow:this.handleShow,onShown:this.handleShown,onHide:this.handleHidden}),t.domEvents.addEventListener(document,"mousedown",this.handleDocumentMouseDown)}visible(){var t;return(t=this.currentInstance)==null?void 0:t.state.isVisible}hide(){var t;(t=this.currentInstance)!=null&&t.state.isVisible&&this.currentInstance.hide()}destroy(){this.destroyObserver(),this.instance.destroy(),this.editor.domEvents.removeEventListener(document,"mousedown",this.handleDocumentMouseDown),this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)}createObserver(){this.destroyObserver();const t=this.currentInstance;if(!t||!t.reference)return;this.observerCallback=Le.default(()=>{t.reference.closest("body")||(t.hide(),this.destroyObserver())},200),this.observer=new MutationObserver(this.observerCallback);const e=document.body,o={childList:!0,attributes:!1,subtree:!0};this.observer.observe(e,o)}destroyObserver(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observerCallback&&(this.observerCallback.cancel(),this.observerCallback=null)}}const iF={"text/style-bold":"bold","text/style-italic":"italic","text/style-underline":"underline","text/style-strikethrough":"line-through","text/style-code":"code","text/style-sub":"subscript","text/style-super":"superscript"};function sF(n,t){const e=new Set(Object.keys(iF)),o=t.filter(i=>e.has(i.id));return lf(o)}function yf(n,t){if(!n.isWritable())return!1;const e=n.selection.range,o=n.editorCommandProviders.getCommands(e),i=sF(n,o).find(s=>s.id===`text/${t}`);return i?(n.editorCommandProviders.executeCommand(e,i,{}),gc.get(n).update("selectionChange"),!0):!1}const D0={"CtrlOrCmd+B":n=>yf(n,"style-bold"),"CtrlOrCmd+I":n=>yf(n,"style-italic"),"CtrlOrCmd+U":n=>yf(n,"style-underline"),"CtrlOrCmd+D":n=>yf(n,"style-strikethrough")},lF={quickMenu:{basic:{heading:{title:"\u6807\u9898 {heading}",space:"{markdown}\u7A7A\u683C"},unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",checkbox:"\u5F85\u529E\u4E8B\u9879",quote:"\u5F15\u7528"},inlineBox:{math:"\u516C\u5F0F",link:"\u94FE\u63A5"}},link:{textLabel:"\u6587\u672C",urlLabel:"\u94FE\u63A5\u5730\u5740",textPlaceholder:"\u8BF7\u8F93\u5165\u6587\u672C",urlPlaceholder:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740",submitText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",edit:"\u7F16\u8F91",remove:"\u53D6\u6D88\u94FE\u63A5"},commands:{unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",check:"\u5F85\u529E\u5217\u8868",link:"\u94FE\u63A5",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u5BF9\u9F50",alignRight:"\u53F3\u5BF9\u9F50",alignCenter:"\u5C45\u4E2D\u5BF9\u9F50",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u6807\u9898 {name}",headingGroup:"\u6807\u9898\u6837\u5F0F",text:"\u6B63\u6587"}},cF={quickMenu:{basic:{heading:{title:"Title {heading}",space:"{markdown}space"},unordered:"Bulleted list",ordered:"Numbered list",checkbox:"To-do list",quote:"Quote"},inlineBox:{math:"Formula",link:"Link"}},link:{textLabel:"Text",urlLabel:"Link address",textPlaceholder:"Please enter text",urlPlaceholder:"Please enter link",submitText:"Confirm",cancelText:"Cancel",edit:"Edit",remove:"Remove link"},commands:{unordered:"Bulleted list",ordered:"Numberer list",check:"To-do list",link:"Link",quote:"Quote",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Center text",alignGroup:"Alignment",heading:"Title {name}",headingGroup:"Text style",text:"Text"}},aF={quickMenu:{basic:{heading:{title:"\u898B\u51FA\u3057{heading}",space:"{markdown}\u30B9\u30DA\u30FC\u30B9"},unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",checkbox:"\u30D0\u30C3\u30AF\u30ED\u30B0",quote:"\u5F15\u7528"},inlineBox:{math:"\u6570\u5F0F",link:"URL"}},link:{textLabel:"\u30C6\u30AD\u30B9\u30C8",urlLabel:"URL",textPlaceholder:"\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",urlPlaceholder:"URL \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submitText:"OK",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB",edit:"\u7DE8\u96C6",remove:"\u30EA\u30F3\u30AF\u3092\u89E3\u9664"},commands:{unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",check:"\u30D0\u30C3\u30AF\u30ED\u30B0",link:"URL",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u63C3\u3048",alignRight:"\u53F3\u63C3\u3048",alignCenter:"\u4E2D\u592E\u63C3\u3048",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u898B\u51FA\u3057{name}",headingGroup:"\u30BF\u30A4\u30C8\u30EB\u30B9\u30BF\u30A4\u30EB",text:"\u672C\u6587"}};L.mergeLang({"zh-CN":lF,"en-US":cF,"ja-JP":aF});const _nt="";function Zs(n,...t){const e=ho(...t);return e.classList.remove("editor-button"),e.classList.add("editor-text-button"),n.append(e),e}function j9(n){const t=cf(n);t==null||t.hide();const e=n.findCustom("table-border-bar");e==null||e.closeToolbar()}function uF(n){return k("div",["insert-column-button","drop-marker"],n)}const dF=S("row-height");function U9(n){const t=Tt.fromTable(n),e=n.rows;g(dF,e.length===t.rowCount,"row count mismatch");const o=Array(t.rowCount).fill(0);for(let r=0;r<e.length;){let i=1,l=e[r].getBoundingClientRect().height,a=r+1;for(;a<e.length;){const d=e[a];if(d.cells.length!==0)break;i++,a++,l+=d.getBoundingClientRect().height}for(let d=0;d<i;d++)o[r+d]=l/i;r=a}return o}const hF=S("table-border-bar-dom");function z9(n){var a;const t=tt(n.contentElement);g(hF,t,"no block");const o=te(t).querySelector(".table-border-bar-container.left"),i=Lt(t).offsetLeft-ic,s=((a=n.scrollOptions.paddingLeft)!=null?a:0)+i,l=Math.min(n.contentElement.offsetLeft-i,n.rootElement.scrollLeft-s);o&&(o.style.left=`${-l}px`)}const Qi=S("table-border-bar-dom");function Cc(n,t){g(Qi,Ve(t),"invalid table block");const e=_e(t),o=gr(n,t),r=te(t),i=(p,A,v)=>{const B=k("div",["button-root",A],p),D=k("div",["button-container",A],B);B.setAttribute(`data-${A}-index`,`${v}`),D.setAttribute(`data-editor-tooltip-${n.clientId}`,A==="left"?L.t("table.insertRow"):L.t("table.insertCol")),k("span",["insert-indicator"],D),uF(D)},{selectedRows:s,selectedColumns:l}=Hp(n,t),a=()=>{const p=o.querySelector(".table-border-bar-container.top");g(Qi,p,"no top border bar container");const A=k("div",["table-border-bar-container","top"],null),v=k("div",["table-border-bar","top"],A),B=vR(e),x=Tt.fromTable(e).colCount;n.selection.range.isSimple()&&i(v,"top",0);for(let _=0;_<x;_++){const R=_===x-1?B[_]+2:B[_],H=k("span",["table-border-bar-cell","top"],v);l.has(_)&&H.classList.add("selected"),H.setAttribute("data-top-index",`${_}`),H.style.width=`${R}px`,n.selection.range.isSimple()&&i(v,"top",_+1)}Ca(p,A)},d=()=>{const p=r.querySelector(".table-border-bar-container.left");g(Qi,p,"no left border bar container");const A=k("div",["table-border-bar-container","left"],null),v=k("div",["table-border-bar","left"],A);k("span",["table-border-bar-cell","corner"],v);const B=U9(e);n.selection.range.isSimple()&&i(v,"left",0),Array.from(e.rows).forEach((D,x,_)=>{const R=k("span",["table-border-bar-cell","left"],v);s.has(x)&&R.classList.add("selected"),R.setAttribute("data-left-index",`${x}`);const H=x===_.length-1?B[x]+2:B[x];R.style.height=`${H}px`,n.selection.range.isSimple()&&i(v,"left",x+1)}),Ca(p,A)};a(),d();const h=n.findCustom(mr(t));h&&z9(h)}function V9(n,t){const e=t.target;if(!(e instanceof Element))return;const o=tt(e);g(Qi,o&&Ve(o),"invalid table block"),Cc(n,o),n.selection.caret.update()}function kf(n,t){const e=t.target;if(!(e instanceof Element))return;const o=tt(e);g(Qi,o&&Ve(o),"invalid table block");const r=e.closest(".button-root");if(r){if(r.classList.contains("top")){const i=parseInt(r.getAttribute("data-top-index")||"0",10);Xv(n,o,i),Cc(n,o)}else if(r.classList.contains("left")){const i=parseInt(r.getAttribute("data-left-index")||"0",10);t9(n,o,i),Cc(n,o)}}}function wf(n,t){var s;j9(n),t.preventDefault(),t.stopPropagation();let e=null,o,r;const i=l=>{var a;if(l.target instanceof HTMLElement&&o&&e&&r!==void 0){const d=tt(l.target),h=l.target.closest(".table-border-bar");if(d===e&&h){const p=parseInt((a=l.target.getAttribute(`data-${o}-index`))!=null?a:"0",10),A=Math.min(r,p),v=Math.abs(r-p)+1;xt(l.target,"top")&&o==="top"?OR(n,d,A,v,{reverse:!0}):xt(l.target,"left")&&o==="left"&&_R(n,d,A,v,{reverse:!0})}}l.type==="mouseup"&&(e=null,r=void 0,o=void 0,document.body.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",i))};t.target instanceof HTMLElement&&xt(t.target,"table-border-bar-cell")&&(e=tt(t.target),xt(t.target,"top")?o="top":xt(t.target,"left")&&(o="left"),o&&e&&(r=parseInt((s=t.target.getAttribute(`data-${o}-index`))!=null?s:"0",10),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",i)))}function W9(n){const t=n.selection.range,e=lu(n,t);e&&Cc(n,e)}function fF(n,t){g(Qi,Ve(t),"invalid table block");const e=gr(n,t),o=te(t),r=k("div",["table-border-bar-container","top"],e),i=k("div",["table-border-bar-container","left"],o);Cc(n,t),n.domEvents.addEventListener(Lt(t),"scroll",V9),n.domEvents.addEventListener(r,"click",kf),n.domEvents.addEventListener(i,"click",kf),n.domEvents.addEventListener(r,"mousedown",wf),n.domEvents.addEventListener(i,"mousedown",wf),n.addListener("afterClearSelection",W9)}function q9(n,t){if(!n.isWritable())return;if(gr(n,t).querySelector(".table-border-bar-container")){Cc(n,t);return}fF(n,t)}function G9(n,t){g(Qi,Ve(t),"invalid table block");const e=gr(n,t),o=te(t),r=e.querySelectorAll(".table-border-bar-container"),i=o.querySelectorAll(".table-border-bar-container");r.forEach(s=>{n.domEvents.removeEventListener(s,"click",kf),n.domEvents.removeEventListener(s,"mousedown",wf),s.remove()}),i.forEach(s=>{n.domEvents.removeEventListener(s,"click",kf),n.domEvents.removeEventListener(s,"mousedown",wf),s.remove()}),n.domEvents.removeEventListener(Lt(t),"scroll",V9),n.addListener("afterClearSelection",W9)}function mF(n,t){g(Qi,Ve(t),"invalid table block");const o=gr(n,t).querySelector(".table-border-bar-container.top");return o?o.getBoundingClientRect().height:0}class gF{constructor(t,e){m(this,"toolbar");m(this,"handleSelectionChange",(t,e)=>{!t.isVisible||(e==="delete-columns"?(Vi(this.editor,this.tableBlock,!0,!0),Wi(this.editor,this.tableBlock,!0,!0)):e==="delete-rows"?(Vi(this.editor,this.tableBlock,!0,!1),Wi(this.editor,this.tableBlock,!0,!1)):(Vi(this.editor,this.tableBlock,!1),Wi(this.editor,this.tableBlock,!1)))});m(this,"handleClick",(t,e,o)=>{e.id==="delete-columns"?jp(this.editor.selection.range):e.id==="delete-rows"&&Up(this.editor.selection.range)});m(this,"handleToolbarClose",()=>{this.tableBlock&&lu(this.editor,this.editor.selection.range)===this.tableBlock&&(Vi(this.editor,this.tableBlock,!1),Wi(this.editor,this.tableBlock,!1))});this.editor=t,this.tableBlock=e;const o=t.options.componentsOptions.popover;this.toolbar=new ru([],void 0,{id:"table-row-column-toolbar",overflowBoundary:o==null?void 0:o.overflowBoundary,refuseOverflow:!0,tooltipId:this.editor.clientId}),this.toolbar.addListener("selectionChange",this.handleSelectionChange),this.toolbar.addListener("click",this.handleClick),this.toolbar.addListener("close",this.handleToolbarClose)}close(){this.toolbar.close("cancelBar")}update(){var r,i,s;const{selectedColumns:t,selectedRows:e}=Hp(this.editor,this.tableBlock);if(!this.editor.isWritable())return;if(t.size>0&&e.size>0){this.toolbar.close("cancelBar");return}if(t.size===0&&e.size===0){this.toolbar.close("cancelBar");return}const o=$r(this.editor,this.tableBlock,this.editor.selection.range)[0];if(!o){this.toolbar.close("cancelBar");return}if(t.size>0){const l={id:"delete-columns",name:L.t("table.deleteCol"),icon:uL};this.toolbar.updateItems([l]);const a=Vr(this.editor,this.tableBlock,"table-row-column-delete",o);this.toolbar.manualShow(a,{placement:"top",offset:[0,5]})}else{const l={id:"delete-rows",name:L.t("table.deleteRow"),icon:aL};this.toolbar.updateItems([l]);const h=te(this.tableBlock).querySelector(".table-border-bar-container.left").getBoundingClientRect(),p=new DOMRect(Math.max(h.left,o.left-ic),o.top,ic,o.height),A=Vr(this.editor,this.tableBlock,"table-row-column-delete",p);this.toolbar.manualShow(A,{placement:"left",offset:[0,5]});const v=this.editor.options.componentsOptions.popover;(r=this.toolbar.tippyInstance)==null||r.setProps({popperOptions:{modifiers:[{name:"flip",options:{boundary:v==null?void 0:v.overflowBoundary,fallbackPlacements:["left","right"]}}]}})}(s=(i=this.toolbar.tippyInstance)==null?void 0:i.popperInstance)==null||s.update()}destroy(){this.toolbar.destroy(),this.toolbar.removeAllListeners()}}const S0=S("table-border-bar");class pF{constructor(t,e){m(this,"toolbar");m(this,"resizeObserver");m(this,"handleReadonlyChanged",t=>{t.isWritable()?this.update():G9(this.editor,this.tableBlock)});m(this,"handleBlockUpdated",()=>{this.resizeObserver.disconnect(),setTimeout(()=>{const t=this.editor.getBlockById(it(this.tableBlock));this.resizeObserver.observe(_e(t))})});m(this,"handleScroll",()=>{var t;(t=this.toolbar)==null||t.update()});m(this,"handleTableResize",()=>{!this.editor.isWritable()||(console.log("resize"),this.update())});this.editor=t,this.tableBlock=e,g(S0,this.tableBlock,"no table block"),S0.debug("create table border bar"),q9(this.editor,this.tableBlock),this.resizeObserver=new ResizeObserver(this.handleTableResize),this.resizeObserver.observe(_e(this.tableBlock));const o=t.getComponentOptions("table");o!=null&&o.hideToolbar||(this.toolbar=new gF(this.editor,this.tableBlock)),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}close(){var t;(t=this.toolbar)==null||t.close()}destroy(){var t;S0.debug("destroy table border bar"),this.resizeObserver.disconnect(),G9(this.editor,this.tableBlock),(t=this.toolbar)==null||t.destroy(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}update(){var t;q9(this.editor,this.tableBlock),(t=this.toolbar)==null||t.update()}}const CF=S("table-border-bar");class AF{constructor(t){m(this,"activeTableBar",null);m(this,"handleBlockDeleted",(t,e)=>{!this.activeTableBar||(e===this.activeTableBar.tableBlock||Xt(e,this.activeTableBar.tableBlock))&&(this.activeTableBar.destroy(),this.activeTableBar=null)});m(this,"handleSelectionChanged",t=>{var r;const e=t.selection.range,o=lu(t,e);((r=this.activeTableBar)==null?void 0:r.tableBlock)!==o&&this.activeTableBar&&this.hide(),o&&this.show(o)});m(this,"handleScroll",()=>{var t;(t=this.activeTableBar)==null||t.handleScroll()});this.editor=t,this.editor.addListener("blockDeleted",this.handleBlockDeleted),this.editor.addListener("selectionChanged",this.handleSelectionChanged)}destroy(){this.editor.removeListener("blockDeleted",this.handleBlockDeleted),this.editor.removeListener("selectionChanged",this.handleSelectionChanged)}show(t){this.activeTableBar?(this.activeTableBar.tableBlock!==t&&this.hide(),this.activeTableBar.update()):this.activeTableBar=new pF(this.editor,t)}update(){var t;(t=this.activeTableBar)==null||t.handleBlockUpdated()}closeToolbar(){var t;(t=this.activeTableBar)==null||t.close()}hide(){!this.activeTableBar||(g(CF,this.activeTableBar,"no active table bar"),this.activeTableBar.destroy(),this.activeTableBar=null)}}function Z9(n,t){const e=n.addCustom("table-border-bar",o=>new AF(o));t==="update"&&e.update()}const Mn=S("table-cell-menu"),bF="style-bg-color-";class vF{constructor(t){m(this,"activeTableBlock",null);m(this,"targetButton",null);m(this,"manualMenu",null);m(this,"colorPaletteItem",null);m(this,"handlePrevent",(t,e)=>{e.stopPropagation()});m(this,"handleReadonlyChanged",t=>{t.isWritable()||this.hide()});m(this,"handleSelectionChanged",t=>{const e=t.selection.range,o=lu(t,e);if(this.hide(),this.activeTableBlock!==o&&(this.activeTableBlock=o),this.activeTableBlock){const r=Tt.fromBlock(this.activeTableBlock),i=e.isReverse()?e.start:e.end;let s=null;i instanceof Mo?t.getBlockById(i.blockId)===this.activeTableBlock?s=r.getCellByContainerId(i.childContainerId):s=this.getCellByChildBlockId(r,i.blockId):i.blockId!==this.activeTableBlock.id&&(s=this.getCellByChildBlockId(r,i.blockId)),s&&this.editor.isWritable()&&this.showCellMenuButton(s)}});m(this,"handleBeforePopupPalette",()=>{var e;const t=this.getSelectedBkgColorIndex();(e=this.colorPaletteItem)==null||e.palette.setColor("backgroundColor",t)});m(this,"createBkgColorItem",()=>{const t=k("div",["cell-background-color-item"],null);k("span",[],t,L.t("table.cellBackground"));const e=this.getSelectedBkgColorIndex();k("button",["item-button"],t).setAttribute("data-color-index",`${e}`);const r=k("span",["item-sub-indicator"],t);return r.innerHTML=ev,t});m(this,"handleCommand",t=>{var r;g(Mn,this.activeTableBlock,"no target table block");const e=((r=t.states)==null?void 0:r.includes("checked"))||!1,o=t.value;switch(t.id){case"delete-select-row":Up(Ov(this.editor,this.activeTableBlock,!1));break;case"delete-select-col":jp(Ov(this.editor,this.activeTableBlock,!0));break;case"merge-cell":Lv(this.editor.selection.range);break;case"split-cell":this.handleSplitCell();break;case"row-title":this.handleRowTitle(e);break;case"col-title":this.handleColTitle(e);break;case"stripe-style":this.handleStripeStyle(e);break;case"hide-border":UM(this.editor,this.activeTableBlock,o==="show-border");break;case"show-chart":GM(this.editor,this.activeTableBlock,o==="show-chart"),Jp(this.editor,this.activeTableBlock,{updateNow:!0});break}});m(this,"handleToolbarClose",()=>{this.targetButton&&ot(this.targetButton,"active"),this.activeTableBlock&&lu(this.editor,this.editor.selection.range)===this.activeTableBlock&&(Vi(this.editor,this.activeTableBlock,!1),Wi(this.editor,this.activeTableBlock,!1)),this.editor.focus()});m(this,"handleSelectionChange",(t,e)=>{!t.isVisible||(g(Mn,this.activeTableBlock,"no target table block"),e==="cell-background-color"&&this.handleBeforePopupPalette(),e==="delete-select-row"?(Vi(this.editor,this.activeTableBlock,!0,!1),Wi(this.editor,this.activeTableBlock,!0,!1)):e==="delete-select-col"?(Vi(this.editor,this.activeTableBlock,!0,!0),Wi(this.editor,this.activeTableBlock,!0,!0)):(Vi(this.editor,this.activeTableBlock,!1),Wi(this.editor,this.activeTableBlock,!1)))});m(this,"handleClick",(t,e)=>{var o;g(Mn,this.activeTableBlock,"no target table block"),g(Mn,this.targetButton,"no target button"),j9(this.editor),xt(this.targetButton,"active")?(ot(this.targetButton,"active"),(o=this.manualMenu)==null||o.close("clickItem")):(W(this.targetButton,"active"),this.manualMenu?this.manualMenu.updateItems(this.createCommandMenu()):(this.manualMenu=new Us(this.createCommandMenu()),this.manualMenu.on("click",(r,i)=>{var s;this.handleCommand(i),(s=this.manualMenu)==null||s.close("clickItem")}),this.manualMenu.on("selectionChange",this.handleSelectionChange),this.manualMenu.on("close",this.handleToolbarClose)),this.manualMenu.manualShow(this.targetButton,{placement:"right-start"})),e.stopPropagation()});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}destroy(){var t,e;this.activeTableBlock=null,this.targetButton=null,this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged),(t=this.manualMenu)==null||t.destroy(),(e=this.colorPaletteItem)==null||e.destroy()}hide(){var t;(t=this.manualMenu)==null||t.close("cancelBar"),this.targetButton&&(ot(this.targetButton,"active"),this.targetButton.style.display="none")}getCellByChildBlockId(t,e){let o=this.editor.getBlockById(e);for(;o;){const r=o.closest("td");g(Mn,r,"no parent cell");const i=tt(r);if(g(Mn,i,"no parent block"),_e(i)===t.table)return t.getCellByCellElement(r);o=i}return g(Mn,!1,"filed to get cell by child block id"),null}createTargetButton(t){this.targetButton?t.querySelector(`:scope > .${Gp}`)||t.appendChild(this.targetButton):(this.targetButton=k("button",[Gp],t),this.targetButton.innerHTML=Qh,this.editor.domEvents.addEventListener(this.targetButton,"click",this.handleClick),this.editor.domEvents.addEventListener(this.targetButton,"mousedown",this.handlePrevent),this.editor.domEvents.addEventListener(this.targetButton,"dblclick",this.handlePrevent))}showCellMenuButton(t){this.createTargetButton(t.cell),g(Mn,this.targetButton,"no target button"),this.targetButton.style.display="inline-block"}handleSplitCell(){if(this.activeTableBlock){const t=Tt.fromBlock(this.activeTableBlock),e=this.editor.selection.range;if(e.isSimple()){const{col:o,row:r}=this.getCellByChildBlockId(t,e.start.blockId);Vp(this.editor,this.activeTableBlock,{col:o,row:r})}else Wp(this.editor.selection.range)}}getSelectedBkgColorIndex(){var r;g(Mn,this.activeTableBlock,"no target table block");const t=WM(this.editor,this.activeTableBlock),e=this.editor.getBlockData(this.activeTableBlock),o=new Set;for(const i of t){if(o.size>1)break;const s=ct(i),l=e[`${s}_background`];if(l)o.add(Number.parseInt((r=l.substring(bF.length))!=null?r:"0",10));else{o.add(-1);break}}return o.size===1&&[...o][0]!==-1?[...o][0]:-1}createCommandMenu(){g(Mn,this.activeTableBlock,"no target table block");const t=this.editor.getBlockData(this.activeTableBlock),e=Sv(this.editor,this.activeTableBlock,this.editor.selection.range);let o=this.editor.selection.range;if(o.isSimple()){const h=Kr(this.editor,this.activeTableBlock,o.start);o=Ue(this.editor,{anchor:h,focus:h})}const r=Dv(this.editor,this.activeTableBlock,o),i=t.hasRowTitle,s=t.hasColTitle,l=t.isStripeStyle,a=t.noBorder,d=t.chart;return this.colorPaletteItem=new wv("cell-background-color",{color:!1}),this.colorPaletteItem.palette.on("onClick",(h,p)=>{var A;switch(g(Mn,this.activeTableBlock,"no target table block"),h){case"clearColor":Pv(this.editor,this.activeTableBlock,-1);break;case"backgroundColor":Pv(this.editor,this.activeTableBlock,p);break}(A=this.manualMenu)==null||A.close("clickItem")}),[{id:"cell-background-color",name:L.t("table.cellBackground"),element:this.createBkgColorItem(),children:[this.colorPaletteItem]},{id:"separator",name:"",type:"separator"},{id:"merge-cell",name:L.t("table.mergeCell"),states:e?[]:["disabled"]},{id:"split-cell",name:L.t("table.splitCell"),states:r?[]:["disabled"]},{id:"separator",name:"",type:"separator"},{id:"delete-select-row",name:L.t("table.deleteSelectRow")},{id:"delete-select-col",name:L.t("table.deleteSelectCol")},{id:"separator",name:"",type:"separator"},{id:"table-config",name:L.t("table.tableConfigKey"),children:[{id:"row-title",name:L.t("table.tableConfig.rowTitle"),states:i?["checked"]:[]},{id:"col-title",name:L.t("table.tableConfig.colTitle"),states:s?["checked"]:[]},{id:"stripe-style",name:L.t("table.tableConfig.stripeStyle"),states:l?["checked"]:[]},{id:"hide-border",name:a?L.t("table.tableConfig.showBorder"):L.t("table.tableConfig.hideBorder"),value:a?"show-border":"hide-border"},{id:"show-chart",name:d?L.t("table.tableConfig.hideChart"):L.t("table.tableConfig.showChart"),value:d?"hide-chart":"show-chart"}]}]}handleRowTitle(t){g(Mn,this.activeTableBlock,"no target table block"),t?$M(this.editor,this.activeTableBlock):NM(this.editor,this.activeTableBlock)}handleColTitle(t){g(Mn,this.activeTableBlock,"no target table block"),t?PM(this.editor,this.activeTableBlock):FM(this.editor,this.activeTableBlock)}handleStripeStyle(t){g(Mn,this.activeTableBlock,"no target table block"),t?jM(this.editor,this.activeTableBlock):HM(this.editor,this.activeTableBlock)}}function Q9(n){n.addCustom("table-cell-menu",t=>new vF(t))}const Bf=S("table-container");function L0(n){const t=n.closest("td");return g(Bf,t,"no parent cell for a table cell container"),t}function Y9(n){const t=_e(n);return Array.from(t.querySelectorAll(':scope > tbody > tr > td > [data-type="editor-container"].child'))}function M0(n,t,e,o){const r=Tt.fromBlock(n),i=r.getCellByContainerId(ct(t));if(e==="ArrowDown"){const s=r.getBottomCell(i);return s?s.container:null}if(e==="ArrowUp"){const s=r.getTopCell(i);return s?s.container:null}if(e==="ArrowLeft"){const s=r.getAllContainers(),l=s.indexOf(t);if(g(Bf,l>=0,"not a valid child container"),l===0)return null;const a=s[l-1];return o!=null&&o.noWrap&&r.getCellByContainerId(ct(a)).row!==i.row?null:a}if(e==="ArrowRight"){const s=r.getAllContainers(),l=s.indexOf(t);if(g(Bf,l>=0,"not a valid child container"),l===s.length-1)return null;const a=s[l+1];return o!=null&&o.noWrap&&r.getCellByContainerId(ct(a)).row!==i.row?null:a}g(Bf,!1,`invalid navigation type: ${e}`)}const yF=12,kF=90,Ef=23,J9=2;class wF{constructor(t){m(this,"scrollTableBlock",null);m(this,"autoScrollDir",null);m(this,"autoScrollTimer",null);m(this,"handleMouseDown",t=>{const e=document.elementFromPoint(t.clientX,t.clientY);if(e&&e instanceof HTMLElement){const o=tt(e);if(o&&Xt(this.editor.rootContainer,o)){const r=Jr(o);r&&(this.scrollTableBlock=r,document.addEventListener("mousemove",this.handleAutoScroll))}}});m(this,"handleAutoScroll",UB.default(t=>{if(this.scrollTableBlock){const e=this.editor.getCustom(mr(this.scrollTableBlock)),o=e.rootElement,r=e.scrollOptions.parentContainer,i=o.getBoundingClientRect(),s=window.innerHeight-this.getBarFloatWindowBottom(e),l=r.getBoundingClientRect(),a=Math.min(l.bottom,s),d=Math.max(l.top,0);i.bottom>a&&t.clientY>=a?this.setAutoScroll("bottom"):i.top<d&&t.clientY<=d?this.setAutoScroll("top"):o.scrollLeft>0&&t.clientX<i.left?this.setAutoScroll("left"):o.scrollLeft<o.scrollWidth-o.offsetWidth&&t.clientX>i.right?this.setAutoScroll("right"):this.clearAutoScroll()}},15));m(this,"handleMouseUp",()=>{document.removeEventListener("mousemove",this.handleAutoScroll),setTimeout(()=>{this.scrollTableBlock=null})});m(this,"handleSelectionChanged",t=>{const e=t.selection.range;if(e.isCollapsed()&&e.isSimple()){const o=t.getBlockById(e.start.blockId),r=Jr(o);if(r){const i=t.getCustom(mr(r)),s=i.rootElement.getBoundingClientRect(),l=So(t,o,e.start);if(s.left>l.left){const a=e.start.offset===0?yF:J9;i.rootElement.scrollLeft-=s.left-l.left+a}else if(l.right>s.right){const a=e.start.offset===0?kF:J9;i.rootElement.scrollLeft+=l.right-s.right+a}}}else{const o=t.getBlockById(e.start.blockId),r=Jr(o),i=t.getBlockById(e.end.blockId),s=Jr(i);if(r&&r===s){const l=t.getCustom(mr(r)),a=l.rootElement.getBoundingClientRect();let d=null;if(e.isSimple())d=e.isReverse()?So(t,o,e.start):So(t,i,e.end);else{const h=L0(Ur(t,e.start.childContainerId)),p=L0(Ur(t,e.end.childContainerId));d=e.isReverse()?h.getBoundingClientRect():p.getBoundingClientRect()}a.left>d.left&&e.isReverse()?l.rootElement.scrollLeft-=a.left-d.left:a.right<d.right&&!e.isReverse()&&(l.rootElement.scrollLeft+=d.right-a.right)}}});m(this,"handleScroll",t=>{xv(t),this.editor.selection.caret.update()});m(this,"handleReset",t=>{xv(t),this.editor.selection.caret.update();const e=this.editor.findCustom("table-border-bar");e&&e.handleScroll(),z9(t)});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),document.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mouseup",this.handleMouseUp)}getBarFloatWindowBottom(t){return t.scrollOptions.barFloatWindowBottom?typeof t.scrollOptions.barFloatWindowBottom=="number"?t.scrollOptions.barFloatWindowBottom:t.scrollOptions.barFloatWindowBottom():0}clearAutoScroll(){this.autoScrollTimer&&(clearInterval(this.autoScrollTimer),this.autoScrollTimer=null,this.autoScrollDir=null)}setAutoScroll(t){this.autoScrollDir&&this.autoScrollDir!==t&&this.clearAutoScroll(),this.autoScrollTimer||(this.autoScrollDir=t,this.autoScrollTimer=window.setInterval(()=>{if(this.scrollTableBlock){const e=this.editor.getCustom(mr(this.scrollTableBlock)),o=e.rootElement,r=e.scrollOptions.parentContainer,i=o.getBoundingClientRect(),s=r===document.documentElement?window.innerHeight:r.offsetHeight,l=window.innerHeight-this.getBarFloatWindowBottom(e),a=r.getBoundingClientRect(),d=Math.min(a.bottom,l),h=Math.max(a.top,0);this.autoScrollDir==="left"&&(o.scrollLeft-=Ef,o.scrollLeft<=0&&this.clearAutoScroll()),this.autoScrollDir==="right"&&(o.scrollLeft+=Ef,o.scrollLeft>=o.scrollWidth-o.offsetWidth&&this.clearAutoScroll()),this.autoScrollDir==="bottom"&&(r.scrollTop+=Ef,(r.scrollTop>=r.scrollHeight-s||i.bottom<=d)&&this.clearAutoScroll()),this.autoScrollDir==="top"&&(r.scrollTop-=Ef,(r.scrollTop<=0||i.top>=h)&&this.clearAutoScroll())}},100))}destroy(){document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mouseup",this.handleMouseUp),this.editor.removeListener("selectionChanged",this.handleSelectionChanged)}}function K9(n){return n.addCustom("table-scroll-events",t=>new wF(t))}const pr=S("create-content");function X9(n,t,e){const o=new Jh(e),r=e.rows,i=e.cols;g(pr,r>=1,`invalid rows: ${r}`),g(pr,i>=1,`invalid cols: ${i}`),g(pr,e.children,"no table children");const s=k("table",[],null),l=e.colsWidth,a=k("colgroup",[],s);for(let p=0;p<o.colCount;p++){const A=k("col",[],a);l[p]&&(A.style.width=`${l[p]}px`)}const d=k("tbody",[],s);let h=0;for(let p=0;p<r;p++){const A=k("tr",[],d);for(let v=0;v<i;v++){const B=o.getCell({col:v,row:p});if(B.virtual)g(pr,B.colSpan>1||B.rowSpan>1,"virtual cell should have colSpan or rowSpan");else{const D=e.children[h],x=k("td",[],A);B.colSpan>1&&(x.colSpan=B.colSpan),B.rowSpan>1&&(x.rowSpan=B.rowSpan);const _=e[uu(D)];_&&W(x,_),v===0&&e.hasColTitle&&W(x,Mv.COL_TITLE_ITEM),n.createChildContainer(t,x,D),h+=1}}}return g(pr,h===e.children.length,"container count mismatch"),e.noBorder&&W(s,"no-border"),e.chart&&W(s,"editor-table-chart"),e.isStripeStyle&&W(s,"stripe"),e.hasRowTitle&&W(s,"row-title"),e.hasColTitle&&W(s,"col-title"),s}function BF(n,t,e,o,r){g(pr,r.type==="table","not table data"),g(pr,ct(e)===t[t.length-1].containerId,"invalid path");const i=r,s=xs(o,"div");try{const l=k("div",[],null);l.setAttribute("data-type","table-content");const a=X9(n,t,i);a.classList.add("drag-preview-element"),l.appendChild(a);const d=n.getComponentOptions("table");Jv(n),n9(n),Z9(n,"create"),d!=null&&d.hideCellMenu||Q9(n),nL(n,Kp);const h=n.addCustom(mr(o),()=>AR());h.init({parentElement:s,childElement:l,safeRightSpace:50,safeLeftSpace:40,parentContainer:Gt(e)?n.scrollContainer:e,locatingContainer:Gt(e)?(d==null?void 0:d.locatingContainer)||n.parent:e,paddingLeft:ic+au,paddingTop:ic+au,paddingBottom:au/2,paddingRight:au/2,barFloatWindowBottom:d==null?void 0:d.barFloatWindowBottom,allowScrollBarFixed:d==null?void 0:d.allowScrollBarFixed,isSetScale:d==null?void 0:d.isSetScale});const p=K9(n);h.on("scroll",p.handleReset),h.on("resize",p.handleReset),setTimeout(()=>{YM(n,o)})}catch{const a=`invalid table data: ${JSON.stringify(i)}`;pr.error(a);const d=k("div",["error"],s);d.innerText=a}return s}function EF(n,t,e){g(pr,e.type==="table","not table data");const o=e,r=Lt(t);try{const i=_e(t),s=Mi(t),l=X9(n,s,o);l.classList.add("drag-preview-element"),i.insertAdjacentElement("afterend",l),i.remove();const a=n.getComponentOptions("table");Jv(n),n9(n),Z9(n,"update"),a!=null&&a.hideCellMenu||Q9(n),Kp(n,t)}catch{const s=`invalid table data: ${JSON.stringify(o)}`;pr.error(s);const l=k("div",["error"],r);l.innerText=s}}function xF(n,t){let e,o,r=!1;if([...t].every(A=>A==="|")?(o=t.length,e=Array(o).fill(""),r=!0):(e=Bm(t,"|").split("|"),o=e.length),o<2)return null;const i=3,s=o,l=[];for(let A=0;A<3;A++)e.forEach(v=>{l.push(Gr(n.doc,A===0?v:""))});const a=Array(s).fill(e0),d=l[r?0:s],h=n.doc.getContainerBlocks(d)[0].id;return{blockData:{id:K(),type:"table",rows:i,cols:s,children:l,colsWidth:a},focusBlockId:h}}function IF(n,t){const e=t.rows,o=t.cols;if(e<1||o<1)return null;const r=[];for(let d=0;d<e;d++)for(let h=0;h<o;h++)r.push(Gr(n.doc));const i=Array(o).fill(e0),s=r[0],l=n.doc.getContainerBlocks(s)[0].id;return{blockData:{id:K(),type:"table",rows:e,cols:o,children:r,colsWidth:i},focusBlockId:l}}const t7=S("table-selection-to-doc");function TF(n,t){const{start:e,end:o,block:r}=t,i=Dt(r);g(t7,i==="table",`invalid block type: ${i}`);const s=n.getBlockData(r);if(e.isSimple()&&o.isSimple())return Pi(n.editorBlocks,n.doc.toJSON(),s);g(t7,!e.isSimple()&&!o.isSimple(),"invalid block pos type");const l=Tt.fromBlock(r),{fromCol:a,toCol:d,fromRow:h,toRow:p}=Uo(r,e,o),A={},v=[],B=n.doc.toJSON();let D={};l.sub({row:h,col:a},{row:p,col:d}).forEach((rt,ft)=>{rt.forEach((Bt,jt)=>{const Ut=Bt.containerId;if(v.indexOf(Ut)!==-1)return;v.push(Ut);let ne;if(Bt.virtual){const $e=l.getCellByContainerId(Bt.containerId),Rn=a+jt;let Br=$e.col+$e.colSpan-1;Br>d&&(Br=d);const kn=Br-Rn+1;kn>1&&(A[`${Ut}_colSpan`]=kn);const an=h+ft;let Er=$e.row+$e.rowSpan-1;Er>p&&(Er=p);const ri=Er-an+1;ri>1&&(A[`${Ut}_rowSpan`]=ri),ne=qr()}else{if(ne=Fg(n.editorBlocks,B,Ut),Bt.col+Bt.colSpan>d+1){const $e=d-Bt.col+1;$e>1&&(A[`${Ut}_colSpan`]=$e)}else Bt.colSpan>1&&(A[`${Ut}_colSpan`]=Bt.colSpan);if(Bt.row+Bt.rowSpan>p+1){const $e=p-Bt.row+1;$e>1&&(A[`${Ut}_rowSpan`]=$e)}else Bt.rowSpan>1&&(A[`${Ut}_rowSpan`]=Bt.rowSpan)}const{root:qe,...Yn}=ne.blocks;D={...D,...Yn,[Ut]:qe}})});const _=gu(_e(r)).slice(a,d+1);return{blocks:{root:[{id:K(),type:i,children:v,colsWidth:_,rows:p-h+1,cols:d-a+1,...A}],...D},meta:{},comments:{}}}function DF(n,t){if(t.top===0)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.top-1][e]===n[t.top][e])return!1;return!0}function SF(n,t){if(t.left===0)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.left-1]===n[e][t.left])return!1;return!0}function LF(n,t){if(t.bottom===n.length-1)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.bottom][e]===n[t.bottom+1][e])return!1;return!0}function MF(n,t){if(t.right===n[0].length-1)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.right]===n[e][t.right+1])return!1;return!0}function RF(n,t,e){const o=t.col,r=t.row,i=e.col,s=e.row,l={left:o,top:r,right:i,bottom:s};let a=!1;do{if(a=!1,!DF(n,l)){l.top--,a=!0;continue}if(!SF(n,l)){l.left--,a=!0;continue}if(!LF(n,l)){l.bottom++,a=!0;continue}if(!MF(n,l)){l.right++,a=!0;continue}}while(a);return l}function OF(n,t,e,o){if(e.custom!==void 0||o.custom!==void 0)return{anchor:e,focus:o};const r=Tt.fromBlock(t),i=r.map(H=>H.containerId),s=r.getCellByContainerId(e.childContainerId),l=r.getCellByContainerId(o.childContainerId),a=Math.min(s.row,l.row),d=Math.max(s.row,l.row),h=Math.min(s.col,l.col),p=Math.max(s.col,l.col),A=RF(i,{row:a,col:h},{row:d,col:p}),v=r.getCell({row:A.top,col:A.left}),B=r.getCell({row:A.bottom,col:A.right}),D=r.getCell({row:A.top,col:A.right}),x=r.getCell({row:A.bottom,col:A.left});let _,R;return s.row<=l.row?s.col<=l.col?(_=v,R=B):(_=D,R=x):s.col<l.col?(_=x,R=D):(_=B,R=v),console.log(`move ${_.col}, ${_.row}, -> ${R.col}, ${R.row}`),{anchor:me(t,_.containerId),focus:me(t,R.containerId)}}function e7(n,t,e){if(e.isSimple())return[_e(t).getBoundingClientRect()];const o=_e(t),r=o.getBoundingClientRect(),{fromCol:i,fromRow:s,toCol:l,toRow:a}=Uo(t,e.start,e.end),d=gu(o),h=d.slice(0,i).reduce((D,x)=>D+x,0),p=h+d.slice(i,l+1).reduce((D,x)=>D+x,0),A=U9(o);let v=A.slice(0,s).reduce((D,x)=>D+x,0);const B=v+A.slice(s,a+1).reduce((D,x)=>D+x,0);if(s===0){const D=mF(n,t);v-=D}return[new DOMRect(r.left+h,r.top+v,p-h,B-v)]}S("table-size");const _F=40;function xf(n){const t=n.querySelector("td");if(!t)return 0;const e=window.getComputedStyle(t),o=Number.parseInt(e.borderLeft,10),r=Number.parseInt(e.borderRight,10);return(o+r)/2}function FF(n,t,e){const o=Zm(n,e.container);return o!==void 0?o+xf(t):_F*e.colSpan-xf(t)}function PF(n,t,e,o){let r=0;const i=e.colCount;for(let s=0;s<i;s++){const l=e.getCell({col:s,row:o});if(l.virtual)continue;let a=FF(n,t,l);const d=v4(l.container,{withPadding:!0});d&&d>a&&(a=d),r+=a+xf(t)}return r}function NF(n,t){const e=_e(t),o=Tt.fromTable(e);let r=0;for(let s=0;s<o.rowCount;s++)r=Math.max(r,PF(n,e,o,s));const i=xf(e);return r+=i,r}const Xr=S("table-creator");async function $F(n,t){return n.undoManager.runInGroup(()=>{var a,d;const e=t.item,o=(a=e.colCount)!=null?a:5,r=(d=e.rowCount)!=null?d:3,i=IF(n,{cols:o,rows:r});if(!i)return null;const{blockData:s,focusBlockId:l}=i;return n.insertBlock(t.containerId,t.blockIndex,s,ke(n,l,0))})}class HF{constructor(){m(this,"id","insert-table");m(this,"name","Create table");m(this,"element");m(this,"closeable",null);m(this,"colCount");m(this,"rowCount");m(this,"setCloseable",t=>{this.closeable=t});m(this,"destroy",()=>{this.closeable=null});m(this,"getTableCreatorCellId",(t,e)=>`table-creator-cell-${t}-${e}`);m(this,"handleTableCreatorClick",t=>{var A,v;t.preventDefault(),t.stopPropagation();const e=t.target;g(Xr,e instanceof HTMLElement,"invalid event target");const o=e.closest(".table-creator");g(Xr,o,"no table creator");const r=o.querySelectorAll(".active");if(r.length===0)return;const s=r[r.length-1].id;g(Xr,s,"no cell id");const l="table-creator-cell-";if(!s.startsWith(l))return;const d=s.substring(l.length).split("-");g(Xr,d.length===2,"invalid cell id");const h=Number.parseInt(d[0],10)+1,p=Number.parseInt(d[1],10)+1;Xr.debug(`${h}, ${p}`),this.colCount=p,this.rowCount=h,(A=this.closeable)==null||A.click(this,this.element),(v=this.closeable)==null||v.close("clickItem"),this.handleTableCreatorLeave()});m(this,"handleTableCreatorLeave",()=>{for(let t=0;t<9;t++)for(let e=0;e<9;e++){const o=this.getTableCreatorCellId(t,e),r=document.getElementById(o);r&&ot(r,"active")}});m(this,"handleTableCreatorCellEnter",t=>{const e=t.target;g(Xr,e instanceof HTMLElement,"invalid event target");const o=e.id,r="table-creator-cell-";g(Xr,o.startsWith(r),"invalid cell id");const s=o.substring(r.length).split("-");g(Xr,s.length===2,"invalid cell id");let l=Number.parseInt(s[0],10),a=Number.parseInt(s[1],10);l===0&&a===0&&(l=-1,a=-1);for(let d=0;d<9;d++)for(let h=0;h<9;h++){const p=this.getTableCreatorCellId(d,h),A=document.getElementById(p);g(Xr,A,"no cell"),d<=l&&h<=a?W(A,"active"):ot(A,"active")}});this.element=this.createTableCreatorElement()}createTableCreatorElement(){const t=k("div",["table-creator"],null),e=(o,r,i)=>{const s=k("div",["table-creator-cell"],o);return s.id=this.getTableCreatorCellId(r,i),s};t.addEventListener("click",this.handleTableCreatorClick),t.addEventListener("mouseleave",this.handleTableCreatorLeave);for(let o=0;o<9;o++){const r=k("div",["table-creator-row"],t);for(let i=0;i<9;i++)e(r,o,i).addEventListener("mouseenter",this.handleTableCreatorCellEnter)}return t}}function jF(){return new HF}function UF(n){const t=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g,e=n.match(t);return e?e.length:0}function n7(n){const t=UF(n);return n.length+t}function zF(n,t){const e=n7(n),o=t-e;return o>0?n+" ".repeat(o):n}function VF(n,t,e,o,r){const i=t,s=new Jh(i);if(o==="markdown"||o==="text"){const l=x=>e.blocks[x].map((H,z)=>o==="markdown"?xg(n,H,e,[...r,{containerId:x,blockIndex:z}]):yh(n,H,e,[...r,{containerId:x,blockIndex:z}])),a=x=>l(x).join(" ").replace(/\n/g," ").trim(),d=new Map,h=new Map;for(let x=0;x<s.colCount;x++){let _=0;for(let R=0;R<s.rowCount;R++){const H=s.getCell({row:R,col:x});let z="";H.virtual||(z=a(H.containerId)),d.set(`${R},${x}`,z),_=Math.max(_,n7(z))}h.set(x,_)}const p=x=>{const _=d.get(`${x.row},${x.col}`)||"",R=h.get(x.col)||0;return zF(_,R)},A=[];let v="|",B="|";for(let x=0;x<s.colCount;x++){const _=p({row:0,col:x});v+=` ${_} |`;const R="-".repeat((h.get(x)||0)+2);B+=`${R}|`}A.push(v),A.push(B);for(let x=1;x<s.rowCount;x++){let _="|";for(let R=0;R<s.colCount;R++){const H=p({row:x,col:R});_+=` ${H} |`}A.push(_)}return`${A.join(`
411
411
  `)}
412
412
  `}if(o==="html"){const l=d=>e.blocks[d].map((A,v)=>Eg(n,A,e,[...r,{containerId:d,blockIndex:v}])).join(`
413
413
  `),a=[];a.push("<table>");for(let d=0;d<s.rowCount;d++){let h="<tr>";for(let p=0;p<s.colCount;p++){const A=s.getCell({row:d,col:p});if(!A.virtual){const v=l(A.containerId);h+=`<td colSpan="${A.colSpan}" rowSpan="${A.rowSpan}">${v}</td>`}}h+="</tr>",a.push(h)}return a.push("</table>"),a.join(`
414
- `)}return""}const bu=S("table-block");function WF(n){return 1}function qF(n){return!!n.closest(`.${Gp}`)}function GF(n,t,e,o){const r=document.elementsFromPoint(e,o)[0];if(!r||!t.contains(r)||!n.contains(t))return null;let i=r;if(qF(r)&&(i=r.closest("td"),g(bu,i instanceof HTMLTableCellElement,"invalid element")),i instanceof HTMLTableCellElement){const a=_e(t);if(Bv(a).indexOf(i)!==-1){const h=su(i),p=me(t,ct(h));return new ir(n,{anchor:p,focus:p})}}if(!Nr(r))return null;const s=r;if(Y7(t).indexOf(s)===-1)return null;const l=me(t,ct(s));return new ir(n,{anchor:l,focus:l})}function ZF(n,t,e,o){return null}function QF(n,t){return n.getBoundingClientRect()}function o9(n,t,e,o){if(e.isSimple()){g(bu,o.isSimple(),"from is simple position but to is not simple position"),bu.debug("full select table"),W(t,"full-selected");return}g(bu,!o.isSimple(),"from is complex position but end is simple position");const r=Kr(n,t,e),i=Kr(n,t,o);g(bu,r.blockId===i.blockId,"only allow update one table selection"),zM(n,r,i).forEach(l=>{const a=L0(l);W(a,"selected")})}function YF(n){n.rootContainer.querySelectorAll('[data-type="editor-block"][data-block-type="table"]').forEach(t=>{ot(t,"full-selected"),t.querySelectorAll("td.selected").forEach(e=>{ot(e,"selected")})})}function JF(n,t){return Ev(t)?Y7(t):[]}function KF(n,t,e,o,r){return M0(t,e,o,r)}function XF(n,t){return NF(n,t)}function tP(n,t){return et(n,t)?xF(n,n.getBlockString(t).trim()):null}function eP(n){return{name:"TableBlock",insertBlockCommandItems:[{id:"insert-table",name:L.t("table.title"),order:200,icon:BL,children:[jF()],group:"common",subText:An("insert-table")}],handleInsertEmptyBlock:$F}}function nP(n,t,e){return EF(n,t,e),setTimeout(()=>{const o=n.selection.range;o.isSimple()?n.selection.caret.update():o9(n,t,o.start,o.end)}),!0}function oP(n,t){let e=0;const{selectedColumns:o}=Hp(n,t);if(o.size>0){const{fromCol:i,toCol:s}=Uo(t,n.selection.range.start,n.selection.range.end),l=Tt.fromBlock(t);(i!==0||s!==l.colCount-1)&&(e=60)}const r=e9(n,t,n.selection.range)[0];return new DOMRect(r.left,r.top+e,r.width,Math.max(r.height-e*2,0))}function rP(n,t){oL(n,Kp);const e=n.findCustom(mr(t));if(e){const o=K7(n);e.off("scroll",o.handleReset),e.off("resize",o.handleReset),e.destroy()}}function iP(){return{abstract:`${L.t("table.abstract")}`}}const R0={blockType:"table",blockKind:"complex",enableKeyboardSelect:!0,createBlockContent:BF,getBlockTextLength:WF,getRangeFromPoint:GF,moveCaret:ZF,getCaretRect:QF,updateSelection:o9,clearSelection:YF,getChildContainers:JF,getNextContainer:KF,getMinWidth:XF,getSelectedContainers:Qp,convertFrom:tP,convertTo:VF,adjustSelectionPos:OF,getClientRects:e9,selectionToDoc:TF,getOptions:eP,getTextToolbarReferenceClient:oP,handleUpdateBlock:nP,handleDeleteBlock:rP,getBlockProperties:iP},sP={table:{cellBackground:"\u5355\u5143\u683C\u80CC\u666F\u8272",deleteSelectRow:"\u5220\u9664\u6240\u9009\u884C",deleteSelectCol:"\u5220\u9664\u6240\u9009\u5217",mergeCell:"\u5408\u5E76\u5355\u5143\u683C",splitCell:"\u62C6\u5206\u5355\u5143\u683C",tableConfigKey:"\u8868\u683C\u8BBE\u7F6E",deleteTable:"\u5220\u9664\u8868\u683C",insertCol:"\u63D2\u5165\u5217",insertRow:"\u63D2\u5165\u884C",deleteCol:"\u5220\u9664\u5217",deleteRow:"\u5220\u9664\u884C",tableConfig:{rowTitle:"\u884C\u6807\u9898",colTitle:"\u5217\u6807\u9898",stripeStyle:"\u6761\u7EB9\u6837\u5F0F",hideBorder:"\u9690\u85CF\u8868\u683C\u7EBF",showBorder:"\u663E\u793A\u8868\u683C\u7EBF",showChart:"\u663E\u793A\u56FE\u8868",hideChart:"\u9690\u85CF\u56FE\u8868"},title:"\u8868\u683C",abstract:"\u8868\u683C"}},lP={table:{cellBackground:"Cell background color",deleteSelectRow:"Delete selected rows",deleteSelectCol:"Delete selected columns",mergeCell:"Merge cells",splitCell:"Split cell",tableConfigKey:"Table settings",deleteTable:"Delete table",insertCol:"Insert column",insertRow:"Insert row",deleteCol:"Delete column",deleteRow:"Delete row",tableConfig:{rowTitle:"Row header",colTitle:"Column header",stripeStyle:"Stripe style",hideBorder:"Hide border",showBorder:"Show border",showChart:"Show chart",hideChart:"Hide chart"},title:"Table",abstract:"Table"}},cP={table:{cellBackground:"\u30BB\u30EB\u306E\u80CC\u666F\u8272",deleteSelectRow:"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",deleteSelectCol:"\u9078\u629E\u3057\u305F\u5217\u3092\u524A\u9664",mergeCell:"\u30BB\u30EB\u3092\u7D50\u5408",splitCell:"\u30BB\u30EB\u306E\u7D50\u5408\u3092\u89E3\u9664",tableConfigKey:"\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A",deleteTable:"\u30C6\u30FC\u30D6\u30EB\u3092\u524A\u9664",insertCol:"\u5217\u3092\u633F\u5165",insertRow:"\u884C\u3092\u633F\u5165",deleteCol:"\u5217\u3092\u524A\u9664",deleteRow:"\u884C\u3092\u524A\u9664",tableConfig:{rowTitle:"\u884C\u898B\u51FA\u3057",colTitle:"\u5217\u898B\u51FA\u3057",stripeStyle:"\u7E1E\u6A21\u69D8",hideBorder:"\u67A0\u7DDA\u3092\u975E\u8868\u793A",showBorder:"\u67A0\u7DDA\u3092\u8868\u793A",showChart:"\u30B0\u30E9\u30D5\u3092\u8868\u793A",hideChart:"\u30B0\u30E9\u30D5\u3092\u975E\u8868\u793A"},title:"\u30C6\u30FC\u30D6\u30EB",abstract:"\u30C6\u30FC\u30D6\u30EB"}};L.mergeLang({"zh-CN":sP,"en-US":lP,"ja-JP":cP});const Pnt="",r9=S("table");function i9(n,t){const e=$p(t);if(!e)return;const o=tt(e);g(r9,o&&Ve(o),"not a table block");const r=M0(o,e,"ArrowRight");if(!r){const s=Qt(o);return s?(n.selection.selectBlock(s,0),!0):i9(n,o)}const i=ye(r);return n.selection.selectBlock(i,0),!0}function aP(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!t)return i9(n,t)}function s9(n,t){const e=$p(t);if(!e)return;const o=tt(e);g(r9,o&&Ve(o),"not a table block");const r=M0(o,e,"ArrowLeft");if(!r){const s=ce(o);return s?(n.selection.selectBlock(s,ut(n,s)),!0):s9(n,o)}const i=Qe(r);return n.selection.selectBlock(i,ut(n,i)),!0}function uP(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!t)return s9(n,t)}const O0={Tab:aP,"Shift+Tab":uP},l9=S("code-dom");function Cr(n){return Dt(n)==="code"}function c9(n,t,e){e.language?t.setAttribute("data-language",e.language):t.removeAttribute("data-language"),e.nowrap?ot(t,"wrap"):W(t,"wrap")}function _0(n){const t=n.closest("div[data-type=editor-block][data-block-type=code]");return g(l9,t,"no parent code block"),g(l9,Cr(t),"not a code block"),t}const vu={plain:{name:"Plain Text",aliases:["txt","text"]},abap:{name:"ABAP",aliases:["abap"]},arduino:{name:"Arduino",aliases:["ino"]},bash:{name:"Bash",aliases:["sh","shell"]},basic:{name:"BASIC",aliases:["bas"]},c:{name:"C",aliases:["c"]},clojure:{name:"Clojure",aliases:["clj"]},cofeescript:{name:"CoffeeScript",aliases:["coffee"]},cpp:{name:"C++",aliases:["cpp","cxx"]},csharp:{name:"C#",aliases:["cs"]},css:{name:"CSS",aliases:["css"]},dart:{name:"Dart",aliases:["dart"]},diff:{name:"Diff",aliases:["diff","patch"]},docker:{name:"Docker",aliases:["dockerfile"]},elixir:{name:"Elixir",aliases:["ex","exs"]},elm:{name:"Elm",aliases:["elm"]},erlang:{name:"Erlang",aliases:["erl"]},flow:{name:"Flow",aliases:["flow"]},fortran:{name:"Fortran",aliases:["f","for","f77","f90"]},fsharp:{name:"F#",aliases:["fsharp"]},gherkin:{name:"Gherkin",aliases:["feature"]},glsl:{name:"GLSL",aliases:["glsl"]},go:{name:"Go",aliases:["go"]},graphql:{name:"GraphQL",aliases:["graphql"]},groovy:{name:"Groovy",aliases:["groovy"]},haskell:{name:"Haskell",aliases:["hs"]},java:{name:"Java",aliases:["java"]},js:{name:"JavaScript",aliases:["js","jsx"]},json:{name:"JSON",aliases:["json"]},julia:{name:"Julia",aliases:["jl"]},kotlin:{name:"Kotlin",aliases:["kt","ktm","kts"]},latex:{name:"LaTeX",aliases:["tex"]},less:{name:"LESS",aliases:["less"]},lisp:{name:"Lisp",aliases:["lisp"]},livescript:{name:"LiveScript",aliases:["ls"]},lua:{name:"Lua",aliases:["lua"]},makefile:{name:"Makefile",aliases:["mk","mak"]},markdown:{name:"Markdown",aliases:["md","mkdown","mkd"]},markup:{name:"HTML / XML",aliases:["html","htm","xml","xsd","xsl","xslt","wsdl"]},matlab:{name:"MATLAB",aliases:["matlab"]},mermaid:{name:"Mermaid",aliases:["mermaid"]},nix:{name:"Nix",aliases:["nix"]},objectivec:{name:"Objective-C",aliases:["m","mm"]},ocaml:{name:"OCaml",aliases:["ml"]},pascal:{name:"Pascal",aliases:["pas"]},perl:{name:"Perl",aliases:["pl","pm"]},php:{name:"PHP",aliases:["php"]},powershell:{name:"PowerShell",aliases:["ps","ps1"]},prolog:{name:"Prolog",aliases:["plg"]},protobuf:{name:"Protocol Buffers",aliases:["proto"]},python:{name:"Python",aliases:["py"]},r:{name:"R",aliases:["r"]},reason:{name:"Reason",aliases:["re","rei"]},ruby:{name:"Ruby",aliases:["rb"]},rust:{name:"Rust",aliases:["rs"]},sass:{name:"Sass",aliases:["sass"]},scala:{name:"Scala",aliases:["scala"]},scheme:{name:"Scheme",aliases:["scm","sm"]},scss:{name:"SCSS",aliases:["scss"]},solidity:{name:"Solidity",aliases:["sol"]},sql:{name:"SQL",aliases:["sql"]},swift:{name:"Swift",aliases:["swift"]},typescript:{name:"TypeScript",aliases:["ts","tsx"]},vbnet:{name:"VB.Net",aliases:["vbnet"]},verilog:{name:"Verilog",aliases:["v"]},vhdl:{name:"VHDL",aliases:["vhdl"]},"visual-basic":{name:"Visual Basic",aliases:["vb","vba"]},wasm:{name:"WebAssembly",aliases:["wasm"]},yaml:{name:"YAML",aliases:["yaml"]}};function a9(n){const t=n.toLocaleLowerCase();let e="";return Object.entries(vu).forEach(([o,r])=>{(o===t||r.aliases.includes(t)||r.name.toLocaleLowerCase()===t)&&(e=o)}),e}function u9(n){const t=n.settingsProvider.getItem("editor-code-lang");return t!=null?t:"plain"}function dP(n,t){return n.settingsProvider.setItem("editor-code-lang",t)}const hP=S("convert-to-code");function fP(n,t){if(!et(n,t))return null;const e={id:K(),type:"text",text:[]},o=K();n.doc.localInsertChildContainer(o,[e]);const r=n.getBlockData(t).text;g(hP,r,"no text");let i=ie(r);i.startsWith("```")&&(i=i.substring(3));const s=a9(i)||u9(n)||"plain";return{blockData:{id:K(),type:"code",language:s,children:[o]},focusBlockId:e.id}}const Nnt="",F0=S("code-block-child-container");function Ac(n){g(F0,Cr(n),"not a code block");const e=Lt(n).querySelector(":scope > div.editor-code-root > div.code-text-root [data-type=editor-container].child");return g(F0,e,"no code text container"),e}function Qs(n){g(F0,Cr(n),"not a code block");const e=Lt(n).querySelector(":scope > div.editor-code-root > div.code-caption-root [data-type=editor-container].child");return e||null}function If(n){const t=[Ac(n)],e=Qs(n);return e&&t.push(e),t}function bc(n,t){if(!et(n,t))return!1;const e=nt(t),o=tt(e);return o?Cr(o)?e===Ac(o):Dt(t)==="code":!1}const P0=S("code-caption");function mP(n,t){if(n.readonly)return;const e=Qs(t);if(e){const a=ye(e);n.selection.selectBlock(a,0);return}const o=Gr(n.doc),r=n.getBlockData(t);g(P0,r.children.length===1,"code block should have only one child");const i={...r,children:[r.children[0],o]};n.updateBlockData(t,i);const s=n.getContainerById(o),l=ye(s);n.selection.selectBlock(l,0)}function d9(n,t){const e=nt(t);if(Gt(e))return!1;const o=tt(e);if(g(P0,o,"no parent block"),!Cr(o))return!1;const i=Qs(o);return e===i}function gP(n,t){if(n.readonly||!Qs(t))return;const o=Ac(t),r=Qe(o);n.selection.selectBlock(r,ut(n,r));const i=n.getBlockData(t);g(P0,i.children.length===2,"code block should have only one child");const s=i.children[1],l={...i,children:[i.children[0]]};n.updateBlockData(t,l),n.deleteChildContainers([s])}const pP=S("paste-in-table-block");class CP{constructor(t){this.editor=t,setTimeout(()=>{t.input.addHandler(this)})}destroy(){}async handleBeforePaste(t,e,o){if(!t.selection.range.isSimple())return!1;const r=t.selection.range.start,i=t.getBlockById(r.blockId),s=nt(i);if(Gt(s))return!1;const l=tt(s);if(g(pP,l,"no parent block"),!Cr(l)||d9(t,i))return!1;const a=o["text/x-ones-editor-doc"];let d=null;if(a){const p=Ma(t,a);d=qr(p)}else d=o["text/plain"];if(!d)return!0;const h=d;return t.undoManager.runInGroup(()=>{t.clearSelectedContents(),t.insertDoc(i,r.offset,h)}),!0}}function AP(n){n.addCustom("code-block-paste-event",t=>new CP(t))}class bP{constructor(t){m(this,"id","CodeBlockCommandProvider");setTimeout(()=>{t.editorCommandProviders.registerCommandProvider(this)})}destroy(){}getAvailableCommands(){return[]}executeCommand(){return!1}filterCommands(t,e,o,r){if(bc(t,e))return[]}beforeExecuteCommand(t,e,o,r,i){return!!bc(t,e)}}function vP(n){n.addCustom("code-block-command-provider",t=>new bP(t))}const yP=S("code-caption-input-handler");function N0(n){if(!n.selection.range.isSimple())return null;const t=n.selection.range.start;if(!t.isSimple())return null;const e=n.getBlockById(t.blockId);return d9(n,e)?e:null}function kP(n,t){var i;const e=N0(n);if(or(t,"Shift+Enter")){const s=n.selection.range.start;return!!((i=n.getBlockById(s.blockId).closest("div[data-type=editor-block][data-block-type=code]"))!=null?i:null)}if(!e)return!1;const o=_0(e),r=Qt(o);return r?(n.selection.selectBlock(r,0),!0):(n.insertTextBlock("",ct(nt(o)),bt(o)+1),!0)}function wP(n,t){if(ae(n,t)){const e=_0(t);return gP(n,e),!0}return!1}function BP(n){var e;const{start:t}=n.selection.range;if(t.isSimple()){const o=n.getBlockById(t.blockId),r=(e=o.closest("div[data-type=editor-block][data-block-type=code]"))!=null?e:null;if(!r)return!1;const i=Qs(r),s=i&&!ae(n,ye(i));if(!r||!ae(n,o)||s)return!1;const l=gn(n,r)[0],a=fe(l);if(a.length>1)return!1;if(l&&a[0]===o)return n.deleteBlock(r),!0}return!1}function EP(n){const t=N0(n);return t?wP(n,t):BP(n)}class $0{constructor(t){setTimeout(()=>{t.input.addHandler(this)})}destroy(){}handleBeforeKeyDown(t,e){return e.key==="Enter"?kP(t,e):e.key==="Backspace"?EP(t):!1}async handleBeforePaste(t,e,o){const r=N0(t);if(!r)return!1;const i=o["text/plain"];if(!i)return!0;const s=Ma(t,i);return s&&t.undoManager.runInGroup(()=>{t.clearSelectedContents();const l=t.selection.range.start;g(yP,l.isSimple(),"not simple position"),t.insertTextToBlock(r,l.offset,s)}),!0}static init(t){t.addCustom("code-block-caption-input-handler",e=>new $0(e))}}function xP(n){const o=new DOMParser().parseFromString(n,"text/html").querySelector("svg");if(!o)return null;const r=o.getAttribute("viewBox");if(!r)return null;const i=r.split(" ");if(i.length===4){const s=i[2],l=i[3];return o.setAttribute("width",s),o.setAttribute("height",l),o.outerHTML}return null}function H0(n,t,e=!0){const o=new Image,r=document.createElement("canvas"),i=r.getContext("2d");if(!i){t(new Error("failed to get context"),null);return}o.onload=()=>{if(r.width=o.naturalWidth,r.height=o.naturalHeight,e&&(r.width===0||r.height===0)){const s=n.substring(26);if(s){const l=atob(s),a=xP(l);if(a){Dm(a,"image/svg+xml").then(d=>{H0(d,t,!1)});return}}t(null,null);return}i.drawImage(o,0,0),r.toBlob(s=>{t(null,s)},"image/png")},o.src=n}function IP(n){return new Promise((t,e)=>{H0(n,(o,r)=>{if(o){e(o);return}if(!r){e(new Error("Failed to get image blob"));return}t(r)})})}async function h9(n){const t=await jl(n);return new Promise((e,o)=>{H0(t,(r,i)=>{if(r){o(r);return}if(!i){o(new Error("Failed to get image blob"));return}e(i)})})}const f9="Untitled";function m9(n){const t=ye(n.rootContainer);return!t||!et(n,t)?f9:n.getBlockString(t)||f9}function j0(){return Object.prototype.hasOwnProperty.bind(window,"isSecureContext")?window.isSecureContext:window.location.protocol==="https:"||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function TP(n){let t;return n.forEach((e,o)=>{o.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function g9(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),o=TP(t.headers).toLocaleLowerCase();let r="";if(o){const s=gm.default[o].extensions;s&&s.length>0&&(r=s[0])}return new File([e],`${Date.now()}.${r}`,{type:o})}catch{return null}}const DP=`
414
+ `)}return""}const bu=S("table-block");function WF(n){return 1}function qF(n){return!!n.closest(`.${Gp}`)}function GF(n,t,e,o){const r=document.elementsFromPoint(e,o)[0];if(!r||!t.contains(r)||!n.contains(t))return null;let i=r;if(qF(r)&&(i=r.closest("td"),g(bu,i instanceof HTMLTableCellElement,"invalid element")),i instanceof HTMLTableCellElement){const a=_e(t);if(Bv(a).indexOf(i)!==-1){const h=su(i),p=me(t,ct(h));return new ir(n,{anchor:p,focus:p})}}if(!Nr(r))return null;const s=r;if(Y9(t).indexOf(s)===-1)return null;const l=me(t,ct(s));return new ir(n,{anchor:l,focus:l})}function ZF(n,t,e,o){return null}function QF(n,t){return n.getBoundingClientRect()}function o7(n,t,e,o){if(e.isSimple()){g(bu,o.isSimple(),"from is simple position but to is not simple position"),bu.debug("full select table"),W(t,"full-selected");return}g(bu,!o.isSimple(),"from is complex position but end is simple position");const r=Kr(n,t,e),i=Kr(n,t,o);g(bu,r.blockId===i.blockId,"only allow update one table selection"),zM(n,r,i).forEach(l=>{const a=L0(l);W(a,"selected")})}function YF(n){n.rootContainer.querySelectorAll('[data-type="editor-block"][data-block-type="table"]').forEach(t=>{ot(t,"full-selected"),t.querySelectorAll("td.selected").forEach(e=>{ot(e,"selected")})})}function JF(n,t){return Ev(t)?Y9(t):[]}function KF(n,t,e,o,r){return M0(t,e,o,r)}function XF(n,t){return NF(n,t)}function tP(n,t){return et(n,t)?xF(n,n.getBlockString(t).trim()):null}function eP(n){return{name:"TableBlock",insertBlockCommandItems:[{id:"insert-table",name:L.t("table.title"),order:200,icon:BL,children:[jF()],group:"common",subText:An("insert-table")}],handleInsertEmptyBlock:$F}}function nP(n,t,e){return EF(n,t,e),setTimeout(()=>{const o=n.selection.range;o.isSimple()?n.selection.caret.update():o7(n,t,o.start,o.end)}),!0}function oP(n,t){let e=0;const{selectedColumns:o}=Hp(n,t);if(o.size>0){const{fromCol:i,toCol:s}=Uo(t,n.selection.range.start,n.selection.range.end),l=Tt.fromBlock(t);(i!==0||s!==l.colCount-1)&&(e=60)}const r=e7(n,t,n.selection.range)[0];return new DOMRect(r.left,r.top+e,r.width,Math.max(r.height-e*2,0))}function rP(n,t){oL(n,Kp);const e=n.findCustom(mr(t));if(e){const o=K9(n);e.off("scroll",o.handleReset),e.off("resize",o.handleReset),e.destroy()}}function iP(){return{abstract:`${L.t("table.abstract")}`}}const R0={blockType:"table",blockKind:"complex",enableKeyboardSelect:!0,createBlockContent:BF,getBlockTextLength:WF,getRangeFromPoint:GF,moveCaret:ZF,getCaretRect:QF,updateSelection:o7,clearSelection:YF,getChildContainers:JF,getNextContainer:KF,getMinWidth:XF,getSelectedContainers:Qp,convertFrom:tP,convertTo:VF,adjustSelectionPos:OF,getClientRects:e7,selectionToDoc:TF,getOptions:eP,getTextToolbarReferenceClient:oP,handleUpdateBlock:nP,handleDeleteBlock:rP,getBlockProperties:iP},sP={table:{cellBackground:"\u5355\u5143\u683C\u80CC\u666F\u8272",deleteSelectRow:"\u5220\u9664\u6240\u9009\u884C",deleteSelectCol:"\u5220\u9664\u6240\u9009\u5217",mergeCell:"\u5408\u5E76\u5355\u5143\u683C",splitCell:"\u62C6\u5206\u5355\u5143\u683C",tableConfigKey:"\u8868\u683C\u8BBE\u7F6E",deleteTable:"\u5220\u9664\u8868\u683C",insertCol:"\u63D2\u5165\u5217",insertRow:"\u63D2\u5165\u884C",deleteCol:"\u5220\u9664\u5217",deleteRow:"\u5220\u9664\u884C",tableConfig:{rowTitle:"\u884C\u6807\u9898",colTitle:"\u5217\u6807\u9898",stripeStyle:"\u6761\u7EB9\u6837\u5F0F",hideBorder:"\u9690\u85CF\u8868\u683C\u7EBF",showBorder:"\u663E\u793A\u8868\u683C\u7EBF",showChart:"\u663E\u793A\u56FE\u8868",hideChart:"\u9690\u85CF\u56FE\u8868"},title:"\u8868\u683C",abstract:"\u8868\u683C"}},lP={table:{cellBackground:"Cell background color",deleteSelectRow:"Delete selected rows",deleteSelectCol:"Delete selected columns",mergeCell:"Merge cells",splitCell:"Split cell",tableConfigKey:"Table settings",deleteTable:"Delete table",insertCol:"Insert column",insertRow:"Insert row",deleteCol:"Delete column",deleteRow:"Delete row",tableConfig:{rowTitle:"Row header",colTitle:"Column header",stripeStyle:"Stripe style",hideBorder:"Hide border",showBorder:"Show border",showChart:"Show chart",hideChart:"Hide chart"},title:"Table",abstract:"Table"}},cP={table:{cellBackground:"\u30BB\u30EB\u306E\u80CC\u666F\u8272",deleteSelectRow:"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",deleteSelectCol:"\u9078\u629E\u3057\u305F\u5217\u3092\u524A\u9664",mergeCell:"\u30BB\u30EB\u3092\u7D50\u5408",splitCell:"\u30BB\u30EB\u306E\u7D50\u5408\u3092\u89E3\u9664",tableConfigKey:"\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A",deleteTable:"\u30C6\u30FC\u30D6\u30EB\u3092\u524A\u9664",insertCol:"\u5217\u3092\u633F\u5165",insertRow:"\u884C\u3092\u633F\u5165",deleteCol:"\u5217\u3092\u524A\u9664",deleteRow:"\u884C\u3092\u524A\u9664",tableConfig:{rowTitle:"\u884C\u898B\u51FA\u3057",colTitle:"\u5217\u898B\u51FA\u3057",stripeStyle:"\u7E1E\u6A21\u69D8",hideBorder:"\u67A0\u7DDA\u3092\u975E\u8868\u793A",showBorder:"\u67A0\u7DDA\u3092\u8868\u793A",showChart:"\u30B0\u30E9\u30D5\u3092\u8868\u793A",hideChart:"\u30B0\u30E9\u30D5\u3092\u975E\u8868\u793A"},title:"\u30C6\u30FC\u30D6\u30EB",abstract:"\u30C6\u30FC\u30D6\u30EB"}};L.mergeLang({"zh-CN":sP,"en-US":lP,"ja-JP":cP});const Pnt="",r7=S("table");function i7(n,t){const e=$p(t);if(!e)return;const o=tt(e);g(r7,o&&Ve(o),"not a table block");const r=M0(o,e,"ArrowRight");if(!r){const s=Qt(o);return s?(n.selection.selectBlock(s,0),!0):i7(n,o)}const i=ye(r);return n.selection.selectBlock(i,0),!0}function aP(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!t)return i7(n,t)}function s7(n,t){const e=$p(t);if(!e)return;const o=tt(e);g(r7,o&&Ve(o),"not a table block");const r=M0(o,e,"ArrowLeft");if(!r){const s=ce(o);return s?(n.selection.selectBlock(s,ut(n,s)),!0):s7(n,o)}const i=Qe(r);return n.selection.selectBlock(i,ut(n,i)),!0}function uP(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!t)return s7(n,t)}const O0={Tab:aP,"Shift+Tab":uP},l7=S("code-dom");function Cr(n){return Dt(n)==="code"}function c7(n,t,e){e.language?t.setAttribute("data-language",e.language):t.removeAttribute("data-language"),e.nowrap?ot(t,"wrap"):W(t,"wrap")}function _0(n){const t=n.closest("div[data-type=editor-block][data-block-type=code]");return g(l7,t,"no parent code block"),g(l7,Cr(t),"not a code block"),t}const vu={plain:{name:"Plain Text",aliases:["txt","text"]},abap:{name:"ABAP",aliases:["abap"]},arduino:{name:"Arduino",aliases:["ino"]},bash:{name:"Bash",aliases:["sh","shell"]},basic:{name:"BASIC",aliases:["bas"]},c:{name:"C",aliases:["c"]},clojure:{name:"Clojure",aliases:["clj"]},cofeescript:{name:"CoffeeScript",aliases:["coffee"]},cpp:{name:"C++",aliases:["cpp","cxx"]},csharp:{name:"C#",aliases:["cs"]},css:{name:"CSS",aliases:["css"]},dart:{name:"Dart",aliases:["dart"]},diff:{name:"Diff",aliases:["diff","patch"]},docker:{name:"Docker",aliases:["dockerfile"]},elixir:{name:"Elixir",aliases:["ex","exs"]},elm:{name:"Elm",aliases:["elm"]},erlang:{name:"Erlang",aliases:["erl"]},flow:{name:"Flow",aliases:["flow"]},fortran:{name:"Fortran",aliases:["f","for","f77","f90"]},fsharp:{name:"F#",aliases:["fsharp"]},gherkin:{name:"Gherkin",aliases:["feature"]},glsl:{name:"GLSL",aliases:["glsl"]},go:{name:"Go",aliases:["go"]},graphql:{name:"GraphQL",aliases:["graphql"]},groovy:{name:"Groovy",aliases:["groovy"]},haskell:{name:"Haskell",aliases:["hs"]},java:{name:"Java",aliases:["java"]},js:{name:"JavaScript",aliases:["js","jsx"]},json:{name:"JSON",aliases:["json"]},julia:{name:"Julia",aliases:["jl"]},kotlin:{name:"Kotlin",aliases:["kt","ktm","kts"]},latex:{name:"LaTeX",aliases:["tex"]},less:{name:"LESS",aliases:["less"]},lisp:{name:"Lisp",aliases:["lisp"]},livescript:{name:"LiveScript",aliases:["ls"]},lua:{name:"Lua",aliases:["lua"]},makefile:{name:"Makefile",aliases:["mk","mak"]},markdown:{name:"Markdown",aliases:["md","mkdown","mkd"]},markup:{name:"HTML / XML",aliases:["html","htm","xml","xsd","xsl","xslt","wsdl"]},matlab:{name:"MATLAB",aliases:["matlab"]},mermaid:{name:"Mermaid",aliases:["mermaid"]},nix:{name:"Nix",aliases:["nix"]},objectivec:{name:"Objective-C",aliases:["m","mm"]},ocaml:{name:"OCaml",aliases:["ml"]},pascal:{name:"Pascal",aliases:["pas"]},perl:{name:"Perl",aliases:["pl","pm"]},php:{name:"PHP",aliases:["php"]},powershell:{name:"PowerShell",aliases:["ps","ps1"]},prolog:{name:"Prolog",aliases:["plg"]},protobuf:{name:"Protocol Buffers",aliases:["proto"]},python:{name:"Python",aliases:["py"]},r:{name:"R",aliases:["r"]},reason:{name:"Reason",aliases:["re","rei"]},ruby:{name:"Ruby",aliases:["rb"]},rust:{name:"Rust",aliases:["rs"]},sass:{name:"Sass",aliases:["sass"]},scala:{name:"Scala",aliases:["scala"]},scheme:{name:"Scheme",aliases:["scm","sm"]},scss:{name:"SCSS",aliases:["scss"]},solidity:{name:"Solidity",aliases:["sol"]},sql:{name:"SQL",aliases:["sql"]},swift:{name:"Swift",aliases:["swift"]},typescript:{name:"TypeScript",aliases:["ts","tsx"]},vbnet:{name:"VB.Net",aliases:["vbnet"]},verilog:{name:"Verilog",aliases:["v"]},vhdl:{name:"VHDL",aliases:["vhdl"]},"visual-basic":{name:"Visual Basic",aliases:["vb","vba"]},wasm:{name:"WebAssembly",aliases:["wasm"]},yaml:{name:"YAML",aliases:["yaml"]}};function a7(n){const t=n.toLocaleLowerCase();let e="";return Object.entries(vu).forEach(([o,r])=>{(o===t||r.aliases.includes(t)||r.name.toLocaleLowerCase()===t)&&(e=o)}),e}function u7(n){const t=n.settingsProvider.getItem("editor-code-lang");return t!=null?t:"plain"}function dP(n,t){return n.settingsProvider.setItem("editor-code-lang",t)}const hP=S("convert-to-code");function fP(n,t){if(!et(n,t))return null;const e={id:K(),type:"text",text:[]},o=K();n.doc.localInsertChildContainer(o,[e]);const r=n.getBlockData(t).text;g(hP,r,"no text");let i=ie(r);i.startsWith("```")&&(i=i.substring(3));const s=a7(i)||u7(n)||"plain";return{blockData:{id:K(),type:"code",language:s,children:[o]},focusBlockId:e.id}}const Nnt="",F0=S("code-block-child-container");function Ac(n){g(F0,Cr(n),"not a code block");const e=Lt(n).querySelector(":scope > div.editor-code-root > div.code-text-root [data-type=editor-container].child");return g(F0,e,"no code text container"),e}function Qs(n){g(F0,Cr(n),"not a code block");const e=Lt(n).querySelector(":scope > div.editor-code-root > div.code-caption-root [data-type=editor-container].child");return e||null}function If(n){const t=[Ac(n)],e=Qs(n);return e&&t.push(e),t}function bc(n,t){if(!et(n,t))return!1;const e=nt(t),o=tt(e);return o?Cr(o)?e===Ac(o):Dt(t)==="code":!1}const P0=S("code-caption");function mP(n,t){if(n.readonly)return;const e=Qs(t);if(e){const a=ye(e);n.selection.selectBlock(a,0);return}const o=Gr(n.doc),r=n.getBlockData(t);g(P0,r.children.length===1,"code block should have only one child");const i={...r,children:[r.children[0],o]};n.updateBlockData(t,i);const s=n.getContainerById(o),l=ye(s);n.selection.selectBlock(l,0)}function d7(n,t){const e=nt(t);if(Gt(e))return!1;const o=tt(e);if(g(P0,o,"no parent block"),!Cr(o))return!1;const i=Qs(o);return e===i}function gP(n,t){if(n.readonly||!Qs(t))return;const o=Ac(t),r=Qe(o);n.selection.selectBlock(r,ut(n,r));const i=n.getBlockData(t);g(P0,i.children.length===2,"code block should have only one child");const s=i.children[1],l={...i,children:[i.children[0]]};n.updateBlockData(t,l),n.deleteChildContainers([s])}const pP=S("paste-in-table-block");class CP{constructor(t){this.editor=t,setTimeout(()=>{t.input.addHandler(this)})}destroy(){}async handleBeforePaste(t,e,o){if(!t.selection.range.isSimple())return!1;const r=t.selection.range.start,i=t.getBlockById(r.blockId),s=nt(i);if(Gt(s))return!1;const l=tt(s);if(g(pP,l,"no parent block"),!Cr(l)||d7(t,i))return!1;const a=o["text/x-ones-editor-doc"];let d=null;if(a){const p=Ma(t,a);d=qr(p)}else d=o["text/plain"];if(!d)return!0;const h=d;return t.undoManager.runInGroup(()=>{t.clearSelectedContents(),t.insertDoc(i,r.offset,h)}),!0}}function AP(n){n.addCustom("code-block-paste-event",t=>new CP(t))}class bP{constructor(t){m(this,"id","CodeBlockCommandProvider");setTimeout(()=>{t.editorCommandProviders.registerCommandProvider(this)})}destroy(){}getAvailableCommands(){return[]}executeCommand(){return!1}filterCommands(t,e,o,r){if(bc(t,e))return[]}beforeExecuteCommand(t,e,o,r,i){return!!bc(t,e)}}function vP(n){n.addCustom("code-block-command-provider",t=>new bP(t))}const yP=S("code-caption-input-handler");function N0(n){if(!n.selection.range.isSimple())return null;const t=n.selection.range.start;if(!t.isSimple())return null;const e=n.getBlockById(t.blockId);return d7(n,e)?e:null}function kP(n,t){var i;const e=N0(n);if(or(t,"Shift+Enter")){const s=n.selection.range.start;return!!((i=n.getBlockById(s.blockId).closest("div[data-type=editor-block][data-block-type=code]"))!=null?i:null)}if(!e)return!1;const o=_0(e),r=Qt(o);return r?(n.selection.selectBlock(r,0),!0):(n.insertTextBlock("",ct(nt(o)),bt(o)+1),!0)}function wP(n,t){if(ae(n,t)){const e=_0(t);return gP(n,e),!0}return!1}function BP(n){var e;const{start:t}=n.selection.range;if(t.isSimple()){const o=n.getBlockById(t.blockId),r=(e=o.closest("div[data-type=editor-block][data-block-type=code]"))!=null?e:null;if(!r)return!1;const i=Qs(r),s=i&&!ae(n,ye(i));if(!r||!ae(n,o)||s)return!1;const l=gn(n,r)[0],a=fe(l);if(a.length>1)return!1;if(l&&a[0]===o)return n.deleteBlock(r),!0}return!1}function EP(n){const t=N0(n);return t?wP(n,t):BP(n)}class $0{constructor(t){setTimeout(()=>{t.input.addHandler(this)})}destroy(){}handleBeforeKeyDown(t,e){return e.key==="Enter"?kP(t,e):e.key==="Backspace"?EP(t):!1}async handleBeforePaste(t,e,o){const r=N0(t);if(!r)return!1;const i=o["text/plain"];if(!i)return!0;const s=Ma(t,i);return s&&t.undoManager.runInGroup(()=>{t.clearSelectedContents();const l=t.selection.range.start;g(yP,l.isSimple(),"not simple position"),t.insertTextToBlock(r,l.offset,s)}),!0}static init(t){t.addCustom("code-block-caption-input-handler",e=>new $0(e))}}function xP(n){const o=new DOMParser().parseFromString(n,"text/html").querySelector("svg");if(!o)return null;const r=o.getAttribute("viewBox");if(!r)return null;const i=r.split(" ");if(i.length===4){const s=i[2],l=i[3];return o.setAttribute("width",s),o.setAttribute("height",l),o.outerHTML}return null}function H0(n,t,e=!0){const o=new Image,r=document.createElement("canvas"),i=r.getContext("2d");if(!i){t(new Error("failed to get context"),null);return}o.onload=()=>{if(r.width=o.naturalWidth,r.height=o.naturalHeight,e&&(r.width===0||r.height===0)){const s=n.substring(26);if(s){const l=atob(s),a=xP(l);if(a){Dm(a,"image/svg+xml").then(d=>{H0(d,t,!1)});return}}t(null,null);return}i.drawImage(o,0,0),r.toBlob(s=>{t(null,s)},"image/png")},o.src=n}function IP(n){return new Promise((t,e)=>{H0(n,(o,r)=>{if(o){e(o);return}if(!r){e(new Error("Failed to get image blob"));return}t(r)})})}async function h7(n){const t=await jl(n);return new Promise((e,o)=>{H0(t,(r,i)=>{if(r){o(r);return}if(!i){o(new Error("Failed to get image blob"));return}e(i)})})}const f7="Untitled";function m7(n){const t=ye(n.rootContainer);return!t||!et(n,t)?f7:n.getBlockString(t)||f7}function j0(){return Object.prototype.hasOwnProperty.bind(window,"isSecureContext")?window.isSecureContext:window.location.protocol==="https:"||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function TP(n){let t;return n.forEach((e,o)=>{o.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function g7(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),o=TP(t.headers).toLocaleLowerCase();let r="";if(o){const s=gm.default[o].extensions;s&&s.length>0&&(r=s[0])}return new File([e],`${Date.now()}.${r}`,{type:o})}catch{return null}}const DP=`
415
415
  <svg fill="currentColor" focusable="false" viewBox="0 0 24 24" aria-hidden="true" tabindex="-1">
416
416
  <path d="M8.12 9.29 12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7a.9959.9959 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0z"></path>
417
417
  </svg>`,SP=`
@@ -422,19 +422,19 @@ $$${r.mathjaxText}$$
422
422
  <svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
423
423
  <path fill-rule="evenodd" clip-rule="evenodd" d="M18.4388 7.11504H5.55388C5.24779 7.11504 5 6.86726 5 6.55388C5 6.24779 5.24779 6 5.55388 6H18.4388C18.7522 6 19 6.24779 19 6.55388C19 6.86726 18.7449 7.11504 18.4388 7.11504ZM18.4388 10.7225H5.55388C5.24779 10.7225 5 10.4748 5 10.1687C5 9.86257 5.24779 9.61478 5.55388 9.61478H18.4388C18.7522 9.61478 19 9.85528 19 10.1687C19 10.4748 18.7449 10.7225 18.4388 10.7225ZM18.4388 14.3373H5.55388C5.24779 14.3373 5 14.0895 5 13.7834C5 13.4701 5.24779 13.2223 5.55388 13.2223H18.4388C18.7522 13.2223 19 13.4701 19 13.7834C19 14.0895 18.7449 14.3373 18.4388 14.3373ZM12.8855 17.9448H5.55388C5.24779 17.9448 5 17.697 5 17.3909C5 17.0849 5.24779 16.8371 5.55388 16.8371H12.8855C13.1989 16.8371 13.4466 17.0849 13.4466 17.3909C13.4466 17.7043 13.1989 17.9448 12.8855 17.9448ZM21 14.7344V16.3013C21 17.486 20.4268 18.0593 19.2357 18.0593L17.5159 18.0593V18.8555C17.5159 19.2631 17.1019 19.4351 16.7771 19.1803L15.2866 18.0211C14.9045 17.7217 14.9045 17.3459 15.2866 17.0465L16.7771 15.8809C17.1019 15.6262 17.5159 15.8045 17.5159 16.2121V17.0083H19.1847C19.6943 17.0083 19.9554 16.7535 19.9554 16.2121V14.7344C19.9554 14.365 20.1465 14.1548 20.4777 14.1484C20.8153 14.1421 21 14.365 21 14.7344Z"/>
424
424
  </svg>
425
- `;function MP(n,t,e){const r={...n.getBlockData(t),language:e};n.updateBlockData(t,r),gn(n,t).forEach(s=>{fe(s).forEach(l=>{n.reloadBlock(l)})})}function RP(n,t,e){const r={...n.getBlockData(t),nowrap:e};n.updateBlockData(t,r)}const Ys=S("code-block-header"),OP=Object.entries(vu).map(([n,t])=>({id:n,name:t.name,language:t}));function p9(n,t,e){g(Ys,Cr(t),"not a code block");const o=ye(Ac(t));n.selection.selectBlock(o,0),e.focusToEditor&&n.focus()}function _P(n,t){if(t){const e=n,{editor:o,codeBlock:r}=e.custom;MP(o,r,t.id);const i=r.querySelector(".code-block-header .language-select .name-label");i.innerText=t.name,dP(o,t.id),o.focus()}}function FP(n,t,e){n.addCustom("code-header-language-select-dropdown",i=>{const s=new tM(OP,i.rootElement,{placeholder:L.t("code.search")});return s.onSelected=_P,s});const o=k("div",["language-select"],null);k("span",["name-label"],o,e);const r=k("span",["arrow-icon"],o);return r.innerHTML=DP,n.domEvents.addEventListener(o,"click",(i,s)=>{if(i.readonly)return;const a=s.target.closest(".language-select"),d=tt(a);g(Ys,d,"no parent block"),g(Ys,Dt(d)==="code","not a code block");const h=i.getBlockData(d),p=i.getCustom("code-header-language-select-dropdown");p.custom={codeBlock:d,editor:i},p.setSelectedId(h.language),p.show(a),p9(i,d,{focusToEditor:!1}),W(t,"editing-language"),p.onHide=()=>{ot(t,"editing-language")}}),o}function PP(){return k("div",["code-header-spacer"],null)}function NP(n,t){const e=t.target,o=e.closest(".code-header-button");g(Ys,o,"no button");const r=tt(e);g(Ys,r,"no parent block");const i=o.getAttribute("data-id");if(g(Ys,Dt(r)==="code","not a code block"),i==="wrap"){const s=n.getBlockData(r);RP(n,r,!s.nowrap);return}if(i==="copy"){p9(n,r,{focusToEditor:!0}),Fh(n,r).then(()=>{const{onCodeCopyComplete:s}=n.getComponentOptions("code")||{};if(s){s();return}const l=o.getBoundingClientRect();eM(L.t("code.copySuccess"),{position:{x:l.x+l.width/2,y:l.bottom+30}})}).catch(s=>{Ys.error(s.message)});return}i==="caption"&&(mP(n,r),setTimeout(()=>{n.focus()}))}function U0(n,t,e,o){const r=k("button",["code-header-button"],null);if(r.setAttribute("data-id",t),o){const i=k("span",["button-icon"],r);i.innerHTML=o,e&&r.setAttribute(`data-editor-tooltip-${n.clientId}`,e)}else if(e){const i=k("span",["button-label"],r);i.innerHTML=e}return n.domEvents.addEventListener(r,"click",NP),r}function $P(n,t,e){const o=te(t),r=k("div",["code-block-header"],o),i=vu[e.language]||vu[a9(e.language.toLocaleLowerCase())]||vu.plain;r.appendChild(FP(n,t,i.name)),r.appendChild(PP()),r.appendChild(U0(n,"wrap",L.t("code.wrap"),LP));const s=r.appendChild(U0(n,"copy",L.t("code.copy"),SP));j0()||(W(s,"disabled"),s.setAttribute("data-editor-tooltip-maxwidth","800"),s.setAttribute(`data-editor-tooltip-${n.clientId}`,L.t("copyCutProperty.unsafeEnvTips",{shortCut:ro("CtrlOrCmd+C"),operation:L.t("copyCutProperty.copy")}))),r.appendChild(U0(n,"caption",L.t("code.caption"),null))}function HP(n,t){!t.target||setTimeout(()=>{n.selection.caret.update()})}function jP(n,t,e,o){$0.init(n);const r=o.children,i=xs(e,"div");i.setAttribute("data-language",o.language||"text"),c9(n,e,o);const s=k("div",["editor-code-root"],i),l=k("div",["code-text-root"],s),a=n.createChildContainer(t,l,r[0]);if(r.length===2){const d=k("div",["code-caption-root"],s);n.createChildContainer(t,d,r[1])}return n.domEvents.addEventListener(a,"scroll",HP),$P(n,e,o),i}async function UP(n){const t={id:K(),type:"text",text:[]},e=K();n.doc.localInsertChildContainer(e,[t]);const o=await u9(n);return{blockData:{id:K(),type:"code",language:o,children:[e]},focusBlockId:t.id}}const Ar=S("code-block");function zP(n,t,e,o,r){AP(n),vP(n),g(Ar,r.type==="code","invalid block data type");const i=r;return g(Ar,i.children,"invalid block data children"),g(Ar,i.children.length===1||i.children.length===2,"invalid block data children length"),jP(n,t,o,i)}function VP(n){return 1}function WP(n,t,e,o){const r=document.elementsFromPoint(e,o)[0];if(!r||!t.contains(r)||!n.contains(t)||!Nr(r))return null;const i=If(t);if(!Nr(r))return null;const s=r;if(i.indexOf(s)===-1||Io(s)>1)return null;const l=me(t,ct(s));return new ir(n,{anchor:l,focus:l})}function qP(n,t,e,o){return null}function GP(n,t){return n.getBoundingClientRect()}function ZP(n,t,e,o){if(e.isSimple()){g(Ar,o.isSimple(),"from is simple position but to is not simple position"),Ar.debug("full select list"),W(t,"full-selected");return}g(Ar,!o.isSimple(),"from is complex position but end is simple position");const r=e,i=o;g(Ar,r.blockId===i.blockId,"only allow update one table selection"),If(t).forEach(l=>{const a=ct(l);(a===r.childContainerId||a===i.childContainerId)&&W(l,"selected")})}function QP(n){n.rootContainer.querySelectorAll('[data-type="editor-block"][data-block-type="code"]').forEach(t=>{ot(t,"full-selected"),t.querySelectorAll("div[data-type=editor-container].child.selected").forEach(e=>{ot(e,"selected")})})}function YP(n,t){return If(t)}function JP(n,t,e,o,r){if(o==="ArrowDown"||o==="ArrowRight"){if(e===Ac(t))return Qs(t)}else if(e===Qs(t))return Ac(t);return null}function KP(n,t,e,o){const r=If(t),i=r.map(ct),s=i.indexOf(e.childContainerId),l=i.indexOf(o.childContainerId);g(Ar,s!==-1,"invalid start pos"),g(Ar,l!==-1,"invalid end pos");const a=[r[s]];return s!==l&&a.push(r[l]),a}function XP(n,t,e){g(Ar,Cr(t),"invalid block type"),c9(n,t,e)}async function tN(n,t){const e=await UP(n);if(!e)return null;const{blockData:o,focusBlockId:r}=e;return n.focus(),n.insertBlock(t.containerId,t.blockIndex,o,ke(n,r,0))}function eN(n){return{name:"CodeBlock",insertBlockCommandItems:[{id:"insert-code",name:L.t("code.title"),icon:PL,order:300,group:"common",subText:An("insert-code")}],handleInsertEmptyBlock:tN}}function nN(){return{abstract:`${L.t("code.abstract")}`}}function oN(n,t,e,o){const r=t,i=a=>{const d=[];return e.blocks[a].forEach(p=>{var A;d.push(ie((A=p.text)!=null?A:[]))}),d.join(`
425
+ `;function MP(n,t,e){const r={...n.getBlockData(t),language:e};n.updateBlockData(t,r),gn(n,t).forEach(s=>{fe(s).forEach(l=>{n.reloadBlock(l)})})}function RP(n,t,e){const r={...n.getBlockData(t),nowrap:e};n.updateBlockData(t,r)}const Ys=S("code-block-header"),OP=Object.entries(vu).map(([n,t])=>({id:n,name:t.name,language:t}));function p7(n,t,e){g(Ys,Cr(t),"not a code block");const o=ye(Ac(t));n.selection.selectBlock(o,0),e.focusToEditor&&n.focus()}function _P(n,t){if(t){const e=n,{editor:o,codeBlock:r}=e.custom;MP(o,r,t.id);const i=r.querySelector(".code-block-header .language-select .name-label");i.innerText=t.name,dP(o,t.id),o.focus()}}function FP(n,t,e){n.addCustom("code-header-language-select-dropdown",i=>{const s=new tM(OP,i.rootElement,{placeholder:L.t("code.search")});return s.onSelected=_P,s});const o=k("div",["language-select"],null);k("span",["name-label"],o,e);const r=k("span",["arrow-icon"],o);return r.innerHTML=DP,n.domEvents.addEventListener(o,"click",(i,s)=>{if(i.readonly)return;const a=s.target.closest(".language-select"),d=tt(a);g(Ys,d,"no parent block"),g(Ys,Dt(d)==="code","not a code block");const h=i.getBlockData(d),p=i.getCustom("code-header-language-select-dropdown");p.custom={codeBlock:d,editor:i},p.setSelectedId(h.language),p.show(a),p7(i,d,{focusToEditor:!1}),W(t,"editing-language"),p.onHide=()=>{ot(t,"editing-language")}}),o}function PP(){return k("div",["code-header-spacer"],null)}function NP(n,t){const e=t.target,o=e.closest(".code-header-button");g(Ys,o,"no button");const r=tt(e);g(Ys,r,"no parent block");const i=o.getAttribute("data-id");if(g(Ys,Dt(r)==="code","not a code block"),i==="wrap"){const s=n.getBlockData(r);RP(n,r,!s.nowrap);return}if(i==="copy"){p7(n,r,{focusToEditor:!0}),Fh(n,r).then(()=>{const{onCodeCopyComplete:s}=n.getComponentOptions("code")||{};if(s){s();return}const l=o.getBoundingClientRect();eM(L.t("code.copySuccess"),{position:{x:l.x+l.width/2,y:l.bottom+30}})}).catch(s=>{Ys.error(s.message)});return}i==="caption"&&(mP(n,r),setTimeout(()=>{n.focus()}))}function U0(n,t,e,o){const r=k("button",["code-header-button"],null);if(r.setAttribute("data-id",t),o){const i=k("span",["button-icon"],r);i.innerHTML=o,e&&r.setAttribute(`data-editor-tooltip-${n.clientId}`,e)}else if(e){const i=k("span",["button-label"],r);i.innerHTML=e}return n.domEvents.addEventListener(r,"click",NP),r}function $P(n,t,e){const o=te(t),r=k("div",["code-block-header"],o),i=vu[e.language]||vu[a7(e.language.toLocaleLowerCase())]||vu.plain;r.appendChild(FP(n,t,i.name)),r.appendChild(PP()),r.appendChild(U0(n,"wrap",L.t("code.wrap"),LP));const s=r.appendChild(U0(n,"copy",L.t("code.copy"),SP));j0()||(W(s,"disabled"),s.setAttribute("data-editor-tooltip-maxwidth","800"),s.setAttribute(`data-editor-tooltip-${n.clientId}`,L.t("copyCutProperty.unsafeEnvTips",{shortCut:ro("CtrlOrCmd+C"),operation:L.t("copyCutProperty.copy")}))),r.appendChild(U0(n,"caption",L.t("code.caption"),null))}function HP(n,t){!t.target||setTimeout(()=>{n.selection.caret.update()})}function jP(n,t,e,o){$0.init(n);const r=o.children,i=xs(e,"div");i.setAttribute("data-language",o.language||"text"),c7(n,e,o);const s=k("div",["editor-code-root"],i),l=k("div",["code-text-root"],s),a=n.createChildContainer(t,l,r[0]);if(r.length===2){const d=k("div",["code-caption-root"],s);n.createChildContainer(t,d,r[1])}return n.domEvents.addEventListener(a,"scroll",HP),$P(n,e,o),i}async function UP(n){const t={id:K(),type:"text",text:[]},e=K();n.doc.localInsertChildContainer(e,[t]);const o=await u7(n);return{blockData:{id:K(),type:"code",language:o,children:[e]},focusBlockId:t.id}}const Ar=S("code-block");function zP(n,t,e,o,r){AP(n),vP(n),g(Ar,r.type==="code","invalid block data type");const i=r;return g(Ar,i.children,"invalid block data children"),g(Ar,i.children.length===1||i.children.length===2,"invalid block data children length"),jP(n,t,o,i)}function VP(n){return 1}function WP(n,t,e,o){const r=document.elementsFromPoint(e,o)[0];if(!r||!t.contains(r)||!n.contains(t)||!Nr(r))return null;const i=If(t);if(!Nr(r))return null;const s=r;if(i.indexOf(s)===-1||Io(s)>1)return null;const l=me(t,ct(s));return new ir(n,{anchor:l,focus:l})}function qP(n,t,e,o){return null}function GP(n,t){return n.getBoundingClientRect()}function ZP(n,t,e,o){if(e.isSimple()){g(Ar,o.isSimple(),"from is simple position but to is not simple position"),Ar.debug("full select list"),W(t,"full-selected");return}g(Ar,!o.isSimple(),"from is complex position but end is simple position");const r=e,i=o;g(Ar,r.blockId===i.blockId,"only allow update one table selection"),If(t).forEach(l=>{const a=ct(l);(a===r.childContainerId||a===i.childContainerId)&&W(l,"selected")})}function QP(n){n.rootContainer.querySelectorAll('[data-type="editor-block"][data-block-type="code"]').forEach(t=>{ot(t,"full-selected"),t.querySelectorAll("div[data-type=editor-container].child.selected").forEach(e=>{ot(e,"selected")})})}function YP(n,t){return If(t)}function JP(n,t,e,o,r){if(o==="ArrowDown"||o==="ArrowRight"){if(e===Ac(t))return Qs(t)}else if(e===Qs(t))return Ac(t);return null}function KP(n,t,e,o){const r=If(t),i=r.map(ct),s=i.indexOf(e.childContainerId),l=i.indexOf(o.childContainerId);g(Ar,s!==-1,"invalid start pos"),g(Ar,l!==-1,"invalid end pos");const a=[r[s]];return s!==l&&a.push(r[l]),a}function XP(n,t,e){g(Ar,Cr(t),"invalid block type"),c7(n,t,e)}async function tN(n,t){const e=await UP(n);if(!e)return null;const{blockData:o,focusBlockId:r}=e;return n.focus(),n.insertBlock(t.containerId,t.blockIndex,o,ke(n,r,0))}function eN(n){return{name:"CodeBlock",insertBlockCommandItems:[{id:"insert-code",name:L.t("code.title"),icon:PL,order:300,group:"common",subText:An("insert-code")}],handleInsertEmptyBlock:tN}}function nN(){return{abstract:`${L.t("code.abstract")}`}}function oN(n,t,e,o){const r=t,i=a=>{const d=[];return e.blocks[a].forEach(p=>{var A;d.push(ie((A=p.text)!=null?A:[]))}),d.join(`
426
426
  `)},s=i(r.children[0]),l=r.children[1]?i(r.children[1]):"";return o==="text"?`${s}
427
427
  ${l}`:o==="markdown"?`\`\`\`${r.language}
428
428
  ${s}
429
429
  \`\`\`
430
430
  ${l}`:`<p><pre><code>${s}</code></pre></p>
431
- <p>${l}</p>`}const z0={blockType:"code",blockKind:"complex",createBlockContent:zP,getBlockTextLength:VP,getRangeFromPoint:WP,moveCaret:qP,getCaretRect:GP,updateSelection:ZP,clearSelection:QP,getChildContainers:YP,getNextContainer:JP,getSelectedContainers:KP,convertFrom:fP,handleBlockElementUpdated:XP,getOptions:eN,getBlockProperties:nN,convertTo:oN},V0={...Dn,blockType:"code-line"};class rN{constructor(t){m(this,"handleSelectionChange",()=>{const t=this.editor.selection;if(!t.range.isCollapsed())return;const e=t.focusedBlock;if(!bc(this.editor,e))return;const o=e,r=t.range.focus.offset,i=R4(this.editor,o,r,"code-caret");i.scrollIntoView({block:"nearest"}),setTimeout(()=>{i.remove(),this.editor.selection.caret.update()})});this.editor=t,t.addListener("selectionChanged",this.handleSelectionChange)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChange)}}function C9(n,t){const e=n.split(`
432
- `).map(s=>({id:K(),type:"text",text:_i(s)})),o=K();return{blocks:{root:[{children:[o],type:"code",id:K(),...t}],[o]:e},meta:{},comments:{}}}class iN{handleBeforeCopy(t,e,o){const r=t.getFocusedBlock();if(!bc(t,r))return;const i=_0(r),s=t.getBlockData(i),{language:l,nowrap:a}=s;if(t.selection.range.isCollapsed()){const h=t.getBlockString(r);return C9(h,{language:l,nowrap:a})}const d=t.getSelectedText();return C9(d,{language:l,nowrap:a})}}function sN(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!bc(n,t)){if(n.selection.range.isCollapsed()){const e=n.selection.range.start;return n.insertTextToBlock(t,e.offset," "),!0}return n.undoManager.runInGroup(()=>{Ro(n).forEach(o=>{n.insertTextToBlock(o.block,0," ")})}),!0}}function lN(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!bc(n,t))return;const e=[" "," "];return n.undoManager.runInGroup(()=>{Ro(n).forEach(r=>{const i=ie(n.getBlockText(r.block));for(let s=0;s<e.length;s++){const l=e[s];if(i.startsWith(l)){n.deleteTextFromBlock(r.block,0,l.length);break}}})}),!0}function cN(n){const t=n.getFocusedBlock(),e=nt(t);if(Gt(e))return;const o=tt(e);if(!o||Dt(o)!=="code")return;const r=n.selection.range;if(!!r.isSimple()&&!MA(e,r))return Qg(n,e),!0}const aN={Tab:sN,"Shift+Tab":lN,"CtrlOrCmd+A":cN},yu=S("code-text-decorate");class Tf{decorateText(t,e,o){var v;if(g(yu,e.length>0,"invalid path"),e.length===1)return{};const r=e[e.length-2];if(t.doc.getBlockData(r.containerId,r.blockIndex).type!=="code")return{};const s=o;if(s.length===0)return{};const l=ie(s),a=t.doc.getBlockData(r.containerId,r.blockIndex),d=ua.default.tokenize(l,(v=ua.default.languages[a.language])!=null?v:ua.default.languages.plain),h=(B,D)=>{if(g(yu,B,"no token"),typeof B=="string")return[{insert:B,attributes:mt.default(D)}];g(yu,B instanceof ua.default.Token,"invalid token type");const x=B.content,_=mt.default(D);return _[`style-code-${B.type}`]=!0,typeof x=="string"?[{insert:x,attributes:_}]:Array.isArray(x)?x.map(z=>h(z,_)).flat():(g(yu,x instanceof ua.default.Token,"invalid token"),h(x,_))},A=d.map(B=>h(B,{})).flat();return g(yu,rn(A)===rn(s),"failed to highlight code, text length mismatch"),{text:A}}}const uN={code:{title:"\u4EE3\u7801",abstract:"\u4EE3\u7801",wrap:"\u6362\u884C",copy:"\u590D\u5236",caption:"\u8BF4\u660E",search:"\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",copySuccess:"\u590D\u5236\u6210\u529F"}},dN={code:{title:"Code",abstract:"Code",wrap:"Wrap",copy:"Copy",caption:"Caption",search:"Search",copySuccess:"Copied successfully"}},hN={code:{title:"\u30B3\u30FC\u30C9",abstract:"\u30B3\u30FC\u30C9",wrap:"\u6298\u308A\u8FD4\u3059",copy:"\u8907\u88FD",caption:"\u4F8B\u8A3C\u3059\u308B",search:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u691C\u7D22",copySuccess:"\u30B3\u30D4\u30FC\u3055\u308C\u307E\u3057\u305F"}};L.mergeLang({"zh-CN":uN,"en-US":dN,"ja-JP":hN});function fN(n,t,e,o){const r=n.getBlockByIndex(t,e);if(ut(n,r)!==o)return!1;const i=ie(n.getBlockText(r));if(![...i].every(h=>h==="|")||i.length<3||!n.editorBlocks.hasBlock("table"))return!1;const s=n.editorBlocks.getBlockClass("table");if(!s.convertFrom)return!1;const l=s.convertFrom(n,r,{offset:o});if(!l)return!1;const{blockData:a,focusBlockId:d}=l;return a?(n.undoManager.runInGroup(()=>{var p;const h=n.insertBlock(t,e,a,ke(n,d!=null?d:a.id,0));n.deleteBlock(r),(p=l.onConverted)==null||p.call(l,n,h)}),!0):!1}const mN={mermaid:{blockType:"embed",reg:/^```mermaid$/,data:{embedType:"mermaid"}},flowchart:{blockType:"embed",reg:/^```flowchart$/,data:{embedType:"flowchart"}},plantuml:{blockType:"embed",reg:/^```plantuml$/,data:{embedType:"plantuml"}},code:{blockType:"code",reg:/^```\S+$/},code2:{blockType:"code",reg:/^```$/},table:{blockType:"table",reg:/^\|.+\|.+\|$/},math:{blockType:"embed",reg:/^\$\$.+\$\$$/},image:{blockType:"embed",reg:/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/,data:{embedType:"image"}},dividing:{blockType:"embed",reg:/^-{3,}$/,data:{embedType:"dividing-line"}},toc:{blockType:"embed",reg:/^\[toc\]/,data:{embedType:"toc"}}},gN={orderedList:{reg:/^(\d)+(\.|。)$/,blockType:"list",data:{listType:"ordered"}},unorderedList1:{reg:/^\*$/,blockType:"list",data:{listType:"unordered"}},unorderedList2:{reg:/^-$/,blockType:"list",data:{listType:"unordered"}},checkList1:{reg:/^\[\s?\]$/,blockType:"list",data:{listType:"unchecked"}},checkList2:{reg:/^\[X\]$/i,blockType:"list",data:{listType:"checked"}},image:{blockType:"embed",reg:/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/,data:{embedType:"image"}}};function Df(n,t,e,o,r){const i=n.getContainerById(t);if(!Gt(i)){const s=tt(i);if(s&&Cr(s))return!0}return!1}function A9(n,t,e,o,r){if(Df(n,t))return!1;if(r==="enter"&&fN(n,t,e,o))return!0;const i=n.getBlockByIndex(t,e),s=ie(Tn(n.getBlockText(i),o).left).trim(),l=r==="enter"?mN:gN;for(const[,a]of Object.entries(l)){if(!s.match(a.reg))continue;return!!n.undoManager.runInGroup(()=>{var B;const h=eh(n,i,a.blockType,{offset:o,data:a.data});if(!h)return null;const{blockData:p,focusBlockId:A}=h;if(!p)return null;const v=n.insertBlock(t,e,p,ke(n,A!=null?A:p.id,0));return n.deleteBlock(i),(B=h.onConverted)==null||B.call(h,n,v),{newBlock:v,focusBlockId:A}})}return!1}function pN(n,t,e,o){const r=n.getBlockByIndex(t,e);return n.getBlockString(r,{boxReplacement:" "}).substring(0,o)!==">"?!1:(n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,0,o+1),n.updateBlockData(r,{quoted:!0},ke(n,r,0))}),!0)}const CN={"#":1,"##":2,"###":3,"####":4,"#####":5,"######":6,"#######":7,"########":8};function AN(n,t,e,o){const r=n.getBlockByIndex(t,e),i=n.getBlockString(r,{boxReplacement:" "}).substring(0,o);let s=CN[i];if(!s)return!1;const l=n.getBlockData(r).heading;return l&&l==s&&(s=null),n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,0,o+1),n.updateBlockData(r,{heading:s},ke(n,r,0))}),!0}function bN(n,t,e,o){return!!(AN(n,t,e,o)||pN(n,t,e,o))}const vN=S("match-text-style");function yN(n,t){if(n.length<t.length*2+1||!n.endsWith(t)||n.substring(0,n.length-1).endsWith(t))return-1;const e=n.substring(0,n.length-t.length),o=e.lastIndexOf(t);return o===-1?-1:o===0?0:e.substring(o-1).startsWith(t)?-1:o}const kN={"*":{type:"style",styles:["style-italic"],boxType:""},"**":{type:"style",styles:["style-bold"],boxType:""},"***":{type:"style",styles:["style-bold","style-italic"],boxType:""},"~~":{type:"style",styles:["style-strikethrough"],boxType:""},"`":{type:"style",styles:["style-code"],boxType:""},$$:{type:"box",styles:[],boxType:"math"}};function wN(n,t,e,o){var A,v;const r=n.getBlockByIndex(t,e),i=n.getBlockText(r),{left:s}=Tn(i,o),l=mg(s),a=rn(s)-l.length,d=Object.entries(kN);for(const[B,D]of d){const x=yN(l,B);if(x===-1)continue;const _=a+x,R=o,H=B.length,z=ie(ze(i,_+H,R-_-H*2).middle);if(D.type==="style"){const q={};D.styles.forEach(ft=>{q[ft]=!0});const rt=_i(z,q);n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,_,R-_),n.insertTextToBlock(r,_,rt)})}else if(D.type==="box")try{const q=(v=(A=n.editorBoxes.getBoxClass(D.boxType)).convertFrom)==null?void 0:v.call(A,n,z);if(!q)continue;n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,_,R-_),n.insertBoxToBlock(r,_,q)})}catch(q){vN.warn(`failed to convert to box, ${q.message}`);continue}return!0}const h=/\[([^\]]+)\]\((https?:\/\/\S+)\)\s*$/,p=l.match(h);if(p){const B=p.index,D=p[1],x=p[2],_=B,R=o,z={...Da(i,_),link:x};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,_,R-_),n.insertTextToBlock(r,_,_i(D,z))}),!0}return!1}class Sf{handleAfterInsertText(t,e,o,r,i){if(i===" "){if(Df(t,e))return!1;if(bN(t,e,o,r)||wN(t,e,o,r))return!0}return!1}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:r,blockIndex:i,offset:s}=t.getTextPosition();if(et(t,t.getBlockByIndex(r,i))){if(or(e,"Enter")){if(A9(t,r,i,s,"enter"))return!0}else if(or(e,"Space")&&A9(t,r,i,s,"space"))return!0}return!1}}const BN={"en-US":{placeholder:{default:"Type / for commands",heading:"Title {heading}",list:"List",mention:"Quickly assign tasks and use @ to mention yourself or others",quote:"Quote",title:"Enter document title"}},"zh-CN":{placeholder:{default:"\u8F93\u5165\u300C/\u300D\u5FEB\u901F\u63D2\u5165",heading:"\u6807\u9898{heading}",list:"\u5217\u8868",mention:"\u5FEB\u901F\u5206\u914D\u4EFB\u52A1\uFF0C@\u63D0\u53CA\u81EA\u5DF1\u6216\u4ED6\u4EBA",quote:"\u5F15\u7528",title:"\u8BF7\u8F93\u5165\u6587\u6863\u6807\u9898"}},"ja-JP":{placeholder:{default:"\u300C/\u300D\u3092\u5165\u529B\u3057\u3066\u7D20\u65E9\u304F\u633F\u5165\u3059\u308B",heading:"\u898B\u51FA\u3057{heading}",list:"\u30EA\u30B9\u30C8",mention:"\u81EA\u5206\u3084\u30E1\u30F3\u30D0\u30FC\u3092\uFF20\u3057\u3001\u30BF\u30B9\u30AF\u3092\u7D20\u65E9\u304F\u5272\u308A\u5F53\u3066\u307E\u3059",quote:"\u5F15\u7528",title:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}}};L.mergeLang(BN);function ku(n,t){const e=Fi(n,t);return!!(e.text&&rn(e.text)===0&&!t.querySelector(".inputting-insertion"))}function b9(n,t){var o;Lt(t).removeAttribute("data-content-placeholder"),(o=t.querySelector("[data-type=block-tools] .block-placeholder-container"))==null||o.remove()}function Lf(n,t,e){var r;if(!ku(n,t)){b9(n,t);return}const o=Lt(t);if(typeof e=="string")o.setAttribute("data-content-placeholder",e);else{const i=te(t),s=(r=i.querySelector(".block-placeholder-container"))!=null?r:k("div",["block-placeholder-container"],i);s.innerHTML="",s.appendChild(e)}}function EN(n){const t=n.getAttribute("data-style-heading");return t?L.t("placeholder.heading",{heading:t}):n.getAttribute("data-style-quoted")?L.t("placeholder.quote"):null}function xN(n){const t=n.getAttribute("data-list-type");return t?t==="ordered"||t==="unordered"?L.t("placeholder.list"):L.t("placeholder.mention"):null}function v9(n){switch(Dt(n)){case"text":return EN(n);case"list":return xN(n);default:return null}}function IN(n){if(so(n))return!1;const t=tt(nt(n));return t?Dt(t)==="code":!1}function TN(n){return!so(n)}function DN(n,t){var h,p;const e=n.selection.focusedBlock,o=Dt(e),r=t.contentPlaceholder||L.t("placeholder.default");let i=r;if(o&&ya(n,o)&&e){if(!n.isBlockWritable(e)||IN(e))return;TN(e)&&(i=L.t("placeholder.common.contentInTable")),i=(h=v9(e))!=null?h:i}const s=n.getFirstBlock(),l=Qt(s);if(!l)return;const a=Qt(l);if(a&&!t.addPlaceholderToAllCurrentEmptyBlock)return;if(!a&&ku(n,l)){Lf(n,l,(p=v9(l))!=null?p:r);return}const d=n.getFocusedBlock();!ku(n,d)||d!==s&&Lf(n,d,i)}function SN(n,t){var r,i;const e=n.getFirstBlock(),o=Lt(e);ku(n,e)?(o.setAttribute("data-title-placeholder",(r=t.titlePlaceholder)!=null?r:L.t("placeholder.title")),o.setAttribute("data-title-placeholder-readonly",(i=t.readonlyTitlePlaceholder)!=null?i:"")):(o.removeAttribute("data-title-placeholder"),o.removeAttribute("data-title-placeholder-readonly"))}function LN(n){n.rootContainer.querySelectorAll("[data-content-placeholder").forEach(t=>{t.removeAttribute("data-content-placeholder")}),n.rootContainer.querySelectorAll("[data-type=block-tools] .block-placeholder-container").forEach(t=>{t.remove()})}function MN(n,t){LN(n),n.selection.range.isCollapsed()&&(SN(n,t),DN(n,t))}const Unt="";function RN(n){for(let t=1;t<n.length;t++){const e=n[t];if(e.attributes&&Object.keys(e.attributes).length)return!0}return!1}const y9=S("enforce-title");class wu{constructor(t,e={headingLevel:1}){m(this,"handleSelectionChange",t=>{setTimeout(()=>{this.applyPlaceholder(t)})});this.options=e,this.handleChanged(t),this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange)}destroy(t){t.removeListener("selectionChanged",this.handleSelectionChange)}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:r,blockIndex:i,offset:s}=t.getTextPosition();if(!wu.isDocumentTitleBlock(r,i)||!or(e,"Enter"))return!1;let l=!1,a=null;Io(t.rootContainer)===2&&(a=Pr(t.rootContainer,1),ut(t,a)===0&&(l=!0));const d=t.getFirstBlock();return t.undoManager.runInGroup(()=>{t.breakTextBlock(d,s,{forceInsertAfter:!0}),l&&a&&t.deleteBlock(a)}),!0}handleChanged(t){var e,o;try{const r=t.doc.getContainerBlocks(ct(t.rootContainer));g(y9,r.length>0,"root container is empty");const i=r[0];if(i.type!=="text"){const s=cr("",{heading:(e=this.options.headingLevel)!=null?e:1});t.insertBlock(ct(t.rootContainer),0,s,t.selection.range.toDocRange());return}if(g(y9,i.text,"invalid text block"),RN(i.text)||i.quoted||i.heading!==this.options.headingLevel){const s=t.getBlockById(i.id),l=t.getBlockString(s),a=cr(l,{heading:(o=this.options.headingLevel)!=null?o:1,quoted:!1}),d=t.selection.focusedBlock;let h=t.selection.range;const p=t.insertBlock(ct(t.rootContainer),0,a);d===s&&(h=ke(t,a.id,ut(t,p))),Eh(t,s,h)}if(r.length>1)return;t.insertTextBlock("",ct(t.rootContainer),1,{newRange:t.selection.range.toDocRange()})}finally{this.applyPlaceholder(t)}}handleRemoteChanged(t){setTimeout(()=>{this.applyPlaceholder(t)})}handleUpdateCompositionText(t){this.applyPlaceholder(t)}applyPlaceholder(t){var e,o;!((e=this.options)!=null&&e.titlePlaceholder)&&!((o=this.options)!=null&&o.contentPlaceholder)||MN(t,this.options)}static isDocumentTitleBlock(t,e){return t==="root"&&e===0}}const ON=S("image-data"),k9=1e3,W0=400,_N=10;function vc(n){return n.src.startsWith("empty:")||!n.src}function FN(n){return n.src.startsWith("http:")||n.src.startsWith("https:")}function w9(n){return`${Nd.default(n)}_width`}function B9(n){return`${Nd.default(n)}_height`}function E9(n){return`${n}_flex`}function x9(n){let t=n.getBoundingClientRect().width;return t-=Number.parseFloat(window.getComputedStyle(n).paddingLeft)+Number.parseFloat(window.getComputedStyle(n).paddingRight),t}function Bu(n){if(n.every(r=>typeof r.flex=="number"&&r.flex))return;const t=100,o=n.map(r=>{const i=r.height==="auto"?r.width/t:r.height/t;return r.width/i}).reduce((r,i)=>r+i,0);n.forEach(r=>{const i=r.height==="auto"?r.width/t:r.height/t,s=r.width/i;r.flex=s/o})}function yc(n){const t=(r,i)=>{r||(r=`empty:${i}`);const s=w9(r),l=B9(r),a=E9(i);let d=n[s],h=n[l],p=n[a];return typeof d=="string"&&(d=Number.parseInt(d,10)),typeof h=="string"&&(h=Number.parseInt(h,10)),typeof p=="string"&&(p=Number.parseInt(p,10)),d&&h?{src:r,width:d,height:h,flex:p,virtualSize:!1}:d&&!h?{src:r,width:d,height:"auto",flex:p,virtualSize:!1}:(d=k9,h=W0,{src:r,width:d,height:h,flex:p,virtualSize:!0})};let e=[];const o=n.src;return Array.isArray(o)?e=o.map(t):typeof o=="string"&&(e=o.split("|").map(t)),Bu(e),e}function Vo(n){const t=n.embedData;return yc(n.embedData).length>1?100:t.widthPercent}function PN(n,t,e,o){const r=yc(t.embedData);if(r.length>1||o)return"100%";const i=Vo(t),s=n.rootContainer.getBoundingClientRect().width;if(i){const l=x9(e);return`${Math.min(s*i/100,l)}px`}return r[0].width?`${r[0].width}px`:"auto"}function cn(n,t){const o={src:n.map(r=>r.src).join("|"),widthPercent:t};return n.forEach((r,i)=>{if(r.width&&r.height&&!r.virtualSize){const l=r.src||`empty:${i}`,a=w9(l);o[a]=r.width;const d=B9(l);r.height!=="auto"&&(o[d]=r.height)}g(ON,r.flex,"no image flex");const s=E9(i);o[s]=r.flex}),o}function NN(n,t,e,o){const r=yc(t.embedData),i=r.length===1?n.rootContainer:e;if(r.length===1&&o)return`${W0}px`;if(r.some(h=>h.height==="auto"))return"auto";const s=Vo(t);if(!s)return"";let l=i.getBoundingClientRect().width*(s/100);if(l-=Number.parseFloat(window.getComputedStyle(i).paddingLeft)+Number.parseFloat(window.getComputedStyle(i).paddingRight),i===n.rootContainer&&i!==e&&(l=Math.min(l,x9(e))),r.length===1){const h=r[0];return h.virtualSize?"":`${h.height/(h.width/l)}px`}l-=(r.length-1)*_N;const a=r.reduce((h,p)=>h+p.flex,0);let d=0;for(const h of r){const A=l*h.flex/a/h.width*h.height;d=Math.max(A,d)}return`${d}px`}function $N(n){return n.reduce((e,o)=>e+o.flex,0)}function HN(n,t){k("div",["resize-gripper",t],n).setAttribute("data-resize-type",t)}function q0(n){return te(n).querySelector(".block-resizer")}function jN(n){const t=q0(n);t&&ot(t,"active")}function I9(n,t,e){const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-o.top,s=r.left-o.left,l=r.width,a=r.height;e.style.top=`${i}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${a}px`}function UN(n,t,e,o){const r=q0(n);if(r)return W(r,"active"),I9(n,t,r),r;const i=te(n),s=k("div",["block-resizer"],i);return I9(n,t,s),e.resize.forEach(l=>{HN(s,l)}),s.addEventListener("mousedown",o),W(s,"active"),s}function G0(n,t){const e=q0(n);if(!e||!Xt(n,t))return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-o.top,s=r.left-o.left,l=r.width,a=r.height;e.style.top=`${i}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${a}px`}const znt="",zN=S("block-resizer");class Eu extends ve.TypedEmitter{constructor(e,o){super();m(this,"resizableElement");m(this,"block",null);m(this,"startRect",null);m(this,"startPos",null);m(this,"resizeType",null);m(this,"enabled",!1);m(this,"handleMouseDown",e=>{e.preventDefault(),e.stopPropagation();const o=this.getResizableElement();if(!o||e.button!==0)return;const r=e.target;if(!r||!(r instanceof HTMLElement))return;const i=r.getAttribute("data-resize-type");!i||(this.bindEvents(),this.startRect=o.getBoundingClientRect(),this.startPos=e,this.resizeType=i,ga(window.getComputedStyle(r).cursor),this.block&&this.editor.selection.selectBlock(this.block,0))});m(this,"handleMouseMove",e=>{if(!this.startPos||!this.startRect||!this.resizeType||!this.getResizableElement()||!this.block)return;const r=e.x-this.startPos.x,i=e.y-this.startPos.y,s=this.startRect;let{top:l,left:a,right:d,bottom:h}=s;(this.resizeType==="bottom"||this.resizeType==="bottom-left"||this.resizeType==="bottom-right")&&(h+=i),(this.resizeType==="top"||this.resizeType==="top-left"||this.resizeType==="top-right")&&(l+=i),(this.resizeType==="left"||this.resizeType==="top-left"||this.resizeType==="bottom-left")&&(a+=r),(this.resizeType==="right"||this.resizeType==="top-right"||this.resizeType==="bottom-right")&&(d+=r);const p=d>a?d-a:0,A=h>l?h-l:0,v=new DOMRect(a,l,p,A);this.emit("resizing",this,v);const B=this.getResizableElement();B&&G0(this.block,B)});m(this,"handleMouseUp",e=>{if(e.button!==0)return;ga(""),this.unbindEvents(),this.emit("resized",this);const o=this.getResizableElement();!o||!this.block||G0(this.block,o)});this.editor=e,this.options=o}enableResize(e,o){this.block=e,this.resizableElement=o,this.createResizer(),this.enabled=!0}disableResize(){!this.block||(jN(this.block),this.enabled=!1)}update(e,o){this.block=e,this.resizableElement=o,this.getResizableElement()&&this.enabled&&this.createResizer()}updateResizer(){const e=this.getResizableElement();e&&this.block&&G0(this.block,e)}getBlock(){return this.block}destroy(){}getResizableElement(){return this.resizableElement?this.resizableElement:this.block?Lt(this.block):null}createResizer(){const e=this.getResizableElement();!e||!this.block||(g(zN,Xt(this.block,e),"not a block child element"),UN(this.block,e,this.options,this.handleMouseDown))}bindEvents(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}unbindEvents(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}}const VN=S("image-dom");function T9(n){return n.querySelector(".uploading-progress-mask")}function WN(n){const t=T9(n);if(t)return t;const e=k("div",["uploading-progress-mask"],n),o=k("div",["uploading-progress-bar"],e);return k("div",["uploading-progress-bar-value"],o),o}function qN(n){const e=WN(n).querySelector(".uploading-progress-bar-value");return g(VN,e,"no progress value"),e}function D9(n,t){const e=qN(n);e.style.width=`${t}%`}function GN(n){var t;(t=T9(n))==null||t.remove()}function xu(n,t,e,o){const r=e!=null?e:n.findBlockById(t.id);if(!r)return;const i=o||nt(r),s=!!r.querySelector(".images > .image-container.error, .images > .image-container.empty "),l=PN(n,t,i,s),a=NN(n,t,i,s),d=Lt(r);l==="auto"?d.style.width=l:(d.style.maxWidth=l,d.style.width="100%");const h=r.querySelector(".images");!h||(h.style.height=a||"none")}function ZN(n){let t;return n.forEach((e,o)=>{o.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function QN(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),o=ZN(t.headers).toLocaleLowerCase();let r="";if(o){const s=gm.default[o].extensions;s&&s.length>0&&(r=s[0])}return new File([e],`${Date.now()}.${r}`,{type:o})}catch{return null}}function Yi(n,t){const e=typeof t=="string"?t:it(t);return n.getCustom(`image-${e}`)}function Mf(n,t){if(!t||!(t instanceof Node))return null;const e=tt(t);return e?Yi(n,e):null}function br(n){return Array.from(n.querySelectorAll(".image-container"))}const Z0=S("table-resize-drag-drop");class YN{constructor(t,e,o,r){m(this,"cursor","col-resize");m(this,"initWidths");this.editor=t,this.elem=e,this.data=o,this.mouseDownEvent=r;const i=this.data.block,l=Yi(this.editor,i).getImages(),a=this.data.splitterIndex;g(Z0,a>=0&&a<l.length-1,`invalid splitter index: ${a}`);const h=br(i).map(p=>p.getBoundingClientRect().width);this.initWidths=h}onDragStart(t,e,o){if(!this.editor.isWritable())return;const r=this.data.block;Yi(this.editor,r).setResizing(!0)}onDragging(t,e,o,r,i){const s=this.data.block,l=Yi(this.editor,s),a=mt.default(l.getImages()),d=this.data.splitterIndex;g(Z0,d>=0&&d<a.length-1,`invalid splitter index: ${d}`);const h=this.initWidths[d],p=this.initWidths[d+1];if(h+p<100)return;let A=r;h+A<50&&(A=50-h),p-A<50&&(A=p-50);const D=[...this.initWidths];D[d]+=A,D[d+1]-=A;const x=br(s);g(Z0,x.length===a.length,"invalid image data");const _=D.reduce((z,q)=>z+q,0);for(let z=0;z<a.length;z++){const q=D[z]/_;a[z].flex=q,x[z].style.flexGrow=`${q}`}const R=mt.default(this.editor.getBlockData(s)),H=cn(a,Vo(R));R.embedData=H,xu(this.editor,R,s,null)}onDragEnd(t,e,o,r,i){const s=this.data.block,l=Yi(this.editor,s),d=br(s).map(h=>Number.parseFloat(h.style.flexGrow));l.updateFlex(d),l.setResizing(!1)}}function S9(n){var t;return!n||!(n instanceof HTMLElement)?null:xt(n,"image-splitter")?n:(t=n.closest(".image-splitter"))!=null?t:null}function JN(n,t){var s;const e=S9(t.target);if(!e)return;const o=tt(e);if(!o)return;Yi(n,o).setSelectedIndex(-1),n.selection.selectBlock(o,0);const r=Number.parseInt((s=e.getAttribute("data-index"))!=null?s:"",10);if(Number.isNaN(r)||typeof r!="number")return;const i={block:o,splitterIndex:r};wm(new YN(n,e,i,t))}function KN(n,t){t.preventDefault(),t.stopPropagation();const e=S9(t.target);if(!e)return;const o=tt(e);!o||Yi(n,o).resetFlex()}function XN(n,t,e,o){const r=k("div",["image-splitter"],e);k("div",["image-splitter-indicator"],r),r.setAttribute("data-index",`${o}`),n.domEvents.addEventListener(r,"mousedown",JN),n.domEvents.addEventListener(r,"dblclick",KN)}const t$=S("image-item");function L9(n){return!n||!(n instanceof Node)?null:tt(n)}function M9(n){const t=L9(n);return t?br(t):[]}function Q0(n){if(!n||!(n instanceof Node))return null;const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest(".image-container");return e||null}function Iu(n){const t=Q0(n);return t?M9(n).indexOf(t):-1}async function e$(n,t){const e=Mf(n,t.target);if(!e)return;const o=Iu(t.target);if(o===-1)return;const r=t.target;if(!(r instanceof HTMLImageElement))return;const i=e.getImages()[o];if(vc(i)||n.readonly||!e.isAutoFix()||(setTimeout(()=>{e.setAutoFix(!1)},400),i.height==="auto"&&e.fixImageSize(o,r),i.virtualSize&&e.fixImageSize(o,r),!i||!FN(i)||i.downloading))return;i.downloading=!0;const s=await QN(i.src);s?e.replaceImage(o,s):t$.warn(`failed to download image: ${i.src}`)}function n$(n,t,e){if(t.querySelector(".load-error"))return;const r=e.src.startsWith("http:")||e.src.startsWith("https:"),i=k("div",["load-error"],t),s=k("div",["error-icon"],i);s.innerHTML=ov;const l=k("div",["error-message"],i);r?(l.innerHTML=L.t("image.load.remote.failed"),n.domEvents.addEventListener(i,"click",(a,d)=>{d.preventDefault(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&window.open(e.src,"_blank")})):(l.innerHTML=L.t("image.load.failed"),n.domEvents.addEventListener(i,"click",(a,d)=>{d.preventDefault(),d.stopPropagation(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&s$(a,d.target)}))}function Y0(n,t){setTimeout(()=>{if(Xt(n.rootContainer,t)){const e=n.getBlockData(t);xu(n,e,null,null)}})}function o$(n,t){const e=Mf(n,t.target);if(!e)return;const o=Iu(t.target);if(o===-1)return;const r=e.getImages()[o];if(!r)return;const i=Q0(t.target);if(!i)return;W(i,"error","error-load");const s=tt(i);s&&Y0(n,s),i.innerHTML="",n$(n,i,r)}function r$(n,t,e){if(t.querySelector(".upload-error"))return;const r=k("div",["upload-error"],t),i=k("div",["error-icon"],r);i.innerHTML=ov;const s=k("div",["error-message"],r);s.innerHTML=L.t("image.upload.failed"),n.domEvents.addEventListener(r,"click",(l,a)=>{if(a.preventDefault(),!a.target||!(a.target instanceof Element)||a.target.tagName!=="A")return;const d=Mf(l,a.target),h=Iu(a.target);!d||h===-1||d.replaceImage(h,e)})}function R9(n,t,e,o,r){const i=br(t)[e];!i||(W(i,"error","error-upload"),Y0(n,t),i.innerHTML="",r$(n,i,r))}function O9(n,t,e,o,r,i,s){const l=k("div",["image-container"],e);if(l.setAttribute("data-src",o.src),s.length>1&&(l.style.flexShrink=`${o.flex}`,l.style.flexGrow=`${o.flex}`),i===r&&W(l,"active"),vc(o)){W(l,"empty");const d=k("div",["upload-image-icon"],l);return d.innerHTML=yL,l}const a=k("img",["editor-image"],l);if(a.src=n.doc.buildResourceUrl(o.src),n.domEvents.addEventListener(a,"load",e$),n.domEvents.addEventListener(a,"error",o$),o.src.startsWith("https:")||o.src.startsWith("http:")){const d=k("div",["image-warning"],l);d.innerHTML=nv,d.setAttribute(`data-editor-tooltip-${n.clientId}`,L.t("image.load.remote.tooltip"))}return l}function i$(n,t,e,o,r){const i=k("div",["images"],e);return o.forEach((s,l)=>{l>0&&XN(n,t,i,l-1),O9(n,t,i,s,l,r,o)}),o.length>1&&W(t,"multi"),i}function _9(n,t,e,o,r,i){const l=Array.from(t.querySelectorAll(".image-container"))[o];if(!l)return;const a=O9(n,t,null,e,o,r,i);l.insertAdjacentElement("beforebegin",a),l.remove(),Y0(n,t)}function Tu(n,t){return br(n)[t]}function s$(n,t){const e=L9(t);if(!e)return;const o=Iu(t);if(o===-1)return;const r=Mf(n,t);if(!r)return;const i=r.getImages()[o];_9(n,e,i,o,r.getSelectedIndex(),r.getImages())}function Wo(n){return Dt(n)==="embed"&&fn(n)==="image"}async function F9(n){return new Promise((t,e)=>{const o=new Image;o.onload=()=>{t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=e,o.src=n})}async function l$(n){const t=await jl(n);return F9(t)}function P9(n){var o;let t="image/*";const e=(o=n.getComponentOptions("image"))==null?void 0:o.allowedMedias;return e&&(t=e.map(r=>`.${r}`).join(",")),t}function N9(n,t){var s;const{maxSize:e,allowedMedias:o,callbacks:r}=(s=n.getComponentOptions("image"))!=null?s:{};if(e&&t.size>e){const l=new Error("image is too large");throw l.code="MaxMediaSize",r!=null&&r.onError&&(r==null||r.onError(n,l)),l}const i=Aa(t.name);if(o&&!o.includes(i)){const l=new Error(`media file is not allowed: ${i}`);throw l.code="NotAllowedFile",r!=null&&r.onError&&(r==null||r.onError(n,l)),l}}function $9(n){return n.startsWith("image/")}const H9=S("image-object");class Ie{constructor(t,e){m(this,"images",[]);m(this,"selectedIndex",-1);m(this,"blockResizer");m(this,"resizing",!1);m(this,"parentContainerResizerObserver",null);m(this,"autoFix",!1);m(this,"handleMouseDown",async(t,e)=>{const o=Iu(e.target);if(o===-1)return;const r=this.images[o];vc(r)||this.setSelectedIndex(o)});m(this,"handleRootContainerResize",()=>{this.handleEditorResize(this.editor.rootContainer)});m(this,"handleEditorResize",t=>{if(this.isEmpty()||this.resizing)return;const e=this.editor.findBlockById(this.blockData.id);!e||nt(e)===t&&xu(this.editor,this.blockData,e,null)});m(this,"handleResizing",(t,e)=>{const o=this.editor.findBlockById(this.blockData.id);if(!o)return;this.autoFix||this.setAutoFix(!0);const i=this.editor.rootContainer.getBoundingClientRect().width,s=o.getBoundingClientRect();let l=e.width>s.width?s.width:e.width;l<50&&(l=50);const a=l*100/i;this.blockData.embedData.widthPercent=a,xu(this.editor,this.blockData,o,null)});m(this,"handleResized",t=>{const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const o=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(e,o),this.blockResizer.enableResize(e)});m(this,"fixImageSizes",Le.default(()=>{const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(t,e)},1e3));this.editor=t,this.blockData=e,this.blockResizer=new Eu(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}),this.blockResizer.addListener("resizing",this.handleResizing),this.blockResizer.addListener("resized",this.handleResized),this.images=yc(this.blockData.embedData)}destroy(){var t;this.blockResizer.removeAllListeners(),this.blockResizer.destroy(),this.editor.domEvents.removeEventListener(null,null,this.handleMouseDown),(t=this.parentContainerResizerObserver)==null||t.disconnect()}setAutoFix(t){this.autoFix=t}isAutoFix(){return this.autoFix}createContent(t,e,o){const r=i$(this.editor,e,o,this.images,this.selectedIndex);if(this.editor.domEvents.addEventListener(o,"mousedown",this.handleMouseDown),this.editor.addListener("resize",this.handleRootContainerResize),Lo(t)){const s=()=>{this.handleEditorResize(t)};this.parentContainerResizerObserver=new ResizeObserver(s),this.parentContainerResizerObserver.observe(t)}const i=()=>!!(this.images.length===1&&this.images[0].virtualSize);this.isEmpty()&&i()&&W(r,"empty"),xu(this.editor,this.blockData,e,t),setTimeout(()=>{const s=this.editor.findBlockById(this.blockData.id);s&&this.blockResizer.update(s)})}getImages(){return this.images}getWidthPercent(){return Vo(this.blockData)}isEmpty(){return this.images.length===1&&vc(this.images[0])}setResizing(t){this.resizing=t}getSelectedIndex(){return this.selectedIndex}getBlock(){return this.editor.findBlockById(this.blockData.id)}setSelectedIndex(t){const e=this.getBlock();if(!e||t===this.selectedIndex)return;if(this.selectedIndex!==-1){const r=Tu(e,this.selectedIndex);r&&ot(r,"active")}this.selectedIndex=t;const o=Tu(e,t);o&&W(o,"active")}async requestUploadImage(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const o=Tu(e,t);if(xt(o,"error"))return;const r=P9(this.editor),i=await Ul(r);await this.replaceImage(t,i)}tryEnableResizer(){const t=this.editor.findBlockById(this.blockData.id);if(!t||!this.editor.isWritable())return;const e=Tu(t,0);!this.isEmpty()&&this.images.length===1&&!xt(e,"error")&&this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}fixImageSize(t,e){const o=this.images[t];vc(o)||(o.height==="auto"&&(o.height=e.height),o.width=e.naturalWidth,o.height=e.naturalHeight,o.virtualSize=!1,this.fixImageSizes())}removeImage(t){const e=this.editor.findBlockById(this.blockData.id);if(!e||t===-1||t>=this.images.length)return!1;const o=mt.default(this.images);if(o.splice(t,1),o.length===0)return this.editor.deleteBlock(e),!0;o[0].flex=NaN,Bu(o),this.selectedIndex>=o.length&&(this.selectedIndex=o.length-1);const r=cn(o,Vo(this.blockData));return this.editor.updateEmbedData(e,r),!0}async replaceImage(t,e){const o=this.editor.findBlockById(this.blockData.id);if(!o)return!1;try{const i=await jl(e),s=this.images[t];if(s.virtualSize){const{width:a,height:d}=await F9(i);s.width=a,s.height=d,s.virtualSize=!1;const h=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(o,h)}const l={...s,src:i};_9(this.editor,o,l,t,this.selectedIndex,this.images),setTimeout(()=>{this.blockResizer.update(o)})}catch(i){return R9(this.editor,o,t,i,e),!1}const r=Tu(o,t);if(!r)return!1;W(r,"uploading"),D9(r,0),W(o,"media-block-uploading");try{const i=await this.editor.doc.uploadResource(e,{onProgress:a=>{D9(r,a)}});ot(r,"uploading"),this.images[t].src=i.resourceId;const s=this.editor.findBlockById(this.blockData.id);if(!s)return!1;ot(s,"media-block-uploading");const l=cn(this.images,Vo(this.blockData));return this.editor.updateEmbedData(s,l),!0}catch(i){H9.error(i);const s=this.editor.findBlockById(this.blockData.id);return s&&(ot(r,"uploading"),GN(r),R9(this.editor,s,t,i,e),ot(s,"media-block-uploading")),!1}}updateFlex(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;g(H9,t.length===this.images.length,"invalid flex");for(let r=0;r<this.images.length;r++)this.images[r].flex=t[r];const o=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(e,o)}resetFlex(){const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=mt.default(this.images);e[0].flex=NaN,Bu(e);const o=cn(e,Vo(this.blockData));this.editor.updateEmbedData(t,o)}setData(t){this.blockData=t,this.images=yc(t.embedData)}static create(t,e){const o=t.addCustom(`image-${e.id}`,()=>new Ie(t,e));return o.setData(e),o}static getImageObject(t,e){let o;return typeof e=="string"?o=e:o=it(e),t.getCustom(`image-${o}`)}}const Vnt="",Wnt="";function Rf(n){const t=te(n);let e=t.querySelector(":scope > .block-helper");return e||(e=k("div",["block-helper"],t),k("span",["helper-sizer"],e,"A")),e}function J0(n,t,e){const o=Rf(n),i=Array.from(o.children).find(s=>{var a;return Number.parseInt((a=s.getAttribute("data-index"))!=null?a:"0",10)>e});o.insertBefore(t,i!=null?i:null)}const j9=40,c$=20;class a${findTargetBlock(t,e){const o=e.target;if(o&&o instanceof Element){const a=tt(o);if(a&&Xt(t.rootContainer,a))return a}let r=e.clientX,i=e.clientY;const s=t.rootContainer.getBoundingClientRect().left;r<s&&s-r<j9&&(r+=j9);let l=document.elementFromPoint(r,i);if(l){const a=tt(l);if(a&&Xt(t.rootContainer,a))return a}if(i-=c$,l=document.elementFromPoint(r,i),l){const a=tt(l);if(a&&Xt(t.rootContainer,a))return a}return null}destroy(){}}class u$ extends bf{constructor(e){super(e,{trigger:[],id:"empty-block-menu"});m(this,"currentBlock",null)}get isVisible(){return this.suggest.menu.isVisible}isInMenu(e){return this.menu.isInCommandBar(e)}show(){const o=this.editor.selection.focusedBlock;this.suggest.popup(o,0,"","")}setBlock(e){this.currentBlock=e}}function d$(n,t,e){const o=Vm(n,t);if(!o)return[];const r=[];return Object.values(o).forEach(i=>{e!=null&&e.has(i.group)||r.push(...i.commands.map(s=>({...s,source:"block-command",blockMenuItemCustomData:i.group})))}),r}function K0(n,t,e={withPlainText:!1}){const o=T0(n,e),r=i=>{i.forEach(s=>{s.source=t,s.children&&r(s.children)})};return r(o),o}function h$(n,t,e,o=!1){var d,h;const r=nt(t);let s=bt(t);ae(n,t)||o||(s+=1);const l=ct(r),a=e;return a.commandProvider?a.commandProvider.executeCommand(n,e,{from:"block-menu",containerId:l,blockIndex:s}):(h=(d=a.blockOptions)==null?void 0:d.handleInsertEmptyBlock)==null?void 0:h.call(d,n,{containerId:l,blockIndex:s,item:e})}function f$(n,t){const e=Do(n,t),o=n.getBlockData(t);return!(e!=="text"||o.heading)}class U9{constructor(t,e,o){m(this,"source","text-style");m(this,"id","text-style-item");m(this,"name","Text styles");m(this,"element");m(this,"textStylesTooltips",{});m(this,"createHeadingItemElement",(t,e,o)=>{var i;const r=B0();this.createItem("text",nu,e,f$(this.editor,t)),(i=r.insertBlockCommandItems)==null||i.forEach(s=>{s.id&&s.icon&&this.createItem(s.id,s.icon,e,o?o===Number(s.value):!1)})});m(this,"createListItemElement",(t,e,o)=>{const{checkbox:r,ordered:i}=o,l=Dt(t)==="list",a=l&&i===!1&&!r,d=l&&i,h=l&&!!r;this.createItem("unordered-list",av,e,a),this.createItem("ordered-list",uv,e,d),this.createItem("check-list",lv,e,h)});m(this,"handleClick",(t,e)=>{var l,a;if(!e.target||!(e.target instanceof Node))return;const o=e.target instanceof Element?e.target:e.target.parentElement;if(!o)return;const r=o.closest(".text-style-item");if(!r)return;const i=r.id,s="heading-";if(i==="text"&&Cf(t,this.block,null),i.startsWith(s)){const d=Number.parseInt(i.substring(s.length),10);d&&Cf(t,this.block,d)}if(i==="blockquote"&&y0(t,this.block),i.startsWith("align")){const d=i.replace(/^align-/,"");T7(t,this.block,d)}(i==="unordered-list"||i==="ordered-list"||i==="check-list")&&w0(t,this.block,i),(a=(l=this.options).onAfterStyleItemClick)==null||a.call(l)});m(this,"calcTextStyleItemTooltipsEnum",()=>{this.textStylesTooltips={text:{title:L.t("commands.text")},blockquote:{title:L.t("commands.quote")},"align-left":{title:L.t("commands.alignLeft")},"align-center":{title:L.t("commands.alignCenter")},"align-right":{title:L.t("commands.alignRight")},"unordered-list":{title:L.t("commands.unordered")},"ordered-list":{title:L.t("commands.ordered")},"check-list":{title:L.t("commands.check")}};let t=1;for(;t<=8;)this.textStylesTooltips[`heading-${t}`]={title:L.t("commands.heading",{name:`${t}`})},t++});this.editor=t,this.block=e,this.options=o,this.calcTextStyleItemTooltipsEnum(),this.element=this.createItemElement(t,e),t.domEvents.addEventListener(this.element,"click",this.handleClick)}createItemElement(t,e){const o=k("div",["text-styles"],null),r=k("div",["text-style-section"],o),i=t.getBlockData(e);if(!this.options.fromEmbed){const l=i.heading,a=i.quoted;this.createHeadingItemElement(e,r,l),this.createListItemElement(e,r,i),this.createItem("blockquote",cv,r,!!a)}const s=i.align||"left";return this.createItem("align-left",tu,r,s==="left"),this.createItem("align-center",Sp,r,s==="center"),this.createItem("align-right",Dp,r,s==="right"),o}createItem(t,e,o,r=!1){const i=["style-icon","text-style-item"];r&&i.push("active");const s=$l(e,i,o);s.id=t;const l=this.textStylesTooltips[t];if(!l)return;const{title:a,shortcut:d}=l;s.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,a),d&&s.setAttribute(`data-editor-tooltip-desc-${this.editor.clientId}`,ro(d))}}function z9(){return{source:"separator",type:"separator",id:`section-${K()}`,name:""}}const V9={copy:NL,cut:$L,delete:HL,"lock-block":jL,"unlock-block":UL,comment:eu},m$=["image","video"];function g$(n,t,e){const o=[],r=et(n,t),i=Me(t)&&m$.includes(fn(t)),s=i&&(fn(t)!=="image"||fn(t)==="image"&&br(t).length===1);if(r?o.push(new U9(n,t,e)):i&&s&&o.push(new U9(n,t,{...e,fromEmbed:!0})),!ae(n,t)){(r||i&&s)&&o.push(z9());const l=d$(n,t,new Set(["hovering-toolbar"]));l.sort((a,d)=>{var h,p;return((h=a.order)!=null?h:0)-((p=d.order)!=null?p:0)}),l.forEach(a=>{a.id in V9&&(a.icon=V9[a.id])}),o.push(...l)}return ae(n,t)?o.push(...K0(n,"insert-block")):o.push(z9(),{id:"insert-block-before",icon:zL,name:L.t("blockMenu.command.insertAbove"),children:K0(n,"insert-block-before",{withPlainText:!0}),childrenMenuId:"quick-menu",source:"insert-block-before"},{id:"insert-block-after",icon:VL,name:L.t("blockMenu.command.insertAfter"),children:K0(n,"insert-block",{withPlainText:!0}),source:"insert-block",childrenMenuId:"quick-menu"}),o}function p$(n,t,e){if(e.source==="block-command"){const o=e.blockMenuItemCustomData;d4(n,t,o,e)}else(e.source==="insert-block"||e.source==="insert-block-before")&&h$(n,t,e,e.source==="insert-block-before")}const C$=S("exclusive-block");function X0(n,t,e,o){var l;W(t,"block-exclusive");const r=Yt(n,t),i=(l=r.getBlockProperties)==null?void 0:l.call(r,n,t),{abstract:s}=i||{};t.setAttribute("data-user-name",o),t.setAttribute("data-user-id",e),t.setAttribute("data-exclusive-tips",L.t("exclusive.tips",{editor:o,embedType:s||L.t("exclusive.fallbackAbstract")}))}function W9(n){ot(n,"block-exclusive"),n.removeAttribute("data-user-name"),n.removeAttribute("data-user-id"),n.removeAttribute("data-exclusive-tips")}function A$(n,t,e,o,r){C$.debug(`block ${it(t)} ${e?"exclusive":"unexclusive"}, ${o}, ${r}`),e?X0(n,t,o,r):W9(t)}function Of(n){return n.classList.contains("block-exclusive")}function q9(n,t){t.blockIds.forEach(e=>{const o=n.findBlockById(e);o&&A$(n,o,t.exclusive,t.userId,t.displayName)})}class Ji{constructor(t){m(this,"exclusiveBlockIds",new Set);m(this,"exclusiveBlockTimer",0);m(this,"remoteExclusiveBlockIds",new Map);m(this,"handleUserChanged",t=>{const e=new Set(t.map(r=>r.userId));Array.from(this.remoteExclusiveBlockIds.entries()).forEach(([r,i])=>{if(!e.has(i.userId)){this.remoteExclusiveBlockIds.delete(r);const s={...i,exclusive:!1};q9(this.editor,s)}});const o=Array.from(this.exclusiveBlockIds).map(r=>this.editor.findBlockById(r)).filter(r=>!!r);o.length>0&&this.broadcastExclusiveBlockMessage(o,!0)});this.editor=t,t.doc.registerCallback(this),t.doc.getRemoteUsers().addListener("change",this.handleUserChanged)}destroy(){this.stopExclusiveBlockTimer(),this.editor.doc.unregisterCallback(this),this.editor.doc.getRemoteUsers().addListener("change",this.handleUserChanged)}onCustomMessage(t){if(t.type==="exclusiveBlock"){const e=t;q9(this.editor,e),e.blockIds.forEach(o=>{e.exclusive?this.remoteExclusiveBlockIds.set(o,e):this.remoteExclusiveBlockIds.delete(o)})}}getExclusiveMessage(t){return this.remoteExclusiveBlockIds.get(t)}broadcastExclusiveBlockMessage(t,e){if(this.editor.readonly||t.length===0)return;const o=this.editor.doc.getUser(),r={type:"exclusiveBlock",userId:o.userId,displayName:o.displayName,blockIds:t.map(i=>it(i)),exclusive:e};this.editor.doc.broadcastMessage(r)}exclusiveBlock(t){this.exclusiveBlockIds.has(it(t))||(this.broadcastExclusiveBlockMessage([t],!0),this.exclusiveBlockIds.add(it(t)),this.exclusiveBlockIds.size===1&&this.startExclusiveBlockTimer())}unexclusiveBlock(t){!this.exclusiveBlockIds.has(it(t))||(this.exclusiveBlockIds.delete(it(t)),this.broadcastExclusiveBlockMessage([t],!1),this.exclusiveBlockIds.size===0&&this.stopExclusiveBlockTimer())}startExclusiveBlockTimer(){this.exclusiveBlockTimer=window.setInterval(()=>{Array.from(this.exclusiveBlockIds.keys()).forEach(t=>{this.broadcastExclusiveBlockMessage([this.editor.getBlockById(t)],!0)})},30*1e3)}stopExclusiveBlockTimer(){clearInterval(this.exclusiveBlockTimer),this.exclusiveBlockTimer=0}static get(t){return t.addCustom("exclusiveBlock",()=>new Ji(t))}static register(t){return this.get(t)}}function t2(n,t){Ji.get(n).exclusiveBlock(t)}function e2(n,t){Ji.get(n).unexclusiveBlock(t)}class G9{writable(t,e){if(Of(e))return!1}create(t,e,o,r,i){const s=Ji.get(t).getExclusiveMessage(i.id);s&&X0(t,r,s.userId,s.displayName)}update(t,e,o,r,i){const s=Ji.get(t).getExclusiveMessage(i.id);s?X0(t,r,s.userId,s.displayName):W9(r)}}const qnt="",b$={exclusive:{tips:"\u300C{editor}\u300D\u6B63\u5728\u7F16\u8F91\uFF0C\u300C{embedType}\u300D\u4E0D\u652F\u6301\u591A\u4EBA\u7F16\u8F91",fallbackAbstract:"\u8BE5 Block"}},v$={exclusive:{tips:"\u300C{editor}\u300Dis editing\uFF0C\u300C{embedType}\u300Ddoes not support multi-person editing",fallbackAbstract:"This Block"}},y$={exclusive:{tips:"\u300C{editor}\u300D\u306F\u7DE8\u96C6\u4E2D\u3067\u3059\u3002\u300C{embedType}\u300D\u306F\u8907\u6570\u4EBA\u3067\u540C\u6642\u7DE8\u96C6\u3067\u304D\u307E\u305B\u3093",fallbackAbstract:"\u3053\u306E\u8981\u7D20"}};L.mergeLang({"zh-CN":b$,"en-US":v$,"ja-JP":y$});function Du(n,t){return n.getBlockData(t).lock}function _f(n,t){return!!Du(n,t)}function Su(n,t){const e=Du(n,t);return e?e.userId===n.doc.getUser().userId:!1}function n2(n,t){const e=Du(n,t);return e?e.userId!==n.doc.getUser().userId:!1}function k$(n,t){if(n.readonly||!n.isBlockWritable(t)||_f(n,t)&&!Su(n,t))return;const e=n.doc.getUser(),o={userId:e.userId,displayName:e.displayName,locked:Date.now()},i={...n.getBlockData(t),lock:o};n.updateBlockData(t,i)}function w$(n,t){if(!Su(n,t))return;const e={lock:null};n.updateBlockData(t,e)}const B$=10,E$=80;class o2{constructor(){m(this,"executeCommand",(t,e,o)=>{const r=o.data;if(!r||!r.blockId)return;const i=t.getBlockById(r.blockId);r.type==="lock"?k$(t,i):r.type==="unlock"&&w$(t,i)})}create(t,e,o,r,i){const s=i.lock;s&&(s.userId!==t.doc.getUser().userId?W(r,"locked-by-others"):W(r,"locked-by-self"))}update(t,e,o,r,i){const s=i.lock;if(s)if(s.userId!==t.doc.getUser().userId){W(r,"locked-by-others");const l=t.selection.focusedBlock;(l===r||Xt(r,l))&&(et(t,r)||Dt(r)==="code")&&t.insertTextBlock("",ct(o),bt(r)+1)}else W(r,"locked-by-self");else ot(r,"locked-by-others"),ot(r,"locked-by-self")}writable(t,e){if(n2(t,e))return!1;if(so(e))return;let o=Es(e);for(;o;){if(n2(t,o))return!1;o=Es(o)}}commands(t,e){const o=_f(t,e),r=Su(t,e),i=Of(e),s={blockId:it(e),type:"lock"},l={id:"lock-block",name:"",data:s,order:10};if(o)if(r)l.id="unlock-block",l.name=L.t("locker.unlock"),s.type="unlock";else{const a=Du(t,e);let d=(a==null?void 0:a.displayName)||"";const h=O5(d,B$,E$);(h==null?void 0:h.length)!==d.length&&(l.ellipsisTooltip=a==null?void 0:a.displayName,d=h||""),l.name=L.t("locker.lockedBy",{name:d}),l.states=["disabled"]}else i?(l.name=L.t("locker.lock"),l.states=["disabled"]):l.name=L.t("locker.lock");return{group:"block-locker",commands:[l],executeCommand:this.executeCommand}}}const Gnt="",x$={locker:{lock:"\u9501\u5B9A",unlock:"\u89E3\u9664\u9501\u5B9A",lockedBy:"\u88AB {name} \u9501\u5B9A"}},I$={locker:{lock:"Lock",unlock:"Unlock",lockedBy:"Locked by {name}"}},T$={locker:{lock:"\u30ED\u30C3\u30AF",unlock:"\u30ED\u30C3\u30AF\u89E3\u9664",lockedBy:"{name}\u304C\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F"}};L.mergeLang({"zh-CN":x$,"en-US":I$,"ja-JP":T$});class Ff{async handleBeforePasteDoc(t,e){return Object.values(e.blocks).forEach(o=>{o.forEach(r=>{delete r.lock})}),!1}}const D$=S("standard-block-actions");class S${constructor(){m(this,"executeCommand",(t,e,o)=>{const r=o.data;try{const i=t.getBlockById(r);if(o.id==="delete"){t.deleteBlock(i);return}o.id==="copy"&&Fh(t,i),o.id==="cut"&&(Fh(t,i),t.deleteBlock(i))}catch(i){D$.error(`failed to execute block command: ${JSON.stringify(i)}`)}})}commands(t,e){const o=_f(t,e),r=o&&Su(t,e),i=it(e),s=j0(),l=Of(e),a={id:"copy",name:L.t("blockMenu.command.copy"),data:i,order:1,states:s?[]:["disabled"],disableReason:s?void 0:L.t("copyCutProperty.unsafeEnvTips",{shortCut:ro("CtrlOrCmd+C"),operation:L.t("copyCutProperty.copy")})},d={id:"cut",name:L.t("blockMenu.command.cut"),data:i,order:2,states:o&&!r||!s||l?["disabled"]:[],disableReason:s?void 0:L.t("copyCutProperty.unsafeEnvTips",{shortCut:ro("CtrlOrCmd+X"),operation:L.t("copyCutProperty.cut")})},h={id:"delete",name:L.t("blockMenu.command.delete"),data:i,order:3,states:o&&!r||l?["disabled"]:[]};return{group:"standard-block-actions",commands:[a,d,h],executeCommand:this.executeCommand}}}const Z9=S("block-menu");class L${constructor(t){m(this,"menu");m(this,"currentBlock",null);m(this,"commandBlock",null);m(this,"handleShow",()=>{g(Z9,this.currentBlock,"no target block before show block menu");const t=g$(this.editor,this.currentBlock,{onAfterStyleItemClick:this.close});this.menu.updateItems(t),this.commandBlock=this.currentBlock});m(this,"handleClose",()=>{Fp(this.editor)&&this.editor.focus()});m(this,"handleItemClick",(t,e)=>{g(Z9,this.commandBlock,"no command block before show block menu"),p$(this.editor,this.commandBlock,e),e.element||this.close()});m(this,"close",()=>{this.menu.close("clickItem")});this.editor=t,this.menu=new Us([],void 0,{id:"block-menu"}),this.menu.on("show",this.handleShow),this.menu.on("close",this.handleClose),this.menu.on("click",this.handleItemClick),t.blockHooks.push(new S$)}show(t,e){this.menu.manualShow(t,{placement:"bottom-start",...e})}isInMenu(t){return this.menu.isInCommandBar(t)}setBlock(t){this.currentBlock=t}get isVisible(){return this.menu.isVisible}destroy(){this.menu.destroy()}}const M$=1e3;async function R$(n,t){const{width:e}=n.rootContainer.getBoundingClientRect(),o=t.getBoundingClientRect();return o.width>e||o.height>=M$?"":(await QC.default.toSvg(t)).replace(/margin-block:.*?;/,"").replace(/margin:.*?;/,"")}const O$=S("drag-preview-image");class _${constructor(t){m(this,"startPosition",null);m(this,"dragContainer",null);m(this,"handleDragStart",async(t,e)=>{const o=t.target;g(O$,o instanceof Element,`Invalid Drag target:${o}`);const{x:r,y:i}=t;this.startPosition={x:r,y:i};const s=k("div",["drag-image-container"],this.editor.rootContainer),l=k("img",["drag-image"],s),a=k("span",["drag-loading"],s);a.innerHTML=ZL;const{x:d,width:h,height:p,y:A}=o.getBoundingClientRect(),v=this.editor.rootContainer.getBoundingClientRect(),B=e.getBoundingClientRect();s.style.left=`${d+h}px`,s.style.top=`${A+p}px`,s.style.width=`${Math.min(v.width/2,B.width)}px`,this.dragContainer=s;const x=await R$(this.editor,e);x?l.src=x:W(s,"drag-placeholder"),bm(s,{status:"loaded"})});m(this,"handleDrag",t=>{if(this.startPosition&&this.dragContainer){const{x:e,y:o}=t;if(e===0&&o===0){this.dragContainer.style.transition="transform 0.15s, opacity .15s",this.dragContainer.style.transform="",this.dragContainer.style.opacity="0";return}const{x:r,y:i}=this.startPosition,s=e-r,l=o-i;this.dragContainer.style.transform=`translate(${s}px, ${l}px)`}});m(this,"handleDragEnd",()=>{this.dragContainer&&(this.dragContainer.remove(),this.startPosition=null,this.dragContainer=null)});this.editor=t}}const Q9="drag-preview-element";function F$(n){if(xt(n,Q9))return n;const t=n.querySelector(`.${Q9}`);return t||(Me(n)?Lt(n):n)}const Pf=S("block-menu-drag-handler");function r2(n,t){return new DragEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,dataTransfer:new DataTransfer,clientX:n.clientX,clientY:n.clientY})}class P${constructor(t,e){m(this,"dragPreview");m(this,"autoScroll");m(this,"oldPos",{x:0,y:0});m(this,"handleMouseDown",t=>{const e=this.button.blockMenu.currentBlock;if(g(Pf,e,"no dragged block"),t.button!==0)return;if(!this.editor.isBlockWritable(e)){t.preventDefault(),t.stopPropagation();return}const{x:o,y:r}=t;this.oldPos={x:o,y:r},document.addEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.addEventListener("mousemove",this.handleDrag)});m(this,"handleDragStart",t=>{var s,l;const e=io(this.button.buttonElement);this.autoScroll||(this.autoScroll=new Yd({scrollElement:e,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}));const o=this.button.blockMenu.currentBlock;g(Pf,o,"no dragged block"),(l=(s=Yt(this.editor,o)).notify)==null||l.call(s,this.editor,"beginDrag");const r=r2(t,"dragstart");U$(this.editor,r,o),window.isDragging=!0,this.button.buttonElement.style.opacity="0";const i=F$(o);this.dragPreview.handleDragStart(t,i),this.autoScroll.active(),W(o,"dragging"),W(this.editor.contentElement,"dragging")});m(this,"handleDrag",t=>{const{target:e,x:o,y:r}=t;if(this.oldPos.x===o&&this.oldPos.y===r)return;window.isDragging||this.handleDragStart(t),this.oldPos={x:o,y:r},g(Pf,e instanceof Element,"target is invalid"),this.dragPreview.handleDrag(t);const i=r2(t,"dragover");this.editor.contentElement.dispatchEvent(i)});m(this,"handleDragEnd",t=>{var r;const e=this.button.blockMenu.currentBlock;g(Pf,e,"no dragged block"),window.isDragging=!1,this.button.buttonElement.style.opacity="1",this.dragPreview.handleDragEnd(),(r=this.autoScroll)==null||r.inactive(),ot(e,"dragging"),ot(this.editor.contentElement,"dragging"),document.removeEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.removeEventListener("mousemove",this.handleDrag);const o=r2(t,"drop");this.editor.contentElement.dispatchEvent(o)});this.editor=t,this.button=e,this.button.buttonElement.addEventListener("mousedown",this.handleMouseDown),this.dragPreview=new _$(t)}destroy(){this.button.buttonElement.removeEventListener("mousedown",this.handleMouseDown)}}class Lu{constructor(t){m(this,"highlightedBlockId","");m(this,"handleSelectionChange",()=>{this.clearHighlightedBlock()});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChange)}highlightBlock(t){this.clearHighlightedBlock(),this.highlightedBlockId=it(t),W(t,"highlighted")}clearHighlightedBlock(){if(this.highlightedBlockId){const t=this.editor.findBlockById(this.highlightedBlockId);t&&ot(t,"highlighted"),this.highlightedBlockId=""}}destroy(){}static register(t){return t.addCustom("editor-block-highlighter",()=>new Lu(t))}static get(t){return t.getCustom("editor-block-highlighter")}}class Y9{constructor(t){m(this,"buttonElement");m(this,"emptyBlockMenu");m(this,"blockMenu");m(this,"dragHandler");m(this,"handleHoverBlock",(t,e,o)=>{if(this.emptyBlockMenu.isVisible||this.blockMenu.isVisible||!this.editor.isWritable())return;const r=this.editor.getCustom("editor-tooltip");if(r&&r.visible()&&(r.hide(),this.buttonElement.setAttribute("data-tooltip-hide-at",`${Date.now()}`)),!t){this.buttonElement.parentElement&&(this.blockMenu.isInMenu(o.target)||this.buttonElement.remove());return}const i=zm(t);this.editor.getBlockIndex(i)===0&&this.editor.getBlockData(i).heading===1||(this.updateButton(i),J0(i,this.buttonElement,Number.MAX_SAFE_INTEGER))});m(this,"handleButtonClick",()=>{if(this.buttonElement.getAttribute("data-type")==="move"){const o=this.blockMenu.currentBlock;if(!o)return;this.editor.selection.selectBlock(o,0),this.blockMenu.show(this.buttonElement,{placement:"bottom-end"}),setTimeout(()=>{Lu.get(this.editor).highlightBlock(o)});return}const e=this.emptyBlockMenu.currentBlock;!e||(this.editor.selection.selectBlock(e,0),setTimeout(()=>{this.editor.focus(),this.updatePlaceholder(e),this.emptyBlockMenu.show()}))});m(this,"updatePlaceholder",t=>{Lt(t).setAttribute("data-content-placeholder",L.t("blockMenu.button.searchPlaceholder"))});m(this,"handleChanged",()=>{const t=this.emptyBlockMenu.currentBlock;if(!t)return;const e=ae(this.editor,t)?"insert":"move";this.buttonElement.getAttribute("data-type")!==e&&this.setButtonType(e)});this.editor=t,this.buttonElement=this.createButton(),this.emptyBlockMenu=new u$(t),this.blockMenu=new L$(t),this.editor.addListener("docChanged",this.handleChanged),this.buttonElement.addEventListener("click",this.handleButtonClick),this.dragHandler=new P$(this.editor,this);const e=Ce.get(t);e.addListener("change",this.handleHoverBlock),e.addFinder(new a$),Lu.register(this.editor)}destroy(){Ce.get(this.editor).removeListener("change",this.handleHoverBlock),this.buttonElement.removeEventListener("click",this.handleButtonClick),this.editor.removeListener("docChanged",this.handleChanged),this.emptyBlockMenu.destroy(),this.blockMenu.destroy(),this.buttonElement.remove(),this.dragHandler.destroy()}createButton(){const t=k("button",["block-button"],null);return t.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,L.t("blockMenu.button.tips")),t.innerHTML=dv,t}setButtonType(t){this.buttonElement.setAttribute("data-type",t);const e=`data-editor-tooltip-${this.editor.clientId}-dynamic`;this.buttonElement.hasAttribute(e)&&this.buttonElement.removeAttribute(e),t==="insert"?(this.buttonElement.innerHTML=GL,this.buttonElement.setAttribute(e,L.t("blockMenu.button.insertTips"))):(this.buttonElement.innerHTML=dv,this.buttonElement.setAttribute(e,L.t("blockMenu.button.tips")))}updateButton(t){this.emptyBlockMenu.setBlock(t),this.blockMenu.setBlock(t),ae(this.editor,t)?this.setButtonType("insert"):this.setButtonType("move")}}const N$={blockMenu:{section:{basics:"\u57FA\u7840",system:"\u7CFB\u7EDF",styles:"\u6837\u5F0F",common:"\u901A\u7528",actions:"\u64CD\u4F5C",thirdParty:"\u7B2C\u4E09\u65B9\u5185\u5BB9"},command:{insertAbove:"\u5728\u4E0A\u65B9\u63D2\u5165",insertAfter:"\u5728\u4E0B\u65B9\u63D2\u5165",copy:"\u590D\u5236",cut:"\u526A\u5207",delete:"\u5220\u9664"},button:{searchPlaceholder:"\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",tips:`\u957F\u6309\u62D6\u62FD
431
+ <p>${l}</p>`}const z0={blockType:"code",blockKind:"complex",createBlockContent:zP,getBlockTextLength:VP,getRangeFromPoint:WP,moveCaret:qP,getCaretRect:GP,updateSelection:ZP,clearSelection:QP,getChildContainers:YP,getNextContainer:JP,getSelectedContainers:KP,convertFrom:fP,handleBlockElementUpdated:XP,getOptions:eN,getBlockProperties:nN,convertTo:oN},V0={...Dn,blockType:"code-line"};class rN{constructor(t){m(this,"handleSelectionChange",()=>{const t=this.editor.selection;if(!t.range.isCollapsed())return;const e=t.focusedBlock;if(!bc(this.editor,e))return;const o=e,r=t.range.focus.offset,i=R4(this.editor,o,r,"code-caret");i.scrollIntoView({block:"nearest"}),setTimeout(()=>{i.remove(),this.editor.selection.caret.update()})});this.editor=t,t.addListener("selectionChanged",this.handleSelectionChange)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChange)}}function C7(n,t){const e=n.split(`
432
+ `).map(s=>({id:K(),type:"text",text:_i(s)})),o=K();return{blocks:{root:[{children:[o],type:"code",id:K(),...t}],[o]:e},meta:{},comments:{}}}class iN{handleBeforeCopy(t,e,o){const r=t.getFocusedBlock();if(!bc(t,r))return;const i=_0(r),s=t.getBlockData(i),{language:l,nowrap:a}=s;if(t.selection.range.isCollapsed()){const h=t.getBlockString(r);return C7(h,{language:l,nowrap:a})}const d=t.getSelectedText();return C7(d,{language:l,nowrap:a})}}function sN(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!bc(n,t)){if(n.selection.range.isCollapsed()){const e=n.selection.range.start;return n.insertTextToBlock(t,e.offset," "),!0}return n.undoManager.runInGroup(()=>{Ro(n).forEach(o=>{n.insertTextToBlock(o.block,0," ")})}),!0}}function lN(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!bc(n,t))return;const e=[" "," "];return n.undoManager.runInGroup(()=>{Ro(n).forEach(r=>{const i=ie(n.getBlockText(r.block));for(let s=0;s<e.length;s++){const l=e[s];if(i.startsWith(l)){n.deleteTextFromBlock(r.block,0,l.length);break}}})}),!0}function cN(n){const t=n.getFocusedBlock(),e=nt(t);if(Gt(e))return;const o=tt(e);if(!o||Dt(o)!=="code")return;const r=n.selection.range;if(!!r.isSimple()&&!MA(e,r))return Qg(n,e),!0}const aN={Tab:sN,"Shift+Tab":lN,"CtrlOrCmd+A":cN},yu=S("code-text-decorate");class Tf{decorateText(t,e,o){var v;if(g(yu,e.length>0,"invalid path"),e.length===1)return{};const r=e[e.length-2];if(t.doc.getBlockData(r.containerId,r.blockIndex).type!=="code")return{};const s=o;if(s.length===0)return{};const l=ie(s),a=t.doc.getBlockData(r.containerId,r.blockIndex),d=ua.default.tokenize(l,(v=ua.default.languages[a.language])!=null?v:ua.default.languages.plain),h=(B,D)=>{if(g(yu,B,"no token"),typeof B=="string")return[{insert:B,attributes:mt.default(D)}];g(yu,B instanceof ua.default.Token,"invalid token type");const x=B.content,_=mt.default(D);return _[`style-code-${B.type}`]=!0,typeof x=="string"?[{insert:x,attributes:_}]:Array.isArray(x)?x.map(z=>h(z,_)).flat():(g(yu,x instanceof ua.default.Token,"invalid token"),h(x,_))},A=d.map(B=>h(B,{})).flat();return g(yu,rn(A)===rn(s),"failed to highlight code, text length mismatch"),{text:A}}}const uN={code:{title:"\u4EE3\u7801",abstract:"\u4EE3\u7801",wrap:"\u6362\u884C",copy:"\u590D\u5236",caption:"\u8BF4\u660E",search:"\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",copySuccess:"\u590D\u5236\u6210\u529F"}},dN={code:{title:"Code",abstract:"Code",wrap:"Wrap",copy:"Copy",caption:"Caption",search:"Search",copySuccess:"Copied successfully"}},hN={code:{title:"\u30B3\u30FC\u30C9",abstract:"\u30B3\u30FC\u30C9",wrap:"\u6298\u308A\u8FD4\u3059",copy:"\u8907\u88FD",caption:"\u4F8B\u8A3C\u3059\u308B",search:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u691C\u7D22",copySuccess:"\u30B3\u30D4\u30FC\u3055\u308C\u307E\u3057\u305F"}};L.mergeLang({"zh-CN":uN,"en-US":dN,"ja-JP":hN});function fN(n,t,e,o){const r=n.getBlockByIndex(t,e);if(ut(n,r)!==o)return!1;const i=ie(n.getBlockText(r));if(![...i].every(h=>h==="|")||i.length<3||!n.editorBlocks.hasBlock("table"))return!1;const s=n.editorBlocks.getBlockClass("table");if(!s.convertFrom)return!1;const l=s.convertFrom(n,r,{offset:o});if(!l)return!1;const{blockData:a,focusBlockId:d}=l;return a?(n.undoManager.runInGroup(()=>{var p;const h=n.insertBlock(t,e,a,ke(n,d!=null?d:a.id,0));n.deleteBlock(r),(p=l.onConverted)==null||p.call(l,n,h)}),!0):!1}const mN={mermaid:{blockType:"embed",reg:/^```mermaid$/,data:{embedType:"mermaid"}},flowchart:{blockType:"embed",reg:/^```flowchart$/,data:{embedType:"flowchart"}},plantuml:{blockType:"embed",reg:/^```plantuml$/,data:{embedType:"plantuml"}},code:{blockType:"code",reg:/^```\S+$/},code2:{blockType:"code",reg:/^```$/},table:{blockType:"table",reg:/^\|.+\|.+\|$/},math:{blockType:"embed",reg:/^\$\$.+\$\$$/},image:{blockType:"embed",reg:/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/,data:{embedType:"image"}},dividing:{blockType:"embed",reg:/^-{3,}$/,data:{embedType:"dividing-line"}},toc:{blockType:"embed",reg:/^\[toc\]/,data:{embedType:"toc"}}},gN={orderedList:{reg:/^(\d)+(\.|。)$/,blockType:"list",data:{listType:"ordered"}},unorderedList1:{reg:/^\*$/,blockType:"list",data:{listType:"unordered"}},unorderedList2:{reg:/^-$/,blockType:"list",data:{listType:"unordered"}},checkList1:{reg:/^\[\s?\]$/,blockType:"list",data:{listType:"unchecked"}},checkList2:{reg:/^\[X\]$/i,blockType:"list",data:{listType:"checked"}},image:{blockType:"embed",reg:/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/,data:{embedType:"image"}}};function Df(n,t,e,o,r){const i=n.getContainerById(t);if(!Gt(i)){const s=tt(i);if(s&&Cr(s))return!0}return!1}function A7(n,t,e,o,r){if(Df(n,t))return!1;if(r==="enter"&&fN(n,t,e,o))return!0;const i=n.getBlockByIndex(t,e),s=ie(Tn(n.getBlockText(i),o).left).trim(),l=r==="enter"?mN:gN;for(const[,a]of Object.entries(l)){if(!s.match(a.reg))continue;return!!n.undoManager.runInGroup(()=>{var B;const h=eh(n,i,a.blockType,{offset:o,data:a.data});if(!h)return null;const{blockData:p,focusBlockId:A}=h;if(!p)return null;const v=n.insertBlock(t,e,p,ke(n,A!=null?A:p.id,0));return n.deleteBlock(i),(B=h.onConverted)==null||B.call(h,n,v),{newBlock:v,focusBlockId:A}})}return!1}function pN(n,t,e,o){const r=n.getBlockByIndex(t,e);return n.getBlockString(r,{boxReplacement:" "}).substring(0,o)!==">"?!1:(n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,0,o+1),n.updateBlockData(r,{quoted:!0},ke(n,r,0))}),!0)}const CN={"#":1,"##":2,"###":3,"####":4,"#####":5,"######":6,"#######":7,"########":8};function AN(n,t,e,o){const r=n.getBlockByIndex(t,e),i=n.getBlockString(r,{boxReplacement:" "}).substring(0,o);let s=CN[i];if(!s)return!1;const l=n.getBlockData(r).heading;return l&&l==s&&(s=null),n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,0,o+1),n.updateBlockData(r,{heading:s},ke(n,r,0))}),!0}function bN(n,t,e,o){return!!(AN(n,t,e,o)||pN(n,t,e,o))}const vN=S("match-text-style");function yN(n,t){if(n.length<t.length*2+1||!n.endsWith(t)||n.substring(0,n.length-1).endsWith(t))return-1;const e=n.substring(0,n.length-t.length),o=e.lastIndexOf(t);return o===-1?-1:o===0?0:e.substring(o-1).startsWith(t)?-1:o}const kN={"*":{type:"style",styles:["style-italic"],boxType:""},"**":{type:"style",styles:["style-bold"],boxType:""},"***":{type:"style",styles:["style-bold","style-italic"],boxType:""},"~~":{type:"style",styles:["style-strikethrough"],boxType:""},"`":{type:"style",styles:["style-code"],boxType:""},$$:{type:"box",styles:[],boxType:"math"}};function wN(n,t,e,o){var A,v;const r=n.getBlockByIndex(t,e),i=n.getBlockText(r),{left:s}=Tn(i,o),l=mg(s),a=rn(s)-l.length,d=Object.entries(kN);for(const[B,D]of d){const x=yN(l,B);if(x===-1)continue;const _=a+x,R=o,H=B.length,z=ie(ze(i,_+H,R-_-H*2).middle);if(D.type==="style"){const q={};D.styles.forEach(ft=>{q[ft]=!0});const rt=_i(z,q);n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,_,R-_),n.insertTextToBlock(r,_,rt)})}else if(D.type==="box")try{const q=(v=(A=n.editorBoxes.getBoxClass(D.boxType)).convertFrom)==null?void 0:v.call(A,n,z);if(!q)continue;n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,_,R-_),n.insertBoxToBlock(r,_,q)})}catch(q){vN.warn(`failed to convert to box, ${q.message}`);continue}return!0}const h=/\[([^\]]+)\]\((https?:\/\/\S+)\)\s*$/,p=l.match(h);if(p){const B=p.index,D=p[1],x=p[2],_=B,R=o,z={...Da(i,_),link:x};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,_,R-_),n.insertTextToBlock(r,_,_i(D,z))}),!0}return!1}class Sf{handleAfterInsertText(t,e,o,r,i){if(i===" "){if(Df(t,e))return!1;if(bN(t,e,o,r)||wN(t,e,o,r))return!0}return!1}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:r,blockIndex:i,offset:s}=t.getTextPosition();if(et(t,t.getBlockByIndex(r,i))){if(or(e,"Enter")){if(A7(t,r,i,s,"enter"))return!0}else if(or(e,"Space")&&A7(t,r,i,s,"space"))return!0}return!1}}const BN={"en-US":{placeholder:{default:"Type / for commands",heading:"Title {heading}",list:"List",mention:"Quickly assign tasks and use @ to mention yourself or others",quote:"Quote",title:"Enter document title"}},"zh-CN":{placeholder:{default:"\u8F93\u5165\u300C/\u300D\u5FEB\u901F\u63D2\u5165",heading:"\u6807\u9898{heading}",list:"\u5217\u8868",mention:"\u5FEB\u901F\u5206\u914D\u4EFB\u52A1\uFF0C@\u63D0\u53CA\u81EA\u5DF1\u6216\u4ED6\u4EBA",quote:"\u5F15\u7528",title:"\u8BF7\u8F93\u5165\u6587\u6863\u6807\u9898"}},"ja-JP":{placeholder:{default:"\u300C/\u300D\u3092\u5165\u529B\u3057\u3066\u7D20\u65E9\u304F\u633F\u5165\u3059\u308B",heading:"\u898B\u51FA\u3057{heading}",list:"\u30EA\u30B9\u30C8",mention:"\u81EA\u5206\u3084\u30E1\u30F3\u30D0\u30FC\u3092\uFF20\u3057\u3001\u30BF\u30B9\u30AF\u3092\u7D20\u65E9\u304F\u5272\u308A\u5F53\u3066\u307E\u3059",quote:"\u5F15\u7528",title:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}}};L.mergeLang(BN);function ku(n,t){const e=Fi(n,t);return!!(e.text&&rn(e.text)===0&&!t.querySelector(".inputting-insertion"))}function b7(n,t){var o;Lt(t).removeAttribute("data-content-placeholder"),(o=t.querySelector("[data-type=block-tools] .block-placeholder-container"))==null||o.remove()}function Lf(n,t,e){var r;if(!ku(n,t)){b7(n,t);return}const o=Lt(t);if(typeof e=="string")o.setAttribute("data-content-placeholder",e);else{const i=te(t),s=(r=i.querySelector(".block-placeholder-container"))!=null?r:k("div",["block-placeholder-container"],i);s.innerHTML="",s.appendChild(e)}}function EN(n){const t=n.getAttribute("data-style-heading");return t?L.t("placeholder.heading",{heading:t}):n.getAttribute("data-style-quoted")?L.t("placeholder.quote"):null}function xN(n){const t=n.getAttribute("data-list-type");return t?t==="ordered"||t==="unordered"?L.t("placeholder.list"):L.t("placeholder.mention"):null}function v7(n){switch(Dt(n)){case"text":return EN(n);case"list":return xN(n);default:return null}}function IN(n){if(so(n))return!1;const t=tt(nt(n));return t?Dt(t)==="code":!1}function TN(n){return!so(n)}function DN(n,t){var h,p;const e=n.selection.focusedBlock,o=Dt(e),r=t.contentPlaceholder||L.t("placeholder.default");let i=r;if(o&&ya(n,o)&&e){if(!n.isBlockWritable(e)||IN(e))return;TN(e)&&(i=L.t("placeholder.common.contentInTable")),i=(h=v7(e))!=null?h:i}const s=n.getFirstBlock(),l=Qt(s);if(!l)return;const a=Qt(l);if(a&&!t.addPlaceholderToAllCurrentEmptyBlock)return;if(!a&&ku(n,l)){Lf(n,l,(p=v7(l))!=null?p:r);return}const d=n.getFocusedBlock();!ku(n,d)||d!==s&&Lf(n,d,i)}function SN(n,t){var r,i;const e=n.getFirstBlock(),o=Lt(e);ku(n,e)?(o.setAttribute("data-title-placeholder",(r=t.titlePlaceholder)!=null?r:L.t("placeholder.title")),o.setAttribute("data-title-placeholder-readonly",(i=t.readonlyTitlePlaceholder)!=null?i:"")):(o.removeAttribute("data-title-placeholder"),o.removeAttribute("data-title-placeholder-readonly"))}function LN(n){n.rootContainer.querySelectorAll("[data-content-placeholder").forEach(t=>{t.removeAttribute("data-content-placeholder")}),n.rootContainer.querySelectorAll("[data-type=block-tools] .block-placeholder-container").forEach(t=>{t.remove()})}function MN(n,t){LN(n),n.selection.range.isCollapsed()&&(SN(n,t),DN(n,t))}const Unt="";function RN(n){for(let t=1;t<n.length;t++){const e=n[t];if(e.attributes&&Object.keys(e.attributes).length)return!0}return!1}const y7=S("enforce-title");class wu{constructor(t,e={headingLevel:1}){m(this,"handleSelectionChange",t=>{setTimeout(()=>{this.applyPlaceholder(t)})});this.options=e,this.handleChanged(t),this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange)}destroy(t){t.removeListener("selectionChanged",this.handleSelectionChange)}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:r,blockIndex:i,offset:s}=t.getTextPosition();if(!wu.isDocumentTitleBlock(r,i)||!or(e,"Enter"))return!1;let l=!1,a=null;Io(t.rootContainer)===2&&(a=Pr(t.rootContainer,1),ut(t,a)===0&&(l=!0));const d=t.getFirstBlock();return t.undoManager.runInGroup(()=>{t.breakTextBlock(d,s,{forceInsertAfter:!0}),l&&a&&t.deleteBlock(a)}),!0}handleChanged(t){var e,o;try{const r=t.doc.getContainerBlocks(ct(t.rootContainer));g(y7,r.length>0,"root container is empty");const i=r[0];if(i.type!=="text"){const s=cr("",{heading:(e=this.options.headingLevel)!=null?e:1});t.insertBlock(ct(t.rootContainer),0,s,t.selection.range.toDocRange());return}if(g(y7,i.text,"invalid text block"),RN(i.text)||i.quoted||i.heading!==this.options.headingLevel){const s=t.getBlockById(i.id),l=t.getBlockString(s),a=cr(l,{heading:(o=this.options.headingLevel)!=null?o:1,quoted:!1}),d=t.selection.focusedBlock;let h=t.selection.range;const p=t.insertBlock(ct(t.rootContainer),0,a);d===s&&(h=ke(t,a.id,ut(t,p))),Eh(t,s,h)}if(r.length>1)return;t.insertTextBlock("",ct(t.rootContainer),1,{newRange:t.selection.range.toDocRange()})}finally{this.applyPlaceholder(t)}}handleRemoteChanged(t){setTimeout(()=>{this.applyPlaceholder(t)})}handleUpdateCompositionText(t){this.applyPlaceholder(t)}applyPlaceholder(t){var e,o;!((e=this.options)!=null&&e.titlePlaceholder)&&!((o=this.options)!=null&&o.contentPlaceholder)||MN(t,this.options)}static isDocumentTitleBlock(t,e){return t==="root"&&e===0}}const ON=S("image-data"),k7=1e3,W0=400,_N=10;function vc(n){return n.src.startsWith("empty:")||!n.src}function FN(n){return n.src.startsWith("http:")||n.src.startsWith("https:")}function w7(n){return`${Nd.default(n)}_width`}function B7(n){return`${Nd.default(n)}_height`}function E7(n){return`${n}_flex`}function x7(n){let t=n.getBoundingClientRect().width;return t-=Number.parseFloat(window.getComputedStyle(n).paddingLeft)+Number.parseFloat(window.getComputedStyle(n).paddingRight),t}function Bu(n){if(n.every(r=>typeof r.flex=="number"&&r.flex))return;const t=100,o=n.map(r=>{const i=r.height==="auto"?r.width/t:r.height/t;return r.width/i}).reduce((r,i)=>r+i,0);n.forEach(r=>{const i=r.height==="auto"?r.width/t:r.height/t,s=r.width/i;r.flex=s/o})}function yc(n){const t=(r,i)=>{r||(r=`empty:${i}`);const s=w7(r),l=B7(r),a=E7(i);let d=n[s],h=n[l],p=n[a];return typeof d=="string"&&(d=Number.parseInt(d,10)),typeof h=="string"&&(h=Number.parseInt(h,10)),typeof p=="string"&&(p=Number.parseInt(p,10)),d&&h?{src:r,width:d,height:h,flex:p,virtualSize:!1}:d&&!h?{src:r,width:d,height:"auto",flex:p,virtualSize:!1}:(d=k7,h=W0,{src:r,width:d,height:h,flex:p,virtualSize:!0})};let e=[];const o=n.src;return Array.isArray(o)?e=o.map(t):typeof o=="string"&&(e=o.split("|").map(t)),Bu(e),e}function Vo(n){const t=n.embedData;return yc(n.embedData).length>1?100:t.widthPercent}function PN(n,t,e,o){const r=yc(t.embedData);if(r.length>1||o)return"100%";const i=Vo(t),s=n.rootContainer.getBoundingClientRect().width;if(i){const l=x7(e);return`${Math.min(s*i/100,l)}px`}return r[0].width?`${r[0].width}px`:"auto"}function cn(n,t){const o={src:n.map(r=>r.src).join("|"),widthPercent:t};return n.forEach((r,i)=>{if(r.width&&r.height&&!r.virtualSize){const l=r.src||`empty:${i}`,a=w7(l);o[a]=r.width;const d=B7(l);r.height!=="auto"&&(o[d]=r.height)}g(ON,r.flex,"no image flex");const s=E7(i);o[s]=r.flex}),o}function NN(n,t,e,o){const r=yc(t.embedData),i=r.length===1?n.rootContainer:e;if(r.length===1&&o)return`${W0}px`;if(r.some(h=>h.height==="auto"))return"auto";const s=Vo(t);if(!s)return"";let l=i.getBoundingClientRect().width*(s/100);if(l-=Number.parseFloat(window.getComputedStyle(i).paddingLeft)+Number.parseFloat(window.getComputedStyle(i).paddingRight),i===n.rootContainer&&i!==e&&(l=Math.min(l,x7(e))),r.length===1){const h=r[0];return h.virtualSize?"":`${h.height/(h.width/l)}px`}l-=(r.length-1)*_N;const a=r.reduce((h,p)=>h+p.flex,0);let d=0;for(const h of r){const A=l*h.flex/a/h.width*h.height;d=Math.max(A,d)}return`${d}px`}function $N(n){return n.reduce((e,o)=>e+o.flex,0)}function HN(n,t){k("div",["resize-gripper",t],n).setAttribute("data-resize-type",t)}function q0(n){return te(n).querySelector(".block-resizer")}function jN(n){const t=q0(n);t&&ot(t,"active")}function I7(n,t,e){const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-o.top,s=r.left-o.left,l=r.width,a=r.height;e.style.top=`${i}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${a}px`}function UN(n,t,e,o){const r=q0(n);if(r)return W(r,"active"),I7(n,t,r),r;const i=te(n),s=k("div",["block-resizer"],i);return I7(n,t,s),e.resize.forEach(l=>{HN(s,l)}),s.addEventListener("mousedown",o),W(s,"active"),s}function G0(n,t){const e=q0(n);if(!e||!Xt(n,t))return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-o.top,s=r.left-o.left,l=r.width,a=r.height;e.style.top=`${i}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${a}px`}const znt="",zN=S("block-resizer");class Eu extends ve.TypedEmitter{constructor(e,o){super();m(this,"resizableElement");m(this,"block",null);m(this,"startRect",null);m(this,"startPos",null);m(this,"resizeType",null);m(this,"enabled",!1);m(this,"handleMouseDown",e=>{e.preventDefault(),e.stopPropagation();const o=this.getResizableElement();if(!o||e.button!==0)return;const r=e.target;if(!r||!(r instanceof HTMLElement))return;const i=r.getAttribute("data-resize-type");!i||(this.bindEvents(),this.startRect=o.getBoundingClientRect(),this.startPos=e,this.resizeType=i,ga(window.getComputedStyle(r).cursor),this.block&&this.editor.selection.selectBlock(this.block,0))});m(this,"handleMouseMove",e=>{if(!this.startPos||!this.startRect||!this.resizeType||!this.getResizableElement()||!this.block)return;const r=e.x-this.startPos.x,i=e.y-this.startPos.y,s=this.startRect;let{top:l,left:a,right:d,bottom:h}=s;(this.resizeType==="bottom"||this.resizeType==="bottom-left"||this.resizeType==="bottom-right")&&(h+=i),(this.resizeType==="top"||this.resizeType==="top-left"||this.resizeType==="top-right")&&(l+=i),(this.resizeType==="left"||this.resizeType==="top-left"||this.resizeType==="bottom-left")&&(a+=r),(this.resizeType==="right"||this.resizeType==="top-right"||this.resizeType==="bottom-right")&&(d+=r);const p=d>a?d-a:0,A=h>l?h-l:0,v=new DOMRect(a,l,p,A);this.emit("resizing",this,v);const B=this.getResizableElement();B&&G0(this.block,B)});m(this,"handleMouseUp",e=>{if(e.button!==0)return;ga(""),this.unbindEvents(),this.emit("resized",this);const o=this.getResizableElement();!o||!this.block||G0(this.block,o)});this.editor=e,this.options=o}enableResize(e,o){this.block=e,this.resizableElement=o,this.createResizer(),this.enabled=!0}disableResize(){!this.block||(jN(this.block),this.enabled=!1)}update(e,o){this.block=e,this.resizableElement=o,this.getResizableElement()&&this.enabled&&this.createResizer()}updateResizer(){const e=this.getResizableElement();e&&this.block&&G0(this.block,e)}getBlock(){return this.block}destroy(){}getResizableElement(){return this.resizableElement?this.resizableElement:this.block?Lt(this.block):null}createResizer(){const e=this.getResizableElement();!e||!this.block||(g(zN,Xt(this.block,e),"not a block child element"),UN(this.block,e,this.options,this.handleMouseDown))}bindEvents(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}unbindEvents(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}}const VN=S("image-dom");function T7(n){return n.querySelector(".uploading-progress-mask")}function WN(n){const t=T7(n);if(t)return t;const e=k("div",["uploading-progress-mask"],n),o=k("div",["uploading-progress-bar"],e);return k("div",["uploading-progress-bar-value"],o),o}function qN(n){const e=WN(n).querySelector(".uploading-progress-bar-value");return g(VN,e,"no progress value"),e}function D7(n,t){const e=qN(n);e.style.width=`${t}%`}function GN(n){var t;(t=T7(n))==null||t.remove()}function xu(n,t,e,o){const r=e!=null?e:n.findBlockById(t.id);if(!r)return;const i=o||nt(r),s=!!r.querySelector(".images > .image-container.error, .images > .image-container.empty "),l=PN(n,t,i,s),a=NN(n,t,i,s),d=Lt(r);l==="auto"?d.style.width=l:(d.style.maxWidth=l,d.style.width="100%");const h=r.querySelector(".images");!h||(h.style.height=a||"none")}function ZN(n){let t;return n.forEach((e,o)=>{o.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function QN(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),o=ZN(t.headers).toLocaleLowerCase();let r="";if(o){const s=gm.default[o].extensions;s&&s.length>0&&(r=s[0])}return new File([e],`${Date.now()}.${r}`,{type:o})}catch{return null}}function Yi(n,t){const e=typeof t=="string"?t:it(t);return n.getCustom(`image-${e}`)}function Mf(n,t){if(!t||!(t instanceof Node))return null;const e=tt(t);return e?Yi(n,e):null}function br(n){return Array.from(n.querySelectorAll(".image-container"))}const Z0=S("table-resize-drag-drop");class YN{constructor(t,e,o,r){m(this,"cursor","col-resize");m(this,"initWidths");this.editor=t,this.elem=e,this.data=o,this.mouseDownEvent=r;const i=this.data.block,l=Yi(this.editor,i).getImages(),a=this.data.splitterIndex;g(Z0,a>=0&&a<l.length-1,`invalid splitter index: ${a}`);const h=br(i).map(p=>p.getBoundingClientRect().width);this.initWidths=h}onDragStart(t,e,o){if(!this.editor.isWritable())return;const r=this.data.block;Yi(this.editor,r).setResizing(!0)}onDragging(t,e,o,r,i){const s=this.data.block,l=Yi(this.editor,s),a=mt.default(l.getImages()),d=this.data.splitterIndex;g(Z0,d>=0&&d<a.length-1,`invalid splitter index: ${d}`);const h=this.initWidths[d],p=this.initWidths[d+1];if(h+p<100)return;let A=r;h+A<50&&(A=50-h),p-A<50&&(A=p-50);const D=[...this.initWidths];D[d]+=A,D[d+1]-=A;const x=br(s);g(Z0,x.length===a.length,"invalid image data");const _=D.reduce((z,q)=>z+q,0);for(let z=0;z<a.length;z++){const q=D[z]/_;a[z].flex=q,x[z].style.flexGrow=`${q}`}const R=mt.default(this.editor.getBlockData(s)),H=cn(a,Vo(R));R.embedData=H,xu(this.editor,R,s,null)}onDragEnd(t,e,o,r,i){const s=this.data.block,l=Yi(this.editor,s),d=br(s).map(h=>Number.parseFloat(h.style.flexGrow));l.updateFlex(d),l.setResizing(!1)}}function S7(n){var t;return!n||!(n instanceof HTMLElement)?null:xt(n,"image-splitter")?n:(t=n.closest(".image-splitter"))!=null?t:null}function JN(n,t){var s;const e=S7(t.target);if(!e)return;const o=tt(e);if(!o)return;Yi(n,o).setSelectedIndex(-1),n.selection.selectBlock(o,0);const r=Number.parseInt((s=e.getAttribute("data-index"))!=null?s:"",10);if(Number.isNaN(r)||typeof r!="number")return;const i={block:o,splitterIndex:r};wm(new YN(n,e,i,t))}function KN(n,t){t.preventDefault(),t.stopPropagation();const e=S7(t.target);if(!e)return;const o=tt(e);!o||Yi(n,o).resetFlex()}function XN(n,t,e,o){const r=k("div",["image-splitter"],e);k("div",["image-splitter-indicator"],r),r.setAttribute("data-index",`${o}`),n.domEvents.addEventListener(r,"mousedown",JN),n.domEvents.addEventListener(r,"dblclick",KN)}const t$=S("image-item");function L7(n){return!n||!(n instanceof Node)?null:tt(n)}function M7(n){const t=L7(n);return t?br(t):[]}function Q0(n){if(!n||!(n instanceof Node))return null;const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest(".image-container");return e||null}function Iu(n){const t=Q0(n);return t?M7(n).indexOf(t):-1}async function e$(n,t){const e=Mf(n,t.target);if(!e)return;const o=Iu(t.target);if(o===-1)return;const r=t.target;if(!(r instanceof HTMLImageElement))return;const i=e.getImages()[o];if(vc(i)||n.readonly||!e.isAutoFix()||(setTimeout(()=>{e.setAutoFix(!1)},400),i.height==="auto"&&e.fixImageSize(o,r),i.virtualSize&&e.fixImageSize(o,r),!i||!FN(i)||i.downloading))return;i.downloading=!0;const s=await QN(i.src);s?e.replaceImage(o,s):t$.warn(`failed to download image: ${i.src}`)}function n$(n,t,e){if(t.querySelector(".load-error"))return;const r=e.src.startsWith("http:")||e.src.startsWith("https:"),i=k("div",["load-error"],t),s=k("div",["error-icon"],i);s.innerHTML=ov;const l=k("div",["error-message"],i);r?(l.innerHTML=L.t("image.load.remote.failed"),n.domEvents.addEventListener(i,"click",(a,d)=>{d.preventDefault(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&window.open(e.src,"_blank")})):(l.innerHTML=L.t("image.load.failed"),n.domEvents.addEventListener(i,"click",(a,d)=>{d.preventDefault(),d.stopPropagation(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&s$(a,d.target)}))}function Y0(n,t){setTimeout(()=>{if(Xt(n.rootContainer,t)){const e=n.getBlockData(t);xu(n,e,null,null)}})}function o$(n,t){const e=Mf(n,t.target);if(!e)return;const o=Iu(t.target);if(o===-1)return;const r=e.getImages()[o];if(!r)return;const i=Q0(t.target);if(!i)return;W(i,"error","error-load");const s=tt(i);s&&Y0(n,s),i.innerHTML="",n$(n,i,r)}function r$(n,t,e){if(t.querySelector(".upload-error"))return;const r=k("div",["upload-error"],t),i=k("div",["error-icon"],r);i.innerHTML=ov;const s=k("div",["error-message"],r);s.innerHTML=L.t("image.upload.failed"),n.domEvents.addEventListener(r,"click",(l,a)=>{if(a.preventDefault(),!a.target||!(a.target instanceof Element)||a.target.tagName!=="A")return;const d=Mf(l,a.target),h=Iu(a.target);!d||h===-1||d.replaceImage(h,e)})}function R7(n,t,e,o,r){const i=br(t)[e];!i||(W(i,"error","error-upload"),Y0(n,t),i.innerHTML="",r$(n,i,r))}function O7(n,t,e,o,r,i,s){const l=k("div",["image-container"],e);if(l.setAttribute("data-src",o.src),s.length>1&&(l.style.flexShrink=`${o.flex}`,l.style.flexGrow=`${o.flex}`),i===r&&W(l,"active"),vc(o)){W(l,"empty");const d=k("div",["upload-image-icon"],l);return d.innerHTML=yL,l}const a=k("img",["editor-image"],l);if(a.src=n.doc.buildResourceUrl(o.src),n.domEvents.addEventListener(a,"load",e$),n.domEvents.addEventListener(a,"error",o$),o.src.startsWith("https:")||o.src.startsWith("http:")){const d=k("div",["image-warning"],l);d.innerHTML=nv,d.setAttribute(`data-editor-tooltip-${n.clientId}`,L.t("image.load.remote.tooltip"))}return l}function i$(n,t,e,o,r){const i=k("div",["images"],e);return o.forEach((s,l)=>{l>0&&XN(n,t,i,l-1),O7(n,t,i,s,l,r,o)}),o.length>1&&W(t,"multi"),i}function _7(n,t,e,o,r,i){const l=Array.from(t.querySelectorAll(".image-container"))[o];if(!l)return;const a=O7(n,t,null,e,o,r,i);l.insertAdjacentElement("beforebegin",a),l.remove(),Y0(n,t)}function Tu(n,t){return br(n)[t]}function s$(n,t){const e=L7(t);if(!e)return;const o=Iu(t);if(o===-1)return;const r=Mf(n,t);if(!r)return;const i=r.getImages()[o];_7(n,e,i,o,r.getSelectedIndex(),r.getImages())}function Wo(n){return Dt(n)==="embed"&&fn(n)==="image"}async function F7(n){return new Promise((t,e)=>{const o=new Image;o.onload=()=>{t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=e,o.src=n})}async function l$(n){const t=await jl(n);return F7(t)}function P7(n){var o;let t="image/*";const e=(o=n.getComponentOptions("image"))==null?void 0:o.allowedMedias;return e&&(t=e.map(r=>`.${r}`).join(",")),t}function N7(n,t){var s;const{maxSize:e,allowedMedias:o,callbacks:r}=(s=n.getComponentOptions("image"))!=null?s:{};if(e&&t.size>e){const l=new Error("image is too large");throw l.code="MaxMediaSize",r!=null&&r.onError&&(r==null||r.onError(n,l)),l}const i=Aa(t.name);if(o&&!o.includes(i)){const l=new Error(`media file is not allowed: ${i}`);throw l.code="NotAllowedFile",r!=null&&r.onError&&(r==null||r.onError(n,l)),l}}function $7(n){return n.startsWith("image/")}const H7=S("image-object");class Ie{constructor(t,e){m(this,"images",[]);m(this,"selectedIndex",-1);m(this,"blockResizer");m(this,"resizing",!1);m(this,"parentContainerResizerObserver",null);m(this,"autoFix",!1);m(this,"handleMouseDown",async(t,e)=>{const o=Iu(e.target);if(o===-1)return;const r=this.images[o];vc(r)||this.setSelectedIndex(o)});m(this,"handleRootContainerResize",()=>{this.handleEditorResize(this.editor.rootContainer)});m(this,"handleEditorResize",t=>{if(this.isEmpty()||this.resizing)return;const e=this.editor.findBlockById(this.blockData.id);!e||nt(e)===t&&xu(this.editor,this.blockData,e,null)});m(this,"handleResizing",(t,e)=>{const o=this.editor.findBlockById(this.blockData.id);if(!o)return;this.autoFix||this.setAutoFix(!0);const i=this.editor.rootContainer.getBoundingClientRect().width,s=o.getBoundingClientRect();let l=e.width>s.width?s.width:e.width;l<50&&(l=50);const a=l*100/i;this.blockData.embedData.widthPercent=a,xu(this.editor,this.blockData,o,null)});m(this,"handleResized",t=>{const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const o=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(e,o),this.blockResizer.enableResize(e)});m(this,"fixImageSizes",Le.default(()=>{const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(t,e)},1e3));this.editor=t,this.blockData=e,this.blockResizer=new Eu(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}),this.blockResizer.addListener("resizing",this.handleResizing),this.blockResizer.addListener("resized",this.handleResized),this.images=yc(this.blockData.embedData)}destroy(){var t;this.blockResizer.removeAllListeners(),this.blockResizer.destroy(),this.editor.domEvents.removeEventListener(null,null,this.handleMouseDown),(t=this.parentContainerResizerObserver)==null||t.disconnect()}setAutoFix(t){this.autoFix=t}isAutoFix(){return this.autoFix}createContent(t,e,o){const r=i$(this.editor,e,o,this.images,this.selectedIndex);if(this.editor.domEvents.addEventListener(o,"mousedown",this.handleMouseDown),this.editor.addListener("resize",this.handleRootContainerResize),Lo(t)){const s=()=>{this.handleEditorResize(t)};this.parentContainerResizerObserver=new ResizeObserver(s),this.parentContainerResizerObserver.observe(t)}const i=()=>!!(this.images.length===1&&this.images[0].virtualSize);this.isEmpty()&&i()&&W(r,"empty"),xu(this.editor,this.blockData,e,t),setTimeout(()=>{const s=this.editor.findBlockById(this.blockData.id);s&&this.blockResizer.update(s)})}getImages(){return this.images}getWidthPercent(){return Vo(this.blockData)}isEmpty(){return this.images.length===1&&vc(this.images[0])}setResizing(t){this.resizing=t}getSelectedIndex(){return this.selectedIndex}getBlock(){return this.editor.findBlockById(this.blockData.id)}setSelectedIndex(t){const e=this.getBlock();if(!e||t===this.selectedIndex)return;if(this.selectedIndex!==-1){const r=Tu(e,this.selectedIndex);r&&ot(r,"active")}this.selectedIndex=t;const o=Tu(e,t);o&&W(o,"active")}async requestUploadImage(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const o=Tu(e,t);if(xt(o,"error"))return;const r=P7(this.editor),i=await Ul(r);await this.replaceImage(t,i)}tryEnableResizer(){const t=this.editor.findBlockById(this.blockData.id);if(!t||!this.editor.isWritable())return;const e=Tu(t,0);!this.isEmpty()&&this.images.length===1&&!xt(e,"error")&&this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}fixImageSize(t,e){const o=this.images[t];vc(o)||(o.height==="auto"&&(o.height=e.height),o.width=e.naturalWidth,o.height=e.naturalHeight,o.virtualSize=!1,this.fixImageSizes())}removeImage(t){const e=this.editor.findBlockById(this.blockData.id);if(!e||t===-1||t>=this.images.length)return!1;const o=mt.default(this.images);if(o.splice(t,1),o.length===0)return this.editor.deleteBlock(e),!0;o[0].flex=NaN,Bu(o),this.selectedIndex>=o.length&&(this.selectedIndex=o.length-1);const r=cn(o,Vo(this.blockData));return this.editor.updateEmbedData(e,r),!0}async replaceImage(t,e){const o=this.editor.findBlockById(this.blockData.id);if(!o)return!1;try{const i=await jl(e),s=this.images[t];if(s.virtualSize){const{width:a,height:d}=await F7(i);s.width=a,s.height=d,s.virtualSize=!1;const h=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(o,h)}const l={...s,src:i};_7(this.editor,o,l,t,this.selectedIndex,this.images),setTimeout(()=>{this.blockResizer.update(o)})}catch(i){return R7(this.editor,o,t,i,e),!1}const r=Tu(o,t);if(!r)return!1;W(r,"uploading"),D7(r,0),W(o,"media-block-uploading");try{const i=await this.editor.doc.uploadResource(e,{onProgress:a=>{D7(r,a)}});ot(r,"uploading"),this.images[t].src=i.resourceId;const s=this.editor.findBlockById(this.blockData.id);if(!s)return!1;ot(s,"media-block-uploading");const l=cn(this.images,Vo(this.blockData));return this.editor.updateEmbedData(s,l),!0}catch(i){H7.error(i);const s=this.editor.findBlockById(this.blockData.id);return s&&(ot(r,"uploading"),GN(r),R7(this.editor,s,t,i,e),ot(s,"media-block-uploading")),!1}}updateFlex(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;g(H7,t.length===this.images.length,"invalid flex");for(let r=0;r<this.images.length;r++)this.images[r].flex=t[r];const o=cn(this.images,Vo(this.blockData));this.editor.updateEmbedData(e,o)}resetFlex(){const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=mt.default(this.images);e[0].flex=NaN,Bu(e);const o=cn(e,Vo(this.blockData));this.editor.updateEmbedData(t,o)}setData(t){this.blockData=t,this.images=yc(t.embedData)}static create(t,e){const o=t.addCustom(`image-${e.id}`,()=>new Ie(t,e));return o.setData(e),o}static getImageObject(t,e){let o;return typeof e=="string"?o=e:o=it(e),t.getCustom(`image-${o}`)}}const Vnt="",Wnt="";function Rf(n){const t=te(n);let e=t.querySelector(":scope > .block-helper");return e||(e=k("div",["block-helper"],t),k("span",["helper-sizer"],e,"A")),e}function J0(n,t,e){const o=Rf(n),i=Array.from(o.children).find(s=>{var a;return Number.parseInt((a=s.getAttribute("data-index"))!=null?a:"0",10)>e});o.insertBefore(t,i!=null?i:null)}const j7=40,c$=20;class a${findTargetBlock(t,e){const o=e.target;if(o&&o instanceof Element){const a=tt(o);if(a&&Xt(t.rootContainer,a))return a}let r=e.clientX,i=e.clientY;const s=t.rootContainer.getBoundingClientRect().left;r<s&&s-r<j7&&(r+=j7);let l=document.elementFromPoint(r,i);if(l){const a=tt(l);if(a&&Xt(t.rootContainer,a))return a}if(i-=c$,l=document.elementFromPoint(r,i),l){const a=tt(l);if(a&&Xt(t.rootContainer,a))return a}return null}destroy(){}}class u$ extends bf{constructor(e){super(e,{trigger:[],id:"empty-block-menu"});m(this,"currentBlock",null)}get isVisible(){return this.suggest.menu.isVisible}isInMenu(e){return this.menu.isInCommandBar(e)}show(){const o=this.editor.selection.focusedBlock;this.suggest.popup(o,0,"","")}setBlock(e){this.currentBlock=e}}function d$(n,t,e){const o=Vm(n,t);if(!o)return[];const r=[];return Object.values(o).forEach(i=>{e!=null&&e.has(i.group)||r.push(...i.commands.map(s=>({...s,source:"block-command",blockMenuItemCustomData:i.group})))}),r}function K0(n,t,e={withPlainText:!1}){const o=T0(n,e),r=i=>{i.forEach(s=>{s.source=t,s.children&&r(s.children)})};return r(o),o}function h$(n,t,e,o=!1){var d,h;const r=nt(t);let s=bt(t);ae(n,t)||o||(s+=1);const l=ct(r),a=e;return a.commandProvider?a.commandProvider.executeCommand(n,e,{from:"block-menu",containerId:l,blockIndex:s}):(h=(d=a.blockOptions)==null?void 0:d.handleInsertEmptyBlock)==null?void 0:h.call(d,n,{containerId:l,blockIndex:s,item:e})}function f$(n,t){const e=Do(n,t),o=n.getBlockData(t);return!(e!=="text"||o.heading)}class U7{constructor(t,e,o){m(this,"source","text-style");m(this,"id","text-style-item");m(this,"name","Text styles");m(this,"element");m(this,"textStylesTooltips",{});m(this,"createHeadingItemElement",(t,e,o)=>{var i;const r=B0();this.createItem("text",nu,e,f$(this.editor,t)),(i=r.insertBlockCommandItems)==null||i.forEach(s=>{s.id&&s.icon&&this.createItem(s.id,s.icon,e,o?o===Number(s.value):!1)})});m(this,"createListItemElement",(t,e,o)=>{const{checkbox:r,ordered:i}=o,l=Dt(t)==="list",a=l&&i===!1&&!r,d=l&&i,h=l&&!!r;this.createItem("unordered-list",av,e,a),this.createItem("ordered-list",uv,e,d),this.createItem("check-list",lv,e,h)});m(this,"handleClick",(t,e)=>{var l,a;if(!e.target||!(e.target instanceof Node))return;const o=e.target instanceof Element?e.target:e.target.parentElement;if(!o)return;const r=o.closest(".text-style-item");if(!r)return;const i=r.id,s="heading-";if(i==="text"&&Cf(t,this.block,null),i.startsWith(s)){const d=Number.parseInt(i.substring(s.length),10);d&&Cf(t,this.block,d)}if(i==="blockquote"&&y0(t,this.block),i.startsWith("align")){const d=i.replace(/^align-/,"");T9(t,this.block,d)}(i==="unordered-list"||i==="ordered-list"||i==="check-list")&&w0(t,this.block,i),(a=(l=this.options).onAfterStyleItemClick)==null||a.call(l)});m(this,"calcTextStyleItemTooltipsEnum",()=>{this.textStylesTooltips={text:{title:L.t("commands.text")},blockquote:{title:L.t("commands.quote")},"align-left":{title:L.t("commands.alignLeft")},"align-center":{title:L.t("commands.alignCenter")},"align-right":{title:L.t("commands.alignRight")},"unordered-list":{title:L.t("commands.unordered")},"ordered-list":{title:L.t("commands.ordered")},"check-list":{title:L.t("commands.check")}};let t=1;for(;t<=8;)this.textStylesTooltips[`heading-${t}`]={title:L.t("commands.heading",{name:`${t}`})},t++});this.editor=t,this.block=e,this.options=o,this.calcTextStyleItemTooltipsEnum(),this.element=this.createItemElement(t,e),t.domEvents.addEventListener(this.element,"click",this.handleClick)}createItemElement(t,e){const o=k("div",["text-styles"],null),r=k("div",["text-style-section"],o),i=t.getBlockData(e);if(!this.options.fromEmbed){const l=i.heading,a=i.quoted;this.createHeadingItemElement(e,r,l),this.createListItemElement(e,r,i),this.createItem("blockquote",cv,r,!!a)}const s=i.align||"left";return this.createItem("align-left",tu,r,s==="left"),this.createItem("align-center",Sp,r,s==="center"),this.createItem("align-right",Dp,r,s==="right"),o}createItem(t,e,o,r=!1){const i=["style-icon","text-style-item"];r&&i.push("active");const s=$l(e,i,o);s.id=t;const l=this.textStylesTooltips[t];if(!l)return;const{title:a,shortcut:d}=l;s.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,a),d&&s.setAttribute(`data-editor-tooltip-desc-${this.editor.clientId}`,ro(d))}}function z7(){return{source:"separator",type:"separator",id:`section-${K()}`,name:""}}const V7={copy:NL,cut:$L,delete:HL,"lock-block":jL,"unlock-block":UL,comment:eu},m$=["image","video"];function g$(n,t,e){const o=[],r=et(n,t),i=Me(t)&&m$.includes(fn(t)),s=i&&(fn(t)!=="image"||fn(t)==="image"&&br(t).length===1);if(r?o.push(new U7(n,t,e)):i&&s&&o.push(new U7(n,t,{...e,fromEmbed:!0})),!ae(n,t)){(r||i&&s)&&o.push(z7());const l=d$(n,t,new Set(["hovering-toolbar"]));l.sort((a,d)=>{var h,p;return((h=a.order)!=null?h:0)-((p=d.order)!=null?p:0)}),l.forEach(a=>{a.id in V7&&(a.icon=V7[a.id])}),o.push(...l)}return ae(n,t)?o.push(...K0(n,"insert-block")):o.push(z7(),{id:"insert-block-before",icon:zL,name:L.t("blockMenu.command.insertAbove"),children:K0(n,"insert-block-before",{withPlainText:!0}),childrenMenuId:"quick-menu",source:"insert-block-before"},{id:"insert-block-after",icon:VL,name:L.t("blockMenu.command.insertAfter"),children:K0(n,"insert-block",{withPlainText:!0}),source:"insert-block",childrenMenuId:"quick-menu"}),o}function p$(n,t,e){if(e.source==="block-command"){const o=e.blockMenuItemCustomData;d4(n,t,o,e)}else(e.source==="insert-block"||e.source==="insert-block-before")&&h$(n,t,e,e.source==="insert-block-before")}const C$=S("exclusive-block");function X0(n,t,e,o){var l;W(t,"block-exclusive");const r=Yt(n,t),i=(l=r.getBlockProperties)==null?void 0:l.call(r,n,t),{abstract:s}=i||{};t.setAttribute("data-user-name",o),t.setAttribute("data-user-id",e),t.setAttribute("data-exclusive-tips",L.t("exclusive.tips",{editor:o,embedType:s||L.t("exclusive.fallbackAbstract")}))}function W7(n){ot(n,"block-exclusive"),n.removeAttribute("data-user-name"),n.removeAttribute("data-user-id"),n.removeAttribute("data-exclusive-tips")}function A$(n,t,e,o,r){C$.debug(`block ${it(t)} ${e?"exclusive":"unexclusive"}, ${o}, ${r}`),e?X0(n,t,o,r):W7(t)}function Of(n){return n.classList.contains("block-exclusive")}function q7(n,t){t.blockIds.forEach(e=>{const o=n.findBlockById(e);o&&A$(n,o,t.exclusive,t.userId,t.displayName)})}class Ji{constructor(t){m(this,"exclusiveBlockIds",new Set);m(this,"exclusiveBlockTimer",0);m(this,"remoteExclusiveBlockIds",new Map);m(this,"handleUserChanged",t=>{const e=new Set(t.map(r=>r.userId));Array.from(this.remoteExclusiveBlockIds.entries()).forEach(([r,i])=>{if(!e.has(i.userId)){this.remoteExclusiveBlockIds.delete(r);const s={...i,exclusive:!1};q7(this.editor,s)}});const o=Array.from(this.exclusiveBlockIds).map(r=>this.editor.findBlockById(r)).filter(r=>!!r);o.length>0&&this.broadcastExclusiveBlockMessage(o,!0)});this.editor=t,t.doc.registerCallback(this),t.doc.getRemoteUsers().addListener("change",this.handleUserChanged)}destroy(){this.stopExclusiveBlockTimer(),this.editor.doc.unregisterCallback(this),this.editor.doc.getRemoteUsers().addListener("change",this.handleUserChanged)}onCustomMessage(t){if(t.type==="exclusiveBlock"){const e=t;q7(this.editor,e),e.blockIds.forEach(o=>{e.exclusive?this.remoteExclusiveBlockIds.set(o,e):this.remoteExclusiveBlockIds.delete(o)})}}getExclusiveMessage(t){return this.remoteExclusiveBlockIds.get(t)}broadcastExclusiveBlockMessage(t,e){if(this.editor.readonly||t.length===0)return;const o=this.editor.doc.getUser(),r={type:"exclusiveBlock",userId:o.userId,displayName:o.displayName,blockIds:t.map(i=>it(i)),exclusive:e};this.editor.doc.broadcastMessage(r)}exclusiveBlock(t){this.exclusiveBlockIds.has(it(t))||(this.broadcastExclusiveBlockMessage([t],!0),this.exclusiveBlockIds.add(it(t)),this.exclusiveBlockIds.size===1&&this.startExclusiveBlockTimer())}unexclusiveBlock(t){!this.exclusiveBlockIds.has(it(t))||(this.exclusiveBlockIds.delete(it(t)),this.broadcastExclusiveBlockMessage([t],!1),this.exclusiveBlockIds.size===0&&this.stopExclusiveBlockTimer())}startExclusiveBlockTimer(){this.exclusiveBlockTimer=window.setInterval(()=>{Array.from(this.exclusiveBlockIds.keys()).forEach(t=>{this.broadcastExclusiveBlockMessage([this.editor.getBlockById(t)],!0)})},30*1e3)}stopExclusiveBlockTimer(){clearInterval(this.exclusiveBlockTimer),this.exclusiveBlockTimer=0}static get(t){return t.addCustom("exclusiveBlock",()=>new Ji(t))}static register(t){return this.get(t)}}function t2(n,t){Ji.get(n).exclusiveBlock(t)}function e2(n,t){Ji.get(n).unexclusiveBlock(t)}class G7{writable(t,e){if(Of(e))return!1}create(t,e,o,r,i){const s=Ji.get(t).getExclusiveMessage(i.id);s&&X0(t,r,s.userId,s.displayName)}update(t,e,o,r,i){const s=Ji.get(t).getExclusiveMessage(i.id);s?X0(t,r,s.userId,s.displayName):W7(r)}}const qnt="",b$={exclusive:{tips:"\u300C{editor}\u300D\u6B63\u5728\u7F16\u8F91\uFF0C\u300C{embedType}\u300D\u4E0D\u652F\u6301\u591A\u4EBA\u7F16\u8F91",fallbackAbstract:"\u8BE5 Block"}},v$={exclusive:{tips:"\u300C{editor}\u300Dis editing\uFF0C\u300C{embedType}\u300Ddoes not support multi-person editing",fallbackAbstract:"This Block"}},y$={exclusive:{tips:"\u300C{editor}\u300D\u306F\u7DE8\u96C6\u4E2D\u3067\u3059\u3002\u300C{embedType}\u300D\u306F\u8907\u6570\u4EBA\u3067\u540C\u6642\u7DE8\u96C6\u3067\u304D\u307E\u305B\u3093",fallbackAbstract:"\u3053\u306E\u8981\u7D20"}};L.mergeLang({"zh-CN":b$,"en-US":v$,"ja-JP":y$});function Du(n,t){return n.getBlockData(t).lock}function _f(n,t){return!!Du(n,t)}function Su(n,t){const e=Du(n,t);return e?e.userId===n.doc.getUser().userId:!1}function n2(n,t){const e=Du(n,t);return e?e.userId!==n.doc.getUser().userId:!1}function k$(n,t){if(n.readonly||!n.isBlockWritable(t)||_f(n,t)&&!Su(n,t))return;const e=n.doc.getUser(),o={userId:e.userId,displayName:e.displayName,locked:Date.now()},i={...n.getBlockData(t),lock:o};n.updateBlockData(t,i)}function w$(n,t){if(!Su(n,t))return;const e={lock:null};n.updateBlockData(t,e)}const B$=10,E$=80;class o2{constructor(){m(this,"executeCommand",(t,e,o)=>{const r=o.data;if(!r||!r.blockId)return;const i=t.getBlockById(r.blockId);r.type==="lock"?k$(t,i):r.type==="unlock"&&w$(t,i)})}create(t,e,o,r,i){const s=i.lock;s&&(s.userId!==t.doc.getUser().userId?W(r,"locked-by-others"):W(r,"locked-by-self"))}update(t,e,o,r,i){const s=i.lock;if(s)if(s.userId!==t.doc.getUser().userId){W(r,"locked-by-others");const l=t.selection.focusedBlock;(l===r||Xt(r,l))&&(et(t,r)||Dt(r)==="code")&&t.insertTextBlock("",ct(o),bt(r)+1)}else W(r,"locked-by-self");else ot(r,"locked-by-others"),ot(r,"locked-by-self")}writable(t,e){if(n2(t,e))return!1;if(so(e))return;let o=Es(e);for(;o;){if(n2(t,o))return!1;o=Es(o)}}commands(t,e){const o=_f(t,e),r=Su(t,e),i=Of(e),s={blockId:it(e),type:"lock"},l={id:"lock-block",name:"",data:s,order:10};if(o)if(r)l.id="unlock-block",l.name=L.t("locker.unlock"),s.type="unlock";else{const a=Du(t,e);let d=(a==null?void 0:a.displayName)||"";const h=O5(d,B$,E$);(h==null?void 0:h.length)!==d.length&&(l.ellipsisTooltip=a==null?void 0:a.displayName,d=h||""),l.name=L.t("locker.lockedBy",{name:d}),l.states=["disabled"]}else i?(l.name=L.t("locker.lock"),l.states=["disabled"]):l.name=L.t("locker.lock");return{group:"block-locker",commands:[l],executeCommand:this.executeCommand}}}const Gnt="",x$={locker:{lock:"\u9501\u5B9A",unlock:"\u89E3\u9664\u9501\u5B9A",lockedBy:"\u88AB {name} \u9501\u5B9A"}},I$={locker:{lock:"Lock",unlock:"Unlock",lockedBy:"Locked by {name}"}},T$={locker:{lock:"\u30ED\u30C3\u30AF",unlock:"\u30ED\u30C3\u30AF\u89E3\u9664",lockedBy:"{name}\u304C\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F"}};L.mergeLang({"zh-CN":x$,"en-US":I$,"ja-JP":T$});class Ff{async handleBeforePasteDoc(t,e){return Object.values(e.blocks).forEach(o=>{o.forEach(r=>{delete r.lock})}),!1}}const D$=S("standard-block-actions");class S${constructor(){m(this,"executeCommand",(t,e,o)=>{const r=o.data;try{const i=t.getBlockById(r);if(o.id==="delete"){t.deleteBlock(i);return}o.id==="copy"&&Fh(t,i),o.id==="cut"&&(Fh(t,i),t.deleteBlock(i))}catch(i){D$.error(`failed to execute block command: ${JSON.stringify(i)}`)}})}commands(t,e){const o=_f(t,e),r=o&&Su(t,e),i=it(e),s=j0(),l=Of(e),a={id:"copy",name:L.t("blockMenu.command.copy"),data:i,order:1,states:s?[]:["disabled"],disableReason:s?void 0:L.t("copyCutProperty.unsafeEnvTips",{shortCut:ro("CtrlOrCmd+C"),operation:L.t("copyCutProperty.copy")})},d={id:"cut",name:L.t("blockMenu.command.cut"),data:i,order:2,states:o&&!r||!s||l?["disabled"]:[],disableReason:s?void 0:L.t("copyCutProperty.unsafeEnvTips",{shortCut:ro("CtrlOrCmd+X"),operation:L.t("copyCutProperty.cut")})},h={id:"delete",name:L.t("blockMenu.command.delete"),data:i,order:3,states:o&&!r||l?["disabled"]:[]};return{group:"standard-block-actions",commands:[a,d,h],executeCommand:this.executeCommand}}}const Z7=S("block-menu");class L${constructor(t){m(this,"menu");m(this,"currentBlock",null);m(this,"commandBlock",null);m(this,"handleShow",()=>{g(Z7,this.currentBlock,"no target block before show block menu");const t=g$(this.editor,this.currentBlock,{onAfterStyleItemClick:this.close});this.menu.updateItems(t),this.commandBlock=this.currentBlock});m(this,"handleClose",()=>{Fp(this.editor)&&this.editor.focus()});m(this,"handleItemClick",(t,e)=>{g(Z7,this.commandBlock,"no command block before show block menu"),p$(this.editor,this.commandBlock,e),e.element||this.close()});m(this,"close",()=>{this.menu.close("clickItem")});this.editor=t,this.menu=new Us([],void 0,{id:"block-menu"}),this.menu.on("show",this.handleShow),this.menu.on("close",this.handleClose),this.menu.on("click",this.handleItemClick),t.blockHooks.push(new S$)}show(t,e){this.menu.manualShow(t,{placement:"bottom-start",...e})}isInMenu(t){return this.menu.isInCommandBar(t)}setBlock(t){this.currentBlock=t}get isVisible(){return this.menu.isVisible}destroy(){this.menu.destroy()}}const M$=1e3;async function R$(n,t){const{width:e}=n.rootContainer.getBoundingClientRect(),o=t.getBoundingClientRect();return o.width>e||o.height>=M$?"":(await QC.default.toSvg(t)).replace(/margin-block:.*?;/,"").replace(/margin:.*?;/,"")}const O$=S("drag-preview-image");class _${constructor(t){m(this,"startPosition",null);m(this,"dragContainer",null);m(this,"handleDragStart",async(t,e)=>{const o=t.target;g(O$,o instanceof Element,`Invalid Drag target:${o}`);const{x:r,y:i}=t;this.startPosition={x:r,y:i};const s=k("div",["drag-image-container"],this.editor.rootContainer),l=k("img",["drag-image"],s),a=k("span",["drag-loading"],s);a.innerHTML=ZL;const{x:d,width:h,height:p,y:A}=o.getBoundingClientRect(),v=this.editor.rootContainer.getBoundingClientRect(),B=e.getBoundingClientRect();s.style.left=`${d+h}px`,s.style.top=`${A+p}px`,s.style.width=`${Math.min(v.width/2,B.width)}px`,this.dragContainer=s;const x=await R$(this.editor,e);x?l.src=x:W(s,"drag-placeholder"),bm(s,{status:"loaded"})});m(this,"handleDrag",t=>{if(this.startPosition&&this.dragContainer){const{x:e,y:o}=t;if(e===0&&o===0){this.dragContainer.style.transition="transform 0.15s, opacity .15s",this.dragContainer.style.transform="",this.dragContainer.style.opacity="0";return}const{x:r,y:i}=this.startPosition,s=e-r,l=o-i;this.dragContainer.style.transform=`translate(${s}px, ${l}px)`}});m(this,"handleDragEnd",()=>{this.dragContainer&&(this.dragContainer.remove(),this.startPosition=null,this.dragContainer=null)});this.editor=t}}const Q7="drag-preview-element";function F$(n){if(xt(n,Q7))return n;const t=n.querySelector(`.${Q7}`);return t||(Me(n)?Lt(n):n)}const Pf=S("block-menu-drag-handler");function r2(n,t){return new DragEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,dataTransfer:new DataTransfer,clientX:n.clientX,clientY:n.clientY})}class P${constructor(t,e){m(this,"dragPreview");m(this,"autoScroll");m(this,"oldPos",{x:0,y:0});m(this,"handleMouseDown",t=>{const e=this.button.blockMenu.currentBlock;if(g(Pf,e,"no dragged block"),t.button!==0)return;if(!this.editor.isBlockWritable(e)){t.preventDefault(),t.stopPropagation();return}const{x:o,y:r}=t;this.oldPos={x:o,y:r},document.addEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.addEventListener("mousemove",this.handleDrag)});m(this,"handleDragStart",t=>{var s,l;const e=io(this.button.buttonElement);this.autoScroll||(this.autoScroll=new Yd({scrollElement:e,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}));const o=this.button.blockMenu.currentBlock;g(Pf,o,"no dragged block"),(l=(s=Yt(this.editor,o)).notify)==null||l.call(s,this.editor,"beginDrag");const r=r2(t,"dragstart");U$(this.editor,r,o),window.isDragging=!0,this.button.buttonElement.style.opacity="0";const i=F$(o);this.dragPreview.handleDragStart(t,i),this.autoScroll.active(),W(o,"dragging"),W(this.editor.contentElement,"dragging")});m(this,"handleDrag",t=>{const{target:e,x:o,y:r}=t;if(this.oldPos.x===o&&this.oldPos.y===r)return;window.isDragging||this.handleDragStart(t),this.oldPos={x:o,y:r},g(Pf,e instanceof Element,"target is invalid"),this.dragPreview.handleDrag(t);const i=r2(t,"dragover");this.editor.contentElement.dispatchEvent(i)});m(this,"handleDragEnd",t=>{var r;const e=this.button.blockMenu.currentBlock;g(Pf,e,"no dragged block"),window.isDragging=!1,this.button.buttonElement.style.opacity="1",this.dragPreview.handleDragEnd(),(r=this.autoScroll)==null||r.inactive(),ot(e,"dragging"),ot(this.editor.contentElement,"dragging"),document.removeEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.removeEventListener("mousemove",this.handleDrag);const o=r2(t,"drop");this.editor.contentElement.dispatchEvent(o)});this.editor=t,this.button=e,this.button.buttonElement.addEventListener("mousedown",this.handleMouseDown),this.dragPreview=new _$(t)}destroy(){this.button.buttonElement.removeEventListener("mousedown",this.handleMouseDown)}}class Lu{constructor(t){m(this,"highlightedBlockId","");m(this,"handleSelectionChange",()=>{this.clearHighlightedBlock()});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChange)}highlightBlock(t){this.clearHighlightedBlock(),this.highlightedBlockId=it(t),W(t,"highlighted")}clearHighlightedBlock(){if(this.highlightedBlockId){const t=this.editor.findBlockById(this.highlightedBlockId);t&&ot(t,"highlighted"),this.highlightedBlockId=""}}destroy(){}static register(t){return t.addCustom("editor-block-highlighter",()=>new Lu(t))}static get(t){return t.getCustom("editor-block-highlighter")}}class Y7{constructor(t){m(this,"buttonElement");m(this,"emptyBlockMenu");m(this,"blockMenu");m(this,"dragHandler");m(this,"handleHoverBlock",(t,e,o)=>{if(this.emptyBlockMenu.isVisible||this.blockMenu.isVisible||!this.editor.isWritable())return;const r=this.editor.getCustom("editor-tooltip");if(r&&r.visible()&&(r.hide(),this.buttonElement.setAttribute("data-tooltip-hide-at",`${Date.now()}`)),!t){this.buttonElement.parentElement&&(this.blockMenu.isInMenu(o.target)||this.buttonElement.remove());return}const i=zm(t);this.editor.getBlockIndex(i)===0&&this.editor.getBlockData(i).heading===1||(this.updateButton(i),J0(i,this.buttonElement,Number.MAX_SAFE_INTEGER))});m(this,"handleButtonClick",()=>{if(this.buttonElement.getAttribute("data-type")==="move"){const o=this.blockMenu.currentBlock;if(!o)return;this.editor.selection.selectBlock(o,0),this.blockMenu.show(this.buttonElement,{placement:"bottom-end"}),setTimeout(()=>{Lu.get(this.editor).highlightBlock(o)});return}const e=this.emptyBlockMenu.currentBlock;!e||(this.editor.selection.selectBlock(e,0),setTimeout(()=>{this.editor.focus(),this.updatePlaceholder(e),this.emptyBlockMenu.show()}))});m(this,"updatePlaceholder",t=>{Lt(t).setAttribute("data-content-placeholder",L.t("blockMenu.button.searchPlaceholder"))});m(this,"handleChanged",()=>{const t=this.emptyBlockMenu.currentBlock;if(!t)return;const e=ae(this.editor,t)?"insert":"move";this.buttonElement.getAttribute("data-type")!==e&&this.setButtonType(e)});this.editor=t,this.buttonElement=this.createButton(),this.emptyBlockMenu=new u$(t),this.blockMenu=new L$(t),this.editor.addListener("docChanged",this.handleChanged),this.buttonElement.addEventListener("click",this.handleButtonClick),this.dragHandler=new P$(this.editor,this);const e=Ce.get(t);e.addListener("change",this.handleHoverBlock),e.addFinder(new a$),Lu.register(this.editor)}destroy(){Ce.get(this.editor).removeListener("change",this.handleHoverBlock),this.buttonElement.removeEventListener("click",this.handleButtonClick),this.editor.removeListener("docChanged",this.handleChanged),this.emptyBlockMenu.destroy(),this.blockMenu.destroy(),this.buttonElement.remove(),this.dragHandler.destroy()}createButton(){const t=k("button",["block-button"],null);return t.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,L.t("blockMenu.button.tips")),t.innerHTML=dv,t}setButtonType(t){this.buttonElement.setAttribute("data-type",t);const e=`data-editor-tooltip-${this.editor.clientId}-dynamic`;this.buttonElement.hasAttribute(e)&&this.buttonElement.removeAttribute(e),t==="insert"?(this.buttonElement.innerHTML=GL,this.buttonElement.setAttribute(e,L.t("blockMenu.button.insertTips"))):(this.buttonElement.innerHTML=dv,this.buttonElement.setAttribute(e,L.t("blockMenu.button.tips")))}updateButton(t){this.emptyBlockMenu.setBlock(t),this.blockMenu.setBlock(t),ae(this.editor,t)?this.setButtonType("insert"):this.setButtonType("move")}}const N$={blockMenu:{section:{basics:"\u57FA\u7840",system:"\u7CFB\u7EDF",styles:"\u6837\u5F0F",common:"\u901A\u7528",actions:"\u64CD\u4F5C",thirdParty:"\u7B2C\u4E09\u65B9\u5185\u5BB9"},command:{insertAbove:"\u5728\u4E0A\u65B9\u63D2\u5165",insertAfter:"\u5728\u4E0B\u65B9\u63D2\u5165",copy:"\u590D\u5236",cut:"\u526A\u5207",delete:"\u5220\u9664"},button:{searchPlaceholder:"\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",tips:`\u957F\u6309\u62D6\u62FD
433
433
  \u70B9\u51FB\u6253\u5F00\u83DC\u5355`,insertTips:"\u70B9\u51FB\u6DFB\u52A0\u533A\u5757"}}},$$={blockMenu:{section:{basics:"Basic",system:"System",styles:"Styles",common:"Common",actions:"Actions",thirdParty:"Third-party content"},command:{insertAbove:"Insert above",insertAfter:"Insert below",copy:"Copy",cut:"Cut",delete:"Delete"},button:{searchPlaceholder:"Search",tips:`Hold to drag
434
- Click to open the menu`,insertTips:"Click to add block"}}},H$={blockMenu:{section:{basics:"\u4E00\u822C",system:"\u30B7\u30B9\u30C6\u30E0",styles:"\u30B9\u30BF\u30A4\u30EB",common:"\u4E00\u822C",actions:"\u64CD\u4F5C",thirdParty:"\u5916\u90E8\u30B3\u30F3\u30C6\u30F3\u30C4"},command:{insertAbove:"\u4E0A\u306B\u633F\u5165",insertAfter:"\u4E0B\u306B\u633F\u5165",copy:"\u8907\u88FD",cut:"\u5207\u308B",delete:"\u524A\u9664"},button:{searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u691C\u7D22",tips:"\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30AF\u30EA\u30C3\u30AF\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u8868\u793A",insertTips:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30D6\u30ED\u30C3\u30AF\u3092\u8FFD\u52A0"}}};L.mergeLang({"zh-CN":N$,"en-US":$$,"ja-JP":H$});const Znt="";class j${constructor(){m(this,"dragObject",null)}setData(t){this.dragObject=t}getData(){return this.dragObject}clearData(){this.dragObject=null}destroy(){}}function Nf(n){return n.addCustom("drag-data",()=>new j$)}function i2(n,t){if(!t)return null;const e=Nf(n).getData();return!e||e.editorId!==n.id?null:e}function J9(n,t){const e=i2(n,t);return e?n.findBlockById(e.blockId):null}function U$(n,t,e){if(!t.dataTransfer)return;const r=nt(e),i=ct(r),s=it(e),l={type:"block",editorId:n.id,containerId:i,blockId:s};Nf(n).setData(l)}function z$(n,t,e,o,r){if(!t.dataTransfer)return;const s=nt(e),l=ct(s),a=it(e),d={type:"custom",customType:o,editorId:n.id,containerId:l,blockId:a,data:r};Nf(n).setData(d)}function V$(n){Nf(n).clearData()}const W$=S("drop-indicator"),$f=2;class q${constructor(t){m(this,"indicator");m(this,"target",null);this.editor=t,this.indicator=k("div",["editor-drop-indicator"],this.editor.contentElement)}show(t,e){const o=this.getIndicatorRect(t,e),r=this.editor.rootElement.getBoundingClientRect(),i=o.top-r.top,s=o.left-r.left;this.indicator.style.top=`${i}px`,this.indicator.style.left=`${s}px`,this.indicator.style.width=`${o.width}px`,this.indicator.style.height=`${o.height}px`,this.indicator.style.display="",this.target={block:t,insertPos:e}}hide(){this.indicator.style.display="none",this.target=null}getIndicatorRect(t,e){if(typeof e!="string")return e.rect;if(e==="before"){const s=Is(t);if(!s){g(W$,Lo(nt(t)),"block does not in a child container");const d=t.getBoundingClientRect();return new DOMRect(d.x,d.y,d.width,$f)}const l=s.getBoundingClientRect(),a=t.getBoundingClientRect();return new DOMRect(l.x,(l.bottom+a.top)/2,l.width,$f)}const o=Ts(t);if(!o){const s=t.getBoundingClientRect();return new DOMRect(s.x,s.bottom,s.width,$f)}const r=t.getBoundingClientRect(),i=o.getBoundingClientRect();return new DOMRect(r.x,(r.bottom+i.top)/2,r.width,$f)}}const G$=S("find-drop-target");function Z$(n,t){const e=document.elementFromPoint(n,t);if(!e)return null;if(Nr(e)&&Lo(e))return e;const o=e.firstElementChild;return o&&Nr(o)&&Lo(o)?o:null}function Q$(n,t){const s=t,l=n;for(let a=0;a<2;a++){const d=l+a*50;for(let h=0;h<5;h++){const p=s+h*8,A=document.elementFromPoint(d,p);if(A){const D=tt(A);if(D)return D}if(h===0)continue;const v=s-h*8,B=document.elementFromPoint(d,v);if(B){const D=tt(B);if(D)return D}}}return null}function Y$(n,t,e){const o=document.elementFromPoint(t,e);if(o){const h=tt(o);if(h&&!Mt(n,h))return h}const r=new Set,i=Z$(t,e);if(i){const h=i.getBoundingClientRect();e<h.top+h.height/2?r.add(ye(i)):r.add(Qe(i))}const s=Q$(t,e);s&&r.add(s);const l=Array.from(r),a=h=>{for(let p=0;p<l.length;p++){const A=l[p];if(h!==A&&Xt(h,A))return!0}return!1},d=l.filter(h=>!a(h));return d.length>0?d[0]:null}function s2(n,t){if(n.readonly)return!1;const e=nt(t);if(Gt(e))return!0;const o=tt(e);return g(G$,o,"no parent block"),n.isBlockWritable(o)?s2(n,o):!1}const J$=S("drop-target");function K$(n,t){let e={};return/image/.test(t.type)?e=n.editorEmbeds.getEmbedClass("image"):/audio/.test(t.type)?e=n.editorEmbeds.getEmbedClass("audio"):/video/.test(t.type)&&(e=n.editorEmbeds.getEmbedClass("video")),g(J$,e,`unSupport file type ${t.type}`),e}async function K9(n,t,e,o){var i,s;let r=o;for(const l of t){const a=K$(n,l);a.getOptions&&await((s=(i=a.getOptions(n)).handleInsertEmptyEmbed)==null?void 0:s.call(i,n,{containerId:e,blockIndex:r,data:{file:l}}))&&(r+=1)}}class X${constructor(t){m(this,"handleDrop",(t,e,o,r)=>{if(Array.isArray(e)){const i=e;if(i.length>0){const s=ct(o);return K9(t,i,s,r),!0}}return!1});this.editor=t}}class Mu{constructor(t){m(this,"indicator");m(this,"lastDropOverResult");m(this,"handlers",[]);m(this,"handleDragOver",t=>{if(!this.editor.isWritable())return;const e=i=>{var d,h;const s=i2(this.editor,i.dataTransfer),l=J9(this.editor,i.dataTransfer),a=this.findTargetBlock(l,i.x,i.y);if(a&&Xt(this.editor.rootContainer,a)){const p=this.findInsertPos(l,a,i.x,i.y,(h=s!=null?s:(d=i.dataTransfer)==null?void 0:d.items)!=null?h:null);if(p)return this.indicator.show(a,p),"move"}return this.indicator.hide(),"none"},o=(i,s)=>{i.dataTransfer&&(i.dataTransfer.dropEffect=s),s==="move"&&i.preventDefault()};if(this.lastDropOverResult&&t.x===this.lastDropOverResult.x&&t.y===this.lastDropOverResult.y){const i=this.lastDropOverResult.dropEffect;o(t,i);return}const r=e(t);o(t,r),this.lastDropOverResult={x:t.x,y:t.y,dropEffect:r}});m(this,"handleDrop",t=>{var i,s;t.stopPropagation(),setTimeout(()=>{this.indicator.hide()});const e=i2(this.editor,t.dataTransfer),o=Array.from((s=(i=t.dataTransfer)==null?void 0:i.files)!=null?s:[]);if(!e&&o.length===0){t.dataTransfer&&(t.dataTransfer.dropEffect="none");return}const r=this.indicator.target;if(r){const{block:l,insertPos:a}=r,d=J9(this.editor,t.dataTransfer);this.editor.undoManager.runInGroup(()=>{const h=Yt(this.editor,l);if(h.handleDrop&&h.handleDrop(this.editor,l,e!=null?e:o,a,{isSourceBlock:!1,targetBlock:l})){t.preventDefault(),this.editor.focus();return}if(d){const p=Yt(this.editor,d);if(p.handleDrop&&p.handleDrop(this.editor,d,e!=null?e:o,a,{isSourceBlock:!0,targetBlock:l})){t.preventDefault(),this.editor.focus();return}}if(typeof a=="string"){const p=nt(l);let A=bt(l);a==="after"&&(A+=1),t.preventDefault();for(let v=0;v<this.handlers.length;v++)if(this.handlers[v].handleDrop(this.editor,d!=null?d:o,p,A)){this.editor.focus();return}if(d){const v=this.editor.getBlockData(d),B=Pi(this.editor.editorBlocks,this.editor.doc.toJSON(),v),[D]=this.editor.insertDocAt(p,A,B);this.editor.selection.selectBlock(D,0),Lu.get(this.editor).highlightBlock(D),this.editor.deleteBlock(d),this.editor.focus()}}}),V$(this.editor)}});m(this,"handleDragLeave",()=>{this.indicator.hide()});this.editor=t,this.indicator=new q$(this.editor),this.handlers.push(new X$(this.editor)),this.editor.contentElement.addEventListener("dragover",this.handleDragOver),this.editor.contentElement.addEventListener("dragleave",this.handleDragLeave),this.editor.contentElement.addEventListener("drop",this.handleDrop)}destroy(){this.editor.contentElement.removeEventListener("dragover",this.handleDragOver),this.editor.contentElement.removeEventListener("dragleave",this.handleDragLeave),this.editor.contentElement.removeEventListener("drop",this.handleDrop),this.handlers=[]}addHandler(t){this.handlers.push(t)}static register(t){return t.addCustom("drop-target",()=>new Mu(t))}static get(t){return t.getCustom("drop-target")}static find(t){return t.findCustom("drop-target")}canInsertAfter(t,e){return!(this.editor.readonly||Ts(e)===t&&t||!s2(this.editor,e))}canInsertBefore(t,e){return!(this.editor.readonly||Is(e)===t&&t||!s2(this.editor,e)||Gt(nt(e))&&bt(e)===0)}canDrop(t,e){return t===null||t===e?!0:!Xt(t,e)}findTargetBlock(t,e,o){let r=Y$(this.editor,e,o);if(!r||!Xt(this.editor.rootContainer,r))return null;const i=nt(r),s=tt(i);return s&&Dt(s)==="code"&&(r=s),this.canDrop(t,r)?r:null}findInsertPos(t,e,o,r,i){let s=e;for(;s;){const a=Yt(this.editor,s);if(a.handleDropOver){const d=a.handleDropOver(this.editor,s,i,o,r);if(d)return d;if(d===!1)return null}s=Es(s)}if(t===e)return"";const l=e.getBoundingClientRect();if(l.top<=r&&r<=l.bottom){if(r<l.top+l.height/2){if(this.canInsertBefore(t,e))return"before";if(this.canInsertAfter(t,e))return"after"}else{if(this.canInsertAfter(t,e))return"after";if(this.canInsertBefore(t,e))return"before"}return""}return r<l.top&&this.canInsertBefore(t,e)?"before":l.bottom<r&&this.canInsertAfter(t,e)?"after":""}}function X9(n,t,e){const o=Ie.getImageObject(n,t),r=mt.default(o.getImages());if(r.length===1){n.deleteBlock(t);return}if(e===-1||e>=r.length)return;const i=$N(r);if(r.splice(e,1),r.length===1){const l=r[0],a=100*(l.flex/i);l.flex=1;const d=cn([l],a);n.updateEmbedData(t,d);return}r[0].flex=NaN,Bu(r);const s=cn(r,o.getWidthPercent());n.updateEmbedData(t,s)}function tH(n,t,e,o){if(t.length===0||o==="after"||o==="before")return!1;let r=o.data;const i=Ie.getImageObject(n,e),s=mt.default(i.getImages()),l=[],a=[];t.forEach(p=>{$9(p.type)&&s.length+l.length<6?l.push(p):a.push(p)}),l.forEach(p=>{try{N9(n,p)}catch{return}const A={src:"",flex:1,width:0,height:0,virtualSize:!0};s.splice(r,0,A);const v=cn(s,i.getWidthPercent());n.updateEmbedData(e,v),i.replaceImage(r,p),r+=1});const d=n.getBlockIndex(e)+1,h=ct(nt(e));return K9(n,a,h,d),!0}function eH(n,t,e,o,r){var s,l,a;if(Zd(e))return tH(n,e,t,o);if(e.type!=="custom"||e.customType!=="image"||!e.data)return;const i=e.data;if(r.isSourceBlock){const d=r.targetBlock,h=nt(d);let p=bt(d);o==="after"&&(p+=1);const v=100*(i.boundingRect.width/n.rootContainer.getBoundingClientRect().width),B=cn([i.image],v),D={id:K(),type:"embed",embedType:"image",embedData:B},x=(l=(s=n.options.componentsOptions)==null?void 0:s.image)==null?void 0:l.defaultAlign;x&&(D.align=x),n.insertBlock(ct(h),p,D),X9(n,t,i.index),(a=n.findCustom("drag-handler"))==null||a.handleDragEnd()}else{if(typeof o=="string")return;const d=t;let h=o.data;const p=Ie.getImageObject(n,d),A=mt.default(p.getImages());h>A.length&&(h=A.length),n.undoManager.runInGroup(()=>{var B,D;p.setAutoFix(!0);const v=n.getBlockById(e.blockId);if(v===d){const x=i.index,_=h,R=i.image;if(x===_||_===x+1)return;let H=_;x<_?(A.splice(_,0,R),A.splice(x,1),H-=1):(A.splice(x,1),A.splice(_,0,R));const z=cn(A,p.getWidthPercent());n.updateEmbedData(d,z),p.setSelectedIndex(H),(B=n.findCustom("drag-handler"))==null||B.handleDragEnd()}else{A.splice(h,0,i.image),A[0].flex=NaN,Bu(A);const x=cn(A,p.getWidthPercent());n.updateEmbedData(d,x),X9(n,v,i.index),(D=n.findCustom("drag-handler"))==null||D.handleDragEnd(),p.setSelectedIndex(h),n.selection.selectBlock(d,0)}})}return!0}const nH=2;function Hf(n,t,e){const o=br(t);if(e<=0){const s=o[0].getBoundingClientRect();return new DOMRect(s.left-4,s.top,2,s.height)}if(e===o.length){const s=o[e-1].getBoundingClientRect();return new DOMRect(s.right+2,s.top,2,s.height)}const r=o[e-1].getBoundingClientRect(),i=o[e].getBoundingClientRect();return new DOMRect((i.left+r.right)/2-1,r.top,nH,r.height)}function oH(n,t,e,o,r){for(let i=0;i<e.length;i++){const l=e[i].getBoundingClientRect();if(o<=l.right)return o<=l.left+l.width/2?{rect:Hf(n,t,i),data:i}:{rect:Hf(n,t,i+1),data:i+1}}return o>e[e.length-1].getBoundingClientRect().right?{rect:Hf(n,t,e.length),data:e.length}:{rect:Hf(n,t,e.length),data:0}}function rH(n,t,e,o,r){const i=br(t);if(e instanceof DataTransferItemList){if(!Array.from(e).some(s=>$9(s.type))||i.length>=6)return}else{if((e==null?void 0:e.type)==="block"||i.length>=6&&(e==null?void 0:e.blockId)!==it(t))return;const s=it(t);if(i.length===1&&s===(e==null?void 0:e.blockId))return}return oH(n,t,i,o)}async function iH(n){return await QC.default.toSvg(n)}function l2(n,t){return new DragEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,dataTransfer:new DataTransfer,clientX:n.clientX,clientY:n.clientY})}class sH{constructor(t){m(this,"img");m(this,"dragContainer",null);m(this,"autoScroll",null);m(this,"imageContainer",null);m(this,"startPosition",null);m(this,"handleMouseDown",t=>{const e=t.target;if(!e||!(e instanceof HTMLImageElement)||t.button!==0)return;const o=tt(e);if(!o||!Wo(o)||!this.editor.isBlockWritable(o)||this.editor.readonly)return;const r=Ie.getImageObject(this.editor,o);if(this.imageContainer=Q0(t.target),!this.imageContainer)return;const s=M9(t.target).indexOf(this.imageContainer);if(s===-1)return;const l=r.getImages()[s];if(!l)return;const{x:a,y:d}=t;this.startPosition={x:a,y:d};const h={image:l,index:s,boundingRect:this.imageContainer.getBoundingClientRect()},p=l2(t,"dragstart");z$(this.editor,p,o,"image",h),document.addEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.addEventListener("mousemove",this.handleDrag),t.preventDefault()});m(this,"handleDragStart",async t=>{if(!this.imageContainer)return;const e=tt(this.imageContainer);if(!e)return;const{x:o,y:r}=t,{width:i,height:s}=t.target.getBoundingClientRect(),l=te(e),a=k("div",["drag-container"],l);a.style.left=`${o-i/4}px`,a.style.top=`${r-s/4}px`,a.style.width=`${Math.max(i/2,16)}px`,a.style.height=`${s/2}px`,this.dragContainer=a,W(this.editor.contentElement,"dragging");const d=io(e);this.autoScroll=new Yd({scrollElement:d,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}),this.autoScroll.active();const h=k("img",["drag-target"],a),A=await iH(this.imageContainer);A&&(h.src=A)});m(this,"handleDrag",t=>{var i;const{x:e,y:o}=t;if(((i=this.startPosition)==null?void 0:i.x)===e&&this.startPosition.y===o)return;if(window.isDragging||(window.isDragging=!0,this.handleDragStart(t)),this.startPosition&&this.dragContainer){const{x:s,y:l}=t;if(s===0&&l===0){this.dragContainer.style.transform="",this.dragContainer.style.opacity="0";return}const{x:a,y:d}=this.startPosition,h=s-a,p=l-d;this.dragContainer.style.transform=`translate(${h}px, ${p}px)`,this.dragContainer.style.opacity="0.5"}const r=l2(t,"dragover");this.editor.contentElement.dispatchEvent(r)});m(this,"handleDragEnd",t=>{var e;if(window.isDragging=!1,this.dragContainer&&this.dragContainer.remove(),this.dragContainer=null,this.startPosition=null,this.imageContainer=null,(e=this.autoScroll)==null||e.inactive(),ot(this.editor.contentElement,"dragging"),document.removeEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.removeEventListener("mousemove",this.handleDrag),t){const o=l2(t,"drop");this.editor.contentElement.dispatchEvent(o)}});this.editor=t,this.editor.rootContainer.addEventListener("mousedown",this.handleMouseDown),this.img=new Image,this.img.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}destroy(){this.editor.rootContainer.removeEventListener("mousedown",this.handleMouseDown)}}class lH{constructor(t){m(this,"handleFocusBlockChanged",(t,e,o)=>{const i=this.editor.getFocusedBlock();if(i&&Wo(i)){const s=Ie.getImageObject(this.editor,i);s.getImages().length>0&&s.getSelectedIndex()===-1&&s.setSelectedIndex(0)}o&&Wo(o)&&t.findCustom(`image-${o.id}`)&&Ie.getImageObject(this.editor,o).blockResizer.disableResize()});this.editor=t,this.editor.addListener("focusBlockChanged",this.handleFocusBlockChanged)}destroy(){this.editor.removeListener("focusBlockChanged",this.handleFocusBlockChanged)}}class cH{constructor(t){m(this,"currentResizer",null);m(this,"handleHoveringBlockChange",(t,e)=>{window.isDragging||(e&&this.disable(e),t&&(this.currentResizer=t,this.enable(t)))});this.editor=t,Ce.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){Ce.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}disable(t){Wo(t)&&Ie.getImageObject(this.editor,t).disableResizer()}enable(t){if(Wo(t)){const e=Ie.getImageObject(this.editor,t);this.editor.isBlockWritable(t)&&e.tryEnableResizer()}}}const aH={image:{title:"\u56FE\u7247",upload:{failed:'<div class="line-1">\u56FE\u7247\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <a href="" class="retry-upload">\u91CD\u8BD5</a></div>'},load:{failed:'<div class="line-1">\u56FE\u7247\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <a href="" class="retry-upload">\u91CD\u8BD5</a></div>',remote:{failed:'<div class="line-1">\u56FE\u7247\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u8BE5\u56FE\u7247\u6765\u81EA\u5916\u90E8\u94FE\u63A5\uFF0C\u5916\u90E8\u94FE\u63A5\u5DF2\u5931\u6548</div><div class="line-3">\u8BF7\u5C06\u539F\u56FE\u4FDD\u5B58\u5230\u672C\u5730\u540E\u4E0A\u4F20\uFF0C <a href="" class="retry-upload">\u6253\u5F00\u56FE\u7247\u94FE\u63A5</a></div>',tooltip:"\u8BE5\u56FE\u7247\u6765\u81EA\u5916\u90E8\u94FE\u63A5\uFF0C\u5982\u679C\u94FE\u63A5\u5931\u6548\u56FE\u7247\u5C06\u65E0\u6CD5\u67E5\u770B\uFF0C\u5EFA\u8BAE\u4FDD\u5B58\u5230\u672C\u5730\u540E\u6DFB\u52A0\u5230\u9875\u9762\u4E2D"}},abstract:"\u56FE\u7247"}},uH={image:{title:"Image",upload:{failed:'<div class="line-1">Image upload failed</div><div class="line-2">Network error, you can <a href="" class="retry-upload">Retry</a></div>'},load:{failed:'<div class="line-1">Image failed to load</div><div class="line-2">Network error, you can <a href="" class="retry-upload">Retry</a></div>',remote:{failed:'<div class="line-1">Failed to load image</div><div class="line-2">This picture is from an expired external link</div><div class="line-3">Please save the original image to local drives and upload it. <a href="" class="retry-upload">Open image link</a></div>',tooltip:"This picture is from an external link. If the link expires, the picture will not be available. It's recommended to save it to local drives and add it to the page."}},abstract:"Image"}},dH={image:{title:"\u753B\u50CF",upload:{failed:'<div class="line-1">\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <a href="" class="retry-upload">\u518D\u8A66\u884C</a></div>'},load:{failed:'<div class="line-1">\u753B\u50CF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <a href="" class="retry-upload">\u518D\u8A66\u884C</a></div>',remote:{failed:'<div class="line-1">\u753B\u50CF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u3053\u306E\u753B\u50CF\u306B\u30EA\u30F3\u30AF\u3057\u3066\u3044\u308B URL \u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u306E\u3067\u3001\u8868\u793A\u3067\u304D\u307E\u305B\u3093</div><div class="line-3">\u753B\u50CF\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C0\u3057\u3066\u304F\u3060\u3055\u3044 <a href="" class="retry-upload">\u753B\u50CF\u30EA\u30F3\u30AF\u3092\u958B\u304F</a></div>',tooltip:"\u3053\u306E\u753B\u50CF\u306F\u5916\u90E8\u306B\u30EA\u30F3\u30AF\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u30EA\u30F3\u30AF\u304C\u7121\u52B9\u306B\u306A\u308B\u3068\u3001\u8868\u793A\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u306E\u3067\u3001\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u3001\u30DA\u30FC\u30B8\u306B\u633F\u5165\u3059\u308B\u3053\u3068\u3092\u304A\u52E7\u3081\u3057\u307E\u3059"}},abstract:"\u753B\u50CF"}};L.mergeLang({"zh-CN":aH,"en-US":uH,"ja-JP":dH});function hH(n,t,e,o){const r=n.getBlockByIndex(t,e),i=n.getBlockText(r),{left:s}=Tn(i,o),l=ie(s);let a=o;if(l.endsWith("![]()"))a-=5;else if(l.endsWith("![]"))a-=3;else return!1;const d=o;return Ul("image/*").then(h=>{n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,a,d-a);let p=e+1;ie(n.getBlockText(r)).trim()?(Ql(n,r,a,{forceInsertAfter:!0}),a===0&&(n.deleteBlock(r),p--)):(n.deleteBlock(r),p--),Wm(n,"image",t,p,{file:h})})}),!0}class fH{handleAfterInsertText(t,e,o,r,i){if(i===" "){if(Df(t,e))return!1;if(hH(t,e,o,r))return!0}return!1}}function mH(n){const t=n.getFocusedBlock(),e=Ts(t);if(e&&Wo(e)){n.selection.selectBlock(e,0);const o=Ie.getImageObject(n,e);return o.getImages().length>0&&o.setSelectedIndex(0),!0}}function gH(n){const t=n.getFocusedBlock(),e=Is(t);if(e&&Wo(e)){n.selection.selectBlock(e,0);const o=Ie.getImageObject(n,e);return o.getImages().length>0&&o.setSelectedIndex(0),!0}}function pH(n){const e=n.getFocusedBlock();if(e&&Wo(e)){const o=Ie.getImageObject(n,e),r=o.getImages();if(r.length>0){const i=o.getSelectedIndex();if(i===-1)return o.setSelectedIndex(r.length-1),!0;if(i>0)return o.setSelectedIndex(i-1),!0}}}function CH(n){const e=n.getFocusedBlock();if(e&&Wo(e)){const o=Ie.getImageObject(n,e),r=o.getImages();if(r.length>0){const i=o.getSelectedIndex();if(i===-1)return o.setSelectedIndex(0),!0;if(i<r.length-1)return o.setSelectedIndex(i+1),!0}}}function c2(n){const e=n.getFocusedBlock();if(e&&Wo(e)){const o=Ie.getImageObject(n,e);if(o.getImages().length>0){const i=o.getSelectedIndex();if(i!==-1)return o.removeImage(i),!0}}}const AH={ArrowLeft:pH,ArrowRight:CH,ArrowUp:gH,ArrowDown:mH,Delete:c2,Backspace:c2},bH=S("copy-image");function vH(n,t,e,o){const r=e.getImages()[o],i=e.getImages().length===1?e.getWidthPercent():r.flex*100,s=cn([r],i),l={id:K(),type:"embed",embedType:"image",embedData:s},a=n.options.componentsOptions.image;a!=null&&a.defaultAlign&&(l.align=a.defaultAlign);const d={blocks:{root:[l]},comments:{},meta:{}},h=document.createElement("canvas");h.width=t.naturalWidth,h.height=t.naturalHeight;const p=h.getContext("2d");if(!p)return;const A={},v={};try{p.drawImage(t,0,0,h.width,h.height);const z=h.toDataURL("image/png").replace(/^data:image\/(png|jpg);base64,/,""),q=Tm(z),rt=new File([q],`${Date.now()}.png`,{type:"image/png"});A["image/png"]=rt}catch(H){bH.error(H)}_h(n,d);const D=`<img src="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" />`,x=Oh(D,d),_=Ra(n,d);A["text/plain"]=new Blob([_],{type:"text/plain"}),v["text/plain"]=_;const R=new Blob([x],{type:"text/html"});return A["text/html"]=R,v["text/html"]=x,[A,v]}function yH(n,t,e,o,r){const i=vH(n,t,e,o);if(!i)return;const[s,l]=i;if(s){const a=Object.entries(s).map(([d,h])=>({type:d,data:h}));return Lm(a).then(d=>{if(!d&&r){const h=r.clipboardData;h&&(h.setData("text/plain",l["text/plain"]),h.setData("text/html",l["text/html"]))}}),!0}}function ty(n,t){const e=n.selection.range;if(e.start.blockId!==e.end.blockId)return;const r=n.getFocusedBlock();if(r&&Wo(r)){const i=Ie.getImageObject(n,r);if(i.getImages().length>0){const l=i.getSelectedIndex();if(l!==-1){const d=br(r)[l].querySelector("img");if(d)return yH(n,d,i,l,t)}}}}class kH{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}handleBeforeCopy(t,e,o){if(ty(t,e))return!0}handleBeforeCut(t,e){if(ty(t,e))return c2(t),!0}destroy(){}}class a2{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}async handleAfterPasteDoc(t,e,o){return Object.values(e.blocks).forEach(r=>{r.forEach(i=>{if(i.type==="embed"&&i.embedType==="image"){const s=i.embedData;if(Array.isArray(s.src))return;if(s.src.startsWith("https:")||s.src.startsWith("http:")){const l=o.blockIdMap.get(i.id);l&&Yi(t,l).setAutoFix(!0)}}})}),!1}destroy(){}}const wH=S("image-embed");function BH(n,t,e,o,r,i){Ie.create(n,e).createContent(r,i,t),n.addCustom("image-select-handler",()=>new lH(n)),n.addCustom("image-copy-handler",()=>new kH(n)),setTimeout(()=>{n.addCustom("drag-handler",()=>new sH(n));const l=n.addCustom("image-resizer",()=>new cH(n)),a=e.embedData;vc(a)?l.disable(i):l.currentResizer===i&&l.enable(i)})}function EH(n,t,e,o){const r=t.embedData,i=yc(r);return o==="html"?i.map(s=>`<img src="${n.doc.buildResourceUrl(s.src,{withToken:!0})}">`).join(""):o==="markdown"?`${i.map(l=>`![img](${n.doc.buildResourceUrl(l.src,{withToken:!0})})`).join(`
434
+ Click to open the menu`,insertTips:"Click to add block"}}},H$={blockMenu:{section:{basics:"\u4E00\u822C",system:"\u30B7\u30B9\u30C6\u30E0",styles:"\u30B9\u30BF\u30A4\u30EB",common:"\u4E00\u822C",actions:"\u64CD\u4F5C",thirdParty:"\u5916\u90E8\u30B3\u30F3\u30C6\u30F3\u30C4"},command:{insertAbove:"\u4E0A\u306B\u633F\u5165",insertAfter:"\u4E0B\u306B\u633F\u5165",copy:"\u8907\u88FD",cut:"\u5207\u308B",delete:"\u524A\u9664"},button:{searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u691C\u7D22",tips:"\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30AF\u30EA\u30C3\u30AF\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u8868\u793A",insertTips:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30D6\u30ED\u30C3\u30AF\u3092\u8FFD\u52A0"}}};L.mergeLang({"zh-CN":N$,"en-US":$$,"ja-JP":H$});const Znt="";class j${constructor(){m(this,"dragObject",null)}setData(t){this.dragObject=t}getData(){return this.dragObject}clearData(){this.dragObject=null}destroy(){}}function Nf(n){return n.addCustom("drag-data",()=>new j$)}function i2(n,t){if(!t)return null;const e=Nf(n).getData();return!e||e.editorId!==n.id?null:e}function J7(n,t){const e=i2(n,t);return e?n.findBlockById(e.blockId):null}function U$(n,t,e){if(!t.dataTransfer)return;const r=nt(e),i=ct(r),s=it(e),l={type:"block",editorId:n.id,containerId:i,blockId:s};Nf(n).setData(l)}function z$(n,t,e,o,r){if(!t.dataTransfer)return;const s=nt(e),l=ct(s),a=it(e),d={type:"custom",customType:o,editorId:n.id,containerId:l,blockId:a,data:r};Nf(n).setData(d)}function V$(n){Nf(n).clearData()}const W$=S("drop-indicator"),$f=2;class q${constructor(t){m(this,"indicator");m(this,"target",null);this.editor=t,this.indicator=k("div",["editor-drop-indicator"],this.editor.contentElement)}show(t,e){const o=this.getIndicatorRect(t,e),r=this.editor.rootElement.getBoundingClientRect(),i=o.top-r.top,s=o.left-r.left;this.indicator.style.top=`${i}px`,this.indicator.style.left=`${s}px`,this.indicator.style.width=`${o.width}px`,this.indicator.style.height=`${o.height}px`,this.indicator.style.display="",this.target={block:t,insertPos:e}}hide(){this.indicator.style.display="none",this.target=null}getIndicatorRect(t,e){if(typeof e!="string")return e.rect;if(e==="before"){const s=Is(t);if(!s){g(W$,Lo(nt(t)),"block does not in a child container");const d=t.getBoundingClientRect();return new DOMRect(d.x,d.y,d.width,$f)}const l=s.getBoundingClientRect(),a=t.getBoundingClientRect();return new DOMRect(l.x,(l.bottom+a.top)/2,l.width,$f)}const o=Ts(t);if(!o){const s=t.getBoundingClientRect();return new DOMRect(s.x,s.bottom,s.width,$f)}const r=t.getBoundingClientRect(),i=o.getBoundingClientRect();return new DOMRect(r.x,(r.bottom+i.top)/2,r.width,$f)}}const G$=S("find-drop-target");function Z$(n,t){const e=document.elementFromPoint(n,t);if(!e)return null;if(Nr(e)&&Lo(e))return e;const o=e.firstElementChild;return o&&Nr(o)&&Lo(o)?o:null}function Q$(n,t){const s=t,l=n;for(let a=0;a<2;a++){const d=l+a*50;for(let h=0;h<5;h++){const p=s+h*8,A=document.elementFromPoint(d,p);if(A){const D=tt(A);if(D)return D}if(h===0)continue;const v=s-h*8,B=document.elementFromPoint(d,v);if(B){const D=tt(B);if(D)return D}}}return null}function Y$(n,t,e){const o=document.elementFromPoint(t,e);if(o){const h=tt(o);if(h&&!Mt(n,h))return h}const r=new Set,i=Z$(t,e);if(i){const h=i.getBoundingClientRect();e<h.top+h.height/2?r.add(ye(i)):r.add(Qe(i))}const s=Q$(t,e);s&&r.add(s);const l=Array.from(r),a=h=>{for(let p=0;p<l.length;p++){const A=l[p];if(h!==A&&Xt(h,A))return!0}return!1},d=l.filter(h=>!a(h));return d.length>0?d[0]:null}function s2(n,t){if(n.readonly)return!1;const e=nt(t);if(Gt(e))return!0;const o=tt(e);return g(G$,o,"no parent block"),n.isBlockWritable(o)?s2(n,o):!1}const J$=S("drop-target");function K$(n,t){let e={};return/image/.test(t.type)?e=n.editorEmbeds.getEmbedClass("image"):/audio/.test(t.type)?e=n.editorEmbeds.getEmbedClass("audio"):/video/.test(t.type)&&(e=n.editorEmbeds.getEmbedClass("video")),g(J$,e,`unSupport file type ${t.type}`),e}async function K7(n,t,e,o){var i,s;let r=o;for(const l of t){const a=K$(n,l);a.getOptions&&await((s=(i=a.getOptions(n)).handleInsertEmptyEmbed)==null?void 0:s.call(i,n,{containerId:e,blockIndex:r,data:{file:l}}))&&(r+=1)}}class X${constructor(t){m(this,"handleDrop",(t,e,o,r)=>{if(Array.isArray(e)){const i=e;if(i.length>0){const s=ct(o);return K7(t,i,s,r),!0}}return!1});this.editor=t}}class Mu{constructor(t){m(this,"indicator");m(this,"lastDropOverResult");m(this,"handlers",[]);m(this,"handleDragOver",t=>{if(!this.editor.isWritable())return;const e=i=>{var d,h;const s=i2(this.editor,i.dataTransfer),l=J7(this.editor,i.dataTransfer),a=this.findTargetBlock(l,i.x,i.y);if(a&&Xt(this.editor.rootContainer,a)){const p=this.findInsertPos(l,a,i.x,i.y,(h=s!=null?s:(d=i.dataTransfer)==null?void 0:d.items)!=null?h:null);if(p)return this.indicator.show(a,p),"move"}return this.indicator.hide(),"none"},o=(i,s)=>{i.dataTransfer&&(i.dataTransfer.dropEffect=s),s==="move"&&i.preventDefault()};if(this.lastDropOverResult&&t.x===this.lastDropOverResult.x&&t.y===this.lastDropOverResult.y){const i=this.lastDropOverResult.dropEffect;o(t,i);return}const r=e(t);o(t,r),this.lastDropOverResult={x:t.x,y:t.y,dropEffect:r}});m(this,"handleDrop",t=>{var i,s;t.stopPropagation(),setTimeout(()=>{this.indicator.hide()});const e=i2(this.editor,t.dataTransfer),o=Array.from((s=(i=t.dataTransfer)==null?void 0:i.files)!=null?s:[]);if(!e&&o.length===0){t.dataTransfer&&(t.dataTransfer.dropEffect="none");return}const r=this.indicator.target;if(r){const{block:l,insertPos:a}=r,d=J7(this.editor,t.dataTransfer);this.editor.undoManager.runInGroup(()=>{const h=Yt(this.editor,l);if(h.handleDrop&&h.handleDrop(this.editor,l,e!=null?e:o,a,{isSourceBlock:!1,targetBlock:l})){t.preventDefault(),this.editor.focus();return}if(d){const p=Yt(this.editor,d);if(p.handleDrop&&p.handleDrop(this.editor,d,e!=null?e:o,a,{isSourceBlock:!0,targetBlock:l})){t.preventDefault(),this.editor.focus();return}}if(typeof a=="string"){const p=nt(l);let A=bt(l);a==="after"&&(A+=1),t.preventDefault();for(let v=0;v<this.handlers.length;v++)if(this.handlers[v].handleDrop(this.editor,d!=null?d:o,p,A)){this.editor.focus();return}if(d){const v=this.editor.getBlockData(d),B=Pi(this.editor.editorBlocks,this.editor.doc.toJSON(),v),[D]=this.editor.insertDocAt(p,A,B);this.editor.selection.selectBlock(D,0),Lu.get(this.editor).highlightBlock(D),this.editor.deleteBlock(d),this.editor.focus()}}}),V$(this.editor)}});m(this,"handleDragLeave",()=>{this.indicator.hide()});this.editor=t,this.indicator=new q$(this.editor),this.handlers.push(new X$(this.editor)),this.editor.contentElement.addEventListener("dragover",this.handleDragOver),this.editor.contentElement.addEventListener("dragleave",this.handleDragLeave),this.editor.contentElement.addEventListener("drop",this.handleDrop)}destroy(){this.editor.contentElement.removeEventListener("dragover",this.handleDragOver),this.editor.contentElement.removeEventListener("dragleave",this.handleDragLeave),this.editor.contentElement.removeEventListener("drop",this.handleDrop),this.handlers=[]}addHandler(t){this.handlers.push(t)}static register(t){return t.addCustom("drop-target",()=>new Mu(t))}static get(t){return t.getCustom("drop-target")}static find(t){return t.findCustom("drop-target")}canInsertAfter(t,e){return!(this.editor.readonly||Ts(e)===t&&t||!s2(this.editor,e))}canInsertBefore(t,e){return!(this.editor.readonly||Is(e)===t&&t||!s2(this.editor,e)||Gt(nt(e))&&bt(e)===0)}canDrop(t,e){return t===null||t===e?!0:!Xt(t,e)}findTargetBlock(t,e,o){let r=Y$(this.editor,e,o);if(!r||!Xt(this.editor.rootContainer,r))return null;const i=nt(r),s=tt(i);return s&&Dt(s)==="code"&&(r=s),this.canDrop(t,r)?r:null}findInsertPos(t,e,o,r,i){let s=e;for(;s;){const a=Yt(this.editor,s);if(a.handleDropOver){const d=a.handleDropOver(this.editor,s,i,o,r);if(d)return d;if(d===!1)return null}s=Es(s)}if(t===e)return"";const l=e.getBoundingClientRect();if(l.top<=r&&r<=l.bottom){if(r<l.top+l.height/2){if(this.canInsertBefore(t,e))return"before";if(this.canInsertAfter(t,e))return"after"}else{if(this.canInsertAfter(t,e))return"after";if(this.canInsertBefore(t,e))return"before"}return""}return r<l.top&&this.canInsertBefore(t,e)?"before":l.bottom<r&&this.canInsertAfter(t,e)?"after":""}}function X7(n,t,e){const o=Ie.getImageObject(n,t),r=mt.default(o.getImages());if(r.length===1){n.deleteBlock(t);return}if(e===-1||e>=r.length)return;const i=$N(r);if(r.splice(e,1),r.length===1){const l=r[0],a=100*(l.flex/i);l.flex=1;const d=cn([l],a);n.updateEmbedData(t,d);return}r[0].flex=NaN,Bu(r);const s=cn(r,o.getWidthPercent());n.updateEmbedData(t,s)}function tH(n,t,e,o){if(t.length===0||o==="after"||o==="before")return!1;let r=o.data;const i=Ie.getImageObject(n,e),s=mt.default(i.getImages()),l=[],a=[];t.forEach(p=>{$7(p.type)&&s.length+l.length<6?l.push(p):a.push(p)}),l.forEach(p=>{try{N7(n,p)}catch{return}const A={src:"",flex:1,width:0,height:0,virtualSize:!0};s.splice(r,0,A);const v=cn(s,i.getWidthPercent());n.updateEmbedData(e,v),i.replaceImage(r,p),r+=1});const d=n.getBlockIndex(e)+1,h=ct(nt(e));return K7(n,a,h,d),!0}function eH(n,t,e,o,r){var s,l,a;if(Zd(e))return tH(n,e,t,o);if(e.type!=="custom"||e.customType!=="image"||!e.data)return;const i=e.data;if(r.isSourceBlock){const d=r.targetBlock,h=nt(d);let p=bt(d);o==="after"&&(p+=1);const v=100*(i.boundingRect.width/n.rootContainer.getBoundingClientRect().width),B=cn([i.image],v),D={id:K(),type:"embed",embedType:"image",embedData:B},x=(l=(s=n.options.componentsOptions)==null?void 0:s.image)==null?void 0:l.defaultAlign;x&&(D.align=x),n.insertBlock(ct(h),p,D),X7(n,t,i.index),(a=n.findCustom("drag-handler"))==null||a.handleDragEnd()}else{if(typeof o=="string")return;const d=t;let h=o.data;const p=Ie.getImageObject(n,d),A=mt.default(p.getImages());h>A.length&&(h=A.length),n.undoManager.runInGroup(()=>{var B,D;p.setAutoFix(!0);const v=n.getBlockById(e.blockId);if(v===d){const x=i.index,_=h,R=i.image;if(x===_||_===x+1)return;let H=_;x<_?(A.splice(_,0,R),A.splice(x,1),H-=1):(A.splice(x,1),A.splice(_,0,R));const z=cn(A,p.getWidthPercent());n.updateEmbedData(d,z),p.setSelectedIndex(H),(B=n.findCustom("drag-handler"))==null||B.handleDragEnd()}else{A.splice(h,0,i.image),A[0].flex=NaN,Bu(A);const x=cn(A,p.getWidthPercent());n.updateEmbedData(d,x),X7(n,v,i.index),(D=n.findCustom("drag-handler"))==null||D.handleDragEnd(),p.setSelectedIndex(h),n.selection.selectBlock(d,0)}})}return!0}const nH=2;function Hf(n,t,e){const o=br(t);if(e<=0){const s=o[0].getBoundingClientRect();return new DOMRect(s.left-4,s.top,2,s.height)}if(e===o.length){const s=o[e-1].getBoundingClientRect();return new DOMRect(s.right+2,s.top,2,s.height)}const r=o[e-1].getBoundingClientRect(),i=o[e].getBoundingClientRect();return new DOMRect((i.left+r.right)/2-1,r.top,nH,r.height)}function oH(n,t,e,o,r){for(let i=0;i<e.length;i++){const l=e[i].getBoundingClientRect();if(o<=l.right)return o<=l.left+l.width/2?{rect:Hf(n,t,i),data:i}:{rect:Hf(n,t,i+1),data:i+1}}return o>e[e.length-1].getBoundingClientRect().right?{rect:Hf(n,t,e.length),data:e.length}:{rect:Hf(n,t,e.length),data:0}}function rH(n,t,e,o,r){const i=br(t);if(e instanceof DataTransferItemList){if(!Array.from(e).some(s=>$7(s.type))||i.length>=6)return}else{if((e==null?void 0:e.type)==="block"||i.length>=6&&(e==null?void 0:e.blockId)!==it(t))return;const s=it(t);if(i.length===1&&s===(e==null?void 0:e.blockId))return}return oH(n,t,i,o)}async function iH(n){return await QC.default.toSvg(n)}function l2(n,t){return new DragEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,dataTransfer:new DataTransfer,clientX:n.clientX,clientY:n.clientY})}class sH{constructor(t){m(this,"img");m(this,"dragContainer",null);m(this,"autoScroll",null);m(this,"imageContainer",null);m(this,"startPosition",null);m(this,"handleMouseDown",t=>{const e=t.target;if(!e||!(e instanceof HTMLImageElement)||t.button!==0)return;const o=tt(e);if(!o||!Wo(o)||!this.editor.isBlockWritable(o)||this.editor.readonly)return;const r=Ie.getImageObject(this.editor,o);if(this.imageContainer=Q0(t.target),!this.imageContainer)return;const s=M7(t.target).indexOf(this.imageContainer);if(s===-1)return;const l=r.getImages()[s];if(!l)return;const{x:a,y:d}=t;this.startPosition={x:a,y:d};const h={image:l,index:s,boundingRect:this.imageContainer.getBoundingClientRect()},p=l2(t,"dragstart");z$(this.editor,p,o,"image",h),document.addEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.addEventListener("mousemove",this.handleDrag),t.preventDefault()});m(this,"handleDragStart",async t=>{if(!this.imageContainer)return;const e=tt(this.imageContainer);if(!e)return;const{x:o,y:r}=t,{width:i,height:s}=t.target.getBoundingClientRect(),l=te(e),a=k("div",["drag-container"],l);a.style.left=`${o-i/4}px`,a.style.top=`${r-s/4}px`,a.style.width=`${Math.max(i/2,16)}px`,a.style.height=`${s/2}px`,this.dragContainer=a,W(this.editor.contentElement,"dragging");const d=io(e);this.autoScroll=new Yd({scrollElement:d,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}),this.autoScroll.active();const h=k("img",["drag-target"],a),A=await iH(this.imageContainer);A&&(h.src=A)});m(this,"handleDrag",t=>{var i;const{x:e,y:o}=t;if(((i=this.startPosition)==null?void 0:i.x)===e&&this.startPosition.y===o)return;if(window.isDragging||(window.isDragging=!0,this.handleDragStart(t)),this.startPosition&&this.dragContainer){const{x:s,y:l}=t;if(s===0&&l===0){this.dragContainer.style.transform="",this.dragContainer.style.opacity="0";return}const{x:a,y:d}=this.startPosition,h=s-a,p=l-d;this.dragContainer.style.transform=`translate(${h}px, ${p}px)`,this.dragContainer.style.opacity="0.5"}const r=l2(t,"dragover");this.editor.contentElement.dispatchEvent(r)});m(this,"handleDragEnd",t=>{var e;if(window.isDragging=!1,this.dragContainer&&this.dragContainer.remove(),this.dragContainer=null,this.startPosition=null,this.imageContainer=null,(e=this.autoScroll)==null||e.inactive(),ot(this.editor.contentElement,"dragging"),document.removeEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.removeEventListener("mousemove",this.handleDrag),t){const o=l2(t,"drop");this.editor.contentElement.dispatchEvent(o)}});this.editor=t,this.editor.rootContainer.addEventListener("mousedown",this.handleMouseDown),this.img=new Image,this.img.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}destroy(){this.editor.rootContainer.removeEventListener("mousedown",this.handleMouseDown)}}class lH{constructor(t){m(this,"handleFocusBlockChanged",(t,e,o)=>{const i=this.editor.getFocusedBlock();if(i&&Wo(i)){const s=Ie.getImageObject(this.editor,i);s.getImages().length>0&&s.getSelectedIndex()===-1&&s.setSelectedIndex(0)}o&&Wo(o)&&t.findCustom(`image-${o.id}`)&&Ie.getImageObject(this.editor,o).blockResizer.disableResize()});this.editor=t,this.editor.addListener("focusBlockChanged",this.handleFocusBlockChanged)}destroy(){this.editor.removeListener("focusBlockChanged",this.handleFocusBlockChanged)}}class cH{constructor(t){m(this,"currentResizer",null);m(this,"handleHoveringBlockChange",(t,e)=>{window.isDragging||(e&&this.disable(e),t&&(this.currentResizer=t,this.enable(t)))});this.editor=t,Ce.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){Ce.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}disable(t){Wo(t)&&Ie.getImageObject(this.editor,t).disableResizer()}enable(t){if(Wo(t)){const e=Ie.getImageObject(this.editor,t);this.editor.isBlockWritable(t)&&e.tryEnableResizer()}}}const aH={image:{title:"\u56FE\u7247",upload:{failed:'<div class="line-1">\u56FE\u7247\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <a href="" class="retry-upload">\u91CD\u8BD5</a></div>'},load:{failed:'<div class="line-1">\u56FE\u7247\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <a href="" class="retry-upload">\u91CD\u8BD5</a></div>',remote:{failed:'<div class="line-1">\u56FE\u7247\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u8BE5\u56FE\u7247\u6765\u81EA\u5916\u90E8\u94FE\u63A5\uFF0C\u5916\u90E8\u94FE\u63A5\u5DF2\u5931\u6548</div><div class="line-3">\u8BF7\u5C06\u539F\u56FE\u4FDD\u5B58\u5230\u672C\u5730\u540E\u4E0A\u4F20\uFF0C <a href="" class="retry-upload">\u6253\u5F00\u56FE\u7247\u94FE\u63A5</a></div>',tooltip:"\u8BE5\u56FE\u7247\u6765\u81EA\u5916\u90E8\u94FE\u63A5\uFF0C\u5982\u679C\u94FE\u63A5\u5931\u6548\u56FE\u7247\u5C06\u65E0\u6CD5\u67E5\u770B\uFF0C\u5EFA\u8BAE\u4FDD\u5B58\u5230\u672C\u5730\u540E\u6DFB\u52A0\u5230\u9875\u9762\u4E2D"}},abstract:"\u56FE\u7247"}},uH={image:{title:"Image",upload:{failed:'<div class="line-1">Image upload failed</div><div class="line-2">Network error, you can <a href="" class="retry-upload">Retry</a></div>'},load:{failed:'<div class="line-1">Image failed to load</div><div class="line-2">Network error, you can <a href="" class="retry-upload">Retry</a></div>',remote:{failed:'<div class="line-1">Failed to load image</div><div class="line-2">This picture is from an expired external link</div><div class="line-3">Please save the original image to local drives and upload it. <a href="" class="retry-upload">Open image link</a></div>',tooltip:"This picture is from an external link. If the link expires, the picture will not be available. It's recommended to save it to local drives and add it to the page."}},abstract:"Image"}},dH={image:{title:"\u753B\u50CF",upload:{failed:'<div class="line-1">\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <a href="" class="retry-upload">\u518D\u8A66\u884C</a></div>'},load:{failed:'<div class="line-1">\u753B\u50CF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <a href="" class="retry-upload">\u518D\u8A66\u884C</a></div>',remote:{failed:'<div class="line-1">\u753B\u50CF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u3053\u306E\u753B\u50CF\u306B\u30EA\u30F3\u30AF\u3057\u3066\u3044\u308B URL \u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u306E\u3067\u3001\u8868\u793A\u3067\u304D\u307E\u305B\u3093</div><div class="line-3">\u753B\u50CF\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C0\u3057\u3066\u304F\u3060\u3055\u3044 <a href="" class="retry-upload">\u753B\u50CF\u30EA\u30F3\u30AF\u3092\u958B\u304F</a></div>',tooltip:"\u3053\u306E\u753B\u50CF\u306F\u5916\u90E8\u306B\u30EA\u30F3\u30AF\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u30EA\u30F3\u30AF\u304C\u7121\u52B9\u306B\u306A\u308B\u3068\u3001\u8868\u793A\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u306E\u3067\u3001\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u3001\u30DA\u30FC\u30B8\u306B\u633F\u5165\u3059\u308B\u3053\u3068\u3092\u304A\u52E7\u3081\u3057\u307E\u3059"}},abstract:"\u753B\u50CF"}};L.mergeLang({"zh-CN":aH,"en-US":uH,"ja-JP":dH});function hH(n,t,e,o){const r=n.getBlockByIndex(t,e),i=n.getBlockText(r),{left:s}=Tn(i,o),l=ie(s);let a=o;if(l.endsWith("![]()"))a-=5;else if(l.endsWith("![]"))a-=3;else return!1;const d=o;return Ul("image/*").then(h=>{n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(r,a,d-a);let p=e+1;ie(n.getBlockText(r)).trim()?(Ql(n,r,a,{forceInsertAfter:!0}),a===0&&(n.deleteBlock(r),p--)):(n.deleteBlock(r),p--),Wm(n,"image",t,p,{file:h})})}),!0}class fH{handleAfterInsertText(t,e,o,r,i){if(i===" "){if(Df(t,e))return!1;if(hH(t,e,o,r))return!0}return!1}}function mH(n){const t=n.getFocusedBlock(),e=Ts(t);if(e&&Wo(e)){n.selection.selectBlock(e,0);const o=Ie.getImageObject(n,e);return o.getImages().length>0&&o.setSelectedIndex(0),!0}}function gH(n){const t=n.getFocusedBlock(),e=Is(t);if(e&&Wo(e)){n.selection.selectBlock(e,0);const o=Ie.getImageObject(n,e);return o.getImages().length>0&&o.setSelectedIndex(0),!0}}function pH(n){const e=n.getFocusedBlock();if(e&&Wo(e)){const o=Ie.getImageObject(n,e),r=o.getImages();if(r.length>0){const i=o.getSelectedIndex();if(i===-1)return o.setSelectedIndex(r.length-1),!0;if(i>0)return o.setSelectedIndex(i-1),!0}}}function CH(n){const e=n.getFocusedBlock();if(e&&Wo(e)){const o=Ie.getImageObject(n,e),r=o.getImages();if(r.length>0){const i=o.getSelectedIndex();if(i===-1)return o.setSelectedIndex(0),!0;if(i<r.length-1)return o.setSelectedIndex(i+1),!0}}}function c2(n){const e=n.getFocusedBlock();if(e&&Wo(e)){const o=Ie.getImageObject(n,e);if(o.getImages().length>0){const i=o.getSelectedIndex();if(i!==-1)return o.removeImage(i),!0}}}const AH={ArrowLeft:pH,ArrowRight:CH,ArrowUp:gH,ArrowDown:mH,Delete:c2,Backspace:c2},bH=S("copy-image");function vH(n,t,e,o){const r=e.getImages()[o],i=e.getImages().length===1?e.getWidthPercent():r.flex*100,s=cn([r],i),l={id:K(),type:"embed",embedType:"image",embedData:s},a=n.options.componentsOptions.image;a!=null&&a.defaultAlign&&(l.align=a.defaultAlign);const d={blocks:{root:[l]},comments:{},meta:{}},h=document.createElement("canvas");h.width=t.naturalWidth,h.height=t.naturalHeight;const p=h.getContext("2d");if(!p)return;const A={},v={};try{p.drawImage(t,0,0,h.width,h.height);const z=h.toDataURL("image/png").replace(/^data:image\/(png|jpg);base64,/,""),q=Tm(z),rt=new File([q],`${Date.now()}.png`,{type:"image/png"});A["image/png"]=rt}catch(H){bH.error(H)}_h(n,d);const D=`<img src="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" />`,x=Oh(D,d),_=Ra(n,d);A["text/plain"]=new Blob([_],{type:"text/plain"}),v["text/plain"]=_;const R=new Blob([x],{type:"text/html"});return A["text/html"]=R,v["text/html"]=x,[A,v]}function yH(n,t,e,o,r){const i=vH(n,t,e,o);if(!i)return;const[s,l]=i;if(s){const a=Object.entries(s).map(([d,h])=>({type:d,data:h}));return Lm(a).then(d=>{if(!d&&r){const h=r.clipboardData;h&&(h.setData("text/plain",l["text/plain"]),h.setData("text/html",l["text/html"]))}}),!0}}function ty(n,t){const e=n.selection.range;if(e.start.blockId!==e.end.blockId)return;const r=n.getFocusedBlock();if(r&&Wo(r)){const i=Ie.getImageObject(n,r);if(i.getImages().length>0){const l=i.getSelectedIndex();if(l!==-1){const d=br(r)[l].querySelector("img");if(d)return yH(n,d,i,l,t)}}}}class kH{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}handleBeforeCopy(t,e,o){if(ty(t,e))return!0}handleBeforeCut(t,e){if(ty(t,e))return c2(t),!0}destroy(){}}class a2{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}async handleAfterPasteDoc(t,e,o){return Object.values(e.blocks).forEach(r=>{r.forEach(i=>{if(i.type==="embed"&&i.embedType==="image"){const s=i.embedData;if(Array.isArray(s.src))return;if(s.src.startsWith("https:")||s.src.startsWith("http:")){const l=o.blockIdMap.get(i.id);l&&Yi(t,l).setAutoFix(!0)}}})}),!1}destroy(){}}const wH=S("image-embed");function BH(n,t,e,o,r,i){Ie.create(n,e).createContent(r,i,t),n.addCustom("image-select-handler",()=>new lH(n)),n.addCustom("image-copy-handler",()=>new kH(n)),setTimeout(()=>{n.addCustom("drag-handler",()=>new sH(n));const l=n.addCustom("image-resizer",()=>new cH(n)),a=e.embedData;vc(a)?l.disable(i):l.currentResizer===i&&l.enable(i)})}function EH(n,t,e,o){const r=t.embedData,i=yc(r);return o==="html"?i.map(s=>`<img src="${n.doc.buildResourceUrl(s.src,{withToken:!0})}">`).join(""):o==="markdown"?`${i.map(l=>`![img](${n.doc.buildResourceUrl(l.src,{withToken:!0})})`).join(`
435
435
  `)}
436
436
  `:i.map(s=>n.doc.buildResourceUrl(s.src,{withToken:!0})).join(`
437
- `)}class xH{constructor(){m(this,"group","image");m(this,"commands",[])}executeCommand(t,e,o){if(o.id==="replace-image"){const{block:r,image:i}=o.data;Ie.getImageObject(t,r).replaceImage(0,i)}}}function IH(){return{blockCommands:{image:new xH},abstract:`${L.t("image.abstract")}`}}function TH(){return{name:"Image",insertEmbedCommandItems:[{id:"insert-image",name:L.t("image.abstract"),icon:bL,group:"common",subText:"/image",order:100}],handleInsertEmptyEmbed:async(n,t)=>{var v;let e;(v=t.data)!=null&&v.file&&(e=t.data.file);const o=P9(n);if(e=e!=null?e:await Ul(o),!e)return null;try{N9(n,e)}catch{return null}let r={width:k9,height:W0};try{r=await l$(e)}catch(B){wH.error(B)}const i=n.rootContainer.clientWidth,s=r.width<i?Math.min(100,r.width/i*100):100,l={src:"",width:r.width,height:r.height,flex:1,virtualSize:!1},a=cn([l],s),d={id:K(),type:"embed",embedType:"image",embedData:a},h=n.options.componentsOptions.image;h!=null&&h.defaultAlign&&(d.align=h.defaultAlign);const p=n.insertBlock(t.containerId,t.blockIndex,d);return Ie.getImageObject(n,p).replaceImage(0,e),p}}}function DH(n,t,e){var h;const{data:o}=e,r=n.getBlockString(t).trim();if(!o||o.embedType!=="image"||!et(n,t))return null;const i=r.match(/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/),s=(h=i==null?void 0:i.groups)==null?void 0:h.filename;if(!s)return null;const l={src:s},a={id:K(),type:"embed",embedType:"image",embedData:l};Ie.create(n,a).setAutoFix(!0);const d=n.options.componentsOptions.image.defaultAlign;return d&&(a.align=d),{blockData:a}}function SH(n,t){const e=it(t);n.destroyCustom(`image-${e}`)}const LH={embedType:"image",createEmbedContent:BH,convertTo:EH,convertFrom:DH,getBlockProperties:IH,getOptions:TH,handleDrop:eH,handleDropOver:rH,handleDeleteBlock:SH};class MH{constructor(t,e){m(this,"toolbar");m(this,"anchor",null);m(this,"item");m(this,"docs",null);m(this,"checkedId");m(this,"handlePasteSpecial",(t,e)=>{!e.data||(this.checkedId===e.id?this.checkedId=void 0:this.checkedId=e.id,this.onPasteSpecial(e.data),setTimeout(()=>{this.docs&&this.show(this.docs),this.editor.focus()}))});m(this,"handleClose",()=>{this.editor.focus()});m(this,"handleSelectionChange",()=>{this.handleClose()});this.editor=t,this.onPasteSpecial=e,this.item={id:"paste-special",name:"",icon:vL,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",childrenOffset:[-4,4],children:[]},this.toolbar=new ru([this.item],void 0,{id:"paste-special-button",tooltipId:this.editor.clientId,refuseOverflow:!0}),this.toolbar.addListener("click",this.handlePasteSpecial),this.toolbar.addListener("close",this.handleClose),this.editor.addListener("selectionChanged",this.handleSelectionChange)}show(t){this.docs=t;const e=this.editor,o=e.selection.range;if(!o.isCollapsed())return;const r=e.getBlockById(o.start.blockId);if(!et(e,r))return;const i=$r(e,r,o)[0];if(!i)return;this.anchor&&this.anchor.remove(),this.anchor=Vr(e,r,"paste-special-button-anchor",i);const s=this.getCommandItems(t);this.item.children=s,this.toolbar.manualShow(this.anchor)}hide(){this.toolbar.close("selectionChange")}clearCheckedState(){this.checkedId=void 0}destroy(){this.toolbar.destroy(),this.editor.removeListener("selectionChanged",this.handleSelectionChange)}getCommandItems(t){const e=i=>({id:i,states:this.checkedId===i?["checked"]:void 0,name:L.t("pasteSpecial.originFormats"),data:t[i]}),o=[];let r=!0;return t["text/x-ones-editor-doc"]?o.push(e("text/x-ones-editor-doc")):t["text/office-html"]?o.push(e("text/office-html")):t["text/html"]?o.push(e("text/html")):t["text/plain"]&&(o.push(e("text/plain")),r=!1),t["text/plain"]&&(r&&o.push({id:"text/plain",states:this.checkedId==="text/plain"?["checked"]:void 0,name:L.t("pasteSpecial.plainText"),data:t["text/plain"]}),o.push({id:"text/markdown",states:this.checkedId==="text/markdown"?["checked"]:void 0,name:L.t("pasteSpecial.markdown"),data:t["text/markdown"]})),o}}const RH=S("paste-special");class u2{constructor(t){m(this,"button");m(this,"lastUndoAction",null);m(this,"event",null);m(this,"handlePasteSpecial",t=>{this.editor.undoManager.runInGroup(()=>{this.editor.undoManager.undoTo(this.lastUndoAction),this.editor.pasteDoc(t)})});this.editor=t,this.button=new MH(t,this.handlePasteSpecial)}destroy(){this.event=null,this.button.destroy()}handleChanged(t,e){this.event=null,this.button.hide()}async handleBeforePaste(t,e){return RH.debug("before paste"),this.lastUndoAction=t.undoManager.lastAction(),!1}async handleAfterPaste(t,e,o){if(Object.keys(o).length<=1)return!1;const r=t.selection.range;if(r.isCollapsed()){const i=t.getBlockById(r.start.blockId);if(!et(t,i))return!1;this.button.clearCheckedState(),this.button.show(o),this.event=e}return!1}}const OH={pasteSpecial:{originFormats:"\u4FDD\u6301\u539F\u6837\u5F0F",plainText:"\u7C98\u8D34\u7EAF\u6587\u672C",markdown:"\u7C98\u8D34\u4E3A Markdown"}},_H={pasteSpecial:{originFormats:"Keep origin formats",plainText:"Paste as plain text",markdown:"Paste as markdown"}},FH={pasteSpecial:{originFormats:"\u5143\u306E\u30B9\u30BF\u30A4\u30EB\u3092\u7DAD\u6301\u3059\u308B",plainText:"\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8CBC\u308A\u4ED8\u3051\u308B",markdown:"Markdown \u3068\u3057\u3066\u8CBC\u308A\u4ED8\u3051"}};L.mergeLang({"zh-CN":OH,"en-US":_H,"ja-JP":FH});const Qnt="",PH=S("html-to-doc");function NH(n){const t=new RegExp('(?<=<canvas data-editor-doc=")[\\s\\S]*(?=" id="ones-editor-doc">)',"g"),e=n.match(t);if(!e||!e.length)return null;const o=e[0],r=pa(o);return JSON.parse(r)}function $H(n){const t="ones-editor-doc::",e="::ones-editor-doc";let o=n.indexOf(t);if(o!==-1){o+=t.length;const i=n.indexOf(e,o);if(i!==-1){const s=n.substr(o,i-o);try{const l=pa(s);return JSON.parse(l)}catch(l){PH.error(`invalid doc data: ${l}, ${s}`)}}}const r=NH(n);return r||null}const ey="latex-b172fea480b",HH=n=>({name:"latex-block",level:"block",start(t){var e,o;return(o=(e=t.match(/\$\$[^\$]/))==null?void 0:e.index)!=null?o:-1},tokenizer(t,e){const o=/^\$\$([^\$]+)\$\$/.exec(t);return o?{type:"latex-block",raw:o[0],formula:o[1]}:void 0},renderer(t){return n.lazy?`<span class="${ey}" block>${t.formula}</span>`:n.render(t.formula,!0)}}),jH=n=>({name:"latex",level:"inline",start(t){var e,o;return(o=(e=t.match(/\$[^\$]/))==null?void 0:e.index)!=null?o:-1},tokenizer(t,e){const o=/^\$([^\$]+)\$/.exec(t);return o?{type:"latex",raw:o[0],formula:o[1]}:void 0},renderer(t){return n.lazy?`<span class="${ey}">${t.formula}</span>`:n.render(t.formula,!1)}});var UH=(n={})=>(n.lazy&&n.env!=="test"&&new IntersectionObserver((t,e)=>{for(const o of t){if(!o.isIntersecting)continue;const r=o.target;e.unobserve(r),Promise.resolve(n.render(r.innerText,r.hasAttribute("block"))).then(i=>{r.innerHTML=i}),r.classList.add("latex-rendered")}},{threshold:1}),{extensions:[HH(n),jH(n)]});function kc(n){const t=n.type;if(t==="link")return!!n.tokens.some(kc);switch(t){case"code":case"table":case"hr":case"blockquote":case"list":case"list_item":case"image":case"paragraph":return!0;default:return!1}}function zH(n){return!kc(n)}function VH(n){if(n.length===0)return[];if(n.length===1)return[n];const t=[];let e=[n[0]],o=kc(n[0]);for(let r=1;r<n.length;r++){const i=n[r];o===kc(i)?e.push(i):(t.push(e),e=[i],o=kc(i))}return t.push(e),t}function WH(n,t,e){const o=n.href;let r=e.tokensToText(n.tokens,t,e);return r.length===0&&(r=_i(o,t)),r=fh(r,"link",o),r}let Ru;function d2(n){Ru||(Ru=document.createElement("textarea")),Ru.innerHTML=n;const t=Ru.childNodes.length===0?"":Ru.childNodes[0].nodeValue;return t!=null?t:""}function qH(n,t){const e=d2(n.text);return[ao(e,{...t,"style-code":!0})]}function GH(n,t,e){const r=n.tokens;return r?e.tokensToText(r,t,e):lg(d2(n.text),t)}const ZH=S("token-to-text");function h2(n,t,e){return n.map(r=>r.type==="text"?GH(r,t,e):r.type==="strong"?e.tokensToText(r.tokens,{...t,"style-bold":!0},e):r.type==="em"?e.tokensToText(r.tokens,{...t,"style-italic":!0},e):r.type==="del"?e.tokensToText(r.tokens,{...t,"style-strikethrough":!0},e):r.type==="link"?WH(r,t,e):r.type==="codespan"?qH(r,t):r.type==="br"?[{insert:" ",attributes:{id:K(),created:Date.now(),box:!0,type:"br"}}]:r.type==="escape"?lg(d2(r.text),t):r.type==="latex"?[{insert:" ",attributes:{id:K(),created:Date.now(),box:!0,type:"math",tex:r.formula}}]:(ZH.warn(`unknown token in text: ${JSON.stringify(r)}`),[])).flat()}function QH(n,t){const e=h2(n.tokens,{},t);return[{id:K(),type:"text",text:e,heading:n.depth}]}function YH(n,t){const{text:e,children:o}=t.tokensToTextWithChildren(n.tokens,t),r=[];return e.length>0&&r.push({id:K(),type:"text",text:e}),r.push(...o),r}function JH(n,t){const{text:e,children:o}=t.tokensToTextWithChildren([n],t),r=[];return e.length>0&&r.push({id:K(),type:"text",text:e}),r.push(...o),r}function KH(n,t){const e=typeof n.start=="number"?n.start:1,o=n.ordered,r=K(),i=[];return n.items.forEach((l,a)=>{const d={...t,listLevel:t.listLevel+1},{text:h,children:p}=t.tokensToTextWithChildren(l.tokens,d);let A;typeof l.checked=="boolean"&&(A=l.checked?"checked":"unchecked");const v={id:K(),type:"list",groupId:r,ordered:o,checkbox:A,start:e+a,text:h,level:t.listLevel};i.push(v),i.push(...p)}),i}function XH(n,t){const e=t.tokensToBlocks(n.tokens,t);return e.forEach(o=>{o.quoted=!0}),e}const ny=100,tj=20,ej=600;function nj(n,t){const e=t.text;if(e){const o=ie(e);return Math.min(Gd(o,n)+tj,ej)}return ny}function oy(n,t){let e=ny;return t.forEach(o=>{e=Math.max(e,nj(n,o))}),e}function oj(n,t){var l,a;const e=n.header.length,o=n.rows.length+1,r=[],i=Array(e).fill(100);for(let d=0;d<o;d++){let h;d===0?h=n.header:h=n.rows[d-1];for(let p=0;p<e;p++){const A=h[p],v=(l=A==null?void 0:A.tokens)!=null?l:[],B=K();r.push(B);let D;if(v.length===0)D=[gh()];else if(kc(v[0]))D=t.tokensToBlocks(A.tokens,t),D.length===0&&D.push(gh());else{const{text:x,children:_}=t.tokensToTextWithChildren(A.tokens,t);D=[{id:K(),type:"text",text:x},..._]}t.doc.blocks[B]=D,i[p]=Math.max(i[p],oy((a=t.font)!=null?a:"",D))}}return[{id:K(),type:"table",cols:e,rows:o,colsWidth:i,children:r}]}function rj(n){return[{id:K(),type:"embed",embedType:"hr",embedData:{}}]}function ij(n,t){var a;const e=n.text;if(!e)return[];try{const d=n.text,h=pa(d),p=JSON.parse(h);if(p){const{root:A,...v}=p.blocks;return t.doc.blocks={...t.doc.blocks,...v},A}}catch{}const o=(a=n.lang)!=null?a:"Plain Text";if(o==="mermaid")return[{id:K(),type:"embed",embedType:"mermaid",embedData:{mermaidText:e}}];if(o==="plantuml")return[{id:K(),type:"embed",embedType:"plantuml",embedData:{plantumlText:e}}];if(o==="flow"||o==="flowchart")return[{id:K(),type:"embed",embedType:"flowchart",embedData:{flowchartText:e}}];const i=e.split(`
437
+ `)}class xH{constructor(){m(this,"group","image");m(this,"commands",[])}executeCommand(t,e,o){if(o.id==="replace-image"){const{block:r,image:i}=o.data;Ie.getImageObject(t,r).replaceImage(0,i)}}}function IH(){return{blockCommands:{image:new xH},abstract:`${L.t("image.abstract")}`}}function TH(){return{name:"Image",insertEmbedCommandItems:[{id:"insert-image",name:L.t("image.abstract"),icon:bL,group:"common",subText:"/image",order:100}],handleInsertEmptyEmbed:async(n,t)=>{var v;let e;(v=t.data)!=null&&v.file&&(e=t.data.file);const o=P7(n);if(e=e!=null?e:await Ul(o),!e)return null;try{N7(n,e)}catch{return null}let r={width:k7,height:W0};try{r=await l$(e)}catch(B){wH.error(B)}const i=n.rootContainer.clientWidth,s=r.width<i?Math.min(100,r.width/i*100):100,l={src:"",width:r.width,height:r.height,flex:1,virtualSize:!1},a=cn([l],s),d={id:K(),type:"embed",embedType:"image",embedData:a},h=n.options.componentsOptions.image;h!=null&&h.defaultAlign&&(d.align=h.defaultAlign);const p=n.insertBlock(t.containerId,t.blockIndex,d);return Ie.getImageObject(n,p).replaceImage(0,e),p}}}function DH(n,t,e){var h;const{data:o}=e,r=n.getBlockString(t).trim();if(!o||o.embedType!=="image"||!et(n,t))return null;const i=r.match(/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/),s=(h=i==null?void 0:i.groups)==null?void 0:h.filename;if(!s)return null;const l={src:s},a={id:K(),type:"embed",embedType:"image",embedData:l};Ie.create(n,a).setAutoFix(!0);const d=n.options.componentsOptions.image.defaultAlign;return d&&(a.align=d),{blockData:a}}function SH(n,t){const e=it(t);n.destroyCustom(`image-${e}`)}const LH={embedType:"image",createEmbedContent:BH,convertTo:EH,convertFrom:DH,getBlockProperties:IH,getOptions:TH,handleDrop:eH,handleDropOver:rH,handleDeleteBlock:SH};class MH{constructor(t,e){m(this,"toolbar");m(this,"anchor",null);m(this,"item");m(this,"docs",null);m(this,"checkedId");m(this,"handlePasteSpecial",(t,e)=>{!e.data||(this.checkedId===e.id?this.checkedId=void 0:this.checkedId=e.id,this.onPasteSpecial(e.data),setTimeout(()=>{this.docs&&this.show(this.docs),this.editor.focus()}))});m(this,"handleClose",()=>{this.editor.focus()});m(this,"handleSelectionChange",()=>{this.handleClose()});this.editor=t,this.onPasteSpecial=e,this.item={id:"paste-special",name:"",icon:vL,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",childrenOffset:[-4,4],children:[]},this.toolbar=new ru([this.item],void 0,{id:"paste-special-button",tooltipId:this.editor.clientId,refuseOverflow:!0}),this.toolbar.addListener("click",this.handlePasteSpecial),this.toolbar.addListener("close",this.handleClose),this.editor.addListener("selectionChanged",this.handleSelectionChange)}show(t){this.docs=t;const e=this.editor,o=e.selection.range;if(!o.isCollapsed())return;const r=e.getBlockById(o.start.blockId);if(!et(e,r))return;const i=$r(e,r,o)[0];if(!i)return;this.anchor&&this.anchor.remove(),this.anchor=Vr(e,r,"paste-special-button-anchor",i);const s=this.getCommandItems(t);this.item.children=s,this.toolbar.manualShow(this.anchor)}hide(){this.toolbar.close("selectionChange")}clearCheckedState(){this.checkedId=void 0}destroy(){this.toolbar.destroy(),this.editor.removeListener("selectionChanged",this.handleSelectionChange)}getCommandItems(t){const e=i=>({id:i,states:this.checkedId===i?["checked"]:void 0,name:L.t("pasteSpecial.originFormats"),data:t[i]}),o=[];let r=!0;return t["text/x-ones-editor-doc"]?o.push(e("text/x-ones-editor-doc")):t["text/office-html"]?o.push(e("text/office-html")):t["text/html"]?o.push(e("text/html")):t["text/plain"]&&(o.push(e("text/plain")),r=!1),t["text/plain"]&&(r&&o.push({id:"text/plain",states:this.checkedId==="text/plain"?["checked"]:void 0,name:L.t("pasteSpecial.plainText"),data:t["text/plain"]}),o.push({id:"text/markdown",states:this.checkedId==="text/markdown"?["checked"]:void 0,name:L.t("pasteSpecial.markdown"),data:t["text/markdown"]})),o}}const RH=S("paste-special");class u2{constructor(t){m(this,"button");m(this,"lastUndoAction",null);m(this,"event",null);m(this,"handlePasteSpecial",t=>{this.editor.undoManager.runInGroup(()=>{this.editor.undoManager.undoTo(this.lastUndoAction),this.editor.pasteDoc(t)})});this.editor=t,this.button=new MH(t,this.handlePasteSpecial)}destroy(){this.event=null,this.button.destroy()}handleChanged(t,e){this.event=null,this.button.hide()}async handleBeforePaste(t,e){return RH.debug("before paste"),this.lastUndoAction=t.undoManager.lastAction(),!1}async handleAfterPaste(t,e,o){if(Object.keys(o).length<=1)return!1;const r=t.selection.range;if(r.isCollapsed()){const i=t.getBlockById(r.start.blockId);if(!et(t,i))return!1;this.button.clearCheckedState(),this.button.show(o),this.event=e}return!1}}const OH={pasteSpecial:{originFormats:"\u4FDD\u6301\u539F\u6837\u5F0F",plainText:"\u7C98\u8D34\u7EAF\u6587\u672C",markdown:"\u7C98\u8D34\u4E3A Markdown"}},_H={pasteSpecial:{originFormats:"Keep origin formats",plainText:"Paste as plain text",markdown:"Paste as markdown"}},FH={pasteSpecial:{originFormats:"\u5143\u306E\u30B9\u30BF\u30A4\u30EB\u3092\u7DAD\u6301\u3059\u308B",plainText:"\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8CBC\u308A\u4ED8\u3051\u308B",markdown:"Markdown \u3068\u3057\u3066\u8CBC\u308A\u4ED8\u3051"}};L.mergeLang({"zh-CN":OH,"en-US":_H,"ja-JP":FH});const Qnt="",PH=S("html-to-doc");function NH(n){const t=new RegExp('(?<=<canvas data-editor-doc=")[\\s\\S]*(?=" id="ones-editor-doc">)',"g"),e=n.match(t);if(!e||!e.length)return null;const o=e[0],r=pa(o);return JSON.parse(r)}function $H(n){const t="ones-editor-doc::",e="::ones-editor-doc";let o=n.indexOf(t);if(o!==-1){o+=t.length;const i=n.indexOf(e,o);if(i!==-1){const s=n.substr(o,i-o);try{const l=pa(s);return JSON.parse(l)}catch(l){PH.error(`invalid doc data: ${l}, ${s}`)}}}const r=NH(n);return r||null}const ey="latex-b172fea480b",HH=n=>({name:"latex-block",level:"block",start(t){var e,o;return(o=(e=t.match(/\$\$[^\$]/))==null?void 0:e.index)!=null?o:-1},tokenizer(t,e){const o=/^\$\$([^\$]+)\$\$/.exec(t);return o?{type:"latex-block",raw:o[0],formula:o[1]}:void 0},renderer(t){return n.lazy?`<span class="${ey}" block>${t.formula}</span>`:n.render(t.formula,!0)}}),jH=n=>({name:"latex",level:"inline",start(t){var e,o;return(o=(e=t.match(/\$[^\$]/))==null?void 0:e.index)!=null?o:-1},tokenizer(t,e){const o=/^\$([^\$]+)\$/.exec(t);return o?{type:"latex",raw:o[0],formula:o[1]}:void 0},renderer(t){return n.lazy?`<span class="${ey}">${t.formula}</span>`:n.render(t.formula,!1)}});var UH=(n={})=>(n.lazy&&n.env!=="test"&&new IntersectionObserver((t,e)=>{for(const o of t){if(!o.isIntersecting)continue;const r=o.target;e.unobserve(r),Promise.resolve(n.render(r.innerText,r.hasAttribute("block"))).then(i=>{r.innerHTML=i}),r.classList.add("latex-rendered")}},{threshold:1}),{extensions:[HH(n),jH(n)]});function kc(n){const t=n.type;if(t==="link")return!!n.tokens.some(kc);switch(t){case"code":case"table":case"hr":case"blockquote":case"list":case"list_item":case"image":case"paragraph":return!0;default:return!1}}function zH(n){return!kc(n)}function VH(n){if(n.length===0)return[];if(n.length===1)return[n];const t=[];let e=[n[0]],o=kc(n[0]);for(let r=1;r<n.length;r++){const i=n[r];o===kc(i)?e.push(i):(t.push(e),e=[i],o=kc(i))}return t.push(e),t}function WH(n,t,e){const o=n.href;let r=e.tokensToText(n.tokens,t,e);return r.length===0&&(r=_i(o,t)),r=fh(r,"link",o),r}let Ru;function d2(n){Ru||(Ru=document.createElement("textarea")),Ru.innerHTML=n;const t=Ru.childNodes.length===0?"":Ru.childNodes[0].nodeValue;return t!=null?t:""}function qH(n,t){const e=d2(n.text);return[ao(e,{...t,"style-code":!0})]}function GH(n,t,e){const r=n.tokens;return r?e.tokensToText(r,t,e):lg(d2(n.text),t)}const ZH=S("token-to-text");function h2(n,t,e){return n.map(r=>r.type==="text"?GH(r,t,e):r.type==="strong"?e.tokensToText(r.tokens,{...t,"style-bold":!0},e):r.type==="em"?e.tokensToText(r.tokens,{...t,"style-italic":!0},e):r.type==="del"?e.tokensToText(r.tokens,{...t,"style-strikethrough":!0},e):r.type==="link"?WH(r,t,e):r.type==="codespan"?qH(r,t):r.type==="br"?[{insert:" ",attributes:{id:K(),created:Date.now(),box:!0,type:"br"}}]:r.type==="escape"?lg(d2(r.text),t):r.type==="latex"?[{insert:" ",attributes:{id:K(),created:Date.now(),box:!0,type:"math",tex:r.formula}}]:(ZH.warn(`unknown token in text: ${JSON.stringify(r)}`),[])).flat()}function QH(n,t){const e=h2(n.tokens,{},t);return[{id:K(),type:"text",text:e,heading:n.depth}]}function YH(n,t){const{text:e,children:o}=t.tokensToTextWithChildren(n.tokens,t),r=[];return e.length>0&&r.push({id:K(),type:"text",text:e}),r.push(...o),r}function JH(n,t){const{text:e,children:o}=t.tokensToTextWithChildren([n],t),r=[];return e.length>0&&r.push({id:K(),type:"text",text:e}),r.push(...o),r}function KH(n,t){const e=typeof n.start=="number"?n.start:1,o=n.ordered,r=K(),i=[];return n.items.forEach((l,a)=>{const d={...t,listLevel:t.listLevel+1},{text:h,children:p}=t.tokensToTextWithChildren(l.tokens,d);let A;typeof l.checked=="boolean"&&(A=l.checked?"checked":"unchecked");const v={id:K(),type:"list",groupId:r,ordered:o,checkbox:A,start:e+a,text:h,level:t.listLevel};i.push(v),i.push(...p)}),i}function XH(n,t){const e=t.tokensToBlocks(n.tokens,t);return e.forEach(o=>{o.quoted=!0}),e}const ny=100,tj=20,ej=600;function nj(n,t){const e=t.text;if(e){const o=ie(e);return Math.min(Gd(o,n)+tj,ej)}return ny}function oy(n,t){let e=ny;return t.forEach(o=>{e=Math.max(e,nj(n,o))}),e}function oj(n,t){var l,a;const e=n.header.length,o=n.rows.length+1,r=[],i=Array(e).fill(100);for(let d=0;d<o;d++){let h;d===0?h=n.header:h=n.rows[d-1];for(let p=0;p<e;p++){const A=h[p],v=(l=A==null?void 0:A.tokens)!=null?l:[],B=K();r.push(B);let D;if(v.length===0)D=[gh()];else if(kc(v[0]))D=t.tokensToBlocks(A.tokens,t),D.length===0&&D.push(gh());else{const{text:x,children:_}=t.tokensToTextWithChildren(A.tokens,t);D=[{id:K(),type:"text",text:x},..._]}t.doc.blocks[B]=D,i[p]=Math.max(i[p],oy((a=t.font)!=null?a:"",D))}}return[{id:K(),type:"table",cols:e,rows:o,colsWidth:i,children:r}]}function rj(n){return[{id:K(),type:"embed",embedType:"hr",embedData:{}}]}function ij(n,t){var a;const e=n.text;if(!e)return[];try{const d=n.text,h=pa(d),p=JSON.parse(h);if(p){const{root:A,...v}=p.blocks;return t.doc.blocks={...t.doc.blocks,...v},A}}catch{}const o=(a=n.lang)!=null?a:"Plain Text";if(o==="mermaid")return[{id:K(),type:"embed",embedType:"mermaid",embedData:{mermaidText:e}}];if(o==="plantuml")return[{id:K(),type:"embed",embedType:"plantuml",embedData:{plantumlText:e}}];if(o==="flow"||o==="flowchart")return[{id:K(),type:"embed",embedType:"flowchart",embedData:{flowchartText:e}}];const i=e.split(`
438
438
  `).map(d=>({id:K(),type:"text",text:_i(d)})),s=t.doc,l=K();return s.blocks[l]=i,[{id:K(),type:"code",language:o,children:[l]}]}function sj(n){return[{id:K(),type:"embed",embedType:"image",embedData:{src:n.href,title:n.title}}]}function lj(n,t){const{text:e,children:o}=t.tokensToTextWithChildren(n.tokens,t),r=[];return e.length>0&&r.push({id:K(),type:"text",text:e}),r.push(...o),r}function cj(n){const t=n.formula;return t?[{id:K(),type:"embed",embedType:"math",embedData:{mathjaxText:t}}]:[]}const ry=S("markdown-to-doc");function aj(n,t){var e;if(n.type==="heading")return QH(n,t);if(n.type==="paragraph")return YH(n,t);if(n.type==="list")return KH(n,t);if(n.type==="blockquote")return XH(n,t);if(n.type==="table")return oj(n,t);if(n.type==="hr")return rj();if(n.type==="code")return ij(n,t);if(n.type==="image")return sj(n);if(n.type==="link")return lj(n,t);if(n.type==="latex-block")return cj(n);if(n.type==="text")return JH(n,t);if(n.type==="space"){const o=n.raw.replaceAll(" ",""),r=Math.floor(o.split(`
439
439
  `).length/2)-1;return r>0?new Array(r).fill("").map(()=>({type:"text",id:K(),text:[]})):[]}if(n.type==="html"){const o=(e=t.htmlToDoc)==null?void 0:e.call(t,n.text);if(!o)return ry.warn(`failed to convert html to doc: ${JSON.stringify(n)}`),[];const{root:r,...i}=o.blocks;return t.doc.blocks={...t.doc.blocks,...i},r}return ry.warn(`unknown block token: ${JSON.stringify(n)}`),[]}function f2(n,t){const e=[];return n.forEach(o=>{const r=aj(o,t);e.push(...r)}),e}S("markdown-to-doc");function uj(n,t){const e={text:[],children:[]};return VH(n).forEach((r,i)=>{const s=r[0];if(i===0&&zH(s)){e.text=h2(r,{},t);return}e.children.push(...f2(r,t))}),e}const dj={render:(n,t)=>""};GC.marked.use(UH(dj));function iy(n,t){const o=new GC.marked.Lexer().lex(n),r={blocks:{root:[]},meta:{},comments:{}},i={font:t==null?void 0:t.font,doc:r,tokensToText:h2,tokensToBlocks:f2,tokensToTextWithChildren:uj,htmlToDoc:t==null?void 0:t.htmlToDoc,listLevel:1},s=f2(o,i);return s.length===0?null:(r.blocks.root.push(...s),r)}function hj(n){if(n.nodeName!=="DIV")return!1;const t=n;return Array.from(t.childNodes).every(e=>e.nodeName==="SPAN"||e instanceof Text)?!!t.querySelector(":scope > .hljs-function, :scope > .hljs-params, :scope > .hljs-string, :scope > .hljs-keyword, :scope > .hljs-attr"):!1}function sy(n){if(hj(n)){const t=n,e=t.parentNode,o=document.createElement("pre");Array.from(t.childNodes).forEach(r=>o.appendChild(r)),e==null||e.insertBefore(o,t);return}n.childNodes.forEach(t=>sy(t))}function jf(n){var t;if(n instanceof HTMLBRElement){const e=document.createTextNode(`
440
440
  `);(t=n.parentNode)==null||t.insertBefore(e,n),n.remove();return}n.childNodes.forEach(jf)}function fj(n){n.addRule("preOnlyBlockToCode",{filter:t=>t.nodeName!=="PRE"?!1:Array.from(t.childNodes).every(e=>e.nodeName==="SPAN"||e instanceof Text||e.nodeName==="BR"),replacement:(t,e,o)=>{var r;return jf(e),`
@@ -520,10 +520,10 @@ width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
520
520
  <path d="M1.00098 12.9985L10.9995 2.99998" stroke="currentColor"/>
521
521
  <path d="M11.9113 6.16809L13.7433 3.79209C13.946 3.52009 14.0473 3.26142 14.0473 3.01609V2.90409C14.0473 2.71209 13.994 2.56009 13.8873 2.44809C13.786 2.33609 13.6473 2.28009 13.4713 2.28009C13.2953 2.28009 13.1567 2.33876 13.0553 2.45609C12.954 2.57342 12.9033 2.73609 12.9033 2.94409V3.07209H11.8873V2.88009C11.8873 2.59209 11.9513 2.33609 12.0793 2.11209C12.2127 1.88809 12.402 1.71209 12.6473 1.58409C12.8927 1.45609 13.1807 1.39209 13.5113 1.39209C13.8313 1.39209 14.1113 1.45876 14.3513 1.59209C14.5967 1.72542 14.7833 1.90409 14.9113 2.12809C15.0447 2.35209 15.1113 2.60009 15.1113 2.87209V3.00809C15.1113 3.24809 15.0687 3.46942 14.9833 3.67209C14.898 3.87476 14.7727 4.08276 14.6073 4.29609L13.2313 6.08009H15.1113V7.00009H11.9113V6.16809Z" fill="currentColor"/>
522
522
  </svg>
523
- `,Ks=S("text-commands");function i8(n){const t={id:"more",name:L.t("commands.more"),icon:Xb,childrenType:"menu",childrenPlacement:"bottom-start",manualShowChildren:!0,children:[]},e={"style-bold":[L.t("commands.bold"),ro("CtrlOrCmd+B"),dz],"style-italic":[L.t("commands.italic"),ro("CtrlOrCmd+I"),hz],"style-underline":[L.t("commands.underline"),ro("CtrlOrCmd+U"),fz],"style-strikethrough":[L.t("commands.strikethrough"),ro("CtrlOrCmd+D"),mz],"style-code":[L.t("commands.code"),void 0,gz]},o={"style-super":[L.t("commands.superscript"),void 0,Cz],"style-sub":[L.t("commands.subscript"),void 0,pz]};if(rn(n)===0){const l=Object.entries(e).map(([a,[d,h,p]])=>({id:a,name:d,icon:p,desc:h}));return t.children=Object.entries(o).map(([a,[d,h,p]])=>({id:a,name:d,icon:p,desc:h})),l.concat(t)}const r=az(n);function i([l,[a,d,h]]){const p=r.get(l);return p!==void 0?{id:l,name:a,value:p,states:p===!0?["checked"]:void 0,icon:h,desc:d}:{id:l,name:a,icon:h,desc:d}}const s=Object.entries(e).map(i);return t.children=Object.entries(o).map(i),s.concat(t)}function Az(n,t){const e=it(t),o=Dt(t),r=Do(n,t);return i8([]).map(i=>({blockId:e,blockType:o,blockKind:r,...i,groupIndex:500}))}function bz(n,t,e){g(Ks,e.isSimple(),"nor a simple range");const{start:o,end:r}=e;g(Ks,o.isSimple(),"is not a simple block position"),g(Ks,r.isSimple(),"is not a simple block position"),g(Ks,et(n,t),"invalid block type, not a text kind block");const i=it(t);g(Ks,o.blockId===i&&r.blockId===i,"invalid range");const s=n.getBlockText(t);let l=[];o.offset===r.offset?o.offset!==0&&(l=ze(s,o.offset-1,1).middle):l=ze(s,o.offset,r.offset-o.offset).middle;const a=Dt(t),d=Do(n,t);return i8(l).map((h,p)=>({blockId:i,blockType:a,blockKind:d,...h,groupIndex:500,order:p*100}))}function vz(n,t,e,o,r,i){if(!et(n,t))return!1;if(!o.startsWith("style-"))return Ks.warn(`unknown command: ${o}`),!1;const s=r==null?void 0:r.value,l=typeof s;if(l!=="string"&&l!=="number"&&l!=="boolean"&&l!=="undefined")return Ks.warn(`invalid value type, accept string | number | boolean | undefined, current is ${l}`),!1;const a=uz(n,t,e,o,s);return n.focus(),i.result=a,!0}const yz=S("text-command-provider");class yr{constructor(t){m(this,"id","TextCommandProvider");m(this,"emptyTextBlockAttributes",new Map);m(this,"colorItem");m(this,"updateButtonColor",()=>{const t=$g(this.editor,this.getEmptyTextBlockColor);this.colorItem.updateButtonColor(t)});m(this,"handleChangeColor",(t,e)=>{if(t==="color"||t==="backgroundColor")Z6(this.editor,t,e,this.setEmptyTextBlockColor);else{const o=["clearAll","clearColor","clearBackground"];Q6(this.editor,o[e],this.setEmptyTextBlockColor)}this.editor.focus()});m(this,"handleBeforePopupPalette",()=>{const t=$g(this.editor,this.getEmptyTextBlockColor);this.colorItem.updatePaletteColor(t)});m(this,"getEmptyTextBlockColor",(t,e)=>{const o=this.getEmptyBlockTextAttributes(t,e);return fg(o)});m(this,"setEmptyTextBlockColor",(t,e,o,r)=>{var s;const i=(s=this.emptyTextBlockAttributes.get(e))!=null?s:{};e6(i,o,r),this.emptyTextBlockAttributes.set(e,i)});this.editor=t,this.colorItem=t.addCustom("text-color-item",()=>new CM(t)),this.colorItem.addListener("onClick",this.handleChangeColor),this.colorItem.addListener("beforePopup",this.handleBeforePopupPalette)}destroy(){this.colorItem.destroy()}getAvailableCommands(t,e,o){if(!et(t,e))return[];let r;ut(t,e)===0?r=this.getCommandsOnEmptyText(t,e).map(yr.toTextCommand):r=bz(t,e,o).map(yr.toTextCommand),this.updateButtonColor();const s={...this.colorItem,blockId:it(e),blockKind:Do(t,e),blockType:Dt(e),groupIndex:500,order:350};return r.push(s),r}executeCommand(t,e,o,r,i,s){if(!et(t,e))return!1;let l=i.value;l===void 0&&(l=!r.value);const a=yr.fromTextCommandId(r.id);if(a.startsWith("style-")){if(a==="style-font")return this.handleChangeColor(i.type,l),!0;if(ut(t,e)===0)return this.executeCommandOnEmptyText(e,r,{value:l})}return vz(t,e,o,a,{value:l},s)}executeCommandOnEmptyText(t,e,o){let r=this.emptyTextBlockAttributes.get(it(t));r||(r={},this.emptyTextBlockAttributes.set(it(t),r));const i=yr.fromTextCommandId(e.id),s=o.value;return s==null||s===!1?(delete r[i],!0):(r[i]=o.value,!0)}getCommandsOnEmptyText(t,e){const o=Az(t,e);return this.setCommandsStates(o,e)}setCommandsStates(t,e){var i;const o=it(e),r=(i=this.emptyTextBlockAttributes.get(o))!=null?i:{};return t.map(s=>{const l=r[s.id],a=l?["checked"]:void 0;return s.children&&(s.children=this.setCommandsStates(s.children,e)),{...s,value:l,states:a}})}getEmptyBlockTextAttributes(t,e){var r;const o=mt.default((r=this.emptyTextBlockAttributes.get(e))!=null?r:{});if(Array.from(Object.entries(o)).forEach(([i,s])=>{s||delete o[i]}),Object.keys(o).length!==0)return o}static toTextCommand(t){return t.children&&(t.children=t.children.map(yr.toTextCommand)),{...t,id:`text/${t.id}`}}static fromTextCommandId(t){const e="text/";return g(yz,t.startsWith(e),`invalid item id: ${t}`),t.substring(e.length)}static fromTextCommand(t){return{...t,id:this.fromTextCommandId(t.id)}}static toTextCommands(t){return t.map(yr.toTextCommand)}static fromTextCommands(t){return t.map(yr.fromTextCommand)}}function s8(n){const t=n.getCustom("toolbar-handler");t.disableTextToolbar(),t.hide(),setTimeout(()=>{t.enableTextToolbar()},300)}function kz(n){n.undoManager.canUndo()&&s8(n)}function wz(n){n.undoManager.canRedo()&&s8(n)}const Bz={"CtrlOrCmd+Z":kz,"CtrlOrCmd+Shift+Z":wz},Ez={commands:{bold:"\u7C97\u4F53",italic:"\u659C\u4F53",underline:"\u4E0B\u5212\u7EBF",strikethrough:"\u5220\u9664\u7EBF",code:"\u884C\u5185\u4EE3\u7801",subscript:"\u4E0B\u6807",superscript:"\u4E0A\u6807",more:"\u66F4\u591A"}},xz={commands:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code",subscript:"Subscript",superscript:"Superscript",more:"More"}},Iz={commands:{bold:"\u592A\u5B57",italic:"\u659C\u4F53",underline:"\u4E0B\u7DDA",strikethrough:"\u53D6\u308A\u6D88\u3057\u7DDA",code:"\u30A4\u30F3\u30E9\u30A4\u30F3\u30B3\u30FC\u30C9",subscript:"\u4E0B\u4ED8\u304D\u6587\u5B57",superscript:"\u4E0A\u4ED8\u304D\u6587\u5B57",more:"\u305D\u306E\u4ED6"}};L.mergeLang({"zh-CN":Ez,"en-US":xz,"ja-JP":Iz});var l8=(n=>(n.Card="card",n.Preview="preview",n))(l8||{});const Tz=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
523
+ `,Ks=S("text-commands");function i8(n){const t={id:"more",name:L.t("commands.more"),icon:Xb,childrenType:"menu",childrenPlacement:"bottom-start",manualShowChildren:!0,children:[]},e={"style-bold":[L.t("commands.bold"),ro("CtrlOrCmd+B"),dz],"style-italic":[L.t("commands.italic"),ro("CtrlOrCmd+I"),hz],"style-underline":[L.t("commands.underline"),ro("CtrlOrCmd+U"),fz],"style-strikethrough":[L.t("commands.strikethrough"),ro("CtrlOrCmd+D"),mz],"style-code":[L.t("commands.code"),void 0,gz]},o={"style-super":[L.t("commands.superscript"),void 0,Cz],"style-sub":[L.t("commands.subscript"),void 0,pz]};if(rn(n)===0){const l=Object.entries(e).map(([a,[d,h,p]])=>({id:a,name:d,icon:p,desc:h}));return t.children=Object.entries(o).map(([a,[d,h,p]])=>({id:a,name:d,icon:p,desc:h})),l.concat(t)}const r=az(n);function i([l,[a,d,h]]){const p=r.get(l);return p!==void 0?{id:l,name:a,value:p,states:p===!0?["checked"]:void 0,icon:h,desc:d}:{id:l,name:a,icon:h,desc:d}}const s=Object.entries(e).map(i);return t.children=Object.entries(o).map(i),s.concat(t)}function Az(n,t){const e=it(t),o=Dt(t),r=Do(n,t);return i8([]).map(i=>({blockId:e,blockType:o,blockKind:r,...i,groupIndex:500}))}function bz(n,t,e){g(Ks,e.isSimple(),"nor a simple range");const{start:o,end:r}=e;g(Ks,o.isSimple(),"is not a simple block position"),g(Ks,r.isSimple(),"is not a simple block position"),g(Ks,et(n,t),"invalid block type, not a text kind block");const i=it(t);g(Ks,o.blockId===i&&r.blockId===i,"invalid range");const s=n.getBlockText(t);let l=[];o.offset===r.offset?o.offset!==0&&(l=ze(s,o.offset-1,1).middle):l=ze(s,o.offset,r.offset-o.offset).middle;const a=Dt(t),d=Do(n,t);return i8(l).map((h,p)=>({blockId:i,blockType:a,blockKind:d,...h,groupIndex:500,order:p*100}))}function vz(n,t,e,o,r,i){if(!et(n,t))return!1;if(!o.startsWith("style-"))return Ks.warn(`unknown command: ${o}`),!1;const s=r==null?void 0:r.value,l=typeof s;if(l!=="string"&&l!=="number"&&l!=="boolean"&&l!=="undefined")return Ks.warn(`invalid value type, accept string | number | boolean | undefined, current is ${l}`),!1;const a=uz(n,t,e,o,s);return n.focus(),i.result=a,!0}const yz=S("text-command-provider");class yr{constructor(t){m(this,"id","TextCommandProvider");m(this,"emptyTextBlockAttributes",new Map);m(this,"colorItem");m(this,"updateButtonColor",()=>{const t=$g(this.editor,this.getEmptyTextBlockColor);this.colorItem.updateButtonColor(t)});m(this,"handleChangeColor",(t,e)=>{if(t==="color"||t==="backgroundColor")Z6(this.editor,t,e,this.setEmptyTextBlockColor);else{const o=["clearAll","clearColor","clearBackground"];Q6(this.editor,o[e],this.setEmptyTextBlockColor)}this.editor.focus()});m(this,"handleBeforePopupPalette",()=>{const t=$g(this.editor,this.getEmptyTextBlockColor);this.colorItem.updatePaletteColor(t)});m(this,"getEmptyTextBlockColor",(t,e)=>{const o=this.getEmptyBlockTextAttributes(t,e);return fg(o)});m(this,"setEmptyTextBlockColor",(t,e,o,r)=>{var s;const i=(s=this.emptyTextBlockAttributes.get(e))!=null?s:{};e6(i,o,r),this.emptyTextBlockAttributes.set(e,i)});this.editor=t,this.colorItem=t.addCustom("text-color-item",()=>new CM(t)),this.colorItem.addListener("onClick",this.handleChangeColor),this.colorItem.addListener("beforePopup",this.handleBeforePopupPalette)}destroy(){this.colorItem.destroy()}getAvailableCommands(t,e,o){if(!et(t,e))return[];let r;ut(t,e)===0?r=this.getCommandsOnEmptyText(t,e).map(yr.toTextCommand):r=bz(t,e,o).map(yr.toTextCommand),this.updateButtonColor();const s={...this.colorItem,blockId:it(e),blockKind:Do(t,e),blockType:Dt(e),groupIndex:500,order:350};return r.push(s),r}executeCommand(t,e,o,r,i,s){if(!et(t,e))return!1;let l=i.value;l===void 0&&(l=!r.value);const a=yr.fromTextCommandId(r.id);if(a.startsWith("style-")){if(a==="style-font")return this.handleChangeColor(i.type,l),!0;if(ut(t,e)===0)return this.executeCommandOnEmptyText(e,r,{value:l})}return vz(t,e,o,a,{value:l},s)}executeCommandOnEmptyText(t,e,o){let r=this.emptyTextBlockAttributes.get(it(t));r||(r={},this.emptyTextBlockAttributes.set(it(t),r));const i=yr.fromTextCommandId(e.id),s=o.value;return s==null||s===!1?(delete r[i],!0):(r[i]=o.value,!0)}getCommandsOnEmptyText(t,e){const o=Az(t,e);return this.setCommandsStates(o,e)}setCommandsStates(t,e){var i;const o=it(e),r=(i=this.emptyTextBlockAttributes.get(o))!=null?i:{};return t.map(s=>{const l=r[s.id],a=l?["checked"]:void 0;return s.children&&(s.children=this.setCommandsStates(s.children,e)),{...s,value:l,states:a}})}getEmptyBlockTextAttributes(t,e){var r;const o=mt.default((r=this.emptyTextBlockAttributes.get(e))!=null?r:{});if(Array.from(Object.entries(o)).forEach(([i,s])=>{s||delete o[i]}),Object.keys(o).length!==0)return o}static toTextCommand(t){return t.children&&(t.children=t.children.map(yr.toTextCommand)),{...t,id:`text/${t.id}`}}static fromTextCommandId(t){const e="text/";return g(yz,t.startsWith(e),`invalid item id: ${t}`),t.substring(e.length)}static fromTextCommand(t){return{...t,id:this.fromTextCommandId(t.id)}}static toTextCommands(t){return t.map(yr.toTextCommand)}static fromTextCommands(t){return t.map(yr.fromTextCommand)}}function s8(n){const t=n.getCustom("toolbar-handler");t.disableTextToolbar(),t.hide(),setTimeout(()=>{t.enableTextToolbar()},300)}function kz(n){n.undoManager.canUndo()&&s8(n)}function wz(n){n.undoManager.canRedo()&&s8(n)}const Bz={"CtrlOrCmd+Z":kz,"CtrlOrCmd+Shift+Z":wz},Ez={commands:{bold:"\u7C97\u4F53",italic:"\u659C\u4F53",underline:"\u4E0B\u5212\u7EBF",strikethrough:"\u5220\u9664\u7EBF",code:"\u884C\u5185\u4EE3\u7801",subscript:"\u4E0B\u6807",superscript:"\u4E0A\u6807",more:"\u66F4\u591A"}},xz={commands:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code",subscript:"Subscript",superscript:"Superscript",more:"More"}},Iz={commands:{bold:"\u592A\u5B57",italic:"\u659C\u4F53",underline:"\u4E0B\u7DDA",strikethrough:"\u53D6\u308A\u6D88\u3057\u7DDA",code:"\u30A4\u30F3\u30E9\u30A4\u30F3\u30B3\u30FC\u30C9",subscript:"\u4E0B\u4ED8\u304D\u6587\u5B57",superscript:"\u4E0A\u4ED8\u304D\u6587\u5B57",more:"\u305D\u306E\u4ED6"}};L.mergeLang({"zh-CN":Ez,"en-US":xz,"ja-JP":Iz});var l8=(n=>(n.Card="card",n.Preview="preview",n))(l8||{});const Tz=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="#5587F0">
524
524
  <g clip-path="url(#clip0)">
525
- <path d="M6.01 10.4886C5.85 10.4886 5.7 10.4286 5.58 10.3086L3.98 8.71859C3.35 8.07859 3 7.23859 3 6.34859C3 5.45859 3.35 4.60859 3.98 3.97859C5.29 2.66859 7.41 2.66859 8.72 3.97859L10.31 5.56859C10.55 5.80859 10.55 6.18859 10.31 6.42859C10.07 6.66859 9.69 6.66859 9.45 6.42859L7.86 4.83859C7.03 4.00859 5.68 4.00859 4.85 4.83859C4.45 5.23859 4.23 5.77859 4.23 6.34859C4.23 6.91859 4.45 7.44859 4.85 7.85859L6.44 9.44859C6.68 9.68859 6.68 10.0686 6.44 10.3086C6.32 10.4286 6.16 10.4886 6.01 10.4886ZM11.65 14.9986C10.79 14.9986 9.93 14.6686 9.28 14.0186L7.4 12.1386C7.16 11.8986 7.16 11.5186 7.4 11.2786C7.64 11.0386 8.02 11.0386 8.26 11.2786L10.14 13.1586C10.97 13.9886 12.32 13.9886 13.15 13.1586C13.55 12.7586 13.77 12.2186 13.77 11.6486C13.77 11.0786 13.55 10.5486 13.15 10.1386L11.28 8.25859C11.04 8.01859 11.04 7.63859 11.28 7.39859C11.52 7.15859 11.9 7.15859 12.14 7.39859L14.02 9.27859C14.65 9.90859 15 10.7486 15 11.6486C15 12.5386 14.65 13.3886 14.02 14.0186C13.37 14.6686 12.51 14.9986 11.65 14.9986Z" fill="#5587F0"/>
526
- <path d="M10.88 10.8604C10.67 11.0704 10.32 11.0704 10.1 10.8604L7.64004 8.40039C7.43004 8.19039 7.43004 7.84039 7.64004 7.62039C7.85004 7.41039 8.20004 7.41039 8.42004 7.62039L10.88 10.0804C11.1 10.3004 11.1 10.6404 10.88 10.8604Z" fill="#5587F0"/>
525
+ <path d="M6.01 10.4886C5.85 10.4886 5.7 10.4286 5.58 10.3086L3.98 8.71859C3.35 8.07859 3 7.23859 3 6.34859C3 5.45859 3.35 4.60859 3.98 3.97859C5.29 2.66859 7.41 2.66859 8.72 3.97859L10.31 5.56859C10.55 5.80859 10.55 6.18859 10.31 6.42859C10.07 6.66859 9.69 6.66859 9.45 6.42859L7.86 4.83859C7.03 4.00859 5.68 4.00859 4.85 4.83859C4.45 5.23859 4.23 5.77859 4.23 6.34859C4.23 6.91859 4.45 7.44859 4.85 7.85859L6.44 9.44859C6.68 9.68859 6.68 10.0686 6.44 10.3086C6.32 10.4286 6.16 10.4886 6.01 10.4886ZM11.65 14.9986C10.79 14.9986 9.93 14.6686 9.28 14.0186L7.4 12.1386C7.16 11.8986 7.16 11.5186 7.4 11.2786C7.64 11.0386 8.02 11.0386 8.26 11.2786L10.14 13.1586C10.97 13.9886 12.32 13.9886 13.15 13.1586C13.55 12.7586 13.77 12.2186 13.77 11.6486C13.77 11.0786 13.55 10.5486 13.15 10.1386L11.28 8.25859C11.04 8.01859 11.04 7.63859 11.28 7.39859C11.52 7.15859 11.9 7.15859 12.14 7.39859L14.02 9.27859C14.65 9.90859 15 10.7486 15 11.6486C15 12.5386 14.65 13.3886 14.02 14.0186C13.37 14.6686 12.51 14.9986 11.65 14.9986Z" fill="currentColor"/>
526
+ <path d="M10.88 10.8604C10.67 11.0704 10.32 11.0704 10.1 10.8604L7.64004 8.40039C7.43004 8.19039 7.43004 7.84039 7.64004 7.62039C7.85004 7.41039 8.20004 7.41039 8.42004 7.62039L10.88 10.0804C11.1 10.3004 11.1 10.6404 10.88 10.8604Z" fill="currentColor"/>
527
527
  </g>
528
528
  <defs>
529
529
  <clipPath id="clip0">
@@ -761,4 +761,4 @@ ${i.mermaidText}
761
761
  ${i.flowchartText}
762
762
  \`\`\`\`\`\``}return"[flowchart]"}const AG={embedType:"flowchart",convertFrom:gG,handleUpdateBlock:mG,createEmbedContent:fG,getBlockProperties:pG,convertTo:CG},bG=S("plantuml-helper");function ak(n,t){var l;let o=((l=(n.getComponentOptions("plantuml")||{}).cdn)==null?void 0:l.plantuml)||Yq;o.endsWith("/")||(o+="/");const r=VB.default.encode(t);g(bG,r,r),o+=r;const s=new URLSearchParams(document.location.search).get("doc");return Im(o,{id:`${s}-${K()}`})}async function vG(n,t){try{const e=await U2(n,t);return(await n.doc.uploadResource(e)).resourceId}catch{return Promise.resolve(t)}}class Oc extends G2{constructor(t){super(t,"plantuml","plantumlText")}static get(t,e){return t.addCustom(`plantuml-${e.id}`,()=>new Oc(t))}code2ObjectUrl(t){return Promise.resolve(ak(this.editor,t))}code2ResourceId(t){const e=ak(this.editor,t);return vG(this.editor,e)}destroy(){}}function yG(n,t,e){Oc.get(n,e).createEmbedContent(t,e)}function kG(n,t,e){const o=Oc.get(n,e),r=Lt(t);return o.updateEmbedContent(r,e),!0}function wG(n,t,e){const{data:o}=e,r=n.getBlockString(t).trim();if(!o||o.embedType!=="plantuml"||r!=="```plantuml"||!et(n,t))return null;const i={src:"",plantumlText:""};return{blockData:{id:K(),type:"embed",embedType:"plantuml",embedData:i},onConverted:(a,d)=>{Oc.get(a,a.getBlockData(d)).editGraph(Lt(d))}}}function BG(n,t){return Oc.get(n,n.getBlockData(t)).getBlockProperties(t)}function EG(n,t,e,o){const{embedData:r}=t,i=r;if(o==="html")return i.src?`<img src="${n.doc.buildResourceUrl(i.src,{withToken:!0})}" />`:i.flowchartText?`<div>${i.flowchartText}</div>`:"<p>[plantuml]</p>";if(o==="markdown"){if(i.src)return`![plantuml](${n.doc.buildResourceUrl(i.src,{withToken:!0})})`;if(i.flowchartText)return`\`\`\`plantuml\`\`\`
763
763
  ${i.flowchartText}
764
- \`\`\`\`\`\``}return"[plantuml]"}const xG={embedType:"plantuml",convertFrom:wG,handleUpdateBlock:kG,createEmbedContent:yG,getBlockProperties:BG,convertTo:EG},yot="",IG="hr",TG={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},DG={dividingLine:{type:"Separation line",abstract:"Separation line"}},SG={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};L.mergeLang({"zh-CN":TG,"en-US":DG,"ja-JP":SG});function LG(n,t){const e=k("div",["editor-embed-container"],t);k("hr",["editor-embed-hr"],e)}function MG(n,t,e,o){return o==="html"?"<hr />":o==="markdown"?"---":"------------"}function RG(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:L.t("dividingLine.type"),icon:FL,order:500,group:"common",subText:An("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:o}=t;return n.insertEmbed(e,o,IG,{})}}}function OG(n,t,e){const{data:o}=e;if(!o||o.embedType!=="dividing-line"||!et(n,t))return null;const r={};return{blockData:{id:K(),type:"embed",embedType:"hr",embedData:r}}}function _G(){return{abstract:L.t("dividingLine.abstract")}}const FG={embedType:"hr",createEmbedContent:LG,convertTo:MG,getOptions:RG,convertFrom:OG,getBlockProperties:_G},kot="",wot="",PG={media:{upload:{failed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>'},load:{failed:'<div class="line-1">{name}\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>'},audio:{menuItem:"\u97F3\u9891",abstract:"\u97F3\u9891"},video:{menuItem:"\u89C6\u9891",abstract:"\u89C6\u9891"}}},NG={media:{upload:{failed:'<div class="line-1">{name} upload failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>'},load:{failed:'<div class="line-1">{name} loading failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>'},audio:{menuItem:"Audio",abstract:"Audio"},video:{menuItem:"Video",abstract:"Video"}}},$G={media:{upload:{failed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>'},load:{failed:'<div class="line-1">{name}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>'},audio:{menuItem:"\u97F3\u58F0",abstract:"\u97F3\u58F0"},video:{menuItem:"\u52D5\u753B",abstract:"\u52D5\u753B"}}};L.mergeLang({"zh-CN":PG,"en-US":NG,"ja-JP":$G});var qo=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(qo||{}),Hu=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(Hu||{});const uk=10*1024*1024,HG=["wav","mp3","aac","ogg","webm","flac"],jG=["ogg","mp4","webm"],UG=()=>{};function dk(n){var h,p,A,v,B,D;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:o,callbacks:r}=t,i=(p=e==null?void 0:e.audio)!=null?p:HG,s=(A=e==null?void 0:e.video)!=null?A:jG,l=(v=o==null?void 0:o.audio)!=null?v:uk,a=(B=o==null?void 0:o.video)!=null?B:uk,d=(D=r==null?void 0:r.onError)!=null?D:UG;return{allowedMedias:{audio:i,video:s},maxSize:{audio:l,video:a},callbacks:{onError:d}}}function zG(n,t){const e=i=>i.map(s=>`.${s}`).join(","),{allowedMedias:o}=dk(n),r=o[t];return r?e(r):"*"}function VG(n,t,e){const{maxSize:o,callbacks:r,allowedMedias:i}=dk(t),{[e]:s}=o,{[e]:l}=i;if(s&&n.size>s){const d=new Error("media is too large");throw d.code=`MaxMediaSize-${e}`,r!=null&&r.onError&&(r==null||r.onError(t,d)),d}const a=Aa(n.name);if(l&&!l.includes(a)){const d=new Error(`media file is not allowed: ${a}`);throw d.code="NotAllowedFile",r!=null&&r.onError&&(r==null||r.onError(t,d)),d}}function WG(n){return n===Hu.Empty||n===Hu.Error}const Ne=S("media");class qG extends ve.TypedEmitter{constructor(e){super();m(this,"mediaContainer",null);m(this,"media",null);m(this,"abstract",null);m(this,"handleMediaLoadError",(e,o)=>{if(!o.target||!(o.target instanceof Node)||!(o.target instanceof Element?o.target:o.target.parentElement))return;const i=tt(o.target);if(!i||!i.contains(this.mediaContainer))return;const s=this.renderError();this.updateMediaContent(s),this.emit("mediaError",e,"load_error",it(i))});m(this,"handleUploadFile",async e=>{g(Ne,this.abstract,"no abstract"),g(Ne,this.mediaContainer,"The media element not exist");const{editor:o}=this.options,r=tt(this.mediaContainer);g(Ne,r,"The block element not exist");const i=o.getBlockData(r);try{const{resourceId:s}=await o.doc.uploadResource(e,{onProgress:p=>{this.renderProgress(p,e)}}),{name:l,type:a,size:d}=e,h={...i,embedData:{...i.embedData,src:s,fileName:l,fileSize:d,fileType:a}};o.updateBlockData(r,h)}catch(s){Ne.error(s),this.emit("mediaError",o,"upload_error",i.id),this.renderRetry(e)}ot(r,"media-block-uploading")});m(this,"destroy",()=>{this.mediaContainer=null});this.options=e}bindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.addEventListener(this.media,"error",this.handleMediaLoadError)}unbindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.removeEventListener(this.media,"error",this.handleMediaLoadError)}updateMediaContent(e){g(Ne,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){g(Ne,this.abstract,"no abstract");const{editor:e,createMediaElement:o}=this.options,{mediaIcon:r,mediaName:i}=this.abstract;g(Ne,this.mediaContainer,"The media element not exist");const s=tt(this.mediaContainer);g(Ne,s,"The block element not exist");const l=e.getBlockData(s),a=l.embedData.src,d=k("div",["media-error","embed-selected-content","embed-hover-content"],null),h=k("span",["media-error-icon"],d);h.innerHTML=r;const p=k("div",[],d);p.innerHTML=L.t("media.load.failed",{name:i}),d.appendChild(p);const A=p.querySelector(".retry-upload");return g(Ne,A,"The element not exist"),e.domEvents.addEventListener(A,"click",(v,B)=>{const D=k("div",["media-element"],null),x=this.getResourceUrl(a),_=o(v,D,l,x);this.unbindMediaEvent(),this.media=_,this.bindMediaEvent(),this.updateMediaContent(D)}),this.setFullScreen(),d}renderRetry(e){g(Ne,this.abstract,"no abstract");const{editor:o}=this.options,{mediaIcon:r,mediaName:i}=this.abstract,s=k("div",["media-error","embed-selected-content","embed-hover-content"],null),l=k("span",["media-error-icon"],s);l.innerHTML=r;const a=k("div",[],s);a.innerHTML=L.t("media.upload.failed",{name:i}),s.appendChild(a);const d=a.querySelector(".retry-upload");g(Ne,d,"The element not exist"),o.domEvents.addEventListener(d,"click",()=>{o.readonly||(g(Ne,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(s),this.setFullScreen()}renderProgress(e,o){g(Ne,this.mediaContainer,"The media element not exist");const r=this.mediaContainer.querySelector(":scope .media-progress"),i=e===-1||e===100?100:e;if(r){const{updateProgressElement:s}=this.options;s(r,i)}else{const{createProgressElement:s}=this.options,l=tt(this.mediaContainer);g(Ne,l,"The element not exist"),W(l,"media-block-uploading");const a=k("div",["media-progress"],null);s(a,i,o),this.updateMediaContent(a)}this.setFullScreen()}renderMediaElement(e){g(Ne,this.mediaContainer,"The media element not exist");const o=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:r,updateMediaElement:i,editor:s}=this.options,l=this.getResourceUrl(e.embedData.src);if(o){const a=i(s,o,e,l);this.unbindMediaEvent(),this.media=a,this.bindMediaEvent()}else{const a=k("div",["media-element"],null),d=r(s,a,e,l);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent(),this.updateMediaContent(a)}}renderEmpty(e){g(Ne,this.abstract,"no abstract"),g(Ne,this.mediaContainer,"The media element not exist");const o=k("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);o.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(o);const{editor:r}=this.options;r.findBlockById(e.id)&&this.emit("mediaError",r,"empty",e.id),this.setFullScreen()}getResourceUrl(e){const{editor:o}=this.options;return o.doc.buildResourceUrl(e)}setFullScreen(){g(Ne,this.mediaContainer,"The media element not exist"),W(this.mediaContainer,"full-screen")}removeFullScreen(){g(Ne,this.mediaContainer,"The media element not exist"),ot(this.mediaContainer,"full-screen")}updateBlockAlign(e,o){const r=tt(o);g(Ne,r,"The block element not exist");const{align:i}=e;e.embedType==="video"&&(r.hasAttribute("data-style-align")&&r.removeAttribute("data-style-align"),r.setAttribute("data-style-align",i))}render(e,o){const{src:r}=e.embedData;(!this.mediaContainer||!o.contains(this.mediaContainer))&&(this.mediaContainer=k("div",["media"],o)),this.updateBlockAlign(e,o),WG(r)?r===Hu.Empty&&this.renderEmpty(e):this.renderMediaElement(e)}setAbstract(e){this.abstract=e}}S("media-embed");const GG="left";class hk{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var p;const{containerId:o,blockIndex:r}=e;let i;(p=e.data)!=null&&p.file&&(i=e.data.file);const s=zG(t,this.embedType);if(i=i!=null?i:await Ul(s,{}),!i)return null;const{mediaType:l}=this.getAbstract();try{VG(i,t,l)}catch{return null}const a={id:K(),type:"embed",embedType:this.embedType,embedData:{src:Hu.Empty}};l==="video"&&(a.align=GG);const d=t.insertBlock(o,r,a);return await this.getMedia(t,a.id).handleUploadFile(i),d})}getMedia(t,e){const o=t.addCustom(`media-${e}`,()=>new qG({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return o.setAbstract({...this.getAbstract()}),o}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:o,order:r,group:i}=this.getAbstract();return{name:o,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:r,group:i,subText:An(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,o){const{id:r}=o;this.getMedia(t,r).render(o,e)}handleUpdateBlock(t,e,o){const{id:r}=o,i=this.getMedia(t,r),s=Lt(e);return i.render(o,s),!0}handleDeleteBlock(t,e){const o=e.id,r=this.getMedia(t,o);r.removeAllListeners(),r.destroy()}convertTo(t,e,o,r){const i=e.embedData,s=t.doc.buildResourceUrl(i.src,{withToken:!0});return r==="html"?`<${i.type} src="${s}" />`:r==="markdown"?`![${i.src}](${s})`:s}}function fk(n,t){const e=k("div",["uploading-progress-mask"],n),o=k("div",["uploading-progress-bar"],e),r=k("div",["uploading-progress-bar-value"],o);r.style.width=`${t}%`}function mk(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const ZG=S("media-audio");class QG extends hk{constructor(){super(...arguments);m(this,"embedType",qo.AUDIO);m(this,"updateProgressElement",mk);m(this,"createMediaElement",(e,o,r,i)=>{const s=k("div",["audio-container","embed-hover-content","embed-selected-content"],o),l=k("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=i,setTimeout(()=>{this.getMedia(e,r.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:RL,mediaName:L.t(`media.${qo.AUDIO}.menuItem`),menuItem:L.t(`media.${qo.AUDIO}.menuItem`),order:800,mediaType:qo.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${L.t(`media.${qo.AUDIO}.abstract`)}`}}updateMediaElement(e,o,r,i){const s=o.querySelector(":scope .audio-container > audio");return g(ZG,s,"The media element not exist"),s.src!==i&&(s.src=i),s}createProgressElement(e,o){const r=k("audio",[],e);r.innerHTML="Your browser does not support the <code>audio</code> element.",r.controls=!0,r.src="about:blank",fk(e,o)}}const YG=new QG;S("video-resizer");function gk(n){return n&&Me(n)&&fn(n)==="video"}const JG=50;class Z2{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&gk(e)&&this.disableBlockResize(e),t&&gk(t))){const o=this.getVideoElement(t);if(!o)return;this.enableBlockResize(t,o)}});m(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const o=t.getBlock();if(!o)return;const r=o.getBoundingClientRect().width,i=Math.min(Math.max(e.width,JG),r);this.currentResizableElement.style.width=`${i}px`,this.currentResizableElement.style.pointerEvents="none"});m(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const o=this.editor.getBlockData(e),{width:r}=this.currentResizableElement.getBoundingClientRect();this.currentResizableElement.style.pointerEvents="auto",this.editor.updateBlockData(e,{...o,width:r})});this.editor=t,Ce.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,Ce.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return Lt(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${it(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${it(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const o=this.editor.addCustom(`${it(t)}-resizer`,()=>new Eu(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));o.enableResize(t,e),o.removeListener("resizing",this.handleResizing),o.removeListener("resized",this.handleResized),o.addListener("resizing",this.handleResizing),o.addListener("resized",this.handleResized),this.currentResizableElement=e}}const KG=S("video");class XG extends hk{constructor(){super(...arguments);m(this,"embedType",qo.VIDEO);m(this,"updateProgressElement",mk);m(this,"createMediaElement",(e,o,r,i)=>{const s=k("div",["video-container","embed-selected-content","drag-preview-element"],o),l=k("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=i,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new Z2(e)),this.getMedia(e,r.id).removeListener("mediaError",this.handleMediaError),this.getMedia(e,r.id).addListener("mediaError",this.handleMediaError),this.getMedia(e,r.id).removeFullScreen()}),r.width&&(l.style.width=`${r.width}px`),l});m(this,"createProgressElement",(e,o,r)=>{const i=k("video",["progress-video"],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,fk(e,o),jl(r).then(s=>{const l=e.querySelector(".progress-video");l&&jm(e)&&(l.src=s)})})}getAbstract(){return{mediaName:L.t(`media.${qo.VIDEO}.menuItem`),mediaIcon:OL,menuItem:L.t(`media.${qo.VIDEO}.menuItem`),order:700,mediaType:qo.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`[${L.t(`media.${qo.VIDEO}.abstract`)}]`}}handleMediaError(e,o,r){const i=e.addCustom("video-resizer",()=>new Z2(e)),s=e.getBlockById(r);i.disableBlockResize(s)}updateMediaElement(e,o,r,i){const s=o.querySelector(":scope .video-container > video");g(KG,s,"The media element not exist"),s.src!==i&&(s.src=i),r.width?s.style.width=`${r.width}px`:s.style.width="";const l=e.getBlockById(r.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new Z2(e)).updateResizer(l)}),s}}const tZ=new XG,pk=[R0,z0,V0,I7],Q2=[ik,eq,aG,AG,xG,V_,FG,tZ,YG,LH,j8,tV],Ck=[N7,V8,d8];function eZ(n,t,e){var r,i,s;const o=ja(n,t,{components:{blocks:[...pk,...((r=e==null?void 0:e.components)==null?void 0:r.blocks)||[]],embeds:[...Q2,...((i=e.components)==null?void 0:i.embeds)||[]],boxes:[...Ck,...((s=e.components)==null?void 0:s.boxes)||[]],textRenders:[new C0],options:{...e.componentsOptions}}});return o.readonly=!0,o.addCustom("heading-collapse",()=>new _2(o)),o.addCustom("editor-tooltip",()=>new vf(o)),o.addListener("clickLink",(l,a,d)=>{var p;if((p=e==null?void 0:e.events)!=null&&p.onClickLink){e.events.onClickLink(l,a,d);return}const h=d.getAttribute("link");h&&(l.readonly||a.ctrlKey||a.metaKey)&&window.open(h,"_blank")}),o}class Ak{constructor(t){this.createOptions=t,t.lang&&L.setLang(t.lang)}createHistoryEditor(t,e){return eZ(t,e,this.createOptions)}}S("create-editor");function bk(n,{root:t,childDoc:e,doc:o}){var d,h;e.uploadResource=o.uploadResource.bind(o),e.buildResourceUrl=o.buildResourceUrl.bind(o);const r={image:{defaultAlign:"left"},toc:{showFirstBlock:!0},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0}},i=[];n.editorBlocks.forEach(p=>{p.blockType==="text"||p.blockType==="embed"||i.push(p)});const s=[];n.editorEmbeds.forEach(p=>{s.push(p)});const l=[];n.editorBoxes.forEach(p=>{p.boxType==="text"||p.boxType==="br"||p.boxType==="image"||p.boxType==="anchor"||l.push(p)});const a=ja(t,e,{shortcuts:[Rh],components:{blocks:i,commandProviders:[new ef],decorators:[new Tf],embeds:s,boxes:l,options:r}});if(a.input.addHandler(new Sf),a.input.addHandler(new u2(a)),a.input.addHandler(new g2(a)),a.input.addHandler(new iz(a)),a.input.addHandler(new Ff),a.addCustom("image-paste-handler",()=>new a2(a)),(d=n.options.componentsOptions)!=null&&d.mention){const p=n.options.componentsOptions.mention;a.addCustom("mention",()=>new z8(a,{...p,enableFirstBlock:!0}))}if((h=n.options.componentsOptions)!=null&&h.comment){const p=n.options.componentsOptions.comment;p.onCommentEditorClick&&a.addListener("click",p.onCommentEditorClick)}return a}function nZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),o=new Set;e.forEach(r=>{const i=tt(r);i&&o.add(i)}),o.forEach(r=>{sz(n,r,t)})}class oZ{constructor(t){m(this,"listeners",new Set);m(this,"doc");this.editor=t,this.doc=this.editor.doc.externalDoc,this.doc.registerCallback(this)}getComments(){return this.doc.getComments()}getComment(t){return this.doc.getComment(t)}getCommentDoc(t){return this.doc.getCommentDoc(t)}localCreateComment(t,e){this.doc.localCreateComment(t,e)}localDeleteComment(t){const e=this.getComment(t);this.doc.localDeleteComment(t);const o=e.groupId;this.getComments().filter(i=>i.groupId===o).length===0&&nZ(this.editor,o)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return bk(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class rZ{constructor(t,e){m(this,"listeners",new Set);this.editor=t,this.localDoc=e}get doc(){return this.localDoc.toJSON()}getComments(){return Object.values(this.doc.comments)}getComment(t){return this.doc.comments[t]}getCommentDoc(t){const e=this.doc.comments[t];return Ap(e)}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}localCreateComment(t,e){}localDeleteComment(t){}localUpdateComment(t,e){}createCommentEditor(t,e){return bk(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const iZ={placeholder:{common:{title:"\u8BF7\u8F93\u5165\u6807\u9898",readonlyTitle:"\u8BF7\u8F93\u5165\u6807\u9898",content:"\u70B9\u51FB + \uFF0C\u6216\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",contentInTable:"\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6"},local:{readonlyTitle:"\u672A\u547D\u540D"}},copyCutProperty:{copy:"\u590D\u5236",cut:"\u526A\u5207",unsafeEnvTips:"\u7531\u4E8E\u5F53\u524D http \u8BBF\u95EE\u73AF\u5883\u4E0B\u7684\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528\u5FEB\u6377\u952E({shortCut}) {operation}"}},sZ={placeholder:{common:{title:"Enter a title",readonlyTitle:"Enter a title",content:"Click + or enter / to insert components quickly",contentInTable:"Enter / to insert components quickly"},local:{readonlyTitle:"Untitled"}},copyCutProperty:{copy:"Copy",cut:"Cut",unsafeEnvTips:"Due to the limitations of the current http access environment, please use the shortcut ({shortCut}) {operation}"}},lZ={placeholder:{common:{title:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",readonlyTitle:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",content:"\u300C+\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u304B\u3001\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",contentInTable:"\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059"},local:{readonlyTitle:"\u7121\u984C"}},copyCutProperty:{copy:"\u8907\u88FD",cut:"\u5207\u308B",unsafeEnvTips:"HTTP\u74B0\u5883\u306E\u5236\u7D04\u306B\u3088\u308A\u3001{operation}\u3059\u308B\u306B\u306F\u3001\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8({shortCut}) \u3092\u3054\u4F7F\u7528\u304F\u3060\u3055\u3044"}};L.mergeLang({"zh-CN":iZ,"en-US":sZ,"ja-JP":lZ});const cZ="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0lMtqwzAQRfeF/oPRtsRKuiilxMmij2UbaArdKvI4EdULaZzH33fsJKYUJy5NsjHIM/feowHNcLw2OllCiMrZjA3SPkvASpcrO8/Yx/Sld8+SiMLmQjsLGdtAZOPR9dVwuvEQE1LbmLEFon/gPMoFGBFT58FSpXDBCKRjmHMv5JeYA7/t9++4dBbBYg8rDzYaPkEhSo3J85p+b0kC6MiSx21jlZUx4b1WUiDV+dLmv1J6u4SUlHVPXCgfb6iB8daEqnI4YKd7o9EElUMyEQFfhaEuvnIh57mTpSFletymhdMVhZLQ6Cs3H5yEGGnmRqcIxtMNIDVC2T1/G4csIzrzaTRXpJkE5+PgZJzGtPKDgAqaGR6chS3NDALRn38YjXUnRMSNhnh+gq1vdzwgkuASADvnToQVzN4vRvHDvBOkoNypmGk4P0Zj3QmBtIpg+z39VdQ2xyKps36AtNrCP669312Vuuf/9PKaRLI++X5QrcUc8pZsXi/60TcAAAD//wMAUEsDBBQABgAIAAAAIQAekRq37wAAAE4CAAALAAgCX3JlbHMvLnJlbHMgogQCKKAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArJLBasMwDEDvg/2D0b1R2sEYo04vY9DbGNkHCFtJTBPb2GrX/v082NgCXelhR8vS05PQenOcRnXglF3wGpZVDYq9Cdb5XsNb+7x4AJWFvKUxeNZw4gyb5vZm/cojSSnKg4tZFYrPGgaR+IiYzcAT5SpE9uWnC2kiKc/UYySzo55xVdf3mH4zoJkx1dZqSFt7B6o9Rb6GHbrOGX4KZj+xlzMtkI/C3rJdxFTqk7gyjWop9SwabDAvJZyRYqwKGvC80ep6o7+nxYmFLAmhCYkv+3xmXBJa/ueK5hk/Nu8hWbRf4W8bnF1B8wEAAP//AwBQSwMEFAAGAAgAAAAhADPCW79BAQAA5wQAABwACAF3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzIKIEASigAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArJQxT8MwEIV3JP5D5B07LVAQatoFkDqwQJFYneSSWI3tyL6Q9t9zojRNRYkYPN6z7r1P57Pny62uo09wXlmTsAmPWQQms7kyZcLe189X9yzyKE0ua2sgYTvwbLm4vJi/Qi2RmnylGh+Ri/EJqxCbByF8VoGWntsGDJ0U1mmJVLpSNDLbyBLENI5nwg092OLEM1rlCXOrnPLXuwb+422LQmXwaLNWg8EzEQKpF8hQuhIwYd/lXpxwMmPiPMN1SAaPu5qG2EPs67H4u5DxhTW4lmk9GEMvjUFMQ0KYVqfgaMeOEL00BjEJCZG1Hq3+oLQegvOjKhSCHl2LWUiaipxcrczmSPNj23UdT6XKW55ZLQ7HLzan5KctgjPyT8TbkIgdpG+ASHc0WN+BODarm6BP6BfFQTkgiJPvafEFAAD//wMAUEsDBBQABgAIAAAAIQBOMo6QFgYAAKYkAAARAAAAd29yZC9kb2N1bWVudC54bWzUWttu40QYvkfiHSJfLRKtz4eYTVeOD7uVQKoo+wCuPUmstT3WeNI0XC0XC1wguOBiuWClLgjBE4AEiIdZ0T28BTM+JM6h7cTZkm0vEnv+mW+++eb7/0yc3r13lsSdU4DyCKY9TtwXuA5IAxhG6bDHPfzM2zO4To79NPRjmIIeNwU5d+/g/ffuTswQBuMEpLhDINLcnGRBjxthnJk8nwcjkPj5fhIFCOZwgPcDmPBwMIgCwE8gCnlJEIXiKkMwAHlO5rP99NTPuQouOGNDC5E/IYMpoMIHIx9hcDbHEDcGUfkub6wCSS2AyAolcRVK3hhK4ymrFSClFRBhtYKktkNaszitHZK0iqS3Q5JXkYx2SCt2SlYNDjOQkuAAosTH5BYN+cRHj8bZHgHOfBydRHGEpwRT0GoYP0oftWBERs0QEjncGEHnExiCWA5rFNjjxig1q/F7s/GUulmOr97qEYhl/eUQpyoOxcp5BGKiBUzzUZTNMjxpi0aCoxrk9KpFnCZx3W+SiYzpcll5ckop54As9Cv9k7hkfjWiKDDsCIWYjWChsDhnzSQhLpxP3EqahrgiYwGpAaQVAC0AjAW/xjAqDD6YZyjFiRhTo8Ypd4XiRHNhRcY6tkymAZCDzSDUmkc+TRoryobb2fY+guNsjhZth3Y4L0ITehzYAKuyfzMl8+3IHI/8jNSmJDAPhylE/klMGBEzd4gfO8UO0FeyrfStuARnHVoIuANyfDmB4ZS+ZySimJmP/EPiHEV2dE+3La5oJcUf01a9+iOtJjkqhZ/2OEEQJE1z5FmTAwb+OMY04nUVRRfryFGjqZjwCBVvx3gaE4bmqR/3uAfAp2cukeNpDJVdYj8d1h1AuvfwmEb5KszPkMqX6tqDKc7JoFGUEi7Az7GVR35z4MTEBy/Pv3rz0w+0CZeBZZwrp6ajxIXBlMwaMT2l6wh9lUHMRcnejpjSDYrJoND2GksMGquOY+iu7exIY/m2ayyzaKwaqi4YNNd3obFy2zVWGDTW+7Il296uaoX6LmisMugkKIpouJqwI5202+5FjUFjTfQ8S7OMHWms33aNdQaNJd3qqoq8q5pq3HaNDRaNNcFzRafLoLGtaF2JdlzReDFSaFw1NTTeRMf1XBVLNcSux+KHnXOVBddQLEm6DVxVSxf6nubdPNfFPLNhCCqWdRxBOHARIj3wNCNf1YbIT46xj3CVi6WxA5jmMAb7MRzeWUqQtQhuGi6Mf/H4xxGIY/hhh3xbjMMXj5998BFDrsiSZnuiYjPoZLiC7fV3rVM+zTFI9uEY72eI1KA4baPWnZZyiYYu2oLFlK6u2C3OzqtyLURaytXME8Zvv//+9fOr8y8unj1lWKjqeroraMpWvliMFAutmoq9WDp9aJohGzrLN7o2M7asLrVj6MMbM8/8gBgqQyAH6BRwB5RlZ8l/1HgFrSO0NH29Wws7e5jGUQoa+zvbLgwuQ26YiBGX2SOvn39z8eWT0ik3tbAzvIzMuiuXbkRndSfW+1rRlb7nKExng00SeDuXXcK1qwiWJi99hmme4uiaRfNkJ1wXt2u78+Dr35+8+vPXJTeMSNVGxDuPOsiMyILRYahR/qMoxxBNSREuTbdox+vy4UGNem06MPB+8/0/L7/9ZdluM+JvV6SX539c/P0dg7eFru3alrhUs1VH6kuqPD/gULUcRVAdd51fFiM35m21L3ueJNOJGlwFQ1FFxZ0beQ3Xcrs3WkDV1FjA4qfrx8RZR4QYOSlko3JX0nFS9ozi07juJ8xih2HdVjy65mcDGlmyljCbK5rbf/H109fPf7u6FjfA2R5Rq47sCZq2JL/ueo5o2VfK//8oXf0g8K4rvcf0c4DrGX25v3TElmzV1foiLe47tfrGZf16xWbiLMlTh/yTCmauWA4CfDST+jopimUNjz8nwQnxhSQp9LmgOSLXqqFUWZoNP/EpIoYZaVfKLigajvD89gRiDJP5fQwGjegI+CEg8+oCfSRmDiDEjdvhGBe31XQBjKle1cmE9imaQxjcR/SnOJOeho4iHBCWslYM4ut1F5flD3P8/B+MDv4DAAD//wMAUEsDBBQABgAIAAAAIQC29GeY0gYAAMkgAAAVAAAAd29yZC90aGVtZS90aGVtZTEueG1s7FlLixtHEL4H8h+Guct6zehhrDXSSPJr1zbetYOPvVJrpq2eadHd2rUwhmCfcgkEnJBDDLnlEEIMMcTkkh9jsEmcH5HqHkkzLfXEj12DCbuCVT++qv66qrq6NHPh4v2YOkeYC8KSjls9V3EdnIzYmCRhx719MCy1XEdIlIwRZQnuuAss3Is7n392AZ2XEY6xA/KJOI86biTl7Hy5LEYwjMQ5NsMJzE0Yj5GELg/LY46OQW9My7VKpVGOEUlcJ0ExqL0xmZARdg6USndnpXxA4V8ihRoYUb6vVGNDQmPH06r6EgsRUO4cIdpxYZ0xOz7A96XrUCQkTHTciv5zyzsXymshKgtkc3JD/beUWwqMpzUtx8PDtaDn+V6ju9avAVRu4wbNQWPQWOvTADQawU5TLqbOZi3wltgcKG1adPeb/XrVwOf017fwXV99DLwGpU1vCz8cBpkNc6C06W/h/V671zf1a1DabGzhm5Vu32saeA2KKEmmW+iK36gHq92uIRNGL1vhbd8bNmtLeIYq56IrlU9kUazF6B7jQwBo5yJJEkcuZniCRoALECWHnDi7JIwg8GYoYQKGK7XKsFKH/+rj6Zb2KDqPUU46HRqJrSHFxxEjTmay414FrW4O8urFi5ePnr989PvLx49fPvp1ufa23GWUhHm5Nz9988/TL52/f/vxzZNv7XiRx7/+5avXf/z5X+qlQeu7Z6+fP3v1/dd//fzEAu9ydJiHH5AYC+c6PnZusRg2aFkAH/L3kziIEMlLdJNQoAQpGQt6ICMDfX2BKLLgeti04x0O6cIGvDS/ZxDej/hcEgvwWhQbwD3GaI9x656uqbXyVpgnoX1xPs/jbiF0ZFs72PDyYD6DuCc2lUGEDZo3KbgchTjB0lFzbIqxRewuIYZd98iIM8Em0rlLnB4iVpMckEMjmjKhyyQGvyxsBMHfhm327jg9Rm3q+/jIRMLZQNSmElPDjJfQXKLYyhjFNI/cRTKykdxf8JFhcCHB0yGmzBmMsRA2mRt8YdC9BmnG7vY9uohNJJdkakPuIsbyyD6bBhGKZ1bOJIny2CtiCiGKnJtMWkkw84SoPvgBJYXuvkOw4e63n+3bkIbsAaJm5tx2JDAzz+OCThC2Ke/y2EixXU6s0dGbh0Zo72JM0TEaY+zcvmLDs5lh84z01QiyymVss81VZMaq6idYQK2kihuLY4kwQnYfh6yAz95iI/EsUBIjXqT5+tQMmQFcdbE1XuloaqRSwtWhtZO4IWJjf4Vab0bICCvVF/Z4XXDDf+9yxkDm3gfI4PeWgcT+zrY5QNRYIAuYAwRVhi3dgojh/kxEHSctNrfKTcxDm7mhvFH0xCR5awW0Ufv4H6/2gQrj1Q9PLdjTqXfswJNUOkXJZLO+KcJtVjUB42Py6Rc1fTRPbmK4RyzQs5rmrKb539c0Ref5rJI5q2TOKhm7yEeoZLLiRT8CWj3o0Vriwqc+E0LpvlxQvCt02SPg7I+HMKg7Wmj9kGkWQXO5nIELOdJthzP5BZHRfoRmsExVrxCKpepQODMmoHDSw1bdaoLO4z02Tker1dVzTRBAMhuHwms1DmWaTEcbzewB3lq97oX6QeuKgJJ9HxK5xUwSdQuJ5mrwLST0zk6FRdvCoqXUF7LQX0uvwOXkIPVI3PdSRhBuENJj5adUfuXdU/d0kTHNbdcs22srrqfjaYNELtxMErkwjODy2Bw+ZV+3M5ca9JQptmk0Wx/D1yqJbOQGmpg95xjOXN0HNSM067gT+MkEzXgG+oTKVIiGSccdyaWhPySzzLiQfSSiFKan0v3HRGLuUBJDrOfdQJOMW7XWVHv8RMm1K5+e5fRX3sl4MsEjWTCSdWEuVWKdPSFYddgcSO9H42PnkM75LQSG8ptVZcAxEXJtzTHhueDOrLiRrpZH0Xjfkh1RRGcRWt4o+WSewnV7TSe3D810c1dmf7mZw1A56cS37tuF1EQuaRZcIOrWtOePj3fJ51hled9glabuzVzXXuW6olvi5BdCjlq2mEFNMbZQy0ZNaqdYEOSWW4dm0R1x2rfBZtSqC2JVV+re1ottdngPIr8P1eqcSqGpwq8WjoLVK8k0E+jRVXa5L505Jx33QcXvekHND0qVlj8oeXWvUmr53Xqp6/v16sCvVvq92kMwioziqp+uPYQf+3SxfG+vx7fe3cerUvvciMVlpuvgshbW7+6rteJ39w4Byzxo1IbtervXKLXr3WHJ6/dapXbQ6JX6jaDZH/YDv9UePnSdIw32uvXAawxapUY1CEpeo6Lot9qlplerdb1mtzXwug+Xtoadr75X5tW8dv4FAAD//wMAUEsDBBQABgAIAAAAIQDlI7CA9QMAAKALAAARAAAAd29yZC9zZXR0aW5ncy54bWy0Vttu2zgQfV9g/8HQ8zq6WHZsoU4R3zYp4nZRebHPlETZRHgRSMqu8/U7pETLu3ELp0VeEmrOzJkh53DoDx+/MdrbY6mI4FMvvAm8Hua5KAjfTr2/N6v+2OspjXiBqOB46h2x8j7e/f7bh0OisNbgpnpAwVXC8qm307pKfF/lO8yQuhEV5gCWQjKk4VNufYbkc131c8EqpElGKNFHPwqCkdfSiKlXS560FH1GcimUKLUJSURZkhy3/1yEvCZvE7IQec0w1zajLzGFGgRXO1Ipx8Z+lg3AnSPZ/2gTe0ad3yEMrtjuQcjiFHFNeSagkiLHSkGDGHUFEt4ljl8RnXLfQO52i5YKwsPArs4rH76NIHpFMMrxt7dxjFsOHyLPeUjxNp7RiYd0BxuOfq6YMwKF30YxdHWoI+t2pOg1PW6gJ5JJJJsb1DaY5cnjlguJMgrlQKN70Kuerc78hS2bf3YJOe/gIr8IwXqHpMIyBzXDFAgCzzdABtXBaFiIz0KntZSi5sUDRmD7LrwSQrcwKFCUqUYa8iZbiRjc/amXU4x4Q1/gEtVUb1CWalGB0x7B1m+jNnu+QxLlwJZWKAcdzwXXUlDnV5i0c5gjEmTeRtipYla1wqvlEzqKWp8haTOxgIEjBofznym0FgWMFAiV5PoumgBbTTg8L+H/iQRMWEkKvDFNSfWR4hVsJiUv+J4Xn2qlCTDaWfQLFfyoAMxN5i8go82xwiuMdA3H9k7JbGdWlFRrAqKQj7wAWb1bMlKWWEICAkJbg5yIFAd7zo1S3ysvKOwfcIZbPNiATJ9nQmvBHo7VDs761zpp9e+fyxme50K5xVe4YifXYBEHw8WyqdSgHRJEo9FicAkJV9Eyvr+EjJfBfDW7hMxm0WB+ewmZx6NJNLmILMPJ+GIFCyhiPL+IfHc/q0kc39qe+KcTYYl5dv+SbmWuVY81EXPEMklQb20eZt94ZPJ5RrjDMwzzFJ8jaZ05sN9vAMUQpStosANsc1hSEFUtcGnXdI3ktuNtPeRFK8y8TycuM26x/BMGZ9WgB4mq5ro4lzCO20jC9RNhzq7qLHVRHF6AMwim8Je9tOfUHc8h0SA/O3aekJWx9cW8P/9shIeR0veKoKn3sjOmRvlUpka1eI2qqhF/tg2nHiXbnQ5NmIavAn7S2Y9sG7VYZLGowewHys1mwbtddLbI2c78Bs426Gyxs8Wdbehsw842craRse1g3ElK+DPcQ7c09lJQKg64eOjwVyb3SuUERJAeWdY9PjcNRomCwVDBO6WFdNgfFgvjpBD5o3ls48Y+nIwXy8mg0XY4tO+btrMDjvYrLmdI4aJRt/tpffcvAAAA//8DAFBLAwQUAAYACAAAACEAQMH/8TkBAAAjAwAAFAAAAHdvcmQvd2ViU2V0dGluZ3MueG1snNJfT8IwEADwdxO/w9J36CCykIVBYgzGF2OifoDS3aCx7S294sBP720CYnhhvvT//XLXdrbYOZt8QiCDvhCjYSoS8BpL49eFeH9bDqYioah8qSx6KMQeSCzmtzezJm9g9Qox8klKWPGUO12ITYx1LiXpDThFQ6zB82aFwanI07CWToWPbT3Q6GoVzcpYE/dynKaZODDhGgWrymh4QL114GMXLwNYFtHTxtR01JprtAZDWQfUQMT1OPvjOWX8iRndXUDO6ICEVRxyMYeMOorDR2k3cvYXmPQDxhdApmHXz5geDMmR544p+znZyTHlmfO/ZM4Agn7E5JgH7V1bkdP509pjUCvLEr9RwtecdHDbcrZt1w35+Jx/LdbROPMFSwz3ARuCINtlZS02L8+PPJF/vvb8GwAA//8DAFBLAwQUAAYACAAAACEAOdtFTLkFAAAnWgAAEgAAAHdvcmQvbnVtYmVyaW5nLnhtbOyczW7qRhiG95V6D8j7xP8/oEOOwECV6rQ60knV9WAGsGKPrbGB0FV7Ke266q430EvpDfQWOuOxzZ9DbIMw5MwmDuP5Xs/3zjfDk0nCh48vvtdaQhy5AeoK8r0ktCBygomLZl3hp6fRnSW0ohigCfACBLvCGkbCx4dvv/mw6qCFP4aYdGwRDRR1VqHTFeZxHHZEMXLm0AfRve86OIiCaXzvBL4YTKeuA8VVgCeiIslS8l2IAwdGEdGxAVqCSEjlnJdyahMMViSYCmqiMwc4hi8bDbmyiC62RetQSKkhRDJU5EMptbKUIdJRHQhptYTIqA6U9HpKBckZ9ZSUQyWznpJ6qGTVUzooJ/+wwIMQInJzGmAfxOQlnok+wM+L8I4IhyB2x67nxmuiKRmZDHDRc40RkahcwVcnlRVM0Q8m0FMnmUrQFRYYddL4uzyeDr3D4tNLFoHL5M9CBoGz8CGKk8xFDD3iRYCiuRvmK9yvq0ZuzjOR5bEklr6X9VuFcsnl8tr2NGBWbgTLDD/13/fYyI8rylKJGaESeUSZIew+MxuJT6pw8+Ba1myZK5fcQDIB5UDAcGDJDT/TsFIN0dmsUKrjllwamQ6bFarjboyVS+5j+4PZEohgNQk9G0e09rcyCmenle13OFiEGzX3NLXHzSa0ojxQQSst/+0lGZ02mC9zEJK9yXc6jzMUYDD2yIhIMbdIPbaSGaBfybTSS/ItfGnRjUB4IPwCxlGMgRP/uPBbO68eSQERDiIiHQwJ/GDayFCnN40h7mMInmkXqoIiKt9ZAo+0jJS+ItuKINI7/sKL3U9wCb2ndQizPkmrR1tZr9gPveyeatvSUJE0dsdb0hsuuWTPSsaSdZZZL0JhIz9vHC88D8Z5/BN8yW/9++sfefv3TtbqwWnaPfyM6cVFNB3a3BU0hdrQmQM0S3iQviZ9xbwzTi+jAMURNTFyXFJgP5PelCCjJLpHLNpvcxGRn8ApIG6wx4+Tr25uJWuNfskalCRfMX2mmKSx75J8ukv//F7VJEu7nEkbO2T9bTuU0+3477e/q/ohK8alDDmevnqO9P+snL5hXUf6bJM7Mf2/qqavyNJ1pK83UvyKfrEt83j6RiPFr7QvthkeT99spPhV9Uq2PquR4lfNxrY+cQfg6DOO0p1ch+4Uua1LumWw/KvTXbsvGX1LS+O3p+sMdJc+r/xkXRPblYEZznY7dnC2Oz19znbV0udsx9mOsx1nuwunX5HtlDpsp2rKSB5ItdlOaxu2aitWbms+Xfzk7kIndzXW9OXwjsMchzkOc4Xpc5hroPg5zHGYuwWYU2vBXNvWTcsasvyLYW6+HmN38sMRpDN7pqbpmpabm09a4l0cek5XsI2BNVRNu8Y0hl/itZeP55MbxZ8BBjMMwnnhPH8FJ3y5rZakS0N5dAZ2fl9nfrlBw/5Is4b9s7x5XDM4VrWI7hepRZImtSVJYlUFUQxidwnP9JPGLcPmvkHMsjMbdMs4um8QazmzQbcMrPsGXccSuyKk3TfoOpbYFUHvvkHXscRuB4vpLl4HiwdqXxqw/KufcQ7aQ0Oib/2ZrfmEvv8zTn6ayU8z+WkmP818M31+mtlA8fPTTH6aeQvYRjG3Mrbplq0aZttm+VfHNsM2FG3YTk9Dt6frDNhWY7FybOPYtsmeYxvHNo5tHNsaTZ9jWwPFfzvYRk+8K2ObOVBHqmFpLP/q2NYb9CRTVtL47el679jGIe317DmkNVD6HNI4pHFI45DWaPoc0o5DGv2te3VIG/ZNc9QbsPyrQxrZGwzLlL/Kf/vgZ2sc2zi2cWx7M32ObQ0UP8c2jm1Xgm0owTWUffIKbdphtywjNZVDBWHsDbQwLPmf3VfC2BtPYVj2x+RFYQefD7gJM4+EsY2uMEw7EsY2iMKw5JMEXwljC6swLJvrojBWkIVhGcYlYezKIPrhfwAAAP//AwBQSwMEFAAGAAgAAAAhAPiVyO/8DgAA85kAAA8AAAB3b3JkL3N0eWxlcy54bWzsXd9zo0YSfr+q+x8oPSUPG/+QLTtbcVJr2T67btdxVt5L3eMIRhZnYHSA1uv89TczDAjUDKKHjuu8m6RqLQH9MczXX890A5qffvkSR95nnmahSM5GBz/sjzye+CIIk4ez0af7qzenIy/LWRKwSCT8bPTMs9EvP//9bz89vc3y54hnngRIsrexfzZa5vnq7d5e5i95zLIfxIoncudCpDHL5df0YS9m6eN69cYX8Yrl4TyMwvx573B/fzIyMGkfFLFYhD6/EP465kmu7fdSHklEkWTLcJWVaE990J5EGqxS4fMskxcdRwVezMKkgjk4AkBx6KciE4v8B3kxpkUaSpof7OtPcbQBOMYBHAKAic+/4DBODcaetKzjhAEOZ1LhhEENx60xNYCM4yCOy3Zkz7G6oth/e/OQiJTNI4kkOfJkN3saWP0rW6v+6I/y8J+lwwbCv+ALto7yTH1N71Lz1XzTf65Ekmfe01uW+WF4L9slweNQnuf6XZKFI7mHsyx/l4WsvvPSbFP7l+rAVks/y2ubz8MgHO2pk2Z/yJ2fWXQ2Ojwqt0xVIxrbIpY8lNt48mZ6W2/M2eiPpdk0l7hnI5a+mb1Thnvm2oq/tSteVd+Ko7a6R+pJqmtWiFzu5Yv3wn/kwSyXO85G++pUcuOnm7s0FKkU8tnoxx/NxhmPw+swCHhSOzBZhgH/fcmTTxkPNtt/u9JiNBt8sU7k5/HJRFMWZcHlF5+vlLTl3oSp3rtVBpE6eh1uTq7N/1uCHZg+a7Nfcqbim3ewDaGbj4I4VBZZ7WrbMddb166PQp1o/FInOnqpEx2/1IkmL3Wik5c60elLnUjD/JknCpOAfymECE8DUHfhWNSIxrGIDY1j0RIaxyIVNI5FCWgci6OjcSx+jMaxuCkCJxe+zQtrzj62eHs37u4xwg1395Dghrt7BHDD3R3w3XB3x3c33N3h3A13d/R2w90drPG4xVTLu5EyS/LBKlsIkSci517OvwxHY4nE0kkfDZ4a9HhKcpEEMEVkMwPxYDSf6e+7PUSL1H08z1U25omFtwgf1inPBjecJ595JLN2jwWBxCMETHm+Ti094uLTKV/wlCc+p3RsOtAoTLiXrOM5gW+u2AMZFk8C4u4rEUmCQuXQbJ0vlUhCAqeOmZ+K4U0TjCw+vA+z4X2lQLzzdRRxIqxbGhfTWMNzAw0zPDXQMMMzAw0zPDGocUbVRQaNqKcMGlGHGTSifiv8k6rfDBpRvxk0on4zaMP77T7MIx3i67OOg/61u2kkVJl+cDtm4UPC5ARg+HBjaqbeHUvZQ8pWS0+VkNth69eMPc+5CJ69e4oxrUKimtdrF5nKqw6T9fAObaBRiavCI5JXhUcksApvuMQ+yGmymqBd0+Qzs/U8bxWtRuol2hmL1sWEdrjaWD7cwzYCuArTjEwG7bAEHnyrprOKTorIt2nl8IZtsIbLajsqkTbPQBK0MhL+I00Yvn5e8VSmZY+Dka5EFIknHtAhzvJUFL5Wl/yhpqSX5C/j1ZJloc6VGhD9h/ryBr/3ga0GX9BdxMKEhrfLNzELI49uBnF9/+G9dy9WKs1UHUMDeC7yXMRkmKYS+N3vfP49TQPfySQ4eSa62ndE5SENNg0JBpkCSQRESHKaGSYhyRiq8f7Jn+eCpQEN2l3Ki2dqck6EOGPxqph0EGhLxsUnGX8IZkMa718sDVVdiEpU9yRgtbJhtp7/h/vDQ92t8EgqQ7+uc11/1FNdbU0HN3ya0IAbPkXQbMrhQfkvwcU24IZfbAOO6mKnEcuy0HoL1RmP6nJLPOrrHZ78GTwRiXSxjug6sAQk68ESkKwLRbSOk4zyijUe4QVrPOrrJXQZjUdQktN4/0jDgIwMDUbFhAajokGDUXGgwUgJGP6ETg1s+GM6NbDhz+oUYERTgBoYlZ+RDv9Ed3lqYFR+psGo/EyDUfmZBqPys/GFxxcLOQmmG2JqkFQ+V4OkG2iSnMcrkbL0mQjyMuIPjKBAWqDdpWKhXrYQSfEQNwGkqlFHhJPtAo6K5N/5nKxpCouyXQQVURZFQhDV1jYDjrZsPru2y0y/czG4CXcR8/lSRAFPLddkt5X58mzFfFOmB7f7epU934cPy9ybLatqfx1msr/TskzYG2a7T9jW55PDDrMPPAjXcdlQ+DLFZNzfWHt0w7h856XDeDOTaFge97SE55zsttzMkhuWJz0t4TlPe1pqnTYsu/RwwdLHVkc46fKfKsezON9JlxdVxq2n7XKkyrLNBU+6vKghFe+d76u7BZCdfpqx2/cTj90eoyI7CkZOdpTeurJDdAnsI/8cqpEdEzT1+aqnJ0Dc15PoXpHzt7Uo6vaNG079X+q6kROnJONeK864/42rRpSx92PvcGOH6B137BC9A5AdolckspqjQpIdpXdsskP0DlJ2CHS0giMCLlpBe1y0gvYu0QqiuESrAbMAO0Tv6YAdAi1UCIEW6oCZgh0CJVRg7iRUiIIWKoRACxVCoIUKJ2A4oUJ7nFChvYtQIYqLUCEKWqgQAi1UCIEWKoRACxVCoIXqOLe3mjsJFaKghQoh0EKFEGih6vniAKFCe5xQob2LUCGKi1AhClqoEAItVAiBFiqEQAsVQqCFCiFQQgXmTkKFKGihQgi0UCEEWqjFq4buQoX2OKFCexehQhQXoUIUtFAhBFqoEAItVAiBFiqEQAsVQqCECsydhApR0EKFEGihQgi0UPXNwgFChfY4oUJ7F6FCFBehQhS0UCEEWqgQAi1UCIEWKoRACxVCoIQKzJ2EClHQQoUQaKFCiC7/NLcobY/ZH+CrntYn9vvfujKN+lh/lbsONe4PVbbKjtX/XYRzIR691hcPxzrf6AcSzqNQ6BK15bZ6HVc/EoG68fnrtPsNnzr6wB9dMu9C6HumAPyoryWoqRx1uXzdEiR5R12eXrcEs86jruhbtwTD4FFX0NW6LB9KkcMRMO4KMzXjA4t5V7SumcMu7orRNUPYw12RuWYIO7grHtcMjz0VnLetj3v206R6vhQgdLljDeHEjtDllpCrMhxDYfQlzY7Qlz07Ql8a7QgoPq0weGLtUGiG7VBuVEOZYal2F6odAUs1RHCiGsC4Uw2hnKmGUG5Uw8CIpRoiYKl2D852BCeqAYw71RDKmWoI5UY1HMqwVEMELNUQAUv1wAHZCuNONYRyphpCuVENJ3dYqiEClmqIgKUaIjhRDWDcqYZQzlRDKDeqQZaMphoiYKmGCFiqIYIT1QDGnWoI5Uw1hOqiWldRGlSjGK6Z4yZhNUPcgFwzxAXnmqFDtlSzdsyWagiO2RLkquQcly3VSbMj9GXPjtCXRjsCik8rDJ5YOxSaYTuUG9W4bKmNaneh2hGwVOOyJSvVuGypk2pcttRJNS5bslONy5baqMZlS21UuwdnO4IT1bhsqZNqXLbUSTUuW7JTjcuW2qjGZUttVOOypTaqBw7IVhh3qnHZUifVuGzJTjUuW2qjGpcttVGNy5baqMZlS1aqcdlSJ9W4bKmTaly2ZKcaly21UY3LltqoxmVLbVTjsiUr1bhsqZNqXLbUSTUuW/ogTUKCn4CaxSzNPbrfi7tm2TJnw3+c8FOS8kxEn3ng0V7qe9RV7j01lr9S2Hq1O3l8LvtM/QJ67XWloPgFWAOoD7wJqmWqlLFqiWeW7jKbdYPN7Vr9Oc1kTm2O2d8/Pz8cT43UVsXSZFnxZqk8Rv1a0dloPNGvJKkvH9dqDTS2zoVpvTbZM43Z0fyqweb+8wFo8mbBLN2eOZM99avqYXBBifqxxZbtysnK7eVppkuWFns37l8eYwRu75+Lo/3ji8tG/zxyvrqV59fb1BfJOc/0t03XzdXvlHG1qJoRvyh+/On956gCr/ehZWE4qcRyrTrv3+yaNxaGa92pV4Vr3eNnZ6P7MOaZd8ufvI8iZon3nemkzJvOvje9rv/1VfjYdIP6T2HodeV0aDkbqd+9N0xtFpYrb5TXF5Yb60hTWx/OxVsOrd5i4hiNtxz28JamlP9kB7L7TxlBvir/GZuJQ2NhQr1toP+Mrf5jHgqh8Z/x6/GfUpVfl/9QxJojq6+Y6EbjK0evx1e0Rv5ffSWcFhfk7DPlSDzEZ46tPmMeAKPxmePX4zNaK19DfBnoGcUKs22eYcY6Gs+YvB7P0Ir4yzMeTqyeYTIyGs84eT2eUc70vppxZqCHnFo9xBS3aDzk9PV4iFbGq4gdhyfq/3bPKDfeh2oV8gtDZiPp6ek+vmSO+eYnxy0VIrN0UPXbN3rhoG3HsqwvZHGKchJVlbnafcTe7lzVKTvarOuYnaWtotRp9VrjtrtaKNszjwonkh9uEuXET2aV96KlwRdWQMn9Ux5FH1hxtFjZD434QmlP7j3Y1780ubV/XiyaYLVPdXXdCrDXbEzxtdtPimUUw+K1D2slUZWQW7pbv4M0tKd7+rC/zmTXzNQB2+1rVPS2W2l2egfeJphtRcdWHdhiovFwazy0B7y/KnlIQouim43QQyJCTZ3wmyV0SGkNSWhRBbMROiYi1BTuvl1C/xw1FmUpG3lHROSZ6PLqyXup4hOSxKJOZCPxmIhEU9r6phRITlVRuLFRNSGiygT/v6gaQlVRSbFRdUJElSn+fJOhkZyyorRho+yUiDKTwH9d6nqZAkaj/tXBp17ibptHvbGNvX5Pv5xe7k+vzoujTEFpdR7U0nt9nFoI2qyb9oe6raE+rJhftlD32eapmCr532GrPwPbqjDgdOaybOBwalVSM5eeLasu8iPOCqHVjpZfF2Ek916eXE4u9YNl2heu9MY58x8fUrFOgn43mKciyUTE9O+BbFx8FsaztX4oy3h2/bBWl9aLsFbuHDFdT9QXwZM3n2a0weUmUWXJVpes7cKFFWuRrZ//EnVv0eagCgKJSCof0mHb+JD+DByQ1HVoWNwMCNVTiNuUbfYMZayshbWUGZvMTS8Pfjw1CaxhrjlMHk/G002YNbF32WzoujzaSH1A52weiCyfh9zupJZHJql6a3eNFtd5k/3jy+Mp1iMPLq4uLhzGrKoPVZF08/vy2/2nn87d7G7ru/qgBXtrbFJm1F2XZB0XH8Jo68kfve+msi5Ha2MAwnZPKZafsp//BwAA//8DAFBLAwQUAAYACAAAACEAzJJQVH0BAADxAgAAEQAIAWRvY1Byb3BzL2NvcmUueG1sIKIEASigAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjJLLTsMwEEX3SPxD5H1qJ+WlKE3FQ6yoQKIViJ2xJ60hsS17IPTvcZI2JYgFO4/n+GRy7Xz+VVfRJzivjJ6RZMJIBFoYqfR6RlbL2/iCRB65lrwyGmZkC57Mi+OjXNhMGAcPzlhwqMBHwaR9JuyMbBBtRqkXG6i5nwRCh2ZpXM0xlG5NLRfvfA00ZeyM1oBccuS0FcZ2MJKdUopBaT9c1QmkoFBBDRo9TSYJPbAIrvZ/Hug6P8ha4dbCn+i+OdBfXg1g0zSTZtqhYf6EPi/uHrtfjZVusxJAilyKDBVWUOT0sAwr//H6BgL77aEIa+GAo3HFQglnvCkxui9LJSBaeXAdvSfa7N9h2xgnffCMqoBJ8MIpi+FG+6+MNgJdcY+LcMWlAnm1LS5Pz9OzTvOr0bIOPlX7NoqkI4Yy3wXdDwUyCgFlfZz7ztP0+mZ5S4qUpUnMTuIpW7I0O00zxl7auUbnD8J6N8A/jdOMnYyNe0EfzfiRFt8AAAD//wMAUEsDBBQABgAIAAAAIQAiURHx1QEAAN4DAAAQAAgBZG9jUHJvcHMvYXBwLnhtbCCiBAEooAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJxTwW7bMAy9D9g/GLo3crKh6AJFxZBi6GFDA8Rtz5xMJ8JsSZDYINnXj7YTT9l2mk/vkfTTE0mp+2PXFgeMyXq3EvNZKQp0xtfW7VbiufpycyeKROBqaL3DlThhEvf6/Tu1iT5gJIupYAmXVmJPFJZSJrPHDtKM044zjY8dENO4k75prMEHb946dCQXZXkr8UjoaqxvwiQoRsXlgf5XtPam95deqlNgPa0q7EILhJrOYFZ7Oio5xVXlCdrKdqjnJccnpjaww6TnSo5AvfpYJ724U3JEar2HCIa4h3p++0HJjKvPIbTWAHF39Tdrok++oeJpsFz0/yuZlyi+xhbNW7R00mwjp+qrdaOREbCxCLsIYX92NzG1NdDimhugG2gTKvk7oB4R+uFuwPb+DrQ8oCEfi2R/8ngXovgOCfu2rcQBogVHYiwbyYDbkCjqylLL2hMfYF6WY/uxNzmC68KBDB4YX7sbTkhPDd+N/mF2npsdPIxWMzu5s8sZf6iufRfAcX/lhLjBP9JzqPxDvxrnHl4Hs6m/WtpvA5h+OJ/KfP5ZRm05ijUPdJrJFFCPfIPY9vr8r9thfan5O9Fv1Mv4XHnbZiV/wwpdYrwI0zvSvwAAAP//AwBQSwMEFAAGAAgAAAAhAIg/pb/hAAAAVQEAABgAKABjdXN0b21YbWwvaXRlbVByb3BzMS54bWwgoiQAKKAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJDBasMwEETvhf6D2bsiObFdEyyHuE4g19JCroq8tgWWZCS5tJT+e2V6So89LbPDzhu2OnzoKXlH55U1HNINgwSNtJ0yA4e31zMpIfFBmE5M1iAHY+FQPz5Und93IggfrMNLQJ3EhYrz0nL4ykvW5E87Rsr2nJLilDXkmKUNKTKWt8fnU8pY8Q1JRJsY4zmMIcx7Sr0cUQu/sTOaaPbWaRGidAO1fa8ktlYuGk2g25hA5RLx+qonqNc+v9cv2Pt7uVZbnPov5aZuk7KDE/P4CbSu6B/Uqu9eUf8AAAD//wMAUEsDBBQABgAIAAAAIQDBJ8sItgAAACEBAAATACgAY3VzdG9tWG1sL2l0ZW0xLnhtbCCiJAAooCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACskE0OgjAQRq9CegCKLlgQfmKiWzEhcV/KAE3aGdIOBm5v1egJXE7mfS/zTdlsziYP8MEQVuKQZiIJrHBQlhAqgSSauuyLjlavISSRxlD0lZiZl0LKoGdwKqS0AMbdSN4pjqOfJI2j0XAmvTpAlscsy2Vvemto8mqZd/GR/UfVgQXNMHS823i2PN1Ondl4vgyGY7P2LWjRGoR0CzYGXuBVuQhHViT37wtyUZfyV7h+AgAA//8DAFBLAwQUAAYACAAAACEAdD85esIAAAAoAQAAHgAIAWN1c3RvbVhtbC9fcmVscy9pdGVtMS54bWwucmVscyCiBAEooAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIzPsYrDMAwG4P3g3sFob5zcUMoRp0spdDtKDroaR0lMY8tYamnfvuamK3ToKIn/+1G7vYVFXTGzp2igqWpQGB0NPk4Gfvv9agOKxcbBLhTRwB0Ztt3nR3vExUoJ8ewTq6JENjCLpG+t2c0YLFeUMJbLSDlYKWOedLLubCfUX3W91vm/Ad2TqQ6DgXwYGlD9PeE7No2jd7gjdwkY5UWFdhcWCqew/GQqjaq3eUIx4AXD36qpigm6a/XTf90DAAD//wMAUEsDBBQABgAIAAAAIQDrgGBMUwMAAI8OAAASAAAAd29yZC9mb250VGFibGUueG1szJbPb9MwFMfvSPwPUU7jwJqkXZdV66Y2WzQk2IEVAUc3cVqL2I7itF3/AA6IE+LI38C4gwb/DNPYf8FznLRZm25LQbBGzY9n+5vnT57f8+7+KQ21MY4F4aytm5uGrmHmcZ+wQVt/0XMf27omEsR8FHKG2/oUC31/7+GD3Ukr4CwRGoxnokW9tj5MkqhVqwlviCkSmzzCDBoDHlOUwGM8qFEUvxlFjz1OI5SQPglJMq1ZhtHUM5n4Lio8CIiHD7g3opgl6fhajENQ5EwMSSRytcld1CY89qOYe1gImDMNlR5FhM1kzMaSECVezAUPkk2YTOZRKgXDTSO9o+FcYKuagLUk0PTwaTUNO9OowciiDvGr6TRnOsQv6KznTEFA4GoSW7kfYkrljKjXejJgPEb9EJTgG2mAWUuF5Rm8lZf0FrrvZfGqTVoMURjwEj62DHKRNkWIcYFNaB2jsK0bW8bST6/Jjt4QxQJLmbRj40CZA0RJOM2tPvbAr4SMsWqNSOIN88Yxion0WTUJMoCGkegb8Fb1q+vKYsJyzN+tLNasT26pX7d4qY6tDGZmMQt94J01BWIJSI9QLLRjPNGec4pYKRYLjqZRBzwN+Ftw1yjFktO6jiVOdasQgaVoWB17e04km9syEfsmIoqH61Yj4qCQ9GOygoSbEpBHAzhYlUiICRGiEomOdNY6TGegSDSkwdjuVosN9bxTkcQBZoNXJAsKFCbHYM19vvz87vLrj2wyS5RMiBcIabhmRyklu1lGCY0SvgakbgFS3XbcbcftLEIym7dAknQrQnqWZy/tNTrCKmwWWF18P/t1/uXq09urbx9WEetCXMl4knGVnisQqx5X6XqyiivM6jhu3dmy1kFmVkS2kHO0jSOM0qSsOSePygAuJqmVDJsZvWyF/oUs5eMAjcLkxoQB+w8eovKSorzaWTNjUO7juMytgJxif/m7HsrSYamMN88XrjOzzPPFzu2Zs2q+OCH0ZFSaLS7O3v88/3gvskU2j0K5tWzbzadfOVv8WbnVNrrcn96PsGc86cUj3JtGeK1lkFcL7SkZDJPVNSNrvw+x8H8rR7bRKPAq226oovBvthuHEkenmD4caWmUbDfukD5u3XhlN2LvNwAAAP//AwBQSwECLQAUAAYACAAAACEAZPVj7oEBAAApBgAAEwAAAAAAAAAAAAAAAAAAAAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAIAAAAIQAekRq37wAAAE4CAAALAAAAAAAAAAAAAAAAALoDAABfcmVscy8ucmVsc1BLAQItABQABgAIAAAAIQAzwlu/QQEAAOcEAAAcAAAAAAAAAAAAAAAAANoGAAB3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAE4yjpAWBgAApiQAABEAAAAAAAAAAAAAAAAAXQkAAHdvcmQvZG9jdW1lbnQueG1sUEsBAi0AFAAGAAgAAAAhALb0Z5jSBgAAySAAABUAAAAAAAAAAAAAAAAAog8AAHdvcmQvdGhlbWUvdGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQDlI7CA9QMAAKALAAARAAAAAAAAAAAAAAAAAKcWAAB3b3JkL3NldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQBAwf/xOQEAACMDAAAUAAAAAAAAAAAAAAAAAMsaAAB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQA520VMuQUAACdaAAASAAAAAAAAAAAAAAAAADYcAAB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEA+JXI7/wOAADzmQAADwAAAAAAAAAAAAAAAAAfIgAAd29yZC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhAMySUFR9AQAA8QIAABEAAAAAAAAAAAAAAAAASDEAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhACJREfHVAQAA3gMAABAAAAAAAAAAAAAAAAAA/DMAAGRvY1Byb3BzL2FwcC54bWxQSwECLQAUAAYACAAAACEAiD+lv+EAAABVAQAAGAAAAAAAAAAAAAAAAAAHNwAAY3VzdG9tWG1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",aZ=()=>Tm(cZ);async function uZ(n){return new Promise((t,e)=>{const o=new Image;o.onload=()=>{t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=e,o.src=n})}async function vk(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};const e=await jl(new File([t],"",{})),o=await uZ(e);return o.width===void 0||o.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||o.width*n.height/o.height,height:n.height||o.height*n.width/o.width,buffer:t}:{width:o.width,height:o.height,buffer:t}}function dZ(n,t){let e=n.filter(s=>s!=null);const o=t-(e.length-1)*20,r=.87,i=e.reduce((s,l)=>s+l.width,0);return i>o&&(e=e.map(s=>({width:s.width*o/i,height:s.height*o/i,buffer:s.buffer}))),e.map(s=>({width:s.width*r,height:s.height*r,buffer:s.buffer}))}function yk(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let o;switch(e%3){case 0:o=gt.LevelFormat.DECIMAL;break;case 1:o=gt.LevelFormat.LOWER_LETTER;break;default:o=gt.LevelFormat.LOWER_ROMAN;break}return{level:e,format:o,text:`%${e+1}. `,alignment:gt.AlignmentType.START,start:t,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(e+1)),hanging:gt.convertInchesToTwip(.2)}}}}})}function hZ(){return[0,1,2,3,4,5,6,7].map(n=>{let t;switch(n%3){case 0:t="\u2022";break;case 1:t="\u25E6";break;default:t="\u25AA";break}return{level:n,format:gt.LevelFormat.BULLET,text:t,alignment:gt.AlignmentType.START,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(n+1)),hanging:gt.convertInchesToTwip(.2)}}}}})}function fZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:gt.LevelFormat.BULLET,text:"\u2611",alignment:gt.AlignmentType.START,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(n+1)),hanging:gt.convertInchesToTwip(.2)}}}}))}function mZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:gt.LevelFormat.BULLET,text:"\u2610",alignment:gt.AlignmentType.START,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(n+1)),hanging:gt.convertInchesToTwip(.2)}}}}))}var ju=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(ju||{});const gZ=[{levels:yk(),reference:"number-numbering-reference"},{levels:hZ(),reference:"number-bullet-reference"},{levels:fZ(),reference:"checked-bullet-reference"},{levels:mZ(),reference:"unchecked-bullet-reference"}];function pZ(n){switch(n){case"style-color-0":return"d83931";case"style-color-1":return"de7802";case"style-color-2":return"dc9b04";case"style-color-3":return"2ea121";case"style-color-4":return"245bdb";case"style-color-5":return"6425d0";case"style-color-6":return"8f959e";default:return}}function CZ(n){switch(n){case"style-bg-color-1":case"style-bg-color-2":case"style-bg-color-8":case"style-bg-color-9":return"yellow";case"style-bg-color-0":case"style-bg-color-5":return"magenta";case"style-bg-color-3":return"green";case"style-bg-color-4":case"style-bg-color-11":return"blue";case"style-bg-color-6":return"lightGray";case"style-bg-color-7":return"red";case"style-bg-color-10":return"darkGreen";case"style-bg-color-12":return"darkMagenta";case"style-bg-color-13":return"darkGray";default:return}}function AZ(n){switch(n){case"style-bg-color-0":return"fbbab6";case"style-bg-color-1":return"ffdcb0";case"style-bg-color-2":return"fff7a0";case"style-bg-color-3":return"ceefc5";case"style-bg-color-4":return"d1ddfb";case"style-bg-color-5":return"d9cbf8";case"style-bg-color-6":return"eaeaea";case"style-bg-color-7":return"fe837c";case"style-bg-color-8":return"ffbd6a";case"style-bg-color-9":return"ffe662";case"style-bg-color-10":return"a8f393";case"style-bg-color-11":return"98b5ff";case"style-bg-color-12":return"b394f8";case"style-bg-color-13":return"b1b1b1";default:return}}const bZ=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function kk(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(bZ);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},o=e(t[1]),r=e(t[2]),i=e(t[3]);return`${o}${r}${i}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function tn(n,t){if(n&&n.attributes&&n.attributes[t])return n.attributes[t];if(n&&n.attributes&&n.attributes.box&&n.attributes.inputType&&t==="style-underline")return!0}function wk(n,t,e){for(let o=0;o<=e;++o){const r=`${t}${o}`;if(tn(n,r))return r}}function i1(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function Y2(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function Bk(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function vZ(n){const t=tn(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const o of e){const r=o.split(":");if(r.length!==2)continue;const i=r[0].trim().toLowerCase(),s=r[1].trim().toLowerCase();i==="font-size"&&i1(n,"inline-style-font-size",s),i==="color"&&i1(n,"inline-style-color",s),i==="background-color"&&i1(n,"inline-style-background-color",s),i==="font-family"&&i1(n,"inline-style-font-family",s)}}function yZ(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function kZ(n){const t=`${tn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function wZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` ${n.attributes.text} `;if(n.attributes&&n.attributes.box&&n.attributes.inputType)return n.attributes.value?`${n.attributes.value}`:" "}function BZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function EZ(n){return tn(n,"inline-style-font-family")}function xZ(n){const t=tn(n,"inline-style-background-color");return kk(t)}function IZ(n){const t=tn(n,"inline-style-color");return kk(t)}function TZ(n){vZ(n);const t=tn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!tn(n,"style-code"),link:Bk(tn(n,"link")),size:kZ(n),text:t?BZ(n):wZ(n)||n.insert,bold:!!tn(n,"style-bold"),underline:!!tn(n,"style-underline"),italics:!!tn(n,"style-italic"),strike:!!tn(n,"style-strikethrough"),superScript:!!tn(n,"style-super"),subScript:!!tn(n,"style-sub"),math:tn(n,"type")==="math"?tn(n,"src"):void 0,mention:t,fontFamily:EZ(n),background:xZ(n),color:t?"338fe5":pZ(wk(n,"style-color-",6))||IZ(n),highlight:wk(n,"style-bg-color-",13)}}function DZ(){return[new gt.Paragraph({border:{top:{color:"auto",style:gt.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new gt.Paragraph({spacing:{line:0}})]}function SZ(){return new gt.Paragraph({children:[new gt.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function LZ(){return new gt.Paragraph({children:[new gt.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function MZ(n,t){return new gt.Paragraph({children:[new gt.ExternalHyperlink({children:[new gt.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function Ek(n){if(n.heading!=null)return`Heading${n.heading}`}function xk(n){if(n.alignment!=null){if(n.alignment==="center")return gt.AlignmentType.CENTER;if(n.alignment==="right")return gt.AlignmentType.RIGHT;if(n.alignment==="left")return gt.AlignmentType.LEFT}}function RZ(n){if(n.indent)return{left:gt.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:gt.convertInchesToTwip(.3*n.padding)}}function OZ(n){return{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function _Z(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function Ik(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const o=n.size||t,r=o!=null?Math.floor(o*1.5+.5):void 0;return new gt.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:gt.UnderlineType.SINGLE}:void 0,italics:n.italics||void 0,strike:n.strike||void 0,superScript:n.superScript||void 0,subScript:n.subScript||void 0,size:r,style:e,font:n.fontFamily?_Z(n.fontFamily):void 0,shading:n.background?OZ(n.background):void 0,color:n.color,highlight:CZ(n.highlight)})}function FZ(n,t){if(n.link)return new gt.ExternalHyperlink({children:[Ik(n,t)],link:n.link})}async function Tk(n,t,e,o,r){const i=await r(n,t,e);if(i==null)return;const s=await vk({width:o||0,height:0,src:e},i);return new gt.ImageRun({data:i,transformation:{width:s.width||100,height:s.height||20}})}function PZ(n){if(n.heading||n.heading)return n.heading}function NZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function $Z(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function HZ(n,t){var o;const e=[];if(n.text&&Array.isArray(n.text)){for(let r=0;r<n.text.length;r++){const i=n.text[r];if(((o=i.attributes)==null?void 0:o.box)===!0&&t){const s=await t(i);if(s){n.text.splice(r+1,0,...s);continue}}e.push(TZ(i))}return e}}function jZ(n){if(n.type==="list"&&n.textOnly!==!0)return{checkbox:n.checkbox,groupId:n.groupId,ordered:!!n.ordered,level:n.level||1,start:n.start||0}}function UZ(n,t){if(n.type==="embed"&&n.embedType&&Y2(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(o=>{const r=t(o),i=n.embedData[`${r}_width`],s=n.embedData[`${r}_height`];return{src:o,width:i,height:s}})}function zZ(n){if(n.padding)return n.padding}function VZ(n){return!!(n.type==="embed"&&n.embedType&&Y2(n.embedType)&&n.embedData&&n.embedData.src)}async function s1(n,t,e){return{quoted:!!n.quoted,heading:PZ(n),alignment:NZ(n),indent:$Z(n),padding:zZ(n),texts:await HZ(n,e),list:jZ(n),images:UZ(n,t),border:VZ(n)}}async function WZ(n,t,e,o){const r=[];if(!n.children)return[];for(const i of n.children){const s=[];for(const l of t.blocks[i])s.push(await s1(l,e,o));r.push(s)}return r}const qZ=S("to-docx");function GZ(n,t){return Array(n).fill(0).map(()=>Array(t).fill(0).map(()=>({cellId:void 0,color:void 0,from:void 0,rowSpan:1,colSpan:1,width:0,originalWidth:void 0,align:void 0})))}function ZZ(n,t,e,o){const r=!!n.hasColTitle,i=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let a=0;a<t;a++)for(let d=0;d<e;d++)(r&&d===0||i&&a===0||s&&a%2===1)&&(o[a][d].color=l)}function QZ(n){g(qZ,n.children,"no table children");const t=n.rows,e=n.cols,o=n.colsWidth;if(o)for(let s=0;s<o.length;s++)o[s]===0&&(o[s]=100);const r=GZ(t,e);let i=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(r[s][l].originalWidth=o?o[l]:void 0,r[s][l].from!==void 0)continue;const a=n.children[i];i+=1,r[s][l].cellId=a,r[s][l].color=AZ(n[`${a}_background`]),r[s][l].width=o?o[l]:100,r[s][l].align=n[`${a}_align`];const d=n[`${a}_rowSpan`]||1,h=n[`${a}_colSpan`]||1;if(r[s][l].rowSpan=d,r[s][l].colSpan=h,d>1||h>1){let p=0;for(let A=0;A<d;A++)for(let v=0;v<h;v++)A===0&&(p+=o?o[l+v]:80),!(A===0&&v===0)&&(r[s+A][l+v].from=[s,l]);r[s][l].width=p}}return ZZ(n,t,e,r),r}async function YZ(n,t,e,o,r,i,s,l,a,d){async function h(v){if(l){const B=await l(r,i,v);if(B){await o.addDoc(n,B,d);return}}if(v.type==="text"||v.textOnly===!0){const B=await s1(v,s,a);await o.addTextBlock(B);return}if(v.type==="code"){const B=await WZ(v,e,s,a);await o.addCodeBlockObject(B);return}if(v.type==="list"&&v.textOnly!==!0){const B=await s1(v,s,a);await o.addListBlockObject(n,B);return}if(v.type==="embed"&&v.embedType){const B=v,D=B.embedData,x=B.embedType;if(Y2(x)){const _=await s1(v,s,a);await o.addImagesBlockObject(v,_,d)}else v.embedType==="hr"?o.addSeparatorBlock():v.embedType==="video"?o.addVideoPlaceholder():v.embedType==="audio"?o.addAudioPlaceholder():v.embedType==="webpage"?o.addHyperlinkParagraph(Bk(D.src),D.title):o.addOtherEmbedBlock(x,v.embedData);return}if(v.type==="table"){let B=[];if(v.colsWidth)B=v.colsWidth;else{const x=v.cols;B=new Array(x);for(let _=0;_<B.length;_++)B[_]=100;v.colsWidth=B}const D=QZ(v);await o.addTableMatrix(B,D,e),o.addEmptyParagraph()}}function p(v){const B=[];for(const{type:D,data:x}of v.embedData.exportSpec){if(D==="text"){const _={id:K(),text:[{insert:x}],type:"text"};B.push(_);continue}if(D==="image"){const _={id:K(),type:"embed",embedType:"image",align:"left",embedData:{src:x}};B.push(_);continue}if(D==="link"){const _={id:K(),type:"embed",embedType:"webpage",embedData:{src:x.url,title:x.title}};B.push(_);continue}}return B}function A(v){var B;return(B=v==null?void 0:v.embedData)!=null&&B.exportSpec?p(v):[v]}for(const v of t)for(const B of A(v))await h(B)}function JZ(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const KZ=S("to-docx");class XZ{constructor(t,e,o,r,i,s){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=o,this.readImageFunc=r,this.convertBlocksFunc=i,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new gt.Paragraph({heading:Ek(t),alignment:xk(t),children:await this.paragraphsFromBlockTexts(t),indent:RZ(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new gt.Paragraph({text:`[${L.t("docx.imageExportFailed")}]`,shading:{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=yZ(this.defaultFontSize,t.heading),o=[];for(const r of t.texts){if(r.link){const i=FZ(r,e);i&&o.push(i);continue}if(r.box&&r.box.type&&r.box.type==="br"){o.push(new gt.TextRun({text:"",break:1}));continue}if(r.box&&r.box.type&&r.box.type==="image"){const i=await Tk(this.appId,this.docId,r.box.src,r.box.width,this.readImageFunc);i&&o.push(i);continue}if(r.math){const i=await Tk(this.appId,this.docId,r.math,0,this.readImageFunc);i&&o.push(i);continue}o.push(Ik(r,e))}return o}async addCodeBlockObject(t){for(const e of t)for(const o of e){const r={style:gt.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new gt.Paragraph({style:"Code",border:{left:{...r},right:{...r},top:{...r},bottom:{...r}},children:await this.paragraphsFromBlockTexts(o)}))}}async addListBlockObject(t,e){if(e.list==null)return;let o;const r=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[r])o=this.state.listInstMap[r];else if(o=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[r]=o,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${o}`,l=yk([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:o}),this.state.listRefMap[r]=s}else e.list.ordered?this.state.listRefMap[r]=ju.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[r]=ju.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[r]=ju.UNCHECKED:this.state.listRefMap[r]=ju.BULLET;const i=Ek(e);e.texts&&this.paragraphs.push(new gt.Paragraph({heading:i,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[r],level:e.list.level-1,instance:o}}))}imageDimWithBufferToImageRun(t){return new gt.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e,o){if(e.images==null){if(t.type==="embed"&&t.embedType==="image"){const{src:a}=t.embedData;a||this.addEmptyImagePlaceHolder()}return}const r=[],i=await Promise.all(e.images.map(async a=>{const d=await this.readImageFunc(this.appId,this.docId,a.src);if(d)return vk(a,d);r.push(a.src)})),s=dZ(i,o),l={style:gt.BorderStyle.SINGLE,color:"#DEDEDE"};s.length&&this.paragraphs.push(new gt.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:xk(e)||gt.AlignmentType.CENTER,children:s.map(a=>this.imageDimWithBufferToImageRun(a)).flatMap((a,d,h)=>a==null?[]:h.length-1!==d?[a,new gt.TextRun({text:" "})]:a)})),r.forEach(a=>{this.addHyperlinkParagraph(a)})}addSeparatorBlock(){DZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new gt.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(SZ())}addAudioPlaceholder(){this.paragraphs.push(LZ())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(MZ(t,e))}async addTableMatrix(t,e,o){const r=t.map(i=>i!==0?i*15:1500);this.paragraphs.push(new gt.Table({rows:await this.generateTableRows(e,o),columnWidths:r}))}async generateRowCells(t,e){const o=[];for(const r of t){const i=r.cellId;if(i===void 0)continue;const s=r.width*.9;o.push(new gt.TableCell({children:await this.convertBlocksFunc(i,e.blocks[i],e,this.appId,this.docId,this.state,s),columnSpan:r.colSpan,rowSpan:r.rowSpan,width:{type:gt.WidthType.DXA,size:r.width*15},shading:r.color?{fill:r.color,type:gt.ShadingType.CLEAR,color:"auto"}:void 0}))}return o}async generateTableRows(t,e){const o=[];for(const r of t)o.push(new gt.TableRow({children:await this.generateRowCells(r,e)}));return o}async addDoc(t,e,o){const r=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,o);r&&(this.paragraphs=this.paragraphs.concat(r))}async addOtherEmbedBlock(){}}class tQ{constructor(t,e,o,r,i,s,l,a){m(this,"convertBlocks",async(t,e,o,r,i,s,l=720)=>{const a=new XZ(r,i,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await YZ(t,e,o,a,r,i,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),a.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=o,this.readImage=r,this.defaultFontSize=i,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=a}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,o){const r=new gt.ImportDotx,i=this.templateData?await r.extract(this.templateData):void 0,s=t.blocks.root;g(KZ,s,"data must have blocks");const l=JZ(),a=await this.convertBlocks("blocks",s,t,e,o,l),d=this.backgroundImageOptions?{default:new gt.Header({children:[new gt.Paragraph({children:[new gt.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new gt.Document({numbering:{config:[...gZ,...l.levelConfigs]},sections:[{headers:d,children:a,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:i});return gt.Packer.toBlob(h)}}async function eQ(n,t,e,o){const r=n.doc.buildResourceUrl(o,{withToken:!0});let i=await g9(r);if(!i)return;if(i.type.indexOf("/svg")!==-1){const l=await h9(i);l&&(i=new File([l],i.name))}return await i.arrayBuffer()}async function nQ(n,t,e){const o=n.editorBlocks.getBlockClass(e.type);if(o.toStandardDoc)return o.toStandardDoc(n,e,t)}async function oQ(n,t){const e=t.attributes,o=n.editorBoxes.getBoxClass(e.type);if(o.toStandardText)return o.toStandardText(n,e)}async function rQ(n,t){let{template:e,download:o,backgroundImageOptions:r}=t!=null?t:{};e||(e=aZ());const i=n.doc.toJSON(),s=(p,A,v)=>eQ(n,p,A,v),l=async(p,A,v)=>nQ(n,i,v),a=async p=>oQ(n,p),h=await new tQ(e,i,Nd.default,s,void 0,l,a,r).convert("_appId","_docId");if(o){const p=URL.createObjectURL(h),A=document.createElement("a");A.setAttribute("download",`${m9(n)}.docx`),A.setAttribute("href",`${p}`),A.click(),A.remove()}return h}const J2=S("create-editor");async function iQ(n,t){var s,l,a,d,h,p,A,v,B,D,x,_,R,H;g(J2,n,"app does not exists"),t.lang&&L.setLang(t.lang),Si.level=(s=t.logLevel)!=null?s:da.DEBUG;const e=t.onReauth?async()=>{var ft;const z=t.user.userId,q=t.docId,rt=await((ft=t.onReauth)==null?void 0:ft.call(t,z,q,t.permission));return{userId:z,docId:q,permission:t.permission,appId:t.appId,token:rt,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,o={auth:{appId:t.appId,docId:t.docId,userId:t.user.userId,permission:t.permission,token:t.token,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl},serverUrl:t.serverUrl,reauthFunc:e,disableLogout:t.disableLogout},r=await Xa.load(o),i=ja(n,r,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,components:{blocks:[...pk,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...Q2,...((a=t.components)==null?void 0:a.embeds)||[]],boxes:[...Ck,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new ef,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new Tf,new vp],insertions:[yg],blockHooks:[new o2,new G9,...((p=t.components)==null?void 0:p.blockHooks)||[]],textRenders:[new r8,new C0],options:{...t.componentsOptions}},shortcuts:[Bz,aN,AH,O0,Oy,MO,D0,sV,Rh,...t.shortcuts||[]],colors:["#338FE5","#24B47E","#F0A100","#E52727","#9678D3","#2CB2AE","#EB6414","#8AAB3F"]});if(i.editorCommandProviders.registerCommandProvider(new yr(i)),i.input.addHandler(new QV),i.input.addHandler(new Sf),i.input.addHandler(new Q_),i.input.addHandler(new fH),i.input.addHandler(new wu(i,{headingLevel:1,titlePlaceholder:L.t("placeholder.common.title"),contentPlaceholder:L.t("placeholder.common.content"),readonlyTitlePlaceholder:L.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new bf(i,(A=t.componentsOptions)==null?void 0:A.quickMenu)),i.input.addHandler(new u2(i)),i.input.addHandler(new g2(i)),i.input.addHandler(new iN),i.input.addHandler(new Ff),i.doc.registerCallback(new YV(i)),i.addCustom("remote-cursor",()=>new Zb(i)),i.addCustom("block-menu",z=>new Y9(z)),i.addCustom("editor-tooltip",()=>new vf(i)),t!=null&&t.enableComments&&i.addCustom("editor-comments",z=>new o8(z,new oZ(z))),i.addCustom("create-options",()=>new KC(i,t)),i.addCustom("drop-target",()=>new Mu(i)),i.addCustom("list-to-mindmap",()=>new ff(i)),i.addCustom("list-to-mention",()=>new pW(i)),i.addCustom("mobile-helper",()=>new RW(i)),i.addCustom("code-caret",()=>new rN(i)),i.addCustom("image-paste-handler",()=>new a2(i)),(v=t.componentsOptions)!=null&&v.mention){const z=t.componentsOptions.mention;i.addCustom("mention",()=>new z8(i,z))}if(i.addCustom("heading-collapse",()=>new _2(i)),gc.register(i),Mu.register(i),ts.register(i),Ji.register(i),i.addListener("clickLink",(z,q,rt)=>{var Bt;if((Bt=t==null?void 0:t.events)!=null&&Bt.onClickLink){t.events.onClickLink(z,q,rt);return}const ft=rt.getAttribute("link");ft&&(z.readonly||q.ctrlKey||q.metaKey)&&window.open(ft,"_blank")}),(D=(B=t.componentsOptions)==null?void 0:B.remoteCarets)!=null&&D.onUserChanged){const z=(_=(x=t.componentsOptions)==null?void 0:x.remoteCarets)==null?void 0:_.onUserChanged;i.doc.getRemoteUsers().on("change",q=>{z(i,q)})}return(H=(R=t.componentsOptions)==null?void 0:R.templates)!=null&&H.templates.length&&(i.addListener("docChanged",()=>{o1(i)}),i.addListener("resize",()=>{o1(i,{reset:!0})}),setTimeout(()=>{o1(i)},100)),i.doc.registerCallback({onError:async z=>{if(z.code==="ResetDoc"){J2.error(`reset doc: ${z.message}`);const q=await Xa.load(o);i.doc.reset(q)}}}),i}function sQ(n){return n.toJSON!==void 0}async function lQ(n,t,e){var i,s,l,a,d;g(J2,n,"app does not exists");const o=sQ(t)?t:new ep(t,{serverUrl:e.serverUrl||""});e.lang&&L.setLang(e.lang);const r=ja(n,o,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[R0,z0,V0,I7],commandProviders:[new ef],decorators:[new Tf,new vp],embeds:[...Q2,...((i=e.components)==null?void 0:i.embeds)||[]],boxes:[N7,V8,d8,...((s=e.components)==null?void 0:s.boxes)||[]],insertions:[yg],blockHooks:[new o2,...((l=e.components)==null?void 0:l.blockHooks)||[]],textRenders:[new r8,new C0,...((a=e.components)==null?void 0:a.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[O0,Oy,D0,Rh]});return r.editorCommandProviders.registerCommandProvider(new yr(r)),r.input.addHandler(new Sf),r.input.addHandler(new wu(r,{headingLevel:1,titlePlaceholder:L.t("placeholder.common.title"),contentPlaceholder:L.t("placeholder.common.content"),readonlyTitlePlaceholder:L.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),r.input.addHandler(new bf(r,(d=e.componentsOptions)==null?void 0:d.quickMenu)),r.input.addHandler(new u2(r)),r.input.addHandler(new g2(r)),r.input.addHandler(new Ff),r.addCustom("block-menu",h=>new Y9(h)),r.addCustom("editor-tooltip",()=>new vf(r)),r.addCustom("image-paste-handler",()=>new a2(r)),e!=null&&e.enableComments&&r.addCustom("editor-comments",h=>new o8(h,new rZ(h,o))),r.addCustom("heading-collapse",()=>new _2(r)),r.addListener("clickLink",(h,p,A)=>{var B;if((B=e==null?void 0:e.events)!=null&&B.onClickLink){e.events.onClickLink(h,p,A);return}const v=A.getAttribute("link");v&&(h.readonly||p.ctrlKey||p.metaKey)&&window.open(v,"_blank")}),gc.register(r),r}function cQ(n,t){var a;const e=n.doc;if(!((a=e.getVersionHelper)==null?void 0:a.call(e)))throw new Error("the editor does not support to show versions");const r=n.getCustom("create-options");if(!r)throw new Error("the editor does not support to show versions");const i=r.getData(),s=new Ak(i),l=n.addCustom("version-dialog",()=>new T8(n.doc,s));return l.show(t),l}b.tippy=HB,b.AnchorBox=b6,b.AuthError=qh,b.AuthHeader=Ka,b.AutoScroll=Yd,b.BaseURLHeader=Gh,b.BasicCommands=v_,b.BlockExclusiveHook=G9,b.BlockLockerHook=o2,b.BlockLockerPasteHandler=Ff,b.BlockResizer=Eu,b.BrBox=g6,b.CodeBlock=z0,b.CodeLineBlock=V0,b.CodeTextDecorator=Tf,b.DefaultShortcuts=Rh,b.DocIdError=jS,b.DragDrop=h5,b.DrawioEmbed=ik,b.EditorBlocks=y4,b.EditorBoxes=C6,b.EditorCommandProviders=sb,b.EditorComplexBlockPosition=Mo,b.EditorComplexSelectionRange=ir,b.EditorDecorators=w6,b.EditorEmbeds=w4,b.EditorInsertions=k6,b.EditorSimpleBlockPosition=je,b.EditorSimpleSelectionRange=Ye,b.EmbedBlock=E4,b.EmbedBlockResizer=Nu,b.EnforceWithDocumentTitleHandler=wu,b.EventCallbacks=ha,b.FILL_CHAR=aI,b.FileExtError=US,b.GroupOrder=L7,b.HeadingBlockScrollListener=uW,b.ImageBox=A6,b.InlineBoxCommandProvider=$7,b.InputtingInsertion=v6,b.LocalDoc=ep,b.LogLevel=da,b.Logger=Si,b.MIN_DISTANCE_THRESHOLD=u5,b.ManualCloseDialog=iu,b.ManualMenu=Us,b.ManualToolbar=ru,b.MarkdownInputHandler=Sf,b.MaxUserError=fp,b.Mindmap=f0,b.OnesEditorAutoSuggest=Np,b.OnesEditorCustomDataWrapper=KC,b.OnesEditorExclusiveBlock=Ji,b.OnesEditorHoveringBlock=Ce,b.OnesEditorQuickMenu=bf,b.OnesEditorToc=$u,b.OnesEditorTocProvider=ts,b.OnesEditorToolbar=gc,b.OnesEditorTooltip=vf,b.OnesEditorVersionsDialog=T8,b.PermissionError=HS,b.Popup=ou,b.RemoteCarets=Zb,b.RemoteCaretsDecorator=vp,b.RemoteCaretsInsertion=yg,b.RemoteUsers=Nh,b.RequestReloadError=Ja,b.RichText=ln,b.ShareDBDoc=Xa,b.ShareDBDocVersionsProvider=Ak,b.SimpleCache=t5,b.StandardEmbedBlockCommands=D2,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=dg,b.TEXT_STYLE_COLOR_PREFIX=ug,b.TableBlock=R0,b.TableBlockCommandProvider=ef,b.TableShortcuts=O0,b.TextBlock=Dn,b.TextBox=m6,b.TextStyleShortcuts=D0,b.TocEmbed=j8,b.ZERO_WIDTH_SPACE_CHAR=fa,b.abbreviation=Jd,b.addAttribute=fh,b.addClass=W,b.addCommentToBlock=Xf,b.addDays=DE,b.addMetaToDoc=_h,b.addMonths=TE,b.animateScrollTo=km,b.applyPlaceholderToBlock=Lf,b.assert=g,b.autoShowHideTemplates=o1,b.blockToDoc=Jg,b.blockToHtml=Eg,b.blockToMarkdown=xg,b.blockToText=yh,b.blocksToDoc=TT,b.clearAllSelection=n4,b.clientType=Ze,b.cloneBlock=Pi,b.cloneChildContainer=Fg,b.cloneDoc=Pg,b.cloneText=r6,b.commentToShareDbComment=bp,b.compareElement=Ud,b.comparePosition=Jm,b.complexBlockAdjustSelectionPos=ih,b.complexBlockFindNearestChildBlock=D4,b.complexBlockGeFirstSimpleChild=Xm,b.complexBlockGetAllChildContainers=gn,b.complexBlockGetBottomChildContainers=T4,b.complexBlockGetLastSimpleChild=zl,b.complexBlockGetSelectedContainers=Ms,b.complexBlockGetTopChildContainers=I4,b.containerToDoc=FA,b.continuousScroll=S5,b.convertBlockFrom=eh,b.convertImageFileToPng=h9,b.convertImageSrcToPng=IP,b.converterIntercept=Df,b.copyBlockAttributes=F6,b.createBlockAnchor=Vr,b.createBlockCaretAnchor=R4,b.createBlockContentElement=xs,b.createBlockElement=W5,b.createBlockSimpleDocRange=Ch,b.createBlockSimpleRange=ke,b.createBoxContentElement=Z5,b.createBoxElement=q5,b.createBoxOp=Q4,b.createChildContainer=b4,b.createComplexBlockPosition=me,b.createComplexDocPos=u6,b.createComplexDocRange=hI,b.createContainer=l6,b.createContainerElement=qm,b.createDeleteOps=W4,b.createEditor=ja,b.createEditorSelectionRange=Ue,b.createElement=k,b.createEmptyContainer=Gr,b.createEmptyDoc=qr,b.createEmptyTextBlockData=gh,b.createExpandedRange=Hd,b.createIconButton=$l,b.createImage=Cm,b.createInsertOps=dh,b.createInsertionContentElement=J5,b.createInsertionElement=Q5,b.createLocalEditor=lQ,b.createOnesEditor=iQ,b.createRange=e5,b.createRichText=_i,b.createRootContainer=A4,b.createSimpleBlockPosition=st,b.createSimpleDocPos=a6,b.createTextBlockData=cr,b.createTextButton=Zs,b.createTextOp=ao,b.createTextWithReplaceSoftReturn=lg,b.daysAfter=Mm,b.deleteText=ag,b.diffDays=SE,b.disablePageScroll=B5,b.docToHtml=L6,b.docToHtmlFragment=kh,b.docToMarkdown=Ra,b.docToText=Ma,b.downloadImageToFile=g9,b.downloadObjectToFile=U2,b.downloadSvgToString=Y8,b.editLink=pu,b.editorAddComment=cz,b.editorAddTextAttribute=G6,b.editorAutoInsertBlock=P6,b.editorBreakTextBlock=Ql,b.editorClearCompositionText=_6,b.editorClearSelectedContents=Og,b.editorCopyBlock=Fh,b.editorDeleteBlock=Mg,b.editorDeleteBlockText=Sg,b.editorDeleteBlockWithoutChildren=Eh,b.editorDeleteChildContainer=sT,b.editorDeleteChildContainers=N6,b.editorFocusToBlock=_g,b.editorFocusToEnd=xT,b.editorGetBlockData=Fi,b.editorGetBlockText=pn,b.editorGetBlockTextEx=bh,b.editorGetBoxData=h6,b.editorHandleKeyboardEvent=HA,b.editorInsertBlock=Zl,b.editorInsertBoxToBlock=R6,b.editorInsertDoc=W6,b.editorInsertDocAt=Ng,b.editorInsertText=Dg,b.editorInsertTextToBlock=M6,b.editorInsertTextToBlockEx=Tg,b.editorMergeTextBlock=$6,b.editorMoveDown=iA,b.editorMoveEnd=qg,b.editorMoveHome=gA,b.editorMoveLeft=nA,b.editorMoveLineEnd=wA,b.editorMoveLineHome=kA,b.editorMovePageDown=DA,b.editorMovePageUp=TA,b.editorMoveRight=oA,b.editorMoveUp=rA,b.editorMoveWordEnd=hA,b.editorMoveWordLeft=dA,b.editorRangeClearColor=Q6,b.editorRangeGetColor=$g,b.editorRangeSetColor=Z6,b.editorRemoveTextAttribute=uT,b.editorReplaceBlockText=Ih,b.editorReplaceContainer=q6,b.editorRunOnce=np,b.editorSelectAll=OA,b.editorSelectContainer=Qg,b.editorSelectDown=sA,b.editorSelectEnd=Gg,b.editorSelectHome=pA,b.editorSelectLeft=lA,b.editorSelectLineEnd=yA,b.editorSelectLineHome=vA,b.editorSelectPageDown=LA,b.editorSelectPageUp=SA,b.editorSelectRight=cA,b.editorSelectUp=aA,b.editorSelectWordEnd=mA,b.editorSelectWordLeft=fA,b.editorSetTextColor=Yl,b.editorShowFindDialog=mU,b.editorToDocx=rQ,b.editorUpdateBlockData=Th,b.editorUpdateCompositionText=O6,b.editorUpdateEmbedData=z6,b.enablePageScroll=E5,b.escapeHtmlText=l5,b.escapeRegExp=Fm,b.escapeSpace=hE,b.exclusiveBlock=t2,b.executeBlockCommand=d4,b.executeEmbedBlockCommand=u4,b.executeRangeCommand=ib,b.fileToDataUrl=jl,b.findAfterOffsetNotType=Ag,b.findAllText=gg,b.findEventTargetBlock=i5,b.findInsertionById=Y5,b.findNextOffset=DI,b.findNextVisibleSimpleBlock=db,b.findPrevOffset=TI,b.findPrevOffsetNotType=Cg,b.findPrevSimpleBlockBeforeChildContainer=x4,b.findPrevVisibleSimpleBlock=ub,b.findTarget=Hl,b.findWordEnd=vg,b.findWordLeft=bg,b.format=ba,b.formatBytes=L5,b.formatDate=Om,b.fragmentToHtml=x5,b.fromBase64=pa,b.fromBase64ToBlob=Tm,b.fromBase64ToUint8Array=wE,b.fromDocRange=Ri,b.fromNowString=_m,b.genId=K,b.getAllChildBlocks=eg,b.getAllQuickMenuItems=T0,b.getAllSelectedBlocks=Ro,b.getAttributesAt=Da,b.getBlockBackground=V5,b.getBlockByIndex=Pr,b.getBlockCaretRect=So,b.getBlockClass=Yt,b.getBlockClassByType=Ss,b.getBlockClientRects=$r,b.getBlockCommandsWithHook=Vm,b.getBlockContent=Lt,b.getBlockId=it,b.getBlockIndex=bt,b.getBlockInfo=Du,b.getBlockKind=Do,b.getBlockMinWidth=r4,b.getBlockNearestRangeFromPoint=M4,b.getBlockOptions=jE,b.getBlockPath=Mi,b.getBlockProperties=l4,b.getBlockRangeFromPoint=sh,b.getBlockStyles=HE,b.getBlockTextLength=ut,b.getBlockTools=te,b.getBlockType=Dt,b.getBoxContent=$m,b.getBoxId=G5,b.getBoxTypeFromElement=va,b.getChildBlockCount=Io,b.getChildBlocks=fe,b.getChildOffset=Os,b.getColorFromAttributes=fg,b.getColorFromContent=Kd,b.getComplexBlockClass=zn,b.getContainerBlockPath=g4,b.getContainerBlocks=e4,b.getContainerBlocksElement=oh,b.getContainerById=Ur,b.getContainerId=ct,b.getContainerMinWidth=Zm,b.getContainerToolsElement=qE,b.getContainerWidth=v4,b.getDistanceSquare=nr,b.getElementOffset=ma,b.getElementScale=vs,b.getEmbedType=fn,b.getExistsBlockTools=th,b.getExistsContainerById=m4,b.getFileExt=Aa,b.getFirstChildBlock=ye,b.getFirstClientRect=jd,b.getHeadingMenuOptions=B0,b.getHorizontalPadding=Am,b.getInsertionContent=Hm,b.getLastChildBlock=Qe,b.getLastClientRect=As,b.getListAllNextBrothers=uc,b.getLogger=S,b.getNextBlock=Qt,b.getNextValidOffset=_s,b.getNextVisibleBlock=Ts,b.getOffsetInfoAfter=La,b.getOffsetInfoBefore=vh,b.getOpAt=J4,b.getOpLength=hh,b.getParentBlock=tt,b.getParentBlockExcludeSelf=Es,b.getParentBox=Nm,b.getParentContainer=nt,b.getPrevBlock=ce,b.getPrevValidOffset=Oi,b.getPrevVisibleBlock=Is,b.getRangeCommands=ob,b.getRootBlock=zm,b.getScrollContainer=io,b.getSpecialBlockCommands=c4,b.getStandardEmbedBlockProperties=S2,b.getTextAfterOffset=xI,b.getTextAttributes=Ig,b.getTextBeforeOffset=II,b.getTextBlockChild=nh,b.getTextBlockClass=X5,b.getTextBlockContentChildTextLength=co,b.getTextBlockContentChildType=h4,b.getTextBlockContentChildren=rr,b.getTextLength=rn,b.getTextOpLength=ng,b.getTextWidth=Gd,b.getToolbar=cf,b.handleBlockElementUpdated=i4,b.hasAltOnly=AE,b.hasClass=xt,b.hasCtrlOrCmd=b5,b.hasCtrlOrCmdOnly=CE,b.hashCode=N5,b.hideBlock=U5,b.htmlToFragment=qd,b.i18n=L,b.injectDocToHtmlFragment=Oh,b.injectStyle=a5,b.insertEmptyBlock=VE,b.insertEmptyEmbedBlock=Wm,b.insertText=Wr,b.intersectionCommands=RD,b.isBackspace=y5,b.isBlock=Bs,b.isBlockLocked=_f,b.isBlockLockedByOthers=n2,b.isBlockLockedBySelf=Su,b.isBlockTools=j5,b.isBox=Pm,b.isCJK=p5,b.isChildContainer=Lo,b.isChildNode=Xt,b.isCodeBlock=Cr,b.isCollapsedRange=dI,b.isComplexBlockPosition=Ym,b.isComplexKindBlock=Mt,b.isContainer=Nr,b.isContainerSelectedAllChildBlocks=MA,b.isControlEvent=ks,b.isDelete=vE,b.isDraggingFiles=Zd,b.isElementVisible=ym,b.isEmbedBlock=Me,b.isEmptyContainer=Ba,b.isEmptyDoc=pg,b.isEmptyTextBlock=ae,b.isEmptyTextBlockWithoutCompositionText=ku,b.isEnterOnly=v5,b.isEscape=xm,b.isExclusiveBlock=Of,b.isFirefox=Wd,b.isFirstChildBlockInComplexBlock=Bx,b.isHighSurrogate=sE,b.isInBlock=jm,b.isInBlockTools=Ds,b.isLetter=g5,b.isLowSurrogate=pm,b.isMatchShortcut=or,b.isMoveForward=gE,b.isNavigationEvent=mE,b.isNavigationKey=A5,b.isNodeRemoved=o5,b.isNumber=m5,b.isPrintableKey=Em,b.isRootBlock=so,b.isRootContainer=Gt,b.isSafari=C5,b.isSameDay=Rm,b.isSecureEnv=j0,b.isShiftEnter=bE,b.isShiftTab=kE,b.isShortcutEvent=pE,b.isSimpleBlock=$E,b.isSimpleBlockPosition=zr,b.isSimplePos=c6,b.isSimpleRange=ph,b.isSpace=Vd,b.isTab=yE,b.isTextBlockContentBoxChild=lo,b.isTextBlockContentChild=ka,b.isTextBlockContentInsertionChild=jr,b.isTextBlockContentTextChild=wa,b.isTextKindBlock=et,b.isTextKindBlockType=ya,b.isToday=M5,b.isValidOffset=sn,b.isVisibleBlock=Xd,b.isYesterday=R5,b.loadJs=r5,b.loadJsPromise=bs,b.lockers=xo,b.mergeCommands=lf,b.mergeDocs=Ns,b.mergeOps=cg,b.mergeText=iI,b.multiSplitText=F4,b.overflowText=O5,b.parseShortcut=k5,b.patchNode=Ca,b.pointInRect=ys,b.rangeAddAttribute=Ta,b.rangeGetTextColor=o6,b.rangeRemoveAttribute=Wl,b.rangeSetTextColor=t6,b.rangeTransformText=K4,b.registerDragDrop=wm,b.removeAttribute=hg,b.removeClass=ot,b.removeLastBr=eI,b.removePlaceholderFromBlock=b9,b.removeStyle=c5,b.replaceAll=LE,b.replaceAllCaseInsensitive=ME,b.replaceAllText=s6,b.replaceText=mh,b.requestDownload=Qd,b.resetListStart=hc,b.scrollable=D5,b.selectFile=Ul,b.selectedBlockToDoc=Sh,b.selectionToDoc=Lh,b.setAttributes=zd,b.setClipboardData=Lm,b.setClipboardDataByEvent=IE,b.setColorToAttributes=e6,b.setDataset=bm,b.setDefaultCursor=ga,b.setStyles=vm,b.shareDBCommentToDocObject=Ap,b.shareDBDocCommentToComment=qb,b.shortcutToDisplayText=ro,b.showBlock=z5,b.showDocVersions=cQ,b.splitText=Tn,b.splitToThree=ze,b.stringToDataUrl=Dm,b.stringToObjectUrl=Sm,b.subText=P4,b.textNodeOffsetFromPoint=n5,b.titleFromEditor=m9,b.toBase64URL=Li,b.toMindmap=hf,b.toPlainText=ie,b.toPlainTextKeepLength=mg,b.trimChar=Bm,b.unexclusiveBlock=e2,b.unicodeLength=lE,b.unicodeSubstr=cE,b.updateBlockSelection=o4,b.updateOpAttributes=i6,b.updateTextBlockContent=EI,b.updateUrl=Im;for(const n in ve)n!=="default"&&!b.hasOwnProperty(n)&&Object.defineProperty(b,n,{enumerable:!0,get:()=>ve[n]});Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
764
+ \`\`\`\`\`\``}return"[plantuml]"}const xG={embedType:"plantuml",convertFrom:wG,handleUpdateBlock:kG,createEmbedContent:yG,getBlockProperties:BG,convertTo:EG},yot="",IG="hr",TG={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},DG={dividingLine:{type:"Separation line",abstract:"Separation line"}},SG={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};L.mergeLang({"zh-CN":TG,"en-US":DG,"ja-JP":SG});function LG(n,t){const e=k("div",["editor-embed-container"],t);k("hr",["editor-embed-hr"],e)}function MG(n,t,e,o){return o==="html"?"<hr />":o==="markdown"?"---":"------------"}function RG(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:L.t("dividingLine.type"),icon:FL,order:500,group:"common",subText:An("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:o}=t;return n.insertEmbed(e,o,IG,{})}}}function OG(n,t,e){const{data:o}=e;if(!o||o.embedType!=="dividing-line"||!et(n,t))return null;const r={};return{blockData:{id:K(),type:"embed",embedType:"hr",embedData:r}}}function _G(){return{abstract:L.t("dividingLine.abstract")}}const FG={embedType:"hr",createEmbedContent:LG,convertTo:MG,getOptions:RG,convertFrom:OG,getBlockProperties:_G},kot="",wot="",PG={media:{upload:{failed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>'},load:{failed:'<div class="line-1">{name}\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>'},audio:{menuItem:"\u97F3\u9891",abstract:"\u97F3\u9891"},video:{menuItem:"\u89C6\u9891",abstract:"\u89C6\u9891"}}},NG={media:{upload:{failed:'<div class="line-1">{name} upload failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>'},load:{failed:'<div class="line-1">{name} loading failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>'},audio:{menuItem:"Audio",abstract:"Audio"},video:{menuItem:"Video",abstract:"Video"}}},$G={media:{upload:{failed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>'},load:{failed:'<div class="line-1">{name}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>'},audio:{menuItem:"\u97F3\u58F0",abstract:"\u97F3\u58F0"},video:{menuItem:"\u52D5\u753B",abstract:"\u52D5\u753B"}}};L.mergeLang({"zh-CN":PG,"en-US":NG,"ja-JP":$G});var qo=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(qo||{}),Hu=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(Hu||{});const uk=10*1024*1024,HG=["wav","mp3","aac","ogg","webm","flac"],jG=["ogg","mp4","webm"],UG=()=>{};function dk(n){var h,p,A,v,B,D;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:o,callbacks:r}=t,i=(p=e==null?void 0:e.audio)!=null?p:HG,s=(A=e==null?void 0:e.video)!=null?A:jG,l=(v=o==null?void 0:o.audio)!=null?v:uk,a=(B=o==null?void 0:o.video)!=null?B:uk,d=(D=r==null?void 0:r.onError)!=null?D:UG;return{allowedMedias:{audio:i,video:s},maxSize:{audio:l,video:a},callbacks:{onError:d}}}function zG(n,t){const e=i=>i.map(s=>`.${s}`).join(","),{allowedMedias:o}=dk(n),r=o[t];return r?e(r):"*"}function VG(n,t,e){const{maxSize:o,callbacks:r,allowedMedias:i}=dk(t),{[e]:s}=o,{[e]:l}=i;if(s&&n.size>s){const d=new Error("media is too large");throw d.code=`MaxMediaSize-${e}`,r!=null&&r.onError&&(r==null||r.onError(t,d)),d}const a=Aa(n.name);if(l&&!l.includes(a)){const d=new Error(`media file is not allowed: ${a}`);throw d.code="NotAllowedFile",r!=null&&r.onError&&(r==null||r.onError(t,d)),d}}function WG(n){return n===Hu.Empty||n===Hu.Error}const Ne=S("media");class qG extends ve.TypedEmitter{constructor(e){super();m(this,"mediaContainer",null);m(this,"media",null);m(this,"abstract",null);m(this,"handleMediaLoadError",(e,o)=>{if(!o.target||!(o.target instanceof Node)||!(o.target instanceof Element?o.target:o.target.parentElement))return;const i=tt(o.target);if(!i||!i.contains(this.mediaContainer))return;const s=this.renderError();this.updateMediaContent(s),this.emit("mediaError",e,"load_error",it(i))});m(this,"handleUploadFile",async e=>{g(Ne,this.abstract,"no abstract"),g(Ne,this.mediaContainer,"The media element not exist");const{editor:o}=this.options,r=tt(this.mediaContainer);g(Ne,r,"The block element not exist");const i=o.getBlockData(r);try{const{resourceId:s}=await o.doc.uploadResource(e,{onProgress:p=>{this.renderProgress(p,e)}}),{name:l,type:a,size:d}=e,h={...i,embedData:{...i.embedData,src:s,fileName:l,fileSize:d,fileType:a}};o.updateBlockData(r,h)}catch(s){Ne.error(s),this.emit("mediaError",o,"upload_error",i.id),this.renderRetry(e)}ot(r,"media-block-uploading")});m(this,"destroy",()=>{this.mediaContainer=null});this.options=e}bindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.addEventListener(this.media,"error",this.handleMediaLoadError)}unbindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.removeEventListener(this.media,"error",this.handleMediaLoadError)}updateMediaContent(e){g(Ne,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){g(Ne,this.abstract,"no abstract");const{editor:e,createMediaElement:o}=this.options,{mediaIcon:r,mediaName:i}=this.abstract;g(Ne,this.mediaContainer,"The media element not exist");const s=tt(this.mediaContainer);g(Ne,s,"The block element not exist");const l=e.getBlockData(s),a=l.embedData.src,d=k("div",["media-error","embed-selected-content","embed-hover-content"],null),h=k("span",["media-error-icon"],d);h.innerHTML=r;const p=k("div",[],d);p.innerHTML=L.t("media.load.failed",{name:i}),d.appendChild(p);const A=p.querySelector(".retry-upload");return g(Ne,A,"The element not exist"),e.domEvents.addEventListener(A,"click",(v,B)=>{const D=k("div",["media-element"],null),x=this.getResourceUrl(a),_=o(v,D,l,x);this.unbindMediaEvent(),this.media=_,this.bindMediaEvent(),this.updateMediaContent(D)}),this.setFullScreen(),d}renderRetry(e){g(Ne,this.abstract,"no abstract");const{editor:o}=this.options,{mediaIcon:r,mediaName:i}=this.abstract,s=k("div",["media-error","embed-selected-content","embed-hover-content"],null),l=k("span",["media-error-icon"],s);l.innerHTML=r;const a=k("div",[],s);a.innerHTML=L.t("media.upload.failed",{name:i}),s.appendChild(a);const d=a.querySelector(".retry-upload");g(Ne,d,"The element not exist"),o.domEvents.addEventListener(d,"click",()=>{o.readonly||(g(Ne,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(s),this.setFullScreen()}renderProgress(e,o){g(Ne,this.mediaContainer,"The media element not exist");const r=this.mediaContainer.querySelector(":scope .media-progress"),i=e===-1||e===100?100:e;if(r){const{updateProgressElement:s}=this.options;s(r,i)}else{const{createProgressElement:s}=this.options,l=tt(this.mediaContainer);g(Ne,l,"The element not exist"),W(l,"media-block-uploading");const a=k("div",["media-progress"],null);s(a,i,o),this.updateMediaContent(a)}this.setFullScreen()}renderMediaElement(e){g(Ne,this.mediaContainer,"The media element not exist");const o=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:r,updateMediaElement:i,editor:s}=this.options,l=this.getResourceUrl(e.embedData.src);if(o){const a=i(s,o,e,l);this.unbindMediaEvent(),this.media=a,this.bindMediaEvent()}else{const a=k("div",["media-element"],null),d=r(s,a,e,l);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent(),this.updateMediaContent(a)}}renderEmpty(e){g(Ne,this.abstract,"no abstract"),g(Ne,this.mediaContainer,"The media element not exist");const o=k("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);o.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(o);const{editor:r}=this.options;r.findBlockById(e.id)&&this.emit("mediaError",r,"empty",e.id),this.setFullScreen()}getResourceUrl(e){const{editor:o}=this.options;return o.doc.buildResourceUrl(e)}setFullScreen(){g(Ne,this.mediaContainer,"The media element not exist"),W(this.mediaContainer,"full-screen")}removeFullScreen(){g(Ne,this.mediaContainer,"The media element not exist"),ot(this.mediaContainer,"full-screen")}updateBlockAlign(e,o){const r=tt(o);g(Ne,r,"The block element not exist");const{align:i}=e;e.embedType==="video"&&(r.hasAttribute("data-style-align")&&r.removeAttribute("data-style-align"),r.setAttribute("data-style-align",i))}render(e,o){const{src:r}=e.embedData;(!this.mediaContainer||!o.contains(this.mediaContainer))&&(this.mediaContainer=k("div",["media"],o)),this.updateBlockAlign(e,o),WG(r)?r===Hu.Empty&&this.renderEmpty(e):this.renderMediaElement(e)}setAbstract(e){this.abstract=e}}S("media-embed");const GG="left";class hk{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var p;const{containerId:o,blockIndex:r}=e;let i;(p=e.data)!=null&&p.file&&(i=e.data.file);const s=zG(t,this.embedType);if(i=i!=null?i:await Ul(s,{}),!i)return null;const{mediaType:l}=this.getAbstract();try{VG(i,t,l)}catch{return null}const a={id:K(),type:"embed",embedType:this.embedType,embedData:{src:Hu.Empty}};l==="video"&&(a.align=GG);const d=t.insertBlock(o,r,a);return await this.getMedia(t,a.id).handleUploadFile(i),d})}getMedia(t,e){const o=t.addCustom(`media-${e}`,()=>new qG({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return o.setAbstract({...this.getAbstract()}),o}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:o,order:r,group:i}=this.getAbstract();return{name:o,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:r,group:i,subText:An(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,o){const{id:r}=o;this.getMedia(t,r).render(o,e)}handleUpdateBlock(t,e,o){const{id:r}=o,i=this.getMedia(t,r),s=Lt(e);return i.render(o,s),!0}handleDeleteBlock(t,e){const o=e.id,r=this.getMedia(t,o);r.removeAllListeners(),r.destroy()}convertTo(t,e,o,r){const i=e.embedData,s=t.doc.buildResourceUrl(i.src,{withToken:!0});return r==="html"?`<${i.type} src="${s}" />`:r==="markdown"?`![${i.src}](${s})`:s}}function fk(n,t){const e=k("div",["uploading-progress-mask"],n),o=k("div",["uploading-progress-bar"],e),r=k("div",["uploading-progress-bar-value"],o);r.style.width=`${t}%`}function mk(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const ZG=S("media-audio");class QG extends hk{constructor(){super(...arguments);m(this,"embedType",qo.AUDIO);m(this,"updateProgressElement",mk);m(this,"createMediaElement",(e,o,r,i)=>{const s=k("div",["audio-container","embed-hover-content","embed-selected-content"],o),l=k("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=i,setTimeout(()=>{this.getMedia(e,r.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:RL,mediaName:L.t(`media.${qo.AUDIO}.menuItem`),menuItem:L.t(`media.${qo.AUDIO}.menuItem`),order:800,mediaType:qo.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${L.t(`media.${qo.AUDIO}.abstract`)}`}}updateMediaElement(e,o,r,i){const s=o.querySelector(":scope .audio-container > audio");return g(ZG,s,"The media element not exist"),s.src!==i&&(s.src=i),s}createProgressElement(e,o){const r=k("audio",[],e);r.innerHTML="Your browser does not support the <code>audio</code> element.",r.controls=!0,r.src="about:blank",fk(e,o)}}const YG=new QG;S("video-resizer");function gk(n){return n&&Me(n)&&fn(n)==="video"}const JG=50;class Z2{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&gk(e)&&this.disableBlockResize(e),t&&gk(t))){const o=this.getVideoElement(t);if(!o)return;this.enableBlockResize(t,o)}});m(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const o=t.getBlock();if(!o)return;const r=o.getBoundingClientRect().width,i=Math.min(Math.max(e.width,JG),r);this.currentResizableElement.style.width=`${i}px`,this.currentResizableElement.style.pointerEvents="none"});m(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const o=this.editor.getBlockData(e),{width:r}=this.currentResizableElement.getBoundingClientRect();this.currentResizableElement.style.pointerEvents="auto",this.editor.updateBlockData(e,{...o,width:r})});this.editor=t,Ce.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,Ce.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return Lt(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${it(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${it(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const o=this.editor.addCustom(`${it(t)}-resizer`,()=>new Eu(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));o.enableResize(t,e),o.removeListener("resizing",this.handleResizing),o.removeListener("resized",this.handleResized),o.addListener("resizing",this.handleResizing),o.addListener("resized",this.handleResized),this.currentResizableElement=e}}const KG=S("video");class XG extends hk{constructor(){super(...arguments);m(this,"embedType",qo.VIDEO);m(this,"updateProgressElement",mk);m(this,"createMediaElement",(e,o,r,i)=>{const s=k("div",["video-container","embed-selected-content","drag-preview-element"],o),l=k("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=i,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new Z2(e)),this.getMedia(e,r.id).removeListener("mediaError",this.handleMediaError),this.getMedia(e,r.id).addListener("mediaError",this.handleMediaError),this.getMedia(e,r.id).removeFullScreen()}),r.width&&(l.style.width=`${r.width}px`),l});m(this,"createProgressElement",(e,o,r)=>{const i=k("video",["progress-video"],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,fk(e,o),jl(r).then(s=>{const l=e.querySelector(".progress-video");l&&jm(e)&&(l.src=s)})})}getAbstract(){return{mediaName:L.t(`media.${qo.VIDEO}.menuItem`),mediaIcon:OL,menuItem:L.t(`media.${qo.VIDEO}.menuItem`),order:700,mediaType:qo.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`[${L.t(`media.${qo.VIDEO}.abstract`)}]`}}handleMediaError(e,o,r){const i=e.addCustom("video-resizer",()=>new Z2(e)),s=e.getBlockById(r);i.disableBlockResize(s)}updateMediaElement(e,o,r,i){const s=o.querySelector(":scope .video-container > video");g(KG,s,"The media element not exist"),s.src!==i&&(s.src=i),r.width?s.style.width=`${r.width}px`:s.style.width="";const l=e.getBlockById(r.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new Z2(e)).updateResizer(l)}),s}}const tZ=new XG,pk=[R0,z0,V0,I9],Q2=[ik,eq,aG,AG,xG,V_,FG,tZ,YG,LH,j8,tV],Ck=[N9,V8,d8];function eZ(n,t,e){var r,i,s;const o=ja(n,t,{components:{blocks:[...pk,...((r=e==null?void 0:e.components)==null?void 0:r.blocks)||[]],embeds:[...Q2,...((i=e.components)==null?void 0:i.embeds)||[]],boxes:[...Ck,...((s=e.components)==null?void 0:s.boxes)||[]],textRenders:[new C0],options:{...e.componentsOptions}}});return o.readonly=!0,o.addCustom("heading-collapse",()=>new _2(o)),o.addCustom("editor-tooltip",()=>new vf(o)),o.addListener("clickLink",(l,a,d)=>{var p;if((p=e==null?void 0:e.events)!=null&&p.onClickLink){e.events.onClickLink(l,a,d);return}const h=d.getAttribute("link");h&&(l.readonly||a.ctrlKey||a.metaKey)&&window.open(h,"_blank")}),o}class Ak{constructor(t){this.createOptions=t,t.lang&&L.setLang(t.lang)}createHistoryEditor(t,e){return eZ(t,e,this.createOptions)}}S("create-editor");function bk(n,{root:t,childDoc:e,doc:o}){var d,h;e.uploadResource=o.uploadResource.bind(o),e.buildResourceUrl=o.buildResourceUrl.bind(o);const r={image:{defaultAlign:"left"},toc:{showFirstBlock:!0},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0}},i=[];n.editorBlocks.forEach(p=>{p.blockType==="text"||p.blockType==="embed"||i.push(p)});const s=[];n.editorEmbeds.forEach(p=>{s.push(p)});const l=[];n.editorBoxes.forEach(p=>{p.boxType==="text"||p.boxType==="br"||p.boxType==="image"||p.boxType==="anchor"||l.push(p)});const a=ja(t,e,{shortcuts:[Rh],components:{blocks:i,commandProviders:[new ef],decorators:[new Tf],embeds:s,boxes:l,options:r}});if(a.input.addHandler(new Sf),a.input.addHandler(new u2(a)),a.input.addHandler(new g2(a)),a.input.addHandler(new iz(a)),a.input.addHandler(new Ff),a.addCustom("image-paste-handler",()=>new a2(a)),(d=n.options.componentsOptions)!=null&&d.mention){const p=n.options.componentsOptions.mention;a.addCustom("mention",()=>new z8(a,{...p,enableFirstBlock:!0}))}if((h=n.options.componentsOptions)!=null&&h.comment){const p=n.options.componentsOptions.comment;p.onCommentEditorClick&&a.addListener("click",p.onCommentEditorClick)}return a}function nZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),o=new Set;e.forEach(r=>{const i=tt(r);i&&o.add(i)}),o.forEach(r=>{sz(n,r,t)})}class oZ{constructor(t){m(this,"listeners",new Set);m(this,"doc");this.editor=t,this.doc=this.editor.doc.externalDoc,this.doc.registerCallback(this)}getComments(){return this.doc.getComments()}getComment(t){return this.doc.getComment(t)}getCommentDoc(t){return this.doc.getCommentDoc(t)}localCreateComment(t,e){this.doc.localCreateComment(t,e)}localDeleteComment(t){const e=this.getComment(t);this.doc.localDeleteComment(t);const o=e.groupId;this.getComments().filter(i=>i.groupId===o).length===0&&nZ(this.editor,o)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return bk(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class rZ{constructor(t,e){m(this,"listeners",new Set);this.editor=t,this.localDoc=e}get doc(){return this.localDoc.toJSON()}getComments(){return Object.values(this.doc.comments)}getComment(t){return this.doc.comments[t]}getCommentDoc(t){const e=this.doc.comments[t];return Ap(e)}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}localCreateComment(t,e){}localDeleteComment(t){}localUpdateComment(t,e){}createCommentEditor(t,e){return bk(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const iZ={placeholder:{common:{title:"\u8BF7\u8F93\u5165\u6807\u9898",readonlyTitle:"\u8BF7\u8F93\u5165\u6807\u9898",content:"\u70B9\u51FB + \uFF0C\u6216\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",contentInTable:"\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6"},local:{readonlyTitle:"\u672A\u547D\u540D"}},copyCutProperty:{copy:"\u590D\u5236",cut:"\u526A\u5207",unsafeEnvTips:"\u7531\u4E8E\u5F53\u524D http \u8BBF\u95EE\u73AF\u5883\u4E0B\u7684\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528\u5FEB\u6377\u952E({shortCut}) {operation}"}},sZ={placeholder:{common:{title:"Enter a title",readonlyTitle:"Enter a title",content:"Click + or enter / to insert components quickly",contentInTable:"Enter / to insert components quickly"},local:{readonlyTitle:"Untitled"}},copyCutProperty:{copy:"Copy",cut:"Cut",unsafeEnvTips:"Due to the limitations of the current http access environment, please use the shortcut ({shortCut}) {operation}"}},lZ={placeholder:{common:{title:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",readonlyTitle:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",content:"\u300C+\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u304B\u3001\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",contentInTable:"\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059"},local:{readonlyTitle:"\u7121\u984C"}},copyCutProperty:{copy:"\u8907\u88FD",cut:"\u5207\u308B",unsafeEnvTips:"HTTP\u74B0\u5883\u306E\u5236\u7D04\u306B\u3088\u308A\u3001{operation}\u3059\u308B\u306B\u306F\u3001\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8({shortCut}) \u3092\u3054\u4F7F\u7528\u304F\u3060\u3055\u3044"}};L.mergeLang({"zh-CN":iZ,"en-US":sZ,"ja-JP":lZ});const cZ="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0lMtqwzAQRfeF/oPRtsRKuiilxMmij2UbaArdKvI4EdULaZzH33fsJKYUJy5NsjHIM/feowHNcLw2OllCiMrZjA3SPkvASpcrO8/Yx/Sld8+SiMLmQjsLGdtAZOPR9dVwuvEQE1LbmLEFon/gPMoFGBFT58FSpXDBCKRjmHMv5JeYA7/t9++4dBbBYg8rDzYaPkEhSo3J85p+b0kC6MiSx21jlZUx4b1WUiDV+dLmv1J6u4SUlHVPXCgfb6iB8daEqnI4YKd7o9EElUMyEQFfhaEuvnIh57mTpSFletymhdMVhZLQ6Cs3H5yEGGnmRqcIxtMNIDVC2T1/G4csIzrzaTRXpJkE5+PgZJzGtPKDgAqaGR6chS3NDALRn38YjXUnRMSNhnh+gq1vdzwgkuASADvnToQVzN4vRvHDvBOkoNypmGk4P0Zj3QmBtIpg+z39VdQ2xyKps36AtNrCP669312Vuuf/9PKaRLI++X5QrcUc8pZsXi/60TcAAAD//wMAUEsDBBQABgAIAAAAIQAekRq37wAAAE4CAAALAAgCX3JlbHMvLnJlbHMgogQCKKAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArJLBasMwDEDvg/2D0b1R2sEYo04vY9DbGNkHCFtJTBPb2GrX/v082NgCXelhR8vS05PQenOcRnXglF3wGpZVDYq9Cdb5XsNb+7x4AJWFvKUxeNZw4gyb5vZm/cojSSnKg4tZFYrPGgaR+IiYzcAT5SpE9uWnC2kiKc/UYySzo55xVdf3mH4zoJkx1dZqSFt7B6o9Rb6GHbrOGX4KZj+xlzMtkI/C3rJdxFTqk7gyjWop9SwabDAvJZyRYqwKGvC80ep6o7+nxYmFLAmhCYkv+3xmXBJa/ueK5hk/Nu8hWbRf4W8bnF1B8wEAAP//AwBQSwMEFAAGAAgAAAAhADPCW79BAQAA5wQAABwACAF3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzIKIEASigAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArJQxT8MwEIV3JP5D5B07LVAQatoFkDqwQJFYneSSWI3tyL6Q9t9zojRNRYkYPN6z7r1P57Pny62uo09wXlmTsAmPWQQms7kyZcLe189X9yzyKE0ua2sgYTvwbLm4vJi/Qi2RmnylGh+Ri/EJqxCbByF8VoGWntsGDJ0U1mmJVLpSNDLbyBLENI5nwg092OLEM1rlCXOrnPLXuwb+422LQmXwaLNWg8EzEQKpF8hQuhIwYd/lXpxwMmPiPMN1SAaPu5qG2EPs67H4u5DxhTW4lmk9GEMvjUFMQ0KYVqfgaMeOEL00BjEJCZG1Hq3+oLQegvOjKhSCHl2LWUiaipxcrczmSPNj23UdT6XKW55ZLQ7HLzan5KctgjPyT8TbkIgdpG+ASHc0WN+BODarm6BP6BfFQTkgiJPvafEFAAD//wMAUEsDBBQABgAIAAAAIQBOMo6QFgYAAKYkAAARAAAAd29yZC9kb2N1bWVudC54bWzUWttu40QYvkfiHSJfLRKtz4eYTVeOD7uVQKoo+wCuPUmstT3WeNI0XC0XC1wguOBiuWClLgjBE4AEiIdZ0T28BTM+JM6h7cTZkm0vEnv+mW+++eb7/0yc3r13lsSdU4DyCKY9TtwXuA5IAxhG6bDHPfzM2zO4To79NPRjmIIeNwU5d+/g/ffuTswQBuMEpLhDINLcnGRBjxthnJk8nwcjkPj5fhIFCOZwgPcDmPBwMIgCwE8gCnlJEIXiKkMwAHlO5rP99NTPuQouOGNDC5E/IYMpoMIHIx9hcDbHEDcGUfkub6wCSS2AyAolcRVK3hhK4ymrFSClFRBhtYKktkNaszitHZK0iqS3Q5JXkYx2SCt2SlYNDjOQkuAAosTH5BYN+cRHj8bZHgHOfBydRHGEpwRT0GoYP0oftWBERs0QEjncGEHnExiCWA5rFNjjxig1q/F7s/GUulmOr97qEYhl/eUQpyoOxcp5BGKiBUzzUZTNMjxpi0aCoxrk9KpFnCZx3W+SiYzpcll5ckop54As9Cv9k7hkfjWiKDDsCIWYjWChsDhnzSQhLpxP3EqahrgiYwGpAaQVAC0AjAW/xjAqDD6YZyjFiRhTo8Ypd4XiRHNhRcY6tkymAZCDzSDUmkc+TRoryobb2fY+guNsjhZth3Y4L0ITehzYAKuyfzMl8+3IHI/8jNSmJDAPhylE/klMGBEzd4gfO8UO0FeyrfStuARnHVoIuANyfDmB4ZS+ZySimJmP/EPiHEV2dE+3La5oJcUf01a9+iOtJjkqhZ/2OEEQJE1z5FmTAwb+OMY04nUVRRfryFGjqZjwCBVvx3gaE4bmqR/3uAfAp2cukeNpDJVdYj8d1h1AuvfwmEb5KszPkMqX6tqDKc7JoFGUEi7Az7GVR35z4MTEBy/Pv3rz0w+0CZeBZZwrp6ajxIXBlMwaMT2l6wh9lUHMRcnejpjSDYrJoND2GksMGquOY+iu7exIY/m2ayyzaKwaqi4YNNd3obFy2zVWGDTW+7Il296uaoX6LmisMugkKIpouJqwI5202+5FjUFjTfQ8S7OMHWms33aNdQaNJd3qqoq8q5pq3HaNDRaNNcFzRafLoLGtaF2JdlzReDFSaFw1NTTeRMf1XBVLNcSux+KHnXOVBddQLEm6DVxVSxf6nubdPNfFPLNhCCqWdRxBOHARIj3wNCNf1YbIT46xj3CVi6WxA5jmMAb7MRzeWUqQtQhuGi6Mf/H4xxGIY/hhh3xbjMMXj5998BFDrsiSZnuiYjPoZLiC7fV3rVM+zTFI9uEY72eI1KA4baPWnZZyiYYu2oLFlK6u2C3OzqtyLURaytXME8Zvv//+9fOr8y8unj1lWKjqeroraMpWvliMFAutmoq9WDp9aJohGzrLN7o2M7asLrVj6MMbM8/8gBgqQyAH6BRwB5RlZ8l/1HgFrSO0NH29Wws7e5jGUQoa+zvbLgwuQ26YiBGX2SOvn39z8eWT0ik3tbAzvIzMuiuXbkRndSfW+1rRlb7nKExng00SeDuXXcK1qwiWJi99hmme4uiaRfNkJ1wXt2u78+Dr35+8+vPXJTeMSNVGxDuPOsiMyILRYahR/qMoxxBNSREuTbdox+vy4UGNem06MPB+8/0/L7/9ZdluM+JvV6SX539c/P0dg7eFru3alrhUs1VH6kuqPD/gULUcRVAdd51fFiM35m21L3ueJNOJGlwFQ1FFxZ0beQ3Xcrs3WkDV1FjA4qfrx8RZR4QYOSlko3JX0nFS9ozi07juJ8xih2HdVjy65mcDGlmyljCbK5rbf/H109fPf7u6FjfA2R5Rq47sCZq2JL/ueo5o2VfK//8oXf0g8K4rvcf0c4DrGX25v3TElmzV1foiLe47tfrGZf16xWbiLMlTh/yTCmauWA4CfDST+jopimUNjz8nwQnxhSQp9LmgOSLXqqFUWZoNP/EpIoYZaVfKLigajvD89gRiDJP5fQwGjegI+CEg8+oCfSRmDiDEjdvhGBe31XQBjKle1cmE9imaQxjcR/SnOJOeho4iHBCWslYM4ut1F5flD3P8/B+MDv4DAAD//wMAUEsDBBQABgAIAAAAIQC29GeY0gYAAMkgAAAVAAAAd29yZC90aGVtZS90aGVtZTEueG1s7FlLixtHEL4H8h+Guct6zehhrDXSSPJr1zbetYOPvVJrpq2eadHd2rUwhmCfcgkEnJBDDLnlEEIMMcTkkh9jsEmcH5HqHkkzLfXEj12DCbuCVT++qv66qrq6NHPh4v2YOkeYC8KSjls9V3EdnIzYmCRhx719MCy1XEdIlIwRZQnuuAss3Is7n392AZ2XEY6xA/KJOI86biTl7Hy5LEYwjMQ5NsMJzE0Yj5GELg/LY46OQW9My7VKpVGOEUlcJ0ExqL0xmZARdg6USndnpXxA4V8ihRoYUb6vVGNDQmPH06r6EgsRUO4cIdpxYZ0xOz7A96XrUCQkTHTciv5zyzsXymshKgtkc3JD/beUWwqMpzUtx8PDtaDn+V6ju9avAVRu4wbNQWPQWOvTADQawU5TLqbOZi3wltgcKG1adPeb/XrVwOf017fwXV99DLwGpU1vCz8cBpkNc6C06W/h/V671zf1a1DabGzhm5Vu32saeA2KKEmmW+iK36gHq92uIRNGL1vhbd8bNmtLeIYq56IrlU9kUazF6B7jQwBo5yJJEkcuZniCRoALECWHnDi7JIwg8GYoYQKGK7XKsFKH/+rj6Zb2KDqPUU46HRqJrSHFxxEjTmay414FrW4O8urFi5ePnr989PvLx49fPvp1ufa23GWUhHm5Nz9988/TL52/f/vxzZNv7XiRx7/+5avXf/z5X+qlQeu7Z6+fP3v1/dd//fzEAu9ydJiHH5AYC+c6PnZusRg2aFkAH/L3kziIEMlLdJNQoAQpGQt6ICMDfX2BKLLgeti04x0O6cIGvDS/ZxDej/hcEgvwWhQbwD3GaI9x656uqbXyVpgnoX1xPs/jbiF0ZFs72PDyYD6DuCc2lUGEDZo3KbgchTjB0lFzbIqxRewuIYZd98iIM8Em0rlLnB4iVpMckEMjmjKhyyQGvyxsBMHfhm327jg9Rm3q+/jIRMLZQNSmElPDjJfQXKLYyhjFNI/cRTKykdxf8JFhcCHB0yGmzBmMsRA2mRt8YdC9BmnG7vY9uohNJJdkakPuIsbyyD6bBhGKZ1bOJIny2CtiCiGKnJtMWkkw84SoPvgBJYXuvkOw4e63n+3bkIbsAaJm5tx2JDAzz+OCThC2Ke/y2EixXU6s0dGbh0Zo72JM0TEaY+zcvmLDs5lh84z01QiyymVss81VZMaq6idYQK2kihuLY4kwQnYfh6yAz95iI/EsUBIjXqT5+tQMmQFcdbE1XuloaqRSwtWhtZO4IWJjf4Vab0bICCvVF/Z4XXDDf+9yxkDm3gfI4PeWgcT+zrY5QNRYIAuYAwRVhi3dgojh/kxEHSctNrfKTcxDm7mhvFH0xCR5awW0Ufv4H6/2gQrj1Q9PLdjTqXfswJNUOkXJZLO+KcJtVjUB42Py6Rc1fTRPbmK4RyzQs5rmrKb539c0Ref5rJI5q2TOKhm7yEeoZLLiRT8CWj3o0Vriwqc+E0LpvlxQvCt02SPg7I+HMKg7Wmj9kGkWQXO5nIELOdJthzP5BZHRfoRmsExVrxCKpepQODMmoHDSw1bdaoLO4z02Tker1dVzTRBAMhuHwms1DmWaTEcbzewB3lq97oX6QeuKgJJ9HxK5xUwSdQuJ5mrwLST0zk6FRdvCoqXUF7LQX0uvwOXkIPVI3PdSRhBuENJj5adUfuXdU/d0kTHNbdcs22srrqfjaYNELtxMErkwjODy2Bw+ZV+3M5ca9JQptmk0Wx/D1yqJbOQGmpg95xjOXN0HNSM067gT+MkEzXgG+oTKVIiGSccdyaWhPySzzLiQfSSiFKan0v3HRGLuUBJDrOfdQJOMW7XWVHv8RMm1K5+e5fRX3sl4MsEjWTCSdWEuVWKdPSFYddgcSO9H42PnkM75LQSG8ptVZcAxEXJtzTHhueDOrLiRrpZH0Xjfkh1RRGcRWt4o+WSewnV7TSe3D810c1dmf7mZw1A56cS37tuF1EQuaRZcIOrWtOePj3fJ51hled9glabuzVzXXuW6olvi5BdCjlq2mEFNMbZQy0ZNaqdYEOSWW4dm0R1x2rfBZtSqC2JVV+re1ottdngPIr8P1eqcSqGpwq8WjoLVK8k0E+jRVXa5L505Jx33QcXvekHND0qVlj8oeXWvUmr53Xqp6/v16sCvVvq92kMwioziqp+uPYQf+3SxfG+vx7fe3cerUvvciMVlpuvgshbW7+6rteJ39w4Byzxo1IbtervXKLXr3WHJ6/dapXbQ6JX6jaDZH/YDv9UePnSdIw32uvXAawxapUY1CEpeo6Lot9qlplerdb1mtzXwug+Xtoadr75X5tW8dv4FAAD//wMAUEsDBBQABgAIAAAAIQDlI7CA9QMAAKALAAARAAAAd29yZC9zZXR0aW5ncy54bWy0Vttu2zgQfV9g/8HQ8zq6WHZsoU4R3zYp4nZRebHPlETZRHgRSMqu8/U7pETLu3ELp0VeEmrOzJkh53DoDx+/MdrbY6mI4FMvvAm8Hua5KAjfTr2/N6v+2OspjXiBqOB46h2x8j7e/f7bh0OisNbgpnpAwVXC8qm307pKfF/lO8yQuhEV5gCWQjKk4VNufYbkc131c8EqpElGKNFHPwqCkdfSiKlXS560FH1GcimUKLUJSURZkhy3/1yEvCZvE7IQec0w1zajLzGFGgRXO1Ipx8Z+lg3AnSPZ/2gTe0ad3yEMrtjuQcjiFHFNeSagkiLHSkGDGHUFEt4ljl8RnXLfQO52i5YKwsPArs4rH76NIHpFMMrxt7dxjFsOHyLPeUjxNp7RiYd0BxuOfq6YMwKF30YxdHWoI+t2pOg1PW6gJ5JJJJsb1DaY5cnjlguJMgrlQKN70Kuerc78hS2bf3YJOe/gIr8IwXqHpMIyBzXDFAgCzzdABtXBaFiIz0KntZSi5sUDRmD7LrwSQrcwKFCUqUYa8iZbiRjc/amXU4x4Q1/gEtVUb1CWalGB0x7B1m+jNnu+QxLlwJZWKAcdzwXXUlDnV5i0c5gjEmTeRtipYla1wqvlEzqKWp8haTOxgIEjBofznym0FgWMFAiV5PoumgBbTTg8L+H/iQRMWEkKvDFNSfWR4hVsJiUv+J4Xn2qlCTDaWfQLFfyoAMxN5i8go82xwiuMdA3H9k7JbGdWlFRrAqKQj7wAWb1bMlKWWEICAkJbg5yIFAd7zo1S3ysvKOwfcIZbPNiATJ9nQmvBHo7VDs761zpp9e+fyxme50K5xVe4YifXYBEHw8WyqdSgHRJEo9FicAkJV9Eyvr+EjJfBfDW7hMxm0WB+ewmZx6NJNLmILMPJ+GIFCyhiPL+IfHc/q0kc39qe+KcTYYl5dv+SbmWuVY81EXPEMklQb20eZt94ZPJ5RrjDMwzzFJ8jaZ05sN9vAMUQpStosANsc1hSEFUtcGnXdI3ktuNtPeRFK8y8TycuM26x/BMGZ9WgB4mq5ro4lzCO20jC9RNhzq7qLHVRHF6AMwim8Je9tOfUHc8h0SA/O3aekJWx9cW8P/9shIeR0veKoKn3sjOmRvlUpka1eI2qqhF/tg2nHiXbnQ5NmIavAn7S2Y9sG7VYZLGowewHys1mwbtddLbI2c78Bs426Gyxs8Wdbehsw842craRse1g3ElK+DPcQ7c09lJQKg64eOjwVyb3SuUERJAeWdY9PjcNRomCwVDBO6WFdNgfFgvjpBD5o3ls48Y+nIwXy8mg0XY4tO+btrMDjvYrLmdI4aJRt/tpffcvAAAA//8DAFBLAwQUAAYACAAAACEAQMH/8TkBAAAjAwAAFAAAAHdvcmQvd2ViU2V0dGluZ3MueG1snNJfT8IwEADwdxO/w9J36CCykIVBYgzGF2OifoDS3aCx7S294sBP720CYnhhvvT//XLXdrbYOZt8QiCDvhCjYSoS8BpL49eFeH9bDqYioah8qSx6KMQeSCzmtzezJm9g9Qox8klKWPGUO12ITYx1LiXpDThFQ6zB82aFwanI07CWToWPbT3Q6GoVzcpYE/dynKaZODDhGgWrymh4QL114GMXLwNYFtHTxtR01JprtAZDWQfUQMT1OPvjOWX8iRndXUDO6ICEVRxyMYeMOorDR2k3cvYXmPQDxhdApmHXz5geDMmR544p+znZyTHlmfO/ZM4Agn7E5JgH7V1bkdP509pjUCvLEr9RwtecdHDbcrZt1w35+Jx/LdbROPMFSwz3ARuCINtlZS02L8+PPJF/vvb8GwAA//8DAFBLAwQUAAYACAAAACEAOdtFTLkFAAAnWgAAEgAAAHdvcmQvbnVtYmVyaW5nLnhtbOyczW7qRhiG95V6D8j7xP8/oEOOwECV6rQ60knV9WAGsGKPrbGB0FV7Ke266q430EvpDfQWOuOxzZ9DbIMw5MwmDuP5Xs/3zjfDk0nCh48vvtdaQhy5AeoK8r0ktCBygomLZl3hp6fRnSW0ohigCfACBLvCGkbCx4dvv/mw6qCFP4aYdGwRDRR1VqHTFeZxHHZEMXLm0AfRve86OIiCaXzvBL4YTKeuA8VVgCeiIslS8l2IAwdGEdGxAVqCSEjlnJdyahMMViSYCmqiMwc4hi8bDbmyiC62RetQSKkhRDJU5EMptbKUIdJRHQhptYTIqA6U9HpKBckZ9ZSUQyWznpJ6qGTVUzooJ/+wwIMQInJzGmAfxOQlnok+wM+L8I4IhyB2x67nxmuiKRmZDHDRc40RkahcwVcnlRVM0Q8m0FMnmUrQFRYYddL4uzyeDr3D4tNLFoHL5M9CBoGz8CGKk8xFDD3iRYCiuRvmK9yvq0ZuzjOR5bEklr6X9VuFcsnl8tr2NGBWbgTLDD/13/fYyI8rylKJGaESeUSZIew+MxuJT6pw8+Ba1myZK5fcQDIB5UDAcGDJDT/TsFIN0dmsUKrjllwamQ6bFarjboyVS+5j+4PZEohgNQk9G0e09rcyCmenle13OFiEGzX3NLXHzSa0ojxQQSst/+0lGZ02mC9zEJK9yXc6jzMUYDD2yIhIMbdIPbaSGaBfybTSS/ItfGnRjUB4IPwCxlGMgRP/uPBbO68eSQERDiIiHQwJ/GDayFCnN40h7mMInmkXqoIiKt9ZAo+0jJS+ItuKINI7/sKL3U9wCb2ndQizPkmrR1tZr9gPveyeatvSUJE0dsdb0hsuuWTPSsaSdZZZL0JhIz9vHC88D8Z5/BN8yW/9++sfefv3TtbqwWnaPfyM6cVFNB3a3BU0hdrQmQM0S3iQviZ9xbwzTi+jAMURNTFyXFJgP5PelCCjJLpHLNpvcxGRn8ApIG6wx4+Tr25uJWuNfskalCRfMX2mmKSx75J8ukv//F7VJEu7nEkbO2T9bTuU0+3477e/q/ohK8alDDmevnqO9P+snL5hXUf6bJM7Mf2/qqavyNJ1pK83UvyKfrEt83j6RiPFr7QvthkeT99spPhV9Uq2PquR4lfNxrY+cQfg6DOO0p1ch+4Uua1LumWw/KvTXbsvGX1LS+O3p+sMdJc+r/xkXRPblYEZznY7dnC2Oz19znbV0udsx9mOsx1nuwunX5HtlDpsp2rKSB5ItdlOaxu2aitWbms+Xfzk7kIndzXW9OXwjsMchzkOc4Xpc5hroPg5zHGYuwWYU2vBXNvWTcsasvyLYW6+HmN38sMRpDN7pqbpmpabm09a4l0cek5XsI2BNVRNu8Y0hl/itZeP55MbxZ8BBjMMwnnhPH8FJ3y5rZakS0N5dAZ2fl9nfrlBw/5Is4b9s7x5XDM4VrWI7hepRZImtSVJYlUFUQxidwnP9JPGLcPmvkHMsjMbdMs4um8QazmzQbcMrPsGXccSuyKk3TfoOpbYFUHvvkHXscRuB4vpLl4HiwdqXxqw/KufcQ7aQ0Oib/2ZrfmEvv8zTn6ayU8z+WkmP818M31+mtlA8fPTTH6aeQvYRjG3Mrbplq0aZttm+VfHNsM2FG3YTk9Dt6frDNhWY7FybOPYtsmeYxvHNo5tHNsaTZ9jWwPFfzvYRk+8K2ObOVBHqmFpLP/q2NYb9CRTVtL47el679jGIe317DmkNVD6HNI4pHFI45DWaPoc0o5DGv2te3VIG/ZNc9QbsPyrQxrZGwzLlL/Kf/vgZ2sc2zi2cWx7M32ObQ0UP8c2jm1Xgm0owTWUffIKbdphtywjNZVDBWHsDbQwLPmf3VfC2BtPYVj2x+RFYQefD7gJM4+EsY2uMEw7EsY2iMKw5JMEXwljC6swLJvrojBWkIVhGcYlYezKIPrhfwAAAP//AwBQSwMEFAAGAAgAAAAhAPiVyO/8DgAA85kAAA8AAAB3b3JkL3N0eWxlcy54bWzsXd9zo0YSfr+q+x8oPSUPG/+QLTtbcVJr2T67btdxVt5L3eMIRhZnYHSA1uv89TczDAjUDKKHjuu8m6RqLQH9MczXX890A5qffvkSR95nnmahSM5GBz/sjzye+CIIk4ez0af7qzenIy/LWRKwSCT8bPTMs9EvP//9bz89vc3y54hnngRIsrexfzZa5vnq7d5e5i95zLIfxIoncudCpDHL5df0YS9m6eN69cYX8Yrl4TyMwvx573B/fzIyMGkfFLFYhD6/EP465kmu7fdSHklEkWTLcJWVaE990J5EGqxS4fMskxcdRwVezMKkgjk4AkBx6KciE4v8B3kxpkUaSpof7OtPcbQBOMYBHAKAic+/4DBODcaetKzjhAEOZ1LhhEENx60xNYCM4yCOy3Zkz7G6oth/e/OQiJTNI4kkOfJkN3saWP0rW6v+6I/y8J+lwwbCv+ALto7yTH1N71Lz1XzTf65Ekmfe01uW+WF4L9slweNQnuf6XZKFI7mHsyx/l4WsvvPSbFP7l+rAVks/y2ubz8MgHO2pk2Z/yJ2fWXQ2Ojwqt0xVIxrbIpY8lNt48mZ6W2/M2eiPpdk0l7hnI5a+mb1Thnvm2oq/tSteVd+Ko7a6R+pJqmtWiFzu5Yv3wn/kwSyXO85G++pUcuOnm7s0FKkU8tnoxx/NxhmPw+swCHhSOzBZhgH/fcmTTxkPNtt/u9JiNBt8sU7k5/HJRFMWZcHlF5+vlLTl3oSp3rtVBpE6eh1uTq7N/1uCHZg+a7Nfcqbim3ewDaGbj4I4VBZZ7WrbMddb166PQp1o/FInOnqpEx2/1IkmL3Wik5c60elLnUjD/JknCpOAfymECE8DUHfhWNSIxrGIDY1j0RIaxyIVNI5FCWgci6OjcSx+jMaxuCkCJxe+zQtrzj62eHs37u4xwg1395Dghrt7BHDD3R3w3XB3x3c33N3h3A13d/R2w90drPG4xVTLu5EyS/LBKlsIkSci517OvwxHY4nE0kkfDZ4a9HhKcpEEMEVkMwPxYDSf6e+7PUSL1H08z1U25omFtwgf1inPBjecJ595JLN2jwWBxCMETHm+Ti094uLTKV/wlCc+p3RsOtAoTLiXrOM5gW+u2AMZFk8C4u4rEUmCQuXQbJ0vlUhCAqeOmZ+K4U0TjCw+vA+z4X2lQLzzdRRxIqxbGhfTWMNzAw0zPDXQMMMzAw0zPDGocUbVRQaNqKcMGlGHGTSifiv8k6rfDBpRvxk0on4zaMP77T7MIx3i67OOg/61u2kkVJl+cDtm4UPC5ARg+HBjaqbeHUvZQ8pWS0+VkNth69eMPc+5CJ69e4oxrUKimtdrF5nKqw6T9fAObaBRiavCI5JXhUcksApvuMQ+yGmymqBd0+Qzs/U8bxWtRuol2hmL1sWEdrjaWD7cwzYCuArTjEwG7bAEHnyrprOKTorIt2nl8IZtsIbLajsqkTbPQBK0MhL+I00Yvn5e8VSmZY+Dka5EFIknHtAhzvJUFL5Wl/yhpqSX5C/j1ZJloc6VGhD9h/ryBr/3ga0GX9BdxMKEhrfLNzELI49uBnF9/+G9dy9WKs1UHUMDeC7yXMRkmKYS+N3vfP49TQPfySQ4eSa62ndE5SENNg0JBpkCSQRESHKaGSYhyRiq8f7Jn+eCpQEN2l3Ki2dqck6EOGPxqph0EGhLxsUnGX8IZkMa718sDVVdiEpU9yRgtbJhtp7/h/vDQ92t8EgqQ7+uc11/1FNdbU0HN3ya0IAbPkXQbMrhQfkvwcU24IZfbAOO6mKnEcuy0HoL1RmP6nJLPOrrHZ78GTwRiXSxjug6sAQk68ESkKwLRbSOk4zyijUe4QVrPOrrJXQZjUdQktN4/0jDgIwMDUbFhAajokGDUXGgwUgJGP6ETg1s+GM6NbDhz+oUYERTgBoYlZ+RDv9Ed3lqYFR+psGo/EyDUfmZBqPys/GFxxcLOQmmG2JqkFQ+V4OkG2iSnMcrkbL0mQjyMuIPjKBAWqDdpWKhXrYQSfEQNwGkqlFHhJPtAo6K5N/5nKxpCouyXQQVURZFQhDV1jYDjrZsPru2y0y/czG4CXcR8/lSRAFPLddkt5X58mzFfFOmB7f7epU934cPy9ybLatqfx1msr/TskzYG2a7T9jW55PDDrMPPAjXcdlQ+DLFZNzfWHt0w7h856XDeDOTaFge97SE55zsttzMkhuWJz0t4TlPe1pqnTYsu/RwwdLHVkc46fKfKsezON9JlxdVxq2n7XKkyrLNBU+6vKghFe+d76u7BZCdfpqx2/cTj90eoyI7CkZOdpTeurJDdAnsI/8cqpEdEzT1+aqnJ0Dc15PoXpHzt7Uo6vaNG079X+q6kROnJONeK864/42rRpSx92PvcGOH6B137BC9A5AdolckspqjQpIdpXdsskP0DlJ2CHS0giMCLlpBe1y0gvYu0QqiuESrAbMAO0Tv6YAdAi1UCIEW6oCZgh0CJVRg7iRUiIIWKoRACxVCoIUKJ2A4oUJ7nFChvYtQIYqLUCEKWqgQAi1UCIEWKoRACxVCoIXqOLe3mjsJFaKghQoh0EKFEGih6vniAKFCe5xQob2LUCGKi1AhClqoEAItVAiBFiqEQAsVQqCFCiFQQgXmTkKFKGihQgi0UCEEWqjFq4buQoX2OKFCexehQhQXoUIUtFAhBFqoEAItVAiBFiqEQAsVQqCECsydhApR0EKFEGihQgi0UPXNwgFChfY4oUJ7F6FCFBehQhS0UCEEWqgQAi1UCIEWKoRACxVCoIQKzJ2EClHQQoUQaKFCiC7/NLcobY/ZH+CrntYn9vvfujKN+lh/lbsONe4PVbbKjtX/XYRzIR691hcPxzrf6AcSzqNQ6BK15bZ6HVc/EoG68fnrtPsNnzr6wB9dMu9C6HumAPyoryWoqRx1uXzdEiR5R12eXrcEs86jruhbtwTD4FFX0NW6LB9KkcMRMO4KMzXjA4t5V7SumcMu7orRNUPYw12RuWYIO7grHtcMjz0VnLetj3v206R6vhQgdLljDeHEjtDllpCrMhxDYfQlzY7Qlz07Ql8a7QgoPq0weGLtUGiG7VBuVEOZYal2F6odAUs1RHCiGsC4Uw2hnKmGUG5Uw8CIpRoiYKl2D852BCeqAYw71RDKmWoI5UY1HMqwVEMELNUQAUv1wAHZCuNONYRyphpCuVENJ3dYqiEClmqIgKUaIjhRDWDcqYZQzlRDKDeqQZaMphoiYKmGCFiqIYIT1QDGnWoI5Uw1hOqiWldRGlSjGK6Z4yZhNUPcgFwzxAXnmqFDtlSzdsyWagiO2RLkquQcly3VSbMj9GXPjtCXRjsCik8rDJ5YOxSaYTuUG9W4bKmNaneh2hGwVOOyJSvVuGypk2pcttRJNS5bslONy5baqMZlS21UuwdnO4IT1bhsqZNqXLbUSTUuW7JTjcuW2qjGZUttVOOypTaqBw7IVhh3qnHZUifVuGzJTjUuW2qjGpcttVGNy5baqMZlS1aqcdlSJ9W4bKmTaly2ZKcaly21UY3LltqoxmVLbVTjsiUr1bhsqZNqXLbUSTUuW/ogTUKCn4CaxSzNPbrfi7tm2TJnw3+c8FOS8kxEn3ng0V7qe9RV7j01lr9S2Hq1O3l8LvtM/QJ67XWloPgFWAOoD7wJqmWqlLFqiWeW7jKbdYPN7Vr9Oc1kTm2O2d8/Pz8cT43UVsXSZFnxZqk8Rv1a0dloPNGvJKkvH9dqDTS2zoVpvTbZM43Z0fyqweb+8wFo8mbBLN2eOZM99avqYXBBifqxxZbtysnK7eVppkuWFns37l8eYwRu75+Lo/3ji8tG/zxyvrqV59fb1BfJOc/0t03XzdXvlHG1qJoRvyh+/On956gCr/ehZWE4qcRyrTrv3+yaNxaGa92pV4Vr3eNnZ6P7MOaZd8ufvI8iZon3nemkzJvOvje9rv/1VfjYdIP6T2HodeV0aDkbqd+9N0xtFpYrb5TXF5Yb60hTWx/OxVsOrd5i4hiNtxz28JamlP9kB7L7TxlBvir/GZuJQ2NhQr1toP+Mrf5jHgqh8Z/x6/GfUpVfl/9QxJojq6+Y6EbjK0evx1e0Rv5ffSWcFhfk7DPlSDzEZ46tPmMeAKPxmePX4zNaK19DfBnoGcUKs22eYcY6Gs+YvB7P0Ir4yzMeTqyeYTIyGs84eT2eUc70vppxZqCHnFo9xBS3aDzk9PV4iFbGq4gdhyfq/3bPKDfeh2oV8gtDZiPp6ek+vmSO+eYnxy0VIrN0UPXbN3rhoG3HsqwvZHGKchJVlbnafcTe7lzVKTvarOuYnaWtotRp9VrjtrtaKNszjwonkh9uEuXET2aV96KlwRdWQMn9Ux5FH1hxtFjZD434QmlP7j3Y1780ubV/XiyaYLVPdXXdCrDXbEzxtdtPimUUw+K1D2slUZWQW7pbv4M0tKd7+rC/zmTXzNQB2+1rVPS2W2l2egfeJphtRcdWHdhiovFwazy0B7y/KnlIQouim43QQyJCTZ3wmyV0SGkNSWhRBbMROiYi1BTuvl1C/xw1FmUpG3lHROSZ6PLqyXup4hOSxKJOZCPxmIhEU9r6phRITlVRuLFRNSGiygT/v6gaQlVRSbFRdUJElSn+fJOhkZyyorRho+yUiDKTwH9d6nqZAkaj/tXBp17ibptHvbGNvX5Pv5xe7k+vzoujTEFpdR7U0nt9nFoI2qyb9oe6raE+rJhftlD32eapmCr532GrPwPbqjDgdOaybOBwalVSM5eeLasu8iPOCqHVjpZfF2Ek916eXE4u9YNl2heu9MY58x8fUrFOgn43mKciyUTE9O+BbFx8FsaztX4oy3h2/bBWl9aLsFbuHDFdT9QXwZM3n2a0weUmUWXJVpes7cKFFWuRrZ//EnVv0eagCgKJSCof0mHb+JD+DByQ1HVoWNwMCNVTiNuUbfYMZayshbWUGZvMTS8Pfjw1CaxhrjlMHk/G002YNbF32WzoujzaSH1A52weiCyfh9zupJZHJql6a3eNFtd5k/3jy+Mp1iMPLq4uLhzGrKoPVZF08/vy2/2nn87d7G7ru/qgBXtrbFJm1F2XZB0XH8Jo68kfve+msi5Ha2MAwnZPKZafsp//BwAA//8DAFBLAwQUAAYACAAAACEAzJJQVH0BAADxAgAAEQAIAWRvY1Byb3BzL2NvcmUueG1sIKIEASigAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjJLLTsMwEEX3SPxD5H1qJ+WlKE3FQ6yoQKIViJ2xJ60hsS17IPTvcZI2JYgFO4/n+GRy7Xz+VVfRJzivjJ6RZMJIBFoYqfR6RlbL2/iCRB65lrwyGmZkC57Mi+OjXNhMGAcPzlhwqMBHwaR9JuyMbBBtRqkXG6i5nwRCh2ZpXM0xlG5NLRfvfA00ZeyM1oBccuS0FcZ2MJKdUopBaT9c1QmkoFBBDRo9TSYJPbAIrvZ/Hug6P8ha4dbCn+i+OdBfXg1g0zSTZtqhYf6EPi/uHrtfjZVusxJAilyKDBVWUOT0sAwr//H6BgL77aEIa+GAo3HFQglnvCkxui9LJSBaeXAdvSfa7N9h2xgnffCMqoBJ8MIpi+FG+6+MNgJdcY+LcMWlAnm1LS5Pz9OzTvOr0bIOPlX7NoqkI4Yy3wXdDwUyCgFlfZz7ztP0+mZ5S4qUpUnMTuIpW7I0O00zxl7auUbnD8J6N8A/jdOMnYyNe0EfzfiRFt8AAAD//wMAUEsDBBQABgAIAAAAIQAiURHx1QEAAN4DAAAQAAgBZG9jUHJvcHMvYXBwLnhtbCCiBAEooAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJxTwW7bMAy9D9g/GLo3crKh6AJFxZBi6GFDA8Rtz5xMJ8JsSZDYINnXj7YTT9l2mk/vkfTTE0mp+2PXFgeMyXq3EvNZKQp0xtfW7VbiufpycyeKROBqaL3DlThhEvf6/Tu1iT5gJIupYAmXVmJPFJZSJrPHDtKM044zjY8dENO4k75prMEHb946dCQXZXkr8UjoaqxvwiQoRsXlgf5XtPam95deqlNgPa0q7EILhJrOYFZ7Oio5xVXlCdrKdqjnJccnpjaww6TnSo5AvfpYJ724U3JEar2HCIa4h3p++0HJjKvPIbTWAHF39Tdrok++oeJpsFz0/yuZlyi+xhbNW7R00mwjp+qrdaOREbCxCLsIYX92NzG1NdDimhugG2gTKvk7oB4R+uFuwPb+DrQ8oCEfi2R/8ngXovgOCfu2rcQBogVHYiwbyYDbkCjqylLL2hMfYF6WY/uxNzmC68KBDB4YX7sbTkhPDd+N/mF2npsdPIxWMzu5s8sZf6iufRfAcX/lhLjBP9JzqPxDvxrnHl4Hs6m/WtpvA5h+OJ/KfP5ZRm05ijUPdJrJFFCPfIPY9vr8r9thfan5O9Fv1Mv4XHnbZiV/wwpdYrwI0zvSvwAAAP//AwBQSwMEFAAGAAgAAAAhAIg/pb/hAAAAVQEAABgAKABjdXN0b21YbWwvaXRlbVByb3BzMS54bWwgoiQAKKAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJDBasMwEETvhf6D2bsiObFdEyyHuE4g19JCroq8tgWWZCS5tJT+e2V6So89LbPDzhu2OnzoKXlH55U1HNINgwSNtJ0yA4e31zMpIfFBmE5M1iAHY+FQPz5Und93IggfrMNLQJ3EhYrz0nL4ykvW5E87Rsr2nJLilDXkmKUNKTKWt8fnU8pY8Q1JRJsY4zmMIcx7Sr0cUQu/sTOaaPbWaRGidAO1fa8ktlYuGk2g25hA5RLx+qonqNc+v9cv2Pt7uVZbnPov5aZuk7KDE/P4CbSu6B/Uqu9eUf8AAAD//wMAUEsDBBQABgAIAAAAIQDBJ8sItgAAACEBAAATACgAY3VzdG9tWG1sL2l0ZW0xLnhtbCCiJAAooCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACskE0OgjAQRq9CegCKLlgQfmKiWzEhcV/KAE3aGdIOBm5v1egJXE7mfS/zTdlsziYP8MEQVuKQZiIJrHBQlhAqgSSauuyLjlavISSRxlD0lZiZl0LKoGdwKqS0AMbdSN4pjqOfJI2j0XAmvTpAlscsy2Vvemto8mqZd/GR/UfVgQXNMHS823i2PN1Ondl4vgyGY7P2LWjRGoR0CzYGXuBVuQhHViT37wtyUZfyV7h+AgAA//8DAFBLAwQUAAYACAAAACEAdD85esIAAAAoAQAAHgAIAWN1c3RvbVhtbC9fcmVscy9pdGVtMS54bWwucmVscyCiBAEooAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIzPsYrDMAwG4P3g3sFob5zcUMoRp0spdDtKDroaR0lMY8tYamnfvuamK3ToKIn/+1G7vYVFXTGzp2igqWpQGB0NPk4Gfvv9agOKxcbBLhTRwB0Ztt3nR3vExUoJ8ewTq6JENjCLpG+t2c0YLFeUMJbLSDlYKWOedLLubCfUX3W91vm/Ad2TqQ6DgXwYGlD9PeE7No2jd7gjdwkY5UWFdhcWCqew/GQqjaq3eUIx4AXD36qpigm6a/XTf90DAAD//wMAUEsDBBQABgAIAAAAIQDrgGBMUwMAAI8OAAASAAAAd29yZC9mb250VGFibGUueG1szJbPb9MwFMfvSPwPUU7jwJqkXZdV66Y2WzQk2IEVAUc3cVqL2I7itF3/AA6IE+LI38C4gwb/DNPYf8FznLRZm25LQbBGzY9n+5vnT57f8+7+KQ21MY4F4aytm5uGrmHmcZ+wQVt/0XMf27omEsR8FHKG2/oUC31/7+GD3Ukr4CwRGoxnokW9tj5MkqhVqwlviCkSmzzCDBoDHlOUwGM8qFEUvxlFjz1OI5SQPglJMq1ZhtHUM5n4Lio8CIiHD7g3opgl6fhajENQ5EwMSSRytcld1CY89qOYe1gImDMNlR5FhM1kzMaSECVezAUPkk2YTOZRKgXDTSO9o+FcYKuagLUk0PTwaTUNO9OowciiDvGr6TRnOsQv6KznTEFA4GoSW7kfYkrljKjXejJgPEb9EJTgG2mAWUuF5Rm8lZf0FrrvZfGqTVoMURjwEj62DHKRNkWIcYFNaB2jsK0bW8bST6/Jjt4QxQJLmbRj40CZA0RJOM2tPvbAr4SMsWqNSOIN88Yxion0WTUJMoCGkegb8Fb1q+vKYsJyzN+tLNasT26pX7d4qY6tDGZmMQt94J01BWIJSI9QLLRjPNGec4pYKRYLjqZRBzwN+Ftw1yjFktO6jiVOdasQgaVoWB17e04km9syEfsmIoqH61Yj4qCQ9GOygoSbEpBHAzhYlUiICRGiEomOdNY6TGegSDSkwdjuVosN9bxTkcQBZoNXJAsKFCbHYM19vvz87vLrj2wyS5RMiBcIabhmRyklu1lGCY0SvgakbgFS3XbcbcftLEIym7dAknQrQnqWZy/tNTrCKmwWWF18P/t1/uXq09urbx9WEetCXMl4knGVnisQqx5X6XqyiivM6jhu3dmy1kFmVkS2kHO0jSOM0qSsOSePygAuJqmVDJsZvWyF/oUs5eMAjcLkxoQB+w8eovKSorzaWTNjUO7juMytgJxif/m7HsrSYamMN88XrjOzzPPFzu2Zs2q+OCH0ZFSaLS7O3v88/3gvskU2j0K5tWzbzadfOVv8WbnVNrrcn96PsGc86cUj3JtGeK1lkFcL7SkZDJPVNSNrvw+x8H8rR7bRKPAq226oovBvthuHEkenmD4caWmUbDfukD5u3XhlN2LvNwAAAP//AwBQSwECLQAUAAYACAAAACEAZPVj7oEBAAApBgAAEwAAAAAAAAAAAAAAAAAAAAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAIAAAAIQAekRq37wAAAE4CAAALAAAAAAAAAAAAAAAAALoDAABfcmVscy8ucmVsc1BLAQItABQABgAIAAAAIQAzwlu/QQEAAOcEAAAcAAAAAAAAAAAAAAAAANoGAAB3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAE4yjpAWBgAApiQAABEAAAAAAAAAAAAAAAAAXQkAAHdvcmQvZG9jdW1lbnQueG1sUEsBAi0AFAAGAAgAAAAhALb0Z5jSBgAAySAAABUAAAAAAAAAAAAAAAAAog8AAHdvcmQvdGhlbWUvdGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQDlI7CA9QMAAKALAAARAAAAAAAAAAAAAAAAAKcWAAB3b3JkL3NldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQBAwf/xOQEAACMDAAAUAAAAAAAAAAAAAAAAAMsaAAB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQA520VMuQUAACdaAAASAAAAAAAAAAAAAAAAADYcAAB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEA+JXI7/wOAADzmQAADwAAAAAAAAAAAAAAAAAfIgAAd29yZC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhAMySUFR9AQAA8QIAABEAAAAAAAAAAAAAAAAASDEAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhACJREfHVAQAA3gMAABAAAAAAAAAAAAAAAAAA/DMAAGRvY1Byb3BzL2FwcC54bWxQSwECLQAUAAYACAAAACEAiD+lv+EAAABVAQAAGAAAAAAAAAAAAAAAAAAHNwAAY3VzdG9tWG1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",aZ=()=>Tm(cZ);async function uZ(n){return new Promise((t,e)=>{const o=new Image;o.onload=()=>{t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=e,o.src=n})}async function vk(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};const e=await jl(new File([t],"",{})),o=await uZ(e);return o.width===void 0||o.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||o.width*n.height/o.height,height:n.height||o.height*n.width/o.width,buffer:t}:{width:o.width,height:o.height,buffer:t}}function dZ(n,t){let e=n.filter(s=>s!=null);const o=t-(e.length-1)*20,r=.87,i=e.reduce((s,l)=>s+l.width,0);return i>o&&(e=e.map(s=>({width:s.width*o/i,height:s.height*o/i,buffer:s.buffer}))),e.map(s=>({width:s.width*r,height:s.height*r,buffer:s.buffer}))}function yk(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let o;switch(e%3){case 0:o=gt.LevelFormat.DECIMAL;break;case 1:o=gt.LevelFormat.LOWER_LETTER;break;default:o=gt.LevelFormat.LOWER_ROMAN;break}return{level:e,format:o,text:`%${e+1}. `,alignment:gt.AlignmentType.START,start:t,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(e+1)),hanging:gt.convertInchesToTwip(.2)}}}}})}function hZ(){return[0,1,2,3,4,5,6,7].map(n=>{let t;switch(n%3){case 0:t="\u2022";break;case 1:t="\u25E6";break;default:t="\u25AA";break}return{level:n,format:gt.LevelFormat.BULLET,text:t,alignment:gt.AlignmentType.START,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(n+1)),hanging:gt.convertInchesToTwip(.2)}}}}})}function fZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:gt.LevelFormat.BULLET,text:"\u2611",alignment:gt.AlignmentType.START,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(n+1)),hanging:gt.convertInchesToTwip(.2)}}}}))}function mZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:gt.LevelFormat.BULLET,text:"\u2610",alignment:gt.AlignmentType.START,style:{paragraph:{indent:{left:gt.convertInchesToTwip(.3*(n+1)),hanging:gt.convertInchesToTwip(.2)}}}}))}var ju=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(ju||{});const gZ=[{levels:yk(),reference:"number-numbering-reference"},{levels:hZ(),reference:"number-bullet-reference"},{levels:fZ(),reference:"checked-bullet-reference"},{levels:mZ(),reference:"unchecked-bullet-reference"}];function pZ(n){switch(n){case"style-color-0":return"d83931";case"style-color-1":return"de7802";case"style-color-2":return"dc9b04";case"style-color-3":return"2ea121";case"style-color-4":return"245bdb";case"style-color-5":return"6425d0";case"style-color-6":return"8f959e";default:return}}function CZ(n){switch(n){case"style-bg-color-1":case"style-bg-color-2":case"style-bg-color-8":case"style-bg-color-9":return"yellow";case"style-bg-color-0":case"style-bg-color-5":return"magenta";case"style-bg-color-3":return"green";case"style-bg-color-4":case"style-bg-color-11":return"blue";case"style-bg-color-6":return"lightGray";case"style-bg-color-7":return"red";case"style-bg-color-10":return"darkGreen";case"style-bg-color-12":return"darkMagenta";case"style-bg-color-13":return"darkGray";default:return}}function AZ(n){switch(n){case"style-bg-color-0":return"fbbab6";case"style-bg-color-1":return"ffdcb0";case"style-bg-color-2":return"fff7a0";case"style-bg-color-3":return"ceefc5";case"style-bg-color-4":return"d1ddfb";case"style-bg-color-5":return"d9cbf8";case"style-bg-color-6":return"eaeaea";case"style-bg-color-7":return"fe837c";case"style-bg-color-8":return"ffbd6a";case"style-bg-color-9":return"ffe662";case"style-bg-color-10":return"a8f393";case"style-bg-color-11":return"98b5ff";case"style-bg-color-12":return"b394f8";case"style-bg-color-13":return"b1b1b1";default:return}}const bZ=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function kk(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(bZ);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},o=e(t[1]),r=e(t[2]),i=e(t[3]);return`${o}${r}${i}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function tn(n,t){if(n&&n.attributes&&n.attributes[t])return n.attributes[t];if(n&&n.attributes&&n.attributes.box&&n.attributes.inputType&&t==="style-underline")return!0}function wk(n,t,e){for(let o=0;o<=e;++o){const r=`${t}${o}`;if(tn(n,r))return r}}function i1(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function Y2(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function Bk(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function vZ(n){const t=tn(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const o of e){const r=o.split(":");if(r.length!==2)continue;const i=r[0].trim().toLowerCase(),s=r[1].trim().toLowerCase();i==="font-size"&&i1(n,"inline-style-font-size",s),i==="color"&&i1(n,"inline-style-color",s),i==="background-color"&&i1(n,"inline-style-background-color",s),i==="font-family"&&i1(n,"inline-style-font-family",s)}}function yZ(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function kZ(n){const t=`${tn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function wZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` ${n.attributes.text} `;if(n.attributes&&n.attributes.box&&n.attributes.inputType)return n.attributes.value?`${n.attributes.value}`:" "}function BZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function EZ(n){return tn(n,"inline-style-font-family")}function xZ(n){const t=tn(n,"inline-style-background-color");return kk(t)}function IZ(n){const t=tn(n,"inline-style-color");return kk(t)}function TZ(n){vZ(n);const t=tn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!tn(n,"style-code"),link:Bk(tn(n,"link")),size:kZ(n),text:t?BZ(n):wZ(n)||n.insert,bold:!!tn(n,"style-bold"),underline:!!tn(n,"style-underline"),italics:!!tn(n,"style-italic"),strike:!!tn(n,"style-strikethrough"),superScript:!!tn(n,"style-super"),subScript:!!tn(n,"style-sub"),math:tn(n,"type")==="math"?tn(n,"src"):void 0,mention:t,fontFamily:EZ(n),background:xZ(n),color:t?"338fe5":pZ(wk(n,"style-color-",6))||IZ(n),highlight:wk(n,"style-bg-color-",13)}}function DZ(){return[new gt.Paragraph({border:{top:{color:"auto",style:gt.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new gt.Paragraph({spacing:{line:0}})]}function SZ(){return new gt.Paragraph({children:[new gt.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function LZ(){return new gt.Paragraph({children:[new gt.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function MZ(n,t){return new gt.Paragraph({children:[new gt.ExternalHyperlink({children:[new gt.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function Ek(n){if(n.heading!=null)return`Heading${n.heading}`}function xk(n){if(n.alignment!=null){if(n.alignment==="center")return gt.AlignmentType.CENTER;if(n.alignment==="right")return gt.AlignmentType.RIGHT;if(n.alignment==="left")return gt.AlignmentType.LEFT}}function RZ(n){if(n.indent)return{left:gt.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:gt.convertInchesToTwip(.3*n.padding)}}function OZ(n){return{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function _Z(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function Ik(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const o=n.size||t,r=o!=null?Math.floor(o*1.5+.5):void 0;return new gt.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:gt.UnderlineType.SINGLE}:void 0,italics:n.italics||void 0,strike:n.strike||void 0,superScript:n.superScript||void 0,subScript:n.subScript||void 0,size:r,style:e,font:n.fontFamily?_Z(n.fontFamily):void 0,shading:n.background?OZ(n.background):void 0,color:n.color,highlight:CZ(n.highlight)})}function FZ(n,t){if(n.link)return new gt.ExternalHyperlink({children:[Ik(n,t)],link:n.link})}async function Tk(n,t,e,o,r){const i=await r(n,t,e);if(i==null)return;const s=await vk({width:o||0,height:0,src:e},i);return new gt.ImageRun({data:i,transformation:{width:s.width||100,height:s.height||20}})}function PZ(n){if(n.heading||n.heading)return n.heading}function NZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function $Z(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function HZ(n,t){var o;const e=[];if(n.text&&Array.isArray(n.text)){for(let r=0;r<n.text.length;r++){const i=n.text[r];if(((o=i.attributes)==null?void 0:o.box)===!0&&t){const s=await t(i);if(s){n.text.splice(r+1,0,...s);continue}}e.push(TZ(i))}return e}}function jZ(n){if(n.type==="list"&&n.textOnly!==!0)return{checkbox:n.checkbox,groupId:n.groupId,ordered:!!n.ordered,level:n.level||1,start:n.start||0}}function UZ(n,t){if(n.type==="embed"&&n.embedType&&Y2(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(o=>{const r=t(o),i=n.embedData[`${r}_width`],s=n.embedData[`${r}_height`];return{src:o,width:i,height:s}})}function zZ(n){if(n.padding)return n.padding}function VZ(n){return!!(n.type==="embed"&&n.embedType&&Y2(n.embedType)&&n.embedData&&n.embedData.src)}async function s1(n,t,e){return{quoted:!!n.quoted,heading:PZ(n),alignment:NZ(n),indent:$Z(n),padding:zZ(n),texts:await HZ(n,e),list:jZ(n),images:UZ(n,t),border:VZ(n)}}async function WZ(n,t,e,o){const r=[];if(!n.children)return[];for(const i of n.children){const s=[];for(const l of t.blocks[i])s.push(await s1(l,e,o));r.push(s)}return r}const qZ=S("to-docx");function GZ(n,t){return Array(n).fill(0).map(()=>Array(t).fill(0).map(()=>({cellId:void 0,color:void 0,from:void 0,rowSpan:1,colSpan:1,width:0,originalWidth:void 0,align:void 0})))}function ZZ(n,t,e,o){const r=!!n.hasColTitle,i=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let a=0;a<t;a++)for(let d=0;d<e;d++)(r&&d===0||i&&a===0||s&&a%2===1)&&(o[a][d].color=l)}function QZ(n){g(qZ,n.children,"no table children");const t=n.rows,e=n.cols,o=n.colsWidth;if(o)for(let s=0;s<o.length;s++)o[s]===0&&(o[s]=100);const r=GZ(t,e);let i=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(r[s][l].originalWidth=o?o[l]:void 0,r[s][l].from!==void 0)continue;const a=n.children[i];i+=1,r[s][l].cellId=a,r[s][l].color=AZ(n[`${a}_background`]),r[s][l].width=o?o[l]:100,r[s][l].align=n[`${a}_align`];const d=n[`${a}_rowSpan`]||1,h=n[`${a}_colSpan`]||1;if(r[s][l].rowSpan=d,r[s][l].colSpan=h,d>1||h>1){let p=0;for(let A=0;A<d;A++)for(let v=0;v<h;v++)A===0&&(p+=o?o[l+v]:80),!(A===0&&v===0)&&(r[s+A][l+v].from=[s,l]);r[s][l].width=p}}return ZZ(n,t,e,r),r}async function YZ(n,t,e,o,r,i,s,l,a,d){async function h(v){if(l){const B=await l(r,i,v);if(B){await o.addDoc(n,B,d);return}}if(v.type==="text"||v.textOnly===!0){const B=await s1(v,s,a);await o.addTextBlock(B);return}if(v.type==="code"){const B=await WZ(v,e,s,a);await o.addCodeBlockObject(B);return}if(v.type==="list"&&v.textOnly!==!0){const B=await s1(v,s,a);await o.addListBlockObject(n,B);return}if(v.type==="embed"&&v.embedType){const B=v,D=B.embedData,x=B.embedType;if(Y2(x)){const _=await s1(v,s,a);await o.addImagesBlockObject(v,_,d)}else v.embedType==="hr"?o.addSeparatorBlock():v.embedType==="video"?o.addVideoPlaceholder():v.embedType==="audio"?o.addAudioPlaceholder():v.embedType==="webpage"?o.addHyperlinkParagraph(Bk(D.src),D.title):o.addOtherEmbedBlock(x,v.embedData);return}if(v.type==="table"){let B=[];if(v.colsWidth)B=v.colsWidth;else{const x=v.cols;B=new Array(x);for(let _=0;_<B.length;_++)B[_]=100;v.colsWidth=B}const D=QZ(v);await o.addTableMatrix(B,D,e),o.addEmptyParagraph()}}function p(v){const B=[];for(const{type:D,data:x}of v.embedData.exportSpec){if(D==="text"){const _={id:K(),text:[{insert:x}],type:"text"};B.push(_);continue}if(D==="image"){const _={id:K(),type:"embed",embedType:"image",align:"left",embedData:{src:x}};B.push(_);continue}if(D==="link"){const _={id:K(),type:"embed",embedType:"webpage",embedData:{src:x.url,title:x.title}};B.push(_);continue}}return B}function A(v){var B;return(B=v==null?void 0:v.embedData)!=null&&B.exportSpec?p(v):[v]}for(const v of t)for(const B of A(v))await h(B)}function JZ(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const KZ=S("to-docx");class XZ{constructor(t,e,o,r,i,s){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=o,this.readImageFunc=r,this.convertBlocksFunc=i,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new gt.Paragraph({heading:Ek(t),alignment:xk(t),children:await this.paragraphsFromBlockTexts(t),indent:RZ(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new gt.Paragraph({text:`[${L.t("docx.imageExportFailed")}]`,shading:{type:gt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=yZ(this.defaultFontSize,t.heading),o=[];for(const r of t.texts){if(r.link){const i=FZ(r,e);i&&o.push(i);continue}if(r.box&&r.box.type&&r.box.type==="br"){o.push(new gt.TextRun({text:"",break:1}));continue}if(r.box&&r.box.type&&r.box.type==="image"){const i=await Tk(this.appId,this.docId,r.box.src,r.box.width,this.readImageFunc);i&&o.push(i);continue}if(r.math){const i=await Tk(this.appId,this.docId,r.math,0,this.readImageFunc);i&&o.push(i);continue}o.push(Ik(r,e))}return o}async addCodeBlockObject(t){for(const e of t)for(const o of e){const r={style:gt.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new gt.Paragraph({style:"Code",border:{left:{...r},right:{...r},top:{...r},bottom:{...r}},children:await this.paragraphsFromBlockTexts(o)}))}}async addListBlockObject(t,e){if(e.list==null)return;let o;const r=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[r])o=this.state.listInstMap[r];else if(o=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[r]=o,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${o}`,l=yk([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:o}),this.state.listRefMap[r]=s}else e.list.ordered?this.state.listRefMap[r]=ju.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[r]=ju.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[r]=ju.UNCHECKED:this.state.listRefMap[r]=ju.BULLET;const i=Ek(e);e.texts&&this.paragraphs.push(new gt.Paragraph({heading:i,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[r],level:e.list.level-1,instance:o}}))}imageDimWithBufferToImageRun(t){return new gt.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e,o){if(e.images==null){if(t.type==="embed"&&t.embedType==="image"){const{src:a}=t.embedData;a||this.addEmptyImagePlaceHolder()}return}const r=[],i=await Promise.all(e.images.map(async a=>{const d=await this.readImageFunc(this.appId,this.docId,a.src);if(d)return vk(a,d);r.push(a.src)})),s=dZ(i,o),l={style:gt.BorderStyle.SINGLE,color:"#DEDEDE"};s.length&&this.paragraphs.push(new gt.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:xk(e)||gt.AlignmentType.CENTER,children:s.map(a=>this.imageDimWithBufferToImageRun(a)).flatMap((a,d,h)=>a==null?[]:h.length-1!==d?[a,new gt.TextRun({text:" "})]:a)})),r.forEach(a=>{this.addHyperlinkParagraph(a)})}addSeparatorBlock(){DZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new gt.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(SZ())}addAudioPlaceholder(){this.paragraphs.push(LZ())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(MZ(t,e))}async addTableMatrix(t,e,o){const r=t.map(i=>i!==0?i*15:1500);this.paragraphs.push(new gt.Table({rows:await this.generateTableRows(e,o),columnWidths:r}))}async generateRowCells(t,e){const o=[];for(const r of t){const i=r.cellId;if(i===void 0)continue;const s=r.width*.9;o.push(new gt.TableCell({children:await this.convertBlocksFunc(i,e.blocks[i],e,this.appId,this.docId,this.state,s),columnSpan:r.colSpan,rowSpan:r.rowSpan,width:{type:gt.WidthType.DXA,size:r.width*15},shading:r.color?{fill:r.color,type:gt.ShadingType.CLEAR,color:"auto"}:void 0}))}return o}async generateTableRows(t,e){const o=[];for(const r of t)o.push(new gt.TableRow({children:await this.generateRowCells(r,e)}));return o}async addDoc(t,e,o){const r=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,o);r&&(this.paragraphs=this.paragraphs.concat(r))}async addOtherEmbedBlock(){}}class tQ{constructor(t,e,o,r,i,s,l,a){m(this,"convertBlocks",async(t,e,o,r,i,s,l=720)=>{const a=new XZ(r,i,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await YZ(t,e,o,a,r,i,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),a.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=o,this.readImage=r,this.defaultFontSize=i,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=a}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,o){const r=new gt.ImportDotx,i=this.templateData?await r.extract(this.templateData):void 0,s=t.blocks.root;g(KZ,s,"data must have blocks");const l=JZ(),a=await this.convertBlocks("blocks",s,t,e,o,l),d=this.backgroundImageOptions?{default:new gt.Header({children:[new gt.Paragraph({children:[new gt.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new gt.Document({numbering:{config:[...gZ,...l.levelConfigs]},sections:[{headers:d,children:a,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:i});return gt.Packer.toBlob(h)}}async function eQ(n,t,e,o){const r=n.doc.buildResourceUrl(o,{withToken:!0});let i=await g7(r);if(!i)return;if(i.type.indexOf("/svg")!==-1){const l=await h7(i);l&&(i=new File([l],i.name))}return await i.arrayBuffer()}async function nQ(n,t,e){const o=n.editorBlocks.getBlockClass(e.type);if(o.toStandardDoc)return o.toStandardDoc(n,e,t)}async function oQ(n,t){const e=t.attributes,o=n.editorBoxes.getBoxClass(e.type);if(o.toStandardText)return o.toStandardText(n,e)}async function rQ(n,t){let{template:e,download:o,backgroundImageOptions:r}=t!=null?t:{};e||(e=aZ());const i=n.doc.toJSON(),s=(p,A,v)=>eQ(n,p,A,v),l=async(p,A,v)=>nQ(n,i,v),a=async p=>oQ(n,p),h=await new tQ(e,i,Nd.default,s,void 0,l,a,r).convert("_appId","_docId");if(o){const p=URL.createObjectURL(h),A=document.createElement("a");A.setAttribute("download",`${m7(n)}.docx`),A.setAttribute("href",`${p}`),A.click(),A.remove()}return h}const J2=S("create-editor");async function iQ(n,t){var s,l,a,d,h,p,A,v,B,D,x,_,R,H;g(J2,n,"app does not exists"),t.lang&&L.setLang(t.lang),Si.level=(s=t.logLevel)!=null?s:da.DEBUG;const e=t.onReauth?async()=>{var ft;const z=t.user.userId,q=t.docId,rt=await((ft=t.onReauth)==null?void 0:ft.call(t,z,q,t.permission));return{userId:z,docId:q,permission:t.permission,appId:t.appId,token:rt,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,o={auth:{appId:t.appId,docId:t.docId,userId:t.user.userId,permission:t.permission,token:t.token,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl},serverUrl:t.serverUrl,reauthFunc:e,disableLogout:t.disableLogout},r=await Xa.load(o),i=ja(n,r,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,components:{blocks:[...pk,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...Q2,...((a=t.components)==null?void 0:a.embeds)||[]],boxes:[...Ck,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new ef,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new Tf,new vp],insertions:[yg],blockHooks:[new o2,new G7,...((p=t.components)==null?void 0:p.blockHooks)||[]],textRenders:[new r8,new C0],options:{...t.componentsOptions}},shortcuts:[Bz,aN,AH,O0,Oy,MO,D0,sV,Rh,...t.shortcuts||[]],colors:["#338FE5","#24B47E","#F0A100","#E52727","#9678D3","#2CB2AE","#EB6414","#8AAB3F"]});if(i.editorCommandProviders.registerCommandProvider(new yr(i)),i.input.addHandler(new QV),i.input.addHandler(new Sf),i.input.addHandler(new Q_),i.input.addHandler(new fH),i.input.addHandler(new wu(i,{headingLevel:1,titlePlaceholder:L.t("placeholder.common.title"),contentPlaceholder:L.t("placeholder.common.content"),readonlyTitlePlaceholder:L.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new bf(i,(A=t.componentsOptions)==null?void 0:A.quickMenu)),i.input.addHandler(new u2(i)),i.input.addHandler(new g2(i)),i.input.addHandler(new iN),i.input.addHandler(new Ff),i.doc.registerCallback(new YV(i)),i.addCustom("remote-cursor",()=>new Zb(i)),i.addCustom("block-menu",z=>new Y7(z)),i.addCustom("editor-tooltip",()=>new vf(i)),t!=null&&t.enableComments&&i.addCustom("editor-comments",z=>new o8(z,new oZ(z))),i.addCustom("create-options",()=>new KC(i,t)),i.addCustom("drop-target",()=>new Mu(i)),i.addCustom("list-to-mindmap",()=>new ff(i)),i.addCustom("list-to-mention",()=>new pW(i)),i.addCustom("mobile-helper",()=>new RW(i)),i.addCustom("code-caret",()=>new rN(i)),i.addCustom("image-paste-handler",()=>new a2(i)),(v=t.componentsOptions)!=null&&v.mention){const z=t.componentsOptions.mention;i.addCustom("mention",()=>new z8(i,z))}if(i.addCustom("heading-collapse",()=>new _2(i)),gc.register(i),Mu.register(i),ts.register(i),Ji.register(i),i.addListener("clickLink",(z,q,rt)=>{var Bt;if((Bt=t==null?void 0:t.events)!=null&&Bt.onClickLink){t.events.onClickLink(z,q,rt);return}const ft=rt.getAttribute("link");ft&&(z.readonly||q.ctrlKey||q.metaKey)&&window.open(ft,"_blank")}),(D=(B=t.componentsOptions)==null?void 0:B.remoteCarets)!=null&&D.onUserChanged){const z=(_=(x=t.componentsOptions)==null?void 0:x.remoteCarets)==null?void 0:_.onUserChanged;i.doc.getRemoteUsers().on("change",q=>{z(i,q)})}return(H=(R=t.componentsOptions)==null?void 0:R.templates)!=null&&H.templates.length&&(i.addListener("docChanged",()=>{o1(i)}),i.addListener("resize",()=>{o1(i,{reset:!0})}),setTimeout(()=>{o1(i)},100)),i.doc.registerCallback({onError:async z=>{if(z.code==="ResetDoc"){J2.error(`reset doc: ${z.message}`);const q=await Xa.load(o);i.doc.reset(q)}}}),i}function sQ(n){return n.toJSON!==void 0}async function lQ(n,t,e){var i,s,l,a,d;g(J2,n,"app does not exists");const o=sQ(t)?t:new ep(t,{serverUrl:e.serverUrl||""});e.lang&&L.setLang(e.lang);const r=ja(n,o,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[R0,z0,V0,I9],commandProviders:[new ef],decorators:[new Tf,new vp],embeds:[...Q2,...((i=e.components)==null?void 0:i.embeds)||[]],boxes:[N9,V8,d8,...((s=e.components)==null?void 0:s.boxes)||[]],insertions:[yg],blockHooks:[new o2,...((l=e.components)==null?void 0:l.blockHooks)||[]],textRenders:[new r8,new C0,...((a=e.components)==null?void 0:a.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[O0,Oy,D0,Rh]});return r.editorCommandProviders.registerCommandProvider(new yr(r)),r.input.addHandler(new Sf),r.input.addHandler(new wu(r,{headingLevel:1,titlePlaceholder:L.t("placeholder.common.title"),contentPlaceholder:L.t("placeholder.common.content"),readonlyTitlePlaceholder:L.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),r.input.addHandler(new bf(r,(d=e.componentsOptions)==null?void 0:d.quickMenu)),r.input.addHandler(new u2(r)),r.input.addHandler(new g2(r)),r.input.addHandler(new Ff),r.addCustom("block-menu",h=>new Y7(h)),r.addCustom("editor-tooltip",()=>new vf(r)),r.addCustom("image-paste-handler",()=>new a2(r)),e!=null&&e.enableComments&&r.addCustom("editor-comments",h=>new o8(h,new rZ(h,o))),r.addCustom("heading-collapse",()=>new _2(r)),r.addListener("clickLink",(h,p,A)=>{var B;if((B=e==null?void 0:e.events)!=null&&B.onClickLink){e.events.onClickLink(h,p,A);return}const v=A.getAttribute("link");v&&(h.readonly||p.ctrlKey||p.metaKey)&&window.open(v,"_blank")}),gc.register(r),r}function cQ(n,t){var a;const e=n.doc;if(!((a=e.getVersionHelper)==null?void 0:a.call(e)))throw new Error("the editor does not support to show versions");const r=n.getCustom("create-options");if(!r)throw new Error("the editor does not support to show versions");const i=r.getData(),s=new Ak(i),l=n.addCustom("version-dialog",()=>new T8(n.doc,s));return l.show(t),l}b.tippy=HB,b.AnchorBox=b6,b.AuthError=qh,b.AuthHeader=Ka,b.AutoScroll=Yd,b.BaseURLHeader=Gh,b.BasicCommands=v_,b.BlockExclusiveHook=G7,b.BlockLockerHook=o2,b.BlockLockerPasteHandler=Ff,b.BlockResizer=Eu,b.BrBox=g6,b.CodeBlock=z0,b.CodeLineBlock=V0,b.CodeTextDecorator=Tf,b.DefaultShortcuts=Rh,b.DocIdError=jS,b.DragDrop=h5,b.DrawioEmbed=ik,b.EditorBlocks=y4,b.EditorBoxes=C6,b.EditorCommandProviders=sb,b.EditorComplexBlockPosition=Mo,b.EditorComplexSelectionRange=ir,b.EditorDecorators=w6,b.EditorEmbeds=w4,b.EditorInsertions=k6,b.EditorSimpleBlockPosition=je,b.EditorSimpleSelectionRange=Ye,b.EmbedBlock=E4,b.EmbedBlockResizer=Nu,b.EnforceWithDocumentTitleHandler=wu,b.EventCallbacks=ha,b.FILL_CHAR=aI,b.FileExtError=US,b.GroupOrder=L9,b.HeadingBlockScrollListener=uW,b.ImageBox=A6,b.InlineBoxCommandProvider=$9,b.InputtingInsertion=v6,b.LocalDoc=ep,b.LogLevel=da,b.Logger=Si,b.MIN_DISTANCE_THRESHOLD=u5,b.ManualCloseDialog=iu,b.ManualMenu=Us,b.ManualToolbar=ru,b.MarkdownInputHandler=Sf,b.MaxUserError=fp,b.Mindmap=f0,b.OnesEditorAutoSuggest=Np,b.OnesEditorCustomDataWrapper=KC,b.OnesEditorExclusiveBlock=Ji,b.OnesEditorHoveringBlock=Ce,b.OnesEditorQuickMenu=bf,b.OnesEditorToc=$u,b.OnesEditorTocProvider=ts,b.OnesEditorToolbar=gc,b.OnesEditorTooltip=vf,b.OnesEditorVersionsDialog=T8,b.PermissionError=HS,b.Popup=ou,b.RemoteCarets=Zb,b.RemoteCaretsDecorator=vp,b.RemoteCaretsInsertion=yg,b.RemoteUsers=Nh,b.RequestReloadError=Ja,b.RichText=ln,b.ShareDBDoc=Xa,b.ShareDBDocVersionsProvider=Ak,b.SimpleCache=t5,b.StandardEmbedBlockCommands=D2,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=dg,b.TEXT_STYLE_COLOR_PREFIX=ug,b.TableBlock=R0,b.TableBlockCommandProvider=ef,b.TableShortcuts=O0,b.TextBlock=Dn,b.TextBox=m6,b.TextStyleShortcuts=D0,b.TocEmbed=j8,b.ZERO_WIDTH_SPACE_CHAR=fa,b.abbreviation=Jd,b.addAttribute=fh,b.addClass=W,b.addCommentToBlock=Xf,b.addDays=DE,b.addMetaToDoc=_h,b.addMonths=TE,b.animateScrollTo=km,b.applyPlaceholderToBlock=Lf,b.assert=g,b.autoShowHideTemplates=o1,b.blockToDoc=Jg,b.blockToHtml=Eg,b.blockToMarkdown=xg,b.blockToText=yh,b.blocksToDoc=TT,b.clearAllSelection=n4,b.clientType=Ze,b.cloneBlock=Pi,b.cloneChildContainer=Fg,b.cloneDoc=Pg,b.cloneText=r6,b.commentToShareDbComment=bp,b.compareElement=Ud,b.comparePosition=Jm,b.complexBlockAdjustSelectionPos=ih,b.complexBlockFindNearestChildBlock=D4,b.complexBlockGeFirstSimpleChild=Xm,b.complexBlockGetAllChildContainers=gn,b.complexBlockGetBottomChildContainers=T4,b.complexBlockGetLastSimpleChild=zl,b.complexBlockGetSelectedContainers=Ms,b.complexBlockGetTopChildContainers=I4,b.containerToDoc=FA,b.continuousScroll=S5,b.convertBlockFrom=eh,b.convertImageFileToPng=h7,b.convertImageSrcToPng=IP,b.converterIntercept=Df,b.copyBlockAttributes=F6,b.createBlockAnchor=Vr,b.createBlockCaretAnchor=R4,b.createBlockContentElement=xs,b.createBlockElement=W5,b.createBlockSimpleDocRange=Ch,b.createBlockSimpleRange=ke,b.createBoxContentElement=Z5,b.createBoxElement=q5,b.createBoxOp=Q4,b.createChildContainer=b4,b.createComplexBlockPosition=me,b.createComplexDocPos=u6,b.createComplexDocRange=hI,b.createContainer=l6,b.createContainerElement=qm,b.createDeleteOps=W4,b.createEditor=ja,b.createEditorSelectionRange=Ue,b.createElement=k,b.createEmptyContainer=Gr,b.createEmptyDoc=qr,b.createEmptyTextBlockData=gh,b.createExpandedRange=Hd,b.createIconButton=$l,b.createImage=Cm,b.createInsertOps=dh,b.createInsertionContentElement=J5,b.createInsertionElement=Q5,b.createLocalEditor=lQ,b.createOnesEditor=iQ,b.createRange=e5,b.createRichText=_i,b.createRootContainer=A4,b.createSimpleBlockPosition=st,b.createSimpleDocPos=a6,b.createTextBlockData=cr,b.createTextButton=Zs,b.createTextOp=ao,b.createTextWithReplaceSoftReturn=lg,b.daysAfter=Mm,b.deleteText=ag,b.diffDays=SE,b.disablePageScroll=B5,b.docToHtml=L6,b.docToHtmlFragment=kh,b.docToMarkdown=Ra,b.docToText=Ma,b.downloadImageToFile=g7,b.downloadObjectToFile=U2,b.downloadSvgToString=Y8,b.editLink=pu,b.editorAddComment=cz,b.editorAddTextAttribute=G6,b.editorAutoInsertBlock=P6,b.editorBreakTextBlock=Ql,b.editorClearCompositionText=_6,b.editorClearSelectedContents=Og,b.editorCopyBlock=Fh,b.editorDeleteBlock=Mg,b.editorDeleteBlockText=Sg,b.editorDeleteBlockWithoutChildren=Eh,b.editorDeleteChildContainer=sT,b.editorDeleteChildContainers=N6,b.editorFocusToBlock=_g,b.editorFocusToEnd=xT,b.editorGetBlockData=Fi,b.editorGetBlockText=pn,b.editorGetBlockTextEx=bh,b.editorGetBoxData=h6,b.editorHandleKeyboardEvent=HA,b.editorInsertBlock=Zl,b.editorInsertBoxToBlock=R6,b.editorInsertDoc=W6,b.editorInsertDocAt=Ng,b.editorInsertText=Dg,b.editorInsertTextToBlock=M6,b.editorInsertTextToBlockEx=Tg,b.editorMergeTextBlock=$6,b.editorMoveDown=iA,b.editorMoveEnd=qg,b.editorMoveHome=gA,b.editorMoveLeft=nA,b.editorMoveLineEnd=wA,b.editorMoveLineHome=kA,b.editorMovePageDown=DA,b.editorMovePageUp=TA,b.editorMoveRight=oA,b.editorMoveUp=rA,b.editorMoveWordEnd=hA,b.editorMoveWordLeft=dA,b.editorRangeClearColor=Q6,b.editorRangeGetColor=$g,b.editorRangeSetColor=Z6,b.editorRemoveTextAttribute=uT,b.editorReplaceBlockText=Ih,b.editorReplaceContainer=q6,b.editorRunOnce=np,b.editorSelectAll=OA,b.editorSelectContainer=Qg,b.editorSelectDown=sA,b.editorSelectEnd=Gg,b.editorSelectHome=pA,b.editorSelectLeft=lA,b.editorSelectLineEnd=yA,b.editorSelectLineHome=vA,b.editorSelectPageDown=LA,b.editorSelectPageUp=SA,b.editorSelectRight=cA,b.editorSelectUp=aA,b.editorSelectWordEnd=mA,b.editorSelectWordLeft=fA,b.editorSetTextColor=Yl,b.editorShowFindDialog=mU,b.editorToDocx=rQ,b.editorUpdateBlockData=Th,b.editorUpdateCompositionText=O6,b.editorUpdateEmbedData=z6,b.enablePageScroll=E5,b.escapeHtmlText=l5,b.escapeRegExp=Fm,b.escapeSpace=hE,b.exclusiveBlock=t2,b.executeBlockCommand=d4,b.executeEmbedBlockCommand=u4,b.executeRangeCommand=ib,b.fileToDataUrl=jl,b.findAfterOffsetNotType=Ag,b.findAllText=gg,b.findEventTargetBlock=i5,b.findInsertionById=Y5,b.findNextOffset=DI,b.findNextVisibleSimpleBlock=db,b.findPrevOffset=TI,b.findPrevOffsetNotType=Cg,b.findPrevSimpleBlockBeforeChildContainer=x4,b.findPrevVisibleSimpleBlock=ub,b.findTarget=Hl,b.findWordEnd=vg,b.findWordLeft=bg,b.format=ba,b.formatBytes=L5,b.formatDate=Om,b.fragmentToHtml=x5,b.fromBase64=pa,b.fromBase64ToBlob=Tm,b.fromBase64ToUint8Array=wE,b.fromDocRange=Ri,b.fromNowString=_m,b.genId=K,b.getAllChildBlocks=eg,b.getAllQuickMenuItems=T0,b.getAllSelectedBlocks=Ro,b.getAttributesAt=Da,b.getBlockBackground=V5,b.getBlockByIndex=Pr,b.getBlockCaretRect=So,b.getBlockClass=Yt,b.getBlockClassByType=Ss,b.getBlockClientRects=$r,b.getBlockCommandsWithHook=Vm,b.getBlockContent=Lt,b.getBlockId=it,b.getBlockIndex=bt,b.getBlockInfo=Du,b.getBlockKind=Do,b.getBlockMinWidth=r4,b.getBlockNearestRangeFromPoint=M4,b.getBlockOptions=jE,b.getBlockPath=Mi,b.getBlockProperties=l4,b.getBlockRangeFromPoint=sh,b.getBlockStyles=HE,b.getBlockTextLength=ut,b.getBlockTools=te,b.getBlockType=Dt,b.getBoxContent=$m,b.getBoxId=G5,b.getBoxTypeFromElement=va,b.getChildBlockCount=Io,b.getChildBlocks=fe,b.getChildOffset=Os,b.getColorFromAttributes=fg,b.getColorFromContent=Kd,b.getComplexBlockClass=zn,b.getContainerBlockPath=g4,b.getContainerBlocks=e4,b.getContainerBlocksElement=oh,b.getContainerById=Ur,b.getContainerId=ct,b.getContainerMinWidth=Zm,b.getContainerToolsElement=qE,b.getContainerWidth=v4,b.getDistanceSquare=nr,b.getElementOffset=ma,b.getElementScale=vs,b.getEmbedType=fn,b.getExistsBlockTools=th,b.getExistsContainerById=m4,b.getFileExt=Aa,b.getFirstChildBlock=ye,b.getFirstClientRect=jd,b.getHeadingMenuOptions=B0,b.getHorizontalPadding=Am,b.getInsertionContent=Hm,b.getLastChildBlock=Qe,b.getLastClientRect=As,b.getListAllNextBrothers=uc,b.getLogger=S,b.getNextBlock=Qt,b.getNextValidOffset=_s,b.getNextVisibleBlock=Ts,b.getOffsetInfoAfter=La,b.getOffsetInfoBefore=vh,b.getOpAt=J4,b.getOpLength=hh,b.getParentBlock=tt,b.getParentBlockExcludeSelf=Es,b.getParentBox=Nm,b.getParentContainer=nt,b.getPrevBlock=ce,b.getPrevValidOffset=Oi,b.getPrevVisibleBlock=Is,b.getRangeCommands=ob,b.getRootBlock=zm,b.getScrollContainer=io,b.getSpecialBlockCommands=c4,b.getStandardEmbedBlockProperties=S2,b.getTextAfterOffset=xI,b.getTextAttributes=Ig,b.getTextBeforeOffset=II,b.getTextBlockChild=nh,b.getTextBlockClass=X5,b.getTextBlockContentChildTextLength=co,b.getTextBlockContentChildType=h4,b.getTextBlockContentChildren=rr,b.getTextLength=rn,b.getTextOpLength=ng,b.getTextWidth=Gd,b.getToolbar=cf,b.handleBlockElementUpdated=i4,b.hasAltOnly=AE,b.hasClass=xt,b.hasCtrlOrCmd=b5,b.hasCtrlOrCmdOnly=CE,b.hashCode=N5,b.hideBlock=U5,b.htmlToFragment=qd,b.i18n=L,b.injectDocToHtmlFragment=Oh,b.injectStyle=a5,b.insertEmptyBlock=VE,b.insertEmptyEmbedBlock=Wm,b.insertText=Wr,b.intersectionCommands=RD,b.isBackspace=y5,b.isBlock=Bs,b.isBlockLocked=_f,b.isBlockLockedByOthers=n2,b.isBlockLockedBySelf=Su,b.isBlockTools=j5,b.isBox=Pm,b.isCJK=p5,b.isChildContainer=Lo,b.isChildNode=Xt,b.isCodeBlock=Cr,b.isCollapsedRange=dI,b.isComplexBlockPosition=Ym,b.isComplexKindBlock=Mt,b.isContainer=Nr,b.isContainerSelectedAllChildBlocks=MA,b.isControlEvent=ks,b.isDelete=vE,b.isDraggingFiles=Zd,b.isElementVisible=ym,b.isEmbedBlock=Me,b.isEmptyContainer=Ba,b.isEmptyDoc=pg,b.isEmptyTextBlock=ae,b.isEmptyTextBlockWithoutCompositionText=ku,b.isEnterOnly=v5,b.isEscape=xm,b.isExclusiveBlock=Of,b.isFirefox=Wd,b.isFirstChildBlockInComplexBlock=Bx,b.isHighSurrogate=sE,b.isInBlock=jm,b.isInBlockTools=Ds,b.isLetter=g5,b.isLowSurrogate=pm,b.isMatchShortcut=or,b.isMoveForward=gE,b.isNavigationEvent=mE,b.isNavigationKey=A5,b.isNodeRemoved=o5,b.isNumber=m5,b.isPrintableKey=Em,b.isRootBlock=so,b.isRootContainer=Gt,b.isSafari=C5,b.isSameDay=Rm,b.isSecureEnv=j0,b.isShiftEnter=bE,b.isShiftTab=kE,b.isShortcutEvent=pE,b.isSimpleBlock=$E,b.isSimpleBlockPosition=zr,b.isSimplePos=c6,b.isSimpleRange=ph,b.isSpace=Vd,b.isTab=yE,b.isTextBlockContentBoxChild=lo,b.isTextBlockContentChild=ka,b.isTextBlockContentInsertionChild=jr,b.isTextBlockContentTextChild=wa,b.isTextKindBlock=et,b.isTextKindBlockType=ya,b.isToday=M5,b.isValidOffset=sn,b.isVisibleBlock=Xd,b.isYesterday=R5,b.loadJs=r5,b.loadJsPromise=bs,b.lockers=xo,b.mergeCommands=lf,b.mergeDocs=Ns,b.mergeOps=cg,b.mergeText=iI,b.multiSplitText=F4,b.overflowText=O5,b.parseShortcut=k5,b.patchNode=Ca,b.pointInRect=ys,b.rangeAddAttribute=Ta,b.rangeGetTextColor=o6,b.rangeRemoveAttribute=Wl,b.rangeSetTextColor=t6,b.rangeTransformText=K4,b.registerDragDrop=wm,b.removeAttribute=hg,b.removeClass=ot,b.removeLastBr=eI,b.removePlaceholderFromBlock=b7,b.removeStyle=c5,b.replaceAll=LE,b.replaceAllCaseInsensitive=ME,b.replaceAllText=s6,b.replaceText=mh,b.requestDownload=Qd,b.resetListStart=hc,b.scrollable=D5,b.selectFile=Ul,b.selectedBlockToDoc=Sh,b.selectionToDoc=Lh,b.setAttributes=zd,b.setClipboardData=Lm,b.setClipboardDataByEvent=IE,b.setColorToAttributes=e6,b.setDataset=bm,b.setDefaultCursor=ga,b.setStyles=vm,b.shareDBCommentToDocObject=Ap,b.shareDBDocCommentToComment=qb,b.shortcutToDisplayText=ro,b.showBlock=z5,b.showDocVersions=cQ,b.splitText=Tn,b.splitToThree=ze,b.stringToDataUrl=Dm,b.stringToObjectUrl=Sm,b.subText=P4,b.textNodeOffsetFromPoint=n5,b.titleFromEditor=m7,b.toBase64URL=Li,b.toMindmap=hf,b.toPlainText=ie,b.toPlainTextKeepLength=mg,b.trimChar=Bm,b.unexclusiveBlock=e2,b.unicodeLength=lE,b.unicodeSubstr=cE,b.updateBlockSelection=o4,b.updateOpAttributes=i6,b.updateTextBlockContent=EI,b.updateUrl=Im;for(const n in ve)n!=="default"&&!b.hasOwnProperty(n)&&Object.defineProperty(b,n,{enumerable:!0,get:()=>ve[n]});Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});