@ones-editor/editor 1.1.17-beta.6 → 1.1.17-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@ones-editor/core/src/utils/file.d.ts +2 -1
- package/@ones-editor/list-block/src/mindmap/to-mindmap/to-mindmap.d.ts +1 -1
- package/@ones-editor/list-block/src/mindmap/to-mindmap/types.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +9 -9
- package/package.json +3 -3
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:#0064ff}}*{--link-color: #0064ff;--color-0: #e52727;--color-1: #eb6414;--color-2: #f0a100;--color-3: #24b47e;--color-4: #0064ff;--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: #0064ff;--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: #0064ff;--background-selection: #0064ff1A;--background-code: #cdcdcd40}div.editor-root{color:#2d2d2e;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:#0064ff;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([data-document-title]){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([data-document-title]) 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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion{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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.link{color:#0064ff}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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.link:hover{cursor:pointer;color:#0053cf}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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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 #0064ff}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 #0064ff}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:#0064ff;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 #d4d6d9;color:#87888a}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.editor-root>div.editor-content>div[data-type=editor-container]>div.container-blocks>div[data-type=editor-block][data-document-title]{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;color:#2d2d2e}.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 #0064ff;background-color:#eaf3fc;color:#0064ff}.editor-button.primary{font-weight:500;border:1px solid rgba(0,0,0,0);background-color:var(--editor-button-bg-color, #0064ff);color:var(--editor-button-color, #fff)}.editor-button.primary:not(:disabled):hover{background-color:#408cff;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:#0053cf;color:#fff;border-color:#2872b7}.editor-button:last-child{margin-right:0}.editor-button:not(:disabled):active{background-color:#cfe2ff;color:#0053cf;border-color:#0053cf}@keyframes editorLoadingCircle{0%{transform-origin:50% 50%;transform:rotate(0)}to{transform-origin:50% 50%;transform:rotate(360deg)}}.editor-loading-icon>svg{color:#0064ff;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:inherit;height:inherit}.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:#0064ff}.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 #0064ff;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:#0064ff;background-color:#0064ff}.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:#2d2d2e}[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;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:#ffffff}[data-theme=dropdown-list] .filterable-list .list{max-height:60vh;overflow-y:auto;padding:0 0 8px}[data-theme=dropdown-list] .filterable-list .list .list-item{user-select:none;transition:background 20ms ease-in 0s;cursor:pointer;width:100%;border-radius:3px;height:34px;padding:6px 10px;display:flex;justify-content:space-between;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:hover{background:rgba(0,36,90,.04)}[data-theme=dropdown-list] .filterable-list .list .list-item.selected{color:#0064ff}[data-theme=dropdown-list] .filterable-list .list .list-item.disabled{color:#c1c1c1}[data-theme=dropdown-list] .filterable-list .list .list-item.disabled:hover{background:transparent}[data-theme=dropdown-list] .filterable-list .list .list-item .list-item-selected-icon{display:flex;background:transparent;border:none;color:#0064ff}::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.menu .menu-item{cursor:pointer}div.tippy-box[data-theme=menu] .tippy-arrow{z-index:2}div.tippy-box[data-theme=menu] .tippy-arrow:before{content:"";display:block;width:0px;height:0px;position:absolute;top:-16px;border-width:8px;border-bottom-color:#fff}div.tippy-box[data-theme=menu] .tippy-arrow:after{content:" ";display:block;position:absolute;left:2px;top:-5px;box-shadow:-1px -1px 2px #3030300f;width:12px;height:12px;transform:rotate(45deg)}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[data-theme=toolbar] .tippy-content .editor-command-bar-root{overflow:initial}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: #0064ff;--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:#2d2d2e;user-select:none;transition:background 20ms ease-in 0s;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:#909090}.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.standard.disabled .menu-item-icon{color:#c7c7c7}.editor-command-bar.menu .command-item.separator{height:1px;margin:4px 0;background-color:#dfe1e5;width:100%}.editor-command-bar.menu .command-item.section{font-size:.8em;color:#ccc;padding:5px 5px 5px 10px;cursor:initial;user-select:none}.editor-command-bar.menu .command-item.selected{background-color:#00245a0a}.editor-command-bar.menu .command-item.selected[data-id=delete]:not(.disabled){color:#e52727;background-color:var(--warn-color)}.editor-command-bar.menu .command-item.selected[data-id=delete]:not(.disabled) svg{color:#e52727}.editor-command-bar.menu .command-item.selected.disabled{background-color:transparent}.editor-command-bar.menu .command-item.checked{color:#0064ff}.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:#eb3723}.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:#2d2d2e;height:24px;padding:0;cursor:pointer;border-radius:3px;min-width:24px}.editor-command-bar.toolbar .command-item.selected:not(.disabled){background-color:#00245a0a}.editor-command-bar.toolbar .command-item:active:not(.disabled){background-color:#00245a0f}.editor-command-bar.toolbar .command-item.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.checked{color:#0064ff}.editor-command-bar.toolbar .command-item.checked.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.separator{margin:auto 2px;height:15px;min-width:1px;width:1px;background-color:#dfe1e5;padding:0;pointer-events:none;cursor:default}.editor-command-bar.toolbar .command-item .toolbar-item-name-container{display:flex;flex-direction:row;align-items:center}.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 .command-item[data-button-id=turn-into] .toolbar-item-name-container,.editor-command-bar.toolbar .command-item[data-button-id=align] .toolbar-item-name-container{width:24px;height:24px}.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:#303030;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:#0064ff}.editor-dropdown.active{border-color:#0064ff;box-shadow:0 0 0 2px #338fe533}.editor-dropdown.active .dropdown-text{display:none}.editor-dropdown.active .dropdown-icon svg{color:#0064ff;transform:rotate(180deg)}.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:#0064ff;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:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.editor-dropdown .dropdown-clear-icon{color:#909090}.editor-dropdown .dropdown-clear-icon:hover{color:#0064ff}.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:8px}.editor-dropdown .dropdown-icon svg{transform:rotate(360deg);transition:transform .2s linear}.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 #0064ff;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 #0064ff}.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:#575859;border:1px solid #bebfc2;border-radius:3px;cursor:pointer}.color-palette .clear-button-container .clear-button:hover{color:#0064ff;background:#e3eeff;border:1px solid #0064ff}.color-palette .clear-button-container .clear-button:active{color:#0053cf;background:#cfe2ff;border:1px solid #0053cf}div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu .menu-item[data-id=text-color-palette-item]{cursor:default}.editor-input-wrap .editor-input-label{margin-top:8px;margin-bottom:8px;position:relative;font-weight:500}.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;position:relative}.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:#0064ff;box-shadow:0 0 0 2px #338fe533}.editor-input-wrap .editor-input-container .editor-input-suffix{height:100%;position:absolute;top:0px;right:10px;display:flex;align-items:center;color:#87888a;font-size:12px}.editor-input-wrap .editor-input-container .editor-input-suffix+.editor-input{padding-right:50px}.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]{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=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:#87888a;background:#F7F8FA;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:#87888a}[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:#2d2d2e}[data-command-bar-id=quick-menu] div.command-item>div.menu-item-icon{color:#2d2d2e}[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;padding:4px 15px}: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 #0064ff}.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 .list-to-mindmap-wrap,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap{display:flex;flex-direction:row;justify-content:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=mention-button]:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=list-to-mindmap]:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=mention-button]:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=list-to-mindmap]:hover{background:rgba(0,36,90,.0392156863);border-radius:3px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=mention-button]:active:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=list-to-mindmap]:active:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=mention-button]:active:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=list-to-mindmap]:active:hover{background:rgba(0,36,90,.0588235294)}.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:center;background-color:transparent;color:#07142a}.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);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 #0064ff;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:#0064ff;background-color:#0064ff}.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-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:#0064ff;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 .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.active[data-list-type=ordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=ordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=checked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=checked]>div[data-type=block-content]{background-color:#f8f8f8}.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:rgba(0,36,90,.04)}.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 .editor-check-list-wrapper:not(.editor-check-list-wrapper-checked)>span.editor-check-box:hover>span.editor-check-box-inner{border-color:#0064ff}.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper,.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper{cursor:pointer}[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;vertical-align:middle;padding:2px 0}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] .embed-block.selected[data-embed-type=math]>div[data-type=block-content].mathjax-overflow:before{width:var(--mathjax-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}div.editor-root div.editor-content div[data-type=editor-block],.status-box-editor-popup{--orange: #F59300;--orange-bkg: #FFF0D9;--grey: #87888A;--grey-bkg: #EDEFF2;--red: #EB3723;--red-bkg: #FFEAE8;--primary: #0064FF;--primary-bkg: #E3EEFF;--green: #00A865;--green-bkg: #D7F7EA;--purple: #8851ED;--purple-bkg: #F0E8FF}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box span[data-type=box-content]{margin-left:0;margin-right:0;padding-left:2.5px;padding-right:2.5px}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-yellow{background-color:var(--orange-bkg);color:var(--orange)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-yellow-subtle{color:#fff;background-color:var(--orange)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-grey{background-color:var(--grey-bkg);color:var(--grey)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-grey-subtle{color:#fff;background-color:var(--grey)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-red{background-color:var(--red-bkg);color:var(--red)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-red-subtle{color:#fff;background-color:var(--red)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-blue{background-color:var(--primary-bkg);color:var(--primary)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-blue-subtle{color:#fff;background-color:var(--primary)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-green{background-color:var(--green-bkg);color:var(--green)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-green-subtle{color:#fff;background-color:var(--green)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-purple{background-color:var(--purple-bkg);color:var(--purple)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-purple-subtle{color:#fff;background-color:var(--purple)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box>[data-type=box-content]{max-width:100%;display:inline-flex;align-items:center;vertical-align:top;position:relative;top:calc((var(--font-size) * var(--line-height) - 20px) / 2)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common{max-width:100%;line-height:20px;padding:0 5px;border-radius:3px;font-size:12px;height:20px;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:inline-block;font-weight:500}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common.box-status-empty{color:#87888a}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common:hover{outline:1px solid #408CFF}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.history-deleted-box .box-status-common{text-decoration:line-through}.status-box-editor-popup{width:178px;padding-top:1px}.status-box-editor-popup .status-input input{caret-color:#0064ff}.status-box-editor-popup .scale-border:after,.status-box-editor-popup .status-color-palette .status-box-button.selected:after,.status-box-editor-popup .status-color-palette .status-box-button:hover:after{content:"";outline:1px solid #0064ff;border-radius:3px;position:absolute;left:0;right:0;top:0;bottom:0;transform:scale(1.1)}.status-box-editor-popup .status-color-palette{display:flex;padding:6px 4px 5px}.status-box-editor-popup .status-color-palette .status-box-button+.status-box-button{margin-left:5px}.status-box-editor-popup .status-color-palette .status-box-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;position:relative}.status-box-editor-popup .status-color-palette .status-box-button.selected:after{outline:1px solid var(--primary-color)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=grey]{background-color:var(--grey-bkg);border:1px solid var(--grey)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=blue]{background-color:var(--primary-bkg);border:1px solid var(--primary)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=yellow]{background-color:var(--orange-bkg);border:1px solid var(--orange)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=red]{background-color:var(--red-bkg);border:1px solid var(--red)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=green]{background-color:var(--green-bkg);border:1px solid var(--green)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=purple]{background-color:var(--purple-bkg);border:1px solid var(--purple)}[data-command-bar-id=status-box-popup] .tippy-content{padding-left:6px;padding-right:6px}div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common{cursor:default}div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common:hover{outline:none}.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:#dfe1e5;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:#d4d6d9}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:#0064ff}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:#0064ff;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;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 #dfe1e5;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:#fff6f5!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:#575859}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);background:#f7f8fa}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] .scroll-container{overflow:hidden}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:#f7f8fa}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:#f7f8fa}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{cursor:pointer;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:#408cff}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:20px}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:#2d2d2e;opacity:.3}.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}div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-rows].selected,div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-columns].selected{background-color:#fff6f5}div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-rows].selected svg,div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-columns].selected svg{color:#eb3723}div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-row],div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-col]{color:#eb3723;background-color:#fff6f5}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block{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:32px 10px 24px 32px;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,.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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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,.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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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,.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.code-line-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,.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.code-line-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}.editor-root:not(.mobile) [data-type=editor-container].root div[data-type=editor-block].code-block{min-width:360px}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:#bebfc2}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:#bebfc2;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{pointer-events:none;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 #0064ff;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:#0064ff;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:#0064ff;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,.editor-root div.editor-content.dragging .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 #0064ff}.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:first-child:last-child{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 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:#0064ff}.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:#0064ff}.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 #0064ff}.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:#F7F8FA;border-radius:var(--editor-border-radius);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:22px;color:#87888a;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:#2d2d2e;opacity:.3}.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}.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:#00245a0a}.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:#0064ff}.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;color:#2d2d2e;font-weight:500;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-container:hover{border:1px solid #0064ff}.editor-find-dialog .editor-find-dialog-input-container:focus{border:1px solid #0064ff;box-shadow:0 0 0 2px #0064ff33}.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:#2d2d2e;background-color:var(--editor-find-dialog-button-border-bg-color);border:none;display:flex;flex-direction:row;align-items:center;padding:0}.editor-find-dialog .editor-find-dialog-icon-button:hover{color:#0064ff}.editor-find-dialog .editor-find-dialog-icon-button:active{color:#0053cf}.editor-find-dialog .editor-find-dialog-button{padding:4px 15px;cursor:pointer;background:#ffffff;border:1px solid #bebfc2;color:#575859;margin:0 4px;font-family:inherit;line-height:20px;border-radius:3px}.editor-find-dialog .editor-find-dialog-button.icon-button{width:32px;height:32px}.editor-find-dialog .editor-find-dialog-button:enabled:hover{color:#0064ff;background:#e3eeff;border:1px solid #0064ff}.editor-find-dialog .editor-find-dialog-button:enabled:active{color:#0053cf;background:#cfe2ff;border:1px solid #0053cf}.editor-find-dialog .editor-find-dialog-button:last-of-type{margin-right:0}.editor-find-dialog .editor-find-dialog-primary-button{color:#fff;background:#0064ff;border:1px solid #0064ff;transition:ease-in .1s}.editor-find-dialog .editor-find-dialog-primary-button:enabled:hover{color:#fff;background:#408cff;border:1px solid #408cff}.editor-find-dialog .editor-find-dialog-primary-button:enabled:active{color:#fff;background:#0053cf;border:1px solid #0053cf}.editor-find-dialog .editor-find-dialog-action{margin:12px 0 20px}.editor-find-dialog .editor-find-dialog-button:disabled{color:#575859;background:#dfe1e5;opacity:.5;border:1px solid #bebfc2;cursor:not-allowed}.editor-find-dialog .editor-find-dialog-primary-button:disabled{color:#fff;background:#0064ff;opacity:.5;border:1px solid #0064ff}.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:#575859;border:var(--editor-find-dialog-button-border);background-color:var(--editor-find-dialog-button-border-bg-color);padding:0;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.editor-find-dialog .editor-find-dialog-icon-button-border:hover{background:#e3eeff;border:1px solid #0064ff}.editor-find-dialog .editor-find-dialog-icon-button-border:active{background:#cfe2ff;border:1px solid #0053cf}.editor-find-dialog .editor-find-dialog-button-close{margin:0 0 0 8px;cursor:pointer;border-radius:4px;color:#2d2d2e;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-button-close:hover{color:#0064ff}.editor-find-dialog .editor-find-dialog-button-close:active{color:#0053cf}.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{pointer-events:none}.editor-find-dialog .editor-highlight .editor-highlight-child{opacity:.1;position:absolute;background-color:#eb3723}.editor-find-dialog .editor-highlight.active .editor-highlight-child{opacity:.3;position:absolute;background-color:#eb3723}.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{pointer-events:none}.editor-highlight .editor-highlight-child{opacity:.1;position:absolute;background-color:#eb3723}.editor-highlight.active .editor-highlight-child{opacity:.3;position:absolute;background-color:#eb3723}.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}body>div[data-tippy-root][data-command-bar-id=right-context-menu].zh-CN{min-width:200px}body>div[data-tippy-root][data-command-bar-id=right-context-menu].en-US,body>div[data-tippy-root][data-command-bar-id=right-context-menu].ja-JP{min-width:200px}body>div[data-tippy-root][data-command-bar-id=right-context-menu]>div.tippy-box>div.tippy-content{padding:0}body>div[data-tippy-root][data-command-bar-id=right-context-menu] .editor-command-bar.menu>div.command-item{cursor:pointer}body>div[data-tippy-root][data-command-bar-id=right-context-menu] .editor-command-bar.menu>div.command-item.disabled{cursor:not-allowed}body>div[data-tippy-root][data-command-bar-id=right-context-menu] .editor-command-bar.menu>div.command-item.disabled>div.item-subtext{color:#c7c7c7}body>div[data-tippy-root][data-command-bar-id=right-context-menu] .editor-command-bar.menu>div.command-item>div.item-subtext{margin-left:10px}.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{max-width:100%;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:224px}.comment-editor-editing{border:1px solid #0064ff}.comment-editor-readonly{border:none;padding-left:calc(var(--editor-comment-avatar-width, 22px) + 5px);margin:0}.comment-editor-readonly .comment-editor-img{display:none}.comment-item-root{position:relative}.comment-item-root:not(.last-comment-item):before{content:" ";display:block;position:absolute;left:10px;width:1px;background-color:#dfe1e5;overflow:hidden;opacity:.8;top:21px;bottom:-12px;transform:scaleX(.5)}.comment-item-root .item-head{padding:0;position:relative;display:flex;align-items:center}.comment-item-root .item-head-avatar{margin-right:5px;width:var(--editor-comment-avatar-width, 22px);height:var(--editor-comment-avatar-width, 22px);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:#2d2d2e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-item-root .item-head-modified{margin-left:10px;font-size:12px;color:#87888a;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{color:#2d2d2e}.comment-item-root .item-head-tools .editor-text-button:hover{color:#0064ff}.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 .editor-button{padding:4px 10px;line-height:1}.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{color:#575859;font-size:12px}.comment-quick-reply .quick-reply-button.editor-text-button:hover{color:var(--text-button-color-hover, #0064ff);background-color:var(--text-button-bg-color-hover, transparent)}.comment-quick-reply .quick-reply-button.editor-text-button:active{color:#0053cf;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 .quick-reply-editor .reply-editor-actions .editor-button{padding:4px 10px;line-height:1}.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);--editor-comment-quote-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,.editor-root .editor-content div[data-type=editor-block] span[data-type=editor-box].comment{border-bottom:2px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block] span.text.comment.active,.editor-root .editor-content div[data-type=editor-block] span[data-type=editor-box].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:284px;padding:0 10px 10px;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)}.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:29}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head{display:flex;align-items:center;justify-content:space-between}.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:20px;height:20px;color:#87888a;padding-bottom:10px;padding-top:10px;padding-right:12px;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:12px;background-color:#d4d6d9;margin-right:6px;float:left;border-radius:10px;margin-top:4px}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch{display:flex;align-items:center;height:22px;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:#f59300}.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] span.file-icon svg{width:18px}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;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;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;flex-direction:row;align-items:center;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:24px;height:24px}div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content]{min-width:360px}div.editor-root:not(.mobile) 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{min-width:360px}:root{--editor-version-button-border: black;--editor-bg-color: #ffffff;--editor-version-list-bg-color: white;--editor-version-select-bg-color: #F0F6FF}.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:#0064ff;background-color:#e3eeff;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;min-width:0}.version-dialog .version-viewer .version-dialog-editor{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: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: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:2000;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: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: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: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:#0064ff}.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 .toolbar-item-dropdown-container{margin-left:5px}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item:not(.disabled):hover{color:#0064ff}.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:#0064ff}.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 #0064ff}.version-list-root .version-list-content .version-item .version-item-restore-from{color:#87888a;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;margin-top:5px}.version-list-root .version-list-content .version-item .memo-input.size-limit-textarea textarea{line-height:22px;padding:4px 9px;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:#2d2d2e}.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:#0064ff}.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;margin-top:10px;color:#606060;line-height:22px}.version-list-root .version-list-content .version-item .version-item-author .version-item-author-name{color:#575859}.version-list-root .version-list-content .version-item .version-item-author-mark{width:6px;height:6px;border-radius:3px;margin-right:5px;flex-shrink:0;margin-top:8px}.version-list-root .version-list-content .version-item .version-item-memo{font-size:14px;color:#303030;padding:5px 10px;border-radius:3px;margin-top:5px;line-height:22px}.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{font-family:PingFang SC;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;font-family:inherit}[data-command-bar-id=versions-dropdown-popup] .tippy-box{color:var(--text-color);line-height:normal}[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:#0064ff;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;font-size:12px}[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;cursor:pointer}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container .filter-item-label{cursor:pointer}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container .editor-checkbox-wrapper{margin-right:4px}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container:hover .editor-checkbox-wrapper:not(.checked)>span.editor-checkbox>span.editor-checkbox-inner{border-color:#0064ff}.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] div[data-type=block-tools] .block-helper .block-button~.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:pointer;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:#00245a0a}.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{color:#87888a;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;cursor:default}.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:#0064ff}.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 .iframe-embed-auth-error-tips{width:100%;height:34px;line-height:34px;background-color:#f7f8fa;text-align:center;color:#bebfc2;z-index:9910;position:fixed;top:0;left:0;box-shadow:0 2px 4px #2d2d2e26,0 0 1px #2d2d2e1a}:root .iframe-embed-auth-error-tips span{cursor:pointer;color:#0064ff;user-select:none}: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;padding:4px 15px}.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 #0064ff;margin-top:16px;margin-bottom:16px}.webpage-content .help-container .help-content{display:flex;align-items:flex-start}.webpage-content .help-container .help-content .help-icon{display:flex;align-items:center;height:20px;color:#0064ff;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:#0064ff;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%;min-height:inherit}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;flex:1}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:#0064ff}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-drawio-content.editor-embed{width:100%;min-height:80px;display:inline-block;text-align:center}.embed-block .editor-drawio-content.editor-embed .editor-empty-drawio{width:240px;height:400px}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;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}.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:#2d2d2e;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:#87888a}.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:#0064ff}.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:#0064ff}.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:#0064ff;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:#2d2d2e;opacity:.3}`)),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:#0064ff}}*{--link-color: #0064ff;--color-0: #e52727;--color-1: #eb6414;--color-2: #f0a100;--color-3: #24b47e;--color-4: #0064ff;--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: #0064ff;--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: #0064ff;--background-selection: #0064ff1A;--background-code: #cdcdcd40}div.editor-root{color:#2d2d2e;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:#0064ff;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([data-document-title]){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([data-document-title]) 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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion{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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.link{color:#0064ff}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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.link:hover{cursor:pointer;color:#0053cf}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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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,div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion.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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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"],div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content]>span.inputting-insertion[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 #0064ff}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 #0064ff}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:#0064ff;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 #d4d6d9;color:#87888a}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.editor-root>div.editor-content>div[data-type=editor-container]>div.container-blocks>div[data-type=editor-block][data-document-title]{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;color:#2d2d2e}.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 #0064ff;background-color:#eaf3fc;color:#0064ff}.editor-button.primary{font-weight:500;border:1px solid rgba(0,0,0,0);background-color:var(--editor-button-bg-color, #0064ff);color:var(--editor-button-color, #fff)}.editor-button.primary:not(:disabled):hover{background-color:#408cff;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:#0053cf;color:#fff;border-color:#2872b7}.editor-button:last-child{margin-right:0}.editor-button:not(:disabled):active{background-color:#cfe2ff;color:#0053cf;border-color:#0053cf}@keyframes editorLoadingCircle{0%{transform-origin:50% 50%;transform:rotate(0)}to{transform-origin:50% 50%;transform:rotate(360deg)}}.editor-loading-icon>svg{color:#0064ff;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:inherit;height:inherit}.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:#0064ff}.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 #0064ff;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:#0064ff;background-color:#0064ff}.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:#2d2d2e}[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;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:#ffffff}[data-theme=dropdown-list] .filterable-list .list{max-height:60vh;overflow-y:auto;padding:0 0 8px}[data-theme=dropdown-list] .filterable-list .list .list-item{user-select:none;transition:background 20ms ease-in 0s;cursor:pointer;width:100%;border-radius:3px;height:34px;padding:6px 10px;display:flex;justify-content:space-between;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:hover{background:rgba(0,36,90,.04)}[data-theme=dropdown-list] .filterable-list .list .list-item.selected{color:#0064ff}[data-theme=dropdown-list] .filterable-list .list .list-item.disabled{color:#c1c1c1}[data-theme=dropdown-list] .filterable-list .list .list-item.disabled:hover{background:transparent}[data-theme=dropdown-list] .filterable-list .list .list-item .list-item-selected-icon{display:flex;background:transparent;border:none;color:#0064ff}::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.menu .menu-item{cursor:pointer}div.tippy-box[data-theme=menu] .tippy-arrow{z-index:2}div.tippy-box[data-theme=menu] .tippy-arrow:before{content:"";display:block;width:0px;height:0px;position:absolute;top:-16px;border-width:8px;border-bottom-color:#fff}div.tippy-box[data-theme=menu] .tippy-arrow:after{content:" ";display:block;position:absolute;left:2px;top:-5px;box-shadow:-1px -1px 2px #3030300f;width:12px;height:12px;transform:rotate(45deg)}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[data-theme=toolbar] .tippy-content .editor-command-bar-root{overflow:initial}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: #0064ff;--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:#2d2d2e;user-select:none;transition:background 20ms ease-in 0s;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:#909090}.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.standard.disabled .menu-item-icon{color:#c7c7c7}.editor-command-bar.menu .command-item.separator{height:1px;margin:4px 0;background-color:#dfe1e5;width:100%}.editor-command-bar.menu .command-item.section{font-size:.8em;color:#ccc;padding:5px 5px 5px 10px;cursor:initial;user-select:none}.editor-command-bar.menu .command-item.selected{background-color:#00245a0a}.editor-command-bar.menu .command-item.selected[data-id=delete]:not(.disabled){color:#e52727;background-color:var(--warn-color)}.editor-command-bar.menu .command-item.selected[data-id=delete]:not(.disabled) svg{color:#e52727}.editor-command-bar.menu .command-item.selected.disabled{background-color:transparent}.editor-command-bar.menu .command-item.checked{color:#0064ff}.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:#eb3723}.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:#2d2d2e;height:24px;padding:0;cursor:pointer;border-radius:3px;min-width:24px}.editor-command-bar.toolbar .command-item.selected:not(.disabled){background-color:#00245a0a}.editor-command-bar.toolbar .command-item:active:not(.disabled){background-color:#00245a0f}.editor-command-bar.toolbar .command-item.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.checked{color:#0064ff}.editor-command-bar.toolbar .command-item.checked.disabled{color:#c7c7c7}.editor-command-bar.toolbar .command-item.separator{margin:auto 2px;height:15px;min-width:1px;width:1px;background-color:#dfe1e5;padding:0;pointer-events:none;cursor:default}.editor-command-bar.toolbar .command-item .toolbar-item-name-container{display:flex;flex-direction:row;align-items:center}.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 .command-item[data-button-id=turn-into] .toolbar-item-name-container,.editor-command-bar.toolbar .command-item[data-button-id=align] .toolbar-item-name-container{width:24px;height:24px}.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:#303030;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:#0064ff}.editor-dropdown.active{border-color:#0064ff;box-shadow:0 0 0 2px #338fe533}.editor-dropdown.active .dropdown-text{display:none}.editor-dropdown.active .dropdown-icon svg{color:#0064ff;transform:rotate(180deg)}.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:#0064ff;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:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.editor-dropdown .dropdown-clear-icon{color:#909090}.editor-dropdown .dropdown-clear-icon:hover{color:#0064ff}.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:8px}.editor-dropdown .dropdown-icon svg{transform:rotate(360deg);transition:transform .2s linear}.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 #0064ff;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 #0064ff}.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:#575859;border:1px solid #bebfc2;border-radius:3px;cursor:pointer}.color-palette .clear-button-container .clear-button:hover{color:#0064ff;background:#e3eeff;border:1px solid #0064ff}.color-palette .clear-button-container .clear-button:active{color:#0053cf;background:#cfe2ff;border:1px solid #0053cf}div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu .menu-item[data-id=text-color-palette-item]{cursor:default}.editor-input-wrap .editor-input-label{margin-top:8px;margin-bottom:8px;position:relative;font-weight:500}.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;position:relative}.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:#0064ff;box-shadow:0 0 0 2px #338fe533}.editor-input-wrap .editor-input-container .editor-input-suffix{height:100%;position:absolute;top:0px;right:10px;display:flex;align-items:center;color:#87888a;font-size:12px}.editor-input-wrap .editor-input-container .editor-input-suffix+.editor-input{padding-right:50px}.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]{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=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:#87888a;background:#F7F8FA;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:#87888a}[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:#2d2d2e}[data-command-bar-id=quick-menu] div.command-item>div.menu-item-icon{color:#2d2d2e}[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;padding:4px 15px}: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 #0064ff}.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 .list-to-mindmap-wrap,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap{display:flex;flex-direction:row;justify-content:center}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=mention-button]:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=list-to-mindmap]:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=mention-button]:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=list-to-mindmap]:hover{background:rgba(0,36,90,.0392156863);border-radius:3px}.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=mention-button]:active:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap>button.editor-button[data-button-id=list-to-mindmap]:active:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=mention-button]:active:hover,.editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap>button.editor-button[data-button-id=list-to-mindmap]:active:hover{background:rgba(0,36,90,.0588235294)}.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:center;background-color:transparent;color:#07142a}.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);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 #0064ff;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:#0064ff;background-color:#0064ff}.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-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:#0064ff;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 .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.active[data-list-type=ordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=ordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked]>div[data-type=block-content],.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=checked]>div.list-container,.editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=checked]>div[data-type=block-content]{background-color:#f8f8f8}.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:rgba(0,36,90,.04)}.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 .editor-check-list-wrapper:not(.editor-check-list-wrapper-checked)>span.editor-check-box:hover>span.editor-check-box-inner{border-color:#0064ff}.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=checked] .list-container .editor-check-list-wrapper,.editor-root:not(.readonly) div[data-type=editor-block].list-block[data-list-type=unchecked] .list-container .editor-check-list-wrapper{cursor:pointer}[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;vertical-align:middle;padding:2px 0}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] .embed-block.selected[data-embed-type=math]>div[data-type=block-content].mathjax-overflow:before{width:var(--mathjax-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}div.editor-root div.editor-content div[data-type=editor-block],.status-box-editor-popup{--orange: #F59300;--orange-bkg: #FFF0D9;--grey: #87888A;--grey-bkg: #EDEFF2;--red: #EB3723;--red-bkg: #FFEAE8;--primary: #0064FF;--primary-bkg: #E3EEFF;--green: #00A865;--green-bkg: #D7F7EA;--purple: #8851ED;--purple-bkg: #F0E8FF}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box span[data-type=box-content]{margin-left:0;margin-right:0;padding-left:2.5px;padding-right:2.5px}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-yellow{background-color:var(--orange-bkg);color:var(--orange)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-yellow-subtle{color:#fff;background-color:var(--orange)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-grey{background-color:var(--grey-bkg);color:var(--grey)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-grey-subtle{color:#fff;background-color:var(--grey)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-red{background-color:var(--red-bkg);color:var(--red)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-red-subtle{color:#fff;background-color:var(--red)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-blue{background-color:var(--primary-bkg);color:var(--primary)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-blue-subtle{color:#fff;background-color:var(--primary)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-green{background-color:var(--green-bkg);color:var(--green)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-green-subtle{color:#fff;background-color:var(--green)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-purple{background-color:var(--purple-bkg);color:var(--purple)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-purple-subtle{color:#fff;background-color:var(--purple)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box>[data-type=box-content]{max-width:100%;display:inline-flex;align-items:center;vertical-align:top;position:relative;top:calc((var(--font-size) * var(--line-height) - 20px) / 2)}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common{max-width:100%;line-height:20px;padding:0 5px;border-radius:3px;font-size:12px;height:20px;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:inline-block;font-weight:500}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common.box-status-empty{color:#87888a}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common:hover{outline:1px solid #408CFF}div.editor-root div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.history-deleted-box .box-status-common{text-decoration:line-through}.status-box-editor-popup{width:178px;padding-top:1px}.status-box-editor-popup .status-input input{caret-color:#0064ff}.status-box-editor-popup .scale-border:after,.status-box-editor-popup .status-color-palette .status-box-button.selected:after,.status-box-editor-popup .status-color-palette .status-box-button:hover:after{content:"";outline:1px solid #0064ff;border-radius:3px;position:absolute;left:0;right:0;top:0;bottom:0;transform:scale(1.1)}.status-box-editor-popup .status-color-palette{display:flex;padding:6px 4px 5px}.status-box-editor-popup .status-color-palette .status-box-button+.status-box-button{margin-left:5px}.status-box-editor-popup .status-color-palette .status-box-button{width:24px;height:24px;border:none;outline:none;cursor:pointer;border-radius:3px;position:relative}.status-box-editor-popup .status-color-palette .status-box-button.selected:after{outline:1px solid var(--primary-color)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=grey]{background-color:var(--grey-bkg);border:1px solid var(--grey)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=blue]{background-color:var(--primary-bkg);border:1px solid var(--primary)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=yellow]{background-color:var(--orange-bkg);border:1px solid var(--orange)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=red]{background-color:var(--red-bkg);border:1px solid var(--red)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=green]{background-color:var(--green-bkg);border:1px solid var(--green)}.status-box-editor-popup .status-color-palette .status-box-button[data-color=purple]{background-color:var(--purple-bkg);border:1px solid var(--purple)}[data-command-bar-id=status-box-popup] .tippy-content{padding-left:6px;padding-right:6px}div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common{cursor:default}div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data-type=block-content]>span.status-box .box-status-common:hover{outline:none}.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:#dfe1e5;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:#d4d6d9}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:#0064ff}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:#0064ff;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;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 #dfe1e5;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:#fff6f5!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:#575859}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);background:#f7f8fa}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] .scroll-container{overflow:hidden}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:#f7f8fa}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:#f7f8fa}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{cursor:pointer;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:#408cff}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:20px}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:#2d2d2e;opacity:.3}.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}div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-rows].selected,div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-columns].selected{background-color:#fff6f5}div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-rows].selected svg,div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content button.command-item[data-id=delete-columns].selected svg{color:#eb3723}div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-row],div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-col]{color:#eb3723;background-color:#fff6f5}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block{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:32px 10px 24px 32px;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,.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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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,.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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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,.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.code-line-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.code-line-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.code-line-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,.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.code-line-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.code-line-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,.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.code-line-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,.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.code-line-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}.editor-root:not(.mobile) [data-type=editor-container].root div[data-type=editor-block].code-block{min-width:360px}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:#bebfc2}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:#bebfc2;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{pointer-events:none;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 #0064ff;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:#0064ff;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:#0064ff;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,.editor-root div.editor-content.dragging .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 #0064ff}.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:first-child:last-child{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 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:#0064ff}.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:#0064ff}.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 #0064ff}.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:#F7F8FA;border-radius:var(--editor-border-radius);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:22px;color:#87888a;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:#2d2d2e;opacity:.3}.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}.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:#00245a0a}.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:#0064ff}.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;color:#2d2d2e;font-weight:500;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-container:hover{border:1px solid #0064ff}.editor-find-dialog .editor-find-dialog-input-container:focus{border:1px solid #0064ff;box-shadow:0 0 0 2px #0064ff33}.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:#2d2d2e;background-color:var(--editor-find-dialog-button-border-bg-color);border:none;display:flex;flex-direction:row;align-items:center;padding:0}.editor-find-dialog .editor-find-dialog-icon-button:hover{color:#0064ff}.editor-find-dialog .editor-find-dialog-icon-button:active{color:#0053cf}.editor-find-dialog .editor-find-dialog-button{padding:4px 15px;cursor:pointer;background:#ffffff;border:1px solid #bebfc2;color:#575859;margin:0 4px;font-family:inherit;line-height:20px;border-radius:3px}.editor-find-dialog .editor-find-dialog-button.icon-button{width:32px;height:32px}.editor-find-dialog .editor-find-dialog-button:enabled:hover{color:#0064ff;background:#e3eeff;border:1px solid #0064ff}.editor-find-dialog .editor-find-dialog-button:enabled:active{color:#0053cf;background:#cfe2ff;border:1px solid #0053cf}.editor-find-dialog .editor-find-dialog-button:last-of-type{margin-right:0}.editor-find-dialog .editor-find-dialog-primary-button{color:#fff;background:#0064ff;border:1px solid #0064ff;transition:ease-in .1s}.editor-find-dialog .editor-find-dialog-primary-button:enabled:hover{color:#fff;background:#408cff;border:1px solid #408cff}.editor-find-dialog .editor-find-dialog-primary-button:enabled:active{color:#fff;background:#0053cf;border:1px solid #0053cf}.editor-find-dialog .editor-find-dialog-action{margin:12px 0 20px}.editor-find-dialog .editor-find-dialog-button:disabled{color:#575859;background:#dfe1e5;opacity:.5;border:1px solid #bebfc2;cursor:not-allowed}.editor-find-dialog .editor-find-dialog-primary-button:disabled{color:#fff;background:#0064ff;opacity:.5;border:1px solid #0064ff}.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:#575859;border:var(--editor-find-dialog-button-border);background-color:var(--editor-find-dialog-button-border-bg-color);padding:0;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.editor-find-dialog .editor-find-dialog-icon-button-border:hover{background:#e3eeff;border:1px solid #0064ff}.editor-find-dialog .editor-find-dialog-icon-button-border:active{background:#cfe2ff;border:1px solid #0053cf}.editor-find-dialog .editor-find-dialog-button-close{margin:0 0 0 8px;cursor:pointer;border-radius:4px;color:#2d2d2e;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-button-close:hover{color:#0064ff}.editor-find-dialog .editor-find-dialog-button-close:active{color:#0053cf}.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{pointer-events:none}.editor-find-dialog .editor-highlight .editor-highlight-child{opacity:.1;position:absolute;background-color:#eb3723}.editor-find-dialog .editor-highlight.active .editor-highlight-child{opacity:.3;position:absolute;background-color:#eb3723}.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{pointer-events:none}.editor-highlight .editor-highlight-child{opacity:.1;position:absolute;background-color:#eb3723}.editor-highlight.active .editor-highlight-child{opacity:.3;position:absolute;background-color:#eb3723}.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}body>div.editor-context-menu[data-tippy-root].zh-CN{min-width:200px}body>div.editor-context-menu[data-tippy-root].en-US,body>div.editor-context-menu[data-tippy-root].ja-JP{min-width:200px}body>div.editor-context-menu[data-tippy-root]>div.tippy-box>div.tippy-content{padding:0}body>div.editor-context-menu[data-tippy-root] .editor-command-bar.menu>div.command-item{cursor:pointer}body>div.editor-context-menu[data-tippy-root] .editor-command-bar.menu>div.command-item.disabled{cursor:not-allowed}body>div.editor-context-menu[data-tippy-root] .editor-command-bar.menu>div.command-item.disabled>div.item-subtext{color:#c7c7c7}body>div.editor-context-menu[data-tippy-root] .editor-command-bar.menu>div.command-item>div.item-subtext{margin-left:10px}.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{max-width:100%;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:224px}.comment-editor-editing{border:1px solid #0064ff}.comment-editor-readonly{border:none;padding-left:calc(var(--editor-comment-avatar-width, 22px) + 5px);margin:0}.comment-editor-readonly .comment-editor-img{display:none}.comment-item-root{position:relative}.comment-item-root:not(.last-comment-item):before{content:" ";display:block;position:absolute;left:10px;width:1px;background-color:#dfe1e5;overflow:hidden;opacity:.8;top:21px;bottom:-12px;transform:scaleX(.5)}.comment-item-root .item-head{padding:0;position:relative;display:flex;align-items:center}.comment-item-root .item-head-avatar{margin-right:5px;width:var(--editor-comment-avatar-width, 22px);height:var(--editor-comment-avatar-width, 22px);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:#2d2d2e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-item-root .item-head-modified{margin-left:10px;font-size:12px;color:#87888a;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{color:#2d2d2e}.comment-item-root .item-head-tools .editor-text-button:hover{color:#0064ff}.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 .editor-button{padding:4px 10px;line-height:1}.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{color:#575859;font-size:12px}.comment-quick-reply .quick-reply-button.editor-text-button:hover{color:var(--text-button-color-hover, #0064ff);background-color:var(--text-button-bg-color-hover, transparent)}.comment-quick-reply .quick-reply-button.editor-text-button:active{color:#0053cf;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 .quick-reply-editor .reply-editor-actions .editor-button{padding:4px 10px;line-height:1}.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);--editor-comment-quote-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,.editor-root .editor-content div[data-type=editor-block] span[data-type=editor-box].comment{border-bottom:2px solid #f8e6ab}.editor-root .editor-content div[data-type=editor-block] span.text.comment.active,.editor-root .editor-content div[data-type=editor-block] span[data-type=editor-box].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:284px;padding:0 10px 10px;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)}.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:29}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head{display:flex;align-items:center;justify-content:space-between}.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:20px;height:20px;color:#87888a;padding-bottom:10px;padding-top:10px;padding-right:12px;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:12px;background-color:#d4d6d9;margin-right:6px;float:left;border-radius:10px;margin-top:4px}.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch{display:flex;align-items:center;height:22px;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:#f59300}.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] span.file-icon svg{width:18px}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;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;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;flex-direction:row;align-items:center;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:24px;height:24px}div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content]{min-width:360px}div.editor-root:not(.mobile) 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{min-width:360px}:root{--editor-version-button-border: black;--editor-bg-color: #ffffff;--editor-version-list-bg-color: white;--editor-version-select-bg-color: #F0F6FF}.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:#0064ff;background-color:#e3eeff;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;min-width:0}.version-dialog .version-viewer .version-dialog-editor{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: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: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:2000;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: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: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: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:#0064ff}.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 .toolbar-item-dropdown-container{margin-left:5px}.version-list-root .version-list-header .version-list-filter .editor-command-bar.toolbar .command-item:not(.disabled):hover{color:#0064ff}.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:#0064ff}.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 #0064ff}.version-list-root .version-list-content .version-item .version-item-restore-from{color:#87888a;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;margin-top:5px}.version-list-root .version-list-content .version-item .memo-input.size-limit-textarea textarea{line-height:22px;padding:4px 9px;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:#2d2d2e}.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:#0064ff}.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;margin-top:10px;color:#606060;line-height:22px}.version-list-root .version-list-content .version-item .version-item-author .version-item-author-name{color:#575859}.version-list-root .version-list-content .version-item .version-item-author-mark{width:6px;height:6px;border-radius:3px;margin-right:5px;flex-shrink:0;margin-top:8px}.version-list-root .version-list-content .version-item .version-item-memo{font-size:14px;color:#303030;padding:5px 10px;border-radius:3px;margin-top:5px;line-height:22px}.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{font-family:PingFang SC;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;font-family:inherit}[data-command-bar-id=versions-dropdown-popup] .tippy-box{color:var(--text-color);line-height:normal}[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:#0064ff;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;font-size:12px}[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;cursor:pointer}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container .filter-item-label{cursor:pointer}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container .editor-checkbox-wrapper{margin-right:4px}[data-command-bar-id=versions-dropdown-popup] .command-item .filter-memoed-version-item .filter-item-input-container:hover .editor-checkbox-wrapper:not(.checked)>span.editor-checkbox>span.editor-checkbox-inner{border-color:#0064ff}.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] div[data-type=block-tools] .block-helper .block-button~.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:pointer;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:#00245a0a}.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{color:#87888a;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;cursor:default}.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:#0064ff}.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 .iframe-embed-auth-error-tips{width:100%;height:34px;line-height:34px;background-color:#f7f8fa;text-align:center;color:#bebfc2;z-index:9910;position:fixed;top:0;left:0;box-shadow:0 2px 4px #2d2d2e26,0 0 1px #2d2d2e1a}:root .iframe-embed-auth-error-tips span{cursor:pointer;color:#0064ff;user-select:none}: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;padding:4px 15px}.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 #0064ff;margin-top:16px;margin-bottom:16px}.webpage-content .help-container .help-content{display:flex;align-items:flex-start}.webpage-content .help-container .help-content .help-icon{display:flex;align-items:center;height:20px;color:#0064ff;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:#0064ff;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%;min-height:inherit}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;flex:1}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:#0064ff}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-drawio-content.editor-embed{width:100%;min-height:80px;display:inline-block;text-align:center}.embed-block .editor-drawio-content.editor-embed .editor-empty-drawio{width:240px;height:400px}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;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}.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:#2d2d2e;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:#87888a}.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:#0064ff}.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:#0064ff}.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:#0064ff;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:#2d2d2e;opacity:.3}`)),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
(function(b,Yn){typeof exports=="object"&&typeof module<"u"?Yn(exports,require("kiwi-intl"),require("lodash.merge"),require("string-template"),require("nanoid"),require("events"),require("query-string"),require("js-base64"),require("snabbdom"),require("tiny-typed-emitter"),require("lodash.clonedeep"),require("lodash.isequal"),require("quill-delta"),require("lodash.debounce"),require("lodash.intersection"),require("ot-json1"),require("axios"),require("lodash.findlastindex"),require("reconnecting-websocket"),require("fast-sha256"),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","tiny-typed-emitter","lodash.clonedeep","lodash.isequal","quill-delta","lodash.debounce","lodash.intersection","ot-json1","axios","lodash.findlastindex","reconnecting-websocket","fast-sha256","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"],Yn):(b=typeof globalThis<"u"?globalThis:b||self,Yn(b["oneseditor-editor"]={},b.KiwiIntl,b.merge,b.stringFormat,b.nanoid$1,b.events,b.queryString,b.jsBase64,b.snabbdom,b.tinyTypedEmitter,b.cloneDeep,b.isEqual,b.Delta,b.debounce,b.intersection,b.json1,b.axios,b.findLastIndex,b.ReconnectingWebSocket,b.sha256,b.tippy$1,b.md5,b.cssColorConverter,b.markmap,b.throttle$1,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,Yn,Ks,k6,R6,vb,w6,zc,$o,ye,S6,L6,I6,D6,_6,M6,U6,O6,N6,P6,vg,F6,Bg,K6,V6,$6,mst,gst,pst,Cst,Est,xst,Ast,bst,vst,Bst,Tst,yst,kst,Rst,wst,Sst,Lst,Ist,Dst,_st,Mst,Ust,Ost,Nst,Pst,Fst,Kst,Vst,$st,Hst,jst,zst,Gst,Wst,qst,Xst,Yst,Qst,Jst,Zst,tlt,elt,nlt,rlt,ilt,olt,slt,llt,alt,clt,ult,flt,dlt,hlt,mlt,glt,plt,Clt,Elt,xlt,Alt,blt,vlt,Blt,Tlt,ylt,klt,Rlt,H6,j6,z6,G6,Tg,W6,q6,Et){"use strict";var dst=Object.defineProperty;var hst=(b,Yn,Ks)=>Yn in b?dst(b,Yn,{enumerable:!0,configurable:!0,writable:!0,value:Ks}):b[Yn]=Ks;var m=(b,Yn,Ks)=>(hst(b,typeof Yn!="symbol"?Yn+"":Yn,Ks),Ks);const Me=n=>n&&typeof n=="object"&&"default"in n?n:{default:n};function Dd(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 r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const X6=Me(Yn),yg=Me(Ks),Y6=Me(k6),kg=Me(vb),mt=Me(S6),Gc=Me(L6),mn=Me(I6),ke=Me(D6),Rg=Me(_6),_d=Dd(M6),Bb=Me(U6),Tb=Me(O6),Q6=Me(N6),J6=Dd(P6),Z6=Me(vg),t9=Dd(vg),Md=Me(F6),e9=Dd(K6),n9=Me(V6),ca=Me($6),wg=Me(H6),yb=Me(j6),r9=Me(G6),kb=Me(W6),i9=Me(q6);function o9(n){const t=r=>r<10?`0${String(r)}`:String(r),e=r=>r<10?`00${String(r)}`:r<100?`0${String(r)}`:String(r);return`${n.getFullYear()}-${t(n.getMonth()+1)}-${t(n.getDate())} ${t(n.getHours())}:${t(n.getMinutes())}:${t(n.getSeconds())}.${e(n.getMilliseconds())}`}var Ho=(n=>(n.DEBUG="DEBUG",n.INFO="INFO ",n.WARN="WARN ",n.ERROR="ERROR",n))(Ho||{});const Rb=new Map,Ec=class{constructor(t){m(this,"times",new Map);this.category=t}shouldLog(t){const e=Object.values(Ho).indexOf(t),r=Object.values(Ho).indexOf(Ec.level);return e>=r}_log(t,e,r,i){var B;if(!this.shouldLog(t))return;const o=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=i?`${s} - ${i}`:s;const l=`${this.category}`;let c=console.log;t==="WARN "&&(c=console.warn),t==="ERROR"&&(c=console.error);const d=`${o9(new Date)}`,h=t,C=l,E=Ec.extParams?"[{date}] {level}: [{module} {extParams}] - {msg}":"[{date}] {level}: [{module}] - {msg}",x=[Y6.default(((B=o.env)==null?void 0:B.LOG_TEMPLATE)||E,{date:d,level:h,module:C,msg:s,extParams:Ec.extParams})];if(typeof e=="object"){const k=e.stack;k&&x.push(k)}if(c===console.error&&Ec.debugMode){const k=new Error().stack;k&&x.push(k)}c(...x),r&&this._log(t,r)}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,r){this._log("WARN ",t,e,r)}error(t,e,r){this._log("ERROR",t,e,r)}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 _r=Ec;m(_r,"debugMode",!1),m(_r,"level","DEBUG"),m(_r,"extParams","");function I(n){const t=Rb.get(n);if(t)return t;const e=new _r(n);return Rb.set(n,e),e}const s9={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"}},l9={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"}},a9={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"}},c9=I("i18n"),u9={"en-US":s9,"zh-CN":l9,"ja-JP":a9},Ud=X6.default.init("en-US",u9);let wb="en-US";function f9(n=void 0){Ud.setLang&&(wb=n||"en-US",Ud.setLang(n||"en-US"))}function d9(n){yg.default(Ud.__metas__,n)}function h9(n,t){const e=Ud.get(n,t);return e===n&&c9.warn(`no locale value for key ${n}`),e}function m9(){return wb}const D=Object.freeze(Object.defineProperty({__proto__:null,setLang:f9,mergeLang:d9,t:h9,getCurrentLang:m9},Symbol.toStringTag,{value:"Module"})),wlt="";class Sb{constructor(t,e){this.editor=t,this.data=e}getData(){return this.data}getEditor(){return this.editor}destroy(){}}var Lb=function(){if(typeof Map<"u")return Map;function n(t,e){var r=-1;return t.some(function(i,o){return i[0]===e?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var r=n(this.__entries__,e),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(e,r){var i=n(this.__entries__,e);~i?this.__entries__[i][1]=r:this.__entries__.push([e,r])},t.prototype.delete=function(e){var r=this.__entries__,i=n(r,e);~i&&r.splice(i,1)},t.prototype.has=function(e){return!!~n(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];e.call(r,s[1],s[0])}},t}()}(),Sg=typeof window<"u"&&typeof document<"u"&&window.document===document,Od=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),g9=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Od):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),p9=2;function C9(n,t){var e=!1,r=!1,i=0;function o(){e&&(e=!1,n()),r&&l()}function s(){g9(o)}function l(){var c=Date.now();if(e){if(c-i<p9)return;r=!0}else e=!0,r=!1,setTimeout(s,t);i=c}return l}var E9=20,x9=["top","right","bottom","left","width","height","size","weight"],A9=typeof MutationObserver<"u",b9=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=C9(this.refresh.bind(this),E9)}return n.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},n.prototype.removeObserver=function(t){var e=this.observers_,r=e.indexOf(t);~r&&e.splice(r,1),!e.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},n.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},n.prototype.connect_=function(){!Sg||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),A9?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!Sg||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(t){var e=t.propertyName,r=e===void 0?"":e,i=x9.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),Ib=function(n,t){for(var e=0,r=Object.keys(t);e<r.length;e++){var i=r[e];Object.defineProperty(n,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return n},ua=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||Od},Db=Pd(0,0,0,0);function Nd(n){return parseFloat(n)||0}function _b(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(r,i){var o=n["border-"+i+"-width"];return r+Nd(o)},0)}function v9(n){for(var t=["top","right","bottom","left"],e={},r=0,i=t;r<i.length;r++){var o=i[r],s=n["padding-"+o];e[o]=Nd(s)}return e}function B9(n){var t=n.getBBox();return Pd(0,0,t.width,t.height)}function T9(n){var t=n.clientWidth,e=n.clientHeight;if(!t&&!e)return Db;var r=ua(n).getComputedStyle(n),i=v9(r),o=i.left+i.right,s=i.top+i.bottom,l=Nd(r.width),c=Nd(r.height);if(r.boxSizing==="border-box"&&(Math.round(l+o)!==t&&(l-=_b(r,"left","right")+o),Math.round(c+s)!==e&&(c-=_b(r,"top","bottom")+s)),!k9(n)){var d=Math.round(l+o)-t,h=Math.round(c+s)-e;Math.abs(d)!==1&&(l-=d),Math.abs(h)!==1&&(c-=h)}return Pd(i.left,i.top,l,c)}var y9=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof ua(n).SVGGraphicsElement}:function(n){return n instanceof ua(n).SVGElement&&typeof n.getBBox=="function"}}();function k9(n){return n===ua(n).document.documentElement}function R9(n){return Sg?y9(n)?B9(n):T9(n):Db}function w9(n){var t=n.x,e=n.y,r=n.width,i=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return Ib(s,{x:t,y:e,width:r,height:i,top:e,right:t+r,bottom:i+e,left:t}),s}function Pd(n,t,e,r){return{x:n,y:t,width:e,height:r}}var S9=function(){function n(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Pd(0,0,0,0),this.target=t}return n.prototype.isActive=function(){var t=R9(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},n}(),L9=function(){function n(t,e){var r=w9(e);Ib(this,{target:t,contentRect:r})}return n}(),I9=function(){function n(t,e,r){if(this.activeObservations_=[],this.observations_=new Lb,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return n.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ua(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new S9(t)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ua(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;!e.has(t)||(e.delete(t),e.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},n.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(r){return new L9(r.target,r.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),Mb=typeof WeakMap<"u"?new WeakMap:new Lb,Ub=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=b9.getInstance(),r=new I9(t,e,this);Mb.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){Ub.prototype[n]=function(){var t;return(t=Mb.get(this))[n].apply(t,arguments)}});var Vs=function(){return typeof Od.ResizeObserver<"u"?Od.ResizeObserver:Ub}();class D9 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 r=e[1].match(/(.*)@(.*):(\d+):(\d+)/);r&&(this.lineNumber=+r[3],this.columnNumber=+r[4],this.fileName=r[2]),e.splice(0,1)}else e.splice(1,1);this.stack=e.join(`
|
|
4
4
|
`)}}}function p(n,t,e){if(!t)throw n.error(`assert failed: ${e}`),new D9(e)}const _9=R6.customAlphabet("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_",8),Ob="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function M9(){return Ob[Date.now()%Ob.length]}const et=()=>`${M9()}${_9()}`;class Nb extends kg.default.EventEmitter{constructor(e=60){super();m(this,"cache",new Map);m(this,"expiredSeconds");this.expiredSeconds=e,this.startAutoClear()}delete(e){const r=this.cache.get(e);r&&this.emit("delete",r.data),this.cache.delete(e)}getSync(e,r){const i=this.cache.get(e),o=Date.now();if(i&&(o-i.lastRead)/1e3<this.expiredSeconds)return i.lastRead=o,i.data;const s=r(e);return this.cache.set(e,{lastRead:o,data:s}),s}async get(e,r){const i=this.cache.get(e),o=Date.now();if(i&&(o-i.lastRead)/1e3<this.expiredSeconds)return i.lastRead=o,i.data;const s=await r(e);return this.cache.set(e,{lastRead:o,data:s}),s}startAutoClear(){setInterval(()=>{const e=Date.now();Array.from(this.cache.entries()).forEach(([r,i])=>{(e-i.lastRead)/1e3>this.expiredSeconds&&this.delete(r)})},10*1e3)}}class fa{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 U9=I("await-locker");class O9{constructor(){m(this,"_acquired",!1);m(this,"_waitingResolvers",[]);this._acquired=!1,this._waitingResolvers=[]}acquireAsync(t){return this._acquired?new Promise((e,r)=>{this._waitingResolvers.push(e),t&&t>0&&setTimeout(()=>{const i=this._waitingResolvers.indexOf(e);if(i!==-1){this._waitingResolvers.splice(i,1);const o=new Error(`lock timeout: ${t}, waiting resolves: ${this._waitingResolvers.length}`);r(o)}},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();p(U9,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 N9{constructor(){m(this,"_map");this._map=new Map}getLocker(t){let e=this._map.get(t);return e||(e=new O9,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 Mr=new N9,Gi=navigator.userAgent;function $s(){const n=navigator.userAgent.toLowerCase();return n.indexOf("safari")!==-1&&!(n.indexOf("chrome")>-1)}function Wc(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}const ie={isAndroid:!!Gi.match(/Android/i),isIOS:!!Gi.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/i),isIPad:!!Gi.match(/iPad/i),isIPhone:!!Gi.match(/iPhone/i),isLinux:!!Gi.match(/Linux/i),isMac:!!Gi.match(/Macintosh/i),isMobile:!!Gi.match(/AppleWebKit.*Mobile.*/i),isWindows:!!Gi.match(/Window/i),isIe:!!Gi.match(/msie|trident/i),isSafari:$s(),isFirefox:Wc(),isMobileSafari:!1};ie.isMobileSafari=ie.isMobile&&ie.isSafari;const da=I("dom-utils");function z(n,...t){n&&n.nodeType===Node.ELEMENT_NODE&&n.classList.add(...t)}function wt(n,t){return n instanceof HTMLElement?n.classList.contains(t):!1}function ot(n,...t){n&&n.nodeType===Node.ELEMENT_NODE&&n.classList.remove(...t),n.classList.length===0&&n.removeAttribute("class")}function v(n,t,e,r){const i=document.createElement(n);return t&&t.length>0&&z(i,...t),e&&e.appendChild(i),r&&(typeof r=="string"?i.innerText=r.replace(/\r/g," ").replace(/\n/g," "):_g(i,r)),i}function Hs(n,t,e){const r=v("button",t,e);return r.innerHTML=n,r}function Lg(n,t,e){const r=v("img",t,e);return r.src=n,r}function Pb(n,t){try{const e=document.createRange();return e.setStart(n,t),e}catch(e){p(da,!1,`failed to create range: ${n.childNodes.length}, ${t}, ${e.message}`)}}function Fd(n,t,e,r){try{const i=document.createRange();return i.setStart(n,t),i.setEnd(e,r),i}catch(i){p(da,!1,`failed to create expanded range: ${n.childNodes.length}, ${t}, ${e.childNodes.length}, ${r}, ${i.message}`)}}function Kd(n){const t=n.getClientRects();return p(da,t.length>=1,"getFirstClientRect: no rects"),t[0]}function js(n){const t=n.getClientRects();return p(da,t.length>=1,"getLastClientRect: no rects"),t[t.length-1]}function jo(n,t,e){const r=n.left+n.width/2,i=n.top+n.height/2;return(r-t)**2+(i-e)**2}function Ig(n,t){const e=document.querySelectorAll(".editor-disable-scroll");e.forEach(s=>{s.style.display="none"});let r,i=null,o=-1;return document.caretPositionFromPoint?(r=document.caretPositionFromPoint(n,t),r&&(i=r.offsetNode,o=r.offset)):document.caretRangeFromPoint&&(r=document.caretRangeFromPoint(n,t),r&&(i=r.startContainer,o=r.startOffset)),e.forEach(s=>{s.style.display="block"}),{textNode:i,offset:o}}function Fb(n,t,e){const r=Ig(t,e);return r.textNode===n?r.offset:0}function Vd(n,t){if(n===t)return 0;if((!n.parentElement||!t.parentElement)&&p(da,!1,"invalid dom node to compare"),n.parentElement===t.parentElement){const o=Array.from(n.parentElement.children);return o.indexOf(n)-o.indexOf(t)}const e=o=>{const s=[o];for(;o.parentElement;)s.unshift(o.parentElement),o=o.parentElement;return s},r=e(n),i=e(t);r[0]!==i[0]&&p(da,!1,"invalid dom node to compare, different tree");for(let o=1;;o++){const s=r[o],l=i[o];if(s===l)continue;const c=r[o-1],d=Array.from(c.children);return d.indexOf(s)-d.indexOf(l)}}function Dg(n){var i,o;const t=window.getComputedStyle(n),e=(i=Number.parseInt(t.paddingLeft,10))!=null?i:0,r=(o=Number.parseInt(t.paddingRight,10))!=null?o:0;return e+r}function qc(n){return!document.documentElement.contains(n)}function re(n,t){let e=t;for(;e;){if(n===e)return!0;e=e.parentNode}return!1}function Kb(n,t,e){if(document.getElementById(t)){setTimeout(e);return}const i=document.createElement("script");i.async=!0,i.src=n,i.id=t,document.head.appendChild(i),i.onload=()=>e(),i.onerror=o=>{if(o instanceof Event){const s=o.target;let l="";s&&(l=s.src),e(new URIError(`The script ${l} didn't load correctly.`))}else e(new URIError(`The script ${o} didn't load correctly.`))}}async function zs(n,t){const e=new Promise((r,i)=>{Kb(n,t,o=>{o?i(o):r(void 0)})});try{await Mr.lock(t),await e}finally{Mr.release(t)}}function _g(n,t){Object.entries(t).forEach(([e,r])=>{n.dataset[e]=`${r}`})}function $d(n,t){Object.entries(t).forEach(([e,r])=>{n.setAttribute(e,r)})}function Mg(n,t){Object.entries(t).forEach(([e,r])=>{n.style.setProperty(e,r)})}function Xc(n){let t=0,e=0,r=n;do t+=r.offsetTop||0,e+=r.offsetLeft||0,r=r.offsetParent;while(r);return{top:t,left:e}}function ha(n,t){return!n.target||!(n.target instanceof Element)?null:n.target.closest(t)}function Vb(n){return ha(n,'[data-type="editor-block"]')}function Ug(n){if(!n)return!1;const t=window.getComputedStyle(n);return t.display==="none"||t.visibility==="hidden"?!1:n.parentElement?Ug(n.parentElement):!0}function dr(n){let t=n;for(;t;){let e;if(t instanceof HTMLElement?e=t.offsetWidth:e=Number.parseInt(getComputedStyle(n).width,10),e!==0)return t.getBoundingClientRect().width/e;t=t.parentElement}return 1}function Hd(n,t){let e=!1;n.addEventListener("compositionstart",()=>{e=!0}),n.addEventListener("compositionend",()=>{$s()?setTimeout(()=>{e=!1},100):e=!1});const r=i=>{t(i,e)};return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}}function Ae(n,t,e={noFilter:!1}){return e.noFilter?document.elementFromPoint(n,t)||document.body:document.elementsFromPoint(n,t).find(o=>o instanceof HTMLElement&&!wt(o,"editor-disable-scroll"))||document.body}class P9{constructor(t){m(this,"element");this.element=t}getClientHeight(){return this.element.clientHeight}getHorizontalScroll(){return this.element.scrollLeft}getVerticalScroll(){return this.element.scrollTop}getMaxHorizontalScroll(){return this.element.scrollWidth-this.element.clientWidth}getMaxVerticalScroll(){return this.element.scrollHeight-this.element.clientHeight}getHorizontalElementScrollOffset(t,e){return Xc(t).left*dr(t)-Xc(e).left*dr(e)}getVerticalElementScrollOffset(t,e){return Xc(t).top*dr(t)-Xc(e).top*dr(e)}scrollTo(t,e){this.element.scrollLeft=t,this.element.scrollTop=e}}class F9{constructor(){m(this,"element",window)}getHorizontalScroll(){return window.scrollX||document.documentElement.scrollLeft}getClientHeight(){return window.innerHeight||document.documentElement.clientHeight}getVerticalScroll(){return window.scrollY||document.documentElement.scrollTop}getMaxHorizontalScroll(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth)-window.innerWidth}getMaxVerticalScroll(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-window.innerHeight}getHorizontalElementScrollOffset(t){return(window.scrollX||document.documentElement.scrollLeft)+t.getBoundingClientRect().left}getVerticalElementScrollOffset(t){return(window.scrollY||document.documentElement.scrollTop)+t.getBoundingClientRect().top}scrollTo(t,e){window.scrollTo(t,e)}}const Wi={elements:[],cancelMethods:[],add:(n,t)=>{Wi.elements.push(n),Wi.cancelMethods.push(t)},remove:(n,t)=>{const e=Wi.elements.indexOf(n);e>-1&&(t&&Wi.cancelMethods[e](),Wi.elements.splice(e,1),Wi.cancelMethods.splice(e,1))}},$b=typeof window<"u",K9={cancelOnUserAction:!0,easing:n=>--n*n*n+1,elementToScroll:$b?window:null,horizontalOffset:0,maxDuration:3e3,minDuration:250,speed:500,verticalOffset:0};async function Gs(n,t={}){if(!$b)return new Promise(Y=>{Y(!1)});if(!window.Promise)throw"Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill.";let e,r,i;const o={...K9,...t},s=o.elementToScroll===window,l=!!o.elementToScroll.nodeName;if(!s&&!l)throw"Element to scroll needs to be either window or DOM element.";const c=s?document.documentElement:o.elementToScroll;getComputedStyle(c).getPropertyValue("scroll-behavior")==="smooth"&&console.warn(`${c.tagName} has "scroll-behavior: smooth" which can mess up with animated-scroll-to's animations`);const h=s?new F9:new P9(o.elementToScroll);if(n instanceof Element){if(i=n,l&&(!o.elementToScroll.contains(i)||o.elementToScroll.isSameNode(i)))throw"options.elementToScroll has to be a parent of scrollToElement";e=h.getHorizontalElementScrollOffset(i,o.elementToScroll),r=h.getVerticalElementScrollOffset(i,o.elementToScroll)}else if(typeof n=="number")e=h.getHorizontalScroll(),r=n;else if(Array.isArray(n)&&n.length===2)e=n[0]===null?h.getHorizontalScroll():n[0],r=n[1]===null?h.getVerticalScroll():n[1];else throw`Wrong function signature. Check documentation.
|
|
@@ -12,7 +12,7 @@ Available method signatures are:
|
|
|
12
12
|
* @author Roy Revelt, Codsen Ltd
|
|
13
13
|
* @license MIT
|
|
14
14
|
* {@link https://codsen.com/os/string-character-is-astral-surrogate/}
|
|
15
|
-
*/function V9(n){if(typeof n=="string")return n.length===0?!1:n.charCodeAt(0)>=55296&&n.charCodeAt(0)<=56319;if(n===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isHighSurrogate(): the input is not string but ${typeof n}`)}function $9(n){if(typeof n=="string")return n.length===0?!1:n.charCodeAt(0)>=56320&&n.charCodeAt(0)<=57343;if(n===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isLowSurrogate(): the input is not string but ${typeof n}`)}const Yc="\u200B";function H9(n){return[...n].length}function j9(n,t,e){const i=[...n];let o;return e===void 0?o=i.length:o=t+e,i.slice(t,o).join("")}function z9(n){const t="\xA0";if(!n)return"";if(n===" ")return t;let e=n;return e.startsWith(" ")&&(e=t+e.substr(1)),e.endsWith(" ")&&(e=e.substr(0,e.length-1)+t),e=e.replace(/ {2}/g,` ${t}`),e}function jd(n){if(!/["'&<>]/.exec(n))return n;const r={'"':""","'":"'","&":"&","<":"<",">":">"};return n.split("").map(l=>r[l]||l).join("")}function Hb(n){const t=document.getElementById(n);t&&t.remove()}function jb(n,t){const e=document.getElementById(t);if(e)return e.textContent=n,e;const r=document.createElement("style");return r.id=t,r.textContent=n,document.head.append(r),r}function Qc(n){const t="custom-cursor-style";if(n){const e=`body * { cursor: ${n} !important}`;jb(e,t)}else Hb(t)}const zb=3,Gb=I("drag-drop");class Wb{constructor(t){m(this,"dragStarted",!1);m(this,"mouseDownEvent",null);m(this,"_dragOffsetX",0);m(this,"_dragOffsetY",0);m(this,"handleMouseDown",t=>{t.preventDefault(),t.stopPropagation(),this.mouseDownEvent=t;const e=this.options.elem.getBoundingClientRect();this._dragOffsetX=this.mouseDownEvent.x-e.left,this._dragOffsetY=this.mouseDownEvent.y-e.top,this.bindEvents()});m(this,"handleMouseMove",t=>{var o;t.preventDefault(),t.stopPropagation(),p(Gb,this.mouseDownEvent,"no mouse down event");const e=t.x-this.mouseDownEvent.x,r=t.y-this.mouseDownEvent.y;if(this.dragStarted){this.onDragging(t,e,r);return}const i=(o=this.options.minThreshold)!=null?o:zb;(Math.abs(e)>=i||Math.abs(r)>=i)&&this.onDragStart(this.mouseDownEvent)});m(this,"handleMouseUp",t=>{if(t.button===0){p(Gb,this.mouseDownEvent,"no mouse down event");const e=t.x-this.mouseDownEvent.x,r=t.y-this.mouseDownEvent.y;this.onDragEnd(t,e,r),t.preventDefault(),t.stopPropagation()}});this.options=t,this.options.mouseDownEvent?this.handleMouseDown(this.options.mouseDownEvent):this.trackEvents()}get data(){return this.options.data}get dragOffsetX(){return this._dragOffsetX}get dragOffsetY(){return this._dragOffsetY}get dragOffset(){return{x:this._dragOffsetX,y:this._dragOffsetY}}trackEvents(){this.options.elem.addEventListener("mousedown",this.handleMouseDown)}untrackEvents(){this.options.elem.removeEventListener("mousedown",this.handleMouseDown)}bindEvents(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}unbindEvents(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}onDragStart(t){this.dragStarted=!0,this.options.cursor&&Qc(this.options.cursor),this.options.onDragStart(this,t,this.options.elem)}onDragging(t,e,r){this.options.onDragging(this,t,this.options.elem,e,r)}onDragEnd(t,e,r){this.options.cursor&&Qc(null),this.dragStarted&&this.options.onDragEnd(this,t,this.options.elem,e,r),this.unbindEvents(),this.dragStarted=!1}destroy(){this.unbindEvents(),this.untrackEvents()}}function Og(n){return new Wb(n)}const G9=I("character");function qb(n,t){for(let e=0;e<t.length;e++){const r=t[e][0],i=t[e].length>1?t[e][1]:null;if(i===null&&n===r||i!==null&&n>=r&&n<=i)return!0}return!1}function Xb(n){const t=n.charAt(0);return t>="0"&&t<="9"}function Yb(n){const t=n.charAt(0);return t>="a"&&t<="z"||t>="A"&&t<="Z"||t.toUpperCase()!==t.toLowerCase()?!0:RegExp(/^\p{L}/,"u").test(t)}function zd(n){const t=[[9,13],[32],[160]];return qb(n.charCodeAt(0),t)}function Qb(n){const t=[[12352,12687],[13056,13183],[13312,15661],[19968,40959],[63744,64255],[44032,55215]];return qb(n.charCodeAt(0),t)}function Ng(n,t){let e=t;return p(G9,e.length===1,"invalid char length"),e==="]"&&(e="\\]"),e==="\\"&&(e="\\\\"),n.replace(new RegExp(`^[${e}]+|[${e}]+$`,"g"),"")}function Pg(n){return n?n.length===1||n==="Process"||n==="Unidentified"&&ie.isAndroid:!1}function Jb(n){switch(n){case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":case"End":case"Home":case"PageDown":case"PageUp":return!0;default:return!1}}function W9(n){return Jb(n.key)}function q9(n){switch(n){case"ArrowUp":case"ArrowLeft":case"Home":case"PageUp":return!0;default:return!1}}function qs(n){return n.ctrlKey||n.altKey||n.shiftKey||n.metaKey}function X9(n){return n.key?!!(n.ctrlKey||n.metaKey||n.altKey):!1}function Zb(n){return ie.isMac?n.metaKey&&!n.ctrlKey:!n.metaKey&&n.ctrlKey}function Y9(n){return Zb(n)&&!n.altKey&&!n.shiftKey}function Q9(n){return!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.altKey}function tv(n){return!qs(n)&&n.key==="Enter"}function J9(n){return n.key==="Enter"&&n.shiftKey&&!n.altKey&&!n.ctrlKey&&!n.metaKey}function Gd(n){return!qs(n)&&n.key==="Escape"}function Z9(n){return!qs(n)&&n.key==="Delete"}function ev(n){return!qs(n)&&n.key==="Backspace"}function tI(n){return!qs(n)&&n.key==="Tab"}function eI(n){return n.shiftKey&&n.key==="Tab"&&!n.ctrlKey&&!n.metaKey}function qe(n){if(!n)return"";if(ie.isMac){const t=n.replace("CtrlOrCmd","\u2318").replace("Shift","\u21E7").replace("Ctrl","\u2303").replace("Alt","\u2325").replace(/\+(?!$)/gm,""),e={"\u2318":4,"\u21E7":3,"\u2325":2,"\u2303":1};return t.split(/(?=[\s\S])/u).sort((i,o)=>{var c,d;const s=(c=e[i])!=null?c:5,l=(d=e[o])!=null?d:5;return s-l}).map(i=>i in e?`${i}+`:i).join("")}return n.replace("CtrlOrCmd","Ctrl")}function nv(n){const t={ctrl:!1,alt:!1,shift:!1,cmd:!1,key:""},e=n.toLocaleUpperCase().split("+");for(let r=0;r<e.length;r++){const i=e[r];i==="CTRL"||i==="CONTROL"?t.ctrl=!0:i==="ALT"||i==="OPTION"?t.alt=!0:i==="SHIFT"?t.shift=!0:i==="CMD"||i==="COMMAND"?t.cmd=!0:i==="CMDORCTRL"||i==="CTRLORCMD"?ie.isMac?t.cmd=!0:t.ctrl=!0:i==="SPACE"?t.key=" ":t.key=i.substring(0,1)+i.substring(1).toLocaleLowerCase()}return t}function di(n,t){const e=nv(t);return e.ctrl!==n.ctrlKey||e.alt!==n.altKey||e.shift!==n.shiftKey||ie.isMac&&e.cmd!==n.metaKey?!1:e.key.length===1?e.key===n.key.toUpperCase():e.key.toUpperCase()===n.key.toUpperCase()}function Fg(n,t){return w6.stringifyUrl({url:n,query:t})}function hi(n){return typeof n=="string"?zc.Base64.encode(n,!0):zc.Base64.fromUint8Array(n,!0)}function Jc(n){return zc.Base64.decode(n)}function nI(n){return zc.Base64.toUint8Array(n)}function Kg(n){return new Blob([zc.Base64.toUint8Array(n)])}const rI=$o.init([$o.classModule,$o.styleModule,$o.datasetModule,$o.attributesModule,$o.propsModule]);function Zc(n,t){const e=$o.toVNode(n),r=$o.toVNode(t);rI(e,r)}async function Vg(n,t){const e=new FileReader,r=new Promise((o,s)=>{e.onload=o,e.onerror=s});return e.readAsDataURL(new Blob([n],{type:t})),await r,e.result}async function ma(n){const t=new FileReader,e=new Promise((i,o)=>{t.onload=i,t.onerror=o});return t.readAsDataURL(n),await e,t.result}function iI(n,...t){const e=n.tagName.toLowerCase();for(let r=0,i=t.length;r<i;r++)if(e===t[r].toLowerCase())return!0;return!1}function Xe(n,t){let e=n;for(;e;){const r=window.getComputedStyle(e);if(t!=null&&t.horizontal){if(/auto|scroll/i.test(r.overflowX))break}else if(/auto|scroll/i.test(r.overflowY))break;e=e.parentElement}return(!e||iI(e,"body"))&&(e=document.documentElement),e}function rv(n){n.preventDefault(),n.stopPropagation()}function $g(n){if(document.querySelector(`.editor-disable-scroll[data-scroll-id="${n}"]`))return;const t=v("div",["editor-disable-scroll"],null);t.setAttribute("data-scroll-id",n),t.addEventListener("wheel",rv,{passive:!1}),document.body.appendChild(t)}function Hg(n){const t=document.querySelector(`.editor-disable-scroll[data-scroll-id="${n}"]`);t&&(t.removeEventListener("wheel",rv),t.remove())}function jg(n,t,e){const r=new Blob([n]),i=new File([r],e,{type:t});return URL.createObjectURL(i)}function Wd(n){const t=document.createElement("template");if("content"in t)return t.innerHTML=n,document.importNode(t.content,!0);const e=document.createDocumentFragment(),r=document.createElement("div");for(r.innerHTML=n;r.firstChild;)e.appendChild(r.firstChild);return e}function iv(n){const t=document.createElement("div");return t.appendChild(n),t.innerHTML}function ov(n){let t=n.getPropertyValue("font");if(t)return t;const e=n.getPropertyValue("font-style"),r=n.getPropertyValue("font-variant"),i=n.getPropertyValue("font-weight"),o=n.getPropertyValue("font-size"),s=n.getPropertyValue("font-family");return t=`${e} ${r} ${i} ${o} ${s}`.replace(/ +/g," ").trim(),t}function qd(n,t){const r=(qd.canvas||(qd.canvas=document.createElement("canvas"))).getContext("2d");return r?(typeof t=="string"?t?r.font=t:r.font=ov(window.getComputedStyle(document.body)):t instanceof Element&&(r.font=ov(window.getComputedStyle(t))),r.measureText(n).width+4):200}const sv=I("editor-clipboard");async function oI(n,t){if(t.clipboardData){const e=t.clipboardData;for(const r of n)e.setData(r.type,r.data);return!0}return!1}function sI(n){return typeof n.text=="function"?n.text():new Promise((t,e)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=e,r.readAsText(n)})}async function lI(n){var t;if(document.queryCommandSupported&&document.queryCommandSupported("copy")){const e=document.createElement("textarea");try{let r=(t=n.find(i=>i.type==="text/plain"))==null?void 0:t.data;return r instanceof Blob&&(r=await sI(r)),e.textContent=r!=null?r:"",e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),!0}catch(r){return sv.error(r),document.body.removeChild(e),!1}}return!1}async function tu(n){try{const t={};n.forEach(r=>{t[r.type]=r.data});const e=new ClipboardItem(t);return await navigator.clipboard.write([e]),!0}catch(t){return sv.error(t),await lI(n)}}function ga(n,t){return new Promise((e,r)=>{const i=document.createElement("input");i.type="file",i.style.display="none",t!=null&&t.multiple&&(i.multiple=!0),i.accept=n,i.onchange=()=>{const o=i.files;if(o){const s=t!=null&&t.multiple?Array.from(o):o[0];e(s)}i.remove()},i.onerror=o=>{r(o),i.remove()},document.body.append(i),i.click()})}function Xd(n){return Array.isArray(n)?n.every(t=>t instanceof File):!1}function eu(n){const t=n;if(!t)return"";const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1)}function Yd(n,t){const e=document.createElement("a");e.setAttribute("download",`${t||""}`),e.setAttribute("href",`${n}`),e.click(),e.remove()}const lv=I("auto-scroll");function av(n,t){return!(n.scrollHeight===n.clientHeight||t==="top"&&n.scrollTop===0||t==="bottom"&&n.scrollTop+n.clientHeight===n.scrollHeight||t==="left"&&n.scrollLeft===0||t==="right"&&n.scrollLeft+n.clientWidth===n.scrollWidth)}function cv(n,{direction:t,step:e}){let r=null;const i=t==="left"||t==="right",o=()=>av(n,t)?(i?t==="left"?n.scrollLeft=Math.max(n.scrollLeft-e,0):n.scrollLeft=Math.min(n.scrollLeft+e,n.scrollWidth):t==="top"?n.scrollTop=Math.max(n.scrollTop-e,0):n.scrollTop=Math.min(n.scrollTop+e,n.scrollHeight),r=requestAnimationFrame(o),r):(lv.debug("No need for scroll"),null);return r=requestAnimationFrame(o),()=>{r&&cancelAnimationFrame(r)}}class Qd{constructor(t){m(this,"cancelScroll",null);m(this,"options");m(this,"scrollDomInfo");m(this,"scrolling",!1);m(this,"getScrollingDirection",t=>{const{x:e,y:r}=t,{top:i,bottom:o,left:s,right:l}=this.scrollDomInfo,{edge:c}=this.options;return c.top&&r<=c.top+i?"top":c.bottom&&r>=o-c.bottom?"bottom":c.left&&e<=s+c.left?"left":c.right&&e>=l-c.right?"right":null});m(this,"handleMouseMove",t=>{var s;const{scrollElement:e,step:r=10,onDirectionChange:i}=this.options,o=this.getScrollingDirection(t);if(o){if(this.scrolling)return;lv.debug(`scroll direction: ${o}`),this.cancelScroll=cv(e,{direction:o,step:r}),i==null||i(o),this.scrolling=!0}else(s=this.cancelScroll)==null||s.call(this),this.scrolling=!1});this.options=t,this.scrollDomInfo=this.getScrollDomInfo()}getScrollDomInfo(){const{scrollElement:t}=this.options,e=t.getBoundingClientRect(),r=e.top,i=e.left,o=e.bottom,s=e.right;return{left:i,top:r,right:s,bottom:o}}active(){const{trackMouseEvent:t="mousemove"}=this.options;window.addEventListener(t,this.handleMouseMove,!0)}inactive(){var e;const{trackMouseEvent:t="mousemove"}=this.options;window.removeEventListener(t,this.handleMouseMove,!0),(e=this.cancelScroll)==null||e.call(this),this.scrolling=!1}}function uv(n,t){if(n===0)return"0 Bytes";const e=1024,r=t||2,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(n)/Math.log(e));return`${parseFloat((n/e**o).toFixed(r))} ${i[o]}`}function nu(n,t){let e=`${n}`;const r=t-e.length;for(let i=0;i<r;i++)e=`0${e}`;return e}const{t:Xs}=D;function zg(n,t){const e=new Date(n).getTime()+864e5*t;return new Date(e)}function aI(n,t){const e=n,r=Math.floor(t/12),i=t-r*12;return r&&e.setFullYear(e.getFullYear()+r),i&&e.setMonth(e.getMonth()+i),e}function cI(n,t){return zg(n,t)}function Gg(n,t){const e=new Date(n),r=new Date(t);return e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()}function fv(n){const t=new Date,e=new Date(n);return Gg(t,e)}function dv(n){const t=zg(new Date,-1);return Gg(t,n)}function uI(n,t){return Math.round((n.getTime()-t.getTime())/864e5)}function Wg(n,t){const e=new Date(n);if(t){const r=e.getFullYear(),i=e.getMonth()+1,o=e.getDate(),s=e.getHours(),l=e.getMinutes();let c=t;return c=c.replace("YYYY",`${r}`),c=c.replace("MM",nu(i,2)),c=c.replace("DD",nu(o,2)),c=c.replace("M",`${i}`),c=c.replace("D",`${o}`),c=c.replace("hh",nu(s,2)),c=c.replace("mm",nu(l,2)),c=c.replace("h",`${s}`),c=c.replace("m",`${l}`),c}return n.toLocaleDateString()}function qg(n,t){const e=new Date(n),r=new Date;if(e.getTime()-r.getTime()>10*1e3)return D.t("date.dateFromFuture");if(fv(e)){const o=(r.getTime()-n.getTime())/1e3;if(o<10*60)return Xs("date.dateJustNow");if(o<60*60)return Xs("date.dateMinutesAgo",{num:`${Math.floor(o/60)}`});const s=Math.floor(o/60/60);return s===1?Xs("date.date1HourAgo"):Xs("date.dateHoursAgo",{num:`${s}`})}if(dv(n))return Xs("date.dateYesterday");const i=Math.floor((r.getTime()-n.getTime())/1e3/24/60/60)+1;return i<14?Xs("date.dateDaysAgo",{num:`${i}`}):i<28?Xs("date.dateWeeksAgo",{num:`${Math.round(i/7)}`}):Wg(n,t)}function Xg(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fI(n,t,e){return n.replace(new RegExp(Xg(t),"g"),e)}function dI(n,t,e){return n.replace(new RegExp(Xg(t),"gi"),e)}function hv(n,t,e){const i=document.createElement("canvas").getContext("2d");if(!i)return null;if(i.font=String(t),i.measureText(n).width>e){let s=0,l=0;for(;l<e;)l=i.measureText(n.slice(0,s)).width,s++;return`${n.slice(0,s-2)}...`}return n}const mv=/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f\uAC00-\uD7AF]/,gv=" -\x7F0-9!-/:-@[-`{-~\u0370-\u03FF\u0400-\u04FF",hI=new RegExp(`[${gv}]`),mI=new RegExp(`([^(${gv})])`,"g"),pv=/(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]/;function Cv(n){return n.length===0?0:n.split("").reduce((t,e)=>{const r=(t<<5)-t+e.charCodeAt(0);return r&r},0)}function gI(n,t=1){var r,i;return(i=((r=Array.from(n))==null?void 0:r.filter(o=>mv.test(o))).slice(-t))==null?void 0:i.join("")}function pI(n,t=1){var i;const e=Array.from((i=n==null?void 0:n.replace(mI,""))==null?void 0:i.split(/\s/));return e.reduce((o,s,l)=>{var c,d;return l===e.length-1&&o.length<t?`${o}${(c=s==null?void 0:s.slice(0,t-o.length))!=null?c:""}`:`${o}${(d=s[0])!=null?d:""}`},"").slice(0,t)}function CI(n,t=1){var r,i;return(i=((r=Array.from(n))==null?void 0:r.filter(o=>pv.test(o))).slice(-t))==null?void 0:i.join("")}function EI(n,t=1){var e,r;return(r=(e=Array.from(n))==null?void 0:e.slice(0,t))==null?void 0:r.join("")}function Jd(n,t=1){if(!n||n.length===0)return"";const e=mv.test(n),r=hI.test(n),i=pv.test(n);switch(!0){case e:return gI(n,t);case r:return pI(n,t);case i:return CI(n,t);default:return EI(n,t)}}var Ev=(n=>(n.blue="#0064FF",n.cyan="#34AFDE",n.teal="#2CB2AE",n.green="#24B47E",n.kelly="#8AAB3F",n.yellow="#F0A100",n.orange="#EB6414",n.red="#E52727",n.fuchsia="#BE507D",n.purple="#9678D3",n))(Ev||{});function Zd(n){const t=Object.values(Ev),e=Math.abs(typeof n=="string"&&n.trim()?Cv(n.trim()):0)%t.length;return t[e]}const xv=I("element");function Yg(n,t,e){const r=v("div",[t],n);return r.setAttribute("data-type","editor-container"),r.setAttribute("data-container-id",e),v("div",["container-blocks"],r),r}function Ur(n,t){const e=n.rootElement.querySelector(`[data-container-id=${t}]`);return p(xv,e,`no container: ${t}`),e}function ru(n,t){return n.rootElement.querySelector(`[data-container-id=${t}]`)}function iu(n){const t=n.querySelector(":scope > .container-blocks");return p(xv,t,"no container blocks element"),t}function xI(n){let t=n.querySelector(":scope > .container-tools");return t||(t=v("div",["container-tools"],n)),t}const Qg=I("container-children");function fe(n){const t=iu(n),e=Array.from(t.children);return p(Qg,e.length>0,"container have not any child block"),e}function be(n){const t=n.querySelector(":scope > .container-blocks > div[data-type=editor-block]");return p(Qg,t,"container have not any child block"),t}function Ue(n){const t=fe(n);return t[t.length-1]}function Or(n){return fe(n).length}function zo(n,t){const e=fe(n)[t];return p(Qg,e,`container have not block at index ${t}`),e}function Av(n,t){var e;return(e=fe(n)[t])!=null?e:null}class AI{constructor(t){m(this,"renders",[]);this.editor=t}registerRender(t){this.renders.push(t)}renderBox(t,e){const r={classes:[],attributes:{},styles:{}};return this.renders.forEach(i=>{if(i.renderBox){const o=i.renderBox(this.editor,t,e);o.classes&&r.classes.push(...o.classes),o.attributes&&(r.attributes={...r.attributes,...o.attributes}),o.styles&&(r.styles={...r.styles,...o.styles})}}),r}renderText(t,e){const r={classes:[],attributes:{},styles:{}};return this.renders.forEach(i=>{if(i.renderText){const o=i.renderText(this.editor,t,e);o.classes&&r.classes.push(...o.classes),o.attributes&&(r.attributes={...r.attributes,...o.attributes}),o.styles&&(r.styles={...r.styles,...o.styles})}}),r}renderBlock(t,e,r){const i={classes:[],attributes:{},styles:{}};return this.renders.forEach(o=>{if(o.renderBlock){const s=o.renderBlock(this.editor,e,r);s.classes&&i.classes.push(...s.classes),s.attributes&&(i.attributes={...i.attributes,...s.attributes}),s.styles&&(i.styles={...i.styles,...s.styles})}}),i}updateBlock(t,e,r,i){this.renders.forEach(o=>{var s;(s=o.updateBlock)==null||s.call(o,t,e,r,i)})}}const bv=I("block-class");function Qt(n,t){return n.editorBlocks.getBlockClass(Dt(t))}function vv(n,t){const e=n.editorBlocks.getBlockClass(Dt(t));return p(bv,e.blockKind==="text",`is not a text block, ${e.blockType}`),e}function hr(n,t){const e=n.editorBlocks.getBlockClass(Dt(t));return p(bv,e.blockKind==="complex",`is not a text block, ${e.blockType}`),e}function Ys(n,t){return n.editorBlocks.getBlockClass(t)}function rt(n,t){return Qt(n,t).blockKind==="text"}function ou(n,t){return n.editorBlocks.getBlockClass(t).blockKind==="text"}function It(n,t){return Qt(n,t).blockKind==="complex"}function bI(n,t){return!It(n,t)}function Nr(n,t){return Qt(n,t).blockKind}class Re extends ye.TypedEmitter{constructor(e){super();m(this,"hoveringBlock",null);m(this,"hoveringTextChild",null);m(this,"filters",[]);m(this,"finders",[]);m(this,"handleDocumentMouseMove",e=>{if(this.hoveringBlock){for(const s of this.filters)if(s.isInBlock(this.hoveringBlock,e))return}const r=Ae(e.x,e.y,{noFilter:!0});if(!r){this.setHoveringBlock(null,e,null);return}let i=Z(r);if((!i||!re(this.editor.rootContainer,i))&&(i=this.findBlockByFinders(e),!i)){this.setHoveringBlock(null,e,null);return}const o=this.getParentTextContentChild(i,r);this.setHoveringBlock(i,e,o)});this.editor=e,document.addEventListener("mousemove",this.handleDocumentMouseMove)}destroy(){document.removeEventListener("mousemove",this.handleDocumentMouseMove),this.filters.forEach(e=>e.destroy()),this.filters=[],this.finders.forEach(e=>e.destroy()),this.finders=[]}addFilter(e){this.filters.push(e)}addFinder(e){this.finders.push(e)}hoveringBlockId(){return this.hoveringBlock?lt(this.hoveringBlock):""}findBlockByFinders(e){for(let r=0;r<this.finders.length;r++){const o=this.finders[r].findTargetBlock(this.editor,e);if(o)return o}return null}setHoveringBlock(e,r,i){if(this.hoveringBlock===e&&this.hoveringTextChild===i)return;if(this.hoveringBlock!==e){const s=this.hoveringBlock&&re(this.editor.rootContainer,this.hoveringBlock)?this.hoveringBlock:null;s&&ot(s,"hover"),e&&z(e,"hover"),this.hoveringBlock=e,this.emit("change",this.hoveringBlock,s,r)}const o=this.hoveringTextChild;this.hoveringTextChild=i,this.emit("childChange",this.hoveringBlock,i,o,r)}static get(e){return e.addCustom("standard-hovering-block",()=>new Re(e))}getParentTextContentChild(e,r){if(!rt(this.editor,e))return null;const i=Nt(e);return r.parentElement===i?r:t1(r)}}const Bv="style-color-",Tv="style-bg-color-";class yv{renderText(t,e,r){return this.generateCSSCustomProperties(r)}renderBlock(t,e,r){var l,c;const i={};Object.entries(r).filter(d=>d[0].startsWith("style-")).forEach(([d,h])=>{i[`data-${d}`]=`${h}`});const s=[];return((c=(l=t.selection)==null?void 0:l.range)==null?void 0:c.start.blockId)===r.id&&s.push("focused"),typeof r.align=="string"&&r.align&&(i["data-style-align"]=r.align),r.heading&&(i["data-style-heading"]=String(r.heading)),r.quoted&&(i["data-style-quoted"]="true"),Re.get(t).hoveringBlockId()===r.id&&s.push("hover"),{attributes:i,classes:s}}updateBlock(t,e,r,i){var s,l;Array.from(r.attributes).forEach(c=>{c.name.startsWith("data-style-")&&r.removeAttribute(c.name)}),Object.entries(i).filter(c=>c[0].startsWith("style-")||c[0]==="align").forEach(([c,d])=>{c==="align"&&r.setAttribute(c.startsWith("style-")?`data-${c}`:`data-style-${c}`,`${d}`)}),((l=(s=t.selection)==null?void 0:s.range)==null?void 0:l.start.blockId)===i.id&&z(r,"focused"),Re.get(t).hoveringBlockId()===i.id&&z(r,"hover")}generateCSSCustomProperties(t){const e=[],r={},i={};return Object.entries(t).forEach(([o,s])=>{s===!0?o.startsWith(Bv)?r["data-style-color"]=o.substring(Bv.length):o.startsWith(Tv)?r["data-style-bg-color"]=o.substring(Tv.length):o.startsWith("style")&&e.push(o):typeof s=="string"&&(o==="link"&&(e.push("link"),r.link=s),o==="inline-style-color"&&(i.color=s),o==="inline-style-background-color"&&(i.backgroundColor=s))}),{classes:e,attributes:r,styles:i}}}const Pr=I("block-dom");function Qs(n){return n instanceof HTMLDivElement?n.getAttribute("data-type")==="editor-block":!1}function kv(n){return n instanceof HTMLElement&&n.getAttribute("data-type")==="block-tools"}function Rv(n){z(n,"block-hidden")}function Jg(n){ot(n,"block-hidden")}function Go(n){return!wt(n,"block-hidden")}function lt(n){const{id:t}=n;return p(Pr,t,"no block id"),t}function Dt(n){const t=n.getAttribute("data-block-type");return p(Pr,t,"invalid block dom, no data-type"),t}function Z(n){const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest("div[data-type=editor-block]");return e||null}function Js(n){const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest("div[data-type=editor-block]:not(:scope)");return e||null}function it(n){const t=n.closest("div[data-type=editor-container]");return p(Pr,t,"failed to get block container"),t}function Nt(n){const t=n.querySelector(":scope >div[data-type=block-content]");return p(Pr,t,"no block content"),t}function oe(n){let t=n.querySelector(":scope >div[data-type=block-tools]");return t||(t=v("div",[],n),t.setAttribute("data-type","block-tools")),p(Pr,t,"no block tools"),t}function th(n){const t=n.querySelector(":scope >div[data-type=block-tools]");return t||null}function Zg(n){let t=n.querySelector(":scope > div[data-type=block-background]");return t||(t=v("div",[],n),t.setAttribute("data-type","block-background")),t}function wv(n,t,e){const r=n.editorDecorators.decorateBlock(t,e),{id:i,type:o}=r;p(Pr,i,"no block id");const s=v("div",[`${o}-block`],null);s.id=i,s.setAttribute("data-type","editor-block"),s.setAttribute("data-block-type",o);const l=n.editorBlockRenders.renderBlock(n,t,e);return l.classes&&z(s,...l.classes),l.attributes&&Object.entries(l.attributes).forEach(([c,d])=>{s.setAttribute(c,d)}),l.styles&&Object.entries(l.styles).forEach(([c,d])=>{s.style.setProperty(c,d)}),s}function Zs(n,t){const e=v(t,[],null);return e.setAttribute("data-type","block-content"),n&&n.appendChild(e),e}function Sv(n){const t=v("span",[`${n.type}-box`],null);return t.setAttribute("data-type","editor-box"),t.setAttribute("data-box-type",n.type),t.id=n.id,t}function su(n){const t=n.getAttribute("data-box-type");return p(Pr,t,"not a valid box element, no type"),t}function eh(n){return n instanceof HTMLSpanElement?n.getAttribute("data-type")==="editor-box":!1}function Lv(n){const{id:t}=n;return p(Pr,t,"no box id"),t}function t1(n){const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest("span[data-type=editor-box]");return e||null}function Iv(n){n.innerHTML="",v("span",["box-space-start"],n,Yc);const t=v("span",[],n);return t.setAttribute("data-type","box-content"),v("span",["box-space-start"],n,Yc),t}function e1(n){const t=n.querySelector("span[data-type=box-content]");return p(Pr,t,"invalid box dom, no content"),t}function Dv(n,t,e){const r=v("span",[`${n}-insertion`],null);if(r.setAttribute("data-type","editor-insertion"),r.setAttribute("data-insertion-id",t),e){const i=new yv,{attributes:o}=i.generateCSSCustomProperties(e);o&&[...Object.entries(o)].forEach(s=>{const[l,c]=s;r.setAttribute(l,c)})}return r}function _v(n,t){return n.rootContainer.querySelector(`[data-insertion-id=${t}]`)}function Mv(n){n.innerHTML="",v("span",["insertion-space-start"],n,Yc);const t=v("span",[],n);return t.setAttribute("data-type","insertion-content"),v("span",["insertion-space-start"],n,Yc),t}function n1(n){const t=n.querySelector("span[data-type=insertion-content]");return p(Pr,t,"invalid insertion-child dom, no content"),t}function Oe(n){let t=n.previousElementSibling;for(;t;){if(Qs(t))return t;t=t.nextElementSibling}return null}function Jt(n){let t=n.nextElementSibling;for(;t;){if(Qs(t))return t;t=t.nextElementSibling}return null}function mr(n){let t=n.previousElementSibling;for(;t;){if(Qs(t)&&Go(t))return t;t=t.previousElementSibling}return null}function gr(n){let t=n.nextElementSibling;for(;t;){if(Qs(t)&&Go(t))return t;t=t.nextElementSibling}return null}function vt(n){const t=it(n),r=fe(t).indexOf(n);return p(Pr,r!==-1,"invalid block & container dom, failed to get block index"),r}function r1(n){return!n||!(n instanceof Node)?!1:!!Z(n)}function pa(n){if(!r1(n))return!1;const t=n,e=t instanceof Element?t:t.parentElement;return e?!!e.closest("div[data-type=block-tools]"):!1}function qi(n){return n.hasAttribute("data-document-title")}function Wo(n,t,e){return Qt(n,t).getCaretRect(t,e)}const Uv=I("container");function Xi(n){return n.getAttribute("data-type")==="editor-container"}function qt(n){return wt(n,"root")}function Fr(n){return wt(n,"child")}function ct(n){const t=n.getAttribute("data-container-id");return p(Uv,t,"no id for container"),qt(n)&&p(Uv,t==="root",`invalid root container id, : ${t}`),t}function Ov(n,t){const e=ct(n);return t.getContainerBlocks(e)}const i1=I("block");function dt(n,t){return Qt(n,t).getBlockTextLength(t)}function Nv(n){n.editorBlocks.forEach(t=>{t.clearSelection(n)})}function Pv(n,t,e,r){Qt(n,t).updateSelection(n,t,e,r)}function o1(n){for(;;){const t=it(n);if(qt(t))return n;const e=Z(t);p(i1,e,"no parent block exists for child container"),n=e}}function Fv(n,t){const e=Qt(n,t);if(!!e.getMinWidth)return e.getMinWidth(n,t)}function Kv(n,t,e){const r=Qt(n,t);r.handleBlockElementUpdated&&r.handleBlockElementUpdated(n,t,e)}function nh(n,t,e,r){try{const i=Ys(n,e).convertFrom;return i?i(n,t,r):null}catch{return i1.debug(`unsupported block type: ${e}`),null}}function Yi(n,t,e){const r=Qt(n,t);return r.getClientRects?r.getClientRects(n,t,e):[t.getBoundingClientRect()]}function vI(n,t){const e=Qt(n,t);if(e.getBlockStyles)return e.getBlockStyles(n,t);const r=n.getBlockData(t),i=Object.fromEntries(Object.entries(r).filter(([o])=>o.startsWith("style-")));return Object.entries(i).forEach(([,o])=>{const s=typeof o;p(i1,s==="string"||s==="number"||s==="boolean","invalid style value")}),i}function se(n,t){return Nr(n,t)==="text"?dt(n,t)===0:!1}const Vv=I("block-path");function qo(n){const t=[];let e=n;for(;e;){const r=it(e);if(t.unshift({containerId:ct(r),blockIndex:vt(e)}),qt(r))return t;const i=Z(r);p(Vv,i,"no parent block"),e=i}return p(Vv,!1,"no parent block"),[]}function BI(n,t){var i,o;const e=Qt(n,t);return(o=(i=e.getOptions)==null?void 0:i.call(e,n))!=null?o:{name:Dt(t)}}function pr(n){return qt(it(n))}function $v(n,t){var i;const e=Qt(n,t);return(i=e.getBlockProperties)==null?void 0:i.call(e,n,t)}function s1(n,t){var o,s;const e=Qt(n,t),r=(o=e.getBlockProperties)==null?void 0:o.call(e,n,t);let i={};r!=null&&r.blockCommands&&(i={...r.blockCommands});for(const l of n.blockHooks){const c=(s=l.commands)==null?void 0:s.call(l,n,t);c&&(i[c.group]=c)}return i}function TI(n,t,e){var s,l,c,d;const r=Qt(n,t),i=(s=r.getBlockProperties)==null?void 0:s.call(r,n,t);let o={};i!=null&&i.blockCommands&&(o={...i.blockCommands});for(const h of n.blockHooks){const C=(l=h.commands)==null?void 0:l.call(h,n,t);C&&(o[C.group]=C)}return(d=(c=o[e])==null?void 0:c.commands)!=null?d:[]}function Hv(n,t,e){let r=t;for(;r;){const i=TI(n,r,e);if(i.length>0)return{element:Nt(r),commands:i};if(pr(r))break;r=Js(r)}return{element:null,commands:[]}}const jv=I("embed-block-common");function pe(n){return Dt(n)==="embed"}function $e(n){p(jv,pe(n),"not an embed block");const t=n.getAttribute("data-embed-type");return p(jv,t,"no embed data type"),t}function yI(n,t){return n.editorEmbeds.getEmbedClass($e(t))}function tl(n,t){return n.editorEmbeds.getEmbedClass(t)}async function l1(n,t,e,r,i){const o=tl(n,t);if(!o.getOptions)return null;const s=o.getOptions(n);if(!s.insertEmbedCommandItems||!s.insertEmbedCommandItems||s.insertEmbedCommandItems.length===0||!s.handleInsertEmptyEmbed)return null;const l=s.insertEmbedCommandItems[0];return s.handleInsertEmptyEmbed(n,{item:l,containerId:e,blockIndex:r,data:i})}function kI(n,t,e,r,i){var l,c;const o=(c=(l=Ys(n,t)).getOptions)==null?void 0:c.call(l,n);if(!o||!o.insertBlockCommandItems||o.insertBlockCommandItems.length===0||!o.handleInsertEmptyBlock)return null;const s=o.insertBlockCommandItems[0];return o.handleInsertEmptyBlock(n,{item:s,containerId:e,blockIndex:r,data:i})}const RI=I("execute-block-command");function zv(n,t,e,r){var d;p(RI,pe(t),"not a embed block");const i=$e(t),o=tl(n,i);if(!o.getOptions)return;const s=(d=o.getBlockProperties)==null?void 0:d.call(o,n,t),l=s==null?void 0:s.blockCommands;if(!l)return;const c=Object.entries(l);for(const h of c)if(h[0]===e)return h[1].executeCommand(n,t,r)}function Gv(n,t,e,r){const i=s1(n,t);if(!i)return;const o=Object.entries(i);for(const s of o)if(s[0]===e)return n.emit("beforeExecCommand",n,r,{source:r.source}),s[1].executeCommand(n,t,r)}const Wv=I("block-class");function ln(n){return!!n.getAttribute("data-style-heading")}function lu(n){var e;const t=Number.parseInt((e=n.getAttribute("data-style-heading"))!=null?e:"",10);return p(Wv,t,"not a heading block"),t}function qv(n){return!wt(n,"heading-collapsed")}function mi(n){return wt(n,"heading-collapsed")}function Ca(n,t){t||p(Wv,ln(n),"not a heading block");const e=[],r=t!=null?t:lu(n);let i=Jt(n);for(;i&&!(ln(i)&&lu(i)<=r);)e.push(i),i=Jt(i);return e}function Xv(n){let t=Jt(n);const e=[];for(;t&&!Go(t);)e.push(t),t=Jt(t);return e}const Qi=I("text-block-child");function au(n){return n.tagName==="SPAN"}function Qn(n){return p(Qi,au(n),"not a valid text child"),n.getAttribute("data-type")==="editor-box"}function Ji(n){return p(Qi,au(n),"not a valid text child"),n.getAttribute("data-type")==="editor-insertion"}function cu(n){return!Qn(n)&&!Ji(n)}function Yv(n){return p(Qi,au(n),"not a valid text child"),Qn(n)?"box":Ji(n)?"insertion":"text"}function Cr(n){const t=Yv(n);return t==="insertion"?0:t==="box"?1:(p(Qi,n.textContent!==null,"text block content is undefined"),p(Qi,n.textContent.length>=0,"text block content length is negative"),n.textContent.length)}function gi(n){const t=Nt(n),e=Array.from(t.children);return e.forEach(r=>{p(Qi,au(r),"not a valid text child")}),e}function uu(n,t){const e=gi(n);let r=0;for(let i=0;i<e.length;i++){const o=e[i],s=Cr(o);if(r+s<t){r+=s;continue}if(r===t)return{prev:e[i-1],next:o,offset:0};if(r+s===t)return{prev:o,next:e[i+1],offset:0};const l=t-r;return p(Qi,l>0,"invalid offset value"),p(Qi,!Qn(o),"invalid box child"),{prev:o,next:o,offset:l}}p(Qi,!1,`invalid block child at position: ${t}`)}const wI=I("child-container-path");function Qv(n){if(qt(n))return[];const t=Z(n);return p(wI,t,"no parent block"),qo(t)}const Jv=I("load-blocks");function a1(n,t,e){const r=ct(t),i=Ov(t,n.doc);p(Jv,i.length>0,"no blocks in container");const o=document.createDocumentFragment();i.forEach((l,c)=>{const d=n.editorBlocks.createBlock([...e,{containerId:r,blockIndex:c}],t,l);o.appendChild(d)}),iu(t).appendChild(o)}function SI(n,t,e){const r=iu(n);if(t===0)return r.insertBefore(e,r.firstChild),e;const i=fe(n);return p(Jv,t>=0&&t<=i.length,"invalid block index"),t===i.length?r.appendChild(e):r.insertBefore(e,i[t]),e}function LI(n,t,e,r){const i=Qv(t);i.push({containerId:ct(t),blockIndex:e});const o=n.editorBlocks.createBlock(i,t,r);return SI(t,e,o),o}const c1=I("root-container"),Zv=3;class II{constructor(t,e){m(this,"resizeObserver");m(this,"isMoved",!1);m(this,"mouseDownEvent",null);m(this,"handleContextMenu",t=>{if(ie.isSafari){const e=document.getSelection();e&&!e.isCollapsed&&e.collapseToStart()}});m(this,"handleResize",()=>{try{this.editor.selection.updateSelection(null),this.editor.emit("resize",this.editor)}catch(t){c1.warn(`failed to update selection while container resizing: ${t.message}`)}});m(this,"handleClick",t=>{this.editor.emit("click",this.editor,t);const e=t.target;if(!pa(e)&&(t.detail===1&&this.editor.input.focus(),t.detail===3&&this.editor.selectionHandler.handleTripleClick(t),t.detail===1&&t.button===0)){const r=Ae(t.clientX,t.clientY);if(r&&re(this.rootContainer,r)){const i=Z(r);i&&re(i,r)&&this.handleBlockClick(t,i,r)}}});m(this,"handleBlockClick",(t,e,r)=>{var s,l;if(!rt(this.editor,e))return;const i=t1(r);if(i){const c=Z(i);p(c1,c,"no parent block"),(l=(s=this.editor.editorBoxes.getBoxClass(su(i)))==null?void 0:s.handleClickBox)==null||l.call(s,this.editor,i,t);return}const o=r.closest("span.text.link");o&&gi(e).indexOf(o)!==-1&&this.editor.emit("clickLink",this.editor,t,o)});m(this,"handleDblClick",t=>{pa(t.target)||this.editor.selectionHandler.handleDblClick(t)});m(this,"handleMouseDown",t=>{this.mouseDownEvent=t,this.isMoved=!1;const e=t.target;if(!!e&&e instanceof Node&&!pa(e)){if(t.button===2){t.stopPropagation();return}if(e instanceof HTMLElement&&e.draggable){this.editor.selectionHandler.handleMouseDown(t,{autoScroll:!1}),this.editor.selectionHandler.stopSelection(),this.editor.input.focus();return}t.button===0&&(document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),this.editor.selectionHandler.handleMouseDown(t,{autoScroll:!0})),ie.isMobileSafari||this.editor.input.focus()}});m(this,"handleMouseMove",t=>{p(c1,this.mouseDownEvent,"no mouse down event");const e=t.x-this.mouseDownEvent.x,r=t.y-this.mouseDownEvent.y;(Math.abs(e)>=Zv||Math.abs(r)>=Zv)&&(this.editor.selectionHandler.handleMouseMove(t),this.isMoved=!0)});m(this,"handleMouseUp",t=>{t.button===0&&(this.editor.selectionHandler.handleMouseUp(t),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)),this.isMoved&&(document.addEventListener("click",this.handleCaptureClick,!0),document.addEventListener("dblclick",this.handleCaptureDbClick,!0)),this.isMoved=!1});m(this,"handleCaptureClick",t=>{document.removeEventListener("click",this.handleCaptureClick,!0),t.stopPropagation()});m(this,"handleCaptureDbClick",t=>{document.removeEventListener("dblclick",this.handleCaptureDbClick,!0),t.stopPropagation()});this.editor=t,this.rootContainer=e,this.editor=t,this.resizeObserver=new Vs(this.handleResize),this.bindEvents(e)}bindEvents(t){this.resizeObserver.observe(t);const e=this.editor.rootElement;e.onmousedown=this.handleMouseDown,e.ondblclick=this.handleDblClick,e.onclick=this.handleClick,e.oncontextmenu=this.handleContextMenu}unbindEvents(){this.resizeObserver.disconnect();const t=this.editor.rootElement;t.onmousedown=null,t.ondblclick=null,t.onclick=null,t.oncontextmenu=null}destroy(){this.unbindEvents()}reload(){const t=this.editor.selection.range,e=iu(this.rootContainer);e.innerHTML="",a1(this.editor,this.rootContainer,[]);const r=this.editor.findBlockById(t.start.blockId);if(r)this.editor.selection.selectBlock(r,0);else{const i=be(this.rootContainer);this.editor.selection.selectBlock(i,0)}}}function t3(n){const t=Yg(n.contentElement,"root","root");return n.rootContainer=t,a1(n,t,[]),new II(n,t)}function e3(n,t,e,r){const i=ru(n,r);if(i)return e.appendChild(i),setTimeout(()=>{n.emit("containerRemount",n,r)}),i;const o=Yg(e,"child",r);return a1(n,o,t),o}function n3(n,t){const e=n.getBoundingClientRect().width;return t.withPadding?e:e-Dg(n)}function u1(n,t){let e=Number.MAX_SAFE_INTEGER;const r=fe(t);for(let o=0;o<r.length;o++){const s=r[o],l=Fv(n,s);l&&(e=Math.min(e,l))}return e===Number.MAX_SAFE_INTEGER?void 0:e+Dg(t)}function fu(n,t){const e=fe(t);return e.length!==1?!1:se(n,e[0])}const DI=I("complex-block-position");class Kr{constructor(t,e,r){m(this,"blockId");m(this,"childContainerId");m(this,"custom");t instanceof HTMLElement?this.blockId=lt(t):(p(DI,typeof t=="string",`not a valid block id: ${t}`),this.blockId=t),this.childContainerId=e,r!==void 0&&(this.custom=r)}isSimple(){return!1}}const _I=I("simple-block-position");class Ye{constructor(t,e,r){m(this,"blockId");m(this,"offset");m(this,"type");t instanceof HTMLElement?this.blockId=lt(t):(p(_I,typeof t=="string",`not a valid block id: ${t}`),this.blockId=t),this.offset=e,this.type=r}isSimple(){return!0}}const f1=I("editor-position");function at(n,t,e){return new Ye(n,t,e)}function xe(n,t,e){return new Kr(n,t,e)}function Vr(n){return n instanceof Ye}function el(n){return n instanceof Kr}function d1(n,t,e){if(Vr(t)&&Vr(e)){const r=t,i=e;if(r.blockId===i.blockId)return r.offset-i.offset;const o=n.getBlockById(t.blockId),s=n.getBlockById(e.blockId);return p(f1,o!==s,"comparePosition: blocks are the same"),Vd(o,s)}if(el(t)&&el(e)){const r=t,i=e;if(r.childContainerId===i.childContainerId)return 0;const o=n.getContainerById(r.childContainerId),s=n.getContainerById(i.childContainerId);return p(f1,o!==s,"comparePosition: containers are the same"),Vd(o,s)}return p(f1,!1,"invalid "),0}const rh=I("simple-range");class rn{constructor(t,e){m(this,"editor");m(this,"_anchor");m(this,"_focus");m(this,"reverse");this.editor=t,this._anchor=e.anchor,this._focus=e.focus,this.reverse=d1(this.editor,this._anchor,this._focus)>0}isCollapsed(){return this.start.blockId===this.end.blockId&&this.start.offset===this.end.offset}isEqual(t){if(!(t instanceof rn))return!1;const e=t,{start:r,end:i}=e;return this.start.blockId===r.blockId&&this.start.offset===r.offset&&this.start.type===r.type&&this.end.blockId===i.blockId&&this.end.offset===i.offset&&this.end.type===i.type}isSimple(){return!0}isReverse(){return this.reverse}getEditor(){return this.editor}get start(){return this.reverse?this._focus:this._anchor}get end(){return this.reverse?this._anchor:this._focus}get anchor(){return this._anchor}get focus(){return this._focus}getSelectedBlocks(){const{editor:t}=this,e=t.getBlockById(this.start.blockId),r=t.getBlockById(this.end.blockId);p(rh,e,"no start block"),p(rh,r,"no end block");const i=it(e),o=it(r);p(rh,i===o,"invalid range");const s=[];if(e===r)s.push({block:e,start:this.start,end:this.end});else{const l=vt(e),c=vt(r);p(rh,l<c,"invalid range, start > index"),s.push({block:e,start:this.start,end:at(e,dt(this.editor,e),"end")});const d=fe(i);for(let h=l+1;h<c;h+=1){const C=d[h];s.push({block:C,start:at(C,0,"home"),end:at(C,dt(this.editor,C),"end")})}s.push({block:r,start:at(r,0,"home"),end:this.end})}return s}getSelectedContainers(){return[]}getAnchorPos(){return this.isReverse()?this.end:this.start}getFocusedPos(){return this.isReverse()?this.start:this.end}clone(){return new rn(this.editor,this)}toDocRange(){return{anchor:this.anchor,focus:this.focus}}static from(t,e){return new rn(t,e)}}I("unknown-block");function MI(n,t,e,r,i){z(r,"unknown-block");const o=Zs(r,"div");return o.innerText=`unknown block (${i.type}): ${JSON.stringify(i)}`,o}function UI(n){return 1}function OI(n,t,e,r){return null}function NI(n,t,e,r){const i=Ae(e,r);if(!i||!t.contains(i)||!n.contains(t))return null;const o=lt(t),s=at(o,0,"home"),l=at(o,1,"end");return new rn(n,{anchor:s,focus:l})}function PI(n,t){const r=Nt(n).getBoundingClientRect();return new DOMRect(r.left+r.width/2,r.top,1,r.height)}function FI(n,t,e,r){z(t,"selected")}function KI(n){n.rootContainer.querySelectorAll("div.unknown-block[data-type=editor-block]").forEach(t=>{ot(t,"selected")})}function VI(n,t,e,r){return`[unknown block, ${t.type}]`}const $I={blockType:"unknown-block",blockKind:"embed",createBlockContent:MI,getBlockTextLength:UI,getRangeFromPoint:NI,moveCaret:OI,getCaretRect:PI,updateSelection:FI,clearSelection:KI,convertTo:VI},h1=I("editor-blocks");class r3{constructor(t){m(this,"blocks",new Map);this.editor=t}registerBlockClass(t){const e=t.blockType,r=this.blocks.get(e);p(h1,!r,`duplicated block type: ${e}`),this.blocks.set(e,t)}getBlockClass(t){const e=this.blocks.get(t);return p(h1,e,`unknown block type: ${t}`),e}hasBlock(t){return this.blocks.has(t)}createBlock(t,e,r){const i=wv(this.editor,t,r);let o;this.hasBlock(r.type)?o=this.getBlockClass(r.type):o=this.registerUnknownBlock(r.type);const s=o.createBlockContent(this.editor,t,e,i,r);return s.parentElement!==i&&(h1.warn("content parent is not block"),i.appendChild(s)),this.editor.blockHooks.forEach(l=>{var c;(c=l.create)==null||c.call(l,this.editor,t,e,i,r)}),i}forEach(t){this.blocks.forEach(t)}registerUnknownBlock(t){const e={...$I,blockType:t};return this.editor.editorBlocks.registerBlockClass(e),e}}const i3=I("editor-embeds");class o3{constructor(t){m(this,"objects",new Map);this.editor=t}registerEmbedClass(t){const e=t.embedType,r=this.objects.get(e);p(i3,!r,`duplicated embed object type: ${e}`),this.objects.set(e,t)}getEmbedClass(t){const e=this.objects.get(t);return p(i3,e,`unknown embed type: ${t}`),e}getEmbedClassFromBlock(t){return this.getEmbedClass($e(t))}forEach(t){this.objects.forEach(t)}}const s3=I("embed-block");function HI(n,t,e,r,i){const o=Zs(r,"div");p(s3,i.type==="embed",`not an embed data: ${JSON.stringify(i)}`);const s=i;return p(s3,s.embedType&&s.embedData,`not an embed data: ${JSON.stringify(s)}`),n.editorEmbeds.getEmbedClass(s.embedType).createEmbedContent(n,o,s,t,e,r),r.setAttribute("data-embed-type",s.embedType),o}function jI(n){return 1}function zI(n,t,e,r){return null}function GI(n,t,e,r){const i=Ae(e,r);if(!i||!t.contains(i)||!n.contains(t))return null;const o=lt(t),s=at(o,0,"home"),l=at(o,1,"end");return new rn(n,{anchor:s,focus:l})}function WI(n,t){const r=Nt(n).getBoundingClientRect();return new DOMRect(r.left+r.width/2,r.top,1,r.height)}function qI(n,t,e,r){z(t,"selected")}function XI(n){n.rootContainer.querySelectorAll("div.embed-block[data-type=editor-block][data-block-type=embed]").forEach(t=>{ot(t,"selected")})}function YI(n,t,e){let r=null;return n.editorEmbeds.forEach(i=>{var s,l;const o=(l=(s=i.convertFrom)==null?void 0:s.call(i,n,t,e))!=null?l:null;o&&(r=o)}),r}function QI(n,t,e,r){const i=tl(n,t.embedType);return i.convertTo?i.convertTo(n,t,e,r):""}function JI(n,t){const e=yI(n,t);return e.getBlockProperties?e.getBlockProperties(n,t):{}}function ZI(n){const t=new Map,e=[];return n.editorEmbeds.forEach(r=>{if(r.getOptions){const i=r.getOptions(n);i.insertEmbedCommandItems&&i.insertEmbedCommandItems.forEach(o=>{e.push(o),t.set(o.id,r)})}}),{name:"EmbedBlock",insertBlockCommandItems:e,async handleInsertEmptyBlock(r,i){const o=t.get(i.item.id);if(!o||!o.getOptions)return null;const s=o.getOptions(r);return s.handleInsertEmptyEmbed?s.handleInsertEmptyEmbed(r,i):null}}}function t7(n,t,e,r){const i=$e(t),o=tl(n,i);!o.handleDeleteBlock||o.handleDeleteBlock(n,t,e,r)}function e7(n,t,e){const r=$e(t),i=tl(n,r);return i.handleUpdateBlock?i.handleUpdateBlock(n,t,e):!1}function n7(n,t,e,r,i){const o=$e(t),s=tl(n,o);if(s.handleDropOver)return s.handleDropOver(n,t,e,r,i)}function r7(n,t,e,r,i){const o=$e(t),s=tl(n,o);if(s.handleDrop&&n.isWritable())return s.handleDrop(n,t,e,r,i)}async function i7(n,t,e){const r=t.embedType,i=n.editorEmbeds.getEmbedClass(r);if(i.toStandardDoc){const o=n.getBlockById(t.id),s=qo(o);return i.toStandardDoc(n,t,e,s)}}function o7(n,t){const e=t.embedType,r=n.editorEmbeds.getEmbedClass(e);return r.getResources?r.getResources(n,t):null}const l3={blockType:"embed",blockKind:"embed",createBlockContent:HI,getBlockTextLength:jI,getRangeFromPoint:GI,moveCaret:zI,getCaretRect:WI,updateSelection:qI,clearSelection:XI,convertFrom:YI,convertTo:QI,getBlockProperties:JI,getOptions:ZI,handleDeleteBlock:t7,handleUpdateBlock:e7,handleDropOver:n7,handleDrop:r7,toStandardDoc:i7,getResources:o7},Tn=I("complex-block-helper");function an(n,t,e){return hr(n,t).getChildContainers(n,t,e)}function Ea(n,t,e,r){return e.isSimple()?(p(Tn,r.isSimple(),"invalid start and end position"),an(n,t)):(p(Tn,!e.isSimple(),"invalid start pos"),p(Tn,!r.isSimple(),"invalid end pos"),hr(n,t).getSelectedContainers(n,t,e,r))}function s7(n,t){if(vt(t)!==0)return!1;const e=Z(it(t));if(!e)return!1;p(Tn,It(n,e),"not a complex block");const r=it(t),o=an(n,e).indexOf(r);return p(Tn,o>=0,"not valid child container"),o===0}function m1(n,t,e){const r=an(n,t,e);if(r.length===0)return null;const i=r[0];if(!i)return null;const o=be(i);return It(n,o)?m1(n,o,e):o}function xa(n,t,e){const r=an(n,t,e);if(r.length===0)return null;const i=r[r.length-1];if(!i)return null;const o=Ue(i);return It(n,o)?xa(n,o,e):o}function a3(n,t){const e=o=>{const s=an(n,o,{visibleOnly:!0});return s.length===0?null:s[0]};let r=t,i=be(r);for(;It(n,i);){if(r=e(i),!r)return null;i=be(r)}return i}function c3(n,t,e){p(Tn,Fr(t),"not a child container");const r=Z(t);p(Tn,r,"no parent block"),p(Tn,It(n,r),"not a complex block");const i=an(n,r,e),o=i.indexOf(t);if(p(Tn,o!==-1,"child container not found"),o===0){const c=Oe(r);return c?It(n,c)?xa(n,c):c:null}const s=i[o-1],l=Ue(s);return It(n,l)?xa(n,l):l}function u3(n,t){p(Tn,It(n,t),"not a complex block");const e=an(n,t);if(p(Tn,e.length>0,"no child container"),e.length===1)return e;const r=e[0],i=r.getBoundingClientRect();let o=i.left,s=i.right;const l=[r];for(let c=1;c<e.length;c++){const d=e[c],h=d.getBoundingClientRect();if(h.right<=o){l.push(d),o=h.left;continue}if(h.left>=s){s=h.right;continue}}return l}function f3(n,t){p(Tn,It(n,t),"not a complex block");const e=an(n,t);if(p(Tn,e.length>0,"no child container"),e.length===1)return e;const r=e[e.length-1],i=r.getBoundingClientRect();let o=i.left,s=i.right;const l=[r];for(let c=e.length-2;c>=0;c--){const d=e[c],h=d.getBoundingClientRect();if(h.right<=o){l.push(d),o=h.left;continue}if(h.left>=s){s=h.right;continue}}return l}function l7(n,t,e,r){const i=t.getBoundingClientRect(),o=r<i.top,s=o?u3(n,t):f3(n,t);let l=s[0],c=jo(l.getBoundingClientRect(),e,r);for(let d=1;d<s.length;d++){const h=s[d],C=h.getBoundingClientRect(),E=jo(C,e,r);E<c&&(l=h,c=E)}return o?be(l):Ue(l)}function ih(n,t,e,r){const i=lt(t);p(Tn,i===e.blockId,"invalid start pos"),p(Tn,i===r.blockId,"invalid end pos");const o=hr(n,t);return o.adjustSelectionPos?o.adjustSelectionPos(n,t,e,r):{anchor:e,focus:r}}class pi{constructor(t,e){m(this,"editor");m(this,"reverse");m(this,"_anchor");m(this,"_focus");this.editor=t,this._anchor=e.anchor,this._focus=e.focus,this.reverse=d1(this.editor,this._anchor,this._focus)>0}isCollapsed(){return!1}isEqual(t){if(!(t instanceof pi))return!1;const e=t,{anchor:r,focus:i}=e;return this._anchor.blockId===r.blockId&&this._anchor.childContainerId===r.childContainerId&&this._focus.blockId===i.blockId&&this._focus.childContainerId===i.childContainerId&&this._anchor.custom===r.custom&&this._focus.custom===i.custom}isReverse(){return this.reverse}isSimple(){return!1}getEditor(){return this.editor}get anchor(){return this._anchor}get focus(){return this._focus}get start(){return this.reverse?this._focus:this._anchor}get end(){return this.reverse?this._anchor:this._focus}getSelectedBlocks(){const t=this.start,e=this.end;return[{block:this.editor.getBlockById(t.blockId),start:t,end:e}]}getAnchorPos(){return this._anchor}getFocusedPos(){return this._focus}getSelectedContainers(){const t=this.editor.getBlockById(this._anchor.blockId);return Ea(this.editor,t,this.start,this.end)}clone(){return new pi(this.editor,this)}toDocRange(){return{anchor:this._anchor,focus:this._focus}}}const a7=I("selection-range");function Qe(n,t){const{anchor:e,focus:r}=t;return e instanceof Ye&&r instanceof Ye?new rn(n,{anchor:e,focus:r}):(p(a7,e instanceof Kr&&r instanceof Kr,"start position type does not math end type"),new pi(n,{anchor:e,focus:r}))}function ve(n,t,e,r){const i=new Ye(t,e,"normal"),o=new Ye(t,r!=null?r:e,"normal");return Qe(n,{anchor:i,focus:o})}function c7(n){return!!n.anchor.childContainerId}function Xo(n,t){var i,o;if(c7(t)){const s=xe(t.anchor.blockId,t.anchor.childContainerId,(i=t.anchor)==null?void 0:i.custom),l=xe(t.focus.blockId,t.focus.childContainerId,(o=t.focus)==null?void 0:o.custom);return Qe(n,{anchor:s,focus:l})}const e=at(t.anchor.blockId,t.anchor.offset,"normal"),r=at(t.focus.blockId,t.focus.offset,"normal");return Qe(n,{anchor:e,focus:r})}const g1=I("range-from-point");function oh(n,t,e){const r=[0,-12,12];let i=t;const o=e;let s=Ae(i,o),l=Z(s);if(!l&&s&&n.contentElement.contains(s)){const c=n.rootContainer.getBoundingClientRect(),d=c.left+c.width/2;s=Ae(d,o),l=Z(s);let h=c;l&&(h=l.getBoundingClientRect()),t<h.left?i=h.left:t>h.right&&(i=h.right-5)}for(let c=0;c<r.length;c++){const d=Ae(i,o+r[c]);if(!d)continue;const h=d.getBoundingClientRect();if(d.clientWidth&&d.clientHeight&&c===0&&(h.left+d.clientWidth<i||h.top+d.clientHeight<o))return g1.debug("click on scrollbar, out of element rect"),null;if(c===0&&!n.rootContainer.contains(d)&&(i=n.rootContainer.getBoundingClientRect().left),!n.rootContainer.contains(d))continue;const C=Z(d);if(!C||!n.contains(C))continue;const E=Qt(n,C).getRangeFromPoint(n,C,i,o+r[c]);if(E)return E}return null}function d3(n,t,e,r){const i=t.getBoundingClientRect();if(r<=i.top){const c=be(t),d=Qt(n,c).getRangeFromPoint(n,c,e,c.getBoundingClientRect().top+4);if(d!=null&&d.isSimple())return rn.from(n,d);const h=at(c,0,"home");return new rn(n,{anchor:h,focus:h})}let o=Ue(t);if(!Go(o)){const c=mr(o);p(g1,c,"container must have visible block"),o=c}const s=Qt(n,o).getRangeFromPoint(n,o,e,o.getBoundingClientRect().bottom-4);if(s!=null&&s.isSimple())return rn.from(n,s);if(It(n,o))return null;const l=at(o,dt(n,o),"end");return new rn(n,{anchor:l,focus:l})}function p1(n,t,e){const r=oh(n,t,e);if(r){if(r instanceof rn)return r;p(g1,r instanceof pi,`invalid range type: ${typeof r}`);const c=r,d=n.getContainerById(c.start.childContainerId);return d3(n,d,t,e)}const i=Ae(t,e);if(!i)return null;const{children:o}=i,s=Array.from(o).filter(c=>Xi(c));if(s.length===0)return null;const l=s.reduce((c,d)=>{const h=c.getBoundingClientRect(),C=d.getBoundingClientRect();return jo(h,t,e)>jo(C,t,e)?d:c});return d3(n,l,t,e)}function C1(n,t,e){const r=[];return fe(t).forEach(o=>{r.push(o),It(n,o)&&an(n,o,e).forEach(l=>{r.push(...C1(n,l))})}),r}function E1(n,t){let e=C1(n,n.rootContainer,t);return t!=null&&t.simpleBlockOnly&&(e=e.filter(r=>!It(n,r))),e}function Ci(n,t){const e=n.selection.range.getSelectedBlocks(),r=[];for(const i of e)r.push(i),It(n,i.block)&&Ea(n,i.block,i.start,i.end).forEach(s=>{const c=C1(n,s).map(d=>({block:d,start:at(d,0,"home"),end:at(d,dt(n,d),"home")}));r.push(...c)});return t!=null&&t.simpleBlockOnly?r.filter(i=>!It(n,i.block)):r}const Slt="",on=I("text-range");function u7(n,t){const e=(o,s)=>{if(Ji(o))return p(on,s===0,`invalid offset for insertion child: ${s}`),{child:o,container:o,offset:2};if(Qn(o))return p(on,s===0||s===1,`invalid offset for box: ${s}`),{child:o,container:o,offset:s===0?1:2};const l=o.firstChild;return p(on,l,"no child node for text child"),p(on,l instanceof Text||l instanceof HTMLBRElement,`invalid child for text child, ${l.nodeName}`),l instanceof HTMLBRElement?(p(on,s>=0&&s<=0,"invalid offset for text child"),{child:o,container:l,offset:s}):(p(on,s>=0&&s<=l.data.length,"invalid offset for text child"),{child:o,container:l,offset:s})};let r=0;const i=gi(n);for(let o=0;o<i.length;o++){const s=i[o],l=Cr(s);if(t===r)return[e(s,0)];if(t<r+l)return[e(s,t-r)];if(t===r+l){const c=[];c.push(e(s,Cr(s)));const d=i[o+1];return d&&c.push(e(d,0)),c}r+=l}p(on,!1,"failed to get range info")}function f7(n,t,e){if(t===e?p(on,Ji(n),"only insertion child can be zero offset"):p(on,t<e,`invalid start & end: ${t}, ${e}`),Ji(n)){p(on,t===e,`invalid insertion child range offset: ${t}, ${e}`),p(on,t===0,`invalid insertion child range start: ${t}`);const o=n;return p(on,o.children.length===3,`invalid insertion dom, children.length = ${o.children.length}`),Fd(o,1,o,2)}if(Qn(n)){p(on,t+1===e,`invalid box child range offset: ${t}, ${e}`),p(on,t===0,`invalid box child range start: ${t}`);const o=n;return p(on,o.children.length===3,`invalid box dom, children.length = ${o.children.length}`),Fd(o,1,o,2)}const r=Cr(n);p(on,e<=r,`invalid child end: ${e}, ${r}`);const i=n.firstChild;return p(on,i instanceof Text,"invalid block text child"),p(on,i.data.length>=e,`invalid range end: ${e}, ${i.data.length}`),Fd(i,t,i,e)}const $r=I("caret-rect");function d7(n,t){if(eh(t)){const e=t,r=e1(e);if(e.getAttribute("data-box-type")==="br"){const i=Nt(n),o=Number.parseFloat(window.getComputedStyle(i).lineHeight)||r.getBoundingClientRect().height,s=Array.from(r.getClientRects());p($r,s.length>0,"no box client rects");const l=i.getBoundingClientRect(),c=s[0],d=new DOMRect(l.left,c.bottom,1,o);return s.push(d),s}return r.getClientRects()}return n1(t).getClientRects()}function Jn(n,t){var l,c,d;const e=u7(n,t.offset);if(e[1]&&e[0].child!==((l=e[1])==null?void 0:l.child)){if(t.type==="end"){const C=js(e[0].child);return new DOMRect(C.right,C.top,1,C.height)}p($r,e[1],"invalid ranges");const h=Kd(e[1].child);return new DOMRect(h.left,h.top,1,h.height)}let i=e[0];if(p($r,e.length>=1,"failed to get block range"),e.length===1)i=e[0];else{if(p($r,e.length>=2,`invalid range info length: ${e.length}`),Ji(e[e.length-1].child)){i=e[e.length-1];const h=i.child,E=n1(h).getClientRects();p($r,E.length>=1,"no client rects for box content");const x=E[E.length-1];return new DOMRect(x.right,x.y,1,x.height)}t.type==="home"?i=e[1]:t.type==="end"||cu(e[0].child)?i=e[0]:cu(e[1].child)&&(i=e[1])}if(i.container instanceof HTMLBRElement){p($r,t.offset===0,"invalid offset for empty block text");const h=i.container.parentElement;p($r,h,"invalid br parent");const C=h.getBoundingClientRect();return new DOMRect(C.left,C.top,1,C.height)}const o=Pb(i.container,i.offset),s=Array.from(o.getClientRects());if(s.length===0){p($r,!cu(i.child),"only box or insertion child range has zero client rect"),p($r,i.offset===1||i.offset===2,"invalid offset for box or insertion child");const h=i.child,C=d7(n,h);if(p($r,C.length>=1,"no client rects for box content"),i.offset===1){const x=C[0];return new DOMRect(x.x,x.y,1,x.height)}const E=C[C.length-1];if(t.type==="end"||i.offset===2){if(eh(h)&&h.getAttribute("data-box-type")==="br"){const x=h.lastChild.getBoundingClientRect();return new DOMRect(E.right,x.top,1,x.height)}return new DOMRect(E.right,E.y,1,E.height)}return new DOMRect(E.x,E.y,1,E.height)}if(Wc()||$s()){const h=document.createRange();h.selectNodeContents(i.container);const C=h.getClientRects();if(i.container.nodeType===Node.TEXT_NODE&&i.offset<((d=(c=i.container.textContent)==null?void 0:c.length)!=null?d:0)){const E=document.createRange();E.setStart(i.container,i.offset+1);const x=E.getClientRects();Array.from(C).forEach((B,k)=>{if(Math.floor(x[0].top)!==Math.floor(s[0].top)&&Math.floor(x[0].top)===Math.floor(B.top)){const{x:w,y:U,height:M}=C[k];s.length===1&&t.type==="home"&&s.push(new DOMRect(w,U,0,M))}})}if(i.container.nodeType===Node.TEXT_NODE&&i.offset>0){const E=document.createRange();E.setStart(i.container,i.offset-1);const x=E.getClientRects();Array.from(C).forEach((B,k)=>{if(Math.floor(x[0].top)!==Math.floor(s[0].top)&&Math.floor(x[0].top)===Math.floor(B.top)){const{y:w,height:U,right:M}=C[k];s.length===1&&t.type==="end"&&s.unshift(new DOMRect(M,w,0,U))}})}}return p($r,s.length>0,"no client rects for range"),t.type==="home"?s[s.length-1]:s[0]}const h7=I("core");function Zi(n,t,e,r){const i=oe(t);let o=i.querySelector(`.block-anchor[data-id=${e}]`);o||(o=v("div",["block-anchor"],i),o.setAttribute("data-id",e));const s=r!=null?r:t.getBoundingClientRect(),l=t.getBoundingClientRect(),c=new DOMRect(s.left-l.left,s.top-l.top,s.width,s.height);return o.style.left=`${c.left}px`,o.style.top=`${c.top}px`,o.style.width=`${c.width}px`,o.style.height=`${c.height}px`,o}function h3(n,t,e,r){p(h7,rt(n,t),"not a text kind block");const i=Jn(t,at(t,e,"normal")),o=t.getBoundingClientRect(),s=oe(t);let l=s.querySelector(`.block-anchor[data-id=${r}]`);l||(l=v("div",["block-anchor"],s),l.setAttribute("data-id",r));const c=new DOMRect(i.left-o.left,i.top-o.top,i.width,i.height);return l.style.left=`${c.left}px`,l.style.top=`${c.top}px`,l.style.width=`${c.width}px`,l.style.height=`${c.height}px`,l}function du(n){const t=gi(n);let e=0;return t.forEach(r=>{e+=Cr(r)}),e}var m7=typeof global=="object"&&global&&global.Object===Object&&global;const g7=m7;var p7=typeof self=="object"&&self&&self.Object===Object&&self,C7=g7||p7||Function("return this")(),E7=C7.Symbol;const Aa=E7;var m3=Object.prototype,x7=m3.hasOwnProperty,A7=m3.toString,hu=Aa?Aa.toStringTag:void 0;function b7(n){var t=x7.call(n,hu),e=n[hu];try{n[hu]=void 0;var r=!0}catch{}var i=A7.call(n);return r&&(t?n[hu]=e:delete n[hu]),i}var v7=Object.prototype,B7=v7.toString;function T7(n){return B7.call(n)}var y7="[object Null]",k7="[object Undefined]",g3=Aa?Aa.toStringTag:void 0;function R7(n){return n==null?n===void 0?k7:y7:g3&&g3 in Object(n)?b7(n):T7(n)}function w7(n){return n!=null&&typeof n=="object"}var S7="[object Symbol]";function L7(n){return typeof n=="symbol"||w7(n)&&R7(n)==S7}function I7(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var D7=Array.isArray;const _7=D7;var M7=1/0,p3=Aa?Aa.prototype:void 0,C3=p3?p3.toString:void 0;function E3(n){if(typeof n=="string")return n;if(_7(n))return I7(n,E3)+"";if(L7(n))return C3?C3.call(n):"";var t=n+"";return t=="0"&&1/n==-M7?"-0":t}function x3(n){return n==null?"":E3(n)}function U7(n,t,e,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(e=n[++i]);++i<o;)e=t(e,n[i],i,n);return e}function O7(n){return function(t){return n==null?void 0:n[t]}}var N7={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},P7=O7(N7);const F7=P7;var K7=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,V7="\\u0300-\\u036f",$7="\\ufe20-\\ufe2f",H7="\\u20d0-\\u20ff",j7=V7+$7+H7,z7="["+j7+"]",G7=RegExp(z7,"g");function W7(n){return n=x3(n),n&&n.replace(K7,F7).replace(G7,"")}var q7=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function X7(n){return n.match(q7)||[]}var Y7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Q7(n){return Y7.test(n)}var A3="\\ud800-\\udfff",J7="\\u0300-\\u036f",Z7="\\ufe20-\\ufe2f",tD="\\u20d0-\\u20ff",eD=J7+Z7+tD,b3="\\u2700-\\u27bf",v3="a-z\\xdf-\\xf6\\xf8-\\xff",nD="\\xac\\xb1\\xd7\\xf7",rD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iD="\\u2000-\\u206f",oD=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",B3="A-Z\\xc0-\\xd6\\xd8-\\xde",sD="\\ufe0e\\ufe0f",T3=nD+rD+iD+oD,y3="['\u2019]",k3="["+T3+"]",lD="["+eD+"]",R3="\\d+",aD="["+b3+"]",w3="["+v3+"]",S3="[^"+A3+T3+R3+b3+v3+B3+"]",cD="\\ud83c[\\udffb-\\udfff]",uD="(?:"+lD+"|"+cD+")",fD="[^"+A3+"]",L3="(?:\\ud83c[\\udde6-\\uddff]){2}",I3="[\\ud800-\\udbff][\\udc00-\\udfff]",ba="["+B3+"]",dD="\\u200d",D3="(?:"+w3+"|"+S3+")",hD="(?:"+ba+"|"+S3+")",_3="(?:"+y3+"(?:d|ll|m|re|s|t|ve))?",M3="(?:"+y3+"(?:D|LL|M|RE|S|T|VE))?",U3=uD+"?",O3="["+sD+"]?",mD="(?:"+dD+"(?:"+[fD,L3,I3].join("|")+")"+O3+U3+")*",gD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",CD=O3+U3+mD,ED="(?:"+[aD,L3,I3].join("|")+")"+CD,xD=RegExp([ba+"?"+w3+"+"+_3+"(?="+[k3,ba,"$"].join("|")+")",hD+"+"+M3+"(?="+[k3,ba+D3,"$"].join("|")+")",ba+"?"+D3+"+"+_3,ba+"+"+M3,pD,gD,R3,ED].join("|"),"g");function AD(n){return n.match(xD)||[]}function bD(n,t,e){return n=x3(n),t=e?void 0:t,t===void 0?Q7(n)?AD(n):X7(n):n.match(t)||[]}var vD="['\u2019]",BD=RegExp(vD,"g");function TD(n){return function(t){return U7(bD(W7(t).replace(BD,"")),n,"")}}var yD=TD(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()});const kD=yD,N3=I("box");function to(n){return!n.attributes||!n.attributes.box?!1:(p(N3,typeof n.attributes.box=="string"&&n.attributes.box==="true"||n.attributes.box===!0,`invalid op attribute box property, ${n.attributes.box}`),p(N3,n.attributes.type,`no box type: ${JSON.stringify(n)}`),!0)}const P3=I("text-op");function sh(n){return p(P3,typeof n.insert=="string","invalid op, no insert"),n.insert.length}function F3(n,t){const e=n;let r=0;for(let i=0;i<e.length;i++){const o=e[i];p(P3,typeof o.insert=="string","invalid text op, no insert");const s=r+sh(o);if(s>t)return[o];if(s===t){const l=[o];return i<e.length-1&&l.push(e[i+1]),l}r=s}return[]}const K3=I("rich-text-length");function x1(n){return p(K3,typeof n.insert=="string","op.insert is not string"),n.insert.length}function gn(n){let t=0;return n.forEach(e=>{e.insert&&(p(K3,typeof e.insert=="string","op.insert is not string"),t+=x1(e))}),t}const Ei=I("split-text");function Mn(n,t,e){if(n=mt.default(n),t===0)return{left:[],right:n};if(t===-1)return{left:n,right:[]};let r=0;for(let i=0;i<n.length;i++){const o=n[i];p(Ei,typeof o=="object",`invalid op type, ${typeof o}`),p(Ei,typeof o.insert=="string",`invalid op.insert type, ${typeof o.insert}`);const s=x1(o);if(r+s<t)r+=s;else{if(r+s===t)return{left:n.slice(0,i+1),right:n.slice(i+1)};{p(Ei,r+s>t,`invalid offset, ${r}, ${s}, ${t}`);const l=t-r,c=mt.default(o);p(Ei,c.insert,"no copied.insert"),p(Ei,typeof c.insert=="string","invalid copied.insert type"),c.insert=c.insert.substr(0,l),o.insert=o.insert.substr(l),c.insert===""&&p(Ei,!1,"invalid copied.insert, is empty string"),o.insert===""&&p(Ei,!1,"invalid op.insert, is empty string");const d=[o,...n.slice(i+1)],h=[...n.splice(0,i),c];return e&&(e.sourceOp=o),{left:h,right:d}}}}throw new Error(`invalid split offset: ${t}, ${JSON.stringify(n)}`)}function Je(n,t,e){p(Ei,t>=0,"invalid offset, < 0"),p(Ei,e>0,"invalid length, <= 0"),p(Ei,t+e<=gn(n),"invalid offset + length < text length");const{left:r,right:i}=Mn(n,t+e),{left:o,right:s}=Mn(r,t);return{left:o,middle:s,right:i}}function V3(n,t){const e=Array.from(new Set(t)).sort((o,s)=>o-s),r=[];let i=n;for(let o=e.length-1;o>=0;o--){const s=e[o],{left:l,right:c}=Mn(i,s);i=l,r.unshift(c)}return i.length>0&&r.unshift(i),r}function $3(n,t,e){return Je(n,t,e).middle}const A1="style-color-",b1="style-bg-color-";function lh(n,t,e){const r=mt.default(n);return r.forEach(i=>{if(!(i.attributes&&i.attributes.box===!0&&!t.startsWith("comment-")))if(e===void 0){if(!i.attributes||i.attributes[t]===void 0)return;delete i.attributes[t],Object.keys(i.attributes).length===0&&delete i.attributes}else i.attributes||(i.attributes={}),i.attributes[t]=e}),r}function v1(n,t,e,r){const i=mt.default(n);return i.forEach(o=>{o.attributes&&o.attributes.box===!0&&!(r!=null&&r.handleBox)||o.attributes&&((r==null?void 0:r.ignoreValue)||o.attributes[t]===e)&&(delete o.attributes[t],Object.keys(o.attributes).length===0&&delete o.attributes)}),i}function mu(n,t,e,r,i){if(t===0)return e;const o=Je(e,n,t);return[...o.left,...lh(o.middle,r,i),...o.right]}function va(n,t,e,r,i,o){if(t===0)return e;const s=Je(e,n,t);return[...s.left,...v1(s.middle,r,i,o),...s.right]}function Ba(n,t){const e=F3(n,t);if(e.length===1)return e[0].attributes;if(e.length===2)return e[1].attributes}function H3(n,t,e,r){if(t===0)return e;const i=Je(e,n,t),o=i.middle.map(s=>r(s));return[...i.left,...o,...i.right]}function j3(n,t){t==="color"?Object.keys(n).forEach(e=>{(e.startsWith("style-color-")||e==="inline-style-color")&&delete n[e]}):t==="backgroundColor"&&Object.keys(n).forEach(e=>{e.startsWith("style-bg-color-")&&delete n[e]})}function RD(n,t){if(!n.attributes||n.attributes.box)return;const e=n.attributes;j3(e,t),Object.keys(e).length===0&&delete n.attributes}function wD(n,t,e){n.attributes||(n.attributes={}),!n.attributes.box&&(t==="color"?n.attributes[`style-color-${e}`]=!0:n.attributes[`style-bg-color-${e}`]=!0)}function z3(n,t,e,r,i){const o=mt.default(e);return H3(n,t,o,l=>(RD(l,r),i!==null&&wD(l,r,i),l))}function B1(n){var i,o;if(!n||n.box)return[null,null];const t=Array.from(Object.keys(n));let e=null,r=null;for(let s=0;s<t.length;s++){const l=t[s];l.startsWith(A1)?e=(i=Number.parseInt(l.substring(A1.length),10))!=null?i:null:l.startsWith(b1)&&(r=(o=Number.parseInt(l.substring(b1.length),10))!=null?o:null)}return[e,r]}function G3(n,t,e){j3(n,t),t==="color"?n[`style-color-${e}`]=!0:n[`style-bg-color-${e}`]=!0}function W3(n){return n.attributes?n.attributes.box?[null,null]:B1(n.attributes):[null,null]}function q3(n,t,e){let r=[];if(t===0?n!==0&&(r=Je(e,n-1,1).middle):r=Je(e,n,t).middle,r.length===0)return[null,null];let[i,o]=W3(r[0]);if(i===null&&o===null)return[i,o];for(let s=1;s<r.length;s++){const l=r[s];if(!l.attributes)return[null,null];if(l.attributes.box)continue;const[c,d]=W3(l);c===null||i===null?i=null:i=c===i?i:null,d===null||o===null?o=null:o=d===o?o:null}return[i,o]}const Ta=I("text-block-content");function SD(n,t,e,r,i){if(p(Ta,r,"no text for block"),r.length===0&&(!i||i.size===0)){e.innerHTML="<span><br></span>";return}const o=[];i&&o.push(...i.keys());const s=C=>n.editorInsertions.createInsertion(e,C),l=(C,E)=>{const x=i==null?void 0:i.get(E);x&&(x.forEach(B=>{C.appendChild(s(B))}),i==null||i.delete(E))},c=document.createDocumentFragment();let d=0;const h=V3(r,o);for(let C=0;C<h.length;C++){l(c,d);const E=h[C];d+=gn(E);for(let x=0;x<E.length;x++){const B=E[x];if(to(B)){p(Ta,B.attributes,`op is not an valid box: ${JSON.stringify(B)}`);const w=n.editorBoxes.createBox(e,B.attributes);p(Ta,w instanceof HTMLSpanElement,`invalid box element: ${w.tagName}`);const U=n.editorBlockRenders.renderBox(t,B.attributes);U.classes&&z(w,...U.classes),U.attributes&&Object.entries(U.attributes).forEach(([M,F])=>{w.setAttribute(M,F)}),U.styles&&Object.entries(U.styles).forEach(([M,F])=>{w.style.setProperty(M,F)}),c.appendChild(w);continue}p(Ta,B.insert,`no insert in op: ${JSON.stringify(B)}`);const k=v("span",["text"],c,B.insert);if(B.attributes){const w=n.editorBlockRenders.renderText(t,B.attributes);w.classes&&z(k,...w.classes),w.attributes&&Object.entries(w.attributes).forEach(([U,M])=>{k.setAttribute(U,M)}),w.styles&&Object.entries(w.styles).forEach(([U,M])=>{k.style.setProperty(kD(U),M)})}c.appendChild(k)}}l(c,d),e.innerHTML="",e.appendChild(c)}function ah(n,t,e,r,i){const{text:o,insertions:s}=n.editorDecorators.decorateText(t,i),l=n.compositingText;if(l){const c=n.selection.range.start;if(p(Ta,c.isSimple(),"not an simple position while compositing"),c.blockId===e){const d=Ba(o,0);s.set(c.offset,[{type:"inputting",id:et(),text:l,attributes:d}])}}return SD(n,t,r,o,s)}function LD(n){const t=n.rootContainer.querySelectorAll('span[data-type="editor-insertion"].inputting-insertion');t.length&&Ta.debug(`remove ${t.length} temp composition span`),Array.from(t).forEach(e=>e.remove())}const xi=I("client-rects");function ID(n){const t=gi(n);let e=0;const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=Cr(o);r.push({child:o,startBlockOffset:e,endBlockOffset:e+s}),e+=s}return r}function DD(n,t,e,r){p(xi,e<r,`invalid from & to: ${e}, ${r}`);const i=dt(n,t);p(xi,e>=0&&r>=0&&e<=i&&r<=i,`invalid offset: ${e}, ${r}, length: ${i}`);const o=ID(t),s=o.findIndex(x=>x.startBlockOffset<=e&&e<x.endBlockOffset),l=o.findIndex(x=>x.startBlockOffset<r&&r<=x.endBlockOffset);if(p(xi,s!==-1,"failed to find start child"),p(xi,l!==-1,"failed to find end child"),p(xi,s<=l,`invalid start index & end index: ${s}, ${l}`),s===l){const x=o[s];return[{child:x.child,startChildOffset:e-x.startBlockOffset,endChildOffset:r-x.startBlockOffset}]}const c=[],d=o[s],h={child:d.child,startChildOffset:e-d.startBlockOffset,endChildOffset:Cr(d.child)};c.push(h);for(let x=s+1;x<l;x++){const B=o[x],k={child:B.child,startChildOffset:0,endChildOffset:B.endBlockOffset-B.startBlockOffset};c.push(k)}const C=o[l],E={child:C.child,startChildOffset:0,endChildOffset:r-C.startBlockOffset};return c.push(E),c}function _D(n){const t=(r,i)=>r.left<=i.left&&r.top<=i.top&&r.right>=i.right&&r.bottom>=i.bottom&&(r.width!==i.width||r.height!==i.height);n=n.filter(r=>!n.find(o=>t(r,o)));const e=[];return n=n.filter(r=>e.find(i=>i.left===r.left&&i.top===r.top&&i.width===r.width&&i.height===r.height)?!1:(e.push(r),!0)),n}function X3(n,t,e,r){if(dt(n,t)===0){const h=Nt(t).getBoundingClientRect();return[new DOMRect(h.left,h.top,4,h.height)]}const i=e.offset,o=r.offset;if(i===o)return[Jn(t,e)];const l=DD(n,t,i,o).map(d=>f7(d.child,d.startChildOffset,d.endChildOffset)),c=[];return l.forEach(d=>{const h=_D(Array.from(d.getClientRects()));c.push(...h)}),c}function MD(n,t,e){p(xi,e instanceof rn,"invalid range");const r=e.start,i=e.end;return p(xi,r.isSimple(),"text block only allow simple position"),p(xi,i.isSimple(),"text block only allow simple position"),p(xi,r.blockId===i.blockId,"only allow update one text block selection"),p(xi,r.blockId===lt(t),"only allow update one text block selection"),X3(n,t,r,i)}const T1=I("selection-background");function UD(n,t,e,r){p(T1,e.isSimple(),"text block only allow simple position"),p(T1,r.isSimple(),"text block only allow simple position"),p(T1,e.blockId===r.blockId,"only allow update one text block selection");const i=e.offset,o=r.offset;if(i===o&&(dt(n,t)!==0||n.selection.range.isCollapsed())){const h=Zg(t);Array.from(h.children).forEach(C=>{C.remove()});return}const s=X3(n,t,e,r),l=t.getBoundingClientRect(),c=dr(t),d=Zg(t);Array.from(d.children).forEach((h,C)=>{if(C<s.length){const E=s[C],x=h;x.style.left=`${(E.left-l.left-t.clientLeft)/c}px`,x.style.top=`${(E.top-l.top-t.clientTop)/c}px`,x.style.width=`${E.width/c}px`,x.style.height=`${E.height/c}px`}else h.remove()}),s.slice(d.children.length).forEach(h=>{const C=v("div",["editor-selection-background"],d);C.style.left=`${(h.left-l.left-t.clientLeft)/c}px`,C.style.top=`${(h.top-l.top-t.clientTop)/c}px`,C.style.width=`${h.width/c}px`,C.style.height=`${h.height/c}px`})}function OD(n){const t=n.selection.range.getSelectedBlocks(),e=n.selection.range.isCollapsed();n.rootContainer.querySelectorAll("div[data-type=block-background]").forEach(r=>{const i=Z(r);i&&rt(n,i)&&(!t.find(o=>o.block===i)||e)&&r.remove()})}const gu=I("line-breaker");function Y3(n){const t=[];let e=null;for(let r=0;r<n.length;r++){let i=n[r];!!e&&i.top===e.top?(i=new DOMRect(e.left,e.top,e.width+i.width,i.height),t.splice(t.length-1,1,i)):t.push(i),e=i}return t}function ND(n){const t=document.createRange();return t.setStart(n,0),t.setEnd(n,n.data.length),Y3(t.getClientRects())}function pu(n){const t=l=>{if(!l)return!1;const c=Kd(l);return js(l).top>c.top+c.height/2},e=(l,c)=>{const d=js(l),h=Kd(c);return Math.floor(h.left)<Math.floor(d.right)},r=(l,c)=>{const d=js(l),h=js(c);return h.top+h.height/2>d.bottom},i=[];let o=0;const s=gi(n);for(let l=0;l<s.length;l++){const c=s[l];if(Ji(c)){const B=c,k=s[l+1];if(!k)break;const w=s[l-1];if(w&&r(w,B)&&i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:B,wrap:"nextWrapped",prevWrapped:t(w),nextWrapped:t(B)}}),e(B,k)){i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:B,wrap:"nowrap",prevWrapped:t(w),nextWrapped:t(B)}});continue}continue}if(Qn(c)){const B=c,k=s[l+1];if(!k)break;const w=s[l-1];if(w&&r(w,B)&&i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:B,wrap:"nextWrapped",prevWrapped:t(w),nextWrapped:t(B)}}),e(B,k)){o+=1,i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:c,wrap:"nowrap",prevWrapped:t(w),nextWrapped:t(c)}});continue}o+=1;continue}const d=c,h=Y3(d.getClientRects());if(p(gu,h.length>0,"invalid text child dom"),h.length===1){const B=s[l+1];if(!B)break;if(e(d,B)){o+=Cr(d),i.push({offset:o,type:"betweenChild",childInfo:{prevChild:d,nextChild:B,wrap:"nowrap",prevWrapped:t(d),nextWrapped:t(B)}});continue}o+=Cr(d);continue}const C=d.firstChild;p(gu,C,"invalid text child, no text node"),p(gu,C instanceof Text,`invalid text child, not a valid text node: ${typeof C}`);const E=Cr(d);p(gu,C.data.length===E,"text node data length not equal child text length");const x=ND(C);for(let B=0;B<x.length-1;B++){const k=x[B],w=Ig(k.right,k.top+k.height-1);w.offset>-1&&w.textNode===C&&i.push({offset:o+w.offset,type:"textBreakWord",childInfo:{prevChild:c,nextChild:c,wrap:"nowrap",prevWrapped:t(c),nextWrapped:t(c)}})}o+=E}return i}function y1(n,t){const e=pu(n);for(let r=0;r<e.length;r++){const{offset:i}=e[r];if(t.offset<i)return{lineIndex:r,lineBreaks:e};if(t.offset===i&&t.type==="end")return{lineIndex:r,lineBreaks:e}}return p(gu,t.offset<=du(n),"invalid position, offset > block length"),{lineIndex:e.length,lineBreaks:e}}var Un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Q3={},k1={},R1={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EXTENDED_PICTOGRAPHIC=n.CLUSTER_BREAK=void 0,function(t){t[t.CR=0]="CR",t[t.LF=1]="LF",t[t.CONTROL=2]="CONTROL",t[t.EXTEND=3]="EXTEND",t[t.REGIONAL_INDICATOR=4]="REGIONAL_INDICATOR",t[t.SPACINGMARK=5]="SPACINGMARK",t[t.L=6]="L",t[t.V=7]="V",t[t.T=8]="T",t[t.LV=9]="LV",t[t.LVT=10]="LVT",t[t.OTHER=11]="OTHER",t[t.PREPEND=12]="PREPEND",t[t.E_BASE=13]="E_BASE",t[t.E_MODIFIER=14]="E_MODIFIER",t[t.ZWJ=15]="ZWJ",t[t.GLUE_AFTER_ZWJ=16]="GLUE_AFTER_ZWJ",t[t.E_BASE_GAZ=17]="E_BASE_GAZ"}(n.CLUSTER_BREAK||(n.CLUSTER_BREAK={})),n.EXTENDED_PICTOGRAPHIC=101})(R1);var w1={};Object.defineProperty(w1,"__esModule",{value:!0});const Ht=R1,eo=0,S1=1,PD=2,FD=3,KD=4;class VD{static isSurrogate(t,e){return 55296<=t.charCodeAt(e)&&t.charCodeAt(e)<=56319&&56320<=t.charCodeAt(e+1)&&t.charCodeAt(e+1)<=57343}static codePointAt(t,e){e===void 0&&(e=0);const r=t.charCodeAt(e);if(55296<=r&&r<=56319&&e<t.length-1){const i=r,o=t.charCodeAt(e+1);return 56320<=o&&o<=57343?(i-55296)*1024+(o-56320)+65536:i}if(56320<=r&&r<=57343&&e>=1){const i=t.charCodeAt(e-1),o=r;return 55296<=i&&i<=56319?(i-55296)*1024+(o-56320)+65536:o}return r}static shouldBreak(t,e,r,i,o,s){const l=[t].concat(e).concat([r]),c=[i].concat(o).concat([s]),d=l[l.length-2],h=r,C=s,E=l.lastIndexOf(Ht.CLUSTER_BREAK.REGIONAL_INDICATOR);if(E>0&&l.slice(1,E).every(function(B){return B===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR})&&[Ht.CLUSTER_BREAK.PREPEND,Ht.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(d)===-1)return l.filter(function(B){return B===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR}).length%2===1?FD:KD;if(d===Ht.CLUSTER_BREAK.CR&&h===Ht.CLUSTER_BREAK.LF)return eo;if(d===Ht.CLUSTER_BREAK.CONTROL||d===Ht.CLUSTER_BREAK.CR||d===Ht.CLUSTER_BREAK.LF)return S1;if(h===Ht.CLUSTER_BREAK.CONTROL||h===Ht.CLUSTER_BREAK.CR||h===Ht.CLUSTER_BREAK.LF)return S1;if(d===Ht.CLUSTER_BREAK.L&&(h===Ht.CLUSTER_BREAK.L||h===Ht.CLUSTER_BREAK.V||h===Ht.CLUSTER_BREAK.LV||h===Ht.CLUSTER_BREAK.LVT))return eo;if((d===Ht.CLUSTER_BREAK.LV||d===Ht.CLUSTER_BREAK.V)&&(h===Ht.CLUSTER_BREAK.V||h===Ht.CLUSTER_BREAK.T))return eo;if((d===Ht.CLUSTER_BREAK.LVT||d===Ht.CLUSTER_BREAK.T)&&h===Ht.CLUSTER_BREAK.T)return eo;if(h===Ht.CLUSTER_BREAK.EXTEND||h===Ht.CLUSTER_BREAK.ZWJ)return eo;if(h===Ht.CLUSTER_BREAK.SPACINGMARK)return eo;if(d===Ht.CLUSTER_BREAK.PREPEND)return eo;const x=c.slice(0,-1).lastIndexOf(Ht.EXTENDED_PICTOGRAPHIC);return x!==-1&&c[x]===Ht.EXTENDED_PICTOGRAPHIC&&l.slice(x+1,-2).every(function(B){return B===Ht.CLUSTER_BREAK.EXTEND})&&d===Ht.CLUSTER_BREAK.ZWJ&&C===Ht.EXTENDED_PICTOGRAPHIC?eo:e.indexOf(Ht.CLUSTER_BREAK.REGIONAL_INDICATOR)!==-1?PD:d===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR&&h===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR?eo:S1}}w1.default=VD;var L1={};Object.defineProperty(L1,"__esModule",{value:!0});class $D{constructor(t,e){this._index=0,this._str=t,this._nextBreak=e}[Symbol.iterator](){return this}next(){let t;if((t=this._nextBreak(this._str,this._index))<this._str.length){const e=this._str.slice(this._index,t);return this._index=t,{value:e,done:!1}}if(this._index<this._str.length){const e=this._str.slice(this._index);return this._index=this._str.length,{value:e,done:!1}}return{value:void 0,done:!0}}}L1.default=$D;var J3=Un&&Un.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(k1,"__esModule",{value:!0});const f=R1,ch=J3(w1),HD=J3(L1);class no{static nextBreak(t,e){if(e===void 0&&(e=0),e<0)return 0;if(e>=t.length-1)return t.length;const r=ch.default.codePointAt(t,e),i=no.getGraphemeBreakProperty(r),o=no.getEmojiProperty(r),s=[],l=[];for(let c=e+1;c<t.length;c++){if(ch.default.isSurrogate(t,c-1))continue;const d=ch.default.codePointAt(t,c),h=no.getGraphemeBreakProperty(d),C=no.getEmojiProperty(d);if(ch.default.shouldBreak(i,s,h,o,l,C))return c;s.push(h),l.push(C)}return t.length}splitGraphemes(t){const e=[];let r=0,i;for(;(i=no.nextBreak(t,r))<t.length;)e.push(t.slice(r,i)),r=i;return r<t.length&&e.push(t.slice(r)),e}iterateGraphemes(t){return new HD.default(t,no.nextBreak)}countGraphemes(t){let e=0,r=0,i;for(;(i=no.nextBreak(t,r))<t.length;)r=i,e++;return r<t.length&&e++,e}static getGraphemeBreakProperty(t){if(t<48905){if(t<44116){if(t<4141){if(t<2818){if(t<2363)if(t<1759){if(t<1471){if(t<127){if(t<11){if(t<10){if(0<=t&&t<=9)return f.CLUSTER_BREAK.CONTROL}else if(t===10)return f.CLUSTER_BREAK.LF}else if(t<13){if(11<=t&&t<=12)return f.CLUSTER_BREAK.CONTROL}else if(t<14){if(t===13)return f.CLUSTER_BREAK.CR}else if(14<=t&&t<=31)return f.CLUSTER_BREAK.CONTROL}else if(t<768){if(t<173){if(127<=t&&t<=159)return f.CLUSTER_BREAK.CONTROL}else if(t===173)return f.CLUSTER_BREAK.CONTROL}else if(t<1155){if(768<=t&&t<=879)return f.CLUSTER_BREAK.EXTEND}else if(t<1425){if(1155<=t&&t<=1161)return f.CLUSTER_BREAK.EXTEND}else if(1425<=t&&t<=1469)return f.CLUSTER_BREAK.EXTEND}else if(t<1552){if(t<1476){if(t<1473){if(t===1471)return f.CLUSTER_BREAK.EXTEND}else if(1473<=t&&t<=1474)return f.CLUSTER_BREAK.EXTEND}else if(t<1479){if(1476<=t&&t<=1477)return f.CLUSTER_BREAK.EXTEND}else if(t<1536){if(t===1479)return f.CLUSTER_BREAK.EXTEND}else if(1536<=t&&t<=1541)return f.CLUSTER_BREAK.PREPEND}else if(t<1648){if(t<1564){if(1552<=t&&t<=1562)return f.CLUSTER_BREAK.EXTEND}else if(t<1611){if(t===1564)return f.CLUSTER_BREAK.CONTROL}else if(1611<=t&&t<=1631)return f.CLUSTER_BREAK.EXTEND}else if(t<1750){if(t===1648)return f.CLUSTER_BREAK.EXTEND}else if(t<1757){if(1750<=t&&t<=1756)return f.CLUSTER_BREAK.EXTEND}else if(t===1757)return f.CLUSTER_BREAK.PREPEND}else if(t<2075){if(t<1840)if(t<1770){if(t<1767){if(1759<=t&&t<=1764)return f.CLUSTER_BREAK.EXTEND}else if(1767<=t&&t<=1768)return f.CLUSTER_BREAK.EXTEND}else if(t<1807){if(1770<=t&&t<=1773)return f.CLUSTER_BREAK.EXTEND}else{if(t===1807)return f.CLUSTER_BREAK.PREPEND;if(t===1809)return f.CLUSTER_BREAK.EXTEND}else if(t<2027){if(t<1958){if(1840<=t&&t<=1866)return f.CLUSTER_BREAK.EXTEND}else if(1958<=t&&t<=1968)return f.CLUSTER_BREAK.EXTEND}else if(t<2045){if(2027<=t&&t<=2035)return f.CLUSTER_BREAK.EXTEND}else if(t<2070){if(t===2045)return f.CLUSTER_BREAK.EXTEND}else if(2070<=t&&t<=2073)return f.CLUSTER_BREAK.EXTEND}else if(t<2200){if(t<2089){if(t<2085){if(2075<=t&&t<=2083)return f.CLUSTER_BREAK.EXTEND}else if(2085<=t&&t<=2087)return f.CLUSTER_BREAK.EXTEND}else if(t<2137){if(2089<=t&&t<=2093)return f.CLUSTER_BREAK.EXTEND}else if(t<2192){if(2137<=t&&t<=2139)return f.CLUSTER_BREAK.EXTEND}else if(2192<=t&&t<=2193)return f.CLUSTER_BREAK.PREPEND}else if(t<2275){if(t<2250){if(2200<=t&&t<=2207)return f.CLUSTER_BREAK.EXTEND}else if(t<2274){if(2250<=t&&t<=2273)return f.CLUSTER_BREAK.EXTEND}else if(t===2274)return f.CLUSTER_BREAK.PREPEND}else if(t<2307){if(2275<=t&&t<=2306)return f.CLUSTER_BREAK.EXTEND}else{if(t===2307)return f.CLUSTER_BREAK.SPACINGMARK;if(t===2362)return f.CLUSTER_BREAK.EXTEND}else if(t<2561){if(t<2434){if(t<2381){if(t<2366){if(t===2363)return f.CLUSTER_BREAK.SPACINGMARK;if(t===2364)return f.CLUSTER_BREAK.EXTEND}else if(t<2369){if(2366<=t&&t<=2368)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2377){if(2369<=t&&t<=2376)return f.CLUSTER_BREAK.EXTEND}else if(2377<=t&&t<=2380)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2385){if(t<2382){if(t===2381)return f.CLUSTER_BREAK.EXTEND}else if(2382<=t&&t<=2383)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2402){if(2385<=t&&t<=2391)return f.CLUSTER_BREAK.EXTEND}else if(t<2433){if(2402<=t&&t<=2403)return f.CLUSTER_BREAK.EXTEND}else if(t===2433)return f.CLUSTER_BREAK.EXTEND}else if(t<2503){if(t<2494){if(t<2492){if(2434<=t&&t<=2435)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2492)return f.CLUSTER_BREAK.EXTEND}else if(t<2495){if(t===2494)return f.CLUSTER_BREAK.EXTEND}else if(t<2497){if(2495<=t&&t<=2496)return f.CLUSTER_BREAK.SPACINGMARK}else if(2497<=t&&t<=2500)return f.CLUSTER_BREAK.EXTEND}else if(t<2519){if(t<2507){if(2503<=t&&t<=2504)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2509){if(2507<=t&&t<=2508)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2509)return f.CLUSTER_BREAK.EXTEND}else if(t<2530){if(t===2519)return f.CLUSTER_BREAK.EXTEND}else if(t<2558){if(2530<=t&&t<=2531)return f.CLUSTER_BREAK.EXTEND}else if(t===2558)return f.CLUSTER_BREAK.EXTEND}else if(t<2691){if(t<2631){if(t<2620){if(t<2563){if(2561<=t&&t<=2562)return f.CLUSTER_BREAK.EXTEND}else if(t===2563)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2622){if(t===2620)return f.CLUSTER_BREAK.EXTEND}else if(t<2625){if(2622<=t&&t<=2624)return f.CLUSTER_BREAK.SPACINGMARK}else if(2625<=t&&t<=2626)return f.CLUSTER_BREAK.EXTEND}else if(t<2672){if(t<2635){if(2631<=t&&t<=2632)return f.CLUSTER_BREAK.EXTEND}else if(t<2641){if(2635<=t&&t<=2637)return f.CLUSTER_BREAK.EXTEND}else if(t===2641)return f.CLUSTER_BREAK.EXTEND}else if(t<2677){if(2672<=t&&t<=2673)return f.CLUSTER_BREAK.EXTEND}else if(t<2689){if(t===2677)return f.CLUSTER_BREAK.EXTEND}else if(2689<=t&&t<=2690)return f.CLUSTER_BREAK.EXTEND}else if(t<2761){if(t<2750){if(t===2691)return f.CLUSTER_BREAK.SPACINGMARK;if(t===2748)return f.CLUSTER_BREAK.EXTEND}else if(t<2753){if(2750<=t&&t<=2752)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2759){if(2753<=t&&t<=2757)return f.CLUSTER_BREAK.EXTEND}else if(2759<=t&&t<=2760)return f.CLUSTER_BREAK.EXTEND}else if(t<2786){if(t<2763){if(t===2761)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2765){if(2763<=t&&t<=2764)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2765)return f.CLUSTER_BREAK.EXTEND}else if(t<2810){if(2786<=t&&t<=2787)return f.CLUSTER_BREAK.EXTEND}else if(t<2817){if(2810<=t&&t<=2815)return f.CLUSTER_BREAK.EXTEND}else if(t===2817)return f.CLUSTER_BREAK.EXTEND}else if(t<3315){if(t<3076){if(t<2946){if(t<2887){if(t<2878){if(t<2876){if(2818<=t&&t<=2819)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2876)return f.CLUSTER_BREAK.EXTEND}else if(t<2880){if(2878<=t&&t<=2879)return f.CLUSTER_BREAK.EXTEND}else if(t<2881){if(t===2880)return f.CLUSTER_BREAK.SPACINGMARK}else if(2881<=t&&t<=2884)return f.CLUSTER_BREAK.EXTEND}else if(t<2893){if(t<2891){if(2887<=t&&t<=2888)return f.CLUSTER_BREAK.SPACINGMARK}else if(2891<=t&&t<=2892)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2901){if(t===2893)return f.CLUSTER_BREAK.EXTEND}else if(t<2914){if(2901<=t&&t<=2903)return f.CLUSTER_BREAK.EXTEND}else if(2914<=t&&t<=2915)return f.CLUSTER_BREAK.EXTEND}else if(t<3014){if(t<3007){if(t===2946||t===3006)return f.CLUSTER_BREAK.EXTEND}else if(t<3008){if(t===3007)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3009){if(t===3008)return f.CLUSTER_BREAK.EXTEND}else if(3009<=t&&t<=3010)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3031){if(t<3018){if(3014<=t&&t<=3016)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3021){if(3018<=t&&t<=3020)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===3021)return f.CLUSTER_BREAK.EXTEND}else if(t<3072){if(t===3031)return f.CLUSTER_BREAK.EXTEND}else if(t<3073){if(t===3072)return f.CLUSTER_BREAK.EXTEND}else if(3073<=t&&t<=3075)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3262){if(t<3146){if(t<3134){if(t===3076||t===3132)return f.CLUSTER_BREAK.EXTEND}else if(t<3137){if(3134<=t&&t<=3136)return f.CLUSTER_BREAK.EXTEND}else if(t<3142){if(3137<=t&&t<=3140)return f.CLUSTER_BREAK.SPACINGMARK}else if(3142<=t&&t<=3144)return f.CLUSTER_BREAK.EXTEND}else if(t<3201){if(t<3157){if(3146<=t&&t<=3149)return f.CLUSTER_BREAK.EXTEND}else if(t<3170){if(3157<=t&&t<=3158)return f.CLUSTER_BREAK.EXTEND}else if(3170<=t&&t<=3171)return f.CLUSTER_BREAK.EXTEND}else if(t<3202){if(t===3201)return f.CLUSTER_BREAK.EXTEND}else if(t<3260){if(3202<=t&&t<=3203)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===3260)return f.CLUSTER_BREAK.EXTEND}else if(t<3270){if(t<3264){if(t===3262)return f.CLUSTER_BREAK.SPACINGMARK;if(t===3263)return f.CLUSTER_BREAK.EXTEND}else if(t<3266){if(3264<=t&&t<=3265)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3267){if(t===3266)return f.CLUSTER_BREAK.EXTEND}else if(3267<=t&&t<=3268)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3276){if(t<3271){if(t===3270)return f.CLUSTER_BREAK.EXTEND}else if(t<3274){if(3271<=t&&t<=3272)return f.CLUSTER_BREAK.SPACINGMARK}else if(3274<=t&&t<=3275)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3285){if(3276<=t&&t<=3277)return f.CLUSTER_BREAK.EXTEND}else if(t<3298){if(3285<=t&&t<=3286)return f.CLUSTER_BREAK.EXTEND}else if(3298<=t&&t<=3299)return f.CLUSTER_BREAK.EXTEND}else if(t<3551){if(t<3406){if(t<3391){if(t<3330){if(t<3328){if(t===3315)return f.CLUSTER_BREAK.SPACINGMARK}else if(3328<=t&&t<=3329)return f.CLUSTER_BREAK.EXTEND}else if(t<3387){if(3330<=t&&t<=3331)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3390){if(3387<=t&&t<=3388)return f.CLUSTER_BREAK.EXTEND}else if(t===3390)return f.CLUSTER_BREAK.EXTEND}else if(t<3398){if(t<3393){if(3391<=t&&t<=3392)return f.CLUSTER_BREAK.SPACINGMARK}else if(3393<=t&&t<=3396)return f.CLUSTER_BREAK.EXTEND}else if(t<3402){if(3398<=t&&t<=3400)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3405){if(3402<=t&&t<=3404)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===3405)return f.CLUSTER_BREAK.EXTEND}else if(t<3530){if(t<3426){if(t===3406)return f.CLUSTER_BREAK.PREPEND;if(t===3415)return f.CLUSTER_BREAK.EXTEND}else if(t<3457){if(3426<=t&&t<=3427)return f.CLUSTER_BREAK.EXTEND}else if(t<3458){if(t===3457)return f.CLUSTER_BREAK.EXTEND}else if(3458<=t&&t<=3459)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3538){if(t<3535){if(t===3530)return f.CLUSTER_BREAK.EXTEND}else if(t<3536){if(t===3535)return f.CLUSTER_BREAK.EXTEND}else if(3536<=t&&t<=3537)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3542){if(3538<=t&&t<=3540)return f.CLUSTER_BREAK.EXTEND}else if(t<3544){if(t===3542)return f.CLUSTER_BREAK.EXTEND}else if(3544<=t&&t<=3550)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3893){if(t<3655){if(t<3633){if(t<3570){if(t===3551)return f.CLUSTER_BREAK.EXTEND}else if(3570<=t&&t<=3571)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3635){if(t===3633)return f.CLUSTER_BREAK.EXTEND}else if(t<3636){if(t===3635)return f.CLUSTER_BREAK.SPACINGMARK}else if(3636<=t&&t<=3642)return f.CLUSTER_BREAK.EXTEND}else if(t<3764)if(t<3761){if(3655<=t&&t<=3662)return f.CLUSTER_BREAK.EXTEND}else{if(t===3761)return f.CLUSTER_BREAK.EXTEND;if(t===3763)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3784){if(3764<=t&&t<=3772)return f.CLUSTER_BREAK.EXTEND}else if(t<3864){if(3784<=t&&t<=3790)return f.CLUSTER_BREAK.EXTEND}else if(3864<=t&&t<=3865)return f.CLUSTER_BREAK.EXTEND}else if(t<3967){if(t<3897){if(t===3893||t===3895)return f.CLUSTER_BREAK.EXTEND}else if(t<3902){if(t===3897)return f.CLUSTER_BREAK.EXTEND}else if(t<3953){if(3902<=t&&t<=3903)return f.CLUSTER_BREAK.SPACINGMARK}else if(3953<=t&&t<=3966)return f.CLUSTER_BREAK.EXTEND}else if(t<3981){if(t<3968){if(t===3967)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3974){if(3968<=t&&t<=3972)return f.CLUSTER_BREAK.EXTEND}else if(3974<=t&&t<=3975)return f.CLUSTER_BREAK.EXTEND}else if(t<3993){if(3981<=t&&t<=3991)return f.CLUSTER_BREAK.EXTEND}else if(t<4038){if(3993<=t&&t<=4028)return f.CLUSTER_BREAK.EXTEND}else if(t===4038)return f.CLUSTER_BREAK.EXTEND}else if(t<7204){if(t<6448){if(t<5938){if(t<4226){if(t<4157){if(t<4146){if(t<4145){if(4141<=t&&t<=4144)return f.CLUSTER_BREAK.EXTEND}else if(t===4145)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4153){if(4146<=t&&t<=4151)return f.CLUSTER_BREAK.EXTEND}else if(t<4155){if(4153<=t&&t<=4154)return f.CLUSTER_BREAK.EXTEND}else if(4155<=t&&t<=4156)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4184){if(t<4182){if(4157<=t&&t<=4158)return f.CLUSTER_BREAK.EXTEND}else if(4182<=t&&t<=4183)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4190){if(4184<=t&&t<=4185)return f.CLUSTER_BREAK.EXTEND}else if(t<4209){if(4190<=t&&t<=4192)return f.CLUSTER_BREAK.EXTEND}else if(4209<=t&&t<=4212)return f.CLUSTER_BREAK.EXTEND}else if(t<4352){if(t<4229){if(t===4226)return f.CLUSTER_BREAK.EXTEND;if(t===4228)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4237){if(4229<=t&&t<=4230)return f.CLUSTER_BREAK.EXTEND}else if(t===4237||t===4253)return f.CLUSTER_BREAK.EXTEND}else if(t<4957){if(t<4448){if(4352<=t&&t<=4447)return f.CLUSTER_BREAK.L}else if(t<4520){if(4448<=t&&t<=4519)return f.CLUSTER_BREAK.V}else if(4520<=t&&t<=4607)return f.CLUSTER_BREAK.T}else if(t<5906){if(4957<=t&&t<=4959)return f.CLUSTER_BREAK.EXTEND}else if(t<5909){if(5906<=t&&t<=5908)return f.CLUSTER_BREAK.EXTEND}else if(t===5909)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6089){if(t<6070){if(t<5970){if(t<5940){if(5938<=t&&t<=5939)return f.CLUSTER_BREAK.EXTEND}else if(t===5940)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6002){if(5970<=t&&t<=5971)return f.CLUSTER_BREAK.EXTEND}else if(t<6068){if(6002<=t&&t<=6003)return f.CLUSTER_BREAK.EXTEND}else if(6068<=t&&t<=6069)return f.CLUSTER_BREAK.EXTEND}else if(t<6078){if(t<6071){if(t===6070)return f.CLUSTER_BREAK.SPACINGMARK}else if(6071<=t&&t<=6077)return f.CLUSTER_BREAK.EXTEND}else if(t<6086){if(6078<=t&&t<=6085)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6087){if(t===6086)return f.CLUSTER_BREAK.EXTEND}else if(6087<=t&&t<=6088)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6277)if(t<6155){if(t<6109){if(6089<=t&&t<=6099)return f.CLUSTER_BREAK.EXTEND}else if(t===6109)return f.CLUSTER_BREAK.EXTEND}else if(t<6158){if(6155<=t&&t<=6157)return f.CLUSTER_BREAK.EXTEND}else{if(t===6158)return f.CLUSTER_BREAK.CONTROL;if(t===6159)return f.CLUSTER_BREAK.EXTEND}else if(t<6435){if(t<6313){if(6277<=t&&t<=6278)return f.CLUSTER_BREAK.EXTEND}else if(t<6432){if(t===6313)return f.CLUSTER_BREAK.EXTEND}else if(6432<=t&&t<=6434)return f.CLUSTER_BREAK.EXTEND}else if(t<6439){if(6435<=t&&t<=6438)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6441){if(6439<=t&&t<=6440)return f.CLUSTER_BREAK.EXTEND}else if(6441<=t&&t<=6443)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6971){if(t<6744)if(t<6681){if(t<6451){if(t<6450){if(6448<=t&&t<=6449)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===6450)return f.CLUSTER_BREAK.EXTEND}else if(t<6457){if(6451<=t&&t<=6456)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6679){if(6457<=t&&t<=6459)return f.CLUSTER_BREAK.EXTEND}else if(6679<=t&&t<=6680)return f.CLUSTER_BREAK.EXTEND}else if(t<6741){if(t<6683){if(6681<=t&&t<=6682)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===6683)return f.CLUSTER_BREAK.EXTEND}else if(t<6742){if(t===6741)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===6742)return f.CLUSTER_BREAK.EXTEND;if(t===6743)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6771){if(t<6754){if(t<6752){if(6744<=t&&t<=6750)return f.CLUSTER_BREAK.EXTEND}else if(t===6752)return f.CLUSTER_BREAK.EXTEND}else if(t<6757){if(t===6754)return f.CLUSTER_BREAK.EXTEND}else if(t<6765){if(6757<=t&&t<=6764)return f.CLUSTER_BREAK.EXTEND}else if(6765<=t&&t<=6770)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6912){if(t<6783){if(6771<=t&&t<=6780)return f.CLUSTER_BREAK.EXTEND}else if(t<6832){if(t===6783)return f.CLUSTER_BREAK.EXTEND}else if(6832<=t&&t<=6862)return f.CLUSTER_BREAK.EXTEND}else if(t<6916){if(6912<=t&&t<=6915)return f.CLUSTER_BREAK.EXTEND}else if(t<6964){if(t===6916)return f.CLUSTER_BREAK.SPACINGMARK}else if(6964<=t&&t<=6970)return f.CLUSTER_BREAK.EXTEND}else if(t<7080){if(t<7019){if(t<6973){if(t===6971)return f.CLUSTER_BREAK.SPACINGMARK;if(t===6972)return f.CLUSTER_BREAK.EXTEND}else if(t<6978){if(6973<=t&&t<=6977)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6979){if(t===6978)return f.CLUSTER_BREAK.EXTEND}else if(6979<=t&&t<=6980)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7073){if(t<7040){if(7019<=t&&t<=7027)return f.CLUSTER_BREAK.EXTEND}else if(t<7042){if(7040<=t&&t<=7041)return f.CLUSTER_BREAK.EXTEND}else if(t===7042)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7074){if(t===7073)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7078){if(7074<=t&&t<=7077)return f.CLUSTER_BREAK.EXTEND}else if(7078<=t&&t<=7079)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7144)if(t<7083){if(t<7082){if(7080<=t&&t<=7081)return f.CLUSTER_BREAK.EXTEND}else if(t===7082)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7142){if(7083<=t&&t<=7085)return f.CLUSTER_BREAK.EXTEND}else{if(t===7142)return f.CLUSTER_BREAK.EXTEND;if(t===7143)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7150){if(t<7146){if(7144<=t&&t<=7145)return f.CLUSTER_BREAK.EXTEND}else if(t<7149){if(7146<=t&&t<=7148)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===7149)return f.CLUSTER_BREAK.EXTEND}else if(t<7151){if(t===7150)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7154){if(7151<=t&&t<=7153)return f.CLUSTER_BREAK.EXTEND}else if(7154<=t&&t<=7155)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43346){if(t<11647){if(t<7415){if(t<7380){if(t<7220){if(t<7212){if(7204<=t&&t<=7211)return f.CLUSTER_BREAK.SPACINGMARK}else if(7212<=t&&t<=7219)return f.CLUSTER_BREAK.EXTEND}else if(t<7222){if(7220<=t&&t<=7221)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7376){if(7222<=t&&t<=7223)return f.CLUSTER_BREAK.EXTEND}else if(7376<=t&&t<=7378)return f.CLUSTER_BREAK.EXTEND}else if(t<7394){if(t<7393){if(7380<=t&&t<=7392)return f.CLUSTER_BREAK.EXTEND}else if(t===7393)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7405){if(7394<=t&&t<=7400)return f.CLUSTER_BREAK.EXTEND}else if(t===7405||t===7412)return f.CLUSTER_BREAK.EXTEND}else if(t<8205)if(t<7616){if(t<7416){if(t===7415)return f.CLUSTER_BREAK.SPACINGMARK}else if(7416<=t&&t<=7417)return f.CLUSTER_BREAK.EXTEND}else if(t<8203){if(7616<=t&&t<=7679)return f.CLUSTER_BREAK.EXTEND}else{if(t===8203)return f.CLUSTER_BREAK.CONTROL;if(t===8204)return f.CLUSTER_BREAK.EXTEND}else if(t<8288){if(t<8206){if(t===8205)return f.CLUSTER_BREAK.ZWJ}else if(t<8232){if(8206<=t&&t<=8207)return f.CLUSTER_BREAK.CONTROL}else if(8232<=t&&t<=8238)return f.CLUSTER_BREAK.CONTROL}else if(t<8400){if(8288<=t&&t<=8303)return f.CLUSTER_BREAK.CONTROL}else if(t<11503){if(8400<=t&&t<=8432)return f.CLUSTER_BREAK.EXTEND}else if(11503<=t&&t<=11505)return f.CLUSTER_BREAK.EXTEND}else if(t<43043){if(t<42612){if(t<12330){if(t<11744){if(t===11647)return f.CLUSTER_BREAK.EXTEND}else if(11744<=t&&t<=11775)return f.CLUSTER_BREAK.EXTEND}else if(t<12441){if(12330<=t&&t<=12335)return f.CLUSTER_BREAK.EXTEND}else if(t<42607){if(12441<=t&&t<=12442)return f.CLUSTER_BREAK.EXTEND}else if(42607<=t&&t<=42610)return f.CLUSTER_BREAK.EXTEND}else if(t<43010){if(t<42654){if(42612<=t&&t<=42621)return f.CLUSTER_BREAK.EXTEND}else if(t<42736){if(42654<=t&&t<=42655)return f.CLUSTER_BREAK.EXTEND}else if(42736<=t&&t<=42737)return f.CLUSTER_BREAK.EXTEND}else if(t<43014){if(t===43010)return f.CLUSTER_BREAK.EXTEND}else if(t===43014||t===43019)return f.CLUSTER_BREAK.EXTEND}else if(t<43188){if(t<43047){if(t<43045){if(43043<=t&&t<=43044)return f.CLUSTER_BREAK.SPACINGMARK}else if(43045<=t&&t<=43046)return f.CLUSTER_BREAK.EXTEND}else if(t<43052){if(t===43047)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43136){if(t===43052)return f.CLUSTER_BREAK.EXTEND}else if(43136<=t&&t<=43137)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43263){if(t<43204){if(43188<=t&&t<=43203)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43232){if(43204<=t&&t<=43205)return f.CLUSTER_BREAK.EXTEND}else if(43232<=t&&t<=43249)return f.CLUSTER_BREAK.EXTEND}else if(t<43302){if(t===43263)return f.CLUSTER_BREAK.EXTEND}else if(t<43335){if(43302<=t&&t<=43309)return f.CLUSTER_BREAK.EXTEND}else if(43335<=t&&t<=43345)return f.CLUSTER_BREAK.EXTEND}else if(t<43698){if(t<43493){if(t<43444)if(t<43392){if(t<43360){if(43346<=t&&t<=43347)return f.CLUSTER_BREAK.SPACINGMARK}else if(43360<=t&&t<=43388)return f.CLUSTER_BREAK.L}else if(t<43395){if(43392<=t&&t<=43394)return f.CLUSTER_BREAK.EXTEND}else{if(t===43395)return f.CLUSTER_BREAK.SPACINGMARK;if(t===43443)return f.CLUSTER_BREAK.EXTEND}else if(t<43450){if(t<43446){if(43444<=t&&t<=43445)return f.CLUSTER_BREAK.SPACINGMARK}else if(43446<=t&&t<=43449)return f.CLUSTER_BREAK.EXTEND}else if(t<43452){if(43450<=t&&t<=43451)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43454){if(43452<=t&&t<=43453)return f.CLUSTER_BREAK.EXTEND}else if(43454<=t&&t<=43456)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43573){if(t<43567){if(t<43561){if(t===43493)return f.CLUSTER_BREAK.EXTEND}else if(43561<=t&&t<=43566)return f.CLUSTER_BREAK.EXTEND}else if(t<43569){if(43567<=t&&t<=43568)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43571){if(43569<=t&&t<=43570)return f.CLUSTER_BREAK.EXTEND}else if(43571<=t&&t<=43572)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43597){if(t<43587){if(43573<=t&&t<=43574)return f.CLUSTER_BREAK.EXTEND}else if(t===43587||t===43596)return f.CLUSTER_BREAK.EXTEND}else if(t<43644){if(t===43597)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===43644||t===43696)return f.CLUSTER_BREAK.EXTEND}else if(t<44006){if(t<43756)if(t<43710){if(t<43703){if(43698<=t&&t<=43700)return f.CLUSTER_BREAK.EXTEND}else if(43703<=t&&t<=43704)return f.CLUSTER_BREAK.EXTEND}else if(t<43713){if(43710<=t&&t<=43711)return f.CLUSTER_BREAK.EXTEND}else{if(t===43713)return f.CLUSTER_BREAK.EXTEND;if(t===43755)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43766){if(t<43758){if(43756<=t&&t<=43757)return f.CLUSTER_BREAK.EXTEND}else if(t<43765){if(43758<=t&&t<=43759)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===43765)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<44003){if(t===43766)return f.CLUSTER_BREAK.EXTEND}else if(t<44005){if(44003<=t&&t<=44004)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===44005)return f.CLUSTER_BREAK.EXTEND}else if(t<44032)if(t<44009){if(t<44008){if(44006<=t&&t<=44007)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===44008)return f.CLUSTER_BREAK.EXTEND}else if(t<44012){if(44009<=t&&t<=44010)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===44012)return f.CLUSTER_BREAK.SPACINGMARK;if(t===44013)return f.CLUSTER_BREAK.EXTEND}else if(t<44061){if(t<44033){if(t===44032)return f.CLUSTER_BREAK.LV}else if(t<44060){if(44033<=t&&t<=44059)return f.CLUSTER_BREAK.LVT}else if(t===44060)return f.CLUSTER_BREAK.LV}else if(t<44088){if(44061<=t&&t<=44087)return f.CLUSTER_BREAK.LVT}else if(t<44089){if(t===44088)return f.CLUSTER_BREAK.LV}else if(44089<=t&&t<=44115)return f.CLUSTER_BREAK.LVT}else if(t<46497){if(t<45293){if(t<44704){if(t<44397){if(t<44256){if(t<44173){if(t<44144){if(t<44117){if(t===44116)return f.CLUSTER_BREAK.LV}else if(44117<=t&&t<=44143)return f.CLUSTER_BREAK.LVT}else if(t<44145){if(t===44144)return f.CLUSTER_BREAK.LV}else if(t<44172){if(44145<=t&&t<=44171)return f.CLUSTER_BREAK.LVT}else if(t===44172)return f.CLUSTER_BREAK.LV}else if(t<44201){if(t<44200){if(44173<=t&&t<=44199)return f.CLUSTER_BREAK.LVT}else if(t===44200)return f.CLUSTER_BREAK.LV}else if(t<44228){if(44201<=t&&t<=44227)return f.CLUSTER_BREAK.LVT}else if(t<44229){if(t===44228)return f.CLUSTER_BREAK.LV}else if(44229<=t&&t<=44255)return f.CLUSTER_BREAK.LVT}else if(t<44313){if(t<44284){if(t<44257){if(t===44256)return f.CLUSTER_BREAK.LV}else if(44257<=t&&t<=44283)return f.CLUSTER_BREAK.LVT}else if(t<44285){if(t===44284)return f.CLUSTER_BREAK.LV}else if(t<44312){if(44285<=t&&t<=44311)return f.CLUSTER_BREAK.LVT}else if(t===44312)return f.CLUSTER_BREAK.LV}else if(t<44368){if(t<44340){if(44313<=t&&t<=44339)return f.CLUSTER_BREAK.LVT}else if(t<44341){if(t===44340)return f.CLUSTER_BREAK.LV}else if(44341<=t&&t<=44367)return f.CLUSTER_BREAK.LVT}else if(t<44369){if(t===44368)return f.CLUSTER_BREAK.LV}else if(t<44396){if(44369<=t&&t<=44395)return f.CLUSTER_BREAK.LVT}else if(t===44396)return f.CLUSTER_BREAK.LV}else if(t<44537){if(t<44480){if(t<44425){if(t<44424){if(44397<=t&&t<=44423)return f.CLUSTER_BREAK.LVT}else if(t===44424)return f.CLUSTER_BREAK.LV}else if(t<44452){if(44425<=t&&t<=44451)return f.CLUSTER_BREAK.LVT}else if(t<44453){if(t===44452)return f.CLUSTER_BREAK.LV}else if(44453<=t&&t<=44479)return f.CLUSTER_BREAK.LVT}else if(t<44508){if(t<44481){if(t===44480)return f.CLUSTER_BREAK.LV}else if(44481<=t&&t<=44507)return f.CLUSTER_BREAK.LVT}else if(t<44509){if(t===44508)return f.CLUSTER_BREAK.LV}else if(t<44536){if(44509<=t&&t<=44535)return f.CLUSTER_BREAK.LVT}else if(t===44536)return f.CLUSTER_BREAK.LV}else if(t<44620){if(t<44565){if(t<44564){if(44537<=t&&t<=44563)return f.CLUSTER_BREAK.LVT}else if(t===44564)return f.CLUSTER_BREAK.LV}else if(t<44592){if(44565<=t&&t<=44591)return f.CLUSTER_BREAK.LVT}else if(t<44593){if(t===44592)return f.CLUSTER_BREAK.LV}else if(44593<=t&&t<=44619)return f.CLUSTER_BREAK.LVT}else if(t<44649){if(t<44621){if(t===44620)return f.CLUSTER_BREAK.LV}else if(t<44648){if(44621<=t&&t<=44647)return f.CLUSTER_BREAK.LVT}else if(t===44648)return f.CLUSTER_BREAK.LV}else if(t<44676){if(44649<=t&&t<=44675)return f.CLUSTER_BREAK.LVT}else if(t<44677){if(t===44676)return f.CLUSTER_BREAK.LV}else if(44677<=t&&t<=44703)return f.CLUSTER_BREAK.LVT}else if(t<44985){if(t<44844){if(t<44761){if(t<44732){if(t<44705){if(t===44704)return f.CLUSTER_BREAK.LV}else if(44705<=t&&t<=44731)return f.CLUSTER_BREAK.LVT}else if(t<44733){if(t===44732)return f.CLUSTER_BREAK.LV}else if(t<44760){if(44733<=t&&t<=44759)return f.CLUSTER_BREAK.LVT}else if(t===44760)return f.CLUSTER_BREAK.LV}else if(t<44789){if(t<44788){if(44761<=t&&t<=44787)return f.CLUSTER_BREAK.LVT}else if(t===44788)return f.CLUSTER_BREAK.LV}else if(t<44816){if(44789<=t&&t<=44815)return f.CLUSTER_BREAK.LVT}else if(t<44817){if(t===44816)return f.CLUSTER_BREAK.LV}else if(44817<=t&&t<=44843)return f.CLUSTER_BREAK.LVT}else if(t<44901){if(t<44872){if(t<44845){if(t===44844)return f.CLUSTER_BREAK.LV}else if(44845<=t&&t<=44871)return f.CLUSTER_BREAK.LVT}else if(t<44873){if(t===44872)return f.CLUSTER_BREAK.LV}else if(t<44900){if(44873<=t&&t<=44899)return f.CLUSTER_BREAK.LVT}else if(t===44900)return f.CLUSTER_BREAK.LV}else if(t<44956){if(t<44928){if(44901<=t&&t<=44927)return f.CLUSTER_BREAK.LVT}else if(t<44929){if(t===44928)return f.CLUSTER_BREAK.LV}else if(44929<=t&&t<=44955)return f.CLUSTER_BREAK.LVT}else if(t<44957){if(t===44956)return f.CLUSTER_BREAK.LV}else if(t<44984){if(44957<=t&&t<=44983)return f.CLUSTER_BREAK.LVT}else if(t===44984)return f.CLUSTER_BREAK.LV}else if(t<45152){if(t<45068){if(t<45013){if(t<45012){if(44985<=t&&t<=45011)return f.CLUSTER_BREAK.LVT}else if(t===45012)return f.CLUSTER_BREAK.LV}else if(t<45040){if(45013<=t&&t<=45039)return f.CLUSTER_BREAK.LVT}else if(t<45041){if(t===45040)return f.CLUSTER_BREAK.LV}else if(45041<=t&&t<=45067)return f.CLUSTER_BREAK.LVT}else if(t<45097){if(t<45069){if(t===45068)return f.CLUSTER_BREAK.LV}else if(t<45096){if(45069<=t&&t<=45095)return f.CLUSTER_BREAK.LVT}else if(t===45096)return f.CLUSTER_BREAK.LV}else if(t<45124){if(45097<=t&&t<=45123)return f.CLUSTER_BREAK.LVT}else if(t<45125){if(t===45124)return f.CLUSTER_BREAK.LV}else if(45125<=t&&t<=45151)return f.CLUSTER_BREAK.LVT}else if(t<45209){if(t<45180){if(t<45153){if(t===45152)return f.CLUSTER_BREAK.LV}else if(45153<=t&&t<=45179)return f.CLUSTER_BREAK.LVT}else if(t<45181){if(t===45180)return f.CLUSTER_BREAK.LV}else if(t<45208){if(45181<=t&&t<=45207)return f.CLUSTER_BREAK.LVT}else if(t===45208)return f.CLUSTER_BREAK.LV}else if(t<45264){if(t<45236){if(45209<=t&&t<=45235)return f.CLUSTER_BREAK.LVT}else if(t<45237){if(t===45236)return f.CLUSTER_BREAK.LV}else if(45237<=t&&t<=45263)return f.CLUSTER_BREAK.LVT}else if(t<45265){if(t===45264)return f.CLUSTER_BREAK.LV}else if(t<45292){if(45265<=t&&t<=45291)return f.CLUSTER_BREAK.LVT}else if(t===45292)return f.CLUSTER_BREAK.LV}else if(t<45908){if(t<45600){if(t<45433){if(t<45376){if(t<45321){if(t<45320){if(45293<=t&&t<=45319)return f.CLUSTER_BREAK.LVT}else if(t===45320)return f.CLUSTER_BREAK.LV}else if(t<45348){if(45321<=t&&t<=45347)return f.CLUSTER_BREAK.LVT}else if(t<45349){if(t===45348)return f.CLUSTER_BREAK.LV}else if(45349<=t&&t<=45375)return f.CLUSTER_BREAK.LVT}else if(t<45404){if(t<45377){if(t===45376)return f.CLUSTER_BREAK.LV}else if(45377<=t&&t<=45403)return f.CLUSTER_BREAK.LVT}else if(t<45405){if(t===45404)return f.CLUSTER_BREAK.LV}else if(t<45432){if(45405<=t&&t<=45431)return f.CLUSTER_BREAK.LVT}else if(t===45432)return f.CLUSTER_BREAK.LV}else if(t<45516){if(t<45461){if(t<45460){if(45433<=t&&t<=45459)return f.CLUSTER_BREAK.LVT}else if(t===45460)return f.CLUSTER_BREAK.LV}else if(t<45488){if(45461<=t&&t<=45487)return f.CLUSTER_BREAK.LVT}else if(t<45489){if(t===45488)return f.CLUSTER_BREAK.LV}else if(45489<=t&&t<=45515)return f.CLUSTER_BREAK.LVT}else if(t<45545){if(t<45517){if(t===45516)return f.CLUSTER_BREAK.LV}else if(t<45544){if(45517<=t&&t<=45543)return f.CLUSTER_BREAK.LVT}else if(t===45544)return f.CLUSTER_BREAK.LV}else if(t<45572){if(45545<=t&&t<=45571)return f.CLUSTER_BREAK.LVT}else if(t<45573){if(t===45572)return f.CLUSTER_BREAK.LV}else if(45573<=t&&t<=45599)return f.CLUSTER_BREAK.LVT}else if(t<45741){if(t<45657){if(t<45628){if(t<45601){if(t===45600)return f.CLUSTER_BREAK.LV}else if(45601<=t&&t<=45627)return f.CLUSTER_BREAK.LVT}else if(t<45629){if(t===45628)return f.CLUSTER_BREAK.LV}else if(t<45656){if(45629<=t&&t<=45655)return f.CLUSTER_BREAK.LVT}else if(t===45656)return f.CLUSTER_BREAK.LV}else if(t<45712){if(t<45684){if(45657<=t&&t<=45683)return f.CLUSTER_BREAK.LVT}else if(t<45685){if(t===45684)return f.CLUSTER_BREAK.LV}else if(45685<=t&&t<=45711)return f.CLUSTER_BREAK.LVT}else if(t<45713){if(t===45712)return f.CLUSTER_BREAK.LV}else if(t<45740){if(45713<=t&&t<=45739)return f.CLUSTER_BREAK.LVT}else if(t===45740)return f.CLUSTER_BREAK.LV}else if(t<45824){if(t<45769){if(t<45768){if(45741<=t&&t<=45767)return f.CLUSTER_BREAK.LVT}else if(t===45768)return f.CLUSTER_BREAK.LV}else if(t<45796){if(45769<=t&&t<=45795)return f.CLUSTER_BREAK.LVT}else if(t<45797){if(t===45796)return f.CLUSTER_BREAK.LV}else if(45797<=t&&t<=45823)return f.CLUSTER_BREAK.LVT}else if(t<45853){if(t<45825){if(t===45824)return f.CLUSTER_BREAK.LV}else if(t<45852){if(45825<=t&&t<=45851)return f.CLUSTER_BREAK.LVT}else if(t===45852)return f.CLUSTER_BREAK.LV}else if(t<45880){if(45853<=t&&t<=45879)return f.CLUSTER_BREAK.LVT}else if(t<45881){if(t===45880)return f.CLUSTER_BREAK.LV}else if(45881<=t&&t<=45907)return f.CLUSTER_BREAK.LVT}else if(t<46189){if(t<46048){if(t<45965){if(t<45936){if(t<45909){if(t===45908)return f.CLUSTER_BREAK.LV}else if(45909<=t&&t<=45935)return f.CLUSTER_BREAK.LVT}else if(t<45937){if(t===45936)return f.CLUSTER_BREAK.LV}else if(t<45964){if(45937<=t&&t<=45963)return f.CLUSTER_BREAK.LVT}else if(t===45964)return f.CLUSTER_BREAK.LV}else if(t<45993){if(t<45992){if(45965<=t&&t<=45991)return f.CLUSTER_BREAK.LVT}else if(t===45992)return f.CLUSTER_BREAK.LV}else if(t<46020){if(45993<=t&&t<=46019)return f.CLUSTER_BREAK.LVT}else if(t<46021){if(t===46020)return f.CLUSTER_BREAK.LV}else if(46021<=t&&t<=46047)return f.CLUSTER_BREAK.LVT}else if(t<46105){if(t<46076){if(t<46049){if(t===46048)return f.CLUSTER_BREAK.LV}else if(46049<=t&&t<=46075)return f.CLUSTER_BREAK.LVT}else if(t<46077){if(t===46076)return f.CLUSTER_BREAK.LV}else if(t<46104){if(46077<=t&&t<=46103)return f.CLUSTER_BREAK.LVT}else if(t===46104)return f.CLUSTER_BREAK.LV}else if(t<46160){if(t<46132){if(46105<=t&&t<=46131)return f.CLUSTER_BREAK.LVT}else if(t<46133){if(t===46132)return f.CLUSTER_BREAK.LV}else if(46133<=t&&t<=46159)return f.CLUSTER_BREAK.LVT}else if(t<46161){if(t===46160)return f.CLUSTER_BREAK.LV}else if(t<46188){if(46161<=t&&t<=46187)return f.CLUSTER_BREAK.LVT}else if(t===46188)return f.CLUSTER_BREAK.LV}else if(t<46356){if(t<46272){if(t<46217){if(t<46216){if(46189<=t&&t<=46215)return f.CLUSTER_BREAK.LVT}else if(t===46216)return f.CLUSTER_BREAK.LV}else if(t<46244){if(46217<=t&&t<=46243)return f.CLUSTER_BREAK.LVT}else if(t<46245){if(t===46244)return f.CLUSTER_BREAK.LV}else if(46245<=t&&t<=46271)return f.CLUSTER_BREAK.LVT}else if(t<46301){if(t<46273){if(t===46272)return f.CLUSTER_BREAK.LV}else if(t<46300){if(46273<=t&&t<=46299)return f.CLUSTER_BREAK.LVT}else if(t===46300)return f.CLUSTER_BREAK.LV}else if(t<46328){if(46301<=t&&t<=46327)return f.CLUSTER_BREAK.LVT}else if(t<46329){if(t===46328)return f.CLUSTER_BREAK.LV}else if(46329<=t&&t<=46355)return f.CLUSTER_BREAK.LVT}else if(t<46413){if(t<46384){if(t<46357){if(t===46356)return f.CLUSTER_BREAK.LV}else if(46357<=t&&t<=46383)return f.CLUSTER_BREAK.LVT}else if(t<46385){if(t===46384)return f.CLUSTER_BREAK.LV}else if(t<46412){if(46385<=t&&t<=46411)return f.CLUSTER_BREAK.LVT}else if(t===46412)return f.CLUSTER_BREAK.LV}else if(t<46468){if(t<46440){if(46413<=t&&t<=46439)return f.CLUSTER_BREAK.LVT}else if(t<46441){if(t===46440)return f.CLUSTER_BREAK.LV}else if(46441<=t&&t<=46467)return f.CLUSTER_BREAK.LVT}else if(t<46469){if(t===46468)return f.CLUSTER_BREAK.LV}else if(t<46496){if(46469<=t&&t<=46495)return f.CLUSTER_BREAK.LVT}else if(t===46496)return f.CLUSTER_BREAK.LV}else if(t<47701){if(t<47112){if(t<46804){if(t<46637){if(t<46580){if(t<46525){if(t<46524){if(46497<=t&&t<=46523)return f.CLUSTER_BREAK.LVT}else if(t===46524)return f.CLUSTER_BREAK.LV}else if(t<46552){if(46525<=t&&t<=46551)return f.CLUSTER_BREAK.LVT}else if(t<46553){if(t===46552)return f.CLUSTER_BREAK.LV}else if(46553<=t&&t<=46579)return f.CLUSTER_BREAK.LVT}else if(t<46608){if(t<46581){if(t===46580)return f.CLUSTER_BREAK.LV}else if(46581<=t&&t<=46607)return f.CLUSTER_BREAK.LVT}else if(t<46609){if(t===46608)return f.CLUSTER_BREAK.LV}else if(t<46636){if(46609<=t&&t<=46635)return f.CLUSTER_BREAK.LVT}else if(t===46636)return f.CLUSTER_BREAK.LV}else if(t<46720){if(t<46665){if(t<46664){if(46637<=t&&t<=46663)return f.CLUSTER_BREAK.LVT}else if(t===46664)return f.CLUSTER_BREAK.LV}else if(t<46692){if(46665<=t&&t<=46691)return f.CLUSTER_BREAK.LVT}else if(t<46693){if(t===46692)return f.CLUSTER_BREAK.LV}else if(46693<=t&&t<=46719)return f.CLUSTER_BREAK.LVT}else if(t<46749){if(t<46721){if(t===46720)return f.CLUSTER_BREAK.LV}else if(t<46748){if(46721<=t&&t<=46747)return f.CLUSTER_BREAK.LVT}else if(t===46748)return f.CLUSTER_BREAK.LV}else if(t<46776){if(46749<=t&&t<=46775)return f.CLUSTER_BREAK.LVT}else if(t<46777){if(t===46776)return f.CLUSTER_BREAK.LV}else if(46777<=t&&t<=46803)return f.CLUSTER_BREAK.LVT}else if(t<46945){if(t<46861){if(t<46832){if(t<46805){if(t===46804)return f.CLUSTER_BREAK.LV}else if(46805<=t&&t<=46831)return f.CLUSTER_BREAK.LVT}else if(t<46833){if(t===46832)return f.CLUSTER_BREAK.LV}else if(t<46860){if(46833<=t&&t<=46859)return f.CLUSTER_BREAK.LVT}else if(t===46860)return f.CLUSTER_BREAK.LV}else if(t<46916){if(t<46888){if(46861<=t&&t<=46887)return f.CLUSTER_BREAK.LVT}else if(t<46889){if(t===46888)return f.CLUSTER_BREAK.LV}else if(46889<=t&&t<=46915)return f.CLUSTER_BREAK.LVT}else if(t<46917){if(t===46916)return f.CLUSTER_BREAK.LV}else if(t<46944){if(46917<=t&&t<=46943)return f.CLUSTER_BREAK.LVT}else if(t===46944)return f.CLUSTER_BREAK.LV}else if(t<47028){if(t<46973){if(t<46972){if(46945<=t&&t<=46971)return f.CLUSTER_BREAK.LVT}else if(t===46972)return f.CLUSTER_BREAK.LV}else if(t<47e3){if(46973<=t&&t<=46999)return f.CLUSTER_BREAK.LVT}else if(t<47001){if(t===47e3)return f.CLUSTER_BREAK.LV}else if(47001<=t&&t<=47027)return f.CLUSTER_BREAK.LVT}else if(t<47057){if(t<47029){if(t===47028)return f.CLUSTER_BREAK.LV}else if(t<47056){if(47029<=t&&t<=47055)return f.CLUSTER_BREAK.LVT}else if(t===47056)return f.CLUSTER_BREAK.LV}else if(t<47084){if(47057<=t&&t<=47083)return f.CLUSTER_BREAK.LVT}else if(t<47085){if(t===47084)return f.CLUSTER_BREAK.LV}else if(47085<=t&&t<=47111)return f.CLUSTER_BREAK.LVT}else if(t<47393){if(t<47252){if(t<47169){if(t<47140){if(t<47113){if(t===47112)return f.CLUSTER_BREAK.LV}else if(47113<=t&&t<=47139)return f.CLUSTER_BREAK.LVT}else if(t<47141){if(t===47140)return f.CLUSTER_BREAK.LV}else if(t<47168){if(47141<=t&&t<=47167)return f.CLUSTER_BREAK.LVT}else if(t===47168)return f.CLUSTER_BREAK.LV}else if(t<47197){if(t<47196){if(47169<=t&&t<=47195)return f.CLUSTER_BREAK.LVT}else if(t===47196)return f.CLUSTER_BREAK.LV}else if(t<47224){if(47197<=t&&t<=47223)return f.CLUSTER_BREAK.LVT}else if(t<47225){if(t===47224)return f.CLUSTER_BREAK.LV}else if(47225<=t&&t<=47251)return f.CLUSTER_BREAK.LVT}else if(t<47309){if(t<47280){if(t<47253){if(t===47252)return f.CLUSTER_BREAK.LV}else if(47253<=t&&t<=47279)return f.CLUSTER_BREAK.LVT}else if(t<47281){if(t===47280)return f.CLUSTER_BREAK.LV}else if(t<47308){if(47281<=t&&t<=47307)return f.CLUSTER_BREAK.LVT}else if(t===47308)return f.CLUSTER_BREAK.LV}else if(t<47364){if(t<47336){if(47309<=t&&t<=47335)return f.CLUSTER_BREAK.LVT}else if(t<47337){if(t===47336)return f.CLUSTER_BREAK.LV}else if(47337<=t&&t<=47363)return f.CLUSTER_BREAK.LVT}else if(t<47365){if(t===47364)return f.CLUSTER_BREAK.LV}else if(t<47392){if(47365<=t&&t<=47391)return f.CLUSTER_BREAK.LVT}else if(t===47392)return f.CLUSTER_BREAK.LV}else if(t<47560){if(t<47476){if(t<47421){if(t<47420){if(47393<=t&&t<=47419)return f.CLUSTER_BREAK.LVT}else if(t===47420)return f.CLUSTER_BREAK.LV}else if(t<47448){if(47421<=t&&t<=47447)return f.CLUSTER_BREAK.LVT}else if(t<47449){if(t===47448)return f.CLUSTER_BREAK.LV}else if(47449<=t&&t<=47475)return f.CLUSTER_BREAK.LVT}else if(t<47505){if(t<47477){if(t===47476)return f.CLUSTER_BREAK.LV}else if(t<47504){if(47477<=t&&t<=47503)return f.CLUSTER_BREAK.LVT}else if(t===47504)return f.CLUSTER_BREAK.LV}else if(t<47532){if(47505<=t&&t<=47531)return f.CLUSTER_BREAK.LVT}else if(t<47533){if(t===47532)return f.CLUSTER_BREAK.LV}else if(47533<=t&&t<=47559)return f.CLUSTER_BREAK.LVT}else if(t<47617){if(t<47588){if(t<47561){if(t===47560)return f.CLUSTER_BREAK.LV}else if(47561<=t&&t<=47587)return f.CLUSTER_BREAK.LVT}else if(t<47589){if(t===47588)return f.CLUSTER_BREAK.LV}else if(t<47616){if(47589<=t&&t<=47615)return f.CLUSTER_BREAK.LVT}else if(t===47616)return f.CLUSTER_BREAK.LV}else if(t<47672){if(t<47644){if(47617<=t&&t<=47643)return f.CLUSTER_BREAK.LVT}else if(t<47645){if(t===47644)return f.CLUSTER_BREAK.LV}else if(47645<=t&&t<=47671)return f.CLUSTER_BREAK.LVT}else if(t<47673){if(t===47672)return f.CLUSTER_BREAK.LV}else if(t<47700){if(47673<=t&&t<=47699)return f.CLUSTER_BREAK.LVT}else if(t===47700)return f.CLUSTER_BREAK.LV}else if(t<48316){if(t<48008){if(t<47841){if(t<47784){if(t<47729){if(t<47728){if(47701<=t&&t<=47727)return f.CLUSTER_BREAK.LVT}else if(t===47728)return f.CLUSTER_BREAK.LV}else if(t<47756){if(47729<=t&&t<=47755)return f.CLUSTER_BREAK.LVT}else if(t<47757){if(t===47756)return f.CLUSTER_BREAK.LV}else if(47757<=t&&t<=47783)return f.CLUSTER_BREAK.LVT}else if(t<47812){if(t<47785){if(t===47784)return f.CLUSTER_BREAK.LV}else if(47785<=t&&t<=47811)return f.CLUSTER_BREAK.LVT}else if(t<47813){if(t===47812)return f.CLUSTER_BREAK.LV}else if(t<47840){if(47813<=t&&t<=47839)return f.CLUSTER_BREAK.LVT}else if(t===47840)return f.CLUSTER_BREAK.LV}else if(t<47924){if(t<47869){if(t<47868){if(47841<=t&&t<=47867)return f.CLUSTER_BREAK.LVT}else if(t===47868)return f.CLUSTER_BREAK.LV}else if(t<47896){if(47869<=t&&t<=47895)return f.CLUSTER_BREAK.LVT}else if(t<47897){if(t===47896)return f.CLUSTER_BREAK.LV}else if(47897<=t&&t<=47923)return f.CLUSTER_BREAK.LVT}else if(t<47953){if(t<47925){if(t===47924)return f.CLUSTER_BREAK.LV}else if(t<47952){if(47925<=t&&t<=47951)return f.CLUSTER_BREAK.LVT}else if(t===47952)return f.CLUSTER_BREAK.LV}else if(t<47980){if(47953<=t&&t<=47979)return f.CLUSTER_BREAK.LVT}else if(t<47981){if(t===47980)return f.CLUSTER_BREAK.LV}else if(47981<=t&&t<=48007)return f.CLUSTER_BREAK.LVT}else if(t<48149){if(t<48065){if(t<48036){if(t<48009){if(t===48008)return f.CLUSTER_BREAK.LV}else if(48009<=t&&t<=48035)return f.CLUSTER_BREAK.LVT}else if(t<48037){if(t===48036)return f.CLUSTER_BREAK.LV}else if(t<48064){if(48037<=t&&t<=48063)return f.CLUSTER_BREAK.LVT}else if(t===48064)return f.CLUSTER_BREAK.LV}else if(t<48120){if(t<48092){if(48065<=t&&t<=48091)return f.CLUSTER_BREAK.LVT}else if(t<48093){if(t===48092)return f.CLUSTER_BREAK.LV}else if(48093<=t&&t<=48119)return f.CLUSTER_BREAK.LVT}else if(t<48121){if(t===48120)return f.CLUSTER_BREAK.LV}else if(t<48148){if(48121<=t&&t<=48147)return f.CLUSTER_BREAK.LVT}else if(t===48148)return f.CLUSTER_BREAK.LV}else if(t<48232){if(t<48177){if(t<48176){if(48149<=t&&t<=48175)return f.CLUSTER_BREAK.LVT}else if(t===48176)return f.CLUSTER_BREAK.LV}else if(t<48204){if(48177<=t&&t<=48203)return f.CLUSTER_BREAK.LVT}else if(t<48205){if(t===48204)return f.CLUSTER_BREAK.LV}else if(48205<=t&&t<=48231)return f.CLUSTER_BREAK.LVT}else if(t<48261){if(t<48233){if(t===48232)return f.CLUSTER_BREAK.LV}else if(t<48260){if(48233<=t&&t<=48259)return f.CLUSTER_BREAK.LVT}else if(t===48260)return f.CLUSTER_BREAK.LV}else if(t<48288){if(48261<=t&&t<=48287)return f.CLUSTER_BREAK.LVT}else if(t<48289){if(t===48288)return f.CLUSTER_BREAK.LV}else if(48289<=t&&t<=48315)return f.CLUSTER_BREAK.LVT}else if(t<48597){if(t<48456){if(t<48373){if(t<48344){if(t<48317){if(t===48316)return f.CLUSTER_BREAK.LV}else if(48317<=t&&t<=48343)return f.CLUSTER_BREAK.LVT}else if(t<48345){if(t===48344)return f.CLUSTER_BREAK.LV}else if(t<48372){if(48345<=t&&t<=48371)return f.CLUSTER_BREAK.LVT}else if(t===48372)return f.CLUSTER_BREAK.LV}else if(t<48401){if(t<48400){if(48373<=t&&t<=48399)return f.CLUSTER_BREAK.LVT}else if(t===48400)return f.CLUSTER_BREAK.LV}else if(t<48428){if(48401<=t&&t<=48427)return f.CLUSTER_BREAK.LVT}else if(t<48429){if(t===48428)return f.CLUSTER_BREAK.LV}else if(48429<=t&&t<=48455)return f.CLUSTER_BREAK.LVT}else if(t<48513){if(t<48484){if(t<48457){if(t===48456)return f.CLUSTER_BREAK.LV}else if(48457<=t&&t<=48483)return f.CLUSTER_BREAK.LVT}else if(t<48485){if(t===48484)return f.CLUSTER_BREAK.LV}else if(t<48512){if(48485<=t&&t<=48511)return f.CLUSTER_BREAK.LVT}else if(t===48512)return f.CLUSTER_BREAK.LV}else if(t<48568){if(t<48540){if(48513<=t&&t<=48539)return f.CLUSTER_BREAK.LVT}else if(t<48541){if(t===48540)return f.CLUSTER_BREAK.LV}else if(48541<=t&&t<=48567)return f.CLUSTER_BREAK.LVT}else if(t<48569){if(t===48568)return f.CLUSTER_BREAK.LV}else if(t<48596){if(48569<=t&&t<=48595)return f.CLUSTER_BREAK.LVT}else if(t===48596)return f.CLUSTER_BREAK.LV}else if(t<48764){if(t<48680){if(t<48625){if(t<48624){if(48597<=t&&t<=48623)return f.CLUSTER_BREAK.LVT}else if(t===48624)return f.CLUSTER_BREAK.LV}else if(t<48652){if(48625<=t&&t<=48651)return f.CLUSTER_BREAK.LVT}else if(t<48653){if(t===48652)return f.CLUSTER_BREAK.LV}else if(48653<=t&&t<=48679)return f.CLUSTER_BREAK.LVT}else if(t<48709){if(t<48681){if(t===48680)return f.CLUSTER_BREAK.LV}else if(t<48708){if(48681<=t&&t<=48707)return f.CLUSTER_BREAK.LVT}else if(t===48708)return f.CLUSTER_BREAK.LV}else if(t<48736){if(48709<=t&&t<=48735)return f.CLUSTER_BREAK.LVT}else if(t<48737){if(t===48736)return f.CLUSTER_BREAK.LV}else if(48737<=t&&t<=48763)return f.CLUSTER_BREAK.LVT}else if(t<48821){if(t<48792){if(t<48765){if(t===48764)return f.CLUSTER_BREAK.LV}else if(48765<=t&&t<=48791)return f.CLUSTER_BREAK.LVT}else if(t<48793){if(t===48792)return f.CLUSTER_BREAK.LV}else if(t<48820){if(48793<=t&&t<=48819)return f.CLUSTER_BREAK.LVT}else if(t===48820)return f.CLUSTER_BREAK.LV}else if(t<48876){if(t<48848){if(48821<=t&&t<=48847)return f.CLUSTER_BREAK.LVT}else if(t<48849){if(t===48848)return f.CLUSTER_BREAK.LV}else if(48849<=t&&t<=48875)return f.CLUSTER_BREAK.LVT}else if(t<48877){if(t===48876)return f.CLUSTER_BREAK.LV}else if(t<48904){if(48877<=t&&t<=48903)return f.CLUSTER_BREAK.LVT}else if(t===48904)return f.CLUSTER_BREAK.LV}else if(t<53720){if(t<51312){if(t<50108){if(t<49493){if(t<49212){if(t<49045){if(t<48988){if(t<48933){if(t<48932){if(48905<=t&&t<=48931)return f.CLUSTER_BREAK.LVT}else if(t===48932)return f.CLUSTER_BREAK.LV}else if(t<48960){if(48933<=t&&t<=48959)return f.CLUSTER_BREAK.LVT}else if(t<48961){if(t===48960)return f.CLUSTER_BREAK.LV}else if(48961<=t&&t<=48987)return f.CLUSTER_BREAK.LVT}else if(t<49016){if(t<48989){if(t===48988)return f.CLUSTER_BREAK.LV}else if(48989<=t&&t<=49015)return f.CLUSTER_BREAK.LVT}else if(t<49017){if(t===49016)return f.CLUSTER_BREAK.LV}else if(t<49044){if(49017<=t&&t<=49043)return f.CLUSTER_BREAK.LVT}else if(t===49044)return f.CLUSTER_BREAK.LV}else if(t<49128){if(t<49073){if(t<49072){if(49045<=t&&t<=49071)return f.CLUSTER_BREAK.LVT}else if(t===49072)return f.CLUSTER_BREAK.LV}else if(t<49100){if(49073<=t&&t<=49099)return f.CLUSTER_BREAK.LVT}else if(t<49101){if(t===49100)return f.CLUSTER_BREAK.LV}else if(49101<=t&&t<=49127)return f.CLUSTER_BREAK.LVT}else if(t<49157){if(t<49129){if(t===49128)return f.CLUSTER_BREAK.LV}else if(t<49156){if(49129<=t&&t<=49155)return f.CLUSTER_BREAK.LVT}else if(t===49156)return f.CLUSTER_BREAK.LV}else if(t<49184){if(49157<=t&&t<=49183)return f.CLUSTER_BREAK.LVT}else if(t<49185){if(t===49184)return f.CLUSTER_BREAK.LV}else if(49185<=t&&t<=49211)return f.CLUSTER_BREAK.LVT}else if(t<49352){if(t<49269){if(t<49240){if(t<49213){if(t===49212)return f.CLUSTER_BREAK.LV}else if(49213<=t&&t<=49239)return f.CLUSTER_BREAK.LVT}else if(t<49241){if(t===49240)return f.CLUSTER_BREAK.LV}else if(t<49268){if(49241<=t&&t<=49267)return f.CLUSTER_BREAK.LVT}else if(t===49268)return f.CLUSTER_BREAK.LV}else if(t<49297){if(t<49296){if(49269<=t&&t<=49295)return f.CLUSTER_BREAK.LVT}else if(t===49296)return f.CLUSTER_BREAK.LV}else if(t<49324){if(49297<=t&&t<=49323)return f.CLUSTER_BREAK.LVT}else if(t<49325){if(t===49324)return f.CLUSTER_BREAK.LV}else if(49325<=t&&t<=49351)return f.CLUSTER_BREAK.LVT}else if(t<49409){if(t<49380){if(t<49353){if(t===49352)return f.CLUSTER_BREAK.LV}else if(49353<=t&&t<=49379)return f.CLUSTER_BREAK.LVT}else if(t<49381){if(t===49380)return f.CLUSTER_BREAK.LV}else if(t<49408){if(49381<=t&&t<=49407)return f.CLUSTER_BREAK.LVT}else if(t===49408)return f.CLUSTER_BREAK.LV}else if(t<49464){if(t<49436){if(49409<=t&&t<=49435)return f.CLUSTER_BREAK.LVT}else if(t<49437){if(t===49436)return f.CLUSTER_BREAK.LV}else if(49437<=t&&t<=49463)return f.CLUSTER_BREAK.LVT}else if(t<49465){if(t===49464)return f.CLUSTER_BREAK.LV}else if(t<49492){if(49465<=t&&t<=49491)return f.CLUSTER_BREAK.LVT}else if(t===49492)return f.CLUSTER_BREAK.LV}else if(t<49800){if(t<49633){if(t<49576){if(t<49521){if(t<49520){if(49493<=t&&t<=49519)return f.CLUSTER_BREAK.LVT}else if(t===49520)return f.CLUSTER_BREAK.LV}else if(t<49548){if(49521<=t&&t<=49547)return f.CLUSTER_BREAK.LVT}else if(t<49549){if(t===49548)return f.CLUSTER_BREAK.LV}else if(49549<=t&&t<=49575)return f.CLUSTER_BREAK.LVT}else if(t<49604){if(t<49577){if(t===49576)return f.CLUSTER_BREAK.LV}else if(49577<=t&&t<=49603)return f.CLUSTER_BREAK.LVT}else if(t<49605){if(t===49604)return f.CLUSTER_BREAK.LV}else if(t<49632){if(49605<=t&&t<=49631)return f.CLUSTER_BREAK.LVT}else if(t===49632)return f.CLUSTER_BREAK.LV}else if(t<49716){if(t<49661){if(t<49660){if(49633<=t&&t<=49659)return f.CLUSTER_BREAK.LVT}else if(t===49660)return f.CLUSTER_BREAK.LV}else if(t<49688){if(49661<=t&&t<=49687)return f.CLUSTER_BREAK.LVT}else if(t<49689){if(t===49688)return f.CLUSTER_BREAK.LV}else if(49689<=t&&t<=49715)return f.CLUSTER_BREAK.LVT}else if(t<49745){if(t<49717){if(t===49716)return f.CLUSTER_BREAK.LV}else if(t<49744){if(49717<=t&&t<=49743)return f.CLUSTER_BREAK.LVT}else if(t===49744)return f.CLUSTER_BREAK.LV}else if(t<49772){if(49745<=t&&t<=49771)return f.CLUSTER_BREAK.LVT}else if(t<49773){if(t===49772)return f.CLUSTER_BREAK.LV}else if(49773<=t&&t<=49799)return f.CLUSTER_BREAK.LVT}else if(t<49941){if(t<49857){if(t<49828){if(t<49801){if(t===49800)return f.CLUSTER_BREAK.LV}else if(49801<=t&&t<=49827)return f.CLUSTER_BREAK.LVT}else if(t<49829){if(t===49828)return f.CLUSTER_BREAK.LV}else if(t<49856){if(49829<=t&&t<=49855)return f.CLUSTER_BREAK.LVT}else if(t===49856)return f.CLUSTER_BREAK.LV}else if(t<49912){if(t<49884){if(49857<=t&&t<=49883)return f.CLUSTER_BREAK.LVT}else if(t<49885){if(t===49884)return f.CLUSTER_BREAK.LV}else if(49885<=t&&t<=49911)return f.CLUSTER_BREAK.LVT}else if(t<49913){if(t===49912)return f.CLUSTER_BREAK.LV}else if(t<49940){if(49913<=t&&t<=49939)return f.CLUSTER_BREAK.LVT}else if(t===49940)return f.CLUSTER_BREAK.LV}else if(t<50024){if(t<49969){if(t<49968){if(49941<=t&&t<=49967)return f.CLUSTER_BREAK.LVT}else if(t===49968)return f.CLUSTER_BREAK.LV}else if(t<49996){if(49969<=t&&t<=49995)return f.CLUSTER_BREAK.LVT}else if(t<49997){if(t===49996)return f.CLUSTER_BREAK.LV}else if(49997<=t&&t<=50023)return f.CLUSTER_BREAK.LVT}else if(t<50053){if(t<50025){if(t===50024)return f.CLUSTER_BREAK.LV}else if(t<50052){if(50025<=t&&t<=50051)return f.CLUSTER_BREAK.LVT}else if(t===50052)return f.CLUSTER_BREAK.LV}else if(t<50080){if(50053<=t&&t<=50079)return f.CLUSTER_BREAK.LVT}else if(t<50081){if(t===50080)return f.CLUSTER_BREAK.LV}else if(50081<=t&&t<=50107)return f.CLUSTER_BREAK.LVT}else if(t<50697){if(t<50389){if(t<50248){if(t<50165){if(t<50136){if(t<50109){if(t===50108)return f.CLUSTER_BREAK.LV}else if(50109<=t&&t<=50135)return f.CLUSTER_BREAK.LVT}else if(t<50137){if(t===50136)return f.CLUSTER_BREAK.LV}else if(t<50164){if(50137<=t&&t<=50163)return f.CLUSTER_BREAK.LVT}else if(t===50164)return f.CLUSTER_BREAK.LV}else if(t<50193){if(t<50192){if(50165<=t&&t<=50191)return f.CLUSTER_BREAK.LVT}else if(t===50192)return f.CLUSTER_BREAK.LV}else if(t<50220){if(50193<=t&&t<=50219)return f.CLUSTER_BREAK.LVT}else if(t<50221){if(t===50220)return f.CLUSTER_BREAK.LV}else if(50221<=t&&t<=50247)return f.CLUSTER_BREAK.LVT}else if(t<50305){if(t<50276){if(t<50249){if(t===50248)return f.CLUSTER_BREAK.LV}else if(50249<=t&&t<=50275)return f.CLUSTER_BREAK.LVT}else if(t<50277){if(t===50276)return f.CLUSTER_BREAK.LV}else if(t<50304){if(50277<=t&&t<=50303)return f.CLUSTER_BREAK.LVT}else if(t===50304)return f.CLUSTER_BREAK.LV}else if(t<50360){if(t<50332){if(50305<=t&&t<=50331)return f.CLUSTER_BREAK.LVT}else if(t<50333){if(t===50332)return f.CLUSTER_BREAK.LV}else if(50333<=t&&t<=50359)return f.CLUSTER_BREAK.LVT}else if(t<50361){if(t===50360)return f.CLUSTER_BREAK.LV}else if(t<50388){if(50361<=t&&t<=50387)return f.CLUSTER_BREAK.LVT}else if(t===50388)return f.CLUSTER_BREAK.LV}else if(t<50556){if(t<50472){if(t<50417){if(t<50416){if(50389<=t&&t<=50415)return f.CLUSTER_BREAK.LVT}else if(t===50416)return f.CLUSTER_BREAK.LV}else if(t<50444){if(50417<=t&&t<=50443)return f.CLUSTER_BREAK.LVT}else if(t<50445){if(t===50444)return f.CLUSTER_BREAK.LV}else if(50445<=t&&t<=50471)return f.CLUSTER_BREAK.LVT}else if(t<50501){if(t<50473){if(t===50472)return f.CLUSTER_BREAK.LV}else if(t<50500){if(50473<=t&&t<=50499)return f.CLUSTER_BREAK.LVT}else if(t===50500)return f.CLUSTER_BREAK.LV}else if(t<50528){if(50501<=t&&t<=50527)return f.CLUSTER_BREAK.LVT}else if(t<50529){if(t===50528)return f.CLUSTER_BREAK.LV}else if(50529<=t&&t<=50555)return f.CLUSTER_BREAK.LVT}else if(t<50613){if(t<50584){if(t<50557){if(t===50556)return f.CLUSTER_BREAK.LV}else if(50557<=t&&t<=50583)return f.CLUSTER_BREAK.LVT}else if(t<50585){if(t===50584)return f.CLUSTER_BREAK.LV}else if(t<50612){if(50585<=t&&t<=50611)return f.CLUSTER_BREAK.LVT}else if(t===50612)return f.CLUSTER_BREAK.LV}else if(t<50668){if(t<50640){if(50613<=t&&t<=50639)return f.CLUSTER_BREAK.LVT}else if(t<50641){if(t===50640)return f.CLUSTER_BREAK.LV}else if(50641<=t&&t<=50667)return f.CLUSTER_BREAK.LVT}else if(t<50669){if(t===50668)return f.CLUSTER_BREAK.LV}else if(t<50696){if(50669<=t&&t<=50695)return f.CLUSTER_BREAK.LVT}else if(t===50696)return f.CLUSTER_BREAK.LV}else if(t<51004){if(t<50837){if(t<50780){if(t<50725){if(t<50724){if(50697<=t&&t<=50723)return f.CLUSTER_BREAK.LVT}else if(t===50724)return f.CLUSTER_BREAK.LV}else if(t<50752){if(50725<=t&&t<=50751)return f.CLUSTER_BREAK.LVT}else if(t<50753){if(t===50752)return f.CLUSTER_BREAK.LV}else if(50753<=t&&t<=50779)return f.CLUSTER_BREAK.LVT}else if(t<50808){if(t<50781){if(t===50780)return f.CLUSTER_BREAK.LV}else if(50781<=t&&t<=50807)return f.CLUSTER_BREAK.LVT}else if(t<50809){if(t===50808)return f.CLUSTER_BREAK.LV}else if(t<50836){if(50809<=t&&t<=50835)return f.CLUSTER_BREAK.LVT}else if(t===50836)return f.CLUSTER_BREAK.LV}else if(t<50920){if(t<50865){if(t<50864){if(50837<=t&&t<=50863)return f.CLUSTER_BREAK.LVT}else if(t===50864)return f.CLUSTER_BREAK.LV}else if(t<50892){if(50865<=t&&t<=50891)return f.CLUSTER_BREAK.LVT}else if(t<50893){if(t===50892)return f.CLUSTER_BREAK.LV}else if(50893<=t&&t<=50919)return f.CLUSTER_BREAK.LVT}else if(t<50949){if(t<50921){if(t===50920)return f.CLUSTER_BREAK.LV}else if(t<50948){if(50921<=t&&t<=50947)return f.CLUSTER_BREAK.LVT}else if(t===50948)return f.CLUSTER_BREAK.LV}else if(t<50976){if(50949<=t&&t<=50975)return f.CLUSTER_BREAK.LVT}else if(t<50977){if(t===50976)return f.CLUSTER_BREAK.LV}else if(50977<=t&&t<=51003)return f.CLUSTER_BREAK.LVT}else if(t<51145){if(t<51061){if(t<51032){if(t<51005){if(t===51004)return f.CLUSTER_BREAK.LV}else if(51005<=t&&t<=51031)return f.CLUSTER_BREAK.LVT}else if(t<51033){if(t===51032)return f.CLUSTER_BREAK.LV}else if(t<51060){if(51033<=t&&t<=51059)return f.CLUSTER_BREAK.LVT}else if(t===51060)return f.CLUSTER_BREAK.LV}else if(t<51116){if(t<51088){if(51061<=t&&t<=51087)return f.CLUSTER_BREAK.LVT}else if(t<51089){if(t===51088)return f.CLUSTER_BREAK.LV}else if(51089<=t&&t<=51115)return f.CLUSTER_BREAK.LVT}else if(t<51117){if(t===51116)return f.CLUSTER_BREAK.LV}else if(t<51144){if(51117<=t&&t<=51143)return f.CLUSTER_BREAK.LVT}else if(t===51144)return f.CLUSTER_BREAK.LV}else if(t<51228){if(t<51173){if(t<51172){if(51145<=t&&t<=51171)return f.CLUSTER_BREAK.LVT}else if(t===51172)return f.CLUSTER_BREAK.LV}else if(t<51200){if(51173<=t&&t<=51199)return f.CLUSTER_BREAK.LVT}else if(t<51201){if(t===51200)return f.CLUSTER_BREAK.LV}else if(51201<=t&&t<=51227)return f.CLUSTER_BREAK.LVT}else if(t<51257){if(t<51229){if(t===51228)return f.CLUSTER_BREAK.LV}else if(t<51256){if(51229<=t&&t<=51255)return f.CLUSTER_BREAK.LVT}else if(t===51256)return f.CLUSTER_BREAK.LV}else if(t<51284){if(51257<=t&&t<=51283)return f.CLUSTER_BREAK.LVT}else if(t<51285){if(t===51284)return f.CLUSTER_BREAK.LV}else if(51285<=t&&t<=51311)return f.CLUSTER_BREAK.LVT}else if(t<52516){if(t<51901){if(t<51593){if(t<51452){if(t<51369){if(t<51340){if(t<51313){if(t===51312)return f.CLUSTER_BREAK.LV}else if(51313<=t&&t<=51339)return f.CLUSTER_BREAK.LVT}else if(t<51341){if(t===51340)return f.CLUSTER_BREAK.LV}else if(t<51368){if(51341<=t&&t<=51367)return f.CLUSTER_BREAK.LVT}else if(t===51368)return f.CLUSTER_BREAK.LV}else if(t<51397){if(t<51396){if(51369<=t&&t<=51395)return f.CLUSTER_BREAK.LVT}else if(t===51396)return f.CLUSTER_BREAK.LV}else if(t<51424){if(51397<=t&&t<=51423)return f.CLUSTER_BREAK.LVT}else if(t<51425){if(t===51424)return f.CLUSTER_BREAK.LV}else if(51425<=t&&t<=51451)return f.CLUSTER_BREAK.LVT}else if(t<51509){if(t<51480){if(t<51453){if(t===51452)return f.CLUSTER_BREAK.LV}else if(51453<=t&&t<=51479)return f.CLUSTER_BREAK.LVT}else if(t<51481){if(t===51480)return f.CLUSTER_BREAK.LV}else if(t<51508){if(51481<=t&&t<=51507)return f.CLUSTER_BREAK.LVT}else if(t===51508)return f.CLUSTER_BREAK.LV}else if(t<51564){if(t<51536){if(51509<=t&&t<=51535)return f.CLUSTER_BREAK.LVT}else if(t<51537){if(t===51536)return f.CLUSTER_BREAK.LV}else if(51537<=t&&t<=51563)return f.CLUSTER_BREAK.LVT}else if(t<51565){if(t===51564)return f.CLUSTER_BREAK.LV}else if(t<51592){if(51565<=t&&t<=51591)return f.CLUSTER_BREAK.LVT}else if(t===51592)return f.CLUSTER_BREAK.LV}else if(t<51760){if(t<51676){if(t<51621){if(t<51620){if(51593<=t&&t<=51619)return f.CLUSTER_BREAK.LVT}else if(t===51620)return f.CLUSTER_BREAK.LV}else if(t<51648){if(51621<=t&&t<=51647)return f.CLUSTER_BREAK.LVT}else if(t<51649){if(t===51648)return f.CLUSTER_BREAK.LV}else if(51649<=t&&t<=51675)return f.CLUSTER_BREAK.LVT}else if(t<51705){if(t<51677){if(t===51676)return f.CLUSTER_BREAK.LV}else if(t<51704){if(51677<=t&&t<=51703)return f.CLUSTER_BREAK.LVT}else if(t===51704)return f.CLUSTER_BREAK.LV}else if(t<51732){if(51705<=t&&t<=51731)return f.CLUSTER_BREAK.LVT}else if(t<51733){if(t===51732)return f.CLUSTER_BREAK.LV}else if(51733<=t&&t<=51759)return f.CLUSTER_BREAK.LVT}else if(t<51817){if(t<51788){if(t<51761){if(t===51760)return f.CLUSTER_BREAK.LV}else if(51761<=t&&t<=51787)return f.CLUSTER_BREAK.LVT}else if(t<51789){if(t===51788)return f.CLUSTER_BREAK.LV}else if(t<51816){if(51789<=t&&t<=51815)return f.CLUSTER_BREAK.LVT}else if(t===51816)return f.CLUSTER_BREAK.LV}else if(t<51872){if(t<51844){if(51817<=t&&t<=51843)return f.CLUSTER_BREAK.LVT}else if(t<51845){if(t===51844)return f.CLUSTER_BREAK.LV}else if(51845<=t&&t<=51871)return f.CLUSTER_BREAK.LVT}else if(t<51873){if(t===51872)return f.CLUSTER_BREAK.LV}else if(t<51900){if(51873<=t&&t<=51899)return f.CLUSTER_BREAK.LVT}else if(t===51900)return f.CLUSTER_BREAK.LV}else if(t<52208){if(t<52041){if(t<51984){if(t<51929){if(t<51928){if(51901<=t&&t<=51927)return f.CLUSTER_BREAK.LVT}else if(t===51928)return f.CLUSTER_BREAK.LV}else if(t<51956){if(51929<=t&&t<=51955)return f.CLUSTER_BREAK.LVT}else if(t<51957){if(t===51956)return f.CLUSTER_BREAK.LV}else if(51957<=t&&t<=51983)return f.CLUSTER_BREAK.LVT}else if(t<52012){if(t<51985){if(t===51984)return f.CLUSTER_BREAK.LV}else if(51985<=t&&t<=52011)return f.CLUSTER_BREAK.LVT}else if(t<52013){if(t===52012)return f.CLUSTER_BREAK.LV}else if(t<52040){if(52013<=t&&t<=52039)return f.CLUSTER_BREAK.LVT}else if(t===52040)return f.CLUSTER_BREAK.LV}else if(t<52124){if(t<52069){if(t<52068){if(52041<=t&&t<=52067)return f.CLUSTER_BREAK.LVT}else if(t===52068)return f.CLUSTER_BREAK.LV}else if(t<52096){if(52069<=t&&t<=52095)return f.CLUSTER_BREAK.LVT}else if(t<52097){if(t===52096)return f.CLUSTER_BREAK.LV}else if(52097<=t&&t<=52123)return f.CLUSTER_BREAK.LVT}else if(t<52153){if(t<52125){if(t===52124)return f.CLUSTER_BREAK.LV}else if(t<52152){if(52125<=t&&t<=52151)return f.CLUSTER_BREAK.LVT}else if(t===52152)return f.CLUSTER_BREAK.LV}else if(t<52180){if(52153<=t&&t<=52179)return f.CLUSTER_BREAK.LVT}else if(t<52181){if(t===52180)return f.CLUSTER_BREAK.LV}else if(52181<=t&&t<=52207)return f.CLUSTER_BREAK.LVT}else if(t<52349){if(t<52265){if(t<52236){if(t<52209){if(t===52208)return f.CLUSTER_BREAK.LV}else if(52209<=t&&t<=52235)return f.CLUSTER_BREAK.LVT}else if(t<52237){if(t===52236)return f.CLUSTER_BREAK.LV}else if(t<52264){if(52237<=t&&t<=52263)return f.CLUSTER_BREAK.LVT}else if(t===52264)return f.CLUSTER_BREAK.LV}else if(t<52320){if(t<52292){if(52265<=t&&t<=52291)return f.CLUSTER_BREAK.LVT}else if(t<52293){if(t===52292)return f.CLUSTER_BREAK.LV}else if(52293<=t&&t<=52319)return f.CLUSTER_BREAK.LVT}else if(t<52321){if(t===52320)return f.CLUSTER_BREAK.LV}else if(t<52348){if(52321<=t&&t<=52347)return f.CLUSTER_BREAK.LVT}else if(t===52348)return f.CLUSTER_BREAK.LV}else if(t<52432){if(t<52377){if(t<52376){if(52349<=t&&t<=52375)return f.CLUSTER_BREAK.LVT}else if(t===52376)return f.CLUSTER_BREAK.LV}else if(t<52404){if(52377<=t&&t<=52403)return f.CLUSTER_BREAK.LVT}else if(t<52405){if(t===52404)return f.CLUSTER_BREAK.LV}else if(52405<=t&&t<=52431)return f.CLUSTER_BREAK.LVT}else if(t<52461){if(t<52433){if(t===52432)return f.CLUSTER_BREAK.LV}else if(t<52460){if(52433<=t&&t<=52459)return f.CLUSTER_BREAK.LVT}else if(t===52460)return f.CLUSTER_BREAK.LV}else if(t<52488){if(52461<=t&&t<=52487)return f.CLUSTER_BREAK.LVT}else if(t<52489){if(t===52488)return f.CLUSTER_BREAK.LV}else if(52489<=t&&t<=52515)return f.CLUSTER_BREAK.LVT}else if(t<53105){if(t<52797){if(t<52656){if(t<52573){if(t<52544){if(t<52517){if(t===52516)return f.CLUSTER_BREAK.LV}else if(52517<=t&&t<=52543)return f.CLUSTER_BREAK.LVT}else if(t<52545){if(t===52544)return f.CLUSTER_BREAK.LV}else if(t<52572){if(52545<=t&&t<=52571)return f.CLUSTER_BREAK.LVT}else if(t===52572)return f.CLUSTER_BREAK.LV}else if(t<52601){if(t<52600){if(52573<=t&&t<=52599)return f.CLUSTER_BREAK.LVT}else if(t===52600)return f.CLUSTER_BREAK.LV}else if(t<52628){if(52601<=t&&t<=52627)return f.CLUSTER_BREAK.LVT}else if(t<52629){if(t===52628)return f.CLUSTER_BREAK.LV}else if(52629<=t&&t<=52655)return f.CLUSTER_BREAK.LVT}else if(t<52713){if(t<52684){if(t<52657){if(t===52656)return f.CLUSTER_BREAK.LV}else if(52657<=t&&t<=52683)return f.CLUSTER_BREAK.LVT}else if(t<52685){if(t===52684)return f.CLUSTER_BREAK.LV}else if(t<52712){if(52685<=t&&t<=52711)return f.CLUSTER_BREAK.LVT}else if(t===52712)return f.CLUSTER_BREAK.LV}else if(t<52768){if(t<52740){if(52713<=t&&t<=52739)return f.CLUSTER_BREAK.LVT}else if(t<52741){if(t===52740)return f.CLUSTER_BREAK.LV}else if(52741<=t&&t<=52767)return f.CLUSTER_BREAK.LVT}else if(t<52769){if(t===52768)return f.CLUSTER_BREAK.LV}else if(t<52796){if(52769<=t&&t<=52795)return f.CLUSTER_BREAK.LVT}else if(t===52796)return f.CLUSTER_BREAK.LV}else if(t<52964){if(t<52880){if(t<52825){if(t<52824){if(52797<=t&&t<=52823)return f.CLUSTER_BREAK.LVT}else if(t===52824)return f.CLUSTER_BREAK.LV}else if(t<52852){if(52825<=t&&t<=52851)return f.CLUSTER_BREAK.LVT}else if(t<52853){if(t===52852)return f.CLUSTER_BREAK.LV}else if(52853<=t&&t<=52879)return f.CLUSTER_BREAK.LVT}else if(t<52909){if(t<52881){if(t===52880)return f.CLUSTER_BREAK.LV}else if(t<52908){if(52881<=t&&t<=52907)return f.CLUSTER_BREAK.LVT}else if(t===52908)return f.CLUSTER_BREAK.LV}else if(t<52936){if(52909<=t&&t<=52935)return f.CLUSTER_BREAK.LVT}else if(t<52937){if(t===52936)return f.CLUSTER_BREAK.LV}else if(52937<=t&&t<=52963)return f.CLUSTER_BREAK.LVT}else if(t<53021){if(t<52992){if(t<52965){if(t===52964)return f.CLUSTER_BREAK.LV}else if(52965<=t&&t<=52991)return f.CLUSTER_BREAK.LVT}else if(t<52993){if(t===52992)return f.CLUSTER_BREAK.LV}else if(t<53020){if(52993<=t&&t<=53019)return f.CLUSTER_BREAK.LVT}else if(t===53020)return f.CLUSTER_BREAK.LV}else if(t<53076){if(t<53048){if(53021<=t&&t<=53047)return f.CLUSTER_BREAK.LVT}else if(t<53049){if(t===53048)return f.CLUSTER_BREAK.LV}else if(53049<=t&&t<=53075)return f.CLUSTER_BREAK.LVT}else if(t<53077){if(t===53076)return f.CLUSTER_BREAK.LV}else if(t<53104){if(53077<=t&&t<=53103)return f.CLUSTER_BREAK.LVT}else if(t===53104)return f.CLUSTER_BREAK.LV}else if(t<53412){if(t<53245){if(t<53188){if(t<53133){if(t<53132){if(53105<=t&&t<=53131)return f.CLUSTER_BREAK.LVT}else if(t===53132)return f.CLUSTER_BREAK.LV}else if(t<53160){if(53133<=t&&t<=53159)return f.CLUSTER_BREAK.LVT}else if(t<53161){if(t===53160)return f.CLUSTER_BREAK.LV}else if(53161<=t&&t<=53187)return f.CLUSTER_BREAK.LVT}else if(t<53216){if(t<53189){if(t===53188)return f.CLUSTER_BREAK.LV}else if(53189<=t&&t<=53215)return f.CLUSTER_BREAK.LVT}else if(t<53217){if(t===53216)return f.CLUSTER_BREAK.LV}else if(t<53244){if(53217<=t&&t<=53243)return f.CLUSTER_BREAK.LVT}else if(t===53244)return f.CLUSTER_BREAK.LV}else if(t<53328){if(t<53273){if(t<53272){if(53245<=t&&t<=53271)return f.CLUSTER_BREAK.LVT}else if(t===53272)return f.CLUSTER_BREAK.LV}else if(t<53300){if(53273<=t&&t<=53299)return f.CLUSTER_BREAK.LVT}else if(t<53301){if(t===53300)return f.CLUSTER_BREAK.LV}else if(53301<=t&&t<=53327)return f.CLUSTER_BREAK.LVT}else if(t<53357){if(t<53329){if(t===53328)return f.CLUSTER_BREAK.LV}else if(t<53356){if(53329<=t&&t<=53355)return f.CLUSTER_BREAK.LVT}else if(t===53356)return f.CLUSTER_BREAK.LV}else if(t<53384){if(53357<=t&&t<=53383)return f.CLUSTER_BREAK.LVT}else if(t<53385){if(t===53384)return f.CLUSTER_BREAK.LV}else if(53385<=t&&t<=53411)return f.CLUSTER_BREAK.LVT}else if(t<53553){if(t<53469){if(t<53440){if(t<53413){if(t===53412)return f.CLUSTER_BREAK.LV}else if(53413<=t&&t<=53439)return f.CLUSTER_BREAK.LVT}else if(t<53441){if(t===53440)return f.CLUSTER_BREAK.LV}else if(t<53468){if(53441<=t&&t<=53467)return f.CLUSTER_BREAK.LVT}else if(t===53468)return f.CLUSTER_BREAK.LV}else if(t<53524){if(t<53496){if(53469<=t&&t<=53495)return f.CLUSTER_BREAK.LVT}else if(t<53497){if(t===53496)return f.CLUSTER_BREAK.LV}else if(53497<=t&&t<=53523)return f.CLUSTER_BREAK.LVT}else if(t<53525){if(t===53524)return f.CLUSTER_BREAK.LV}else if(t<53552){if(53525<=t&&t<=53551)return f.CLUSTER_BREAK.LVT}else if(t===53552)return f.CLUSTER_BREAK.LV}else if(t<53636){if(t<53581){if(t<53580){if(53553<=t&&t<=53579)return f.CLUSTER_BREAK.LVT}else if(t===53580)return f.CLUSTER_BREAK.LV}else if(t<53608){if(53581<=t&&t<=53607)return f.CLUSTER_BREAK.LVT}else if(t<53609){if(t===53608)return f.CLUSTER_BREAK.LV}else if(53609<=t&&t<=53635)return f.CLUSTER_BREAK.LVT}else if(t<53665){if(t<53637){if(t===53636)return f.CLUSTER_BREAK.LV}else if(t<53664){if(53637<=t&&t<=53663)return f.CLUSTER_BREAK.LVT}else if(t===53664)return f.CLUSTER_BREAK.LV}else if(t<53692){if(53665<=t&&t<=53691)return f.CLUSTER_BREAK.LVT}else if(t<53693){if(t===53692)return f.CLUSTER_BREAK.LV}else if(53693<=t&&t<=53719)return f.CLUSTER_BREAK.LVT}else if(t<70459){if(t<54897){if(t<54308){if(t<54001){if(t<53860){if(t<53777){if(t<53748){if(t<53721){if(t===53720)return f.CLUSTER_BREAK.LV}else if(53721<=t&&t<=53747)return f.CLUSTER_BREAK.LVT}else if(t<53749){if(t===53748)return f.CLUSTER_BREAK.LV}else if(t<53776){if(53749<=t&&t<=53775)return f.CLUSTER_BREAK.LVT}else if(t===53776)return f.CLUSTER_BREAK.LV}else if(t<53805){if(t<53804){if(53777<=t&&t<=53803)return f.CLUSTER_BREAK.LVT}else if(t===53804)return f.CLUSTER_BREAK.LV}else if(t<53832){if(53805<=t&&t<=53831)return f.CLUSTER_BREAK.LVT}else if(t<53833){if(t===53832)return f.CLUSTER_BREAK.LV}else if(53833<=t&&t<=53859)return f.CLUSTER_BREAK.LVT}else if(t<53917){if(t<53888){if(t<53861){if(t===53860)return f.CLUSTER_BREAK.LV}else if(53861<=t&&t<=53887)return f.CLUSTER_BREAK.LVT}else if(t<53889){if(t===53888)return f.CLUSTER_BREAK.LV}else if(t<53916){if(53889<=t&&t<=53915)return f.CLUSTER_BREAK.LVT}else if(t===53916)return f.CLUSTER_BREAK.LV}else if(t<53972){if(t<53944){if(53917<=t&&t<=53943)return f.CLUSTER_BREAK.LVT}else if(t<53945){if(t===53944)return f.CLUSTER_BREAK.LV}else if(53945<=t&&t<=53971)return f.CLUSTER_BREAK.LVT}else if(t<53973){if(t===53972)return f.CLUSTER_BREAK.LV}else if(t<54e3){if(53973<=t&&t<=53999)return f.CLUSTER_BREAK.LVT}else if(t===54e3)return f.CLUSTER_BREAK.LV}else if(t<54141){if(t<54084){if(t<54029){if(t<54028){if(54001<=t&&t<=54027)return f.CLUSTER_BREAK.LVT}else if(t===54028)return f.CLUSTER_BREAK.LV}else if(t<54056){if(54029<=t&&t<=54055)return f.CLUSTER_BREAK.LVT}else if(t<54057){if(t===54056)return f.CLUSTER_BREAK.LV}else if(54057<=t&&t<=54083)return f.CLUSTER_BREAK.LVT}else if(t<54112){if(t<54085){if(t===54084)return f.CLUSTER_BREAK.LV}else if(54085<=t&&t<=54111)return f.CLUSTER_BREAK.LVT}else if(t<54113){if(t===54112)return f.CLUSTER_BREAK.LV}else if(t<54140){if(54113<=t&&t<=54139)return f.CLUSTER_BREAK.LVT}else if(t===54140)return f.CLUSTER_BREAK.LV}else if(t<54224){if(t<54169){if(t<54168){if(54141<=t&&t<=54167)return f.CLUSTER_BREAK.LVT}else if(t===54168)return f.CLUSTER_BREAK.LV}else if(t<54196){if(54169<=t&&t<=54195)return f.CLUSTER_BREAK.LVT}else if(t<54197){if(t===54196)return f.CLUSTER_BREAK.LV}else if(54197<=t&&t<=54223)return f.CLUSTER_BREAK.LVT}else if(t<54253){if(t<54225){if(t===54224)return f.CLUSTER_BREAK.LV}else if(t<54252){if(54225<=t&&t<=54251)return f.CLUSTER_BREAK.LVT}else if(t===54252)return f.CLUSTER_BREAK.LV}else if(t<54280){if(54253<=t&&t<=54279)return f.CLUSTER_BREAK.LVT}else if(t<54281){if(t===54280)return f.CLUSTER_BREAK.LV}else if(54281<=t&&t<=54307)return f.CLUSTER_BREAK.LVT}else if(t<54589){if(t<54448){if(t<54365){if(t<54336){if(t<54309){if(t===54308)return f.CLUSTER_BREAK.LV}else if(54309<=t&&t<=54335)return f.CLUSTER_BREAK.LVT}else if(t<54337){if(t===54336)return f.CLUSTER_BREAK.LV}else if(t<54364){if(54337<=t&&t<=54363)return f.CLUSTER_BREAK.LVT}else if(t===54364)return f.CLUSTER_BREAK.LV}else if(t<54393){if(t<54392){if(54365<=t&&t<=54391)return f.CLUSTER_BREAK.LVT}else if(t===54392)return f.CLUSTER_BREAK.LV}else if(t<54420){if(54393<=t&&t<=54419)return f.CLUSTER_BREAK.LVT}else if(t<54421){if(t===54420)return f.CLUSTER_BREAK.LV}else if(54421<=t&&t<=54447)return f.CLUSTER_BREAK.LVT}else if(t<54505){if(t<54476){if(t<54449){if(t===54448)return f.CLUSTER_BREAK.LV}else if(54449<=t&&t<=54475)return f.CLUSTER_BREAK.LVT}else if(t<54477){if(t===54476)return f.CLUSTER_BREAK.LV}else if(t<54504){if(54477<=t&&t<=54503)return f.CLUSTER_BREAK.LVT}else if(t===54504)return f.CLUSTER_BREAK.LV}else if(t<54560){if(t<54532){if(54505<=t&&t<=54531)return f.CLUSTER_BREAK.LVT}else if(t<54533){if(t===54532)return f.CLUSTER_BREAK.LV}else if(54533<=t&&t<=54559)return f.CLUSTER_BREAK.LVT}else if(t<54561){if(t===54560)return f.CLUSTER_BREAK.LV}else if(t<54588){if(54561<=t&&t<=54587)return f.CLUSTER_BREAK.LVT}else if(t===54588)return f.CLUSTER_BREAK.LV}else if(t<54756){if(t<54672){if(t<54617){if(t<54616){if(54589<=t&&t<=54615)return f.CLUSTER_BREAK.LVT}else if(t===54616)return f.CLUSTER_BREAK.LV}else if(t<54644){if(54617<=t&&t<=54643)return f.CLUSTER_BREAK.LVT}else if(t<54645){if(t===54644)return f.CLUSTER_BREAK.LV}else if(54645<=t&&t<=54671)return f.CLUSTER_BREAK.LVT}else if(t<54701){if(t<54673){if(t===54672)return f.CLUSTER_BREAK.LV}else if(t<54700){if(54673<=t&&t<=54699)return f.CLUSTER_BREAK.LVT}else if(t===54700)return f.CLUSTER_BREAK.LV}else if(t<54728){if(54701<=t&&t<=54727)return f.CLUSTER_BREAK.LVT}else if(t<54729){if(t===54728)return f.CLUSTER_BREAK.LV}else if(54729<=t&&t<=54755)return f.CLUSTER_BREAK.LVT}else if(t<54813){if(t<54784){if(t<54757){if(t===54756)return f.CLUSTER_BREAK.LV}else if(54757<=t&&t<=54783)return f.CLUSTER_BREAK.LVT}else if(t<54785){if(t===54784)return f.CLUSTER_BREAK.LV}else if(t<54812){if(54785<=t&&t<=54811)return f.CLUSTER_BREAK.LVT}else if(t===54812)return f.CLUSTER_BREAK.LV}else if(t<54868){if(t<54840){if(54813<=t&&t<=54839)return f.CLUSTER_BREAK.LVT}else if(t<54841){if(t===54840)return f.CLUSTER_BREAK.LV}else if(54841<=t&&t<=54867)return f.CLUSTER_BREAK.LVT}else if(t<54869){if(t===54868)return f.CLUSTER_BREAK.LV}else if(t<54896){if(54869<=t&&t<=54895)return f.CLUSTER_BREAK.LVT}else if(t===54896)return f.CLUSTER_BREAK.LV}else if(t<69632){if(t<55216){if(t<55037){if(t<54980){if(t<54925){if(t<54924){if(54897<=t&&t<=54923)return f.CLUSTER_BREAK.LVT}else if(t===54924)return f.CLUSTER_BREAK.LV}else if(t<54952){if(54925<=t&&t<=54951)return f.CLUSTER_BREAK.LVT}else if(t<54953){if(t===54952)return f.CLUSTER_BREAK.LV}else if(54953<=t&&t<=54979)return f.CLUSTER_BREAK.LVT}else if(t<55008){if(t<54981){if(t===54980)return f.CLUSTER_BREAK.LV}else if(54981<=t&&t<=55007)return f.CLUSTER_BREAK.LVT}else if(t<55009){if(t===55008)return f.CLUSTER_BREAK.LV}else if(t<55036){if(55009<=t&&t<=55035)return f.CLUSTER_BREAK.LVT}else if(t===55036)return f.CLUSTER_BREAK.LV}else if(t<55120){if(t<55065){if(t<55064){if(55037<=t&&t<=55063)return f.CLUSTER_BREAK.LVT}else if(t===55064)return f.CLUSTER_BREAK.LV}else if(t<55092){if(55065<=t&&t<=55091)return f.CLUSTER_BREAK.LVT}else if(t<55093){if(t===55092)return f.CLUSTER_BREAK.LV}else if(55093<=t&&t<=55119)return f.CLUSTER_BREAK.LVT}else if(t<55149){if(t<55121){if(t===55120)return f.CLUSTER_BREAK.LV}else if(t<55148){if(55121<=t&&t<=55147)return f.CLUSTER_BREAK.LVT}else if(t===55148)return f.CLUSTER_BREAK.LV}else if(t<55176){if(55149<=t&&t<=55175)return f.CLUSTER_BREAK.LVT}else if(t<55177){if(t===55176)return f.CLUSTER_BREAK.LV}else if(55177<=t&&t<=55203)return f.CLUSTER_BREAK.LVT}else if(t<68097){if(t<65279){if(t<64286){if(t<55243){if(55216<=t&&t<=55238)return f.CLUSTER_BREAK.V}else if(55243<=t&&t<=55291)return f.CLUSTER_BREAK.T}else if(t<65024){if(t===64286)return f.CLUSTER_BREAK.EXTEND}else if(t<65056){if(65024<=t&&t<=65039)return f.CLUSTER_BREAK.EXTEND}else if(65056<=t&&t<=65071)return f.CLUSTER_BREAK.EXTEND}else if(t<66045){if(t<65438){if(t===65279)return f.CLUSTER_BREAK.CONTROL}else if(t<65520){if(65438<=t&&t<=65439)return f.CLUSTER_BREAK.EXTEND}else if(65520<=t&&t<=65531)return f.CLUSTER_BREAK.CONTROL}else if(t<66272){if(t===66045)return f.CLUSTER_BREAK.EXTEND}else if(t<66422){if(t===66272)return f.CLUSTER_BREAK.EXTEND}else if(66422<=t&&t<=66426)return f.CLUSTER_BREAK.EXTEND}else if(t<68325){if(t<68108){if(t<68101){if(68097<=t&&t<=68099)return f.CLUSTER_BREAK.EXTEND}else if(68101<=t&&t<=68102)return f.CLUSTER_BREAK.EXTEND}else if(t<68152){if(68108<=t&&t<=68111)return f.CLUSTER_BREAK.EXTEND}else if(t<68159){if(68152<=t&&t<=68154)return f.CLUSTER_BREAK.EXTEND}else if(t===68159)return f.CLUSTER_BREAK.EXTEND}else if(t<69373){if(t<68900){if(68325<=t&&t<=68326)return f.CLUSTER_BREAK.EXTEND}else if(t<69291){if(68900<=t&&t<=68903)return f.CLUSTER_BREAK.EXTEND}else if(69291<=t&&t<=69292)return f.CLUSTER_BREAK.EXTEND}else if(t<69446){if(69373<=t&&t<=69375)return f.CLUSTER_BREAK.EXTEND}else if(t<69506){if(69446<=t&&t<=69456)return f.CLUSTER_BREAK.EXTEND}else if(69506<=t&&t<=69509)return f.CLUSTER_BREAK.EXTEND}else if(t<70016){if(t<69815){if(t<69747){if(t<69634){if(t===69632)return f.CLUSTER_BREAK.SPACINGMARK;if(t===69633)return f.CLUSTER_BREAK.EXTEND}else if(t<69688){if(t===69634)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<69744){if(69688<=t&&t<=69702)return f.CLUSTER_BREAK.EXTEND}else if(t===69744)return f.CLUSTER_BREAK.EXTEND}else if(t<69762){if(t<69759){if(69747<=t&&t<=69748)return f.CLUSTER_BREAK.EXTEND}else if(69759<=t&&t<=69761)return f.CLUSTER_BREAK.EXTEND}else if(t<69808){if(t===69762)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<69811){if(69808<=t&&t<=69810)return f.CLUSTER_BREAK.SPACINGMARK}else if(69811<=t&&t<=69814)return f.CLUSTER_BREAK.EXTEND}else if(t<69888)if(t<69821){if(t<69817){if(69815<=t&&t<=69816)return f.CLUSTER_BREAK.SPACINGMARK}else if(69817<=t&&t<=69818)return f.CLUSTER_BREAK.EXTEND}else if(t<69826){if(t===69821)return f.CLUSTER_BREAK.PREPEND}else{if(t===69826)return f.CLUSTER_BREAK.EXTEND;if(t===69837)return f.CLUSTER_BREAK.PREPEND}else if(t<69933){if(t<69927){if(69888<=t&&t<=69890)return f.CLUSTER_BREAK.EXTEND}else if(t<69932){if(69927<=t&&t<=69931)return f.CLUSTER_BREAK.EXTEND}else if(t===69932)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<69957){if(69933<=t&&t<=69940)return f.CLUSTER_BREAK.EXTEND}else if(t<70003){if(69957<=t&&t<=69958)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===70003)return f.CLUSTER_BREAK.EXTEND}else if(t<70194){if(t<70082){if(t<70067){if(t<70018){if(70016<=t&&t<=70017)return f.CLUSTER_BREAK.EXTEND}else if(t===70018)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70070){if(70067<=t&&t<=70069)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70079){if(70070<=t&&t<=70078)return f.CLUSTER_BREAK.EXTEND}else if(70079<=t&&t<=70080)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70095){if(t<70089){if(70082<=t&&t<=70083)return f.CLUSTER_BREAK.PREPEND}else if(t<70094){if(70089<=t&&t<=70092)return f.CLUSTER_BREAK.EXTEND}else if(t===70094)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70188){if(t===70095)return f.CLUSTER_BREAK.EXTEND}else if(t<70191){if(70188<=t&&t<=70190)return f.CLUSTER_BREAK.SPACINGMARK}else if(70191<=t&&t<=70193)return f.CLUSTER_BREAK.EXTEND}else if(t<70209){if(t<70197){if(t<70196){if(70194<=t&&t<=70195)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===70196)return f.CLUSTER_BREAK.EXTEND}else if(t<70198){if(t===70197)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70206){if(70198<=t&&t<=70199)return f.CLUSTER_BREAK.EXTEND}else if(t===70206)return f.CLUSTER_BREAK.EXTEND}else if(t<70371){if(t<70367){if(t===70209)return f.CLUSTER_BREAK.EXTEND}else if(t<70368){if(t===70367)return f.CLUSTER_BREAK.EXTEND}else if(70368<=t&&t<=70370)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70400){if(70371<=t&&t<=70378)return f.CLUSTER_BREAK.EXTEND}else if(t<70402){if(70400<=t&&t<=70401)return f.CLUSTER_BREAK.EXTEND}else if(70402<=t&&t<=70403)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72343){if(t<71339){if(t<70841){if(t<70512){if(t<70471){if(t<70463){if(t<70462){if(70459<=t&&t<=70460)return f.CLUSTER_BREAK.EXTEND}else if(t===70462)return f.CLUSTER_BREAK.EXTEND}else if(t<70464){if(t===70463)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70465){if(t===70464)return f.CLUSTER_BREAK.EXTEND}else if(70465<=t&&t<=70468)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70487){if(t<70475){if(70471<=t&&t<=70472)return f.CLUSTER_BREAK.SPACINGMARK}else if(70475<=t&&t<=70477)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70498){if(t===70487)return f.CLUSTER_BREAK.EXTEND}else if(t<70502){if(70498<=t&&t<=70499)return f.CLUSTER_BREAK.SPACINGMARK}else if(70502<=t&&t<=70508)return f.CLUSTER_BREAK.EXTEND}else if(t<70725){if(t<70712){if(t<70709){if(70512<=t&&t<=70516)return f.CLUSTER_BREAK.EXTEND}else if(70709<=t&&t<=70711)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70720){if(70712<=t&&t<=70719)return f.CLUSTER_BREAK.EXTEND}else if(t<70722){if(70720<=t&&t<=70721)return f.CLUSTER_BREAK.SPACINGMARK}else if(70722<=t&&t<=70724)return f.CLUSTER_BREAK.EXTEND}else if(t<70832){if(t<70726){if(t===70725)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===70726||t===70750)return f.CLUSTER_BREAK.EXTEND}else if(t<70833){if(t===70832)return f.CLUSTER_BREAK.EXTEND}else if(t<70835){if(70833<=t&&t<=70834)return f.CLUSTER_BREAK.SPACINGMARK}else if(70835<=t&&t<=70840)return f.CLUSTER_BREAK.EXTEND}else if(t<71096){if(t<70847)if(t<70843){if(t===70841)return f.CLUSTER_BREAK.SPACINGMARK;if(t===70842)return f.CLUSTER_BREAK.EXTEND}else if(t<70845){if(70843<=t&&t<=70844)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===70845)return f.CLUSTER_BREAK.EXTEND;if(t===70846)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71087){if(t<70849){if(70847<=t&&t<=70848)return f.CLUSTER_BREAK.EXTEND}else if(t<70850){if(t===70849)return f.CLUSTER_BREAK.SPACINGMARK}else if(70850<=t&&t<=70851)return f.CLUSTER_BREAK.EXTEND}else if(t<71088){if(t===71087)return f.CLUSTER_BREAK.EXTEND}else if(t<71090){if(71088<=t&&t<=71089)return f.CLUSTER_BREAK.SPACINGMARK}else if(71090<=t&&t<=71093)return f.CLUSTER_BREAK.EXTEND}else if(t<71216){if(t<71102){if(t<71100){if(71096<=t&&t<=71099)return f.CLUSTER_BREAK.SPACINGMARK}else if(71100<=t&&t<=71101)return f.CLUSTER_BREAK.EXTEND}else if(t<71103){if(t===71102)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71132){if(71103<=t&&t<=71104)return f.CLUSTER_BREAK.EXTEND}else if(71132<=t&&t<=71133)return f.CLUSTER_BREAK.EXTEND}else if(t<71229){if(t<71219){if(71216<=t&&t<=71218)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71227){if(71219<=t&&t<=71226)return f.CLUSTER_BREAK.EXTEND}else if(71227<=t&&t<=71228)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71230){if(t===71229)return f.CLUSTER_BREAK.EXTEND}else if(t<71231){if(t===71230)return f.CLUSTER_BREAK.SPACINGMARK}else if(71231<=t&&t<=71232)return f.CLUSTER_BREAK.EXTEND}else if(t<71999)if(t<71463){if(t<71350){if(t<71341){if(t===71339)return f.CLUSTER_BREAK.EXTEND;if(t===71340)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71342){if(t===71341)return f.CLUSTER_BREAK.EXTEND}else if(t<71344){if(71342<=t&&t<=71343)return f.CLUSTER_BREAK.SPACINGMARK}else if(71344<=t&&t<=71349)return f.CLUSTER_BREAK.EXTEND}else if(t<71453){if(t===71350)return f.CLUSTER_BREAK.SPACINGMARK;if(t===71351)return f.CLUSTER_BREAK.EXTEND}else if(t<71458){if(71453<=t&&t<=71455)return f.CLUSTER_BREAK.EXTEND}else if(t<71462){if(71458<=t&&t<=71461)return f.CLUSTER_BREAK.EXTEND}else if(t===71462)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71984){if(t<71727){if(t<71724){if(71463<=t&&t<=71467)return f.CLUSTER_BREAK.EXTEND}else if(71724<=t&&t<=71726)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71736){if(71727<=t&&t<=71735)return f.CLUSTER_BREAK.EXTEND}else if(t<71737){if(t===71736)return f.CLUSTER_BREAK.SPACINGMARK}else if(71737<=t&&t<=71738)return f.CLUSTER_BREAK.EXTEND}else if(t<71995){if(t<71985){if(t===71984)return f.CLUSTER_BREAK.EXTEND}else if(t<71991){if(71985<=t&&t<=71989)return f.CLUSTER_BREAK.SPACINGMARK}else if(71991<=t&&t<=71992)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71997){if(71995<=t&&t<=71996)return f.CLUSTER_BREAK.EXTEND}else{if(t===71997)return f.CLUSTER_BREAK.SPACINGMARK;if(t===71998)return f.CLUSTER_BREAK.EXTEND}else if(t<72193)if(t<72145)if(t<72001){if(t===71999)return f.CLUSTER_BREAK.PREPEND;if(t===72e3)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72002){if(t===72001)return f.CLUSTER_BREAK.PREPEND}else{if(t===72002)return f.CLUSTER_BREAK.SPACINGMARK;if(t===72003)return f.CLUSTER_BREAK.EXTEND}else if(t<72156){if(t<72148){if(72145<=t&&t<=72147)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72154){if(72148<=t&&t<=72151)return f.CLUSTER_BREAK.EXTEND}else if(72154<=t&&t<=72155)return f.CLUSTER_BREAK.EXTEND}else if(t<72160){if(72156<=t&&t<=72159)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===72160)return f.CLUSTER_BREAK.EXTEND;if(t===72164)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72263){if(t<72249){if(t<72243){if(72193<=t&&t<=72202)return f.CLUSTER_BREAK.EXTEND}else if(72243<=t&&t<=72248)return f.CLUSTER_BREAK.EXTEND}else if(t<72250){if(t===72249)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72251){if(t===72250)return f.CLUSTER_BREAK.PREPEND}else if(72251<=t&&t<=72254)return f.CLUSTER_BREAK.EXTEND}else if(t<72281){if(t<72273){if(t===72263)return f.CLUSTER_BREAK.EXTEND}else if(t<72279){if(72273<=t&&t<=72278)return f.CLUSTER_BREAK.EXTEND}else if(72279<=t&&t<=72280)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72324){if(72281<=t&&t<=72283)return f.CLUSTER_BREAK.EXTEND}else if(t<72330){if(72324<=t&&t<=72329)return f.CLUSTER_BREAK.PREPEND}else if(72330<=t&&t<=72342)return f.CLUSTER_BREAK.EXTEND}else if(t<94033){if(t<73104){if(t<72881){if(t<72766){if(t<72751){if(t<72344){if(t===72343)return f.CLUSTER_BREAK.SPACINGMARK}else if(72344<=t&&t<=72345)return f.CLUSTER_BREAK.EXTEND}else if(t<72752){if(t===72751)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72760){if(72752<=t&&t<=72758)return f.CLUSTER_BREAK.EXTEND}else if(72760<=t&&t<=72765)return f.CLUSTER_BREAK.EXTEND}else if(t<72850){if(t===72766)return f.CLUSTER_BREAK.SPACINGMARK;if(t===72767)return f.CLUSTER_BREAK.EXTEND}else if(t<72873){if(72850<=t&&t<=72871)return f.CLUSTER_BREAK.EXTEND}else if(t<72874){if(t===72873)return f.CLUSTER_BREAK.SPACINGMARK}else if(72874<=t&&t<=72880)return f.CLUSTER_BREAK.EXTEND}else if(t<73018){if(t<72884){if(t<72882){if(t===72881)return f.CLUSTER_BREAK.SPACINGMARK}else if(72882<=t&&t<=72883)return f.CLUSTER_BREAK.EXTEND}else if(t<72885){if(t===72884)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73009){if(72885<=t&&t<=72886)return f.CLUSTER_BREAK.EXTEND}else if(73009<=t&&t<=73014)return f.CLUSTER_BREAK.EXTEND}else if(t<73030){if(t<73020){if(t===73018)return f.CLUSTER_BREAK.EXTEND}else if(t<73023){if(73020<=t&&t<=73021)return f.CLUSTER_BREAK.EXTEND}else if(73023<=t&&t<=73029)return f.CLUSTER_BREAK.EXTEND}else if(t<73031){if(t===73030)return f.CLUSTER_BREAK.PREPEND}else if(t<73098){if(t===73031)return f.CLUSTER_BREAK.EXTEND}else if(73098<=t&&t<=73102)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73526){if(t<73459)if(t<73109){if(t<73107){if(73104<=t&&t<=73105)return f.CLUSTER_BREAK.EXTEND}else if(73107<=t&&t<=73108)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73110){if(t===73109)return f.CLUSTER_BREAK.EXTEND}else{if(t===73110)return f.CLUSTER_BREAK.SPACINGMARK;if(t===73111)return f.CLUSTER_BREAK.EXTEND}else if(t<73474){if(t<73461){if(73459<=t&&t<=73460)return f.CLUSTER_BREAK.EXTEND}else if(t<73472){if(73461<=t&&t<=73462)return f.CLUSTER_BREAK.SPACINGMARK}else if(73472<=t&&t<=73473)return f.CLUSTER_BREAK.EXTEND}else if(t<73475){if(t===73474)return f.CLUSTER_BREAK.PREPEND}else if(t<73524){if(t===73475)return f.CLUSTER_BREAK.SPACINGMARK}else if(73524<=t&&t<=73525)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<78896)if(t<73536){if(t<73534){if(73526<=t&&t<=73530)return f.CLUSTER_BREAK.EXTEND}else if(73534<=t&&t<=73535)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73537){if(t===73536)return f.CLUSTER_BREAK.EXTEND}else{if(t===73537)return f.CLUSTER_BREAK.SPACINGMARK;if(t===73538)return f.CLUSTER_BREAK.EXTEND}else if(t<92912){if(t<78912){if(78896<=t&&t<=78911)return f.CLUSTER_BREAK.CONTROL}else if(t<78919){if(t===78912)return f.CLUSTER_BREAK.EXTEND}else if(78919<=t&&t<=78933)return f.CLUSTER_BREAK.EXTEND}else if(t<92976){if(92912<=t&&t<=92916)return f.CLUSTER_BREAK.EXTEND}else if(t<94031){if(92976<=t&&t<=92982)return f.CLUSTER_BREAK.EXTEND}else if(t===94031)return f.CLUSTER_BREAK.EXTEND}else if(t<121476){if(t<119143)if(t<113824){if(t<94180){if(t<94095){if(94033<=t&&t<=94087)return f.CLUSTER_BREAK.SPACINGMARK}else if(94095<=t&&t<=94098)return f.CLUSTER_BREAK.EXTEND}else if(t<94192){if(t===94180)return f.CLUSTER_BREAK.EXTEND}else if(t<113821){if(94192<=t&&t<=94193)return f.CLUSTER_BREAK.SPACINGMARK}else if(113821<=t&&t<=113822)return f.CLUSTER_BREAK.EXTEND}else if(t<118576){if(t<118528){if(113824<=t&&t<=113827)return f.CLUSTER_BREAK.CONTROL}else if(118528<=t&&t<=118573)return f.CLUSTER_BREAK.EXTEND}else if(t<119141){if(118576<=t&&t<=118598)return f.CLUSTER_BREAK.EXTEND}else{if(t===119141)return f.CLUSTER_BREAK.EXTEND;if(t===119142)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<119173){if(t<119150){if(t<119149){if(119143<=t&&t<=119145)return f.CLUSTER_BREAK.EXTEND}else if(t===119149)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<119155){if(119150<=t&&t<=119154)return f.CLUSTER_BREAK.EXTEND}else if(t<119163){if(119155<=t&&t<=119162)return f.CLUSTER_BREAK.CONTROL}else if(119163<=t&&t<=119170)return f.CLUSTER_BREAK.EXTEND}else if(t<121344){if(t<119210){if(119173<=t&&t<=119179)return f.CLUSTER_BREAK.EXTEND}else if(t<119362){if(119210<=t&&t<=119213)return f.CLUSTER_BREAK.EXTEND}else if(119362<=t&&t<=119364)return f.CLUSTER_BREAK.EXTEND}else if(t<121403){if(121344<=t&&t<=121398)return f.CLUSTER_BREAK.EXTEND}else if(t<121461){if(121403<=t&&t<=121452)return f.CLUSTER_BREAK.EXTEND}else if(t===121461)return f.CLUSTER_BREAK.EXTEND}else if(t<123628){if(t<122907){if(t<121505){if(t<121499){if(t===121476)return f.CLUSTER_BREAK.EXTEND}else if(121499<=t&&t<=121503)return f.CLUSTER_BREAK.EXTEND}else if(t<122880){if(121505<=t&&t<=121519)return f.CLUSTER_BREAK.EXTEND}else if(t<122888){if(122880<=t&&t<=122886)return f.CLUSTER_BREAK.EXTEND}else if(122888<=t&&t<=122904)return f.CLUSTER_BREAK.EXTEND}else if(t<123023){if(t<122915){if(122907<=t&&t<=122913)return f.CLUSTER_BREAK.EXTEND}else if(t<122918){if(122915<=t&&t<=122916)return f.CLUSTER_BREAK.EXTEND}else if(122918<=t&&t<=122922)return f.CLUSTER_BREAK.EXTEND}else if(t<123184){if(t===123023)return f.CLUSTER_BREAK.EXTEND}else if(t<123566){if(123184<=t&&t<=123190)return f.CLUSTER_BREAK.EXTEND}else if(t===123566)return f.CLUSTER_BREAK.EXTEND}else if(t<127995){if(t<125136){if(t<124140){if(123628<=t&&t<=123631)return f.CLUSTER_BREAK.EXTEND}else if(124140<=t&&t<=124143)return f.CLUSTER_BREAK.EXTEND}else if(t<125252){if(125136<=t&&t<=125142)return f.CLUSTER_BREAK.EXTEND}else if(t<127462){if(125252<=t&&t<=125258)return f.CLUSTER_BREAK.EXTEND}else if(127462<=t&&t<=127487)return f.CLUSTER_BREAK.REGIONAL_INDICATOR}else if(t<917632){if(t<917504){if(127995<=t&&t<=127999)return f.CLUSTER_BREAK.EXTEND}else if(t<917536){if(917504<=t&&t<=917535)return f.CLUSTER_BREAK.CONTROL}else if(917536<=t&&t<=917631)return f.CLUSTER_BREAK.EXTEND}else if(t<917760){if(917632<=t&&t<=917759)return f.CLUSTER_BREAK.CONTROL}else if(t<918e3){if(917760<=t&&t<=917999)return f.CLUSTER_BREAK.EXTEND}else if(918e3<=t&&t<=921599)return f.CLUSTER_BREAK.CONTROL;return f.CLUSTER_BREAK.OTHER}static getEmojiProperty(t){if(t<10160){if(t<9728){if(t<9e3){if(t<8482){if(t<8252){if(t===169||t===174)return f.EXTENDED_PICTOGRAPHIC}else if(t===8252||t===8265)return f.EXTENDED_PICTOGRAPHIC}else if(t<8596){if(t===8482||t===8505)return f.EXTENDED_PICTOGRAPHIC}else if(t<8617){if(8596<=t&&t<=8601)return f.EXTENDED_PICTOGRAPHIC}else if(t<8986){if(8617<=t&&t<=8618)return f.EXTENDED_PICTOGRAPHIC}else if(8986<=t&&t<=8987)return f.EXTENDED_PICTOGRAPHIC}else if(t<9410){if(t<9167){if(t===9e3||t===9096)return f.EXTENDED_PICTOGRAPHIC}else if(t<9193){if(t===9167)return f.EXTENDED_PICTOGRAPHIC}else if(t<9208){if(9193<=t&&t<=9203)return f.EXTENDED_PICTOGRAPHIC}else if(9208<=t&&t<=9210)return f.EXTENDED_PICTOGRAPHIC}else if(t<9654){if(t<9642){if(t===9410)return f.EXTENDED_PICTOGRAPHIC}else if(9642<=t&&t<=9643)return f.EXTENDED_PICTOGRAPHIC}else if(t<9664){if(t===9654)return f.EXTENDED_PICTOGRAPHIC}else if(t<9723){if(t===9664)return f.EXTENDED_PICTOGRAPHIC}else if(9723<=t&&t<=9726)return f.EXTENDED_PICTOGRAPHIC}else if(t<10035){if(t<10004){if(t<9748){if(t<9735){if(9728<=t&&t<=9733)return f.EXTENDED_PICTOGRAPHIC}else if(9735<=t&&t<=9746)return f.EXTENDED_PICTOGRAPHIC}else if(t<9872){if(9748<=t&&t<=9861)return f.EXTENDED_PICTOGRAPHIC}else if(t<9992){if(9872<=t&&t<=9989)return f.EXTENDED_PICTOGRAPHIC}else if(9992<=t&&t<=10002)return f.EXTENDED_PICTOGRAPHIC}else if(t<10013){if(t===10004||t===10006)return f.EXTENDED_PICTOGRAPHIC}else if(t<10017){if(t===10013)return f.EXTENDED_PICTOGRAPHIC}else if(t===10017||t===10024)return f.EXTENDED_PICTOGRAPHIC}else if(t<10067){if(t<10055){if(t<10052){if(10035<=t&&t<=10036)return f.EXTENDED_PICTOGRAPHIC}else if(t===10052)return f.EXTENDED_PICTOGRAPHIC}else if(t<10060){if(t===10055)return f.EXTENDED_PICTOGRAPHIC}else if(t===10060||t===10062)return f.EXTENDED_PICTOGRAPHIC}else if(t<10083){if(t<10071){if(10067<=t&&t<=10069)return f.EXTENDED_PICTOGRAPHIC}else if(t===10071)return f.EXTENDED_PICTOGRAPHIC}else if(t<10133){if(10083<=t&&t<=10087)return f.EXTENDED_PICTOGRAPHIC}else if(t<10145){if(10133<=t&&t<=10135)return f.EXTENDED_PICTOGRAPHIC}else if(t===10145)return f.EXTENDED_PICTOGRAPHIC}else if(t<127489){if(t<12951){if(t<11035){if(t<10548){if(t===10160||t===10175)return f.EXTENDED_PICTOGRAPHIC}else if(t<11013){if(10548<=t&&t<=10549)return f.EXTENDED_PICTOGRAPHIC}else if(11013<=t&&t<=11015)return f.EXTENDED_PICTOGRAPHIC}else if(t<11093){if(t<11088){if(11035<=t&&t<=11036)return f.EXTENDED_PICTOGRAPHIC}else if(t===11088)return f.EXTENDED_PICTOGRAPHIC}else if(t<12336){if(t===11093)return f.EXTENDED_PICTOGRAPHIC}else if(t===12336||t===12349)return f.EXTENDED_PICTOGRAPHIC}else if(t<127340){if(t<126976){if(t===12951||t===12953)return f.EXTENDED_PICTOGRAPHIC}else if(t<127245){if(126976<=t&&t<=127231)return f.EXTENDED_PICTOGRAPHIC}else if(t<127279){if(127245<=t&&t<=127247)return f.EXTENDED_PICTOGRAPHIC}else if(t===127279)return f.EXTENDED_PICTOGRAPHIC}else if(t<127374){if(t<127358){if(127340<=t&&t<=127345)return f.EXTENDED_PICTOGRAPHIC}else if(127358<=t&&t<=127359)return f.EXTENDED_PICTOGRAPHIC}else if(t<127377){if(t===127374)return f.EXTENDED_PICTOGRAPHIC}else if(t<127405){if(127377<=t&&t<=127386)return f.EXTENDED_PICTOGRAPHIC}else if(127405<=t&&t<=127461)return f.EXTENDED_PICTOGRAPHIC}else if(t<128981){if(t<127561){if(t<127535){if(t<127514){if(127489<=t&&t<=127503)return f.EXTENDED_PICTOGRAPHIC}else if(t===127514)return f.EXTENDED_PICTOGRAPHIC}else if(t<127538){if(t===127535)return f.EXTENDED_PICTOGRAPHIC}else if(t<127548){if(127538<=t&&t<=127546)return f.EXTENDED_PICTOGRAPHIC}else if(127548<=t&&t<=127551)return f.EXTENDED_PICTOGRAPHIC}else if(t<128326){if(t<128e3){if(127561<=t&&t<=127994)return f.EXTENDED_PICTOGRAPHIC}else if(128e3<=t&&t<=128317)return f.EXTENDED_PICTOGRAPHIC}else if(t<128640){if(128326<=t&&t<=128591)return f.EXTENDED_PICTOGRAPHIC}else if(t<128884){if(128640<=t&&t<=128767)return f.EXTENDED_PICTOGRAPHIC}else if(128884<=t&&t<=128895)return f.EXTENDED_PICTOGRAPHIC}else if(t<129198){if(t<129096){if(t<129036){if(128981<=t&&t<=129023)return f.EXTENDED_PICTOGRAPHIC}else if(129036<=t&&t<=129039)return f.EXTENDED_PICTOGRAPHIC}else if(t<129114){if(129096<=t&&t<=129103)return f.EXTENDED_PICTOGRAPHIC}else if(t<129160){if(129114<=t&&t<=129119)return f.EXTENDED_PICTOGRAPHIC}else if(129160<=t&&t<=129167)return f.EXTENDED_PICTOGRAPHIC}else if(t<129340){if(t<129292){if(129198<=t&&t<=129279)return f.EXTENDED_PICTOGRAPHIC}else if(129292<=t&&t<=129338)return f.EXTENDED_PICTOGRAPHIC}else if(t<129351){if(129340<=t&&t<=129349)return f.EXTENDED_PICTOGRAPHIC}else if(t<130048){if(129351<=t&&t<=129791)return f.EXTENDED_PICTOGRAPHIC}else if(130048<=t&&t<=131069)return f.EXTENDED_PICTOGRAPHIC;return f.CLUSTER_BREAK.OTHER}}k1.default=no;var jD=Un&&Un.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Q3,"__esModule",{value:!0});const zD=jD(k1);var GD=Q3.default=zD.default;const WD=new GD,nl=I("text-offset");function Yo(n,t){const e=gi(n);let r=0;for(let i=0;i<e.length;i++){const o=e[i],s=Cr(o);if(o===t){const l=r+s;return{start:r,end:l}}r+=s}p(nl,!1,"can not find child in children")}function On(n,t){p(nl,t>=0,`invalid offset: ${t}`);const e=uu(n,t),{prev:r,next:i,offset:o}=e;if(!r&&!i&&p(nl,!1,"invalid offset, no prev & next child at offset"),r!==i)return!0;const s=r;if(p(nl,s,"no child"),Qn(s))return p(nl,o===0||o===1,`invalid box child offset: ${o}`),!0;const l=s.textContent;p(nl,l,"no content for text child");const c=WD.splitGraphemes(l),d=new Set;let h=0;return c.forEach(C=>{d.add(h),h+=C.length}),d.add(h),!!d.has(o)}function Qo(n,t){if(t===0)return 0;const e=t-1;if(On(n,e))return e;let r=e-1;for(;!On(n,r);)r-=1;return r}function rl(n,t){const e=du(n);if(p(nl,t>=0&&t<=e,`invalid offset: ${t}, ${e}`),t===e)return e;const r=t+1;if(On(n,r))return r;let i=r+1;for(;!On(n,i);)i+=1;return i}const qD=I("line-offset");function I1(n){const t=pu(n),e=[];let r=0;for(let i=0;i<t.length;i++){const o=t[i];e.push({start:r,end:o.offset}),r=o.offset}return e.push({start:r,end:du(n)}),e}function uh(n,t){const e=I1(n);return p(qD,t>=0&&t<e.length,`invalid line index: ${t}, ${e.length}`),e[t]}function Z3(n,t){const{lineIndex:e}=y1(n,t);return uh(n,e)}function XD(n){const t=I1(n),e=n.getBoundingClientRect(),r=[];return t.forEach(({start:i,end:o})=>{const s=at(n,i,"home");let l=Jn(n,s);const c=at(n,o,"end"),d=Jn(n,c);l.top+l.height/2<d.top&&(l=new DOMRect(e.left-1e4,d.top,1,d.height));const h=new DOMRect(l.left,d.top,d.left-l.left,d.height),C=new DOMRect(e.left,d.top,e.width,d.height);r.push({start:i,end:o,rect:C,contentRect:h})}),r}function YD(n,t,e){const i=XD(n).find(s=>Ws(s.rect,t,e));if(!i)return null;const o=i.contentRect;return t<=o.left+1?at(n,i.start,"home"):t>=o.right-1?at(n,i.end,"end"):null}function tB(n,t,e){const r=Jn(n,t),i=Jn(n,e),o=r.top+r.height/2,s=i.top+i.height/2,l=i.top<o&&o<i.bottom,c=r.top<s&&s<r.bottom;return l&&c}function eB(n){return I1(n).length}const il=I("find-text-position");function nB(n,t){const{start:e,end:r}=uh(n,t),i=lt(n),o=Jn(n,at(i,e,"home"));if(!(Jn(n,at(i,r,"end")).top>o.top+o.height/2))return!1;const c=uu(n,e);return p(il,c.next,"no next child at offset"),p(il,!cu(c.next),"next child is not text child"),!0}function QD(n,t){const e=lt(n);p(il,nB(n,t),"line is not wrapped");const{start:r,end:i}=uh(n,t),o=at(e,r,"home");for(let s=r+1;s<=i;s+=1){let l="normal";s===r?l="home":s===i&&(l="end");const c=at(e,s,l);if(!tB(n,o,c))return s-1}return p(il,!1,"failed to find wrapped offset"),0}function fh(n,t,e,r,i,o,s){p(il,rt(n,t),`not a text kind block: ${Dt(t)}`);const{start:l,end:c}=uh(t,e);let d=l;const h=lt(t);if(t===r&&nB(t,e)){const w=QD(t,e);(o==="up"||o==="down"&&tB(t,i,at(h,l,"home")))&&(d=w+1)}let C=Number.MAX_SAFE_INTEGER;const E=Wo(n,r,i),x=s!=null?s:E.left+E.width/2,B=E.top+E.height/2;let k=at(h,d,"home");for(let w=d;w<=c;w++){if(!On(t,w))continue;let U="normal";w===l?U="home":w===c&&(U="end");const M=at(h,w,U),F=Jn(t,M),Y=jo(F,x,B);Y<C&&(C=Y,k=M)}return k}function JD(n,t,e,r,i){return p(il,rt(n,t),"not a text block"),fh(n,t,eB(t)-1,e,r,"up",i)}function ZD(n,t,e,r,i){return p(il,rt(n,t),"not a text block"),fh(n,t,0,e,r,"down",i)}function t8(n,t,e,r){const{lineIndex:i}=y1(t,e);if(i===eB(t)-1)return null;const o=fh(n,t,i+1,t,e,"down",r);return o||null}function e8(n,t){if(t.offset===0)return null;const e=pu(n),r=e.find(i=>i.offset===t.offset);if(!r){const i=Qo(n,t.offset);return e.find(s=>s.offset===i)?{offset:i,type:"home"}:{offset:i,type:"normal"}}if(r.type==="betweenChild"){if(t.type==="home"&&r.childInfo.wrap==="nowrap")return{offset:t.offset,type:"end"};if(r.childInfo.prevWrapped)return{offset:Qo(n,t.offset),type:"normal"}}return{offset:Qo(n,t.offset),type:"normal"}}function n8(n,t){const e=du(n);if(t.offset===e)return null;const r=pu(n),i=r.find(o=>o.offset===t.offset);if(!i){const o=rl(n,t.offset),s=r.find(l=>l.offset===o);return s?s.type==="betweenChild"?{offset:o,type:"end"}:{offset:o,type:"home"}:{offset:o,type:"normal"}}return i.type==="betweenChild"?i.childInfo.wrap==="nowrap"&&t.type==="end"?{offset:t.offset,type:"home"}:{offset:rl(n,t.offset),type:"home"}:{offset:rl(n,t.offset),type:"normal"}}function r8(n,t,e,r){const{lineIndex:i}=y1(t,e);if(i===0)return null;const o=fh(n,t,i-1,t,e,"up",r);return o||null}const i8=I("move-caret");function o8(n,t,e,r){if(r==="ArrowLeft"){const i=e8(t,e);return i?at(lt(t),i.offset,i.type):null}if(r==="ArrowRight"){const i=n8(t,e);return i?at(lt(t),i.offset,i.type):null}if(r==="ArrowUp"){const i=r8(n,t,e,n.selection.getSuggestedCaretX());return i?at(lt(t),i.offset,i.type):null}if(r==="ArrowDown"){const i=t8(n,t,e,n.selection.getSuggestedCaretX());return i?at(lt(t),i.offset,i.type):null}p(i8,!1,`invalid navigation direction: ${r}`)}const D1=I("text-range");function rB(n){const t=[];return gi(n).forEach(r=>{const i=Array.from(r.getClientRects()).map(o=>({rect:o,child:r}));t.push(...i)}),t}function s8(n,t,e){const r=rB(n);for(let i=1;i<r.length;i++){const o=r[i-1],s=r[i];if(t>=o.rect.right&&t<=s.rect.left&&e>=o.rect.top&&e<=o.rect.bottom&&e>=s.rect.top&&e<=s.rect.bottom)return Yo(n,s.child).start}return null}function l8(n,t,e,r){const i=Ae(e,r);if(!i||!t.contains(i)||!n.contains(t))return null;const o=t.getBoundingClientRect(),s=rB(t);let l=e,c=r,d=o.left+o.width/2,h=o.top+o.height/2,C=d,E=h;s.forEach(Ct=>{d=Math.min(d,Ct.rect.left),h=Math.min(h,Ct.rect.top),C=Math.max(C,Ct.rect.right),E=Math.max(E,Ct.rect.bottom)}),l>=o.left&&l<d?l=d:l<=o.right&&l>C&&(l=C),c>=o.top&&c<h?c=h:c<=o.bottom&&c>E&&(c=E);const x=i.closest("div[data-type=block-content]>span");if(!x){const Ct=t.getBoundingClientRect();if(!Ws(Ct,l,c))return null;const yt=s8(t,l,c);if(yt!==null){const Gt=at(t,yt,"normal");return new rn(n,{anchor:Gt,focus:Gt})}const bt=YD(t,l,c);return bt?new rn(n,{anchor:bt,focus:bt}):null}const B=gi(t);p(D1,B.indexOf(x)!==-1,"failed to find child in children");const k=Yo(t,x);p(D1,k,"failed to get child offset");const{start:w}=k;let U,M;Ji(x)||Qn(x)?(U=w,M=0):(p(D1,x.firstChild instanceof Text,"child is not text"),U=w+Fb(x.firstChild,l,c),M=0);const F=lt(t),X=pu(t).find(Ct=>Ct.offset===U);let G="normal";if(X){const Ct=at(F,U,"home"),yt=at(F,U,"end"),bt=Jn(t,Ct),Gt=Jn(t,yt),Pe=jo(bt,l,c),he=jo(Gt,l,c);G=Pe<he?"home":"end"}const st=at(F,U,G);let pt;return M&&(pt=at(F,U+M,G)),new rn(n,{anchor:st,focus:pt!=null?pt:st})}const a8=I("create-text-op");function Er(n,t){p(a8,n,"text is empty");const e={insert:n};return t&&Object.keys(t).length>0&&(e.attributes=t),e}function _1(n,t){if(n.length===0)return[];if(n.indexOf(`
|
|
15
|
+
*/function V9(n){if(typeof n=="string")return n.length===0?!1:n.charCodeAt(0)>=55296&&n.charCodeAt(0)<=56319;if(n===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isHighSurrogate(): the input is not string but ${typeof n}`)}function $9(n){if(typeof n=="string")return n.length===0?!1:n.charCodeAt(0)>=56320&&n.charCodeAt(0)<=57343;if(n===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isLowSurrogate(): the input is not string but ${typeof n}`)}const Yc="\u200B";function H9(n){return[...n].length}function j9(n,t,e){const i=[...n];let o;return e===void 0?o=i.length:o=t+e,i.slice(t,o).join("")}function z9(n){const t="\xA0";if(!n)return"";if(n===" ")return t;let e=n;return e.startsWith(" ")&&(e=t+e.substr(1)),e.endsWith(" ")&&(e=e.substr(0,e.length-1)+t),e=e.replace(/ {2}/g,` ${t}`),e}function jd(n){if(!/["'&<>]/.exec(n))return n;const r={'"':""","'":"'","&":"&","<":"<",">":">"};return n.split("").map(l=>r[l]||l).join("")}function Hb(n){const t=document.getElementById(n);t&&t.remove()}function jb(n,t){const e=document.getElementById(t);if(e)return e.textContent=n,e;const r=document.createElement("style");return r.id=t,r.textContent=n,document.head.append(r),r}function Qc(n){const t="custom-cursor-style";if(n){const e=`body * { cursor: ${n} !important}`;jb(e,t)}else Hb(t)}const zb=3,Gb=I("drag-drop");class Wb{constructor(t){m(this,"dragStarted",!1);m(this,"mouseDownEvent",null);m(this,"_dragOffsetX",0);m(this,"_dragOffsetY",0);m(this,"handleMouseDown",t=>{t.preventDefault(),t.stopPropagation(),this.mouseDownEvent=t;const e=this.options.elem.getBoundingClientRect();this._dragOffsetX=this.mouseDownEvent.x-e.left,this._dragOffsetY=this.mouseDownEvent.y-e.top,this.bindEvents()});m(this,"handleMouseMove",t=>{var o;t.preventDefault(),t.stopPropagation(),p(Gb,this.mouseDownEvent,"no mouse down event");const e=t.x-this.mouseDownEvent.x,r=t.y-this.mouseDownEvent.y;if(this.dragStarted){this.onDragging(t,e,r);return}const i=(o=this.options.minThreshold)!=null?o:zb;(Math.abs(e)>=i||Math.abs(r)>=i)&&this.onDragStart(this.mouseDownEvent)});m(this,"handleMouseUp",t=>{if(t.button===0){p(Gb,this.mouseDownEvent,"no mouse down event");const e=t.x-this.mouseDownEvent.x,r=t.y-this.mouseDownEvent.y;this.onDragEnd(t,e,r),t.preventDefault(),t.stopPropagation()}});this.options=t,this.options.mouseDownEvent?this.handleMouseDown(this.options.mouseDownEvent):this.trackEvents()}get data(){return this.options.data}get dragOffsetX(){return this._dragOffsetX}get dragOffsetY(){return this._dragOffsetY}get dragOffset(){return{x:this._dragOffsetX,y:this._dragOffsetY}}trackEvents(){this.options.elem.addEventListener("mousedown",this.handleMouseDown)}untrackEvents(){this.options.elem.removeEventListener("mousedown",this.handleMouseDown)}bindEvents(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}unbindEvents(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}onDragStart(t){this.dragStarted=!0,this.options.cursor&&Qc(this.options.cursor),this.options.onDragStart(this,t,this.options.elem)}onDragging(t,e,r){this.options.onDragging(this,t,this.options.elem,e,r)}onDragEnd(t,e,r){this.options.cursor&&Qc(null),this.dragStarted&&this.options.onDragEnd(this,t,this.options.elem,e,r),this.unbindEvents(),this.dragStarted=!1}destroy(){this.unbindEvents(),this.untrackEvents()}}function Og(n){return new Wb(n)}const G9=I("character");function qb(n,t){for(let e=0;e<t.length;e++){const r=t[e][0],i=t[e].length>1?t[e][1]:null;if(i===null&&n===r||i!==null&&n>=r&&n<=i)return!0}return!1}function Xb(n){const t=n.charAt(0);return t>="0"&&t<="9"}function Yb(n){const t=n.charAt(0);return t>="a"&&t<="z"||t>="A"&&t<="Z"||t.toUpperCase()!==t.toLowerCase()?!0:RegExp(/^\p{L}/,"u").test(t)}function zd(n){const t=[[9,13],[32],[160]];return qb(n.charCodeAt(0),t)}function Qb(n){const t=[[12352,12687],[13056,13183],[13312,15661],[19968,40959],[63744,64255],[44032,55215]];return qb(n.charCodeAt(0),t)}function Ng(n,t){let e=t;return p(G9,e.length===1,"invalid char length"),e==="]"&&(e="\\]"),e==="\\"&&(e="\\\\"),n.replace(new RegExp(`^[${e}]+|[${e}]+$`,"g"),"")}function Pg(n){return n?n.length===1||n==="Process"||n==="Unidentified"&&ie.isAndroid:!1}function Jb(n){switch(n){case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":case"End":case"Home":case"PageDown":case"PageUp":return!0;default:return!1}}function W9(n){return Jb(n.key)}function q9(n){switch(n){case"ArrowUp":case"ArrowLeft":case"Home":case"PageUp":return!0;default:return!1}}function qs(n){return n.ctrlKey||n.altKey||n.shiftKey||n.metaKey}function X9(n){return n.key?!!(n.ctrlKey||n.metaKey||n.altKey):!1}function Zb(n){return ie.isMac?n.metaKey&&!n.ctrlKey:!n.metaKey&&n.ctrlKey}function Y9(n){return Zb(n)&&!n.altKey&&!n.shiftKey}function Q9(n){return!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.altKey}function tv(n){return!qs(n)&&n.key==="Enter"}function J9(n){return n.key==="Enter"&&n.shiftKey&&!n.altKey&&!n.ctrlKey&&!n.metaKey}function Gd(n){return!qs(n)&&n.key==="Escape"}function Z9(n){return!qs(n)&&n.key==="Delete"}function ev(n){return!qs(n)&&n.key==="Backspace"}function tI(n){return!qs(n)&&n.key==="Tab"}function eI(n){return n.shiftKey&&n.key==="Tab"&&!n.ctrlKey&&!n.metaKey}function qe(n){if(!n)return"";if(ie.isMac){const t=n.replace("CtrlOrCmd","\u2318").replace("Shift","\u21E7").replace("Ctrl","\u2303").replace("Alt","\u2325").replace(/\+(?!$)/gm,""),e={"\u2318":4,"\u21E7":3,"\u2325":2,"\u2303":1};return t.split(/(?=[\s\S])/u).sort((i,o)=>{var c,d;const s=(c=e[i])!=null?c:5,l=(d=e[o])!=null?d:5;return s-l}).map(i=>i in e?`${i}+`:i).join("")}return n.replace("CtrlOrCmd","Ctrl")}function nv(n){const t={ctrl:!1,alt:!1,shift:!1,cmd:!1,key:""},e=n.toLocaleUpperCase().split("+");for(let r=0;r<e.length;r++){const i=e[r];i==="CTRL"||i==="CONTROL"?t.ctrl=!0:i==="ALT"||i==="OPTION"?t.alt=!0:i==="SHIFT"?t.shift=!0:i==="CMD"||i==="COMMAND"?t.cmd=!0:i==="CMDORCTRL"||i==="CTRLORCMD"?ie.isMac?t.cmd=!0:t.ctrl=!0:i==="SPACE"?t.key=" ":t.key=i.substring(0,1)+i.substring(1).toLocaleLowerCase()}return t}function di(n,t){const e=nv(t);return e.ctrl!==n.ctrlKey||e.alt!==n.altKey||e.shift!==n.shiftKey||ie.isMac&&e.cmd!==n.metaKey?!1:e.key.length===1?e.key===n.key.toUpperCase():e.key.toUpperCase()===n.key.toUpperCase()}function Fg(n,t){return w6.stringifyUrl({url:n,query:t})}function hi(n){return typeof n=="string"?zc.Base64.encode(n,!0):zc.Base64.fromUint8Array(n,!0)}function Jc(n){return zc.Base64.decode(n)}function nI(n){return zc.Base64.toUint8Array(n)}function Kg(n){return new Blob([zc.Base64.toUint8Array(n)])}const rI=$o.init([$o.classModule,$o.styleModule,$o.datasetModule,$o.attributesModule,$o.propsModule]);function Zc(n,t){const e=$o.toVNode(n),r=$o.toVNode(t);rI(e,r)}async function Vg(n,t){const e=new FileReader,r=new Promise((o,s)=>{e.onload=o,e.onerror=s});return e.readAsDataURL(new Blob([n],{type:t})),await r,e.result}async function ma(n){const t=new FileReader,e=new Promise((i,o)=>{t.onload=i,t.onerror=o});return t.readAsDataURL(n),await e,t.result}function iI(n,...t){const e=n.tagName.toLowerCase();for(let r=0,i=t.length;r<i;r++)if(e===t[r].toLowerCase())return!0;return!1}function Xe(n,t){let e=n;for(;e;){const r=window.getComputedStyle(e);if(t!=null&&t.horizontal){if(/auto|scroll/i.test(r.overflowX))break}else if(/auto|scroll/i.test(r.overflowY))break;e=e.parentElement}return(!e||iI(e,"body"))&&(e=document.documentElement),e}function rv(n){n.preventDefault(),n.stopPropagation()}function $g(n){if(document.querySelector(`.editor-disable-scroll[data-scroll-id="${n}"]`))return;const t=v("div",["editor-disable-scroll"],null);t.setAttribute("data-scroll-id",n),t.addEventListener("wheel",rv,{passive:!1}),document.body.appendChild(t)}function Hg(n){const t=document.querySelector(`.editor-disable-scroll[data-scroll-id="${n}"]`);t&&(t.removeEventListener("wheel",rv),t.remove())}function jg(n,t,e){const r=new Blob([n]),i=new File([r],e,{type:t});return URL.createObjectURL(i)}function Wd(n){const t=document.createElement("template");if("content"in t)return t.innerHTML=n,document.importNode(t.content,!0);const e=document.createDocumentFragment(),r=document.createElement("div");for(r.innerHTML=n;r.firstChild;)e.appendChild(r.firstChild);return e}function iv(n){const t=document.createElement("div");return t.appendChild(n),t.innerHTML}function ov(n){let t=n.getPropertyValue("font");if(t)return t;const e=n.getPropertyValue("font-style"),r=n.getPropertyValue("font-variant"),i=n.getPropertyValue("font-weight"),o=n.getPropertyValue("font-size"),s=n.getPropertyValue("font-family");return t=`${e} ${r} ${i} ${o} ${s}`.replace(/ +/g," ").trim(),t}function qd(n,t){const r=(qd.canvas||(qd.canvas=document.createElement("canvas"))).getContext("2d");return r?(typeof t=="string"?t?r.font=t:r.font=ov(window.getComputedStyle(document.body)):t instanceof Element&&(r.font=ov(window.getComputedStyle(t))),r.measureText(n).width+4):200}const sv=I("editor-clipboard");async function oI(n,t){if(t.clipboardData){const e=t.clipboardData;for(const r of n)e.setData(r.type,r.data);return!0}return!1}function sI(n){return typeof n.text=="function"?n.text():new Promise((t,e)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=e,r.readAsText(n)})}async function lI(n){var t;if(document.queryCommandSupported&&document.queryCommandSupported("copy")){const e=document.createElement("textarea");try{let r=(t=n.find(i=>i.type==="text/plain"))==null?void 0:t.data;return r instanceof Blob&&(r=await sI(r)),e.textContent=r!=null?r:"",e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),!0}catch(r){return sv.error(r),document.body.removeChild(e),!1}}return!1}async function tu(n){try{const t={};n.forEach(r=>{t[r.type]=r.data});const e=new ClipboardItem(t);return await navigator.clipboard.write([e]),!0}catch(t){return sv.error(t),await lI(n)}}function ga(n,t){return new Promise((e,r)=>{const i=document.createElement("input");i.type="file",i.style.display="none";const o=(t==null?void 0:t.container)||document.body;t!=null&&t.multiple&&(i.multiple=!0),i.accept=n,i.oncancel=()=>{e(null),i.remove()},i.onchange=()=>{const s=i.files;if(s){const l=t!=null&&t.multiple?Array.from(s):s[0];e(l)}i.remove()},i.onerror=s=>{r(s),i.remove()},o.append(i),i.click()})}function Xd(n){return Array.isArray(n)?n.every(t=>t instanceof File):!1}function eu(n){const t=n;if(!t)return"";const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1)}function Yd(n,t){const e=document.createElement("a");e.setAttribute("download",`${t||""}`),e.setAttribute("href",`${n}`),e.click(),e.remove()}const lv=I("auto-scroll");function av(n,t){return!(n.scrollHeight===n.clientHeight||t==="top"&&n.scrollTop===0||t==="bottom"&&n.scrollTop+n.clientHeight===n.scrollHeight||t==="left"&&n.scrollLeft===0||t==="right"&&n.scrollLeft+n.clientWidth===n.scrollWidth)}function cv(n,{direction:t,step:e}){let r=null;const i=t==="left"||t==="right",o=()=>av(n,t)?(i?t==="left"?n.scrollLeft=Math.max(n.scrollLeft-e,0):n.scrollLeft=Math.min(n.scrollLeft+e,n.scrollWidth):t==="top"?n.scrollTop=Math.max(n.scrollTop-e,0):n.scrollTop=Math.min(n.scrollTop+e,n.scrollHeight),r=requestAnimationFrame(o),r):(lv.debug("No need for scroll"),null);return r=requestAnimationFrame(o),()=>{r&&cancelAnimationFrame(r)}}class Qd{constructor(t){m(this,"cancelScroll",null);m(this,"options");m(this,"scrollDomInfo");m(this,"scrolling",!1);m(this,"getScrollingDirection",t=>{const{x:e,y:r}=t,{top:i,bottom:o,left:s,right:l}=this.scrollDomInfo,{edge:c}=this.options;return c.top&&r<=c.top+i?"top":c.bottom&&r>=o-c.bottom?"bottom":c.left&&e<=s+c.left?"left":c.right&&e>=l-c.right?"right":null});m(this,"handleMouseMove",t=>{var s;const{scrollElement:e,step:r=10,onDirectionChange:i}=this.options,o=this.getScrollingDirection(t);if(o){if(this.scrolling)return;lv.debug(`scroll direction: ${o}`),this.cancelScroll=cv(e,{direction:o,step:r}),i==null||i(o),this.scrolling=!0}else(s=this.cancelScroll)==null||s.call(this),this.scrolling=!1});this.options=t,this.scrollDomInfo=this.getScrollDomInfo()}getScrollDomInfo(){const{scrollElement:t}=this.options,e=t.getBoundingClientRect(),r=e.top,i=e.left,o=e.bottom,s=e.right;return{left:i,top:r,right:s,bottom:o}}active(){const{trackMouseEvent:t="mousemove"}=this.options;window.addEventListener(t,this.handleMouseMove,!0)}inactive(){var e;const{trackMouseEvent:t="mousemove"}=this.options;window.removeEventListener(t,this.handleMouseMove,!0),(e=this.cancelScroll)==null||e.call(this),this.scrolling=!1}}function uv(n,t){if(n===0)return"0 Bytes";const e=1024,r=t||2,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(n)/Math.log(e));return`${parseFloat((n/e**o).toFixed(r))} ${i[o]}`}function nu(n,t){let e=`${n}`;const r=t-e.length;for(let i=0;i<r;i++)e=`0${e}`;return e}const{t:Xs}=D;function zg(n,t){const e=new Date(n).getTime()+864e5*t;return new Date(e)}function aI(n,t){const e=n,r=Math.floor(t/12),i=t-r*12;return r&&e.setFullYear(e.getFullYear()+r),i&&e.setMonth(e.getMonth()+i),e}function cI(n,t){return zg(n,t)}function Gg(n,t){const e=new Date(n),r=new Date(t);return e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()}function fv(n){const t=new Date,e=new Date(n);return Gg(t,e)}function dv(n){const t=zg(new Date,-1);return Gg(t,n)}function uI(n,t){return Math.round((n.getTime()-t.getTime())/864e5)}function Wg(n,t){const e=new Date(n);if(t){const r=e.getFullYear(),i=e.getMonth()+1,o=e.getDate(),s=e.getHours(),l=e.getMinutes();let c=t;return c=c.replace("YYYY",`${r}`),c=c.replace("MM",nu(i,2)),c=c.replace("DD",nu(o,2)),c=c.replace("M",`${i}`),c=c.replace("D",`${o}`),c=c.replace("hh",nu(s,2)),c=c.replace("mm",nu(l,2)),c=c.replace("h",`${s}`),c=c.replace("m",`${l}`),c}return n.toLocaleDateString()}function qg(n,t){const e=new Date(n),r=new Date;if(e.getTime()-r.getTime()>10*1e3)return D.t("date.dateFromFuture");if(fv(e)){const o=(r.getTime()-n.getTime())/1e3;if(o<10*60)return Xs("date.dateJustNow");if(o<60*60)return Xs("date.dateMinutesAgo",{num:`${Math.floor(o/60)}`});const s=Math.floor(o/60/60);return s===1?Xs("date.date1HourAgo"):Xs("date.dateHoursAgo",{num:`${s}`})}if(dv(n))return Xs("date.dateYesterday");const i=Math.floor((r.getTime()-n.getTime())/1e3/24/60/60)+1;return i<14?Xs("date.dateDaysAgo",{num:`${i}`}):i<28?Xs("date.dateWeeksAgo",{num:`${Math.round(i/7)}`}):Wg(n,t)}function Xg(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fI(n,t,e){return n.replace(new RegExp(Xg(t),"g"),e)}function dI(n,t,e){return n.replace(new RegExp(Xg(t),"gi"),e)}function hv(n,t,e){const i=document.createElement("canvas").getContext("2d");if(!i)return null;if(i.font=String(t),i.measureText(n).width>e){let s=0,l=0;for(;l<e;)l=i.measureText(n.slice(0,s)).width,s++;return`${n.slice(0,s-2)}...`}return n}const mv=/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f\uAC00-\uD7AF]/,gv=" -\x7F0-9!-/:-@[-`{-~\u0370-\u03FF\u0400-\u04FF",hI=new RegExp(`[${gv}]`),mI=new RegExp(`([^(${gv})])`,"g"),pv=/(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]/;function Cv(n){return n.length===0?0:n.split("").reduce((t,e)=>{const r=(t<<5)-t+e.charCodeAt(0);return r&r},0)}function gI(n,t=1){var r,i;return(i=((r=Array.from(n))==null?void 0:r.filter(o=>mv.test(o))).slice(-t))==null?void 0:i.join("")}function pI(n,t=1){var i;const e=Array.from((i=n==null?void 0:n.replace(mI,""))==null?void 0:i.split(/\s/));return e.reduce((o,s,l)=>{var c,d;return l===e.length-1&&o.length<t?`${o}${(c=s==null?void 0:s.slice(0,t-o.length))!=null?c:""}`:`${o}${(d=s[0])!=null?d:""}`},"").slice(0,t)}function CI(n,t=1){var r,i;return(i=((r=Array.from(n))==null?void 0:r.filter(o=>pv.test(o))).slice(-t))==null?void 0:i.join("")}function EI(n,t=1){var e,r;return(r=(e=Array.from(n))==null?void 0:e.slice(0,t))==null?void 0:r.join("")}function Jd(n,t=1){if(!n||n.length===0)return"";const e=mv.test(n),r=hI.test(n),i=pv.test(n);switch(!0){case e:return gI(n,t);case r:return pI(n,t);case i:return CI(n,t);default:return EI(n,t)}}var Ev=(n=>(n.blue="#0064FF",n.cyan="#34AFDE",n.teal="#2CB2AE",n.green="#24B47E",n.kelly="#8AAB3F",n.yellow="#F0A100",n.orange="#EB6414",n.red="#E52727",n.fuchsia="#BE507D",n.purple="#9678D3",n))(Ev||{});function Zd(n){const t=Object.values(Ev),e=Math.abs(typeof n=="string"&&n.trim()?Cv(n.trim()):0)%t.length;return t[e]}const xv=I("element");function Yg(n,t,e){const r=v("div",[t],n);return r.setAttribute("data-type","editor-container"),r.setAttribute("data-container-id",e),v("div",["container-blocks"],r),r}function Ur(n,t){const e=n.rootElement.querySelector(`[data-container-id=${t}]`);return p(xv,e,`no container: ${t}`),e}function ru(n,t){return n.rootElement.querySelector(`[data-container-id=${t}]`)}function iu(n){const t=n.querySelector(":scope > .container-blocks");return p(xv,t,"no container blocks element"),t}function xI(n){let t=n.querySelector(":scope > .container-tools");return t||(t=v("div",["container-tools"],n)),t}const Qg=I("container-children");function fe(n){const t=iu(n),e=Array.from(t.children);return p(Qg,e.length>0,"container have not any child block"),e}function be(n){const t=n.querySelector(":scope > .container-blocks > div[data-type=editor-block]");return p(Qg,t,"container have not any child block"),t}function Ue(n){const t=fe(n);return t[t.length-1]}function Or(n){return fe(n).length}function zo(n,t){const e=fe(n)[t];return p(Qg,e,`container have not block at index ${t}`),e}function Av(n,t){var e;return(e=fe(n)[t])!=null?e:null}class AI{constructor(t){m(this,"renders",[]);this.editor=t}registerRender(t){this.renders.push(t)}renderBox(t,e){const r={classes:[],attributes:{},styles:{}};return this.renders.forEach(i=>{if(i.renderBox){const o=i.renderBox(this.editor,t,e);o.classes&&r.classes.push(...o.classes),o.attributes&&(r.attributes={...r.attributes,...o.attributes}),o.styles&&(r.styles={...r.styles,...o.styles})}}),r}renderText(t,e){const r={classes:[],attributes:{},styles:{}};return this.renders.forEach(i=>{if(i.renderText){const o=i.renderText(this.editor,t,e);o.classes&&r.classes.push(...o.classes),o.attributes&&(r.attributes={...r.attributes,...o.attributes}),o.styles&&(r.styles={...r.styles,...o.styles})}}),r}renderBlock(t,e,r){const i={classes:[],attributes:{},styles:{}};return this.renders.forEach(o=>{if(o.renderBlock){const s=o.renderBlock(this.editor,e,r);s.classes&&i.classes.push(...s.classes),s.attributes&&(i.attributes={...i.attributes,...s.attributes}),s.styles&&(i.styles={...i.styles,...s.styles})}}),i}updateBlock(t,e,r,i){this.renders.forEach(o=>{var s;(s=o.updateBlock)==null||s.call(o,t,e,r,i)})}}const bv=I("block-class");function Qt(n,t){return n.editorBlocks.getBlockClass(Dt(t))}function vv(n,t){const e=n.editorBlocks.getBlockClass(Dt(t));return p(bv,e.blockKind==="text",`is not a text block, ${e.blockType}`),e}function hr(n,t){const e=n.editorBlocks.getBlockClass(Dt(t));return p(bv,e.blockKind==="complex",`is not a text block, ${e.blockType}`),e}function Ys(n,t){return n.editorBlocks.getBlockClass(t)}function rt(n,t){return Qt(n,t).blockKind==="text"}function ou(n,t){return n.editorBlocks.getBlockClass(t).blockKind==="text"}function It(n,t){return Qt(n,t).blockKind==="complex"}function bI(n,t){return!It(n,t)}function Nr(n,t){return Qt(n,t).blockKind}class Re extends ye.TypedEmitter{constructor(e){super();m(this,"hoveringBlock",null);m(this,"hoveringTextChild",null);m(this,"filters",[]);m(this,"finders",[]);m(this,"handleDocumentMouseMove",e=>{if(this.hoveringBlock){for(const s of this.filters)if(s.isInBlock(this.hoveringBlock,e))return}const r=Ae(e.x,e.y,{noFilter:!0});if(!r){this.setHoveringBlock(null,e,null);return}let i=Z(r);if((!i||!re(this.editor.rootContainer,i))&&(i=this.findBlockByFinders(e),!i)){this.setHoveringBlock(null,e,null);return}const o=this.getParentTextContentChild(i,r);this.setHoveringBlock(i,e,o)});this.editor=e,document.addEventListener("mousemove",this.handleDocumentMouseMove)}destroy(){document.removeEventListener("mousemove",this.handleDocumentMouseMove),this.filters.forEach(e=>e.destroy()),this.filters=[],this.finders.forEach(e=>e.destroy()),this.finders=[]}addFilter(e){this.filters.push(e)}addFinder(e){this.finders.push(e)}hoveringBlockId(){return this.hoveringBlock?lt(this.hoveringBlock):""}findBlockByFinders(e){for(let r=0;r<this.finders.length;r++){const o=this.finders[r].findTargetBlock(this.editor,e);if(o)return o}return null}setHoveringBlock(e,r,i){if(this.hoveringBlock===e&&this.hoveringTextChild===i)return;if(this.hoveringBlock!==e){const s=this.hoveringBlock&&re(this.editor.rootContainer,this.hoveringBlock)?this.hoveringBlock:null;s&&ot(s,"hover"),e&&z(e,"hover"),this.hoveringBlock=e,this.emit("change",this.hoveringBlock,s,r)}const o=this.hoveringTextChild;this.hoveringTextChild=i,this.emit("childChange",this.hoveringBlock,i,o,r)}static get(e){return e.addCustom("standard-hovering-block",()=>new Re(e))}getParentTextContentChild(e,r){if(!rt(this.editor,e))return null;const i=Nt(e);return r.parentElement===i?r:t1(r)}}const Bv="style-color-",Tv="style-bg-color-";class yv{renderText(t,e,r){return this.generateCSSCustomProperties(r)}renderBlock(t,e,r){var l,c;const i={};Object.entries(r).filter(d=>d[0].startsWith("style-")).forEach(([d,h])=>{i[`data-${d}`]=`${h}`});const s=[];return((c=(l=t.selection)==null?void 0:l.range)==null?void 0:c.start.blockId)===r.id&&s.push("focused"),typeof r.align=="string"&&r.align&&(i["data-style-align"]=r.align),r.heading&&(i["data-style-heading"]=String(r.heading)),r.quoted&&(i["data-style-quoted"]="true"),Re.get(t).hoveringBlockId()===r.id&&s.push("hover"),{attributes:i,classes:s}}updateBlock(t,e,r,i){var s,l;Array.from(r.attributes).forEach(c=>{c.name.startsWith("data-style-")&&r.removeAttribute(c.name)}),Object.entries(i).filter(c=>c[0].startsWith("style-")||c[0]==="align").forEach(([c,d])=>{c==="align"&&r.setAttribute(c.startsWith("style-")?`data-${c}`:`data-style-${c}`,`${d}`)}),((l=(s=t.selection)==null?void 0:s.range)==null?void 0:l.start.blockId)===i.id&&z(r,"focused"),Re.get(t).hoveringBlockId()===i.id&&z(r,"hover")}generateCSSCustomProperties(t){const e=[],r={},i={};return Object.entries(t).forEach(([o,s])=>{s===!0?o.startsWith(Bv)?r["data-style-color"]=o.substring(Bv.length):o.startsWith(Tv)?r["data-style-bg-color"]=o.substring(Tv.length):o.startsWith("style")&&e.push(o):typeof s=="string"&&(o==="link"&&(e.push("link"),r.link=s),o==="inline-style-color"&&(i.color=s),o==="inline-style-background-color"&&(i.backgroundColor=s))}),{classes:e,attributes:r,styles:i}}}const Pr=I("block-dom");function Qs(n){return n instanceof HTMLDivElement?n.getAttribute("data-type")==="editor-block":!1}function kv(n){return n instanceof HTMLElement&&n.getAttribute("data-type")==="block-tools"}function Rv(n){z(n,"block-hidden")}function Jg(n){ot(n,"block-hidden")}function Go(n){return!wt(n,"block-hidden")}function lt(n){const{id:t}=n;return p(Pr,t,"no block id"),t}function Dt(n){const t=n.getAttribute("data-block-type");return p(Pr,t,"invalid block dom, no data-type"),t}function Z(n){const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest("div[data-type=editor-block]");return e||null}function Js(n){const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest("div[data-type=editor-block]:not(:scope)");return e||null}function it(n){const t=n.closest("div[data-type=editor-container]");return p(Pr,t,"failed to get block container"),t}function Nt(n){const t=n.querySelector(":scope >div[data-type=block-content]");return p(Pr,t,"no block content"),t}function oe(n){let t=n.querySelector(":scope >div[data-type=block-tools]");return t||(t=v("div",[],n),t.setAttribute("data-type","block-tools")),p(Pr,t,"no block tools"),t}function th(n){const t=n.querySelector(":scope >div[data-type=block-tools]");return t||null}function Zg(n){let t=n.querySelector(":scope > div[data-type=block-background]");return t||(t=v("div",[],n),t.setAttribute("data-type","block-background")),t}function wv(n,t,e){const r=n.editorDecorators.decorateBlock(t,e),{id:i,type:o}=r;p(Pr,i,"no block id");const s=v("div",[`${o}-block`],null);s.id=i,s.setAttribute("data-type","editor-block"),s.setAttribute("data-block-type",o);const l=n.editorBlockRenders.renderBlock(n,t,e);return l.classes&&z(s,...l.classes),l.attributes&&Object.entries(l.attributes).forEach(([c,d])=>{s.setAttribute(c,d)}),l.styles&&Object.entries(l.styles).forEach(([c,d])=>{s.style.setProperty(c,d)}),s}function Zs(n,t){const e=v(t,[],null);return e.setAttribute("data-type","block-content"),n&&n.appendChild(e),e}function Sv(n){const t=v("span",[`${n.type}-box`],null);return t.setAttribute("data-type","editor-box"),t.setAttribute("data-box-type",n.type),t.id=n.id,t}function su(n){const t=n.getAttribute("data-box-type");return p(Pr,t,"not a valid box element, no type"),t}function eh(n){return n instanceof HTMLSpanElement?n.getAttribute("data-type")==="editor-box":!1}function Lv(n){const{id:t}=n;return p(Pr,t,"no box id"),t}function t1(n){const t=n instanceof Element?n:n.parentElement;if(!t)return null;const e=t.closest("span[data-type=editor-box]");return e||null}function Iv(n){n.innerHTML="",v("span",["box-space-start"],n,Yc);const t=v("span",[],n);return t.setAttribute("data-type","box-content"),v("span",["box-space-start"],n,Yc),t}function e1(n){const t=n.querySelector("span[data-type=box-content]");return p(Pr,t,"invalid box dom, no content"),t}function Dv(n,t,e){const r=v("span",[`${n}-insertion`],null);if(r.setAttribute("data-type","editor-insertion"),r.setAttribute("data-insertion-id",t),e){const i=new yv,{attributes:o}=i.generateCSSCustomProperties(e);o&&[...Object.entries(o)].forEach(s=>{const[l,c]=s;r.setAttribute(l,c)})}return r}function _v(n,t){return n.rootContainer.querySelector(`[data-insertion-id=${t}]`)}function Mv(n){n.innerHTML="",v("span",["insertion-space-start"],n,Yc);const t=v("span",[],n);return t.setAttribute("data-type","insertion-content"),v("span",["insertion-space-start"],n,Yc),t}function n1(n){const t=n.querySelector("span[data-type=insertion-content]");return p(Pr,t,"invalid insertion-child dom, no content"),t}function Oe(n){let t=n.previousElementSibling;for(;t;){if(Qs(t))return t;t=t.nextElementSibling}return null}function Jt(n){let t=n.nextElementSibling;for(;t;){if(Qs(t))return t;t=t.nextElementSibling}return null}function mr(n){let t=n.previousElementSibling;for(;t;){if(Qs(t)&&Go(t))return t;t=t.previousElementSibling}return null}function gr(n){let t=n.nextElementSibling;for(;t;){if(Qs(t)&&Go(t))return t;t=t.nextElementSibling}return null}function vt(n){const t=it(n),r=fe(t).indexOf(n);return p(Pr,r!==-1,"invalid block & container dom, failed to get block index"),r}function r1(n){return!n||!(n instanceof Node)?!1:!!Z(n)}function pa(n){if(!r1(n))return!1;const t=n,e=t instanceof Element?t:t.parentElement;return e?!!e.closest("div[data-type=block-tools]"):!1}function qi(n){return n.hasAttribute("data-document-title")}function Wo(n,t,e){return Qt(n,t).getCaretRect(t,e)}const Uv=I("container");function Xi(n){return n.getAttribute("data-type")==="editor-container"}function qt(n){return wt(n,"root")}function Fr(n){return wt(n,"child")}function ct(n){const t=n.getAttribute("data-container-id");return p(Uv,t,"no id for container"),qt(n)&&p(Uv,t==="root",`invalid root container id, : ${t}`),t}function Ov(n,t){const e=ct(n);return t.getContainerBlocks(e)}const i1=I("block");function dt(n,t){return Qt(n,t).getBlockTextLength(t)}function Nv(n){n.editorBlocks.forEach(t=>{t.clearSelection(n)})}function Pv(n,t,e,r){Qt(n,t).updateSelection(n,t,e,r)}function o1(n){for(;;){const t=it(n);if(qt(t))return n;const e=Z(t);p(i1,e,"no parent block exists for child container"),n=e}}function Fv(n,t){const e=Qt(n,t);if(!!e.getMinWidth)return e.getMinWidth(n,t)}function Kv(n,t,e){const r=Qt(n,t);r.handleBlockElementUpdated&&r.handleBlockElementUpdated(n,t,e)}function nh(n,t,e,r){try{const i=Ys(n,e).convertFrom;return i?i(n,t,r):null}catch{return i1.debug(`unsupported block type: ${e}`),null}}function Yi(n,t,e){const r=Qt(n,t);return r.getClientRects?r.getClientRects(n,t,e):[t.getBoundingClientRect()]}function vI(n,t){const e=Qt(n,t);if(e.getBlockStyles)return e.getBlockStyles(n,t);const r=n.getBlockData(t),i=Object.fromEntries(Object.entries(r).filter(([o])=>o.startsWith("style-")));return Object.entries(i).forEach(([,o])=>{const s=typeof o;p(i1,s==="string"||s==="number"||s==="boolean","invalid style value")}),i}function se(n,t){return Nr(n,t)==="text"?dt(n,t)===0:!1}const Vv=I("block-path");function qo(n){const t=[];let e=n;for(;e;){const r=it(e);if(t.unshift({containerId:ct(r),blockIndex:vt(e)}),qt(r))return t;const i=Z(r);p(Vv,i,"no parent block"),e=i}return p(Vv,!1,"no parent block"),[]}function BI(n,t){var i,o;const e=Qt(n,t);return(o=(i=e.getOptions)==null?void 0:i.call(e,n))!=null?o:{name:Dt(t)}}function pr(n){return qt(it(n))}function $v(n,t){var i;const e=Qt(n,t);return(i=e.getBlockProperties)==null?void 0:i.call(e,n,t)}function s1(n,t){var o,s;const e=Qt(n,t),r=(o=e.getBlockProperties)==null?void 0:o.call(e,n,t);let i={};r!=null&&r.blockCommands&&(i={...r.blockCommands});for(const l of n.blockHooks){const c=(s=l.commands)==null?void 0:s.call(l,n,t);c&&(i[c.group]=c)}return i}function TI(n,t,e){var s,l,c,d;const r=Qt(n,t),i=(s=r.getBlockProperties)==null?void 0:s.call(r,n,t);let o={};i!=null&&i.blockCommands&&(o={...i.blockCommands});for(const h of n.blockHooks){const C=(l=h.commands)==null?void 0:l.call(h,n,t);C&&(o[C.group]=C)}return(d=(c=o[e])==null?void 0:c.commands)!=null?d:[]}function Hv(n,t,e){let r=t;for(;r;){const i=TI(n,r,e);if(i.length>0)return{element:Nt(r),commands:i};if(pr(r))break;r=Js(r)}return{element:null,commands:[]}}const jv=I("embed-block-common");function pe(n){return Dt(n)==="embed"}function $e(n){p(jv,pe(n),"not an embed block");const t=n.getAttribute("data-embed-type");return p(jv,t,"no embed data type"),t}function yI(n,t){return n.editorEmbeds.getEmbedClass($e(t))}function tl(n,t){return n.editorEmbeds.getEmbedClass(t)}async function l1(n,t,e,r,i){const o=tl(n,t);if(!o.getOptions)return null;const s=o.getOptions(n);if(!s.insertEmbedCommandItems||!s.insertEmbedCommandItems||s.insertEmbedCommandItems.length===0||!s.handleInsertEmptyEmbed)return null;const l=s.insertEmbedCommandItems[0];return s.handleInsertEmptyEmbed(n,{item:l,containerId:e,blockIndex:r,data:i})}function kI(n,t,e,r,i){var l,c;const o=(c=(l=Ys(n,t)).getOptions)==null?void 0:c.call(l,n);if(!o||!o.insertBlockCommandItems||o.insertBlockCommandItems.length===0||!o.handleInsertEmptyBlock)return null;const s=o.insertBlockCommandItems[0];return o.handleInsertEmptyBlock(n,{item:s,containerId:e,blockIndex:r,data:i})}const RI=I("execute-block-command");function zv(n,t,e,r){var d;p(RI,pe(t),"not a embed block");const i=$e(t),o=tl(n,i);if(!o.getOptions)return;const s=(d=o.getBlockProperties)==null?void 0:d.call(o,n,t),l=s==null?void 0:s.blockCommands;if(!l)return;const c=Object.entries(l);for(const h of c)if(h[0]===e)return h[1].executeCommand(n,t,r)}function Gv(n,t,e,r){const i=s1(n,t);if(!i)return;const o=Object.entries(i);for(const s of o)if(s[0]===e)return n.emit("beforeExecCommand",n,r,{source:r.source}),s[1].executeCommand(n,t,r)}const Wv=I("block-class");function ln(n){return!!n.getAttribute("data-style-heading")}function lu(n){var e;const t=Number.parseInt((e=n.getAttribute("data-style-heading"))!=null?e:"",10);return p(Wv,t,"not a heading block"),t}function qv(n){return!wt(n,"heading-collapsed")}function mi(n){return wt(n,"heading-collapsed")}function Ca(n,t){t||p(Wv,ln(n),"not a heading block");const e=[],r=t!=null?t:lu(n);let i=Jt(n);for(;i&&!(ln(i)&&lu(i)<=r);)e.push(i),i=Jt(i);return e}function Xv(n){let t=Jt(n);const e=[];for(;t&&!Go(t);)e.push(t),t=Jt(t);return e}const Qi=I("text-block-child");function au(n){return n.tagName==="SPAN"}function Qn(n){return p(Qi,au(n),"not a valid text child"),n.getAttribute("data-type")==="editor-box"}function Ji(n){return p(Qi,au(n),"not a valid text child"),n.getAttribute("data-type")==="editor-insertion"}function cu(n){return!Qn(n)&&!Ji(n)}function Yv(n){return p(Qi,au(n),"not a valid text child"),Qn(n)?"box":Ji(n)?"insertion":"text"}function Cr(n){const t=Yv(n);return t==="insertion"?0:t==="box"?1:(p(Qi,n.textContent!==null,"text block content is undefined"),p(Qi,n.textContent.length>=0,"text block content length is negative"),n.textContent.length)}function gi(n){const t=Nt(n),e=Array.from(t.children);return e.forEach(r=>{p(Qi,au(r),"not a valid text child")}),e}function uu(n,t){const e=gi(n);let r=0;for(let i=0;i<e.length;i++){const o=e[i],s=Cr(o);if(r+s<t){r+=s;continue}if(r===t)return{prev:e[i-1],next:o,offset:0};if(r+s===t)return{prev:o,next:e[i+1],offset:0};const l=t-r;return p(Qi,l>0,"invalid offset value"),p(Qi,!Qn(o),"invalid box child"),{prev:o,next:o,offset:l}}p(Qi,!1,`invalid block child at position: ${t}`)}const wI=I("child-container-path");function Qv(n){if(qt(n))return[];const t=Z(n);return p(wI,t,"no parent block"),qo(t)}const Jv=I("load-blocks");function a1(n,t,e){const r=ct(t),i=Ov(t,n.doc);p(Jv,i.length>0,"no blocks in container");const o=document.createDocumentFragment();i.forEach((l,c)=>{const d=n.editorBlocks.createBlock([...e,{containerId:r,blockIndex:c}],t,l);o.appendChild(d)}),iu(t).appendChild(o)}function SI(n,t,e){const r=iu(n);if(t===0)return r.insertBefore(e,r.firstChild),e;const i=fe(n);return p(Jv,t>=0&&t<=i.length,"invalid block index"),t===i.length?r.appendChild(e):r.insertBefore(e,i[t]),e}function LI(n,t,e,r){const i=Qv(t);i.push({containerId:ct(t),blockIndex:e});const o=n.editorBlocks.createBlock(i,t,r);return SI(t,e,o),o}const c1=I("root-container"),Zv=3;class II{constructor(t,e){m(this,"resizeObserver");m(this,"isMoved",!1);m(this,"mouseDownEvent",null);m(this,"handleContextMenu",t=>{if(ie.isSafari){const e=document.getSelection();e&&!e.isCollapsed&&e.collapseToStart()}});m(this,"handleResize",()=>{try{this.editor.selection.updateSelection(null),this.editor.emit("resize",this.editor)}catch(t){c1.warn(`failed to update selection while container resizing: ${t.message}`)}});m(this,"handleClick",t=>{this.editor.emit("click",this.editor,t);const e=t.target;if(!pa(e)&&(t.detail===1&&this.editor.input.focus(),t.detail===3&&this.editor.selectionHandler.handleTripleClick(t),t.detail===1&&t.button===0)){const r=Ae(t.clientX,t.clientY);if(r&&re(this.rootContainer,r)){const i=Z(r);i&&re(i,r)&&this.handleBlockClick(t,i,r)}}});m(this,"handleBlockClick",(t,e,r)=>{var s,l;if(!rt(this.editor,e))return;const i=t1(r);if(i){const c=Z(i);p(c1,c,"no parent block"),(l=(s=this.editor.editorBoxes.getBoxClass(su(i)))==null?void 0:s.handleClickBox)==null||l.call(s,this.editor,i,t);return}const o=r.closest("span.text.link");o&&gi(e).indexOf(o)!==-1&&this.editor.emit("clickLink",this.editor,t,o)});m(this,"handleDblClick",t=>{pa(t.target)||this.editor.selectionHandler.handleDblClick(t)});m(this,"handleMouseDown",t=>{this.mouseDownEvent=t,this.isMoved=!1;const e=t.target;if(!!e&&e instanceof Node&&!pa(e)){if(t.button===2){t.stopPropagation();return}if(e instanceof HTMLElement&&e.draggable){this.editor.selectionHandler.handleMouseDown(t,{autoScroll:!1}),this.editor.selectionHandler.stopSelection(),this.editor.input.focus();return}t.button===0&&(document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),this.editor.selectionHandler.handleMouseDown(t,{autoScroll:!0})),ie.isMobileSafari||this.editor.input.focus()}});m(this,"handleMouseMove",t=>{p(c1,this.mouseDownEvent,"no mouse down event");const e=t.x-this.mouseDownEvent.x,r=t.y-this.mouseDownEvent.y;(Math.abs(e)>=Zv||Math.abs(r)>=Zv)&&(this.editor.selectionHandler.handleMouseMove(t),this.isMoved=!0)});m(this,"handleMouseUp",t=>{t.button===0&&(this.editor.selectionHandler.handleMouseUp(t),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)),this.isMoved&&(document.addEventListener("click",this.handleCaptureClick,!0),document.addEventListener("dblclick",this.handleCaptureDbClick,!0)),this.isMoved=!1});m(this,"handleCaptureClick",t=>{document.removeEventListener("click",this.handleCaptureClick,!0),t.stopPropagation()});m(this,"handleCaptureDbClick",t=>{document.removeEventListener("dblclick",this.handleCaptureDbClick,!0),t.stopPropagation()});this.editor=t,this.rootContainer=e,this.editor=t,this.resizeObserver=new Vs(this.handleResize),this.bindEvents(e)}bindEvents(t){this.resizeObserver.observe(t);const e=this.editor.rootElement;e.onmousedown=this.handleMouseDown,e.ondblclick=this.handleDblClick,e.onclick=this.handleClick,e.oncontextmenu=this.handleContextMenu}unbindEvents(){this.resizeObserver.disconnect();const t=this.editor.rootElement;t.onmousedown=null,t.ondblclick=null,t.onclick=null,t.oncontextmenu=null}destroy(){this.unbindEvents()}reload(){const t=this.editor.selection.range,e=iu(this.rootContainer);e.innerHTML="",a1(this.editor,this.rootContainer,[]);const r=this.editor.findBlockById(t.start.blockId);if(r)this.editor.selection.selectBlock(r,0);else{const i=be(this.rootContainer);this.editor.selection.selectBlock(i,0)}}}function t3(n){const t=Yg(n.contentElement,"root","root");return n.rootContainer=t,a1(n,t,[]),new II(n,t)}function e3(n,t,e,r){const i=ru(n,r);if(i)return e.appendChild(i),setTimeout(()=>{n.emit("containerRemount",n,r)}),i;const o=Yg(e,"child",r);return a1(n,o,t),o}function n3(n,t){const e=n.getBoundingClientRect().width;return t.withPadding?e:e-Dg(n)}function u1(n,t){let e=Number.MAX_SAFE_INTEGER;const r=fe(t);for(let o=0;o<r.length;o++){const s=r[o],l=Fv(n,s);l&&(e=Math.min(e,l))}return e===Number.MAX_SAFE_INTEGER?void 0:e+Dg(t)}function fu(n,t){const e=fe(t);return e.length!==1?!1:se(n,e[0])}const DI=I("complex-block-position");class Kr{constructor(t,e,r){m(this,"blockId");m(this,"childContainerId");m(this,"custom");t instanceof HTMLElement?this.blockId=lt(t):(p(DI,typeof t=="string",`not a valid block id: ${t}`),this.blockId=t),this.childContainerId=e,r!==void 0&&(this.custom=r)}isSimple(){return!1}}const _I=I("simple-block-position");class Ye{constructor(t,e,r){m(this,"blockId");m(this,"offset");m(this,"type");t instanceof HTMLElement?this.blockId=lt(t):(p(_I,typeof t=="string",`not a valid block id: ${t}`),this.blockId=t),this.offset=e,this.type=r}isSimple(){return!0}}const f1=I("editor-position");function at(n,t,e){return new Ye(n,t,e)}function xe(n,t,e){return new Kr(n,t,e)}function Vr(n){return n instanceof Ye}function el(n){return n instanceof Kr}function d1(n,t,e){if(Vr(t)&&Vr(e)){const r=t,i=e;if(r.blockId===i.blockId)return r.offset-i.offset;const o=n.getBlockById(t.blockId),s=n.getBlockById(e.blockId);return p(f1,o!==s,"comparePosition: blocks are the same"),Vd(o,s)}if(el(t)&&el(e)){const r=t,i=e;if(r.childContainerId===i.childContainerId)return 0;const o=n.getContainerById(r.childContainerId),s=n.getContainerById(i.childContainerId);return p(f1,o!==s,"comparePosition: containers are the same"),Vd(o,s)}return p(f1,!1,"invalid "),0}const rh=I("simple-range");class rn{constructor(t,e){m(this,"editor");m(this,"_anchor");m(this,"_focus");m(this,"reverse");this.editor=t,this._anchor=e.anchor,this._focus=e.focus,this.reverse=d1(this.editor,this._anchor,this._focus)>0}isCollapsed(){return this.start.blockId===this.end.blockId&&this.start.offset===this.end.offset}isEqual(t){if(!(t instanceof rn))return!1;const e=t,{start:r,end:i}=e;return this.start.blockId===r.blockId&&this.start.offset===r.offset&&this.start.type===r.type&&this.end.blockId===i.blockId&&this.end.offset===i.offset&&this.end.type===i.type}isSimple(){return!0}isReverse(){return this.reverse}getEditor(){return this.editor}get start(){return this.reverse?this._focus:this._anchor}get end(){return this.reverse?this._anchor:this._focus}get anchor(){return this._anchor}get focus(){return this._focus}getSelectedBlocks(){const{editor:t}=this,e=t.getBlockById(this.start.blockId),r=t.getBlockById(this.end.blockId);p(rh,e,"no start block"),p(rh,r,"no end block");const i=it(e),o=it(r);p(rh,i===o,"invalid range");const s=[];if(e===r)s.push({block:e,start:this.start,end:this.end});else{const l=vt(e),c=vt(r);p(rh,l<c,"invalid range, start > index"),s.push({block:e,start:this.start,end:at(e,dt(this.editor,e),"end")});const d=fe(i);for(let h=l+1;h<c;h+=1){const C=d[h];s.push({block:C,start:at(C,0,"home"),end:at(C,dt(this.editor,C),"end")})}s.push({block:r,start:at(r,0,"home"),end:this.end})}return s}getSelectedContainers(){return[]}getAnchorPos(){return this.isReverse()?this.end:this.start}getFocusedPos(){return this.isReverse()?this.start:this.end}clone(){return new rn(this.editor,this)}toDocRange(){return{anchor:this.anchor,focus:this.focus}}static from(t,e){return new rn(t,e)}}I("unknown-block");function MI(n,t,e,r,i){z(r,"unknown-block");const o=Zs(r,"div");return o.innerText=`unknown block (${i.type}): ${JSON.stringify(i)}`,o}function UI(n){return 1}function OI(n,t,e,r){return null}function NI(n,t,e,r){const i=Ae(e,r);if(!i||!t.contains(i)||!n.contains(t))return null;const o=lt(t),s=at(o,0,"home"),l=at(o,1,"end");return new rn(n,{anchor:s,focus:l})}function PI(n,t){const r=Nt(n).getBoundingClientRect();return new DOMRect(r.left+r.width/2,r.top,1,r.height)}function FI(n,t,e,r){z(t,"selected")}function KI(n){n.rootContainer.querySelectorAll("div.unknown-block[data-type=editor-block]").forEach(t=>{ot(t,"selected")})}function VI(n,t,e,r){return`[unknown block, ${t.type}]`}const $I={blockType:"unknown-block",blockKind:"embed",createBlockContent:MI,getBlockTextLength:UI,getRangeFromPoint:NI,moveCaret:OI,getCaretRect:PI,updateSelection:FI,clearSelection:KI,convertTo:VI},h1=I("editor-blocks");class r3{constructor(t){m(this,"blocks",new Map);this.editor=t}registerBlockClass(t){const e=t.blockType,r=this.blocks.get(e);p(h1,!r,`duplicated block type: ${e}`),this.blocks.set(e,t)}getBlockClass(t){const e=this.blocks.get(t);return p(h1,e,`unknown block type: ${t}`),e}hasBlock(t){return this.blocks.has(t)}createBlock(t,e,r){const i=wv(this.editor,t,r);let o;this.hasBlock(r.type)?o=this.getBlockClass(r.type):o=this.registerUnknownBlock(r.type);const s=o.createBlockContent(this.editor,t,e,i,r);return s.parentElement!==i&&(h1.warn("content parent is not block"),i.appendChild(s)),this.editor.blockHooks.forEach(l=>{var c;(c=l.create)==null||c.call(l,this.editor,t,e,i,r)}),i}forEach(t){this.blocks.forEach(t)}registerUnknownBlock(t){const e={...$I,blockType:t};return this.editor.editorBlocks.registerBlockClass(e),e}}const i3=I("editor-embeds");class o3{constructor(t){m(this,"objects",new Map);this.editor=t}registerEmbedClass(t){const e=t.embedType,r=this.objects.get(e);p(i3,!r,`duplicated embed object type: ${e}`),this.objects.set(e,t)}getEmbedClass(t){const e=this.objects.get(t);return p(i3,e,`unknown embed type: ${t}`),e}getEmbedClassFromBlock(t){return this.getEmbedClass($e(t))}forEach(t){this.objects.forEach(t)}}const s3=I("embed-block");function HI(n,t,e,r,i){const o=Zs(r,"div");p(s3,i.type==="embed",`not an embed data: ${JSON.stringify(i)}`);const s=i;return p(s3,s.embedType&&s.embedData,`not an embed data: ${JSON.stringify(s)}`),n.editorEmbeds.getEmbedClass(s.embedType).createEmbedContent(n,o,s,t,e,r),r.setAttribute("data-embed-type",s.embedType),o}function jI(n){return 1}function zI(n,t,e,r){return null}function GI(n,t,e,r){const i=Ae(e,r);if(!i||!t.contains(i)||!n.contains(t))return null;const o=lt(t),s=at(o,0,"home"),l=at(o,1,"end");return new rn(n,{anchor:s,focus:l})}function WI(n,t){const r=Nt(n).getBoundingClientRect();return new DOMRect(r.left+r.width/2,r.top,1,r.height)}function qI(n,t,e,r){z(t,"selected")}function XI(n){n.rootContainer.querySelectorAll("div.embed-block[data-type=editor-block][data-block-type=embed]").forEach(t=>{ot(t,"selected")})}function YI(n,t,e){let r=null;return n.editorEmbeds.forEach(i=>{var s,l;const o=(l=(s=i.convertFrom)==null?void 0:s.call(i,n,t,e))!=null?l:null;o&&(r=o)}),r}function QI(n,t,e,r){const i=tl(n,t.embedType);return i.convertTo?i.convertTo(n,t,e,r):""}function JI(n,t){const e=yI(n,t);return e.getBlockProperties?e.getBlockProperties(n,t):{}}function ZI(n){const t=new Map,e=[];return n.editorEmbeds.forEach(r=>{if(r.getOptions){const i=r.getOptions(n);i.insertEmbedCommandItems&&i.insertEmbedCommandItems.forEach(o=>{e.push(o),t.set(o.id,r)})}}),{name:"EmbedBlock",insertBlockCommandItems:e,async handleInsertEmptyBlock(r,i){const o=t.get(i.item.id);if(!o||!o.getOptions)return null;const s=o.getOptions(r);return s.handleInsertEmptyEmbed?s.handleInsertEmptyEmbed(r,i):null}}}function t7(n,t,e,r){const i=$e(t),o=tl(n,i);!o.handleDeleteBlock||o.handleDeleteBlock(n,t,e,r)}function e7(n,t,e){const r=$e(t),i=tl(n,r);return i.handleUpdateBlock?i.handleUpdateBlock(n,t,e):!1}function n7(n,t,e,r,i){const o=$e(t),s=tl(n,o);if(s.handleDropOver)return s.handleDropOver(n,t,e,r,i)}function r7(n,t,e,r,i){const o=$e(t),s=tl(n,o);if(s.handleDrop&&n.isWritable())return s.handleDrop(n,t,e,r,i)}async function i7(n,t,e){const r=t.embedType,i=n.editorEmbeds.getEmbedClass(r);if(i.toStandardDoc){const o=n.getBlockById(t.id),s=qo(o);return i.toStandardDoc(n,t,e,s)}}function o7(n,t){const e=t.embedType,r=n.editorEmbeds.getEmbedClass(e);return r.getResources?r.getResources(n,t):null}const l3={blockType:"embed",blockKind:"embed",createBlockContent:HI,getBlockTextLength:jI,getRangeFromPoint:GI,moveCaret:zI,getCaretRect:WI,updateSelection:qI,clearSelection:XI,convertFrom:YI,convertTo:QI,getBlockProperties:JI,getOptions:ZI,handleDeleteBlock:t7,handleUpdateBlock:e7,handleDropOver:n7,handleDrop:r7,toStandardDoc:i7,getResources:o7},Tn=I("complex-block-helper");function an(n,t,e){return hr(n,t).getChildContainers(n,t,e)}function Ea(n,t,e,r){return e.isSimple()?(p(Tn,r.isSimple(),"invalid start and end position"),an(n,t)):(p(Tn,!e.isSimple(),"invalid start pos"),p(Tn,!r.isSimple(),"invalid end pos"),hr(n,t).getSelectedContainers(n,t,e,r))}function s7(n,t){if(vt(t)!==0)return!1;const e=Z(it(t));if(!e)return!1;p(Tn,It(n,e),"not a complex block");const r=it(t),o=an(n,e).indexOf(r);return p(Tn,o>=0,"not valid child container"),o===0}function m1(n,t,e){const r=an(n,t,e);if(r.length===0)return null;const i=r[0];if(!i)return null;const o=be(i);return It(n,o)?m1(n,o,e):o}function xa(n,t,e){const r=an(n,t,e);if(r.length===0)return null;const i=r[r.length-1];if(!i)return null;const o=Ue(i);return It(n,o)?xa(n,o,e):o}function a3(n,t){const e=o=>{const s=an(n,o,{visibleOnly:!0});return s.length===0?null:s[0]};let r=t,i=be(r);for(;It(n,i);){if(r=e(i),!r)return null;i=be(r)}return i}function c3(n,t,e){p(Tn,Fr(t),"not a child container");const r=Z(t);p(Tn,r,"no parent block"),p(Tn,It(n,r),"not a complex block");const i=an(n,r,e),o=i.indexOf(t);if(p(Tn,o!==-1,"child container not found"),o===0){const c=Oe(r);return c?It(n,c)?xa(n,c):c:null}const s=i[o-1],l=Ue(s);return It(n,l)?xa(n,l):l}function u3(n,t){p(Tn,It(n,t),"not a complex block");const e=an(n,t);if(p(Tn,e.length>0,"no child container"),e.length===1)return e;const r=e[0],i=r.getBoundingClientRect();let o=i.left,s=i.right;const l=[r];for(let c=1;c<e.length;c++){const d=e[c],h=d.getBoundingClientRect();if(h.right<=o){l.push(d),o=h.left;continue}if(h.left>=s){s=h.right;continue}}return l}function f3(n,t){p(Tn,It(n,t),"not a complex block");const e=an(n,t);if(p(Tn,e.length>0,"no child container"),e.length===1)return e;const r=e[e.length-1],i=r.getBoundingClientRect();let o=i.left,s=i.right;const l=[r];for(let c=e.length-2;c>=0;c--){const d=e[c],h=d.getBoundingClientRect();if(h.right<=o){l.push(d),o=h.left;continue}if(h.left>=s){s=h.right;continue}}return l}function l7(n,t,e,r){const i=t.getBoundingClientRect(),o=r<i.top,s=o?u3(n,t):f3(n,t);let l=s[0],c=jo(l.getBoundingClientRect(),e,r);for(let d=1;d<s.length;d++){const h=s[d],C=h.getBoundingClientRect(),E=jo(C,e,r);E<c&&(l=h,c=E)}return o?be(l):Ue(l)}function ih(n,t,e,r){const i=lt(t);p(Tn,i===e.blockId,"invalid start pos"),p(Tn,i===r.blockId,"invalid end pos");const o=hr(n,t);return o.adjustSelectionPos?o.adjustSelectionPos(n,t,e,r):{anchor:e,focus:r}}class pi{constructor(t,e){m(this,"editor");m(this,"reverse");m(this,"_anchor");m(this,"_focus");this.editor=t,this._anchor=e.anchor,this._focus=e.focus,this.reverse=d1(this.editor,this._anchor,this._focus)>0}isCollapsed(){return!1}isEqual(t){if(!(t instanceof pi))return!1;const e=t,{anchor:r,focus:i}=e;return this._anchor.blockId===r.blockId&&this._anchor.childContainerId===r.childContainerId&&this._focus.blockId===i.blockId&&this._focus.childContainerId===i.childContainerId&&this._anchor.custom===r.custom&&this._focus.custom===i.custom}isReverse(){return this.reverse}isSimple(){return!1}getEditor(){return this.editor}get anchor(){return this._anchor}get focus(){return this._focus}get start(){return this.reverse?this._focus:this._anchor}get end(){return this.reverse?this._anchor:this._focus}getSelectedBlocks(){const t=this.start,e=this.end;return[{block:this.editor.getBlockById(t.blockId),start:t,end:e}]}getAnchorPos(){return this._anchor}getFocusedPos(){return this._focus}getSelectedContainers(){const t=this.editor.getBlockById(this._anchor.blockId);return Ea(this.editor,t,this.start,this.end)}clone(){return new pi(this.editor,this)}toDocRange(){return{anchor:this._anchor,focus:this._focus}}}const a7=I("selection-range");function Qe(n,t){const{anchor:e,focus:r}=t;return e instanceof Ye&&r instanceof Ye?new rn(n,{anchor:e,focus:r}):(p(a7,e instanceof Kr&&r instanceof Kr,"start position type does not math end type"),new pi(n,{anchor:e,focus:r}))}function ve(n,t,e,r){const i=new Ye(t,e,"normal"),o=new Ye(t,r!=null?r:e,"normal");return Qe(n,{anchor:i,focus:o})}function c7(n){return!!n.anchor.childContainerId}function Xo(n,t){var i,o;if(c7(t)){const s=xe(t.anchor.blockId,t.anchor.childContainerId,(i=t.anchor)==null?void 0:i.custom),l=xe(t.focus.blockId,t.focus.childContainerId,(o=t.focus)==null?void 0:o.custom);return Qe(n,{anchor:s,focus:l})}const e=at(t.anchor.blockId,t.anchor.offset,"normal"),r=at(t.focus.blockId,t.focus.offset,"normal");return Qe(n,{anchor:e,focus:r})}const g1=I("range-from-point");function oh(n,t,e){const r=[0,-12,12];let i=t;const o=e;let s=Ae(i,o),l=Z(s);if(!l&&s&&n.contentElement.contains(s)){const c=n.rootContainer.getBoundingClientRect(),d=c.left+c.width/2;s=Ae(d,o),l=Z(s);let h=c;l&&(h=l.getBoundingClientRect()),t<h.left?i=h.left:t>h.right&&(i=h.right-5)}for(let c=0;c<r.length;c++){const d=Ae(i,o+r[c]);if(!d)continue;const h=d.getBoundingClientRect();if(d.clientWidth&&d.clientHeight&&c===0&&(h.left+d.clientWidth<i||h.top+d.clientHeight<o))return g1.debug("click on scrollbar, out of element rect"),null;if(c===0&&!n.rootContainer.contains(d)&&(i=n.rootContainer.getBoundingClientRect().left),!n.rootContainer.contains(d))continue;const C=Z(d);if(!C||!n.contains(C))continue;const E=Qt(n,C).getRangeFromPoint(n,C,i,o+r[c]);if(E)return E}return null}function d3(n,t,e,r){const i=t.getBoundingClientRect();if(r<=i.top){const c=be(t),d=Qt(n,c).getRangeFromPoint(n,c,e,c.getBoundingClientRect().top+4);if(d!=null&&d.isSimple())return rn.from(n,d);const h=at(c,0,"home");return new rn(n,{anchor:h,focus:h})}let o=Ue(t);if(!Go(o)){const c=mr(o);p(g1,c,"container must have visible block"),o=c}const s=Qt(n,o).getRangeFromPoint(n,o,e,o.getBoundingClientRect().bottom-4);if(s!=null&&s.isSimple())return rn.from(n,s);if(It(n,o))return null;const l=at(o,dt(n,o),"end");return new rn(n,{anchor:l,focus:l})}function p1(n,t,e){const r=oh(n,t,e);if(r){if(r instanceof rn)return r;p(g1,r instanceof pi,`invalid range type: ${typeof r}`);const c=r,d=n.getContainerById(c.start.childContainerId);return d3(n,d,t,e)}const i=Ae(t,e);if(!i)return null;const{children:o}=i,s=Array.from(o).filter(c=>Xi(c));if(s.length===0)return null;const l=s.reduce((c,d)=>{const h=c.getBoundingClientRect(),C=d.getBoundingClientRect();return jo(h,t,e)>jo(C,t,e)?d:c});return d3(n,l,t,e)}function C1(n,t,e){const r=[];return fe(t).forEach(o=>{r.push(o),It(n,o)&&an(n,o,e).forEach(l=>{r.push(...C1(n,l))})}),r}function E1(n,t){let e=C1(n,n.rootContainer,t);return t!=null&&t.simpleBlockOnly&&(e=e.filter(r=>!It(n,r))),e}function Ci(n,t){const e=n.selection.range.getSelectedBlocks(),r=[];for(const i of e)r.push(i),It(n,i.block)&&Ea(n,i.block,i.start,i.end).forEach(s=>{const c=C1(n,s).map(d=>({block:d,start:at(d,0,"home"),end:at(d,dt(n,d),"home")}));r.push(...c)});return t!=null&&t.simpleBlockOnly?r.filter(i=>!It(n,i.block)):r}const Slt="",on=I("text-range");function u7(n,t){const e=(o,s)=>{if(Ji(o))return p(on,s===0,`invalid offset for insertion child: ${s}`),{child:o,container:o,offset:2};if(Qn(o))return p(on,s===0||s===1,`invalid offset for box: ${s}`),{child:o,container:o,offset:s===0?1:2};const l=o.firstChild;return p(on,l,"no child node for text child"),p(on,l instanceof Text||l instanceof HTMLBRElement,`invalid child for text child, ${l.nodeName}`),l instanceof HTMLBRElement?(p(on,s>=0&&s<=0,"invalid offset for text child"),{child:o,container:l,offset:s}):(p(on,s>=0&&s<=l.data.length,"invalid offset for text child"),{child:o,container:l,offset:s})};let r=0;const i=gi(n);for(let o=0;o<i.length;o++){const s=i[o],l=Cr(s);if(t===r)return[e(s,0)];if(t<r+l)return[e(s,t-r)];if(t===r+l){const c=[];c.push(e(s,Cr(s)));const d=i[o+1];return d&&c.push(e(d,0)),c}r+=l}p(on,!1,"failed to get range info")}function f7(n,t,e){if(t===e?p(on,Ji(n),"only insertion child can be zero offset"):p(on,t<e,`invalid start & end: ${t}, ${e}`),Ji(n)){p(on,t===e,`invalid insertion child range offset: ${t}, ${e}`),p(on,t===0,`invalid insertion child range start: ${t}`);const o=n;return p(on,o.children.length===3,`invalid insertion dom, children.length = ${o.children.length}`),Fd(o,1,o,2)}if(Qn(n)){p(on,t+1===e,`invalid box child range offset: ${t}, ${e}`),p(on,t===0,`invalid box child range start: ${t}`);const o=n;return p(on,o.children.length===3,`invalid box dom, children.length = ${o.children.length}`),Fd(o,1,o,2)}const r=Cr(n);p(on,e<=r,`invalid child end: ${e}, ${r}`);const i=n.firstChild;return p(on,i instanceof Text,"invalid block text child"),p(on,i.data.length>=e,`invalid range end: ${e}, ${i.data.length}`),Fd(i,t,i,e)}const $r=I("caret-rect");function d7(n,t){if(eh(t)){const e=t,r=e1(e);if(e.getAttribute("data-box-type")==="br"){const i=Nt(n),o=Number.parseFloat(window.getComputedStyle(i).lineHeight)||r.getBoundingClientRect().height,s=Array.from(r.getClientRects());p($r,s.length>0,"no box client rects");const l=i.getBoundingClientRect(),c=s[0],d=new DOMRect(l.left,c.bottom,1,o);return s.push(d),s}return r.getClientRects()}return n1(t).getClientRects()}function Jn(n,t){var l,c,d;const e=u7(n,t.offset);if(e[1]&&e[0].child!==((l=e[1])==null?void 0:l.child)){if(t.type==="end"){const C=js(e[0].child);return new DOMRect(C.right,C.top,1,C.height)}p($r,e[1],"invalid ranges");const h=Kd(e[1].child);return new DOMRect(h.left,h.top,1,h.height)}let i=e[0];if(p($r,e.length>=1,"failed to get block range"),e.length===1)i=e[0];else{if(p($r,e.length>=2,`invalid range info length: ${e.length}`),Ji(e[e.length-1].child)){i=e[e.length-1];const h=i.child,E=n1(h).getClientRects();p($r,E.length>=1,"no client rects for box content");const x=E[E.length-1];return new DOMRect(x.right,x.y,1,x.height)}t.type==="home"?i=e[1]:t.type==="end"||cu(e[0].child)?i=e[0]:cu(e[1].child)&&(i=e[1])}if(i.container instanceof HTMLBRElement){p($r,t.offset===0,"invalid offset for empty block text");const h=i.container.parentElement;p($r,h,"invalid br parent");const C=h.getBoundingClientRect();return new DOMRect(C.left,C.top,1,C.height)}const o=Pb(i.container,i.offset),s=Array.from(o.getClientRects());if(s.length===0){p($r,!cu(i.child),"only box or insertion child range has zero client rect"),p($r,i.offset===1||i.offset===2,"invalid offset for box or insertion child");const h=i.child,C=d7(n,h);if(p($r,C.length>=1,"no client rects for box content"),i.offset===1){const x=C[0];return new DOMRect(x.x,x.y,1,x.height)}const E=C[C.length-1];if(t.type==="end"||i.offset===2){if(eh(h)&&h.getAttribute("data-box-type")==="br"){const x=h.lastChild.getBoundingClientRect();return new DOMRect(E.right,x.top,1,x.height)}return new DOMRect(E.right,E.y,1,E.height)}return new DOMRect(E.x,E.y,1,E.height)}if(Wc()||$s()){const h=document.createRange();h.selectNodeContents(i.container);const C=h.getClientRects();if(i.container.nodeType===Node.TEXT_NODE&&i.offset<((d=(c=i.container.textContent)==null?void 0:c.length)!=null?d:0)){const E=document.createRange();E.setStart(i.container,i.offset+1);const x=E.getClientRects();Array.from(C).forEach((B,k)=>{if(Math.floor(x[0].top)!==Math.floor(s[0].top)&&Math.floor(x[0].top)===Math.floor(B.top)){const{x:w,y:U,height:M}=C[k];s.length===1&&t.type==="home"&&s.push(new DOMRect(w,U,0,M))}})}if(i.container.nodeType===Node.TEXT_NODE&&i.offset>0){const E=document.createRange();E.setStart(i.container,i.offset-1);const x=E.getClientRects();Array.from(C).forEach((B,k)=>{if(Math.floor(x[0].top)!==Math.floor(s[0].top)&&Math.floor(x[0].top)===Math.floor(B.top)){const{y:w,height:U,right:M}=C[k];s.length===1&&t.type==="end"&&s.unshift(new DOMRect(M,w,0,U))}})}}return p($r,s.length>0,"no client rects for range"),t.type==="home"?s[s.length-1]:s[0]}const h7=I("core");function Zi(n,t,e,r){const i=oe(t);let o=i.querySelector(`.block-anchor[data-id=${e}]`);o||(o=v("div",["block-anchor"],i),o.setAttribute("data-id",e));const s=r!=null?r:t.getBoundingClientRect(),l=t.getBoundingClientRect(),c=new DOMRect(s.left-l.left,s.top-l.top,s.width,s.height);return o.style.left=`${c.left}px`,o.style.top=`${c.top}px`,o.style.width=`${c.width}px`,o.style.height=`${c.height}px`,o}function h3(n,t,e,r){p(h7,rt(n,t),"not a text kind block");const i=Jn(t,at(t,e,"normal")),o=t.getBoundingClientRect(),s=oe(t);let l=s.querySelector(`.block-anchor[data-id=${r}]`);l||(l=v("div",["block-anchor"],s),l.setAttribute("data-id",r));const c=new DOMRect(i.left-o.left,i.top-o.top,i.width,i.height);return l.style.left=`${c.left}px`,l.style.top=`${c.top}px`,l.style.width=`${c.width}px`,l.style.height=`${c.height}px`,l}function du(n){const t=gi(n);let e=0;return t.forEach(r=>{e+=Cr(r)}),e}var m7=typeof global=="object"&&global&&global.Object===Object&&global;const g7=m7;var p7=typeof self=="object"&&self&&self.Object===Object&&self,C7=g7||p7||Function("return this")(),E7=C7.Symbol;const Aa=E7;var m3=Object.prototype,x7=m3.hasOwnProperty,A7=m3.toString,hu=Aa?Aa.toStringTag:void 0;function b7(n){var t=x7.call(n,hu),e=n[hu];try{n[hu]=void 0;var r=!0}catch{}var i=A7.call(n);return r&&(t?n[hu]=e:delete n[hu]),i}var v7=Object.prototype,B7=v7.toString;function T7(n){return B7.call(n)}var y7="[object Null]",k7="[object Undefined]",g3=Aa?Aa.toStringTag:void 0;function R7(n){return n==null?n===void 0?k7:y7:g3&&g3 in Object(n)?b7(n):T7(n)}function w7(n){return n!=null&&typeof n=="object"}var S7="[object Symbol]";function L7(n){return typeof n=="symbol"||w7(n)&&R7(n)==S7}function I7(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var D7=Array.isArray;const _7=D7;var M7=1/0,p3=Aa?Aa.prototype:void 0,C3=p3?p3.toString:void 0;function E3(n){if(typeof n=="string")return n;if(_7(n))return I7(n,E3)+"";if(L7(n))return C3?C3.call(n):"";var t=n+"";return t=="0"&&1/n==-M7?"-0":t}function x3(n){return n==null?"":E3(n)}function U7(n,t,e,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(e=n[++i]);++i<o;)e=t(e,n[i],i,n);return e}function O7(n){return function(t){return n==null?void 0:n[t]}}var N7={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},P7=O7(N7);const F7=P7;var K7=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,V7="\\u0300-\\u036f",$7="\\ufe20-\\ufe2f",H7="\\u20d0-\\u20ff",j7=V7+$7+H7,z7="["+j7+"]",G7=RegExp(z7,"g");function W7(n){return n=x3(n),n&&n.replace(K7,F7).replace(G7,"")}var q7=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function X7(n){return n.match(q7)||[]}var Y7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Q7(n){return Y7.test(n)}var A3="\\ud800-\\udfff",J7="\\u0300-\\u036f",Z7="\\ufe20-\\ufe2f",tD="\\u20d0-\\u20ff",eD=J7+Z7+tD,b3="\\u2700-\\u27bf",v3="a-z\\xdf-\\xf6\\xf8-\\xff",nD="\\xac\\xb1\\xd7\\xf7",rD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iD="\\u2000-\\u206f",oD=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",B3="A-Z\\xc0-\\xd6\\xd8-\\xde",sD="\\ufe0e\\ufe0f",T3=nD+rD+iD+oD,y3="['\u2019]",k3="["+T3+"]",lD="["+eD+"]",R3="\\d+",aD="["+b3+"]",w3="["+v3+"]",S3="[^"+A3+T3+R3+b3+v3+B3+"]",cD="\\ud83c[\\udffb-\\udfff]",uD="(?:"+lD+"|"+cD+")",fD="[^"+A3+"]",L3="(?:\\ud83c[\\udde6-\\uddff]){2}",I3="[\\ud800-\\udbff][\\udc00-\\udfff]",ba="["+B3+"]",dD="\\u200d",D3="(?:"+w3+"|"+S3+")",hD="(?:"+ba+"|"+S3+")",_3="(?:"+y3+"(?:d|ll|m|re|s|t|ve))?",M3="(?:"+y3+"(?:D|LL|M|RE|S|T|VE))?",U3=uD+"?",O3="["+sD+"]?",mD="(?:"+dD+"(?:"+[fD,L3,I3].join("|")+")"+O3+U3+")*",gD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",CD=O3+U3+mD,ED="(?:"+[aD,L3,I3].join("|")+")"+CD,xD=RegExp([ba+"?"+w3+"+"+_3+"(?="+[k3,ba,"$"].join("|")+")",hD+"+"+M3+"(?="+[k3,ba+D3,"$"].join("|")+")",ba+"?"+D3+"+"+_3,ba+"+"+M3,pD,gD,R3,ED].join("|"),"g");function AD(n){return n.match(xD)||[]}function bD(n,t,e){return n=x3(n),t=e?void 0:t,t===void 0?Q7(n)?AD(n):X7(n):n.match(t)||[]}var vD="['\u2019]",BD=RegExp(vD,"g");function TD(n){return function(t){return U7(bD(W7(t).replace(BD,"")),n,"")}}var yD=TD(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()});const kD=yD,N3=I("box");function to(n){return!n.attributes||!n.attributes.box?!1:(p(N3,typeof n.attributes.box=="string"&&n.attributes.box==="true"||n.attributes.box===!0,`invalid op attribute box property, ${n.attributes.box}`),p(N3,n.attributes.type,`no box type: ${JSON.stringify(n)}`),!0)}const P3=I("text-op");function sh(n){return p(P3,typeof n.insert=="string","invalid op, no insert"),n.insert.length}function F3(n,t){const e=n;let r=0;for(let i=0;i<e.length;i++){const o=e[i];p(P3,typeof o.insert=="string","invalid text op, no insert");const s=r+sh(o);if(s>t)return[o];if(s===t){const l=[o];return i<e.length-1&&l.push(e[i+1]),l}r=s}return[]}const K3=I("rich-text-length");function x1(n){return p(K3,typeof n.insert=="string","op.insert is not string"),n.insert.length}function gn(n){let t=0;return n.forEach(e=>{e.insert&&(p(K3,typeof e.insert=="string","op.insert is not string"),t+=x1(e))}),t}const Ei=I("split-text");function Mn(n,t,e){if(n=mt.default(n),t===0)return{left:[],right:n};if(t===-1)return{left:n,right:[]};let r=0;for(let i=0;i<n.length;i++){const o=n[i];p(Ei,typeof o=="object",`invalid op type, ${typeof o}`),p(Ei,typeof o.insert=="string",`invalid op.insert type, ${typeof o.insert}`);const s=x1(o);if(r+s<t)r+=s;else{if(r+s===t)return{left:n.slice(0,i+1),right:n.slice(i+1)};{p(Ei,r+s>t,`invalid offset, ${r}, ${s}, ${t}`);const l=t-r,c=mt.default(o);p(Ei,c.insert,"no copied.insert"),p(Ei,typeof c.insert=="string","invalid copied.insert type"),c.insert=c.insert.substr(0,l),o.insert=o.insert.substr(l),c.insert===""&&p(Ei,!1,"invalid copied.insert, is empty string"),o.insert===""&&p(Ei,!1,"invalid op.insert, is empty string");const d=[o,...n.slice(i+1)],h=[...n.splice(0,i),c];return e&&(e.sourceOp=o),{left:h,right:d}}}}throw new Error(`invalid split offset: ${t}, ${JSON.stringify(n)}`)}function Je(n,t,e){p(Ei,t>=0,"invalid offset, < 0"),p(Ei,e>0,"invalid length, <= 0"),p(Ei,t+e<=gn(n),"invalid offset + length < text length");const{left:r,right:i}=Mn(n,t+e),{left:o,right:s}=Mn(r,t);return{left:o,middle:s,right:i}}function V3(n,t){const e=Array.from(new Set(t)).sort((o,s)=>o-s),r=[];let i=n;for(let o=e.length-1;o>=0;o--){const s=e[o],{left:l,right:c}=Mn(i,s);i=l,r.unshift(c)}return i.length>0&&r.unshift(i),r}function $3(n,t,e){return Je(n,t,e).middle}const A1="style-color-",b1="style-bg-color-";function lh(n,t,e){const r=mt.default(n);return r.forEach(i=>{if(!(i.attributes&&i.attributes.box===!0&&!t.startsWith("comment-")))if(e===void 0){if(!i.attributes||i.attributes[t]===void 0)return;delete i.attributes[t],Object.keys(i.attributes).length===0&&delete i.attributes}else i.attributes||(i.attributes={}),i.attributes[t]=e}),r}function v1(n,t,e,r){const i=mt.default(n);return i.forEach(o=>{o.attributes&&o.attributes.box===!0&&!(r!=null&&r.handleBox)||o.attributes&&((r==null?void 0:r.ignoreValue)||o.attributes[t]===e)&&(delete o.attributes[t],Object.keys(o.attributes).length===0&&delete o.attributes)}),i}function mu(n,t,e,r,i){if(t===0)return e;const o=Je(e,n,t);return[...o.left,...lh(o.middle,r,i),...o.right]}function va(n,t,e,r,i,o){if(t===0)return e;const s=Je(e,n,t);return[...s.left,...v1(s.middle,r,i,o),...s.right]}function Ba(n,t){const e=F3(n,t);if(e.length===1)return e[0].attributes;if(e.length===2)return e[1].attributes}function H3(n,t,e,r){if(t===0)return e;const i=Je(e,n,t),o=i.middle.map(s=>r(s));return[...i.left,...o,...i.right]}function j3(n,t){t==="color"?Object.keys(n).forEach(e=>{(e.startsWith("style-color-")||e==="inline-style-color")&&delete n[e]}):t==="backgroundColor"&&Object.keys(n).forEach(e=>{e.startsWith("style-bg-color-")&&delete n[e]})}function RD(n,t){if(!n.attributes||n.attributes.box)return;const e=n.attributes;j3(e,t),Object.keys(e).length===0&&delete n.attributes}function wD(n,t,e){n.attributes||(n.attributes={}),!n.attributes.box&&(t==="color"?n.attributes[`style-color-${e}`]=!0:n.attributes[`style-bg-color-${e}`]=!0)}function z3(n,t,e,r,i){const o=mt.default(e);return H3(n,t,o,l=>(RD(l,r),i!==null&&wD(l,r,i),l))}function B1(n){var i,o;if(!n||n.box)return[null,null];const t=Array.from(Object.keys(n));let e=null,r=null;for(let s=0;s<t.length;s++){const l=t[s];l.startsWith(A1)?e=(i=Number.parseInt(l.substring(A1.length),10))!=null?i:null:l.startsWith(b1)&&(r=(o=Number.parseInt(l.substring(b1.length),10))!=null?o:null)}return[e,r]}function G3(n,t,e){j3(n,t),t==="color"?n[`style-color-${e}`]=!0:n[`style-bg-color-${e}`]=!0}function W3(n){return n.attributes?n.attributes.box?[null,null]:B1(n.attributes):[null,null]}function q3(n,t,e){let r=[];if(t===0?n!==0&&(r=Je(e,n-1,1).middle):r=Je(e,n,t).middle,r.length===0)return[null,null];let[i,o]=W3(r[0]);if(i===null&&o===null)return[i,o];for(let s=1;s<r.length;s++){const l=r[s];if(!l.attributes)return[null,null];if(l.attributes.box)continue;const[c,d]=W3(l);c===null||i===null?i=null:i=c===i?i:null,d===null||o===null?o=null:o=d===o?o:null}return[i,o]}const Ta=I("text-block-content");function SD(n,t,e,r,i){if(p(Ta,r,"no text for block"),r.length===0&&(!i||i.size===0)){e.innerHTML="<span><br></span>";return}const o=[];i&&o.push(...i.keys());const s=C=>n.editorInsertions.createInsertion(e,C),l=(C,E)=>{const x=i==null?void 0:i.get(E);x&&(x.forEach(B=>{C.appendChild(s(B))}),i==null||i.delete(E))},c=document.createDocumentFragment();let d=0;const h=V3(r,o);for(let C=0;C<h.length;C++){l(c,d);const E=h[C];d+=gn(E);for(let x=0;x<E.length;x++){const B=E[x];if(to(B)){p(Ta,B.attributes,`op is not an valid box: ${JSON.stringify(B)}`);const w=n.editorBoxes.createBox(e,B.attributes);p(Ta,w instanceof HTMLSpanElement,`invalid box element: ${w.tagName}`);const U=n.editorBlockRenders.renderBox(t,B.attributes);U.classes&&z(w,...U.classes),U.attributes&&Object.entries(U.attributes).forEach(([M,F])=>{w.setAttribute(M,F)}),U.styles&&Object.entries(U.styles).forEach(([M,F])=>{w.style.setProperty(M,F)}),c.appendChild(w);continue}p(Ta,B.insert,`no insert in op: ${JSON.stringify(B)}`);const k=v("span",["text"],c,B.insert);if(B.attributes){const w=n.editorBlockRenders.renderText(t,B.attributes);w.classes&&z(k,...w.classes),w.attributes&&Object.entries(w.attributes).forEach(([U,M])=>{k.setAttribute(U,M)}),w.styles&&Object.entries(w.styles).forEach(([U,M])=>{k.style.setProperty(kD(U),M)})}c.appendChild(k)}}l(c,d),e.innerHTML="",e.appendChild(c)}function ah(n,t,e,r,i){const{text:o,insertions:s}=n.editorDecorators.decorateText(t,i),l=n.compositingText;if(l){const c=n.selection.range.start;if(p(Ta,c.isSimple(),"not an simple position while compositing"),c.blockId===e){const d=Ba(o,0);s.set(c.offset,[{type:"inputting",id:et(),text:l,attributes:d}])}}return SD(n,t,r,o,s)}function LD(n){const t=n.rootContainer.querySelectorAll('span[data-type="editor-insertion"].inputting-insertion');t.length&&Ta.debug(`remove ${t.length} temp composition span`),Array.from(t).forEach(e=>e.remove())}const xi=I("client-rects");function ID(n){const t=gi(n);let e=0;const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=Cr(o);r.push({child:o,startBlockOffset:e,endBlockOffset:e+s}),e+=s}return r}function DD(n,t,e,r){p(xi,e<r,`invalid from & to: ${e}, ${r}`);const i=dt(n,t);p(xi,e>=0&&r>=0&&e<=i&&r<=i,`invalid offset: ${e}, ${r}, length: ${i}`);const o=ID(t),s=o.findIndex(x=>x.startBlockOffset<=e&&e<x.endBlockOffset),l=o.findIndex(x=>x.startBlockOffset<r&&r<=x.endBlockOffset);if(p(xi,s!==-1,"failed to find start child"),p(xi,l!==-1,"failed to find end child"),p(xi,s<=l,`invalid start index & end index: ${s}, ${l}`),s===l){const x=o[s];return[{child:x.child,startChildOffset:e-x.startBlockOffset,endChildOffset:r-x.startBlockOffset}]}const c=[],d=o[s],h={child:d.child,startChildOffset:e-d.startBlockOffset,endChildOffset:Cr(d.child)};c.push(h);for(let x=s+1;x<l;x++){const B=o[x],k={child:B.child,startChildOffset:0,endChildOffset:B.endBlockOffset-B.startBlockOffset};c.push(k)}const C=o[l],E={child:C.child,startChildOffset:0,endChildOffset:r-C.startBlockOffset};return c.push(E),c}function _D(n){const t=(r,i)=>r.left<=i.left&&r.top<=i.top&&r.right>=i.right&&r.bottom>=i.bottom&&(r.width!==i.width||r.height!==i.height);n=n.filter(r=>!n.find(o=>t(r,o)));const e=[];return n=n.filter(r=>e.find(i=>i.left===r.left&&i.top===r.top&&i.width===r.width&&i.height===r.height)?!1:(e.push(r),!0)),n}function X3(n,t,e,r){if(dt(n,t)===0){const h=Nt(t).getBoundingClientRect();return[new DOMRect(h.left,h.top,4,h.height)]}const i=e.offset,o=r.offset;if(i===o)return[Jn(t,e)];const l=DD(n,t,i,o).map(d=>f7(d.child,d.startChildOffset,d.endChildOffset)),c=[];return l.forEach(d=>{const h=_D(Array.from(d.getClientRects()));c.push(...h)}),c}function MD(n,t,e){p(xi,e instanceof rn,"invalid range");const r=e.start,i=e.end;return p(xi,r.isSimple(),"text block only allow simple position"),p(xi,i.isSimple(),"text block only allow simple position"),p(xi,r.blockId===i.blockId,"only allow update one text block selection"),p(xi,r.blockId===lt(t),"only allow update one text block selection"),X3(n,t,r,i)}const T1=I("selection-background");function UD(n,t,e,r){p(T1,e.isSimple(),"text block only allow simple position"),p(T1,r.isSimple(),"text block only allow simple position"),p(T1,e.blockId===r.blockId,"only allow update one text block selection");const i=e.offset,o=r.offset;if(i===o&&(dt(n,t)!==0||n.selection.range.isCollapsed())){const h=Zg(t);Array.from(h.children).forEach(C=>{C.remove()});return}const s=X3(n,t,e,r),l=t.getBoundingClientRect(),c=dr(t),d=Zg(t);Array.from(d.children).forEach((h,C)=>{if(C<s.length){const E=s[C],x=h;x.style.left=`${(E.left-l.left-t.clientLeft)/c}px`,x.style.top=`${(E.top-l.top-t.clientTop)/c}px`,x.style.width=`${E.width/c}px`,x.style.height=`${E.height/c}px`}else h.remove()}),s.slice(d.children.length).forEach(h=>{const C=v("div",["editor-selection-background"],d);C.style.left=`${(h.left-l.left-t.clientLeft)/c}px`,C.style.top=`${(h.top-l.top-t.clientTop)/c}px`,C.style.width=`${h.width/c}px`,C.style.height=`${h.height/c}px`})}function OD(n){const t=n.selection.range.getSelectedBlocks(),e=n.selection.range.isCollapsed();n.rootContainer.querySelectorAll("div[data-type=block-background]").forEach(r=>{const i=Z(r);i&&rt(n,i)&&(!t.find(o=>o.block===i)||e)&&r.remove()})}const gu=I("line-breaker");function Y3(n){const t=[];let e=null;for(let r=0;r<n.length;r++){let i=n[r];!!e&&i.top===e.top?(i=new DOMRect(e.left,e.top,e.width+i.width,i.height),t.splice(t.length-1,1,i)):t.push(i),e=i}return t}function ND(n){const t=document.createRange();return t.setStart(n,0),t.setEnd(n,n.data.length),Y3(t.getClientRects())}function pu(n){const t=l=>{if(!l)return!1;const c=Kd(l);return js(l).top>c.top+c.height/2},e=(l,c)=>{const d=js(l),h=Kd(c);return Math.floor(h.left)<Math.floor(d.right)},r=(l,c)=>{const d=js(l),h=js(c);return h.top+h.height/2>d.bottom},i=[];let o=0;const s=gi(n);for(let l=0;l<s.length;l++){const c=s[l];if(Ji(c)){const B=c,k=s[l+1];if(!k)break;const w=s[l-1];if(w&&r(w,B)&&i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:B,wrap:"nextWrapped",prevWrapped:t(w),nextWrapped:t(B)}}),e(B,k)){i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:B,wrap:"nowrap",prevWrapped:t(w),nextWrapped:t(B)}});continue}continue}if(Qn(c)){const B=c,k=s[l+1];if(!k)break;const w=s[l-1];if(w&&r(w,B)&&i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:B,wrap:"nextWrapped",prevWrapped:t(w),nextWrapped:t(B)}}),e(B,k)){o+=1,i.push({offset:o,type:"betweenChild",childInfo:{prevChild:w,nextChild:c,wrap:"nowrap",prevWrapped:t(w),nextWrapped:t(c)}});continue}o+=1;continue}const d=c,h=Y3(d.getClientRects());if(p(gu,h.length>0,"invalid text child dom"),h.length===1){const B=s[l+1];if(!B)break;if(e(d,B)){o+=Cr(d),i.push({offset:o,type:"betweenChild",childInfo:{prevChild:d,nextChild:B,wrap:"nowrap",prevWrapped:t(d),nextWrapped:t(B)}});continue}o+=Cr(d);continue}const C=d.firstChild;p(gu,C,"invalid text child, no text node"),p(gu,C instanceof Text,`invalid text child, not a valid text node: ${typeof C}`);const E=Cr(d);p(gu,C.data.length===E,"text node data length not equal child text length");const x=ND(C);for(let B=0;B<x.length-1;B++){const k=x[B],w=Ig(k.right,k.top+k.height-1);w.offset>-1&&w.textNode===C&&i.push({offset:o+w.offset,type:"textBreakWord",childInfo:{prevChild:c,nextChild:c,wrap:"nowrap",prevWrapped:t(c),nextWrapped:t(c)}})}o+=E}return i}function y1(n,t){const e=pu(n);for(let r=0;r<e.length;r++){const{offset:i}=e[r];if(t.offset<i)return{lineIndex:r,lineBreaks:e};if(t.offset===i&&t.type==="end")return{lineIndex:r,lineBreaks:e}}return p(gu,t.offset<=du(n),"invalid position, offset > block length"),{lineIndex:e.length,lineBreaks:e}}var Un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Q3={},k1={},R1={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EXTENDED_PICTOGRAPHIC=n.CLUSTER_BREAK=void 0,function(t){t[t.CR=0]="CR",t[t.LF=1]="LF",t[t.CONTROL=2]="CONTROL",t[t.EXTEND=3]="EXTEND",t[t.REGIONAL_INDICATOR=4]="REGIONAL_INDICATOR",t[t.SPACINGMARK=5]="SPACINGMARK",t[t.L=6]="L",t[t.V=7]="V",t[t.T=8]="T",t[t.LV=9]="LV",t[t.LVT=10]="LVT",t[t.OTHER=11]="OTHER",t[t.PREPEND=12]="PREPEND",t[t.E_BASE=13]="E_BASE",t[t.E_MODIFIER=14]="E_MODIFIER",t[t.ZWJ=15]="ZWJ",t[t.GLUE_AFTER_ZWJ=16]="GLUE_AFTER_ZWJ",t[t.E_BASE_GAZ=17]="E_BASE_GAZ"}(n.CLUSTER_BREAK||(n.CLUSTER_BREAK={})),n.EXTENDED_PICTOGRAPHIC=101})(R1);var w1={};Object.defineProperty(w1,"__esModule",{value:!0});const Ht=R1,eo=0,S1=1,PD=2,FD=3,KD=4;class VD{static isSurrogate(t,e){return 55296<=t.charCodeAt(e)&&t.charCodeAt(e)<=56319&&56320<=t.charCodeAt(e+1)&&t.charCodeAt(e+1)<=57343}static codePointAt(t,e){e===void 0&&(e=0);const r=t.charCodeAt(e);if(55296<=r&&r<=56319&&e<t.length-1){const i=r,o=t.charCodeAt(e+1);return 56320<=o&&o<=57343?(i-55296)*1024+(o-56320)+65536:i}if(56320<=r&&r<=57343&&e>=1){const i=t.charCodeAt(e-1),o=r;return 55296<=i&&i<=56319?(i-55296)*1024+(o-56320)+65536:o}return r}static shouldBreak(t,e,r,i,o,s){const l=[t].concat(e).concat([r]),c=[i].concat(o).concat([s]),d=l[l.length-2],h=r,C=s,E=l.lastIndexOf(Ht.CLUSTER_BREAK.REGIONAL_INDICATOR);if(E>0&&l.slice(1,E).every(function(B){return B===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR})&&[Ht.CLUSTER_BREAK.PREPEND,Ht.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(d)===-1)return l.filter(function(B){return B===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR}).length%2===1?FD:KD;if(d===Ht.CLUSTER_BREAK.CR&&h===Ht.CLUSTER_BREAK.LF)return eo;if(d===Ht.CLUSTER_BREAK.CONTROL||d===Ht.CLUSTER_BREAK.CR||d===Ht.CLUSTER_BREAK.LF)return S1;if(h===Ht.CLUSTER_BREAK.CONTROL||h===Ht.CLUSTER_BREAK.CR||h===Ht.CLUSTER_BREAK.LF)return S1;if(d===Ht.CLUSTER_BREAK.L&&(h===Ht.CLUSTER_BREAK.L||h===Ht.CLUSTER_BREAK.V||h===Ht.CLUSTER_BREAK.LV||h===Ht.CLUSTER_BREAK.LVT))return eo;if((d===Ht.CLUSTER_BREAK.LV||d===Ht.CLUSTER_BREAK.V)&&(h===Ht.CLUSTER_BREAK.V||h===Ht.CLUSTER_BREAK.T))return eo;if((d===Ht.CLUSTER_BREAK.LVT||d===Ht.CLUSTER_BREAK.T)&&h===Ht.CLUSTER_BREAK.T)return eo;if(h===Ht.CLUSTER_BREAK.EXTEND||h===Ht.CLUSTER_BREAK.ZWJ)return eo;if(h===Ht.CLUSTER_BREAK.SPACINGMARK)return eo;if(d===Ht.CLUSTER_BREAK.PREPEND)return eo;const x=c.slice(0,-1).lastIndexOf(Ht.EXTENDED_PICTOGRAPHIC);return x!==-1&&c[x]===Ht.EXTENDED_PICTOGRAPHIC&&l.slice(x+1,-2).every(function(B){return B===Ht.CLUSTER_BREAK.EXTEND})&&d===Ht.CLUSTER_BREAK.ZWJ&&C===Ht.EXTENDED_PICTOGRAPHIC?eo:e.indexOf(Ht.CLUSTER_BREAK.REGIONAL_INDICATOR)!==-1?PD:d===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR&&h===Ht.CLUSTER_BREAK.REGIONAL_INDICATOR?eo:S1}}w1.default=VD;var L1={};Object.defineProperty(L1,"__esModule",{value:!0});class $D{constructor(t,e){this._index=0,this._str=t,this._nextBreak=e}[Symbol.iterator](){return this}next(){let t;if((t=this._nextBreak(this._str,this._index))<this._str.length){const e=this._str.slice(this._index,t);return this._index=t,{value:e,done:!1}}if(this._index<this._str.length){const e=this._str.slice(this._index);return this._index=this._str.length,{value:e,done:!1}}return{value:void 0,done:!0}}}L1.default=$D;var J3=Un&&Un.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(k1,"__esModule",{value:!0});const f=R1,ch=J3(w1),HD=J3(L1);class no{static nextBreak(t,e){if(e===void 0&&(e=0),e<0)return 0;if(e>=t.length-1)return t.length;const r=ch.default.codePointAt(t,e),i=no.getGraphemeBreakProperty(r),o=no.getEmojiProperty(r),s=[],l=[];for(let c=e+1;c<t.length;c++){if(ch.default.isSurrogate(t,c-1))continue;const d=ch.default.codePointAt(t,c),h=no.getGraphemeBreakProperty(d),C=no.getEmojiProperty(d);if(ch.default.shouldBreak(i,s,h,o,l,C))return c;s.push(h),l.push(C)}return t.length}splitGraphemes(t){const e=[];let r=0,i;for(;(i=no.nextBreak(t,r))<t.length;)e.push(t.slice(r,i)),r=i;return r<t.length&&e.push(t.slice(r)),e}iterateGraphemes(t){return new HD.default(t,no.nextBreak)}countGraphemes(t){let e=0,r=0,i;for(;(i=no.nextBreak(t,r))<t.length;)r=i,e++;return r<t.length&&e++,e}static getGraphemeBreakProperty(t){if(t<48905){if(t<44116){if(t<4141){if(t<2818){if(t<2363)if(t<1759){if(t<1471){if(t<127){if(t<11){if(t<10){if(0<=t&&t<=9)return f.CLUSTER_BREAK.CONTROL}else if(t===10)return f.CLUSTER_BREAK.LF}else if(t<13){if(11<=t&&t<=12)return f.CLUSTER_BREAK.CONTROL}else if(t<14){if(t===13)return f.CLUSTER_BREAK.CR}else if(14<=t&&t<=31)return f.CLUSTER_BREAK.CONTROL}else if(t<768){if(t<173){if(127<=t&&t<=159)return f.CLUSTER_BREAK.CONTROL}else if(t===173)return f.CLUSTER_BREAK.CONTROL}else if(t<1155){if(768<=t&&t<=879)return f.CLUSTER_BREAK.EXTEND}else if(t<1425){if(1155<=t&&t<=1161)return f.CLUSTER_BREAK.EXTEND}else if(1425<=t&&t<=1469)return f.CLUSTER_BREAK.EXTEND}else if(t<1552){if(t<1476){if(t<1473){if(t===1471)return f.CLUSTER_BREAK.EXTEND}else if(1473<=t&&t<=1474)return f.CLUSTER_BREAK.EXTEND}else if(t<1479){if(1476<=t&&t<=1477)return f.CLUSTER_BREAK.EXTEND}else if(t<1536){if(t===1479)return f.CLUSTER_BREAK.EXTEND}else if(1536<=t&&t<=1541)return f.CLUSTER_BREAK.PREPEND}else if(t<1648){if(t<1564){if(1552<=t&&t<=1562)return f.CLUSTER_BREAK.EXTEND}else if(t<1611){if(t===1564)return f.CLUSTER_BREAK.CONTROL}else if(1611<=t&&t<=1631)return f.CLUSTER_BREAK.EXTEND}else if(t<1750){if(t===1648)return f.CLUSTER_BREAK.EXTEND}else if(t<1757){if(1750<=t&&t<=1756)return f.CLUSTER_BREAK.EXTEND}else if(t===1757)return f.CLUSTER_BREAK.PREPEND}else if(t<2075){if(t<1840)if(t<1770){if(t<1767){if(1759<=t&&t<=1764)return f.CLUSTER_BREAK.EXTEND}else if(1767<=t&&t<=1768)return f.CLUSTER_BREAK.EXTEND}else if(t<1807){if(1770<=t&&t<=1773)return f.CLUSTER_BREAK.EXTEND}else{if(t===1807)return f.CLUSTER_BREAK.PREPEND;if(t===1809)return f.CLUSTER_BREAK.EXTEND}else if(t<2027){if(t<1958){if(1840<=t&&t<=1866)return f.CLUSTER_BREAK.EXTEND}else if(1958<=t&&t<=1968)return f.CLUSTER_BREAK.EXTEND}else if(t<2045){if(2027<=t&&t<=2035)return f.CLUSTER_BREAK.EXTEND}else if(t<2070){if(t===2045)return f.CLUSTER_BREAK.EXTEND}else if(2070<=t&&t<=2073)return f.CLUSTER_BREAK.EXTEND}else if(t<2200){if(t<2089){if(t<2085){if(2075<=t&&t<=2083)return f.CLUSTER_BREAK.EXTEND}else if(2085<=t&&t<=2087)return f.CLUSTER_BREAK.EXTEND}else if(t<2137){if(2089<=t&&t<=2093)return f.CLUSTER_BREAK.EXTEND}else if(t<2192){if(2137<=t&&t<=2139)return f.CLUSTER_BREAK.EXTEND}else if(2192<=t&&t<=2193)return f.CLUSTER_BREAK.PREPEND}else if(t<2275){if(t<2250){if(2200<=t&&t<=2207)return f.CLUSTER_BREAK.EXTEND}else if(t<2274){if(2250<=t&&t<=2273)return f.CLUSTER_BREAK.EXTEND}else if(t===2274)return f.CLUSTER_BREAK.PREPEND}else if(t<2307){if(2275<=t&&t<=2306)return f.CLUSTER_BREAK.EXTEND}else{if(t===2307)return f.CLUSTER_BREAK.SPACINGMARK;if(t===2362)return f.CLUSTER_BREAK.EXTEND}else if(t<2561){if(t<2434){if(t<2381){if(t<2366){if(t===2363)return f.CLUSTER_BREAK.SPACINGMARK;if(t===2364)return f.CLUSTER_BREAK.EXTEND}else if(t<2369){if(2366<=t&&t<=2368)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2377){if(2369<=t&&t<=2376)return f.CLUSTER_BREAK.EXTEND}else if(2377<=t&&t<=2380)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2385){if(t<2382){if(t===2381)return f.CLUSTER_BREAK.EXTEND}else if(2382<=t&&t<=2383)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2402){if(2385<=t&&t<=2391)return f.CLUSTER_BREAK.EXTEND}else if(t<2433){if(2402<=t&&t<=2403)return f.CLUSTER_BREAK.EXTEND}else if(t===2433)return f.CLUSTER_BREAK.EXTEND}else if(t<2503){if(t<2494){if(t<2492){if(2434<=t&&t<=2435)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2492)return f.CLUSTER_BREAK.EXTEND}else if(t<2495){if(t===2494)return f.CLUSTER_BREAK.EXTEND}else if(t<2497){if(2495<=t&&t<=2496)return f.CLUSTER_BREAK.SPACINGMARK}else if(2497<=t&&t<=2500)return f.CLUSTER_BREAK.EXTEND}else if(t<2519){if(t<2507){if(2503<=t&&t<=2504)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2509){if(2507<=t&&t<=2508)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2509)return f.CLUSTER_BREAK.EXTEND}else if(t<2530){if(t===2519)return f.CLUSTER_BREAK.EXTEND}else if(t<2558){if(2530<=t&&t<=2531)return f.CLUSTER_BREAK.EXTEND}else if(t===2558)return f.CLUSTER_BREAK.EXTEND}else if(t<2691){if(t<2631){if(t<2620){if(t<2563){if(2561<=t&&t<=2562)return f.CLUSTER_BREAK.EXTEND}else if(t===2563)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2622){if(t===2620)return f.CLUSTER_BREAK.EXTEND}else if(t<2625){if(2622<=t&&t<=2624)return f.CLUSTER_BREAK.SPACINGMARK}else if(2625<=t&&t<=2626)return f.CLUSTER_BREAK.EXTEND}else if(t<2672){if(t<2635){if(2631<=t&&t<=2632)return f.CLUSTER_BREAK.EXTEND}else if(t<2641){if(2635<=t&&t<=2637)return f.CLUSTER_BREAK.EXTEND}else if(t===2641)return f.CLUSTER_BREAK.EXTEND}else if(t<2677){if(2672<=t&&t<=2673)return f.CLUSTER_BREAK.EXTEND}else if(t<2689){if(t===2677)return f.CLUSTER_BREAK.EXTEND}else if(2689<=t&&t<=2690)return f.CLUSTER_BREAK.EXTEND}else if(t<2761){if(t<2750){if(t===2691)return f.CLUSTER_BREAK.SPACINGMARK;if(t===2748)return f.CLUSTER_BREAK.EXTEND}else if(t<2753){if(2750<=t&&t<=2752)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2759){if(2753<=t&&t<=2757)return f.CLUSTER_BREAK.EXTEND}else if(2759<=t&&t<=2760)return f.CLUSTER_BREAK.EXTEND}else if(t<2786){if(t<2763){if(t===2761)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2765){if(2763<=t&&t<=2764)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2765)return f.CLUSTER_BREAK.EXTEND}else if(t<2810){if(2786<=t&&t<=2787)return f.CLUSTER_BREAK.EXTEND}else if(t<2817){if(2810<=t&&t<=2815)return f.CLUSTER_BREAK.EXTEND}else if(t===2817)return f.CLUSTER_BREAK.EXTEND}else if(t<3315){if(t<3076){if(t<2946){if(t<2887){if(t<2878){if(t<2876){if(2818<=t&&t<=2819)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===2876)return f.CLUSTER_BREAK.EXTEND}else if(t<2880){if(2878<=t&&t<=2879)return f.CLUSTER_BREAK.EXTEND}else if(t<2881){if(t===2880)return f.CLUSTER_BREAK.SPACINGMARK}else if(2881<=t&&t<=2884)return f.CLUSTER_BREAK.EXTEND}else if(t<2893){if(t<2891){if(2887<=t&&t<=2888)return f.CLUSTER_BREAK.SPACINGMARK}else if(2891<=t&&t<=2892)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<2901){if(t===2893)return f.CLUSTER_BREAK.EXTEND}else if(t<2914){if(2901<=t&&t<=2903)return f.CLUSTER_BREAK.EXTEND}else if(2914<=t&&t<=2915)return f.CLUSTER_BREAK.EXTEND}else if(t<3014){if(t<3007){if(t===2946||t===3006)return f.CLUSTER_BREAK.EXTEND}else if(t<3008){if(t===3007)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3009){if(t===3008)return f.CLUSTER_BREAK.EXTEND}else if(3009<=t&&t<=3010)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3031){if(t<3018){if(3014<=t&&t<=3016)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3021){if(3018<=t&&t<=3020)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===3021)return f.CLUSTER_BREAK.EXTEND}else if(t<3072){if(t===3031)return f.CLUSTER_BREAK.EXTEND}else if(t<3073){if(t===3072)return f.CLUSTER_BREAK.EXTEND}else if(3073<=t&&t<=3075)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3262){if(t<3146){if(t<3134){if(t===3076||t===3132)return f.CLUSTER_BREAK.EXTEND}else if(t<3137){if(3134<=t&&t<=3136)return f.CLUSTER_BREAK.EXTEND}else if(t<3142){if(3137<=t&&t<=3140)return f.CLUSTER_BREAK.SPACINGMARK}else if(3142<=t&&t<=3144)return f.CLUSTER_BREAK.EXTEND}else if(t<3201){if(t<3157){if(3146<=t&&t<=3149)return f.CLUSTER_BREAK.EXTEND}else if(t<3170){if(3157<=t&&t<=3158)return f.CLUSTER_BREAK.EXTEND}else if(3170<=t&&t<=3171)return f.CLUSTER_BREAK.EXTEND}else if(t<3202){if(t===3201)return f.CLUSTER_BREAK.EXTEND}else if(t<3260){if(3202<=t&&t<=3203)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===3260)return f.CLUSTER_BREAK.EXTEND}else if(t<3270){if(t<3264){if(t===3262)return f.CLUSTER_BREAK.SPACINGMARK;if(t===3263)return f.CLUSTER_BREAK.EXTEND}else if(t<3266){if(3264<=t&&t<=3265)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3267){if(t===3266)return f.CLUSTER_BREAK.EXTEND}else if(3267<=t&&t<=3268)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3276){if(t<3271){if(t===3270)return f.CLUSTER_BREAK.EXTEND}else if(t<3274){if(3271<=t&&t<=3272)return f.CLUSTER_BREAK.SPACINGMARK}else if(3274<=t&&t<=3275)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3285){if(3276<=t&&t<=3277)return f.CLUSTER_BREAK.EXTEND}else if(t<3298){if(3285<=t&&t<=3286)return f.CLUSTER_BREAK.EXTEND}else if(3298<=t&&t<=3299)return f.CLUSTER_BREAK.EXTEND}else if(t<3551){if(t<3406){if(t<3391){if(t<3330){if(t<3328){if(t===3315)return f.CLUSTER_BREAK.SPACINGMARK}else if(3328<=t&&t<=3329)return f.CLUSTER_BREAK.EXTEND}else if(t<3387){if(3330<=t&&t<=3331)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3390){if(3387<=t&&t<=3388)return f.CLUSTER_BREAK.EXTEND}else if(t===3390)return f.CLUSTER_BREAK.EXTEND}else if(t<3398){if(t<3393){if(3391<=t&&t<=3392)return f.CLUSTER_BREAK.SPACINGMARK}else if(3393<=t&&t<=3396)return f.CLUSTER_BREAK.EXTEND}else if(t<3402){if(3398<=t&&t<=3400)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3405){if(3402<=t&&t<=3404)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===3405)return f.CLUSTER_BREAK.EXTEND}else if(t<3530){if(t<3426){if(t===3406)return f.CLUSTER_BREAK.PREPEND;if(t===3415)return f.CLUSTER_BREAK.EXTEND}else if(t<3457){if(3426<=t&&t<=3427)return f.CLUSTER_BREAK.EXTEND}else if(t<3458){if(t===3457)return f.CLUSTER_BREAK.EXTEND}else if(3458<=t&&t<=3459)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3538){if(t<3535){if(t===3530)return f.CLUSTER_BREAK.EXTEND}else if(t<3536){if(t===3535)return f.CLUSTER_BREAK.EXTEND}else if(3536<=t&&t<=3537)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3542){if(3538<=t&&t<=3540)return f.CLUSTER_BREAK.EXTEND}else if(t<3544){if(t===3542)return f.CLUSTER_BREAK.EXTEND}else if(3544<=t&&t<=3550)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3893){if(t<3655){if(t<3633){if(t<3570){if(t===3551)return f.CLUSTER_BREAK.EXTEND}else if(3570<=t&&t<=3571)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3635){if(t===3633)return f.CLUSTER_BREAK.EXTEND}else if(t<3636){if(t===3635)return f.CLUSTER_BREAK.SPACINGMARK}else if(3636<=t&&t<=3642)return f.CLUSTER_BREAK.EXTEND}else if(t<3764)if(t<3761){if(3655<=t&&t<=3662)return f.CLUSTER_BREAK.EXTEND}else{if(t===3761)return f.CLUSTER_BREAK.EXTEND;if(t===3763)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3784){if(3764<=t&&t<=3772)return f.CLUSTER_BREAK.EXTEND}else if(t<3864){if(3784<=t&&t<=3790)return f.CLUSTER_BREAK.EXTEND}else if(3864<=t&&t<=3865)return f.CLUSTER_BREAK.EXTEND}else if(t<3967){if(t<3897){if(t===3893||t===3895)return f.CLUSTER_BREAK.EXTEND}else if(t<3902){if(t===3897)return f.CLUSTER_BREAK.EXTEND}else if(t<3953){if(3902<=t&&t<=3903)return f.CLUSTER_BREAK.SPACINGMARK}else if(3953<=t&&t<=3966)return f.CLUSTER_BREAK.EXTEND}else if(t<3981){if(t<3968){if(t===3967)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<3974){if(3968<=t&&t<=3972)return f.CLUSTER_BREAK.EXTEND}else if(3974<=t&&t<=3975)return f.CLUSTER_BREAK.EXTEND}else if(t<3993){if(3981<=t&&t<=3991)return f.CLUSTER_BREAK.EXTEND}else if(t<4038){if(3993<=t&&t<=4028)return f.CLUSTER_BREAK.EXTEND}else if(t===4038)return f.CLUSTER_BREAK.EXTEND}else if(t<7204){if(t<6448){if(t<5938){if(t<4226){if(t<4157){if(t<4146){if(t<4145){if(4141<=t&&t<=4144)return f.CLUSTER_BREAK.EXTEND}else if(t===4145)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4153){if(4146<=t&&t<=4151)return f.CLUSTER_BREAK.EXTEND}else if(t<4155){if(4153<=t&&t<=4154)return f.CLUSTER_BREAK.EXTEND}else if(4155<=t&&t<=4156)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4184){if(t<4182){if(4157<=t&&t<=4158)return f.CLUSTER_BREAK.EXTEND}else if(4182<=t&&t<=4183)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4190){if(4184<=t&&t<=4185)return f.CLUSTER_BREAK.EXTEND}else if(t<4209){if(4190<=t&&t<=4192)return f.CLUSTER_BREAK.EXTEND}else if(4209<=t&&t<=4212)return f.CLUSTER_BREAK.EXTEND}else if(t<4352){if(t<4229){if(t===4226)return f.CLUSTER_BREAK.EXTEND;if(t===4228)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<4237){if(4229<=t&&t<=4230)return f.CLUSTER_BREAK.EXTEND}else if(t===4237||t===4253)return f.CLUSTER_BREAK.EXTEND}else if(t<4957){if(t<4448){if(4352<=t&&t<=4447)return f.CLUSTER_BREAK.L}else if(t<4520){if(4448<=t&&t<=4519)return f.CLUSTER_BREAK.V}else if(4520<=t&&t<=4607)return f.CLUSTER_BREAK.T}else if(t<5906){if(4957<=t&&t<=4959)return f.CLUSTER_BREAK.EXTEND}else if(t<5909){if(5906<=t&&t<=5908)return f.CLUSTER_BREAK.EXTEND}else if(t===5909)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6089){if(t<6070){if(t<5970){if(t<5940){if(5938<=t&&t<=5939)return f.CLUSTER_BREAK.EXTEND}else if(t===5940)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6002){if(5970<=t&&t<=5971)return f.CLUSTER_BREAK.EXTEND}else if(t<6068){if(6002<=t&&t<=6003)return f.CLUSTER_BREAK.EXTEND}else if(6068<=t&&t<=6069)return f.CLUSTER_BREAK.EXTEND}else if(t<6078){if(t<6071){if(t===6070)return f.CLUSTER_BREAK.SPACINGMARK}else if(6071<=t&&t<=6077)return f.CLUSTER_BREAK.EXTEND}else if(t<6086){if(6078<=t&&t<=6085)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6087){if(t===6086)return f.CLUSTER_BREAK.EXTEND}else if(6087<=t&&t<=6088)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6277)if(t<6155){if(t<6109){if(6089<=t&&t<=6099)return f.CLUSTER_BREAK.EXTEND}else if(t===6109)return f.CLUSTER_BREAK.EXTEND}else if(t<6158){if(6155<=t&&t<=6157)return f.CLUSTER_BREAK.EXTEND}else{if(t===6158)return f.CLUSTER_BREAK.CONTROL;if(t===6159)return f.CLUSTER_BREAK.EXTEND}else if(t<6435){if(t<6313){if(6277<=t&&t<=6278)return f.CLUSTER_BREAK.EXTEND}else if(t<6432){if(t===6313)return f.CLUSTER_BREAK.EXTEND}else if(6432<=t&&t<=6434)return f.CLUSTER_BREAK.EXTEND}else if(t<6439){if(6435<=t&&t<=6438)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6441){if(6439<=t&&t<=6440)return f.CLUSTER_BREAK.EXTEND}else if(6441<=t&&t<=6443)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6971){if(t<6744)if(t<6681){if(t<6451){if(t<6450){if(6448<=t&&t<=6449)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===6450)return f.CLUSTER_BREAK.EXTEND}else if(t<6457){if(6451<=t&&t<=6456)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6679){if(6457<=t&&t<=6459)return f.CLUSTER_BREAK.EXTEND}else if(6679<=t&&t<=6680)return f.CLUSTER_BREAK.EXTEND}else if(t<6741){if(t<6683){if(6681<=t&&t<=6682)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===6683)return f.CLUSTER_BREAK.EXTEND}else if(t<6742){if(t===6741)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===6742)return f.CLUSTER_BREAK.EXTEND;if(t===6743)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6771){if(t<6754){if(t<6752){if(6744<=t&&t<=6750)return f.CLUSTER_BREAK.EXTEND}else if(t===6752)return f.CLUSTER_BREAK.EXTEND}else if(t<6757){if(t===6754)return f.CLUSTER_BREAK.EXTEND}else if(t<6765){if(6757<=t&&t<=6764)return f.CLUSTER_BREAK.EXTEND}else if(6765<=t&&t<=6770)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6912){if(t<6783){if(6771<=t&&t<=6780)return f.CLUSTER_BREAK.EXTEND}else if(t<6832){if(t===6783)return f.CLUSTER_BREAK.EXTEND}else if(6832<=t&&t<=6862)return f.CLUSTER_BREAK.EXTEND}else if(t<6916){if(6912<=t&&t<=6915)return f.CLUSTER_BREAK.EXTEND}else if(t<6964){if(t===6916)return f.CLUSTER_BREAK.SPACINGMARK}else if(6964<=t&&t<=6970)return f.CLUSTER_BREAK.EXTEND}else if(t<7080){if(t<7019){if(t<6973){if(t===6971)return f.CLUSTER_BREAK.SPACINGMARK;if(t===6972)return f.CLUSTER_BREAK.EXTEND}else if(t<6978){if(6973<=t&&t<=6977)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<6979){if(t===6978)return f.CLUSTER_BREAK.EXTEND}else if(6979<=t&&t<=6980)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7073){if(t<7040){if(7019<=t&&t<=7027)return f.CLUSTER_BREAK.EXTEND}else if(t<7042){if(7040<=t&&t<=7041)return f.CLUSTER_BREAK.EXTEND}else if(t===7042)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7074){if(t===7073)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7078){if(7074<=t&&t<=7077)return f.CLUSTER_BREAK.EXTEND}else if(7078<=t&&t<=7079)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7144)if(t<7083){if(t<7082){if(7080<=t&&t<=7081)return f.CLUSTER_BREAK.EXTEND}else if(t===7082)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7142){if(7083<=t&&t<=7085)return f.CLUSTER_BREAK.EXTEND}else{if(t===7142)return f.CLUSTER_BREAK.EXTEND;if(t===7143)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7150){if(t<7146){if(7144<=t&&t<=7145)return f.CLUSTER_BREAK.EXTEND}else if(t<7149){if(7146<=t&&t<=7148)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===7149)return f.CLUSTER_BREAK.EXTEND}else if(t<7151){if(t===7150)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7154){if(7151<=t&&t<=7153)return f.CLUSTER_BREAK.EXTEND}else if(7154<=t&&t<=7155)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43346){if(t<11647){if(t<7415){if(t<7380){if(t<7220){if(t<7212){if(7204<=t&&t<=7211)return f.CLUSTER_BREAK.SPACINGMARK}else if(7212<=t&&t<=7219)return f.CLUSTER_BREAK.EXTEND}else if(t<7222){if(7220<=t&&t<=7221)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7376){if(7222<=t&&t<=7223)return f.CLUSTER_BREAK.EXTEND}else if(7376<=t&&t<=7378)return f.CLUSTER_BREAK.EXTEND}else if(t<7394){if(t<7393){if(7380<=t&&t<=7392)return f.CLUSTER_BREAK.EXTEND}else if(t===7393)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<7405){if(7394<=t&&t<=7400)return f.CLUSTER_BREAK.EXTEND}else if(t===7405||t===7412)return f.CLUSTER_BREAK.EXTEND}else if(t<8205)if(t<7616){if(t<7416){if(t===7415)return f.CLUSTER_BREAK.SPACINGMARK}else if(7416<=t&&t<=7417)return f.CLUSTER_BREAK.EXTEND}else if(t<8203){if(7616<=t&&t<=7679)return f.CLUSTER_BREAK.EXTEND}else{if(t===8203)return f.CLUSTER_BREAK.CONTROL;if(t===8204)return f.CLUSTER_BREAK.EXTEND}else if(t<8288){if(t<8206){if(t===8205)return f.CLUSTER_BREAK.ZWJ}else if(t<8232){if(8206<=t&&t<=8207)return f.CLUSTER_BREAK.CONTROL}else if(8232<=t&&t<=8238)return f.CLUSTER_BREAK.CONTROL}else if(t<8400){if(8288<=t&&t<=8303)return f.CLUSTER_BREAK.CONTROL}else if(t<11503){if(8400<=t&&t<=8432)return f.CLUSTER_BREAK.EXTEND}else if(11503<=t&&t<=11505)return f.CLUSTER_BREAK.EXTEND}else if(t<43043){if(t<42612){if(t<12330){if(t<11744){if(t===11647)return f.CLUSTER_BREAK.EXTEND}else if(11744<=t&&t<=11775)return f.CLUSTER_BREAK.EXTEND}else if(t<12441){if(12330<=t&&t<=12335)return f.CLUSTER_BREAK.EXTEND}else if(t<42607){if(12441<=t&&t<=12442)return f.CLUSTER_BREAK.EXTEND}else if(42607<=t&&t<=42610)return f.CLUSTER_BREAK.EXTEND}else if(t<43010){if(t<42654){if(42612<=t&&t<=42621)return f.CLUSTER_BREAK.EXTEND}else if(t<42736){if(42654<=t&&t<=42655)return f.CLUSTER_BREAK.EXTEND}else if(42736<=t&&t<=42737)return f.CLUSTER_BREAK.EXTEND}else if(t<43014){if(t===43010)return f.CLUSTER_BREAK.EXTEND}else if(t===43014||t===43019)return f.CLUSTER_BREAK.EXTEND}else if(t<43188){if(t<43047){if(t<43045){if(43043<=t&&t<=43044)return f.CLUSTER_BREAK.SPACINGMARK}else if(43045<=t&&t<=43046)return f.CLUSTER_BREAK.EXTEND}else if(t<43052){if(t===43047)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43136){if(t===43052)return f.CLUSTER_BREAK.EXTEND}else if(43136<=t&&t<=43137)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43263){if(t<43204){if(43188<=t&&t<=43203)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43232){if(43204<=t&&t<=43205)return f.CLUSTER_BREAK.EXTEND}else if(43232<=t&&t<=43249)return f.CLUSTER_BREAK.EXTEND}else if(t<43302){if(t===43263)return f.CLUSTER_BREAK.EXTEND}else if(t<43335){if(43302<=t&&t<=43309)return f.CLUSTER_BREAK.EXTEND}else if(43335<=t&&t<=43345)return f.CLUSTER_BREAK.EXTEND}else if(t<43698){if(t<43493){if(t<43444)if(t<43392){if(t<43360){if(43346<=t&&t<=43347)return f.CLUSTER_BREAK.SPACINGMARK}else if(43360<=t&&t<=43388)return f.CLUSTER_BREAK.L}else if(t<43395){if(43392<=t&&t<=43394)return f.CLUSTER_BREAK.EXTEND}else{if(t===43395)return f.CLUSTER_BREAK.SPACINGMARK;if(t===43443)return f.CLUSTER_BREAK.EXTEND}else if(t<43450){if(t<43446){if(43444<=t&&t<=43445)return f.CLUSTER_BREAK.SPACINGMARK}else if(43446<=t&&t<=43449)return f.CLUSTER_BREAK.EXTEND}else if(t<43452){if(43450<=t&&t<=43451)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43454){if(43452<=t&&t<=43453)return f.CLUSTER_BREAK.EXTEND}else if(43454<=t&&t<=43456)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43573){if(t<43567){if(t<43561){if(t===43493)return f.CLUSTER_BREAK.EXTEND}else if(43561<=t&&t<=43566)return f.CLUSTER_BREAK.EXTEND}else if(t<43569){if(43567<=t&&t<=43568)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43571){if(43569<=t&&t<=43570)return f.CLUSTER_BREAK.EXTEND}else if(43571<=t&&t<=43572)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43597){if(t<43587){if(43573<=t&&t<=43574)return f.CLUSTER_BREAK.EXTEND}else if(t===43587||t===43596)return f.CLUSTER_BREAK.EXTEND}else if(t<43644){if(t===43597)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===43644||t===43696)return f.CLUSTER_BREAK.EXTEND}else if(t<44006){if(t<43756)if(t<43710){if(t<43703){if(43698<=t&&t<=43700)return f.CLUSTER_BREAK.EXTEND}else if(43703<=t&&t<=43704)return f.CLUSTER_BREAK.EXTEND}else if(t<43713){if(43710<=t&&t<=43711)return f.CLUSTER_BREAK.EXTEND}else{if(t===43713)return f.CLUSTER_BREAK.EXTEND;if(t===43755)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<43766){if(t<43758){if(43756<=t&&t<=43757)return f.CLUSTER_BREAK.EXTEND}else if(t<43765){if(43758<=t&&t<=43759)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===43765)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<44003){if(t===43766)return f.CLUSTER_BREAK.EXTEND}else if(t<44005){if(44003<=t&&t<=44004)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===44005)return f.CLUSTER_BREAK.EXTEND}else if(t<44032)if(t<44009){if(t<44008){if(44006<=t&&t<=44007)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===44008)return f.CLUSTER_BREAK.EXTEND}else if(t<44012){if(44009<=t&&t<=44010)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===44012)return f.CLUSTER_BREAK.SPACINGMARK;if(t===44013)return f.CLUSTER_BREAK.EXTEND}else if(t<44061){if(t<44033){if(t===44032)return f.CLUSTER_BREAK.LV}else if(t<44060){if(44033<=t&&t<=44059)return f.CLUSTER_BREAK.LVT}else if(t===44060)return f.CLUSTER_BREAK.LV}else if(t<44088){if(44061<=t&&t<=44087)return f.CLUSTER_BREAK.LVT}else if(t<44089){if(t===44088)return f.CLUSTER_BREAK.LV}else if(44089<=t&&t<=44115)return f.CLUSTER_BREAK.LVT}else if(t<46497){if(t<45293){if(t<44704){if(t<44397){if(t<44256){if(t<44173){if(t<44144){if(t<44117){if(t===44116)return f.CLUSTER_BREAK.LV}else if(44117<=t&&t<=44143)return f.CLUSTER_BREAK.LVT}else if(t<44145){if(t===44144)return f.CLUSTER_BREAK.LV}else if(t<44172){if(44145<=t&&t<=44171)return f.CLUSTER_BREAK.LVT}else if(t===44172)return f.CLUSTER_BREAK.LV}else if(t<44201){if(t<44200){if(44173<=t&&t<=44199)return f.CLUSTER_BREAK.LVT}else if(t===44200)return f.CLUSTER_BREAK.LV}else if(t<44228){if(44201<=t&&t<=44227)return f.CLUSTER_BREAK.LVT}else if(t<44229){if(t===44228)return f.CLUSTER_BREAK.LV}else if(44229<=t&&t<=44255)return f.CLUSTER_BREAK.LVT}else if(t<44313){if(t<44284){if(t<44257){if(t===44256)return f.CLUSTER_BREAK.LV}else if(44257<=t&&t<=44283)return f.CLUSTER_BREAK.LVT}else if(t<44285){if(t===44284)return f.CLUSTER_BREAK.LV}else if(t<44312){if(44285<=t&&t<=44311)return f.CLUSTER_BREAK.LVT}else if(t===44312)return f.CLUSTER_BREAK.LV}else if(t<44368){if(t<44340){if(44313<=t&&t<=44339)return f.CLUSTER_BREAK.LVT}else if(t<44341){if(t===44340)return f.CLUSTER_BREAK.LV}else if(44341<=t&&t<=44367)return f.CLUSTER_BREAK.LVT}else if(t<44369){if(t===44368)return f.CLUSTER_BREAK.LV}else if(t<44396){if(44369<=t&&t<=44395)return f.CLUSTER_BREAK.LVT}else if(t===44396)return f.CLUSTER_BREAK.LV}else if(t<44537){if(t<44480){if(t<44425){if(t<44424){if(44397<=t&&t<=44423)return f.CLUSTER_BREAK.LVT}else if(t===44424)return f.CLUSTER_BREAK.LV}else if(t<44452){if(44425<=t&&t<=44451)return f.CLUSTER_BREAK.LVT}else if(t<44453){if(t===44452)return f.CLUSTER_BREAK.LV}else if(44453<=t&&t<=44479)return f.CLUSTER_BREAK.LVT}else if(t<44508){if(t<44481){if(t===44480)return f.CLUSTER_BREAK.LV}else if(44481<=t&&t<=44507)return f.CLUSTER_BREAK.LVT}else if(t<44509){if(t===44508)return f.CLUSTER_BREAK.LV}else if(t<44536){if(44509<=t&&t<=44535)return f.CLUSTER_BREAK.LVT}else if(t===44536)return f.CLUSTER_BREAK.LV}else if(t<44620){if(t<44565){if(t<44564){if(44537<=t&&t<=44563)return f.CLUSTER_BREAK.LVT}else if(t===44564)return f.CLUSTER_BREAK.LV}else if(t<44592){if(44565<=t&&t<=44591)return f.CLUSTER_BREAK.LVT}else if(t<44593){if(t===44592)return f.CLUSTER_BREAK.LV}else if(44593<=t&&t<=44619)return f.CLUSTER_BREAK.LVT}else if(t<44649){if(t<44621){if(t===44620)return f.CLUSTER_BREAK.LV}else if(t<44648){if(44621<=t&&t<=44647)return f.CLUSTER_BREAK.LVT}else if(t===44648)return f.CLUSTER_BREAK.LV}else if(t<44676){if(44649<=t&&t<=44675)return f.CLUSTER_BREAK.LVT}else if(t<44677){if(t===44676)return f.CLUSTER_BREAK.LV}else if(44677<=t&&t<=44703)return f.CLUSTER_BREAK.LVT}else if(t<44985){if(t<44844){if(t<44761){if(t<44732){if(t<44705){if(t===44704)return f.CLUSTER_BREAK.LV}else if(44705<=t&&t<=44731)return f.CLUSTER_BREAK.LVT}else if(t<44733){if(t===44732)return f.CLUSTER_BREAK.LV}else if(t<44760){if(44733<=t&&t<=44759)return f.CLUSTER_BREAK.LVT}else if(t===44760)return f.CLUSTER_BREAK.LV}else if(t<44789){if(t<44788){if(44761<=t&&t<=44787)return f.CLUSTER_BREAK.LVT}else if(t===44788)return f.CLUSTER_BREAK.LV}else if(t<44816){if(44789<=t&&t<=44815)return f.CLUSTER_BREAK.LVT}else if(t<44817){if(t===44816)return f.CLUSTER_BREAK.LV}else if(44817<=t&&t<=44843)return f.CLUSTER_BREAK.LVT}else if(t<44901){if(t<44872){if(t<44845){if(t===44844)return f.CLUSTER_BREAK.LV}else if(44845<=t&&t<=44871)return f.CLUSTER_BREAK.LVT}else if(t<44873){if(t===44872)return f.CLUSTER_BREAK.LV}else if(t<44900){if(44873<=t&&t<=44899)return f.CLUSTER_BREAK.LVT}else if(t===44900)return f.CLUSTER_BREAK.LV}else if(t<44956){if(t<44928){if(44901<=t&&t<=44927)return f.CLUSTER_BREAK.LVT}else if(t<44929){if(t===44928)return f.CLUSTER_BREAK.LV}else if(44929<=t&&t<=44955)return f.CLUSTER_BREAK.LVT}else if(t<44957){if(t===44956)return f.CLUSTER_BREAK.LV}else if(t<44984){if(44957<=t&&t<=44983)return f.CLUSTER_BREAK.LVT}else if(t===44984)return f.CLUSTER_BREAK.LV}else if(t<45152){if(t<45068){if(t<45013){if(t<45012){if(44985<=t&&t<=45011)return f.CLUSTER_BREAK.LVT}else if(t===45012)return f.CLUSTER_BREAK.LV}else if(t<45040){if(45013<=t&&t<=45039)return f.CLUSTER_BREAK.LVT}else if(t<45041){if(t===45040)return f.CLUSTER_BREAK.LV}else if(45041<=t&&t<=45067)return f.CLUSTER_BREAK.LVT}else if(t<45097){if(t<45069){if(t===45068)return f.CLUSTER_BREAK.LV}else if(t<45096){if(45069<=t&&t<=45095)return f.CLUSTER_BREAK.LVT}else if(t===45096)return f.CLUSTER_BREAK.LV}else if(t<45124){if(45097<=t&&t<=45123)return f.CLUSTER_BREAK.LVT}else if(t<45125){if(t===45124)return f.CLUSTER_BREAK.LV}else if(45125<=t&&t<=45151)return f.CLUSTER_BREAK.LVT}else if(t<45209){if(t<45180){if(t<45153){if(t===45152)return f.CLUSTER_BREAK.LV}else if(45153<=t&&t<=45179)return f.CLUSTER_BREAK.LVT}else if(t<45181){if(t===45180)return f.CLUSTER_BREAK.LV}else if(t<45208){if(45181<=t&&t<=45207)return f.CLUSTER_BREAK.LVT}else if(t===45208)return f.CLUSTER_BREAK.LV}else if(t<45264){if(t<45236){if(45209<=t&&t<=45235)return f.CLUSTER_BREAK.LVT}else if(t<45237){if(t===45236)return f.CLUSTER_BREAK.LV}else if(45237<=t&&t<=45263)return f.CLUSTER_BREAK.LVT}else if(t<45265){if(t===45264)return f.CLUSTER_BREAK.LV}else if(t<45292){if(45265<=t&&t<=45291)return f.CLUSTER_BREAK.LVT}else if(t===45292)return f.CLUSTER_BREAK.LV}else if(t<45908){if(t<45600){if(t<45433){if(t<45376){if(t<45321){if(t<45320){if(45293<=t&&t<=45319)return f.CLUSTER_BREAK.LVT}else if(t===45320)return f.CLUSTER_BREAK.LV}else if(t<45348){if(45321<=t&&t<=45347)return f.CLUSTER_BREAK.LVT}else if(t<45349){if(t===45348)return f.CLUSTER_BREAK.LV}else if(45349<=t&&t<=45375)return f.CLUSTER_BREAK.LVT}else if(t<45404){if(t<45377){if(t===45376)return f.CLUSTER_BREAK.LV}else if(45377<=t&&t<=45403)return f.CLUSTER_BREAK.LVT}else if(t<45405){if(t===45404)return f.CLUSTER_BREAK.LV}else if(t<45432){if(45405<=t&&t<=45431)return f.CLUSTER_BREAK.LVT}else if(t===45432)return f.CLUSTER_BREAK.LV}else if(t<45516){if(t<45461){if(t<45460){if(45433<=t&&t<=45459)return f.CLUSTER_BREAK.LVT}else if(t===45460)return f.CLUSTER_BREAK.LV}else if(t<45488){if(45461<=t&&t<=45487)return f.CLUSTER_BREAK.LVT}else if(t<45489){if(t===45488)return f.CLUSTER_BREAK.LV}else if(45489<=t&&t<=45515)return f.CLUSTER_BREAK.LVT}else if(t<45545){if(t<45517){if(t===45516)return f.CLUSTER_BREAK.LV}else if(t<45544){if(45517<=t&&t<=45543)return f.CLUSTER_BREAK.LVT}else if(t===45544)return f.CLUSTER_BREAK.LV}else if(t<45572){if(45545<=t&&t<=45571)return f.CLUSTER_BREAK.LVT}else if(t<45573){if(t===45572)return f.CLUSTER_BREAK.LV}else if(45573<=t&&t<=45599)return f.CLUSTER_BREAK.LVT}else if(t<45741){if(t<45657){if(t<45628){if(t<45601){if(t===45600)return f.CLUSTER_BREAK.LV}else if(45601<=t&&t<=45627)return f.CLUSTER_BREAK.LVT}else if(t<45629){if(t===45628)return f.CLUSTER_BREAK.LV}else if(t<45656){if(45629<=t&&t<=45655)return f.CLUSTER_BREAK.LVT}else if(t===45656)return f.CLUSTER_BREAK.LV}else if(t<45712){if(t<45684){if(45657<=t&&t<=45683)return f.CLUSTER_BREAK.LVT}else if(t<45685){if(t===45684)return f.CLUSTER_BREAK.LV}else if(45685<=t&&t<=45711)return f.CLUSTER_BREAK.LVT}else if(t<45713){if(t===45712)return f.CLUSTER_BREAK.LV}else if(t<45740){if(45713<=t&&t<=45739)return f.CLUSTER_BREAK.LVT}else if(t===45740)return f.CLUSTER_BREAK.LV}else if(t<45824){if(t<45769){if(t<45768){if(45741<=t&&t<=45767)return f.CLUSTER_BREAK.LVT}else if(t===45768)return f.CLUSTER_BREAK.LV}else if(t<45796){if(45769<=t&&t<=45795)return f.CLUSTER_BREAK.LVT}else if(t<45797){if(t===45796)return f.CLUSTER_BREAK.LV}else if(45797<=t&&t<=45823)return f.CLUSTER_BREAK.LVT}else if(t<45853){if(t<45825){if(t===45824)return f.CLUSTER_BREAK.LV}else if(t<45852){if(45825<=t&&t<=45851)return f.CLUSTER_BREAK.LVT}else if(t===45852)return f.CLUSTER_BREAK.LV}else if(t<45880){if(45853<=t&&t<=45879)return f.CLUSTER_BREAK.LVT}else if(t<45881){if(t===45880)return f.CLUSTER_BREAK.LV}else if(45881<=t&&t<=45907)return f.CLUSTER_BREAK.LVT}else if(t<46189){if(t<46048){if(t<45965){if(t<45936){if(t<45909){if(t===45908)return f.CLUSTER_BREAK.LV}else if(45909<=t&&t<=45935)return f.CLUSTER_BREAK.LVT}else if(t<45937){if(t===45936)return f.CLUSTER_BREAK.LV}else if(t<45964){if(45937<=t&&t<=45963)return f.CLUSTER_BREAK.LVT}else if(t===45964)return f.CLUSTER_BREAK.LV}else if(t<45993){if(t<45992){if(45965<=t&&t<=45991)return f.CLUSTER_BREAK.LVT}else if(t===45992)return f.CLUSTER_BREAK.LV}else if(t<46020){if(45993<=t&&t<=46019)return f.CLUSTER_BREAK.LVT}else if(t<46021){if(t===46020)return f.CLUSTER_BREAK.LV}else if(46021<=t&&t<=46047)return f.CLUSTER_BREAK.LVT}else if(t<46105){if(t<46076){if(t<46049){if(t===46048)return f.CLUSTER_BREAK.LV}else if(46049<=t&&t<=46075)return f.CLUSTER_BREAK.LVT}else if(t<46077){if(t===46076)return f.CLUSTER_BREAK.LV}else if(t<46104){if(46077<=t&&t<=46103)return f.CLUSTER_BREAK.LVT}else if(t===46104)return f.CLUSTER_BREAK.LV}else if(t<46160){if(t<46132){if(46105<=t&&t<=46131)return f.CLUSTER_BREAK.LVT}else if(t<46133){if(t===46132)return f.CLUSTER_BREAK.LV}else if(46133<=t&&t<=46159)return f.CLUSTER_BREAK.LVT}else if(t<46161){if(t===46160)return f.CLUSTER_BREAK.LV}else if(t<46188){if(46161<=t&&t<=46187)return f.CLUSTER_BREAK.LVT}else if(t===46188)return f.CLUSTER_BREAK.LV}else if(t<46356){if(t<46272){if(t<46217){if(t<46216){if(46189<=t&&t<=46215)return f.CLUSTER_BREAK.LVT}else if(t===46216)return f.CLUSTER_BREAK.LV}else if(t<46244){if(46217<=t&&t<=46243)return f.CLUSTER_BREAK.LVT}else if(t<46245){if(t===46244)return f.CLUSTER_BREAK.LV}else if(46245<=t&&t<=46271)return f.CLUSTER_BREAK.LVT}else if(t<46301){if(t<46273){if(t===46272)return f.CLUSTER_BREAK.LV}else if(t<46300){if(46273<=t&&t<=46299)return f.CLUSTER_BREAK.LVT}else if(t===46300)return f.CLUSTER_BREAK.LV}else if(t<46328){if(46301<=t&&t<=46327)return f.CLUSTER_BREAK.LVT}else if(t<46329){if(t===46328)return f.CLUSTER_BREAK.LV}else if(46329<=t&&t<=46355)return f.CLUSTER_BREAK.LVT}else if(t<46413){if(t<46384){if(t<46357){if(t===46356)return f.CLUSTER_BREAK.LV}else if(46357<=t&&t<=46383)return f.CLUSTER_BREAK.LVT}else if(t<46385){if(t===46384)return f.CLUSTER_BREAK.LV}else if(t<46412){if(46385<=t&&t<=46411)return f.CLUSTER_BREAK.LVT}else if(t===46412)return f.CLUSTER_BREAK.LV}else if(t<46468){if(t<46440){if(46413<=t&&t<=46439)return f.CLUSTER_BREAK.LVT}else if(t<46441){if(t===46440)return f.CLUSTER_BREAK.LV}else if(46441<=t&&t<=46467)return f.CLUSTER_BREAK.LVT}else if(t<46469){if(t===46468)return f.CLUSTER_BREAK.LV}else if(t<46496){if(46469<=t&&t<=46495)return f.CLUSTER_BREAK.LVT}else if(t===46496)return f.CLUSTER_BREAK.LV}else if(t<47701){if(t<47112){if(t<46804){if(t<46637){if(t<46580){if(t<46525){if(t<46524){if(46497<=t&&t<=46523)return f.CLUSTER_BREAK.LVT}else if(t===46524)return f.CLUSTER_BREAK.LV}else if(t<46552){if(46525<=t&&t<=46551)return f.CLUSTER_BREAK.LVT}else if(t<46553){if(t===46552)return f.CLUSTER_BREAK.LV}else if(46553<=t&&t<=46579)return f.CLUSTER_BREAK.LVT}else if(t<46608){if(t<46581){if(t===46580)return f.CLUSTER_BREAK.LV}else if(46581<=t&&t<=46607)return f.CLUSTER_BREAK.LVT}else if(t<46609){if(t===46608)return f.CLUSTER_BREAK.LV}else if(t<46636){if(46609<=t&&t<=46635)return f.CLUSTER_BREAK.LVT}else if(t===46636)return f.CLUSTER_BREAK.LV}else if(t<46720){if(t<46665){if(t<46664){if(46637<=t&&t<=46663)return f.CLUSTER_BREAK.LVT}else if(t===46664)return f.CLUSTER_BREAK.LV}else if(t<46692){if(46665<=t&&t<=46691)return f.CLUSTER_BREAK.LVT}else if(t<46693){if(t===46692)return f.CLUSTER_BREAK.LV}else if(46693<=t&&t<=46719)return f.CLUSTER_BREAK.LVT}else if(t<46749){if(t<46721){if(t===46720)return f.CLUSTER_BREAK.LV}else if(t<46748){if(46721<=t&&t<=46747)return f.CLUSTER_BREAK.LVT}else if(t===46748)return f.CLUSTER_BREAK.LV}else if(t<46776){if(46749<=t&&t<=46775)return f.CLUSTER_BREAK.LVT}else if(t<46777){if(t===46776)return f.CLUSTER_BREAK.LV}else if(46777<=t&&t<=46803)return f.CLUSTER_BREAK.LVT}else if(t<46945){if(t<46861){if(t<46832){if(t<46805){if(t===46804)return f.CLUSTER_BREAK.LV}else if(46805<=t&&t<=46831)return f.CLUSTER_BREAK.LVT}else if(t<46833){if(t===46832)return f.CLUSTER_BREAK.LV}else if(t<46860){if(46833<=t&&t<=46859)return f.CLUSTER_BREAK.LVT}else if(t===46860)return f.CLUSTER_BREAK.LV}else if(t<46916){if(t<46888){if(46861<=t&&t<=46887)return f.CLUSTER_BREAK.LVT}else if(t<46889){if(t===46888)return f.CLUSTER_BREAK.LV}else if(46889<=t&&t<=46915)return f.CLUSTER_BREAK.LVT}else if(t<46917){if(t===46916)return f.CLUSTER_BREAK.LV}else if(t<46944){if(46917<=t&&t<=46943)return f.CLUSTER_BREAK.LVT}else if(t===46944)return f.CLUSTER_BREAK.LV}else if(t<47028){if(t<46973){if(t<46972){if(46945<=t&&t<=46971)return f.CLUSTER_BREAK.LVT}else if(t===46972)return f.CLUSTER_BREAK.LV}else if(t<47e3){if(46973<=t&&t<=46999)return f.CLUSTER_BREAK.LVT}else if(t<47001){if(t===47e3)return f.CLUSTER_BREAK.LV}else if(47001<=t&&t<=47027)return f.CLUSTER_BREAK.LVT}else if(t<47057){if(t<47029){if(t===47028)return f.CLUSTER_BREAK.LV}else if(t<47056){if(47029<=t&&t<=47055)return f.CLUSTER_BREAK.LVT}else if(t===47056)return f.CLUSTER_BREAK.LV}else if(t<47084){if(47057<=t&&t<=47083)return f.CLUSTER_BREAK.LVT}else if(t<47085){if(t===47084)return f.CLUSTER_BREAK.LV}else if(47085<=t&&t<=47111)return f.CLUSTER_BREAK.LVT}else if(t<47393){if(t<47252){if(t<47169){if(t<47140){if(t<47113){if(t===47112)return f.CLUSTER_BREAK.LV}else if(47113<=t&&t<=47139)return f.CLUSTER_BREAK.LVT}else if(t<47141){if(t===47140)return f.CLUSTER_BREAK.LV}else if(t<47168){if(47141<=t&&t<=47167)return f.CLUSTER_BREAK.LVT}else if(t===47168)return f.CLUSTER_BREAK.LV}else if(t<47197){if(t<47196){if(47169<=t&&t<=47195)return f.CLUSTER_BREAK.LVT}else if(t===47196)return f.CLUSTER_BREAK.LV}else if(t<47224){if(47197<=t&&t<=47223)return f.CLUSTER_BREAK.LVT}else if(t<47225){if(t===47224)return f.CLUSTER_BREAK.LV}else if(47225<=t&&t<=47251)return f.CLUSTER_BREAK.LVT}else if(t<47309){if(t<47280){if(t<47253){if(t===47252)return f.CLUSTER_BREAK.LV}else if(47253<=t&&t<=47279)return f.CLUSTER_BREAK.LVT}else if(t<47281){if(t===47280)return f.CLUSTER_BREAK.LV}else if(t<47308){if(47281<=t&&t<=47307)return f.CLUSTER_BREAK.LVT}else if(t===47308)return f.CLUSTER_BREAK.LV}else if(t<47364){if(t<47336){if(47309<=t&&t<=47335)return f.CLUSTER_BREAK.LVT}else if(t<47337){if(t===47336)return f.CLUSTER_BREAK.LV}else if(47337<=t&&t<=47363)return f.CLUSTER_BREAK.LVT}else if(t<47365){if(t===47364)return f.CLUSTER_BREAK.LV}else if(t<47392){if(47365<=t&&t<=47391)return f.CLUSTER_BREAK.LVT}else if(t===47392)return f.CLUSTER_BREAK.LV}else if(t<47560){if(t<47476){if(t<47421){if(t<47420){if(47393<=t&&t<=47419)return f.CLUSTER_BREAK.LVT}else if(t===47420)return f.CLUSTER_BREAK.LV}else if(t<47448){if(47421<=t&&t<=47447)return f.CLUSTER_BREAK.LVT}else if(t<47449){if(t===47448)return f.CLUSTER_BREAK.LV}else if(47449<=t&&t<=47475)return f.CLUSTER_BREAK.LVT}else if(t<47505){if(t<47477){if(t===47476)return f.CLUSTER_BREAK.LV}else if(t<47504){if(47477<=t&&t<=47503)return f.CLUSTER_BREAK.LVT}else if(t===47504)return f.CLUSTER_BREAK.LV}else if(t<47532){if(47505<=t&&t<=47531)return f.CLUSTER_BREAK.LVT}else if(t<47533){if(t===47532)return f.CLUSTER_BREAK.LV}else if(47533<=t&&t<=47559)return f.CLUSTER_BREAK.LVT}else if(t<47617){if(t<47588){if(t<47561){if(t===47560)return f.CLUSTER_BREAK.LV}else if(47561<=t&&t<=47587)return f.CLUSTER_BREAK.LVT}else if(t<47589){if(t===47588)return f.CLUSTER_BREAK.LV}else if(t<47616){if(47589<=t&&t<=47615)return f.CLUSTER_BREAK.LVT}else if(t===47616)return f.CLUSTER_BREAK.LV}else if(t<47672){if(t<47644){if(47617<=t&&t<=47643)return f.CLUSTER_BREAK.LVT}else if(t<47645){if(t===47644)return f.CLUSTER_BREAK.LV}else if(47645<=t&&t<=47671)return f.CLUSTER_BREAK.LVT}else if(t<47673){if(t===47672)return f.CLUSTER_BREAK.LV}else if(t<47700){if(47673<=t&&t<=47699)return f.CLUSTER_BREAK.LVT}else if(t===47700)return f.CLUSTER_BREAK.LV}else if(t<48316){if(t<48008){if(t<47841){if(t<47784){if(t<47729){if(t<47728){if(47701<=t&&t<=47727)return f.CLUSTER_BREAK.LVT}else if(t===47728)return f.CLUSTER_BREAK.LV}else if(t<47756){if(47729<=t&&t<=47755)return f.CLUSTER_BREAK.LVT}else if(t<47757){if(t===47756)return f.CLUSTER_BREAK.LV}else if(47757<=t&&t<=47783)return f.CLUSTER_BREAK.LVT}else if(t<47812){if(t<47785){if(t===47784)return f.CLUSTER_BREAK.LV}else if(47785<=t&&t<=47811)return f.CLUSTER_BREAK.LVT}else if(t<47813){if(t===47812)return f.CLUSTER_BREAK.LV}else if(t<47840){if(47813<=t&&t<=47839)return f.CLUSTER_BREAK.LVT}else if(t===47840)return f.CLUSTER_BREAK.LV}else if(t<47924){if(t<47869){if(t<47868){if(47841<=t&&t<=47867)return f.CLUSTER_BREAK.LVT}else if(t===47868)return f.CLUSTER_BREAK.LV}else if(t<47896){if(47869<=t&&t<=47895)return f.CLUSTER_BREAK.LVT}else if(t<47897){if(t===47896)return f.CLUSTER_BREAK.LV}else if(47897<=t&&t<=47923)return f.CLUSTER_BREAK.LVT}else if(t<47953){if(t<47925){if(t===47924)return f.CLUSTER_BREAK.LV}else if(t<47952){if(47925<=t&&t<=47951)return f.CLUSTER_BREAK.LVT}else if(t===47952)return f.CLUSTER_BREAK.LV}else if(t<47980){if(47953<=t&&t<=47979)return f.CLUSTER_BREAK.LVT}else if(t<47981){if(t===47980)return f.CLUSTER_BREAK.LV}else if(47981<=t&&t<=48007)return f.CLUSTER_BREAK.LVT}else if(t<48149){if(t<48065){if(t<48036){if(t<48009){if(t===48008)return f.CLUSTER_BREAK.LV}else if(48009<=t&&t<=48035)return f.CLUSTER_BREAK.LVT}else if(t<48037){if(t===48036)return f.CLUSTER_BREAK.LV}else if(t<48064){if(48037<=t&&t<=48063)return f.CLUSTER_BREAK.LVT}else if(t===48064)return f.CLUSTER_BREAK.LV}else if(t<48120){if(t<48092){if(48065<=t&&t<=48091)return f.CLUSTER_BREAK.LVT}else if(t<48093){if(t===48092)return f.CLUSTER_BREAK.LV}else if(48093<=t&&t<=48119)return f.CLUSTER_BREAK.LVT}else if(t<48121){if(t===48120)return f.CLUSTER_BREAK.LV}else if(t<48148){if(48121<=t&&t<=48147)return f.CLUSTER_BREAK.LVT}else if(t===48148)return f.CLUSTER_BREAK.LV}else if(t<48232){if(t<48177){if(t<48176){if(48149<=t&&t<=48175)return f.CLUSTER_BREAK.LVT}else if(t===48176)return f.CLUSTER_BREAK.LV}else if(t<48204){if(48177<=t&&t<=48203)return f.CLUSTER_BREAK.LVT}else if(t<48205){if(t===48204)return f.CLUSTER_BREAK.LV}else if(48205<=t&&t<=48231)return f.CLUSTER_BREAK.LVT}else if(t<48261){if(t<48233){if(t===48232)return f.CLUSTER_BREAK.LV}else if(t<48260){if(48233<=t&&t<=48259)return f.CLUSTER_BREAK.LVT}else if(t===48260)return f.CLUSTER_BREAK.LV}else if(t<48288){if(48261<=t&&t<=48287)return f.CLUSTER_BREAK.LVT}else if(t<48289){if(t===48288)return f.CLUSTER_BREAK.LV}else if(48289<=t&&t<=48315)return f.CLUSTER_BREAK.LVT}else if(t<48597){if(t<48456){if(t<48373){if(t<48344){if(t<48317){if(t===48316)return f.CLUSTER_BREAK.LV}else if(48317<=t&&t<=48343)return f.CLUSTER_BREAK.LVT}else if(t<48345){if(t===48344)return f.CLUSTER_BREAK.LV}else if(t<48372){if(48345<=t&&t<=48371)return f.CLUSTER_BREAK.LVT}else if(t===48372)return f.CLUSTER_BREAK.LV}else if(t<48401){if(t<48400){if(48373<=t&&t<=48399)return f.CLUSTER_BREAK.LVT}else if(t===48400)return f.CLUSTER_BREAK.LV}else if(t<48428){if(48401<=t&&t<=48427)return f.CLUSTER_BREAK.LVT}else if(t<48429){if(t===48428)return f.CLUSTER_BREAK.LV}else if(48429<=t&&t<=48455)return f.CLUSTER_BREAK.LVT}else if(t<48513){if(t<48484){if(t<48457){if(t===48456)return f.CLUSTER_BREAK.LV}else if(48457<=t&&t<=48483)return f.CLUSTER_BREAK.LVT}else if(t<48485){if(t===48484)return f.CLUSTER_BREAK.LV}else if(t<48512){if(48485<=t&&t<=48511)return f.CLUSTER_BREAK.LVT}else if(t===48512)return f.CLUSTER_BREAK.LV}else if(t<48568){if(t<48540){if(48513<=t&&t<=48539)return f.CLUSTER_BREAK.LVT}else if(t<48541){if(t===48540)return f.CLUSTER_BREAK.LV}else if(48541<=t&&t<=48567)return f.CLUSTER_BREAK.LVT}else if(t<48569){if(t===48568)return f.CLUSTER_BREAK.LV}else if(t<48596){if(48569<=t&&t<=48595)return f.CLUSTER_BREAK.LVT}else if(t===48596)return f.CLUSTER_BREAK.LV}else if(t<48764){if(t<48680){if(t<48625){if(t<48624){if(48597<=t&&t<=48623)return f.CLUSTER_BREAK.LVT}else if(t===48624)return f.CLUSTER_BREAK.LV}else if(t<48652){if(48625<=t&&t<=48651)return f.CLUSTER_BREAK.LVT}else if(t<48653){if(t===48652)return f.CLUSTER_BREAK.LV}else if(48653<=t&&t<=48679)return f.CLUSTER_BREAK.LVT}else if(t<48709){if(t<48681){if(t===48680)return f.CLUSTER_BREAK.LV}else if(t<48708){if(48681<=t&&t<=48707)return f.CLUSTER_BREAK.LVT}else if(t===48708)return f.CLUSTER_BREAK.LV}else if(t<48736){if(48709<=t&&t<=48735)return f.CLUSTER_BREAK.LVT}else if(t<48737){if(t===48736)return f.CLUSTER_BREAK.LV}else if(48737<=t&&t<=48763)return f.CLUSTER_BREAK.LVT}else if(t<48821){if(t<48792){if(t<48765){if(t===48764)return f.CLUSTER_BREAK.LV}else if(48765<=t&&t<=48791)return f.CLUSTER_BREAK.LVT}else if(t<48793){if(t===48792)return f.CLUSTER_BREAK.LV}else if(t<48820){if(48793<=t&&t<=48819)return f.CLUSTER_BREAK.LVT}else if(t===48820)return f.CLUSTER_BREAK.LV}else if(t<48876){if(t<48848){if(48821<=t&&t<=48847)return f.CLUSTER_BREAK.LVT}else if(t<48849){if(t===48848)return f.CLUSTER_BREAK.LV}else if(48849<=t&&t<=48875)return f.CLUSTER_BREAK.LVT}else if(t<48877){if(t===48876)return f.CLUSTER_BREAK.LV}else if(t<48904){if(48877<=t&&t<=48903)return f.CLUSTER_BREAK.LVT}else if(t===48904)return f.CLUSTER_BREAK.LV}else if(t<53720){if(t<51312){if(t<50108){if(t<49493){if(t<49212){if(t<49045){if(t<48988){if(t<48933){if(t<48932){if(48905<=t&&t<=48931)return f.CLUSTER_BREAK.LVT}else if(t===48932)return f.CLUSTER_BREAK.LV}else if(t<48960){if(48933<=t&&t<=48959)return f.CLUSTER_BREAK.LVT}else if(t<48961){if(t===48960)return f.CLUSTER_BREAK.LV}else if(48961<=t&&t<=48987)return f.CLUSTER_BREAK.LVT}else if(t<49016){if(t<48989){if(t===48988)return f.CLUSTER_BREAK.LV}else if(48989<=t&&t<=49015)return f.CLUSTER_BREAK.LVT}else if(t<49017){if(t===49016)return f.CLUSTER_BREAK.LV}else if(t<49044){if(49017<=t&&t<=49043)return f.CLUSTER_BREAK.LVT}else if(t===49044)return f.CLUSTER_BREAK.LV}else if(t<49128){if(t<49073){if(t<49072){if(49045<=t&&t<=49071)return f.CLUSTER_BREAK.LVT}else if(t===49072)return f.CLUSTER_BREAK.LV}else if(t<49100){if(49073<=t&&t<=49099)return f.CLUSTER_BREAK.LVT}else if(t<49101){if(t===49100)return f.CLUSTER_BREAK.LV}else if(49101<=t&&t<=49127)return f.CLUSTER_BREAK.LVT}else if(t<49157){if(t<49129){if(t===49128)return f.CLUSTER_BREAK.LV}else if(t<49156){if(49129<=t&&t<=49155)return f.CLUSTER_BREAK.LVT}else if(t===49156)return f.CLUSTER_BREAK.LV}else if(t<49184){if(49157<=t&&t<=49183)return f.CLUSTER_BREAK.LVT}else if(t<49185){if(t===49184)return f.CLUSTER_BREAK.LV}else if(49185<=t&&t<=49211)return f.CLUSTER_BREAK.LVT}else if(t<49352){if(t<49269){if(t<49240){if(t<49213){if(t===49212)return f.CLUSTER_BREAK.LV}else if(49213<=t&&t<=49239)return f.CLUSTER_BREAK.LVT}else if(t<49241){if(t===49240)return f.CLUSTER_BREAK.LV}else if(t<49268){if(49241<=t&&t<=49267)return f.CLUSTER_BREAK.LVT}else if(t===49268)return f.CLUSTER_BREAK.LV}else if(t<49297){if(t<49296){if(49269<=t&&t<=49295)return f.CLUSTER_BREAK.LVT}else if(t===49296)return f.CLUSTER_BREAK.LV}else if(t<49324){if(49297<=t&&t<=49323)return f.CLUSTER_BREAK.LVT}else if(t<49325){if(t===49324)return f.CLUSTER_BREAK.LV}else if(49325<=t&&t<=49351)return f.CLUSTER_BREAK.LVT}else if(t<49409){if(t<49380){if(t<49353){if(t===49352)return f.CLUSTER_BREAK.LV}else if(49353<=t&&t<=49379)return f.CLUSTER_BREAK.LVT}else if(t<49381){if(t===49380)return f.CLUSTER_BREAK.LV}else if(t<49408){if(49381<=t&&t<=49407)return f.CLUSTER_BREAK.LVT}else if(t===49408)return f.CLUSTER_BREAK.LV}else if(t<49464){if(t<49436){if(49409<=t&&t<=49435)return f.CLUSTER_BREAK.LVT}else if(t<49437){if(t===49436)return f.CLUSTER_BREAK.LV}else if(49437<=t&&t<=49463)return f.CLUSTER_BREAK.LVT}else if(t<49465){if(t===49464)return f.CLUSTER_BREAK.LV}else if(t<49492){if(49465<=t&&t<=49491)return f.CLUSTER_BREAK.LVT}else if(t===49492)return f.CLUSTER_BREAK.LV}else if(t<49800){if(t<49633){if(t<49576){if(t<49521){if(t<49520){if(49493<=t&&t<=49519)return f.CLUSTER_BREAK.LVT}else if(t===49520)return f.CLUSTER_BREAK.LV}else if(t<49548){if(49521<=t&&t<=49547)return f.CLUSTER_BREAK.LVT}else if(t<49549){if(t===49548)return f.CLUSTER_BREAK.LV}else if(49549<=t&&t<=49575)return f.CLUSTER_BREAK.LVT}else if(t<49604){if(t<49577){if(t===49576)return f.CLUSTER_BREAK.LV}else if(49577<=t&&t<=49603)return f.CLUSTER_BREAK.LVT}else if(t<49605){if(t===49604)return f.CLUSTER_BREAK.LV}else if(t<49632){if(49605<=t&&t<=49631)return f.CLUSTER_BREAK.LVT}else if(t===49632)return f.CLUSTER_BREAK.LV}else if(t<49716){if(t<49661){if(t<49660){if(49633<=t&&t<=49659)return f.CLUSTER_BREAK.LVT}else if(t===49660)return f.CLUSTER_BREAK.LV}else if(t<49688){if(49661<=t&&t<=49687)return f.CLUSTER_BREAK.LVT}else if(t<49689){if(t===49688)return f.CLUSTER_BREAK.LV}else if(49689<=t&&t<=49715)return f.CLUSTER_BREAK.LVT}else if(t<49745){if(t<49717){if(t===49716)return f.CLUSTER_BREAK.LV}else if(t<49744){if(49717<=t&&t<=49743)return f.CLUSTER_BREAK.LVT}else if(t===49744)return f.CLUSTER_BREAK.LV}else if(t<49772){if(49745<=t&&t<=49771)return f.CLUSTER_BREAK.LVT}else if(t<49773){if(t===49772)return f.CLUSTER_BREAK.LV}else if(49773<=t&&t<=49799)return f.CLUSTER_BREAK.LVT}else if(t<49941){if(t<49857){if(t<49828){if(t<49801){if(t===49800)return f.CLUSTER_BREAK.LV}else if(49801<=t&&t<=49827)return f.CLUSTER_BREAK.LVT}else if(t<49829){if(t===49828)return f.CLUSTER_BREAK.LV}else if(t<49856){if(49829<=t&&t<=49855)return f.CLUSTER_BREAK.LVT}else if(t===49856)return f.CLUSTER_BREAK.LV}else if(t<49912){if(t<49884){if(49857<=t&&t<=49883)return f.CLUSTER_BREAK.LVT}else if(t<49885){if(t===49884)return f.CLUSTER_BREAK.LV}else if(49885<=t&&t<=49911)return f.CLUSTER_BREAK.LVT}else if(t<49913){if(t===49912)return f.CLUSTER_BREAK.LV}else if(t<49940){if(49913<=t&&t<=49939)return f.CLUSTER_BREAK.LVT}else if(t===49940)return f.CLUSTER_BREAK.LV}else if(t<50024){if(t<49969){if(t<49968){if(49941<=t&&t<=49967)return f.CLUSTER_BREAK.LVT}else if(t===49968)return f.CLUSTER_BREAK.LV}else if(t<49996){if(49969<=t&&t<=49995)return f.CLUSTER_BREAK.LVT}else if(t<49997){if(t===49996)return f.CLUSTER_BREAK.LV}else if(49997<=t&&t<=50023)return f.CLUSTER_BREAK.LVT}else if(t<50053){if(t<50025){if(t===50024)return f.CLUSTER_BREAK.LV}else if(t<50052){if(50025<=t&&t<=50051)return f.CLUSTER_BREAK.LVT}else if(t===50052)return f.CLUSTER_BREAK.LV}else if(t<50080){if(50053<=t&&t<=50079)return f.CLUSTER_BREAK.LVT}else if(t<50081){if(t===50080)return f.CLUSTER_BREAK.LV}else if(50081<=t&&t<=50107)return f.CLUSTER_BREAK.LVT}else if(t<50697){if(t<50389){if(t<50248){if(t<50165){if(t<50136){if(t<50109){if(t===50108)return f.CLUSTER_BREAK.LV}else if(50109<=t&&t<=50135)return f.CLUSTER_BREAK.LVT}else if(t<50137){if(t===50136)return f.CLUSTER_BREAK.LV}else if(t<50164){if(50137<=t&&t<=50163)return f.CLUSTER_BREAK.LVT}else if(t===50164)return f.CLUSTER_BREAK.LV}else if(t<50193){if(t<50192){if(50165<=t&&t<=50191)return f.CLUSTER_BREAK.LVT}else if(t===50192)return f.CLUSTER_BREAK.LV}else if(t<50220){if(50193<=t&&t<=50219)return f.CLUSTER_BREAK.LVT}else if(t<50221){if(t===50220)return f.CLUSTER_BREAK.LV}else if(50221<=t&&t<=50247)return f.CLUSTER_BREAK.LVT}else if(t<50305){if(t<50276){if(t<50249){if(t===50248)return f.CLUSTER_BREAK.LV}else if(50249<=t&&t<=50275)return f.CLUSTER_BREAK.LVT}else if(t<50277){if(t===50276)return f.CLUSTER_BREAK.LV}else if(t<50304){if(50277<=t&&t<=50303)return f.CLUSTER_BREAK.LVT}else if(t===50304)return f.CLUSTER_BREAK.LV}else if(t<50360){if(t<50332){if(50305<=t&&t<=50331)return f.CLUSTER_BREAK.LVT}else if(t<50333){if(t===50332)return f.CLUSTER_BREAK.LV}else if(50333<=t&&t<=50359)return f.CLUSTER_BREAK.LVT}else if(t<50361){if(t===50360)return f.CLUSTER_BREAK.LV}else if(t<50388){if(50361<=t&&t<=50387)return f.CLUSTER_BREAK.LVT}else if(t===50388)return f.CLUSTER_BREAK.LV}else if(t<50556){if(t<50472){if(t<50417){if(t<50416){if(50389<=t&&t<=50415)return f.CLUSTER_BREAK.LVT}else if(t===50416)return f.CLUSTER_BREAK.LV}else if(t<50444){if(50417<=t&&t<=50443)return f.CLUSTER_BREAK.LVT}else if(t<50445){if(t===50444)return f.CLUSTER_BREAK.LV}else if(50445<=t&&t<=50471)return f.CLUSTER_BREAK.LVT}else if(t<50501){if(t<50473){if(t===50472)return f.CLUSTER_BREAK.LV}else if(t<50500){if(50473<=t&&t<=50499)return f.CLUSTER_BREAK.LVT}else if(t===50500)return f.CLUSTER_BREAK.LV}else if(t<50528){if(50501<=t&&t<=50527)return f.CLUSTER_BREAK.LVT}else if(t<50529){if(t===50528)return f.CLUSTER_BREAK.LV}else if(50529<=t&&t<=50555)return f.CLUSTER_BREAK.LVT}else if(t<50613){if(t<50584){if(t<50557){if(t===50556)return f.CLUSTER_BREAK.LV}else if(50557<=t&&t<=50583)return f.CLUSTER_BREAK.LVT}else if(t<50585){if(t===50584)return f.CLUSTER_BREAK.LV}else if(t<50612){if(50585<=t&&t<=50611)return f.CLUSTER_BREAK.LVT}else if(t===50612)return f.CLUSTER_BREAK.LV}else if(t<50668){if(t<50640){if(50613<=t&&t<=50639)return f.CLUSTER_BREAK.LVT}else if(t<50641){if(t===50640)return f.CLUSTER_BREAK.LV}else if(50641<=t&&t<=50667)return f.CLUSTER_BREAK.LVT}else if(t<50669){if(t===50668)return f.CLUSTER_BREAK.LV}else if(t<50696){if(50669<=t&&t<=50695)return f.CLUSTER_BREAK.LVT}else if(t===50696)return f.CLUSTER_BREAK.LV}else if(t<51004){if(t<50837){if(t<50780){if(t<50725){if(t<50724){if(50697<=t&&t<=50723)return f.CLUSTER_BREAK.LVT}else if(t===50724)return f.CLUSTER_BREAK.LV}else if(t<50752){if(50725<=t&&t<=50751)return f.CLUSTER_BREAK.LVT}else if(t<50753){if(t===50752)return f.CLUSTER_BREAK.LV}else if(50753<=t&&t<=50779)return f.CLUSTER_BREAK.LVT}else if(t<50808){if(t<50781){if(t===50780)return f.CLUSTER_BREAK.LV}else if(50781<=t&&t<=50807)return f.CLUSTER_BREAK.LVT}else if(t<50809){if(t===50808)return f.CLUSTER_BREAK.LV}else if(t<50836){if(50809<=t&&t<=50835)return f.CLUSTER_BREAK.LVT}else if(t===50836)return f.CLUSTER_BREAK.LV}else if(t<50920){if(t<50865){if(t<50864){if(50837<=t&&t<=50863)return f.CLUSTER_BREAK.LVT}else if(t===50864)return f.CLUSTER_BREAK.LV}else if(t<50892){if(50865<=t&&t<=50891)return f.CLUSTER_BREAK.LVT}else if(t<50893){if(t===50892)return f.CLUSTER_BREAK.LV}else if(50893<=t&&t<=50919)return f.CLUSTER_BREAK.LVT}else if(t<50949){if(t<50921){if(t===50920)return f.CLUSTER_BREAK.LV}else if(t<50948){if(50921<=t&&t<=50947)return f.CLUSTER_BREAK.LVT}else if(t===50948)return f.CLUSTER_BREAK.LV}else if(t<50976){if(50949<=t&&t<=50975)return f.CLUSTER_BREAK.LVT}else if(t<50977){if(t===50976)return f.CLUSTER_BREAK.LV}else if(50977<=t&&t<=51003)return f.CLUSTER_BREAK.LVT}else if(t<51145){if(t<51061){if(t<51032){if(t<51005){if(t===51004)return f.CLUSTER_BREAK.LV}else if(51005<=t&&t<=51031)return f.CLUSTER_BREAK.LVT}else if(t<51033){if(t===51032)return f.CLUSTER_BREAK.LV}else if(t<51060){if(51033<=t&&t<=51059)return f.CLUSTER_BREAK.LVT}else if(t===51060)return f.CLUSTER_BREAK.LV}else if(t<51116){if(t<51088){if(51061<=t&&t<=51087)return f.CLUSTER_BREAK.LVT}else if(t<51089){if(t===51088)return f.CLUSTER_BREAK.LV}else if(51089<=t&&t<=51115)return f.CLUSTER_BREAK.LVT}else if(t<51117){if(t===51116)return f.CLUSTER_BREAK.LV}else if(t<51144){if(51117<=t&&t<=51143)return f.CLUSTER_BREAK.LVT}else if(t===51144)return f.CLUSTER_BREAK.LV}else if(t<51228){if(t<51173){if(t<51172){if(51145<=t&&t<=51171)return f.CLUSTER_BREAK.LVT}else if(t===51172)return f.CLUSTER_BREAK.LV}else if(t<51200){if(51173<=t&&t<=51199)return f.CLUSTER_BREAK.LVT}else if(t<51201){if(t===51200)return f.CLUSTER_BREAK.LV}else if(51201<=t&&t<=51227)return f.CLUSTER_BREAK.LVT}else if(t<51257){if(t<51229){if(t===51228)return f.CLUSTER_BREAK.LV}else if(t<51256){if(51229<=t&&t<=51255)return f.CLUSTER_BREAK.LVT}else if(t===51256)return f.CLUSTER_BREAK.LV}else if(t<51284){if(51257<=t&&t<=51283)return f.CLUSTER_BREAK.LVT}else if(t<51285){if(t===51284)return f.CLUSTER_BREAK.LV}else if(51285<=t&&t<=51311)return f.CLUSTER_BREAK.LVT}else if(t<52516){if(t<51901){if(t<51593){if(t<51452){if(t<51369){if(t<51340){if(t<51313){if(t===51312)return f.CLUSTER_BREAK.LV}else if(51313<=t&&t<=51339)return f.CLUSTER_BREAK.LVT}else if(t<51341){if(t===51340)return f.CLUSTER_BREAK.LV}else if(t<51368){if(51341<=t&&t<=51367)return f.CLUSTER_BREAK.LVT}else if(t===51368)return f.CLUSTER_BREAK.LV}else if(t<51397){if(t<51396){if(51369<=t&&t<=51395)return f.CLUSTER_BREAK.LVT}else if(t===51396)return f.CLUSTER_BREAK.LV}else if(t<51424){if(51397<=t&&t<=51423)return f.CLUSTER_BREAK.LVT}else if(t<51425){if(t===51424)return f.CLUSTER_BREAK.LV}else if(51425<=t&&t<=51451)return f.CLUSTER_BREAK.LVT}else if(t<51509){if(t<51480){if(t<51453){if(t===51452)return f.CLUSTER_BREAK.LV}else if(51453<=t&&t<=51479)return f.CLUSTER_BREAK.LVT}else if(t<51481){if(t===51480)return f.CLUSTER_BREAK.LV}else if(t<51508){if(51481<=t&&t<=51507)return f.CLUSTER_BREAK.LVT}else if(t===51508)return f.CLUSTER_BREAK.LV}else if(t<51564){if(t<51536){if(51509<=t&&t<=51535)return f.CLUSTER_BREAK.LVT}else if(t<51537){if(t===51536)return f.CLUSTER_BREAK.LV}else if(51537<=t&&t<=51563)return f.CLUSTER_BREAK.LVT}else if(t<51565){if(t===51564)return f.CLUSTER_BREAK.LV}else if(t<51592){if(51565<=t&&t<=51591)return f.CLUSTER_BREAK.LVT}else if(t===51592)return f.CLUSTER_BREAK.LV}else if(t<51760){if(t<51676){if(t<51621){if(t<51620){if(51593<=t&&t<=51619)return f.CLUSTER_BREAK.LVT}else if(t===51620)return f.CLUSTER_BREAK.LV}else if(t<51648){if(51621<=t&&t<=51647)return f.CLUSTER_BREAK.LVT}else if(t<51649){if(t===51648)return f.CLUSTER_BREAK.LV}else if(51649<=t&&t<=51675)return f.CLUSTER_BREAK.LVT}else if(t<51705){if(t<51677){if(t===51676)return f.CLUSTER_BREAK.LV}else if(t<51704){if(51677<=t&&t<=51703)return f.CLUSTER_BREAK.LVT}else if(t===51704)return f.CLUSTER_BREAK.LV}else if(t<51732){if(51705<=t&&t<=51731)return f.CLUSTER_BREAK.LVT}else if(t<51733){if(t===51732)return f.CLUSTER_BREAK.LV}else if(51733<=t&&t<=51759)return f.CLUSTER_BREAK.LVT}else if(t<51817){if(t<51788){if(t<51761){if(t===51760)return f.CLUSTER_BREAK.LV}else if(51761<=t&&t<=51787)return f.CLUSTER_BREAK.LVT}else if(t<51789){if(t===51788)return f.CLUSTER_BREAK.LV}else if(t<51816){if(51789<=t&&t<=51815)return f.CLUSTER_BREAK.LVT}else if(t===51816)return f.CLUSTER_BREAK.LV}else if(t<51872){if(t<51844){if(51817<=t&&t<=51843)return f.CLUSTER_BREAK.LVT}else if(t<51845){if(t===51844)return f.CLUSTER_BREAK.LV}else if(51845<=t&&t<=51871)return f.CLUSTER_BREAK.LVT}else if(t<51873){if(t===51872)return f.CLUSTER_BREAK.LV}else if(t<51900){if(51873<=t&&t<=51899)return f.CLUSTER_BREAK.LVT}else if(t===51900)return f.CLUSTER_BREAK.LV}else if(t<52208){if(t<52041){if(t<51984){if(t<51929){if(t<51928){if(51901<=t&&t<=51927)return f.CLUSTER_BREAK.LVT}else if(t===51928)return f.CLUSTER_BREAK.LV}else if(t<51956){if(51929<=t&&t<=51955)return f.CLUSTER_BREAK.LVT}else if(t<51957){if(t===51956)return f.CLUSTER_BREAK.LV}else if(51957<=t&&t<=51983)return f.CLUSTER_BREAK.LVT}else if(t<52012){if(t<51985){if(t===51984)return f.CLUSTER_BREAK.LV}else if(51985<=t&&t<=52011)return f.CLUSTER_BREAK.LVT}else if(t<52013){if(t===52012)return f.CLUSTER_BREAK.LV}else if(t<52040){if(52013<=t&&t<=52039)return f.CLUSTER_BREAK.LVT}else if(t===52040)return f.CLUSTER_BREAK.LV}else if(t<52124){if(t<52069){if(t<52068){if(52041<=t&&t<=52067)return f.CLUSTER_BREAK.LVT}else if(t===52068)return f.CLUSTER_BREAK.LV}else if(t<52096){if(52069<=t&&t<=52095)return f.CLUSTER_BREAK.LVT}else if(t<52097){if(t===52096)return f.CLUSTER_BREAK.LV}else if(52097<=t&&t<=52123)return f.CLUSTER_BREAK.LVT}else if(t<52153){if(t<52125){if(t===52124)return f.CLUSTER_BREAK.LV}else if(t<52152){if(52125<=t&&t<=52151)return f.CLUSTER_BREAK.LVT}else if(t===52152)return f.CLUSTER_BREAK.LV}else if(t<52180){if(52153<=t&&t<=52179)return f.CLUSTER_BREAK.LVT}else if(t<52181){if(t===52180)return f.CLUSTER_BREAK.LV}else if(52181<=t&&t<=52207)return f.CLUSTER_BREAK.LVT}else if(t<52349){if(t<52265){if(t<52236){if(t<52209){if(t===52208)return f.CLUSTER_BREAK.LV}else if(52209<=t&&t<=52235)return f.CLUSTER_BREAK.LVT}else if(t<52237){if(t===52236)return f.CLUSTER_BREAK.LV}else if(t<52264){if(52237<=t&&t<=52263)return f.CLUSTER_BREAK.LVT}else if(t===52264)return f.CLUSTER_BREAK.LV}else if(t<52320){if(t<52292){if(52265<=t&&t<=52291)return f.CLUSTER_BREAK.LVT}else if(t<52293){if(t===52292)return f.CLUSTER_BREAK.LV}else if(52293<=t&&t<=52319)return f.CLUSTER_BREAK.LVT}else if(t<52321){if(t===52320)return f.CLUSTER_BREAK.LV}else if(t<52348){if(52321<=t&&t<=52347)return f.CLUSTER_BREAK.LVT}else if(t===52348)return f.CLUSTER_BREAK.LV}else if(t<52432){if(t<52377){if(t<52376){if(52349<=t&&t<=52375)return f.CLUSTER_BREAK.LVT}else if(t===52376)return f.CLUSTER_BREAK.LV}else if(t<52404){if(52377<=t&&t<=52403)return f.CLUSTER_BREAK.LVT}else if(t<52405){if(t===52404)return f.CLUSTER_BREAK.LV}else if(52405<=t&&t<=52431)return f.CLUSTER_BREAK.LVT}else if(t<52461){if(t<52433){if(t===52432)return f.CLUSTER_BREAK.LV}else if(t<52460){if(52433<=t&&t<=52459)return f.CLUSTER_BREAK.LVT}else if(t===52460)return f.CLUSTER_BREAK.LV}else if(t<52488){if(52461<=t&&t<=52487)return f.CLUSTER_BREAK.LVT}else if(t<52489){if(t===52488)return f.CLUSTER_BREAK.LV}else if(52489<=t&&t<=52515)return f.CLUSTER_BREAK.LVT}else if(t<53105){if(t<52797){if(t<52656){if(t<52573){if(t<52544){if(t<52517){if(t===52516)return f.CLUSTER_BREAK.LV}else if(52517<=t&&t<=52543)return f.CLUSTER_BREAK.LVT}else if(t<52545){if(t===52544)return f.CLUSTER_BREAK.LV}else if(t<52572){if(52545<=t&&t<=52571)return f.CLUSTER_BREAK.LVT}else if(t===52572)return f.CLUSTER_BREAK.LV}else if(t<52601){if(t<52600){if(52573<=t&&t<=52599)return f.CLUSTER_BREAK.LVT}else if(t===52600)return f.CLUSTER_BREAK.LV}else if(t<52628){if(52601<=t&&t<=52627)return f.CLUSTER_BREAK.LVT}else if(t<52629){if(t===52628)return f.CLUSTER_BREAK.LV}else if(52629<=t&&t<=52655)return f.CLUSTER_BREAK.LVT}else if(t<52713){if(t<52684){if(t<52657){if(t===52656)return f.CLUSTER_BREAK.LV}else if(52657<=t&&t<=52683)return f.CLUSTER_BREAK.LVT}else if(t<52685){if(t===52684)return f.CLUSTER_BREAK.LV}else if(t<52712){if(52685<=t&&t<=52711)return f.CLUSTER_BREAK.LVT}else if(t===52712)return f.CLUSTER_BREAK.LV}else if(t<52768){if(t<52740){if(52713<=t&&t<=52739)return f.CLUSTER_BREAK.LVT}else if(t<52741){if(t===52740)return f.CLUSTER_BREAK.LV}else if(52741<=t&&t<=52767)return f.CLUSTER_BREAK.LVT}else if(t<52769){if(t===52768)return f.CLUSTER_BREAK.LV}else if(t<52796){if(52769<=t&&t<=52795)return f.CLUSTER_BREAK.LVT}else if(t===52796)return f.CLUSTER_BREAK.LV}else if(t<52964){if(t<52880){if(t<52825){if(t<52824){if(52797<=t&&t<=52823)return f.CLUSTER_BREAK.LVT}else if(t===52824)return f.CLUSTER_BREAK.LV}else if(t<52852){if(52825<=t&&t<=52851)return f.CLUSTER_BREAK.LVT}else if(t<52853){if(t===52852)return f.CLUSTER_BREAK.LV}else if(52853<=t&&t<=52879)return f.CLUSTER_BREAK.LVT}else if(t<52909){if(t<52881){if(t===52880)return f.CLUSTER_BREAK.LV}else if(t<52908){if(52881<=t&&t<=52907)return f.CLUSTER_BREAK.LVT}else if(t===52908)return f.CLUSTER_BREAK.LV}else if(t<52936){if(52909<=t&&t<=52935)return f.CLUSTER_BREAK.LVT}else if(t<52937){if(t===52936)return f.CLUSTER_BREAK.LV}else if(52937<=t&&t<=52963)return f.CLUSTER_BREAK.LVT}else if(t<53021){if(t<52992){if(t<52965){if(t===52964)return f.CLUSTER_BREAK.LV}else if(52965<=t&&t<=52991)return f.CLUSTER_BREAK.LVT}else if(t<52993){if(t===52992)return f.CLUSTER_BREAK.LV}else if(t<53020){if(52993<=t&&t<=53019)return f.CLUSTER_BREAK.LVT}else if(t===53020)return f.CLUSTER_BREAK.LV}else if(t<53076){if(t<53048){if(53021<=t&&t<=53047)return f.CLUSTER_BREAK.LVT}else if(t<53049){if(t===53048)return f.CLUSTER_BREAK.LV}else if(53049<=t&&t<=53075)return f.CLUSTER_BREAK.LVT}else if(t<53077){if(t===53076)return f.CLUSTER_BREAK.LV}else if(t<53104){if(53077<=t&&t<=53103)return f.CLUSTER_BREAK.LVT}else if(t===53104)return f.CLUSTER_BREAK.LV}else if(t<53412){if(t<53245){if(t<53188){if(t<53133){if(t<53132){if(53105<=t&&t<=53131)return f.CLUSTER_BREAK.LVT}else if(t===53132)return f.CLUSTER_BREAK.LV}else if(t<53160){if(53133<=t&&t<=53159)return f.CLUSTER_BREAK.LVT}else if(t<53161){if(t===53160)return f.CLUSTER_BREAK.LV}else if(53161<=t&&t<=53187)return f.CLUSTER_BREAK.LVT}else if(t<53216){if(t<53189){if(t===53188)return f.CLUSTER_BREAK.LV}else if(53189<=t&&t<=53215)return f.CLUSTER_BREAK.LVT}else if(t<53217){if(t===53216)return f.CLUSTER_BREAK.LV}else if(t<53244){if(53217<=t&&t<=53243)return f.CLUSTER_BREAK.LVT}else if(t===53244)return f.CLUSTER_BREAK.LV}else if(t<53328){if(t<53273){if(t<53272){if(53245<=t&&t<=53271)return f.CLUSTER_BREAK.LVT}else if(t===53272)return f.CLUSTER_BREAK.LV}else if(t<53300){if(53273<=t&&t<=53299)return f.CLUSTER_BREAK.LVT}else if(t<53301){if(t===53300)return f.CLUSTER_BREAK.LV}else if(53301<=t&&t<=53327)return f.CLUSTER_BREAK.LVT}else if(t<53357){if(t<53329){if(t===53328)return f.CLUSTER_BREAK.LV}else if(t<53356){if(53329<=t&&t<=53355)return f.CLUSTER_BREAK.LVT}else if(t===53356)return f.CLUSTER_BREAK.LV}else if(t<53384){if(53357<=t&&t<=53383)return f.CLUSTER_BREAK.LVT}else if(t<53385){if(t===53384)return f.CLUSTER_BREAK.LV}else if(53385<=t&&t<=53411)return f.CLUSTER_BREAK.LVT}else if(t<53553){if(t<53469){if(t<53440){if(t<53413){if(t===53412)return f.CLUSTER_BREAK.LV}else if(53413<=t&&t<=53439)return f.CLUSTER_BREAK.LVT}else if(t<53441){if(t===53440)return f.CLUSTER_BREAK.LV}else if(t<53468){if(53441<=t&&t<=53467)return f.CLUSTER_BREAK.LVT}else if(t===53468)return f.CLUSTER_BREAK.LV}else if(t<53524){if(t<53496){if(53469<=t&&t<=53495)return f.CLUSTER_BREAK.LVT}else if(t<53497){if(t===53496)return f.CLUSTER_BREAK.LV}else if(53497<=t&&t<=53523)return f.CLUSTER_BREAK.LVT}else if(t<53525){if(t===53524)return f.CLUSTER_BREAK.LV}else if(t<53552){if(53525<=t&&t<=53551)return f.CLUSTER_BREAK.LVT}else if(t===53552)return f.CLUSTER_BREAK.LV}else if(t<53636){if(t<53581){if(t<53580){if(53553<=t&&t<=53579)return f.CLUSTER_BREAK.LVT}else if(t===53580)return f.CLUSTER_BREAK.LV}else if(t<53608){if(53581<=t&&t<=53607)return f.CLUSTER_BREAK.LVT}else if(t<53609){if(t===53608)return f.CLUSTER_BREAK.LV}else if(53609<=t&&t<=53635)return f.CLUSTER_BREAK.LVT}else if(t<53665){if(t<53637){if(t===53636)return f.CLUSTER_BREAK.LV}else if(t<53664){if(53637<=t&&t<=53663)return f.CLUSTER_BREAK.LVT}else if(t===53664)return f.CLUSTER_BREAK.LV}else if(t<53692){if(53665<=t&&t<=53691)return f.CLUSTER_BREAK.LVT}else if(t<53693){if(t===53692)return f.CLUSTER_BREAK.LV}else if(53693<=t&&t<=53719)return f.CLUSTER_BREAK.LVT}else if(t<70459){if(t<54897){if(t<54308){if(t<54001){if(t<53860){if(t<53777){if(t<53748){if(t<53721){if(t===53720)return f.CLUSTER_BREAK.LV}else if(53721<=t&&t<=53747)return f.CLUSTER_BREAK.LVT}else if(t<53749){if(t===53748)return f.CLUSTER_BREAK.LV}else if(t<53776){if(53749<=t&&t<=53775)return f.CLUSTER_BREAK.LVT}else if(t===53776)return f.CLUSTER_BREAK.LV}else if(t<53805){if(t<53804){if(53777<=t&&t<=53803)return f.CLUSTER_BREAK.LVT}else if(t===53804)return f.CLUSTER_BREAK.LV}else if(t<53832){if(53805<=t&&t<=53831)return f.CLUSTER_BREAK.LVT}else if(t<53833){if(t===53832)return f.CLUSTER_BREAK.LV}else if(53833<=t&&t<=53859)return f.CLUSTER_BREAK.LVT}else if(t<53917){if(t<53888){if(t<53861){if(t===53860)return f.CLUSTER_BREAK.LV}else if(53861<=t&&t<=53887)return f.CLUSTER_BREAK.LVT}else if(t<53889){if(t===53888)return f.CLUSTER_BREAK.LV}else if(t<53916){if(53889<=t&&t<=53915)return f.CLUSTER_BREAK.LVT}else if(t===53916)return f.CLUSTER_BREAK.LV}else if(t<53972){if(t<53944){if(53917<=t&&t<=53943)return f.CLUSTER_BREAK.LVT}else if(t<53945){if(t===53944)return f.CLUSTER_BREAK.LV}else if(53945<=t&&t<=53971)return f.CLUSTER_BREAK.LVT}else if(t<53973){if(t===53972)return f.CLUSTER_BREAK.LV}else if(t<54e3){if(53973<=t&&t<=53999)return f.CLUSTER_BREAK.LVT}else if(t===54e3)return f.CLUSTER_BREAK.LV}else if(t<54141){if(t<54084){if(t<54029){if(t<54028){if(54001<=t&&t<=54027)return f.CLUSTER_BREAK.LVT}else if(t===54028)return f.CLUSTER_BREAK.LV}else if(t<54056){if(54029<=t&&t<=54055)return f.CLUSTER_BREAK.LVT}else if(t<54057){if(t===54056)return f.CLUSTER_BREAK.LV}else if(54057<=t&&t<=54083)return f.CLUSTER_BREAK.LVT}else if(t<54112){if(t<54085){if(t===54084)return f.CLUSTER_BREAK.LV}else if(54085<=t&&t<=54111)return f.CLUSTER_BREAK.LVT}else if(t<54113){if(t===54112)return f.CLUSTER_BREAK.LV}else if(t<54140){if(54113<=t&&t<=54139)return f.CLUSTER_BREAK.LVT}else if(t===54140)return f.CLUSTER_BREAK.LV}else if(t<54224){if(t<54169){if(t<54168){if(54141<=t&&t<=54167)return f.CLUSTER_BREAK.LVT}else if(t===54168)return f.CLUSTER_BREAK.LV}else if(t<54196){if(54169<=t&&t<=54195)return f.CLUSTER_BREAK.LVT}else if(t<54197){if(t===54196)return f.CLUSTER_BREAK.LV}else if(54197<=t&&t<=54223)return f.CLUSTER_BREAK.LVT}else if(t<54253){if(t<54225){if(t===54224)return f.CLUSTER_BREAK.LV}else if(t<54252){if(54225<=t&&t<=54251)return f.CLUSTER_BREAK.LVT}else if(t===54252)return f.CLUSTER_BREAK.LV}else if(t<54280){if(54253<=t&&t<=54279)return f.CLUSTER_BREAK.LVT}else if(t<54281){if(t===54280)return f.CLUSTER_BREAK.LV}else if(54281<=t&&t<=54307)return f.CLUSTER_BREAK.LVT}else if(t<54589){if(t<54448){if(t<54365){if(t<54336){if(t<54309){if(t===54308)return f.CLUSTER_BREAK.LV}else if(54309<=t&&t<=54335)return f.CLUSTER_BREAK.LVT}else if(t<54337){if(t===54336)return f.CLUSTER_BREAK.LV}else if(t<54364){if(54337<=t&&t<=54363)return f.CLUSTER_BREAK.LVT}else if(t===54364)return f.CLUSTER_BREAK.LV}else if(t<54393){if(t<54392){if(54365<=t&&t<=54391)return f.CLUSTER_BREAK.LVT}else if(t===54392)return f.CLUSTER_BREAK.LV}else if(t<54420){if(54393<=t&&t<=54419)return f.CLUSTER_BREAK.LVT}else if(t<54421){if(t===54420)return f.CLUSTER_BREAK.LV}else if(54421<=t&&t<=54447)return f.CLUSTER_BREAK.LVT}else if(t<54505){if(t<54476){if(t<54449){if(t===54448)return f.CLUSTER_BREAK.LV}else if(54449<=t&&t<=54475)return f.CLUSTER_BREAK.LVT}else if(t<54477){if(t===54476)return f.CLUSTER_BREAK.LV}else if(t<54504){if(54477<=t&&t<=54503)return f.CLUSTER_BREAK.LVT}else if(t===54504)return f.CLUSTER_BREAK.LV}else if(t<54560){if(t<54532){if(54505<=t&&t<=54531)return f.CLUSTER_BREAK.LVT}else if(t<54533){if(t===54532)return f.CLUSTER_BREAK.LV}else if(54533<=t&&t<=54559)return f.CLUSTER_BREAK.LVT}else if(t<54561){if(t===54560)return f.CLUSTER_BREAK.LV}else if(t<54588){if(54561<=t&&t<=54587)return f.CLUSTER_BREAK.LVT}else if(t===54588)return f.CLUSTER_BREAK.LV}else if(t<54756){if(t<54672){if(t<54617){if(t<54616){if(54589<=t&&t<=54615)return f.CLUSTER_BREAK.LVT}else if(t===54616)return f.CLUSTER_BREAK.LV}else if(t<54644){if(54617<=t&&t<=54643)return f.CLUSTER_BREAK.LVT}else if(t<54645){if(t===54644)return f.CLUSTER_BREAK.LV}else if(54645<=t&&t<=54671)return f.CLUSTER_BREAK.LVT}else if(t<54701){if(t<54673){if(t===54672)return f.CLUSTER_BREAK.LV}else if(t<54700){if(54673<=t&&t<=54699)return f.CLUSTER_BREAK.LVT}else if(t===54700)return f.CLUSTER_BREAK.LV}else if(t<54728){if(54701<=t&&t<=54727)return f.CLUSTER_BREAK.LVT}else if(t<54729){if(t===54728)return f.CLUSTER_BREAK.LV}else if(54729<=t&&t<=54755)return f.CLUSTER_BREAK.LVT}else if(t<54813){if(t<54784){if(t<54757){if(t===54756)return f.CLUSTER_BREAK.LV}else if(54757<=t&&t<=54783)return f.CLUSTER_BREAK.LVT}else if(t<54785){if(t===54784)return f.CLUSTER_BREAK.LV}else if(t<54812){if(54785<=t&&t<=54811)return f.CLUSTER_BREAK.LVT}else if(t===54812)return f.CLUSTER_BREAK.LV}else if(t<54868){if(t<54840){if(54813<=t&&t<=54839)return f.CLUSTER_BREAK.LVT}else if(t<54841){if(t===54840)return f.CLUSTER_BREAK.LV}else if(54841<=t&&t<=54867)return f.CLUSTER_BREAK.LVT}else if(t<54869){if(t===54868)return f.CLUSTER_BREAK.LV}else if(t<54896){if(54869<=t&&t<=54895)return f.CLUSTER_BREAK.LVT}else if(t===54896)return f.CLUSTER_BREAK.LV}else if(t<69632){if(t<55216){if(t<55037){if(t<54980){if(t<54925){if(t<54924){if(54897<=t&&t<=54923)return f.CLUSTER_BREAK.LVT}else if(t===54924)return f.CLUSTER_BREAK.LV}else if(t<54952){if(54925<=t&&t<=54951)return f.CLUSTER_BREAK.LVT}else if(t<54953){if(t===54952)return f.CLUSTER_BREAK.LV}else if(54953<=t&&t<=54979)return f.CLUSTER_BREAK.LVT}else if(t<55008){if(t<54981){if(t===54980)return f.CLUSTER_BREAK.LV}else if(54981<=t&&t<=55007)return f.CLUSTER_BREAK.LVT}else if(t<55009){if(t===55008)return f.CLUSTER_BREAK.LV}else if(t<55036){if(55009<=t&&t<=55035)return f.CLUSTER_BREAK.LVT}else if(t===55036)return f.CLUSTER_BREAK.LV}else if(t<55120){if(t<55065){if(t<55064){if(55037<=t&&t<=55063)return f.CLUSTER_BREAK.LVT}else if(t===55064)return f.CLUSTER_BREAK.LV}else if(t<55092){if(55065<=t&&t<=55091)return f.CLUSTER_BREAK.LVT}else if(t<55093){if(t===55092)return f.CLUSTER_BREAK.LV}else if(55093<=t&&t<=55119)return f.CLUSTER_BREAK.LVT}else if(t<55149){if(t<55121){if(t===55120)return f.CLUSTER_BREAK.LV}else if(t<55148){if(55121<=t&&t<=55147)return f.CLUSTER_BREAK.LVT}else if(t===55148)return f.CLUSTER_BREAK.LV}else if(t<55176){if(55149<=t&&t<=55175)return f.CLUSTER_BREAK.LVT}else if(t<55177){if(t===55176)return f.CLUSTER_BREAK.LV}else if(55177<=t&&t<=55203)return f.CLUSTER_BREAK.LVT}else if(t<68097){if(t<65279){if(t<64286){if(t<55243){if(55216<=t&&t<=55238)return f.CLUSTER_BREAK.V}else if(55243<=t&&t<=55291)return f.CLUSTER_BREAK.T}else if(t<65024){if(t===64286)return f.CLUSTER_BREAK.EXTEND}else if(t<65056){if(65024<=t&&t<=65039)return f.CLUSTER_BREAK.EXTEND}else if(65056<=t&&t<=65071)return f.CLUSTER_BREAK.EXTEND}else if(t<66045){if(t<65438){if(t===65279)return f.CLUSTER_BREAK.CONTROL}else if(t<65520){if(65438<=t&&t<=65439)return f.CLUSTER_BREAK.EXTEND}else if(65520<=t&&t<=65531)return f.CLUSTER_BREAK.CONTROL}else if(t<66272){if(t===66045)return f.CLUSTER_BREAK.EXTEND}else if(t<66422){if(t===66272)return f.CLUSTER_BREAK.EXTEND}else if(66422<=t&&t<=66426)return f.CLUSTER_BREAK.EXTEND}else if(t<68325){if(t<68108){if(t<68101){if(68097<=t&&t<=68099)return f.CLUSTER_BREAK.EXTEND}else if(68101<=t&&t<=68102)return f.CLUSTER_BREAK.EXTEND}else if(t<68152){if(68108<=t&&t<=68111)return f.CLUSTER_BREAK.EXTEND}else if(t<68159){if(68152<=t&&t<=68154)return f.CLUSTER_BREAK.EXTEND}else if(t===68159)return f.CLUSTER_BREAK.EXTEND}else if(t<69373){if(t<68900){if(68325<=t&&t<=68326)return f.CLUSTER_BREAK.EXTEND}else if(t<69291){if(68900<=t&&t<=68903)return f.CLUSTER_BREAK.EXTEND}else if(69291<=t&&t<=69292)return f.CLUSTER_BREAK.EXTEND}else if(t<69446){if(69373<=t&&t<=69375)return f.CLUSTER_BREAK.EXTEND}else if(t<69506){if(69446<=t&&t<=69456)return f.CLUSTER_BREAK.EXTEND}else if(69506<=t&&t<=69509)return f.CLUSTER_BREAK.EXTEND}else if(t<70016){if(t<69815){if(t<69747){if(t<69634){if(t===69632)return f.CLUSTER_BREAK.SPACINGMARK;if(t===69633)return f.CLUSTER_BREAK.EXTEND}else if(t<69688){if(t===69634)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<69744){if(69688<=t&&t<=69702)return f.CLUSTER_BREAK.EXTEND}else if(t===69744)return f.CLUSTER_BREAK.EXTEND}else if(t<69762){if(t<69759){if(69747<=t&&t<=69748)return f.CLUSTER_BREAK.EXTEND}else if(69759<=t&&t<=69761)return f.CLUSTER_BREAK.EXTEND}else if(t<69808){if(t===69762)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<69811){if(69808<=t&&t<=69810)return f.CLUSTER_BREAK.SPACINGMARK}else if(69811<=t&&t<=69814)return f.CLUSTER_BREAK.EXTEND}else if(t<69888)if(t<69821){if(t<69817){if(69815<=t&&t<=69816)return f.CLUSTER_BREAK.SPACINGMARK}else if(69817<=t&&t<=69818)return f.CLUSTER_BREAK.EXTEND}else if(t<69826){if(t===69821)return f.CLUSTER_BREAK.PREPEND}else{if(t===69826)return f.CLUSTER_BREAK.EXTEND;if(t===69837)return f.CLUSTER_BREAK.PREPEND}else if(t<69933){if(t<69927){if(69888<=t&&t<=69890)return f.CLUSTER_BREAK.EXTEND}else if(t<69932){if(69927<=t&&t<=69931)return f.CLUSTER_BREAK.EXTEND}else if(t===69932)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<69957){if(69933<=t&&t<=69940)return f.CLUSTER_BREAK.EXTEND}else if(t<70003){if(69957<=t&&t<=69958)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===70003)return f.CLUSTER_BREAK.EXTEND}else if(t<70194){if(t<70082){if(t<70067){if(t<70018){if(70016<=t&&t<=70017)return f.CLUSTER_BREAK.EXTEND}else if(t===70018)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70070){if(70067<=t&&t<=70069)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70079){if(70070<=t&&t<=70078)return f.CLUSTER_BREAK.EXTEND}else if(70079<=t&&t<=70080)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70095){if(t<70089){if(70082<=t&&t<=70083)return f.CLUSTER_BREAK.PREPEND}else if(t<70094){if(70089<=t&&t<=70092)return f.CLUSTER_BREAK.EXTEND}else if(t===70094)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70188){if(t===70095)return f.CLUSTER_BREAK.EXTEND}else if(t<70191){if(70188<=t&&t<=70190)return f.CLUSTER_BREAK.SPACINGMARK}else if(70191<=t&&t<=70193)return f.CLUSTER_BREAK.EXTEND}else if(t<70209){if(t<70197){if(t<70196){if(70194<=t&&t<=70195)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===70196)return f.CLUSTER_BREAK.EXTEND}else if(t<70198){if(t===70197)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70206){if(70198<=t&&t<=70199)return f.CLUSTER_BREAK.EXTEND}else if(t===70206)return f.CLUSTER_BREAK.EXTEND}else if(t<70371){if(t<70367){if(t===70209)return f.CLUSTER_BREAK.EXTEND}else if(t<70368){if(t===70367)return f.CLUSTER_BREAK.EXTEND}else if(70368<=t&&t<=70370)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70400){if(70371<=t&&t<=70378)return f.CLUSTER_BREAK.EXTEND}else if(t<70402){if(70400<=t&&t<=70401)return f.CLUSTER_BREAK.EXTEND}else if(70402<=t&&t<=70403)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72343){if(t<71339){if(t<70841){if(t<70512){if(t<70471){if(t<70463){if(t<70462){if(70459<=t&&t<=70460)return f.CLUSTER_BREAK.EXTEND}else if(t===70462)return f.CLUSTER_BREAK.EXTEND}else if(t<70464){if(t===70463)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70465){if(t===70464)return f.CLUSTER_BREAK.EXTEND}else if(70465<=t&&t<=70468)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70487){if(t<70475){if(70471<=t&&t<=70472)return f.CLUSTER_BREAK.SPACINGMARK}else if(70475<=t&&t<=70477)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70498){if(t===70487)return f.CLUSTER_BREAK.EXTEND}else if(t<70502){if(70498<=t&&t<=70499)return f.CLUSTER_BREAK.SPACINGMARK}else if(70502<=t&&t<=70508)return f.CLUSTER_BREAK.EXTEND}else if(t<70725){if(t<70712){if(t<70709){if(70512<=t&&t<=70516)return f.CLUSTER_BREAK.EXTEND}else if(70709<=t&&t<=70711)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<70720){if(70712<=t&&t<=70719)return f.CLUSTER_BREAK.EXTEND}else if(t<70722){if(70720<=t&&t<=70721)return f.CLUSTER_BREAK.SPACINGMARK}else if(70722<=t&&t<=70724)return f.CLUSTER_BREAK.EXTEND}else if(t<70832){if(t<70726){if(t===70725)return f.CLUSTER_BREAK.SPACINGMARK}else if(t===70726||t===70750)return f.CLUSTER_BREAK.EXTEND}else if(t<70833){if(t===70832)return f.CLUSTER_BREAK.EXTEND}else if(t<70835){if(70833<=t&&t<=70834)return f.CLUSTER_BREAK.SPACINGMARK}else if(70835<=t&&t<=70840)return f.CLUSTER_BREAK.EXTEND}else if(t<71096){if(t<70847)if(t<70843){if(t===70841)return f.CLUSTER_BREAK.SPACINGMARK;if(t===70842)return f.CLUSTER_BREAK.EXTEND}else if(t<70845){if(70843<=t&&t<=70844)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===70845)return f.CLUSTER_BREAK.EXTEND;if(t===70846)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71087){if(t<70849){if(70847<=t&&t<=70848)return f.CLUSTER_BREAK.EXTEND}else if(t<70850){if(t===70849)return f.CLUSTER_BREAK.SPACINGMARK}else if(70850<=t&&t<=70851)return f.CLUSTER_BREAK.EXTEND}else if(t<71088){if(t===71087)return f.CLUSTER_BREAK.EXTEND}else if(t<71090){if(71088<=t&&t<=71089)return f.CLUSTER_BREAK.SPACINGMARK}else if(71090<=t&&t<=71093)return f.CLUSTER_BREAK.EXTEND}else if(t<71216){if(t<71102){if(t<71100){if(71096<=t&&t<=71099)return f.CLUSTER_BREAK.SPACINGMARK}else if(71100<=t&&t<=71101)return f.CLUSTER_BREAK.EXTEND}else if(t<71103){if(t===71102)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71132){if(71103<=t&&t<=71104)return f.CLUSTER_BREAK.EXTEND}else if(71132<=t&&t<=71133)return f.CLUSTER_BREAK.EXTEND}else if(t<71229){if(t<71219){if(71216<=t&&t<=71218)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71227){if(71219<=t&&t<=71226)return f.CLUSTER_BREAK.EXTEND}else if(71227<=t&&t<=71228)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71230){if(t===71229)return f.CLUSTER_BREAK.EXTEND}else if(t<71231){if(t===71230)return f.CLUSTER_BREAK.SPACINGMARK}else if(71231<=t&&t<=71232)return f.CLUSTER_BREAK.EXTEND}else if(t<71999)if(t<71463){if(t<71350){if(t<71341){if(t===71339)return f.CLUSTER_BREAK.EXTEND;if(t===71340)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71342){if(t===71341)return f.CLUSTER_BREAK.EXTEND}else if(t<71344){if(71342<=t&&t<=71343)return f.CLUSTER_BREAK.SPACINGMARK}else if(71344<=t&&t<=71349)return f.CLUSTER_BREAK.EXTEND}else if(t<71453){if(t===71350)return f.CLUSTER_BREAK.SPACINGMARK;if(t===71351)return f.CLUSTER_BREAK.EXTEND}else if(t<71458){if(71453<=t&&t<=71455)return f.CLUSTER_BREAK.EXTEND}else if(t<71462){if(71458<=t&&t<=71461)return f.CLUSTER_BREAK.EXTEND}else if(t===71462)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71984){if(t<71727){if(t<71724){if(71463<=t&&t<=71467)return f.CLUSTER_BREAK.EXTEND}else if(71724<=t&&t<=71726)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71736){if(71727<=t&&t<=71735)return f.CLUSTER_BREAK.EXTEND}else if(t<71737){if(t===71736)return f.CLUSTER_BREAK.SPACINGMARK}else if(71737<=t&&t<=71738)return f.CLUSTER_BREAK.EXTEND}else if(t<71995){if(t<71985){if(t===71984)return f.CLUSTER_BREAK.EXTEND}else if(t<71991){if(71985<=t&&t<=71989)return f.CLUSTER_BREAK.SPACINGMARK}else if(71991<=t&&t<=71992)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<71997){if(71995<=t&&t<=71996)return f.CLUSTER_BREAK.EXTEND}else{if(t===71997)return f.CLUSTER_BREAK.SPACINGMARK;if(t===71998)return f.CLUSTER_BREAK.EXTEND}else if(t<72193)if(t<72145)if(t<72001){if(t===71999)return f.CLUSTER_BREAK.PREPEND;if(t===72e3)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72002){if(t===72001)return f.CLUSTER_BREAK.PREPEND}else{if(t===72002)return f.CLUSTER_BREAK.SPACINGMARK;if(t===72003)return f.CLUSTER_BREAK.EXTEND}else if(t<72156){if(t<72148){if(72145<=t&&t<=72147)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72154){if(72148<=t&&t<=72151)return f.CLUSTER_BREAK.EXTEND}else if(72154<=t&&t<=72155)return f.CLUSTER_BREAK.EXTEND}else if(t<72160){if(72156<=t&&t<=72159)return f.CLUSTER_BREAK.SPACINGMARK}else{if(t===72160)return f.CLUSTER_BREAK.EXTEND;if(t===72164)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72263){if(t<72249){if(t<72243){if(72193<=t&&t<=72202)return f.CLUSTER_BREAK.EXTEND}else if(72243<=t&&t<=72248)return f.CLUSTER_BREAK.EXTEND}else if(t<72250){if(t===72249)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72251){if(t===72250)return f.CLUSTER_BREAK.PREPEND}else if(72251<=t&&t<=72254)return f.CLUSTER_BREAK.EXTEND}else if(t<72281){if(t<72273){if(t===72263)return f.CLUSTER_BREAK.EXTEND}else if(t<72279){if(72273<=t&&t<=72278)return f.CLUSTER_BREAK.EXTEND}else if(72279<=t&&t<=72280)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72324){if(72281<=t&&t<=72283)return f.CLUSTER_BREAK.EXTEND}else if(t<72330){if(72324<=t&&t<=72329)return f.CLUSTER_BREAK.PREPEND}else if(72330<=t&&t<=72342)return f.CLUSTER_BREAK.EXTEND}else if(t<94033){if(t<73104){if(t<72881){if(t<72766){if(t<72751){if(t<72344){if(t===72343)return f.CLUSTER_BREAK.SPACINGMARK}else if(72344<=t&&t<=72345)return f.CLUSTER_BREAK.EXTEND}else if(t<72752){if(t===72751)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<72760){if(72752<=t&&t<=72758)return f.CLUSTER_BREAK.EXTEND}else if(72760<=t&&t<=72765)return f.CLUSTER_BREAK.EXTEND}else if(t<72850){if(t===72766)return f.CLUSTER_BREAK.SPACINGMARK;if(t===72767)return f.CLUSTER_BREAK.EXTEND}else if(t<72873){if(72850<=t&&t<=72871)return f.CLUSTER_BREAK.EXTEND}else if(t<72874){if(t===72873)return f.CLUSTER_BREAK.SPACINGMARK}else if(72874<=t&&t<=72880)return f.CLUSTER_BREAK.EXTEND}else if(t<73018){if(t<72884){if(t<72882){if(t===72881)return f.CLUSTER_BREAK.SPACINGMARK}else if(72882<=t&&t<=72883)return f.CLUSTER_BREAK.EXTEND}else if(t<72885){if(t===72884)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73009){if(72885<=t&&t<=72886)return f.CLUSTER_BREAK.EXTEND}else if(73009<=t&&t<=73014)return f.CLUSTER_BREAK.EXTEND}else if(t<73030){if(t<73020){if(t===73018)return f.CLUSTER_BREAK.EXTEND}else if(t<73023){if(73020<=t&&t<=73021)return f.CLUSTER_BREAK.EXTEND}else if(73023<=t&&t<=73029)return f.CLUSTER_BREAK.EXTEND}else if(t<73031){if(t===73030)return f.CLUSTER_BREAK.PREPEND}else if(t<73098){if(t===73031)return f.CLUSTER_BREAK.EXTEND}else if(73098<=t&&t<=73102)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73526){if(t<73459)if(t<73109){if(t<73107){if(73104<=t&&t<=73105)return f.CLUSTER_BREAK.EXTEND}else if(73107<=t&&t<=73108)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73110){if(t===73109)return f.CLUSTER_BREAK.EXTEND}else{if(t===73110)return f.CLUSTER_BREAK.SPACINGMARK;if(t===73111)return f.CLUSTER_BREAK.EXTEND}else if(t<73474){if(t<73461){if(73459<=t&&t<=73460)return f.CLUSTER_BREAK.EXTEND}else if(t<73472){if(73461<=t&&t<=73462)return f.CLUSTER_BREAK.SPACINGMARK}else if(73472<=t&&t<=73473)return f.CLUSTER_BREAK.EXTEND}else if(t<73475){if(t===73474)return f.CLUSTER_BREAK.PREPEND}else if(t<73524){if(t===73475)return f.CLUSTER_BREAK.SPACINGMARK}else if(73524<=t&&t<=73525)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<78896)if(t<73536){if(t<73534){if(73526<=t&&t<=73530)return f.CLUSTER_BREAK.EXTEND}else if(73534<=t&&t<=73535)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<73537){if(t===73536)return f.CLUSTER_BREAK.EXTEND}else{if(t===73537)return f.CLUSTER_BREAK.SPACINGMARK;if(t===73538)return f.CLUSTER_BREAK.EXTEND}else if(t<92912){if(t<78912){if(78896<=t&&t<=78911)return f.CLUSTER_BREAK.CONTROL}else if(t<78919){if(t===78912)return f.CLUSTER_BREAK.EXTEND}else if(78919<=t&&t<=78933)return f.CLUSTER_BREAK.EXTEND}else if(t<92976){if(92912<=t&&t<=92916)return f.CLUSTER_BREAK.EXTEND}else if(t<94031){if(92976<=t&&t<=92982)return f.CLUSTER_BREAK.EXTEND}else if(t===94031)return f.CLUSTER_BREAK.EXTEND}else if(t<121476){if(t<119143)if(t<113824){if(t<94180){if(t<94095){if(94033<=t&&t<=94087)return f.CLUSTER_BREAK.SPACINGMARK}else if(94095<=t&&t<=94098)return f.CLUSTER_BREAK.EXTEND}else if(t<94192){if(t===94180)return f.CLUSTER_BREAK.EXTEND}else if(t<113821){if(94192<=t&&t<=94193)return f.CLUSTER_BREAK.SPACINGMARK}else if(113821<=t&&t<=113822)return f.CLUSTER_BREAK.EXTEND}else if(t<118576){if(t<118528){if(113824<=t&&t<=113827)return f.CLUSTER_BREAK.CONTROL}else if(118528<=t&&t<=118573)return f.CLUSTER_BREAK.EXTEND}else if(t<119141){if(118576<=t&&t<=118598)return f.CLUSTER_BREAK.EXTEND}else{if(t===119141)return f.CLUSTER_BREAK.EXTEND;if(t===119142)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<119173){if(t<119150){if(t<119149){if(119143<=t&&t<=119145)return f.CLUSTER_BREAK.EXTEND}else if(t===119149)return f.CLUSTER_BREAK.SPACINGMARK}else if(t<119155){if(119150<=t&&t<=119154)return f.CLUSTER_BREAK.EXTEND}else if(t<119163){if(119155<=t&&t<=119162)return f.CLUSTER_BREAK.CONTROL}else if(119163<=t&&t<=119170)return f.CLUSTER_BREAK.EXTEND}else if(t<121344){if(t<119210){if(119173<=t&&t<=119179)return f.CLUSTER_BREAK.EXTEND}else if(t<119362){if(119210<=t&&t<=119213)return f.CLUSTER_BREAK.EXTEND}else if(119362<=t&&t<=119364)return f.CLUSTER_BREAK.EXTEND}else if(t<121403){if(121344<=t&&t<=121398)return f.CLUSTER_BREAK.EXTEND}else if(t<121461){if(121403<=t&&t<=121452)return f.CLUSTER_BREAK.EXTEND}else if(t===121461)return f.CLUSTER_BREAK.EXTEND}else if(t<123628){if(t<122907){if(t<121505){if(t<121499){if(t===121476)return f.CLUSTER_BREAK.EXTEND}else if(121499<=t&&t<=121503)return f.CLUSTER_BREAK.EXTEND}else if(t<122880){if(121505<=t&&t<=121519)return f.CLUSTER_BREAK.EXTEND}else if(t<122888){if(122880<=t&&t<=122886)return f.CLUSTER_BREAK.EXTEND}else if(122888<=t&&t<=122904)return f.CLUSTER_BREAK.EXTEND}else if(t<123023){if(t<122915){if(122907<=t&&t<=122913)return f.CLUSTER_BREAK.EXTEND}else if(t<122918){if(122915<=t&&t<=122916)return f.CLUSTER_BREAK.EXTEND}else if(122918<=t&&t<=122922)return f.CLUSTER_BREAK.EXTEND}else if(t<123184){if(t===123023)return f.CLUSTER_BREAK.EXTEND}else if(t<123566){if(123184<=t&&t<=123190)return f.CLUSTER_BREAK.EXTEND}else if(t===123566)return f.CLUSTER_BREAK.EXTEND}else if(t<127995){if(t<125136){if(t<124140){if(123628<=t&&t<=123631)return f.CLUSTER_BREAK.EXTEND}else if(124140<=t&&t<=124143)return f.CLUSTER_BREAK.EXTEND}else if(t<125252){if(125136<=t&&t<=125142)return f.CLUSTER_BREAK.EXTEND}else if(t<127462){if(125252<=t&&t<=125258)return f.CLUSTER_BREAK.EXTEND}else if(127462<=t&&t<=127487)return f.CLUSTER_BREAK.REGIONAL_INDICATOR}else if(t<917632){if(t<917504){if(127995<=t&&t<=127999)return f.CLUSTER_BREAK.EXTEND}else if(t<917536){if(917504<=t&&t<=917535)return f.CLUSTER_BREAK.CONTROL}else if(917536<=t&&t<=917631)return f.CLUSTER_BREAK.EXTEND}else if(t<917760){if(917632<=t&&t<=917759)return f.CLUSTER_BREAK.CONTROL}else if(t<918e3){if(917760<=t&&t<=917999)return f.CLUSTER_BREAK.EXTEND}else if(918e3<=t&&t<=921599)return f.CLUSTER_BREAK.CONTROL;return f.CLUSTER_BREAK.OTHER}static getEmojiProperty(t){if(t<10160){if(t<9728){if(t<9e3){if(t<8482){if(t<8252){if(t===169||t===174)return f.EXTENDED_PICTOGRAPHIC}else if(t===8252||t===8265)return f.EXTENDED_PICTOGRAPHIC}else if(t<8596){if(t===8482||t===8505)return f.EXTENDED_PICTOGRAPHIC}else if(t<8617){if(8596<=t&&t<=8601)return f.EXTENDED_PICTOGRAPHIC}else if(t<8986){if(8617<=t&&t<=8618)return f.EXTENDED_PICTOGRAPHIC}else if(8986<=t&&t<=8987)return f.EXTENDED_PICTOGRAPHIC}else if(t<9410){if(t<9167){if(t===9e3||t===9096)return f.EXTENDED_PICTOGRAPHIC}else if(t<9193){if(t===9167)return f.EXTENDED_PICTOGRAPHIC}else if(t<9208){if(9193<=t&&t<=9203)return f.EXTENDED_PICTOGRAPHIC}else if(9208<=t&&t<=9210)return f.EXTENDED_PICTOGRAPHIC}else if(t<9654){if(t<9642){if(t===9410)return f.EXTENDED_PICTOGRAPHIC}else if(9642<=t&&t<=9643)return f.EXTENDED_PICTOGRAPHIC}else if(t<9664){if(t===9654)return f.EXTENDED_PICTOGRAPHIC}else if(t<9723){if(t===9664)return f.EXTENDED_PICTOGRAPHIC}else if(9723<=t&&t<=9726)return f.EXTENDED_PICTOGRAPHIC}else if(t<10035){if(t<10004){if(t<9748){if(t<9735){if(9728<=t&&t<=9733)return f.EXTENDED_PICTOGRAPHIC}else if(9735<=t&&t<=9746)return f.EXTENDED_PICTOGRAPHIC}else if(t<9872){if(9748<=t&&t<=9861)return f.EXTENDED_PICTOGRAPHIC}else if(t<9992){if(9872<=t&&t<=9989)return f.EXTENDED_PICTOGRAPHIC}else if(9992<=t&&t<=10002)return f.EXTENDED_PICTOGRAPHIC}else if(t<10013){if(t===10004||t===10006)return f.EXTENDED_PICTOGRAPHIC}else if(t<10017){if(t===10013)return f.EXTENDED_PICTOGRAPHIC}else if(t===10017||t===10024)return f.EXTENDED_PICTOGRAPHIC}else if(t<10067){if(t<10055){if(t<10052){if(10035<=t&&t<=10036)return f.EXTENDED_PICTOGRAPHIC}else if(t===10052)return f.EXTENDED_PICTOGRAPHIC}else if(t<10060){if(t===10055)return f.EXTENDED_PICTOGRAPHIC}else if(t===10060||t===10062)return f.EXTENDED_PICTOGRAPHIC}else if(t<10083){if(t<10071){if(10067<=t&&t<=10069)return f.EXTENDED_PICTOGRAPHIC}else if(t===10071)return f.EXTENDED_PICTOGRAPHIC}else if(t<10133){if(10083<=t&&t<=10087)return f.EXTENDED_PICTOGRAPHIC}else if(t<10145){if(10133<=t&&t<=10135)return f.EXTENDED_PICTOGRAPHIC}else if(t===10145)return f.EXTENDED_PICTOGRAPHIC}else if(t<127489){if(t<12951){if(t<11035){if(t<10548){if(t===10160||t===10175)return f.EXTENDED_PICTOGRAPHIC}else if(t<11013){if(10548<=t&&t<=10549)return f.EXTENDED_PICTOGRAPHIC}else if(11013<=t&&t<=11015)return f.EXTENDED_PICTOGRAPHIC}else if(t<11093){if(t<11088){if(11035<=t&&t<=11036)return f.EXTENDED_PICTOGRAPHIC}else if(t===11088)return f.EXTENDED_PICTOGRAPHIC}else if(t<12336){if(t===11093)return f.EXTENDED_PICTOGRAPHIC}else if(t===12336||t===12349)return f.EXTENDED_PICTOGRAPHIC}else if(t<127340){if(t<126976){if(t===12951||t===12953)return f.EXTENDED_PICTOGRAPHIC}else if(t<127245){if(126976<=t&&t<=127231)return f.EXTENDED_PICTOGRAPHIC}else if(t<127279){if(127245<=t&&t<=127247)return f.EXTENDED_PICTOGRAPHIC}else if(t===127279)return f.EXTENDED_PICTOGRAPHIC}else if(t<127374){if(t<127358){if(127340<=t&&t<=127345)return f.EXTENDED_PICTOGRAPHIC}else if(127358<=t&&t<=127359)return f.EXTENDED_PICTOGRAPHIC}else if(t<127377){if(t===127374)return f.EXTENDED_PICTOGRAPHIC}else if(t<127405){if(127377<=t&&t<=127386)return f.EXTENDED_PICTOGRAPHIC}else if(127405<=t&&t<=127461)return f.EXTENDED_PICTOGRAPHIC}else if(t<128981){if(t<127561){if(t<127535){if(t<127514){if(127489<=t&&t<=127503)return f.EXTENDED_PICTOGRAPHIC}else if(t===127514)return f.EXTENDED_PICTOGRAPHIC}else if(t<127538){if(t===127535)return f.EXTENDED_PICTOGRAPHIC}else if(t<127548){if(127538<=t&&t<=127546)return f.EXTENDED_PICTOGRAPHIC}else if(127548<=t&&t<=127551)return f.EXTENDED_PICTOGRAPHIC}else if(t<128326){if(t<128e3){if(127561<=t&&t<=127994)return f.EXTENDED_PICTOGRAPHIC}else if(128e3<=t&&t<=128317)return f.EXTENDED_PICTOGRAPHIC}else if(t<128640){if(128326<=t&&t<=128591)return f.EXTENDED_PICTOGRAPHIC}else if(t<128884){if(128640<=t&&t<=128767)return f.EXTENDED_PICTOGRAPHIC}else if(128884<=t&&t<=128895)return f.EXTENDED_PICTOGRAPHIC}else if(t<129198){if(t<129096){if(t<129036){if(128981<=t&&t<=129023)return f.EXTENDED_PICTOGRAPHIC}else if(129036<=t&&t<=129039)return f.EXTENDED_PICTOGRAPHIC}else if(t<129114){if(129096<=t&&t<=129103)return f.EXTENDED_PICTOGRAPHIC}else if(t<129160){if(129114<=t&&t<=129119)return f.EXTENDED_PICTOGRAPHIC}else if(129160<=t&&t<=129167)return f.EXTENDED_PICTOGRAPHIC}else if(t<129340){if(t<129292){if(129198<=t&&t<=129279)return f.EXTENDED_PICTOGRAPHIC}else if(129292<=t&&t<=129338)return f.EXTENDED_PICTOGRAPHIC}else if(t<129351){if(129340<=t&&t<=129349)return f.EXTENDED_PICTOGRAPHIC}else if(t<130048){if(129351<=t&&t<=129791)return f.EXTENDED_PICTOGRAPHIC}else if(130048<=t&&t<=131069)return f.EXTENDED_PICTOGRAPHIC;return f.CLUSTER_BREAK.OTHER}}k1.default=no;var jD=Un&&Un.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Q3,"__esModule",{value:!0});const zD=jD(k1);var GD=Q3.default=zD.default;const WD=new GD,nl=I("text-offset");function Yo(n,t){const e=gi(n);let r=0;for(let i=0;i<e.length;i++){const o=e[i],s=Cr(o);if(o===t){const l=r+s;return{start:r,end:l}}r+=s}p(nl,!1,"can not find child in children")}function On(n,t){p(nl,t>=0,`invalid offset: ${t}`);const e=uu(n,t),{prev:r,next:i,offset:o}=e;if(!r&&!i&&p(nl,!1,"invalid offset, no prev & next child at offset"),r!==i)return!0;const s=r;if(p(nl,s,"no child"),Qn(s))return p(nl,o===0||o===1,`invalid box child offset: ${o}`),!0;const l=s.textContent;p(nl,l,"no content for text child");const c=WD.splitGraphemes(l),d=new Set;let h=0;return c.forEach(C=>{d.add(h),h+=C.length}),d.add(h),!!d.has(o)}function Qo(n,t){if(t===0)return 0;const e=t-1;if(On(n,e))return e;let r=e-1;for(;!On(n,r);)r-=1;return r}function rl(n,t){const e=du(n);if(p(nl,t>=0&&t<=e,`invalid offset: ${t}, ${e}`),t===e)return e;const r=t+1;if(On(n,r))return r;let i=r+1;for(;!On(n,i);)i+=1;return i}const qD=I("line-offset");function I1(n){const t=pu(n),e=[];let r=0;for(let i=0;i<t.length;i++){const o=t[i];e.push({start:r,end:o.offset}),r=o.offset}return e.push({start:r,end:du(n)}),e}function uh(n,t){const e=I1(n);return p(qD,t>=0&&t<e.length,`invalid line index: ${t}, ${e.length}`),e[t]}function Z3(n,t){const{lineIndex:e}=y1(n,t);return uh(n,e)}function XD(n){const t=I1(n),e=n.getBoundingClientRect(),r=[];return t.forEach(({start:i,end:o})=>{const s=at(n,i,"home");let l=Jn(n,s);const c=at(n,o,"end"),d=Jn(n,c);l.top+l.height/2<d.top&&(l=new DOMRect(e.left-1e4,d.top,1,d.height));const h=new DOMRect(l.left,d.top,d.left-l.left,d.height),C=new DOMRect(e.left,d.top,e.width,d.height);r.push({start:i,end:o,rect:C,contentRect:h})}),r}function YD(n,t,e){const i=XD(n).find(s=>Ws(s.rect,t,e));if(!i)return null;const o=i.contentRect;return t<=o.left+1?at(n,i.start,"home"):t>=o.right-1?at(n,i.end,"end"):null}function tB(n,t,e){const r=Jn(n,t),i=Jn(n,e),o=r.top+r.height/2,s=i.top+i.height/2,l=i.top<o&&o<i.bottom,c=r.top<s&&s<r.bottom;return l&&c}function eB(n){return I1(n).length}const il=I("find-text-position");function nB(n,t){const{start:e,end:r}=uh(n,t),i=lt(n),o=Jn(n,at(i,e,"home"));if(!(Jn(n,at(i,r,"end")).top>o.top+o.height/2))return!1;const c=uu(n,e);return p(il,c.next,"no next child at offset"),p(il,!cu(c.next),"next child is not text child"),!0}function QD(n,t){const e=lt(n);p(il,nB(n,t),"line is not wrapped");const{start:r,end:i}=uh(n,t),o=at(e,r,"home");for(let s=r+1;s<=i;s+=1){let l="normal";s===r?l="home":s===i&&(l="end");const c=at(e,s,l);if(!tB(n,o,c))return s-1}return p(il,!1,"failed to find wrapped offset"),0}function fh(n,t,e,r,i,o,s){p(il,rt(n,t),`not a text kind block: ${Dt(t)}`);const{start:l,end:c}=uh(t,e);let d=l;const h=lt(t);if(t===r&&nB(t,e)){const w=QD(t,e);(o==="up"||o==="down"&&tB(t,i,at(h,l,"home")))&&(d=w+1)}let C=Number.MAX_SAFE_INTEGER;const E=Wo(n,r,i),x=s!=null?s:E.left+E.width/2,B=E.top+E.height/2;let k=at(h,d,"home");for(let w=d;w<=c;w++){if(!On(t,w))continue;let U="normal";w===l?U="home":w===c&&(U="end");const M=at(h,w,U),F=Jn(t,M),Y=jo(F,x,B);Y<C&&(C=Y,k=M)}return k}function JD(n,t,e,r,i){return p(il,rt(n,t),"not a text block"),fh(n,t,eB(t)-1,e,r,"up",i)}function ZD(n,t,e,r,i){return p(il,rt(n,t),"not a text block"),fh(n,t,0,e,r,"down",i)}function t8(n,t,e,r){const{lineIndex:i}=y1(t,e);if(i===eB(t)-1)return null;const o=fh(n,t,i+1,t,e,"down",r);return o||null}function e8(n,t){if(t.offset===0)return null;const e=pu(n),r=e.find(i=>i.offset===t.offset);if(!r){const i=Qo(n,t.offset);return e.find(s=>s.offset===i)?{offset:i,type:"home"}:{offset:i,type:"normal"}}if(r.type==="betweenChild"){if(t.type==="home"&&r.childInfo.wrap==="nowrap")return{offset:t.offset,type:"end"};if(r.childInfo.prevWrapped)return{offset:Qo(n,t.offset),type:"normal"}}return{offset:Qo(n,t.offset),type:"normal"}}function n8(n,t){const e=du(n);if(t.offset===e)return null;const r=pu(n),i=r.find(o=>o.offset===t.offset);if(!i){const o=rl(n,t.offset),s=r.find(l=>l.offset===o);return s?s.type==="betweenChild"?{offset:o,type:"end"}:{offset:o,type:"home"}:{offset:o,type:"normal"}}return i.type==="betweenChild"?i.childInfo.wrap==="nowrap"&&t.type==="end"?{offset:t.offset,type:"home"}:{offset:rl(n,t.offset),type:"home"}:{offset:rl(n,t.offset),type:"normal"}}function r8(n,t,e,r){const{lineIndex:i}=y1(t,e);if(i===0)return null;const o=fh(n,t,i-1,t,e,"up",r);return o||null}const i8=I("move-caret");function o8(n,t,e,r){if(r==="ArrowLeft"){const i=e8(t,e);return i?at(lt(t),i.offset,i.type):null}if(r==="ArrowRight"){const i=n8(t,e);return i?at(lt(t),i.offset,i.type):null}if(r==="ArrowUp"){const i=r8(n,t,e,n.selection.getSuggestedCaretX());return i?at(lt(t),i.offset,i.type):null}if(r==="ArrowDown"){const i=t8(n,t,e,n.selection.getSuggestedCaretX());return i?at(lt(t),i.offset,i.type):null}p(i8,!1,`invalid navigation direction: ${r}`)}const D1=I("text-range");function rB(n){const t=[];return gi(n).forEach(r=>{const i=Array.from(r.getClientRects()).map(o=>({rect:o,child:r}));t.push(...i)}),t}function s8(n,t,e){const r=rB(n);for(let i=1;i<r.length;i++){const o=r[i-1],s=r[i];if(t>=o.rect.right&&t<=s.rect.left&&e>=o.rect.top&&e<=o.rect.bottom&&e>=s.rect.top&&e<=s.rect.bottom)return Yo(n,s.child).start}return null}function l8(n,t,e,r){const i=Ae(e,r);if(!i||!t.contains(i)||!n.contains(t))return null;const o=t.getBoundingClientRect(),s=rB(t);let l=e,c=r,d=o.left+o.width/2,h=o.top+o.height/2,C=d,E=h;s.forEach(Ct=>{d=Math.min(d,Ct.rect.left),h=Math.min(h,Ct.rect.top),C=Math.max(C,Ct.rect.right),E=Math.max(E,Ct.rect.bottom)}),l>=o.left&&l<d?l=d:l<=o.right&&l>C&&(l=C),c>=o.top&&c<h?c=h:c<=o.bottom&&c>E&&(c=E);const x=i.closest("div[data-type=block-content]>span");if(!x){const Ct=t.getBoundingClientRect();if(!Ws(Ct,l,c))return null;const yt=s8(t,l,c);if(yt!==null){const Gt=at(t,yt,"normal");return new rn(n,{anchor:Gt,focus:Gt})}const bt=YD(t,l,c);return bt?new rn(n,{anchor:bt,focus:bt}):null}const B=gi(t);p(D1,B.indexOf(x)!==-1,"failed to find child in children");const k=Yo(t,x);p(D1,k,"failed to get child offset");const{start:w}=k;let U,M;Ji(x)||Qn(x)?(U=w,M=0):(p(D1,x.firstChild instanceof Text,"child is not text"),U=w+Fb(x.firstChild,l,c),M=0);const F=lt(t),X=pu(t).find(Ct=>Ct.offset===U);let G="normal";if(X){const Ct=at(F,U,"home"),yt=at(F,U,"end"),bt=Jn(t,Ct),Gt=Jn(t,yt),Pe=jo(bt,l,c),he=jo(Gt,l,c);G=Pe<he?"home":"end"}const st=at(F,U,G);let pt;return M&&(pt=at(F,U+M,G)),new rn(n,{anchor:st,focus:pt!=null?pt:st})}const a8=I("create-text-op");function Er(n,t){p(a8,n,"text is empty");const e={insert:n};return t&&Object.keys(t).length>0&&(e.attributes=t),e}function _1(n,t){if(n.length===0)return[];if(n.indexOf(`
|
|
16
16
|
`)===-1)return[Er(n,t)];const e=n.replace(/\r\n/g,`
|
|
17
17
|
`).replace(/\r/g,`
|
|
18
18
|
`).replace(/\n/g," "),r=[];return e&&r.push(Er(e,t)),r}const dh=I("merge-ops");function M1(n){if(n.length<=1)return n;const t=(i,o)=>i.insert===void 0||o.insert===void 0||i.delete!==void 0||o.delete!==void 0||i.retain!==void 0||o.retain!==void 0||i.attributes!==void 0&&o.attributes===void 0||i.attributes===void 0&&o.attributes!==void 0?!1:i.attributes===void 0?(p(dh,o.attributes===void 0,"op2.attributes is not undefined"),!0):(p(dh,i.attributes&&o.attributes,"op1.attributes && op2.attributes is undefined"),Gc.default(i.attributes,o.attributes)),e=[];let r=n[0];e.push(r);for(let i=1;i<n.length;i+=1){const o=n[i];t(r,o)?(p(dh,typeof r.insert=="string","before.insert is not string"),p(dh,typeof o.insert=="string","op.insert is not string"),r.insert+=o.insert):(e.push(o),r=o)}return e}function c8(n){let t;for(t=n.length-1;t>=0;t--){const e=n[t];if(!e.attributes||!e.attributes.box||e.attributes.type!=="br")break}return t===n.length-1?n:n.slice(0,t+1)}const iB=I("delete-text");function U1(n,t,e){const{left:r,right:i}=Je(n,t,e),o=[...r,...i];return M1(o)}function oB(n,t){p(iB,n>=0,`invalid offset: ${n}`),p(iB,t>=1,`invalid delete count: ${t}`);const e=[];return n!==0&&e.push({retain:n}),e.push({delete:t}),e}const sB=I("delta");function lB(n,t){const e=new mn.default(n),r=new mn.default(t);return e.diff(r).ops}function u8(n,t,e){return new mn.default(t).transformPosition(n,!e)}function f8(n){p(sB,n,"ops is null or undefined");for(let t=0;t<n.length;t++){const e=n[t];if(e.insert===null||e.insert===void 0||e.retain!==void 0||e.delete!==void 0)return!1}return!0}function d8(n,t){const e=new mn.default(n),r=new mn.default(t);return e.compose(r).ops}class pn{static ensureValidText(t){p(sB,f8(t),`text is not a valid text, ${JSON.stringify(t)}`)}static diff(t,e){return this.ensureValidText(t),this.ensureValidText(e),lB(t,e)}static transformCursor(t,e,r){return u8(t,e,r)}static transformOffset(t,e,r){const i=lB(t,e),o=new mn.default(i);return r.map(s=>o.transformPosition(s))}static apply(t,e){this.ensureValidText(t);const r=d8(t,e);return this.ensureValidText(r),r}}const aB=I("insert-text");function ro(n,t,e,r){p(aB,e,`invalid text to insert: ${e}`);const{left:i,right:o}=Mn(n,t),s=typeof e=="string"?[Er(e,r)]:e,l=[...i,...s,...o];return M1(l)}function cB(n){return{insert:" ",attributes:n}}function hh(n,t,e){if(p(aB,n>=0,`invalid offset: ${n}`),t.length===0)return[];const r=[];if(n>0&&r.push({retain:n}),typeof t!="string")return r.push(...t),r;const o={insert:t.replaceAll(`\r
|
|
@@ -21,7 +21,7 @@ Available method signatures are:
|
|
|
21
21
|
`).map((i,o)=>{const l=o===0&&(t==null?void 0:t.firstLineAsTitle)?{heading:1}:void 0;return Ai(i,l)})},meta:{},comments:{}}}function O1(n){const t=n.blocks.root;if(t.length!==1)return!1;const e=t[0];return!(!e.text||gn(e.text))}function dB(n,t){const e=et();return n.localInsertChildContainers([{containerId:e,blocks:t}]),e}function oo(n,t){return dB(n,[gh(t)])}const g8="\u200B",p8=I("to-plain-text");function de(n,t){let e="";return n.forEach(r=>{if(p(p8,typeof r.insert=="string","invalid op"),r.attributes&&r.attributes.box===!0){if(t!=null&&t.boxReplacement){e+=t.boxReplacement;return}if(r.attributes.text){e+=r.attributes.text;return}e+=" "}e+=r.insert}),e}function N1(n){return de(n,{boxReplacement:" "})}function hB(n){return typeof n.offset=="number"}function ph(n){return hB(n.anchor)}function C8(n){return ph(n)&&n.anchor.offset===n.focus.offset&&n.anchor.blockId===n.focus.blockId}function mB(n,t){return{blockId:n,offset:t}}function Ch(n,t){const e=mB(n,t);return{anchor:e,focus:e}}function gB(n,t){return{blockId:n,childContainerId:t}}function E8(n,t){const e=gB(n,t);return{anchor:e,focus:e}}const x8=I("block-to-text");function A8(n,t,e){let r="";return t.forEach(i=>{if(p(x8,typeof i.insert=="string","invalid op"),i.attributes&&i.attributes.box===!0){const o=i.attributes,s=n.editorBoxes.getBoxClass(o.type);if(s!=null&&s.convertTo){r+=s.convertTo(n,o,e,"text");return}if(i.attributes.text){r+=i.attributes.text;return}r+=`[${o.type}]`}r+=i.insert}),r}const b8=I("block-to-text");function v8(n,t,e){let r="";return t.forEach(i=>{if(p(b8,typeof i.insert=="string","invalid op"),i.attributes&&i.attributes.box===!0){const s=i.attributes,l=n.editorBoxes.getBoxClass(s.type);if(l!=null&&l.convertTo){r+=l.convertTo(n,s,e,"markdown");return}if(i.attributes.text){r+=i.attributes.text;return}r+=`[${s.type}]`}const o=i.attributes;if(o){let s=i.insert;o.link&&(s=`[${s}](${o.link})`);const l=[];o["style-code"]?l.push("`"):(o["style-bold"]&&l.push("**"),o["style-italic"]&&l.push("*"),o["style-underline"]&&l.push("__"),o["style-strikethrough"]&&l.push("~~"));const c=l.join("");r.endsWith(c.substring(0,1))&&(r+=" ");const d=l.reverse().join("");r+=c+s+d;return}r+=i.insert}),r}function B8(n,t,e){const r=t.text||[];let o=v8(n,r,e);if(t.heading){const s=t.heading;o=`${"#".repeat(s)} ${o}`}return t.quoted&&(o=`> ${o}`),t.type==="text"&&(o=`${o}
|
|
22
22
|
`),o}function T8(n){switch(n){case"style-color-0":return"#e52727";case"style-color-1":return"#eb6414";case"style-color-2":return"#f0a100";case"style-color-3":return"#24b47e";case"style-color-4":return"#0064ff";case"style-color-5":return"#9678d3";case"style-color-6":return"#909090";default:return}}function y8(n){switch(n){case"style-bg-color-0":return"#fad4d4";case"style-bg-color-1":return"#fbe0d0";case"style-bg-color-2":return"#fceccc";case"style-bg-color-3":return"#d3f0e5";case"style-bg-color-4":return"#d6e9fa";case"style-bg-color-5":return"#eae4f6";case"style-bg-color-6":return"#dedede";case"style-bg-color-7":return"#e52727";case"style-bg-color-8":return"#eb6414";case"style-bg-color-9":return"#f0a100";case"style-bg-color-10":return"#24b47e";case"style-bg-color-11":return"#0064ff";case"style-bg-color-12":return"#9678d3";case"style-bg-color-13":return"#909090";case"style-bg-color-14":return"#e8e8e8";default:return}}const k8=I("block-to-text");function R8(n,t,e){let r="";return t.forEach(i=>{if(p(k8,typeof i.insert=="string","invalid op"),i.attributes&&i.attributes.box===!0){const s=i.attributes,l=n.editorBoxes.getBoxClass(s.type);if(l!=null&&l.convertTo){r+=l.convertTo(n,s,e,"html");return}if(i.attributes.text){r+=i.attributes.text;return}r+=`[${s.type}]`}const o=i.attributes;if(o){let s=i.insert;const l=[];let c="";o["style-bold"]&&l.push("strong"),o["style-italic"]&&l.push("em"),o["style-underline"]&&l.push("u"),o["style-strikethrough"]&&l.push("s"),o["style-code"]&&l.push("code");const d=Object.keys(o).find(x=>x.startsWith("style-bg-color-"));d&&(c+=`background-color: ${y8(d)};`);const h=Object.keys(o).find(x=>x.startsWith("style-color-"));h&&(c+=`color: ${T8(h)};`),o.link&&(s=`<a href="${o.link}">${s}</a>`);let C=l.map(x=>`<${x}>`).join(""),E=l.reverse().map(x=>`</${x}>`).join("");c&&(o.link?s=`<a href="${o.link}" style="${c}">${i.insert}</a>`:C?C=C.replace(">",` style="${c}">`):(C=`<span style="${c}">`,E="</span>")),r+=C+s+E;return}r+=i.insert}),r||(r="<br>"),`<p>${r}</p>`}const ya=I("text-block");function w8(n,t,e,r,i){const{text:o}=i;p(ya,o,"no text for text block");const s=Zs(r,"div");return ah(n,t,i.id,s,o),s}function S8(n,t,e){p(ya,e,"no text to update");const r=Zs(null,"div");ah(n,qo(t),lt(t),r,e);const i=Nt(t);Zc(i,r)}function L8(n,t,e){return MD(n,t,e)}function pB(n,t){let e="";return t.forEach(r=>{var i,o,s;if(!!r.insert){if(r.attributes&&r.attributes.box===!0){const l=n.getBoxById(r.attributes.id),c=(o=(i=n.editorBoxes.getBoxClass(r.attributes.type)).getBoxProperties)==null?void 0:o.call(i,n,l);e+=(s=c==null?void 0:c.abstract)!=null?s:" ";return}e+=r.insert}}),e.trim()}function I8(n,t){p(ya,rt(n,t),"block in not textBlock");const e=n.selection.range;let r="";if(e.isCollapsed()){const i=n.getBlockText(t);r=pB(n,i)}else{const i=lt(t),o=Ci(n,{simpleBlockOnly:!0}).find(s=>lt(s.block)===i);if(o&&!se(n,o.block)){p(ya,o.block===t,"block not match");const s=n.getBlockText(t),{start:l,end:c}=o,d=l.offset,h=c.offset-d;if(h>0){const{middle:C}=Je(s,d,h);r=pB(n,C)}}}return{abstract:r.trim()}}function D8(n,t,e,r){return p(ya,t.text,"no text for text block"),r==="text"?A8(n,t.text,e):r==="markdown"?B8(n,t,e):R8(n,t.text,e)}function _8(n,t){const e=mt.default(t);e.id=et();const{text:r}=e;return p(ya,r,"no text for text block"),r.forEach(i=>{i.insert&&i.attributes&&i.attributes.box===!0&&(i.attributes.id=et())}),{blocks:{root:[e]},meta:{},comments:{}}}const Nn={blockType:"text",blockKind:"text",createBlockContent:w8,getBlockTextLength:du,getRangeFromPoint:l8,moveCaret:o8,updateSelection:UD,clearSelection:OD,getCaretRect:Jn,getClientRects:L8,setBlockText:S8,getBlockProperties:I8,convertTo:D8,blockToDoc:_8},M8=ah,Eh=I("action-helper");function Jo(n,t){const e=it(t),r=ct(e),i=vt(t);return n.doc.getBlockData(r,i)}function yn(n,t){p(Eh,rt(n,t),"not a text kind block");const r=Jo(n,t).text;return p(Eh,r,"no text in block"),r}function xh(n,t,e){return Mn(yn(n,t),e).left}function CB(n,t){const e=Z(t);p(Eh,e,"no parent block");const r=yn(n,e),i=Lv(t),o=r.find(s=>{const l=s.attributes;return l?l.box&&l.id===i:!1});return p(Eh,o,"failed to find box"),o.attributes}const Be=I("block-text");function U8(n,t,e){p(Be,rt(n,t),"not a text kind block"),p(Be,On(t,e),"not a valid offset"),p(Be,e>=0&&e<dt(n,t),`invalid offset: ${e}`);const i=rl(t,e)-e;i===0&&p(Be,!1,`no text after offset: ${e}`);const o=yn(n,t),{middle:s}=Je(o,e,i);p(Be,s.length===1,"failed to split text to 3 parts");const l=s[0];return to(l)?" ":(p(Be,l.insert.length===1||l.insert.length===2,"invalid op"),l.insert)}function O8(n,t,e){p(Be,rt(n,t),"not a text kind block"),p(Be,On(t,e),"not a valid offset"),p(Be,e>0&&e<=dt(n,t),`invalid offset: ${e}`);const r=Qo(t,e),i=e-r;i===0&&p(Be,!1,`no text before offset: ${e}`);const o=yn(n,t),{middle:s}=Je(o,r,i);p(Be,s.length===1,"failed to split text to 3 parts");const l=s[0];return to(l)?" ":(p(Be,l.insert.length===1||l.insert.length===2,"invalid op"),l.insert)}function Ah(n,t,e){p(Be,rt(n,t),"not a text kind block"),p(Be,On(t,e),"not a valid offset"),p(Be,e>0&&e<=dt(n,t),`invalid offset: ${e}`);const r=Qo(t,e),i=e-r;i===0&&p(Be,!1,`no text before offset: ${e}`);const o=yn(n,t),{middle:s}=Je(o,r,i);p(Be,s.length===1,"failed to split text to 3 parts");const l=s[0];return to(l)?{op:l,charType:"box",offset:r,length:1}:{op:l,charType:zd(l.insert)?"space":"text",offset:r,length:l.insert.length}}function Cu(n,t,e){p(Be,rt(n,t),"not a text kind block"),p(Be,On(t,e),"not a valid offset"),p(Be,e>=0&&e<dt(n,t),`invalid offset: ${e}`);const i=rl(t,e)-e;i===0&&p(Be,!1,`no text after offset: ${e}`);const o=yn(n,t),{middle:s}=Je(o,e,i);p(Be,s.length===1,"failed to split text to 3 parts");const l=s[0];return to(l)?{op:l,charType:"box",offset:e,length:1}:{op:l,charType:zd(l.insert)?"space":"text",offset:e,length:l.insert.length}}function N8(n,t,e,r){let i=e;for(;i>0;){const o=Ah(n,t,i);if(o.charType===r)return o;i-=o.length}return null}function P8(n,t,e,r){const i=dt(n,t);let o=e;for(;o<i;){const s=Cu(n,t,o);if(s.charType===r)return s;o+=s.length}return null}function P1(n,t,e,r){let i=e;for(;i>0;){const o=Ah(n,t,i);if(o.charType!==r)return o;i-=o.length}return null}function F1(n,t,e,r){const i=dt(n,t);let o=e;for(;o<i;){const s=Cu(n,t,o);if(s.charType!==r)return s;o+=s.length}return null}function K1(n,t,e){if(p(Be,rt(n,t),"invalid blok type"),se(n,t))return 0;const r=Ah(n,t,e);if(r.charType==="box")return e-1;let i=e;if(r.charType==="space"){const s=P1(n,t,i,"space");if(!s||s.offset===0)return 0;if(s.charType==="box")return s.offset;i=s.offset}const o=P1(n,t,i,"text");return o?o.offset+o.length:0}function V1(n,t,e){if(p(Be,rt(n,t),"invalid blok type"),se(n,t))return 0;const r=Cu(n,t,e);if(r.charType==="box")return e+1;let i=e;if(r.charType==="space"){const s=F1(n,t,i,"space");if(!s||s.offset===0)return dt(n,t);if(s.charType==="box")return s.offset;i=s.offset}const o=F1(n,t,i,"text");return o?o.offset:dt(n,t)}const EB=I("text-box");function F8(n,t,e,r){p(EB,r.text,`no text for text box data: ${JSON.stringify(r)}`),p(EB,typeof r.text=="string",`invalid text type for text box data: ${JSON.stringify(r)}`),v("span",[],e,r.text)}function K8(n,t,e,r){var i;return(i=t.text)!=null?i:""}const xB={boxType:"text",updateBoxContent:F8,convertTo:K8},V8="data:image/svg+xml;base64,Cjxzdmcgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMTguMjQ0NSA2QzE3LjgyNzQgNiAxNy41MzYzIDYuMjkxMTcgMTcuNTM2MyA2LjcwODI2QzE3LjUzNjMgNi45ODM3IDE3LjU1OTkgNy4yMzU1MyAxNy41NTk5IDcuNjEzMjdDMTcuNTU5OSAxMC4yODExIDE2LjYyMzQgMTEuMzc0OSAxMy45NzkyIDExLjM3NDlIOC45NDI2Nkw3LjEyNDc5IDExLjQ4NTFMOS41NDA3NSA5LjI4MTYyTDExLjE5MzQgNy41OTc1M0MxMS4zMjcxIDcuNDcxNjEgMTEuMzk4IDcuMjgyNzQgMTEuMzk4IDcuMDkzODdDMTEuMzk4IDYuNjkyNTIgMTEuMDk4OSA2LjQwMTM1IDEwLjY5NzYgNi40MDEzNUMxMC41MDg3IDYuNDAxMzUgMTAuMzM1NiA2LjQ3MjE4IDEwLjE3ODIgNi42MjE3TDUuMjQzOTYgMTEuNTQ4MUM1LjA4NjU3IDExLjcwNTUgNSAxMS44OTQzIDUgMTIuMDkxMUM1IDEyLjI4NzggNS4wODY1NyAxMi40NzY3IDUuMjQzOTYgMTIuNjI2MkwxMC4xNjI1IDE3LjUzNjhDMTAuMzM1NiAxNy43MDk5IDEwLjUwODcgMTcuNzgwOCAxMC42OTc2IDE3Ljc4MDhDMTEuMDk4OSAxNy43ODA4IDExLjM5OCAxNy40ODk2IDExLjM5OCAxNy4wODgzQzExLjM5OCAxNi44OTE1IDExLjMyNzEgMTYuNzEwNSAxMS4xOTM0IDE2LjU4NDZMOS41NDA3NSAxNC45MDA1TDcuMTMyNjYgMTIuNjk3TDguOTQyNjYgMTIuODA3MkgxNC4wNTc5QzE3LjU1OTkgMTIuODA3MiAxOSAxMS4yNDExIDE5IDcuNjc2MjJDMTkgNy4yMzU1MyAxOC45OTIxIDYuODY1NjUgMTguOTM3IDYuNjEzODNDMTguODc0MSA2LjI5OTA0IDE4LjY3NzMgNiAxOC4yNDQ1IDZaIiBmaWxsPSIjQjJCQ0NEIi8+Cjwvc3ZnPgo=";function $8(n,t,e,r){Lg(V8,[],e),v("br",[],e)}function H8(n,t,e,r){return r==="text"?`
|
|
23
23
|
`:r==="html"?"<br>":r==="markdown"?`
|
|
24
|
-
`:""}const AB={boxType:"br",updateBoxContent:$8,convertTo:H8},bB=I("editor-boxes");class vB{constructor(t){m(this,"boxes",new Map);this.editor=t}registerBoxClass(t){const e=t.boxType,r=this.boxes.get(e);p(bB,!r,`duplicated box type: ${e}`),this.boxes.set(e,t)}getBoxClass(t){const e=this.boxes.get(t);return p(bB,e,`unknown box type: ${t}`),e}createBox(t,e){const r=Sv(e),i=Iv(r);return this.getBoxClass(e.type).updateBoxContent(this.editor,r,i,e),r}forEach(t){this.boxes.forEach(t)}}function j8(n,t,e,r){const i=r,{width:o,height:s,src:l}=i,c=["editor-box-image"];i.link&&c.push("editor-box-image-link");const d=v("img",c,e);o&&(d.style.width=`${o}px`),s&&(d.style.height=`${s}px`),d.src=n.doc.buildResourceUrl(l)}const BB={boxType:"image",updateBoxContent:j8},z8="data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9InJnYigxNzgsIDE4OCwgMjA1KSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0ibTE3IDE1IDEuNTUgMS41NWMtLjk2IDEuNjktMy4zMyAzLjA0LTUuNTUgMy4zN1YxMWgzVjloLTNWNy44MkMxNC4xNiA3LjQgMTUgNi4zIDE1IDVjMC0xLjY1LTEuMzUtMy0zLTNTOSAzLjM1IDkgNWMwIDEuMy44NCAyLjQgMiAyLjgyVjlIOHYyaDN2OC45MmMtMi4yMi0uMzMtNC41OS0xLjY4LTUuNTUtMy4zN0w3IDE1bC00LTN2M2MwIDMuODggNC45MiA3IDkgN3M5LTMuMTIgOS03di0zbC00IDN6TTEyIDRjLjU1IDAgMSAuNDUgMSAxcy0uNDUgMS0xIDEtMS0uNDUtMS0xIC40NS0xIDEtMXoiPjwvcGF0aD4KPC9zdmc+Cg==";function G8(n,t,e){z(e,"editor-box-anchor"),Lg(z8,[],e)}const TB={boxType:"anchor",updateBoxContent:G8};function W8(n,t,e,r){v("span",[],e,r.text)}const yB={insertionType:"inputting",updateInsertionContent:W8},kB=I("editor-insertion");class RB{constructor(t){m(this,"insertions",new Map);this.editor=t}registerInsertionClass(t){const e=t.insertionType,r=this.insertions.get(e);p(kB,!r,`duplicated insertion type: ${e}`),this.insertions.set(e,t)}getInsertionClass(t){const e=this.insertions.get(t);return p(kB,e,`unknown insertion type: ${t}`),e}createInsertion(t,e){const r=Dv(e.type,e.id,e.attributes),i=Mv(r);return this.getInsertionClass(e.type).updateInsertionContent(this.editor,r,i,e),r}}class q8{constructor(t){m(this,"cursors",new Map);m(this,"timer");this.editor=t,this.timer=this.startTimer()}add(t,e){this.cursors.set(t,e)}startTimer(){return setInterval(()=>{const t=Date.now();Array.from(this.cursors).forEach(([e,r])=>{if(t-r>3e3){const i=_v(this.editor,e);i&&ot(i,"active"),this.cursors.delete(e)}})},1e3)}destroy(){clearInterval(this.timer)}}function X8(n,t,e,r){var l;const i=r;Date.now()-i.time<5*1e3&&(n.addCustom("active-cursors",d=>new q8(d)).add(i.id,i.time),z(t,"active")),v("span",[],e,"|").setAttribute("data-cursor-name",i.name),t.style.setProperty("--cursor-color",n.getColor((l=i.rainbowIndex)!=null?l:0))}const $1={insertionType:"remote-cursor",updateInsertionContent:X8};class wB{constructor(t){m(this,"decorators",[]);this.editor=t}registerDecorator(t){this.decorators.push(t)}decorateBlock(t,e){let r=e;return this.decorators.forEach(i=>{if(i.decorateBlock){const o=i.decorateBlock(this.editor,t,e);o&&(r=mt.default(o))}}),r}decorateText(t,e){let r=e;const i=new Map;return this.decorators.forEach(o=>{if(o.decorateText){const s=o.decorateText(this.editor,t,e);if(s){const{insertions:l,text:c}=s;l&&Array.from(l.entries()).forEach(([d,h])=>{const C=i.get(d);C?C.push(...h):i.set(d,h)}),c&&(r=mt.default(c))}}}),{insertions:i,text:r}}}const H1=I("editor-input");class Y8{constructor(t,e){m(this,"editor");m(this,"composing",!1);m(this,"callbacks");m(this,"inputElement");m(this,"handleWindowBlur",()=>{this.editor.emit("blur",this.editor),this.callbacks.onBlur()});m(this,"handleDocumentClick",t=>{const e=this.editor.rootContainer,r=t.target,i=!!(r!=null&&r.classList.contains("editor-disable-scroll"));if(r&&(i||e.contains(r))){!i&&!pa(r)&&(this.editor.emit("focus",this.editor),this.callbacks.onFocus(),this.editor.input.focus());return}this.isInCommandbar(r)||(this.editor.emit("blur",this.editor),this.callbacks.onBlur())});m(this,"handleDocumentSelectionChange",()=>{setTimeout(()=>{var e;const t=(e=document.getSelection())==null?void 0:e.focusNode;t&&(this.editor.contains(t)||this.isInCommandbar(t))||(this.editor.emit("blur",this.editor),this.callbacks.onBlur())},100)});m(this,"handleEditorSelectionChanged",()=>{const e=!this.editor.isWritable();this.inputElement.readOnly=e});m(this,"handleReadonlyChanged",()=>{this.handleEditorSelectionChanged()});m(this,"handleCompositionstart",t=>{!this.editor.isWritable()||(this.composing=!0,this.callbacks.onCompositionStart(t))});m(this,"handleCompositionend",t=>{$s()?setTimeout(()=>{this.composing=!1},100):this.composing=!1,this.callbacks.onUpdateCompositionText(t,this.inputElement.value,!0),this.inputElement.value=""});m(this,"handleInput",t=>{if(t instanceof InputEvent&&!!t.data){if(this.editor.readonly||!this.editor.isWritable()){this.inputElement.value="";return}this.composing?this.callbacks.onUpdateCompositionText(t,t.data,!1):(this.callbacks.onInsertText(t,t.data),this.inputElement.value="")}});m(this,"handleKeyDown",t=>{if(!this.composing){if(this.callbacks.onKeyDown(t)){t.preventDefault(),t.stopPropagation();return}!this.editor.isWritable()||setTimeout(()=>{this.composing||(this.inputElement.value="")})}});m(this,"handleCopy",t=>{this.callbacks.onCopy(t)});m(this,"handleCut",t=>{if(this.editor.readonly){t.stopPropagation(),t.preventDefault();return}this.callbacks.onCut(t),H1.debug("on cut")});m(this,"handlePaste",t=>{if(!(t.isTrusted&&(!(t.target instanceof HTMLInputElement)||this.inputElement!==t.target))){if(this.editor.readonly){t.stopPropagation(),t.preventDefault();return}this.callbacks.onPaste(t)}});m(this,"handlePasteText",(t,e)=>{this.callbacks.onPasteText(t,e)});this.editor=t,this.callbacks=e;const r=v("input",["editor-input"],t.contentElement);r.type="text",r.name="editor-input",r.onkeydown=this.handleKeyDown,r.oninput=this.handleInput,r.oncopy=this.handleCopy,document.addEventListener("paste",this.handlePaste),r.oncut=this.handleCut,r.addEventListener("compositionstart",this.handleCompositionstart),r.addEventListener("compositionend",this.handleCompositionend),this.inputElement=r,document.addEventListener("click",this.handleDocumentClick),document.addEventListener("selectionchange",this.handleDocumentSelectionChange),this.editor.addListener("selectionChanged",this.handleEditorSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged),window.addEventListener("blur",this.handleWindowBlur)}isInCommandbar(t){return!!(t!=null&&t.closest("div[data-command-bar-id]"))}destroy(){this.callbacks.destroy(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("selectionchange",this.handleDocumentSelectionChange),this.editor.removeListener("selectionChanged",this.handleEditorSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged);const t=this.inputElement;t.removeEventListener("compositionstart",this.handleCompositionstart),t.removeEventListener("compositionend",this.handleCompositionend),t.onkeydown=null,t.oninput=null,t.oncopy=null,document.removeEventListener("paste",this.handlePaste),window.removeEventListener("blur",this.handleWindowBlur),t.oncut=null}getInput(){return this.inputElement}focus(){this.editor.selection.caret.visible()||this.editor.selection.caret.update(),ie.isMobileSafari?(this.inputElement.focus(),this.callbacks.onFocus()):setTimeout(()=>{this.inputElement.focus(),this.callbacks.onFocus()})}handleChanged(t){this.callbacks.onChanged(t)}handleRemoteChanged(t){this.callbacks.onRemoteChanged(t)}addHandler(t){this.callbacks.addHandler(t)}removeHandler(t){this.callbacks.removeHandler(t)}defaultInsertText(t,e,r,i,o){p(H1,t===this.editor,"invalid editor"),this.callbacks.defaultInsertText(t,e,r,i,o)}defaultHandleKeydown(t,e){return p(H1,t===this.editor,"invalid editor"),this.callbacks.defaultHandleKeydown(t,e)}forEach(t){this.callbacks.forEach(t)}}function SB(n){const t=n.rootElement,e=t.getBoundingClientRect(),r=dr(t),i=window.innerWidth,o=window.innerHeight,s=e.left<0?0:e.left,l=e.top<0?0:e.top,c=e.right>i?i:e.right,d=e.bottom>o?o:e.bottom,h=(s+c)/2,C=(l+d)/2,E=0-e.left+h,x=0-e.top+C,B=n.input.inputElement;B.style.left=`${E/r}px`,B.style.top=`${x/r}px`}const j1=I("editor-caret");function Q8(){const t=window.navigator.userAgent.match(/Firefox\/(\d+)\./);return t?Number.parseInt(t[1],10):null}class J8{constructor(t){m(this,"editor");m(this,"caretElem");m(this,"handleReadOnlyChanged",()=>{this.update()});if(this.editor=t,this.caretElem=v("div",["editor-cursor"],this.editor.contentElement),ie.isFirefox){const e=Q8();e&&e<=79&&(this.caretElem.style.transition="none")}this.editor.on("readonlyChanged",this.handleReadOnlyChanged)}destroy(){this.editor.off("readonlyChanged",this.handleReadOnlyChanged)}visible(){const t=window.getComputedStyle(this.caretElem);return t.display!=="none"&&t.opacity!=="0"}hasCaret(){if(this.editor.readonly||!this.editor.selection.range.isCollapsed())return!1;const t=this.editor.selection.range.start;if(!(t instanceof Ye))return!1;const e=this.editor.getBlockById(t.blockId);return!!rt(this.editor,e)}update(){if(qc(this.editor.rootElement))return;const t=this.caretElem;if(this.hasCaret())t.style.display="";else{t.style.display="none",SB(this.editor);return}const{range:e}=this.editor.selection;p(j1,e.isCollapsed,"range is not collapsed");const r=e.start;p(j1,r instanceof Ye,"only simple block position can has caret");const i=this.editor.getBlockById(r.blockId);p(j1,rt(this.editor,i),"only text kind block can has caret");let o;const s=i.querySelector("span.inputting-insertion");s?(o=js(s),o=new DOMRect(o.right,o.top,1,o.height)):o=Jn(i,r);const l=this.editor.contentElement.getBoundingClientRect(),c=o.left-l.left,d=o.top-l.top;t.style.left=`${c}px`,t.style.top=`${d}px`,t.style.height=`${o.height}px`;const h=this.editor.input.inputElement;h.style.left=`${c}px`,h.style.top=`${d+o.height-24}px`,ie.isMobileSafari&&(h.style.left=`${c-4}px`,h.style.height=`${o.height}px`);const E=Xe(i,{horizontal:!0}).getBoundingClientRect(),x=E.left-l.left,B=x+E.width;c<x||c>B?(SB(this.editor),t.style.display="none"):t.style.display=""}}function Z8(n){Nv(n),n.selection.range.getSelectedBlocks().forEach(t=>Pv(n,t.block,t.start,t.end))}const t_=I("editor-dom");function bh(n){return Xe(n.rootContainer).clientHeight}function Eu(n){const e=Xe(n.rootContainer).getBoundingClientRect(),r=e.x<0?0:e.x,i=e.y<0?0:e.y,o=e.right>window.innerWidth?window.innerWidth:e.right,s=e.bottom>window.innerHeight?window.innerHeight:e.bottom;return new DOMRect(r,i,o-r,s-i)}function e_(n,t){const e=Eu(n),r=n.getBlockById(t.blockId),o=Wo(n,r,t);return Ws(e,o.x,o.y)&&Ws(e,o.right,o.bottom)}function LB(n,t){const e=Eu(n),r=t.getBoundingClientRect();return r.top>=e.top&&r.top<=e.bottom||r.bottom<=e.bottom&&r.bottom>=e.top}function n_(n,t){const e=Eu(n),r=t.getBoundingClientRect();if(r.top>=e.top&&r.top<=e.bottom&&r.bottom<=e.bottom&&r.bottom>=e.top)return 100;const i=Math.max(0,Math.min(r.right,e.right)-Math.max(r.left,e.left)),o=Math.max(0,Math.min(r.bottom,e.bottom)-Math.max(r.top,e.top)),s=i*o,l=r.width*r.height;return s/l*100}function r_(n,t){const e=Eu(n),r=t.getBoundingClientRect();return Ws(e,r.x,r.y)||Ws(e,r.right,r.bottom)}function i_(n,t){const e=Eu(n),r=t.getBoundingClientRect();return r.right>e.right||r.left<e.left}function xu(n,t,e){!t||(e!=null&&e.animation?(i_(n,t)&&Gs(t,{elementToScroll:Xe(t,{horizontal:!0}),disableHorizontal:!1}),Gs(t,{elementToScroll:Xe(t),disableHorizontal:!0})):t.scrollIntoView&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}))}function o_(n){if(!Ug(n.rootContainer)){t_.warn("editorScrollIntoView: editor is not visible");return}const t=n.rootContainer.getBoundingClientRect();if(t.height<1&&t.width<1)return;const e=n.selection,r=e.range.focus;if(!r.isSimple()){const C=r,E=n.getContainerById(C.childContainerId);r_(n,E)||E.scrollIntoView();return}if(e.range.start.blockId===e.range.end.blockId){const C=n.getBlockById(e.range.start.blockId);if(pe(C)&&LB(n,C)&&n_(n,C)>=95||It(n,C)&&LB(n,C))return}const i=r,o=n.getBlockById(i.blockId);if(e_(n,i))return;if(pe(o)){const C=Jt(o);if(C){["image"].includes($e(o))?setTimeout(()=>{xu(n,C,{animation:!0})},500):xu(n,C,{animation:!0});return}}const s=Wo(n,o,i),l=o.getBoundingClientRect(),c=oe(o),d=v("div",["editor-block-anchor"],c),h=dr(o);d.style.top=`${(s.top-l.top)/h}px`,xu(n,d,{animation:!0}),setTimeout(()=>{d.remove()},200)}function s_(n,t){if(t.isCollapsed())return!1;const e=be(n.rootContainer),r=Ue(n.rootContainer),{start:i,end:o}=t;return i.blockId===lt(e)&&i.offset===0&&o.blockId===lt(r)&&o.offset===dt(n,r)}const IB=I("range-in-block");function DB(n,t){const e=t.getEditor(),r=e.getBlockById(t.start.blockId),i=e.getBlockById(t.end.blockId),o=r===n||re(n,r),s=i===n||re(n,i);return!!(o||s)}function _B(n,t){const e=n.doc.toJSON(),r=new Set(Object.values(e.blocks).map(s=>s.map(l=>l.id)).flat());let i,o=mr(t);if(o){for(;o&&!r.has(lt(o));)o=mr(o);p(IB,o,"no prev block while deleting a block"),i=ve(n,o,dt(n,o))}else{const s=gr(t);p(IB,s,"no prev and next block while deleting a block"),i=ve(n,s,0)}return i}const l_=I("block-to-html");function z1(n,t,e,r){const i=Ys(n,t.type);if(i.convertTo)return i.convertTo(n,t,e,"html",r);if(i.blockKind!=="text")return`[${t.type}]`;p(l_,t.text,"no text");const o=de(t.text);return`<div>${jd(o)}</div>`}const MB=I("block-to-text");function a_(n,t,e){let r="";return t.forEach(i=>{if(p(MB,typeof i.insert=="string","invalid op"),i.attributes&&i.attributes.box===!0){const o=i.attributes,s=n.editorBoxes.getBoxClass(o.type);if(s!=null&&s.convertTo){r+=s.convertTo(n,o,e,"text");return}if(i.attributes.text){r+=i.attributes.text;return}r+=`[${o.type}]`}r+=i.insert}),r}function vh(n,t,e,r){const i=Ys(n,t.type);return i.convertTo?i.convertTo(n,t,e,"text",r):i.blockKind!=="text"?`[${t.type}]`:(p(MB,t.text,"no text"),a_(n,t.text,e))}function Bh(n,t,e,r){const i=Ys(n,t.type);return i.convertTo?i.convertTo(n,t,e,"markdown",r):vh(n,t,e,r)}function Au(n,t){return t.blocks.root.map((i,o)=>z1(n,i,t,[{containerId:"root",blockIndex:o}])).join(`
|
|
24
|
+
`:""}const AB={boxType:"br",updateBoxContent:$8,convertTo:H8},bB=I("editor-boxes");class vB{constructor(t){m(this,"boxes",new Map);this.editor=t}registerBoxClass(t){const e=t.boxType,r=this.boxes.get(e);p(bB,!r,`duplicated box type: ${e}`),this.boxes.set(e,t)}getBoxClass(t){const e=this.boxes.get(t);return p(bB,e,`unknown box type: ${t}`),e}createBox(t,e){const r=Sv(e),i=Iv(r);return this.getBoxClass(e.type).updateBoxContent(this.editor,r,i,e),r}forEach(t){this.boxes.forEach(t)}}function j8(n,t,e,r){const i=r,{width:o,height:s,src:l}=i,c=["editor-box-image"];i.link&&c.push("editor-box-image-link");const d=v("img",c,e);o&&(d.style.width=`${o}px`),s&&(d.style.height=`${s}px`),d.src=n.doc.buildResourceUrl(l)}const BB={boxType:"image",updateBoxContent:j8},z8="data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9InJnYigxNzgsIDE4OCwgMjA1KSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0ibTE3IDE1IDEuNTUgMS41NWMtLjk2IDEuNjktMy4zMyAzLjA0LTUuNTUgMy4zN1YxMWgzVjloLTNWNy44MkMxNC4xNiA3LjQgMTUgNi4zIDE1IDVjMC0xLjY1LTEuMzUtMy0zLTNTOSAzLjM1IDkgNWMwIDEuMy44NCAyLjQgMiAyLjgyVjlIOHYyaDN2OC45MmMtMi4yMi0uMzMtNC41OS0xLjY4LTUuNTUtMy4zN0w3IDE1bC00LTN2M2MwIDMuODggNC45MiA3IDkgN3M5LTMuMTIgOS03di0zbC00IDN6TTEyIDRjLjU1IDAgMSAuNDUgMSAxcy0uNDUgMS0xIDEtMS0uNDUtMS0xIC40NS0xIDEtMXoiPjwvcGF0aD4KPC9zdmc+Cg==";function G8(n,t,e){z(e,"editor-box-anchor"),Lg(z8,[],e)}const TB={boxType:"anchor",updateBoxContent:G8};function W8(n,t,e,r){v("span",[],e,r.text)}const yB={insertionType:"inputting",updateInsertionContent:W8},kB=I("editor-insertion");class RB{constructor(t){m(this,"insertions",new Map);this.editor=t}registerInsertionClass(t){const e=t.insertionType,r=this.insertions.get(e);p(kB,!r,`duplicated insertion type: ${e}`),this.insertions.set(e,t)}getInsertionClass(t){const e=this.insertions.get(t);return p(kB,e,`unknown insertion type: ${t}`),e}createInsertion(t,e){const r=Dv(e.type,e.id,e.attributes),i=Mv(r);return this.getInsertionClass(e.type).updateInsertionContent(this.editor,r,i,e),r}}class q8{constructor(t){m(this,"cursors",new Map);m(this,"timer");this.editor=t,this.timer=this.startTimer()}add(t,e){this.cursors.set(t,e)}startTimer(){return setInterval(()=>{const t=Date.now();Array.from(this.cursors).forEach(([e,r])=>{if(t-r>3e3){const i=_v(this.editor,e);i&&ot(i,"active"),this.cursors.delete(e)}})},1e3)}destroy(){clearInterval(this.timer)}}function X8(n,t,e,r){var l;const i=r;Date.now()-i.time<5*1e3&&(n.addCustom("active-cursors",d=>new q8(d)).add(i.id,i.time),z(t,"active")),v("span",[],e,"|").setAttribute("data-cursor-name",i.name),t.style.setProperty("--cursor-color",n.getColor((l=i.rainbowIndex)!=null?l:0))}const $1={insertionType:"remote-cursor",updateInsertionContent:X8};class wB{constructor(t){m(this,"decorators",[]);this.editor=t}registerDecorator(t){this.decorators.push(t)}decorateBlock(t,e){let r=e;return this.decorators.forEach(i=>{if(i.decorateBlock){const o=i.decorateBlock(this.editor,t,e);o&&(r=mt.default(o))}}),r}decorateText(t,e){let r=e;const i=new Map;return this.decorators.forEach(o=>{if(o.decorateText){const s=o.decorateText(this.editor,t,e);if(s){const{insertions:l,text:c}=s;l&&Array.from(l.entries()).forEach(([d,h])=>{const C=i.get(d);C?C.push(...h):i.set(d,h)}),c&&(r=mt.default(c))}}}),{insertions:i,text:r}}}const H1=I("editor-input");class Y8{constructor(t,e){m(this,"editor");m(this,"composing",!1);m(this,"callbacks");m(this,"inputElement");m(this,"handleWindowBlur",()=>{this.editor.emit("blur",this.editor),this.callbacks.onBlur()});m(this,"handleDocumentClick",t=>{const e=this.editor.rootContainer,r=t.target,i=!!(r!=null&&r.classList.contains("editor-disable-scroll"));if(r&&(i||e.contains(r))){!i&&!pa(r)&&(this.editor.emit("focus",this.editor),this.callbacks.onFocus(),this.editor.input.focus());return}this.isInCommandbar(r)||(this.editor.emit("blur",this.editor),this.callbacks.onBlur())});m(this,"handleDocumentSelectionChange",()=>{setTimeout(()=>{var e;const t=(e=document.getSelection())==null?void 0:e.focusNode;t&&(this.editor.contains(t)||this.isInCommandbar(t))||(this.editor.emit("blur",this.editor),this.callbacks.onBlur())},100)});m(this,"handleEditorSelectionChanged",()=>{const e=!this.editor.isWritable();this.inputElement.readOnly=e});m(this,"handleReadonlyChanged",()=>{this.handleEditorSelectionChanged()});m(this,"handleCompositionstart",t=>{!this.editor.isWritable()||(this.composing=!0,this.callbacks.onCompositionStart(t))});m(this,"handleCompositionend",t=>{$s()?setTimeout(()=>{this.composing=!1},100):this.composing=!1,this.callbacks.onUpdateCompositionText(t,this.inputElement.value,!0),this.inputElement.value=""});m(this,"handleInput",t=>{if(t instanceof InputEvent&&!!t.data){if(this.editor.readonly||!this.editor.isWritable()){this.inputElement.value="";return}this.composing?this.callbacks.onUpdateCompositionText(t,t.data,!1):(this.callbacks.onInsertText(t,t.data),this.inputElement.value="")}});m(this,"handleKeyDown",t=>{if(!this.composing){if(this.callbacks.onKeyDown(t)){t.preventDefault(),t.stopPropagation();return}!this.editor.isWritable()||setTimeout(()=>{this.composing||(this.inputElement.value="")})}});m(this,"handleCopy",t=>{this.callbacks.onCopy(t)});m(this,"handleCut",t=>{if(this.editor.readonly){t.stopPropagation(),t.preventDefault();return}this.callbacks.onCut(t),H1.debug("on cut")});m(this,"handlePaste",t=>{if(!(t.isTrusted&&(!(t.target instanceof HTMLInputElement)||this.inputElement!==t.target))){if(this.editor.readonly){t.stopPropagation(),t.preventDefault();return}this.callbacks.onPaste(t)}});m(this,"handlePasteText",(t,e)=>{this.callbacks.onPasteText(t,e)});this.editor=t,this.callbacks=e;const r=v("input",["editor-input"],t.contentElement);r.type="text",r.name="editor-input",r.onkeydown=this.handleKeyDown,r.oninput=this.handleInput,r.oncopy=this.handleCopy,document.addEventListener("paste",this.handlePaste),r.oncut=this.handleCut,r.addEventListener("compositionstart",this.handleCompositionstart),r.addEventListener("compositionend",this.handleCompositionend),this.inputElement=r,document.addEventListener("click",this.handleDocumentClick),document.addEventListener("selectionchange",this.handleDocumentSelectionChange),this.editor.addListener("selectionChanged",this.handleEditorSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged),window.addEventListener("blur",this.handleWindowBlur)}isInCommandbar(t){let e=t;return e===null?!1:(e.nodeType===3&&(e=e.parentElement),!!(e!=null&&e.closest("div[data-command-bar-id]")))}destroy(){this.callbacks.destroy(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("selectionchange",this.handleDocumentSelectionChange),this.editor.removeListener("selectionChanged",this.handleEditorSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged);const t=this.inputElement;t.removeEventListener("compositionstart",this.handleCompositionstart),t.removeEventListener("compositionend",this.handleCompositionend),t.onkeydown=null,t.oninput=null,t.oncopy=null,document.removeEventListener("paste",this.handlePaste),window.removeEventListener("blur",this.handleWindowBlur),t.oncut=null}getInput(){return this.inputElement}focus(){this.editor.selection.caret.visible()||this.editor.selection.caret.update(),ie.isMobileSafari?(this.inputElement.focus(),this.callbacks.onFocus()):setTimeout(()=>{this.inputElement.focus(),this.callbacks.onFocus()})}handleChanged(t){this.callbacks.onChanged(t)}handleRemoteChanged(t){this.callbacks.onRemoteChanged(t)}addHandler(t){this.callbacks.addHandler(t)}removeHandler(t){this.callbacks.removeHandler(t)}defaultInsertText(t,e,r,i,o){p(H1,t===this.editor,"invalid editor"),this.callbacks.defaultInsertText(t,e,r,i,o)}defaultHandleKeydown(t,e){return p(H1,t===this.editor,"invalid editor"),this.callbacks.defaultHandleKeydown(t,e)}forEach(t){this.callbacks.forEach(t)}}function SB(n){const t=n.rootElement,e=t.getBoundingClientRect(),r=dr(t),i=window.innerWidth,o=window.innerHeight,s=e.left<0?0:e.left,l=e.top<0?0:e.top,c=e.right>i?i:e.right,d=e.bottom>o?o:e.bottom,h=(s+c)/2,C=(l+d)/2,E=0-e.left+h,x=0-e.top+C,B=n.input.inputElement;B.style.left=`${E/r}px`,B.style.top=`${x/r}px`}const j1=I("editor-caret");function Q8(){const t=window.navigator.userAgent.match(/Firefox\/(\d+)\./);return t?Number.parseInt(t[1],10):null}class J8{constructor(t){m(this,"editor");m(this,"caretElem");m(this,"handleReadOnlyChanged",()=>{this.update()});if(this.editor=t,this.caretElem=v("div",["editor-cursor"],this.editor.contentElement),ie.isFirefox){const e=Q8();e&&e<=79&&(this.caretElem.style.transition="none")}this.editor.on("readonlyChanged",this.handleReadOnlyChanged)}destroy(){this.editor.off("readonlyChanged",this.handleReadOnlyChanged)}visible(){const t=window.getComputedStyle(this.caretElem);return t.display!=="none"&&t.opacity!=="0"}hasCaret(){if(this.editor.readonly||!this.editor.selection.range.isCollapsed())return!1;const t=this.editor.selection.range.start;if(!(t instanceof Ye))return!1;const e=this.editor.getBlockById(t.blockId);return!!rt(this.editor,e)}update(){if(qc(this.editor.rootElement))return;const t=this.caretElem;if(this.hasCaret())t.style.display="";else{t.style.display="none",SB(this.editor);return}const{range:e}=this.editor.selection;p(j1,e.isCollapsed,"range is not collapsed");const r=e.start;p(j1,r instanceof Ye,"only simple block position can has caret");const i=this.editor.getBlockById(r.blockId);p(j1,rt(this.editor,i),"only text kind block can has caret");let o;const s=i.querySelector("span.inputting-insertion");s?(o=js(s),o=new DOMRect(o.right,o.top,1,o.height)):o=Jn(i,r);const l=this.editor.contentElement.getBoundingClientRect(),c=o.left-l.left,d=o.top-l.top;t.style.left=`${c}px`,t.style.top=`${d}px`,t.style.height=`${o.height}px`;const h=this.editor.input.inputElement;h.style.left=`${c}px`,h.style.top=`${d+o.height-24}px`,ie.isMobileSafari&&(h.style.left=`${c-4}px`,h.style.height=`${o.height}px`);const E=Xe(i,{horizontal:!0}).getBoundingClientRect(),x=E.left-l.left,B=x+E.width;c<x||c>B?(SB(this.editor),t.style.display="none"):t.style.display=""}}function Z8(n){Nv(n),n.selection.range.getSelectedBlocks().forEach(t=>Pv(n,t.block,t.start,t.end))}const t_=I("editor-dom");function bh(n){return Xe(n.rootContainer).clientHeight}function Eu(n){const e=Xe(n.rootContainer).getBoundingClientRect(),r=e.x<0?0:e.x,i=e.y<0?0:e.y,o=e.right>window.innerWidth?window.innerWidth:e.right,s=e.bottom>window.innerHeight?window.innerHeight:e.bottom;return new DOMRect(r,i,o-r,s-i)}function e_(n,t){const e=Eu(n),r=n.getBlockById(t.blockId),o=Wo(n,r,t);return Ws(e,o.x,o.y)&&Ws(e,o.right,o.bottom)}function LB(n,t){const e=Eu(n),r=t.getBoundingClientRect();return r.top>=e.top&&r.top<=e.bottom||r.bottom<=e.bottom&&r.bottom>=e.top}function n_(n,t){const e=Eu(n),r=t.getBoundingClientRect();if(r.top>=e.top&&r.top<=e.bottom&&r.bottom<=e.bottom&&r.bottom>=e.top)return 100;const i=Math.max(0,Math.min(r.right,e.right)-Math.max(r.left,e.left)),o=Math.max(0,Math.min(r.bottom,e.bottom)-Math.max(r.top,e.top)),s=i*o,l=r.width*r.height;return s/l*100}function r_(n,t){const e=Eu(n),r=t.getBoundingClientRect();return Ws(e,r.x,r.y)||Ws(e,r.right,r.bottom)}function i_(n,t){const e=Eu(n),r=t.getBoundingClientRect();return r.right>e.right||r.left<e.left}function xu(n,t,e){!t||(e!=null&&e.animation?(i_(n,t)&&Gs(t,{elementToScroll:Xe(t,{horizontal:!0}),disableHorizontal:!1}),Gs(t,{elementToScroll:Xe(t),disableHorizontal:!0})):t.scrollIntoView&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}))}function o_(n){if(!Ug(n.rootContainer)){t_.warn("editorScrollIntoView: editor is not visible");return}const t=n.rootContainer.getBoundingClientRect();if(t.height<1&&t.width<1)return;const e=n.selection,r=e.range.focus;if(!r.isSimple()){const C=r,E=n.getContainerById(C.childContainerId);r_(n,E)||E.scrollIntoView();return}if(e.range.start.blockId===e.range.end.blockId){const C=n.getBlockById(e.range.start.blockId);if(pe(C)&&LB(n,C)&&n_(n,C)>=95||It(n,C)&&LB(n,C))return}const i=r,o=n.getBlockById(i.blockId);if(e_(n,i))return;if(pe(o)){const C=Jt(o);if(C){["image"].includes($e(o))?setTimeout(()=>{xu(n,C,{animation:!0})},500):xu(n,C,{animation:!0});return}}const s=Wo(n,o,i),l=o.getBoundingClientRect(),c=oe(o),d=v("div",["editor-block-anchor"],c),h=dr(o);d.style.top=`${(s.top-l.top)/h}px`,xu(n,d,{animation:!0}),setTimeout(()=>{d.remove()},200)}function s_(n,t){if(t.isCollapsed())return!1;const e=be(n.rootContainer),r=Ue(n.rootContainer),{start:i,end:o}=t;return i.blockId===lt(e)&&i.offset===0&&o.blockId===lt(r)&&o.offset===dt(n,r)}const IB=I("range-in-block");function DB(n,t){const e=t.getEditor(),r=e.getBlockById(t.start.blockId),i=e.getBlockById(t.end.blockId),o=r===n||re(n,r),s=i===n||re(n,i);return!!(o||s)}function _B(n,t){const e=n.doc.toJSON(),r=new Set(Object.values(e.blocks).map(s=>s.map(l=>l.id)).flat());let i,o=mr(t);if(o){for(;o&&!r.has(lt(o));)o=mr(o);p(IB,o,"no prev block while deleting a block"),i=ve(n,o,dt(n,o))}else{const s=gr(t);p(IB,s,"no prev and next block while deleting a block"),i=ve(n,s,0)}return i}const l_=I("block-to-html");function z1(n,t,e,r){const i=Ys(n,t.type);if(i.convertTo)return i.convertTo(n,t,e,"html",r);if(i.blockKind!=="text")return`[${t.type}]`;p(l_,t.text,"no text");const o=de(t.text);return`<div>${jd(o)}</div>`}const MB=I("block-to-text");function a_(n,t,e){let r="";return t.forEach(i=>{if(p(MB,typeof i.insert=="string","invalid op"),i.attributes&&i.attributes.box===!0){const o=i.attributes,s=n.editorBoxes.getBoxClass(o.type);if(s!=null&&s.convertTo){r+=s.convertTo(n,o,e,"text");return}if(i.attributes.text){r+=i.attributes.text;return}r+=`[${o.type}]`}r+=i.insert}),r}function vh(n,t,e,r){const i=Ys(n,t.type);return i.convertTo?i.convertTo(n,t,e,"text",r):i.blockKind!=="text"?`[${t.type}]`:(p(MB,t.text,"no text"),a_(n,t.text,e))}function Bh(n,t,e,r){const i=Ys(n,t.type);return i.convertTo?i.convertTo(n,t,e,"markdown",r):vh(n,t,e,r)}function Au(n,t){return t.blocks.root.map((i,o)=>z1(n,i,t,[{containerId:"root",blockIndex:o}])).join(`
|
|
25
25
|
`)}function UB(n,t){return`<!doctype html><html><head><meta charset="utf8" /></head><body>${Au(n,t)}</body></html>`}function Zo(n,t){return t.blocks.root.map((i,o)=>vh(n,i,t,[{containerId:"root",blockIndex:o}])).join(`
|
|
26
26
|
`)}function OB(n,t){const e=t.blocks.root.map((i,o)=>Bh(n,i,t,[{containerId:"root",blockIndex:o}]));return e[e.length-1]=e[e.length-1].trimEnd(),e.join(`
|
|
27
27
|
`)}const c_=I("get-text-position");function ka(n,t){const e=t!=null?t:n.selection.range.start;e instanceof Ye||p(c_,!1,`invalid insert pos type: ${typeof e}`);const{blockId:r}=e,i=n.getBlockById(r),o=vt(i),s=it(i),l=ct(s),{offset:c}=e;return{block:i,container:s,containerId:l,blockIndex:o,offset:c}}const Ra=I("insert-text");function G1(n,t,e,r){var s;const i=n.doc.getBlockData(t,e);if(p(Ra,i,"no block data"),p(Ra,i.text,"no block text"),gn(i.text)===0)return p(Ra,r===0,"invalid text offset"),n.editorCommandProviders.getEmptyBlockTextAttributes(n,i.id);if(r===0)return;const o=Je(i.text,r-1,1).middle;if(!((s=o[0].attributes)!=null&&s.box))return o[0].attributes}function u_(n,t,e){const r=it(t),i=ct(r),o=vt(t);return G1(n,i,o,e)}function NB(n,t,e,r,i){const o=it(t),s=ct(o),l=vt(t),c=u_(n,t,e),d=hh(e,r,c!=null?c:null);return n.doc.localUpdateBlockText(s,l,d,i),yn(n,t)}function PB(n,t,e,r){const i=it(t),o=ct(i),s=vt(t),l=hh(e," ",r);return n.doc.localUpdateBlockText(o,s,l),yn(n,t)}function f_(n,t){let e=0;if(t===0)return!1;for(let r=0;r<n.length;r++){const i=n[r];p(Ra,typeof i.insert=="string","invalid text op, no insert");const o=e+sh(i);if(o===t)return!1;if(o>t)return!0;e=o}return!1}function W1(n,t,e,r,i){const o=n.doc.getBlockData(e,r);p(Ra,o,"no block data"),p(Ra,o.text,"no block text");const s=G1(n,e,r,i);s&&Object.keys(s).includes("link")&&(f_(o.text,i)||delete s.link);const l=hh(i,t,s!=null?s:null);return n.doc.localUpdateBlockText(e,r,l),yn(n,n.getBlockById(o.id))}function q1(n,t){n.selection.range.isCollapsed()||n.clearSelectedContents();const{containerId:e,blockIndex:r,offset:i}=ka(n);W1(n,t,e,r,i)}const Th=I("update-composition-text");function FB(n){const t=n.selection.range.start;t instanceof Ye||p(Th,!1,`invalid insert pos type: ${typeof t}`);const{blockId:e}=t,r=n.getBlockById(e);p(Th,rt(n,r),"not a text kind block");const i=it(r),o=ct(i),s=vt(r),l=n.doc.getBlockData(o,s);p(Th,l,"no block data in doc"),p(Th,l.text,"no text data in text block");const c=Nt(r);ah(n,qo(r),e,c,l.text)}function X1(n){LD(n)}function wa(n,t,e,r,i,o){return n.doc.localInsertBlock(t,e,r,i,o),n.getBlockById(r.id)}const bu=I("delete-block-text");function Y1(n,t,e,r,i){if(!n.isBlockWritable(t))return bu.error("block is not writable"),0;p(bu,rt(n,t),"block is not a text kind block");const o=it(t),s=ct(o),l=vt(t),c=n.doc.getBlockData(s,l);p(bu,c,"no block data in doc"),p(bu,c.text,"no text data in text block");let d=e;On(t,e)||(d=Qo(t,d));let h=e+r;p(bu,h<=dt(n,t),`invalid offset and count: ${e}, ${r}`),On(t,h)||(h=rl(t,h));const C=h-d,E=oB(d,C);return n.doc.localUpdateBlockText(s,l,E,i),C}const Q1=I("break-text-block");function KB(n,t){const r=n.getBlockData(t).quoted;return r?{quoted:r}:{}}function Sa(n,t,e,r){p(Q1,rt(n,t),`block is not a text kind block: ${Dt(t)}`),p(Q1,e>=0&&e<=dt(n,t),`invalid offset: ${e}`);const i=it(t),o=ct(i),s=vt(t),l=r!=null&&r.copyBlockAttributes?KB(n,t):{};if(!(r!=null&&r.forceInsertAfter)&&(e===0||e===dt(n,t))){let k=s;if(e!==0){let F=gr(t);F?k=vt(F):(F=Ue(i),k=vt(F)+1)}const w={...Ai(""),...l,...r==null?void 0:r.newBlockData},U=ve(n,t.id,0),M=wa(n,o,k,w,U);return{block:t,newBlock:M}}p(Q1,On(t,e),"not a valid offset");const c=yn(n,t),{right:d}=Mn(c,e),h=gn(d);h>0&&Y1(n,t,e,h);let C=gr(t),E;C?E=vt(C):(C=Ue(i),E=vt(C)+1);const x={...Ai(d),...l,...r==null?void 0:r.newBlockData},B=wa(n,o,E,x,ve(n,x.id,0));return{block:t,newBlock:B}}const d_=I("prepare-insert-new-block");function h_(n,t,e){if(t&&e!==void 0&&e!==null){const d=n.getContainerById(t),h=fe(d);return p(d_,e>=0&&e<=h.length,`invalid blockIndex: ${e}`),{containerId:t,blockIndex:e}}const r=n.selection.range.start;if(!r.isSimple())return null;const i=n.getBlockById(r.blockId);if(t=ct(it(i)),e=vt(i),!rt(n,i))return{containerId:t,blockIndex:e+1};const s=r.offset;if(s===0||s===dt(n,i))return{containerId:t,blockIndex:s===0?e:e+1};const c=Sa(n,i,s).newBlock;return{containerId:t,blockIndex:vt(c)}}const m_=I("auto-insert-block");function VB(n,t,e,r,i,o){const s=h_(n,e,r);p(m_,s,`not an valid insert position: ${n.selection.range}`);const l={blockId:t.id,offset:0},c={anchor:l,focus:l};return wa(n,s.containerId,s.blockIndex,t,i!=null?i:c,o)}const g_=I("delete-block");function yh(n,t,e){t.children&&(e.push(...t.children),t.children.forEach(r=>{n.getChildContainerData(r).forEach(o=>{yh(n,o,e)})}))}function kh(n,t,e){const r=it(t),i=ct(r),o=vt(t),s=n.doc.getBlockData(i,o);return p(g_,s,"no block data in doc"),n.doc.localDeleteBlock(i,o,Qe(n,{anchor:e.start,focus:e.end})),s}function J1(n,t,e){return n.undoManager.runInGroup(()=>{const r=it(t);Or(r)===1&&n.insertTextBlock("",ct(r),0);let i=e?Xo(n,e):null;if(!i){const l=n.selection.range;DB(t,l)?i=_B(n,t):i=l}const o=kh(n,t,i),s=[];return yh(n,o,s),s.length>0&&n.doc.localDeleteChildContainers(s),o})}function p_(n,t){const e=[t];n.doc.getContainerBlocks(t).forEach(i=>{yh(n,i,e)}),n.doc.localDeleteChildContainers(e)}function $B(n,t){const e=[...t];t.forEach(r=>{n.doc.getContainerBlocks(r).forEach(o=>{yh(n,o,e)})}),n.doc.localDeleteChildContainers(e)}const Z1=I("merge-text-block");function HB(n,t,e){p(Z1,rt(n,t),"only text block can be merged"),p(Z1,rt(n,e),"only text block can be merged");const r=Jo(n,t),i=Jo(n,e),o=r.text,s=i.text;p(Z1,o&&s,"block data has no text");const l=it(t),c=ct(l),d=vt(t),h=dt(n,t),C=W1(n,s,c,d,h),E=ve(n,t,gn(o));return J1(n,e,E),C}const bi=I("clear-selected-contents");function Rh(n,t){p(bi,rt(n,t.block),"not a text kind block");const{start:e,end:r}=t;p(bi,e.isSimple(),"not a simple block position"),p(bi,r.isSimple(),"not a simple block position");const i=e.offset,o=r.offset;p(bi,i<=o,`invalid delete text offset: ${i}, ${o}`),i!==o&&n.deleteTextFromBlock(t.block,i,o-i)}function jB(n,t,e){const r=ct(t),i=fe(t),o=e.focus?void 0:n.selection.range.toDocRange(),s=n.insertTextBlock("",r,0,{newRange:o});e.focus&&n.selection.selectBlock(s,0),i.reverse().forEach(l=>{n.deleteBlock(l)})}function C_(n,t){const{block:e,start:r,end:i}=t;if(rt(n,e)){Rh(n,t);return}if(pe(e)||r.isSimple()){p(bi,i.isSimple(),"invalid range");const s=it(e),l=vt(e),c=n.insertTextBlock("",ct(s),l);n.selection.selectBlock(c,0),n.deleteBlock(e);return}p(bi,It(n,e),"invalid block kind"),p(bi,!r.isSimple()&&!i.isSimple(),"invalid range"),Ea(n,e,r,i),n.selection.range.getSelectedContainers().forEach((s,l)=>{jB(n,s,{focus:l===0})})}function E_(n){if(!n.isWritable())return;const t=n.selection.range;if(t.isCollapsed())return;const e=t.getSelectedBlocks();if(p(bi,e.length>0,"no selected block"),e.length===1){C_(n,e[0]);return}const r=e[0],i=r.block,o=it(i);p(bi,e.length>1,"no selected block");const s=e[e.length-1],l=s.block;if(rt(n,i)){Rh(n,r);const h=ve(n,r.block,r.start.offset);if(e.slice(1,e.length-1).reverse().forEach(E=>n.deleteBlock(E.block)),rt(n,l)){Rh(n,s),n.mergeTextBlock(i,l,{focus:!0}),n.selection.setRange(h);return}n.deleteBlock(l),n.selection.setRange(h);return}if(rt(n,l)){Rh(n,s),e.slice(0,e.length-1).reverse().forEach(h=>n.deleteBlock(h.block)),n.selection.selectBlock(s.block,0);return}if(e.length===Or(o)){jB(n,o,{focus:!0});return}const c=Oe(i),d=Jt(l);p(bi,c||d,"no prev or next block"),e.forEach(h=>n.deleteBlock(h.block))}function wh(n){n.selection.range.isCollapsed()||n.undoManager.runInGroup(()=>{n.emit("beforeClearSelection",n);try{n.doc.beginBatchUpdate(),E_(n)}finally{n.doc.endBatchUpdate()}n.emit("afterClearSelection",n)})}const x_=I("core");function zB(n,t,e,r){const i=it(t),o=ct(i),s=vt(t);return n.doc.localUpdateBlockText(o,s,e,r),setTimeout(()=>{n.selection.updateSelection(null)}),yn(n,t)}function GB(n,t,e,r){if(!n.isBlockWritable(t)){x_.error("block is not writable");return}const i=n.getBlockText(t),o=pn.diff(i,e);zB(n,t,o,r)}function Sh(n,t,e){const r=yn(n,t),i=typeof e=="string"?ol(e):e,o=pn.diff(r,i);return zB(n,t,o)}const vu=I("update-block-data");function Lh(n,t,e,r){const i=it(t),o=ct(i),s=vt(t),l=n.doc.getBlockData(o,s),c={insert:{},delete:[]},d=new Set(Object.keys(l)),h=new Set(Object.keys(e));return d.forEach(E=>{if(!h.has(E)){if(E==="id"||E==="type"||E==="text")return;vu.debug(`delete key: ${E}`),c.delete.push(E)}}),Object.entries(e).forEach(([E,x])=>{p(vu,E!=="id"&&E!=="type",`invalid block data delta, ${E}`);const B=l[E];if(x==null){B!=null&&(vu.debug(`delete key: ${E}`),c.delete.push(E));return}B!==x&&(Gc.default(B,x)||E==="text"&&pn.diff(B,x).length===0||(d.has(E)?(vu.debug(`replace key: ${E}`),c.delete.push(E)):vu.debug(`insert key: ${E}`),c.insert[E]=x))}),n.doc.localUpdateBlockData(o,s,c,r),Jo(n,t)}function WB(n,t,e,r){const o={...n.getBlockData(t),embedData:e};return n.updateBlockData(t,o,r)}function tp(n,t,e){if(!It(n,t)||!(e!=null&&e.tryFocusToChildSimpleBlock)){n.selection.selectBlock(t,0);return}const i=hr(n,t).getChildContainers(n,t)[0],o=be(i);tp(n,o,e)}function sl(n){const t=[];let e={};return n.forEach(r=>{t.push(...r.blocks.root);const{root:i,...o}=r.blocks;e={...e,...o}}),{blocks:{...e,root:t},meta:{},comments:{}}}const Bu=I("clone-block");function ts(n,t,e,r){const i=n.getBlockClass(e.type);if(i.blockToDoc)return i.blockToDoc(t,e,(h,C)=>(p(Bu,e!==C,"invalid child block"),ts(n,h,e,r)));let o={};const s=new Map,l=mt.default(e);l.children&&(l.children=l.children.map(h=>{const C=et(),E=t.blocks[h];p(Bu,Array.isArray(E),"invalid child blocks");const x=E.map(U=>ts(n,t,U,r)),B=sl(x),{root:k,...w}=B.blocks;return o={...o,...w},o[C]=B.blocks.root,s.set(h,C),C}));const c=Array.from(s.entries()),d=h=>{for(const C of c){const[E,x]=C;{const B=`${E}/`;if(h.startsWith(B)){const k=h.substring(B.length),w=`${x}/${k}`;return Bu.debug(`replace key: ${h} -> ${w}`),w}}{const B=`${E}_`;if(h.startsWith(B)){const k=h.substring(B.length),w=`${x}_${k}`;return Bu.debug(`replace key: ${h} -> ${w}`),w}}}return h};return Array.from(Object.entries(l)).forEach(([h,C])=>{const E=d(h);E!==h&&delete l.key,l[E]=C}),l.id=et(),r&&(r.blockIdMap.set(e.id,l.id),s.forEach((h,C)=>r.containerIdMap.set(C,h))),{blocks:{root:[l],...o},meta:{},comments:{}}}function ep(n,t,e,r){const i=t.blocks[e];p(Bu,Array.isArray(i),"invalid child blocks");const o=i.map(l=>ts(n,t,l,r));return sl(o)}function np(n,t,e){const r=t.blocks.root.map(i=>ts(n.editorBlocks,t,i,e));return mt.default(sl(r))}const qB=I("insert-doc");function XB(n,t,e,r,i){if(It(n,t)){qB.warn("failed to insert doc into a complex block");return}const o=np(n,r,i),s=it(t),l=vt(t),c=ct(s);n.doc.beginBatchUpdate(),n.undoManager.runInGroup(()=>{var F,Y,X;const d=[];Object.entries(o.blocks).forEach(([G,st])=>{G!=="root"&&d.push({containerId:G,blocks:st})}),d.length>0&&n.doc.localInsertChildContainers(d);const h=o.blocks.root;if(pe(t)){n.deleteBlock(t);let G;h.reverse().forEach(st=>{const pt=n.insertBlock(c,l,st,void 0,{noFocus:!0});G||(G=pt)}),G&&n.selection.selectBlock(G,dt(n,G));return}if(p(qB,rt(n,t),"not a text block"),se(n,t)){const G=vt(t);let st,pt=!1;for(let Ct=0;Ct<h.length;Ct++){if(Ct===0){const bt=n.findBlockByIndex(c,G),Gt=h[Ct].type==="text"||h[Ct].type==="list";if(bt&&rt(n,bt)&&se(n,bt)&&Gt){const Pe=n.insertBlock(c,G,h[Ct],void 0,{noFocus:!0});pt=!0,Ct===h.length-1&&(st=Pe);continue}bt&&qi(bt)&&(pt=!0)}const yt=n.insertBlock(c,G+Ct,h[Ct],void 0,{noFocus:!0});Ct===h.length-1&&(st=yt)}st&&n.selection.selectBlock(st,dt(n,st)),pt&&n.deleteBlock(t);return}if(h.length===1){const G=h[0];if(ou(n,G.type)){n.insertTextToBlock(t,e,(F=G.text)!=null?F:[]);return}n.breakTextBlock(t,e),n.insertBlock(c,l+1,G);return}const C=e===dt(n,t),E=e===0,x=h[0],B=h[h.length-1];let k;!C&&!E?k=n.breakTextBlock(t,e,{forceInsertAfter:!0}):k=t;const w=E?l:l+1;C?(k=n.insertBlock(c,l+1,B),n.selection.selectBlock(k,dt(n,k))):(n.selection.selectBlock(k,0),ou(n,B.type)?n.insertTextToBlock(k,0,(Y=B.text)!=null?Y:[]):n.insertBlock(c,w,B));const U=n.selection.range;let M=w;ou(n,x.type)?E?(n.insertBlock(c,w,x),M+=1):n.insertTextToBlock(t,e,(X=x.text)!=null?X:[]):(n.insertBlock(c,w,x),M+=1),h.slice(1,h.length-1).reverse().forEach(G=>{n.insertBlock(c,M,G)}),n.selection.setRange(U)}),n.doc.endBatchUpdate()}function rp(n,t,e,r,i){const o=np(n,r,i),s=ct(t),l=[];return n.undoManager.runInGroup(()=>{const c=[];Object.entries(o.blocks).forEach(([h,C])=>{h!=="root"&&c.push({containerId:h,blocks:C})}),n.doc.localInsertChildContainers(c),o.blocks.root.reverse().forEach(h=>{const C=n.insertBlock(s,e,h,void 0,{noFocus:!0,noScroll:!0});l.push(C)})}),l}function YB(n,t,e,r){const i=Or(t);rp(n,t,i,e,r);for(let o=0;o<i;o++){const s=be(t);n.deleteBlock(s)}}const Tu=I("add-text-attribute");function A_(n,t,e,r){const{start:i,end:o}=e;p(Tu,i.blockId===o.blockId&&i.blockId===lt(t),"invalid range"),p(Tu,r,"invalid attribute name");const s=n.getBlockText(t),l=va(i.offset,o.offset-i.offset,s,r,void 0,{ignoreValue:!0});return n.setBlockText(t,l),l}function QB(n,t,e,r,i){const{start:o,end:s}=e;p(Tu,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range"),p(Tu,r,"invalid attribute name");const l=n.getBlockText(t),c=mu(o.offset,s.offset-o.offset,l,r,i);return n.setBlockText(t,c),c}function La(n,t,e,r,i){const{start:o,end:s}=e;p(Tu,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range");const l=n.getBlockText(t),c=z3(o.offset,s.offset-o.offset,l,r,i);return n.setBlockText(t,c),c}function JB(n,t,e,r){const i=Ci(n,{simpleBlockOnly:!0});n.undoManager.runInGroup(()=>{i.forEach(o=>{const{block:s,start:l,end:c}=o;if(!rt(n,s))return;if(se(n,s)){r(n,lt(s),t,e);return}const d=Qe(n,{anchor:l,focus:c});t==="color"||t==="backgroundColor"?La(n,s,d,t,e):(La(n,s,d,"color",null),La(n,s,d,"backgroundColor",null))})})}function ZB(n,t,e){const r=Ci(n,{simpleBlockOnly:!0});n.undoManager.runInGroup(()=>{r.forEach(i=>{const{block:o,start:s,end:l}=i;if(!rt(n,o))return;if(se(n,o)){(t==="clearColor"||t==="clearAll")&&e(n,lt(o),"color",null),(t==="clearBackground"||t==="clearAll")&&e(n,lt(o),"backgroundColor",null);return}const c=Qe(n,{anchor:s,focus:l});(t==="clearColor"||t==="clearAll")&&La(n,o,c,"color",null),(t==="clearBackground"||t==="clearAll")&&La(n,o,c,"backgroundColor",null)})})}function t5(n,t,e){const r=t.getSelectedBlocks().filter(l=>rt(n,l.block));if(r.length===0)return[null,null];const i=l=>{if(dt(n,l.block)===0)return e(n,lt(l.block));const c=l.start,d=l.end,h=n.getBlockText(l.block);return q3(c.offset,d.offset-c.offset,h)};let[o,s]=i(r[0]);return o===null&&s===null?[o,s]:(r.forEach(l=>{const[c,d]=i(l);c===null||o===null?o=null:o=c===o?o:null,d===null||s===null?s=null:s=d===s?s:null}),[o,s])}const Zn=I("adjust-selection-pos");function e5(n){const t=[];for(;n;){const e=it(n);if(t.unshift(e),qt(e))return t;const r=Z(e);p(Zn,r,"child container has not parent container"),n=r}p(Zn,!1,"should not come here: getParentContainers")}function n5(n,t){for(;t;){const e=it(t);if(e===n)return t;const r=Z(e);p(Zn,r,"could not find parent block for a child container"),t=r}p(Zn,!1,"no parent block in specified container")}function b_(n,t){const e=e5(n),r=e5(t);p(Zn,e.length>0&&r.length>0,"block has not parent container"),p(Zn,e[0]===r[0],"root container does not equal");let i=e[0];for(let l=1;l<e.length||r.length;l++)if(e[l]!==r[l]){i=e[l-1];break}const o=n5(i,n),s=n5(i,t);return{parentContainer:i,newBlock1:o,newBlock2:s}}function r5(n,t){let e=Z(t);for(p(Zn,e,"element is not in a block");e;){const r=it(e);p(Zn,Fr(r),"not a child container");const i=Z(r);if(p(Zn,i,"child container has not parent block"),i===n)return r;e=i}p(Zn,!1,"failed to find parent container in complex block")}function Ih(n,t,e){const r=n.getBlockById(t.blockId),i=n.getBlockById(e.blockId);if(r===i)return t instanceof Ye&&e instanceof Ye?{anchor:t,focus:e}:t instanceof Kr&&e instanceof Kr?ih(n,r,t,e):null;const o=it(r),s=it(i);if(o===s)return t instanceof Kr&&(t=at(r,0,"home")),e instanceof Kr&&(e=at(i,dt(n,i),"end")),p(Zn,t instanceof Ye,"not valid position type"),p(Zn,e instanceof Ye,"not valid position type"),{anchor:t,focus:e};if(r.contains(s))return null;if(i.contains(o)){if(t instanceof Ye&&e instanceof Kr){const B=n.getContainerById(e.childContainerId);if(B===o)return{anchor:e,focus:e};const k=Z(o);if(k&&k===Z(B)){const w=xe(k,ct(o)),U=xe(k,ct(B));return ih(n,k,w,U)}}return null}const l=Vd(r,i)>0,{newBlock1:c,newBlock2:d}=b_(r,i);if(c===d){const B=c,k=r5(B,r),w=r5(B,i);return t=xe(c,ct(k)),e=xe(c,ct(w)),Zn.debug(`select in complex block: ${k.id}, ${w.id}`),ih(n,B,t,e)}let h=l?dt(n,c):0;c===r&&t instanceof Ye&&(h=t.offset);let E=l?0:dt(n,d);return d===i&&e instanceof Ye&&(E=e.offset),t=at(c,h,l?"end":"home"),e=at(d,E,l?"home":"end"),{anchor:t,focus:e}}const v_=I("move-complex-block-position");function B_(n,t,e){const r=n.getBlockById(t.blockId);p(v_,It(n,r),"is not a complex block");const i=hr(n,r),o=n.getContainerById(t.childContainerId),s=i.getNextContainer(n,r,o,e,{noWrap:!0});return s?xe(r,ct(s)):null}const es=I("move-simple-block-position");function i5(n,t){const e=an(n,t,{visibleOnly:!0});if(e.length===0)return es.warn("complex block has not any child container, not loaded?"),null;p(es,e.length>0,"complex block has not any child container");const r=e[0];return be(r)}function o5(n,t){const e=an(n,t,{visibleOnly:!0});if(e.length===0)return es.warn("complex block has not any child container, not loaded?"),null;p(es,e.length>0,"complex block has not any child container");const r=e[e.length-1];return Ue(r)}function s5(n,t,e){const r=e?i5(n,t):o5(n,t);return r?It(n,r)?s5(n,r,e):r:null}function T_(n,t,e){const r=n.getBlockById(t.blockId);return e==="move"&&It(n,r)&&t.offset===0?i5(n,r):gr(r)}function y_(n,t,e){const r=n.getBlockById(t.blockId);return e==="move"&&It(n,r)&&t.offset===1?o5(n,r):mr(r)}function ip(n){return n==="ArrowLeft"||n==="ArrowUp"}function op(n,t,e){const r=it(t);if(qt(r))return null;const i=Z(r);p(es,i,"child container has not parent block"),p(es,It(n,i),"is not a complex block");const o=hr(n,i).getNextContainer(n,i,r,e);return o?ip(e)?Ue(o):be(o):op(n,i,e)}function k_(n,t,e){const r=it(t);if(qt(r))return null;const i=Z(r);if(p(es,i,"child container has not parent block"),ip(e)){const l=Oe(i);if(l)return l}else{const l=Jt(i);if(l)return l}const o=op(n,i,e);if(o)return o;let s=i;for(;!qt(it(s));)s=Z(it(s));return ip(e)?Oe(s):Jt(s)}function R_(n,t,e){if(!It(n,t)||hr(n,t).enableKeyboardSelect)return t;const i=s5(n,t,e==="ArrowDown"||e==="ArrowRight");return i||t}function w_(n,t,e,r){const i=n.getBlockById(t.blockId),s=Qt(n,i).moveCaret(n,i,t,e);if(s)return s;let l=e==="ArrowDown"||e==="ArrowRight"?T_(n,t,r):y_(n,t,r);if(l||(l=op(n,i,e),l||(l=k_(n,i,e))),l||It(n,i)&&an(n,i).length===0&&(es.warn("complex block has not any child container, not loaded?"),l=e==="ArrowDown"||e==="ArrowRight"?gr(i):mr(i)),!l){if(e==="ArrowDown"||e==="ArrowRight"){if(n.readonly||!qt(it(i)))return null;const c=n.insertTextBlock("",ct(n.rootContainer),Or(n.rootContainer));return at(c,0,"home")}return null}if(l=R_(n,l,e),rt(n,l)){const c=n.selection.getSuggestedCaretX();if(e==="ArrowDown")return ZD(n,l,i,t,c);if(e==="ArrowUp")return JD(n,l,i,t,c)}return e==="ArrowLeft"||e==="ArrowUp"?at(l,dt(n,l),"end"):e==="ArrowRight"||e==="ArrowDown"?at(l,0,"home"):null}function S_(n,t,e){if(t==="ArrowLeft")return e.start;const r=e.end,i=n.getBlockById(r.blockId);if(rt(n,i))return r;const o=Jt(i);if(o)return at(o,0,"home");if(!qt(it(i))||n.readonly)return r;const s=n.insertTextBlock("",ct(n.rootContainer),Or(n.rootContainer));return at(s,0,"home")}function L_(n,t,e){const r=n.selection.range;let i;if(r instanceof rn)e==="move"&&!r.isCollapsed()&&(t==="ArrowLeft"||t==="ArrowRight")?i=S_(n,t,r):i=w_(n,r.getFocusedPos(),t,e);else if(i=B_(n,r.focus,t),e==="move"){const o=i!=null?i:r.focus,s=n.getContainerById(o.childContainerId);if(t==="ArrowLeft"||t==="ArrowUp"){const l=Ue(s);i=at(l,0,"home")}else{const l=be(s);i=at(l,dt(n,l),"end")}}return i?e==="move"?{anchor:i,focus:i}:Ih(n,r.anchor,i):null}function ns(n,t,e){const r=L_(n,t,e);if(!r)return!1;const{anchor:i,focus:o}=r;return n.selection.setSelection(i,o),(t==="ArrowLeft"||t==="ArrowRight")&&n.selection.updateLastCaretRect(),!0}function l5(n){return ns(n,"ArrowLeft","move"),!0}function a5(n){return ns(n,"ArrowRight","move"),!0}function c5(n){return ns(n,"ArrowUp","move"),!0}function u5(n){if(ns(n,"ArrowDown","move")||n.readonly)return!0;const t=n.getFocusedBlock(),e=it(t);if(qt(e)||Ue(e)!==t)return!0;const r=n.rootContainer;return n.insertTextBlock("",ct(r),Or(r)),!0}function f5(n){return ns(n,"ArrowDown","select"),!0}function d5(n){return ns(n,"ArrowLeft","select"),!0}function h5(n){return ns(n,"ArrowRight","select"),!0}function m5(n){return ns(n,"ArrowUp","select"),!0}const g5=I("word-offset");function sp(n,t){const e=n.selection.range.focus;p(g5,e.isSimple(),"invalid range type");const r=n.getBlockById(e.blockId);if(se(n,r))return at(r,0,"home");if(e.offset===0||!rt(n,r)){const s=Oe(r);if(!s)return null;const l=at(s,dt(n,s),"end");if(t==="select"&&rt(n,s)){const c=K1(n,s,l.offset);return at(s,c,"normal")}return l}const i=K1(n,r,e.offset);return at(r,i,"normal")}function lp(n,t){const e=n.selection.range.focus;p(g5,e.isSimple(),"invalid range type");const r=n.getBlockById(e.blockId);if(se(n,r))return at(r,0,"end");if(e.offset===dt(n,r)||!rt(n,r)){const s=Jt(r);if(!s)return null;const l=at(s,0,"home");if(t==="select"&&rt(n,s)){const c=V1(n,s,l.offset);return at(s,c,"end")}return l}const i=V1(n,r,e.offset);return at(r,i,"normal")}function p5(n){if(!n.selection.range.focus.isSimple())return!1;const e=sp(n,"move");return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function C5(n){if(!n.selection.range.focus.isSimple())return!1;const e=lp(n,"move");return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function E5(n){if(!n.selection.range.focus.isSimple())return!1;const e=sp(n,"select");return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function x5(n){if(!n.selection.range.focus.isSimple())return!1;const e=lp(n,"select");return e?(n.selection.setSelection(n.selection.range.anchor,e),n.selection.updateLastCaretRect(),!0):!1}I("find-block");function ap(n,t){if(!It(n,t))return t;const r=hr(n,t).getChildContainers(n,t)[0],o=fe(r)[0];return ap(n,o)}function cp(n,t){if(!It(n,t))return t;const e=hr(n,t).getChildContainers(n,t),r=e[e.length-1],i=fe(r),o=i[i.length-1];return cp(n,o)}function up(n){const t=cp(n,Ue(n.rootContainer)),e=at(t,dt(n,t),"end");return n.selection.setSelection(e),!0}function A5(n){const t=ap(n,n.getFirstBlock()),e=at(t,0,"home");return n.selection.setSelection(e),!0}function b5(n){const t=ap(n,n.getFirstBlock()),e=at(t,0,"home");return n.selection.setSelection(n.selection.getAnchorPos(),e),!0}function fp(n){const t=cp(n,Ue(n.rootContainer)),e=at(t,dt(n,t),"end");return n.selection.setSelection(n.selection.getAnchorPos(),e),!0}const v5=I("line-offset");function B5(n){const t=n.selection.range.focus;p(v5,t.isSimple(),"invalid range type");const e=n.getBlockById(t.blockId);if(t.offset===0||!rt(n,e))return at(e,0,"home");let i=Z3(e,t).start;const{next:o}=uu(e,i);return o&&Qn(o)&&su(o)==="br"&&(i+=1),at(e,i,"home")}function T5(n){const t=n.selection.range.focus;p(v5,t.isSimple(),"invalid range type");const e=n.getBlockById(t.blockId);if(t.offset===dt(n,e)||!rt(n,e))return at(e,dt(n,e),"end");const r=Z3(e,t);return at(e,r.end,"end")}function y5(n){if(!n.selection.range.focus.isSimple())return!1;const e=B5(n);return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function k5(n){if(!n.selection.range.focus.isSimple())return!1;const e=T5(n);return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function R5(n){if(!n.selection.range.focus.isSimple())return!1;const e=B5(n);return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function w5(n){if(!n.selection.range.focus.isSimple())return!1;const e=T5(n);return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}I("find-block-position"),I("page-offset");function S5(n,t){const r=Qt(n,t).getBlockTextLength(t),i=at(t,r,"normal"),o=Ih(n,n.selection.getAnchorPos(),i);if(!o)return!1;const{anchor:s,focus:l}=o;return n.selection.setSelection(s,l,{noScroll:!0}),n.selection.updateLastCaretRect(),!0}function L5(n,t){const e=at(t,0,"normal"),r=Ih(n,n.selection.getAnchorPos(),e);if(!r)return!1;const{anchor:i,focus:o}=r;return n.selection.setSelection(i,o,{noScroll:!0}),n.selection.updateLastCaretRect(),!0}async function I5(n){const t=bh(n)*.9,e=Xe(n.rootContainer);await Gs(Math.min(e.scrollTop+t*2,e.scrollHeight),{elementToScroll:e})}async function D5(n){const t=bh(n)*.9,e=Xe(n.rootContainer);await Gs(Math.max(e.scrollTop-t,0),{elementToScroll:e})}function _5(n){return D5(n),!0}function M5(n){return I5(n),!0}const I_=I("table-scroll");class U5{constructor(t,e,r,i,o){m(this,"handleEvent",t=>{this.handler(this.editor,t,this.data)});this.editor=t,this.dom=e,this.name=r,this.handler=i,this.data=o,e.addEventListener(r,this.handleEvent)}destroy(){this.dom.removeEventListener(this.name,this.handleEvent)}}class D_{constructor(t){m(this,"handlers",new Map);this.editor=t}destroy(){Array.from(this.handlers.entries()).forEach(([t,e])=>{e.forEach(r=>r.destroy()),this.handlers.delete(t)})}addEventListener(t,e,r,i){const o=this.handlers.get(t);if(o){if(o.find(s=>s.handler===r&&s.name===e)){I_.warn(`event has already registered: ${e}`);return}o.push(new U5(this.editor,t,e,r,i))}else{const s=new U5(this.editor,t,e,r,i);this.handlers.set(t,[s])}}removeEventListener(t,e,r){if(!t){for(const[o,s]of Array.from(this.handlers.entries()))for(let l=s.length-1;l>=0;l--){const c=s[l];if(e)e===c.name&&r===c.handler&&s.splice(l,1);else if(r===c.handler){s.splice(l,1),c.destroy(),s.length===0&&this.handlers.delete(o);continue}}return}const i=this.handlers.get(t);if(i){const o=i.findIndex(s=>s.handler===r&&s.name===e);if(o!==-1){const s=i[o];i.splice(o,1),s.destroy(),i.length===0&&this.handlers.delete(t)}}}removeAllListeners(t,e){const r=this.handlers.get(t);if(r)if(e)for(let i=0;i<r.length;i++){const o=r[i];o.name===e&&(r.splice(i,1),o.destroy())}else r.forEach(i=>{i.destroy()}),this.handlers.delete(t)}}function O5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Xe(n.rootContainer);return e.scrollTop===0?L5(n,n.getFirstBlock()):(D5(n).then(()=>{const r=e.getBoundingClientRect(),i=r.left+r.width/2,o=r.top+bh(n)*.1,s=Ae(i,o);if(s){const l=Z(s);l&&L5(n,l)}}),!0)}function N5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Xe(n.rootContainer);return e.scrollTop+e.clientHeight>=e.scrollHeight?S5(n,n.getLastBlock()):(I5(n).then(()=>{const r=bh(n)*.9,i=e.getBoundingClientRect(),o=i.left+i.width/2,s=i.top+r,l=Ae(o,s);if(l){const c=Z(l);c&&S5(n,c)}}),!0)}const yu=I("select-all");function P5(n,t){const e=be(n),r=Ue(n);return t.start.offset===0&&t.start.blockId===lt(e)&&t.end.offset===dt(t.getEditor(),r)&&t.end.blockId===lt(r)}function __(n,t){const e=t.getEditor(),r=hr(e,n).getChildContainers(e,n),i=r[0],o=r[r.length-1],s=lt(n);return t.start.blockId===s&&t.start.childContainerId===ct(i)&&t.end.blockId===s&&t.end.childContainerId===ct(o)}function M_(n,t){p(yu,t,"no parent block"),p(yu,It(n,t),"not a complex block");const e=hr(n,t).getChildContainers(n,t),r=e[0],i=e[e.length-1];n.selection.setRange(Qe(n,{anchor:xe(t,ct(r)),focus:xe(t,ct(i))}))}function F5(n,t){const e=it(t);Dh(n,e)}function dp(n){const t=n.getFocusedBlock(),e=n.selection.range;if(e.start.isSimple()){if(e.start.blockId===e.end.blockId&&rt(n,t)){const i=e.start,o=e.end,s=dt(n,t);if(i.offset>0||o.offset<s)return n.selection.selectBlock(t,0,s),!1}return z(n.rootContainer,"select-all"),F5(n,be(n.rootContainer)),!1}return p(yu,!e.isSimple(),"invalid range type"),__(t,e)?(F5(n,t),!1):(p(yu,t,"no parent block"),p(yu,It(n,t),"not a complex block"),M_(n,t),!0)}function Dh(n,t){const e=fe(t),r=e[0],i=e[e.length-1],o=at(r,0,"home"),s=at(i,dt(n,i),"end");n.selection.setSelection(o,s,{noScroll:!0})}function U_(n){fp(n),n.focus()}function O_(n){const t=[];return n.forEach(e=>{var r;((r=e.attributes)==null?void 0:r.box)===!0?(t.length>0&&t[t.length-1].length===0&&t.pop(),t.push([e]),t.push([])):t.length>0?t[t.length-1].push(e):t.push([e])}),t.length>0&&t[t.length-1].length===0&&t.pop(),t}function hp(n,t,e,r=!1){var c;if(!e)return[];const i=e.length;e=e.toLowerCase();const o=[];let s=0;const l=O_(t);for(const d of l){if(((c=d[0].attributes)==null?void 0:c.box)===!0){const E=d[0].attributes,x=n.editorBoxes.getBoxClass(E.type);(x==null?void 0:x.matchText)&&!r&&x.matchText(n,E,e)&&o.push({start:s,end:s+1}),s+=1;continue}const h=de(d,{boxReplacement:" "}).toLowerCase();let C=h.indexOf(e,0);for(;C!==-1;)o.push({start:C+s,end:C+i+s}),C=h.indexOf(e,C+i);s+=h.length}return o}function K5(n,t,e,r,i){const o=hp(n,t,e,!0);let s=mt.default(t);return o.length===0||(o.reverse().forEach(l=>{s=mh(s,l.start,l.end,r)}),i&&(i.count=o.length)),s}const mp=I("selected-block-to-doc");function V5(n,t,e){!t.children||t.children.forEach(r=>{const i=n.getChildContainerData(r);i.forEach(o=>{V5(n,o,e)}),e.blocks[r]=mt.default(i)})}function _h(n,t){const e=Qt(n,t.block);if(e.selectionToDoc)return e.selectionToDoc(n,t);const r=mt.default(Jo(n,t.block));if(rt(n,t.block)){const o=t.start,s=t.end;if(p(mp,r.text,"no block text"),o.offset===s.offset)return{blocks:{root:[{...r,text:[]}]},meta:{},comments:{}};const{middle:l}=Je(r.text,o.offset,s.offset-o.offset);return{blocks:{root:[{...r,text:l}]},meta:{},comments:{}}}if(pe(t.block))return{blocks:{root:[r]},meta:{},comments:{}};p(mp,It(n,t.block),"not complex block"),p(mp,r.children,"no children");const i={blocks:{root:[r]},meta:{},comments:{}};return V5(n,r,i),i}function gp(n,t){const e=at(t,0,"normal"),r=at(t,dt(n,t),"end");return _h(n,{block:t,start:e,end:r})}const N_=I("block-to-doc");function $5(n,t){p(N_,t.length>0,"invalid params, no blocks");const e=t.map(r=>gp(n,r));return sl(e)}function Ia(n){const e=n.selection.range.getSelectedBlocks().map(r=>_h(n,r));return sl(e)}function H5(n,t){const e=n.getContainerById(t),o=fe(e).map(s=>({start:at(s,0,"home"),end:at(s,dt(n,s),"end"),block:s})).map(s=>_h(n,s));return sl(o)}const j5=I("ensure-block-visible");function P_(n,t){var e;for(;t;){const r=it(t);if(qt(r))return;const i=Z(r);p(j5,i,"no parent block");const o=Qt(n,i);o.isChildContainerVisible&&!((e=o.isChildContainerVisible)!=null&&e.call(o,n,i,r))&&(p(j5,o.showChildContainer,"no showChildContainer method"),o.showChildContainer(n,i,r)),t=i}}const Mh=I("editor-selection");class F_{constructor(t){m(this,"editor");m(this,"caret");m(this,"_range");m(this,"lastCaretRect");m(this,"handleBlockDelete",(t,e,r,i)=>{if(r||i.child)return;const o=this.range;if(DB(e,o)){Mh.debug("adjust selection because remote deleted current block");const s=_B(t,e);this.setRange(s,{noScroll:!0})}});this.editor=t;const e=t.getFirstBlock(),r=lt(e);this.caret=new J8(t);const i=at(r,0,"normal");this._range=Qe(t,{anchor:i,focus:i}),this.lastCaretRect=null,this.editor.addListener("blockDeleted",this.handleBlockDelete),setTimeout(()=>{this.updateFocusedBlock(null)})}destroy(){this.caret.destroy()}get range(){return this._range}get focusedBlock(){return this.getFocusedBlock()}get startBlock(){return this.getStartBlock()}get endBlock(){return this.getEndBlock()}getFocusedBlock(){const t=this.range.focus;return this.editor.getBlockById(t.blockId)}getStartBlock(){const t=this.range.start;return this.editor.getBlockById(t.blockId)}getEndBlock(){const t=this.range.end;return this.editor.getBlockById(t.blockId)}selectBlock(t,e,r,i){const o=at(t,e,"normal");let s;r&&(s=at(t,r,"normal")),this.setSelection(o,s,i)}setSelection(t,e,r){if(e||(e=t),this.verifyPos(t),this.verifyPos(e),!this.selectionChanging(t,e))return this.range;const i=this.editor.getBlockById(t.blockId);P_(this.editor,i);const o=Qe(this.editor,{anchor:t,focus:e});if(this.range.isEqual(o))return this.range;const s=this._range;return this._range=o,this.selectionChanged(),this.updateFocusedBlock(s),wt(this.editor.rootContainer,"select-all")&&(!o.isSimple()||!s_(this.editor,o))&&ot(this.editor.rootContainer,"select-all"),r!=null&&r.noScroll||this.scrollIntoView(),this.range}setRange(t,e){return this.setSelection(t.anchor,t.focus,e)}updateSelection(){this.caret.update(),Z8(this.editor)}getFocusedPos(){return this.range.focus}getAnchorPos(){return this.range.anchor}selectionChanging(t,e){return!0}selectionChanged(){this.updateSelection(),this.editor.emit("selectionChanged",this.editor)}updateLastCaretRect(){const t=this.range.focus;if(!Vr(t))return;const e=this.editor.getBlockById(t.blockId);this.lastCaretRect=Wo(this.editor,e,t)}getSuggestedCaretX(){var t;return(t=this.lastCaretRect)==null?void 0:t.x}scrollIntoView(){o_(this.editor)}verifyPos(t){const e=this.editor.getBlockById(t.blockId);if(t.isSimple())t.offset>=0&&t.offset<=dt(this.editor,e)||p(Mh,!1,"invalid block position, out of range");else{const r=t.childContainerId;!!this.editor.getContainerById(r)||p(Mh,!1,"invalid complex block position, no container found")}}updateFocusedBlock(t){if(t&&this.range.start.blockId===t.start.blockId)return;let e;t&&t.start.blockId===t.end.blockId&&(e=this.editor.findBlockById(t.start.blockId));let r;(this.range.isCollapsed()||!this.range.isSimple()||this.range.start.blockId===this.range.end.blockId)&&(r=this.editor.getBlockById(this.range.start.blockId));let i=!1;e&&wt(e,"focused")&&(ot(e,"focused"),i=!0),this.removeAllBlockFocusedClass(),r&&this.setBlockFocused(r)&&(i=!0),i&&this.editor.emit("focusBlockChanged",this.editor,r!=null?r:null,e!=null?e:null)}verify(){this.verifyPos(this._range.start),this.verifyPos(this._range.end)}to(t){const e=Ia(this.editor);return t==="text"?Zo(this.editor,e):t==="markdown"?OB(this.editor,e):UB(this.editor,e)}removeAllBlockFocusedClass(){this.editor.rootContainer.querySelectorAll('div[data-type="editor-block"].focused, div[data-type="editor-block"].child-focused').forEach(t=>{ot(t,"focused"),ot(t,"child-focused")})}setBlockFocused(t){if(wt(t,"focused"))return!1;z(t,"focused");let e=it(t);for(;Fr(e);){const r=Z(e);p(Mh,r,"parent block not found"),z(r,"child-focused"),e=it(r)}return!0}}function K_(n){const t=n.selection.range.focus;if(!t.isSimple())return;const e=n.findBlockById(t.blockId);!e||n.selection.selectBlock(e,0,dt(n,e))}function V_(n){const t=n.selection.range.focus;if(!t.isSimple())return;const e=n.findBlockById(t.blockId);if(!e||!rt(n,e))return;let r=sp(n,"select"),i=lp(n,"select");if(!r||!i)return;const o=t.blockId;r.blockId!==o&&(r=at(e,0,"home")),i.blockId!==o&&(i=at(e,dt(n,e),"end")),n.selection.setSelection(r,i)}class $_{constructor(t){m(this,"editor");m(this,"startPos",null);m(this,"lastCaretRect");m(this,"mouseDownEvent",null);m(this,"autoScroll",null);m(this,"handleMouseDown",(t,e)=>{var i;this.mouseDownEvent=t;const r=p1(this.editor,t.x,t.y);if(r){if(r instanceof pi)return;if(!this.autoScroll&&e.autoScroll){const s=r.getSelectedBlocks(),l=Xe(s[0].block);this.autoScroll=new Qd({scrollElement:l,edge:{top:50,bottom:50}})}const o=this.editor.selection.range;if(t.shiftKey&&o.isSimple()){const s=o.anchor;this.editor.selection.setSelection(s,r.focus),this.startPos=r.start}else this.editor.selection.setSelection(r.anchor,r.focus),this.startPos=r.start;this.editor.selection.updateLastCaretRect(),e.autoScroll&&((i=this.autoScroll)==null||i.active())}});m(this,"handleMouseMove",t=>{if(!this.startPos||!this.mouseDownEvent||Math.abs(this.mouseDownEvent.x-t.x)<3&&Math.abs(this.mouseDownEvent.y-t.y)<3)return;const e=oh(this.editor,t.x,t.y);if(!e)return;const r=Ih(this.editor,this.startPos,e.end);if(!r)return;const{anchor:i,focus:o}=r;this.editor.selection.setSelection(i,o)});m(this,"handleMouseUp",t=>{var e;(e=this.autoScroll)==null||e.inactive(),this.startPos=null});this.editor=t,this.startPos=null,this.lastCaretRect=new DOMRect}isSelecting(){return this.startPos!==null}stopSelection(){this.startPos=null}handleDblClick(t){V_(this.editor)}handleTripleClick(t){K_(this.editor)}}function H_(n){return n.readonly||!n.isWritable()?!1:(n.undoManager.undo(),!0)}function j_(n){return n.readonly||!n.isWritable()?!1:(n.undoManager.redo(),!0)}const z5=I("delete-text");function G5(n,t,e,r){const i=r!=null?r:n.selection.range.start;i instanceof Ye||p(z5,!1,`invalid insert pos type: ${typeof i}`);const{blockId:o}=i,s=n.getBlockById(o);p(z5,rt(n,s),"block is not a text kind block");let{offset:l}=i;if(t==="backward"){if(l-e<0)return 0;if(!On(s,l-e)){const c=Qo(s,l);e=l-c}}else if(t==="forward"&&l+e>dt(n,s))return 0;return t==="backward"&&(l-=e),n.deleteTextFromBlock(s,l,e)}function W5(n,t){if(n.getBlockData(t).quoted){const e={quoted:null};return n.updateBlockData(t,e),!0}return!1}const z_=I("handle-backspace");function pp(n,t){if(!se(n,t))return;const e=it(t);Or(e)!==1&&n.deleteBlock(t)}function G_(n,t){if(!n.selection.range.isCollapsed()){n.clearSelectedContents();return}const e=n.selection.range.start,r=n.getBlockById(e.blockId);if(rt(n,r))if(e.offset===0){if(W5(n,r))return;const i=mr(r);if(i){if(!n.isBlockWritable(i))return;if(rt(n,i))n.mergeTextBlock(i,r,{focus:!0});else if(It(n,i)){pp(n,r);const o=xa(n,i);o?n.selection.selectBlock(o,dt(n,o)):n.selection.selectBlock(i,0,dt(n,i))}else pp(n,r),p(z_,pe(i),"prev block is not embed block"),n.selection.selectBlock(i,1)}else{const o=it(r);if(Fr(o)){const s=c3(n,o,{visibleOnly:!0});if(s){if(!n.isBlockWritable(s))return;pp(n,r),n.selection.selectBlock(s,dt(n,s))}}}}else G5(n,"backward",1,null),n.selection.updateLastCaretRect();else{const i=vt(r),o=it(r);n.insertTextBlock("",ct(o),i),n.deleteBlock(r)}}function W_(n,t){if(!n.selection.range.isCollapsed()){n.clearSelectedContents();return}const e=n.selection.range.start,r=n.getBlockById(e.blockId);if(rt(n,r))if(e.offset===dt(n,r)){const i=Jt(r);if(i){if(!n.isBlockWritable(i))return;rt(n,i)?n.mergeTextBlock(r,i,{focus:!0}):se(n,r)?n.deleteBlock(r,ve(n,i,0)):n.deleteBlock(i)}}else G5(n,"forward",1,null);else{const i=vt(r),o=it(r);n.insertTextBlock("",ct(o),i),n.deleteBlock(r)}}function q_(n){const{range:t}=n.selection,{start:e,end:r}=t,i=n.getBlockById(e.blockId),o=n.getBlockById(r.blockId);if(i!==o||!It(n,i))return!1;if(Vr(e))return!0;const s=Ea(n,i,e,r),l=an(n,i);return s.length===l.length}function X_(n,t){if(q_(n)){const s=n.getFocusedBlock(),l=vt(s),c=ct(it(s));n.insertTextBlock("",c,l+1);return}const e=n.getFocusedBlock(),{start:r,end:i}=n.selection.range,o=r.blockId===i.blockId&&pe(e);if(!n.selection.range.isCollapsed()&&!o&&n.clearSelectedContents(),rt(n,e)){if(se(n,e)&&W5(n,e))return;const s=n.selection.range.start,l=n.breakTextBlock(e,s.offset,{copyBlockAttributes:!0});s.offset!==0?n.selection.selectBlock(l,0):n.selection.scrollIntoView()}else{const s=n.insertTextBlock();n.selection.selectBlock(s,0)}}function Y_(n,t){const e=n.selection.range.getSelectedBlocks()[0],{block:r}=e;if(!rt(n,r))return!1;const i=e.end;return n.insertBoxToBlock(r,i.offset,{type:"br",id:et(),box:!0,created:Date.now()}),!0}function Cp(n,t,e,r){if(e.type==="embed"){const l=e.embedData.src;if(l&&typeof l=="string")for(const c of l.split("|"))r.add(c);return}const i=e.text;i&&i.forEach(s=>{if(s.attributes&&s.attributes.src&&typeof s.attributes.src=="string")if(to(s)){const l=n.editorBoxes.getBoxClass(s.attributes.type);if(l.getResources){const c=l.getResources(n,s.attributes);c?c.forEach(d=>{r.add(d)}):r.add(s.attributes.src)}else r.add(s.attributes.src)}else r.add(s.attributes.src)});const o=e.children;o&&o.forEach(s=>{t.blocks[s].forEach(c=>{Cp(n,t,c,r)})})}function Q_(n,t){const e=new Set;return t.blocks.root.forEach(i=>{const o=n.editorBlocks.getBlockClass(i.type);if(o.getResources){const s=o.getResources(n,i);s?s.forEach(l=>{e.add(l)}):Cp(n,t,i,e)}else Cp(n,t,i,e)}),Array.from(e)}function ku(n,t){return ie.isFirefox?`<!doctype html><html><head><meta charset="utf8" /></head><body><canvas data-editor-doc="${hi(JSON.stringify(t))}" id="ones-editor-doc">${n}</body></html>`:`<!doctype html><html><head><meta charset="utf8" />${`<meta charset="utf-8"><ones-editor-doc data-source="ones-editor-doc::${hi(JSON.stringify(t))}::ones-editor-doc" />`}</head><body>${n}</body></html>`}function Ru(n,t){var o,s,l;const e=(l=(s=(o=n.doc).getServerMeta)==null?void 0:s.call(o))!=null?l:{},r=Q_(n,t),i={};r.forEach(c=>{const d=n.doc.buildResourceUrl(c,{withToken:!0});i[c]=d}),t.meta={...e,resources:i}}function J_(n,t,e){if(t.preventDefault(),t.stopPropagation(),!t.clipboardData)return;let r=Ia(n);const i=e==null?void 0:e(n,t,r);if(i===!0)return;typeof i=="object"&&i!==null&&(r=i),Ru(n,r);const o=Au(n,r),s=Zo(n,r),l=ku(o,r);t.clipboardData.setData("text/html",l),t.clipboardData.setData("text/plain",s),t.clipboardData.setData("text/x-ones-editor-doc",JSON.stringify(r))}function Uh(n,t){Ru(n,t);const e=Au(n,t),r=ku(e,t),i=Zo(n,t),o=new Blob([r],{type:"text/html"});tu([{type:"text/plain",data:new Blob([i],{type:"text/plain"})},{type:"text/html",data:o}])}function Z_(n,t){if(n.selection.range.isCollapsed())return;let e=Ia(n);const r=t==null?void 0:t(n,new ClipboardEvent("mock-event"),e);r!==!0&&(typeof r=="object"&&r!==null&&(e=r),Uh(n,e))}async function Ep(n,t){if(!window.isSecureContext)throw new Error("Can't copy block in insecure context.");const e=gp(n,t);Uh(n,e)}const tM=I("input-handler-actions");function q5(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(X_(n),!0))}function X5(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(W_(n),!0))}function Y5(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(G_(n),!0))}function Q5(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(Y_(n),!0))}function J5(n){return n.readonly||!n.isWritable()||!window.isSecureContext?!1:(navigator.clipboard.readText().then(t=>{n.input.handlePasteText(t,{toPlainText:!0})}).catch(t=>{tM.error(t)}),!0)}function Z5(n){return n.selection.range.getSelectedBlocks().every(e=>{const r=e.block,i=it(r);if(qt(i))return!1;const o=Z(i);return o&&Dt(o)==="code"})}function t2(n,t){const e=n.selection.range.getSelectedBlocks(),r=it(e[0].block),i=Z(r);return i?`\`\`\`${n.getBlockData(i).language}
|
|
@@ -610,7 +610,7 @@ ${t}
|
|
|
610
610
|
</clipPath>
|
|
611
611
|
</defs>
|
|
612
612
|
</svg>
|
|
613
|
-
`,IO=Object.freeze(Object.defineProperty({__proto__:null,ClearIcon:XT,CloseIcon:qh,PrevIcon:fT,NextIcon:dT,MoreIcon:zp,TextColorIcon:Gp,ArrowDownIcon:Xh,ArrowUpIcon:mO,ArrowLeftIcon:gO,ArrowRightIcon:Wp,DeleteRowIcon:hT,DeleteColIcon:mT,MergeCellIcon:gT,SplitCellIcon:pT,DeleteTableIcon:CT,Heading1Icon:Yh,Heading2Icon:Qh,Heading3Icon:Jh,Heading4Icon:Zh,Heading5Icon:t0,Heading6Icon:e0,Heading7Icon:n0,Heading8Icon:r0,HeadingNIcon:pO,OrderedListIcon:ET,UnorderedListIcon:xT,CheckListIcon:AT,BlockquoteIcon:bT,AlignCenterIcon:o0,AlignLeftIcon:Pa,AlignRightIcon:i0,ImageIcon:vT,ImageMenuIcon:BT,ImageErrorIcon:Xp,ImageEmptyIcon:yT,LinkIcon:Zp,LinkOffIcon:kT,WarningIcon:qp,PasteSpecialIcon:TT,LaunchIcon:Yp,CodeIcon:KT,AudioIcon:OT,GraphIcon:CO,VideoIcon:NT,FileIcon:EO,MathIcon:AO,MathMenuIcon:RT,TableIcon:bO,TableMenuIcon:wT,BilibiliIcon:LT,YoukuIcon:IT,ModaoIcon:_T,FigmaIcon:DT,EditIcon:s0,CommentIcon:ul,RefreshIcon:ST,HelpIcon:Qp,CheckMarkIcon:Jp,TextIcon:Fa,RightArrowIcon:xO,TencentVideoIcon:MT,WebPageIcon:UT,UmlIcon:PT,DividingLineIcon:FT,HeadingH1Icon:vO,HeadingH2Icon:BO,HeadingH3Icon:TO,HeadingH4Icon:yO,HeadingH5Icon:kO,HeadingH6Icon:RO,HeadingH7Icon:wO,HeadingH8Icon:SO,CheckboxIcon:tC,QuoteIcon:eC,LinkHrefIcon:LO,OrderedIcon:rC,UnorderedIcon:nC,CopyIcon:VT,CutIcon:$T,DeleteIcon:HT,LockBlockIcon:jT,UnLockBlockIcon:zT,InsertBeforeIcon:GT,InsertAfterIcon:WT,MentionIcon:qT,CircleAddIcon:YT,LoadingIcon:QT,DragIcon:iC,UmlBrandIcon:l0,OnesLoadingIcon:JT,BoldIcon:ZT,ItalicIcon:ty,UnderlineIcon:ey,LineThroughIcon:ny,SubscriptIcon:iy,SuperscriptIcon:oy,InlineCodeIcon:ry,ToMindMapIcon:sy,FitIcon:ly,FullScreenIcon:oC,ExitFullScreenIcon:ay,CaretDownIcon:cy,StatusIcon:uy},Symbol.toStringTag,{value:"Module"}));function fy(){const n=v("span",["editor-loading-icon"],null);return n.innerHTML=JT,n}const Mlt="";function DO(n,t){const e=v("button",["editor-checkbox-wrapper"],null);e.setAttribute("data-button-id",n),t!=null&&t.includes("checked")&&z(e,"checked"),t!=null&&t.includes("disabled")&&(e.disabled=!0);const r=v("span",["editor-checkbox"],e);return v("span",["editor-checkbox-inner"],r),e}const Ult="",Ka=I("ui-command-bar-base"),_O={itemElementTag:"div",tippyArrow:!1},wx=class extends ye.TypedEmitter{constructor(e,r,i){var o,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=>{var r,i;if(!!this.isVisible&&!e.isComposing&&!pa(e.target)){if(this.subBar){this.subBar.handleDocumentKeydown(e);return}if(this.items.length!==0){if(e.key==="Escape"){if((i=(r=this.options).beforeClose)!=null&&i.call(r))return;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 s=this.items[o],l=this.getItemElementById(s.id);l&&this.emit("click",this,s,l)}}}});m(this,"handleDocumentMouseDown",e=>{var r,i;if(e.target instanceof Element){if((i=(r=this.options).beforeClose)!=null&&i.call(r,e))return;if(!this.isInCommandBar(e.target)){const o=this.listeners("closing");for(let s=0;s<o.length;s++)if(o[s](this,e)===!1)return;this.close("clickBackground")}}});m(this,"handleHidden",()=>{this.closeReason!=="fromHover"&&this.emit("close",this),this.close(null),Hg(this.id)});m(this,"handleShow",()=>{this.popper&&(this.popper.setAttribute("data-command-bar-id",this.id),this.options.classes&&z(this.popper,...this.options.classes),this.options.refuseOverflow&&this.popper.classList.add("reference-hidden")),this.emit("show",this),this.options.disablePageScroll&&$g(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 r=this.getParentCommandItemElement(e.target);if(!r)return;const i=this.getItemElementId(r),o=this.getItemById(i);if(this.selectItem(i),o.manualShowChildren)return;const s=o.childrenMenuId||"";this.showSubCommandBar(s)});m(this,"handleItemMouseLeave",e=>{var i,o;const r=this.getParentCommandItemElement(e.target);!r||((o=(i=this.subBar)==null?void 0:i.parentItem)==null?void 0:o.id)!==this.getItemElementId(r)&&(ot(r,"selected"),this.emit("selectionChange",this,""))});m(this,"handleItemClick",e=>{var s,l;const r=this.getParentCommandItemElement(e.target);if(!r)return;const i=this.getItemElementId(r),o=this.items.find(c=>c.id===i);if(!!o&&!(o.states&&o.states.indexOf("disabled")!==-1)){if(o.children&&o.children.length>0&&o.manualShowChildren){this.showSubCommandBar(o.childrenMenuId);return}if(!o.element&&(this.emit("click",this,o,r),this.options.autoClose)){if((l=(s=this.options).beforeClose)!=null&&l.call(s,e))return;this.close("clickItem")}}});m(this,"handleWheel",e=>{if(!this.options.disablePageScroll&&!document.querySelector(".editor-disable-scroll"))return;const r=e.target;if(!r||!(r instanceof Node))return;const i=r instanceof HTMLElement?r:r.parentElement;if(!i)return;const o=Xe(i);if(!re(this.content,o)){e.stopPropagation(),e.preventDefault();return}e.deltaY<0?o.scrollTop===0&&(e.stopPropagation(),e.preventDefault()):e.deltaY>0&&o.scrollTop+o.clientHeight>=o.scrollHeight&&(e.stopPropagation(),e.preventDefault())});this.id=(o=i==null?void 0:i.id)!=null?o:et(),this.options={..._O,...i},this.items=e,this.parentItem=(s=i==null?void 0:i.parentItem)!=null?s:null,this.closeable=r!=null?r: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,r){this.emit("click",this,e,r)}createPopperOptions(){var i,o;const e={modifiers:[]},r=this.options.overflowBoundary;return r&&((i=e==null?void 0:e.modifiers)==null||i.push({name:"flip",options:{boundary:r,fallbackPlacements:["top","bottom"]}})),this.options.padding&&((o=e==null?void 0:e.modifiers)==null||o.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 i;this.subBar&&e.findIndex(s=>{var l,c;return s.id===((c=(l=this.subBar)==null?void 0:l.parentItem)==null?void 0:c.id)})===-1&&((i=this.subBar)==null||i.destroy(),this.subBar=null),this.items=e;const r=this.createCommandBarContent(e);this.content.innerHTML="",Array.from(r.children).forEach(o=>{this.content.appendChild(o)})}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 r=e-1;for(;;){const i=this.items[r],o=i.type,l=!(i.states&&i.states.indexOf("disabled")!==-1);if(o!=="separator"&&o!=="section"&&l)return r;if(r-=1,r<0)return this.items.length-1}}getNextItemIndex(e){let r=e+1;for(;;){if(!this.items[r])return this.getNextItemIndex(-1);const i=this.items[r],o=i.type,l=!(i.states&&i.states.indexOf("disabled")!==-1);if(o!=="separator"&&o!=="section"&&l)return r;if(r+=1,r>this.items.length-1)return 0}}clearSelectedItem(){const e=this.getSelectedItem();if(!e)return;const r=this.getItemElementById(e.id);r&&ot(r,"selected")}selectItem(e){const r=this.getSelectedItem();if(r){if(r.id===e)return;const o=r.id,s=this.getItemElementById(o);s&&ot(s,"selected")}const i=this.getItemElementById(e);i?(z(i,"selected"),this.emit("selectionChange",this,i.getAttribute("data-id")||""),this.options.disableSelectedScroll||i.scrollIntoView({block:"nearest"})):this.emit("selectionChange",this,"")}showSubCommandBar(e){var s,l,c,d;const r=this.getSelectedItem();if(!r||!r.children&&((l=(s=this.subBar)==null?void 0:s.parentItem)==null?void 0:l.manualShowChildren))return;if(this.subBar){if(((c=this.subBar.parentItem)==null?void 0:c.id)===r.id){r.manualShowChildren&&this.subBar.close("switchItem");return}this.subBar.destroy(),this.subBar=null}if(!r.children)return;const i=this.getItemElementById(r.id);if(!i)return;const o=wx.createSubCommandBar(r,(d=this.closeable)!=null?d:this,e?{id:e}:{});this.subBar=o,this.subBar.on("click",(h,C,E)=>{this.emit("click",h,C,E)}),this.subBar.on("close",()=>{var h;(h=this.subBar)==null||h.destroy(),this.subBar=null,ot(i,"active")}),r.beforePopup&&r.beforePopup(o),this.subBar.manualShow(i,this.getSubBarOptions(r)),z(i,"active")}isInCommandBar(e){if(!e||!(e instanceof Node))return!1;const r=this.getCommandBarRoot();return r&&re(r,e)||re(this.content,e)?!0:this.subBar?this.subBar.isInCommandBar(e):!1}createCommandItem(e){var o,s,l,c;let r=(o=this.options.itemElementTag)!=null?o:"div";e.element&&(r="div");const i=v(r,["command-item"],null);return i.setAttribute("data-id",e.id),e.type==="separator"?i.classList.add("separator"):e.type==="section"?(i.classList.add("section","text"),e.element&&(typeof e.element=="function"?i.appendChild(e.element(e)):i.appendChild(e.element))):((s=e.states)!=null&&s.includes("selected")&&i.classList.add("selected"),(l=e.states)!=null&&l.includes("checked")&&i.classList.add("checked"),(c=e.states)!=null&&c.includes("disabled")&&i.classList.add("disabled"),i.onclick=this.handleItemClick,i.onmouseenter=this.handleItemMouseEnter,i.onmouseleave=this.handleItemMouseLeave,e.element?typeof e.element=="function"?i.appendChild(e.element(e)):i.appendChild(e.element):i.classList.add("standard")),this.initItemElement(e,i),i}getItemById(e){const r=this.items.find(i=>i.id===e);return p(Ka,r,`can not find command item for id: ${e}`),r}getSelectedItem(){const e=this.content.querySelector(":scope >.editor-command-bar >.command-item.selected");if(e){const r=this.getItemElementId(e),i=this.items.find(o=>o.id===r);return p(Ka,i,`can not find command item for id: ${r}`),i}return null}getItemElementId(e){const r=e.getAttribute("data-id");return p(Ka,r,"no data-id attribute"),r}getItemElementById(e){const r=this.content.querySelector(`:scope >.editor-command-bar > .command-item[data-id="${e}"]`);return p(Ka,r,`no exists command item, id=${e}`),r}getParentCommandItemElement(e){if(!e||!(e instanceof Element))return null;if(wt(e,"command-item"))return e;const r=e.closest(".command-item");return r||null}createCommandBarContent(e){this.content&&this.content.removeEventListener("wheel",this.handleWheel);const r=v("div",["editor-command-bar-root"],null);if(this.options.header){const o=v("div",["editor-command-bar-header"],null);if(this.options.header instanceof Function){const s=this.options.header();s&&o.appendChild(s)}else o.appendChild(this.options.header);this.header=o,this.header&&r.appendChild(this.header)}const i=v("div",["editor-command-bar"],r);if(e.forEach(o=>{var l;const s=this.createCommandItem(o);i.appendChild(s),o.element&&o.setCloseable&&o.setCloseable((l=this.closeable)!=null?l:this)}),this.options.footer){const o=v("div",["menu-item","editor-command-bar","footer"],null);if(this.options.footer instanceof Function){const s=this.options.footer();s&&o.appendChild(s)}else o.appendChild(this.options.footer);this.footer=o,this.footer&&r.appendChild(this.footer)}return(this.options.header||this.options.footer)&&z(r,"scrollable-bar"),this.initCommandBarElement(i),r.addEventListener("wheel",this.handleWheel,{passive:!1}),r}getSubBarOptions(e){var r;return{placement:(r=e.childrenPlacement)!=null?r:"right-start",offset:e.childrenOffset,arrow:e.childArrow}}static registerManualCommandBar(e,r){this.commandBarCreators.set(e,r)}static createSubCommandBar(e,r,i){var l;p(Ka,e.children&&e.children.length>0,"no item children");const o=(l=e.childrenType)!=null?l:"menu",s=this.commandBarCreators.get(o);return p(Ka,s,`no creator for command type: ${o}`),s(e,r,i)}static hasExistsCommandBar(){return!!document.querySelector("[data-command-bar-id]")}};let fl=wx;m(fl,"commandBarCreators",new Map),I("ui-command-bar");class a0 extends fl{constructor(){super(...arguments);m(this,"tippyInstance",null)}manualShow(e,r){var i,o,s;if(!this.isVisible){if(this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.tippyInstance=Z6.default(e,{interactive:!0,content:this.content,trigger:"manual",triggerTarget:null,hideOnClick:!1,placement:(i=r==null?void 0:r.placement)!=null?i:"bottom-start",maxWidth:650,arrow:(o=r==null?void 0:r.arrow)!=null?o:this.options.tippyArrow,appendTo:document.body,onShow:this.handleShow,onHidden:this.handleHidden,theme:r==null?void 0:r.theme,getReferenceClientRect:r==null?void 0:r.getReferenceClientRect,offset:(s=r==null?void 0:r.offset)!=null?s:[0,0],popperOptions:this.createPopperOptions()}),r!=null&&r.point){const{x:l,y:c}=r.point;this.tippyInstance.setProps({getReferenceClientRect:()=>new DOMRect(l,c,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 r;super.close(e),this.isVisible&&((r=this.tippyInstance)==null||r.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,r;return(r=(e=this.tippyInstance)==null?void 0:e.state.isVisible)!=null?r:!1}get popper(){return this.content.closest("[data-tippy-root]")}}const dy=I("ui-base");class Va extends a0{constructor(t,e){var o;const r=(o=e==null?void 0:e.id)!=null?o:`popup-${et()}`,i=[{id:r,name:"",element:t}];super(i,void 0,{disablePageScroll:!0,id:r,beforeClose:e==null?void 0:e.beforeClose})}initCommandBarElement(t){z(t,"popper")}initItemElement(t,e){}get popupContent(){const t=this.items[0];p(dy,t,"no dialog item");const e=typeof t.element=="function"?t.element(t):t.element;return p(dy,e,"no item element"),e}}const fo=I("filterable-list");function hy(n){var e,r;const t=v("div",["list-item"],null);return t.setAttribute("data-id",n.id),t.appendChild(v("div",["list-item-text"],null,n.name)),(e=n.states)!=null&&e.includes("selected")&&(z(t,"selected"),Hs(Jp,["list-item-selected-icon"],t)),(r=n.states)!=null&&r.includes("disabled")&&z(t,"disabled"),t}function my(n){const t=v("div",["list-root"],null);return n.forEach(e=>{t.appendChild(hy(e))}),n.length||t.appendChild(hy({id:"placeholder",states:["disabled"],name:D.t("search.emptyTips")})),t}function gy(n,t){return n.map(e=>({...e,states:t===e.id?["selected"]:[]}))}function MO(n,t){const e=v("div",["filterable-list"],null),r=v("div",["filter"],e),i=v("div",["filter-container"],r),o=v("input",["filter-input"],i);t&&t.placeholder&&(o.placeholder=t.placeholder);const s=v("div",["list"],e),l=my(gy(n,t==null?void 0:t.initialSelectedId));return s.appendChild(l),e}function py(n,t,e){const r=n.querySelector(".list");p(fo,r,"no list root");const i=my(gy(t,e)),o=r.querySelector(".list-root");if(p(fo,o,"no exists menu"),Zc(o,i),e){const s=r.querySelector(".list-item.selected");s&&(p(fo,s,"no selected menu item"),s.scrollIntoView({block:"nearest"}))}}class UO{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");p(fo,t,"no input");const e=t.value.toLocaleLowerCase();this.setFilter(e)});m(this,"handleClick",t=>{this.processClick(t)});var r;this.items=t,this.options=e,this.root=MO(t,e),this.bindEvents(),this.selectedId=(r=e==null?void 0:e.initialSelectedId)!=null?r:"",this.visibleItems=t}bindEvents(){const t=this.root.querySelector(".filter-input");p(fo,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");p(fo,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,py(this.root,this.visibleItems,t)}focus(){const t=this.root.querySelector(".filter-input");p(fo,t,"no input"),t.focus()}moveSelectedItemIntoView(){const t=this.root.querySelector(".list-item.selected");t&&(p(fo,t,"no selected menu item"),t.scrollIntoView({block:"nearest"}))}reset(){this.setFilter("");const t=this.root.querySelector(".filter-input");p(fo,t,"no input"),t.value=""}setFilter(t){this.filter!==t&&(this.filter=t,this.visibleItems=this.items.filter(e=>e.name.toLocaleLowerCase().includes(t)),py(this.root,this.visibleItems,this.selectedId))}processClick(t){var s,l;const e=t.target;if(!(e instanceof HTMLElement))return;const r=e.closest(".list-item");if(!r)return;const i=(s=r.getAttribute("data-id"))!=null?s:"",o=(l=this.visibleItems.find(c=>c.id===i))!=null?l:null;this.onSelected&&this.onSelected(this,o)}processKeyDown(t){var e;if(t.key==="ArrowUp"){let r=this.getSelectedIndex();r===-1?r=this.visibleItems.length-1:r>0&&(r-=1);let i="";r!==-1&&(i=this.visibleItems[r].id),this.setSelectedId(i);return}if(t.key==="ArrowDown"){let r=this.getSelectedIndex();r===-1?r=0:r<this.visibleItems.length-1&&(r+=1);let i="";r!==-1&&(i=this.visibleItems[r].id),this.setSelectedId(i);return}if(t.key==="Enter"){const r=(e=this.visibleItems.find(i=>i.id===this.selectedId))!=null?e:null;this.onSelected&&this.onSelected(this,r)}}}class OO extends UO{constructor(e,r,i){super(e,i);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 Va(this.root)}destroy(){super.destroy(),this.onShow=null,this.onHide=null}show(e){this.reset(),this.popup.manualShow(e,{theme:"dropdown-list"}),this.focus(),this.moveSelectedItemIntoView()}processKeyDown(e){super.processKeyDown(e),(e.key==="Esc"||e.key==="Enter")&&this.popup.close("cancelBar")}processClick(e){super.processClick(e);const r=e.target;!(r instanceof HTMLElement)||!r.closest(".list-item")||this.popup.close("clickItem")}}const Olt="",Nlt="";function NO(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 PO(n,t){var e,r;if(z(t,"menu-item"),!n.element){if(n.type==="section"){const i=v("div",["section-name"],null,n.name);t.appendChild(i)}else if(n.type!=="separator"){if(n.icon){const o=v("div",["menu-item-icon"],null);n.icon&&(o.innerHTML=n.icon),t.appendChild(o)}const i=v("div",["menu-item-name","text"],null);if(v("span",[],i,n.name),n.ellipsisTooltip&&(t.setAttribute("data-editor-tooltip-allow-markdown","true"),t.setAttribute("data-editor-tooltip-offset-y","25"),t.setAttribute("data-editor-tooltip-placement","right"),t.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&&(t.setAttribute("data-editor-tooltip-placement","right"),t.setAttribute("data-editor-tooltip-common",n.disableReason)),t.appendChild(i),n.subText&&v("div",["item-subtext","text"],t,n.subText),n.children&&!n.element){const o=v("div",["menu-item-sub-indicator"],null);o.innerHTML=Wp,t.appendChild(o)}if((r=n.states)!=null&&r.includes("checked")){const o=v("div",["menu-item-checked-icon"],null);o.innerHTML=Jp,t.appendChild(o)}}}}class ls extends a0{constructor(t,e,r){super(t,e,{autoClose:!0,disablePageScroll:!0,beforeClose:r==null?void 0:r.beforeClose,...r})}manualShow(t,e){const r={theme:"menu",...e};super.manualShow(t,r)}initCommandBarElement(t){z(t,"menu")}initItemElement(t,e){PO(t,e)}}function FO(n,t,e){var r;return new ls((r=n.children)!=null?r:[],t,{...e,parentItem:n})}function Cy(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 r=t;if(!n.element)if(n.icon){const i=v("span",["toolbar-item-icon-container"],r);n.icon.trim().startsWith("<")?i.innerHTML=n.icon:i.innerText=n.icon}else{const i=v("span",["toolbar-item-name-container"],r);i.innerText=n.name}if(n.dropdown){t.setAttribute("data-dropdown","true");const i=v("span",["toolbar-item-dropdown-container"],r);i.innerHTML=Xh}n.states&&(n.states.indexOf("checked")!==-1&&z(r,"checked"),n.states.indexOf("disabled")!==-1&&(r.disabled=!0))}class ju extends a0{constructor(t,e,r){super(t,e,{itemElementTag:"button",tippyArrow:!1,...r})}getSubBarOptions(t){var i,o;const e=()=>{const s=this.getItemElementById(t.id),c=this.content.getBoundingClientRect(),d=s.getBoundingClientRect();return new DOMRect(d.left,c.top,d.width,c.height)};return{placement:(i=t.childrenPlacement)!=null?i:"top",getReferenceClientRect:e,offset:(o=t.childrenOffset)!=null?o:[0,4]}}manualShow(t,e){const r={theme:"toolbar",...e};super.manualShow(t,r)}initCommandBarElement(t){z(t,"toolbar")}initItemElement(t,e){Cy(t,e,this.options)}}function KO(n,t,e){var r;return new ju((r=n.children)!=null?r:[],t,{...e,parentItem:n})}class VO extends fl{constructor(t,e,r){super(e,void 0,r),t.appendChild(this.content),document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}initCommandBarElement(t){z(t,"toolbar","fixed")}initItemElement(t,e){Cy(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 Plt="";fl.registerManualCommandBar("menu",FO),fl.registerManualCommandBar("toolbar",KO);const Flt="",Ey=I("ui-base");class zu extends a0{constructor(e,r){super(zu.getCommandItems(e,r),void 0,{disablePageScroll:!0,...r});m(this,"handleDocumentMouseDown",e=>{})}initCommandBarElement(e){z(e,"dialog","manual")}initItemElement(e,r){}show(e,r){this.manualShow(e,{...r,theme:"light"})}get dialogContent(){const e=this.items[0];p(Ey,e,"no dialog item");const r=e.element;return p(Ey,r,"no item element"),r}static getCommandItems(e,r){var s;return[{id:(s=r==null?void 0:r.id)!=null?s:`manual-dialog-${et()}`,name:"",element:e}]}}const Klt="",$O=I("ui-base");class xy{constructor(t){m(this,"menu");m(this,"currentText","");m(this,"handleSearchText");m(this,"handleClick",ke.default((t,e)=>{this.options.onClickItem(this,e)},300,{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 ls([],void 0,{id:t.id,header:t.header,footer:t.footer,disableSelectedScroll:t.disableSelectedScroll}),this.menu.addListener("click",this.handleClick),this.menu.addListener("close",this.handleClose),this.menu.addListener("show",this.handleShow),this.options.wait?this.handleSearchText=ke.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(r=>r.type!=="section"&&r.type!=="separator");e&&this.menu.selectItem(e.id)}}async popup(t,e){var i,o;if(!(e!=null&&e.noEvent)&&((o=(i=this.options).onShow)==null?void 0:o.call(i,this))===!1)return;this.menu.manualShow(t),this.options.placeholder&&this.showPlaceholder();const r=await this.options.queryItems(this,"");this.highlightText("",r),this.setItems(r)}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||D.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()}isInCommandBar(t){return this.menu.isInCommandBar(t)}async handleSearchTextPure(t){this.currentText=t;const e="auto-suggest";try{await Mr.lock(e),this.showLoading();const r=this.currentText,i=await this.options.queryItems(this,t);if(this.currentText===r&&(this.currentText=""),i.length===0){this.showNoResultMessage(t);return}this.setItems(i),this.options.highlight&&this.highlightText(r.replace(/^\s+|\s+$/g,""),i)}finally{Mr.release(e)}}highlightText(t,e){$O.debug(`highlight menu text: ${t}`);const r=this.menu.content,i=(s,l)=>{if(!l)return s;let c="";const d=l.length,h=l.toLocaleLowerCase();let C=0;for(C=0;C<=s.length-d;C){let E=s.substring(C,C+d);if(E.toLocaleLowerCase()===h){C+=d;const x=s.charAt(C);let B=!1;E.endsWith(" ")&&(B=!0,E=E.trimEnd()),c+=`<span class="highlight">${E}${x===" "||B?" ":""}</span>`}else c+=s.charAt(C),C++}return C<s.length&&(c+=s.substring(C)),c},o=s=>{if(wt(s,"text")){const l=e==null?void 0:e.find(h=>h.id===s.getAttribute("data-id"));if(l&&l.element)return;const c=s.textContent;if(!c)return;const d=i(c,t);s.innerHTML=d;return}Array.from(s.children).forEach(o)};o(r)}}class sC{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 r,i;(i=(r=this.options)==null?void 0:r.onClickItem)==null||i.call(r,e)});m(this,"handleInput",()=>{this.autoSuggest.handleSearchText(this.input.value),this.updatePlaceholder()});m(this,"handleClear",t=>{var e,r;this.clear(),this.autoSuggest.handleSearchText(""),t.preventDefault(),t.stopPropagation(),(r=(e=this.options)==null?void 0:e.onClear)==null||r.call(e)});m(this,"handleQueryItems",async(t,e)=>this.items.filter(i=>{var o;return(o=this.options)!=null&&o.filter?this.options.filter(i,e):!0}));m(this,"handleShow",()=>{z(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 c,d,h,C,E;this.options=e,this.labels=(d=(c=this.options)==null?void 0:c.labels)!=null?d:[];const{root:r,input:i,text:o,clearIcon:s,dropdownIcon:l}=sC.createDropdown(t,this.labels);this.root=r,this.input=i,this.text=o,this.clearIcon=s,this.dropdownIcon=l,this.autoSuggest=new xy({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,disableSelectedScroll:e==null?void 0:e.disableSelectedScroll}),this.items=(E=(C=this.options)==null?void 0:C.items)!=null?E:[],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 r=v("div",["editor-dropdown","empty"],t),i=v("input",["dropdown-input"],r),o=v("div",["dropdown-text"],r),s=v("div",["dropdown-labels"],r);for(let d=0;d<e.length;d+=1){const h=e[d];v("span",["dropdown-label"],s,h)}const l=v("div",["dropdown-clear-icon"],r);l.innerHTML=XT;const c=v("div",["dropdown-icon"],r);return c.innerHTML=Xh,{root:r,input:i,text:o,clearIcon:l,dropdownIcon:c}}updateLabels(){const t=this.root.querySelector(".dropdown-labels");if(t){t.innerHTML="";for(let e=0;e<this.labels.length;e+=1){const r=this.labels[e];v("span",["dropdown-label"],t,r)}}}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),z(this.root,"empty")}else ot(this.root,"empty")}}const HO=[-1,6,0,1,2,3,4,5],jO=[-1,6,0,1,2,3,4,5,14,13,7,8,9,10,11,12],Ay=I("color-palette");function by(n,t,e,r){p(Ay,n>0,"no color in palette");const i=t||1;p(Ay,i>0,`invalid palette rows: ${i}`);const o=n/i,s=v("div",["palette-container",r],null);for(let l=0;l<i;l++){const c=v("div",["palette-container-row"],s);for(let d=0;d<o;d++){const h=e(l*o+d);c.appendChild(h)}}return s}function zO(n){const t=v("button",["color-button"],null),e=HO[n];return t.setAttribute("data-color-index",`${e}`),t.innerHTML=Gp,t}function GO(n){const t=v("button",["background-color-button"],null),e=jO[n];return t.setAttribute("data-color-index",`${e}`),t}function WO(){const n=v("div",["clear-button-container"],null),t=v("button",["clear-button"],n);return t.innerText=D.t("colorPalette.reset"),n}function qO(n){const t=v("div",["color-palette"],null);return n.color!==!1&&(v("div",["bar-desc"],t,D.t("colorPalette.colorDesc")),t.appendChild(by(8,1,zO,"color"))),n.backgroundColor!==!1&&(v("div",["bar-desc"],t,D.t("colorPalette.backgroundDesc")),t.appendChild(by(16,2,GO,"background-color"))),n.clearColorButton!==!1&&t.appendChild(WO()),t}function XO(n,t,e){const r=t==="color"?"color":"background-color",i=n.querySelector(`.${r} button.selected`);i&&ot(i,"selected"),e===null&&(e=-1);const o=n.querySelector(`.${r} button[data-color-index="${e}"]`);o&&z(o,"selected")}const Vlt="",YO={};class QO extends ye.TypedEmitter{constructor(e=YO){super();m(this,"root");m(this,"handleClick",e=>{const r=e.target;if(!r||!(r instanceof Element))return;const i=r.closest("button");if(!i)return;if(wt(i,"clear-button")){this.setColor("backgroundColor",null),this.setColor("color",null),this.emit("onClick","clearColor",0);return}const o=i.getAttribute("data-color-index");if(!o)return;const s=Number.parseInt(o,10);Number.isNaN(s)||(wt(i,"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=qO(e),this.root.addEventListener("click",this.handleClick)}destroy(){this.removeAllListeners(),this.root.removeEventListener("click",this.handleClick)}setColor(e,r){XO(this.root,e,r)}}class vy{constructor(t,e){m(this,"name","Color Palette");m(this,"element");m(this,"palette");m(this,"closeable",null);this.id=t,this.palette=new QO(e),this.element=this.palette.root}setCloseable(t){this.closeable=t}destroy(){this.palette.destroy(),this.closeable=null}}function JO(){const n=v("button",["color-button"],null);return n.innerHTML=Gp,n}function lC(n,t){const[e,r]=t;e===null?n.removeAttribute("data-color"):n.setAttribute("data-color",`${e}`),r===null?n.removeAttribute("data-background-color"):n.setAttribute("data-background-color",`${r}`)}class By extends ye.TypedEmitter{constructor(e){super();m(this,"id","text-color-item");m(this,"name",D.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,r)=>{this.emit("onClick",e,r)});m(this,"setLatestColors",(e,r)=>{e==="color"||e==="backgroundColor"?e==="color"?this.latestColors[0]=r:this.latestColors[1]=r:this.latestColors=[null,null],lC(this.element,this.latestColors)});m(this,"beforePopup",()=>{this.updatePaletteColor(this.latestColors),this.emit("beforePopup")});this.editor=e,this.colorPaletteItem=new vy("text-color-palette-item"),this.colorPaletteItem.palette.addListener("onClick",this.handlePaletteClick),this.children.push(this.colorPaletteItem),this.element=JO()}destroy(){this.colorPaletteItem.destroy()}updatePaletteColor(e){this.colorPaletteItem.palette.setColor("color",e[0]),this.colorPaletteItem.palette.setColor("backgroundColor",e[1]),this.latestColors=e,lC(this.element,this.latestColors)}updateButtonColor(e){this.latestColors=e,lC(this.element,this.latestColors)}}const $lt="";function c0(n,t){const e=v("div",["editor-input-wrap"],n);if(t!=null&&t.className&&z(e,t==null?void 0:t.className),t.label){const s=v("div",["editor-input-label"],e);v("span",[],s,t.label),t.required&&z(s,"required")}const r=v("div",["editor-input-container"],e),i=v("input",["editor-input"],null);if(t.placeholder&&(i.placeholder=t.placeholder),t.defaultValue&&(i.value=t.defaultValue),t.maxLength&&(i.maxLength=t.maxLength),t.maxLength){const s=v("div",["editor-input-suffix"],r);v("span",[],s,`${i.value.length} / ${t.maxLength}`),i.addEventListener("input",l=>{const c=l.target;s.innerText=`${c.value.length} / ${t.maxLength}`})}r.appendChild(i);const o=v("div",["editor-input-error"],e);return i.addEventListener("input",s=>{var l;(l=t.onChange)==null||l.call(t,s),ot(e,"error")}),Hd(i,(s,l)=>{var c;(c=t.onKeyDown)==null||c.call(t,s,l)}),{getField:()=>i,getInputValue:()=>i.value,setFieldError:s=>{z(e,"error"),o.innerText=s},focus:()=>{setTimeout(()=>{i.focus()})}}}function aC(n){const t=document.getSelection();if(!t)return!0;const e=t.focusNode;if(!e)return!0;const r=t.focusOffset,i=e.childNodes[r];if(!i)return!0;if(i instanceof HTMLElement){const o=i.tagName.toLowerCase();if(i===n.input.inputElement)return!0;if(o==="input"||o==="textarea")return!1}return!0}class ZO extends xy{constructor(e,r){super(r);m(this,"handleClose",()=>{var e,r;aC(this.editor)&&this.editor.focus(),(r=(e=this.options).onClose)==null||r.call(e)});this.editor=e,this.editorOptions=r}async popupInEditor(e,r,i){var d,h;if(((h=(d=this.editorOptions).onShow)==null?void 0:h.call(d,this,e,r,i))===!1)return;this.options.showLoading&&this.showLoading();const o=this.editor.getBlockByIndex(e,r);if(!re(this.editor.rootContainer,o)||dt(this.editor,o)<i)return;const s=Yi(this.editor,o,ve(this.editor,o,i));if(s.length===0)return;const l=s[0],c=Zi(this.editor,o,"editor-auto-suggest-menu",l);super.popup(c,{noEvent:!0})}}const cC=I("auto-suggest-menu");class uC{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 r,i;if(!((r=this.menu)!=null&&r.isVisible))return;const e=t.selection.range.start;if(e.isSimple()&&e.blockId===((i=this.anchor)==null?void 0:i.blockId)&&e.offset>=this.anchor.offset){const o=t.getBlockById(e.blockId);if(de(Mn(yn(t,o),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:r,offset:i}=e,o=t.getBlockById(r),s=de(xh(t,o,i));if(p(cC,this.anchor,"no anchor"),!s.startsWith(this.anchor.leftText))return!1;const l=this.anchor.offset-this.anchor.trigger.length,c=i-l;return t.selection.selectBlock(o,l),c&&(t.deleteTextFromBlock(o,l,c),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,r,i)=>{var o;if((o=this.options)!=null&&o.onShow)return this.options.onShow(this,e,r,i)});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 i,o;return(o=(i=this.options).renderMenuItem)==null?void 0:o.call(i,this,e)});m(this,"hasExistsMenuThemeCommandBar",()=>!!document.querySelector('div.tippy-box[data-theme="menu"]'));this.editor=t,this.options=e,this.menu=new ZO(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 r;return!((r=this.menu)!=null&&r.isVisible)||Pg(e.key)?!1:ev(e)&&!qs(e)?(setTimeout(()=>{this.resetItems()}),!1):Gd(e)?(this.menu.close(),!0):(this.menu.handleKeydown(e),!0)}popup(t,e,r,i){this.anchor={blockId:lt(t),offset:e,leftText:r,trigger:i};const o=ct(it(t)),s=vt(t);this.menu.popupInEditor(o,s,e)}handleAfterInsertText(t,e,r,i,o){var h,C;const s=t.selection.range.start;if(!s.isSimple())return!1;const l=t.getBlockByIndex(e,r);if(qi(l))return!1;const{blockId:c,offset:d}=s;if(lt(l)!==c)return!1;if((h=this.menu)!=null&&h.isVisible)this.resetItems();else if(this.options.trigger.indexOf(o)!==-1){if(i>0&&this.options.needSpaceBeforeTrigger&&(((C=t.getBlockData(l).text)==null?void 0:C.reduce((k,w)=>k+w.insert,""))||"")[i-1].trim().length!==0||this.hasExistsMenuThemeCommandBar())return!1;const E=de(xh(t,l,d));this.popup(l,d,E,o)}return!1}handleUpdateCompositionText(t,e,r,i,o){var d;const s=t.selection.range.start;if(!s.isSimple())return!1;const{blockId:l}=s,c=t.getBlockByIndex(e,r);return lt(c)!==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:r,offset:i}=e,o=t.getBlockById(r),s=de(xh(t,o,i));if(p(cC,this.anchor,"no anchor"),s.startsWith(this.anchor.leftText)){const c=s.substring(this.anchor.leftText.length);cC.debug(`search text: ${c}`),this.menu.handleSearchText(c)}}destroy(){var t;this.editor.input.removeHandler(this),this.editor.removeListener("selectionChanged",this.handleSelectionChanged),(t=this.menu)==null||t.destroy()}}function tN(){const n={};for(let t=1;t<=8;t++)n[`heading-${t}`]={shortcut:`/h${t}`};return n}const eN={"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"},...tN()};function kn(n){var t;return(t=eN[n])==null?void 0:t.shortcut}function nN(n){var t;return(t=n.subText)!=null?t:""}const yi=I("table-dom");function ki(n){return`${lt(n)}_scroll`}function ze(n){const t=n.querySelector("div[data-type=table-content] >table");return p(yi,t instanceof HTMLTableElement,"invalid table"),t}function Ri(n,t){const r=n.getCustom(ki(t)).contentElement.firstElementChild;p(yi,r instanceof HTMLElement,"invalid table content");let i=r.querySelector(":scope >div[data-type=table-tools]");return i||(i=v("div",[],r),i.setAttribute("data-type","table-tools"),n.domEvents.addEventListener(i,"dblclick",(o,s)=>s.stopPropagation()),n.domEvents.addEventListener(i,"click",(o,s)=>{s.detail===3&&s.stopPropagation()})),p(yi,i,"no table tools"),i}function rN(n,t){return n.findCustom(ki(t))?Ri(n,t):null}function Ty(n){const t=[];return Array.from(n.rows).forEach(e=>{t.push(...Array.from(e.cells))}),t}function Gu(n){const t=n.querySelector(":scope div[data-type=editor-container]");return p(yi,t,"no child container in cell"),t}function iN(n){const r=Ty(n).map(i=>{const o=Gu(i),s=ct(o),l=i.colSpan,c=i.rowSpan;return`${s}/${l}/${c}`}).join();return Md.default(r)}function Ge(n){return Dt(n)==="table"}function fC(n){const t=it(n);if(qt(t))return null;const e=Z(t);return p(yi,e,"no parent block"),Ge(e)?t:fC(e)}function ho(n){if(Ge(n))return n;const t=it(n);if(qt(t))return null;const e=Z(t);return p(yi,e,"no parent block"),Ge(e)?e:ho(e)}function oN(n,t){const e=n.querySelector("colgroup");p(yi,e,"no colgroup");const r=e.children[t];return p(yi,r,"no col"),p(yi,r instanceof HTMLTableColElement,`invalid col: ${r.tagName}`),r}function yy(n){try{return ze(n),!0}catch{return!1}}function sN(n){return oe(n).querySelector(":scope > .block-helper")}function ky(n){const t=Z(n.contentElement);p(yi,t,"no block");const e=sN(t);if(e){const o=Math.min(n.contentElement.offsetLeft+29,n.rootElement.scrollLeft),s=t.getBoundingClientRect().width;e.style.right=`${o+s+5}px`}}function lN(n){const t=n.getComponentOptions("table"),e=t==null?void 0:t.bigTableBoundary;if(!e)return!1;const r=n.rootContainer.querySelectorAll("div[data-type=table-content] >table");let i=!1;return r.forEach(o=>{o.getBoundingClientRect().width>e&&(i=!0)}),i}const Xr=I("doc-table-grid");class aN{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){p(Xr,t>=0&&t<this.cols(),`set cell, invalid col: ${t}`),this._cells[t]=e}getCell(t){p(Xr,t>=0&&t<this.cols(),`get cell, invalid col: ${t}`);const e=this._cells[t];return p(Xr,e,"get cell, no cell"),e}getCellAllowEmpty(t){return p(Xr,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 u0{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 aN(this.colCount));this.fillGrid()}get rowCount(){return this._data.rows}get colCount(){return this._data.cols}getNextEmptyCell(t,e){let r=t,i=e;for(;;){if(r+=1,r===this.colCount&&(r=0,i+=1),i>=this.rowCount)return null;if(this._rows[i].getCellAllowEmpty(r)===void 0)return{col:r,row:i}}}fillGrid(){const t=this._data.children;p(Xr,t,"no children");let e=0,r=0;t.forEach((i,o)=>{const s=this._data[`${i}_colSpan`]||1,l=this._data[`${i}_rowSpan`]||1;for(let d=0;d<l;d++)for(let h=0;h<s;h++)this._rows[r+d].setCell(e+h,{col:e,row:r,containerId:i,virtual:h!==0||d!==0,colSpan:s,rowSpan:l});const c=this.getNextEmptyCell(e,r);c?(e=c.col,r=c.row):p(Xr,o===t.length-1,`invalid table data, no next empty cell: ${JSON.stringify(this._data)}`)}),this._rows.forEach(i=>{i.forEach(o=>{p(Xr,o,"no cell"),p(Xr,o.containerId,"no containerId")})})}getCell(t){const{col:e,row:r}=t,i=this._rows[r];p(Xr,i,`get cell, no row: ${r}`);const o=i.getCell(e);return p(Xr,o,`get cell, no cell: ${e}`),o}getRow(t){const e=this._rows[t];return p(Xr,e,`get row, no row: ${t}`),e}forEach(t){this._rows.forEach(t)}}const f0=I("table-data");function cN(n){const t=n.firstElementChild;return p(f0,t,"no child element for cell"),p(f0,Xi(t),"cell first child is not a container"),p(f0,Fr(t),"cell first child is not a container"),t}function uN(n){const t=Z(n);p(f0,t,"no parent block for table");const e=[],r={};Array.from(n.rows).forEach(l=>{Array.from(l.cells).forEach(c=>{const d=cN(c),h=ct(d);e.push(h),(c.colSpan>1||c.rowSpan>1)&&(r[`${h}_colSpan`]=c.colSpan,r[`${h}_rowSpan`]=c.rowSpan)})});const i=n.rows.length,o=Array.from(n.rows[0].cells).map(l=>l.colSpan).reduce((l,c)=>l+c,0);return{id:lt(t),type:Dt(t),rows:i,cols:o,children:e,colsWidth:Array(o).fill(100),...r}}function dl(n){return new u0(n)}function fN(n){return dl(uN(n))}const Ze=I("table-grid"),dN=60;class hN{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 p(Ze,e,"no parent cell for child container"),e}get container(){const t=this.table.querySelectorAll(`[data-container-id=${this.containerId}]`);p(Ze,t.length===1,"containers !== 1"),p(Ze,Xi(t[0]),"not a container");const e=t[0];return p(Ze,Fr(e),"not a child container"),e}}class mN{constructor(t,e){m(this,"_cells",[]);e.forEach(r=>{this._cells.push(new hN(t,r))})}get cells(){return this._cells}getCell(t){return p(Ze,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 Sx=class{constructor(t){m(this,"_rows",[]);this.table=t,fN(t).forEach(i=>{this._rows.push(new mN(t,i))});const r=this.colCount;this._rows.forEach(i=>{p(Ze,i.cells.length===r,"row.cells.length !== colCount")})}get rowCount(){return this._rows.length}get colCount(){return this._rows.length===0?0:(p(Ze,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 p(Ze,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){p(Ze,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount,r=[];for(let i=0;i<e;i++){const o=this.getCell({row:i,col:t});r.push(o)}return r}toRealCells(t){const e=[];return t.forEach(r=>{const i=this.getRealCell(r);e.findIndex(o=>o.containerId===i.containerId)===-1&&e.push(i)}),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){p(Ze,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount;for(let r=0;r<e;r++){const i=this.getCell({row:r,col:t});if(i.virtual||i.colSpan>1||i.rowSpan>1)return i}}getRealCell(t){const e=this.getCell(t);if(!e.virtual)return e;const r=this.getCellById(e.containerId);return p(Ze,!r.virtual,"found a virtual cell"),r}getColumnSpannedRange(t){const e=this.getColumnRealCells(t);let r=1e5,i=-1;return e.forEach(o=>{r=Math.min(o.col,r),i=Math.max(o.col+o.colSpan-1,i)}),p(Ze,r<=i,"min > max"),p(Ze,r>=0,"min < 0"),p(Ze,i<this.colCount,"max >= colCount"),[r,i]}getRowSpannedRange(t){const e=this.getRowRealCells(t);let r=1e5,i=-1;return e.forEach(o=>{r=Math.min(o.row,r),i=Math.max(o.row+o.rowSpan-1,i)}),p(Ze,r<=i,"min > max"),p(Ze,r>=0,"min < 0"),p(Ze,i<this.rowCount,"max >= rowCount"),[r,i]}getSpannedRange(t,e){const r=Math.min(t.row,e.row),i=Math.max(t.row,e.row),o=Math.min(t.col,e.col),s=Math.max(t.col,e.col),l=[];for(let x=r;x<=i;x++)for(let B=o;B<=s;B++)l.push(this.getCell({row:x,col:B}));const c=this.toRealCells(l);let d=1e4,h=1e4,C=-1,E=-1;return c.forEach(x=>{h=Math.min(x.col,h),d=Math.min(x.row,d),E=Math.max(x.col+x.colSpan-1,E),C=Math.max(x.row+x.rowSpan-1,C)}),[{row:d,col:h},{row:C,col:E}]}getAllCells(){return this.getCells({col:0,row:0},{col:this.colCount-1,row:this.rowCount-1})}sub(t,e){const r=[];for(let i=t.row;i<=e.row;i++){const o=[];for(let s=t.col;s<=e.col;s++){const l=this.getCell({row:i,col:s});o.push(l)}r.push(o)}return r}getAllContainers(){return this.getAllCells().map(e=>e.container)}getCells(t,e){const r=[],i=this.getSpannedRange(t,e),o=i[0],s=i[1],l=Math.min(o.row,s.row),c=Math.max(o.row,s.row),d=Math.min(o.col,s.col),h=Math.max(o.col,s.col);for(let C=l;C<=c;C++)for(let E=d;E<=h;E++){const x=this.getCell({row:C,col:E});x.virtual||r.push(x)}return r}map(t){const e=[];for(let r=0;r<this.rowCount;r++){const i=[];for(let o=0;o<this.colCount;o++){const s=this.getCell({row:r,col:o});i.push(t(s))}e.push(i)}return e}getBottomCell(t){const e=this.rowCount;let r=t,i=t.row;for(;r.containerId===t.containerId;){if(i+=1,i>=e)return null;r=this.getCell({row:i,col:t.col})}return this.getRealCell(r)}getTopCell(t){let e=t,r=t.row;for(;e.containerId===t.containerId;){if(r-=1,r<0)return null;e=this.getCell({row:r,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,r=[];return e.forEach(i=>{i.forEach(o=>{r.indexOf(o)===-1&&r.push(o)})}),r}getCellById(t){const r=this.cells.find(i=>i.containerId===t);return p(Ze,r,"cell not found"),r}getCellByCellElement(t){const e=Gu(t);return this.getCellByContainerId(ct(e))}getCellByContainerId(t){return this.getCellById(t)}static fromTable(t){const e=iN(t),r=this.caches.getSync(e,()=>(Ze.debug("create table grid"),new Sx(t)));return r.table!==t?(this.caches.delete(e),this.fromTable(t)):r}static fromBlock(t){return this.fromTable(ze(t))}};let Mt=Sx;m(Mt,"caches",new Nb(dN));function d0(n,t){Object.entries(n).forEach(([e])=>{e.startsWith(`${t}/`)&&delete n[e]})}const gN=I("table-selection-range");function Yr(n,t,e){var M,F,Y,X;const r=Mt.fromBlock(n),i=t,o=e,s=r.getCellByContainerId(i.childContainerId),l=r.getCellByContainerId(o.childContainerId),c=i.custom,d=o.custom,h=(M=c==null?void 0:c.rowIndex)!=null?M:s.row,C=(F=c==null?void 0:c.colIndex)!=null?F:s.col,E=(Y=d==null?void 0:d.rowIndex)!=null?Y:l.row+l.rowSpan-1,x=(X=d==null?void 0:d.colIndex)!=null?X:l.col+l.colSpan-1,B=Math.min(h,E),k=Math.max(h,E),w=Math.min(C,x),U=Math.max(C,x);return{fromRow:B,toRow:k,fromCol:w,toCol:U}}function dC(n,t){const e=new Set,r=new Set,i=n.selection.range;if(!i.isSimple()&&i.start.blockId===lt(t)){const o=Mt.fromBlock(t),{start:s,end:l}=i;p(gN,!s.isSimple()&&!l.isSimple(),"invalid range");const{fromCol:c,toCol:d,fromRow:h,toRow:C}=Yr(t,s,l);if(h===0&&C===o.rowCount-1)for(let E=c;E<=d;E++)r.add(E);if(c===0&&d===o.colCount-1)for(let E=h;E<=C;E++)e.add(E)}return{selectedRows:e,selectedColumns:r}}function Wu(n,t){let e=null;if(t.isCollapsed()&&t.isSimple()){const r=n.getBlockById(t.start.blockId);if(Ge(r)){const i=it(r),o=Z(i);o&&(e=ho(o))}else e=ho(r)}else{const r=n.getBlockById(t.start.blockId),i=ho(r),o=n.getBlockById(t.end.blockId),s=ho(o);i===s&&(e=i)}return e}const $a=I("delete-columns");function Ry(n,t,e){const{start:r,end:i}=e;if(r.blockId!==i.blockId||e.isSimple()||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{fromRow:s,toRow:l}=Yr(t,e.start,e.end),c=Mt.fromBlock(t);return s===0&&l===c.rowCount-1}function hC(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{var F,Y;const e=t.getBlockById(n.start.blockId);if(!Ry(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromCol:r,toCol:i}=Yr(e,n.start,n.end),o=Mt.fromBlock(e);if(r===0&&i===o.colCount-1){t.deleteBlock(e);return}const s=new Set,l=o.map(X=>X.containerId);for(let X=0;X<l.length;X++){const G=l[X];for(let st=r;st<=i;st++){const pt=G[st];s.add(pt)}G.splice(r,i-r+1)}const c=new Set(l.flat()),d=new Set(Array.from(s).filter(X=>!c.has(X))),h=i-r+1,C=new Map,E=new Map;s.forEach(X=>{if(d.has(X))return;const G=o.getCellByContainerId(X);if(p($a,G.colSpan>1,"invalid effected cell, colSpan === 1"),G.col<r){p($a,c.has(X),"invalid effected cell, not exists");let Gt=G.col+G.colSpan-1;Gt>i&&(Gt=i);const Pe=Gt-r+1,he=G.colSpan-Pe;C.set(X,he);return}p($a,G.col<=i,"invalid effected cell, col > endCol");const st=G.col,pt=G.col+G.colSpan-1,Ct=G.col-r,yt=pt-st+1-h+Ct;p($a,yt>0,"invalid effected cell, newSpanned <= 0");const bt=oo(t.doc);E.set(X,{newContainerId:bt,colSpan:yt})});for(let X=0;X<l.length;X++){const G=l[X];for(let st=r;st<G.length;st++){const pt=G[st],Ct=E.get(pt);Ct&&(G[st]=Ct.newContainerId)}}const x=mt.default(t.getBlockData(e));((F=x.colsWidth)!=null?F:new Array(x.cols).fill(0)).splice(r,i-r+1),d.forEach(X=>{d0(x,X)}),C.forEach((X,G)=>{p($a,X>=1,"invalid modified colSpan, colSpan < 1"),X===1?x[`${G}_colSpan`]=void 0:x[`${G}_colSpan`]=X}),E.forEach((X,G)=>{d0(x,G);const{newContainerId:st,colSpan:pt}=X;p($a,pt>=1,"invalid newContainerData, colSpan < 1"),pt>1&&(x[`${st}_colSpan`]=pt);const Ct=o.getCellByContainerId(G).rowSpan;Ct>1&&(x[`${st}_rowSpan`]=Ct)});const k=(Y=l[0][r])!=null?Y:l[0][r-1],w=t.getChildContainerData(k)[0],U=Mt.virtualCellContainersGridToChildren(l),M={...x,cols:x.cols-h,children:U};dl(M),t.updateBlockData(e,M,ve(t,w.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(E.keys()))})}const Ha=I("delete-rows");function wy(n,t,e){const{start:r,end:i}=e;if(r.blockId!==i.blockId||e.isSimple()||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{fromCol:s,toCol:l}=Yr(t,e.start,e.end),c=Mt.fromBlock(t);return s===0&&l===c.colCount-1}function mC(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{const e=t.getBlockById(n.start.blockId);if(!wy(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromRow:r,toRow:i}=Yr(e,n.start,n.end),o=Mt.fromBlock(e);if(r===0&&i===o.rowCount-1){t.deleteBlock(e);return}const s=new Set,l=o.map(M=>M.containerId);for(let M=i;M>=r;M--)l[M].forEach(Y=>s.add(Y)),l.splice(M,1);const c=new Set(l.flat()),d=new Set(Array.from(s).filter(M=>!c.has(M))),h=i-r+1,C=new Map,E=new Map;s.forEach(M=>{if(d.has(M))return;const F=o.getCellByContainerId(M);if(p(Ha,F.rowSpan>1,"invalid effected cell, rowSpan === 1"),F.row<r){p(Ha,c.has(M),"invalid effected cell, not exists");let Ct=F.row+F.rowSpan-1;Ct>i&&(Ct=i);const yt=Ct-r+1,bt=F.rowSpan-yt;C.set(M,bt);return}p(Ha,F.row<=i,"invalid effected cell, col > endCol");const Y=F.row,X=F.row+F.rowSpan-1,G=F.row-r,st=X-Y+1-h+G;p(Ha,st>0,"invalid effected cell, newSpanned <= 0");const pt=oo(t.doc);E.set(M,{newContainerId:pt,rowSpan:st})});for(let M=r;M<l.length;M++){const F=l[M];for(let Y=0;Y<F.length;Y++){const X=F[Y],G=E.get(X);G&&(F[Y]=G.newContainerId)}}const x=mt.default(t.getBlockData(e));d.forEach(M=>{d0(x,M)}),C.forEach((M,F)=>{p(Ha,M>=1,"invalid modified rowSpan, rowSpan < 1"),M===1?x[`${F}_rowSpan`]=void 0:x[`${F}_rowSpan`]=M}),E.forEach((M,F)=>{d0(x,F);const{newContainerId:Y,rowSpan:X}=M;p(Ha,X>=1,"invalid newContainerData, rowSpan < 1"),X>1&&(x[`${Y}_rowSpan`]=X);const G=o.getCellByContainerId(F).colSpan;G>1&&(x[`${Y}_colSpan`]=G)});const B=l[r]?l[r][0]:l[r-1][0],k=t.getChildContainerData(B)[0],w=Mt.virtualCellContainersGridToChildren(l),U={...x,rows:x.rows-h,children:w};dl(U),t.updateBlockData(e,U,ve(t,k.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(E.keys()))})}const qu=I("table-range");function h0(n){p(qu,!n.isSimple(),"must be complex selection range");const{anchor:t,focus:e}=n;p(qu,!t.isSimple(),"invalid start pos type"),p(qu,!e.isSimple(),"invalid end pos type");const r=n.getEditor();p(qu,t.blockId===e.blockId,"invalid range, not same block");const i=r.getBlockById(t.blockId);p(qu,Dt(i)==="table","invalid block type, not a table block");const o=ze(i),s=Mt.fromTable(o),l=s.getCellByContainerId(t.childContainerId),c=s.getCellByContainerId(e.childContainerId),d=Math.min(l.row,c.row),h=Math.max(l.row,c.row),C=Math.min(l.col,c.col),E=Math.max(l.col,c.col),x=s.getCell({row:d,col:C}),B=s.getCell({row:h,col:E});return{editor:r,block:i,table:o,startCell:x,endCell:B,startRow:d,startCol:C,endRow:h,endCol:E}}const gC=I("split-cell");function pC(n,t,e){n.undoManager.runInGroup(()=>{const r=Mt.fromBlock(t),i=r.getRealCell(e);p(gC,!i.virtual,"should not split virtual cell"),p(gC,i.colSpan>1||i.rowSpan>1,"cell does not has span data");const o=r.getVirtualCellContainersGrid();for(let C=0;C<i.rowSpan;C++)for(let E=0;E<i.colSpan;E++){if(C===0&&E===0)continue;const x=C+i.row,B=E+i.col,k=oo(n.doc);o[x][B]=k}const s=n.getBlockData(t),l=mt.default(s);l[`${i.containerId}_colSpan`]=null,l[`${i.containerId}_rowSpan`]=null,l.children=Mt.virtualCellContainersGridToChildren(o);const d=n.getChildContainerData(i.containerId)[0];p(gC,d,"no child block");const h=ve(n,d.id,0);dl(l),n.updateBlockData(t,l,h)})}function pN(n,t,e){e.forEach(r=>{const i=Mt.fromBlock(t).getCell(r);(i.virtual||i.colSpan>1||i.rowSpan>1)&&pC(n,t,r)})}function Sy(n,t,e){if(e.isSimple())return!1;const{start:r,end:i}=e;if(r.blockId!==i.blockId||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=h0(e);return!(s.cell!==l.cell||s.colSpan===1&&s.rowSpan===1)}function CC(n){const{editor:t,block:e,startRow:r,startCol:i,endRow:o,endCol:s}=h0(n),l=[];for(let c=r;c<=o;c++)for(let d=i;d<=s;d++)l.push({row:c,col:d});return pN(t,e,l),!0}const ja=I("merge-cells");function Ly(n,t,e){if(e.isSimple())return!1;const{start:r,end:i}=e;if(r.blockId!==i.blockId||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=h0(e);return s.cell!==l.cell}function Iy(n){const t=h0(n),e=t.editor;e.undoManager.runInGroup(()=>{const r=t.endCell,i=r.row+r.rowSpan-1,o=r.col+r.colSpan-1,s=lt(t.block);CC(n);const l=e.getBlockById(s),c=ze(l),{startRow:d,startCol:h}=t,C=mt.default(e.getBlockData(l));p(ja,C.children,"no table children");const E=Mt.fromTable(c),x=[];for(let Ct=d;Ct<=i;Ct++)for(let yt=h;yt<=o;yt++){const bt=E.getCell({row:Ct,col:yt});p(ja,!bt.virtual,"cell is virtual"),x.push(bt)}p(ja,x.length>0,"no selected cells");const B=x[0],k=x.slice(1),w=E.getCellByContainerId(B.containerId).container,U=[];k.forEach(Ct=>{const yt=E.getCellByContainerId(Ct.containerId).container,bt=ct(yt);if(!fu(e,yt)){const Gt=H5(e,bt);if(fu(e,w)){const Pe=fe(w)[0];e.insertDocAt(w,0,Gt),e.deleteBlock(Pe)}else e.insertDocAt(w,Or(w),Gt)}U.push(bt)});const M=ct(w),F=o-h+1,Y=i-d+1;C[`${M}_colSpan`]=F,C[`${M}_rowSpan`]=Y,U.forEach(Ct=>{p(ja,C.children,"no table children");const yt=C.children.indexOf(Ct);p(ja,yt>0,"no deleted container"),C.children.splice(yt,1)});const X=C,st=e.getChildContainerData(M)[0];p(ja,st,"no child block");const pt=ve(e,st.id,0);dl(X),e.updateBlockData(l,X,pt),e.deleteChildContainers(U)})}const EC=10,CN=["table/merge-cells","table/split-cell","table/insert-column","table/insert-row","table/delete-rows","table/delete-columns","table/delete"];class m0{constructor(){m(this,"id","TableBlockCommandProvider")}getAvailableCommands(t,e,r){if(Dt(e)!=="table")return[];const i={blockId:lt(e),blockKind:Nr(t,e),blockType:Dt(e)},o=[];Ly(t,e,r)&&o.push({id:"table/merge-cells",name:D.t("table.mergeCell"),icon:gT,groupIndex:EC,...i}),Sy(t,e,r)&&o.push({id:"table/split-cell",name:D.t("table.splitCell"),icon:pT,groupIndex:EC,...i});const s=Ry(t,e,r),l=wy(t,e,r);return s&&l&&o.push({id:"table/delete",name:D.t("table.deleteTable"),icon:CT,groupIndex:EC,...i}),o}executeCommand(t,e,r,i,o,s){return Dt(e)!=="table"||!new Set(CN).has(i.id)?!1:i.id==="table/merge-cells"?(Iy(r),!0):i.id==="table/split-cell"?(CC(r),!0):i.id==="table/delete-columns"?(hC(r),!0):i.id==="table/delete-rows"?(mC(r),!0):i.id==="table/delete"?(t.deleteBlock(e),!0):!1}}var Dy=(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))(Dy||{});const za=6,Xu=20,xC="table-cell-menu-btn";function EN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasColTitle:!0};n.updateBlockData(t,r)}function xN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasColTitle:!1};n.updateBlockData(t,r)}function AN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasRowTitle:!0};n.updateBlockData(t,r)}function bN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasRowTitle:!1};n.updateBlockData(t,r)}function vN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),isStripeStyle:!0};n.updateBlockData(t,r)}function BN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),isStripeStyle:!1};n.updateBlockData(t,r)}function TN(n,t,e){if(!n.isBlockWritable(t))return;const i={...mt.default(n.getBlockData(t)),noBorder:!e};n.updateBlockData(t,i)}const hl=I("table-cell-dom");function yN(n,t,e){let r=n.getBlockById(e);for(;r;){const i=r.closest("td");p(hl,i,"no parent cell");const o=Z(i);if(p(hl,o,"no parent block"),o===t)return i;r=o}return p(hl,!1,"filed to get cell by child block id"),null}function as(n,t,e){if(n.getBlockById(e.blockId)===t&&!e.isSimple())return p(hl,e.childContainerId,"block position must have childContainerId attribute"),e;const i=yN(n,t,e.blockId),o=ct(Gu(i));return xe(t,o)}function AC(n,t){const e=n.selection.range,r=as(n,t,e.start),i=as(n,t,e.end);return Yr(t,r,i)}function _y(n,t,e,r){p(hl,Ge(t),"invalid table block");const i=Ri(n,t),o=oe(t),s=()=>{const c=i.querySelector(".table-border-bar-container.top");p(hl,c,"no top border bar container"),c.querySelectorAll(".table-border-bar-cell.top").forEach(h=>{const C=parseInt(h.getAttribute("data-top-index")||"0",10);r.includes(C)?z(h,"danger"):ot(h,"danger")})},l=()=>{const c=o.querySelector(".table-border-bar-container.left");p(hl,c,"no left border bar container"),c.querySelectorAll(".table-border-bar-cell.left").forEach(h=>{const C=parseInt(h.getAttribute("data-left-index")||"0",10);e.includes(C)?z(h,"danger"):ot(h,"danger")})};s(),l()}function cs(n,t,e=!0,r){const o=Mt.fromBlock(t).map(h=>h),{fromCol:s,toCol:l,fromRow:c,toRow:d}=AC(n,t);for(let h=0;h<o.length;h++){const C=o[h];for(let E=0;E<C.length;E++){const x=C[E],B=r?E>=s&&E+x.colSpan-1<=l:h>=c&&h+x.rowSpan-1<=d;e&&B?x.virtual||z(x.cell,"danger"):x.virtual||ot(x.cell,"danger")}}}function us(n,t,e=!0,r){const i=new Set,o=new Set;if(!e){_y(n,t,Array.from(i),Array.from(o));return}const{fromCol:s,toCol:l,fromRow:c,toRow:d}=AC(n,t);if(r)for(let h=s;h<=l;h++)o.add(h);else for(let h=c;h<=d;h++)i.add(h);_y(n,t,Array.from(i),Array.from(o))}function My(n,t,e){const{fromCol:r,toCol:i,fromRow:o,toRow:s}=AC(n,t),l=Mt.fromBlock(t);let c=null,d=null;return e?(c=l.getCell({col:r,row:0}),d=l.getCell({col:i,row:l.rowCount-1}),Qe(n,{anchor:xe(t,c.containerId,{colIndex:r,rowIndex:0}),focus:xe(t,d.containerId,{colIndex:i,rowIndex:l.rowCount-1})})):(c=l.getCell({col:0,row:o}),d=l.getCell({col:l.colCount-1,row:s}),Qe(n,{anchor:xe(t,c.containerId,{colIndex:0,rowIndex:o}),focus:xe(t,d.containerId,{colIndex:l.colCount-1,rowIndex:s})}))}const Uy=["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 Oy(n){return`style-bg-color-${n}`}function Yu(n){return`${n}_background`}function kN(n,t,e){const r=ze(n),s=(e!=null?e:Mt.fromTable(r)).getCell(t).cell;for(let l=0;l<Uy.length;l++){const c=Uy[l];if(wt(s,c))return c}}function Ny(n,t,e){if(!n.isBlockWritable(t))return;const r=n.selection.range,o={...mt.default(n.getBlockData(t))},s=as(n,t,r.start),l=as(n,t,r.end);if(r.isSimple()){const c=s.childContainerId;e===-1?o[Yu(c)]=void 0:o[Yu(c)]=Oy(e)}else{const c=Mt.fromBlock(t),d=Yr(t,s,l),h=new Set;for(let C=d.fromRow;C<=d.toRow;C++)for(let E=d.fromCol;E<=d.toCol;E++){const x=c.getCell({row:C,col:E});!h.has(x.containerId)&&x.col>=d.fromCol&&x.row>=d.fromRow&&x.col+x.colSpan-1<=d.toCol&&x.row+x.rowSpan-1<=d.toRow&&(h.add(x.containerId),e===-1?o[Yu(x.containerId)]=void 0:o[Yu(x.containerId)]=Oy(e))}}n.updateBlockData(t,o)}function RN(n,t,e){if(!n.isBlockWritable(t))return;const i={...mt.default(n.getBlockData(t)),chart:e};n.updateBlockData(t,i)}const Py=I("table-chart");function wN(n,t){const e=rN(n,t);if(e){const r=e.querySelector(".editor-table-chart");if(r){const i=r.chartObject;i&&i.destroy(),r.remove()}}}async function SN(n,t){if(!n.contains(t)||!n.isBlockWritable(t))return;if(!!!n.getBlockData(t).chart){wN(n,t);return}const i=[],o=Mt.fromBlock(t),s=["line","bar","pie","radar"];let l=o.getCell({row:0,col:0}).container.innerText.trim().toLowerCase();new Set(s).has(l)||(l=s[0]);const c=[];for(let k=1;k<o.colCount;k++)c.push(o.getCell({row:0,col:k}).container.innerText);for(let k=1;k<o.rowCount;k++){const w=o.getCell({row:k,col:0}),M=w.container.innerText,F=[];for(let Gt=1;Gt<o.colCount;Gt++){const Pe=o.getCell({row:k,col:Gt}).container.innerText,he=Number.parseFloat(Pe)||0;F.push(he)}let Y;const X=kN(t,w,o);X?Y=window.getComputedStyle(n.rootElement).getPropertyValue(`--${X}`).trim():Y=window.getComputedStyle(n.rootElement).getPropertyValue("--background-color").trim();let[G,st,pt,Ct]=Y?Bg.fromString(Y).toRgbaArray():[];if(!G&&!st&&!pt&&!Ct){const Gt=(k-1)%n.options.colors.length;Y=n.options.colors[Gt],[G,st,pt,Ct]=Bg.fromString(Y).toRgbaArray()}const yt=Y,bt=Bg.fromRgba([G,st,pt,Ct/3]).toHexString();i.push({label:M,data:F,borderColor:yt,backgroundColor:bt,borderWidth:2})}const d=Ri(n,t);let h=null,C=d.querySelector(".editor-table-chart");C?h=C.chartObject:C=v("div",["editor-table-chart"],d);const E=C;p(Py,E,"no chart container");const x=n.getComponentOptions("table"),B=(x==null?void 0:x.chartCdn)||"https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js";try{await zs(B,"editor-chartjs");let k=!1;(h&&h.config.data.datasets.length>i.length||h&&h.config.data.datasets[0].data.length>i[0].data.length)&&(k=!0),h&&(l!==h.config.type||k)&&(h.destroy(),h=null,Array.from(C.querySelectorAll(".editor-chartjs-canvas")).forEach(M=>{M.remove()}));const w=yg.default({},{type:l,data:{datasets:i,labels:c},options:{onClick:()=>{n.selection.selectBlock(t,0,0)}}});if(h)yg.default(h.config,w),h.update();else{const M=v("canvas",["editor-chartjs-canvas"],E).getContext("2d");h=new window.Chart(M,w),C.chartObject=h}}catch(k){Py.error(`failed to resolve chart cdn: ${JSON.stringify(k)}`)}}async function Fy(n,t){await Mr.lock("updateTableChart");try{await SN(n,t)}finally{Mr.release("updateTableChart")}}const Ky=ke.default(Fy,1e3);let Vy=null;function bC(n,t,e){if(Vy!==t&&(Ky.flush(),Vy=t),e.updateNow){Fy(n,t);return}Ky(n,t)}function vC(n,t,e){e&&Ge(e)&&bC(n,e,{updateNow:!1})}function LN(n,t){Ge(t)&&bC(n,t,{updateNow:!0})}const vr={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"},g0={SCROLL_BAR:"container-scrollbar",FIXED:"fixed"},fs={SCROLL_CONTAINER:"scroll-container",TOOL:"container-scroll-tool",CONTAINER:"scroll-container-root",MAC:"mac",SCROLL_AREA:"scroll-area"};function Qu(n,t){return n.containers.get(t)}function $y(n){return n.closest(`.${fs.SCROLL_CONTAINER}`)}function Qr(n){return n.firstElementChild}function Rn(n){return n.closest(`.${fs.CONTAINER}`)}function Ju(n){const t=Rn(n);let e=t.querySelector(`:scope >.${fs.TOOL}`);return e||(e=v("div",[fs.TOOL],t)),e}function IN(n){return Rn(n).firstElementChild}function DN(n,t){const e=Qu(n,Rn(t));return e!=null&&e.barFloatWindowBottom?typeof e.barFloatWindowBottom=="function"?e.barFloatWindowBottom():e.barFloatWindowBottom:0}function Br(n,t){const e=dr(n);return t/e}function Zu(n){const t=window.getComputedStyle(n),e=dr(n);return{paddingBottom:parseFloat(t.paddingBottom)*e,paddingTop:parseFloat(t.paddingTop)*e,paddingLeft:parseFloat(t.paddingLeft)*e,paddingRight:parseFloat(t.paddingRight)*e}}function Ga(n){const t=dr(n);return{scrollLeft:n.scrollLeft*t,scrollWidth:n.scrollWidth*t,clientWidth:n.clientWidth*t,clientHeight:n.clientHeight*t}}function _N(n,t){const e=dr(n);return n[t]*e}function BC(n,t){const e=Rn(t),r=Qu(n,e),i=(r==null?void 0:r.safeRightSpace)||0,o=(r==null?void 0:r.safeLeftSpace)||0,l=(r==null?void 0:r.locatingContainer).getBoundingClientRect(),c=e.getBoundingClientRect(),d=c.width;let h=Math.floor(c.left-l.left-o);h<0&&(h=0);let C=l.right;C-=i;let E=C-c.right;return E<0&&(E=0),h=Math.round(h),E=Math.round(E),{originWidth:d,maxLeft:h,maxRight:E}}function MN(n,t){const e=BC(n,t),{maxLeft:r}=e;t.style.marginLeft=`${Br(t,0-r)}px`,t.style.paddingLeft=`${Br(t,r)}px`}function UN(n,t){const e=BC(n,t);t.style.marginRight=`${Br(t,0-e.maxRight)}px`}function ON(n){if(n!==document.documentElement&&n!==document.body)return n.getBoundingClientRect();const t=0,e=0,r=document.documentElement.clientWidth,i=document.documentElement.clientHeight;return new DOMRect(t,e,r,i)}const Hy=I("scroll-bar-handle"),NN=2;function Wa(n){const t=Ju(n);let e=t.querySelector(`.${g0.SCROLL_BAR}`);return e||(e=v("div",[g0.SCROLL_BAR],t)),p(Hy,e instanceof HTMLDivElement,"invalid child for container tools"),e.firstElementChild||v("div",[],e),e}function p0(n,t){const e=$y(t),r=Wa(e),{scrollWidth:i,clientWidth:o}=Ga(e),{paddingLeft:s,paddingRight:l}=Zu(t),c=BC(n,e),{originWidth:d,maxRight:h}=c;UN(n,e),MN(n,e);const C=i-o;p(Hy,r.firstElementChild instanceof HTMLDivElement,"invalid child for scroll bar"),r.style.width=`${Br(e,d+h-s-l)}px`,r.firstElementChild.style.width=`${Br(e,d+h+C-s-l)}px`}function PN(n,t){const e=Qr(n),{paddingLeft:r}=Zu(e);if(wt(t,"fixed")){const o=Rn(n).getBoundingClientRect();t.style.left=`${Br(n,o.left+r)}px`}else t.style.left=`${Br(n,r)}px`}function qa(n,t){var M;const e=n.getParentScrollContainer(),r=ON(e),i=t.getBoundingClientRect(),o=Wa(t),s=o.getBoundingClientRect(),l=Qu(n,Rn(t)),c=DN(n,t),d=Qr(t),{paddingTop:h,paddingBottom:C}=Zu(d),{scrollWidth:E,clientWidth:x}=Ga(t),B=document.documentElement.clientHeight-c,k=r.top+Ga(e).clientHeight-B,w=B+Math.min(0,k);if(E>x&&i.top+h<w-s.height&&i.bottom>w-s.height+C&&!((M=l==null?void 0:l.isSetScale)!=null&&M.call(l))){l!=null&&l.allowScrollBarFixed&&z(o,g0.FIXED);const F=k>0?c:0;o.style.bottom=`${Math.max(document.documentElement.clientHeight-r.bottom,0)+NN+F}px`}else ot(o,g0.FIXED),o.style.bottom=`${Br(t,C-s.height)}px`;PN(t,o)}class FN{constructor(t,e){m(this,"intersectionObserver");m(this,"handleIntersection",t=>{t.forEach(e=>{this.containers.get(Rn(e.target))?(this.handleIntersectionEntry(e),this.callback(e)):this.intersectionObserver.unobserve(e.target)})});m(this,"handleIntersectionEntry",t=>{const e=t.target;qa(this.scrollCore,e);const r=Qr(e);p0(this.scrollCore,r)});this.scrollCore=t,this.callback=e;const i={root:this.scrollCore.getParentScrollContainer(),rootMargin:"20px",threshold:0};this.intersectionObserver=new IntersectionObserver(this.handleIntersection,i)}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 ml=I("container-scroll-shadow");function jy(n,t,e){const r=n,i=t.getBoundingClientRect(),o=e.getBoundingClientRect(),{paddingTop:s,paddingBottom:l}=Zu(e);r.style.top=`${Br(t,o.top-i.top+s)}px`,r.style.bottom=`${Br(t,i.bottom-o.bottom+l)}px`}function zy(n,t){const e=n;t<24?e.style.width=`${(t/3).toFixed(2)}px`:e.style.width=""}function KN(n){const t=Ju(n);p(ml,t,"no container tools");let e=t.querySelector(`.${vr.LEFT}`);if(!e){const l=Qr(n),c=[vr.COMMON,vr.LEFT];e=v("div",c,t),p(ml,e instanceof HTMLDivElement,"invalid child for container tools"),jy(e,n,l)}p(ml,e instanceof HTMLElement,"invalid child for container tools");const i=Rn(n).getBoundingClientRect(),o=n.getBoundingClientRect();e.style.left=`${Br(n,o.left-i.left)}px`;const s=Ga(n).scrollLeft;p(ml,e instanceof HTMLDivElement,"invalid child for container tools"),zy(e,s),z(e,vr.ACTIVE)}function VN(n){const t=Ju(n);let e=t.querySelector(`.${vr.RIGHT}`);if(!e){const h=Qr(n),C=[vr.COMMON,vr.RIGHT];e=v("div",C,t),p(ml,e instanceof HTMLDivElement,"no div, create shadow failed"),jy(e,n,h)}p(ml,e instanceof HTMLElement,"");const i=Rn(n).getBoundingClientRect(),o=n.getBoundingClientRect();e.style.right=`${Br(n,i.right-o.right)}px`;const{scrollWidth:s,scrollLeft:l,clientWidth:c}=Ga(n),d=s-l-c;p(ml,e instanceof HTMLDivElement,"no shadow element"),zy(e,d),z(e,vr.ACTIVE)}function $N(n){const e=Ju(n).querySelector(`.${vr.LEFT}`);e&&ot(e,vr.ACTIVE)}function HN(n){const e=Ju(n).querySelector(`.${vr.RIGHT}`);e&&ot(e,vr.ACTIVE)}function tf(n){const{scrollLeft:t,scrollWidth:e,clientWidth:r}=Ga(n),i=Qr(n),{paddingLeft:o,paddingRight:s}=Zu(i),l=_N(i,"offsetLeft");e-o<=r-s||e-o<=t+r-s?HN(n):VN(n),i&&t>=l+o?KN(n):$N(n)}class jN{constructor(t,e){m(this,"resizeObserver");m(this,"handleResizeEntry",t=>{const e=t.target,r=Qr(e);tf(e),p0(this.scrollCore,r),qa(this.scrollCore,e),this.callback(e)});m(this,"handleContentResize",t=>{t.forEach(e=>{this.containers.get(Rn(e.target))?this.handleResizeEntry(e):this.unbind(e.target)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new Vs(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 Gy=I("container-scroll-observer");class zN{constructor(t,e){m(this,"handleContentScroll",t=>{const e=t.target;p(Gy,e instanceof Element,"invalid target for scroll event");const r=Wa(e);r.removeEventListener("scroll",this.handleScroll);const i=!0;this.fixScrollXPos(e,e.scrollLeft,i),this.bind(r),tf(e),this.callback(e)});m(this,"handleScroll",t=>{const e=t.target;p(Gy,e instanceof HTMLElement,"");const r=e.scrollLeft,i=!1,o=IN(e);this.unbindContentScroll(o),this.fixScrollXPos(o,r,i),this.bindContentScroll(o),tf(o),this.callback(o)});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",ke.default(this.bindContentScrollCore,300));m(this,"bind",ke.default(this.bindCore,200));this.scrollCore=t,this.callback=e}fixScrollXPos(t,e,r){const i=Wa(t);r||(t.scrollLeft=e),r&&i.scrollLeft!==e&&(i.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 GN{constructor(t){m(this,"scrollContainers",new Set);m(this,"handleParentContainerScroll",()=>{this.scrollContainers.forEach(t=>{qa(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 WN=I("scroll-wrap-resize-observer");class qN{constructor(t){m(this,"resizeObserver");m(this,"handleScrollWrapResize",t=>{t.forEach(e=>{this.containers.get(Rn(e.target))?this.handleScrollWrapResizeEntry(e):this.unbind(e.target)})});m(this,"handleScrollWrapResizeEntry",t=>{const e=t.target;p(WN,e instanceof HTMLElement,"invalid target for observer entry");const r=$y(e);p0(this.scrollCore,e),tf(r),qa(this.scrollCore,r)});this.scrollCore=t,this.resizeObserver=new Vs(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 XN{constructor(t,e){m(this,"resizeObserver");m(this,"scrollContainersMap",new Map);m(this,"handleResizeEntry",t=>{t==null||t.forEach(e=>{const r=Qr(e);tf(e),p0(this.scrollCore,r),qa(this.scrollCore,e),this.callback(e)})});m(this,"handleResize",t=>{t.forEach(e=>{const r=this.scrollContainersMap.get(e.target);r!=null&&r.length&&this.handleResizeEntry(r)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new Vs(this.handleResize)}bind(t){var i,o;const e=Rn(t),r=(i=Qu(this.scrollCore,e))==null?void 0:i.locatingContainer;this.scrollContainersMap.has(r)?(o=this.scrollContainersMap.get(r))==null||o.push(t):(this.scrollContainersMap.set(r,[t]),this.resizeObserver.observe(r))}unbind(t){var o,s;const e=Rn(t),r=(o=Qu(this.scrollCore,e))==null?void 0:o.locatingContainer;if(!r)return;const i=this.scrollContainersMap.get(r);this.scrollContainersMap.set(r,(i==null?void 0:i.filter(l=>l!==t))||[]),(s=this.scrollContainersMap.get(r))!=null&&s.length||(this.resizeObserver.unobserve(r),this.scrollContainersMap.delete(r))}destroy(){this.scrollContainersMap.clear(),this.resizeObserver.disconnect()}}const Hlt="";class YN extends ye.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 r=e.target,i=Qr(r);e.isIntersecting?(this.load(),this.bindCore(r,i)):this.unbindCore(r,i)});m(this,"handleWindowEffect",()=>{var e;(e=this.getScrollContainerInViewable())==null||e.forEach(r=>{qa(this,r)})});this.parentContainer=e}load(){this.containerResizeObserver||(this.containerResizeObserver=new jN(this,this.handleResize)),this.containerScrollObserver||(this.containerScrollObserver=new zN(this,this.handleScrollContainerScroll)),this.parentContainerScrollObserver||(this.parentContainerScrollObserver=new GN(this)),this.scrollWrapResizeObserve||(this.scrollWrapResizeObserve=new qN(this)),this.locatingContainerResizeObserver||(this.locatingContainerResizeObserver=new XN(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,r){var o,s,l,c,d,h;const i=Wa(e);(o=this.containerScrollObserver)==null||o.unbindContentScroll(e),(s=this.containerScrollObserver)==null||s.unbind(i),(l=this.scrollWrapResizeObserve)==null||l.unbind(r),(c=this.containerResizeObserver)==null||c.unbind(e),(d=this.parentContainerScrollObserver)==null||d.unbindScrollContainer(e),(h=this.locatingContainerResizeObserver)==null||h.unbind(e)}bindCore(e,r){var s,l,c,d,h,C;if(this.unbindCore(e,r),!e.closest("body"))return;const i=Wa(e);(s=this.containerScrollObserver)==null||s.bindContentScrollCore(e),(l=this.containerScrollObserver)==null||l.bindCore(i),(c=this.scrollWrapResizeObserve)==null||c.bind(r),(d=this.containerResizeObserver)==null||d.bind(e);const o=this.containers.get(Rn(e));o!=null&&o.allowScrollBarFixed&&((h=this.parentContainerScrollObserver)==null||h.bindScrollContainer(e)),(C=this.locatingContainerResizeObserver)==null||C.bind(e)}bind(e,r){this.containers.set(e,r);const i=e.firstElementChild;this.containerIntersectionObserver||(this.containerIntersectionObserver=new FN(this,this.handleIntersection)),this.containerIntersectionObserver.bind(i)}unbind(e){var o;const r=e.firstElementChild,i=Qr(r);this.unbindCore(r,i),this.containers.delete(e),(o=this.containerIntersectionObserver)==null||o.unbind(r),this.containers.size||this.destroy()}destroy(){var e,r,i,o,s;this.containers.forEach((l,c)=>{this.unbind(c)}),this.containers.clear(),(e=this.parentContainerScrollObserver)==null||e.destroy(),(r=this.containerIntersectionObserver)==null||r.destroy(),(i=this.containerResizeObserver)==null||i.destroy(),(o=this.scrollWrapResizeObserve)==null||o.destroy(),(s=this.locatingContainerResizeObserver)==null||s.destroy(),window.removeEventListener("resize",this.handleWindowEffect),window.removeEventListener("scroll",this.handleWindowEffect)}}const Wy=I("scroll-container"),C0=new Map;class QN extends ye.TypedEmitter{constructor(){super(...arguments);m(this,"scrollListener");m(this,"options");m(this,"scrollContainerElement");m(this,"init",e=>{this.options=e;const r=v("div",[fs.CONTAINER],e.parentElement);ie.isMac&&z(r,fs.MAC);const i=v("div",[fs.SCROLL_CONTAINER],r),o=v("div",[fs.SCROLL_AREA],i);o.style.paddingLeft=e.paddingLeft?`${e.paddingLeft}px`:"",o.style.paddingTop=e.paddingTop?`${e.paddingTop}px`:"",o.style.paddingBottom=e.paddingBottom?`${e.paddingBottom}px`:"",o.style.paddingRight=e.paddingRight?`${e.paddingRight}px`:"",o.appendChild(e.childElement);const s=e.parentContainer;this.scrollListener=C0.get(s),this.scrollListener||(this.scrollListener=new YN(s),C0.set(s,this.scrollListener)),this.scrollListener.unbind(r),this.scrollListener.bind(r,e),this.scrollListener.on("scroll",this.handleContainerScroll),this.scrollListener.on("resize",this.handleResize),this.scrollContainerElement=i});m(this,"handleContainerScroll",(e,r)=>{r===this.scrollContainerElement&&this.emit("scroll",this)});m(this,"handleResize",(e,r)=>{r===this.scrollContainerElement&&this.emit("scroll",this)})}get rootElement(){return this.scrollContainerElement}get contentElement(){return p(Wy,this.scrollContainerElement,"scrollContainerElement cannot be undefined"),Qr(this.scrollContainerElement)}get scrollOptions(){return p(Wy,this.options,"options cannot be undefined"),{...this.options}}handleBaseListenerDestroy(e){e.destroy()}destroy(){var r;(r=this.scrollListener)==null||r.off("scroll",this.handleContainerScroll);const e=Rn(this.contentElement);e&&C0.forEach((i,o)=>{i.unbind(e),i.containers.size===0&&(this.handleBaseListenerDestroy(i),C0.delete(o))})}}function JN(){return new QN}const TC=I("column-width");function ZN(n,t,e){const r=oN(n,t);r.style.width=`${e}px`,r.style.minWidth=`${e}px`}function tP(n){const e=Array.from(n.querySelector("colgroup").children).map(c=>c.getBoundingClientRect().width);if(e[0]!==0)return e;const r=Mt.fromTable(n),i=Array(r.colCount).fill(-1),o=n.getBoundingClientRect().left;r.toRealCells(r.cells).forEach(c=>{const d=c.col+c.colSpan-1;i[d]===-1&&(i[d]=c.cell.getBoundingClientRect().right-o)}),TC.debug(`cellRightOffsets1: ${i.join()}`);for(let c=0;c<i.length;c++){const d=i[c];if(d===-1||c===0)continue;let h=c-1;for(;i[h]===-1&&(h--,h!==-1););const C=h===-1?0:i[h],x=(d-C)/(c-h);for(let B=h+1;B<c;B++)i[B]=C+x*(B-h)}TC.debug(`cellRightOffsets2: ${i.join()}`);const s=[];let l=0;for(let c=0;c<i.length;c++){const d=i[c];s.push(d-l),l=d}return TC.debug(`widths: ${s.join()}`),s}function ef(n){return Array.from(n.querySelector("colgroup").children).map(r=>r.getBoundingClientRect().width||Number.parseInt(r.style.width,10))}const yC=200,eP=40,nP=I("table-resize-gripper"),qy=7,kC=(qy-1)/2,rP=3;function iP(n,t,e){const{rows:r}=n;for(let i=0;i<r.length;i++){const o=r[i],s=Array.from(o.cells);for(let l=0;l<s.length;l++){const c=s[l],d=c.getBoundingClientRect(),h=Math.round(d.right);if(Math.abs(t-h)<=kC&&d.top<=e&&e<=d.bottom)return c}}return null}function oP(n){return!!n.rootContainer.querySelector(".table-resize-gripper")}function RC(n,t){return Ri(n,t).querySelector(".table-resize-gripper")}function Xy(n,t){const e=RC(n,t);p(nP,!e,"resize gripper has already exists");const r=Ri(n,t),i=v("div",["table-resize-gripper","table-indicator"],r);return v("div",["table-resize-gripper-indicator"],i),i}function Yy(n,t,e){let r=RC(n,t);r||(r=Xy(n,t));const o=ze(t).getBoundingClientRect(),s=e.getBoundingClientRect(),l=0,c=o.height,d=n.getCustom(ki(t)).contentElement.getBoundingClientRect(),h=s.right-d.left;r.style.left=`${h-kC-za-Xu}px`,r.style.top=`${l}px`,r.style.height=`${c}px`,r.style.width=`${qy}px`}function wC(n){n.rootContainer.querySelectorAll(".table-resize-gripper").forEach(t=>{t.remove()})}function sP(n,t,e){const i={...n.getBlockData(t),colsWidth:e};n.updateBlockData(t,i)}function lP(n,t,e,r){const i=t,o=Mt.fromTable(e),s=o.getCellByCellElement(i),l=s.col+s.colSpan-1,c=ef(e);let d=r;const h=(E,x)=>{const B=x+1,k=E.col+E.colSpan;return c.slice(B,k).reduce((U,M)=>U+M,0)},C=new Set;for(let E=0;E<o.rowCount;E++){const x=o.getCell({row:E,col:l});if(C.has(x.cell))continue;C.add(x.cell);const B=x.cell,k=B.getBoundingClientRect();let w=r-k.left+kC-rP;const U=Gu(B),M=u1(n,U)||eP*x.colSpan,F=h(x,l),Y=M-F;w<Y&&(w=Y);const X=k.left+w;d=Math.max(d,X)}return d}const aP=I("table-resize-drag-drop");class cP{constructor(t,e,r,i){m(this,"cursor","col-resize");this.editor=t,this.elem=e,this.data=r,this.onEnd=i}onDragStart(t,e,r){}onDragging(t,e,r,i,o){const{table:s,block:l,draggingRefCell:c}=t.data,h=lP(this.editor,c,s,e.x-t.dragOffsetX)-s.getBoundingClientRect().left;p(aP,c,"no dragging cell");const E=Mt.fromTable(s).getCellByCellElement(c),x=E.col+E.colSpan-1,B=ef(s),k=B.slice(0,x).reduce((U,M)=>U+M,0),w=h-k;if(ZN(s,x,w),w){const U=parseFloat(s.style.minWidth);s.style.minWidth=`${U+(w-B[x])}px`}Yy(this.editor,l,c),this.editor.selection.caret.update()}onDragEnd(t,e,r,i,o){const s=ef(t.data.table);sP(this.editor,t.data.block,s),wC(this.editor),this.onEnd&&(this.onEnd(e),this.onEnd=null)}}function uP(n,t){const e=Ae(t.x,t.y);if(!e)return null;const r=Z(e);return!r||!n.contains(r)||!Ge(r)?null:r}I("table-resize");class fP{constructor(t){m(this,"draggingRefCell",null);m(this,"handleMouseMove",(t,e)=>{if(t.readonly||window.isDragging||t.selectionHandler.isSelecting()&&!this.draggingRefCell||this.draggingRefCell)return;const r=e.target;if(!(r instanceof Element)||r.closest(".table-indicator"))return;const o=e,s=uP(t,o);if(!s||!yy(s)||!t.isBlockWritable(s)){wC(t);return}this.updateGripper(s,o.x,o.y)});this.editor=t,t.domEvents.addEventListener(document,"mousemove",this.handleMouseMove)}destroy(){this.editor.domEvents.removeEventListener(document,"mousemove",this.handleMouseMove)}updateGripper(t,e,r){const i=ze(t),o=iP(i,e,r);if(o){if(!RC(this.editor,t)){if(oP(this.editor))return;const l=Xy(this.editor,t),c={block:t,table:i,draggingRefCell:o};Og(new cP(this.editor,l,c,d=>{this.updateGripper(t,d.x,d.y)}))}Yy(this.editor,t,o)}else wC(this.editor)}}function Qy(n){n.addCustom("table-mouse-event-handler",t=>new fP(t))}const Jy=I("table-insert-column");function Zy(n,t,e){n.undoManager.runInGroup(()=>{var E;const r=ze(t),i=Mt.fromTable(r),o=i.colCount;p(Jy,e>=0&&e<=o,`insert index ${e} is out of range [0, ${o}]`);const s=i.map(x=>x.containerId),l=new Set;n.doc.beginBatchUpdate();for(let x=0;x<s.length;x++){const B=s[x],k=B[e-1],w=B[e];if(e===0||e===B.length||k!==w){const U=oo(n.doc);B.splice(e,0,U)}else B.splice(e,0,k),l.add(k)}n.doc.endBatchUpdate();const c=mt.default(n.getBlockData(t));l.forEach(x=>{const B=`${x}_colSpan`,k=c[B];p(Jy,typeof k=="number"&&k>1,`no colSpan for containerId ${x}, ${k}`),c[B]=k+1});const d=((E=c.colsWidth)==null?void 0:E.concat())||new Array(c.cols).fill(0);d.splice(e,0,yC);const h=Mt.virtualCellContainersGridToChildren(s),C={...c,cols:c.cols+1,children:h,colsWidth:d};dl(C),n.updateBlockData(t,C)})}const E0=I("table-insert-row");function SC(n,t,e){n.undoManager.runInGroup(()=>{const r=ze(t),i=Mt.fromTable(r),o=i.rowCount;p(E0,e>=0&&e<=o,`insert index ${e} is out of range [0, ${o}]`);const s=i.map(E=>E.containerId),l=new Set;n.doc.beginBatchUpdate();const c=[];for(let E=0;E<i.colCount;E++){const x=e>0&&s[e-1][E],B=e<i.rowCount&&s[e][E];if(p(E0,x||B,"no top and bottom cell"),e===0||e===i.rowCount||x!==B){const k=oo(n.doc);c.push(k)}else p(E0,x,"no top cell"),c.push(x),l.add(x)}n.doc.endBatchUpdate(),s.splice(e,0,c);const d=mt.default(n.getBlockData(t));l.forEach(E=>{const x=`${E}_rowSpan`,B=d[x];p(E0,typeof B=="number"&&B>1,`no rowSpan for containerId ${E}, ${B}`),d[x]=B+1});const h=Mt.virtualCellContainersGridToChildren(s),C={...d,rows:d.rows+1,children:h};dl(C),n.updateBlockData(t,C)})}const LC=I("paste-table-in-table-block");function dP(n,t,e,r,i){let o=Mt.fromBlock(e);const s=t.blocks.root[0];p(LC,s,"no table data"),p(LC,s.type==="table",`table data type is not table, but ${s.type}`);const l=s,c=o.getCellByCellElement(r),d=l.cols,h=l.rows,C=c.col,E=c.row,x=C+d,B=E+h,k=[];for(let w=C;w<x&&w<o.colCount;w++)for(let U=E;U<B&&U<o.rowCount;U++){const M=o.getCell({col:w,row:U});M.virtual?M.virtual&&k.push({col:w,row:U}):(M.colSpan>1||M.rowSpan>1)&&k.push({col:w,row:U})}n.undoManager.runInGroup(()=>{if(n.doc.beginBatchUpdate(),k.forEach(F=>{const Y=Mt.fromBlock(e).getCell(F);(Y.colSpan>1||Y.rowSpan>1)&&pC(n,e,F)}),x>o.colCount)for(let F=o.colCount;F<x;F++)Zy(n,e,F);if(B>o.rowCount)for(let F=o.rowCount;F<B;F++)SC(n,e,F);o=Mt.fromBlock(e);const w=new u0(l);let U;for(let F=0;F<w.colCount;F++)for(let Y=0;Y<w.rowCount;Y++){const X=w.getCell({col:F,row:Y});if(!X.virtual){const G=ep(n.editorBlocks,t,X.containerId,i),st=C+F,pt=E+Y,Ct={col:st,row:pt},yt=o.getCellContainer(Ct);YB(n,yt,G,i),U=yt}}n.doc.endBatchUpdate(),p(LC,U,"no last container");const M=Ue(U);n.selection.selectBlock(M,dt(n,M))})}const IC=I("paste-in-table-block");class hP{constructor(t){m(this,"pasteData");this.editor=t,setTimeout(()=>{t.input.addHandler(this)})}destroy(){this.pasteData=void 0}async handleBeforePaste(t,e,r,i){return this.pasteData={doc:r,files:i,event:e},!1}async handleBeforePasteDoc(t,e){var E,x,B,k;if(!t.selection.range.isSimple())return this.pasteData=void 0,!1;if(t.selection.range.start.offset!==0)return this.pasteData=void 0,!1;const i=t.selection.startBlock,o=it(i);if(qt(o))return this.pasteData=void 0,!1;if(!fu(t,o))return this.pasteData=void 0,!1;const s=Z(o);if(p(IC,s,"no parent block"),!Ge(s))return this.pasteData=void 0,!1;if(e.blocks.root.length!==1)return this.pasteData=void 0,!1;if(e.blocks.root[0].type!=="table")return this.pasteData=void 0,!1;IC.debug("paste child table in table");const d=Mt.fromBlock(s).getCellByContainerId(ct(o)).cell;Ap(t,e);const h={blockIdMap:new Map,containerIdMap:new Map,boxIdMap:new Map};dP(t,e,s,d,h),p(IC,this.pasteData,"invalid paste data");const C=[];t.input.forEach(w=>{C.push(w)});for(let w=0;w<C.length&&!await((x=(E=C[w]).handleAfterPasteDoc)==null?void 0:x.call(E,t,e,h));w++);for(let w=0;w<C.length&&!await((k=(B=C[w]).handleAfterPaste)==null?void 0:k.call(B,t,this.pasteData.event,this.pasteData.doc));w++);return this.pasteData=void 0,!0}}function tk(n){n.addCustom("table-block-paste-event",t=>new hP(t))}const DC=I("table-select-columns");function mP(n,t,e,r,i){p(DC,Ge(t),"is not a table block");const o=Mt.fromBlock(t);p(DC,e>=0&&e<o.colCount,"invalid from"),p(DC,r>0&&e+r<=o.colCount,"invalid count");const s=o.getCell({row:0,col:e}),l=o.getCell({row:o.rowCount-1,col:e+r-1}),c=xe(t,s.containerId,{colIndex:e,rowIndex:0}),d=xe(t,l.containerId,{colIndex:e+r-1,rowIndex:o.rowCount-1});i!=null&&i.reverse?n.selection.setSelection(d,c):n.selection.setSelection(c,d)}const _C=I("table-select-columns");function gP(n,t,e,r,i){p(_C,Ge(t),"is not a table block");const o=Mt.fromBlock(t);p(_C,e>=0&&e<o.rowCount,"invalid from"),p(_C,r>0&&e+r<=o.rowCount,"invalid count");const s=o.getCell({row:e,col:0}),l=o.getCell({row:e+r-1,col:o.colCount-1}),c=xe(t,s.containerId,{rowIndex:e,colIndex:0}),d=xe(t,l.containerId,{rowIndex:e+r-1,colIndex:o.colCount-1});i!=null&&i.reverse?n.selection.setSelection(d,c):n.selection.setSelection(c,d)}const jlt="",ek=I("get-toolbar-reference-client");function nk(n,t){const e=n.selection.range;if(!e.isSimple()){p(ek,e.start.blockId===e.end.blockId,"invalid selection range");const s=n.getBlockById(e.start.blockId);p(ek,It(n,s),"not a complex block");const l=Qt(n,s);if(l.getTextToolbarReferenceClient){const c=l.getTextToolbarReferenceClient(n,s);if(c)return c}}const r=e.isReverse()?t.start:t.end,i=Qe(n,{anchor:r,focus:r}),o=Yi(n,t.block,i);if(o.length!==0)return o[0]}function pP(n){var t,e;if(n.children){let r=!1;const i=[];for(const o of n.children){if((t=o.states)!=null&&t.includes("checked")){r=!0;break}(e=n.defaultCheckedChildren)!=null&&e.includes(o.id)&&i.push(o)}if(!r&&(i==null?void 0:i.length))for(const o of i)Array.isArray(o.states)?o.states.push("checked"):o.states=["checked"]}}function x0(n){const t=(i,o)=>{const s=i.findIndex(c=>c.id===o.id);if(s===-1){i.push(o);return}const l=i[s];if(l.value!==o.value&&delete l.value,!!l.states){if(!o.states){l.states=[];return}l.states=Rg.default(l.states,o.states)}},e=[],r=new Map;return n.forEach(i=>{var o,s;(o=i.children)!=null&&o.length&&(r.has(i.id)?(s=r.get(i.id))==null||s.push(...i.children):r.set(i.id,[...i.children])),t(e,i)}),r.forEach((i,o)=>{const s=e.find(l=>l.id===o);s&&(s.children=x0(i),pP(s))}),e}function A0(n){return n.findCustom("toolbar-handler")}const zlt="";class CP{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:r}=this.form,i=this.formatUrl(r.getInputValue());(t=this.onFinished)==null||t.call(this,e.getInputValue()||i,i),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,e)=>{var r;if(!e){if(t.key==="Enter"){(r=this.form.linkUrl)==null||r.getField().focus(),t.stopPropagation();return}t.key==="Escape"&&this.handleClose()}});m(this,"handleUrlKeyboard",(t,e)=>{if(!e){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(D.t("link.urlPlaceholder")),new Error(D.t("link.urlPlaceholder"))}formatUrl(t){if(!t)return"";try{new URL(t)}catch{return`${window.location.protocol}//${t}`}return t}editLink(t){var h,C;const{target:e,linkText:r,linkUrl:i,onFinished:o,onClose:s,placement:l="bottom-start"}=t;this.linkPopup=new Va(this.createPopupContent(r,i)),this.linkPopup.addListener("show",this.onShow),this.linkPopup.manualShow(e,{theme:"light",placement:l}),this.onFinished=o,s&&(this.onClose=s);const c=(h=this.linkPopup)==null?void 0:h.content.querySelector('[data-button-id="submit-button"]'),d=(C=this.linkPopup)==null?void 0:C.content.querySelector('[data-button-id="cancel-button"]');c==null||c.addEventListener("click",this.handleOk),d==null||d.addEventListener("click",this.handleClose)}createPopupContent(t,e){const r=v("div",["link-popup-content"],null);this.form.linkText=c0(r,{label:D.t("link.textLabel"),required:!1,placeholder:D.t("link.textPlaceholder"),defaultValue:t,onChange:this.onChange,onKeyDown:this.handleTextKeyboard}),this.form.linkUrl=c0(r,{className:"link-popup-gap",label:D.t("link.urlLabel"),required:!0,placeholder:D.t("link.urlPlaceholder"),defaultValue:e,onChange:this.onChange,onKeyDown:this.handleUrlKeyboard});const i=v("div",["link-popup-footer"],r),o=br("cancel-button",D.t("link.cancelText"));i.appendChild(o);const s=br("submit-button",D.t("link.submitText"),void 0,["disabled","primary"]);return i.appendChild(s),r}_destroy(){var r,i,o,s;const t=(r=this.linkPopup)==null?void 0:r.content.querySelector('[data-button-id="submit-button"]'),e=(i=this.linkPopup)==null?void 0:i.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={},(o=this.linkPopup)==null||o.removeAllListeners(),(s=this.linkPopup)==null||s.destroy()}destroy(){this._destroy()}}function nf(n,t){n.addCustom("link-editor",()=>new CP).editLink(t)}const EP=I("link-popup");function xP(n){return wt(n,"link")}function rf(n){var t,e;return(e=(t=n.getAttribute("link"))!=null?t:n.textContent)!=null?e:""}function AP(n,t,e){var i,o,s,l;if(n.isBlockWritable(t)&&e&&Qn(e)){const c=e,d=(o=(i=n.editorBoxes.getBoxClass(su(c))).getBoxProperties)==null?void 0:o.call(i,n,c);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&&rt(n,t)&&xP(e)){const c=v("a",["link-href-button"],null,rf(e));c.href=rf(e),c.target="_blank",c.rel="noopener noreferrer";const d=[{id:"link-text",name:rf(e),disableTooltip:!0,element:c},{id:"edit-link",name:D.t("link.edit"),icon:s0},{id:"remove-link",name:D.t("link.remove"),icon:kT}];return{element:e,commands:d}}return Hv(n,t,"hovering-toolbar")}function rk(n,t,e){var l;const r=Yo(t,e),i=n.getBlockText(t),o={start:0,end:0};let s=(l=e.textContent)!=null?l:"";for(let c=0;c<i.length;c++){const d=i[c];if(o.end+d.insert.length>=r.end){o.end+=d.insert.length,s=d.insert;break}o.start<r.start&&(o.start+=d.insert.length,o.end=o.start)}return[o,s]}function bP(n,t,e){const[r,i]=rk(n,t,e);n.selection.selectBlock(t,r.start,r.end);const o=rf(e),s=(h,C)=>{try{const E=n.getBlockText(t),x=U1(E,r.start,r.end-r.start),B=ro(x,r.start,h,{link:C});n.setBlockText(t,B),n.selection.selectBlock(t,r.start+h.length),n.focus()}catch(E){EP.error(E)}},l=()=>{n.selection.selectBlock(t,r.end),n.focus()},c=Yi(n,t,n.selection.range)[0];if(!c)return;const d=Zi(n,t,"link-button-anchor",c);nf(n,{target:d,linkText:i,linkUrl:o,onFinished:s,onClose:l})}function vP(n,t,e){const[r]=rk(n,t,e),i=n.getBlockText(t),o=rf(e),s=va(r.start,r.end-r.start,i,"link",o);n.setBlockText(t,s),n.selection.selectBlock(t,r.end)}function BP(n,t,e,r){var s,l,c;if(e){if(n.isBlockWritable(t)&&Qn(e)){const h=e,C=(l=(s=n.editorBoxes.getBoxClass(su(h))).getBoxProperties)==null?void 0:l.call(s,n,h);if(C!=null&&C.boxCommands){C.boxCommands["hovering-toolbar"].executeCommand(n,t,h,r);return}return}const d=A0(n);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},400),r.id==="edit-link"?bP(n,t,e):r.id==="remove-link"&&vP(n,t,e);return}const i=$v(n,t);if(!i)return;const o=(c=i.blockCommands)==null?void 0:c["hovering-toolbar"];!o||o.executeCommand(n,t,r)}function b0(){let n=8;for(;n>0&&!document.querySelector(`div[data-style-heading='${n}']`);)n--;return n}function Jr(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 r=n.getBlockById(e.start.blockId);return!(!rt(n,r)||Cu(n,r,e.start.offset).charType!=="box")}const TP=[Yh,Qh,Jh,Zh,t0,e0,n0,r0];class yP{constructor(t){m(this,"id","BlockTurnIntoCommandProvider");this.editor=t}getHeadingIndex(){let t=b0();return t<=4?t=5:t<8&&(t+=1),t}getAvailableCommands(t,e,r){if(!rt(t,e))return[];if(Jr(t))return[];const i=lt(e),o=Dt(e),s=Nr(t,e),c=t.getBlockData(e).heading,d=[];for(let C=0;C<this.getHeadingIndex();C++)d.push({id:`heading-${C+1}`,name:D.t("commands.heading",{name:`${C+1}`}),icon:TP[C],states:c===C+1?["checked"]:[],value:`${C+1}`});const h=C=>{var x;const E=v("span",["toolbar-item-name-container"],null);for(const B of C.children)if((x=B.states)!=null&&x.includes("checked"))return E.innerHTML=B.icon||Fa,E;return E.innerHTML=Fa,E};return[{id:"turn-into",name:D.t("commands.headingGroup"),blockId:i,blockType:o,blockKind:s,element:h,groupIndex:200,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["text"],children:[{id:"text",name:D.t("commands.text"),icon:Fa,states:c?[]:["checked"]},...d],childrenType:"menu"}]}applyHeadingStyle(t,e,r){t.updateBlockData(e,{heading:r})}executeCommand(t,e,r,i){if(Jr(t))return!1;if(rt(t,e)&&(i.id.startsWith("heading-")||i.id==="text")){const o=i.value?Number(i.value):null;return this.applyHeadingStyle(t,e,o),!0}return!1}}const kP=8,Le=I("list-block"),v0=I("list-block");function Ft(n){return Dt(n)==="list"}function Ne(n){p(v0,Ft(n),"not a list block")}function er(n){Ne(n);const t=n.getAttribute("data-list-type");return p(v0,t,"no list type"),t}function B0(n){return Ft(n)&&er(n)==="text-only"}function nr(n){var t,e;return Ne(n),(e=Number.parseInt((t=n.getAttribute("data-list-start"))!=null?t:"1",10))!=null?e:1}function un(n){var t,e;return Ne(n),(e=Number.parseInt((t=n.getAttribute("data-list-level"))!=null?t:"1",10))!=null?e:1}function Xa(n){Ne(n);const t=n.getAttribute("data-list-group-id");return p(v0,t,"no group id"),t}function ds(n){var o,s,l,c,d;Ne(n);const t=(o=n.getAttribute("data-list-type"))!=null?o:"ordered",e=(l=Number.parseInt((s=n.getAttribute("data-list-start"))!=null?s:"1",10))!=null?l:1,r=(d=Number.parseInt((c=n.getAttribute("data-list-level"))!=null?c:"1",10))!=null?d:1,i=n.getAttribute("data-list-group-id");return p(v0,i,"no group id"),{type:t,start:e,level:r,groupId:i}}function MC(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 RP(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="",r=n;return Object.entries(t).forEach(([i,o])=>{for(;r>=o;)e+=i,r-=o}),e.toLowerCase()}const wP="abcdefghijklmnopqrstuvwxyz";function ik(n){if(n<=0)return`${n}`;const t=(n-1)%26,e=Math.floor((n-1)/26),r=wP[t];return e?ik(e)+r:r}function SP(n){return`${n}`}const ok=[SP,ik,RP];function LP(n,t){const e=ok[(n-1)%ok.length];return e(t)}function IP(n){return["\u2022","\u25E6","\u25AA"][(n-1)%3]}function hs(n,t){Ne(n);const{level:e,groupId:r,type:i}=ds(n);let o=Oe(n);for(;o;){if(!Ft(o))return null;const{level:s,groupId:l,type:c}=ds(o);if(s<e)return null;if(e===s&&((t==null?void 0:t.ignoreGroupId)||r===l)&&(c==="text-only"||i==="text-only"||i===c))return o;o=Oe(o)}return null}function sk(n){return hs(n,{ignoreGroupId:!0})}function gl(n){Ne(n);const{level:t,groupId:e,type:r}=ds(n);let i=Jt(n);for(;i;){if(Ft(i)){const{level:o,groupId:s,type:l}=ds(i);if(t===o&&e===s&&(l==="text-only"||r==="text-only"||r===l))return i;if(o<t)return null}i=Jt(i)}return null}function lk(n){Ne(n);const t=[];let e=hs(n);for(;e;)t.unshift(e),e=hs(e);return t}function Ya(n){Ne(n);const t=[];let e=gl(n);for(;e;)t.push(e),e=gl(e);return t}function of(n){Ne(n);let t=hs(n);for(;t;){const e=hs(t);if(!e)return t;t=e}return n}function DP(n){Ne(n);let t=gl(n);for(;t;){const e=gl(t);if(!e)return t;t=e}return null}function ak(n,t){const e=lk(n),r=Ya(n);return t.withSelf?[...e,n,...r]:[...e,...r]}function T0(n){Ne(n);let t=n;const e=lk(n);e.length>0&&(t=e[0]);const r=Oe(t);return!r||!Ft(r)?null:un(r)<un(t)?r:null}function _P(n,t){Ne(n);let e=n;for(;e;){const r=un(e);if(r===t)return e;if(r>t)e=T0(e);else if(r<t)return null}return null}function MP(n){let t=of(n);for(;;){const e=T0(t);if(!e)return t;t=of(e)}}class UP{constructor(){m(this,"nodeMap",new Map);m(this,"rootNodes",[])}addNode(t,e){const r={block:e,children:[]};if(this.nodeMap.set(e,r),t){const i=this.nodeMap.get(t);p(Le,i,"no parent node"),i.children.push(r)}else this.rootNodes.push(r)}}function ck(n,t){const e=MP(t),r=new UP;r.addNode(null,e);let i=Jt(e);for(;i&&Ft(i);){if(B0(i)){r.addNode(null,i),i=Jt(i);continue}if(un(i)===0&&er(i)!==er(e))break;const s=T0(i);r.addNode(s,i),i=Jt(i)}return r.rootNodes}function OP(n){const t=document.fullscreenEnabled||document.mozFullScreenEnabled||document.documentElement.webkitRequestFullScreen,e=r=>{if(r.requestFullscreen)return r.requestFullscreen();if(r.mozRequestFullScreen)return r.mozRequestFullScreen();if(r.webkitRequestFullScreen){try{document.fullscreenElement=n}catch{}return r.webkitRequestFullScreen()}return Promise.resolve(0)};return t?e(n):Promise.resolve(0)}function uk(){const e=(document.exitFullscreen||document.webkitExitFullscreen).bind(document)();try{document.fullscreenElement=null}catch{}return e}function UC(n){return wt(n,"editor-in-mindmap-first")}function OC(n){if(p(Le,Ft(n),"not a list block"),wt(n,"editor-in-mindmap-first")||!Go(n))return!0;const t=n.classList,e="editor-mindmap-root-";return!!Array.from(t).find(i=>{if(i.startsWith(e))return i})}function NP(n,t,e){const r=it(n);if(t){const s=it(t);p(Le,r===s,"invalid block container")}const i=vt(n);if(t){const s=vt(t);p(Le,i<=s,"invalid block index")}if(z(n,...e),!t||t===n)return;let o=Jt(n);for(;o!==t;)p(Le,o,"no next button"),z(o,...e),o=Jt(o);o&&z(o,...e)}function PP(n){const t=`editor-mindmap-root-${n.id}`,r=it(n).querySelectorAll(`.${t}`);return r[r.length-1]}async function FP(n,t,e){const r=oe(t),i=r.querySelector('[data-button-id="mindmap-fullscreen"]');p(Le,i,"no full screen button");const o=()=>{setTimeout(()=>{e.toMindmap(n,t,{},{reset:!0,mindmapTools:e})},300)},s=()=>{ot(r,"fullscreen"),i.innerHTML=oC,i.setAttribute(`data-editor-tooltip-${n.clientId}-dynamic`,D.t("mindmap.fullScreen")),OC(t)&&setTimeout(()=>{o()},300)};if(document.fullscreenElement===r){try{await uk()}catch(l){Le.error(l)}s()}else{try{z(r,"fullscreen"),await OP(r),o()}catch(l){Le.error(l)}i.innerHTML=ay,i.setAttribute(`data-editor-tooltip-${n.clientId}-dynamic`,D.t("mindmap.exitFullscreen"))}r.onfullscreenchange=()=>{document.fullscreenElement||s()}}function NC(n,t,e,r,i){if(t.querySelector(`[data-button-id="${e}"]`))return null;const s=br(e,r,i,[]);return s.setAttribute(`data-editor-tooltip-${n.clientId}-dynamic`,r),z(s,"mindmap-button"),t.appendChild(s),s}function PC(n,t){return n.querySelector(`[data-button-id="${t}"]`)}function KP(n){return PC(n,"mindmap-fullscreen")}function VP(n){return PC(n,"mindmap-fit")}function $P(n){return PC(n,"mindmap-close")}function HP(n,t,e,r){const i=NC(n,t,"mindmap-close",D.t("mindmap.close"),qh);!i||n.domEvents.addEventListener(i,"click",()=>{r.closeMindmap(n,e)})}function jP(n,t,e,r){const i=NC(n,t,"mindmap-fit",D.t("mindmap.autoFit"),ly);!i||n.domEvents.addEventListener(i,"click",()=>{r.fitMindmap(n,e)})}function zP(n,t,e,r){if(navigator.userAgent.includes("Mobile")&&!navigator.userAgent.includes("iPad"))return;const o=NC(n,t,"mindmap-fullscreen",D.t("mindmap.fullScreen"),oC);!o||n.domEvents.addEventListener(o,"click",()=>{FP(n,e,r)})}function GP(n,t){const e=th(t);if(!e)return;const r=VP(e);r&&(r.remove(),n.domEvents.removeAllListeners(r));const i=$P(e);i&&(i.remove(),n.domEvents.removeAllListeners(i));const o=KP(e);o&&(o.remove(),n.domEvents.removeAllListeners(o))}const Qa=new Map;function FC(n,t,e){const r=(s,l)=>{s.forEach(c=>{l?z(c.block,"to-mindmap-highlight"):ot(c.block,"to-mindmap-highlight"),r(c.children,l)})},i=ck(n,t);if(i.length===0)return;const o=i[0].block;if(e){const s=Qa.get(o);s&&(s.forEach(l=>l.cancel()),Qa.delete(o)),r(i,!0)}else{const s=setTimeout(()=>{r(i,!1),Qa.delete(o)},300),l=()=>{clearTimeout(s),Qa.delete(o)},c=Qa.get(o);c?c.push({cancel:l}):Qa.set(o,[{cancel:l}])}}const{Markmap:WP}=e9;function qP(n,t){Ne(t);const e=ck(n,t),r=e[0].block,i=d=>({t:"text",v:Nt(d.block).textContent,d:1,c:d.children.length>0?d.children.map(C=>i(C)):void 0});let o=null;e.length>1?o={t:"root",v:"root",d:0,c:e.length>0?e.map(d=>i(d)):void 0}:o=i(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},c=l(e);return{root:o,block:r,nodes:e,last:c}}function y0(n,t,e,r){const{root:i,block:o,last:s}=qP(n,t);r.selectBlock&&n.selection.selectBlock(o,0,0),FC(n,o,!1),r.saveData&&n.updateBlockData(o,{viewAsMindmap:!0});const l=oe(o);let c=l.querySelector(".editor-mindmap-svg");if(r.reset&&(c&&c.remove(),c=null),c)c.innerHTML="";else{const U="http://www.w3.org/2000/svg",M=l.getBoundingClientRect(),F=document.fullscreenElement===l,Y=F?`${M.width}`:`${t.getBoundingClientRect().width}`,X=F?`${M.height}`:"600",G=document.createElementNS(U,"svg");G.setAttributeNS(null,"viewBox",`0 0 ${Y} ${X}`),G.setAttributeNS(null,"width","100%"),G.setAttributeNS(null,"height",X),G.style.display="block",G.style.width="100%",G.style.height=`${X}px`,G.classList.add("editor-mindmap-svg"),l.appendChild(G),c=G}const d=o,C=`editor-mindmap-root-${lt(o)}`;z(d,"editor-in-mindmap-first",C,"readonly"),d.contentEditable="false";const E=Jt(o);E&&vt(E)<=vt(s.block)&&NP(E,s.block,["block-hidden",C]);const x=(U,M)=>{if(M.length>0){const F=M[0].parentElement;F&&(F.style.width="100vw",F.style.maxWidth="200px")}M.forEach(F=>{z(F,"editor-mindmap-node")})},B=new WP(c,{...e,autoFit:!0});B.viewHooks.transformHtml.tap(x),B.setData(i),B.fit();const k=oe(o);let w=k.querySelector(".mindmap-toolbar");w||(w=v("div",["mindmap-toolbar"],k)),jP(n,w,d,r.mindmapTools),zP(n,w,d,r.mindmapTools),HP(n,w,d,r.mindmapTools),n.domEvents.addEventListener(c,"click",()=>{n.selection.selectBlock(o,0),n.input.focus()}),d.mindMap=B}function XP(n){const t=v("div",["list-to-mindmap-wrap"],null),e=br("list-to-mindmap",D.t("mindmap.viewAsMindMap"),sy,[],n.clientId);return t.appendChild(e),t}async function fk(n,t){const e=`editor-mindmap-root-${t.id}`,r=it(t);fe(r).forEach(l=>{wt(l,e)&&ot(l,e,"editor-in-mindmap-first","block-hidden")});const o=oe(t);document.fullscreenElement===o&&await uk();const s=o.querySelector(".editor-mindmap-svg");!s||(p(Le,s,"no mindmap svg"),s.remove(),n.domEvents.removeAllListeners(s),GP(n,t))}function YP(n){const t=n.classList,e="editor-mindmap-root-";return Array.from(t).find(i=>{if(i.startsWith(e))return i})}async function dk(n,t){!YP(t)||(n.updateBlockData(t,{viewAsMindmap:null}),fk(n,t),n.selection.selectBlock(t,0))}function QP(n,t){const e=t.mindMap;e&&e.fit()}const k0={toMindmap:y0,closeMindmap:dk,fitMindmap:QP},Glt="";class R0{constructor(t){m(this,"toMindmapButton");m(this,"currentBlock",null);m(this,"handleHoveringBlock",t=>{t&&Ft(t)&&er(t)!=="unchecked"&&er(t)!=="checked"&&this.editor.isWritable()?oe(t).appendChild(this.toMindmapButton):this.toMindmapButton.remove()});m(this,"handleMouseEnter",()=>{const t=Z(this.toMindmapButton);p(Le,t&&Ft(t),"no parent list"),FC(this.editor,t,!0),this.currentBlock=t});m(this,"handleMouseLeave",()=>{this.currentBlock&&(FC(this.editor,this.currentBlock,!1),this.currentBlock=null)});m(this,"handleClick",()=>{const t=Z(this.toMindmapButton);p(Le,t&&Ft(t),"no parent list"),y0(this.editor,t,{},{saveData:!0,selectBlock:!0,mindmapTools:k0})});this.editor=t,Re.get(this.editor).addListener("change",this.handleHoveringBlock),this.toMindmapButton=XP(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(R0)}destroy(){Re.get(this.editor).removeListener("change",this.handleHoveringBlock)}hide(){this.currentBlock&&(this.currentBlock=null),this.toMindmapButton.remove()}}function JP(n,t,e){var r;t==="beginDrag"&&((r=R0.get(n))==null||r.hide())}function Ja(n,t,e,r){var o;const i=(o=r==null?void 0:r.groupId)!=null?o:et();t.forEach(s=>{const l=n.getBlockData(s);if(l.start!==e||(r==null?void 0:r.resetGroupId)){const c={...l,start:e};r!=null&&r.resetGroupId&&(c.groupId=i),n.updateBlockData(s,c)}l.textOnly||(e+=1)})}function KC(n,t,e,r){const i=ak(t,{withSelf:!0});i.length!==0&&Ja(n,i,e,r)}class w0{constructor(t,e){m(this,"listStart",0);m(this,"listBrother",null);if(this.editor=t,B0(e))return;const r=of(e),i=nr(r);this.listStart=i,r===e?this.listBrother=gl(r):this.listBrother=r}fix(){if(!!this.listBrother){if(qc(this.listBrother)){this.listBrother=null;return}KC(this.editor,this.listBrother,this.listStart)}}}class pl{constructor(t,e,r){m(this,"listStart");m(this,"listBrother",null);this.editor=t,this.options=r;const i=of(e),o=nr(i);this.listStart=o,this.listBrother=i,r!=null&&r.resetStart&&(this.listStart=1)}fix(){!this.listBrother||KC(this.editor,this.listBrother,this.listStart,this.options)}}class hk{constructor(t,e,r){m(this,"listStart");m(this,"listNextBrothers",[]);this.editor=t,this.listNextBrothers=Ya(e);const{start:i,resetStart:o}=r||{};this.listStart=o?1:i!=null?i:1}fix(){!this.listNextBrothers.length||Ja(this.editor,this.listNextBrothers,this.listStart)}}function ZP(n,t,e){n.getBlockData(t).quoted&&(e.quoted=!0)}function VC(n,t,e,r){if(Le.debug("drag a block on a list block"),!rt(n,t))return!1;p(Le,Ft(e),"target is not a list block");const{type:i,start:o,level:s,groupId:l}=ds(e),c=r==="after"?o+1:o,d=n.getBlockData(t),h={id:et(),type:"list",groupId:l,level:s,start:c,text:d.text,...MC(i)};ZP(n,e,h);let C=vt(e);const E=it(e);r==="after"&&(C+=1);let x=null;Ft(t)&&(x=new w0(n,t));const B=n.insertBlock(ct(E),C,h,Ch(h.id,0));return n.deleteBlock(t),new pl(n,B).fix(),x==null||x.fix(),!0}function tF(n,t,e,r){if(Le.debug("drag a list between text blocks"),r==="after"){const d=Jt(e);if(d&&Ft(d))return VC(n,t,d,"before")}if(r==="before"){const d=Oe(e);if(d&&Ft(d))return VC(n,t,d,"after")}const o={...n.getBlockData(t),groupId:et(),start:1,level:1};let s=vt(e);const l=it(e);r==="after"&&(s+=1),n.insertBlock(ct(l),s,o,Ch(o.id,0));const c=new w0(n,t);return n.deleteBlock(t),c.fix(),!0}function eF(n,t,e,r,i){if(Xd(e))return!1;const{blockId:o}=e,s=n.getBlockById(o);p(Le,s,"no dragged block");const{isSourceBlock:l,targetBlock:c}=i;return!l&&c?(p(Le,t===c,"block !== target block"),p(Le,Ft(c),"target is not a list block"),VC(n,s,c,r)):tF(n,s,c,r)}function mk(n,t){if(!n.isWritable())return!1;const e=n.selection.range,i=n.editorCommandProviders.getCommands(e,"shortcut").find(o=>o.id===t);return i?(n.editorCommandProviders.executeCommand(e,i,{}),!0):!1}const nF={"Shift+CtrlOrCmd+L":n=>mk(n,"ordered-list"),"Shift+CtrlOrCmd+U":n=>mk(n,"unordered-list")};function S0(n){const t=n.getAttribute("block-padding-level");return t?Number(t):null}function rF(n,t){let e;const r=S0(t);if(!r)e=1;else{if(r>=12)return e=12,!1;e=r+1}return n.updateBlockData(t,{...n.getBlockData(t),padding:e}),!0}function gk(n,t){const e=S0(t);if(!e)return!1;const r=n.getBlockData(t);return e>1?(n.updateBlockData(t,{...r,padding:e-1}),!0):(n.updateBlockData(t,{...r,padding:null}),!0)}function $C(n){return n.readonly||!n.isWritable()}function iF(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const r=e.block;rt(n,r)&&rF(n,r)}),!0}function oF(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const r=e.block;rt(n,r)&&gk(n,r)}),!0}function sF(n){return $C(n)?!1:n.undoManager.runInGroup(()=>(iF(n),!0))}function lF(n){return $C(n)?!1:n.undoManager.runInGroup(()=>(oF(n),!0))}function aF(n){if($C(n))return!1;if(!n.selection.range.isCollapsed())return;const t=n.selection.focusedBlock;if(!rt(n,t))return;const e=n.selection.range.focus;if(!(!e.isSimple()||e.offset!==0||!S0(t)))return gk(n,t),!0}class HC{renderBlock(t,e,r){const{padding:i}=r;return i?{attributes:{"block-padding-level":i}}:{}}}const Wlt="",cF={Tab:sF,"Shift+Tab":lF,Backspace:aF};function uF(n,t,e=1){if(!t)return null;let r=Oe(n);for(;r;){const i=r.getAttribute("data-style-heading"),o=Number(r.getAttribute("data-list-level"));if(i){if(i<t)return null;if(i===t&&o===e)return Ft(r)?r:null}r=Oe(r)}return null}function fF(n,t){const e=n.getAttribute("data-style-heading"),r=uF(n,e);if(r)return r;const i=Oe(n);if(i&&Ft(i)&&er(i)===t)return i;const o=Jt(n);return o&&Ft(o)&&er(o)===t?o:null}function dF(n,t,e){var k,w,U;const r=(k=e.data)!=null?k:{};let i=1;if(Ft(t))i=un(t);else{const M=S0(t);M&&(i=M+1),i>8&&(i=8)}const o=(w=r.listType)!=null?w:"ordered";if(o==="text-only")return null;const s=n.getBlockData(t);let l=(U=s.text)!=null?U:[],d=de(l);const h=e.offset||0;h<=gn(l)&&(l=Mn(l,h).right,d=d.substring(0,h));let C=1;o==="ordered"&&(C=Number.parseInt(d,10)||1);let E=et();const x=fF(t,o);if(x)if(un(x)===i){if(vt(t)>vt(x))C=nr(x)+1;else{const M=nr(x);M>1&&(C=M-1),new hk(n,x,{start:C+1}).fix()}E=Xa(x)}else{const M=_P(x,i);M&&(C=nr(M)+1)}else Ft(t)&&new hk(n,t,{start:1}).fix();const B={id:et(),type:"list",level:i,start:C,groupId:E,ordered:!1,text:l};return s.quoted&&(B.quoted=!0),s.heading&&(B.heading=s.heading),o==="ordered"?B.ordered=!0:(o==="checked"||o==="unchecked")&&(B.checkbox=o),{blockData:B,onConverted:(M,F)=>{new pl(M,F).fix()}}}function Za(n){return n.textOnly?"text-only":n.checkbox?n.checkbox:n.ordered?"ordered":"unordered"}function hF(n){var e,r;if(n.checkbox)return"";const t=(e=n.level)!=null?e:1;return n.ordered?`${LP(t,(r=n.start)!=null?r:1)}.`:IP(t)}function L0(n){return n==="checked"||n==="unchecked"}function pk(n,t,e,r){const i=t,{containerId:o,blockIndex:s}=r[r.length-1];if(s===0)return!0;const l=e.blocks[o][s-1];if(l.type!=="list")return!0;const c=Za(i),d=Za(l);return c!==d&&(!L0(c)||!L0(d))||(i.level||1)>(l.level||1)}function Ck(n,t,e,r){const i=t,{containerId:o,blockIndex:s}=r[r.length-1];if(s===e.blocks[o].length-1)return!0;const l=e.blocks[o][s+1];if(l.type!=="list")return!0;const c=Za(i),d=Za(l);return c!==d&&(!L0(c)||!L0(d))||(i.level||1)>(l.level||1)}function mF(n,t,e,r,i){var s,l,c;const o=t;if(r==="text")return((s=Nn.convertTo)==null?void 0:s.call(Nn,n,t,e,"text",i))||"";if(r==="markdown"){let d=((l=Nn.convertTo)==null?void 0:l.call(Nn,n,t,e,"markdown",i))||"";o.checkbox==="checked"?d=`[x] ${d}`:o.checkbox==="unchecked"&&(d=`[ ] ${d}`),o.ordered?d=`${o.start}. ${d}`:d=`- ${d}`;const h=o.level||0;return d=(h>0?" ".repeat(h-1):"")+d,pk(n,t,e,i)&&(d=`${d}`),Ck(n,t,e,i)&&(d=`${d}`,h<=1&&(d+=`
|
|
613
|
+
`,IO=Object.freeze(Object.defineProperty({__proto__:null,ClearIcon:XT,CloseIcon:qh,PrevIcon:fT,NextIcon:dT,MoreIcon:zp,TextColorIcon:Gp,ArrowDownIcon:Xh,ArrowUpIcon:mO,ArrowLeftIcon:gO,ArrowRightIcon:Wp,DeleteRowIcon:hT,DeleteColIcon:mT,MergeCellIcon:gT,SplitCellIcon:pT,DeleteTableIcon:CT,Heading1Icon:Yh,Heading2Icon:Qh,Heading3Icon:Jh,Heading4Icon:Zh,Heading5Icon:t0,Heading6Icon:e0,Heading7Icon:n0,Heading8Icon:r0,HeadingNIcon:pO,OrderedListIcon:ET,UnorderedListIcon:xT,CheckListIcon:AT,BlockquoteIcon:bT,AlignCenterIcon:o0,AlignLeftIcon:Pa,AlignRightIcon:i0,ImageIcon:vT,ImageMenuIcon:BT,ImageErrorIcon:Xp,ImageEmptyIcon:yT,LinkIcon:Zp,LinkOffIcon:kT,WarningIcon:qp,PasteSpecialIcon:TT,LaunchIcon:Yp,CodeIcon:KT,AudioIcon:OT,GraphIcon:CO,VideoIcon:NT,FileIcon:EO,MathIcon:AO,MathMenuIcon:RT,TableIcon:bO,TableMenuIcon:wT,BilibiliIcon:LT,YoukuIcon:IT,ModaoIcon:_T,FigmaIcon:DT,EditIcon:s0,CommentIcon:ul,RefreshIcon:ST,HelpIcon:Qp,CheckMarkIcon:Jp,TextIcon:Fa,RightArrowIcon:xO,TencentVideoIcon:MT,WebPageIcon:UT,UmlIcon:PT,DividingLineIcon:FT,HeadingH1Icon:vO,HeadingH2Icon:BO,HeadingH3Icon:TO,HeadingH4Icon:yO,HeadingH5Icon:kO,HeadingH6Icon:RO,HeadingH7Icon:wO,HeadingH8Icon:SO,CheckboxIcon:tC,QuoteIcon:eC,LinkHrefIcon:LO,OrderedIcon:rC,UnorderedIcon:nC,CopyIcon:VT,CutIcon:$T,DeleteIcon:HT,LockBlockIcon:jT,UnLockBlockIcon:zT,InsertBeforeIcon:GT,InsertAfterIcon:WT,MentionIcon:qT,CircleAddIcon:YT,LoadingIcon:QT,DragIcon:iC,UmlBrandIcon:l0,OnesLoadingIcon:JT,BoldIcon:ZT,ItalicIcon:ty,UnderlineIcon:ey,LineThroughIcon:ny,SubscriptIcon:iy,SuperscriptIcon:oy,InlineCodeIcon:ry,ToMindMapIcon:sy,FitIcon:ly,FullScreenIcon:oC,ExitFullScreenIcon:ay,CaretDownIcon:cy,StatusIcon:uy},Symbol.toStringTag,{value:"Module"}));function fy(){const n=v("span",["editor-loading-icon"],null);return n.innerHTML=JT,n}const Mlt="";function DO(n,t){const e=v("button",["editor-checkbox-wrapper"],null);e.setAttribute("data-button-id",n),t!=null&&t.includes("checked")&&z(e,"checked"),t!=null&&t.includes("disabled")&&(e.disabled=!0);const r=v("span",["editor-checkbox"],e);return v("span",["editor-checkbox-inner"],r),e}const Ult="",Ka=I("ui-command-bar-base"),_O={itemElementTag:"div",tippyArrow:!1},wx=class extends ye.TypedEmitter{constructor(e,r,i){var o,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=>{var r,i;if(!!this.isVisible&&!e.isComposing&&!pa(e.target)){if(this.subBar){this.subBar.handleDocumentKeydown(e);return}if(this.items.length!==0){if(e.key==="Escape"){if((i=(r=this.options).beforeClose)!=null&&i.call(r))return;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 s=this.items[o],l=this.getItemElementById(s.id);l&&this.emit("click",this,s,l)}}}});m(this,"handleDocumentMouseDown",e=>{var r,i;if(e.target instanceof Element){if((i=(r=this.options).beforeClose)!=null&&i.call(r,e))return;if(!this.isInCommandBar(e.target)){const o=this.listeners("closing");for(let s=0;s<o.length;s++)if(o[s](this,e)===!1)return;this.close("clickBackground")}}});m(this,"handleHidden",()=>{this.closeReason!=="fromHover"&&this.emit("close",this),this.close(null),Hg(this.id)});m(this,"handleShow",()=>{this.popper&&(this.popper.setAttribute("data-command-bar-id",this.id),this.options.classes&&z(this.popper,...this.options.classes),this.options.refuseOverflow&&this.popper.classList.add("reference-hidden")),this.emit("show",this),this.options.disablePageScroll&&$g(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 r=this.getParentCommandItemElement(e.target);if(!r)return;const i=this.getItemElementId(r),o=this.getItemById(i);if(this.selectItem(i),o.manualShowChildren)return;const s=o.childrenMenuId||"";this.showSubCommandBar(s)});m(this,"handleItemMouseLeave",e=>{var i,o;const r=this.getParentCommandItemElement(e.target);!r||((o=(i=this.subBar)==null?void 0:i.parentItem)==null?void 0:o.id)!==this.getItemElementId(r)&&(ot(r,"selected"),this.emit("selectionChange",this,""))});m(this,"handleItemClick",e=>{var s,l;const r=this.getParentCommandItemElement(e.target);if(!r)return;const i=this.getItemElementId(r),o=this.items.find(c=>c.id===i);if(!!o&&!(o.states&&o.states.indexOf("disabled")!==-1)){if(o.children&&o.children.length>0&&o.manualShowChildren){this.showSubCommandBar(o.childrenMenuId);return}if(!o.element&&(this.emit("click",this,o,r),this.options.autoClose)){if((l=(s=this.options).beforeClose)!=null&&l.call(s,e))return;this.close("clickItem")}}});m(this,"handleWheel",e=>{if(!this.options.disablePageScroll&&!document.querySelector(".editor-disable-scroll"))return;const r=e.target;if(!r||!(r instanceof Node))return;const i=r instanceof HTMLElement?r:r.parentElement;if(!i)return;const o=Xe(i);if(!re(this.content,o)){e.stopPropagation(),e.preventDefault();return}e.deltaY<0?o.scrollTop===0&&(e.stopPropagation(),e.preventDefault()):e.deltaY>0&&o.scrollTop+o.clientHeight>=o.scrollHeight&&(e.stopPropagation(),e.preventDefault())});this.id=(o=i==null?void 0:i.id)!=null?o:et(),this.options={..._O,...i},this.items=e,this.parentItem=(s=i==null?void 0:i.parentItem)!=null?s:null,this.closeable=r!=null?r: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,r){this.emit("click",this,e,r)}createPopperOptions(){var i,o;const e={modifiers:[]},r=this.options.overflowBoundary;return r&&((i=e==null?void 0:e.modifiers)==null||i.push({name:"flip",options:{boundary:r,fallbackPlacements:["top","bottom"]}})),this.options.padding&&((o=e==null?void 0:e.modifiers)==null||o.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 i;this.subBar&&e.findIndex(s=>{var l,c;return s.id===((c=(l=this.subBar)==null?void 0:l.parentItem)==null?void 0:c.id)})===-1&&((i=this.subBar)==null||i.destroy(),this.subBar=null),this.items=e;const r=this.createCommandBarContent(e);this.content.innerHTML="",Array.from(r.children).forEach(o=>{this.content.appendChild(o)})}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 r=e-1;for(;;){const i=this.items[r],o=i.type,l=!(i.states&&i.states.indexOf("disabled")!==-1);if(o!=="separator"&&o!=="section"&&l)return r;if(r-=1,r<0)return this.items.length-1}}getNextItemIndex(e){let r=e+1;for(;;){if(!this.items[r])return this.getNextItemIndex(-1);const i=this.items[r],o=i.type,l=!(i.states&&i.states.indexOf("disabled")!==-1);if(o!=="separator"&&o!=="section"&&l)return r;if(r+=1,r>this.items.length-1)return 0}}clearSelectedItem(){const e=this.getSelectedItem();if(!e)return;const r=this.getItemElementById(e.id);r&&ot(r,"selected")}selectItem(e){const r=this.getSelectedItem();if(r){if(r.id===e)return;const o=r.id,s=this.getItemElementById(o);s&&ot(s,"selected")}const i=this.getItemElementById(e);i?(z(i,"selected"),this.emit("selectionChange",this,i.getAttribute("data-id")||""),this.options.disableSelectedScroll||i.scrollIntoView({block:"nearest"})):this.emit("selectionChange",this,"")}showSubCommandBar(e){var s,l,c,d;const r=this.getSelectedItem();if(!r||!r.children&&((l=(s=this.subBar)==null?void 0:s.parentItem)==null?void 0:l.manualShowChildren))return;if(this.subBar){if(((c=this.subBar.parentItem)==null?void 0:c.id)===r.id){r.manualShowChildren&&this.subBar.close("switchItem");return}this.subBar.destroy(),this.subBar=null}if(!r.children)return;const i=this.getItemElementById(r.id);if(!i)return;const o=wx.createSubCommandBar(r,(d=this.closeable)!=null?d:this,e?{id:e}:{});this.subBar=o,this.subBar.on("click",(h,C,E)=>{this.emit("click",h,C,E)}),this.subBar.on("close",()=>{var h;(h=this.subBar)==null||h.destroy(),this.subBar=null,ot(i,"active")}),r.beforePopup&&r.beforePopup(o),this.subBar.manualShow(i,this.getSubBarOptions(r)),z(i,"active")}isInCommandBar(e){if(!e||!(e instanceof Node))return!1;const r=this.getCommandBarRoot();return r&&re(r,e)||re(this.content,e)?!0:this.subBar?this.subBar.isInCommandBar(e):!1}createCommandItem(e){var o,s,l,c;let r=(o=this.options.itemElementTag)!=null?o:"div";e.element&&(r="div");const i=v(r,["command-item"],null);return i.setAttribute("data-id",e.id),e.type==="separator"?i.classList.add("separator"):e.type==="section"?(i.classList.add("section","text"),e.element&&(typeof e.element=="function"?i.appendChild(e.element(e)):i.appendChild(e.element))):((s=e.states)!=null&&s.includes("selected")&&i.classList.add("selected"),(l=e.states)!=null&&l.includes("checked")&&i.classList.add("checked"),(c=e.states)!=null&&c.includes("disabled")&&i.classList.add("disabled"),i.onclick=this.handleItemClick,i.onmouseenter=this.handleItemMouseEnter,i.onmouseleave=this.handleItemMouseLeave,e.element?typeof e.element=="function"?i.appendChild(e.element(e)):i.appendChild(e.element):i.classList.add("standard")),this.initItemElement(e,i),i}getItemById(e){const r=this.items.find(i=>i.id===e);return p(Ka,r,`can not find command item for id: ${e}`),r}getSelectedItem(){const e=this.content.querySelector(":scope >.editor-command-bar >.command-item.selected");if(e){const r=this.getItemElementId(e),i=this.items.find(o=>o.id===r);return p(Ka,i,`can not find command item for id: ${r}`),i}return null}getItemElementId(e){const r=e.getAttribute("data-id");return p(Ka,r,"no data-id attribute"),r}getItemElementById(e){const r=this.content.querySelector(`:scope >.editor-command-bar > .command-item[data-id="${e}"]`);return p(Ka,r,`no exists command item, id=${e}`),r}getParentCommandItemElement(e){if(!e||!(e instanceof Element))return null;if(wt(e,"command-item"))return e;const r=e.closest(".command-item");return r||null}createCommandBarContent(e){this.content&&this.content.removeEventListener("wheel",this.handleWheel);const r=v("div",["editor-command-bar-root"],null);if(this.options.header){const o=v("div",["editor-command-bar-header"],null);if(this.options.header instanceof Function){const s=this.options.header();s&&o.appendChild(s)}else o.appendChild(this.options.header);this.header=o,this.header&&r.appendChild(this.header)}const i=v("div",["editor-command-bar"],r);if(e.forEach(o=>{var l;const s=this.createCommandItem(o);i.appendChild(s),o.element&&o.setCloseable&&o.setCloseable((l=this.closeable)!=null?l:this)}),this.options.footer){const o=v("div",["menu-item","editor-command-bar","footer"],null);if(this.options.footer instanceof Function){const s=this.options.footer();s&&o.appendChild(s)}else o.appendChild(this.options.footer);this.footer=o,this.footer&&r.appendChild(this.footer)}return(this.options.header||this.options.footer)&&z(r,"scrollable-bar"),this.initCommandBarElement(i),r.addEventListener("wheel",this.handleWheel,{passive:!1}),r}getSubBarOptions(e){var r;return{placement:(r=e.childrenPlacement)!=null?r:"right-start",offset:e.childrenOffset,arrow:e.childArrow}}static registerManualCommandBar(e,r){this.commandBarCreators.set(e,r)}static createSubCommandBar(e,r,i){var l;p(Ka,e.children&&e.children.length>0,"no item children");const o=(l=e.childrenType)!=null?l:"menu",s=this.commandBarCreators.get(o);return p(Ka,s,`no creator for command type: ${o}`),s(e,r,i)}static hasExistsCommandBar(){return!!document.querySelector("[data-command-bar-id]")}};let fl=wx;m(fl,"commandBarCreators",new Map),I("ui-command-bar");class a0 extends fl{constructor(){super(...arguments);m(this,"tippyInstance",null)}manualShow(e,r){var i,o,s;if(!this.isVisible){if(this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.tippyInstance=Z6.default(e,{interactive:!0,content:this.content,trigger:"manual",triggerTarget:null,hideOnClick:!1,placement:(i=r==null?void 0:r.placement)!=null?i:"bottom-start",maxWidth:650,arrow:(o=r==null?void 0:r.arrow)!=null?o:this.options.tippyArrow,appendTo:document.body,onShow:this.handleShow,onHidden:this.handleHidden,theme:r==null?void 0:r.theme,getReferenceClientRect:r==null?void 0:r.getReferenceClientRect,offset:(s=r==null?void 0:r.offset)!=null?s:[0,0],popperOptions:this.createPopperOptions()}),r!=null&&r.point){const{x:l,y:c}=r.point;this.tippyInstance.setProps({getReferenceClientRect:()=>new DOMRect(l,c,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 r;super.close(e),this.isVisible&&((r=this.tippyInstance)==null||r.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,r;return(r=(e=this.tippyInstance)==null?void 0:e.state.isVisible)!=null?r:!1}get popper(){return this.content.closest("[data-tippy-root]")}}const dy=I("ui-base");class Va extends a0{constructor(t,e){var o;const r=(o=e==null?void 0:e.id)!=null?o:`popup-${et()}`,i=[{id:r,name:"",element:t}];super(i,void 0,{disablePageScroll:!0,id:r,beforeClose:e==null?void 0:e.beforeClose})}initCommandBarElement(t){z(t,"popper")}initItemElement(t,e){}get popupContent(){const t=this.items[0];p(dy,t,"no dialog item");const e=typeof t.element=="function"?t.element(t):t.element;return p(dy,e,"no item element"),e}}const fo=I("filterable-list");function hy(n){var e,r;const t=v("div",["list-item"],null);return t.setAttribute("data-id",n.id),t.appendChild(v("div",["list-item-text"],null,n.name)),(e=n.states)!=null&&e.includes("selected")&&(z(t,"selected"),Hs(Jp,["list-item-selected-icon"],t)),(r=n.states)!=null&&r.includes("disabled")&&z(t,"disabled"),t}function my(n){const t=v("div",["list-root"],null);return n.forEach(e=>{t.appendChild(hy(e))}),n.length||t.appendChild(hy({id:"placeholder",states:["disabled"],name:D.t("search.emptyTips")})),t}function gy(n,t){return n.map(e=>({...e,states:t===e.id?["selected"]:[]}))}function MO(n,t){const e=v("div",["filterable-list"],null),r=v("div",["filter"],e),i=v("div",["filter-container"],r),o=v("input",["filter-input"],i);t&&t.placeholder&&(o.placeholder=t.placeholder);const s=v("div",["list"],e),l=my(gy(n,t==null?void 0:t.initialSelectedId));return s.appendChild(l),e}function py(n,t,e){const r=n.querySelector(".list");p(fo,r,"no list root");const i=my(gy(t,e)),o=r.querySelector(".list-root");if(p(fo,o,"no exists menu"),Zc(o,i),e){const s=r.querySelector(".list-item.selected");s&&(p(fo,s,"no selected menu item"),s.scrollIntoView({block:"nearest"}))}}class UO{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");p(fo,t,"no input");const e=t.value.toLocaleLowerCase();this.setFilter(e)});m(this,"handleClick",t=>{this.processClick(t)});var r;this.items=t,this.options=e,this.root=MO(t,e),this.bindEvents(),this.selectedId=(r=e==null?void 0:e.initialSelectedId)!=null?r:"",this.visibleItems=t}bindEvents(){const t=this.root.querySelector(".filter-input");p(fo,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");p(fo,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,py(this.root,this.visibleItems,t)}focus(){const t=this.root.querySelector(".filter-input");p(fo,t,"no input"),t.focus()}moveSelectedItemIntoView(){const t=this.root.querySelector(".list-item.selected");t&&(p(fo,t,"no selected menu item"),t.scrollIntoView({block:"nearest"}))}reset(){this.setFilter("");const t=this.root.querySelector(".filter-input");p(fo,t,"no input"),t.value=""}setFilter(t){this.filter!==t&&(this.filter=t,this.visibleItems=this.items.filter(e=>e.name.toLocaleLowerCase().includes(t)),py(this.root,this.visibleItems,this.selectedId))}processClick(t){var s,l;const e=t.target;if(!(e instanceof HTMLElement))return;const r=e.closest(".list-item");if(!r)return;const i=(s=r.getAttribute("data-id"))!=null?s:"",o=(l=this.visibleItems.find(c=>c.id===i))!=null?l:null;this.onSelected&&this.onSelected(this,o)}processKeyDown(t){var e;if(t.key==="ArrowUp"){let r=this.getSelectedIndex();r===-1?r=this.visibleItems.length-1:r>0&&(r-=1);let i="";r!==-1&&(i=this.visibleItems[r].id),this.setSelectedId(i);return}if(t.key==="ArrowDown"){let r=this.getSelectedIndex();r===-1?r=0:r<this.visibleItems.length-1&&(r+=1);let i="";r!==-1&&(i=this.visibleItems[r].id),this.setSelectedId(i);return}if(t.key==="Enter"){const r=(e=this.visibleItems.find(i=>i.id===this.selectedId))!=null?e:null;this.onSelected&&this.onSelected(this,r)}}}class OO extends UO{constructor(e,r,i){super(e,i);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 Va(this.root)}destroy(){super.destroy(),this.onShow=null,this.onHide=null}show(e){this.reset(),this.popup.manualShow(e,{theme:"dropdown-list"}),this.focus(),this.moveSelectedItemIntoView()}processKeyDown(e){super.processKeyDown(e),(e.key==="Esc"||e.key==="Enter")&&this.popup.close("cancelBar")}processClick(e){super.processClick(e);const r=e.target;!(r instanceof HTMLElement)||!r.closest(".list-item")||this.popup.close("clickItem")}}const Olt="",Nlt="";function NO(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 PO(n,t){var e,r;if(z(t,"menu-item"),!n.element){if(n.type==="section"){const i=v("div",["section-name"],null,n.name);t.appendChild(i)}else if(n.type!=="separator"){if(n.icon){const o=v("div",["menu-item-icon"],null);n.icon&&(o.innerHTML=n.icon),t.appendChild(o)}const i=v("div",["menu-item-name","text"],null);if(v("span",[],i,n.name),n.ellipsisTooltip&&(t.setAttribute("data-editor-tooltip-allow-markdown","true"),t.setAttribute("data-editor-tooltip-offset-y","25"),t.setAttribute("data-editor-tooltip-placement","right"),t.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&&(t.setAttribute("data-editor-tooltip-placement","right"),t.setAttribute("data-editor-tooltip-common",n.disableReason)),t.appendChild(i),n.subText&&v("div",["item-subtext","text"],t,n.subText),n.children&&!n.element){const o=v("div",["menu-item-sub-indicator"],null);o.innerHTML=Wp,t.appendChild(o)}if((r=n.states)!=null&&r.includes("checked")){const o=v("div",["menu-item-checked-icon"],null);o.innerHTML=Jp,t.appendChild(o)}}}}class ls extends a0{constructor(t,e,r){super(t,e,{autoClose:!0,disablePageScroll:!0,beforeClose:r==null?void 0:r.beforeClose,...r})}manualShow(t,e){const r={theme:"menu",...e};super.manualShow(t,r)}initCommandBarElement(t){z(t,"menu")}initItemElement(t,e){PO(t,e)}}function FO(n,t,e){var r;return new ls((r=n.children)!=null?r:[],t,{...e,parentItem:n})}function Cy(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 r=t;if(!n.element)if(n.icon){const i=v("span",["toolbar-item-icon-container"],r);n.icon.trim().startsWith("<")?i.innerHTML=n.icon:i.innerText=n.icon}else{const i=v("span",["toolbar-item-name-container"],r);i.innerText=n.name}if(n.dropdown){t.setAttribute("data-dropdown","true");const i=v("span",["toolbar-item-dropdown-container"],r);i.innerHTML=Xh}n.states&&(n.states.indexOf("checked")!==-1&&z(r,"checked"),n.states.indexOf("disabled")!==-1&&(r.disabled=!0))}class ju extends a0{constructor(t,e,r){super(t,e,{itemElementTag:"button",tippyArrow:!1,...r})}getSubBarOptions(t){var i,o;const e=()=>{const s=this.getItemElementById(t.id),c=this.content.getBoundingClientRect(),d=s.getBoundingClientRect();return new DOMRect(d.left,c.top,d.width,c.height)};return{placement:(i=t.childrenPlacement)!=null?i:"top",getReferenceClientRect:e,offset:(o=t.childrenOffset)!=null?o:[0,4]}}manualShow(t,e){const r={theme:"toolbar",...e};super.manualShow(t,r)}initCommandBarElement(t){z(t,"toolbar")}initItemElement(t,e){Cy(t,e,this.options)}}function KO(n,t,e){var r;return new ju((r=n.children)!=null?r:[],t,{...e,parentItem:n})}class VO extends fl{constructor(t,e,r){super(e,void 0,r),t.appendChild(this.content),document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}initCommandBarElement(t){z(t,"toolbar","fixed")}initItemElement(t,e){Cy(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 Plt="";fl.registerManualCommandBar("menu",FO),fl.registerManualCommandBar("toolbar",KO);const Flt="",Ey=I("ui-base");class zu extends a0{constructor(e,r){super(zu.getCommandItems(e,r),void 0,{disablePageScroll:!0,...r});m(this,"handleDocumentMouseDown",e=>{})}initCommandBarElement(e){z(e,"dialog","manual")}initItemElement(e,r){}show(e,r){this.manualShow(e,{...r,theme:"light"})}get dialogContent(){const e=this.items[0];p(Ey,e,"no dialog item");const r=e.element;return p(Ey,r,"no item element"),r}static getCommandItems(e,r){var s;return[{id:(s=r==null?void 0:r.id)!=null?s:`manual-dialog-${et()}`,name:"",element:e}]}}const Klt="",$O=I("ui-base");class xy{constructor(t){m(this,"menu");m(this,"currentText","");m(this,"handleSearchText");m(this,"handleClick",ke.default((t,e)=>{this.options.onClickItem(this,e)},300,{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 ls([],void 0,{id:t.id,header:t.header,footer:t.footer,disableSelectedScroll:t.disableSelectedScroll}),this.menu.addListener("click",this.handleClick),this.menu.addListener("close",this.handleClose),this.menu.addListener("show",this.handleShow),this.options.wait?this.handleSearchText=ke.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(r=>r.type!=="section"&&r.type!=="separator");e&&this.menu.selectItem(e.id)}}async popup(t,e){var i,o;if(!(e!=null&&e.noEvent)&&((o=(i=this.options).onShow)==null?void 0:o.call(i,this))===!1)return;this.menu.manualShow(t),this.options.placeholder&&this.showPlaceholder();const r=await this.options.queryItems(this,"");this.highlightText("",r),this.setItems(r)}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||D.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()}isInCommandBar(t){return this.menu.isInCommandBar(t)}async handleSearchTextPure(t){this.currentText=t;const e="auto-suggest";try{await Mr.lock(e),this.showLoading();const r=this.currentText,i=await this.options.queryItems(this,t);if(this.currentText===r&&(this.currentText=""),i.length===0){this.showNoResultMessage(t);return}this.setItems(i),this.options.highlight&&this.highlightText(r.replace(/^\s+|\s+$/g,""),i)}finally{Mr.release(e)}}highlightText(t,e){$O.debug(`highlight menu text: ${t}`);const r=this.menu.content,i=(s,l)=>{if(!l)return s;let c="";const d=l.length,h=l.toLocaleLowerCase();let C=0;for(C=0;C<=s.length-d;C){let E=s.substring(C,C+d);if(E.toLocaleLowerCase()===h){C+=d;const x=s.charAt(C);let B=!1;E.endsWith(" ")&&(B=!0,E=E.trimEnd()),c+=`<span class="highlight">${E}${x===" "||B?" ":""}</span>`}else c+=s.charAt(C),C++}return C<s.length&&(c+=s.substring(C)),c},o=s=>{if(wt(s,"text")){const l=e==null?void 0:e.find(h=>h.id===s.getAttribute("data-id"));if(l&&l.element)return;const c=s.textContent;if(!c)return;const d=i(c,t);s.innerHTML=d;return}Array.from(s.children).forEach(o)};o(r)}}class sC{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 r,i;(i=(r=this.options)==null?void 0:r.onClickItem)==null||i.call(r,e)});m(this,"handleInput",()=>{this.autoSuggest.handleSearchText(this.input.value),this.updatePlaceholder()});m(this,"handleClear",t=>{var e,r;this.clear(),this.autoSuggest.handleSearchText(""),t.preventDefault(),t.stopPropagation(),(r=(e=this.options)==null?void 0:e.onClear)==null||r.call(e)});m(this,"handleQueryItems",async(t,e)=>this.items.filter(i=>{var o;return(o=this.options)!=null&&o.filter?this.options.filter(i,e):!0}));m(this,"handleShow",()=>{z(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 c,d,h,C,E;this.options=e,this.labels=(d=(c=this.options)==null?void 0:c.labels)!=null?d:[];const{root:r,input:i,text:o,clearIcon:s,dropdownIcon:l}=sC.createDropdown(t,this.labels);this.root=r,this.input=i,this.text=o,this.clearIcon=s,this.dropdownIcon=l,this.autoSuggest=new xy({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,disableSelectedScroll:e==null?void 0:e.disableSelectedScroll}),this.items=(E=(C=this.options)==null?void 0:C.items)!=null?E:[],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 r=v("div",["editor-dropdown","empty"],t),i=v("input",["dropdown-input"],r),o=v("div",["dropdown-text"],r),s=v("div",["dropdown-labels"],r);for(let d=0;d<e.length;d+=1){const h=e[d];v("span",["dropdown-label"],s,h)}const l=v("div",["dropdown-clear-icon"],r);l.innerHTML=XT;const c=v("div",["dropdown-icon"],r);return c.innerHTML=Xh,{root:r,input:i,text:o,clearIcon:l,dropdownIcon:c}}updateLabels(){const t=this.root.querySelector(".dropdown-labels");if(t){t.innerHTML="";for(let e=0;e<this.labels.length;e+=1){const r=this.labels[e];v("span",["dropdown-label"],t,r)}}}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),z(this.root,"empty")}else ot(this.root,"empty")}}const HO=[-1,6,0,1,2,3,4,5],jO=[-1,6,0,1,2,3,4,5,14,13,7,8,9,10,11,12],Ay=I("color-palette");function by(n,t,e,r){p(Ay,n>0,"no color in palette");const i=t||1;p(Ay,i>0,`invalid palette rows: ${i}`);const o=n/i,s=v("div",["palette-container",r],null);for(let l=0;l<i;l++){const c=v("div",["palette-container-row"],s);for(let d=0;d<o;d++){const h=e(l*o+d);c.appendChild(h)}}return s}function zO(n){const t=v("button",["color-button"],null),e=HO[n];return t.setAttribute("data-color-index",`${e}`),t.innerHTML=Gp,t}function GO(n){const t=v("button",["background-color-button"],null),e=jO[n];return t.setAttribute("data-color-index",`${e}`),t}function WO(){const n=v("div",["clear-button-container"],null),t=v("button",["clear-button"],n);return t.innerText=D.t("colorPalette.reset"),n}function qO(n){const t=v("div",["color-palette"],null);return n.color!==!1&&(v("div",["bar-desc"],t,D.t("colorPalette.colorDesc")),t.appendChild(by(8,1,zO,"color"))),n.backgroundColor!==!1&&(v("div",["bar-desc"],t,D.t("colorPalette.backgroundDesc")),t.appendChild(by(16,2,GO,"background-color"))),n.clearColorButton!==!1&&t.appendChild(WO()),t}function XO(n,t,e){const r=t==="color"?"color":"background-color",i=n.querySelector(`.${r} button.selected`);i&&ot(i,"selected"),e===null&&(e=-1);const o=n.querySelector(`.${r} button[data-color-index="${e}"]`);o&&z(o,"selected")}const Vlt="",YO={};class QO extends ye.TypedEmitter{constructor(e=YO){super();m(this,"root");m(this,"handleClick",e=>{const r=e.target;if(!r||!(r instanceof Element))return;const i=r.closest("button");if(!i)return;if(wt(i,"clear-button")){this.setColor("backgroundColor",null),this.setColor("color",null),this.emit("onClick","clearColor",0);return}const o=i.getAttribute("data-color-index");if(!o)return;const s=Number.parseInt(o,10);Number.isNaN(s)||(wt(i,"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=qO(e),this.root.addEventListener("click",this.handleClick)}destroy(){this.removeAllListeners(),this.root.removeEventListener("click",this.handleClick)}setColor(e,r){XO(this.root,e,r)}}class vy{constructor(t,e){m(this,"name","Color Palette");m(this,"element");m(this,"palette");m(this,"closeable",null);this.id=t,this.palette=new QO(e),this.element=this.palette.root}setCloseable(t){this.closeable=t}destroy(){this.palette.destroy(),this.closeable=null}}function JO(){const n=v("button",["color-button"],null);return n.innerHTML=Gp,n}function lC(n,t){const[e,r]=t;e===null?n.removeAttribute("data-color"):n.setAttribute("data-color",`${e}`),r===null?n.removeAttribute("data-background-color"):n.setAttribute("data-background-color",`${r}`)}class By extends ye.TypedEmitter{constructor(e){super();m(this,"id","text-color-item");m(this,"name",D.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,r)=>{this.emit("onClick",e,r)});m(this,"setLatestColors",(e,r)=>{e==="color"||e==="backgroundColor"?e==="color"?this.latestColors[0]=r:this.latestColors[1]=r:this.latestColors=[null,null],lC(this.element,this.latestColors)});m(this,"beforePopup",()=>{this.updatePaletteColor(this.latestColors),this.emit("beforePopup")});this.editor=e,this.colorPaletteItem=new vy("text-color-palette-item"),this.colorPaletteItem.palette.addListener("onClick",this.handlePaletteClick),this.children.push(this.colorPaletteItem),this.element=JO()}destroy(){this.colorPaletteItem.destroy()}updatePaletteColor(e){this.colorPaletteItem.palette.setColor("color",e[0]),this.colorPaletteItem.palette.setColor("backgroundColor",e[1]),this.latestColors=e,lC(this.element,this.latestColors)}updateButtonColor(e){this.latestColors=e,lC(this.element,this.latestColors)}}const $lt="";function c0(n,t){const e=v("div",["editor-input-wrap"],n);if(t!=null&&t.className&&z(e,t==null?void 0:t.className),t.label){const s=v("div",["editor-input-label"],e);v("span",[],s,t.label),t.required&&z(s,"required")}const r=v("div",["editor-input-container"],e),i=v("input",["editor-input"],null);if(t.placeholder&&(i.placeholder=t.placeholder),t.defaultValue&&(i.value=t.defaultValue),t.maxLength&&(i.maxLength=t.maxLength),t.maxLength){const s=v("div",["editor-input-suffix"],r);v("span",[],s,`${i.value.length} / ${t.maxLength}`),i.addEventListener("input",l=>{const c=l.target;s.innerText=`${c.value.length} / ${t.maxLength}`})}r.appendChild(i);const o=v("div",["editor-input-error"],e);return i.addEventListener("input",s=>{var l;(l=t.onChange)==null||l.call(t,s),ot(e,"error")}),Hd(i,(s,l)=>{var c;(c=t.onKeyDown)==null||c.call(t,s,l)}),{getField:()=>i,getInputValue:()=>i.value,setFieldError:s=>{z(e,"error"),o.innerText=s},focus:()=>{setTimeout(()=>{i.focus()})}}}function aC(n){const t=document.getSelection();if(!t)return!0;const e=t.focusNode;if(!e)return!0;const r=t.focusOffset,i=e.childNodes[r];if(!i)return!0;if(i instanceof HTMLElement){const o=i.tagName.toLowerCase();if(i===n.input.inputElement)return!0;if(o==="input"||o==="textarea")return!1}return!0}class ZO extends xy{constructor(e,r){super(r);m(this,"handleClose",()=>{var e,r;aC(this.editor)&&this.editor.focus(),(r=(e=this.options).onClose)==null||r.call(e)});this.editor=e,this.editorOptions=r}async popupInEditor(e,r,i){var d,h;if(((h=(d=this.editorOptions).onShow)==null?void 0:h.call(d,this,e,r,i))===!1)return;this.options.showLoading&&this.showLoading();const o=this.editor.getBlockByIndex(e,r);if(!re(this.editor.rootContainer,o)||dt(this.editor,o)<i)return;const s=Yi(this.editor,o,ve(this.editor,o,i));if(s.length===0)return;const l=s[0],c=Zi(this.editor,o,"editor-auto-suggest-menu",l);super.popup(c,{noEvent:!0})}}const cC=I("auto-suggest-menu");class uC{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 r,i;if(!((r=this.menu)!=null&&r.isVisible))return;const e=t.selection.range.start;if(e.isSimple()&&e.blockId===((i=this.anchor)==null?void 0:i.blockId)&&e.offset>=this.anchor.offset){const o=t.getBlockById(e.blockId);if(de(Mn(yn(t,o),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:r,offset:i}=e,o=t.getBlockById(r),s=de(xh(t,o,i));if(p(cC,this.anchor,"no anchor"),!s.startsWith(this.anchor.leftText))return!1;const l=this.anchor.offset-this.anchor.trigger.length,c=i-l;return t.selection.selectBlock(o,l),c&&(t.deleteTextFromBlock(o,l,c),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,r,i)=>{var o;if((o=this.options)!=null&&o.onShow)return this.options.onShow(this,e,r,i)});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 i,o;return(o=(i=this.options).renderMenuItem)==null?void 0:o.call(i,this,e)});m(this,"hasExistsMenuThemeCommandBar",()=>!!document.querySelector('div.tippy-box[data-theme="menu"]'));this.editor=t,this.options=e,this.menu=new ZO(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 r;return!((r=this.menu)!=null&&r.isVisible)||Pg(e.key)?!1:ev(e)&&!qs(e)?(setTimeout(()=>{this.resetItems()}),!1):Gd(e)?(this.menu.close(),!0):(this.menu.handleKeydown(e),!0)}popup(t,e,r,i){this.anchor={blockId:lt(t),offset:e,leftText:r,trigger:i};const o=ct(it(t)),s=vt(t);this.menu.popupInEditor(o,s,e)}handleAfterInsertText(t,e,r,i,o){var h,C;const s=t.selection.range.start;if(!s.isSimple())return!1;const l=t.getBlockByIndex(e,r);if(qi(l))return!1;const{blockId:c,offset:d}=s;if(lt(l)!==c)return!1;if((h=this.menu)!=null&&h.isVisible)this.resetItems();else if(this.options.trigger.indexOf(o)!==-1){if(i>0&&this.options.needSpaceBeforeTrigger&&(((C=t.getBlockData(l).text)==null?void 0:C.reduce((k,w)=>k+w.insert,""))||"")[i-1].trim().length!==0||this.hasExistsMenuThemeCommandBar())return!1;const E=de(xh(t,l,d));this.popup(l,d,E,o)}return!1}handleUpdateCompositionText(t,e,r,i,o){var d;const s=t.selection.range.start;if(!s.isSimple())return!1;const{blockId:l}=s,c=t.getBlockByIndex(e,r);return lt(c)!==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:r,offset:i}=e,o=t.getBlockById(r),s=de(xh(t,o,i));if(p(cC,this.anchor,"no anchor"),s.startsWith(this.anchor.leftText)){const c=s.substring(this.anchor.leftText.length);cC.debug(`search text: ${c}`),this.menu.handleSearchText(c)}}destroy(){var t;this.editor.input.removeHandler(this),this.editor.removeListener("selectionChanged",this.handleSelectionChanged),(t=this.menu)==null||t.destroy()}}function tN(){const n={};for(let t=1;t<=8;t++)n[`heading-${t}`]={shortcut:`/h${t}`};return n}const eN={"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"},...tN()};function kn(n){var t;return(t=eN[n])==null?void 0:t.shortcut}function nN(n){var t;return(t=n.subText)!=null?t:""}const yi=I("table-dom");function ki(n){return`${lt(n)}_scroll`}function ze(n){const t=n.querySelector("div[data-type=table-content] >table");return p(yi,t instanceof HTMLTableElement,"invalid table"),t}function Ri(n,t){const r=n.getCustom(ki(t)).contentElement.firstElementChild;p(yi,r instanceof HTMLElement,"invalid table content");let i=r.querySelector(":scope >div[data-type=table-tools]");return i||(i=v("div",[],r),i.setAttribute("data-type","table-tools"),n.domEvents.addEventListener(i,"dblclick",(o,s)=>s.stopPropagation()),n.domEvents.addEventListener(i,"click",(o,s)=>{s.detail===3&&s.stopPropagation()})),p(yi,i,"no table tools"),i}function rN(n,t){return n.findCustom(ki(t))?Ri(n,t):null}function Ty(n){const t=[];return Array.from(n.rows).forEach(e=>{t.push(...Array.from(e.cells))}),t}function Gu(n){const t=n.querySelector(":scope div[data-type=editor-container]");return p(yi,t,"no child container in cell"),t}function iN(n){const r=Ty(n).map(i=>{const o=Gu(i),s=ct(o),l=i.colSpan,c=i.rowSpan;return`${s}/${l}/${c}`}).join();return Md.default(r)}function Ge(n){return Dt(n)==="table"}function fC(n){const t=it(n);if(qt(t))return null;const e=Z(t);return p(yi,e,"no parent block"),Ge(e)?t:fC(e)}function ho(n){if(Ge(n))return n;const t=it(n);if(qt(t))return null;const e=Z(t);return p(yi,e,"no parent block"),Ge(e)?e:ho(e)}function oN(n,t){const e=n.querySelector("colgroup");p(yi,e,"no colgroup");const r=e.children[t];return p(yi,r,"no col"),p(yi,r instanceof HTMLTableColElement,`invalid col: ${r.tagName}`),r}function yy(n){try{return ze(n),!0}catch{return!1}}function sN(n){return oe(n).querySelector(":scope > .block-helper")}function ky(n){const t=Z(n.contentElement);p(yi,t,"no block");const e=sN(t);if(e){const o=Math.min(n.contentElement.offsetLeft+29,n.rootElement.scrollLeft),s=t.getBoundingClientRect().width;e.style.right=`${o+s+5}px`}}function lN(n){const t=n.getComponentOptions("table"),e=t==null?void 0:t.bigTableBoundary;if(!e)return!1;const r=n.rootContainer.querySelectorAll("div[data-type=table-content] >table");let i=!1;return r.forEach(o=>{o.getBoundingClientRect().width>e&&(i=!0)}),i}const Xr=I("doc-table-grid");class aN{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){p(Xr,t>=0&&t<this.cols(),`set cell, invalid col: ${t}`),this._cells[t]=e}getCell(t){p(Xr,t>=0&&t<this.cols(),`get cell, invalid col: ${t}`);const e=this._cells[t];return p(Xr,e,"get cell, no cell"),e}getCellAllowEmpty(t){return p(Xr,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 u0{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 aN(this.colCount));this.fillGrid()}get rowCount(){return this._data.rows}get colCount(){return this._data.cols}getNextEmptyCell(t,e){let r=t,i=e;for(;;){if(r+=1,r===this.colCount&&(r=0,i+=1),i>=this.rowCount)return null;if(this._rows[i].getCellAllowEmpty(r)===void 0)return{col:r,row:i}}}fillGrid(){const t=this._data.children;p(Xr,t,"no children");let e=0,r=0;t.forEach((i,o)=>{const s=this._data[`${i}_colSpan`]||1,l=this._data[`${i}_rowSpan`]||1;for(let d=0;d<l;d++)for(let h=0;h<s;h++)this._rows[r+d].setCell(e+h,{col:e,row:r,containerId:i,virtual:h!==0||d!==0,colSpan:s,rowSpan:l});const c=this.getNextEmptyCell(e,r);c?(e=c.col,r=c.row):p(Xr,o===t.length-1,`invalid table data, no next empty cell: ${JSON.stringify(this._data)}`)}),this._rows.forEach(i=>{i.forEach(o=>{p(Xr,o,"no cell"),p(Xr,o.containerId,"no containerId")})})}getCell(t){const{col:e,row:r}=t,i=this._rows[r];p(Xr,i,`get cell, no row: ${r}`);const o=i.getCell(e);return p(Xr,o,`get cell, no cell: ${e}`),o}getRow(t){const e=this._rows[t];return p(Xr,e,`get row, no row: ${t}`),e}forEach(t){this._rows.forEach(t)}}const f0=I("table-data");function cN(n){const t=n.firstElementChild;return p(f0,t,"no child element for cell"),p(f0,Xi(t),"cell first child is not a container"),p(f0,Fr(t),"cell first child is not a container"),t}function uN(n){const t=Z(n);p(f0,t,"no parent block for table");const e=[],r={};Array.from(n.rows).forEach(l=>{Array.from(l.cells).forEach(c=>{const d=cN(c),h=ct(d);e.push(h),(c.colSpan>1||c.rowSpan>1)&&(r[`${h}_colSpan`]=c.colSpan,r[`${h}_rowSpan`]=c.rowSpan)})});const i=n.rows.length,o=Array.from(n.rows[0].cells).map(l=>l.colSpan).reduce((l,c)=>l+c,0);return{id:lt(t),type:Dt(t),rows:i,cols:o,children:e,colsWidth:Array(o).fill(100),...r}}function dl(n){return new u0(n)}function fN(n){return dl(uN(n))}const Ze=I("table-grid"),dN=60;class hN{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 p(Ze,e,"no parent cell for child container"),e}get container(){const t=this.table.querySelectorAll(`[data-container-id=${this.containerId}]`);p(Ze,t.length===1,"containers !== 1"),p(Ze,Xi(t[0]),"not a container");const e=t[0];return p(Ze,Fr(e),"not a child container"),e}}class mN{constructor(t,e){m(this,"_cells",[]);e.forEach(r=>{this._cells.push(new hN(t,r))})}get cells(){return this._cells}getCell(t){return p(Ze,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 Sx=class{constructor(t){m(this,"_rows",[]);this.table=t,fN(t).forEach(i=>{this._rows.push(new mN(t,i))});const r=this.colCount;this._rows.forEach(i=>{p(Ze,i.cells.length===r,"row.cells.length !== colCount")})}get rowCount(){return this._rows.length}get colCount(){return this._rows.length===0?0:(p(Ze,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 p(Ze,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){p(Ze,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount,r=[];for(let i=0;i<e;i++){const o=this.getCell({row:i,col:t});r.push(o)}return r}toRealCells(t){const e=[];return t.forEach(r=>{const i=this.getRealCell(r);e.findIndex(o=>o.containerId===i.containerId)===-1&&e.push(i)}),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){p(Ze,t>=0&&t<this.colCount,"colIndex out of range");const e=this.rowCount;for(let r=0;r<e;r++){const i=this.getCell({row:r,col:t});if(i.virtual||i.colSpan>1||i.rowSpan>1)return i}}getRealCell(t){const e=this.getCell(t);if(!e.virtual)return e;const r=this.getCellById(e.containerId);return p(Ze,!r.virtual,"found a virtual cell"),r}getColumnSpannedRange(t){const e=this.getColumnRealCells(t);let r=1e5,i=-1;return e.forEach(o=>{r=Math.min(o.col,r),i=Math.max(o.col+o.colSpan-1,i)}),p(Ze,r<=i,"min > max"),p(Ze,r>=0,"min < 0"),p(Ze,i<this.colCount,"max >= colCount"),[r,i]}getRowSpannedRange(t){const e=this.getRowRealCells(t);let r=1e5,i=-1;return e.forEach(o=>{r=Math.min(o.row,r),i=Math.max(o.row+o.rowSpan-1,i)}),p(Ze,r<=i,"min > max"),p(Ze,r>=0,"min < 0"),p(Ze,i<this.rowCount,"max >= rowCount"),[r,i]}getSpannedRange(t,e){const r=Math.min(t.row,e.row),i=Math.max(t.row,e.row),o=Math.min(t.col,e.col),s=Math.max(t.col,e.col),l=[];for(let x=r;x<=i;x++)for(let B=o;B<=s;B++)l.push(this.getCell({row:x,col:B}));const c=this.toRealCells(l);let d=1e4,h=1e4,C=-1,E=-1;return c.forEach(x=>{h=Math.min(x.col,h),d=Math.min(x.row,d),E=Math.max(x.col+x.colSpan-1,E),C=Math.max(x.row+x.rowSpan-1,C)}),[{row:d,col:h},{row:C,col:E}]}getAllCells(){return this.getCells({col:0,row:0},{col:this.colCount-1,row:this.rowCount-1})}sub(t,e){const r=[];for(let i=t.row;i<=e.row;i++){const o=[];for(let s=t.col;s<=e.col;s++){const l=this.getCell({row:i,col:s});o.push(l)}r.push(o)}return r}getAllContainers(){return this.getAllCells().map(e=>e.container)}getCells(t,e){const r=[],i=this.getSpannedRange(t,e),o=i[0],s=i[1],l=Math.min(o.row,s.row),c=Math.max(o.row,s.row),d=Math.min(o.col,s.col),h=Math.max(o.col,s.col);for(let C=l;C<=c;C++)for(let E=d;E<=h;E++){const x=this.getCell({row:C,col:E});x.virtual||r.push(x)}return r}map(t){const e=[];for(let r=0;r<this.rowCount;r++){const i=[];for(let o=0;o<this.colCount;o++){const s=this.getCell({row:r,col:o});i.push(t(s))}e.push(i)}return e}getBottomCell(t){const e=this.rowCount;let r=t,i=t.row;for(;r.containerId===t.containerId;){if(i+=1,i>=e)return null;r=this.getCell({row:i,col:t.col})}return this.getRealCell(r)}getTopCell(t){let e=t,r=t.row;for(;e.containerId===t.containerId;){if(r-=1,r<0)return null;e=this.getCell({row:r,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,r=[];return e.forEach(i=>{i.forEach(o=>{r.indexOf(o)===-1&&r.push(o)})}),r}getCellById(t){const r=this.cells.find(i=>i.containerId===t);return p(Ze,r,"cell not found"),r}getCellByCellElement(t){const e=Gu(t);return this.getCellByContainerId(ct(e))}getCellByContainerId(t){return this.getCellById(t)}static fromTable(t){const e=iN(t),r=this.caches.getSync(e,()=>(Ze.debug("create table grid"),new Sx(t)));return r.table!==t?(this.caches.delete(e),this.fromTable(t)):r}static fromBlock(t){return this.fromTable(ze(t))}};let Mt=Sx;m(Mt,"caches",new Nb(dN));function d0(n,t){Object.entries(n).forEach(([e])=>{e.startsWith(`${t}/`)&&delete n[e]})}const gN=I("table-selection-range");function Yr(n,t,e){var M,F,Y,X;const r=Mt.fromBlock(n),i=t,o=e,s=r.getCellByContainerId(i.childContainerId),l=r.getCellByContainerId(o.childContainerId),c=i.custom,d=o.custom,h=(M=c==null?void 0:c.rowIndex)!=null?M:s.row,C=(F=c==null?void 0:c.colIndex)!=null?F:s.col,E=(Y=d==null?void 0:d.rowIndex)!=null?Y:l.row+l.rowSpan-1,x=(X=d==null?void 0:d.colIndex)!=null?X:l.col+l.colSpan-1,B=Math.min(h,E),k=Math.max(h,E),w=Math.min(C,x),U=Math.max(C,x);return{fromRow:B,toRow:k,fromCol:w,toCol:U}}function dC(n,t){const e=new Set,r=new Set,i=n.selection.range;if(!i.isSimple()&&i.start.blockId===lt(t)){const o=Mt.fromBlock(t),{start:s,end:l}=i;p(gN,!s.isSimple()&&!l.isSimple(),"invalid range");const{fromCol:c,toCol:d,fromRow:h,toRow:C}=Yr(t,s,l);if(h===0&&C===o.rowCount-1)for(let E=c;E<=d;E++)r.add(E);if(c===0&&d===o.colCount-1)for(let E=h;E<=C;E++)e.add(E)}return{selectedRows:e,selectedColumns:r}}function Wu(n,t){let e=null;if(t.isCollapsed()&&t.isSimple()){const r=n.getBlockById(t.start.blockId);if(Ge(r)){const i=it(r),o=Z(i);o&&(e=ho(o))}else e=ho(r)}else{const r=n.getBlockById(t.start.blockId),i=ho(r),o=n.getBlockById(t.end.blockId),s=ho(o);i===s&&(e=i)}return e}const $a=I("delete-columns");function Ry(n,t,e){const{start:r,end:i}=e;if(r.blockId!==i.blockId||e.isSimple()||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{fromRow:s,toRow:l}=Yr(t,e.start,e.end),c=Mt.fromBlock(t);return s===0&&l===c.rowCount-1}function hC(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{var F,Y;const e=t.getBlockById(n.start.blockId);if(!Ry(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromCol:r,toCol:i}=Yr(e,n.start,n.end),o=Mt.fromBlock(e);if(r===0&&i===o.colCount-1){t.deleteBlock(e);return}const s=new Set,l=o.map(X=>X.containerId);for(let X=0;X<l.length;X++){const G=l[X];for(let st=r;st<=i;st++){const pt=G[st];s.add(pt)}G.splice(r,i-r+1)}const c=new Set(l.flat()),d=new Set(Array.from(s).filter(X=>!c.has(X))),h=i-r+1,C=new Map,E=new Map;s.forEach(X=>{if(d.has(X))return;const G=o.getCellByContainerId(X);if(p($a,G.colSpan>1,"invalid effected cell, colSpan === 1"),G.col<r){p($a,c.has(X),"invalid effected cell, not exists");let Gt=G.col+G.colSpan-1;Gt>i&&(Gt=i);const Pe=Gt-r+1,he=G.colSpan-Pe;C.set(X,he);return}p($a,G.col<=i,"invalid effected cell, col > endCol");const st=G.col,pt=G.col+G.colSpan-1,Ct=G.col-r,yt=pt-st+1-h+Ct;p($a,yt>0,"invalid effected cell, newSpanned <= 0");const bt=oo(t.doc);E.set(X,{newContainerId:bt,colSpan:yt})});for(let X=0;X<l.length;X++){const G=l[X];for(let st=r;st<G.length;st++){const pt=G[st],Ct=E.get(pt);Ct&&(G[st]=Ct.newContainerId)}}const x=mt.default(t.getBlockData(e));((F=x.colsWidth)!=null?F:new Array(x.cols).fill(0)).splice(r,i-r+1),d.forEach(X=>{d0(x,X)}),C.forEach((X,G)=>{p($a,X>=1,"invalid modified colSpan, colSpan < 1"),X===1?x[`${G}_colSpan`]=void 0:x[`${G}_colSpan`]=X}),E.forEach((X,G)=>{d0(x,G);const{newContainerId:st,colSpan:pt}=X;p($a,pt>=1,"invalid newContainerData, colSpan < 1"),pt>1&&(x[`${st}_colSpan`]=pt);const Ct=o.getCellByContainerId(G).rowSpan;Ct>1&&(x[`${st}_rowSpan`]=Ct)});const k=(Y=l[0][r])!=null?Y:l[0][r-1],w=t.getChildContainerData(k)[0],U=Mt.virtualCellContainersGridToChildren(l),M={...x,cols:x.cols-h,children:U};dl(M),t.updateBlockData(e,M,ve(t,w.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(E.keys()))})}const Ha=I("delete-rows");function wy(n,t,e){const{start:r,end:i}=e;if(r.blockId!==i.blockId||e.isSimple()||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{fromCol:s,toCol:l}=Yr(t,e.start,e.end),c=Mt.fromBlock(t);return s===0&&l===c.colCount-1}function mC(n){const t=n.getEditor();t.undoManager.runInGroup(()=>{const e=t.getBlockById(n.start.blockId);if(!wy(t,e,n))return;if(n.isSimple()){t.deleteBlock(e);return}const{fromRow:r,toRow:i}=Yr(e,n.start,n.end),o=Mt.fromBlock(e);if(r===0&&i===o.rowCount-1){t.deleteBlock(e);return}const s=new Set,l=o.map(M=>M.containerId);for(let M=i;M>=r;M--)l[M].forEach(Y=>s.add(Y)),l.splice(M,1);const c=new Set(l.flat()),d=new Set(Array.from(s).filter(M=>!c.has(M))),h=i-r+1,C=new Map,E=new Map;s.forEach(M=>{if(d.has(M))return;const F=o.getCellByContainerId(M);if(p(Ha,F.rowSpan>1,"invalid effected cell, rowSpan === 1"),F.row<r){p(Ha,c.has(M),"invalid effected cell, not exists");let Ct=F.row+F.rowSpan-1;Ct>i&&(Ct=i);const yt=Ct-r+1,bt=F.rowSpan-yt;C.set(M,bt);return}p(Ha,F.row<=i,"invalid effected cell, col > endCol");const Y=F.row,X=F.row+F.rowSpan-1,G=F.row-r,st=X-Y+1-h+G;p(Ha,st>0,"invalid effected cell, newSpanned <= 0");const pt=oo(t.doc);E.set(M,{newContainerId:pt,rowSpan:st})});for(let M=r;M<l.length;M++){const F=l[M];for(let Y=0;Y<F.length;Y++){const X=F[Y],G=E.get(X);G&&(F[Y]=G.newContainerId)}}const x=mt.default(t.getBlockData(e));d.forEach(M=>{d0(x,M)}),C.forEach((M,F)=>{p(Ha,M>=1,"invalid modified rowSpan, rowSpan < 1"),M===1?x[`${F}_rowSpan`]=void 0:x[`${F}_rowSpan`]=M}),E.forEach((M,F)=>{d0(x,F);const{newContainerId:Y,rowSpan:X}=M;p(Ha,X>=1,"invalid newContainerData, rowSpan < 1"),X>1&&(x[`${Y}_rowSpan`]=X);const G=o.getCellByContainerId(F).colSpan;G>1&&(x[`${Y}_colSpan`]=G)});const B=l[r]?l[r][0]:l[r-1][0],k=t.getChildContainerData(B)[0],w=Mt.virtualCellContainersGridToChildren(l),U={...x,rows:x.rows-h,children:w};dl(U),t.updateBlockData(e,U,ve(t,k.id,0)),t.deleteChildContainers(Array.from(d)),t.deleteChildContainers(Array.from(E.keys()))})}const qu=I("table-range");function h0(n){p(qu,!n.isSimple(),"must be complex selection range");const{anchor:t,focus:e}=n;p(qu,!t.isSimple(),"invalid start pos type"),p(qu,!e.isSimple(),"invalid end pos type");const r=n.getEditor();p(qu,t.blockId===e.blockId,"invalid range, not same block");const i=r.getBlockById(t.blockId);p(qu,Dt(i)==="table","invalid block type, not a table block");const o=ze(i),s=Mt.fromTable(o),l=s.getCellByContainerId(t.childContainerId),c=s.getCellByContainerId(e.childContainerId),d=Math.min(l.row,c.row),h=Math.max(l.row,c.row),C=Math.min(l.col,c.col),E=Math.max(l.col,c.col),x=s.getCell({row:d,col:C}),B=s.getCell({row:h,col:E});return{editor:r,block:i,table:o,startCell:x,endCell:B,startRow:d,startCol:C,endRow:h,endCol:E}}const gC=I("split-cell");function pC(n,t,e){n.undoManager.runInGroup(()=>{const r=Mt.fromBlock(t),i=r.getRealCell(e);p(gC,!i.virtual,"should not split virtual cell"),p(gC,i.colSpan>1||i.rowSpan>1,"cell does not has span data");const o=r.getVirtualCellContainersGrid();for(let C=0;C<i.rowSpan;C++)for(let E=0;E<i.colSpan;E++){if(C===0&&E===0)continue;const x=C+i.row,B=E+i.col,k=oo(n.doc);o[x][B]=k}const s=n.getBlockData(t),l=mt.default(s);l[`${i.containerId}_colSpan`]=null,l[`${i.containerId}_rowSpan`]=null,l.children=Mt.virtualCellContainersGridToChildren(o);const d=n.getChildContainerData(i.containerId)[0];p(gC,d,"no child block");const h=ve(n,d.id,0);dl(l),n.updateBlockData(t,l,h)})}function pN(n,t,e){e.forEach(r=>{const i=Mt.fromBlock(t).getCell(r);(i.virtual||i.colSpan>1||i.rowSpan>1)&&pC(n,t,r)})}function Sy(n,t,e){if(e.isSimple())return!1;const{start:r,end:i}=e;if(r.blockId!==i.blockId||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=h0(e);return!(s.cell!==l.cell||s.colSpan===1&&s.rowSpan===1)}function CC(n){const{editor:t,block:e,startRow:r,startCol:i,endRow:o,endCol:s}=h0(n),l=[];for(let c=r;c<=o;c++)for(let d=i;d<=s;d++)l.push({row:c,col:d});return pN(t,e,l),!0}const ja=I("merge-cells");function Ly(n,t,e){if(e.isSimple())return!1;const{start:r,end:i}=e;if(r.blockId!==i.blockId||n.getBlockById(r.blockId)!==t||Dt(t)!=="table")return!1;const{startCell:s,endCell:l}=h0(e);return s.cell!==l.cell}function Iy(n){const t=h0(n),e=t.editor;e.undoManager.runInGroup(()=>{const r=t.endCell,i=r.row+r.rowSpan-1,o=r.col+r.colSpan-1,s=lt(t.block);CC(n);const l=e.getBlockById(s),c=ze(l),{startRow:d,startCol:h}=t,C=mt.default(e.getBlockData(l));p(ja,C.children,"no table children");const E=Mt.fromTable(c),x=[];for(let Ct=d;Ct<=i;Ct++)for(let yt=h;yt<=o;yt++){const bt=E.getCell({row:Ct,col:yt});p(ja,!bt.virtual,"cell is virtual"),x.push(bt)}p(ja,x.length>0,"no selected cells");const B=x[0],k=x.slice(1),w=E.getCellByContainerId(B.containerId).container,U=[];k.forEach(Ct=>{const yt=E.getCellByContainerId(Ct.containerId).container,bt=ct(yt);if(!fu(e,yt)){const Gt=H5(e,bt);if(fu(e,w)){const Pe=fe(w)[0];e.insertDocAt(w,0,Gt),e.deleteBlock(Pe)}else e.insertDocAt(w,Or(w),Gt)}U.push(bt)});const M=ct(w),F=o-h+1,Y=i-d+1;C[`${M}_colSpan`]=F,C[`${M}_rowSpan`]=Y,U.forEach(Ct=>{p(ja,C.children,"no table children");const yt=C.children.indexOf(Ct);p(ja,yt>0,"no deleted container"),C.children.splice(yt,1)});const X=C,st=e.getChildContainerData(M)[0];p(ja,st,"no child block");const pt=ve(e,st.id,0);dl(X),e.updateBlockData(l,X,pt),e.deleteChildContainers(U)})}const EC=10,CN=["table/merge-cells","table/split-cell","table/insert-column","table/insert-row","table/delete-rows","table/delete-columns","table/delete"];class m0{constructor(){m(this,"id","TableBlockCommandProvider")}getAvailableCommands(t,e,r){if(Dt(e)!=="table")return[];const i={blockId:lt(e),blockKind:Nr(t,e),blockType:Dt(e)},o=[];Ly(t,e,r)&&o.push({id:"table/merge-cells",name:D.t("table.mergeCell"),icon:gT,groupIndex:EC,...i}),Sy(t,e,r)&&o.push({id:"table/split-cell",name:D.t("table.splitCell"),icon:pT,groupIndex:EC,...i});const s=Ry(t,e,r),l=wy(t,e,r);return s&&l&&o.push({id:"table/delete",name:D.t("table.deleteTable"),icon:CT,groupIndex:EC,...i}),o}executeCommand(t,e,r,i,o,s){return Dt(e)!=="table"||!new Set(CN).has(i.id)?!1:i.id==="table/merge-cells"?(Iy(r),!0):i.id==="table/split-cell"?(CC(r),!0):i.id==="table/delete-columns"?(hC(r),!0):i.id==="table/delete-rows"?(mC(r),!0):i.id==="table/delete"?(t.deleteBlock(e),!0):!1}}var Dy=(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))(Dy||{});const za=6,Xu=20,xC="table-cell-menu-btn";function EN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasColTitle:!0};n.updateBlockData(t,r)}function xN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasColTitle:!1};n.updateBlockData(t,r)}function AN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasRowTitle:!0};n.updateBlockData(t,r)}function bN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),hasRowTitle:!1};n.updateBlockData(t,r)}function vN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),isStripeStyle:!0};n.updateBlockData(t,r)}function BN(n,t){if(!n.isBlockWritable(t))return;const r={...mt.default(n.getBlockData(t)),isStripeStyle:!1};n.updateBlockData(t,r)}function TN(n,t,e){if(!n.isBlockWritable(t))return;const i={...mt.default(n.getBlockData(t)),noBorder:!e};n.updateBlockData(t,i)}const hl=I("table-cell-dom");function yN(n,t,e){let r=n.getBlockById(e);for(;r;){const i=r.closest("td");p(hl,i,"no parent cell");const o=Z(i);if(p(hl,o,"no parent block"),o===t)return i;r=o}return p(hl,!1,"filed to get cell by child block id"),null}function as(n,t,e){if(n.getBlockById(e.blockId)===t&&!e.isSimple())return p(hl,e.childContainerId,"block position must have childContainerId attribute"),e;const i=yN(n,t,e.blockId),o=ct(Gu(i));return xe(t,o)}function AC(n,t){const e=n.selection.range,r=as(n,t,e.start),i=as(n,t,e.end);return Yr(t,r,i)}function _y(n,t,e,r){p(hl,Ge(t),"invalid table block");const i=Ri(n,t),o=oe(t),s=()=>{const c=i.querySelector(".table-border-bar-container.top");p(hl,c,"no top border bar container"),c.querySelectorAll(".table-border-bar-cell.top").forEach(h=>{const C=parseInt(h.getAttribute("data-top-index")||"0",10);r.includes(C)?z(h,"danger"):ot(h,"danger")})},l=()=>{const c=o.querySelector(".table-border-bar-container.left");p(hl,c,"no left border bar container"),c.querySelectorAll(".table-border-bar-cell.left").forEach(h=>{const C=parseInt(h.getAttribute("data-left-index")||"0",10);e.includes(C)?z(h,"danger"):ot(h,"danger")})};s(),l()}function cs(n,t,e=!0,r){const o=Mt.fromBlock(t).map(h=>h),{fromCol:s,toCol:l,fromRow:c,toRow:d}=AC(n,t);for(let h=0;h<o.length;h++){const C=o[h];for(let E=0;E<C.length;E++){const x=C[E],B=r?E>=s&&E+x.colSpan-1<=l:h>=c&&h+x.rowSpan-1<=d;e&&B?x.virtual||z(x.cell,"danger"):x.virtual||ot(x.cell,"danger")}}}function us(n,t,e=!0,r){const i=new Set,o=new Set;if(!e){_y(n,t,Array.from(i),Array.from(o));return}const{fromCol:s,toCol:l,fromRow:c,toRow:d}=AC(n,t);if(r)for(let h=s;h<=l;h++)o.add(h);else for(let h=c;h<=d;h++)i.add(h);_y(n,t,Array.from(i),Array.from(o))}function My(n,t,e){const{fromCol:r,toCol:i,fromRow:o,toRow:s}=AC(n,t),l=Mt.fromBlock(t);let c=null,d=null;return e?(c=l.getCell({col:r,row:0}),d=l.getCell({col:i,row:l.rowCount-1}),Qe(n,{anchor:xe(t,c.containerId,{colIndex:r,rowIndex:0}),focus:xe(t,d.containerId,{colIndex:i,rowIndex:l.rowCount-1})})):(c=l.getCell({col:0,row:o}),d=l.getCell({col:l.colCount-1,row:s}),Qe(n,{anchor:xe(t,c.containerId,{colIndex:0,rowIndex:o}),focus:xe(t,d.containerId,{colIndex:l.colCount-1,rowIndex:s})}))}const Uy=["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 Oy(n){return`style-bg-color-${n}`}function Yu(n){return`${n}_background`}function kN(n,t,e){const r=ze(n),s=(e!=null?e:Mt.fromTable(r)).getCell(t).cell;for(let l=0;l<Uy.length;l++){const c=Uy[l];if(wt(s,c))return c}}function Ny(n,t,e){if(!n.isBlockWritable(t))return;const r=n.selection.range,o={...mt.default(n.getBlockData(t))},s=as(n,t,r.start),l=as(n,t,r.end);if(r.isSimple()){const c=s.childContainerId;e===-1?o[Yu(c)]=void 0:o[Yu(c)]=Oy(e)}else{const c=Mt.fromBlock(t),d=Yr(t,s,l),h=new Set;for(let C=d.fromRow;C<=d.toRow;C++)for(let E=d.fromCol;E<=d.toCol;E++){const x=c.getCell({row:C,col:E});!h.has(x.containerId)&&x.col>=d.fromCol&&x.row>=d.fromRow&&x.col+x.colSpan-1<=d.toCol&&x.row+x.rowSpan-1<=d.toRow&&(h.add(x.containerId),e===-1?o[Yu(x.containerId)]=void 0:o[Yu(x.containerId)]=Oy(e))}}n.updateBlockData(t,o)}function RN(n,t,e){if(!n.isBlockWritable(t))return;const i={...mt.default(n.getBlockData(t)),chart:e};n.updateBlockData(t,i)}const Py=I("table-chart");function wN(n,t){const e=rN(n,t);if(e){const r=e.querySelector(".editor-table-chart");if(r){const i=r.chartObject;i&&i.destroy(),r.remove()}}}async function SN(n,t){if(!n.contains(t)||!n.isBlockWritable(t))return;if(!!!n.getBlockData(t).chart){wN(n,t);return}const i=[],o=Mt.fromBlock(t),s=["line","bar","pie","radar"];let l=o.getCell({row:0,col:0}).container.innerText.trim().toLowerCase();new Set(s).has(l)||(l=s[0]);const c=[];for(let k=1;k<o.colCount;k++)c.push(o.getCell({row:0,col:k}).container.innerText);for(let k=1;k<o.rowCount;k++){const w=o.getCell({row:k,col:0}),M=w.container.innerText,F=[];for(let Gt=1;Gt<o.colCount;Gt++){const Pe=o.getCell({row:k,col:Gt}).container.innerText,he=Number.parseFloat(Pe)||0;F.push(he)}let Y;const X=kN(t,w,o);X?Y=window.getComputedStyle(n.rootElement).getPropertyValue(`--${X}`).trim():Y=window.getComputedStyle(n.rootElement).getPropertyValue("--background-color").trim();let[G,st,pt,Ct]=Y?Bg.fromString(Y).toRgbaArray():[];if(!G&&!st&&!pt&&!Ct){const Gt=(k-1)%n.options.colors.length;Y=n.options.colors[Gt],[G,st,pt,Ct]=Bg.fromString(Y).toRgbaArray()}const yt=Y,bt=Bg.fromRgba([G,st,pt,Ct/3]).toHexString();i.push({label:M,data:F,borderColor:yt,backgroundColor:bt,borderWidth:2})}const d=Ri(n,t);let h=null,C=d.querySelector(".editor-table-chart");C?h=C.chartObject:C=v("div",["editor-table-chart"],d);const E=C;p(Py,E,"no chart container");const x=n.getComponentOptions("table"),B=(x==null?void 0:x.chartCdn)||"https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js";try{await zs(B,"editor-chartjs");let k=!1;(h&&h.config.data.datasets.length>i.length||h&&h.config.data.datasets[0].data.length>i[0].data.length)&&(k=!0),h&&(l!==h.config.type||k)&&(h.destroy(),h=null,Array.from(C.querySelectorAll(".editor-chartjs-canvas")).forEach(M=>{M.remove()}));const w=yg.default({},{type:l,data:{datasets:i,labels:c},options:{onClick:()=>{n.selection.selectBlock(t,0,0)}}});if(h)yg.default(h.config,w),h.update();else{const M=v("canvas",["editor-chartjs-canvas"],E).getContext("2d");h=new window.Chart(M,w),C.chartObject=h}}catch(k){Py.error(`failed to resolve chart cdn: ${JSON.stringify(k)}`)}}async function Fy(n,t){await Mr.lock("updateTableChart");try{await SN(n,t)}finally{Mr.release("updateTableChart")}}const Ky=ke.default(Fy,1e3);let Vy=null;function bC(n,t,e){if(Vy!==t&&(Ky.flush(),Vy=t),e.updateNow){Fy(n,t);return}Ky(n,t)}function vC(n,t,e){e&&Ge(e)&&bC(n,e,{updateNow:!1})}function LN(n,t){Ge(t)&&bC(n,t,{updateNow:!0})}const vr={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"},g0={SCROLL_BAR:"container-scrollbar",FIXED:"fixed"},fs={SCROLL_CONTAINER:"scroll-container",TOOL:"container-scroll-tool",CONTAINER:"scroll-container-root",MAC:"mac",SCROLL_AREA:"scroll-area"};function Qu(n,t){return n.containers.get(t)}function $y(n){return n.closest(`.${fs.SCROLL_CONTAINER}`)}function Qr(n){return n.firstElementChild}function Rn(n){return n.closest(`.${fs.CONTAINER}`)}function Ju(n){const t=Rn(n);let e=t.querySelector(`:scope >.${fs.TOOL}`);return e||(e=v("div",[fs.TOOL],t)),e}function IN(n){return Rn(n).firstElementChild}function DN(n,t){const e=Qu(n,Rn(t));return e!=null&&e.barFloatWindowBottom?typeof e.barFloatWindowBottom=="function"?e.barFloatWindowBottom():e.barFloatWindowBottom:0}function Br(n,t){const e=dr(n);return t/e}function Zu(n){const t=window.getComputedStyle(n),e=dr(n);return{paddingBottom:parseFloat(t.paddingBottom)*e,paddingTop:parseFloat(t.paddingTop)*e,paddingLeft:parseFloat(t.paddingLeft)*e,paddingRight:parseFloat(t.paddingRight)*e}}function Ga(n){const t=dr(n);return{scrollLeft:n.scrollLeft*t,scrollWidth:n.scrollWidth*t,clientWidth:n.clientWidth*t,clientHeight:n.clientHeight*t}}function _N(n,t){const e=dr(n);return n[t]*e}function BC(n,t){const e=Rn(t),r=Qu(n,e),i=(r==null?void 0:r.safeRightSpace)||0,o=(r==null?void 0:r.safeLeftSpace)||0,l=(r==null?void 0:r.locatingContainer).getBoundingClientRect(),c=e.getBoundingClientRect(),d=c.width;let h=Math.floor(c.left-l.left-o);h<0&&(h=0);let C=l.right;C-=i;let E=C-c.right;return E<0&&(E=0),h=Math.round(h),E=Math.round(E),{originWidth:d,maxLeft:h,maxRight:E}}function MN(n,t){const e=BC(n,t),{maxLeft:r}=e;t.style.marginLeft=`${Br(t,0-r)}px`,t.style.paddingLeft=`${Br(t,r)}px`}function UN(n,t){const e=BC(n,t);t.style.marginRight=`${Br(t,0-e.maxRight)}px`}function ON(n){if(n!==document.documentElement&&n!==document.body)return n.getBoundingClientRect();const t=0,e=0,r=document.documentElement.clientWidth,i=document.documentElement.clientHeight;return new DOMRect(t,e,r,i)}const Hy=I("scroll-bar-handle"),NN=2;function Wa(n){const t=Ju(n);let e=t.querySelector(`.${g0.SCROLL_BAR}`);return e||(e=v("div",[g0.SCROLL_BAR],t)),p(Hy,e instanceof HTMLDivElement,"invalid child for container tools"),e.firstElementChild||v("div",[],e),e}function p0(n,t){const e=$y(t),r=Wa(e),{scrollWidth:i,clientWidth:o}=Ga(e),{paddingLeft:s,paddingRight:l}=Zu(t),c=BC(n,e),{originWidth:d,maxRight:h}=c;UN(n,e),MN(n,e);const C=i-o;p(Hy,r.firstElementChild instanceof HTMLDivElement,"invalid child for scroll bar"),r.style.width=`${Br(e,d+h-s-l)}px`,r.firstElementChild.style.width=`${Br(e,d+h+C-s-l)}px`}function PN(n,t){const e=Qr(n),{paddingLeft:r}=Zu(e);if(wt(t,"fixed")){const o=Rn(n).getBoundingClientRect();t.style.left=`${Br(n,o.left+r)}px`}else t.style.left=`${Br(n,r)}px`}function qa(n,t){var M;const e=n.getParentScrollContainer(),r=ON(e),i=t.getBoundingClientRect(),o=Wa(t),s=o.getBoundingClientRect(),l=Qu(n,Rn(t)),c=DN(n,t),d=Qr(t),{paddingTop:h,paddingBottom:C}=Zu(d),{scrollWidth:E,clientWidth:x}=Ga(t),B=document.documentElement.clientHeight-c,k=r.top+Ga(e).clientHeight-B,w=B+Math.min(0,k);if(E>x&&i.top+h<w-s.height&&i.bottom>w-s.height+C&&!((M=l==null?void 0:l.isSetScale)!=null&&M.call(l))){l!=null&&l.allowScrollBarFixed&&z(o,g0.FIXED);const F=k>0?c:0;o.style.bottom=`${Math.max(document.documentElement.clientHeight-r.bottom,0)+NN+F}px`}else ot(o,g0.FIXED),o.style.bottom=`${Br(t,C-s.height)}px`;PN(t,o)}class FN{constructor(t,e){m(this,"intersectionObserver");m(this,"handleIntersection",t=>{t.forEach(e=>{this.containers.get(Rn(e.target))?(this.handleIntersectionEntry(e),this.callback(e)):this.intersectionObserver.unobserve(e.target)})});m(this,"handleIntersectionEntry",t=>{const e=t.target;qa(this.scrollCore,e);const r=Qr(e);p0(this.scrollCore,r)});this.scrollCore=t,this.callback=e;const i={root:this.scrollCore.getParentScrollContainer(),rootMargin:"20px",threshold:0};this.intersectionObserver=new IntersectionObserver(this.handleIntersection,i)}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 ml=I("container-scroll-shadow");function jy(n,t,e){const r=n,i=t.getBoundingClientRect(),o=e.getBoundingClientRect(),{paddingTop:s,paddingBottom:l}=Zu(e);r.style.top=`${Br(t,o.top-i.top+s)}px`,r.style.bottom=`${Br(t,i.bottom-o.bottom+l)}px`}function zy(n,t){const e=n;t<24?e.style.width=`${(t/3).toFixed(2)}px`:e.style.width=""}function KN(n){const t=Ju(n);p(ml,t,"no container tools");let e=t.querySelector(`.${vr.LEFT}`);if(!e){const l=Qr(n),c=[vr.COMMON,vr.LEFT];e=v("div",c,t),p(ml,e instanceof HTMLDivElement,"invalid child for container tools"),jy(e,n,l)}p(ml,e instanceof HTMLElement,"invalid child for container tools");const i=Rn(n).getBoundingClientRect(),o=n.getBoundingClientRect();e.style.left=`${Br(n,o.left-i.left)}px`;const s=Ga(n).scrollLeft;p(ml,e instanceof HTMLDivElement,"invalid child for container tools"),zy(e,s),z(e,vr.ACTIVE)}function VN(n){const t=Ju(n);let e=t.querySelector(`.${vr.RIGHT}`);if(!e){const h=Qr(n),C=[vr.COMMON,vr.RIGHT];e=v("div",C,t),p(ml,e instanceof HTMLDivElement,"no div, create shadow failed"),jy(e,n,h)}p(ml,e instanceof HTMLElement,"");const i=Rn(n).getBoundingClientRect(),o=n.getBoundingClientRect();e.style.right=`${Br(n,i.right-o.right)}px`;const{scrollWidth:s,scrollLeft:l,clientWidth:c}=Ga(n),d=s-l-c;p(ml,e instanceof HTMLDivElement,"no shadow element"),zy(e,d),z(e,vr.ACTIVE)}function $N(n){const e=Ju(n).querySelector(`.${vr.LEFT}`);e&&ot(e,vr.ACTIVE)}function HN(n){const e=Ju(n).querySelector(`.${vr.RIGHT}`);e&&ot(e,vr.ACTIVE)}function tf(n){const{scrollLeft:t,scrollWidth:e,clientWidth:r}=Ga(n),i=Qr(n),{paddingLeft:o,paddingRight:s}=Zu(i),l=_N(i,"offsetLeft");e-o<=r-s||e-o<=t+r-s?HN(n):VN(n),i&&t>=l+o?KN(n):$N(n)}class jN{constructor(t,e){m(this,"resizeObserver");m(this,"handleResizeEntry",t=>{const e=t.target,r=Qr(e);tf(e),p0(this.scrollCore,r),qa(this.scrollCore,e),this.callback(e)});m(this,"handleContentResize",t=>{t.forEach(e=>{this.containers.get(Rn(e.target))?this.handleResizeEntry(e):this.unbind(e.target)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new Vs(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 Gy=I("container-scroll-observer");class zN{constructor(t,e){m(this,"handleContentScroll",t=>{const e=t.target;p(Gy,e instanceof Element,"invalid target for scroll event");const r=Wa(e);r.removeEventListener("scroll",this.handleScroll);const i=!0;this.fixScrollXPos(e,e.scrollLeft,i),this.bind(r),tf(e),this.callback(e)});m(this,"handleScroll",t=>{const e=t.target;p(Gy,e instanceof HTMLElement,"");const r=e.scrollLeft,i=!1,o=IN(e);this.unbindContentScroll(o),this.fixScrollXPos(o,r,i),this.bindContentScroll(o),tf(o),this.callback(o)});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",ke.default(this.bindContentScrollCore,300));m(this,"bind",ke.default(this.bindCore,200));this.scrollCore=t,this.callback=e}fixScrollXPos(t,e,r){const i=Wa(t);r||(t.scrollLeft=e),r&&i.scrollLeft!==e&&(i.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 GN{constructor(t){m(this,"scrollContainers",new Set);m(this,"handleParentContainerScroll",()=>{this.scrollContainers.forEach(t=>{qa(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 WN=I("scroll-wrap-resize-observer");class qN{constructor(t){m(this,"resizeObserver");m(this,"handleScrollWrapResize",t=>{t.forEach(e=>{this.containers.get(Rn(e.target))?this.handleScrollWrapResizeEntry(e):this.unbind(e.target)})});m(this,"handleScrollWrapResizeEntry",t=>{const e=t.target;p(WN,e instanceof HTMLElement,"invalid target for observer entry");const r=$y(e);p0(this.scrollCore,e),tf(r),qa(this.scrollCore,r)});this.scrollCore=t,this.resizeObserver=new Vs(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 XN{constructor(t,e){m(this,"resizeObserver");m(this,"scrollContainersMap",new Map);m(this,"handleResizeEntry",t=>{t==null||t.forEach(e=>{const r=Qr(e);tf(e),p0(this.scrollCore,r),qa(this.scrollCore,e),this.callback(e)})});m(this,"handleResize",t=>{t.forEach(e=>{const r=this.scrollContainersMap.get(e.target);r!=null&&r.length&&this.handleResizeEntry(r)})});this.scrollCore=t,this.callback=e,this.resizeObserver=new Vs(this.handleResize)}bind(t){var i,o;const e=Rn(t),r=(i=Qu(this.scrollCore,e))==null?void 0:i.locatingContainer;this.scrollContainersMap.has(r)?(o=this.scrollContainersMap.get(r))==null||o.push(t):(this.scrollContainersMap.set(r,[t]),this.resizeObserver.observe(r))}unbind(t){var o,s;const e=Rn(t),r=(o=Qu(this.scrollCore,e))==null?void 0:o.locatingContainer;if(!r)return;const i=this.scrollContainersMap.get(r);this.scrollContainersMap.set(r,(i==null?void 0:i.filter(l=>l!==t))||[]),(s=this.scrollContainersMap.get(r))!=null&&s.length||(this.resizeObserver.unobserve(r),this.scrollContainersMap.delete(r))}destroy(){this.scrollContainersMap.clear(),this.resizeObserver.disconnect()}}const Hlt="";class YN extends ye.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 r=e.target,i=Qr(r);e.isIntersecting?(this.load(),this.bindCore(r,i)):this.unbindCore(r,i)});m(this,"handleWindowEffect",()=>{var e;(e=this.getScrollContainerInViewable())==null||e.forEach(r=>{qa(this,r)})});this.parentContainer=e}load(){this.containerResizeObserver||(this.containerResizeObserver=new jN(this,this.handleResize)),this.containerScrollObserver||(this.containerScrollObserver=new zN(this,this.handleScrollContainerScroll)),this.parentContainerScrollObserver||(this.parentContainerScrollObserver=new GN(this)),this.scrollWrapResizeObserve||(this.scrollWrapResizeObserve=new qN(this)),this.locatingContainerResizeObserver||(this.locatingContainerResizeObserver=new XN(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,r){var o,s,l,c,d,h;const i=Wa(e);(o=this.containerScrollObserver)==null||o.unbindContentScroll(e),(s=this.containerScrollObserver)==null||s.unbind(i),(l=this.scrollWrapResizeObserve)==null||l.unbind(r),(c=this.containerResizeObserver)==null||c.unbind(e),(d=this.parentContainerScrollObserver)==null||d.unbindScrollContainer(e),(h=this.locatingContainerResizeObserver)==null||h.unbind(e)}bindCore(e,r){var s,l,c,d,h,C;if(this.unbindCore(e,r),!e.closest("body"))return;const i=Wa(e);(s=this.containerScrollObserver)==null||s.bindContentScrollCore(e),(l=this.containerScrollObserver)==null||l.bindCore(i),(c=this.scrollWrapResizeObserve)==null||c.bind(r),(d=this.containerResizeObserver)==null||d.bind(e);const o=this.containers.get(Rn(e));o!=null&&o.allowScrollBarFixed&&((h=this.parentContainerScrollObserver)==null||h.bindScrollContainer(e)),(C=this.locatingContainerResizeObserver)==null||C.bind(e)}bind(e,r){this.containers.set(e,r);const i=e.firstElementChild;this.containerIntersectionObserver||(this.containerIntersectionObserver=new FN(this,this.handleIntersection)),this.containerIntersectionObserver.bind(i)}unbind(e){var o;const r=e.firstElementChild,i=Qr(r);this.unbindCore(r,i),this.containers.delete(e),(o=this.containerIntersectionObserver)==null||o.unbind(r),this.containers.size||this.destroy()}destroy(){var e,r,i,o,s;this.containers.forEach((l,c)=>{this.unbind(c)}),this.containers.clear(),(e=this.parentContainerScrollObserver)==null||e.destroy(),(r=this.containerIntersectionObserver)==null||r.destroy(),(i=this.containerResizeObserver)==null||i.destroy(),(o=this.scrollWrapResizeObserve)==null||o.destroy(),(s=this.locatingContainerResizeObserver)==null||s.destroy(),window.removeEventListener("resize",this.handleWindowEffect),window.removeEventListener("scroll",this.handleWindowEffect)}}const Wy=I("scroll-container"),C0=new Map;class QN extends ye.TypedEmitter{constructor(){super(...arguments);m(this,"scrollListener");m(this,"options");m(this,"scrollContainerElement");m(this,"init",e=>{this.options=e;const r=v("div",[fs.CONTAINER],e.parentElement);ie.isMac&&z(r,fs.MAC);const i=v("div",[fs.SCROLL_CONTAINER],r),o=v("div",[fs.SCROLL_AREA],i);o.style.paddingLeft=e.paddingLeft?`${e.paddingLeft}px`:"",o.style.paddingTop=e.paddingTop?`${e.paddingTop}px`:"",o.style.paddingBottom=e.paddingBottom?`${e.paddingBottom}px`:"",o.style.paddingRight=e.paddingRight?`${e.paddingRight}px`:"",o.appendChild(e.childElement);const s=e.parentContainer;this.scrollListener=C0.get(s),this.scrollListener||(this.scrollListener=new YN(s),C0.set(s,this.scrollListener)),this.scrollListener.unbind(r),this.scrollListener.bind(r,e),this.scrollListener.on("scroll",this.handleContainerScroll),this.scrollListener.on("resize",this.handleResize),this.scrollContainerElement=i});m(this,"handleContainerScroll",(e,r)=>{r===this.scrollContainerElement&&this.emit("scroll",this)});m(this,"handleResize",(e,r)=>{r===this.scrollContainerElement&&this.emit("scroll",this)})}get rootElement(){return this.scrollContainerElement}get contentElement(){return p(Wy,this.scrollContainerElement,"scrollContainerElement cannot be undefined"),Qr(this.scrollContainerElement)}get scrollOptions(){return p(Wy,this.options,"options cannot be undefined"),{...this.options}}handleBaseListenerDestroy(e){e.destroy()}destroy(){var r;(r=this.scrollListener)==null||r.off("scroll",this.handleContainerScroll);const e=Rn(this.contentElement);e&&C0.forEach((i,o)=>{i.unbind(e),i.containers.size===0&&(this.handleBaseListenerDestroy(i),C0.delete(o))})}}function JN(){return new QN}const TC=I("column-width");function ZN(n,t,e){const r=oN(n,t);r.style.width=`${e}px`,r.style.minWidth=`${e}px`}function tP(n){const e=Array.from(n.querySelector("colgroup").children).map(c=>c.getBoundingClientRect().width);if(e[0]!==0)return e;const r=Mt.fromTable(n),i=Array(r.colCount).fill(-1),o=n.getBoundingClientRect().left;r.toRealCells(r.cells).forEach(c=>{const d=c.col+c.colSpan-1;i[d]===-1&&(i[d]=c.cell.getBoundingClientRect().right-o)}),TC.debug(`cellRightOffsets1: ${i.join()}`);for(let c=0;c<i.length;c++){const d=i[c];if(d===-1||c===0)continue;let h=c-1;for(;i[h]===-1&&(h--,h!==-1););const C=h===-1?0:i[h],x=(d-C)/(c-h);for(let B=h+1;B<c;B++)i[B]=C+x*(B-h)}TC.debug(`cellRightOffsets2: ${i.join()}`);const s=[];let l=0;for(let c=0;c<i.length;c++){const d=i[c];s.push(d-l),l=d}return TC.debug(`widths: ${s.join()}`),s}function ef(n){return Array.from(n.querySelector("colgroup").children).map(r=>r.getBoundingClientRect().width||Number.parseInt(r.style.width,10))}const yC=200,eP=40,nP=I("table-resize-gripper"),qy=7,kC=(qy-1)/2,rP=3;function iP(n,t,e){const{rows:r}=n;for(let i=0;i<r.length;i++){const o=r[i],s=Array.from(o.cells);for(let l=0;l<s.length;l++){const c=s[l],d=c.getBoundingClientRect(),h=Math.round(d.right);if(Math.abs(t-h)<=kC&&d.top<=e&&e<=d.bottom)return c}}return null}function oP(n){return!!n.rootContainer.querySelector(".table-resize-gripper")}function RC(n,t){return Ri(n,t).querySelector(".table-resize-gripper")}function Xy(n,t){const e=RC(n,t);p(nP,!e,"resize gripper has already exists");const r=Ri(n,t),i=v("div",["table-resize-gripper","table-indicator"],r);return v("div",["table-resize-gripper-indicator"],i),i}function Yy(n,t,e){let r=RC(n,t);r||(r=Xy(n,t));const o=ze(t).getBoundingClientRect(),s=e.getBoundingClientRect(),l=0,c=o.height,d=n.getCustom(ki(t)).contentElement.getBoundingClientRect(),h=s.right-d.left;r.style.left=`${h-kC-za-Xu}px`,r.style.top=`${l}px`,r.style.height=`${c}px`,r.style.width=`${qy}px`}function wC(n){n.rootContainer.querySelectorAll(".table-resize-gripper").forEach(t=>{t.remove()})}function sP(n,t,e){const i={...n.getBlockData(t),colsWidth:e};n.updateBlockData(t,i)}function lP(n,t,e,r){const i=t,o=Mt.fromTable(e),s=o.getCellByCellElement(i),l=s.col+s.colSpan-1,c=ef(e);let d=r;const h=(E,x)=>{const B=x+1,k=E.col+E.colSpan;return c.slice(B,k).reduce((U,M)=>U+M,0)},C=new Set;for(let E=0;E<o.rowCount;E++){const x=o.getCell({row:E,col:l});if(C.has(x.cell))continue;C.add(x.cell);const B=x.cell,k=B.getBoundingClientRect();let w=r-k.left+kC-rP;const U=Gu(B),M=u1(n,U)||eP*x.colSpan,F=h(x,l),Y=M-F;w<Y&&(w=Y);const X=k.left+w;d=Math.max(d,X)}return d}const aP=I("table-resize-drag-drop");class cP{constructor(t,e,r,i){m(this,"cursor","col-resize");this.editor=t,this.elem=e,this.data=r,this.onEnd=i}onDragStart(t,e,r){}onDragging(t,e,r,i,o){const{table:s,block:l,draggingRefCell:c}=t.data,h=lP(this.editor,c,s,e.x-t.dragOffsetX)-s.getBoundingClientRect().left;p(aP,c,"no dragging cell");const E=Mt.fromTable(s).getCellByCellElement(c),x=E.col+E.colSpan-1,B=ef(s),k=B.slice(0,x).reduce((U,M)=>U+M,0),w=h-k;if(ZN(s,x,w),w){const U=parseFloat(s.style.minWidth);s.style.minWidth=`${U+(w-B[x])}px`}Yy(this.editor,l,c),this.editor.selection.caret.update()}onDragEnd(t,e,r,i,o){const s=ef(t.data.table);sP(this.editor,t.data.block,s),wC(this.editor),this.onEnd&&(this.onEnd(e),this.onEnd=null)}}function uP(n,t){const e=Ae(t.x,t.y);if(!e)return null;const r=Z(e);return!r||!n.contains(r)||!Ge(r)?null:r}I("table-resize");class fP{constructor(t){m(this,"draggingRefCell",null);m(this,"handleMouseMove",(t,e)=>{if(t.readonly||window.isDragging||t.selectionHandler.isSelecting()&&!this.draggingRefCell||this.draggingRefCell)return;const r=e.target;if(!(r instanceof Element)||r.closest(".table-indicator"))return;const o=e,s=uP(t,o);if(!s||!yy(s)||!t.isBlockWritable(s)){wC(t);return}this.updateGripper(s,o.x,o.y)});this.editor=t,t.domEvents.addEventListener(document,"mousemove",this.handleMouseMove)}destroy(){this.editor.domEvents.removeEventListener(document,"mousemove",this.handleMouseMove)}updateGripper(t,e,r){const i=ze(t),o=iP(i,e,r);if(o){if(!RC(this.editor,t)){if(oP(this.editor))return;const l=Xy(this.editor,t),c={block:t,table:i,draggingRefCell:o};Og(new cP(this.editor,l,c,d=>{this.updateGripper(t,d.x,d.y)}))}Yy(this.editor,t,o)}else wC(this.editor)}}function Qy(n){n.addCustom("table-mouse-event-handler",t=>new fP(t))}const Jy=I("table-insert-column");function Zy(n,t,e){n.undoManager.runInGroup(()=>{var E;const r=ze(t),i=Mt.fromTable(r),o=i.colCount;p(Jy,e>=0&&e<=o,`insert index ${e} is out of range [0, ${o}]`);const s=i.map(x=>x.containerId),l=new Set;n.doc.beginBatchUpdate();for(let x=0;x<s.length;x++){const B=s[x],k=B[e-1],w=B[e];if(e===0||e===B.length||k!==w){const U=oo(n.doc);B.splice(e,0,U)}else B.splice(e,0,k),l.add(k)}n.doc.endBatchUpdate();const c=mt.default(n.getBlockData(t));l.forEach(x=>{const B=`${x}_colSpan`,k=c[B];p(Jy,typeof k=="number"&&k>1,`no colSpan for containerId ${x}, ${k}`),c[B]=k+1});const d=((E=c.colsWidth)==null?void 0:E.concat())||new Array(c.cols).fill(0);d.splice(e,0,yC);const h=Mt.virtualCellContainersGridToChildren(s),C={...c,cols:c.cols+1,children:h,colsWidth:d};dl(C),n.updateBlockData(t,C)})}const E0=I("table-insert-row");function SC(n,t,e){n.undoManager.runInGroup(()=>{const r=ze(t),i=Mt.fromTable(r),o=i.rowCount;p(E0,e>=0&&e<=o,`insert index ${e} is out of range [0, ${o}]`);const s=i.map(E=>E.containerId),l=new Set;n.doc.beginBatchUpdate();const c=[];for(let E=0;E<i.colCount;E++){const x=e>0&&s[e-1][E],B=e<i.rowCount&&s[e][E];if(p(E0,x||B,"no top and bottom cell"),e===0||e===i.rowCount||x!==B){const k=oo(n.doc);c.push(k)}else p(E0,x,"no top cell"),c.push(x),l.add(x)}n.doc.endBatchUpdate(),s.splice(e,0,c);const d=mt.default(n.getBlockData(t));l.forEach(E=>{const x=`${E}_rowSpan`,B=d[x];p(E0,typeof B=="number"&&B>1,`no rowSpan for containerId ${E}, ${B}`),d[x]=B+1});const h=Mt.virtualCellContainersGridToChildren(s),C={...d,rows:d.rows+1,children:h};dl(C),n.updateBlockData(t,C)})}const LC=I("paste-table-in-table-block");function dP(n,t,e,r,i){let o=Mt.fromBlock(e);const s=t.blocks.root[0];p(LC,s,"no table data"),p(LC,s.type==="table",`table data type is not table, but ${s.type}`);const l=s,c=o.getCellByCellElement(r),d=l.cols,h=l.rows,C=c.col,E=c.row,x=C+d,B=E+h,k=[];for(let w=C;w<x&&w<o.colCount;w++)for(let U=E;U<B&&U<o.rowCount;U++){const M=o.getCell({col:w,row:U});M.virtual?M.virtual&&k.push({col:w,row:U}):(M.colSpan>1||M.rowSpan>1)&&k.push({col:w,row:U})}n.undoManager.runInGroup(()=>{if(n.doc.beginBatchUpdate(),k.forEach(F=>{const Y=Mt.fromBlock(e).getCell(F);(Y.colSpan>1||Y.rowSpan>1)&&pC(n,e,F)}),x>o.colCount)for(let F=o.colCount;F<x;F++)Zy(n,e,F);if(B>o.rowCount)for(let F=o.rowCount;F<B;F++)SC(n,e,F);o=Mt.fromBlock(e);const w=new u0(l);let U;for(let F=0;F<w.colCount;F++)for(let Y=0;Y<w.rowCount;Y++){const X=w.getCell({col:F,row:Y});if(!X.virtual){const G=ep(n.editorBlocks,t,X.containerId,i),st=C+F,pt=E+Y,Ct={col:st,row:pt},yt=o.getCellContainer(Ct);YB(n,yt,G,i),U=yt}}n.doc.endBatchUpdate(),p(LC,U,"no last container");const M=Ue(U);n.selection.selectBlock(M,dt(n,M))})}const IC=I("paste-in-table-block");class hP{constructor(t){m(this,"pasteData");this.editor=t,setTimeout(()=>{t.input.addHandler(this)})}destroy(){this.pasteData=void 0}async handleBeforePaste(t,e,r,i){return this.pasteData={doc:r,files:i,event:e},!1}async handleBeforePasteDoc(t,e){var E,x,B,k;if(!t.selection.range.isSimple())return this.pasteData=void 0,!1;if(t.selection.range.start.offset!==0)return this.pasteData=void 0,!1;const i=t.selection.startBlock,o=it(i);if(qt(o))return this.pasteData=void 0,!1;if(!fu(t,o))return this.pasteData=void 0,!1;const s=Z(o);if(p(IC,s,"no parent block"),!Ge(s))return this.pasteData=void 0,!1;if(e.blocks.root.length!==1)return this.pasteData=void 0,!1;if(e.blocks.root[0].type!=="table")return this.pasteData=void 0,!1;IC.debug("paste child table in table");const d=Mt.fromBlock(s).getCellByContainerId(ct(o)).cell;Ap(t,e);const h={blockIdMap:new Map,containerIdMap:new Map,boxIdMap:new Map};dP(t,e,s,d,h),p(IC,this.pasteData,"invalid paste data");const C=[];t.input.forEach(w=>{C.push(w)});for(let w=0;w<C.length&&!await((x=(E=C[w]).handleAfterPasteDoc)==null?void 0:x.call(E,t,e,h));w++);for(let w=0;w<C.length&&!await((k=(B=C[w]).handleAfterPaste)==null?void 0:k.call(B,t,this.pasteData.event,this.pasteData.doc));w++);return this.pasteData=void 0,!0}}function tk(n){n.addCustom("table-block-paste-event",t=>new hP(t))}const DC=I("table-select-columns");function mP(n,t,e,r,i){p(DC,Ge(t),"is not a table block");const o=Mt.fromBlock(t);p(DC,e>=0&&e<o.colCount,"invalid from"),p(DC,r>0&&e+r<=o.colCount,"invalid count");const s=o.getCell({row:0,col:e}),l=o.getCell({row:o.rowCount-1,col:e+r-1}),c=xe(t,s.containerId,{colIndex:e,rowIndex:0}),d=xe(t,l.containerId,{colIndex:e+r-1,rowIndex:o.rowCount-1});i!=null&&i.reverse?n.selection.setSelection(d,c):n.selection.setSelection(c,d)}const _C=I("table-select-columns");function gP(n,t,e,r,i){p(_C,Ge(t),"is not a table block");const o=Mt.fromBlock(t);p(_C,e>=0&&e<o.rowCount,"invalid from"),p(_C,r>0&&e+r<=o.rowCount,"invalid count");const s=o.getCell({row:e,col:0}),l=o.getCell({row:e+r-1,col:o.colCount-1}),c=xe(t,s.containerId,{rowIndex:e,colIndex:0}),d=xe(t,l.containerId,{rowIndex:e+r-1,colIndex:o.colCount-1});i!=null&&i.reverse?n.selection.setSelection(d,c):n.selection.setSelection(c,d)}const jlt="",ek=I("get-toolbar-reference-client");function nk(n,t){const e=n.selection.range;if(!e.isSimple()){p(ek,e.start.blockId===e.end.blockId,"invalid selection range");const s=n.getBlockById(e.start.blockId);p(ek,It(n,s),"not a complex block");const l=Qt(n,s);if(l.getTextToolbarReferenceClient){const c=l.getTextToolbarReferenceClient(n,s);if(c)return c}}const r=e.isReverse()?t.start:t.end,i=Qe(n,{anchor:r,focus:r}),o=Yi(n,t.block,i);if(o.length!==0)return o[0]}function pP(n){var t,e;if(n.children){let r=!1;const i=[];for(const o of n.children){if((t=o.states)!=null&&t.includes("checked")){r=!0;break}(e=n.defaultCheckedChildren)!=null&&e.includes(o.id)&&i.push(o)}if(!r&&(i==null?void 0:i.length))for(const o of i)Array.isArray(o.states)?o.states.push("checked"):o.states=["checked"]}}function x0(n){const t=(i,o)=>{const s=i.findIndex(c=>c.id===o.id);if(s===-1){i.push(o);return}const l=i[s];if(l.value!==o.value&&delete l.value,!!l.states){if(!o.states){l.states=[];return}l.states=Rg.default(l.states,o.states)}},e=[],r=new Map;return n.forEach(i=>{var o,s;(o=i.children)!=null&&o.length&&(r.has(i.id)?(s=r.get(i.id))==null||s.push(...i.children):r.set(i.id,[...i.children])),t(e,i)}),r.forEach((i,o)=>{const s=e.find(l=>l.id===o);s&&(s.children=x0(i),pP(s))}),e}function A0(n){return n.findCustom("toolbar-handler")}const zlt="";class CP{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:r}=this.form,i=this.formatUrl(r.getInputValue());(t=this.onFinished)==null||t.call(this,e.getInputValue()||i,i),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,e)=>{var r;if(!e){if(t.key==="Enter"){(r=this.form.linkUrl)==null||r.getField().focus(),t.stopPropagation();return}t.key==="Escape"&&this.handleClose()}});m(this,"handleUrlKeyboard",(t,e)=>{if(!e){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(D.t("link.urlPlaceholder")),new Error(D.t("link.urlPlaceholder"))}formatUrl(t){if(!t)return"";try{new URL(t)}catch{return`${window.location.protocol}//${t}`}return t}editLink(t){var h,C;const{target:e,linkText:r,linkUrl:i,onFinished:o,onClose:s,placement:l="bottom-start"}=t;this.linkPopup=new Va(this.createPopupContent(r,i)),this.linkPopup.addListener("show",this.onShow),this.linkPopup.manualShow(e,{theme:"light",placement:l}),this.onFinished=o,s&&(this.onClose=s);const c=(h=this.linkPopup)==null?void 0:h.content.querySelector('[data-button-id="submit-button"]'),d=(C=this.linkPopup)==null?void 0:C.content.querySelector('[data-button-id="cancel-button"]');c==null||c.addEventListener("click",this.handleOk),d==null||d.addEventListener("click",this.handleClose)}createPopupContent(t,e){const r=v("div",["link-popup-content"],null);this.form.linkText=c0(r,{label:D.t("link.textLabel"),required:!1,placeholder:D.t("link.textPlaceholder"),defaultValue:t,onChange:this.onChange,onKeyDown:this.handleTextKeyboard}),this.form.linkUrl=c0(r,{className:"link-popup-gap",label:D.t("link.urlLabel"),required:!0,placeholder:D.t("link.urlPlaceholder"),defaultValue:e,onChange:this.onChange,onKeyDown:this.handleUrlKeyboard});const i=v("div",["link-popup-footer"],r),o=br("cancel-button",D.t("link.cancelText"));i.appendChild(o);const s=br("submit-button",D.t("link.submitText"),void 0,["disabled","primary"]);return i.appendChild(s),r}_destroy(){var r,i,o,s;const t=(r=this.linkPopup)==null?void 0:r.content.querySelector('[data-button-id="submit-button"]'),e=(i=this.linkPopup)==null?void 0:i.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={},(o=this.linkPopup)==null||o.removeAllListeners(),(s=this.linkPopup)==null||s.destroy()}destroy(){this._destroy()}}function nf(n,t){n.addCustom("link-editor",()=>new CP).editLink(t)}const EP=I("link-popup");function xP(n){return wt(n,"link")}function rf(n){var t,e;return(e=(t=n.getAttribute("link"))!=null?t:n.textContent)!=null?e:""}function AP(n,t,e){var i,o,s,l;if(n.isBlockWritable(t)&&e&&Qn(e)){const c=e,d=(o=(i=n.editorBoxes.getBoxClass(su(c))).getBoxProperties)==null?void 0:o.call(i,n,c);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&&rt(n,t)&&xP(e)){const c=v("a",["link-href-button"],null,rf(e));c.href=rf(e),c.target="_blank",c.rel="noopener noreferrer";const d=[{id:"link-text",name:rf(e),disableTooltip:!0,element:c},{id:"edit-link",name:D.t("link.edit"),icon:s0},{id:"remove-link",name:D.t("link.remove"),icon:kT}];return{element:e,commands:d}}return Hv(n,t,"hovering-toolbar")}function rk(n,t,e){var l;const r=Yo(t,e),i=n.getBlockText(t),o={start:0,end:0};let s=(l=e.textContent)!=null?l:"";for(let c=0;c<i.length;c++){const d=i[c];if(o.end+d.insert.length>=r.end){o.end+=d.insert.length,s=d.insert;break}o.start<r.start&&(o.start+=d.insert.length,o.end=o.start)}return[o,s]}function bP(n,t,e){const[r,i]=rk(n,t,e);n.selection.selectBlock(t,r.start,r.end);const o=rf(e),s=(h,C)=>{try{const E=n.getBlockText(t),x=U1(E,r.start,r.end-r.start),B=ro(x,r.start,h,{link:C});n.setBlockText(t,B),n.selection.selectBlock(t,r.start+h.length),n.focus()}catch(E){EP.error(E)}},l=()=>{n.selection.selectBlock(t,r.end),n.focus()},c=Yi(n,t,n.selection.range)[0];if(!c)return;const d=Zi(n,t,"link-button-anchor",c);nf(n,{target:d,linkText:i,linkUrl:o,onFinished:s,onClose:l})}function vP(n,t,e){const[r]=rk(n,t,e),i=n.getBlockText(t),o=rf(e),s=va(r.start,r.end-r.start,i,"link",o);n.setBlockText(t,s),n.selection.selectBlock(t,r.end)}function BP(n,t,e,r){var s,l,c;if(e){if(n.isBlockWritable(t)&&Qn(e)){const h=e,C=(l=(s=n.editorBoxes.getBoxClass(su(h))).getBoxProperties)==null?void 0:l.call(s,n,h);if(C!=null&&C.boxCommands){C.boxCommands["hovering-toolbar"].executeCommand(n,t,h,r);return}return}const d=A0(n);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},400),r.id==="edit-link"?bP(n,t,e):r.id==="remove-link"&&vP(n,t,e);return}const i=$v(n,t);if(!i)return;const o=(c=i.blockCommands)==null?void 0:c["hovering-toolbar"];!o||o.executeCommand(n,t,r)}function b0(){let n=8;for(;n>0&&!document.querySelector(`div[data-style-heading='${n}']`);)n--;return n}function Jr(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 r=n.getBlockById(e.start.blockId);return!(!rt(n,r)||Cu(n,r,e.start.offset).charType!=="box")}const TP=[Yh,Qh,Jh,Zh,t0,e0,n0,r0];class yP{constructor(t){m(this,"id","BlockTurnIntoCommandProvider");this.editor=t}getHeadingIndex(){let t=b0();return t<=4?t=5:t<8&&(t+=1),t}getAvailableCommands(t,e,r){if(!rt(t,e))return[];if(Jr(t))return[];const i=lt(e),o=Dt(e),s=Nr(t,e),c=t.getBlockData(e).heading,d=[];for(let C=0;C<this.getHeadingIndex();C++)d.push({id:`heading-${C+1}`,name:D.t("commands.heading",{name:`${C+1}`}),icon:TP[C],states:c===C+1?["checked"]:[],value:`${C+1}`});const h=C=>{var x;const E=v("span",["toolbar-item-name-container"],null);for(const B of C.children)if((x=B.states)!=null&&x.includes("checked"))return E.innerHTML=B.icon||Fa,E;return E.innerHTML=Fa,E};return[{id:"turn-into",name:D.t("commands.headingGroup"),blockId:i,blockType:o,blockKind:s,element:h,groupIndex:200,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["text"],children:[{id:"text",name:D.t("commands.text"),icon:Fa,states:c?[]:["checked"]},...d],childrenType:"menu"}]}applyHeadingStyle(t,e,r){t.updateBlockData(e,{heading:r})}executeCommand(t,e,r,i){if(Jr(t))return!1;if(rt(t,e)&&(i.id.startsWith("heading-")||i.id==="text")){const o=i.value?Number(i.value):null;return this.applyHeadingStyle(t,e,o),!0}return!1}}const kP=8,Le=I("list-block"),v0=I("list-block");function Ft(n){return Dt(n)==="list"}function Ne(n){p(v0,Ft(n),"not a list block")}function er(n){Ne(n);const t=n.getAttribute("data-list-type");return p(v0,t,"no list type"),t}function B0(n){return Ft(n)&&er(n)==="text-only"}function nr(n){var t,e;return Ne(n),(e=Number.parseInt((t=n.getAttribute("data-list-start"))!=null?t:"1",10))!=null?e:1}function un(n){var t,e;return Ne(n),(e=Number.parseInt((t=n.getAttribute("data-list-level"))!=null?t:"1",10))!=null?e:1}function Xa(n){Ne(n);const t=n.getAttribute("data-list-group-id");return p(v0,t,"no group id"),t}function ds(n){var o,s,l,c,d;Ne(n);const t=(o=n.getAttribute("data-list-type"))!=null?o:"ordered",e=(l=Number.parseInt((s=n.getAttribute("data-list-start"))!=null?s:"1",10))!=null?l:1,r=(d=Number.parseInt((c=n.getAttribute("data-list-level"))!=null?c:"1",10))!=null?d:1,i=n.getAttribute("data-list-group-id");return p(v0,i,"no group id"),{type:t,start:e,level:r,groupId:i}}function MC(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 RP(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="",r=n;return Object.entries(t).forEach(([i,o])=>{for(;r>=o;)e+=i,r-=o}),e.toLowerCase()}const wP="abcdefghijklmnopqrstuvwxyz";function ik(n){if(n<=0)return`${n}`;const t=(n-1)%26,e=Math.floor((n-1)/26),r=wP[t];return e?ik(e)+r:r}function SP(n){return`${n}`}const ok=[SP,ik,RP];function LP(n,t){const e=ok[(n-1)%ok.length];return e(t)}function IP(n){return["\u2022","\u25E6","\u25AA"][(n-1)%3]}function hs(n,t){Ne(n);const{level:e,groupId:r,type:i}=ds(n);let o=Oe(n);for(;o;){if(!Ft(o))return null;const{level:s,groupId:l,type:c}=ds(o);if(s<e)return null;if(e===s&&((t==null?void 0:t.ignoreGroupId)||r===l)&&(c==="text-only"||i==="text-only"||i===c))return o;o=Oe(o)}return null}function sk(n){return hs(n,{ignoreGroupId:!0})}function gl(n){Ne(n);const{level:t,groupId:e,type:r}=ds(n);let i=Jt(n);for(;i;){if(Ft(i)){const{level:o,groupId:s,type:l}=ds(i);if(t===o&&e===s&&(l==="text-only"||r==="text-only"||r===l))return i;if(o<t)return null}i=Jt(i)}return null}function lk(n){Ne(n);const t=[];let e=hs(n);for(;e;)t.unshift(e),e=hs(e);return t}function Ya(n){Ne(n);const t=[];let e=gl(n);for(;e;)t.push(e),e=gl(e);return t}function of(n){Ne(n);let t=hs(n);for(;t;){const e=hs(t);if(!e)return t;t=e}return n}function DP(n){Ne(n);let t=gl(n);for(;t;){const e=gl(t);if(!e)return t;t=e}return null}function ak(n,t){const e=lk(n),r=Ya(n);return t.withSelf?[...e,n,...r]:[...e,...r]}function T0(n){Ne(n);let t=n;const e=lk(n);e.length>0&&(t=e[0]);const r=Oe(t);return!r||!Ft(r)?null:un(r)<un(t)?r:null}function _P(n,t){Ne(n);let e=n;for(;e;){const r=un(e);if(r===t)return e;if(r>t)e=T0(e);else if(r<t)return null}return null}function MP(n){let t=of(n);for(;;){const e=T0(t);if(!e)return t;t=of(e)}}class UP{constructor(){m(this,"nodeMap",new Map);m(this,"rootNodes",[])}addNode(t,e){const r={block:e,children:[]};if(this.nodeMap.set(e,r),t){const i=this.nodeMap.get(t);p(Le,i,"no parent node"),i.children.push(r)}else this.rootNodes.push(r)}}function ck(n,t){const e=MP(t),r=new UP;r.addNode(null,e);let i=Jt(e);for(;i&&Ft(i);){if(B0(i)){r.addNode(null,i),i=Jt(i);continue}if(un(i)===0&&er(i)!==er(e))break;const s=T0(i);r.addNode(s,i),i=Jt(i)}return r.rootNodes}function OP(n){const t=document.fullscreenEnabled||document.mozFullScreenEnabled||document.documentElement.webkitRequestFullScreen,e=r=>{if(r.requestFullscreen)return r.requestFullscreen();if(r.mozRequestFullScreen)return r.mozRequestFullScreen();if(r.webkitRequestFullScreen){try{document.fullscreenElement=n}catch{}return r.webkitRequestFullScreen()}return Promise.resolve(0)};return t?e(n):Promise.resolve(0)}function uk(){const e=(document.exitFullscreen||document.webkitExitFullscreen).bind(document)();try{document.fullscreenElement=null}catch{}return e}function UC(n){return wt(n,"editor-in-mindmap-first")}function OC(n){if(p(Le,Ft(n),"not a list block"),wt(n,"editor-in-mindmap-first")||!Go(n))return!0;const t=n.classList,e="editor-mindmap-root-";return!!Array.from(t).find(i=>{if(i.startsWith(e))return i})}function NP(n,t,e){const r=it(n);if(t){const s=it(t);p(Le,r===s,"invalid block container")}const i=vt(n);if(t){const s=vt(t);p(Le,i<=s,"invalid block index")}if(z(n,...e),!t||t===n)return;let o=Jt(n);for(;o!==t;)p(Le,o,"no next button"),z(o,...e),o=Jt(o);o&&z(o,...e)}function PP(n){const t=`editor-mindmap-root-${n.id}`,r=it(n).querySelectorAll(`.${t}`);return r[r.length-1]}async function FP(n,t,e){const r=oe(t),i=r.querySelector('[data-button-id="mindmap-fullscreen"]');p(Le,i,"no full screen button");const o=()=>{setTimeout(()=>{e.toMindmap(n,t,{},{reset:!0,mindmapTools:e})},300)},s=()=>{ot(r,"fullscreen"),i.innerHTML=oC,i.setAttribute(`data-editor-tooltip-${n.clientId}-dynamic`,D.t("mindmap.fullScreen")),OC(t)&&setTimeout(()=>{o()},300)};if(document.fullscreenElement===r){try{await uk()}catch(l){Le.error(l)}s()}else{try{z(r,"fullscreen"),await OP(r),o()}catch(l){Le.error(l)}i.innerHTML=ay,i.setAttribute(`data-editor-tooltip-${n.clientId}-dynamic`,D.t("mindmap.exitFullscreen"))}r.onfullscreenchange=()=>{document.fullscreenElement||s()}}function NC(n,t,e,r,i){if(t.querySelector(`[data-button-id="${e}"]`))return null;const s=br(e,r,i,[]);return s.setAttribute(`data-editor-tooltip-${n.clientId}-dynamic`,r),z(s,"mindmap-button"),t.appendChild(s),s}function PC(n,t){return n.querySelector(`[data-button-id="${t}"]`)}function KP(n){return PC(n,"mindmap-fullscreen")}function VP(n){return PC(n,"mindmap-fit")}function $P(n){return PC(n,"mindmap-close")}function HP(n,t,e,r){const i=NC(n,t,"mindmap-close",D.t("mindmap.close"),qh);!i||n.domEvents.addEventListener(i,"click",()=>{r.closeMindmap(n,e)})}function jP(n,t,e,r){const i=NC(n,t,"mindmap-fit",D.t("mindmap.autoFit"),ly);!i||n.domEvents.addEventListener(i,"click",()=>{r.fitMindmap(n,e)})}function zP(n,t,e,r){if(navigator.userAgent.includes("Mobile")&&!navigator.userAgent.includes("iPad"))return;const o=NC(n,t,"mindmap-fullscreen",D.t("mindmap.fullScreen"),oC);!o||n.domEvents.addEventListener(o,"click",()=>{FP(n,e,r)})}function GP(n,t){const e=th(t);if(!e)return;const r=VP(e);r&&(r.remove(),n.domEvents.removeAllListeners(r));const i=$P(e);i&&(i.remove(),n.domEvents.removeAllListeners(i));const o=KP(e);o&&(o.remove(),n.domEvents.removeAllListeners(o))}const Qa=new Map;function FC(n,t,e){const r=(s,l)=>{s.forEach(c=>{l?z(c.block,"to-mindmap-highlight"):ot(c.block,"to-mindmap-highlight"),r(c.children,l)})},i=ck(n,t);if(i.length===0)return;const o=i[0].block;if(e){const s=Qa.get(o);s&&(s.forEach(l=>l.cancel()),Qa.delete(o)),r(i,!0)}else{const s=setTimeout(()=>{r(i,!1),Qa.delete(o)},300),l=()=>{clearTimeout(s),Qa.delete(o)},c=Qa.get(o);c?c.push({cancel:l}):Qa.set(o,[{cancel:l}])}}const{Markmap:WP}=e9;function qP(n,t){Ne(t);const e=ck(n,t),r=e[0].block,i=d=>({type:"text",content:Nt(d.block).textContent,depth:1,children:d.children.length>0?d.children.map(C=>i(C)):void 0});let o=null;e.length>1?o={type:"root",content:"root",depth:0,children:e.length>0?e.map(d=>i(d)):void 0}:o=i(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},c=l(e);return{root:o,block:r,nodes:e,last:c}}function y0(n,t,e,r){const{root:i,block:o,last:s}=qP(n,t);r.selectBlock&&n.selection.selectBlock(o,0,0),FC(n,o,!1),r.saveData&&n.updateBlockData(o,{viewAsMindmap:!0});const l=oe(o);let c=l.querySelector(".editor-mindmap-svg");if(r.reset&&(c&&c.remove(),c=null),c)c.innerHTML="";else{const U="http://www.w3.org/2000/svg",M=l.getBoundingClientRect(),F=document.fullscreenElement===l,Y=F?`${M.width}`:`${t.getBoundingClientRect().width}`,X=F?`${M.height}`:"600",G=document.createElementNS(U,"svg");G.setAttributeNS(null,"viewBox",`0 0 ${Y} ${X}`),G.setAttributeNS(null,"width","100%"),G.setAttributeNS(null,"height",X),G.style.display="block",G.style.width="100%",G.style.height=`${X}px`,G.classList.add("editor-mindmap-svg"),l.appendChild(G),c=G}const d=o,C=`editor-mindmap-root-${lt(o)}`;z(d,"editor-in-mindmap-first",C,"readonly"),d.contentEditable="false";const E=Jt(o);E&&vt(E)<=vt(s.block)&&NP(E,s.block,["block-hidden",C]);const x=(U,M)=>{if(M.length>0){const F=M[0].parentElement;F&&(F.style.width="100vw",F.style.maxWidth="200px")}M.forEach(F=>{z(F,"editor-mindmap-node")})},B=new WP(c,{...e,autoFit:!0});B.viewHooks.transformHtml.tap(x),B.setData(i),B.fit();const k=oe(o);let w=k.querySelector(".mindmap-toolbar");w||(w=v("div",["mindmap-toolbar"],k)),jP(n,w,d,r.mindmapTools),zP(n,w,d,r.mindmapTools),HP(n,w,d,r.mindmapTools),n.domEvents.addEventListener(c,"click",()=>{n.selection.selectBlock(o,0),n.input.focus()}),d.mindMap=B}function XP(n){const t=v("div",["list-to-mindmap-wrap"],null),e=br("list-to-mindmap",D.t("mindmap.viewAsMindMap"),sy,[],n.clientId);return t.appendChild(e),t}async function fk(n,t){const e=`editor-mindmap-root-${t.id}`,r=it(t);fe(r).forEach(l=>{wt(l,e)&&ot(l,e,"editor-in-mindmap-first","block-hidden")});const o=oe(t);document.fullscreenElement===o&&await uk();const s=o.querySelector(".editor-mindmap-svg");!s||(p(Le,s,"no mindmap svg"),s.remove(),n.domEvents.removeAllListeners(s),GP(n,t))}function YP(n){const t=n.classList,e="editor-mindmap-root-";return Array.from(t).find(i=>{if(i.startsWith(e))return i})}async function dk(n,t){!YP(t)||(n.updateBlockData(t,{viewAsMindmap:null}),fk(n,t),n.selection.selectBlock(t,0))}function QP(n,t){const e=t.mindMap;e&&e.fit()}const k0={toMindmap:y0,closeMindmap:dk,fitMindmap:QP},Glt="";class R0{constructor(t){m(this,"toMindmapButton");m(this,"currentBlock",null);m(this,"handleHoveringBlock",t=>{t&&Ft(t)&&er(t)!=="unchecked"&&er(t)!=="checked"&&this.editor.isWritable()?oe(t).appendChild(this.toMindmapButton):this.toMindmapButton.remove()});m(this,"handleMouseEnter",()=>{const t=Z(this.toMindmapButton);p(Le,t&&Ft(t),"no parent list"),FC(this.editor,t,!0),this.currentBlock=t});m(this,"handleMouseLeave",()=>{this.currentBlock&&(FC(this.editor,this.currentBlock,!1),this.currentBlock=null)});m(this,"handleClick",()=>{const t=Z(this.toMindmapButton);p(Le,t&&Ft(t),"no parent list"),y0(this.editor,t,{},{saveData:!0,selectBlock:!0,mindmapTools:k0})});this.editor=t,Re.get(this.editor).addListener("change",this.handleHoveringBlock),this.toMindmapButton=XP(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(R0)}destroy(){Re.get(this.editor).removeListener("change",this.handleHoveringBlock)}hide(){this.currentBlock&&(this.currentBlock=null),this.toMindmapButton.remove()}}function JP(n,t,e){var r;t==="beginDrag"&&((r=R0.get(n))==null||r.hide())}function Ja(n,t,e,r){var o;const i=(o=r==null?void 0:r.groupId)!=null?o:et();t.forEach(s=>{const l=n.getBlockData(s);if(l.start!==e||(r==null?void 0:r.resetGroupId)){const c={...l,start:e};r!=null&&r.resetGroupId&&(c.groupId=i),n.updateBlockData(s,c)}l.textOnly||(e+=1)})}function KC(n,t,e,r){const i=ak(t,{withSelf:!0});i.length!==0&&Ja(n,i,e,r)}class w0{constructor(t,e){m(this,"listStart",0);m(this,"listBrother",null);if(this.editor=t,B0(e))return;const r=of(e),i=nr(r);this.listStart=i,r===e?this.listBrother=gl(r):this.listBrother=r}fix(){if(!!this.listBrother){if(qc(this.listBrother)){this.listBrother=null;return}KC(this.editor,this.listBrother,this.listStart)}}}class pl{constructor(t,e,r){m(this,"listStart");m(this,"listBrother",null);this.editor=t,this.options=r;const i=of(e),o=nr(i);this.listStart=o,this.listBrother=i,r!=null&&r.resetStart&&(this.listStart=1)}fix(){!this.listBrother||KC(this.editor,this.listBrother,this.listStart,this.options)}}class hk{constructor(t,e,r){m(this,"listStart");m(this,"listNextBrothers",[]);this.editor=t,this.listNextBrothers=Ya(e);const{start:i,resetStart:o}=r||{};this.listStart=o?1:i!=null?i:1}fix(){!this.listNextBrothers.length||Ja(this.editor,this.listNextBrothers,this.listStart)}}function ZP(n,t,e){n.getBlockData(t).quoted&&(e.quoted=!0)}function VC(n,t,e,r){if(Le.debug("drag a block on a list block"),!rt(n,t))return!1;p(Le,Ft(e),"target is not a list block");const{type:i,start:o,level:s,groupId:l}=ds(e),c=r==="after"?o+1:o,d=n.getBlockData(t),h={id:et(),type:"list",groupId:l,level:s,start:c,text:d.text,...MC(i)};ZP(n,e,h);let C=vt(e);const E=it(e);r==="after"&&(C+=1);let x=null;Ft(t)&&(x=new w0(n,t));const B=n.insertBlock(ct(E),C,h,Ch(h.id,0));return n.deleteBlock(t),new pl(n,B).fix(),x==null||x.fix(),!0}function tF(n,t,e,r){if(Le.debug("drag a list between text blocks"),r==="after"){const d=Jt(e);if(d&&Ft(d))return VC(n,t,d,"before")}if(r==="before"){const d=Oe(e);if(d&&Ft(d))return VC(n,t,d,"after")}const o={...n.getBlockData(t),groupId:et(),start:1,level:1};let s=vt(e);const l=it(e);r==="after"&&(s+=1),n.insertBlock(ct(l),s,o,Ch(o.id,0));const c=new w0(n,t);return n.deleteBlock(t),c.fix(),!0}function eF(n,t,e,r,i){if(Xd(e))return!1;const{blockId:o}=e,s=n.getBlockById(o);p(Le,s,"no dragged block");const{isSourceBlock:l,targetBlock:c}=i;return!l&&c?(p(Le,t===c,"block !== target block"),p(Le,Ft(c),"target is not a list block"),VC(n,s,c,r)):tF(n,s,c,r)}function mk(n,t){if(!n.isWritable())return!1;const e=n.selection.range,i=n.editorCommandProviders.getCommands(e,"shortcut").find(o=>o.id===t);return i?(n.editorCommandProviders.executeCommand(e,i,{}),!0):!1}const nF={"Shift+CtrlOrCmd+L":n=>mk(n,"ordered-list"),"Shift+CtrlOrCmd+U":n=>mk(n,"unordered-list")};function S0(n){const t=n.getAttribute("block-padding-level");return t?Number(t):null}function rF(n,t){let e;const r=S0(t);if(!r)e=1;else{if(r>=12)return e=12,!1;e=r+1}return n.updateBlockData(t,{...n.getBlockData(t),padding:e}),!0}function gk(n,t){const e=S0(t);if(!e)return!1;const r=n.getBlockData(t);return e>1?(n.updateBlockData(t,{...r,padding:e-1}),!0):(n.updateBlockData(t,{...r,padding:null}),!0)}function $C(n){return n.readonly||!n.isWritable()}function iF(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const r=e.block;rt(n,r)&&rF(n,r)}),!0}function oF(n){return n.selection.range.getSelectedBlocks().forEach(e=>{const r=e.block;rt(n,r)&&gk(n,r)}),!0}function sF(n){return $C(n)?!1:n.undoManager.runInGroup(()=>(iF(n),!0))}function lF(n){return $C(n)?!1:n.undoManager.runInGroup(()=>(oF(n),!0))}function aF(n){if($C(n))return!1;if(!n.selection.range.isCollapsed())return;const t=n.selection.focusedBlock;if(!rt(n,t))return;const e=n.selection.range.focus;if(!(!e.isSimple()||e.offset!==0||!S0(t)))return gk(n,t),!0}class HC{renderBlock(t,e,r){const{padding:i}=r;return i?{attributes:{"block-padding-level":i}}:{}}}const Wlt="",cF={Tab:sF,"Shift+Tab":lF,Backspace:aF};function uF(n,t,e=1){if(!t)return null;let r=Oe(n);for(;r;){const i=r.getAttribute("data-style-heading"),o=Number(r.getAttribute("data-list-level"));if(i){if(i<t)return null;if(i===t&&o===e)return Ft(r)?r:null}r=Oe(r)}return null}function fF(n,t){const e=n.getAttribute("data-style-heading"),r=uF(n,e);if(r)return r;const i=Oe(n);if(i&&Ft(i)&&er(i)===t)return i;const o=Jt(n);return o&&Ft(o)&&er(o)===t?o:null}function dF(n,t,e){var k,w,U;const r=(k=e.data)!=null?k:{};let i=1;if(Ft(t))i=un(t);else{const M=S0(t);M&&(i=M+1),i>8&&(i=8)}const o=(w=r.listType)!=null?w:"ordered";if(o==="text-only")return null;const s=n.getBlockData(t);let l=(U=s.text)!=null?U:[],d=de(l);const h=e.offset||0;h<=gn(l)&&(l=Mn(l,h).right,d=d.substring(0,h));let C=1;o==="ordered"&&(C=Number.parseInt(d,10)||1);let E=et();const x=fF(t,o);if(x)if(un(x)===i){if(vt(t)>vt(x))C=nr(x)+1;else{const M=nr(x);M>1&&(C=M-1),new hk(n,x,{start:C+1}).fix()}E=Xa(x)}else{const M=_P(x,i);M&&(C=nr(M)+1)}else Ft(t)&&new hk(n,t,{start:1}).fix();const B={id:et(),type:"list",level:i,start:C,groupId:E,ordered:!1,text:l};return s.quoted&&(B.quoted=!0),s.heading&&(B.heading=s.heading),o==="ordered"?B.ordered=!0:(o==="checked"||o==="unchecked")&&(B.checkbox=o),{blockData:B,onConverted:(M,F)=>{new pl(M,F).fix()}}}function Za(n){return n.textOnly?"text-only":n.checkbox?n.checkbox:n.ordered?"ordered":"unordered"}function hF(n){var e,r;if(n.checkbox)return"";const t=(e=n.level)!=null?e:1;return n.ordered?`${LP(t,(r=n.start)!=null?r:1)}.`:IP(t)}function L0(n){return n==="checked"||n==="unchecked"}function pk(n,t,e,r){const i=t,{containerId:o,blockIndex:s}=r[r.length-1];if(s===0)return!0;const l=e.blocks[o][s-1];if(l.type!=="list")return!0;const c=Za(i),d=Za(l);return c!==d&&(!L0(c)||!L0(d))||(i.level||1)>(l.level||1)}function Ck(n,t,e,r){const i=t,{containerId:o,blockIndex:s}=r[r.length-1];if(s===e.blocks[o].length-1)return!0;const l=e.blocks[o][s+1];if(l.type!=="list")return!0;const c=Za(i),d=Za(l);return c!==d&&(!L0(c)||!L0(d))||(i.level||1)>(l.level||1)}function mF(n,t,e,r,i){var s,l,c;const o=t;if(r==="text")return((s=Nn.convertTo)==null?void 0:s.call(Nn,n,t,e,"text",i))||"";if(r==="markdown"){let d=((l=Nn.convertTo)==null?void 0:l.call(Nn,n,t,e,"markdown",i))||"";o.checkbox==="checked"?d=`[x] ${d}`:o.checkbox==="unchecked"&&(d=`[ ] ${d}`),o.ordered?d=`${o.start}. ${d}`:d=`- ${d}`;const h=o.level||0;return d=(h>0?" ".repeat(h-1):"")+d,pk(n,t,e,i)&&(d=`${d}`),Ck(n,t,e,i)&&(d=`${d}`,h<=1&&(d+=`
|
|
614
614
|
`)),d}if(r==="html"){let d=((c=Nn.convertTo)==null?void 0:c.call(Nn,n,t,e,"html",i))||"";d=d.replace("<p>","").replace("</p>",""),o.checkbox==="checked"?d=`<input type="checkbox" checked="checked" disabled="disabled" /> ${d}`:o.checkbox==="unchecked"&&(d=`<input type="checkbox" disabled="disabled" /> ${d}`);let h="ul",C="";if(o.ordered)switch(d=`<li value="${o.start}">${d}</li>`,h="ol",o.level){case 2:case 5:case 8:C="list-style-type: lower-alpha;";break;case 3:case 6:C="list-style-type: lower-roman;";break}else d=`<li>${d}</li>`;return pk(n,t,e,i)&&(d=`<${h}${C?` style="${C}"`:""}>${d}`),Ck(n,t,e,i)&&(d=`${d}</${h}>`),d}return""}function Ek(n){const t=v("label",["editor-check-list-wrapper"],null);n&&z(t,"editor-check-list-wrapper-checked");const e=v("span",["editor-check-box"],t);return v("span",["editor-check-box-inner"],e),t}function gF(n,t){const e=Za(t);if(e!=="text-only"){if(e==="checked"){n.append(Ek(!0));return}if(e==="unchecked"){n.append(Ek(!1));return}n.innerText=hF(t)}}function pF(n){const t=v("div",["list-container"],null),e=v("button",["list-marker"],t);return gF(e,n),t}function tc(n,t){Ne(t);const e=n.getBlockData(t),r={id:et(),type:"text",text:e.text};e.heading&&(r.heading=e.heading),e.heading&&(r.heading=e.heading);const i=it(t),o=vt(t);n.deleteBlock(t);const s=Ch(r.id,0);if(fu(n,i)&&!qt(i)){const l=be(i);n.insertBlock(ct(i),o,r,s),n.deleteBlock(l)}else n.insertBlock(ct(i),o,r,s)}function CF(n){if(!n.selection.range.isCollapsed())return!1;const t=n.selection.focusedBlock;if(!Ft(t))return!1;const e=n.selection.range.focus;return!e.isSimple()||e.offset!==0?!1:(tc(n,t),!0)}function xk(n){let t=Jt(n);if(!t)return null;const e=gl(n);for(;t!==e;){if(p(Le,t,"no next block"),Ft(t))return un(t)>un(n)?t:null;if(t=Jt(t),!t)return null}return null}function jC(n){const t=[];let e=xk(n);if(!e)return t;for(;e;){const r=gl(e);t.push({block:e,children:jC(e)}),e=r}return t}function EF(n){const t=(r,i)=>{i.push(r.block),r.children.forEach(o=>t(o,i))},e=[];return n.forEach(r=>t(r,e)),e}function Ak(n,t){return un(t)!==1}function bk(n,t,e){t.forEach(r=>{const i=n.getBlockData(r.block);n.updateBlockData(r.block,{...i,groupId:e,level:(i.level||1)-1}),r.children.length&&bk(n,r.children,i.groupId)})}function zC(n,t){if(!Ak(n,t))return!1;const e=un(t);if(e===1)return!1;let r=et(),i=1,o=er(t);const s=e-1,l=T0(t);l&&(r=Xa(l),i=nr(l)+1,o!=="text-only"&&(o=er(l)));const c=jC(t),d=n.getBlockData(t),h={...d,groupId:r,level:s,start:i,...MC(o)};n.updateBlockData(t,h),n.doc.beginBatchUpdate(),bk(n,c,d.groupId),n.doc.endBatchUpdate(),new pl(n,t).fix();const E=xk(t);return E&&new pl(n,E,{resetStart:!0,resetGroupId:!0}).fix(),!0}const xF=I("list-block");function AF(n,t,e){p(xF,Ft(t),"not a list block");const r={...n.getBlockData(t),id:et()};return e!=null&&e.level&&(r.level=e.level),e!=null&&e.start&&(r.start=e.start),e!=null&&e.keepText||delete r.text,(r==null?void 0:r.checkbox)==="checked"&&(r.checkbox="unchecked"),r}function bF(n){if(Ne(n),!B0(n))return n;let t=hs(n);for(;t;){if(!B0(t))return t;t=hs(t)}return null}function vF(n,t,e,r){const i=new pl(n,r),o=nr(r)+1;Sa(n,t,e,{forceInsertAfter:!0,newBlockData:AF(n,r,{start:o})}),i.fix()}function BF(n){var s;if(n.selection.range.isCollapsed()){const l=n.selection.focusedBlock;if(Ft(l)&&dt(n,l)===0)return un(l)===1?tc(n,l):zC(n,l),!0}n.clearSelectedContents();const t=n.selection.focusedBlock;if(!Ft(t))return!1;const e=n.selection.range.focus;if(!e.isSimple())return!1;const r=e.offset,o=(s=r===dt(n,t)?bF(t):t)!=null?s:t;return vF(n,t,r,o),!0}function vk(n){p(Le,Ft(n),"not a list block");const{level:t}=ds(n);let e=Oe(n);for(;e;){if(Ft(e)){const{level:r}=ds(e);if(t===r)return e;if(r<t)return null}e=Oe(e)}return null}function Bk(n,t){return Ne(t),vk(t)?un(t)<kP:!1}function TF(n,t,e){let r=Oe(t);p(Le,r,"no prev brother");const i=un(e);for(;r;){if(r===e)return null;if(Ft(r)&&un(r)===i+1)return r;r=Oe(r)}return null}function Tk(n,t){if(!Bk(n,t))return!1;Ne(t);const e=vk(t);p(Le,e,"no list prev brother");const r=e,i=TF(n,t,r),o=un(r)+1;let s=et(),l=1,c=er(t);i&&(s=Xa(i),l=nr(i)+1,c=er(i));const d=jC(t),C={...n.getBlockData(t),groupId:s,level:o,start:l,...MC(c)};return n.updateBlockData(t,C),n.doc.beginBatchUpdate(),EF(d).forEach(x=>{const B=n.getBlockData(x);n.updateBlockData(x,{...B,level:(B.level||1)+1})}),n.doc.endBatchUpdate(),!0}function yF(n,t,e){return t.length===0||!t.every(r=>Ft(r.block))?!1:e==="increase"?Bk(n,t[0].block):Ak(n,t[0].block)}function yk(n,t,e){if(!yF(n,t,e))return!1;const r=t[0].block,i=un(r),o=t.filter(d=>un(d.block)<=i),s=ak(r,{withSelf:!1}),l=new Set(o.map(d=>d.block)),c=s.filter(d=>!l.has(d));return n.undoManager.runInGroup(()=>{let d=null;c.length>0&&(d=new pl(n,c[0])),o.forEach(h=>{e==="increase"?Tk(n,h.block):zC(n,h.block)}),d==null||d.fix()}),!0}function kF(n,t){return Tk(n,t)}function RF(n,t){return zC(n,t)}function wF(n){const t=n.selection.range.getSelectedBlocks();if(t.length>1)return yk(n,t,"increase"),!0;const e=t[0].block;if(!Ft(e))return!1;const r=new w0(n,e);return kF(n,e)&&(r.fix(),new pl(n,e).fix()),!0}function SF(n){const t=n.selection.range.getSelectedBlocks();if(t.length>1)return yk(n,t,"decrease"),!0;const e=t[0].block;return Ft(e)?(RF(n,e),!0):!1}class LF{constructor(t){this.editor=t}handleBeforeKeyDown(t,e){const r=t.selection.range.getSelectedBlocks();if(r.length===0||!r.some(o=>Ft(o.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||!Ft(e.block)||di(t,"Shift+Enter")?!1:this.editor.undoManager.runInGroup(()=>BF(this.editor))}handleBackspace(){return this.editor.undoManager.runInGroup(()=>CF(this.editor))}handleTab(t){return di(t,"Shift+Tab")?this.editor.undoManager.runInGroup(()=>SF(this.editor)):this.editor.undoManager.runInGroup(()=>wF(this.editor))}}class IF{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(i=>{const o=i.block;Ft(o)&&e.add(o)});const r=new Map;Array.from(e.values()).forEach(i=>{var c;const o=of(i),{start:s}=ds(o);r.set(lt(o),s);const l=(c=DP(i))!=null?c:i;r.set(lt(l),s)}),this.effectedBlockIds=r});m(this,"handleAfterClearSelection",()=>{Array.from(this.effectedBlockIds.entries()).forEach(([t,e])=>{const r=this.editor.findBlockById(t);!r||KC(this.editor,r,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 DF=I("customize-list-start-menu");class _F{constructor(t){m(this,"popup");m(this,"block",null);m(this,"show",(t,e)=>{const r=e.querySelector("div.list-container");p(DF,r,"list-block mark does not exist"),this.block=e,this.popup.manualShow(r,{theme:"light"})});m(this,"createDialogContent",()=>{const t=v("div",["customize-start-panel"],null);v("span",["customize-start-panel-title"],t,D.t("list.numberLabel"));const e=this.createNumericInput();t.appendChild(e);const r=v("button",["customize-start-panel-button"],t,D.t("list.confirm"));return this.editor.domEvents.addEventListener(t,"keydown",this.handleKeydown),this.editor.domEvents.addEventListener(r,"click",this.handleOk),t});m(this,"handleDialogShow",()=>{const t=this.block;if(!t)return;const e=this.popup.popupContent,r=e.querySelector("button.customize-start-panel-button"),i=e.querySelector("input.customize-start-panel-input"),o=nr(t);!r||!i||requestAnimationFrame(()=>{i.focus(),i.value=String(o)})});m(this,"handleOk",()=>{const e=this.popup.popupContent.querySelector("input.customize-start-panel-input"),r=this.block;if(!r)return;const i=Number(e.value);!i||(this.editor.undoManager.runInGroup(()=>{Ja(this.editor,[r,...Ya(r)],i,{resetGroupId:!0})}),this.popup.close("clickItem"))});m(this,"handleKeydown",(t,e)=>{const r=e;r.isComposing||(r.key==="Escape"?this.popup.close("cancelBar"):r.key==="Enter"&&this.handleOk())});this.editor=t,this.popup=new Va(this.createDialogContent()),this.popup.on("show",this.handleDialogShow)}destroy(){this.popup.destroy()}createNumericInput(){const t=v("input",["customize-start-panel-input"],null);t.type="number",t.min="1";const e=()=>{const i=t.value.replace(/[^\d]/g,"").replace(/^0+/,""),o=parseInt(i,10);o<=0||Number.isNaN(o)?t.value="":t.value=i};return this.editor.domEvents.addEventListener(t,"input",e),t}}function MF(n,t){return Xa(n)===Xa(t)}function UF(n,t){const e=sk(t);return e?MF(e,t)?nr(e)!==nr(t)-1:!0:!1}function OF(n,t){return hs(t)?!0:nr(t)!==1}function NF(n,t){return Ne(t),[{id:"continue-numbering",name:D.t("list.continueList"),states:UF(n,t)?[]:["disabled"]},{id:"start-new-list",name:D.t("list.restartList"),states:OF(n,t)?[]:["disabled"]},{id:"set-numbering-value",name:D.t("list.changeNumber")}]}function PF(n,t,e){var r,i;if(Ne(t),e.id==="continue-numbering"){const o=sk(t);o&&Ja(n,[t,...Ya(t)],nr(o)+1,{resetGroupId:!0,groupId:Xa(o)})}if(e.id==="start-new-list"&&n.undoManager.runInGroup(()=>{Ja(n,[t,...Ya(t)],1,{resetGroupId:!0})}),e.id==="set-numbering-value"){const o=(r=n.options.componentsOptions)==null?void 0:r.list;if((i=o==null?void 0:o.onChangeStart)!=null&&i.call(o,n,t,e))return;n.addCustom("list-customize-start-dialog",()=>new _F(n)).show(n,t)}}class FF{constructor(t){m(this,"menu");m(this,"handleClick",(t,e)=>{const r=ha(e,"div.list-container");if(r&&this.editor.isWritable()){const i=Z(r);p(Le,i,"no parent block"),Ne(i);const o=t.getBlockData(i);if(o&&o.checkbox){t.updateBlockData(i,{...o,checkbox:o.checkbox==="checked"?"unchecked":"checked"});return}if(er(i)==="unordered")return;this.menu.updateItems(this.getCommandItems(i)),this.menu.manualShow(r),this.activeList(r,!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 i;const r=(i=this.menu.tippyInstance)==null?void 0:i.reference;if(r){const o=Z(r);o&&PF(this.editor,o,e)}});this.editor=t,this.editor.addListener("click",this.handleClick),this.menu=new ls([]),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 NF(this.editor,t)}activeList(t,e){const r=Z(t);!r||(e?(z(t,"active"),z(r,"active")):(ot(t,"active"),ot(r,"active")))}}class KF{constructor(t){this.editor=t}handleBeforeKeyDown(t,e){const r=t.selection.range.getSelectedBlocks();if(r.length===0)return!1;const i=r[0].block;if(!Ft(i)||!OC(i))return!1;if(e.key==="ArrowUp"||e.key==="ArrowLeft"){const o=mr(i);return o&&t.selection.selectBlock(o,dt(t,o)),!0}if(e.key==="ArrowDown"||e.key==="ArrowRight"){const o=gr(i);return o&&t.selection.selectBlock(o,0),!0}return(e.key==="Delete"||e.key==="Backspace"||e.key==="Escape")&&dk(t,i),!0}}function VF(n,t,e,r,i){vp(n,"list-block-init",()=>{setTimeout(()=>{n.input.addHandler(new KF(n)),n.input.addHandler(new LF(n)),n.addCustom("list-clear-selection-handler",()=>new IF(n)),n.addCustom("list-marker-menu",()=>new FF(n))})});const o=Nn.createBlockContent(n,t,e,r,i),s=i,{level:l,start:c,groupId:d}=s,h=Za(s);r.setAttribute("data-list-level",`${l||1}`),r.setAttribute("data-list-start",`${c||1}`),r.setAttribute("data-list-group-id",`${d}`),r.setAttribute("data-list-type",h);const C=pF(s);return r.insertBefore(C,o),s.viewAsMindmap?setTimeout(()=>{const E=n.getBlockById(i.id);E&&y0(n,E,{},{mindmapTools:k0,saveData:!1})}):setTimeout(()=>{const E=n.getBlockById(i.id);E&&fk(n,E)}),o}const $F={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"}},HF={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"}},jF={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"}};D.mergeLang({"zh-CN":$F,"en-US":HF,"ja-JP":jF});const qlt="",kk={...Nn,blockType:"list",createBlockContent:VF,convertFrom:dF,convertTo:mF,handleDrop:eF,notify:JP,handleDeleteBlock:(n,t)=>{if(Ft(t)){const e=new w0(n,t);setTimeout(()=>{e.fix()})}}},GC=I("paragraph");class zF{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){if(!rt(t,e))return[];if(Jr(t))return[];const r=[],i={"unordered-list":[D.t("commands.unordered"),qe("CtrlOrCmd+Shift+U"),xT],"ordered-list":[D.t("commands.ordered"),qe("CtrlOrCmd+Shift+L"),ET],"check-list":[D.t("commands.check"),void 0,AT],link:[D.t("commands.link"),qe("CtrlOrCmd+K"),Zp],quoted:[D.t("commands.quote"),void 0,bT]},o=lt(e),s=Dt(e),l=Nr(t,e),c=t.getBlockData(e);return Object.entries(i).forEach(([d,[h,C,E]])=>{const x=[];if(this.isChecked(c,d)&&x.push("checked"),d==="link"){if(!t.selection.range.isSimple())return;t.selection.range.getSelectedBlocks().length!==1&&x.push("disabled")}r.push({blockId:o,blockType:s,blockKind:l,id:d,name:h,desc:C,states:x,icon:E,groupIndex:600})}),r}convertLink(t,e,r){p(GC,Vr(e.start),""),p(GC,Vr(e.start),"");const i="bottom-start",o=e.start.offset,s=e.end.offset,l=(x,B)=>{t.undoManager.runInGroup(()=>{try{const k=t.selection.range.isCollapsed();let w;if(k){w=ro(t.getBlockText(r),s,x,{link:B}),t.setBlockText(r,w);return}w=mh(t.getBlockText(r),o,s,x),w=mu(o,x.length,w,"link",B),t.setBlockText(r,w),t.selection.selectBlock(r,o+x.length),t.focus()}catch(k){GC.error(k)}})},c=()=>{t.selection.selectBlock(r,s),t.focus()},d=Yi(t,r,e)[0];if(!d)return;const h=Zi(t,r,"link-button-anchor",d),C=t.getBlockText(r),E=Ba(C,o);nf(t,{target:h,linkText:t.getSelectedText(),linkUrl:(E==null?void 0:E.link)||"",onFinished:l,onClose:c,placement:i})}convertToList(t,e,r){const i=nh(t,e,"list",{offset:0,data:{listType:r}});i&&t.undoManager.runInGroup(()=>{const o=vt(e),s=it(e);t.insertBlock(ct(s),o,i.blockData),t.deleteBlock(e)})}executeCommand(t,e,r,i){var c;if(!rt(t,e)||Jr(t))return!1;const o=i.id,s=(c=i.states)==null?void 0:c.includes("checked");let l=!1;if(o==="unordered-list"&&(s?tc(t,e):this.convertToList(t,e,"unordered"),l=!0),o==="ordered-list"&&(s?tc(t,e):this.convertToList(t,e,"ordered"),l=!0),o==="check-list"&&(s?tc(t,e):this.convertToList(t,e,"unchecked"),l=!0),o==="quoted"){const h=t.getBlockData(e).quoted;t.updateBlockData(e,{quoted:h?void 0:!0}),l=!0}if(o==="link"){const d=A0(t);d==null||d.disableTextToolbar(),d==null||d.hide(),setTimeout(()=>{d==null||d.enableTextToolbar()},1e3),this.convertLink(t,r,e),l=!0}return l}}const GF={left:Pa,right:i0,center:o0};class WF{constructor(t){m(this,"id","BlockAlignProvider");this.editor=t}applyAlignStyle(t,e,r){Object.keys(GF).includes(r)?t.updateBlockData(e,{align:r}):t.updateBlockData(e,{align:null})}isChecked(t,e){return t.align===e}getAvailableCommands(t,e,r){if(!rt(t,e))return[];if(Jr(t))return[];const i=lt(e),o=Dt(e),s=Nr(t,e),l=t.getBlockData(e),c=d=>{var C;const h=v("span",["toolbar-item-name-container"],null);for(const E of d.children)if((C=E.states)!=null&&C.includes("checked"))return h.innerHTML=E.icon||Pa,h;return h.innerHTML=Pa,h};return[{id:"align",name:D.t("commands.alignGroup"),blockId:i,blockType:o,blockKind:s,groupIndex:700,dropdown:!0,element:c,manualShowChildren:!0,childrenPlacement:"bottom-start",defaultCheckedChildren:["align-left"],children:[{id:"align-left",name:D.t("commands.alignLeft"),icon:Pa,states:this.isChecked(l,"left")?["checked"]:[]},{id:"align-center",name:D.t("commands.alignCenter"),icon:o0,states:this.isChecked(l,"center")?["checked"]:[]},{id:"align-right",name:D.t("commands.alignRight"),icon:i0,states:this.isChecked(l,"right")?["checked"]:[]}],childrenType:"menu"}]}executeCommand(t,e,r,i){if(!rt(t,e)||Jr(t))return!1;if(i.id.startsWith("align")){const o=i.id.replace(/^align-/,"");return this.applyAlignStyle(t,e,o),!0}return!1}}const qF=I("toolbar-handler"),XF={id:"",name:"",type:"separator"};class ec{constructor(t){m(this,"id","editor-toolbar");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,"_lastClickTime",0);m(this,"isInToolbar",t=>this.toolbar.isInCommandBar(t.target));m(this,"handleButtonClick",(t,e)=>{const r=this.editor.getCustom("editor-tooltip");r.lastClickButtonId=e.id,this.toolbarType==="text"?(this.editor.editorCommandProviders.executeCommand(this.editor.selection.range,e,{}),this.editor.isWritable()&&this.showTextToolbar("click")):Date.now()-this._lastClickTime>200&&(this.toolbar.close("clickItem"),this.hoveringBlock&&BP(this.editor,this.hoveringBlock,this.hoveringTextChild,e)),this._lastClickTime=Date.now()});m(this,"handleClose",()=>{aC(this.editor)&&this.editor.focus()});m(this,"handleClosing",(t,e)=>{if(this.toolbarType==="object"){const r=Vb(e);if(this.hoveringBlock===r)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,r,i)=>{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(i)}});m(this,"handleSelectionChange",ke.default(t=>{var r;if(p(qF,t===this.editor,"editor mismatch"),t.selection.range.isCollapsed()||this.mouseDown){if(this.toolbarType==="object"){const i=(r=this.toolbar.tippyInstance)==null?void 0:r.reference,o=this.editor.selection.focusedBlock;if(i&&re(i,o))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 ju([],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),Re.get(t).addListener("childChange",this.handleHoveringBlockChildChange),Re.get(t).addFilter(this),t.editorCommandProviders.registerCommandProvider(new yP(t)),t.editorCommandProviders.registerCommandProvider(new zF(t)),t.editorCommandProviders.registerCommandProvider(new WF(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),Re.get(this.editor).removeListener("childChange",this.handleHoveringBlockChildChange)}isInBlock(t,e){return t!==this.hoveringBlock?!1:!!(e.target&&e.target instanceof Node&&this.toolbar.popper&&re(this.toolbar.popper,e.target))}bindEvents(){document.addEventListener("mousedown",this.handleDocumentMouseDown)}unbindEvents(){document.removeEventListener("mousedown",this.handleDocumentMouseDown)}update(t){!this.editor.isWritable()||this.showTextToolbar(t)}showTextToolbar(t){var k,w;if(this._disableTextToolbar)return;const e=this.editor.selection.range,r=e.getSelectedBlocks();if(r.length===0)return;const i=r[0];if(!i)return;if(r.length===1){if(pe(i.block)){t==="click"&&this.showObjectToolbar(null);return}if(It(this.editor,i.block)&&e.isSimple())return}if(qi(i.block)){this.toolbar.close("selectionChange");return}const o=this.editor.editorCommandProviders.getCommands(this.editor.selection.range,this.id),s=new Map;o.forEach(U=>{const M=U.groupIndex,F=s.get(M);F?F.push(U):s.set(M,[U])});const l=[[]],c=Array.from(s.entries()).sort((U,M)=>U[0]-M[0]);for(let U=0;U<c.length;U++){const[,M]=c[U];if(M.length===0)continue;let F=l[l.length-1];F.length>0&&F[F.length-1].groupIndex!==M[M.length-1].groupIndex&&(F=[],l.push(F)),F.push(...x0(M))}if(l.length===0){this.toolbar.close("selectionChange");return}this.toolbarType="text";const d=[];if(l.forEach((U,M)=>{const F=U.sort((Y,X)=>{var G,st;return((G=Y.order)!=null?G:0)-((st=X.order)!=null?st:0)});d.push(...F),M!==l.length-1&&d.push(XF)}),d.length===0){this.toolbar.close("selectionChange");return}this.toolbar.updateItems(d);const h=r[r.length-1],C=!this.editor.selection.range.isReverse()&&h!==i,E=C?h:i,x=nk(this.editor,E),B=Zi(this.editor,E.block,"editor-quick-menu",x);this.toolbar.manualShow(B,{placement:C?"bottom":"top",offset:[0,C?5:10]}),(w=(k=this.toolbar.tippyInstance)==null?void 0:k.popperInstance)==null||w.update()}showObjectToolbar(t){var l,c,d;if(!this.hoveringBlock||this.mouseDown)return;const e=this.hoveringBlock,r=this.hoveringTextChild,{commands:i,element:o}=AP(this.editor,e,r);if(!i.length||!o){this.toolbar.close("fromHover");return}this.toolbarType="object",this.toolbar.isVisible&&((c=(l=this.toolbar)==null?void 0:l.tippyInstance)==null?void 0:c.reference)!==o&&this.toolbar.close("fromHover");const s=()=>{let h;const C=o.getClientRects(),E=[];if(Array.from(C).forEach(x=>{const{y:B}=x;E.includes(B)||E.push(B)}),E.length>1){if(h=r?C[C.length-1]:C[0],t)for(let x=0;x<C.length;x++){const B=C[x],k=new DOMRect(B.x-4,B.y-4,B.width+8,B.height+8);if(k.x<t.clientX&&t.clientX<k.right&&k.y<t.clientY&&t.clientY<k.bottom){h=B;break}}}else{if(h=o.getBoundingClientRect(),r){const x=r.getBoundingClientRect();return new DOMRect(x.x,x.y,x.width,x.height)}return new DOMRect(C[0].x,C[0].y,C[0].width,C[0].height)}if(t){const x=h.y,B=t.clientX;return new DOMRect(B,x,10,h.height)}return h};this.toolbar.updateItems(i),this.toolbar.isVisible||(this.toolbar.manualShow(o,{placement:r?"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 ec(e))}static get(t){return t.getCustom("toolbar-handler")}}function I0(n,t,e){n.getBlockData(t).heading===e?n.updateBlockData(t,{heading:null}):n.updateBlockData(t,{heading:e})}function Rk(n,t,e){["left","center","right"].includes(e)?n.updateBlockData(t,{align:e}):n.updateBlockData(t,{align:null})}function WC(n,t){const r=n.getBlockData(t).quoted;n.updateBlockData(t,{quoted:r?void 0:!0})}function qC(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 XC(n,t,e){if(!n.selection.range.focus.isSimple())return;const i=n.getBlockData(t);let o;switch(e){case"unordered-list":o=qC(i,"unordered-list")?void 0:"unordered";break;case"ordered-list":o=qC(i,"ordered-list")?void 0:"ordered";break;case"check-list":o=qC(i,"check-list")?void 0:"unchecked";break}if(o){const s=nh(n,t,"list",{offset:0,data:{listType:o}});s&&n.undoManager.runInGroup(()=>{const l=vt(t),c=it(t);n.deleteBlock(t);const d=n.insertBlock(ct(c),l,s.blockData);s.onConverted&&s.onConverted(n,d)})}else tc(n,t)}const YF=Object.freeze(Object.defineProperty({__proto__:null,applyHeadingStyle:I0,applyAlignStyle:Rk,applyQuoteStyle:WC,applyList:XC},Symbol.toStringTag,{value:"Module"})),QF=[Yh,Qh,Jh,Zh,t0,e0,n0,r0],JF={Unordered:nC,Ordered:rC,Checkbox:tC,Quote:eC};function wk(n,t){const e=n;e.blockOptions=t,e.itemType="insert-block",n.children&&n.children.forEach(r=>wk(r,t))}function ZF(){return{name:"basic",insertBlockCommandItems:[{id:"text",icon:Fa,name:D.t("commands.text"),order:0,group:"basics",value:"text"}]}}function YC(n=1){var i;const t={name:"basic",insertBlockCommandItems:[]};let e=b0();e<=4?e=5:e<8&&(e+=1);let r=n;for(;r<=e;){const o=`heading-${r}`;(i=t.insertBlockCommandItems)==null||i.push({id:o,icon:QF[r-1],name:D.t("quickMenu.basic.heading.title",{heading:String(r)}),order:r,group:"basics",value:String(r),subText:kn(o)}),r++}return t}function tK(){const n={name:"basic",insertBlockCommandItems:[]};return["Unordered","Ordered","Checkbox","Quote"].forEach((e,r)=>{var o;const i=`insert-${e.toLocaleLowerCase()}`;(o=n.insertBlockCommandItems)==null||o.push({id:i,name:D.t(`quickMenu.basic.${e.toLocaleLowerCase()}`),icon:JF[e],value:e.toLocaleLowerCase(),group:"basics",order:10+r,subText:kn(i)})}),n}class Sk{constructor(t){this.withPlainText=t}getCommands(){const t=ZF(),e=YC(),r=tK();return[...this.withPlainText?t.insertBlockCommandItems||[]:[],...e.insertBlockCommandItems||[],...r.insertBlockCommandItems||[]]}updateBlock(t,e,r,i){const{value:o,id:s}=i;return s.startsWith("heading-")?I0(t,r,Number.parseInt(o!=null?o:"1",10)||1):o==="ordered"||o==="unordered"||o==="checkbox"?XC(t,r,{ordered:"ordered-list",unordered:"unordered-list",checkbox:"check-list"}[o]):o==="quote"&&WC(t,r),null}async handleUpdateBlockCore(t,e){const r=t.getBlockByIndex(e.containerId,e.blockIndex);return this.updateBlock(t,e.containerId,r,e.item)}async handleInsertEmptyBlockCore(t,e){const{containerId:r,blockIndex:i}=e,o=t.insertTextBlock(void 0,r,i);return this.updateBlock(t,e.containerId,o,e.item)}async executeCommand(t,e,r){if(r.from==="quick-menu"||r.from==="add-block-menu"){const i=t.getBlockById(r.blockId),o=t.getParentContainer(i),s=ct(o),l=t.getBlockIndex(i);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:s,blockIndex:l})),t.focus()}else r.from==="block-menu"&&(t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:r.containerId,blockIndex:r.blockIndex})),t.focus());return null}}const Lk={basics:100,system:200,common:300,thirdParty:400};class QC{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 eK=I("mathjax-converter"),nK="MathJax-script",rK=30,Ik=8;async function iK(n){var r;window.MathJax||(window.MathJax={options:{skipHtmlTags:["script","noscript","style","textarea","pre","code","annotation","annotation-xml","body"]}});const t=n.getComponentOptions("mathjax"),e=((r=t==null?void 0:t.cdn)==null?void 0:r.mathjax)||"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js";await zs(e,nK)}function oK(){try{window.MathJax&&window.MathJax.texReset()}catch{}}async function JC(n,t){const e="mathjax2Svg";try{await Mr.lock(e),oK(),await iK(n);const r=await window.MathJax.tex2svgPromise(t),i=r.querySelector("merror");if(i)throw new Error(i.textContent);return r.querySelector("svg").outerHTML}catch(r){throw eK.error(r),r}finally{Mr.release(e)}}function sK(n){const t=new DOMParser().parseFromString(n,"image/svg+xml"),e={width:0,height:0};if(t&&t.firstChild){const r=t.firstChild,i=r.getAttribute("height"),o=r.style.minWidth;i&&(e.width=parseInt(o,10)*Ik+rK,e.height=parseInt(i,10)*Ik)}return e}async function Dk(n,t){const e=await JC(n,t);return e?await Vg(e,"image/svg+xml"):""}async function _k(n,t){const r=await JC(n,t),i=new File([r],"math.svg");return(await n.doc.uploadResource(i)).resourceId}async function lK(n,t){const e=await JC(n,t),r=sK(e),i=e,o=new File([i],"math.svg");return{resourceId:(await n.doc.uploadResource(o)).resourceId,...r}}const Mk=I("edit-mathjax");class aK{constructor(){m(this,"editMathjaxPopup",null);m(this,"onChange",null);m(this,"tex","");m(this,"observer",null);m(this,"handleClose",t=>{var r;const e=t.content.querySelector("textarea");if(e){const i=e.value;i!==this.tex&&((r=this.onChange)==null||r.call(this,i,!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",ke.default(t=>{var e;(e=this.onChange)==null||e.call(this,t,!1)},300))}editMathjax(t,e,r,i){if(!this.editMathjaxPopup)this.editMathjaxPopup=new Va(this.createPopupContent(e),{id:"mathjax-popover"});else{const o=this.getTextarea();o.value=e}this.tex=e,this.editMathjaxPopup.manualShow(t,{theme:"light",placement:i==null?void 0:i.placement}),this.editMathjaxPopup.removeAllListeners("close"),this.editMathjaxPopup.addListener("close",this.handleClose),this.onChange=r}createPopupContent(t){const e=v("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 i;(i=this.editMathjaxPopup)!=null&&i.isVisible&&t.focus()};const r=()=>{setTimeout(()=>{t.focus()})};this.observer=new IntersectionObserver(r,{}),this.observer.observe(t)}getTextarea(){p(Mk,this.editMathjaxPopup,"no exists mathjax editor popup");const t=this.editMathjaxPopup.content.querySelector("textarea");return p(Mk,t,"no textarea"),t}destroy(){var t,e;this.onChange=null,(t=this.observer)==null||t.disconnect(),(e=this.editMathjaxPopup)==null||e.removeAllListeners()}}function Uk(n,t,e,r,i){n.addCustom("mathjax-editor",()=>new aK).editMathjax(t,e.trim(),r,i)}function Ok(){return{insert:" ",attributes:{id:et(),box:!0,type:"math",tex:" ",src:"",created:Date.now()}}}function D0(n,t){const e=n.getBoxData(t),r=Z(t);if(!r)return;const i=Yo(r,t);n.selection.selectBlock(r,i.start,i.end);const o=async(s,l)=>{if(!s.trim()){n.updateBoxData({...e,tex:s,src:null});return}try{await Mr.lock("convertAndUploadMathjax");const c=await _k(n,s);n.updateBoxData({...e,tex:s,src:c})}catch(c){const d=n.getBoxData(t);n.addCustom(`mathjax-box-${d.id}`,()=>new QC).setError(c),n.updateBoxData({...e,tex:s,src:""})}finally{Mr.release("convertAndUploadMathjax"),l&&n.focus()}};Uk(n,t,e.tex,o)}const Nk=I("mathjax-box");function ZC(n,t){n.selection.updateSelection(null);const e=t.target;!e||!(e instanceof HTMLElement)||n.domEvents.removeEventListener(e,null,ZC)}async function cK(n,t,e){try{if(!t.tex.trim())return;const r=await Dk(n,t.tex),i=n.findBoxById(t.id);if(!i)return;const o=e1(i);o.innerHTML="";const s=v("img",["mathjax"],o);s.src=r,e.setDataUrl(r),n.domEvents.addEventListener(s,"load",ZC)}catch(r){e.setError(r);const i=n.findBoxById(t.id);if(!i)return;const o=i.querySelector(".mathjax-tex-text");z(o,"mathjax-error"),o.innerText=r.message,n.selection.updateSelection(null)}}function uK(n,t,e,r){const i=r,o=n.addCustom(`mathjax-box-${i.id}`,()=>new QC);if(i.src||o.dataUrl){const c=v("img",["mathjax"],e);c.src=n.doc.buildResourceUrl(i.src||o.dataUrl,{syncNewResources:async(d,h)=>{var E,x;await n.doc.addResources([d]);const C=(x=(E=n.doc).getServerMeta)==null?void 0:x.call(E).appId;if(i.src&&i.src!==h&&C&&i.src.includes(C)){const B=Z(e),k=mt.default(i);B&&n.isBlockWritable(B)&&!n.readonly&&(k.src=d,n.updateBoxData(k))}}}),n.domEvents.addEventListener(c,"load",ZC);return}const s=["mathjax-tex-text"];let l=i.tex;l.trim()?o.error&&(l=o.error.message,s.push("mathjax-error")):l=D.t("mathjax.emptyText"),v("span",s,e,l),cK(n,i,o)}function fK(n,t){const e={id:et(),box:!0,type:"math",tex:t,src:"",created:Date.now()};return _k(n,t).then(r=>{if(!n.findBoxById(e.id))return;const o={...e,src:r};n.updateBoxData(o)}).catch(r=>{Nk.error(`failed to convert and upload mathjax: ${JSON.stringify(r)}`)}),e}function dK(n,t,e,r){const i=t;return r==="text"?i.tex:r==="markdown"?` $${i.tex}$ `:i.src?`<img src="${n.doc.buildResourceUrl(i.src,{withToken:!0})}" />`:`<code>$${i.tex}$</code>`}function hK(n,t,e){const r=Z(t);p(Nk,r,"failed to get block"),!(n.readonly||!n.isBlockWritable(r))&&D0(n,t)}function mK(){return{abstract:`[${D.t("mathjax.abstract")}]`}}const Pk={boxType:"math",updateBoxContent:uK,convertFrom:fK,convertTo:dK,handleClickBox:hK,getBoxProperties:mK};async function gK(n,t,e){try{const r=t.embedData,i=await Dk(n,r.mathjaxText),o=n.findBlockById(t.id);if(!o)return;const s=Nt(o);s.innerHTML="";const l=v("img",["mathjax"],s);l.src=i,e.setDataUrl(i)}catch(r){e.setError(r)}}function pK(n,t){if(n.readonly||!t.target||!(t.target instanceof Node))return;const e=Z(t.target);if(!e||!pe(e)||$e(e)!=="math")return;const r=Nt(e),i=r.querySelector("img")||r.querySelector("span.mathjax-tex-text");if(!i||!re(i,t.target))return;const s=n.getBlockData(e).embedData;Uk(n,i,s.mathjaxText,async l=>{const{resourceId:c,width:d,height:h}=await lK(n,l),C={mathjaxText:l,src:c,width:d,height:h};n.updateEmbedData(e,C)},{placement:"bottom"})}function CK(n,t,e){const r=e.embedData,{src:i,width:o}=r,s=n.addCustom(`mathjax-block-${e.id}`,()=>new QC);if(n.domEvents.addEventListener(t,"click",pK),!r.mathjaxText.trim()){v("span",["mathjax-tex-text"],t,D.t("mathjax.emptyText"));return}if(i||s.dataUrl){const l=v("img",["mathjax"],t);l.src=n.doc.buildResourceUrl(i||s.dataUrl,{syncNewResources:async(c,d)=>{var h,C;if(i){await n.doc.addResources([c]);const E=(C=(h=n.doc).getServerMeta)==null?void 0:C.call(h).appId;if(i&&d!==i&&E&&i.includes(E)){const x=Z(t);setTimeout(()=>{if(x&&!n.readonly&&n.isBlockWritable(x)){const B=mt.default(e);B.embedData.src=c,n.updateBlockData(x,B)}})}}}}),o&&(l.style.minWidth=`${o}px`,setTimeout(()=>{const c=t.getBoundingClientRect().width;o>c?(z(t,"mathjax-overflow"),t.style.overflow="auto",t.style.setProperty("--mathjax-width",`${o}px`)):(ot(t,"mathjax-overflow"),t.removeAttribute("data-mathjax-width"),t.style.removeProperty("--mathjax-width"))}));return}s.error,v("span",["mathjax-tex-text"],t,r.mathjaxText),gK(n,e,s)}function EK(n,t,e){if(!rt(n,t))return null;const r=n.getBlockString(t).trim();if(!r||!r.startsWith("$$")||!r.endsWith("$$"))return null;const i=Ng(r,"$");if(!i)return null;const o={mathjaxText:i,src:""};return{blockData:{id:et(),type:"embed",embedType:"math",embedData:o}}}function xK(n){return{name:"Mathjax"}}function AK(n,t){var r;const e=Nt(t);n.domEvents.removeAllListeners(e),n.findCustom("mathjax-editor")&&((r=n.getCustom("mathjax-editor").editMathjaxPopup)==null||r.close("cancelBar"))}function bK(n,t,e,r){const i=t.embedData;return r==="html"?`<img src="${n.doc.buildResourceUrl(i.src,{withToken:!0})}" />`:r==="markdown"?`
|
|
615
615
|
$$${i.mathjaxText}$$
|
|
616
616
|
`:i.mathjaxText}function vK(){return{abstract:D.t("mathjax.abstract")}}const BK={embedType:"math",createEmbedContent:CK,getOptions:xK,convertFrom:EK,handleDeleteBlock:AK,convertTo:bK,getBlockProperties:vK},Xlt="",TK={mathjax:{emptyText:"\u7A7A\u7684\u516C\u5F0F",abstract:"\u516C\u5F0F"}},yK={mathjax:{emptyText:"Empty formula",abstract:"Formula"}},kK={mathjax:{emptyText:"\u6570\u5F0F\u306A\u3057",abstract:"\u6570\u5F0F"}};D.mergeLang({"zh-CN":TK,"en-US":yK,"ja-JP":kK});function RK(n,t,e,r){const i=n.getBlockByIndex(t,e),o=n.getBlockText(i),{left:s}=Mn(o,r);if(!de(s).endsWith("$$$$"))return!1;const c=r-4,d=r,h={id:et(),box:!0,type:"math",tex:" ",src:"",created:Date.now()};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,c,d-c),n.insertBoxToBlock(i,c,h),setTimeout(()=>{const C=n.getBoxById(h.id);D0(n,C)})}),!0}class wK{handleAfterInsertText(t,e,r,i,o){return!!(o===" "&&RK(t,e,r,i))}}var rr={exports:{}};/**
|
|
@@ -661,9 +661,9 @@ ${l}`:r==="markdown"?`\`\`\`${i.language}
|
|
|
661
661
|
${s}
|
|
662
662
|
\`\`\`
|
|
663
663
|
${l}`:`<p><pre><code>${jd(s)}</code></pre></p>
|
|
664
|
-
<p>${jd(l)}</p>`}function J$(n,t){uT(n,BR)}const pE={blockType:"code",blockKind:"complex",createBlockContent:N$,getBlockTextLength:P$,getRangeFromPoint:F$,moveCaret:K$,getCaretRect:V$,updateSelection:$$,clearSelection:H$,getChildContainers:j$,getNextContainer:z$,getSelectedContainers:G$,convertFrom:c$,handleBlockElementUpdated:W$,getOptions:X$,getBlockProperties:Y$,convertTo:Q$,handleDeleteBlock:J$},CE={...Nn,blockType:"code-line"};class Z${constructor(t){m(this,"handleSelectionChange",()=>{const t=this.editor.selection;if(!t.range.isCollapsed())return;const e=t.focusedBlock;if(!cf(this.editor,e))return;const r=e,i=t.range.focus.offset,o=h3(this.editor,r,i,"code-caret");o.scrollIntoView({block:"nearest"}),setTimeout(()=>{o.remove(),this.editor.selection.caret.update()})});this.editor=t,t.addListener("selectionChanged",this.handleSelectionChange)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChange)}}function tH(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!cf(n,t)){if(n.selection.range.isCollapsed()){const e=n.selection.range.start;return n.insertTextToBlock(t,e.offset," "),!0}return n.undoManager.runInGroup(()=>{Ci(n).forEach(r=>{n.insertTextToBlock(r.block,0," ")})}),!0}}function eH(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!cf(n,t))return;const e=[" "," "];return n.undoManager.runInGroup(()=>{Ci(n).forEach(i=>{const o=de(n.getBlockText(i.block));for(let s=0;s<e.length;s++){const l=e[s];if(o.startsWith(l)){n.deleteTextFromBlock(i.block,0,l.length);break}}})}),!0}function nH(n){const t=n.getFocusedBlock(),e=it(t);if(qt(e))return;const r=Z(e);if(!r||Dt(r)!=="code")return;const i=n.selection.range;if(!!i.isSimple()&&!P5(e,i))return Dh(n,e),!0}const rH={Tab:tH,"Shift+Tab":eH,"CtrlOrCmd+A":nH},uf=I("code-text-decorate");class V0{decorateText(t,e,r){if(p(uf,e.length>0,"invalid path"),e.length===1)return{};const i=e[e.length-2];if(t.doc.getBlockData(i.containerId,i.blockIndex).type!=="code")return{};const s=r;if(s.length===0)return{};const l=de(s),c=t.doc.getBlockData(i.containerId,i.blockIndex),h=(k=>{if(!k)return ca.default.languages.plain;const w=k.replace(/\s/g,"").toLocaleLowerCase();return ca.default.languages[w]||ca.default.languages.plain})(c.language),C=ca.default.tokenize(l,h),E=(k,w)=>{if(p(uf,k,"no token"),typeof k=="string")return[{insert:k,attributes:mt.default(w)}];p(uf,k instanceof ca.default.Token,"invalid token type");const U=k.content,M=mt.default(w);return M[`style-code-${k.type}`]=!0,typeof U=="string"?[{insert:U,attributes:M}]:Array.isArray(U)?U.filter(X=>X.length).map(X=>E(X,M)).flat():(p(uf,U instanceof ca.default.Token,"invalid token"),E(U,M))},B=C.map(k=>E(k,{})).flat();return p(uf,gn(B)===gn(s),"failed to highlight code, text length mismatch"),{text:B}}}const iH={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",plainText:"Plain Text"}},oH={code:{title:"Code",abstract:"Code",wrap:"Wrap",copy:"Copy",caption:"Caption",search:"Search",copySuccess:"Copied successfully",plainText:"Plain Text"}},sH={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",plainText:"\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8"}};D.mergeLang({"zh-CN":iH,"en-US":oH,"ja-JP":sH});function lH(n,t,e,r){const i=n.getBlockByIndex(t,e);if(dt(n,i)!==r)return!1;const o=de(n.getBlockText(i));if(![...o].every(h=>h==="|")||o.length<3||!n.editorBlocks.hasBlock("table"))return!1;const s=n.editorBlocks.getBlockClass("table");if(!s.convertFrom)return!1;const l=s.convertFrom(n,i,{offset:r});if(!l)return!1;const{blockData:c,focusBlockId:d}=l;return c?(n.undoManager.runInGroup(()=>{var C;const h=n.insertBlock(t,e,c,ve(n,d!=null?d:c.id,0));n.deleteBlock(i),(C=l.onConverted)==null||C.call(l,n,h)}),!0):!1}const aH={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\]/i,data:{embedType:"toc"}}},cH={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 $0(n,t,e,r,i){const o=n.getContainerById(t);if(!qt(o)){const s=Z(o);if(s&&Zr(s))return!0}return!1}function TR(n,t,e,r,i){if($0(n,t))return!1;if(i==="enter"&&lH(n,t,e,r))return!0;const o=n.getBlockByIndex(t,e),s=de(Mn(n.getBlockText(o),r).left),l=i==="enter"?aH:cH;for(const[,c]of Object.entries(l)){if(!s.match(c.reg))continue;return!!n.undoManager.runInGroup(()=>{var B;const h=nh(n,o,c.blockType,{offset:r,data:c.data});if(!h)return null;const{blockData:C,focusBlockId:E}=h;if(!C)return null;const x=n.insertBlock(t,e,C,ve(n,E!=null?E:C.id,0));return n.deleteBlock(o),(B=h.onConverted)==null||B.call(h,n,x),{newBlock:x,focusBlockId:E}})}return!1}function uH(n,t,e,r){const i=n.getBlockByIndex(t,e);return n.getBlockString(i,{boxReplacement:" "}).substring(0,r)!==">"?!1:(n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,0,r+1),n.updateBlockData(i,{quoted:!0},ve(n,i,0))}),!0)}const fH={"#":1,"##":2,"###":3,"####":4,"#####":5,"######":6,"#######":7,"########":8};function dH(n,t,e,r){const i=n.getBlockByIndex(t,e),o=n.getBlockString(i,{boxReplacement:" "}).substring(0,r);let s=fH[o];if(!s)return!1;const l=n.getBlockData(i).heading;return l&&l==s&&(s=null),n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,0,r+1),n.updateBlockData(i,{heading:s},ve(n,i,0))}),!0}function hH(n,t,e,r){return!!(dH(n,t,e,r)||uH(n,t,e,r))}const mH=I("match-text-style");function gH(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),r=e.lastIndexOf(t);return r===-1?-1:r===0?0:e.substring(r-1).startsWith(t)?-1:r}const pH={"*":{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 CH(n,t,e,r){var E,x;const i=n.getBlockByIndex(t,e),o=n.getBlockText(i),{left:s}=Mn(o,r),l=N1(s),c=gn(s)-l.length,d=Object.entries(pH);for(const[B,k]of d){const w=gH(l,B);if(w===-1)continue;const U=c+w,M=r,F=B.length,Y=de(Je(o,U+F,M-U-F*2).middle);if(k.type==="style"){const X={};k.styles.forEach(st=>{X[st]=!0});const G=ol(Y,X);n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,U,M-U),n.insertTextToBlock(i,U,G)})}else if(k.type==="box")try{const X=(x=(E=n.editorBoxes.getBoxClass(k.boxType)).convertFrom)==null?void 0:x.call(E,n,Y);if(!X)continue;n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,U,M-U),n.insertBoxToBlock(i,U,X)})}catch(X){mH.warn(`failed to convert to box, ${X.message}`);continue}return!0}const h=/\[([^\]]+)\]\((https?:\/\/\S+)\)\s*$/,C=l.match(h);if(C){const B=C.index,k=C[1],w=C[2],U=B,M=r,Y={...Ba(o,U),link:w};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,U,M-U),n.insertTextToBlock(i,U,ol(k,Y))}),!0}return!1}class H0{handleAfterInsertText(t,e,r,i,o){if(o===" "){if($0(t,e))return!1;if(hH(t,e,r,i)||CH(t,e,r,i))return!0}return!1}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:i,blockIndex:o,offset:s}=t.getTextPosition();if(rt(t,t.getBlockByIndex(i,o))){if(di(e,"Enter")){if(TR(t,i,o,s,"enter"))return!0}else if(di(e,"Space")&&TR(t,i,o,s,"space"))return!0}return!1}}const EH={"en-US":{placeholder:{default:"Type / for commands",heading:"Heading {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"}}};D.mergeLang(EH);function ff(n,t){const e=Jo(n,t);return!!(rt(n,t)&&e.text&&gn(e.text)===0&&!t.querySelector(".inputting-insertion"))}function yR(n,t){var r;Nt(t).removeAttribute("data-content-placeholder"),(r=t.querySelector("[data-type=block-tools] .block-placeholder-container"))==null||r.remove()}function df(n,t,e){var i;if(yR(n,t),!ff(n,t))return;const r=Nt(t);if(typeof e=="string")r.setAttribute("data-content-placeholder",e);else{const o=oe(t),s=(i=o.querySelector(".block-placeholder-container"))!=null?i:v("div",["block-placeholder-container"],o);s.innerHTML="",s.appendChild(e)}}function xH(n){const t=n.getAttribute("data-style-heading");return t?D.t("placeholder.heading",{heading:t}):n.getAttribute("data-style-quoted")?D.t("placeholder.quote"):null}function AH(n){const t=n.getAttribute("data-list-type");return t?t==="ordered"||t==="unordered"?D.t("placeholder.list"):D.t("placeholder.mention"):null}function kR(n){switch(Dt(n)){case"text":return xH(n);case"list":return AH(n);default:return null}}function bH(n){if(pr(n))return!1;const t=Z(it(n));return t?Dt(t)==="code":!1}function vH(n){return!pr(n)}function BH(n,t){var h,C;const e=n.selection.focusedBlock,r=Dt(e),i=t.contentPlaceholder||D.t("placeholder.default");let o=i;if(r&&ou(n,r)&&e){if(!n.isBlockWritable(e)||bH(e))return;vH(e)&&(o=D.t("placeholder.common.contentInTable")),o=(h=kR(e))!=null?h:o}const s=n.getFirstBlock(),l=t.hideTitle?s:Jt(s);if(!l)return;const c=Jt(l);if(c&&!t.addPlaceholderToAllCurrentEmptyBlock)return;if(!c&&ff(n,l)){df(n,l,(C=kR(l))!=null?C:i);return}const d=n.getFocusedBlock();!ff(n,d)||d===s&&!t.hideTitle||df(n,d,o)}function TH(n,t){var i,o;const e=n.getFirstBlock(),r=Nt(e);ff(n,e)?(r.setAttribute("data-title-placeholder",(i=t.titlePlaceholder)!=null?i:D.t("placeholder.title")),r.setAttribute("data-title-placeholder-readonly",(o=t.readonlyTitlePlaceholder)!=null?o:"")):(r.removeAttribute("data-title-placeholder"),r.removeAttribute("data-title-placeholder-readonly"))}function yH(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 kH(n,t){var e;yH(n),n.selection.range.isCollapsed()&&(t.hideTitle||TH(n,t),(e=t.applyContentPlaceholder)!=null&&e.call(t,n)||BH(n,t))}const aat="";function RH(n){for(let t=0;t<n.length;t++){const e=n[t];if(e.attributes&&Object.keys(e.attributes).length)return!0}return!1}const RR=I("enforce-title");class EE{constructor(t,e={headingLevel:1}){m(this,"handleSelectionChange",t=>{setTimeout(()=>{this.applyPlaceholder(t)})});m(this,"reload",t=>{this.handleChanged(t),this.applyPlaceholder(t)});this.options=e,this.handleChanged(t),this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange),setTimeout(()=>{t.addListener("load",this.reload)})}destroy(t){t.removeListener("selectionChanged",this.handleSelectionChange),t.removeListener("load",this.reload)}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:i,blockIndex:o,offset:s}=t.getTextPosition();if(!this.isDocumentTitleBlock(i,o)||!di(e,"Enter"))return!1;let l=!1,c=null;Or(t.rootContainer)===2&&(c=zo(t.rootContainer,1),dt(t,c)===0&&(l=!0));const d=t.getFirstBlock();return t.undoManager.runInGroup(()=>{t.breakTextBlock(d,s,{forceInsertAfter:!0}),l&&c&&t.deleteBlock(c)}),!0}handleChanged(t){var e,r;try{const i=t.doc.getContainerBlocks(ct(t.rootContainer));p(RR,i.length>0,"root container is empty");const o=i[0];if(o.type!=="text"&&!this.options.hideTitle){const s=Ai("",{heading:(e=this.options.headingLevel)!=null?e:1});t.insertBlock(ct(t.rootContainer),0,s,t.selection.range.toDocRange()).setAttribute("data-document-title","");return}if(!this.options.hideTitle){p(RR,o.text,"invalid text block");const s=t.getBlockById(o.id);if(RH(o.text)||o.quoted||o.heading!==this.options.headingLevel){const l=t.getBlockString(s),c=Ai(l,{heading:(r=this.options.headingLevel)!=null?r:1,quoted:!1}),d=t.selection.focusedBlock;let h=t.selection.range;const C=t.insertBlock(ct(t.rootContainer),0,c);C.setAttribute("data-document-title",""),d===s&&(h=ve(t,c.id,dt(t,C))),kh(t,s,h)}else s.setAttribute("data-document-title","")}if(i.length>1||this.options.hideTitle)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,r;!((e=this.options)!=null&&e.titlePlaceholder)&&!((r=this.options)!=null&&r.contentPlaceholder)||kH(t,this.options)}isDocumentTitleBlock(t,e){return t==="root"&&e===0&&!this.options.hideTitle}}function ti(n){return Dt(n)==="embed"&&$e(n)==="image"}async function wR(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>{t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=e,r.src=n})}async function wH(n){const t=await ma(n);return wR(t)}function ps(n){return typeof n=="number"}const SH=I("image-data"),hf=1e3,SR=400,LH=10;function ic(n){return n.src.startsWith("empty:")||!n.src}function IH(n){return n.src.startsWith("http:")||n.src.startsWith("https:")}function LR(n){return`${Md.default(n)}_width`}function IR(n){return`${Md.default(n)}_height`}function DR(n){return`${n}_flex`}function _R(n){let t=n.getBoundingClientRect().width;return t-=Number.parseFloat(window.getComputedStyle(n).paddingLeft)+Number.parseFloat(window.getComputedStyle(n).paddingRight),t}function oc(n){if(n.every(i=>typeof i.flex=="number"&&i.flex))return;const t=100,r=n.map(i=>{const o=i.width==="auto"?hf:i.width,s=i.height==="auto"?o/t:i.height/t;return o/s}).reduce((i,o)=>i+o,0);n.forEach(i=>{const o=i.width==="auto"?hf:i.width,s=i.height==="auto"?o/t:i.height/t,l=o/s;i.flex=l/r})}function sc(n){const t=(i,o)=>{i||(i=`empty:${o}`);const s=LR(i),l=IR(i),c=DR(o);let d=n[s],h=n[l],C=n[c];return typeof d=="string"&&(d=Number.parseInt(d,10)),typeof h=="string"&&(h=Number.parseInt(h,10)),typeof C=="string"&&(C=Number.parseInt(C,10)),{src:i,width:d!=null?d:"auto",height:h!=null?h:"auto",flex:C,virtualSize:!d||!h}};let e=[];const r=n.src;return Array.isArray(r)?e=r.map(t):typeof r=="string"&&(e=r.split("|").map(t)),oc(e),e}function ei(n){const t=n.embedData;return sc(n.embedData).length>1?100:t.widthPercent}function DH(n,t,e,r){const i=sc(t.embedData);if(i.length>1||r)return"100%";const o=ei(t),s=n.rootContainer.getBoundingClientRect().width;if(o){const l=_R(e);return`${Math.min(s*o/100,l)}px`}return ps(i[0].width)?`${i[0].width}px`:"auto"}function En(n,t){const r={src:n.map(i=>i.src).join("|"),widthPercent:t};return n.forEach((i,o)=>{const s=i.src||`empty:${o}`,l=LR(s);l&&ps(i.width)&&(r[l]=i.width);const c=IR(s);c&&ps(i.height)&&(r[c]=i.height),p(SH,i.flex,"no image flex");const d=DR(o);r[d]=i.flex}),r}function _H(n,t,e,r){const i=sc(t.embedData),o=i.length===1?n.rootContainer:e;if(i.length===1&&r)return`${SR}px`;if(i.some(h=>h.height==="auto"))return"auto";const s=ei(t);if(!s){if(i.length!==1||ps(i[0].width))return"";const C=i[0].height;return C==="auto"?"auto":`${C}px`}let l=o.getBoundingClientRect().width*(s/100);if(l-=Number.parseFloat(window.getComputedStyle(o).paddingLeft)+Number.parseFloat(window.getComputedStyle(o).paddingRight),o===n.rootContainer&&o!==e&&(l=Math.min(l,_R(e))),i.length===1){const h=i[0];if(h.virtualSize)return"";const C=h.width==="auto"?hf:h.width;return`${h.height/(C/l)}px`}l-=(i.length-1)*LH;const c=i.reduce((h,C)=>h+C.flex,0);let d=0;for(const h of i){const C=l*h.flex/c,E=h.width==="auto"?hf:h.width,x=C/E*h.height;d=Math.max(x,d)}return`${d}px`}function MH(n){return n.reduce((e,r)=>e+r.flex,0)}function UH(n,t){v("div",["resize-gripper",t],n).setAttribute("data-resize-type",t)}function xE(n){return oe(n).querySelector(".block-resizer")}function OH(n){const t=xE(n);t&&ot(t,"active")}function MR(n,t,e){const r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),o=i.top-r.top,s=i.left-r.left,l=i.width,c=i.height;e.style.top=`${o}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${c}px`}function NH(n,t,e,r){const i=xE(n);if(i)return z(i,"active"),MR(n,t,i),i;const o=oe(n),s=v("div",["block-resizer"],o);return MR(n,t,s),e.resize.forEach(l=>{UH(s,l)}),s.addEventListener("mousedown",r),z(s,"active"),s}function AE(n,t){const e=xE(n);if(!e||!re(n,t))return;const r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),o=i.top-r.top,s=i.left-r.left,l=i.width,c=i.height;e.style.top=`${o}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${c}px`}const cat="",PH=I("block-resizer");class mf extends ye.TypedEmitter{constructor(e,r){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 r=this.getResizableElement();if(!r||e.button!==0)return;const i=e.target;if(!i||!(i instanceof HTMLElement))return;const o=i.getAttribute("data-resize-type");!o||(this.bindEvents(),this.startRect=r.getBoundingClientRect(),this.startPos=e,this.resizeType=o,Qc(window.getComputedStyle(i).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 i=e.x-this.startPos.x,o=e.y-this.startPos.y,s=this.startRect;let{top:l,left:c,right:d,bottom:h}=s;(this.resizeType==="bottom"||this.resizeType==="bottom-left"||this.resizeType==="bottom-right")&&(h+=o),(this.resizeType==="top"||this.resizeType==="top-left"||this.resizeType==="top-right")&&(l+=o),(this.resizeType==="left"||this.resizeType==="top-left"||this.resizeType==="bottom-left")&&(c+=i),(this.resizeType==="right"||this.resizeType==="top-right"||this.resizeType==="bottom-right")&&(d+=i);const C=d>c?d-c:0,E=h>l?h-l:0,x=new DOMRect(c,l,C,E);this.emit("resizing",this,x);const B=this.getResizableElement();B&&AE(this.block,B)});m(this,"handleMouseUp",e=>{if(e.button!==0)return;Qc(""),this.unbindEvents(),this.emit("resized",this);const r=this.getResizableElement();!r||!this.block||AE(this.block,r)});this.editor=e,this.options=r}enableResize(e,r){this.block=e,this.resizableElement=r,this.createResizer(),this.enabled=!0}disableResize(){!this.block||(OH(this.block),this.enabled=!1)}update(e,r){this.block=e,this.resizableElement=r,this.getResizableElement()&&this.enabled&&this.createResizer()}updateResizer(){const e=this.getResizableElement();e&&this.block&&AE(this.block,e)}getBlock(){return this.block}destroy(){}getResizableElement(){return this.resizableElement?this.resizableElement:this.block?Nt(this.block):null}createResizer(){const e=this.getResizableElement();!e||!this.block||(p(PH,re(this.block,e),"not a block child element"),NH(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 FH=I("image-dom");function UR(n){return n.querySelector(".uploading-progress-mask")}function KH(n){const t=UR(n);if(t)return t;const e=v("div",["uploading-progress-mask"],n),r=v("div",["uploading-progress-bar"],e);return v("div",["uploading-progress-bar-value"],r),r}function VH(n){const e=KH(n).querySelector(".uploading-progress-bar-value");return p(FH,e,"no progress value"),e}function OR(n,t){const e=VH(n);e.style.width=`${t}%`}function $H(n){var t;(t=UR(n))==null||t.remove()}function gf(n,t,e,r){const i=e!=null?e:n.findBlockById(t.id);if(!i)return;const o=r||it(i),s=!!i.querySelector(".images > .image-container.error, .images > .image-container.empty "),l=DH(n,t,o,s),c=_H(n,t,o,s),d=Nt(i);l==="auto"?d.style.width=l:(d.style.maxWidth=l,d.style.width="100%");const h=i.querySelector(".images");!h||(h.style.height=c||"none")}function HH(n){let t;return n.forEach((e,r)=>{r.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function jH(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),r=HH(t.headers).toLocaleLowerCase();let i="";if(r){const s=wg.default[r].extensions;s&&s.length>0&&(i=s[0])}return new File([e],`${Date.now()}.${i}`,{type:r})}catch{return null}}function Cs(n,t){const e=typeof t=="string"?t:lt(t);return n.getCustom(`image-${e}`)}function j0(n,t){if(!t||!(t instanceof Node))return null;const e=Z(t);return e?Cs(n,e):null}function Li(n){return Array.from(n.querySelectorAll(".image-container"))}const bE=I("table-resize-drag-drop");class zH{constructor(t,e,r,i){m(this,"cursor","col-resize");m(this,"initWidths");this.editor=t,this.elem=e,this.data=r,this.mouseDownEvent=i;const o=this.data.block,l=Cs(this.editor,o).getImages(),c=this.data.splitterIndex;p(bE,c>=0&&c<l.length-1,`invalid splitter index: ${c}`);const h=Li(o).map(C=>C.getBoundingClientRect().width);this.initWidths=h}onDragStart(t,e,r){if(!this.editor.isWritable())return;const i=this.data.block;Cs(this.editor,i).setResizing(!0)}onDragging(t,e,r,i,o){const s=this.data.block,l=Cs(this.editor,s),c=mt.default(l.getImages()),d=this.data.splitterIndex;p(bE,d>=0&&d<c.length-1,`invalid splitter index: ${d}`);const h=this.initWidths[d],C=this.initWidths[d+1];if(h+C<100)return;let E=i;h+E<50&&(E=50-h),C-E<50&&(E=C-50);const k=[...this.initWidths];k[d]+=E,k[d+1]-=E;const w=Li(s);p(bE,w.length===c.length,"invalid image data");const U=k.reduce((Y,X)=>Y+X,0);for(let Y=0;Y<c.length;Y++){const X=k[Y]/U;c[Y].flex=X,w[Y].style.flexGrow=`${X}`}const M=mt.default(this.editor.getBlockData(s)),F=En(c,ei(M));M.embedData=F,gf(this.editor,M,s,null)}onDragEnd(t,e,r,i,o){const s=this.data.block,l=Cs(this.editor,s),d=Li(s).map(h=>Number.parseFloat(h.style.flexGrow));l.updateFlex(d),l.setResizing(!1)}}function NR(n){var t;return!n||!(n instanceof HTMLElement)?null:wt(n,"image-splitter")?n:(t=n.closest(".image-splitter"))!=null?t:null}function GH(n,t){var s;const e=NR(t.target);if(!e)return;const r=Z(e);if(!r)return;Cs(n,r).setSelectedIndex(-1),n.selection.selectBlock(r,0);const i=Number.parseInt((s=e.getAttribute("data-index"))!=null?s:"",10);if(Number.isNaN(i)||typeof i!="number")return;const o={block:r,splitterIndex:i};Og(new zH(n,e,o,t))}function WH(n,t){t.preventDefault(),t.stopPropagation();const e=NR(t.target);if(!e)return;const r=Z(e);!r||Cs(n,r).resetFlex()}function qH(n,t,e,r){const i=v("div",["image-splitter"],e);v("div",["image-splitter-indicator"],i),i.setAttribute("data-index",`${r}`),n.domEvents.addEventListener(i,"mousedown",GH),n.domEvents.addEventListener(i,"dblclick",WH)}const XH=I("image-item");function PR(n){return!n||!(n instanceof Node)?null:Z(n)}function FR(n){const t=PR(n);return t?Li(t):[]}function vE(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 pf(n){const t=vE(n);return t?FR(n).indexOf(t):-1}async function YH(n,t){const e=j0(n,t.target);if(!e)return;const r=pf(t.target);if(r===-1)return;const i=t.target;if(!(i instanceof HTMLImageElement))return;const o=e.getImages()[r];if(ic(o)||n.readonly||!e.isAutoFix()||(setTimeout(()=>{e.setAutoFix(!1)},400),(o.height==="auto"||o.width==="auto")&&e.fixImageSize(r,i),o.virtualSize&&e.fixImageSize(r,i),!o||!IH(o)||o.downloading))return;o.downloading=!0;const s=await jH(o.src);s?e.replaceImage(r,s):XH.warn(`failed to download image: ${o.src}`)}function QH(n,t,e){if(t.querySelector(".load-error"))return;const i=e.src.startsWith("http:")||e.src.startsWith("https:"),o=v("div",["load-error"],t),s=v("div",["error-icon"],o);s.innerHTML=Xp;const l=v("div",["error-message"],o);i?(l.innerHTML=D.t("image.load.remote.failed"),n.domEvents.addEventListener(o,"click",(c,d)=>{d.preventDefault(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&window.open(e.src,"_blank","noreferrer=1")})):(l.innerHTML=D.t("image.load.failed"),n.domEvents.addEventListener(o,"click",(c,d)=>{d.preventDefault(),d.stopPropagation(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&ej(c,d.target)}))}function BE(n,t){setTimeout(()=>{if(re(n.rootContainer,t)){const e=n.getBlockData(t);gf(n,e,null,null)}})}function JH(n,t){const e=j0(n,t.target);if(!e)return;const r=pf(t.target);if(r===-1)return;const i=e.getImages()[r];if(!i)return;const o=vE(t.target);if(!o)return;const s=Z(o);let l=!1;n.doc.buildResourceUrl(i.src,{syncNewResources(c,d){var C,E;n.doc.addResources([c]);const h=(E=(C=n.doc).getServerMeta)==null?void 0:E.call(C).appId;if(i.src&&d!==i.src&&h&&i.src.includes(h)&&s&&!n.readonly&&n.isBlockWritable(s)){const x=mt.default(n.getBlockData(s));x.embedData.src=c,n.updateEmbedData(s,x.embedData),l=!0,t.target instanceof HTMLImageElement&&(t.target.src=d)}}}),!l&&(z(o,"error","error-load"),s&&BE(n,s),o.innerHTML="",QH(n,o,i))}function ZH(n,t,e){if(t.querySelector(".upload-error"))return;const i=v("div",["upload-error"],t),o=v("div",["error-icon"],i);o.innerHTML=Xp;const s=v("div",["error-message"],i);s.innerHTML=D.t("image.upload.failed"),n.domEvents.addEventListener(i,"click",(l,c)=>{if(c.preventDefault(),!c.target||!(c.target instanceof Element)||c.target.tagName!=="A")return;const d=j0(l,c.target),h=pf(c.target);!d||h===-1||d.replaceImage(h,e)})}function KR(n,t,e,r,i){const o=Li(t)[e];!o||(z(o,"error","error-upload"),BE(n,t),o.innerHTML="",ZH(n,o,i))}function VR(n,t,e,r,i,o,s){const l=v("div",["image-container"],e);if(l.setAttribute("data-src",r.src),s.length>1&&(l.style.flexShrink=`${r.flex}`,l.style.flexGrow=`${r.flex}`),o===i&&z(l,"active"),ic(r)){z(l,"empty");const d=v("div",["upload-image-icon"],l);return d.innerHTML=yT,l}const c=v("img",["editor-image"],l);if(c.src=n.doc.buildResourceUrl(r.src),n.domEvents.addEventListener(c,"load",YH),n.domEvents.addEventListener(c,"error",JH),r.src.startsWith("https:")||r.src.startsWith("http:")){const d=v("div",["image-warning"],l);d.innerHTML=qp,d.setAttribute(`data-editor-tooltip-${n.clientId}`,D.t("image.load.remote.tooltip"))}return l}function tj(n,t,e,r,i){const o=v("div",["images"],e);return r.forEach((s,l)=>{l>0&&qH(n,t,o,l-1),VR(n,t,o,s,l,i,r)}),r.length>1&&z(t,"multi"),o}function $R(n,t,e,r,i,o){const l=Array.from(t.querySelectorAll(".image-container"))[r];if(!l)return;const c=VR(n,t,null,e,r,i,o);l.insertAdjacentElement("beforebegin",c),l.remove(),BE(n,t)}function Cf(n,t){return Li(n)[t]}function ej(n,t){const e=PR(t);if(!e)return;const r=pf(t);if(r===-1)return;const i=j0(n,t);if(!i)return;const o=i.getImages()[r];$R(n,e,o,r,i.getSelectedIndex(),i.getImages())}function HR(n){var r;let t="image/*";const e=(r=n.getComponentOptions("image"))==null?void 0:r.allowedMedias;return e&&(t=e.map(i=>`.${i}`).join(",")),t}function jR(n,t){var s;const{maxSize:e,allowedMedias:r,callbacks:i}=(s=n.getComponentOptions("image"))!=null?s:{};if(e&&t.size>e){const l=new Error("image is too large");throw l.code="MaxMediaSize",i!=null&&i.onError&&(i==null||i.onError(n,l)),l}const o=eu(t.name);if(r&&!r.includes(o.toLowerCase())){const l=new Error(`media file is not allowed: ${o}`);throw l.code="NotAllowedFile",i!=null&&i.onError&&(i==null||i.onError(n,l)),l}}function zR(n){return n.startsWith("image/")}const GR=I("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 r=pf(e.target);if(r===-1)return;const i=this.images[r];ic(i)||this.setSelectedIndex(r)});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||it(e)===t&&gf(this.editor,this.blockData,e,null)});m(this,"handleResizing",(t,e)=>{const r=this.editor.findBlockById(this.blockData.id);if(!r)return;this.autoFix||this.setAutoFix(!0);const i=r.querySelector(".images");i.style.height="";const s=this.editor.rootContainer.getBoundingClientRect().width,l=r.getBoundingClientRect();let c=e.width>l.width?l.width:e.width;c<50&&(c=50);const d=c*100/s;this.blockData.embedData.widthPercent=d,gf(this.editor,this.blockData,r,null)});m(this,"handleResized",t=>{const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const r=En(this.images,ei(this.blockData));this.editor.updateEmbedData(e,r),this.blockResizer.enableResize(e)});m(this,"fixImageSizes",ke.default(()=>{const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=En(this.images,ei(this.blockData));this.editor.updateEmbedData(t,e)},1e3));this.editor=t,this.blockData=e,this.blockResizer=new mf(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=sc(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,r){const i=tj(this.editor,e,r,this.images,this.selectedIndex);if(this.editor.domEvents.addEventListener(r,"mousedown",this.handleMouseDown),this.editor.addListener("resize",this.handleRootContainerResize),Fr(t)){const s=()=>{this.handleEditorResize(t)};this.parentContainerResizerObserver=new Vs(s),this.parentContainerResizerObserver.observe(t)}const o=()=>!!(this.images.length===1&&this.images[0].virtualSize);this.isEmpty()&&o()&&z(i,"empty"),gf(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 ei(this.blockData)}isEmpty(){return this.images.length===1&&ic(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 i=Cf(e,this.selectedIndex);i&&ot(i,"active")}this.selectedIndex=t;const r=Cf(e,t);r&&z(r,"active")}async requestUploadImage(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const r=Cf(e,t);if(wt(r,"error"))return;const i=HR(this.editor),o=await ga(i);await this.replaceImage(t,o)}tryEnableResizer(){const t=this.editor.findBlockById(this.blockData.id);if(!t||!this.editor.isWritable())return;const e=Cf(t,0);!this.isEmpty()&&this.images.length===1&&!wt(e,"error")&&this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}fixImageSize(t,e){const r=this.images[t];ic(r)||(ps(r.width)&&!ps(r.height)?r.height=r.width/e.naturalWidth*e.naturalHeight:ps(r.height)&&!ps(r.width)?r.width=r.height/e.naturalHeight*e.naturalWidth:(r.width=e.naturalWidth,r.height=e.naturalHeight),r.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 r=mt.default(this.images);if(r.splice(t,1),r.length===0)return this.editor.deleteBlock(e),!0;r[0].flex=NaN,oc(r),this.selectedIndex>=r.length&&(this.selectedIndex=r.length-1);const i=En(r,ei(this.blockData));return this.editor.updateEmbedData(e,i),!0}async replaceImage(t,e){const r=this.editor.findBlockById(this.blockData.id);if(!r)return!1;try{const o=await ma(e),s=this.images[t];if(s.virtualSize){const{width:c,height:d}=await wR(o);s.width=c,s.height=d,s.virtualSize=!1,this.images[0].flex=NaN,oc(this.images);const h=En(this.images,ei(this.blockData));this.editor.updateEmbedData(r,h)}const l={...s,src:o};$R(this.editor,r,l,t,this.selectedIndex,this.images),setTimeout(()=>{this.blockResizer.update(r)})}catch(o){return KR(this.editor,r,t,o,e),!1}const i=Cf(r,t);if(!i)return!1;z(i,"uploading"),OR(i,0),z(r,"media-block-uploading");try{const o=await this.editor.doc.uploadResource(e,{onProgress:c=>{OR(i,c)}});ot(i,"uploading"),this.images[t].src=o.resourceId;const s=this.editor.findBlockById(this.blockData.id);if(!s)return!1;ot(s,"media-block-uploading");const l=En(this.images,ei(this.blockData));return this.editor.updateEmbedData(s,l),!0}catch(o){GR.error(o);const s=this.editor.findBlockById(this.blockData.id);return s&&(ot(i,"uploading"),$H(i),KR(this.editor,s,t,o,e),ot(s,"media-block-uploading")),!1}}updateFlex(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;p(GR,t.length===this.images.length,"invalid flex");for(let i=0;i<this.images.length;i++)this.images[i].flex=t[i];const r=En(this.images,ei(this.blockData));this.editor.updateEmbedData(e,r)}resetFlex(){const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=mt.default(this.images);e[0].flex=NaN,oc(e);const r=En(e,ei(this.blockData));this.editor.updateEmbedData(t,r)}setData(t){this.blockData=t,this.images=sc(t.embedData)}static create(t,e){const r=t.addCustom(`image-${e.id}`,()=>new Ie(t,e));return r.setData(e),r}static getImageObject(t,e){let r;return typeof e=="string"?r=e:r=lt(e),t.getCustom(`image-${r}`)}}const uat="",fat="";function z0(n){const t=oe(n);let e=t.querySelector(":scope > .block-helper");return e||(e=v("div",["block-helper"],t),v("span",["helper-sizer"],e,"A")),e}function TE(n,t,e){const r=z0(n),o=Array.from(r.children).find(s=>{var c;return Number.parseInt((c=s.getAttribute("data-index"))!=null?c:"0",10)>e});r.insertBefore(t,o!=null?o:null)}const WR=40,nj=20;class rj{findTargetBlock(t,e){const r=e.target;if(r&&r instanceof Element){const c=Z(r);if(c&&re(t.rootContainer,c))return c}let i=e.clientX,o=e.clientY;const s=t.rootContainer.getBoundingClientRect().left;i<s&&s-i<WR&&(i+=WR);let l=Ae(i,o,{noFilter:!0});if(l){const c=Z(l);if(c&&re(t.rootContainer,c))return c}if(o-=nj,l=Ae(i,o,{noFilter:!0}),l){const c=Z(l);if(c&&re(t.rootContainer,c))return c}return null}destroy(){}}class ij extends M0{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 r=this.editor.selection.focusedBlock;this.suggest.popup(r,0,"","")}setBlock(e){this.currentBlock=e}}function oj(n,t,e){const r=s1(n,t);if(!r)return[];const i=[],o=(s,l)=>{var c;return(c=s.children)==null?void 0:c.map(d=>({...d,source:"block-command",blockMenuItemCustomData:l,children:o(d,l)}))};return Object.values(r).forEach(s=>{e!=null&&e.has(s.group)||i.push(...s.commands.map(l=>({...l,source:"block-command",blockMenuItemCustomData:s.group,children:o(l,s.group)})))}),i}function yE(n,t,e){const r=nE(n,e),i=o=>{o.forEach(s=>{s.source=t,s.children&&i(s.children)})};return i(r),r}function sj(n,t,e,r=!1){var h,C,E;const i=it(t);let o=t;if(o&&Ft(o)&&OC(o)){if(!r){const x=PP(o);o=(h=Jt(x))!=null?h:x}k0.closeMindmap(n,t)}let l=vt(o);if(!se(n,o)&&!r){let x=gr(o);x?l=vt(x):(x=Ue(i),l=vt(x)+1)}const c=ct(i),d=e;return n.emit("beforeExecCommand",n,e,{source:"block-menu"}),d.commandProvider?d.commandProvider.executeCommand(n,e,{from:"block-menu",containerId:c,blockIndex:l}):(E=(C=d.blockOptions)==null?void 0:C.handleInsertEmptyBlock)==null?void 0:E.call(C,n,{containerId:c,blockIndex:l,item:e,from:"block-menu"})}function lj(n,t){const e=Nr(n,t),r=n.getBlockData(t);return!(e!=="text"||r.heading)}class qR{constructor(t,e,r){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,r)=>{var o;const i=YC();this.createItem("text",Fa,e,lj(this.editor,t)),(o=i.insertBlockCommandItems)==null||o.forEach(s=>{s.id&&s.icon&&this.createItem(s.id,s.icon,e,r?r===Number(s.value):!1)})});m(this,"createListItemElement",(t,e,r)=>{const{checkbox:i,ordered:o}=r,l=Dt(t)==="list",c=l&&o===!1&&!i,d=l&&o,h=l&&!!i;this.createItem("unordered-list",nC,e,c),this.createItem("ordered-list",rC,e,d),this.createItem("check-list",tC,e,h)});m(this,"handleClick",(t,e)=>{var c,d;if(!e.target||!(e.target instanceof Node))return;const r=e.target instanceof Element?e.target:e.target.parentElement;if(!r)return;const i=r.closest(".text-style-item");if(!i)return;const o=i.id,s="heading-",l={id:o,name:""};if(t.emit("beforeExecCommand",t,l,{source:"block-command"}),o==="text"&&I0(t,this.block,null),o.startsWith(s)){const h=Number.parseInt(o.substring(s.length),10);h&&I0(t,this.block,h)}if(o==="blockquote"&&WC(t,this.block),o.startsWith("align")){const h=o.replace(/^align-/,"");Rk(t,this.block,h)}(o==="unordered-list"||o==="ordered-list"||o==="check-list")&&XC(t,this.block,o),(d=(c=this.options).onAfterStyleItemClick)==null||d.call(c)});m(this,"calcTextStyleItemTooltipsEnum",()=>{this.textStylesTooltips={text:{title:D.t("commands.text")},blockquote:{title:D.t("commands.quote")},"align-left":{title:D.t("commands.alignLeft")},"align-center":{title:D.t("commands.alignCenter")},"align-right":{title:D.t("commands.alignRight")},"unordered-list":{title:D.t("commands.unordered")},"ordered-list":{title:D.t("commands.ordered")},"check-list":{title:D.t("commands.check")}};let t=1;for(;t<=8;)this.textStylesTooltips[`heading-${t}`]={title:D.t("commands.heading",{name:`${t}`})},t++});this.editor=t,this.block=e,this.options=r,this.calcTextStyleItemTooltipsEnum(),this.element=this.createItemElement(t,e),t.domEvents.addEventListener(this.element,"click",this.handleClick)}createItemElement(t,e){const r=v("div",["text-styles"],null),i=v("div",["text-style-section"],r),o=t.getBlockData(e);if(!this.options.fromEmbed){const l=o.heading,c=o.quoted;this.createHeadingItemElement(e,i,l),this.createListItemElement(e,i,o),this.createItem("blockquote",eC,i,!!c)}const s=o.align||"left";return this.createItem("align-left",Pa,i,s==="left"),this.createItem("align-center",o0,i,s==="center"),this.createItem("align-right",i0,i,s==="right"),r}createItem(t,e,r,i=!1){const o=["style-icon","text-style-item"];i&&o.push("active");const s=Hs(e,o,r);s.id=t;const l=this.textStylesTooltips[t];if(!l)return;const{title:c,shortcut:d}=l;s.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,c),d&&s.setAttribute(`data-editor-tooltip-desc-${this.editor.clientId}`,qe(d))}}function XR(){return{source:"separator",type:"separator",id:`section-${et()}`,name:""}}const YR={copy:VT,cut:$T,delete:HT,"lock-block":jT,"unlock-block":zT,comment:ul},aj=["image","video"];function cj(n,t,e){const r=[],i=rt(n,t),o=pe(t)&&aj.includes($e(t)),s=o&&($e(t)!=="image"||$e(t)==="image"&&Li(t).length===1);if(i?r.push(new qR(n,t,e)):o&&s&&r.push(new qR(n,t,{...e,fromEmbed:!0})),!se(n,t)||UC(t)){(i||o&&s)&&r.push(XR());const l=oj(n,t,new Set(["hovering-toolbar"]));l.sort((c,d)=>{var h,C;return((h=c.order)!=null?h:0)-((C=d.order)!=null?C:0)}),l.forEach(c=>{c.id in YR&&(c.icon=YR[c.id])}),r.push(...l)}return se(n,t)&&!UC(t)?r.push(...yE(n,"insert-block",{withPlainText:!1,from:"block-menu"})):r.push(XR(),{id:"insert-block-before",icon:GT,name:D.t("blockMenu.command.insertAbove"),children:yE(n,"insert-block-before",{withPlainText:!0,from:"block-menu"}),childrenMenuId:"quick-menu",source:"insert-block-before"},{id:"insert-block-after",icon:WT,name:D.t("blockMenu.command.insertAfter"),children:yE(n,"insert-block",{withPlainText:!0,from:"block-menu"}),source:"insert-block",childrenMenuId:"quick-menu"}),r}function uj(n,t,e){if(e.source==="block-command"){const r=e.blockMenuItemCustomData;Gv(n,t,r,e)}else(e.source==="insert-block"||e.source==="insert-block-before")&&sj(n,t,e,e.source==="insert-block-before")}const fj=I("exclusive-block");function kE(n,t,e,r){var l;z(t,"block-exclusive");const i=Qt(n,t),o=(l=i.getBlockProperties)==null?void 0:l.call(i,n,t),{abstract:s}=o||{};t.setAttribute("data-user-name",r),t.setAttribute("data-user-id",e),t.setAttribute("data-exclusive-tips",D.t("exclusive.tips",{editor:r,embedType:s||D.t("exclusive.fallbackAbstract")}))}function QR(n){ot(n,"block-exclusive"),n.removeAttribute("data-user-name"),n.removeAttribute("data-user-id"),n.removeAttribute("data-exclusive-tips")}function dj(n,t,e,r,i){fj.debug(`block ${lt(t)} ${e?"exclusive":"unexclusive"}, ${r}, ${i}`),e?kE(n,t,r,i):QR(t)}function Ef(n){return n.classList.contains("block-exclusive")}function JR(n,t){t.blockIds.forEach(e=>{const r=n.findBlockById(e);r&&dj(n,r,t.exclusive,t.userId,t.displayName)})}class Es{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(i=>i.userId));Array.from(this.remoteExclusiveBlockIds.entries()).forEach(([i,o])=>{if(!e.has(o.userId)){this.remoteExclusiveBlockIds.delete(i);const s={...o,exclusive:!1};JR(this.editor,s)}});const r=Array.from(this.exclusiveBlockIds).map(i=>this.editor.findBlockById(i)).filter(i=>!!i);r.length>0&&this.broadcastExclusiveBlockMessage(r,!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;JR(this.editor,e),e.blockIds.forEach(r=>{e.exclusive?this.remoteExclusiveBlockIds.set(r,e):this.remoteExclusiveBlockIds.delete(r)})}}getExclusiveMessage(t){return this.remoteExclusiveBlockIds.get(t)}broadcastExclusiveBlockMessage(t,e){if(this.editor.readonly||t.length===0)return;const r=this.editor.doc.getUser(),i={type:"exclusiveBlock",userId:r.userId,displayName:r.displayName,blockIds:t.map(o=>lt(o)),exclusive:e};this.editor.doc.broadcastMessage(i)}exclusiveBlock(t){this.exclusiveBlockIds.has(lt(t))||(this.broadcastExclusiveBlockMessage([t],!0),this.exclusiveBlockIds.add(lt(t)),this.exclusiveBlockIds.size===1&&this.startExclusiveBlockTimer())}unexclusiveBlock(t){!this.exclusiveBlockIds.has(lt(t))||(this.exclusiveBlockIds.delete(lt(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 Es(t))}static register(t){return this.get(t)}}function RE(n,t){Es.get(n).exclusiveBlock(t)}function wE(n,t){Es.get(n).unexclusiveBlock(t)}class ZR{writable(t,e){if(Array.isArray(e)){for(const r of e)if(Ef(r))return!1;return}if(Ef(e))return!1}create(t,e,r,i,o){const s=Es.get(t).getExclusiveMessage(o.id);s&&kE(t,i,s.userId,s.displayName)}update(t,e,r,i,o){const s=Es.get(t).getExclusiveMessage(o.id);s?kE(t,i,s.userId,s.displayName):QR(i)}}const dat="",hj={exclusive:{tips:"\u300C{editor}\u300D\u6B63\u5728\u7F16\u8F91\uFF0C\u300C{embedType}\u300D\u4E0D\u652F\u6301\u591A\u4EBA\u7F16\u8F91",fallbackAbstract:"\u8BE5 Block"}},mj={exclusive:{tips:"\u300C{editor}\u300Dis editing\uFF0C\u300C{embedType}\u300Ddoes not support multi-person editing",fallbackAbstract:"This Block"}},gj={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"}};D.mergeLang({"zh-CN":hj,"en-US":mj,"ja-JP":gj});function xf(n,t){return n.getBlockData(t).lock}function G0(n,t){return!!xf(n,t)}function Af(n,t){const e=xf(n,t);return e?e.userId===n.doc.getUser().userId:!1}function SE(n,t){const e=xf(n,t);return e?e.userId!==n.doc.getUser().userId:!1}function pj(n,t){if(n.readonly||!n.isBlockWritable(t)||G0(n,t)&&!Af(n,t))return;const e=n.doc.getUser(),r={userId:e.userId,displayName:e.displayName,locked:Date.now()},o={...n.getBlockData(t),lock:r};n.updateBlockData(t,o)}function Cj(n,t){if(!Af(n,t))return;const e={lock:null};n.updateBlockData(t,e)}const Ej=10,xj=80,Aj=50;class LE{constructor(){m(this,"executeCommand",(t,e,r)=>{const i=r.data;if(!i||!i.blockId)return;const o=t.getBlockById(i.blockId);i.type==="lock"?pj(t,o):i.type==="unlock"&&Cj(t,o)})}create(t,e,r,i,o){const s=o.lock;s&&(s.userId!==t.doc.getUser().userId?z(i,"locked-by-others"):z(i,"locked-by-self"))}update(t,e,r,i,o){const s=o.lock;if(s)if(s.userId!==t.doc.getUser().userId){z(i,"locked-by-others");const l=t.selection.focusedBlock;(l===i||re(i,l))&&(rt(t,i)||Dt(i)==="code")&&t.insertTextBlock("",ct(r),vt(i)+1)}else z(i,"locked-by-self");else ot(i,"locked-by-others"),ot(i,"locked-by-self")}writable(t,e){let r=[];Array.isArray(e)?r=e:r.push(e);for(const i of r){if(SE(t,i))return!1;if(pr(i))return;let o=Js(i);for(;o;){if(SE(t,o))return!1;o=Js(o)}}}commands(t,e){const r=G0(t,e),i=Af(t,e),o=Ef(e),s={blockId:lt(e),type:"lock"},l={id:"lock-block",name:"",data:s,order:50};if(r)if(i)l.id="unlock-block",l.name=D.t("locker.unlock"),s.type="unlock";else{const c=xf(t,e);let d=(c==null?void 0:c.displayName)||"";const h=D.getCurrentLang()==="ja-JP",C=hv(d,Ej,h?Aj:xj);(C==null?void 0:C.length)!==d.length&&(l.ellipsisTooltip=c==null?void 0:c.displayName,d=C||""),l.name=D.t("locker.lockedBy",{name:d}),l.states=["disabled"]}else o?(l.name=D.t("locker.lock"),l.states=["disabled"]):l.name=D.t("locker.lock");return{group:"block-locker",commands:[l],executeCommand:this.executeCommand}}}const hat="",bj={locker:{lock:"\u9501\u5B9A",unlock:"\u89E3\u9664\u9501\u5B9A",lockedBy:"\u88AB {name} \u9501\u5B9A"}},vj={locker:{lock:"Lock",unlock:"Unlock",lockedBy:"Locked by {name}"}},Bj={locker:{lock:"\u30ED\u30C3\u30AF",unlock:"\u30ED\u30C3\u30AF\u89E3\u9664",lockedBy:"{name}\u304C\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F"}};D.mergeLang({"zh-CN":bj,"en-US":vj,"ja-JP":Bj});class W0{async handleBeforePasteDoc(t,e){return Object.values(e.blocks).forEach(r=>{r.forEach(i=>{delete i.lock})}),!1}}const Tj=I("standard-block-actions");class yj{constructor(){m(this,"executeCommand",(t,e,r)=>{const i=r.data;try{const o=t.getBlockById(i);if(r.id==="delete"){this.deleteBlock(t,o);return}r.id==="copy"&&this.copyBlock(t,o),r.id==="cut"&&(this.copyBlock(t,o),this.deleteBlock(t,o))}catch(o){Tj.error(`failed to execute block command: ${JSON.stringify(o)}`)}})}commands(t,e){const r=G0(t,e),i=r&&Af(t,e),o=lt(e),s=window.isSecureContext,l=Ef(e),c={id:"copy",name:D.t("blockMenu.command.copy"),data:o,order:10,states:s?[]:["disabled"],disableReason:s?void 0:D.t("copyCutProperty.unsafeEnvTips",{shortCut:qe("CtrlOrCmd+C"),operation:D.t("copyCutProperty.copy")})},d={id:"cut",name:D.t("blockMenu.command.cut"),data:o,order:20,states:r&&!i||!s||l?["disabled"]:[],disableReason:s?void 0:D.t("copyCutProperty.unsafeEnvTips",{shortCut:qe("CtrlOrCmd+X"),operation:D.t("copyCutProperty.cut")})},h={id:"delete",name:D.t("blockMenu.command.delete"),data:o,order:30,states:r&&!i||l?["disabled"]:[]};return{group:"standard-block-actions",commands:[c,d,h],executeCommand:this.executeCommand}}deleteBlock(t,e){if(mi(e)){const r=Ca(e);t.undoManager.runInGroup(()=>{[e,...r].forEach(i=>t.deleteBlock(i))})}else t.deleteBlock(e)}copyBlock(t,e){if(mi(e)){const r=Ca(e),i=$5(t,[e,...r]);Uh(t,i)}else Ep(t,e)}}const tw=I("block-menu");class kj{constructor(t){m(this,"menu");m(this,"currentBlock",null);m(this,"commandBlock",null);m(this,"handleShow",()=>{p(tw,this.currentBlock,"no target block before show block menu");const t=cj(this.editor,this.currentBlock,{onAfterStyleItemClick:this.close});this.menu.updateItems(t),this.commandBlock=this.currentBlock});m(this,"handleClose",()=>{aC(this.editor)&&this.editor.focus()});m(this,"handleItemClick",(t,e)=>{p(tw,this.commandBlock,"no command block before show block menu"),uj(this.editor,this.commandBlock,e),e.element||this.close()});m(this,"close",()=>{this.menu.close("clickItem")});this.editor=t,this.menu=new ls([],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 yj)}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 Rj=1e3;async function wj(n,t){const{width:e}=n.rootContainer.getBoundingClientRect(),r=t.getBoundingClientRect();return r.width>e||r.height>=Rj?"":(await yb.default.toSvg(t)).replace(/margin-block:.*?;/,"").replace(/margin:.*?;/,"")}const Sj=I("drag-preview-image");class Lj{constructor(t){m(this,"startPosition",null);m(this,"dragContainer",null);m(this,"handleDragStart",async(t,e)=>{const r=t.target;p(Sj,r instanceof Element,`Invalid Drag target:${r}`);const{x:i,y:o}=t;this.startPosition={x:i,y:o};const s=v("div",["drag-image-container"],this.editor.rootContainer),l=v("img",["drag-image"],s),c=v("span",["drag-loading"],s);c.innerHTML=QT;const{x:d,width:h,height:C,y:E}=r.getBoundingClientRect(),x=this.editor.rootContainer.getBoundingClientRect(),B=e.getBoundingClientRect();s.style.left=`${d+h}px`,s.style.top=`${E+C}px`,s.style.width=`${Math.min(x.width/2,B.width)}px`,this.dragContainer=s;const w=await wj(this.editor,e);w?l.src=w:z(s,"drag-placeholder"),_g(s,{status:"loaded"})});m(this,"handleDrag",t=>{if(this.startPosition&&this.dragContainer){const{x:e,y:r}=t;if(e===0&&r===0){this.dragContainer.style.transition="transform 0.15s, opacity .15s",this.dragContainer.style.transform="",this.dragContainer.style.opacity="0";return}const{x:i,y:o}=this.startPosition,s=e-i,l=r-o;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 ew="drag-preview-element";function Ij(n){if(wt(n,ew))return n;const t=n.querySelector(`.${ew}`);return t||(pe(n)?Nt(n):n)}const q0=I("block-menu-drag-handler");function IE(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 Dj{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(p(q0,e,"no dragged block"),t.button!==0)return;if(!this.editor.isBlockWritable(e)){t.preventDefault(),t.stopPropagation();return}const{x:r,y:i}=t;this.oldPos={x:r,y:i},document.addEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.addEventListener("mousemove",this.handleDrag)});m(this,"handleDragStart",t=>{var s,l;const e=Xe(this.button.buttonElement);this.autoScroll||(this.autoScroll=new Qd({scrollElement:e,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}));const r=this.button.blockMenu.currentBlock;p(q0,r,"no dragged block"),(l=(s=Qt(this.editor,r)).notify)==null||l.call(s,this.editor,"beginDrag");const i=IE(t,"dragstart");Nj(this.editor,i,r),window.isDragging=!0,this.button.buttonElement.style.opacity="0";const o=Ij(r);this.dragPreview.handleDragStart(t,o),this.autoScroll.active(),z(r,"dragging"),z(this.editor.contentElement,"dragging")});m(this,"handleDrag",t=>{const{target:e,x:r,y:i}=t;if(this.oldPos.x===r&&this.oldPos.y===i)return;window.isDragging||this.handleDragStart(t),this.oldPos={x:r,y:i},p(q0,e instanceof Element,"target is invalid"),this.dragPreview.handleDrag(t);const o=IE(t,"dragover");this.editor.contentElement.dispatchEvent(o)});m(this,"handleDragEnd",t=>{var i;const e=this.button.blockMenu.currentBlock;p(q0,e,"no dragged block"),window.isDragging=!1,this.button.buttonElement.style.opacity="1",this.dragPreview.handleDragEnd(),(i=this.autoScroll)==null||i.inactive(),ot(e,"dragging"),ot(this.editor.contentElement,"dragging"),document.removeEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.removeEventListener("mousemove",this.handleDrag);const r=IE(t,"drop");this.editor.contentElement.dispatchEvent(r)});this.editor=t,this.button=e,this.button.buttonElement.addEventListener("mousedown",this.handleMouseDown),this.dragPreview=new Lj(t)}destroy(){this.button.buttonElement.removeEventListener("mousedown",this.handleMouseDown)}}class bf{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=lt(t),z(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 bf(t))}static get(t){return t.getCustom("editor-block-highlighter")}}class nw{constructor(t){m(this,"buttonElement");m(this,"emptyBlockMenu");m(this,"blockMenu");m(this,"dragHandler");m(this,"handleHoverBlock",(t,e,r)=>{if(this.emptyBlockMenu.isVisible||this.blockMenu.isVisible||!this.editor.isWritable())return;const i=this.editor.getCustom("editor-tooltip");if(i&&i.visible()&&(i.hide(),this.buttonElement.setAttribute("data-tooltip-hide-at",`${Date.now()}`)),!t){this.buttonElement.parentElement&&(this.blockMenu.isInMenu(r.target)||this.buttonElement.remove());return}const o=o1(t);qi(o)||(this.updateButton(o),TE(o,this.buttonElement,Number.MAX_SAFE_INTEGER))});m(this,"handleButtonClick",()=>{if(this.buttonElement.getAttribute("data-type")==="move"){const r=this.blockMenu.currentBlock;if(!r)return;this.editor.selection.selectBlock(r,0,void 0,{noScroll:!0}),this.blockMenu.show(this.buttonElement,{placement:"bottom-end"}),setTimeout(()=>{bf.get(this.editor).highlightBlock(r)});return}const e=this.emptyBlockMenu.currentBlock;!e||(this.editor.selection.selectBlock(e,0,void 0,{noScroll:!0}),setTimeout(()=>{this.editor.focus(),this.updatePlaceholder(e),this.emptyBlockMenu.show()}))});m(this,"updatePlaceholder",t=>{df(this.editor,t,D.t("blockMenu.button.searchPlaceholder"))});m(this,"handleChanged",()=>{const t=this.emptyBlockMenu.currentBlock;if(!t)return;if(this.blockMenu.currentBlock){const r=lt(this.blockMenu.currentBlock);if(!this.editor.findBlockById(r)&&this.blockMenu.isVisible){this.blockMenu.close();return}}const e=se(this.editor,t)?"insert":"move";this.buttonElement.getAttribute("data-type")!==e&&this.setButtonType(e)});this.editor=t,this.buttonElement=this.createButton(),this.emptyBlockMenu=new ij(t),this.blockMenu=new kj(t),this.editor.addListener("docChanged",this.handleChanged),this.buttonElement.addEventListener("click",this.handleButtonClick),this.dragHandler=new Dj(this.editor,this);const e=Re.get(t);e.addListener("change",this.handleHoverBlock),e.addFinder(new rj),bf.register(this.editor)}destroy(){Re.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=v("button",["block-button"],null);return t.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,D.t("blockMenu.button.tips")),t.innerHTML=iC,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=YT,this.buttonElement.setAttribute(e,D.t("blockMenu.button.insertTips"))):(this.buttonElement.innerHTML=iC,this.buttonElement.setAttribute(e,D.t("blockMenu.button.tips")))}updateButton(t){this.emptyBlockMenu.setBlock(t),this.blockMenu.setBlock(t),se(this.editor,t)&&!(Ft(t)&&UC(t))?this.setButtonType("insert"):this.setButtonType("move")}}const _j={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
|
|
664
|
+
<p>${jd(l)}</p>`}function J$(n,t){uT(n,BR)}const pE={blockType:"code",blockKind:"complex",createBlockContent:N$,getBlockTextLength:P$,getRangeFromPoint:F$,moveCaret:K$,getCaretRect:V$,updateSelection:$$,clearSelection:H$,getChildContainers:j$,getNextContainer:z$,getSelectedContainers:G$,convertFrom:c$,handleBlockElementUpdated:W$,getOptions:X$,getBlockProperties:Y$,convertTo:Q$,handleDeleteBlock:J$},CE={...Nn,blockType:"code-line"};class Z${constructor(t){m(this,"handleSelectionChange",()=>{const t=this.editor.selection;if(!t.range.isCollapsed())return;const e=t.focusedBlock;if(!cf(this.editor,e))return;const r=e,i=t.range.focus.offset,o=h3(this.editor,r,i,"code-caret");o.scrollIntoView({block:"nearest"}),setTimeout(()=>{o.remove(),this.editor.selection.caret.update()})});this.editor=t,t.addListener("selectionChanged",this.handleSelectionChange)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChange)}}function tH(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!!cf(n,t)){if(n.selection.range.isCollapsed()){const e=n.selection.range.start;return n.insertTextToBlock(t,e.offset," "),!0}return n.undoManager.runInGroup(()=>{Ci(n).forEach(r=>{n.insertTextToBlock(r.block,0," ")})}),!0}}function eH(n){if(!n.isWritable())return!1;const t=n.getFocusedBlock();if(!cf(n,t))return;const e=[" "," "];return n.undoManager.runInGroup(()=>{Ci(n).forEach(i=>{const o=de(n.getBlockText(i.block));for(let s=0;s<e.length;s++){const l=e[s];if(o.startsWith(l)){n.deleteTextFromBlock(i.block,0,l.length);break}}})}),!0}function nH(n){const t=n.getFocusedBlock(),e=it(t);if(qt(e))return;const r=Z(e);if(!r||Dt(r)!=="code")return;const i=n.selection.range;if(!!i.isSimple()&&!P5(e,i))return Dh(n,e),!0}const rH={Tab:tH,"Shift+Tab":eH,"CtrlOrCmd+A":nH},uf=I("code-text-decorate");class V0{decorateText(t,e,r){if(p(uf,e.length>0,"invalid path"),e.length===1)return{};const i=e[e.length-2];if(t.doc.getBlockData(i.containerId,i.blockIndex).type!=="code")return{};const s=r;if(s.length===0)return{};const l=de(s),c=t.doc.getBlockData(i.containerId,i.blockIndex),h=(k=>{if(!k)return ca.default.languages.plain;const w=k.replace(/\s/g,"").toLocaleLowerCase();return ca.default.languages[w]||ca.default.languages.plain})(c.language),C=ca.default.tokenize(l,h),E=(k,w)=>{if(p(uf,k,"no token"),typeof k=="string")return[{insert:k,attributes:mt.default(w)}];p(uf,k instanceof ca.default.Token,"invalid token type");const U=k.content,M=mt.default(w);return M[`style-code-${k.type}`]=!0,typeof U=="string"?[{insert:U,attributes:M}]:Array.isArray(U)?U.filter(X=>X.length).map(X=>E(X,M)).flat():(p(uf,U instanceof ca.default.Token,"invalid token"),E(U,M))},B=C.map(k=>E(k,{})).flat();return p(uf,gn(B)===gn(s),"failed to highlight code, text length mismatch"),{text:B}}}const iH={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",plainText:"Plain Text"}},oH={code:{title:"Code",abstract:"Code",wrap:"Wrap",copy:"Copy",caption:"Caption",search:"Search",copySuccess:"Copied successfully",plainText:"Plain Text"}},sH={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",plainText:"\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8"}};D.mergeLang({"zh-CN":iH,"en-US":oH,"ja-JP":sH});function lH(n,t,e,r){const i=n.getBlockByIndex(t,e);if(dt(n,i)!==r)return!1;const o=de(n.getBlockText(i));if(![...o].every(h=>h==="|")||o.length<3||!n.editorBlocks.hasBlock("table"))return!1;const s=n.editorBlocks.getBlockClass("table");if(!s.convertFrom)return!1;const l=s.convertFrom(n,i,{offset:r});if(!l)return!1;const{blockData:c,focusBlockId:d}=l;return c?(n.undoManager.runInGroup(()=>{var C;const h=n.insertBlock(t,e,c,ve(n,d!=null?d:c.id,0));n.deleteBlock(i),(C=l.onConverted)==null||C.call(l,n,h)}),!0):!1}const aH={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\]/i,data:{embedType:"toc"}}},cH={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 $0(n,t,e,r,i){const o=n.getContainerById(t);if(!qt(o)){const s=Z(o);if(s&&Zr(s))return!0}return!1}function TR(n,t,e,r,i){if($0(n,t))return!1;if(i==="enter"&&lH(n,t,e,r))return!0;const o=n.getBlockByIndex(t,e),s=de(Mn(n.getBlockText(o),r).left),l=i==="enter"?aH:cH;for(const[,c]of Object.entries(l)){if(!s.match(c.reg))continue;return!!n.undoManager.runInGroup(()=>{var B;const h=nh(n,o,c.blockType,{offset:r,data:c.data});if(!h)return null;const{blockData:C,focusBlockId:E}=h;if(!C)return null;const x=n.insertBlock(t,e,C,ve(n,E!=null?E:C.id,0));return n.deleteBlock(o),(B=h.onConverted)==null||B.call(h,n,x),{newBlock:x,focusBlockId:E}})}return!1}function uH(n,t,e,r){const i=n.getBlockByIndex(t,e);return n.getBlockString(i,{boxReplacement:" "}).substring(0,r)!==">"?!1:(n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,0,r+1),n.updateBlockData(i,{quoted:!0},ve(n,i,0))}),!0)}const fH={"#":1,"##":2,"###":3,"####":4,"#####":5,"######":6,"#######":7,"########":8};function dH(n,t,e,r){const i=n.getBlockByIndex(t,e),o=n.getBlockString(i,{boxReplacement:" "}).substring(0,r);let s=fH[o];if(!s)return!1;const l=n.getBlockData(i).heading;return l&&l==s&&(s=null),n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,0,r+1),n.updateBlockData(i,{heading:s},ve(n,i,0))}),!0}function hH(n,t,e,r){return!!(dH(n,t,e,r)||uH(n,t,e,r))}const mH=I("match-text-style");function gH(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),r=e.lastIndexOf(t);return r===-1?-1:r===0?0:e.substring(r-1).startsWith(t)?-1:r}const pH={"*":{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 CH(n,t,e,r){var E,x;const i=n.getBlockByIndex(t,e),o=n.getBlockText(i),{left:s}=Mn(o,r),l=N1(s),c=gn(s)-l.length,d=Object.entries(pH);for(const[B,k]of d){const w=gH(l,B);if(w===-1)continue;const U=c+w,M=r,F=B.length,Y=de(Je(o,U+F,M-U-F*2).middle);if(k.type==="style"){const X={};k.styles.forEach(st=>{X[st]=!0});const G=ol(Y,X);n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,U,M-U),n.insertTextToBlock(i,U,G)})}else if(k.type==="box")try{const X=(x=(E=n.editorBoxes.getBoxClass(k.boxType)).convertFrom)==null?void 0:x.call(E,n,Y);if(!X)continue;n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,U,M-U),n.insertBoxToBlock(i,U,X)})}catch(X){mH.warn(`failed to convert to box, ${X.message}`);continue}return!0}const h=/\[([^\]]+)\]\((https?:\/\/\S+)\)\s*$/,C=l.match(h);if(C){const B=C.index,k=C[1],w=C[2],U=B,M=r,Y={...Ba(o,U),link:w};return n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,U,M-U),n.insertTextToBlock(i,U,ol(k,Y))}),!0}return!1}class H0{handleAfterInsertText(t,e,r,i,o){if(o===" "){if($0(t,e))return!1;if(hH(t,e,r,i)||CH(t,e,r,i))return!0}return!1}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:i,blockIndex:o,offset:s}=t.getTextPosition();if(rt(t,t.getBlockByIndex(i,o))){if(di(e,"Enter")){if(TR(t,i,o,s,"enter"))return!0}else if(di(e,"Space")&&TR(t,i,o,s,"space"))return!0}return!1}}const EH={"en-US":{placeholder:{default:"Type / for commands",heading:"Heading {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"}}};D.mergeLang(EH);function ff(n,t){const e=Jo(n,t);return!!(rt(n,t)&&e.text&&gn(e.text)===0&&!t.querySelector(".inputting-insertion"))}function yR(n,t){var r;Nt(t).removeAttribute("data-content-placeholder"),(r=t.querySelector("[data-type=block-tools] .block-placeholder-container"))==null||r.remove()}function df(n,t,e){var i;if(yR(n,t),!ff(n,t))return;const r=Nt(t);if(typeof e=="string")r.setAttribute("data-content-placeholder",e);else{const o=oe(t),s=(i=o.querySelector(".block-placeholder-container"))!=null?i:v("div",["block-placeholder-container"],o);s.innerHTML="",s.appendChild(e)}}function xH(n){const t=n.getAttribute("data-style-heading");return t?D.t("placeholder.heading",{heading:t}):n.getAttribute("data-style-quoted")?D.t("placeholder.quote"):null}function AH(n){const t=n.getAttribute("data-list-type");return t?t==="ordered"||t==="unordered"?D.t("placeholder.list"):D.t("placeholder.mention"):null}function kR(n){switch(Dt(n)){case"text":return xH(n);case"list":return AH(n);default:return null}}function bH(n){if(pr(n))return!1;const t=Z(it(n));return t?Dt(t)==="code":!1}function vH(n){return!pr(n)}function BH(n,t){var h,C;const e=n.selection.focusedBlock,r=Dt(e),i=t.contentPlaceholder||D.t("placeholder.default");let o=i;if(r&&ou(n,r)&&e){if(!n.isBlockWritable(e)||bH(e))return;vH(e)&&(o=D.t("placeholder.common.contentInTable")),o=(h=kR(e))!=null?h:o}const s=n.getFirstBlock(),l=t.hideTitle?s:Jt(s);if(!l)return;const c=Jt(l);if(c&&!t.addPlaceholderToAllCurrentEmptyBlock)return;if(!c&&ff(n,l)){df(n,l,(C=kR(l))!=null?C:i);return}const d=n.getFocusedBlock();!ff(n,d)||d===s&&!t.hideTitle||df(n,d,o)}function TH(n,t){var i,o;const e=n.getFirstBlock(),r=Nt(e);ff(n,e)?(r.setAttribute("data-title-placeholder",(i=t.titlePlaceholder)!=null?i:D.t("placeholder.title")),r.setAttribute("data-title-placeholder-readonly",(o=t.readonlyTitlePlaceholder)!=null?o:"")):(r.removeAttribute("data-title-placeholder"),r.removeAttribute("data-title-placeholder-readonly"))}function yH(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 kH(n,t){var e;yH(n),n.selection.range.isCollapsed()&&(t.hideTitle||TH(n,t),(e=t.applyContentPlaceholder)!=null&&e.call(t,n)||BH(n,t))}const aat="";function RH(n){for(let t=0;t<n.length;t++){const e=n[t];if(e.attributes&&Object.keys(e.attributes).length)return!0}return!1}const RR=I("enforce-title");class EE{constructor(t,e={headingLevel:1}){m(this,"handleSelectionChange",t=>{setTimeout(()=>{this.applyPlaceholder(t)})});m(this,"reload",t=>{this.handleChanged(t),this.applyPlaceholder(t)});this.options=e,this.handleChanged(t),this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange),setTimeout(()=>{t.addListener("load",this.reload)})}destroy(t){t.removeListener("selectionChanged",this.handleSelectionChange),t.removeListener("load",this.reload)}handleBeforeKeyDown(t,e){if(!t.selection.range.isSimple())return!1;const{containerId:i,blockIndex:o,offset:s}=t.getTextPosition();if(!this.isDocumentTitleBlock(i,o)||!di(e,"Enter"))return!1;let l=!1,c=null;Or(t.rootContainer)===2&&(c=zo(t.rootContainer,1),dt(t,c)===0&&(l=!0));const d=t.getFirstBlock();return t.undoManager.runInGroup(()=>{t.breakTextBlock(d,s,{forceInsertAfter:!0}),l&&c&&t.deleteBlock(c)}),!0}handleChanged(t){var e,r;try{const i=t.doc.getContainerBlocks(ct(t.rootContainer));p(RR,i.length>0,"root container is empty");const o=i[0];if(o.type!=="text"&&!this.options.hideTitle){const s=Ai("",{heading:(e=this.options.headingLevel)!=null?e:1});t.insertBlock(ct(t.rootContainer),0,s,t.selection.range.toDocRange()).setAttribute("data-document-title","");return}if(!this.options.hideTitle){p(RR,o.text,"invalid text block");const s=t.getBlockById(o.id);if(RH(o.text)||o.quoted||o.heading!==this.options.headingLevel){const l=t.getBlockString(s),c=Ai(l,{heading:(r=this.options.headingLevel)!=null?r:1,quoted:!1}),d=t.selection.focusedBlock;let h=t.selection.range;const C=t.insertBlock(ct(t.rootContainer),0,c);C.setAttribute("data-document-title",""),d===s&&(h=ve(t,c.id,dt(t,C))),kh(t,s,h)}else s.setAttribute("data-document-title","")}if(i.length>1||this.options.hideTitle)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,r;!((e=this.options)!=null&&e.titlePlaceholder)&&!((r=this.options)!=null&&r.contentPlaceholder)||kH(t,this.options)}isDocumentTitleBlock(t,e){return t==="root"&&e===0&&!this.options.hideTitle}}function ti(n){return Dt(n)==="embed"&&$e(n)==="image"}async function wR(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>{t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=e,r.src=n})}async function wH(n){const t=await ma(n);return wR(t)}function ps(n){return typeof n=="number"}const SH=I("image-data"),hf=1e3,SR=400,LH=10;function ic(n){return n.src.startsWith("empty:")||!n.src}function IH(n){return n.src.startsWith("http:")||n.src.startsWith("https:")}function LR(n){return`${Md.default(n)}_width`}function IR(n){return`${Md.default(n)}_height`}function DR(n){return`${n}_flex`}function _R(n){let t=n.getBoundingClientRect().width;return t-=Number.parseFloat(window.getComputedStyle(n).paddingLeft)+Number.parseFloat(window.getComputedStyle(n).paddingRight),t}function oc(n){if(n.every(i=>typeof i.flex=="number"&&i.flex))return;const t=100,r=n.map(i=>{const o=i.width==="auto"?hf:i.width,s=i.height==="auto"?o/t:i.height/t;return o/s}).reduce((i,o)=>i+o,0);n.forEach(i=>{const o=i.width==="auto"?hf:i.width,s=i.height==="auto"?o/t:i.height/t,l=o/s;i.flex=l/r})}function sc(n){const t=(i,o)=>{i||(i=`empty:${o}`);const s=LR(i),l=IR(i),c=DR(o);let d=n[s],h=n[l],C=n[c];return typeof d=="string"&&(d=Number.parseInt(d,10)),typeof h=="string"&&(h=Number.parseInt(h,10)),typeof C=="string"&&(C=Number.parseInt(C,10)),{src:i,width:d!=null?d:"auto",height:h!=null?h:"auto",flex:C,virtualSize:!d||!h}};let e=[];const r=n.src;return Array.isArray(r)?e=r.map(t):typeof r=="string"&&(e=r.split("|").map(t)),oc(e),e}function ei(n){const t=n.embedData;return sc(n.embedData).length>1?100:t.widthPercent}function DH(n,t,e,r){const i=sc(t.embedData);if(i.length>1||r)return"100%";const o=ei(t),s=n.rootContainer.getBoundingClientRect().width;if(o){const l=_R(e);return`${Math.min(s*o/100,l)}px`}return ps(i[0].width)?`${i[0].width}px`:"auto"}function En(n,t){const r={src:n.map(i=>i.src).join("|"),widthPercent:t};return n.forEach((i,o)=>{const s=i.src||`empty:${o}`,l=LR(s);l&&ps(i.width)&&(r[l]=i.width);const c=IR(s);c&&ps(i.height)&&(r[c]=i.height),p(SH,i.flex,"no image flex");const d=DR(o);r[d]=i.flex}),r}function _H(n,t,e,r){const i=sc(t.embedData),o=i.length===1?n.rootContainer:e;if(i.length===1&&r)return`${SR}px`;if(i.some(h=>h.height==="auto"))return"auto";const s=ei(t);if(!s){if(i.length!==1||ps(i[0].width))return"";const C=i[0].height;return C==="auto"?"auto":`${C}px`}let l=o.getBoundingClientRect().width*(s/100);if(l-=Number.parseFloat(window.getComputedStyle(o).paddingLeft)+Number.parseFloat(window.getComputedStyle(o).paddingRight),o===n.rootContainer&&o!==e&&(l=Math.min(l,_R(e))),i.length===1){const h=i[0];if(h.virtualSize)return"";const C=h.width==="auto"?hf:h.width;return`${h.height/(C/l)}px`}l-=(i.length-1)*LH;const c=i.reduce((h,C)=>h+C.flex,0);let d=0;for(const h of i){const C=l*h.flex/c,E=h.width==="auto"?hf:h.width,x=C/E*h.height;d=Math.max(x,d)}return`${d}px`}function MH(n){return n.reduce((e,r)=>e+r.flex,0)}function UH(n,t){v("div",["resize-gripper",t],n).setAttribute("data-resize-type",t)}function xE(n){return oe(n).querySelector(".block-resizer")}function OH(n){const t=xE(n);t&&ot(t,"active")}function MR(n,t,e){const r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),o=i.top-r.top,s=i.left-r.left,l=i.width,c=i.height;e.style.top=`${o}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${c}px`}function NH(n,t,e,r){const i=xE(n);if(i)return z(i,"active"),MR(n,t,i),i;const o=oe(n),s=v("div",["block-resizer"],o);return MR(n,t,s),e.resize.forEach(l=>{UH(s,l)}),s.addEventListener("mousedown",r),z(s,"active"),s}function AE(n,t){const e=xE(n);if(!e||!re(n,t))return;const r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),o=i.top-r.top,s=i.left-r.left,l=i.width,c=i.height;e.style.top=`${o}px`,e.style.left=`${s}px`,e.style.width=`${l}px`,e.style.height=`${c}px`}const cat="",PH=I("block-resizer");class mf extends ye.TypedEmitter{constructor(e,r){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 r=this.getResizableElement();if(!r||e.button!==0)return;const i=e.target;if(!i||!(i instanceof HTMLElement))return;const o=i.getAttribute("data-resize-type");!o||(this.bindEvents(),this.startRect=r.getBoundingClientRect(),this.startPos=e,this.resizeType=o,Qc(window.getComputedStyle(i).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 i=e.x-this.startPos.x,o=e.y-this.startPos.y,s=this.startRect;let{top:l,left:c,right:d,bottom:h}=s;(this.resizeType==="bottom"||this.resizeType==="bottom-left"||this.resizeType==="bottom-right")&&(h+=o),(this.resizeType==="top"||this.resizeType==="top-left"||this.resizeType==="top-right")&&(l+=o),(this.resizeType==="left"||this.resizeType==="top-left"||this.resizeType==="bottom-left")&&(c+=i),(this.resizeType==="right"||this.resizeType==="top-right"||this.resizeType==="bottom-right")&&(d+=i);const C=d>c?d-c:0,E=h>l?h-l:0,x=new DOMRect(c,l,C,E);this.emit("resizing",this,x);const B=this.getResizableElement();B&&AE(this.block,B)});m(this,"handleMouseUp",e=>{if(e.button!==0)return;Qc(""),this.unbindEvents(),this.emit("resized",this);const r=this.getResizableElement();!r||!this.block||AE(this.block,r)});this.editor=e,this.options=r}enableResize(e,r){this.block=e,this.resizableElement=r,this.createResizer(),this.enabled=!0}disableResize(){!this.block||(OH(this.block),this.enabled=!1)}update(e,r){this.block=e,this.resizableElement=r,this.getResizableElement()&&this.enabled&&this.createResizer()}updateResizer(){const e=this.getResizableElement();e&&this.block&&AE(this.block,e)}getBlock(){return this.block}destroy(){}getResizableElement(){return this.resizableElement?this.resizableElement:this.block?Nt(this.block):null}createResizer(){const e=this.getResizableElement();!e||!this.block||(p(PH,re(this.block,e),"not a block child element"),NH(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 FH=I("image-dom");function UR(n){return n.querySelector(".uploading-progress-mask")}function KH(n){const t=UR(n);if(t)return t;const e=v("div",["uploading-progress-mask"],n),r=v("div",["uploading-progress-bar"],e);return v("div",["uploading-progress-bar-value"],r),r}function VH(n){const e=KH(n).querySelector(".uploading-progress-bar-value");return p(FH,e,"no progress value"),e}function OR(n,t){const e=VH(n);e.style.width=`${t}%`}function $H(n){var t;(t=UR(n))==null||t.remove()}function gf(n,t,e,r){const i=e!=null?e:n.findBlockById(t.id);if(!i)return;const o=r||it(i),s=!!i.querySelector(".images > .image-container.error, .images > .image-container.empty "),l=DH(n,t,o,s),c=_H(n,t,o,s),d=Nt(i);l==="auto"?d.style.width=l:(d.style.maxWidth=l,d.style.width="100%");const h=i.querySelector(".images");!h||(h.style.height=c||"none")}function HH(n){let t;return n.forEach((e,r)=>{r.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function jH(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),r=HH(t.headers).toLocaleLowerCase();let i="";if(r){const s=wg.default[r].extensions;s&&s.length>0&&(i=s[0])}return new File([e],`${Date.now()}.${i}`,{type:r})}catch{return null}}function Cs(n,t){const e=typeof t=="string"?t:lt(t);return n.getCustom(`image-${e}`)}function j0(n,t){if(!t||!(t instanceof Node))return null;const e=Z(t);return e?Cs(n,e):null}function Li(n){return Array.from(n.querySelectorAll(".image-container"))}const bE=I("table-resize-drag-drop");class zH{constructor(t,e,r,i){m(this,"cursor","col-resize");m(this,"initWidths");this.editor=t,this.elem=e,this.data=r,this.mouseDownEvent=i;const o=this.data.block,l=Cs(this.editor,o).getImages(),c=this.data.splitterIndex;p(bE,c>=0&&c<l.length-1,`invalid splitter index: ${c}`);const h=Li(o).map(C=>C.getBoundingClientRect().width);this.initWidths=h}onDragStart(t,e,r){if(!this.editor.isWritable())return;const i=this.data.block;Cs(this.editor,i).setResizing(!0)}onDragging(t,e,r,i,o){const s=this.data.block,l=Cs(this.editor,s),c=mt.default(l.getImages()),d=this.data.splitterIndex;p(bE,d>=0&&d<c.length-1,`invalid splitter index: ${d}`);const h=this.initWidths[d],C=this.initWidths[d+1];if(h+C<100)return;let E=i;h+E<50&&(E=50-h),C-E<50&&(E=C-50);const k=[...this.initWidths];k[d]+=E,k[d+1]-=E;const w=Li(s);p(bE,w.length===c.length,"invalid image data");const U=k.reduce((Y,X)=>Y+X,0);for(let Y=0;Y<c.length;Y++){const X=k[Y]/U;c[Y].flex=X,w[Y].style.flexGrow=`${X}`}const M=mt.default(this.editor.getBlockData(s)),F=En(c,ei(M));M.embedData=F,gf(this.editor,M,s,null)}onDragEnd(t,e,r,i,o){const s=this.data.block,l=Cs(this.editor,s),d=Li(s).map(h=>Number.parseFloat(h.style.flexGrow));l.updateFlex(d),l.setResizing(!1)}}function NR(n){var t;return!n||!(n instanceof HTMLElement)?null:wt(n,"image-splitter")?n:(t=n.closest(".image-splitter"))!=null?t:null}function GH(n,t){var s;const e=NR(t.target);if(!e)return;const r=Z(e);if(!r)return;Cs(n,r).setSelectedIndex(-1),n.selection.selectBlock(r,0);const i=Number.parseInt((s=e.getAttribute("data-index"))!=null?s:"",10);if(Number.isNaN(i)||typeof i!="number")return;const o={block:r,splitterIndex:i};Og(new zH(n,e,o,t))}function WH(n,t){t.preventDefault(),t.stopPropagation();const e=NR(t.target);if(!e)return;const r=Z(e);!r||Cs(n,r).resetFlex()}function qH(n,t,e,r){const i=v("div",["image-splitter"],e);v("div",["image-splitter-indicator"],i),i.setAttribute("data-index",`${r}`),n.domEvents.addEventListener(i,"mousedown",GH),n.domEvents.addEventListener(i,"dblclick",WH)}const XH=I("image-item");function PR(n){return!n||!(n instanceof Node)?null:Z(n)}function FR(n){const t=PR(n);return t?Li(t):[]}function vE(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 pf(n){const t=vE(n);return t?FR(n).indexOf(t):-1}async function YH(n,t){const e=j0(n,t.target);if(!e)return;const r=pf(t.target);if(r===-1)return;const i=t.target;if(!(i instanceof HTMLImageElement))return;const o=e.getImages()[r];if(ic(o)||n.readonly||!e.isAutoFix()||(setTimeout(()=>{e.setAutoFix(!1)},400),(o.height==="auto"||o.width==="auto")&&e.fixImageSize(r,i),o.virtualSize&&e.fixImageSize(r,i),!o||!IH(o)||o.downloading))return;o.downloading=!0;const s=await jH(o.src);s?e.replaceImage(r,s):XH.warn(`failed to download image: ${o.src}`)}function QH(n,t,e){if(t.querySelector(".load-error"))return;const i=e.src.startsWith("http:")||e.src.startsWith("https:"),o=v("div",["load-error"],t),s=v("div",["error-icon"],o);s.innerHTML=Xp;const l=v("div",["error-message"],o);i?(l.innerHTML=D.t("image.load.remote.failed"),n.domEvents.addEventListener(o,"click",(c,d)=>{d.preventDefault(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&window.open(e.src,"_blank","noreferrer=1")})):(l.innerHTML=D.t("image.load.failed"),n.domEvents.addEventListener(o,"click",(c,d)=>{d.preventDefault(),d.stopPropagation(),d.target instanceof HTMLElement&&d.target.tagName==="A"&&ej(c,d.target)}))}function BE(n,t){setTimeout(()=>{if(re(n.rootContainer,t)){const e=n.getBlockData(t);gf(n,e,null,null)}})}function JH(n,t){const e=j0(n,t.target);if(!e)return;const r=pf(t.target);if(r===-1)return;const i=e.getImages()[r];if(!i)return;const o=vE(t.target);if(!o)return;const s=Z(o);let l=!1;n.doc.buildResourceUrl(i.src,{syncNewResources(c,d){var C,E;n.doc.addResources([c]);const h=(E=(C=n.doc).getServerMeta)==null?void 0:E.call(C).appId;if(i.src&&d!==i.src&&h&&i.src.includes(h)&&s&&!n.readonly&&n.isBlockWritable(s)){const x=mt.default(n.getBlockData(s));x.embedData.src=c,n.updateEmbedData(s,x.embedData),l=!0,t.target instanceof HTMLImageElement&&(t.target.src=d)}}}),!l&&(z(o,"error","error-load"),s&&BE(n,s),o.innerHTML="",QH(n,o,i))}function ZH(n,t,e){if(t.querySelector(".upload-error"))return;const i=v("div",["upload-error"],t),o=v("div",["error-icon"],i);o.innerHTML=Xp;const s=v("div",["error-message"],i);s.innerHTML=D.t("image.upload.failed"),n.domEvents.addEventListener(i,"click",(l,c)=>{if(c.preventDefault(),!c.target||!(c.target instanceof Element)||c.target.tagName!=="A")return;const d=j0(l,c.target),h=pf(c.target);!d||h===-1||d.replaceImage(h,e)})}function KR(n,t,e,r,i){const o=Li(t)[e];!o||(z(o,"error","error-upload"),BE(n,t),o.innerHTML="",ZH(n,o,i))}function VR(n,t,e,r,i,o,s){const l=v("div",["image-container"],e);if(l.setAttribute("data-src",r.src),s.length>1&&(l.style.flexShrink=`${r.flex}`,l.style.flexGrow=`${r.flex}`),o===i&&z(l,"active"),ic(r)){z(l,"empty");const d=v("div",["upload-image-icon"],l);return d.innerHTML=yT,l}const c=v("img",["editor-image"],l);if(c.src=n.doc.buildResourceUrl(r.src),n.domEvents.addEventListener(c,"load",YH),n.domEvents.addEventListener(c,"error",JH),r.src.startsWith("https:")||r.src.startsWith("http:")){const d=v("div",["image-warning"],l);d.innerHTML=qp,d.setAttribute(`data-editor-tooltip-${n.clientId}`,D.t("image.load.remote.tooltip"))}return l}function tj(n,t,e,r,i){const o=v("div",["images"],e);return r.forEach((s,l)=>{l>0&&qH(n,t,o,l-1),VR(n,t,o,s,l,i,r)}),r.length>1&&z(t,"multi"),o}function $R(n,t,e,r,i,o){const l=Array.from(t.querySelectorAll(".image-container"))[r];if(!l)return;const c=VR(n,t,null,e,r,i,o);l.insertAdjacentElement("beforebegin",c),l.remove(),BE(n,t)}function Cf(n,t){return Li(n)[t]}function ej(n,t){const e=PR(t);if(!e)return;const r=pf(t);if(r===-1)return;const i=j0(n,t);if(!i)return;const o=i.getImages()[r];$R(n,e,o,r,i.getSelectedIndex(),i.getImages())}function HR(n){var r;let t="image/*";const e=(r=n.getComponentOptions("image"))==null?void 0:r.allowedMedias;return e&&(t=e.map(i=>`.${i}`).join(",")),t}function jR(n,t){var s;const{maxSize:e,allowedMedias:r,callbacks:i}=(s=n.getComponentOptions("image"))!=null?s:{};if(e&&t.size>e){const l=new Error("image is too large");throw l.code="MaxMediaSize",i!=null&&i.onError&&(i==null||i.onError(n,l)),l}const o=eu(t.name);if(r&&!r.includes(o.toLowerCase())){const l=new Error(`media file is not allowed: ${o}`);throw l.code="NotAllowedFile",i!=null&&i.onError&&(i==null||i.onError(n,l)),l}}function zR(n){return n.startsWith("image/")}const GR=I("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 r=pf(e.target);if(r===-1)return;const i=this.images[r];ic(i)||this.setSelectedIndex(r)});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||it(e)===t&&gf(this.editor,this.blockData,e,null)});m(this,"handleResizing",(t,e)=>{const r=this.editor.findBlockById(this.blockData.id);if(!r)return;this.autoFix||this.setAutoFix(!0);const i=r.querySelector(".images");i.style.height="";const s=this.editor.rootContainer.getBoundingClientRect().width,l=r.getBoundingClientRect();let c=e.width>l.width?l.width:e.width;c<50&&(c=50);const d=c*100/s;this.blockData.embedData.widthPercent=d,gf(this.editor,this.blockData,r,null)});m(this,"handleResized",t=>{const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const r=En(this.images,ei(this.blockData));this.editor.updateEmbedData(e,r),this.blockResizer.enableResize(e)});m(this,"fixImageSizes",ke.default(()=>{const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=En(this.images,ei(this.blockData));this.editor.updateEmbedData(t,e)},1e3));this.editor=t,this.blockData=e,this.blockResizer=new mf(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=sc(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,r){const i=tj(this.editor,e,r,this.images,this.selectedIndex);if(this.editor.domEvents.addEventListener(r,"mousedown",this.handleMouseDown),this.editor.addListener("resize",this.handleRootContainerResize),Fr(t)){const s=()=>{this.handleEditorResize(t)};this.parentContainerResizerObserver=new Vs(s),this.parentContainerResizerObserver.observe(t)}const o=()=>!!(this.images.length===1&&this.images[0].virtualSize);this.isEmpty()&&o()&&z(i,"empty"),gf(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 ei(this.blockData)}isEmpty(){return this.images.length===1&&ic(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 i=Cf(e,this.selectedIndex);i&&ot(i,"active")}this.selectedIndex=t;const r=Cf(e,t);r&&z(r,"active")}async requestUploadImage(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;const r=Cf(e,t);if(wt(r,"error"))return;const i=HR(this.editor),o=await ga(i);!o||await this.replaceImage(t,o)}tryEnableResizer(){const t=this.editor.findBlockById(this.blockData.id);if(!t||!this.editor.isWritable())return;const e=Cf(t,0);!this.isEmpty()&&this.images.length===1&&!wt(e,"error")&&this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}fixImageSize(t,e){const r=this.images[t];ic(r)||(ps(r.width)&&!ps(r.height)?r.height=r.width/e.naturalWidth*e.naturalHeight:ps(r.height)&&!ps(r.width)?r.width=r.height/e.naturalHeight*e.naturalWidth:(r.width=e.naturalWidth,r.height=e.naturalHeight),r.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 r=mt.default(this.images);if(r.splice(t,1),r.length===0)return this.editor.deleteBlock(e),!0;r[0].flex=NaN,oc(r),this.selectedIndex>=r.length&&(this.selectedIndex=r.length-1);const i=En(r,ei(this.blockData));return this.editor.updateEmbedData(e,i),!0}async replaceImage(t,e){const r=this.editor.findBlockById(this.blockData.id);if(!r)return!1;try{const o=await ma(e),s=this.images[t];if(s.virtualSize){const{width:c,height:d}=await wR(o);s.width=c,s.height=d,s.virtualSize=!1,this.images[0].flex=NaN,oc(this.images);const h=En(this.images,ei(this.blockData));this.editor.updateEmbedData(r,h)}const l={...s,src:o};$R(this.editor,r,l,t,this.selectedIndex,this.images),setTimeout(()=>{this.blockResizer.update(r)})}catch(o){return KR(this.editor,r,t,o,e),!1}const i=Cf(r,t);if(!i)return!1;z(i,"uploading"),OR(i,0),z(r,"media-block-uploading");try{const o=await this.editor.doc.uploadResource(e,{onProgress:c=>{OR(i,c)}});ot(i,"uploading"),this.images[t].src=o.resourceId;const s=this.editor.findBlockById(this.blockData.id);if(!s)return!1;ot(s,"media-block-uploading");const l=En(this.images,ei(this.blockData));return this.editor.updateEmbedData(s,l),!0}catch(o){GR.error(o);const s=this.editor.findBlockById(this.blockData.id);return s&&(ot(i,"uploading"),$H(i),KR(this.editor,s,t,o,e),ot(s,"media-block-uploading")),!1}}updateFlex(t){const e=this.editor.findBlockById(this.blockData.id);if(!e)return;p(GR,t.length===this.images.length,"invalid flex");for(let i=0;i<this.images.length;i++)this.images[i].flex=t[i];const r=En(this.images,ei(this.blockData));this.editor.updateEmbedData(e,r)}resetFlex(){const t=this.editor.findBlockById(this.blockData.id);if(!t)return;const e=mt.default(this.images);e[0].flex=NaN,oc(e);const r=En(e,ei(this.blockData));this.editor.updateEmbedData(t,r)}setData(t){this.blockData=t,this.images=sc(t.embedData)}static create(t,e){const r=t.addCustom(`image-${e.id}`,()=>new Ie(t,e));return r.setData(e),r}static getImageObject(t,e){let r;return typeof e=="string"?r=e:r=lt(e),t.getCustom(`image-${r}`)}}const uat="",fat="";function z0(n){const t=oe(n);let e=t.querySelector(":scope > .block-helper");return e||(e=v("div",["block-helper"],t),v("span",["helper-sizer"],e,"A")),e}function TE(n,t,e){const r=z0(n),o=Array.from(r.children).find(s=>{var c;return Number.parseInt((c=s.getAttribute("data-index"))!=null?c:"0",10)>e});r.insertBefore(t,o!=null?o:null)}const WR=40,nj=20;class rj{findTargetBlock(t,e){const r=e.target;if(r&&r instanceof Element){const c=Z(r);if(c&&re(t.rootContainer,c))return c}let i=e.clientX,o=e.clientY;const s=t.rootContainer.getBoundingClientRect().left;i<s&&s-i<WR&&(i+=WR);let l=Ae(i,o,{noFilter:!0});if(l){const c=Z(l);if(c&&re(t.rootContainer,c))return c}if(o-=nj,l=Ae(i,o,{noFilter:!0}),l){const c=Z(l);if(c&&re(t.rootContainer,c))return c}return null}destroy(){}}class ij extends M0{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 r=this.editor.selection.focusedBlock;this.suggest.popup(r,0,"","")}setBlock(e){this.currentBlock=e}}function oj(n,t,e){const r=s1(n,t);if(!r)return[];const i=[],o=(s,l)=>{var c;return(c=s.children)==null?void 0:c.map(d=>({...d,source:"block-command",blockMenuItemCustomData:l,children:o(d,l)}))};return Object.values(r).forEach(s=>{e!=null&&e.has(s.group)||i.push(...s.commands.map(l=>({...l,source:"block-command",blockMenuItemCustomData:s.group,children:o(l,s.group)})))}),i}function yE(n,t,e){const r=nE(n,e),i=o=>{o.forEach(s=>{s.source=t,s.children&&i(s.children)})};return i(r),r}function sj(n,t,e,r=!1){var h,C,E;const i=it(t);let o=t;if(o&&Ft(o)&&OC(o)){if(!r){const x=PP(o);o=(h=Jt(x))!=null?h:x}k0.closeMindmap(n,t)}let l=vt(o);if(!se(n,o)&&!r){let x=gr(o);x?l=vt(x):(x=Ue(i),l=vt(x)+1)}const c=ct(i),d=e;return n.emit("beforeExecCommand",n,e,{source:"block-menu"}),d.commandProvider?d.commandProvider.executeCommand(n,e,{from:"block-menu",containerId:c,blockIndex:l}):(E=(C=d.blockOptions)==null?void 0:C.handleInsertEmptyBlock)==null?void 0:E.call(C,n,{containerId:c,blockIndex:l,item:e,from:"block-menu"})}function lj(n,t){const e=Nr(n,t),r=n.getBlockData(t);return!(e!=="text"||r.heading)}class qR{constructor(t,e,r){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,r)=>{var o;const i=YC();this.createItem("text",Fa,e,lj(this.editor,t)),(o=i.insertBlockCommandItems)==null||o.forEach(s=>{s.id&&s.icon&&this.createItem(s.id,s.icon,e,r?r===Number(s.value):!1)})});m(this,"createListItemElement",(t,e,r)=>{const{checkbox:i,ordered:o}=r,l=Dt(t)==="list",c=l&&o===!1&&!i,d=l&&o,h=l&&!!i;this.createItem("unordered-list",nC,e,c),this.createItem("ordered-list",rC,e,d),this.createItem("check-list",tC,e,h)});m(this,"handleClick",(t,e)=>{var c,d;if(!e.target||!(e.target instanceof Node))return;const r=e.target instanceof Element?e.target:e.target.parentElement;if(!r)return;const i=r.closest(".text-style-item");if(!i)return;const o=i.id,s="heading-",l={id:o,name:""};if(t.emit("beforeExecCommand",t,l,{source:"block-command"}),o==="text"&&I0(t,this.block,null),o.startsWith(s)){const h=Number.parseInt(o.substring(s.length),10);h&&I0(t,this.block,h)}if(o==="blockquote"&&WC(t,this.block),o.startsWith("align")){const h=o.replace(/^align-/,"");Rk(t,this.block,h)}(o==="unordered-list"||o==="ordered-list"||o==="check-list")&&XC(t,this.block,o),(d=(c=this.options).onAfterStyleItemClick)==null||d.call(c)});m(this,"calcTextStyleItemTooltipsEnum",()=>{this.textStylesTooltips={text:{title:D.t("commands.text")},blockquote:{title:D.t("commands.quote")},"align-left":{title:D.t("commands.alignLeft")},"align-center":{title:D.t("commands.alignCenter")},"align-right":{title:D.t("commands.alignRight")},"unordered-list":{title:D.t("commands.unordered")},"ordered-list":{title:D.t("commands.ordered")},"check-list":{title:D.t("commands.check")}};let t=1;for(;t<=8;)this.textStylesTooltips[`heading-${t}`]={title:D.t("commands.heading",{name:`${t}`})},t++});this.editor=t,this.block=e,this.options=r,this.calcTextStyleItemTooltipsEnum(),this.element=this.createItemElement(t,e),t.domEvents.addEventListener(this.element,"click",this.handleClick)}createItemElement(t,e){const r=v("div",["text-styles"],null),i=v("div",["text-style-section"],r),o=t.getBlockData(e);if(!this.options.fromEmbed){const l=o.heading,c=o.quoted;this.createHeadingItemElement(e,i,l),this.createListItemElement(e,i,o),this.createItem("blockquote",eC,i,!!c)}const s=o.align||"left";return this.createItem("align-left",Pa,i,s==="left"),this.createItem("align-center",o0,i,s==="center"),this.createItem("align-right",i0,i,s==="right"),r}createItem(t,e,r,i=!1){const o=["style-icon","text-style-item"];i&&o.push("active");const s=Hs(e,o,r);s.id=t;const l=this.textStylesTooltips[t];if(!l)return;const{title:c,shortcut:d}=l;s.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,c),d&&s.setAttribute(`data-editor-tooltip-desc-${this.editor.clientId}`,qe(d))}}function XR(){return{source:"separator",type:"separator",id:`section-${et()}`,name:""}}const YR={copy:VT,cut:$T,delete:HT,"lock-block":jT,"unlock-block":zT,comment:ul},aj=["image","video"];function cj(n,t,e){const r=[],i=rt(n,t),o=pe(t)&&aj.includes($e(t)),s=o&&($e(t)!=="image"||$e(t)==="image"&&Li(t).length===1);if(i?r.push(new qR(n,t,e)):o&&s&&r.push(new qR(n,t,{...e,fromEmbed:!0})),!se(n,t)||UC(t)){(i||o&&s)&&r.push(XR());const l=oj(n,t,new Set(["hovering-toolbar"]));l.sort((c,d)=>{var h,C;return((h=c.order)!=null?h:0)-((C=d.order)!=null?C:0)}),l.forEach(c=>{c.id in YR&&(c.icon=YR[c.id])}),r.push(...l)}return se(n,t)&&!UC(t)?r.push(...yE(n,"insert-block",{withPlainText:!1,from:"block-menu"})):r.push(XR(),{id:"insert-block-before",icon:GT,name:D.t("blockMenu.command.insertAbove"),children:yE(n,"insert-block-before",{withPlainText:!0,from:"block-menu"}),childrenMenuId:"quick-menu",source:"insert-block-before"},{id:"insert-block-after",icon:WT,name:D.t("blockMenu.command.insertAfter"),children:yE(n,"insert-block",{withPlainText:!0,from:"block-menu"}),source:"insert-block",childrenMenuId:"quick-menu"}),r}function uj(n,t,e){if(e.source==="block-command"){const r=e.blockMenuItemCustomData;Gv(n,t,r,e)}else(e.source==="insert-block"||e.source==="insert-block-before")&&sj(n,t,e,e.source==="insert-block-before")}const fj=I("exclusive-block");function kE(n,t,e,r){var l;z(t,"block-exclusive");const i=Qt(n,t),o=(l=i.getBlockProperties)==null?void 0:l.call(i,n,t),{abstract:s}=o||{};t.setAttribute("data-user-name",r),t.setAttribute("data-user-id",e),t.setAttribute("data-exclusive-tips",D.t("exclusive.tips",{editor:r,embedType:s||D.t("exclusive.fallbackAbstract")}))}function QR(n){ot(n,"block-exclusive"),n.removeAttribute("data-user-name"),n.removeAttribute("data-user-id"),n.removeAttribute("data-exclusive-tips")}function dj(n,t,e,r,i){fj.debug(`block ${lt(t)} ${e?"exclusive":"unexclusive"}, ${r}, ${i}`),e?kE(n,t,r,i):QR(t)}function Ef(n){return n.classList.contains("block-exclusive")}function JR(n,t){t.blockIds.forEach(e=>{const r=n.findBlockById(e);r&&dj(n,r,t.exclusive,t.userId,t.displayName)})}class Es{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(i=>i.userId));Array.from(this.remoteExclusiveBlockIds.entries()).forEach(([i,o])=>{if(!e.has(o.userId)){this.remoteExclusiveBlockIds.delete(i);const s={...o,exclusive:!1};JR(this.editor,s)}});const r=Array.from(this.exclusiveBlockIds).map(i=>this.editor.findBlockById(i)).filter(i=>!!i);r.length>0&&this.broadcastExclusiveBlockMessage(r,!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;JR(this.editor,e),e.blockIds.forEach(r=>{e.exclusive?this.remoteExclusiveBlockIds.set(r,e):this.remoteExclusiveBlockIds.delete(r)})}}getExclusiveMessage(t){return this.remoteExclusiveBlockIds.get(t)}broadcastExclusiveBlockMessage(t,e){if(this.editor.readonly||t.length===0)return;const r=this.editor.doc.getUser(),i={type:"exclusiveBlock",userId:r.userId,displayName:r.displayName,blockIds:t.map(o=>lt(o)),exclusive:e};this.editor.doc.broadcastMessage(i)}exclusiveBlock(t){this.exclusiveBlockIds.has(lt(t))||(this.broadcastExclusiveBlockMessage([t],!0),this.exclusiveBlockIds.add(lt(t)),this.exclusiveBlockIds.size===1&&this.startExclusiveBlockTimer())}unexclusiveBlock(t){!this.exclusiveBlockIds.has(lt(t))||(this.exclusiveBlockIds.delete(lt(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 Es(t))}static register(t){return this.get(t)}}function RE(n,t){Es.get(n).exclusiveBlock(t)}function wE(n,t){Es.get(n).unexclusiveBlock(t)}class ZR{writable(t,e){if(Array.isArray(e)){for(const r of e)if(Ef(r))return!1;return}if(Ef(e))return!1}create(t,e,r,i,o){const s=Es.get(t).getExclusiveMessage(o.id);s&&kE(t,i,s.userId,s.displayName)}update(t,e,r,i,o){const s=Es.get(t).getExclusiveMessage(o.id);s?kE(t,i,s.userId,s.displayName):QR(i)}}const dat="",hj={exclusive:{tips:"\u300C{editor}\u300D\u6B63\u5728\u7F16\u8F91\uFF0C\u300C{embedType}\u300D\u4E0D\u652F\u6301\u591A\u4EBA\u7F16\u8F91",fallbackAbstract:"\u8BE5 Block"}},mj={exclusive:{tips:"\u300C{editor}\u300Dis editing\uFF0C\u300C{embedType}\u300Ddoes not support multi-person editing",fallbackAbstract:"This Block"}},gj={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"}};D.mergeLang({"zh-CN":hj,"en-US":mj,"ja-JP":gj});function xf(n,t){return n.getBlockData(t).lock}function G0(n,t){return!!xf(n,t)}function Af(n,t){const e=xf(n,t);return e?e.userId===n.doc.getUser().userId:!1}function SE(n,t){const e=xf(n,t);return e?e.userId!==n.doc.getUser().userId:!1}function pj(n,t){if(n.readonly||!n.isBlockWritable(t)||G0(n,t)&&!Af(n,t))return;const e=n.doc.getUser(),r={userId:e.userId,displayName:e.displayName,locked:Date.now()},o={...n.getBlockData(t),lock:r};n.updateBlockData(t,o)}function Cj(n,t){if(!Af(n,t))return;const e={lock:null};n.updateBlockData(t,e)}const Ej=10,xj=80,Aj=50;class LE{constructor(){m(this,"executeCommand",(t,e,r)=>{const i=r.data;if(!i||!i.blockId)return;const o=t.getBlockById(i.blockId);i.type==="lock"?pj(t,o):i.type==="unlock"&&Cj(t,o)})}create(t,e,r,i,o){const s=o.lock;s&&(s.userId!==t.doc.getUser().userId?z(i,"locked-by-others"):z(i,"locked-by-self"))}update(t,e,r,i,o){const s=o.lock;if(s)if(s.userId!==t.doc.getUser().userId){z(i,"locked-by-others");const l=t.selection.focusedBlock;(l===i||re(i,l))&&(rt(t,i)||Dt(i)==="code")&&t.insertTextBlock("",ct(r),vt(i)+1)}else z(i,"locked-by-self");else ot(i,"locked-by-others"),ot(i,"locked-by-self")}writable(t,e){let r=[];Array.isArray(e)?r=e:r.push(e);for(const i of r){if(SE(t,i))return!1;if(pr(i))return;let o=Js(i);for(;o;){if(SE(t,o))return!1;o=Js(o)}}}commands(t,e){const r=G0(t,e),i=Af(t,e),o=Ef(e),s={blockId:lt(e),type:"lock"},l={id:"lock-block",name:"",data:s,order:50};if(r)if(i)l.id="unlock-block",l.name=D.t("locker.unlock"),s.type="unlock";else{const c=xf(t,e);let d=(c==null?void 0:c.displayName)||"";const h=D.getCurrentLang()==="ja-JP",C=hv(d,Ej,h?Aj:xj);(C==null?void 0:C.length)!==d.length&&(l.ellipsisTooltip=c==null?void 0:c.displayName,d=C||""),l.name=D.t("locker.lockedBy",{name:d}),l.states=["disabled"]}else o?(l.name=D.t("locker.lock"),l.states=["disabled"]):l.name=D.t("locker.lock");return{group:"block-locker",commands:[l],executeCommand:this.executeCommand}}}const hat="",bj={locker:{lock:"\u9501\u5B9A",unlock:"\u89E3\u9664\u9501\u5B9A",lockedBy:"\u88AB {name} \u9501\u5B9A"}},vj={locker:{lock:"Lock",unlock:"Unlock",lockedBy:"Locked by {name}"}},Bj={locker:{lock:"\u30ED\u30C3\u30AF",unlock:"\u30ED\u30C3\u30AF\u89E3\u9664",lockedBy:"{name}\u304C\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F"}};D.mergeLang({"zh-CN":bj,"en-US":vj,"ja-JP":Bj});class W0{async handleBeforePasteDoc(t,e){return Object.values(e.blocks).forEach(r=>{r.forEach(i=>{delete i.lock})}),!1}}const Tj=I("standard-block-actions");class yj{constructor(){m(this,"executeCommand",(t,e,r)=>{const i=r.data;try{const o=t.getBlockById(i);if(r.id==="delete"){this.deleteBlock(t,o);return}r.id==="copy"&&this.copyBlock(t,o),r.id==="cut"&&(this.copyBlock(t,o),this.deleteBlock(t,o))}catch(o){Tj.error(`failed to execute block command: ${JSON.stringify(o)}`)}})}commands(t,e){const r=G0(t,e),i=r&&Af(t,e),o=lt(e),s=window.isSecureContext,l=Ef(e),c={id:"copy",name:D.t("blockMenu.command.copy"),data:o,order:10,states:s?[]:["disabled"],disableReason:s?void 0:D.t("copyCutProperty.unsafeEnvTips",{shortCut:qe("CtrlOrCmd+C"),operation:D.t("copyCutProperty.copy")})},d={id:"cut",name:D.t("blockMenu.command.cut"),data:o,order:20,states:r&&!i||!s||l?["disabled"]:[],disableReason:s?void 0:D.t("copyCutProperty.unsafeEnvTips",{shortCut:qe("CtrlOrCmd+X"),operation:D.t("copyCutProperty.cut")})},h={id:"delete",name:D.t("blockMenu.command.delete"),data:o,order:30,states:r&&!i||l?["disabled"]:[]};return{group:"standard-block-actions",commands:[c,d,h],executeCommand:this.executeCommand}}deleteBlock(t,e){if(mi(e)){const r=Ca(e);t.undoManager.runInGroup(()=>{[e,...r].forEach(i=>t.deleteBlock(i))})}else t.deleteBlock(e)}copyBlock(t,e){if(mi(e)){const r=Ca(e),i=$5(t,[e,...r]);Uh(t,i)}else Ep(t,e)}}const tw=I("block-menu");class kj{constructor(t){m(this,"menu");m(this,"currentBlock",null);m(this,"commandBlock",null);m(this,"handleShow",()=>{p(tw,this.currentBlock,"no target block before show block menu");const t=cj(this.editor,this.currentBlock,{onAfterStyleItemClick:this.close});this.menu.updateItems(t),this.commandBlock=this.currentBlock});m(this,"handleClose",()=>{aC(this.editor)&&this.editor.focus()});m(this,"handleItemClick",(t,e)=>{p(tw,this.commandBlock,"no command block before show block menu"),uj(this.editor,this.commandBlock,e),e.element||this.close()});m(this,"close",()=>{this.menu.close("clickItem")});this.editor=t,this.menu=new ls([],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 yj)}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 Rj=1e3;async function wj(n,t){const{width:e}=n.rootContainer.getBoundingClientRect(),r=t.getBoundingClientRect();return r.width>e||r.height>=Rj?"":(await yb.default.toSvg(t)).replace(/margin-block:.*?;/,"").replace(/margin:.*?;/,"")}const Sj=I("drag-preview-image");class Lj{constructor(t){m(this,"startPosition",null);m(this,"dragContainer",null);m(this,"handleDragStart",async(t,e)=>{const r=t.target;p(Sj,r instanceof Element,`Invalid Drag target:${r}`);const{x:i,y:o}=t;this.startPosition={x:i,y:o};const s=v("div",["drag-image-container"],this.editor.rootContainer),l=v("img",["drag-image"],s),c=v("span",["drag-loading"],s);c.innerHTML=QT;const{x:d,width:h,height:C,y:E}=r.getBoundingClientRect(),x=this.editor.rootContainer.getBoundingClientRect(),B=e.getBoundingClientRect();s.style.left=`${d+h}px`,s.style.top=`${E+C}px`,s.style.width=`${Math.min(x.width/2,B.width)}px`,this.dragContainer=s;const w=await wj(this.editor,e);w?l.src=w:z(s,"drag-placeholder"),_g(s,{status:"loaded"})});m(this,"handleDrag",t=>{if(this.startPosition&&this.dragContainer){const{x:e,y:r}=t;if(e===0&&r===0){this.dragContainer.style.transition="transform 0.15s, opacity .15s",this.dragContainer.style.transform="",this.dragContainer.style.opacity="0";return}const{x:i,y:o}=this.startPosition,s=e-i,l=r-o;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 ew="drag-preview-element";function Ij(n){if(wt(n,ew))return n;const t=n.querySelector(`.${ew}`);return t||(pe(n)?Nt(n):n)}const q0=I("block-menu-drag-handler");function IE(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 Dj{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(p(q0,e,"no dragged block"),t.button!==0)return;if(!this.editor.isBlockWritable(e)){t.preventDefault(),t.stopPropagation();return}const{x:r,y:i}=t;this.oldPos={x:r,y:i},document.addEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.addEventListener("mousemove",this.handleDrag)});m(this,"handleDragStart",t=>{var s,l;const e=Xe(this.button.buttonElement);this.autoScroll||(this.autoScroll=new Qd({scrollElement:e,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}));const r=this.button.blockMenu.currentBlock;p(q0,r,"no dragged block"),(l=(s=Qt(this.editor,r)).notify)==null||l.call(s,this.editor,"beginDrag");const i=IE(t,"dragstart");Nj(this.editor,i,r),window.isDragging=!0,this.button.buttonElement.style.opacity="0";const o=Ij(r);this.dragPreview.handleDragStart(t,o),this.autoScroll.active(),z(r,"dragging"),z(this.editor.contentElement,"dragging")});m(this,"handleDrag",t=>{const{target:e,x:r,y:i}=t;if(this.oldPos.x===r&&this.oldPos.y===i)return;window.isDragging||this.handleDragStart(t),this.oldPos={x:r,y:i},p(q0,e instanceof Element,"target is invalid"),this.dragPreview.handleDrag(t);const o=IE(t,"dragover");this.editor.contentElement.dispatchEvent(o)});m(this,"handleDragEnd",t=>{var i;const e=this.button.blockMenu.currentBlock;p(q0,e,"no dragged block"),window.isDragging=!1,this.button.buttonElement.style.opacity="1",this.dragPreview.handleDragEnd(),(i=this.autoScroll)==null||i.inactive(),ot(e,"dragging"),ot(this.editor.contentElement,"dragging"),document.removeEventListener("mouseup",this.handleDragEnd),this.editor.contentElement.removeEventListener("mousemove",this.handleDrag);const r=IE(t,"drop");this.editor.contentElement.dispatchEvent(r)});this.editor=t,this.button=e,this.button.buttonElement.addEventListener("mousedown",this.handleMouseDown),this.dragPreview=new Lj(t)}destroy(){this.button.buttonElement.removeEventListener("mousedown",this.handleMouseDown)}}class bf{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=lt(t),z(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 bf(t))}static get(t){return t.getCustom("editor-block-highlighter")}}class nw{constructor(t){m(this,"buttonElement");m(this,"emptyBlockMenu");m(this,"blockMenu");m(this,"dragHandler");m(this,"handleHoverBlock",(t,e,r)=>{if(this.emptyBlockMenu.isVisible||this.blockMenu.isVisible||!this.editor.isWritable())return;const i=this.editor.getCustom("editor-tooltip");if(i&&i.visible()&&(i.hide(),this.buttonElement.setAttribute("data-tooltip-hide-at",`${Date.now()}`)),!t){this.buttonElement.parentElement&&(this.blockMenu.isInMenu(r.target)||this.buttonElement.remove());return}const o=o1(t);qi(o)||(this.updateButton(o),TE(o,this.buttonElement,Number.MAX_SAFE_INTEGER))});m(this,"handleButtonClick",()=>{if(this.buttonElement.getAttribute("data-type")==="move"){const r=this.blockMenu.currentBlock;if(!r)return;this.editor.selection.selectBlock(r,0,void 0,{noScroll:!0}),this.blockMenu.show(this.buttonElement,{placement:"bottom-end"}),setTimeout(()=>{bf.get(this.editor).highlightBlock(r)});return}const e=this.emptyBlockMenu.currentBlock;!e||(this.editor.selection.selectBlock(e,0,void 0,{noScroll:!0}),setTimeout(()=>{this.editor.focus(),this.updatePlaceholder(e),this.emptyBlockMenu.show()}))});m(this,"updatePlaceholder",t=>{df(this.editor,t,D.t("blockMenu.button.searchPlaceholder"))});m(this,"handleChanged",()=>{const t=this.emptyBlockMenu.currentBlock;if(!t)return;if(this.blockMenu.currentBlock){const r=lt(this.blockMenu.currentBlock);if(!this.editor.findBlockById(r)&&this.blockMenu.isVisible){this.blockMenu.close();return}}const e=se(this.editor,t)?"insert":"move";this.buttonElement.getAttribute("data-type")!==e&&this.setButtonType(e)});this.editor=t,this.buttonElement=this.createButton(),this.emptyBlockMenu=new ij(t),this.blockMenu=new kj(t),this.editor.addListener("docChanged",this.handleChanged),this.buttonElement.addEventListener("click",this.handleButtonClick),this.dragHandler=new Dj(this.editor,this);const e=Re.get(t);e.addListener("change",this.handleHoverBlock),e.addFinder(new rj),bf.register(this.editor)}destroy(){Re.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=v("button",["block-button"],null);return t.setAttribute(`data-editor-tooltip-${this.editor.clientId}`,D.t("blockMenu.button.tips")),t.innerHTML=iC,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=YT,this.buttonElement.setAttribute(e,D.t("blockMenu.button.insertTips"))):(this.buttonElement.innerHTML=iC,this.buttonElement.setAttribute(e,D.t("blockMenu.button.tips")))}updateButton(t){this.emptyBlockMenu.setBlock(t),this.blockMenu.setBlock(t),se(this.editor,t)&&!(Ft(t)&&UC(t))?this.setButtonType("insert"):this.setButtonType("move")}}const _j={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
|
|
665
665
|
\u70B9\u51FB\u6253\u5F00\u83DC\u5355`,insertTips:"\u70B9\u51FB\u6DFB\u52A0\u533A\u5757"}}},Mj={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
|
|
666
|
-
Click to open the menu`,insertTips:"Click to add block"}}},Uj={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"}}};D.mergeLang({"zh-CN":_j,"en-US":Mj,"ja-JP":Uj});const mat="";class Oj{constructor(){m(this,"dragObject",null)}setData(t){this.dragObject=t}getData(){return this.dragObject}clearData(){this.dragObject=null}destroy(){}}function X0(n){return n.addCustom("drag-data",()=>new Oj)}function DE(n,t){if(!t)return null;const e=X0(n).getData();return!e||e.editorId!==n.id?null:e}function rw(n,t){const e=DE(n,t);return e?n.findBlockById(e.blockId):null}function Nj(n,t,e){if(!t.dataTransfer)return;const i=it(e),o=ct(i),s=lt(e),l={type:"block",editorId:n.id,containerId:o,blockId:s};X0(n).setData(l)}function Pj(n,t,e,r,i){if(!t.dataTransfer)return;const s=it(e),l=ct(s),c=lt(e),d={type:"custom",customType:r,editorId:n.id,containerId:l,blockId:c,data:i};X0(n).setData(d)}function vf(n){X0(n).clearData()}const Fj=I("drop-indicator"),Bf=2;class Kj{constructor(t){m(this,"indicator");m(this,"target",null);this.editor=t,this.indicator=v("div",["editor-drop-indicator"],this.editor.contentElement)}show(t,e){const r=this.getIndicatorRect(t,e),i=this.editor.rootElement.getBoundingClientRect(),o=r.top-i.top,s=r.left-i.left;this.indicator.style.top=`${o}px`,this.indicator.style.left=`${s}px`,this.indicator.style.width=`${r.width}px`,this.indicator.style.height=`${r.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 l=mr(t);if(!l){p(Fj,Fr(it(t)),"block does not in a child container");const C=t.getBoundingClientRect(),E=this.getViewRect(t);return new DOMRect(E.x,C.y,E.width,Bf)}const c=l.getBoundingClientRect(),d=t.getBoundingClientRect(),h=this.getViewRect(t);return new DOMRect(h.x,(c.bottom+d.top)/2,h.width,Bf)}const r=gr(t);if(!r){const l=t.getBoundingClientRect(),c=this.getViewRect(t);return new DOMRect(c.x,l.bottom,c.width,Bf)}const i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),s=this.getViewRect(t);return new DOMRect(s.x,(i.bottom+o.top)/2,s.width,Bf)}getViewRect(t){const e=Xe(t,{horizontal:!0}),r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),o=Math.max(i.x-r.x,0),s=Math.max(r.right-i.right,0);return new DOMRect(r.x+o,r.y,Math.max(r.width-o-s,0),Bf)}}const Vj=I("find-drop-target");function $j(n,t){const e=Ae(n,t);if(!e)return null;if(Xi(e)&&Fr(e))return e;const r=e.firstElementChild;return r&&Xi(r)&&Fr(r)?r:null}function Hj(n,t,e){const l=e,c=t;for(let d=0;d<2;d++){const h=c+d*50;for(let C=0;C<5;C++){const E=l+C*8,x=Ae(h,E);if(x){const w=Z(x);if(w&&!It(n,w))return w}if(C===0)continue;const B=l-C*8,k=Ae(h,B);if(k){const w=Z(k);if(w&&!It(n,w))return w}}}return null}function jj(n,t,e){const r=Ae(t,e);if(r){const h=Z(r);if(h&&!It(n,h))return h}const i=new Set,o=$j(t,e);if(o){const h=o.getBoundingClientRect();e<h.top+h.height/2?i.add(be(o)):i.add(Ue(o))}const s=Hj(n,t,e);s&&i.add(s);const l=Array.from(i),c=h=>{for(let C=0;C<l.length;C++){const E=l[C];if(h!==E&&re(h,E))return!0}return!1},d=l.filter(h=>!c(h));return d.length>0?d[0]:null}function _E(n,t){if(n.readonly)return!1;const e=it(t);if(qt(e))return!0;const r=Z(e);return p(Vj,r,"no parent block"),n.isBlockWritable(r)?_E(n,r):!1}const zj=I("drop-target");function Gj(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")),p(zj,e,`unSupport file type ${t.type}`),e}async function iw(n,t,e,r){var o,s;let i=r;for(const l of t){const c=Gj(n,l);c.getOptions&&await((s=(o=c.getOptions(n)).handleInsertEmptyEmbed)==null?void 0:s.call(o,n,{containerId:e,blockIndex:i,data:{file:l}}))&&(i+=1)}}class Wj{constructor(t){m(this,"handleDrop",(t,e,r,i)=>{if(Array.isArray(e)){const o=e;if(o.length>0){const s=ct(r);return iw(t,o,s,i),!0}}return!1});this.editor=t}}class Tf{constructor(t){m(this,"indicator");m(this,"lastDropOverResult");m(this,"handlers",[]);m(this,"handleDragOver",t=>{if(!this.editor.isWritable())return;const e=o=>{var d,h,C,E;const s=DE(this.editor,o.dataTransfer),l=rw(this.editor,o.dataTransfer);if(((d=o.dataTransfer)==null?void 0:d.types.length)&&!((h=o.dataTransfer)!=null&&h.types.includes("Files")))return"none";const c=this.findTargetBlock(l,o.x,o.y);if(c&&re(this.editor.rootContainer,c)){const x=this.findInsertPos(l,c,o.x,o.y,(E=s!=null?s:(C=o.dataTransfer)==null?void 0:C.items)!=null?E:null);if(x)return this.indicator.show(c,x),"move"}return this.indicator.hide(),"none"},r=(o,s)=>{o.dataTransfer&&(o.dataTransfer.dropEffect=s),s==="move"&&o.preventDefault()};if(this.lastDropOverResult&&t.x===this.lastDropOverResult.x&&t.y===this.lastDropOverResult.y){const o=this.lastDropOverResult.dropEffect;r(t,o);return}const i=e(t);r(t,i),this.lastDropOverResult={x:t.x,y:t.y,dropEffect:i}});m(this,"handleDrop",t=>{var o,s;t.stopPropagation(),setTimeout(()=>{this.indicator.hide()});const e=DE(this.editor,t.dataTransfer),r=Array.from((s=(o=t.dataTransfer)==null?void 0:o.files)!=null?s:[]);if(!e&&r.length===0){t.dataTransfer&&(t.dataTransfer.dropEffect="none"),vf(this.editor);return}const i=this.indicator.target;if(i){const{block:l,insertPos:c}=i,d=rw(this.editor,t.dataTransfer);this.editor.undoManager.runInGroup(()=>{const h=Qt(this.editor,l);if(h.handleDrop&&h.handleDrop(this.editor,l,e!=null?e:r,c,{isSourceBlock:!1,targetBlock:l})){t.preventDefault(),this.editor.focus(),vf(this.editor);return}if(d){const C=Qt(this.editor,d);if(C.handleDrop&&C.handleDrop(this.editor,d,e!=null?e:r,c,{isSourceBlock:!0,targetBlock:l})){t.preventDefault(),this.editor.focus(),vf(this.editor);return}}if(typeof c=="string"){const C=it(l);let E=vt(l);if(c==="after"){E+=1;let x=Jt(l);for(;x&&!Go(x);)E+=1,x=Jt(x)}t.preventDefault();for(let x=0;x<this.handlers.length;x++)if(this.handlers[x].handleDrop(this.editor,d!=null?d:r,C,E)){this.editor.focus(),vf(this.editor);return}if(d){const x=this.editor.getBlockData(d),B=ts(this.editor.editorBlocks,this.editor.doc.toJSON(),x),[k]=this.editor.insertDocAt(C,E,B);this.editor.selection.selectBlock(k,0),bf.get(this.editor).highlightBlock(k),this.editor.deleteBlock(d),this.editor.focus()}}})}vf(this.editor)});m(this,"handleDragLeave",()=>{this.indicator.hide()});this.editor=t,this.indicator=new Kj(this.editor),this.handlers.push(new Wj(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 Tf(t))}static get(t){return t.getCustom("drop-target")}static find(t){return t.findCustom("drop-target")}canInsertAfter(t,e){return!(this.editor.readonly||gr(e)===t&&t||!_E(this.editor,e))}canInsertBefore(t,e){return!(this.editor.readonly||mr(e)===t&&t||!_E(this.editor,e)||qt(it(e))&&vt(e)===0)}canDrop(t,e){return t===null||t===e?!0:!re(t,e)}findTargetBlock(t,e,r){let i=jj(this.editor,e,r);if(!i||!re(this.editor.rootContainer,i))return null;const o=it(i),s=Z(o);return s&&Dt(s)==="code"&&(i=s),this.canDrop(t,i)?i:null}findInsertPos(t,e,r,i,o){let s=e;for(;s;){const c=Qt(this.editor,s);if(c.handleDropOver){const d=c.handleDropOver(this.editor,s,o,r,i);if(d)return d;if(d===!1)return null}s=Js(s)}if(t===e)return"";const l=e.getBoundingClientRect();if(l.top<=i&&i<=l.bottom){if(i<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 i<l.top&&this.canInsertBefore(t,e)?"before":l.bottom<i&&this.canInsertAfter(t,e)?"after":""}}function ow(n,t,e){const r=Ie.getImageObject(n,t),i=mt.default(r.getImages());if(i.length===1){n.deleteBlock(t);return}if(e===-1||e>=i.length)return;const o=MH(i);if(i.splice(e,1),i.length===1){const l=i[0],c=100*(l.flex/o);l.flex=1;const d=En([l],c);n.updateEmbedData(t,d);return}i[0].flex=NaN,oc(i);const s=En(i,r.getWidthPercent());n.updateEmbedData(t,s)}function qj(n,t,e,r){if(t.length===0||r==="after"||r==="before")return!1;let i=r.data;const o=Ie.getImageObject(n,e),s=mt.default(o.getImages()),l=[],c=[];t.forEach(C=>{zR(C.type)&&s.length+l.length<6?l.push(C):c.push(C)}),l.forEach(C=>{try{jR(n,C)}catch{return}const E={src:"",flex:1,width:0,height:0,virtualSize:!0};s.splice(i,0,E);const x=En(s,o.getWidthPercent());n.updateEmbedData(e,x),o.replaceImage(i,C),i+=1});const d=n.getBlockIndex(e)+1,h=ct(it(e));return iw(n,c,h,d),!0}function Xj(n,t,e,r,i){var s,l,c;if(Xd(e))return qj(n,e,t,r);if(e.type!=="custom"||e.customType!=="image"||!e.data)return;const o=e.data;if(i.isSourceBlock){const d=i.targetBlock,h=it(d);let C=vt(d);r==="after"&&(C+=1);const x=100*(o.boundingRect.width/n.rootContainer.getBoundingClientRect().width),B=En([o.image],x),k={id:et(),type:"embed",embedType:"image",embedData:B},w=(l=(s=n.options.componentsOptions)==null?void 0:s.image)==null?void 0:l.defaultAlign;w&&(k.align=w),n.insertBlock(ct(h),C,k),ow(n,t,o.index),(c=n.findCustom("drag-handler"))==null||c.handleDragEnd()}else{if(typeof r=="string")return;const d=t;let h=r.data;const C=Ie.getImageObject(n,d),E=mt.default(C.getImages());h>E.length&&(h=E.length),n.undoManager.runInGroup(()=>{var B,k;C.setAutoFix(!0);const x=n.getBlockById(e.blockId);if(x===d){const w=o.index,U=h,M=o.image;if(w===U||U===w+1)return;let F=U;w<U?(E.splice(U,0,M),E.splice(w,1),F-=1):(E.splice(w,1),E.splice(U,0,M));const Y=En(E,C.getWidthPercent());n.updateEmbedData(d,Y),C.setSelectedIndex(F),(B=n.findCustom("drag-handler"))==null||B.handleDragEnd()}else{E.splice(h,0,o.image),E[0].flex=NaN,oc(E);const w=En(E,C.getWidthPercent());n.updateEmbedData(d,w),ow(n,x,o.index),(k=n.findCustom("drag-handler"))==null||k.handleDragEnd(),C.setSelectedIndex(h),n.selection.selectBlock(d,0)}})}return!0}const Yj=2;function Y0(n,t,e){const r=Li(t);if(e<=0){const s=r[0].getBoundingClientRect();return new DOMRect(s.left-4,s.top,2,s.height)}if(e===r.length){const s=r[e-1].getBoundingClientRect();return new DOMRect(s.right+2,s.top,2,s.height)}const i=r[e-1].getBoundingClientRect(),o=r[e].getBoundingClientRect();return new DOMRect((o.left+i.right)/2-1,i.top,Yj,i.height)}function Qj(n,t,e,r,i){for(let o=0;o<e.length;o++){const l=e[o].getBoundingClientRect();if(r<=l.right)return r<=l.left+l.width/2?{rect:Y0(n,t,o),data:o}:{rect:Y0(n,t,o+1),data:o+1}}return r>e[e.length-1].getBoundingClientRect().right?{rect:Y0(n,t,e.length),data:e.length}:{rect:Y0(n,t,e.length),data:0}}function Jj(n,t,e,r,i){const o=Li(t);if(e instanceof DataTransferItemList){if(!Array.from(e).some(s=>zR(s.type))||o.length>=6)return}else{if((e==null?void 0:e.type)==="block"||o.length>=6&&(e==null?void 0:e.blockId)!==lt(t))return;const s=lt(t);if(o.length===1&&s===(e==null?void 0:e.blockId))return}return Qj(n,t,o,r)}async function Zj(n){return await yb.default.toSvg(n)}function ME(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 tz{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 r=Z(e);if(!r||!ti(r)||!this.editor.isBlockWritable(r)||this.editor.readonly)return;const i=Ie.getImageObject(this.editor,r);if(this.imageContainer=vE(t.target),!this.imageContainer)return;const s=FR(t.target).indexOf(this.imageContainer);if(s===-1)return;const l=i.getImages()[s];if(!l)return;const{x:c,y:d}=t;this.startPosition={x:c,y:d};const h={image:l,index:s,boundingRect:this.imageContainer.getBoundingClientRect()},C=ME(t,"dragstart");Pj(this.editor,C,r,"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=Z(this.imageContainer);if(!e)return;const{x:r,y:i}=t,{width:o,height:s}=t.target.getBoundingClientRect(),l=oe(e),c=v("div",["drag-container"],l);c.style.left=`${r-o/4}px`,c.style.top=`${i-s/4}px`,c.style.width=`${Math.max(o/2,16)}px`,c.style.height=`${s/2}px`,this.dragContainer=c,z(this.editor.contentElement,"dragging");const d=Xe(e);this.autoScroll=new Qd({scrollElement:d,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}),this.autoScroll.active();const h=v("img",["drag-target"],c),E=await Zj(this.imageContainer);E&&(h.src=E)});m(this,"handleDrag",t=>{var o;const{x:e,y:r}=t;if(((o=this.startPosition)==null?void 0:o.x)===e&&this.startPosition.y===r)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:c,y:d}=this.startPosition,h=s-c,C=l-d;this.dragContainer.style.transform=`translate(${h}px, ${C}px)`,this.dragContainer.style.opacity="0.5"}const i=ME(t,"dragover");this.editor.contentElement.dispatchEvent(i)});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 r=ME(t,"drop");this.editor.contentElement.dispatchEvent(r)}});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 ez{constructor(t){m(this,"handleFocusBlockChanged",(t,e,r)=>{const o=this.editor.getFocusedBlock();if(o&&ti(o)){const s=Ie.getImageObject(this.editor,o);s.getImages().length>0&&s.getSelectedIndex()===-1&&s.setSelectedIndex(0)}r&&ti(r)&&t.findCustom(`image-${r.id}`)&&Ie.getImageObject(this.editor,r).blockResizer.disableResize()});this.editor=t,this.editor.addListener("focusBlockChanged",this.handleFocusBlockChanged)}destroy(){this.editor.removeListener("focusBlockChanged",this.handleFocusBlockChanged)}}class nz{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,Re.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){Re.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}disable(t){ti(t)&&Ie.getImageObject(this.editor,t).disableResizer()}enable(t){if(ti(t)){const e=Ie.getImageObject(this.editor,t);this.editor.isBlockWritable(t)&&e.tryEnableResizer()}}}const rz={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"}},iz={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"}},oz={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"}};D.mergeLang({"zh-CN":rz,"en-US":iz,"ja-JP":oz});function sz(n,t,e,r){const i=n.getBlockByIndex(t,e),o=n.getBlockText(i),{left:s}=Mn(o,r),l=de(s);let c=r;if(l.endsWith("![]()"))c-=5;else if(l.endsWith("![]"))c-=3;else return!1;const d=r;return ga("image/*").then(h=>{n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,c,d-c);let C=e+1;de(n.getBlockText(i)).trim()?(Sa(n,i,c,{forceInsertAfter:!0}),c===0&&(n.deleteBlock(i),C--)):(n.deleteBlock(i),C--),l1(n,"image",t,C,{file:h})})}),!0}class lz{handleAfterInsertText(t,e,r,i,o){if(o===" "){if($0(t,e))return!1;if(sz(t,e,r,i))return!0}return!1}}const az=I("copy-image");function cz(n,t,e,r){const i=e.getImages()[r],o=e.getImages().length===1?e.getWidthPercent():i.flex*100,s=En([i],o),l={id:et(),type:"embed",embedType:"image",embedData:s},c=n.options.componentsOptions.image;c!=null&&c.defaultAlign&&(l.align=c.defaultAlign);const d={blocks:{root:[l]},comments:{},meta:{}},h=document.createElement("canvas");h.width=t.naturalWidth,h.height=t.naturalHeight;const C=h.getContext("2d");if(!C)return;const E={},x={};try{C.drawImage(t,0,0,h.width,h.height);const F=h.toDataURL("image/png").replace(/^data:image\/(png|jpg);base64,/,""),Y=Kg(F),X=new File([Y],`${Date.now()}.png`,{type:"image/png"});E["image/png"]=X}catch(M){az.error(M)}Ru(n,d);const k=`<img src="${n.doc.buildResourceUrl(i.src,{withToken:!0})}" />`,w=ku(k,d),U=new Blob([w],{type:"text/html"});return E["text/html"]=U,x["text/html"]=w,[E,x]}function uz(n,t,e,r,i){const o=cz(n,t,e,r);if(!o)return;const[s,l]=o;if(s){const c=Object.entries(s).map(([d,h])=>({type:d,data:h}));return tu(c).then(d=>{if(!d&&i){const h=i.clipboardData;h&&(h.setData("text/plain",l["text/plain"]),h.setData("text/html",l["text/html"]))}}),!0}}function Q0(n,t){const e=n.selection.range;if(e.start.blockId!==e.end.blockId)return;const i=n.getFocusedBlock();if(i&&ti(i)){const o=Ie.getImageObject(n,i);if(o.getImages().length>0){const l=o.getSelectedIndex();if(l!==-1){const d=Li(i)[l].querySelector("img");if(d)return uz(n,d,o,l,t)}}}}function fz(n){const t=n.getFocusedBlock(),e=gr(t);if(e&&ti(e)){n.selection.selectBlock(e,0);const r=Ie.getImageObject(n,e);return r.getImages().length>0&&r.setSelectedIndex(0),!0}}function dz(n){const t=n.getFocusedBlock(),e=mr(t);if(e&&ti(e)){n.selection.selectBlock(e,0);const r=Ie.getImageObject(n,e);return r.getImages().length>0&&r.setSelectedIndex(0),!0}}function hz(n){const e=n.getFocusedBlock();if(e&&ti(e)){const r=Ie.getImageObject(n,e),i=r.getImages();if(i.length>0){const o=r.getSelectedIndex();if(o===-1)return r.setSelectedIndex(i.length-1),!0;if(o>0)return r.setSelectedIndex(o-1),!0}}}function mz(n){const e=n.getFocusedBlock();if(e&&ti(e)){const r=Ie.getImageObject(n,e),i=r.getImages();if(i.length>0){const o=r.getSelectedIndex();if(o===-1)return r.setSelectedIndex(0),!0;if(o<i.length-1)return r.setSelectedIndex(o+1),!0}}}function J0(n){const e=n.getFocusedBlock();if(e&&ti(e)){const r=Ie.getImageObject(n,e);if(r.getImages().length>0){const o=r.getSelectedIndex();if(o!==-1)return r.removeImage(o),!0}}}const gz={ArrowLeft:hz,ArrowRight:mz,ArrowUp:dz,ArrowDown:fz,Delete:J0,Backspace:J0};class pz{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}handleBeforeCopy(t,e,r){if(!window.isSecureContext)return;if(Q0(t,e))return!0}handleBeforeCut(t,e){if(Q0(t,e))return J0(t),!0}destroy(){}}class UE{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}async handleAfterPasteDoc(t,e,r){return Object.values(e.blocks).forEach(i=>{i.forEach(o=>{if(o.type==="embed"&&o.embedType==="image"){const s=o.embedData;if(Array.isArray(s.src))return;let l=r.blockIdMap.get(o.id);for(;l&&r.blockIdMap.get(l);)l=r.blockIdMap.get(l);l&&Cs(t,l).setAutoFix(!0)}})}),!1}destroy(){}}const Cz=I("image-embed");function Ez(n,t,e,r,i,o){Ie.create(n,e).createContent(i,o,t),n.addCustom("image-select-handler",()=>new ez(n)),n.addCustom("image-copy-handler",()=>new pz(n)),setTimeout(()=>{n.addCustom("drag-handler",()=>new tz(n));const l=n.addCustom("image-resizer",()=>new nz(n)),c=e.embedData;ic(c)?l.disable(o):l.currentResizer===o&&l.enable(o)})}function xz(n,t,e,r){const i=t.embedData,o=sc(i);return r==="html"?o.map(s=>`<img src="${n.doc.buildResourceUrl(s.src,{withToken:!0})}">`).join(""):r==="markdown"?`${o.map(l=>`})`).join(`
|
|
666
|
+
Click to open the menu`,insertTips:"Click to add block"}}},Uj={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"}}};D.mergeLang({"zh-CN":_j,"en-US":Mj,"ja-JP":Uj});const mat="";class Oj{constructor(){m(this,"dragObject",null)}setData(t){this.dragObject=t}getData(){return this.dragObject}clearData(){this.dragObject=null}destroy(){}}function X0(n){return n.addCustom("drag-data",()=>new Oj)}function DE(n,t){if(!t)return null;const e=X0(n).getData();return!e||e.editorId!==n.id?null:e}function rw(n,t){const e=DE(n,t);return e?n.findBlockById(e.blockId):null}function Nj(n,t,e){if(!t.dataTransfer)return;const i=it(e),o=ct(i),s=lt(e),l={type:"block",editorId:n.id,containerId:o,blockId:s};X0(n).setData(l)}function Pj(n,t,e,r,i){if(!t.dataTransfer)return;const s=it(e),l=ct(s),c=lt(e),d={type:"custom",customType:r,editorId:n.id,containerId:l,blockId:c,data:i};X0(n).setData(d)}function vf(n){X0(n).clearData()}const Fj=I("drop-indicator"),Bf=2;class Kj{constructor(t){m(this,"indicator");m(this,"target",null);this.editor=t,this.indicator=v("div",["editor-drop-indicator"],this.editor.contentElement)}show(t,e){const r=this.getIndicatorRect(t,e),i=this.editor.rootElement.getBoundingClientRect(),o=r.top-i.top,s=r.left-i.left;this.indicator.style.top=`${o}px`,this.indicator.style.left=`${s}px`,this.indicator.style.width=`${r.width}px`,this.indicator.style.height=`${r.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 l=mr(t);if(!l){p(Fj,Fr(it(t)),"block does not in a child container");const C=t.getBoundingClientRect(),E=this.getViewRect(t);return new DOMRect(E.x,C.y,E.width,Bf)}const c=l.getBoundingClientRect(),d=t.getBoundingClientRect(),h=this.getViewRect(t);return new DOMRect(h.x,(c.bottom+d.top)/2,h.width,Bf)}const r=gr(t);if(!r){const l=t.getBoundingClientRect(),c=this.getViewRect(t);return new DOMRect(c.x,l.bottom,c.width,Bf)}const i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),s=this.getViewRect(t);return new DOMRect(s.x,(i.bottom+o.top)/2,s.width,Bf)}getViewRect(t){const e=Xe(t,{horizontal:!0}),r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),o=Math.max(i.x-r.x,0),s=Math.max(r.right-i.right,0);return new DOMRect(r.x+o,r.y,Math.max(r.width-o-s,0),Bf)}}const Vj=I("find-drop-target");function $j(n,t){const e=Ae(n,t);if(!e)return null;if(Xi(e)&&Fr(e))return e;const r=e.firstElementChild;return r&&Xi(r)&&Fr(r)?r:null}function Hj(n,t,e){const l=e,c=t;for(let d=0;d<2;d++){const h=c+d*50;for(let C=0;C<5;C++){const E=l+C*8,x=Ae(h,E);if(x){const w=Z(x);if(w&&!It(n,w))return w}if(C===0)continue;const B=l-C*8,k=Ae(h,B);if(k){const w=Z(k);if(w&&!It(n,w))return w}}}return null}function jj(n,t,e){const r=Ae(t,e);if(r){const h=Z(r);if(h&&!It(n,h))return h}const i=new Set,o=$j(t,e);if(o){const h=o.getBoundingClientRect();e<h.top+h.height/2?i.add(be(o)):i.add(Ue(o))}const s=Hj(n,t,e);s&&i.add(s);const l=Array.from(i),c=h=>{for(let C=0;C<l.length;C++){const E=l[C];if(h!==E&&re(h,E))return!0}return!1},d=l.filter(h=>!c(h));return d.length>0?d[0]:null}function _E(n,t){if(n.readonly)return!1;const e=it(t);if(qt(e))return!0;const r=Z(e);return p(Vj,r,"no parent block"),n.isBlockWritable(r)?_E(n,r):!1}const zj=I("drop-target");function Gj(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")),p(zj,e,`unSupport file type ${t.type}`),e}async function iw(n,t,e,r){var o,s;let i=r;for(const l of t){const c=Gj(n,l);c.getOptions&&await((s=(o=c.getOptions(n)).handleInsertEmptyEmbed)==null?void 0:s.call(o,n,{containerId:e,blockIndex:i,data:{file:l}}))&&(i+=1)}}class Wj{constructor(t){m(this,"handleDrop",(t,e,r,i)=>{if(Array.isArray(e)){const o=e;if(o.length>0){const s=ct(r);return iw(t,o,s,i),!0}}return!1});this.editor=t}}class Tf{constructor(t){m(this,"indicator");m(this,"lastDropOverResult");m(this,"handlers",[]);m(this,"handleDragOver",t=>{if(!this.editor.isWritable())return;const e=o=>{var d,h,C,E;const s=DE(this.editor,o.dataTransfer),l=rw(this.editor,o.dataTransfer);if(((d=o.dataTransfer)==null?void 0:d.types.length)&&!((h=o.dataTransfer)!=null&&h.types.includes("Files")))return"none";const c=this.findTargetBlock(l,o.x,o.y);if(c&&re(this.editor.rootContainer,c)){const x=this.findInsertPos(l,c,o.x,o.y,(E=s!=null?s:(C=o.dataTransfer)==null?void 0:C.items)!=null?E:null);if(x)return this.indicator.show(c,x),"move"}return this.indicator.hide(),"none"},r=(o,s)=>{o.dataTransfer&&(o.dataTransfer.dropEffect=s),s==="move"&&o.preventDefault()};if(this.lastDropOverResult&&t.x===this.lastDropOverResult.x&&t.y===this.lastDropOverResult.y){const o=this.lastDropOverResult.dropEffect;r(t,o);return}const i=e(t);r(t,i),this.lastDropOverResult={x:t.x,y:t.y,dropEffect:i}});m(this,"handleDrop",t=>{var o,s;t.stopPropagation(),setTimeout(()=>{this.indicator.hide()});const e=DE(this.editor,t.dataTransfer),r=Array.from((s=(o=t.dataTransfer)==null?void 0:o.files)!=null?s:[]);if(!e&&r.length===0){t.dataTransfer&&(t.dataTransfer.dropEffect="none"),vf(this.editor);return}const i=this.indicator.target;if(i){const{block:l,insertPos:c}=i,d=rw(this.editor,t.dataTransfer);this.editor.undoManager.runInGroup(()=>{const h=Qt(this.editor,l);if(h.handleDrop&&h.handleDrop(this.editor,l,e!=null?e:r,c,{isSourceBlock:!1,targetBlock:l})){t.preventDefault(),this.editor.focus(),vf(this.editor);return}if(d){const C=Qt(this.editor,d);if(C.handleDrop&&C.handleDrop(this.editor,d,e!=null?e:r,c,{isSourceBlock:!0,targetBlock:l})){t.preventDefault(),this.editor.focus(),vf(this.editor);return}}if(typeof c=="string"){const C=it(l);let E=vt(l);if(c==="after"){E+=1;let x=Jt(l);for(;x&&!Go(x);)E+=1,x=Jt(x)}t.preventDefault();for(let x=0;x<this.handlers.length;x++)if(this.handlers[x].handleDrop(this.editor,d!=null?d:r,C,E)){this.editor.focus(),vf(this.editor);return}if(d){const x=this.editor.getBlockData(d),B=ts(this.editor.editorBlocks,this.editor.doc.toJSON(),x),[k]=this.editor.insertDocAt(C,E,B);this.editor.selection.selectBlock(k,0),bf.get(this.editor).highlightBlock(k),this.editor.deleteBlock(d),this.editor.focus()}}})}vf(this.editor)});m(this,"handleDragLeave",()=>{this.indicator.hide()});this.editor=t,this.indicator=new Kj(this.editor),this.handlers.push(new Wj(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 Tf(t))}static get(t){return t.getCustom("drop-target")}static find(t){return t.findCustom("drop-target")}canInsertAfter(t,e){return!(this.editor.readonly||gr(e)===t&&t||!_E(this.editor,e))}canInsertBefore(t,e){return!(this.editor.readonly||mr(e)===t&&t||!_E(this.editor,e)||qt(it(e))&&vt(e)===0)}canDrop(t,e){return t===null||t===e?!0:!re(t,e)}findTargetBlock(t,e,r){let i=jj(this.editor,e,r);if(!i||!re(this.editor.rootContainer,i))return null;const o=it(i),s=Z(o);return s&&Dt(s)==="code"&&(i=s),this.canDrop(t,i)?i:null}findInsertPos(t,e,r,i,o){let s=e;for(;s;){const c=Qt(this.editor,s);if(c.handleDropOver){const d=c.handleDropOver(this.editor,s,o,r,i);if(d)return d;if(d===!1)return null}s=Js(s)}if(t===e)return"";const l=e.getBoundingClientRect();if(l.top<=i&&i<=l.bottom){if(i<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 i<l.top&&this.canInsertBefore(t,e)?"before":l.bottom<i&&this.canInsertAfter(t,e)?"after":""}}function ow(n,t,e){const r=Ie.getImageObject(n,t),i=mt.default(r.getImages());if(i.length===1){n.deleteBlock(t);return}if(e===-1||e>=i.length)return;const o=MH(i);if(i.splice(e,1),i.length===1){const l=i[0],c=100*(l.flex/o);l.flex=1;const d=En([l],c);n.updateEmbedData(t,d);return}i[0].flex=NaN,oc(i);const s=En(i,r.getWidthPercent());n.updateEmbedData(t,s)}function qj(n,t,e,r){if(t.length===0||r==="after"||r==="before")return!1;let i=r.data;const o=Ie.getImageObject(n,e),s=mt.default(o.getImages()),l=[],c=[];t.forEach(C=>{zR(C.type)&&s.length+l.length<6?l.push(C):c.push(C)}),l.forEach(C=>{try{jR(n,C)}catch{return}const E={src:"",flex:1,width:0,height:0,virtualSize:!0};s.splice(i,0,E);const x=En(s,o.getWidthPercent());n.updateEmbedData(e,x),o.replaceImage(i,C),i+=1});const d=n.getBlockIndex(e)+1,h=ct(it(e));return iw(n,c,h,d),!0}function Xj(n,t,e,r,i){var s,l,c;if(Xd(e))return qj(n,e,t,r);if(e.type!=="custom"||e.customType!=="image"||!e.data)return;const o=e.data;if(i.isSourceBlock){const d=i.targetBlock,h=it(d);let C=vt(d);r==="after"&&(C+=1);const x=100*(o.boundingRect.width/n.rootContainer.getBoundingClientRect().width),B=En([o.image],x),k={id:et(),type:"embed",embedType:"image",embedData:B},w=(l=(s=n.options.componentsOptions)==null?void 0:s.image)==null?void 0:l.defaultAlign;w&&(k.align=w),n.insertBlock(ct(h),C,k),ow(n,t,o.index),(c=n.findCustom("drag-handler"))==null||c.handleDragEnd()}else{if(typeof r=="string")return;const d=t;let h=r.data;const C=Ie.getImageObject(n,d),E=mt.default(C.getImages());h>E.length&&(h=E.length),n.undoManager.runInGroup(()=>{var B,k;C.setAutoFix(!0);const x=n.getBlockById(e.blockId);if(x===d){const w=o.index,U=h,M=o.image;if(w===U||U===w+1)return;let F=U;w<U?(E.splice(U,0,M),E.splice(w,1),F-=1):(E.splice(w,1),E.splice(U,0,M));const Y=En(E,C.getWidthPercent());n.updateEmbedData(d,Y),C.setSelectedIndex(F),(B=n.findCustom("drag-handler"))==null||B.handleDragEnd()}else{E.splice(h,0,o.image),E[0].flex=NaN,oc(E);const w=En(E,C.getWidthPercent());n.updateEmbedData(d,w),ow(n,x,o.index),(k=n.findCustom("drag-handler"))==null||k.handleDragEnd(),C.setSelectedIndex(h),n.selection.selectBlock(d,0)}})}return!0}const Yj=2;function Y0(n,t,e){const r=Li(t);if(e<=0){const s=r[0].getBoundingClientRect();return new DOMRect(s.left-4,s.top,2,s.height)}if(e===r.length){const s=r[e-1].getBoundingClientRect();return new DOMRect(s.right+2,s.top,2,s.height)}const i=r[e-1].getBoundingClientRect(),o=r[e].getBoundingClientRect();return new DOMRect((o.left+i.right)/2-1,i.top,Yj,i.height)}function Qj(n,t,e,r,i){for(let o=0;o<e.length;o++){const l=e[o].getBoundingClientRect();if(r<=l.right)return r<=l.left+l.width/2?{rect:Y0(n,t,o),data:o}:{rect:Y0(n,t,o+1),data:o+1}}return r>e[e.length-1].getBoundingClientRect().right?{rect:Y0(n,t,e.length),data:e.length}:{rect:Y0(n,t,e.length),data:0}}function Jj(n,t,e,r,i){const o=Li(t);if(e instanceof DataTransferItemList){if(!Array.from(e).some(s=>zR(s.type))||o.length>=6)return}else{if((e==null?void 0:e.type)==="block"||o.length>=6&&(e==null?void 0:e.blockId)!==lt(t))return;const s=lt(t);if(o.length===1&&s===(e==null?void 0:e.blockId))return}return Qj(n,t,o,r)}async function Zj(n){return await yb.default.toSvg(n)}function ME(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 tz{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 r=Z(e);if(!r||!ti(r)||!this.editor.isBlockWritable(r)||this.editor.readonly)return;const i=Ie.getImageObject(this.editor,r);if(this.imageContainer=vE(t.target),!this.imageContainer)return;const s=FR(t.target).indexOf(this.imageContainer);if(s===-1)return;const l=i.getImages()[s];if(!l)return;const{x:c,y:d}=t;this.startPosition={x:c,y:d};const h={image:l,index:s,boundingRect:this.imageContainer.getBoundingClientRect()},C=ME(t,"dragstart");Pj(this.editor,C,r,"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=Z(this.imageContainer);if(!e)return;const{x:r,y:i}=t,{width:o,height:s}=t.target.getBoundingClientRect(),l=oe(e),c=v("div",["drag-container"],l);c.style.left=`${r-o/4}px`,c.style.top=`${i-s/4}px`,c.style.width=`${Math.max(o/2,16)}px`,c.style.height=`${s/2}px`,this.dragContainer=c,z(this.editor.contentElement,"dragging");const d=Xe(e);this.autoScroll=new Qd({scrollElement:d,trackMouseEvent:"mousemove",edge:{top:50,bottom:50}}),this.autoScroll.active();const h=v("img",["drag-target"],c),E=await Zj(this.imageContainer);E&&(h.src=E)});m(this,"handleDrag",t=>{var o;const{x:e,y:r}=t;if(((o=this.startPosition)==null?void 0:o.x)===e&&this.startPosition.y===r)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:c,y:d}=this.startPosition,h=s-c,C=l-d;this.dragContainer.style.transform=`translate(${h}px, ${C}px)`,this.dragContainer.style.opacity="0.5"}const i=ME(t,"dragover");this.editor.contentElement.dispatchEvent(i)});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 r=ME(t,"drop");this.editor.contentElement.dispatchEvent(r)}});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 ez{constructor(t){m(this,"handleFocusBlockChanged",(t,e,r)=>{const o=this.editor.getFocusedBlock();if(o&&ti(o)){const s=Ie.getImageObject(this.editor,o);s.getImages().length>0&&s.getSelectedIndex()===-1&&s.setSelectedIndex(0)}r&&ti(r)&&t.findCustom(`image-${r.id}`)&&Ie.getImageObject(this.editor,r).blockResizer.disableResize()});this.editor=t,this.editor.addListener("focusBlockChanged",this.handleFocusBlockChanged)}destroy(){this.editor.removeListener("focusBlockChanged",this.handleFocusBlockChanged)}}class nz{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,Re.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){Re.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}disable(t){ti(t)&&Ie.getImageObject(this.editor,t).disableResizer()}enable(t){if(ti(t)){const e=Ie.getImageObject(this.editor,t);this.editor.isBlockWritable(t)&&e.tryEnableResizer()}}}const rz={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"}},iz={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"}},oz={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"}};D.mergeLang({"zh-CN":rz,"en-US":iz,"ja-JP":oz});function sz(n,t,e,r){const i=n.getBlockByIndex(t,e),o=n.getBlockText(i),{left:s}=Mn(o,r),l=de(s);let c=r;if(l.endsWith("![]()"))c-=5;else if(l.endsWith("![]"))c-=3;else return!1;const d=r;return ga("image/*").then(h=>{!h||n.undoManager.runInGroup(()=>{n.deleteTextFromBlock(i,c,d-c);let C=e+1;de(n.getBlockText(i)).trim()?(Sa(n,i,c,{forceInsertAfter:!0}),c===0&&(n.deleteBlock(i),C--)):(n.deleteBlock(i),C--),l1(n,"image",t,C,{file:h})})}),!0}class lz{handleAfterInsertText(t,e,r,i,o){if(o===" "){if($0(t,e))return!1;if(sz(t,e,r,i))return!0}return!1}}const az=I("copy-image");function cz(n,t,e,r){const i=e.getImages()[r],o=e.getImages().length===1?e.getWidthPercent():i.flex*100,s=En([i],o),l={id:et(),type:"embed",embedType:"image",embedData:s},c=n.options.componentsOptions.image;c!=null&&c.defaultAlign&&(l.align=c.defaultAlign);const d={blocks:{root:[l]},comments:{},meta:{}},h=document.createElement("canvas");h.width=t.naturalWidth,h.height=t.naturalHeight;const C=h.getContext("2d");if(!C)return;const E={},x={};try{C.drawImage(t,0,0,h.width,h.height);const F=h.toDataURL("image/png").replace(/^data:image\/(png|jpg);base64,/,""),Y=Kg(F),X=new File([Y],`${Date.now()}.png`,{type:"image/png"});E["image/png"]=X}catch(M){az.error(M)}Ru(n,d);const k=`<img src="${n.doc.buildResourceUrl(i.src,{withToken:!0})}" />`,w=ku(k,d),U=new Blob([w],{type:"text/html"});return E["text/html"]=U,x["text/html"]=w,[E,x]}function uz(n,t,e,r,i){const o=cz(n,t,e,r);if(!o)return;const[s,l]=o;if(s){const c=Object.entries(s).map(([d,h])=>({type:d,data:h}));return tu(c).then(d=>{if(!d&&i){const h=i.clipboardData;h&&(h.setData("text/plain",l["text/plain"]),h.setData("text/html",l["text/html"]))}}),!0}}function Q0(n,t){const e=n.selection.range;if(e.start.blockId!==e.end.blockId)return;const i=n.getFocusedBlock();if(i&&ti(i)){const o=Ie.getImageObject(n,i);if(o.getImages().length>0){const l=o.getSelectedIndex();if(l!==-1){const d=Li(i)[l].querySelector("img");if(d)return uz(n,d,o,l,t)}}}}function fz(n){const t=n.getFocusedBlock(),e=gr(t);if(e&&ti(e)){n.selection.selectBlock(e,0);const r=Ie.getImageObject(n,e);return r.getImages().length>0&&r.setSelectedIndex(0),!0}}function dz(n){const t=n.getFocusedBlock(),e=mr(t);if(e&&ti(e)){n.selection.selectBlock(e,0);const r=Ie.getImageObject(n,e);return r.getImages().length>0&&r.setSelectedIndex(0),!0}}function hz(n){const e=n.getFocusedBlock();if(e&&ti(e)){const r=Ie.getImageObject(n,e),i=r.getImages();if(i.length>0){const o=r.getSelectedIndex();if(o===-1)return r.setSelectedIndex(i.length-1),!0;if(o>0)return r.setSelectedIndex(o-1),!0}}}function mz(n){const e=n.getFocusedBlock();if(e&&ti(e)){const r=Ie.getImageObject(n,e),i=r.getImages();if(i.length>0){const o=r.getSelectedIndex();if(o===-1)return r.setSelectedIndex(0),!0;if(o<i.length-1)return r.setSelectedIndex(o+1),!0}}}function J0(n){const e=n.getFocusedBlock();if(e&&ti(e)){const r=Ie.getImageObject(n,e);if(r.getImages().length>0){const o=r.getSelectedIndex();if(o!==-1)return r.removeImage(o),!0}}}const gz={ArrowLeft:hz,ArrowRight:mz,ArrowUp:dz,ArrowDown:fz,Delete:J0,Backspace:J0};class pz{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}handleBeforeCopy(t,e,r){if(!window.isSecureContext)return;if(Q0(t,e))return!0}handleBeforeCut(t,e){if(Q0(t,e))return J0(t),!0}destroy(){}}class UE{constructor(t){this.editor=t,setTimeout(()=>{this.editor.input.addHandler(this)})}async handleAfterPasteDoc(t,e,r){return Object.values(e.blocks).forEach(i=>{i.forEach(o=>{if(o.type==="embed"&&o.embedType==="image"){const s=o.embedData;if(Array.isArray(s.src))return;let l=r.blockIdMap.get(o.id);for(;l&&r.blockIdMap.get(l);)l=r.blockIdMap.get(l);l&&Cs(t,l).setAutoFix(!0)}})}),!1}destroy(){}}const Cz=I("image-embed");function Ez(n,t,e,r,i,o){Ie.create(n,e).createContent(i,o,t),n.addCustom("image-select-handler",()=>new ez(n)),n.addCustom("image-copy-handler",()=>new pz(n)),setTimeout(()=>{n.addCustom("drag-handler",()=>new tz(n));const l=n.addCustom("image-resizer",()=>new nz(n)),c=e.embedData;ic(c)?l.disable(o):l.currentResizer===o&&l.enable(o)})}function xz(n,t,e,r){const i=t.embedData,o=sc(i);return r==="html"?o.map(s=>`<img src="${n.doc.buildResourceUrl(s.src,{withToken:!0})}">`).join(""):r==="markdown"?`${o.map(l=>`})`).join(`
|
|
667
667
|
`)}
|
|
668
668
|
`:""}class Az{constructor(){m(this,"group","image");m(this,"commands",[])}executeCommand(t,e,r){if(r.id==="replace-image"){const{block:i,image:o}=r.data;Ie.getImageObject(t,i).replaceImage(0,o)}}}function bz(){return{blockCommands:{image:new Az},abstract:`${D.t("image.abstract")}`}}function vz(){return{name:"Image",insertEmbedCommandItems:[{id:"insert-image",name:D.t("image.abstract"),icon:BT,group:"common",subText:"/image",order:100}],handleInsertEmptyEmbed:async(n,t)=>{var x;let e;(x=t.data)!=null&&x.file&&(e=t.data.file);const r=HR(n);if(e=e!=null?e:await ga(r),!e)return null;try{jR(n,e)}catch{return null}let i={width:hf,height:SR};try{i=await wH(e)}catch(B){Cz.error(B)}const o=n.rootContainer.clientWidth,s=i.width<o?Math.min(100,i.width/o*100):100,l={src:"",width:i.width,height:i.height,flex:1,virtualSize:!1},c=En([l],s),d={id:et(),type:"embed",embedType:"image",embedData:c},h=n.options.componentsOptions.image;h!=null&&h.defaultAlign&&(d.align=h.defaultAlign);const C=n.insertBlock(t.containerId,t.blockIndex,d);return Ie.getImageObject(n,C).replaceImage(0,e),C}}}function Bz(n,t,e){var h;const{data:r}=e,i=n.getBlockString(t).trim();if(!r||r.embedType!=="image"||!rt(n,t))return null;const o=i.match(/^!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalPart>".*")?\)/),s=(h=o==null?void 0:o.groups)==null?void 0:h.filename;if(!s)return null;const l={src:s},c={id:et(),type:"embed",embedType:"image",embedData:l};Ie.create(n,c).setAutoFix(!0);const d=n.options.componentsOptions.image.defaultAlign;return d&&(c.align=d),{blockData:c}}function Tz(n,t){const e=lt(t);n.destroyCustom(`image-${e}`)}const yz={embedType:"image",createEmbedContent:Ez,convertTo:xz,convertFrom:Bz,getBlockProperties:bz,getOptions:vz,handleDrop:Xj,handleDropOver:Jj,handleDeleteBlock:Tz};class kz{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(this.cleaningDoc(e)),setTimeout(()=>{this.docs&&this.show(this.docs),this.editor.focus()}))});m(this,"handleClose",()=>{this.editor.focus()});m(this,"handleSelectionChange",()=>{this.toolbar.isVisible&&this.handleClose()});this.editor=t,this.onPasteSpecial=e,this.item={id:"paste-special",name:"",icon:TT,dropdown:!0,manualShowChildren:!0,childrenPlacement:"bottom-start",childrenOffset:[-4,4],children:[]},this.toolbar=new ju([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)}show(t){this.docs=t;const e=this.editor,r=e.selection.range;if(!r.isCollapsed())return;const i=e.getBlockById(r.start.blockId);if(!rt(e,i))return;const o=Yi(e,i,r)[0];if(!o)return;this.anchor&&this.anchor.remove(),this.anchor=Zi(e,i,"paste-special-button-anchor",o);const s=this.getCommandItems(t);this.item.children=s,this.toolbar.manualShow(this.anchor)}cleaningDoc(t){const e=t.id,r=t.data;return e!=="text/plain"||Object.values(r.blocks).forEach(i=>{i.forEach(o=>{o.text&&o.text.forEach(s=>{if(s.attributes){const l=s.attributes;Object.keys(l).forEach(c=>{c==="link"&&delete l[c]})}})})}),r}hide(){this.toolbar.close("selectionChange")}clearCheckedState(){this.checkedId=void 0}destroy(){this.toolbar.destroy()}getCommandItems(t){const e=o=>({id:o,states:this.checkedId===o?["checked"]:void 0,name:D.t("pasteSpecial.originFormats"),data:t[o]}),r=[];let i=!0;return t["text/x-ones-editor-doc"]?r.push(e("text/x-ones-editor-doc")):t["text/office-html"]?r.push(e("text/office-html")):t["text/html"]?r.push(e("text/html")):t["text/plain"]&&(r.push(e("text/plain")),i=!1),t["text/plain"]&&(i&&r.push({id:"text/plain",states:this.checkedId==="text/plain"?["checked"]:void 0,name:D.t("pasteSpecial.plainText"),data:t["text/plain"]}),r.push({id:"text/markdown",states:this.checkedId==="text/markdown"?["checked"]:void 0,name:D.t("pasteSpecial.markdown"),data:t["text/markdown"]})),r}}const Rz=I("paste-special");class OE{constructor(t){m(this,"button");m(this,"lastUndoAction",null);m(this,"lastPos",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 kz(t,this.handlePasteSpecial)}destroy(){this.event=null,this.button.destroy()}handleChanged(t,e){this.event=null,this.button.hide()}async handleBeforePaste(t,e){return Rz.debug("before paste"),this.lastUndoAction=t.undoManager.lastAction(),this.lastPos=t.selection.range.start,!1}async handleAfterPaste(t,e,r){if(Object.keys(r).length<=1)return!1;const i=t.selection.range;if(i.isCollapsed()){const o=t.getBlockById(i.start.blockId);if(!rt(t,o))return!1;if(this.lastPos&&Vr(this.lastPos)){const s=t.findBlockById(this.lastPos.blockId);if(s&&qi(s))return!1}this.button.clearCheckedState(),this.button.show(r),this.event=e}return!1}}const wz={pasteSpecial:{originFormats:"\u4FDD\u6301\u539F\u6837\u5F0F",plainText:"\u7C98\u8D34\u7EAF\u6587\u672C",markdown:"\u7C98\u8D34\u4E3A Markdown"}},Sz={pasteSpecial:{originFormats:"Keep origin formats",plainText:"Paste as plain text",markdown:"Paste as markdown"}},Lz={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"}};D.mergeLang({"zh-CN":wz,"en-US":Sz,"ja-JP":Lz});const gat="",Iz=I("html-to-doc");function Dz(n){const t=/(<canvas data-editor-doc=")[\s\S]*( id="ones-editor-doc"\s?>)/g;let e=n;$s()&&(e=n.replace(/style="(.*)"/,""));let r=e.match(t);if(!r||!r.length)return null;r=r.map(l=>l.replace(/(<canvas data-editor-doc=")/g,"").replace(/(" id="ones-editor-doc"\s?>)/g,""));const i=r[0],o=Jc(i);return JSON.parse(o)}function _z(n){const t="ones-editor-doc::",e="::ones-editor-doc";let r=n.indexOf(t);if(r!==-1){r+=t.length;const o=n.indexOf(e,r);if(o!==-1){const s=n.substr(r,o-r);try{const l=Jc(s);return JSON.parse(l)}catch(l){Iz.error(`invalid doc data: ${l}, ${s}`)}}}const i=Dz(n);return i||null}const sw="latex-b172fea480b",Mz=n=>({name:"latex-block",level:"block",start(t){var e,r;return(r=(e=t.match(/\$\$[^\$]/))==null?void 0:e.index)!=null?r:-1},tokenizer(t,e){const r=/^\$\$([^\$]+)\$\$/.exec(t);return r?{type:"latex-block",raw:r[0],formula:r[1]}:void 0},renderer(t){return n.lazy?`<span class="${sw}" block>${t.formula}</span>`:n.render(t.formula,!0)}}),Uz=n=>({name:"latex",level:"inline",start(t){var e,r;return(r=(e=t.match(/\$[^\$]/))==null?void 0:e.index)!=null?r:-1},tokenizer(t,e){const r=/^\$([^\$]+)\$/.exec(t);return r?{type:"latex",raw:r[0],formula:r[1]}:void 0},renderer(t){return n.lazy?`<span class="${sw}">${t.formula}</span>`:n.render(t.formula,!1)}});var Oz=(n={})=>(n.lazy&&n.env!=="test"&&new IntersectionObserver((t,e)=>{for(const r of t){if(!r.isIntersecting)continue;const i=r.target;e.unobserve(i),Promise.resolve(n.render(i.innerText,i.hasAttribute("block"))).then(o=>{i.innerHTML=o}),i.classList.add("latex-rendered")}},{threshold:1}),{extensions:[Mz(n),Uz(n)]});function lc(n){const t=n.type;if(t==="link")return!!n.tokens.some(lc);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 Nz(n){return!lc(n)}function Pz(n){if(n.length===0)return[];if(n.length===1)return[n];const t=[];let e=[n[0]],r=lc(n[0]);for(let i=1;i<n.length;i++){const o=n[i];r===lc(o)?e.push(o):(t.push(e),e=[o],r=lc(o))}return t.push(e),t}function Fz(n,t,e){let r=n.href;r.startsWith("mailto:")&&(r=r.substring(7));let i=e.tokensToText(n.tokens,t,e);return i.length===0&&(i=ol(r,t)),i=lh(i,"link",r),i}let yf;function NE(n){yf||(yf=document.createElement("textarea")),yf.innerHTML=n;const t=yf.childNodes.length===0?"":yf.childNodes[0].nodeValue;return t!=null?t:""}function Kz(n,t){const e=NE(n.text);return[Er(e,{...t,"style-code":!0})]}function Vz(n,t,e){const i=n.tokens;return i?e.tokensToText(i,t,e):_1(NE(n.text),t)}const $z=I("token-to-text");function PE(n,t,e){return n.map(i=>i.type==="text"?Vz(i,t,e):i.type==="strong"?e.tokensToText(i.tokens,{...t,"style-bold":!0},e):i.type==="em"?e.tokensToText(i.tokens,{...t,"style-italic":!0},e):i.type==="del"?e.tokensToText(i.tokens,{...t,"style-strikethrough":!0},e):i.type==="link"?Fz(i,t,e):i.type==="codespan"?Kz(i,t):i.type==="br"?[{insert:" ",attributes:{id:et(),created:Date.now(),box:!0,type:"br"}}]:i.type==="escape"?_1(NE(i.text),t):i.type==="latex"?[{insert:" ",attributes:{id:et(),created:Date.now(),box:!0,type:"math",tex:i.formula}}]:($z.warn(`unknown token in text: ${JSON.stringify(i)}`),[])).flat()}function Hz(n,t){const e=PE(n.tokens,{},t);return[{id:et(),type:"text",text:e,heading:n.depth}]}function jz(n,t){const{text:e,children:r}=t.tokensToTextWithChildren(n.tokens,t),i=[];return e.length>0&&i.push({id:et(),type:"text",text:e}),i.push(...r),i}function zz(n,t){const{text:e,children:r}=t.tokensToTextWithChildren([n],t),i=[];return e.length>0&&i.push({id:et(),type:"text",text:e}),i.push(...r),i}function Gz(n,t){const e=typeof n.start=="number"?n.start:1,r=n.ordered,i=et(),o=[];return n.items.forEach((l,c)=>{const d={...t,listLevel:t.listLevel+1},{text:h,children:C}=t.tokensToTextWithChildren(l.tokens,d);let E;typeof l.checked=="boolean"&&(E=l.checked?"checked":"unchecked");const x={id:et(),type:"list",groupId:i,ordered:r,checkbox:E,start:e+c,text:h,level:t.listLevel};o.push(x),o.push(...C)}),o}function Wz(n,t){const e=t.tokensToBlocks(n.tokens,t);return e.forEach(r=>{r.quoted=!0}),e}const lw=100,qz=20,Xz=600;function Yz(n,t){const e=t.text;if(e){const r=de(e);return Math.min(qd(r,n)+qz,Xz)}return lw}function aw(n,t){let e=lw;return t.forEach(r=>{e=Math.max(e,Yz(n,r))}),e}function Qz(n,t){var l,c;const e=n.header.length,r=n.rows.length+1,i=[],o=Array(e).fill(100);for(let d=0;d<r;d++){let h;d===0?h=n.header:h=n.rows[d-1];for(let C=0;C<e;C++){const E=h[C],x=(l=E==null?void 0:E.tokens)!=null?l:[],B=et();i.push(B);let k;if(x.length===0)k=[gh()];else if(lc(x[0]))k=t.tokensToBlocks(E.tokens,t),k.length===0&&k.push(gh());else{const{text:w,children:U}=t.tokensToTextWithChildren(E.tokens,t);k=[{id:et(),type:"text",text:w},...U]}t.doc.blocks[B]=k,o[C]=Math.max(o[C],aw((c=t.font)!=null?c:"",k))}}return[{id:et(),type:"table",cols:e,rows:r,colsWidth:o,children:i}]}function Jz(n){return[{id:et(),type:"embed",embedType:"hr",embedData:{}}]}function Zz(n,t){const e=n.text;if(!e)return[];try{const c=n.text,d=Jc(c),h=JSON.parse(d);if(h){const{root:C,...E}=h.blocks;return t.doc.blocks={...t.doc.blocks,...E},C}}catch{}const r=D.t("code.plainText");if(r==="mermaid")return[{id:et(),type:"embed",embedType:"mermaid",embedData:{mermaidText:e}}];if(r==="plantuml")return[{id:et(),type:"embed",embedType:"plantuml",embedData:{plantumlText:e}}];if(r==="flow"||r==="flowchart")return[{id:et(),type:"embed",embedType:"flowchart",embedData:{flowchartText:e}}];const o=e.split(`
|
|
669
669
|
`).map(c=>({id:et(),type:"text",text:ol(c)})),s=t.doc,l=et();return s.blocks[l]=o,[{id:et(),type:"code",language:r,children:[l]}]}function tG(n){return[{id:et(),type:"embed",embedType:"image",embedData:{src:n.href,title:n.title}}]}function eG(n,t){const{text:e,children:r}=t.tokensToTextWithChildren(n.tokens,t),i=[];return e.length>0&&i.push({id:et(),type:"text",text:e}),i.push(...r),i}function nG(n){const t=n.formula;return t?[{id:et(),type:"embed",embedType:"math",embedData:{mathjaxText:t}}]:[]}const cw=I("markdown-to-doc");function rG(n,t){var e;if(n.type==="heading")return Hz(n,t);if(n.type==="paragraph")return jz(n,t);if(n.type==="list")return Gz(n,t);if(n.type==="blockquote")return Wz(n,t);if(n.type==="table")return Qz(n,t);if(n.type==="hr")return Jz();if(n.type==="code")return Zz(n,t);if(n.type==="image")return tG(n);if(n.type==="link")return eG(n,t);if(n.type==="latex-block")return nG(n);if(n.type==="text")return zz(n,t);if(n.type==="space"){const r=n.raw.replaceAll(" ",""),i=Math.floor(r.split(`
|
|
@@ -721,7 +721,7 @@ ${s}
|
|
|
721
721
|
`}})}class gG{constructor(t){m(this,"_grid",[]);m(this,"_needFixSpanData",!1);Array.from(t.rows).forEach((e,r)=>{Array.from(e.cells).forEach(i=>{this._addCell(r,i)})})}_addCell(t,e){const r=this._getNextColIndex(t),i=e.colSpan,o=e.rowSpan;for(let s=0;s<o;s++)for(let l=0;l<i;l++){const c=t+s,d=r+l;if(this._getCell({row:c,col:d})){this._needFixSpanData=!0,console.warn(`invalid table data, cell data already exists, ${c}, ${d}`);continue}this._setCell({row:c,col:d},{cell:e,virtual:!(l===0&&s===0)})}}_getNextColIndex(t){const e=this._grid[t];if(!e)return 0;let r=0;for(let i=0;i<e.length;i++)if(e[i])r+=1;else return r;return r}_setCell(t,e){if(!(e.cell.colSpan===0||e.cell.rowSpan===0)){for(;this._grid.length<=t.row;)this._grid.push([]);for(let r=0;r<this._grid.length;r++){const i=this._grid[r];for(;i.length<=t.col;)i.push(null)}this._grid[t.row][t.col]=e}}_getCell(t){var r;const e=this._grid[t.row];return e&&(r=e[t.col])!=null?r:null}get rowCount(){return this._grid.length}get colCount(){return this._grid[0].length}getCellData(t){const e=this._getCell(t);return e||null}getCellSpan(t){const e=this._getCell(t);if(!e)return{colSpan:1,rowSpan:1};if(e.virtual)return{colSpan:1,rowSpan:1};const r=()=>{let l=t.col+1;for(;;){const c=this._getCell({row:t.row,col:l});if(!c||c.cell!==e.cell)return l-t.col;l+=1}},i=()=>{let l=t.row+1;for(;;){const c=this._getCell({row:l,col:t.col});if(!c||c.cell!==e.cell)return l-t.row;l+=1}},o=r(),s=i();return o!==e.cell.colSpan&&console.warn(`invalid colSpan: ${o} -> ${e.cell.colSpan}`),s!==e.cell.rowSpan&&console.warn(`invalid rowSpan: ${s} -> ${e.cell.rowSpan}`),{colSpan:o,rowSpan:s}}getColumnWidth(t){const i=Array(this.rowCount).fill(0).map((s,l)=>{const c=this.getCellData({row:l,col:t});if(c&&!c.virtual){const d=c.cell.getAttribute("width")||c.cell.style.width;if(d){if(d.endsWith("%")){const C=d.substr(0,d.length-1),E=Number.parseInt(C,10);if(E>0&&E<=100)return Math.floor(720*E/100)}const h=Number.parseInt(d,10);if(h)return h}return c.cell.getBoundingClientRect().width}return 1e9}),o=Math.min(...i);return o===1e9||Number.isNaN(o)||o<30?0:o}}function pG(n){return new gG(n)}function dw(n,t){var c;const e=pG(n),r=[],i={},o=e.rowCount,s=e.colCount,l=Array(s).fill(100);for(let d=0;d<o;d++)for(let h=0;h<s;h++){let C;const E=e.getCellData({row:d,col:h});if(E&&E.virtual)continue;E&&!E.virtual&&(C=t.htmlToBlocks(E.cell.innerHTML.trim(),t)),(!C||C.length===0)&&(C=[{id:et(),type:"text",text:[]}]);const x=et();r.push(x);const{colSpan:B,rowSpan:k}=e.getCellSpan({row:d,col:h});k>1&&(i[`${x}_rowSpan`]=k),B>1&&(i[`${x}_colSpan`]=B),t.doc.blocks[x]=C,E&&!E.virtual&&(l[h]=Math.max(l[h],aw((c=t.font)!=null?c:"",C)))}for(let d=0;d<e.colCount;d++)l[d]=e.getColumnWidth(d)||l[d];return r.length===0?[]:[{cols:e.colCount,rows:e.rowCount,id:et(),type:"table",children:r,...i,colsWidth:l}]}function hw(n,t){var e;if(n.tagName==="TABLE"){const r={blocks:{root:[]},meta:{},comments:{}},i=dw(n,{doc:r,...t});if(i.length===0||((e=i[0].children)==null?void 0:e.length)===0)return;r.blocks.root=i;const o=JSON.stringify(r),s=hi(o),l=document.createElement("div");l.classList.add("highlight-text-wizdoc");const c=document.createElement("pre");l.appendChild(c),c.innerText=s,n.insertAdjacentElement("beforebegin",l),n.remove();return}Array.from(n.children).forEach(r=>hw(r,t))}function mw(n){if(n instanceof HTMLStyleElement){n.remove();return}Array.from(n.children).forEach(mw)}function gw(n){if(n instanceof HTMLElement){if(n.style.display==="none"){n.remove();return}if(n.style.visibility==="hidden"){n.remove();return}}Array.from(n.children).forEach(gw)}function CG(n,t){const e=Wd(n);return e.querySelectorAll("td.js-line-number").forEach(i=>i.remove()),e.querySelectorAll("div.copy-button").forEach(i=>i.remove()),e.querySelectorAll("div.code-copy-button").forEach(i=>i.remove()),e.querySelectorAll("noscript").forEach(i=>i.remove()),Array.from(e.children).forEach(gw),Array.from(e.children).forEach(i=>hw(i,t)),Array.from(e.children).forEach(mw),fw(e),iv(e)}const Ii=new r9.default;Ii.use(lG),Ii.use(aG),Ii.use(cG),Ii.use(uG),Ii.use(fG),Ii.use(dG),Ii.use(hG),Ii.use(mG),Ii.use(z6.gfm);function EG(n,t){const e=pw(n,t);if(!e)return[];const{root:r,...i}=e.blocks;return t.doc.blocks={...t.doc.blocks,...i},r}function pw(n,t){let e=n;const r=new DOMParser().parseFromString(n,"text/html").querySelectorAll("meta");if(r.length&&Array.from(r).some(o=>o.getAttribute("content")==="PowerPoint.Slide")){const o=n.indexOf("<!--StartFragment-->"),s=n.indexOf("<!--EndFragment-->");o!==-1&&s!==-1&&(e=n.substring(o+20,s))}const i=Ii.turndown(e);return uw(i,{htmlToDoc:o=>Cw(o,t)})}function Cw(n,t){const e=CG(n,{font:t==null?void 0:t.font,htmlToBlocks:EG});return pw(e)}function Ew(n){return n.indexOf('xmlns:o="urn:schemas-microsoft-com:office:office"')!==-1}function KE(n){return["A","B","DEL","I","U","S","SPAN","SUB","SUP","FONT","BR"].indexOf(n.tagName)!==-1}function xG(n){return["P","H1","H2","H3","H4","H5","H6","H7","H8","LI"].indexOf(n.tagName)!==-1}function xw(n){return n.replace(/\r\n\s*/g,"").replace(/\n\s*/g,"").replace(/\r\s*/g,"")}function AG(n){if(!n.tagName)return!1;if(n.tagName.toLocaleLowerCase()==="img")return!0;const t=n.querySelectorAll("img");for(let e=0;e<t.length;e+=1){const r=t[e];if(!r.src||r.getAttribute("width")==="0"||r.getAttribute("height")==="0")return!1}return t.length}function bG(n){return(n.tagName.toLocaleLowerCase()==="img"?[n]:Array.from(n.querySelectorAll("img"))).map(i=>({id:et(),type:"embed",embedType:"image",embedData:{src:i.src,width:i.width,height:i.height}}))}function Aw(n){var e;return Array.from(((e=n.getAttribute("style"))!=null?e:"").split(" ")).findIndex(r=>r.startsWith("level"))!==-1}function vG(n){var e;const t=Array.from(((e=n.getAttribute("style"))!=null?e:"").split(" "));for(let r=0;r<t.length;r++){const i=t[r];if(i.startsWith("mso-list:"))return i}return""}function bw(n){var e,r;const t=Array.from(((e=n.getAttribute("style"))!=null?e:"").split(" "));for(let i=0;i<t.length;i++){const o=t[i];if(o.startsWith("level")){const s=(r=Number.parseInt(o.substring(5),10))!=null?r:void 0;if(s)return s}}return 1}function BG(n,t){n.setAttribute("data-group-id",t)}function TG(n){const t={},e=i=>{Array.from(Object.keys(t)).forEach(o=>{Number.parseInt(o,10)>i&&delete t[o]})};let r="";Array.from(n.children).forEach(i=>{if(Aw(i)){const o=vG(i);r!==o&&(e(0),r=o);const s=bw(i);e(s);let l=t[`${s}`];l||(l=et(),t[`${s}`]=l),BG(i,l)}})}function vw(n){const t=n.querySelector('[style="mso-list:Ignore"]');if(t){const e=t.innerText;return e&&e.trim()!=="-"}return!0}function yG(n){var r;if(!vw(n))return 1;const e=n.querySelector('[style^="mso-list:Ignore"]');if(e){const i=e.innerText;if(i)return(r=Number.parseInt(i,10))!=null?r:1}return 1}function Bw(n){if(!Aw(n))return{};const t=bw(n),e=n.getAttribute("data-group-id")||et();return{start:yG(n),level:t,groupId:e,ordered:vw(n),type:"list"}}const kG=I("office-list");function Tw(n){return n instanceof HTMLOListElement||n instanceof HTMLUListElement}function RG(n,t){p(kG,Tw(n),"not list group element");let e=!1,r=1;const i=et();n instanceof HTMLOListElement&&(e=!0,r=n.start);const o=n,s=[];let l;return Array.from(o.children).forEach(c=>{if(c instanceof HTMLLIElement){const h=Bw(c),C=t.textElementToBlocks(c,t);l||(l=h.level);const E=C[0];s.push({...E,type:"list",ordered:e,level:l,groupId:i,start:r}),r+=1,s.push(...C.slice(1));return}const d=t.blockElementToBlocks(c,t);s.push(...d)}),s}function yw(n,t){if(n.nodeName==="META")return[];if(n instanceof HTMLTableElement)return dw(n,t);if(Tw(n))return[...RG(n,t)];if(AG(n))return[...bG(n)];if(xG(n))return[...t.textElementToBlocks(n,t)];if(!n.children)return[];const e=[];return Array.from(n.children).forEach(r=>{const i=yw(r,t);e.push(...i)}),e}function kw(n,t){const e=[];return n.forEach(r=>{var i;if(r instanceof Element)if(KE(r)){const o=document.createElement("p");o.appendChild(r);const s=t.blockElementToBlocks(o,t);e.push(...s)}else{const o=t.blockElementToBlocks(r,t);e.push(...o)}else if(r instanceof Text){const o=Ai(xw((i=r.textContent)!=null?i:""));e.push(o)}}),e}function Rw(n){return n instanceof Element?KE(n):n.nodeType===Node.TEXT_NODE}function wG(n){var t;return n.nodeType===Node.TEXT_NODE&&((t=n.textContent)==null?void 0:t.trim())===""}function ww(n){const t=Array.from(n.childNodes);for(let e=0;e<t.length;e++){const r=t[e];if(!Rw(r))continue;let i=e+1;for(;i<t.length&&Rw(t[i]);)i+=1;if(wG(r)&&i===e+1)continue;const o=document.createElement("p");r instanceof Element?r.insertAdjacentElement("beforebegin",o):n.insertBefore(o,r);for(let s=e;s<i;s++)o.appendChild(t[s]);e=i-1}}function SG(n,t){const e=Wd(n);return ww(e),kw(Array.from(e.childNodes),t)}function LG(n){if(!(n instanceof HTMLElement))return{};const t={};if(n.style.textAlign==="right"?t.align="right":n.style.textAlign==="center"&&(t.align="center"),n.style.marginLeft){const e=Math.ceil(Number.parseInt(n.style.marginLeft,10)/20);e>=1&&e<=12&&(t.padding=e)}return t}function IG(n,t){return t&&Object.keys(t).length>0?{insert:n,attributes:t}:{insert:n}}function DG(n,t){if(n.nodeName==="B")return{...t,"style-bold":!0};if(n.nodeName==="I")return{...t,"style-italic":!0};if(n.nodeName==="U")return{...t,"style-underline":!0};if(n.nodeName==="S"||n.nodeName==="DEL")return{...t,"style-strikethrough":!0};if(n.nodeName==="SUB")return{...t,"style-sub":!0};if(n.nodeName==="SUP")return{...t,"style-super":!0};if(n.nodeName==="BR")return{...t,created:Date.now(),id:et(),box:!0,type:"br"};if(n.nodeName==="A"&&n.href){const r=n.href;if(r.startsWith("http:")||r.startsWith("https:"))return{...t,link:n.href}}const e={...t};return n instanceof HTMLSpanElement?(n.style.backgroundColor&&(e["inline-style-background-color"]=n.style.backgroundColor),n.style.color&&(e["inline-style-color"]=n.style.color),n.style.fontSize&&(e["inline-style-font-size"]=n.style.fontSize),n.style.fontFamily&&(e["inline-style-font-family"]=n.style.fontFamily),e):t}function Sw(n,t,e){var i;if(n instanceof HTMLSpanElement&&n.getAttribute("style")==="mso-list:Ignore")return;const r=DG(n,t);if(n instanceof Text&&n.nodeValue||n.nodeName==="BR"){const o=xw((i=n.nodeValue)!=null?i:" ");o&&e.push(IG(o,r));return}n.childNodes.length>0&&Array.from(n.childNodes).forEach(o=>{Sw(o,r,e)})}function Lw(n){return n instanceof Element?KE(n):!0}function VE(n){return!Lw(n)}function _G(n){if(n.length===0)return[];if(n.length===1)return[n];const t=[];let e=[n[0]],r=VE(n[0]);for(let i=1;i<n.length;i++){const o=n[i];r===VE(o)?e.push(o):(t.push(e),e=[o],r=VE(o))}return t.push(e),t}function MG(n,t){const e={};if(n.tagName.startsWith("H")){const o=Number.parseInt(n.tagName.substr(1),10);o>=1&&o<=8&&(e.heading=o)}const r=_G(Array.from(n.childNodes)),i=[];return r.forEach((o,s)=>{if(Lw(o[0])){const l=[],c={};Array.from(n.childNodes).forEach(h=>{Sw(h,c,l)});let d={};s===0&&(d=Bw(n)),i.push({id:et(),type:"text",text:l,...d,...e,...LG(n)})}o.forEach(l=>{const c=t.blockElementToBlocks(l,t);i.push(...c)})}),i}function UG(n,t){const e=Wd(n);TG(e),ww(e);const r={blocks:{root:[]},meta:{},comments:{}},i={font:t==null?void 0:t.font,doc:r,blockElementToBlocks:yw,textElementToBlocks:MG,htmlToBlocks:SG},o=kw(Array.from(e.children),i);if(o.length!==0)return r.blocks.root=o,r}const OG=I("html-to-doc");function Iw(n,t){if(!n)return null;const e=_z(n);if(e)return e;if(Ew(n)){const r=UG(n,t);if(r)return r}try{return Cw(n,t)}catch(r){OG.error(r)}return null}class NG{async fromData(t,e){const r={},i=e.getData("text/html");if(i){const o=Iw(i,{font:t.rootContainer});o&&(Ew(i)?r["text/office-html"]=o:r["text/html"]=o)}return r}}class PG{async fromData(t,e){const r=e.getData("text/plain");if(!r)return;const i=uw(r,{font:t.rootContainer,htmlToDoc:Iw});if(!!i)return{"text/markdown":i}}}function FG(n){return/^([\d\w\u4e00-\u9fa5\s]*[\u4e00-\u9fa5\s]{1}|)((https|http|ftp)?:\/\/)[^\s]+/.test(n)}function KG(n){const t=[],e=n.split(/https|http|ftp/)[0],r=n.substring(e.length).trim();if(e&&e.length){const o=Er(e,null);t.push(o,Er(" ",null))}const i=Er(r,{link:r});return t.push(i,Er(" ",null)),t}class VG{async fromData(t,e,r){const{toPlainText:i=!1}=r||{},o={},s=e.getData("text/plain");if(s){const d={blocks:{root:s.replace(/\r\n/g,`
|
|
722
722
|
`).replace(/\r/g,`
|
|
723
723
|
`).split(`
|
|
724
|
-
`).map(h=>{const C={id:et(),type:"text"};if(FG(h)&&!i)return C.text=KG(h),C;const E=h?[Er(h,null)]:[];return C.text=E,C})},meta:{},comments:{}};o["text/plain"]=d}return o}}function $G(n){const t=[];for(let e=0;e<n.length;e++){const r=n[e];r.type.toLocaleLowerCase().startsWith("image/")&&t.push(r)}return t}class $E{constructor(t){t.dataConverter.addConverter(new NG),t.dataConverter.addConverter(new VG),t.dataConverter.addConverter(new PG)}async handleBeforePaste(t,e,r,i){if(!e)return!1;const o=e.clipboardData;if(o){if(o.getData("text/html").indexOf("<ones-editor-doc")>0)return!1;const l=o.getData("text/plain"),c=$G(i);if(c.length>0&&!l&&!r["text/office-html"])return await this.handleInsertImages(t,c),!0}return!1}async handleInsertImages(t,e){const{start:r,end:i}=t.selection.range,o=t.selection.focusedBlock;let s=it(o),c=vt(o);const d=Z(s);if(d&&Dt(d)==="code")return;if(r.blockId===i.blockId&&pe(o))c+=1;else{t.clearSelectedContents();const{blockId:C}=t.selection.range.start,E=t.getBlockById(C);c=vt(E),s=it(E),se(t,E)||(c+=1),qt(s)&&c===0&&(c+=1)}const h=ct(s);for(let C=0;C<e.length;C++){const E=e[C],x=await l1(t,"image",h,c+C,{file:E});x&&zv(t,x,"image",{id:"replace-image",name:"Replace image",data:{block:x,image:E}})}}}class HG extends ye.TypedEmitter{constructor(t){super(),this.editor=t}onUpdateBlockText(t,e,r){const i=this.editor.getCustom("find-dialog");if(!i||!i.isVisible())return;const o=zo(Ur(this.editor,t),e);!rt(this.editor,o)||!r.some(l=>l.insert||l.delete)||this.emit("onDocChanged",o)}onInsertBlock(t,e,r,i){this.emit("onDocInserted")}onDeleteBlock(t,e,r){const i=zo(Ur(this.editor,t),e);this.emit("onDocDeleted",i)}}function Dw(n){return ie.isSafari&&!!n&&Date.now()-n<100}const _w=I("highlight-data");class Z0{constructor(t){m(this,"data",new Map);this.editor=t}add(t,e,r){const i={id:et(),blockId:lt(t),oldText:this.editor.getBlockText(t),start:e,end:r};return this.data.set(i.id,i),i}get(t){const e=this.data.get(t);return p(_w,e,`no highligh data: ${t}`),e}remove(t){this.data.delete(t)}clearBlockData(t){Array.from(this.data.values()).forEach(e=>{e.blockId===t&&this.data.delete(e.id)})}destroy(){}static getData(t){return t.addCustom("highligh-data",()=>new Z0(t))}}function jG(n,t,e,r,i){const s=Z0.getData(n).add(t,e,r);return i.setAttribute("data-highlight-id",s.id),s}function tm(n,t){const e=t.getAttribute("data-highlight-id");return p(_w,e,"invalid highlight elem, no id"),Z0.getData(n).get(e)}const bl=I("highligh-dom");function zG(n){return wt(n,"editor-highlight")}function go(n){const t=n.rootContainer.querySelectorAll(".editor-highlight");return Array.from(t)}function GG(n,t){p(bl,t,"invalid block");const e=t.querySelectorAll(".editor-highlight");return Array.from(e)}function WG(n){const t=n.rootContainer.querySelectorAll(".editor-replace-result-highlight");return Array.from(t)}function em(n){const t=n.querySelectorAll(".editor-highlight");return Array.from(t)}function qG(n){em(n).forEach(t=>{t.remove()})}function Mw(n){return go(n).length}function xs(n){const t=n.rootContainer.querySelectorAll(".editor-highlight");return Array.from(t).map(r=>{const i=wt(r,"editor-highlight-box")?"box":"text";return{ele:r,type:i}})}function XG(n,t){p(bl,t>=0,`invalid highlight index: ${t}`);const e=go(n);return e.length===0?null:(p(bl,t<e.length,`invalid highlight index: ${t}/${e.length}`),e[t])}function YG(n,t,{left:e,top:r,width:i,height:o},s){const l=["editor-highlight-child"];s&&l.push("editor-highlight-readonly");const c=v("div",l,n);c.style.top=`${r}px`,c.style.left=`${e}px`,c.style.width=`${i}px`,c.style.height=`${o}px`}function Uw(n,t,e,r,i){p(bl,r>0,`invalid end: ${r}`);const o=oe(t),s=t.getBoundingClientRect(),l=Yi(n,t,ve(n,t,e,r)),c=i==="find"?["editor-highlight"]:["editor-replace-result-highlight"],d=uu(t,r),{prev:h}=d;h||p(bl,!1,"invalid offset, no prev child at offset"),Qn(h)&&c.push("editor-highlight-box");const C=v("div",c,o);l.forEach(E=>{YG(C,t,{left:E.left-s.left,width:E.width,top:E.top-s.top,height:E.height})}),jG(n,t,e,r,C)}function QG(n,t,e,r){return Uw(n,t,e,r,"find")}function Ow(n,t,e,r){return Uw(n,t,e,r,"replace")}function nm(n,t){go(n).forEach(s=>{wt(s,"active")&&ot(s,"active")}),z(t,"active"),p(bl,t.firstChild instanceof HTMLElement,"invalid highligh dom, invalid elem child");const r=t.firstChild;let o=r.getBoundingClientRect().y;o===0&&(o=r.getBoundingClientRect().y),xu(n,r,{animation:!0})}function Rf(n){const t=n.rootContainer.querySelector(".editor-highlight.active");return t||null}function Nw(n){return p(bl,n,"no highlight elem"),wt(n,"editor-highlight-readonly")}const ac=I("highligh-text");function Pw(n){WG(n).forEach(e=>{e.remove()})}function rm(n,t){go(n).forEach(r=>{r.remove()}),t!=null&&t.keepReplaceResult||Pw(n)}function Fw(n,t,e){GG(n,t).forEach(i=>{i.remove()}),e!=null&&e.keepReplaceResult||Pw(n)}function wf(n){const t=Rf(n);if(!t)return-1;const r=go(n).indexOf(t);return p(ac,r!==-1,`invalid highlight index: ${r}`),r}function JG(n){const t=go(n);if(t.length===0)return 0;const e=Rf(n);let r=e?t.indexOf(e):-1;!e||r===-1||r===t.length-1?r=0:r+=1;const i=t[r];return nm(n,i),r}function ZG(n){const t=go(n);if(t.length===0)return 0;const e=Rf(n);let r=e?t.indexOf(e):-1;!e||r===-1||r===0?r=t.length-1:r-=1;const i=t[r];return nm(n,i),r}function HE(n,t){const e=go(n);e.length>0&&t<e.length&&nm(n,e[t])}function tW(n,t,e){const r=Rf(n);if(!r)return!1;const i=Z(r);if(p(ac,i,"no parent block"),!n.isBlockWritable(i))return!1;const o=Mw(n);let s=wf(n);if(!Nw(r)&&n.isBlockWritable(i)){const d=tm(n,r),h=n.getBlockText(i),{start:C,end:E}=tm(n,r),[x,B]=pn.transformOffset(d.oldText,h,[C,E]),k=$3(h,x,B-x);if(de(k).toLowerCase()!==t.toLowerCase())return!1;const w=mh(h,x,B,e);n.setBlockText(i,w),qG(i),jE(n,i,t),e&&Ow(n,i,x,x+e.length)}const l=Mw(n);s>=l?s=0:l>o&&(s+=1);const c=XG(n,s);return c&&nm(n,c),!0}function eW(n,t,e,r){if(!rt(n,t)||!n.isBlockWritable(t))return 0;const i=n.getBlockText(t);p(ac,i,"no block text");const o={count:0},s=K5(n,i,e,r,o);return de(i)===de(s)?0:(n.setBlockText(t,s),o.count)}function nW(n,t,e){if(p(ac,zG(t),"not a highlight elem"),Nw(t))return;p(ac,e>0,"invalid highlight length");const r=tm(n,t),i=Z(t);p(ac,i,"no parent block"),Ow(n,i,r.start,r.start+e)}function rW(n,t){xs(n).forEach(r=>{r.type!=="box"&&nW(n,r.ele,t)})}function iW(n,t,e){if(n.readonly)return 0;const r=o=>{let s=0;return fe(o).forEach(c=>{It(n,c)?an(n,c).forEach(h=>{s+=r(h)}):s+=eW(n,c,t,e)}),s},i=r(n.rootContainer);return e.length>0&&rW(n,e.length),i}function oW(n){const t=n.selection.range.end,e=n.getBlockById(t.blockId),r=t.isSimple()?t.offset:1,i=em(e);for(let l=0;l<i.length;l++){const c=i[l],{end:d}=tm(n,c);if(d>=r)return c}const o=E1(n,{simpleBlockOnly:!0}),s=o.indexOf(e);if(s===-1)return null;for(let l=s+1;l<o.length;l++){const c=o[l],d=em(c);if(d.length>0)return d[0]}return null}function sW(n){const t=go(n),e=oW(n);return e?t.indexOf(e):0}function jE(n,t,e){if(!!e&&rt(n,t)){const r=n.getBlockText(t),i=hp(n,r,e);i.length>0&&i.forEach(({start:o,end:s})=>{QG(n,t,o,s)})}}function Kw(n,t){if(rm(n),!t)return;E1(n,{simpleBlockOnly:!0,visibleOnly:!0}).forEach(r=>{jE(n,r,t)})}class lW{constructor(t){m(this,"dialog",null);m(this,"root");m(this,"oldText","");m(this,"_compositionEndTime",0);m(this,"components");m(this,"handleFindChanged",()=>{this.doSearch({keepReplaceResult:!1,gotoFirstSearchResult:!0})});m(this,"handleCompositionEnd",()=>{this._compositionEndTime=Date.now(),this.handleFindChanged()});m(this,"handleDocChanged",t=>{setTimeout(()=>{if(qc(t))return;Fw(this.editor,t),jE(this.editor,t,this.components.findInput.value);const e=xs(this.editor),r=e.length;t.querySelectorAll(".editor-highlight").length===r&&HE(this.editor,0);const i=wf(this.editor);i!==-1&&this.updateSearchStatus(i,e)})});m(this,"handleDocInserted",()=>{const t=setTimeout(()=>{clearTimeout(t),rm(this.editor,{keepReplaceResult:!0}),Kw(this.editor,this.components.findInput.value);const e=wf(this.editor);if(e!==-1){const r=xs(this.editor);this.updateSearchStatus(e,r),HE(this.editor,e)}})});m(this,"handleDocDeleted",t=>{const e=setTimeout(()=>{if(!em(t).length){clearTimeout(e);return}Fw(this.editor,t);const i=wf(this.editor);if(i!==-1){const o=xs(this.editor);this.updateSearchStatus(i,o)}})});m(this,"handleInput",t=>{if(t.isComposing||Dw(this._compositionEndTime)){this.doSearch.cancel();return}this.handleFindChanged()});m(this,"handleFind",()=>{this.findNext({keepSearchResult:!1})});m(this,"handleReplace",()=>{const t=this.components.findInput.value;if(!t||!Rf(this.editor))return;const r=this.components.replaceInput.value;if(t===r)return;if(tW(this.editor,t,r)){const o=wf(this.editor),s=xs(this.editor);this.updateSearchStatus(o,s)}r.includes(t)&&this.findNext({keepSearchResult:!0})});m(this,"handleReplaceAll",()=>{const t=this.components.findInput.value;if(!t)return;const e=this.components.replaceInput.value;t!==e&&this.editor.undoManager.runInGroup(()=>{iW(this.editor,t,e)>0&&(this.oldText="",this.doSearchNow({keepReplaceResult:!0,gotoFirstSearchResult:!0}))})});m(this,"doSearch",ke.default(this.doSearchNow,300));m(this,"handleDocumentKeyDown",t=>{Gd(t)&&this.hide()});this.editor=t;const e=v("div",["editor-find-dialog"],null),r=v("div",["editor-find-content"],e),i=v("div",["editor-find-dialog-row"],r),o=Hs(qh,["editor-find-dialog-button-close"],e),s=v("label",["editor-find-dialog-label"],i,D.t("find.findLabel"));s.htmlFor="";const l=v("div",["editor-find-dialog-input-container"],i),c=v("input",["editor-find-dialog-input"],l);c.type="text",c.placeholder=D.t("find.findPlaceholder");const d=v("div",["editor-find-dialog-status"],l),h=Hs(fT,["editor-find-dialog-icon-button"],d),C=v("div",["editor-find-dialog-curr"],d,"0/0"),E=Hs(dT,["editor-find-dialog-icon-button"],d);let x;D.t("find.moreButton")?x=v("button",["editor-find-dialog-button"],i,D.t("find.moreButton")):x=Hs(zp,["editor-find-dialog-icon-button-border"],i);const B=v("div",["editor-find-dialog-row"],r),k=v("label",["editor-find-dialog-label"],B,D.t("find.replaceLabel"));k.htmlFor="";const w=v("div",["editor-find-dialog-input-container"],B),U=v("input",["editor-find-dialog-input"],w);U.type="text",U.placeholder=D.t("find.replacePlaceholder");const M=v("div",["editor-find-dialog-row","editor-find-dialog-action"],r);v("div",["editor-find-dialog-space"],M);const F=v("button",["editor-find-dialog-button"],M,D.t("find.findButton")),Y=v("button",["editor-find-dialog-button"],M,D.t("find.replaceButton")),X=v("button",["editor-find-dialog-button","editor-find-dialog-primary-button"],M,D.t("find.replaceAllButton"));x.onclick=()=>{this.showReplace()},o.onclick=()=>{this.hide()},c.onkeydown=st=>{if(st.isComposing||Dw(this._compositionEndTime)){this.doSearch.cancel();return}tv(st)?(this.doSearch.cancel(),this.doSearchNow({keepReplaceResult:!1,gotoFirstSearchResult:!0})):Gd(st)&&this.hide()},c.oninput=this.handleInput,c.onpaste=this.handleFindChanged,c.oncut=this.handleFindChanged,c.addEventListener("compositionend",this.handleCompositionEnd),c.maxLength=50,F.onclick=this.handleFind,Y.onclick=this.handleReplace,X.onclick=this.handleReplaceAll,U.maxLength=50,E.onclick=()=>{this.gotoNext()},h.onclick=()=>{this.gotoPrev()},this.components={findInput:c,findPrev:h,findCurrent:C,findNext:E,replaceInput:U,findButton:F,replaceButton:Y,replaceAllButton:X,closeButton:o,showReplaceButton:x,rowReplace:B,rowActions:M,statusContainer:d},this.root=e;const G=new HG(t);t.doc.registerCallback(G),G.addListener("onDocChanged",this.handleDocChanged),G.addListener("onDocInserted",this.handleDocInserted),G.addListener("onDocDeleted",this.handleDocDeleted)}findNext(t){this.doSearch.cancel(),this.doSearchNow({keepReplaceResult:t.keepSearchResult,gotoFirstSearchResult:!0})}doSearchNow(t){const e=this.components.findInput.value;if(e||this.clearFind(t),this.oldText===e){this.gotoNext();return}this.oldText=e,Kw(this.editor,e);const r=xs(this.editor),i=sW(this.editor);t.gotoFirstSearchResult&&HE(this.editor,i),this.updateSearchStatus(i,r)}gotoNext(){const t=JG(this.editor),e=xs(this.editor);this.updateSearchStatus(t,e)}gotoPrev(){const t=ZG(this.editor),e=xs(this.editor);this.updateSearchStatus(t,e)}updateSearchStatus(t,e){var s;this.oldText?this.components.statusContainer.style.display="flex":this.components.statusContainer.style.display="none";const r=e.length,i=e.filter(l=>l.type==="box").length,o=((s=e[t])==null?void 0:s.type)==="box";if(r-i<=0)r===0?(this.components.findCurrent.innerText="0 / 0",this.components.findButton.disabled=!0):(this.components.findCurrent.innerText=`${t+1} / ${r}`,this.components.findButton.disabled=!1),this.components.replaceAllButton.disabled=!0,this.components.replaceButton.disabled=!0;else{this.components.findCurrent.innerText=`${t+1} / ${r}`;const l=this.editor.readonly;this.components.replaceAllButton.disabled=l,this.components.replaceButton.disabled=l||o,this.components.findButton.disabled=!1}}clearFind(t){rm(this.editor),this.updateSearchStatus(0,[])}showFindOnly(){this.components.rowReplace.style.display="none",this.components.rowActions.style.display="none",this.components.showReplaceButton.style.display="flex"}showReplace(){this.components.rowReplace.style.display="flex",this.components.rowActions.style.display="flex",this.components.showReplaceButton.style.display="none",this.components.replaceInput.focus(),this.components.replaceInput.select()}hideSearchResult(){this.components.statusContainer.style.display="none"}showSearchResult(){this.components.statusContainer.style.display="flex"}show(t){document.addEventListener("keydown",this.handleDocumentKeyDown);const e=this.editor.getSelectedText();e.length>0&&e.length<50&&(this.components.findInput.value=e),this.root.style.display="flex",t!=null&&t.showFindAndReplace?(this.showReplace(),this.components.findInput.value&&setTimeout(()=>{this.components.replaceInput.focus()})):this.showFindOnly(),this.hideSearchResult(),this.oldText="",this.doSearchNow({keepReplaceResult:!1,gotoFirstSearchResult:!0});const r=this.editor.readonly,i=this.components.findInput.value;this.components.replaceButton.disabled=r||!i,this.components.replaceAllButton.disabled=r||!i,this.components.replaceInput.disabled=r,this.dialog||(this.dialog=new zu(this.root,{disablePageScroll:!1}));const o=this.editor.options.componentsOptions.findDialog,s=(o==null?void 0:o.popoverTarget)||this.editor.rootContainer,l=()=>{var E,x,B,k;const c=o==null?void 0:o.getReferenceClientRect;if(c&&((x=(E=this.dialog)==null?void 0:E.tippyInstance)==null?void 0:x.popper))return c(s,(k=(B=this.dialog)==null?void 0:B.tippyInstance)==null?void 0:k.popper);const d=s.getBoundingClientRect(),h=d.top<0?12:d.top+12,C=d.right-this.root.clientWidth-12;return new DOMRect(C,h,0,0)};this.dialog.show(s,{getReferenceClientRect:l}),setTimeout(()=>{this.components.findInput.focus(),this.components.findInput.select()},300)}hide(){var t;(t=this.dialog)==null||t.close("cancelBar"),rm(this.editor),document.removeEventListener("keydown",this.handleDocumentKeyDown)}isVisible(){return this.dialog&&this.dialog.isVisible}research(){this.oldText="",this.doSearch({keepReplaceResult:!0,gotoFirstSearchResult:!1})}destroy(){var t;(t=this.dialog)==null||t.destroy()}}const aW={find:{findLabel:"\u67E5\u627E:",replaceLabel:"\u66FF\u6362:",findButton:"\u67E5\u627E",replaceButton:"\u66FF\u6362",replaceAllButton:"\u5168\u90E8\u66FF\u6362",moreButton:"",findPlaceholder:"\u5728\u6587\u6863\u5185\u67E5\u627E",replacePlaceholder:"\u66FF\u6362\u4E3A"}},cW={find:{findLabel:"Search:",replaceLabel:"Replace:",findButton:"Search",replaceButton:"Replace",replaceAllButton:"Replace all",moreButton:"",findPlaceholder:"Search text in document",replacePlaceholder:"Replace with"}},uW={find:{findLabel:"\u691C\u7D22\uFF1A",replaceLabel:"\u7F6E\u63DB\uFF1A",findButton:"\u691C\u7D22",replaceButton:"\u7F6E\u63DB",replaceAllButton:"\u3059\u3079\u3066\u3092\u7F6E\u63DB",moreButton:"",findPlaceholder:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u691C\u7D22",replacePlaceholder:"\u306B\u7F6E\u63DB"}};D.mergeLang({"zh-CN":aW,"en-US":cW,"ja-JP":uW});function Vw(n){const t=n.addCustom("find-dialog",()=>new lW(n));return Jr(n)||t.show(),!0}const $w={"CtrlOrCmd+F":Vw},pat="";function fW(n){Vw(n)}const dW=I("context-menu-utils");async function hW(){try{const n=await navigator.clipboard.readText(),e=(await navigator.clipboard.read())[0].types;return!n.trim()&&e.length===1&&e.includes("text/plain")}catch(n){return dW.warn(`Failed to read clipboard data: ${n}`),!0}}function Hw(n,t){const e=document.createElement("a");e.href=n,e.download=t,e.click()}function mW(n){return new Promise((t,e)=>{const r=new FileReader;r.onload=()=>{const i=r.result;t(i)},r.onerror=()=>{e(new Error("Failed to read Blob as string."))},r.readAsText(n)})}async function gW(){const t=(await navigator.clipboard.read())[0],e=t.types,r=new DataTransfer;for(let i=0;i<e.length;i++){const o=e[i],s=await t.getType(o),l=await mW(s);r.setData(o,l)}return r}const jw=I("context-menu-actions");async function zw(n){n.inputHandlers.onCopyWithoutEvent()}async function pW(n){n.selection.range.isCollapsed()||xp(n)}async function CW(n){zw(n),wh(n)}function EW(n,t){p(jw,t,"block can not be null"),p(jw,pe(t),"block should be embed type");const e=[],r=n.getBlockData(t),i=r.embedType,o=n.editorEmbeds.getEmbedClass(i);if(o.getResources)o.getResources(n,r).forEach(s=>{e.push(s)});else{const l=r.embedData.src;l&&typeof l=="string"&&e.push(l)}return e}async function xW(n,t){const e=EW(n,t);if(e&&e.length){const r=e[0],i=n.doc.buildResourceUrl(r);Hw(i,r)}}function AW(n){gW().then(t=>{const e=new ClipboardEvent("paste",{clipboardData:t});document.dispatchEvent(e)})}const bW=I("context-menu");class vW{constructor(t){m(this,"t",D.t);m(this,"clipboardPermission",{read:"prompt",write:"granted"});m(this,"isSecureContext",window.isSecureContext);m(this,"externalActionHandleMap",new Map);m(this,"handleActionByExternal",t=>{const{data:e}=t;if(e&&e.externalType){const r=e.externalType,i=this.externalActionHandleMap.get(r);if(i)return i(this.editor,this.editor.selection.focusedBlock,t)}return!1});m(this,"getPasteCommandItem",async()=>{const t=this.hasClipboardReadPermission;let e;Wc()||$s()?e=!0:e=t?await hW():!1;const r=this.isSecureContext&&this.clipboardPermission.read!=="denied"&&!e,i=this.t("contextMenu.paste"),o=qe("CtrlOrCmd+V");let s=this.isSecureContext?"":this.secureEnvTips(o,i);return!s&&(!t||e)&&(s=this.t("copyCutProperty.limitedEnvTips",{shortCut:o})),{id:"paste",name:i,subText:o,states:r?[]:["disabled"],disableReason:s}});m(this,"getCommandItems",async()=>{const t=await this.getPasteCommandItem(),e=this.editor.readonly?[]:[this.cutCommandItem,t],r=[...this.copyTypeCommandItems,...e];return this.getExternalContextMenuOptions(r),r.push(this.stepItem,...this.selectionCommandItems),r});m(this,"getExternalContextMenuOptions",t=>{const e=this.editor.selection.focusedBlock,r=Qt(this.editor,e);if(r&&r.getBlockProperties){const i=r.getBlockProperties(this.editor,e);if(i){const{blockCommands:o}=i;if(o&&o["context-menu"]){const{commands:s,executeCommand:l,group:c}=o["context-menu"];if(s.length){const d=s.map(h=>({...h,data:{...h.data||{},externalType:c}}));t.push(this.stepItem,...d)}this.externalActionHandleMap.set(c,l)}}}});m(this,"isFocusImageBlock",()=>{const t=this.editor.selection,e=t.focusedBlock;return pe(e)&&$e(e)==="image"&&t.range.getSelectedBlocks().length===1});m(this,"isFocusImageTypeEmbed",()=>{const e=this.editor.selection.focusedBlock,r=["mermaid","flowchart","drawio"];return pe(e)&&r.includes($e(e))});this.editor=t,this.clipboardSupport()}get hasClipboardReadPermission(){return this.clipboardPermission.read==="granted"}get hasClipboardWritePermission(){return this.clipboardPermission.write==="granted"}clipboardSupport(){if(!navigator.clipboard){this.clipboardPermission={write:"denied",read:"denied"};return}if(!navigator.permissions){this.clipboardPermission={write:"granted",read:"denied"};return}try{const t=navigator.permissions.query({name:"clipboard-read"}),e=navigator.permissions.query({name:"clipboard-write"});Promise.all([t,e]).then(r=>{const i=r[0],o=r[1];this.clipboardPermission={read:i.state,write:o.state},i.state!=="granted"&&(i.onchange=s=>{this.clipboardPermission.read=s.target.state}),o.state!=="granted"&&(i.onchange=s=>{this.clipboardPermission.write=s.target.state})}).catch(r=>{this.clipboardPermission.read="denied",bW.log(r)})}catch{this.clipboardPermission={write:"granted",read:"denied"}}}get isRangeCollapsed(){return this.editor.selection.range.isCollapsed()}get imageTypeCommandItems(){const t=this.isSecureContext&&this.hasClipboardWritePermission;return[{id:"copy-image",name:this.t("contextMenu.copyImage"),subText:qe("CtrlOrCmd+C"),states:t?[]:["disabled"],disableReason:this.isSecureContext&&this.hasClipboardWritePermission?"":this.secureEnvTips(this.t("contextMenu.copyImage"),qe("CtrlOrCmd+C"))},{id:"copy-image-url",name:this.t("contextMenu.copyImageUrl"),states:t?[]:["disabled"]},{id:"image-save-as",name:this.t("contextMenu.imageSaveAs")},{id:"new-tab-open-image",name:this.t("contextMenu.newTabOpenImage")}]}get copyTypeCommandItems(){const t=this.isSecureContext&&!this.isRangeCollapsed;if(this.isFocusImageBlock())return this.imageTypeCommandItems;const e=this.t("copyCutProperty.copy"),r=qe("CtrlOrCmd+C"),i=[{id:"copy",name:e,subText:r,states:t?[]:["disabled"],disableReason:this.isSecureContext&&this.hasClipboardWritePermission?"":this.secureEnvTips(r,e)}];this.isFocusImageTypeEmbed()&&i.push({id:"image-save-as",name:this.t("contextMenu.imageSaveAs")});const s=this.t("contextMenu.copyMarkdown"),l=qe("CtrlOrCmd+Shift+C");return i.push({id:"copy-markdown",name:s,subText:l,states:t?[]:["disabled"],disableReason:this.isSecureContext&&this.hasClipboardWritePermission?"":this.secureEnvTips(l,s)}),i}get cutCommandItem(){let t=this.isSecureContext&&!this.isRangeCollapsed;const r=this.editor.selection.range.getSelectedBlocks().some(l=>!this.editor.isBlockWritable(l.block));r&&(t=!1);const i=this.t("copyCutProperty.cut"),o=qe("CtrlOrCmd+X");let s="";return t||(!this.isSecureContext||!this.hasClipboardWritePermission?s=this.secureEnvTips(o,i):r&&(s=this.t("contextMenu.uneditableBlockSelected"))),{id:"cut",name:this.t("copyCutProperty.cut"),subText:qe("CtrlOrCmd+X"),states:t?[]:["disabled"],disableReason:s}}get stepItem(){return{id:"step",name:"",type:"separator"}}get selectionCommandItems(){let t=!1;const e=this.editor.selection;e.range.isCollapsed()&&(t=!0),e.range.start.isSimple()&&e.range.end.isSimple()&&(t=e.range.start.offset>0&&e.range.getSelectedBlocks().length===1);const r=[{id:"select-block",name:this.t("contextMenu.selectBlock"),states:t?[]:["disabled"]}];return r.push({id:"select-all",name:this.t("contextMenu.selectAll")}),r}destroy(){this.externalActionHandleMap.clear()}secureEnvTips(t,e){return this.t("copyCutProperty.unsafeEnvTips",{shortCut:t,operation:e})}}const Cat="";class zE{constructor(t){m(this,"contextMenu");m(this,"contextMenuCommandItems");m(this,"destroy",()=>{this.contextMenuCommandItems.destroy(),this.contextMenu.off("show",this.handleContextMenuShown),this.contextMenu.off("click",this.handleContextMenuClick),this.contextMenu.off("close",this.handleContextMenuClose),document.removeEventListener("contextmenu",this.handleContextMenu)});m(this,"updateEditorCaret",t=>{const{x:e,y:r,target:i}=t,o=p1(this.editor,e,r);if(!o)return;const s=this.editor.getBlockById(o.focus.blockId),l=this.editor.selection.range;let c=!1;i instanceof HTMLImageElement&&Dt(s)==="embed"&&$e(s)==="image"?c=!1:l.isSimple()?c=l.getSelectedBlocks().some(d=>It(this.editor,d.block)?d.block.contains(s):d.block.id===(o==null?void 0:o.focus.blockId)&&d.start.offset<=o.focus.offset&&d.end.offset>=o.focus.offset):c=l.getSelectedContainers().some(h=>h.contains(s)),c||this.editor.selectionHandler.handleMouseDown(t,{autoScroll:!1})});m(this,"handleContextMenu",t=>{if(ie.isMobile||!this.editor.findCustom("editor-context-menu"))return;const r=t.target;if(this.editor.findCustom("toolbar-handler")&&this.editor.getCustom("toolbar-handler").isInToolbar(t)){t.preventDefault();return}if(this.editor.findCustom("block-menu")){const o=this.editor.getCustom("block-menu");if(o.blockMenu.isInMenu(r)||o.emptyBlockMenu.isInMenu(r)){t.preventDefault();return}}if(this.isInEditor(t)){t.preventDefault(),this.updateEditorCaret(t),this.contextMenu.manualShow(document.body,{theme:"light",point:{x:t.clientX,y:t.clientY}});return}this.isInMenu(t)&&t.preventDefault()});m(this,"isInMenu",t=>this.contextMenu.isInCommandBar(t.target));m(this,"isInEditor",t=>{const e=t.target;if(!e)return!1;let r=e.closest("div.editor-root"),i=this.editor.rootElement===r;if(!i&&e.classList.contains("editor-disable-scroll")){const s=Ae(t.x,t.y);r=(s==null?void 0:s.closest("div.editor-root"))||null,i=this.editor.rootElement===r}const o=t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement;return i&&!o});m(this,"handleContextMenuShown",async()=>{this.editor.findCustom("toolbar-handler")&&this.editor.getCustom("toolbar-handler").hide();const t=await this.contextMenuCommandItems.getCommandItems();this.contextMenu.updateItems(t)});m(this,"handleContextMenuClick",(t,e)=>{if(this.contextMenuCommandItems.handleActionByExternal(e))return;const{id:r}=e;switch(r){case"copy":zw(this.editor);break;case"copy-markdown":pW(this.editor);break;case"cut":if(this.handleImageEmbedAction(r))break;CW(this.editor);break;case"paste":AW(this.editor);break;case"copy-image":case"copy-image-url":case"image-save-as":case"new-tab-open-image":this.handleImageEmbedAction(r);break;case"select-all":Dh(this.editor,this.editor.rootContainer);break;case"select-block":dp(this.editor);break}});m(this,"handleContextMenuClose",()=>{this.editor.focus()});this.editor=t,this.contextMenu=new ls([],void 0,{id:`right-context-menu-${t.clientId}`,classes:[D.getCurrentLang()]}),this.contextMenu.on("show",this.handleContextMenuShown),this.contextMenu.on("click",this.handleContextMenuClick),this.contextMenu.on("close",this.handleContextMenuClose),document.addEventListener("contextmenu",this.handleContextMenu),this.contextMenuCommandItems=new vW(t)}handleImageEmbedAction(t){const e=this.editor.selection.focusedBlock;if(pe(e)&&$e(e)==="image"){const r=e,i=Ie.getImageObject(this.editor,r),o=i.getSelectedIndex(),s=i.getImages();if(o!==-1){let l=r.querySelectorAll("img")[o].src;if(l){switch(l=this.editor.doc.buildResourceUrl(l),t){case"cut":Q0(this.editor,null),J0(this.editor);break;case"copy-image":Q0(this.editor,null);break;case"copy-image-url":tu([{type:"text/plain",data:new Blob([l],{type:"text/plain"})}]);break;case"image-save-as":Hw(l,s[o].src);break;case"new-tab-open-image":window.open(l);break}return!0}}}else switch(t){case"image-save-as":xW(this.editor,e);break}return!1}}const BW={contextMenu:{copyMarkdown:"\u590D\u5236\u4E3A Markdown",paste:"\u7C98\u8D34",copyImage:"\u590D\u5236\u56FE\u7247",copyImageUrl:"\u590D\u5236\u56FE\u7247\u5730\u5740",imageSaveAs:"\u56FE\u7247\u53E6\u5B58\u4E3A",newTabOpenImage:"\u65B0\u6807\u7B7E\u9875\u6253\u5F00\u56FE\u7247",selectBlock:"\u9009\u4E2D\u533A\u5757",selectAll:"\u9009\u4E2D\u5168\u6587",uneditableBlockSelected:"\u9009\u4E2D\u533A\u57DF\u5305\u542B\u9501\u5B9A\u533A\u5757\uFF0C\u6682\u4E0D\u652F\u6301\u526A\u5207"}},TW={contextMenu:{copyMarkdown:"Copy as Markdown",paste:"paste",copyImage:"Copy image",copyImageUrl:"Copy image address",imageSaveAs:"Save image as",newTabOpenImage:"Open image in a new tab",selectBlock:"Select the block",selectAll:"Select all",uneditableBlockSelected:"The selected area contains locked blocks, and cutting is not currently supported"}},yW={contextMenu:{copyMarkdown:"Markdown \u3068\u3057\u3066\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051",copyImage:"\u753B\u50CF\u3092\u30B3\u30D4\u30FC",copyImageUrl:"\u753B\u50CF\u30A2\u30C9\u30EC\u30B9\u3092\u30B3\u30D4\u30FC",imageSaveAs:"\u540D\u524D\u3092\u4ED8\u3051\u3066\u753B\u50CF\u3092\u4FDD\u5B58",newTabOpenImage:"\u65B0\u3057\u3044\u30BF\u30D6\u3067\u753B\u50CF\u3092\u958B\u304F",selectBlock:"\u30D6\u30ED\u30C3\u30AF\u3092\u9078\u629E",selectAll:"\u30C6\u30AD\u30B9\u30C8\u3092\u5168\u9078\u629E",uneditableBlockSelected:"\u9078\u629E\u3057\u305F\u30A8\u30EA\u30A2\u306B\u30ED\u30C3\u30AF\u3055\u308C\u305F\u30D6\u30ED\u30C3\u30AF\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u5207\u308A\u53D6\u308A\u304C\u3067\u304D\u307E\u305B\u3093"}};D.mergeLang({"zh-CN":BW,"en-US":TW,"ja-JP":yW});function GE(n,t){return t.map(e=>{var o,s;const r=Qt(n,e),i=(o=r.getBlockProperties)==null?void 0:o.call(r,n,e);return pe(e)||It(n,e)?i!=null&&i.abstract?`[${i.abstract}]`:"":(s=i==null?void 0:i.abstract)!=null?s:""}).join(" ")}function im(n){const{editor:t,commentGroupId:e,abstract:r="text"}=n,i=et(),o=t.doc.getUser(),s=Date.now(),l=e!=null?e:i;return{id:i,groupId:l,userId:o.userId,displayName:o.displayName,avatarUrl:o.avatarUrl,abstract:r,created:s,modified:s}}function Gw(n,t,e){const r=e.id,o=n.getBlockData(t).comments;let s;o?s=[...o,r]:s=[r];const l={comments:s};n.updateBlockData(t,l)}function WE(n,t,e){const r=GE(n,[t]),i=im({editor:n,abstract:r});Gw(n,t,i);const o=io();return e.localCreateComment(i,o),i}const kW=I("standard-block-actions");class RW{constructor(t,e){m(this,"executeCommand",(t,e,r)=>{const i=r.data;try{this.editorComments.showCommentList();const o=t.getBlockById(i);WE(t,o,this.provider)}catch(o){kW.error(`failed to execute block command: ${JSON.stringify(o)}`)}});this.provider=t,this.editorComments=e}commands(t,e){const r=lt(e);return{group:"block-comment-actions",commands:[{id:"comment",name:D.t("comment.quickMenuCommand"),data:r,order:100,states:t.readonly?["disabled"]:[]}],executeCommand:this.executeCommand}}}class wW{async handleBeforePasteDoc(t,e){return Object.values(e.blocks).forEach(r=>{r.forEach(i=>{delete i.comments,i.text&&i.text.forEach(o=>{if(o.attributes){const s=o.attributes;Object.keys(s).forEach(l=>{l.startsWith("comment-")&&delete s[l]})}})})}),!1}}var ee=(n=>(n.SwitchUp="switch-up",n.SwitchDown="switch-down",n.CommentItemReply="comment-item-reply",n.CommentItemMore="comment-item-more",n.CommentItemOk="comment-item-ok",n.CommentItemCancel="comment-item-cancel",n.CommentItemDelete="comment-item-delete",n.CommentItemEdit="comment-item-edit",n.QuickReply="quick-reply",n.QuickReplyOk="quick-reply-ok",n.QuickReplyCancel="quick-reply-cancel",n))(ee||{});const qE="group-item-action",Ww="last-comment-item",SW="disabled",qw=500;function cc(n){return n.id!==n.groupId}function Xw(n,t=".comment-item-root"){return n.querySelectorAll(t).length}function LW(n){const t=n.closest(".comment-item-root");return t?t.id:null}function po(n,t){n.setAttribute(qE,t)}function IW(n){return n.closest(`[${qE}]`)}function DW(n){var t;return(t=n.getAttribute(qE))!=null?t:""}function _W(n){return n.disabled||n.classList.contains(SW)}function Yw(n,t){const e=n.rootContainer.querySelector(`[comment-${t.toLocaleLowerCase()}=${t}]`);if(!e)return null;const r=e.closest('[data-type="editor-block"]');return r?r.id:null}function Qw(n){return Array.from(n.attributes).map(e=>e.name).filter(e=>e.startsWith("comment-")).map(e=>e.replace("comment-",""))}const Jw=I("doc-comments");function Zw(n,t,e,r){if(t.comments){const o=t.comments;Array.isArray(o)&&o.forEach(s=>{r.has(s)||(r.add(s),e.push(s))})}t.text&&t.text.forEach(s=>{if(s.attributes){const l="comment-";Object.entries(s.attributes).forEach(([c,d])=>{if(c.startsWith(l)){const h=d;r.has(h)||(r.add(h),e.push(h))}})}});const i=t.children;!i||i.forEach(o=>{n.blocks[o].forEach(l=>{Zw(n,l,e,r)})})}function MW(n){const t=[],e=new Set;n.blocks.root.forEach(i=>{Zw(n,i,t,e)});const r=new Map;return t.forEach((i,o)=>r.set(i,o)),r}function UW(n){const t=new Map;n.forEach(i=>{if(cc(i)){const o=t.get(i.groupId);o?o.push(i):t.set(i.groupId,[i])}});const e=[];return n.forEach(i=>{var o;if(!cc(i)){const s=(o=t.get(i.id))!=null?o:[];t.delete(i.id);const l={...i,children:s};e.push(l)}}),Array.from(t.values()).forEach(i=>{const o=i[0],s=i.slice(1),l={...o,children:s};e.push(l)}),e}function As(n,t){const e=n.doc.toJSON(),r=MW(e);return UW(t.getComments()).filter(s=>r.has(s.groupId)).sort((s,l)=>{const c=r.get(s.groupId),d=r.get(l.groupId);return p(Jw,c!==void 0,`comment not exists in doc, ${s.groupId}`),p(Jw,d!==void 0,`comment not exists in doc, ${l.groupId}`),c-d})}function t4(n){const{children:t,...e}=n,r=[e];return t.forEach(i=>{r.push(i)}),r}function OW(n,t){return As(n,t).length}function XE(n,t){const e=[],r=n.getBlockById(t.blockId);if(rt(n,r)){const o=t.blockId,s=t.offset,l=n.getBlockById(o),c=n.getBlockText(l),d=Ba(c,s);d&&Object.entries(d).forEach(([h,C])=>{h.startsWith("comment-")&&e.push(C)})}const i=r.attributes;for(let o=0;o<i.length;o++){const s=i[o];s.name.startsWith("comment-")&&e.push(s.value)}return e}function e4(n){const t=n.selection.range;if(!t.isSimple())return[];if(t.start.blockId!==t.end.blockId)return[];if(t.isCollapsed())return XE(n,t.start);const{start:e,end:r}=t,i=XE(n,e),o=XE(n,r);return Rg.default(i,o)}const NW=I("active-comments");function n4(n,t){n.rootContainer.querySelectorAll(`span.comment[comment-${t}],[data-type=editor-block].comment[comment-${t}]`).forEach(r=>{ot(r,"active")})}function r4(n,t,e){const r=n.rootContainer.querySelector("span.comment.active,[data-type=editor-block].comment.active");if(!t)r&&Qw(r).forEach(o=>n4(n,o));else{const i=t.toLocaleLowerCase();if(r){const s=Qw(r);if(s.length===1&&s[0]===i)return;s.forEach(l=>n4(n,l))}const o=n.rootContainer.querySelectorAll(`span.comment[comment-${i}],[data-type=editor-block].comment[comment-${i}]`);if(o.length){o.forEach(l=>{z(l,"active")});const s=o[0];if(Qs(s)){const l=at(s,0,"normal");n.selection.setSelection(l,void 0,{noScroll:e==="next"})}else if(e4(n).indexOf(t)===-1){const c=Z(s);p(NW,c,"block not found");const d=Yo(c,s),h=at(c,d.start,"normal");n.selection.setSelection(h,void 0,{noScroll:e==="next"})}if(n.focus(),e==="next"){const l=s.getBoundingClientRect(),c=n.scrollContainer.clientHeight;l.top>c/2&&Gs(s,{elementToScroll:n.scrollContainer,verticalOffset:-n.scrollContainer.clientHeight/2})}}}}const Eat="";I("comment-editor");const{t:PW}=D,YE="comment-editor-readonly",Sf="comment-editor-editing";class QE{constructor(t,e,r){m(this,"root");m(this,"components");m(this,"handleEditorBlur",()=>{this.inactiveEditor()});m(this,"handleEditorFocus",()=>{this.editor.readonly||this.activeEditor()});m(this,"activeEditor",()=>{wt(this.root,Sf)||z(this.root,Sf)});m(this,"inactiveEditor",()=>{ot(this.root,Sf)});m(this,"handleInsertImg",async()=>{const{editor:t}=this.components,e=ct(t.rootContainer),r=await ga("image/*",{}),i={src:"",widthPercent:50},o={id:et(),type:"embed",embedType:"image",embedData:i},s=t.options.componentsOptions.image;s!=null&&s.defaultAlign&&(o.align=s.defaultAlign);const l=t.getFocusedBlock(),c=t.getBlockIndex(l),d=t.insertBlock(e,c+1,o);Ie.getImageObject(t,d).replaceImage(0,r)});m(this,"handleReadonlyChange",t=>{t.readonly?(ot(this.root,Sf),z(this.root,YE)):(z(this.root,Sf),ot(this.root,YE))});m(this,"setDoc",t=>{const{components:{editor:e}}=this;e.doc.externalDoc.setDoc(t)});m(this,"getDoc",()=>{const{components:{editor:t}}=this;return t.doc.toJSON()});m(this,"isEmpty",()=>O1(this.getDoc()));m(this,"edit",()=>{const{editor:t}=this.components;t.readonly=!1,up(t),this.activeEditor(),t.focus()});m(this,"clear",()=>{const t=io();this.setDoc(t)});m(this,"readonly",()=>{const{editor:t}=this.components;t.readonly=!0});m(this,"destroy",()=>{const{root:t,components:{editor:e,insertImgButton:r}}=this;r.onclick=null,e.destroy(),t.remove()});this.mainEditor=t,this.commentsProvider=e,this.doc=r,this.root=v("div",["comment-editor",YE],null),this.components=this.createEditor()}createEditor(){const t=v("div",["comment-editor-root"],this.root),{commentsProvider:e,mainEditor:r}=this,i=e.createCommentEditor(t,new bp(this.doc));i.readonly=!0,i.addListener("readonlyChanged",this.handleReadonlyChange),i.addListener("focus",this.handleEditorFocus),i.addListener("blur",this.handleEditorBlur);const o=El(this.root,"comment-editor-img",PW("comment.image"),vT,void 0,r.clientId);return o.classList.add("comment-editor-img"),o.onclick=this.handleInsertImg,{editor:i,insertImgButton:o}}get editor(){return this.components.editor}}class FW{constructor(t){m(this,"handleBeforeKeyDown",(t,e)=>{if(di(e,"Enter")){const{quickReply:r,updateLastCommentItem:i}=this.groupItem;return r.getReplyEditor().isEmpty()?(r.hideReplyEditor(),!0):(r.reply(),i(),!0)}return!1});this.groupItem=t}}class KW{constructor(t,e,r){m(this,"handleBeforeKeyDown",(t,e)=>{if(di(e,"Enter")){const{quickReply:r}=this.groupItem,{comment:i,getCommentEditor:o}=this.commentItem,s=o();if(s.isEmpty())this.commentsProvider.localDeleteComment(i.id);else{const l=s.getDoc();this.commentsProvider.localUpdateComment(i,l),s.readonly()}return r.show(),!0}return!1});this.commentsProvider=t,this.groupItem=e,this.commentItem=r}}const VW=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
724
|
+
`).map(h=>{const C={id:et(),type:"text"};if(FG(h)&&!i)return C.text=KG(h),C;const E=h?[Er(h,null)]:[];return C.text=E,C})},meta:{},comments:{}};o["text/plain"]=d}return o}}function $G(n){const t=[];for(let e=0;e<n.length;e++){const r=n[e];r.type.toLocaleLowerCase().startsWith("image/")&&t.push(r)}return t}class $E{constructor(t){t.dataConverter.addConverter(new NG),t.dataConverter.addConverter(new VG),t.dataConverter.addConverter(new PG)}async handleBeforePaste(t,e,r,i){if(!e)return!1;const o=e.clipboardData;if(o){if(o.getData("text/html").indexOf("<ones-editor-doc")>0)return!1;const l=o.getData("text/plain"),c=$G(i);if(c.length>0&&!l&&!r["text/office-html"])return await this.handleInsertImages(t,c),!0}return!1}async handleInsertImages(t,e){const{start:r,end:i}=t.selection.range,o=t.selection.focusedBlock;let s=it(o),c=vt(o);const d=Z(s);if(d&&Dt(d)==="code")return;if(r.blockId===i.blockId&&pe(o))c+=1;else{t.clearSelectedContents();const{blockId:C}=t.selection.range.start,E=t.getBlockById(C);c=vt(E),s=it(E),se(t,E)||(c+=1),qt(s)&&c===0&&(c+=1)}const h=ct(s);for(let C=0;C<e.length;C++){const E=e[C],x=await l1(t,"image",h,c+C,{file:E});x&&zv(t,x,"image",{id:"replace-image",name:"Replace image",data:{block:x,image:E}})}}}class HG extends ye.TypedEmitter{constructor(t){super(),this.editor=t}onUpdateBlockText(t,e,r){const i=this.editor.getCustom("find-dialog");if(!i||!i.isVisible())return;const o=zo(Ur(this.editor,t),e);!rt(this.editor,o)||!r.some(l=>l.insert||l.delete)||this.emit("onDocChanged",o)}onInsertBlock(t,e,r,i){this.emit("onDocInserted")}onDeleteBlock(t,e,r){const i=zo(Ur(this.editor,t),e);this.emit("onDocDeleted",i)}}function Dw(n){return ie.isSafari&&!!n&&Date.now()-n<100}const _w=I("highlight-data");class Z0{constructor(t){m(this,"data",new Map);this.editor=t}add(t,e,r){const i={id:et(),blockId:lt(t),oldText:this.editor.getBlockText(t),start:e,end:r};return this.data.set(i.id,i),i}get(t){const e=this.data.get(t);return p(_w,e,`no highligh data: ${t}`),e}remove(t){this.data.delete(t)}clearBlockData(t){Array.from(this.data.values()).forEach(e=>{e.blockId===t&&this.data.delete(e.id)})}destroy(){}static getData(t){return t.addCustom("highligh-data",()=>new Z0(t))}}function jG(n,t,e,r,i){const s=Z0.getData(n).add(t,e,r);return i.setAttribute("data-highlight-id",s.id),s}function tm(n,t){const e=t.getAttribute("data-highlight-id");return p(_w,e,"invalid highlight elem, no id"),Z0.getData(n).get(e)}const bl=I("highligh-dom");function zG(n){return wt(n,"editor-highlight")}function go(n){const t=n.rootContainer.querySelectorAll(".editor-highlight");return Array.from(t)}function GG(n,t){p(bl,t,"invalid block");const e=t.querySelectorAll(".editor-highlight");return Array.from(e)}function WG(n){const t=n.rootContainer.querySelectorAll(".editor-replace-result-highlight");return Array.from(t)}function em(n){const t=n.querySelectorAll(".editor-highlight");return Array.from(t)}function qG(n){em(n).forEach(t=>{t.remove()})}function Mw(n){return go(n).length}function xs(n){const t=n.rootContainer.querySelectorAll(".editor-highlight");return Array.from(t).map(r=>{const i=wt(r,"editor-highlight-box")?"box":"text";return{ele:r,type:i}})}function XG(n,t){p(bl,t>=0,`invalid highlight index: ${t}`);const e=go(n);return e.length===0?null:(p(bl,t<e.length,`invalid highlight index: ${t}/${e.length}`),e[t])}function YG(n,t,{left:e,top:r,width:i,height:o},s){const l=["editor-highlight-child"];s&&l.push("editor-highlight-readonly");const c=v("div",l,n);c.style.top=`${r}px`,c.style.left=`${e}px`,c.style.width=`${i}px`,c.style.height=`${o}px`}function Uw(n,t,e,r,i){p(bl,r>0,`invalid end: ${r}`);const o=oe(t),s=t.getBoundingClientRect(),l=Yi(n,t,ve(n,t,e,r)),c=i==="find"?["editor-highlight"]:["editor-replace-result-highlight"],d=uu(t,r),{prev:h}=d;h||p(bl,!1,"invalid offset, no prev child at offset"),Qn(h)&&c.push("editor-highlight-box");const C=v("div",c,o);l.forEach(E=>{YG(C,t,{left:E.left-s.left,width:E.width,top:E.top-s.top,height:E.height})}),jG(n,t,e,r,C)}function QG(n,t,e,r){return Uw(n,t,e,r,"find")}function Ow(n,t,e,r){return Uw(n,t,e,r,"replace")}function nm(n,t){go(n).forEach(s=>{wt(s,"active")&&ot(s,"active")}),z(t,"active"),p(bl,t.firstChild instanceof HTMLElement,"invalid highligh dom, invalid elem child");const r=t.firstChild;let o=r.getBoundingClientRect().y;o===0&&(o=r.getBoundingClientRect().y),xu(n,r,{animation:!0})}function Rf(n){const t=n.rootContainer.querySelector(".editor-highlight.active");return t||null}function Nw(n){return p(bl,n,"no highlight elem"),wt(n,"editor-highlight-readonly")}const ac=I("highligh-text");function Pw(n){WG(n).forEach(e=>{e.remove()})}function rm(n,t){go(n).forEach(r=>{r.remove()}),t!=null&&t.keepReplaceResult||Pw(n)}function Fw(n,t,e){GG(n,t).forEach(i=>{i.remove()}),e!=null&&e.keepReplaceResult||Pw(n)}function wf(n){const t=Rf(n);if(!t)return-1;const r=go(n).indexOf(t);return p(ac,r!==-1,`invalid highlight index: ${r}`),r}function JG(n){const t=go(n);if(t.length===0)return 0;const e=Rf(n);let r=e?t.indexOf(e):-1;!e||r===-1||r===t.length-1?r=0:r+=1;const i=t[r];return nm(n,i),r}function ZG(n){const t=go(n);if(t.length===0)return 0;const e=Rf(n);let r=e?t.indexOf(e):-1;!e||r===-1||r===0?r=t.length-1:r-=1;const i=t[r];return nm(n,i),r}function HE(n,t){const e=go(n);e.length>0&&t<e.length&&nm(n,e[t])}function tW(n,t,e){const r=Rf(n);if(!r)return!1;const i=Z(r);if(p(ac,i,"no parent block"),!n.isBlockWritable(i))return!1;const o=Mw(n);let s=wf(n);if(!Nw(r)&&n.isBlockWritable(i)){const d=tm(n,r),h=n.getBlockText(i),{start:C,end:E}=tm(n,r),[x,B]=pn.transformOffset(d.oldText,h,[C,E]),k=$3(h,x,B-x);if(de(k).toLowerCase()!==t.toLowerCase())return!1;const w=mh(h,x,B,e);n.setBlockText(i,w),qG(i),jE(n,i,t),e&&Ow(n,i,x,x+e.length)}const l=Mw(n);s>=l?s=0:l>o&&(s+=1);const c=XG(n,s);return c&&nm(n,c),!0}function eW(n,t,e,r){if(!rt(n,t)||!n.isBlockWritable(t))return 0;const i=n.getBlockText(t);p(ac,i,"no block text");const o={count:0},s=K5(n,i,e,r,o);return de(i)===de(s)?0:(n.setBlockText(t,s),o.count)}function nW(n,t,e){if(p(ac,zG(t),"not a highlight elem"),Nw(t))return;p(ac,e>0,"invalid highlight length");const r=tm(n,t),i=Z(t);p(ac,i,"no parent block"),Ow(n,i,r.start,r.start+e)}function rW(n,t){xs(n).forEach(r=>{r.type!=="box"&&nW(n,r.ele,t)})}function iW(n,t,e){if(n.readonly)return 0;const r=o=>{let s=0;return fe(o).forEach(c=>{It(n,c)?an(n,c).forEach(h=>{s+=r(h)}):s+=eW(n,c,t,e)}),s},i=r(n.rootContainer);return e.length>0&&rW(n,e.length),i}function oW(n){const t=n.selection.range.end,e=n.getBlockById(t.blockId),r=t.isSimple()?t.offset:1,i=em(e);for(let l=0;l<i.length;l++){const c=i[l],{end:d}=tm(n,c);if(d>=r)return c}const o=E1(n,{simpleBlockOnly:!0}),s=o.indexOf(e);if(s===-1)return null;for(let l=s+1;l<o.length;l++){const c=o[l],d=em(c);if(d.length>0)return d[0]}return null}function sW(n){const t=go(n),e=oW(n);return e?t.indexOf(e):0}function jE(n,t,e){if(!!e&&rt(n,t)){const r=n.getBlockText(t),i=hp(n,r,e);i.length>0&&i.forEach(({start:o,end:s})=>{QG(n,t,o,s)})}}function Kw(n,t){if(rm(n),!t)return;E1(n,{simpleBlockOnly:!0,visibleOnly:!0}).forEach(r=>{jE(n,r,t)})}class lW{constructor(t){m(this,"dialog",null);m(this,"root");m(this,"oldText","");m(this,"_compositionEndTime",0);m(this,"components");m(this,"handleFindChanged",()=>{this.doSearch({keepReplaceResult:!1,gotoFirstSearchResult:!0})});m(this,"handleCompositionEnd",()=>{this._compositionEndTime=Date.now(),this.handleFindChanged()});m(this,"handleDocChanged",t=>{setTimeout(()=>{if(qc(t))return;Fw(this.editor,t),jE(this.editor,t,this.components.findInput.value);const e=xs(this.editor),r=e.length;t.querySelectorAll(".editor-highlight").length===r&&HE(this.editor,0);const i=wf(this.editor);i!==-1&&this.updateSearchStatus(i,e)})});m(this,"handleDocInserted",()=>{const t=setTimeout(()=>{clearTimeout(t),rm(this.editor,{keepReplaceResult:!0}),Kw(this.editor,this.components.findInput.value);const e=wf(this.editor);if(e!==-1){const r=xs(this.editor);this.updateSearchStatus(e,r),HE(this.editor,e)}})});m(this,"handleDocDeleted",t=>{const e=setTimeout(()=>{if(!em(t).length){clearTimeout(e);return}Fw(this.editor,t);const i=wf(this.editor);if(i!==-1){const o=xs(this.editor);this.updateSearchStatus(i,o)}})});m(this,"handleInput",t=>{if(t.isComposing||Dw(this._compositionEndTime)){this.doSearch.cancel();return}this.handleFindChanged()});m(this,"handleFind",()=>{this.findNext({keepSearchResult:!1})});m(this,"handleReplace",()=>{const t=this.components.findInput.value;if(!t||!Rf(this.editor))return;const r=this.components.replaceInput.value;if(t===r)return;if(tW(this.editor,t,r)){const o=wf(this.editor),s=xs(this.editor);this.updateSearchStatus(o,s)}r.includes(t)&&this.findNext({keepSearchResult:!0})});m(this,"handleReplaceAll",()=>{const t=this.components.findInput.value;if(!t)return;const e=this.components.replaceInput.value;t!==e&&this.editor.undoManager.runInGroup(()=>{iW(this.editor,t,e)>0&&(this.oldText="",this.doSearchNow({keepReplaceResult:!0,gotoFirstSearchResult:!0}))})});m(this,"doSearch",ke.default(this.doSearchNow,300));m(this,"handleDocumentKeyDown",t=>{Gd(t)&&this.hide()});this.editor=t;const e=v("div",["editor-find-dialog"],null),r=v("div",["editor-find-content"],e),i=v("div",["editor-find-dialog-row"],r),o=Hs(qh,["editor-find-dialog-button-close"],e),s=v("label",["editor-find-dialog-label"],i,D.t("find.findLabel"));s.htmlFor="";const l=v("div",["editor-find-dialog-input-container"],i),c=v("input",["editor-find-dialog-input"],l);c.type="text",c.placeholder=D.t("find.findPlaceholder");const d=v("div",["editor-find-dialog-status"],l),h=Hs(fT,["editor-find-dialog-icon-button"],d),C=v("div",["editor-find-dialog-curr"],d,"0/0"),E=Hs(dT,["editor-find-dialog-icon-button"],d);let x;D.t("find.moreButton")?x=v("button",["editor-find-dialog-button"],i,D.t("find.moreButton")):x=Hs(zp,["editor-find-dialog-icon-button-border"],i);const B=v("div",["editor-find-dialog-row"],r),k=v("label",["editor-find-dialog-label"],B,D.t("find.replaceLabel"));k.htmlFor="";const w=v("div",["editor-find-dialog-input-container"],B),U=v("input",["editor-find-dialog-input"],w);U.type="text",U.placeholder=D.t("find.replacePlaceholder");const M=v("div",["editor-find-dialog-row","editor-find-dialog-action"],r);v("div",["editor-find-dialog-space"],M);const F=v("button",["editor-find-dialog-button"],M,D.t("find.findButton")),Y=v("button",["editor-find-dialog-button"],M,D.t("find.replaceButton")),X=v("button",["editor-find-dialog-button","editor-find-dialog-primary-button"],M,D.t("find.replaceAllButton"));x.onclick=()=>{this.showReplace()},o.onclick=()=>{this.hide()},c.onkeydown=st=>{if(st.isComposing||Dw(this._compositionEndTime)){this.doSearch.cancel();return}tv(st)?(this.doSearch.cancel(),this.doSearchNow({keepReplaceResult:!1,gotoFirstSearchResult:!0})):Gd(st)&&this.hide()},c.oninput=this.handleInput,c.onpaste=this.handleFindChanged,c.oncut=this.handleFindChanged,c.addEventListener("compositionend",this.handleCompositionEnd),c.maxLength=50,F.onclick=this.handleFind,Y.onclick=this.handleReplace,X.onclick=this.handleReplaceAll,U.maxLength=50,E.onclick=()=>{this.gotoNext()},h.onclick=()=>{this.gotoPrev()},this.components={findInput:c,findPrev:h,findCurrent:C,findNext:E,replaceInput:U,findButton:F,replaceButton:Y,replaceAllButton:X,closeButton:o,showReplaceButton:x,rowReplace:B,rowActions:M,statusContainer:d},this.root=e;const G=new HG(t);t.doc.registerCallback(G),G.addListener("onDocChanged",this.handleDocChanged),G.addListener("onDocInserted",this.handleDocInserted),G.addListener("onDocDeleted",this.handleDocDeleted)}findNext(t){this.doSearch.cancel(),this.doSearchNow({keepReplaceResult:t.keepSearchResult,gotoFirstSearchResult:!0})}doSearchNow(t){const e=this.components.findInput.value;if(e||this.clearFind(t),this.oldText===e){this.gotoNext();return}this.oldText=e,Kw(this.editor,e);const r=xs(this.editor),i=sW(this.editor);t.gotoFirstSearchResult&&HE(this.editor,i),this.updateSearchStatus(i,r)}gotoNext(){const t=JG(this.editor),e=xs(this.editor);this.updateSearchStatus(t,e)}gotoPrev(){const t=ZG(this.editor),e=xs(this.editor);this.updateSearchStatus(t,e)}updateSearchStatus(t,e){var s;this.oldText?this.components.statusContainer.style.display="flex":this.components.statusContainer.style.display="none";const r=e.length,i=e.filter(l=>l.type==="box").length,o=((s=e[t])==null?void 0:s.type)==="box";if(r-i<=0)r===0?(this.components.findCurrent.innerText="0 / 0",this.components.findButton.disabled=!0):(this.components.findCurrent.innerText=`${t+1} / ${r}`,this.components.findButton.disabled=!1),this.components.replaceAllButton.disabled=!0,this.components.replaceButton.disabled=!0;else{this.components.findCurrent.innerText=`${t+1} / ${r}`;const l=this.editor.readonly;this.components.replaceAllButton.disabled=l,this.components.replaceButton.disabled=l||o,this.components.findButton.disabled=!1}}clearFind(t){rm(this.editor),this.updateSearchStatus(0,[])}showFindOnly(){this.components.rowReplace.style.display="none",this.components.rowActions.style.display="none",this.components.showReplaceButton.style.display="flex"}showReplace(){this.components.rowReplace.style.display="flex",this.components.rowActions.style.display="flex",this.components.showReplaceButton.style.display="none",this.components.replaceInput.focus(),this.components.replaceInput.select()}hideSearchResult(){this.components.statusContainer.style.display="none"}showSearchResult(){this.components.statusContainer.style.display="flex"}show(t){document.addEventListener("keydown",this.handleDocumentKeyDown);const e=this.editor.getSelectedText();e.length>0&&e.length<50&&(this.components.findInput.value=e),this.root.style.display="flex",t!=null&&t.showFindAndReplace?(this.showReplace(),this.components.findInput.value&&setTimeout(()=>{this.components.replaceInput.focus()})):this.showFindOnly(),this.hideSearchResult(),this.oldText="",this.doSearchNow({keepReplaceResult:!1,gotoFirstSearchResult:!0});const r=this.editor.readonly,i=this.components.findInput.value;this.components.replaceButton.disabled=r||!i,this.components.replaceAllButton.disabled=r||!i,this.components.replaceInput.disabled=r,this.dialog||(this.dialog=new zu(this.root,{disablePageScroll:!1}));const o=this.editor.options.componentsOptions.findDialog,s=(o==null?void 0:o.popoverTarget)||this.editor.rootContainer,l=()=>{var E,x,B,k;const c=o==null?void 0:o.getReferenceClientRect;if(c&&((x=(E=this.dialog)==null?void 0:E.tippyInstance)==null?void 0:x.popper))return c(s,(k=(B=this.dialog)==null?void 0:B.tippyInstance)==null?void 0:k.popper);const d=s.getBoundingClientRect(),h=d.top<0?12:d.top+12,C=d.right-this.root.clientWidth-12;return new DOMRect(C,h,0,0)};this.dialog.show(s,{getReferenceClientRect:l}),setTimeout(()=>{this.components.findInput.focus(),this.components.findInput.select()},300)}hide(){var t;(t=this.dialog)==null||t.close("cancelBar"),rm(this.editor),document.removeEventListener("keydown",this.handleDocumentKeyDown)}isVisible(){return this.dialog&&this.dialog.isVisible}research(){this.oldText="",this.doSearch({keepReplaceResult:!0,gotoFirstSearchResult:!1})}destroy(){var t;(t=this.dialog)==null||t.destroy()}}const aW={find:{findLabel:"\u67E5\u627E:",replaceLabel:"\u66FF\u6362:",findButton:"\u67E5\u627E",replaceButton:"\u66FF\u6362",replaceAllButton:"\u5168\u90E8\u66FF\u6362",moreButton:"",findPlaceholder:"\u5728\u6587\u6863\u5185\u67E5\u627E",replacePlaceholder:"\u66FF\u6362\u4E3A"}},cW={find:{findLabel:"Search:",replaceLabel:"Replace:",findButton:"Search",replaceButton:"Replace",replaceAllButton:"Replace all",moreButton:"",findPlaceholder:"Search text in document",replacePlaceholder:"Replace with"}},uW={find:{findLabel:"\u691C\u7D22\uFF1A",replaceLabel:"\u7F6E\u63DB\uFF1A",findButton:"\u691C\u7D22",replaceButton:"\u7F6E\u63DB",replaceAllButton:"\u3059\u3079\u3066\u3092\u7F6E\u63DB",moreButton:"",findPlaceholder:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u691C\u7D22",replacePlaceholder:"\u306B\u7F6E\u63DB"}};D.mergeLang({"zh-CN":aW,"en-US":cW,"ja-JP":uW});function Vw(n){const t=n.addCustom("find-dialog",()=>new lW(n));return Jr(n)||t.show(),!0}const $w={"CtrlOrCmd+F":Vw},pat="";function fW(n){Vw(n)}const dW=I("context-menu-utils");async function hW(){try{const n=await navigator.clipboard.readText(),e=(await navigator.clipboard.read())[0].types;return!n.trim()&&e.length===1&&e.includes("text/plain")}catch(n){return dW.warn(`Failed to read clipboard data: ${n}`),!0}}function Hw(n,t){const e=document.createElement("a");e.href=n,e.download=t,e.click()}function mW(n){return new Promise((t,e)=>{const r=new FileReader;r.onload=()=>{const i=r.result;t(i)},r.onerror=()=>{e(new Error("Failed to read Blob as string."))},r.readAsText(n)})}async function gW(){const t=(await navigator.clipboard.read())[0],e=t.types,r=new DataTransfer;for(let i=0;i<e.length;i++){const o=e[i],s=await t.getType(o),l=await mW(s);r.setData(o,l)}return r}const jw=I("context-menu-actions");async function zw(n){n.inputHandlers.onCopyWithoutEvent()}async function pW(n){n.selection.range.isCollapsed()||xp(n)}async function CW(n){zw(n),wh(n)}function EW(n,t){p(jw,t,"block can not be null"),p(jw,pe(t),"block should be embed type");const e=[],r=n.getBlockData(t),i=r.embedType,o=n.editorEmbeds.getEmbedClass(i);if(o.getResources)o.getResources(n,r).forEach(s=>{e.push(s)});else{const l=r.embedData.src;l&&typeof l=="string"&&e.push(l)}return e}async function xW(n,t){const e=EW(n,t);if(e&&e.length){const r=e[0],i=n.doc.buildResourceUrl(r);Hw(i,r)}}function AW(n){gW().then(t=>{const e=new ClipboardEvent("paste",{clipboardData:t});document.dispatchEvent(e)})}const bW=I("context-menu");class vW{constructor(t){m(this,"t",D.t);m(this,"clipboardPermission",{read:"prompt",write:"granted"});m(this,"isSecureContext",window.isSecureContext);m(this,"externalActionHandleMap",new Map);m(this,"handleActionByExternal",t=>{const{data:e}=t;if(e&&e.externalType){const r=e.externalType,i=this.externalActionHandleMap.get(r);if(i)return i(this.editor,this.editor.selection.focusedBlock,t)}return!1});m(this,"getPasteCommandItem",async()=>{const t=this.hasClipboardReadPermission;let e;Wc()||$s()?e=!0:e=t?await hW():!1;const r=this.isSecureContext&&this.clipboardPermission.read!=="denied"&&!e,i=this.t("contextMenu.paste"),o=qe("CtrlOrCmd+V");let s=this.isSecureContext?"":this.secureEnvTips(o,i);return!s&&(!t||e)&&(s=this.t("copyCutProperty.limitedEnvTips",{shortCut:o})),{id:"paste",name:i,subText:o,states:r?[]:["disabled"],disableReason:s}});m(this,"getCommandItems",async()=>{const t=await this.getPasteCommandItem(),e=this.editor.readonly?[]:[this.cutCommandItem,t],r=[...this.copyTypeCommandItems,...e];return this.getExternalContextMenuOptions(r),r.push(this.stepItem,...this.selectionCommandItems),r});m(this,"getExternalContextMenuOptions",t=>{const e=this.editor.selection.focusedBlock,r=Qt(this.editor,e);if(r&&r.getBlockProperties){const i=r.getBlockProperties(this.editor,e);if(i){const{blockCommands:o}=i;if(o&&o["context-menu"]){const{commands:s,executeCommand:l,group:c}=o["context-menu"];if(s.length){const d=s.map(h=>({...h,data:{...h.data||{},externalType:c}}));t.push(this.stepItem,...d)}this.externalActionHandleMap.set(c,l)}}}});m(this,"isFocusImageBlock",()=>{const t=this.editor.selection,e=t.focusedBlock;return pe(e)&&$e(e)==="image"&&t.range.getSelectedBlocks().length===1});m(this,"isFocusImageTypeEmbed",()=>{const e=this.editor.selection.focusedBlock,r=["mermaid","flowchart","drawio"];return pe(e)&&r.includes($e(e))});this.editor=t,this.clipboardSupport()}get hasClipboardReadPermission(){return this.clipboardPermission.read==="granted"}get hasClipboardWritePermission(){return this.clipboardPermission.write==="granted"}clipboardSupport(){if(!navigator.clipboard){this.clipboardPermission={write:"denied",read:"denied"};return}if(!navigator.permissions){this.clipboardPermission={write:"granted",read:"denied"};return}try{const t=navigator.permissions.query({name:"clipboard-read"}),e=navigator.permissions.query({name:"clipboard-write"});Promise.all([t,e]).then(r=>{const i=r[0],o=r[1];this.clipboardPermission={read:i.state,write:o.state},i.state!=="granted"&&(i.onchange=s=>{this.clipboardPermission.read=s.target.state}),o.state!=="granted"&&(i.onchange=s=>{this.clipboardPermission.write=s.target.state})}).catch(r=>{this.clipboardPermission.read="denied",bW.log(r)})}catch{this.clipboardPermission={write:"granted",read:"denied"}}}get isRangeCollapsed(){return this.editor.selection.range.isCollapsed()}get imageTypeCommandItems(){const t=this.isSecureContext&&this.hasClipboardWritePermission;return[{id:"copy-image",name:this.t("contextMenu.copyImage"),subText:qe("CtrlOrCmd+C"),states:t?[]:["disabled"],disableReason:this.isSecureContext&&this.hasClipboardWritePermission?"":this.secureEnvTips(this.t("contextMenu.copyImage"),qe("CtrlOrCmd+C"))},{id:"copy-image-url",name:this.t("contextMenu.copyImageUrl"),states:t?[]:["disabled"]},{id:"image-save-as",name:this.t("contextMenu.imageSaveAs")},{id:"new-tab-open-image",name:this.t("contextMenu.newTabOpenImage")}]}get copyTypeCommandItems(){const t=this.isSecureContext&&!this.isRangeCollapsed;if(this.isFocusImageBlock())return this.imageTypeCommandItems;const e=this.t("copyCutProperty.copy"),r=qe("CtrlOrCmd+C"),i=[{id:"copy",name:e,subText:r,states:t?[]:["disabled"],disableReason:this.isSecureContext&&this.hasClipboardWritePermission?"":this.secureEnvTips(r,e)}];this.isFocusImageTypeEmbed()&&i.push({id:"image-save-as",name:this.t("contextMenu.imageSaveAs")});const s=this.t("contextMenu.copyMarkdown"),l=qe("CtrlOrCmd+Shift+C");return i.push({id:"copy-markdown",name:s,subText:l,states:t?[]:["disabled"],disableReason:this.isSecureContext&&this.hasClipboardWritePermission?"":this.secureEnvTips(l,s)}),i}get cutCommandItem(){let t=this.isSecureContext&&!this.isRangeCollapsed;const r=this.editor.selection.range.getSelectedBlocks().some(l=>!this.editor.isBlockWritable(l.block));r&&(t=!1);const i=this.t("copyCutProperty.cut"),o=qe("CtrlOrCmd+X");let s="";return t||(!this.isSecureContext||!this.hasClipboardWritePermission?s=this.secureEnvTips(o,i):r&&(s=this.t("contextMenu.uneditableBlockSelected"))),{id:"cut",name:this.t("copyCutProperty.cut"),subText:qe("CtrlOrCmd+X"),states:t?[]:["disabled"],disableReason:s}}get stepItem(){return{id:"step",name:"",type:"separator"}}get selectionCommandItems(){let t=!1;const e=this.editor.selection;e.range.isCollapsed()&&(t=!0),e.range.start.isSimple()&&e.range.end.isSimple()&&(t=e.range.start.offset>0&&e.range.getSelectedBlocks().length===1);const r=[{id:"select-block",name:this.t("contextMenu.selectBlock"),states:t?[]:["disabled"]}];return r.push({id:"select-all",name:this.t("contextMenu.selectAll")}),r}destroy(){this.externalActionHandleMap.clear()}secureEnvTips(t,e){return this.t("copyCutProperty.unsafeEnvTips",{shortCut:t,operation:e})}}const Cat="";class zE{constructor(t){m(this,"contextMenu");m(this,"contextMenuCommandItems");m(this,"destroy",()=>{this.contextMenuCommandItems.destroy(),this.contextMenu.off("show",this.handleContextMenuShown),this.contextMenu.off("click",this.handleContextMenuClick),this.contextMenu.off("close",this.handleContextMenuClose),document.removeEventListener("contextmenu",this.handleContextMenu)});m(this,"updateEditorCaret",t=>{const{x:e,y:r,target:i}=t,o=p1(this.editor,e,r);if(!o)return;const s=this.editor.getBlockById(o.focus.blockId),l=this.editor.selection.range;let c=!1;i instanceof HTMLImageElement&&Dt(s)==="embed"&&$e(s)==="image"?c=!1:l.isSimple()?c=l.getSelectedBlocks().some(d=>It(this.editor,d.block)?d.block.contains(s):d.block.id===(o==null?void 0:o.focus.blockId)&&d.start.offset<=o.focus.offset&&d.end.offset>=o.focus.offset):c=l.getSelectedContainers().some(h=>h.contains(s)),c||this.editor.selectionHandler.handleMouseDown(t,{autoScroll:!1})});m(this,"handleContextMenu",t=>{if(ie.isMobile||!this.editor.findCustom("editor-context-menu"))return;const r=t.target;if(this.editor.findCustom("toolbar-handler")&&this.editor.getCustom("toolbar-handler").isInToolbar(t)){t.preventDefault();return}if(this.editor.findCustom("block-menu")){const o=this.editor.getCustom("block-menu");if(o.blockMenu.isInMenu(r)||o.emptyBlockMenu.isInMenu(r)){t.preventDefault();return}}if(this.isInEditor(t)){t.preventDefault(),this.updateEditorCaret(t),this.contextMenu.manualShow(document.body,{theme:"light",point:{x:t.clientX,y:t.clientY}});return}this.isInMenu(t)&&t.preventDefault()});m(this,"isInMenu",t=>this.contextMenu.isInCommandBar(t.target));m(this,"isInEditor",t=>{const e=t.target;if(!e)return!1;let r=e.closest("div.editor-root"),i=this.editor.rootElement===r;if(!i&&e.classList.contains("editor-disable-scroll")){const s=Ae(t.x,t.y);r=(s==null?void 0:s.closest("div.editor-root"))||null,i=this.editor.rootElement===r}const o=t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement;return i&&!o});m(this,"handleContextMenuShown",async()=>{this.editor.findCustom("toolbar-handler")&&this.editor.getCustom("toolbar-handler").hide();const t=await this.contextMenuCommandItems.getCommandItems();this.contextMenu.updateItems(t)});m(this,"handleContextMenuClick",(t,e)=>{if(this.contextMenuCommandItems.handleActionByExternal(e))return;const{id:r}=e;switch(r){case"copy":zw(this.editor);break;case"copy-markdown":pW(this.editor);break;case"cut":if(this.handleImageEmbedAction(r))break;CW(this.editor);break;case"paste":AW(this.editor);break;case"copy-image":case"copy-image-url":case"image-save-as":case"new-tab-open-image":this.handleImageEmbedAction(r);break;case"select-all":Dh(this.editor,this.editor.rootContainer);break;case"select-block":dp(this.editor);break}});m(this,"handleContextMenuClose",()=>{this.editor.focus()});this.editor=t,this.contextMenu=new ls([],void 0,{id:`right-context-menu-${t.clientId}`,classes:[D.getCurrentLang(),"editor-context-menu"]}),this.contextMenu.on("show",this.handleContextMenuShown),this.contextMenu.on("click",this.handleContextMenuClick),this.contextMenu.on("close",this.handleContextMenuClose),document.addEventListener("contextmenu",this.handleContextMenu),this.contextMenuCommandItems=new vW(t)}handleImageEmbedAction(t){const e=this.editor.selection.focusedBlock;if(pe(e)&&$e(e)==="image"){const r=e,i=Ie.getImageObject(this.editor,r),o=i.getSelectedIndex(),s=i.getImages();if(o!==-1){let l=r.querySelectorAll("img")[o].src;if(l){switch(l=this.editor.doc.buildResourceUrl(l),t){case"cut":Q0(this.editor,null),J0(this.editor);break;case"copy-image":Q0(this.editor,null);break;case"copy-image-url":tu([{type:"text/plain",data:new Blob([l],{type:"text/plain"})}]);break;case"image-save-as":Hw(l,s[o].src);break;case"new-tab-open-image":window.open(l);break}return!0}}}else switch(t){case"image-save-as":xW(this.editor,e);break}return!1}}const BW={contextMenu:{copyMarkdown:"\u590D\u5236\u4E3A Markdown",paste:"\u7C98\u8D34",copyImage:"\u590D\u5236\u56FE\u7247",copyImageUrl:"\u590D\u5236\u56FE\u7247\u5730\u5740",imageSaveAs:"\u56FE\u7247\u53E6\u5B58\u4E3A",newTabOpenImage:"\u65B0\u6807\u7B7E\u9875\u6253\u5F00\u56FE\u7247",selectBlock:"\u9009\u4E2D\u533A\u5757",selectAll:"\u9009\u4E2D\u5168\u6587",uneditableBlockSelected:"\u9009\u4E2D\u533A\u57DF\u5305\u542B\u9501\u5B9A\u533A\u5757\uFF0C\u6682\u4E0D\u652F\u6301\u526A\u5207"}},TW={contextMenu:{copyMarkdown:"Copy as Markdown",paste:"paste",copyImage:"Copy image",copyImageUrl:"Copy image address",imageSaveAs:"Save image as",newTabOpenImage:"Open image in a new tab",selectBlock:"Select the block",selectAll:"Select all",uneditableBlockSelected:"The selected area contains locked blocks, and cutting is not currently supported"}},yW={contextMenu:{copyMarkdown:"Markdown \u3068\u3057\u3066\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051",copyImage:"\u753B\u50CF\u3092\u30B3\u30D4\u30FC",copyImageUrl:"\u753B\u50CF\u30A2\u30C9\u30EC\u30B9\u3092\u30B3\u30D4\u30FC",imageSaveAs:"\u540D\u524D\u3092\u4ED8\u3051\u3066\u753B\u50CF\u3092\u4FDD\u5B58",newTabOpenImage:"\u65B0\u3057\u3044\u30BF\u30D6\u3067\u753B\u50CF\u3092\u958B\u304F",selectBlock:"\u30D6\u30ED\u30C3\u30AF\u3092\u9078\u629E",selectAll:"\u30C6\u30AD\u30B9\u30C8\u3092\u5168\u9078\u629E",uneditableBlockSelected:"\u9078\u629E\u3057\u305F\u30A8\u30EA\u30A2\u306B\u30ED\u30C3\u30AF\u3055\u308C\u305F\u30D6\u30ED\u30C3\u30AF\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u5207\u308A\u53D6\u308A\u304C\u3067\u304D\u307E\u305B\u3093"}};D.mergeLang({"zh-CN":BW,"en-US":TW,"ja-JP":yW});function GE(n,t){return t.map(e=>{var o,s;const r=Qt(n,e),i=(o=r.getBlockProperties)==null?void 0:o.call(r,n,e);return pe(e)||It(n,e)?i!=null&&i.abstract?`[${i.abstract}]`:"":(s=i==null?void 0:i.abstract)!=null?s:""}).join(" ")}function im(n){const{editor:t,commentGroupId:e,abstract:r="text"}=n,i=et(),o=t.doc.getUser(),s=Date.now(),l=e!=null?e:i;return{id:i,groupId:l,userId:o.userId,displayName:o.displayName,avatarUrl:o.avatarUrl,abstract:r,created:s,modified:s}}function Gw(n,t,e){const r=e.id,o=n.getBlockData(t).comments;let s;o?s=[...o,r]:s=[r];const l={comments:s};n.updateBlockData(t,l)}function WE(n,t,e){const r=GE(n,[t]),i=im({editor:n,abstract:r});Gw(n,t,i);const o=io();return e.localCreateComment(i,o),i}const kW=I("standard-block-actions");class RW{constructor(t,e){m(this,"executeCommand",(t,e,r)=>{const i=r.data;try{this.editorComments.showCommentList();const o=t.getBlockById(i);WE(t,o,this.provider)}catch(o){kW.error(`failed to execute block command: ${JSON.stringify(o)}`)}});this.provider=t,this.editorComments=e}commands(t,e){const r=lt(e);return{group:"block-comment-actions",commands:[{id:"comment",name:D.t("comment.quickMenuCommand"),data:r,order:100,states:t.readonly?["disabled"]:[]}],executeCommand:this.executeCommand}}}class wW{async handleBeforePasteDoc(t,e){return Object.values(e.blocks).forEach(r=>{r.forEach(i=>{delete i.comments,i.text&&i.text.forEach(o=>{if(o.attributes){const s=o.attributes;Object.keys(s).forEach(l=>{l.startsWith("comment-")&&delete s[l]})}})})}),!1}}var ee=(n=>(n.SwitchUp="switch-up",n.SwitchDown="switch-down",n.CommentItemReply="comment-item-reply",n.CommentItemMore="comment-item-more",n.CommentItemOk="comment-item-ok",n.CommentItemCancel="comment-item-cancel",n.CommentItemDelete="comment-item-delete",n.CommentItemEdit="comment-item-edit",n.QuickReply="quick-reply",n.QuickReplyOk="quick-reply-ok",n.QuickReplyCancel="quick-reply-cancel",n))(ee||{});const qE="group-item-action",Ww="last-comment-item",SW="disabled",qw=500;function cc(n){return n.id!==n.groupId}function Xw(n,t=".comment-item-root"){return n.querySelectorAll(t).length}function LW(n){const t=n.closest(".comment-item-root");return t?t.id:null}function po(n,t){n.setAttribute(qE,t)}function IW(n){return n.closest(`[${qE}]`)}function DW(n){var t;return(t=n.getAttribute(qE))!=null?t:""}function _W(n){return n.disabled||n.classList.contains(SW)}function Yw(n,t){const e=n.rootContainer.querySelector(`[comment-${t.toLocaleLowerCase()}=${t}]`);if(!e)return null;const r=e.closest('[data-type="editor-block"]');return r?r.id:null}function Qw(n){return Array.from(n.attributes).map(e=>e.name).filter(e=>e.startsWith("comment-")).map(e=>e.replace("comment-",""))}const Jw=I("doc-comments");function Zw(n,t,e,r){if(t.comments){const o=t.comments;Array.isArray(o)&&o.forEach(s=>{r.has(s)||(r.add(s),e.push(s))})}t.text&&t.text.forEach(s=>{if(s.attributes){const l="comment-";Object.entries(s.attributes).forEach(([c,d])=>{if(c.startsWith(l)){const h=d;r.has(h)||(r.add(h),e.push(h))}})}});const i=t.children;!i||i.forEach(o=>{n.blocks[o].forEach(l=>{Zw(n,l,e,r)})})}function MW(n){const t=[],e=new Set;n.blocks.root.forEach(i=>{Zw(n,i,t,e)});const r=new Map;return t.forEach((i,o)=>r.set(i,o)),r}function UW(n){const t=new Map;n.forEach(i=>{if(cc(i)){const o=t.get(i.groupId);o?o.push(i):t.set(i.groupId,[i])}});const e=[];return n.forEach(i=>{var o;if(!cc(i)){const s=(o=t.get(i.id))!=null?o:[];t.delete(i.id);const l={...i,children:s};e.push(l)}}),Array.from(t.values()).forEach(i=>{const o=i[0],s=i.slice(1),l={...o,children:s};e.push(l)}),e}function As(n,t){const e=n.doc.toJSON(),r=MW(e);return UW(t.getComments()).filter(s=>r.has(s.groupId)).sort((s,l)=>{const c=r.get(s.groupId),d=r.get(l.groupId);return p(Jw,c!==void 0,`comment not exists in doc, ${s.groupId}`),p(Jw,d!==void 0,`comment not exists in doc, ${l.groupId}`),c-d})}function t4(n){const{children:t,...e}=n,r=[e];return t.forEach(i=>{r.push(i)}),r}function OW(n,t){return As(n,t).length}function XE(n,t){const e=[],r=n.getBlockById(t.blockId);if(rt(n,r)){const o=t.blockId,s=t.offset,l=n.getBlockById(o),c=n.getBlockText(l),d=Ba(c,s);d&&Object.entries(d).forEach(([h,C])=>{h.startsWith("comment-")&&e.push(C)})}const i=r.attributes;for(let o=0;o<i.length;o++){const s=i[o];s.name.startsWith("comment-")&&e.push(s.value)}return e}function e4(n){const t=n.selection.range;if(!t.isSimple())return[];if(t.start.blockId!==t.end.blockId)return[];if(t.isCollapsed())return XE(n,t.start);const{start:e,end:r}=t,i=XE(n,e),o=XE(n,r);return Rg.default(i,o)}const NW=I("active-comments");function n4(n,t){n.rootContainer.querySelectorAll(`span.comment[comment-${t}],[data-type=editor-block].comment[comment-${t}]`).forEach(r=>{ot(r,"active")})}function r4(n,t,e){const r=n.rootContainer.querySelector("span.comment.active,[data-type=editor-block].comment.active");if(!t)r&&Qw(r).forEach(o=>n4(n,o));else{const i=t.toLocaleLowerCase();if(r){const s=Qw(r);if(s.length===1&&s[0]===i)return;s.forEach(l=>n4(n,l))}const o=n.rootContainer.querySelectorAll(`span.comment[comment-${i}],[data-type=editor-block].comment[comment-${i}]`);if(o.length){o.forEach(l=>{z(l,"active")});const s=o[0];if(Qs(s)){const l=at(s,0,"normal");n.selection.setSelection(l,void 0,{noScroll:e==="next"})}else if(e4(n).indexOf(t)===-1){const c=Z(s);p(NW,c,"block not found");const d=Yo(c,s),h=at(c,d.start,"normal");n.selection.setSelection(h,void 0,{noScroll:e==="next"})}if(n.focus(),e==="next"){const l=s.getBoundingClientRect(),c=n.scrollContainer.clientHeight;l.top>c/2&&Gs(s,{elementToScroll:n.scrollContainer,verticalOffset:-n.scrollContainer.clientHeight/2})}}}}const Eat="";I("comment-editor");const{t:PW}=D,YE="comment-editor-readonly",Sf="comment-editor-editing";class QE{constructor(t,e,r){m(this,"root");m(this,"components");m(this,"handleEditorBlur",()=>{this.inactiveEditor()});m(this,"handleEditorFocus",()=>{this.editor.readonly||this.activeEditor()});m(this,"activeEditor",()=>{wt(this.root,Sf)||z(this.root,Sf)});m(this,"inactiveEditor",()=>{ot(this.root,Sf)});m(this,"handleInsertImg",async()=>{const{editor:t}=this.components,e=ct(t.rootContainer),r=await ga("image/*",{container:this.root});if(!r){t.focus();return}const i={src:"",widthPercent:50},o={id:et(),type:"embed",embedType:"image",embedData:i},s=t.options.componentsOptions.image;s!=null&&s.defaultAlign&&(o.align=s.defaultAlign);const l=t.getFocusedBlock(),c=t.getBlockIndex(l),d=t.insertBlock(e,c+1,o);Ie.getImageObject(t,d).replaceImage(0,r),t.focus()});m(this,"handleReadonlyChange",t=>{t.readonly?(ot(this.root,Sf),z(this.root,YE)):(z(this.root,Sf),ot(this.root,YE))});m(this,"setDoc",t=>{const{components:{editor:e}}=this;e.doc.externalDoc.setDoc(t)});m(this,"getDoc",()=>{const{components:{editor:t}}=this;return t.doc.toJSON()});m(this,"isEmpty",()=>O1(this.getDoc()));m(this,"edit",()=>{const{editor:t}=this.components;t.readonly=!1,up(t),this.activeEditor(),t.focus()});m(this,"clear",()=>{const t=io();this.setDoc(t)});m(this,"readonly",()=>{const{editor:t}=this.components;t.readonly=!0});m(this,"destroy",()=>{const{root:t,components:{editor:e,insertImgButton:r}}=this;r.onclick=null,e.destroy(),t.remove()});this.mainEditor=t,this.commentsProvider=e,this.doc=r,this.root=v("div",["comment-editor",YE],null),this.components=this.createEditor()}createEditor(){const t=v("div",["comment-editor-root"],this.root),{commentsProvider:e,mainEditor:r}=this,i=e.createCommentEditor(t,new bp(this.doc));i.readonly=!0,i.addListener("readonlyChanged",this.handleReadonlyChange),i.addListener("focus",this.handleEditorFocus),i.addListener("blur",this.handleEditorBlur);const o=El(this.root,"comment-editor-img",PW("comment.image"),vT,void 0,r.clientId);return o.classList.add("comment-editor-img"),o.onclick=this.handleInsertImg,{editor:i,insertImgButton:o}}get editor(){return this.components.editor}}class FW{constructor(t){m(this,"handleBeforeKeyDown",(t,e)=>{if(di(e,"Enter")){const{quickReply:r,updateLastCommentItem:i}=this.groupItem;return r.getReplyEditor().isEmpty()?(r.hideReplyEditor(),!0):(r.reply(),i(),!0)}return!1});this.groupItem=t}}class KW{constructor(t,e,r){m(this,"handleBeforeKeyDown",(t,e)=>{if(di(e,"Enter")){const{quickReply:r}=this.groupItem,{comment:i,getCommentEditor:o}=this.commentItem,s=o();if(s.isEmpty())this.commentsProvider.localDeleteComment(i.id);else{const l=s.getDoc();this.commentsProvider.localUpdateComment(i,l),s.readonly()}return r.show(),!0}return!1});this.commentsProvider=t,this.groupItem=e,this.commentItem=r}}const VW=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
725
725
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.65499 6.6665C3.09433 6.6665 2.66699 7.1275 2.66699 7.67617C2.66699 8.2255 3.02633 8.64284 3.65499 8.6645C4.23833 8.6645 4.66399 8.26917 4.66399 7.67617C4.66399 7.1275 4.23899 6.6665 3.65499 6.6665ZM12.9883 6.6665C12.4277 6.6665 12.0003 7.1275 12.0003 7.67617C12.0003 8.2255 12.3597 8.64284 12.9883 8.6645C13.5717 8.6645 13.9973 8.26917 13.9973 7.67617C13.9973 7.1275 13.5723 6.6665 12.9883 6.6665ZM8.32166 6.6665C7.76099 6.6665 7.33399 7.1275 7.33399 7.67617C7.33399 8.2255 7.69299 8.64284 8.32166 8.6645C8.90499 8.6645 9.33066 8.26917 9.33066 7.67617C9.33066 7.1275 8.90566 6.6665 8.32166 6.6665Z" fill="currentColor"></path>
|
|
726
726
|
</svg>`,$W=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
727
727
|
<path d="M2 4V11C2 11.5523 2.44772 12 3 12H10L12.5528 13.2764C13.2177 13.6088 14 13.1253 14 12.382V4C14 3.44772 13.5523 3 13 3H3C2.44772 3 2 3.44772 2 4Z" stroke="currentColor"/>
|
|
@@ -732,7 +732,7 @@ ${s}
|
|
|
732
732
|
<path d="M2.00218 11.0005L8.00341 4.99923L14.0046 11.0005" stroke="currentColor" fill="transparent" stroke-width="1.5" stroke-linejoin="bevel"/>
|
|
733
733
|
</svg>`,GW=`<svg width="17" height="16" viewBox="0 0 17 16" xmlns="http://www.w3.org/2000/svg">
|
|
734
734
|
<path d="M14.0029 4.99933L8.00172 11.0006L2.00049 4.99933" stroke="currentColor" fill="transparent" stroke-width="1.5" stroke-linejoin="bevel"/>
|
|
735
|
-
</svg>`,vat="",om="reply-editor-editing",{t:JE}=D;class WW{constructor(t,e,r,i){m(this,"root");m(this,"components");m(this,"handleFocus",()=>{const{replyEditor:t,okButton:e}=this.components;t.isEmpty()&&(e.disabled=!0)});m(this,"handleDocChange",()=>{const{replyEditor:t,okButton:e}=this.components,r=t.getDoc();O1(r)?e.disabled=!0:e.disabled=!1});m(this,"getReplyEditor",()=>this.components.replyEditor);m(this,"showReplyEditor",()=>{wt(this.root,om)||(z(this.root,om),this.components.replyEditor.edit())});m(this,"hideReplyEditor",()=>{!wt(this.root,om)||ot(this.root,om)});m(this,"reply",()=>{const{mainEditor:t,comment:e,components:{replyEditor:r},commentsProvider:i}=this,o=r.getDoc(),s=im({editor:t,commentGroupId:e.groupId,abstract:this.groupItem.comment.abstract});i.localCreateComment(s,o),this.hideReplyEditor(),r.clear()});m(this,"cancel",()=>{const{replyEditor:t}=this.components;this.hideReplyEditor(),t.clear()});m(this,"hide",()=>{wt(this.root,"hidden")||z(this.root,"hidden")});m(this,"show",()=>{ot(this.root,"hidden")});this.mainEditor=t,this.commentsProvider=e,this.comment=r,this.groupItem=i,this.root=v("div",["comment-quick-reply"],null),this.components=this.createQuickReply()}createQuickReply(){const{commentsProvider:t}=this,e=El(this.root,ee.QuickReply,JE("comment.placeholder"));po(e,ee.QuickReply),e.classList.add("quick-reply-button");const r=v("div",["quick-reply-editor"],this.root),i=io(),o=new QE(this.mainEditor,t,i);o.editor.addListener("docChanged",this.handleDocChange),o.editor.addListener("focus",this.handleFocus),o.editor.input.addHandler(new FW(this.groupItem)),r.append(o.root);const s=v("div",["reply-editor-actions"],r),l=br(ee.QuickReplyCancel,JE("common.cancel"));po(l,ee.QuickReplyCancel);const c=br(ee.QuickReplyOk,JE("comment.send"),void 0,["primary","disabled"]);return po(c,ee.QuickReplyOk),s.append(l,c),this.hideReplyEditor(),{replyTextButton:e,replyEditor:o,replyEditorContainer:r,okButton:c}}destroy(){this.components.replyEditor.destroy()}}const bs=I("comment-group-item");class qW extends ye.TypedEmitter{constructor(e,r,i,o){super();m(this,"root");m(this,"header");m(this,"mainItem");m(this,"childrenList");m(this,"resizeObserver");m(this,"quickReply");m(this,"createRoot",()=>v("div",["comment-group-item-root"],null));m(this,"createChildrenList",()=>{const e=v("div",["comment-children-list-container"],this.root);return new jW({editor:this.editor,commentsProvider:this.commentsProvider,comments:this.comment.children,parent:e,groupList:this.groupList,groupItem:this})});m(this,"updateLastCommentItem",()=>{const e=Array.from(this.root.querySelectorAll(":scope .comment-item-root"));p(bs,e.length!==0,"current group item not exist comment-item"),e.forEach(i=>{ot(i,Ww)});const r=e[e.length-1];z(r,Ww)});m(this,"updateSwitchButton",()=>{const e=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-up"]'),r=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-down"]');p(bs,e,"switchUpButton not exist"),p(bs,r,"switchDownButton not exist"),ot(r,"disabled"),ot(e,"disabled"),this.root.previousElementSibling===null&&z(e,"disabled"),this.root.nextElementSibling===null&&z(r,"disabled")});m(this,"handleReadonlyChanged",e=>{e.readonly?z(this.root,"readonly"):ot(this.root,"readonly")});m(this,"getCommentEditor",()=>this.mainItem.getCommentEditor());m(this,"handleResize",()=>{this.emit("resize")});this.editor=e,this.commentsProvider=r,this.comment=i,this.groupList=o,this.root=this.createRoot(),this.header=this.createHeader(),this.mainItem=this.createItem(),this.childrenList=this.createChildrenList(),this.quickReply=this.createQuickReply(),this.editor.on("readonlyChanged",this.handleReadonlyChanged),this.resizeObserver=new Vs(this.handleResize),this.resizeObserver.observe(this.root),this.updateLastCommentItem()}get commentCount(){return Xw(this.root)}createQuickReply(){const{editor:e,commentsProvider:r,comment:i}=this,o=new WW(e,r,i,this);return this.root.append(o.root),o}createHeader(){const{comment:e}=this,r=v("div",["comment-item-head"],this.root),i=v("span",["item-head-quote"],r);i.innerText=e.abstract;const o=v("span",["item-head-switch"],r),s=El(o,ee.SwitchUp,"up",zW),l=El(o,ee.SwitchDown,"down",GW);return po(s,ee.SwitchUp),po(l,ee.SwitchDown),r}createItem(){const e=v("div",["comment-item-container"],this.root),{editor:r,commentsProvider:i,comment:o,groupList:s}=this,l=new s4({mainEditor:r,commentsProvider:i,comment:o,groupList:s,groupItem:this});return e.appendChild(l.root),l}findCommentItem(e){return e?e===this.mainItem.comment.id?this.mainItem:this.childrenList.items.find(r=>r.comment.id===e):null}handleCreateComment(e){return p(bs,cc(e),"invalid comment, not a child comment"),p(bs,e.groupId===this.comment.id,"invalid comment, not a child comment"),this.childrenList.createItem(e)}handleUpdateChildComment(e){const r=this.childrenList.findItem(e.id);if(!r){bs.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(bs,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(bs,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}edit(){this.mainItem.edit()}destroy(){this.quickReply.destroy(),this.mainItem.destroy(),this.childrenList.destroy(),this.root.remove(),this.resizeObserver.disconnect(),this.removeAllListeners(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}}const XW=I("arrange=items"),a4=20;function c4(n,t){const e=n.rootContainer.querySelector(`[comment-${t.toLocaleLowerCase()}=${t}]`);if(!e)return-1;const r=n.scrollContainer.getBoundingClientRect(),i=n.scrollContainer.scrollTop;return e.getBoundingClientRect().top-r.top+i}function u4(n,t){return Number.parseInt(t.root.style.top,10)}function f4(n,t,e,r){let i=0;e&&(i=t.indexOf(e),i===-1&&(i=0));for(let o=i;o<t.length;o++){const s=t[o],l=s.comment,c=c4(n,l.groupId);if(s.root.setAttribute("data-target-top",c.toString()),o===i){if(r!==void 0){const C=t[0];C.root.style.top=`${r}px`}else s.root.style.top=`${c}px`;continue}const d=t[o-1],h=u4(n,d)+d.root.getBoundingClientRect().height;h>c?s.root.style.top=`${h+a4}px`:s.root.style.top=`${c}px`}for(let o=i-1;o>=0;o--){const s=t[o],l=s.comment,c=c4(n,l.groupId);s.root.setAttribute("data-target-top",c.toString());const d=s.root.getBoundingClientRect(),h=c+d.height,C=t[o+1];p(XW,C,"no next item");const E=u4(n,C);E<h?s.root.style.top=`${E-d.height-a4}px`:s.root.style.top=`${c}px`}setTimeout(()=>{n.scrollContainer.dispatchEvent(new Event("scroll"))},350)}const sm=I("comment-group-item-handler");class YW{constructor(t,e){m(this,"handleSwitchUp",t=>{const e=Math.max(0,t-1);this.groupList.setActiveItem(e,"prev"),this.groupList.updateItemsLayout()});m(this,"handleSwitchDown",t=>{const e=Math.min(t+1,this.groupList.items.length);this.groupList.setActiveItem(e,"next"),this.groupList.updateItemsLayout()});m(this,"handleQuickReply",t=>{const{quickReply:e}=t;e.showReplyEditor()});m(this,"handleQuickReplyOk",t=>{const{quickReply:e}=t;e.reply(),t.updateLastCommentItem()});m(this,"handleQuickReplyCancel",t=>{const{quickReply:e}=t;e.cancel()});m(this,"handleCommentItemReply",(t,e)=>{const r=t.findCommentItem(e);p(sm,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t;i.show(),i.showReplyEditor();const{comment:o}=r,s=i.getReplyEditor(),l=s.editor.getFocusedBlock(),c={type:"mention",id:et(),box:!0,created:Date.now(),text:o.displayName,iconUrl:o.avatarUrl,mentionId:o.userId};s.editor.insertBoxToBlock(l,0,c)});m(this,"handleCommentItemMore",t=>{const{quickReply:e}=t;e.hideReplyEditor(),e.getReplyEditor().clear()});m(this,"handleCommentItemOk",(t,e)=>{const r=t.findCommentItem(e);p(sm,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t,{comment:o,getCommentEditor:s}=r,l=s(),c=l.getDoc();this.commentsProvider.localUpdateComment(o,c),l.readonly(),i.show()});m(this,"handleCommentItemCancel",(t,e)=>{var c,d;const r=t.findCommentItem(e);p(sm,r,`the commentItem: ${e} not exist `);const i=this.commentsProvider.getComment(r.comment.id);let o=!1;if((c=i.blocks)!=null&&c.length||(o=!0),((d=i.blocks)==null?void 0:d.length)===1){const h=i.blocks[0];o=!!h.text&&gn(h.text)===0}if(o){this.commentsProvider.localDeleteComment(r.comment.id);return}const{quickReply:s}=t,l=r.getCommentEditor();l.setDoc(r.doc),l.readonly(),s.show()});m(this,"handleCommentItemEdit",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e;t.getCommentEditor().edit(),r.hide()});m(this,"handleCommentItemDelete",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e,{comment:i}=t;this.commentsProvider.localDeleteComment(i.id),r.show()});m(this,"execute",(t,e,r,i)=>{const o=IW(t);if(!o||_W(o))return;const s=DW(o);switch(s){case ee.SwitchUp:this.handleSwitchUp(i);break;case ee.SwitchDown:this.handleSwitchDown(i);break;case ee.CommentItemReply:this.handleCommentItemReply(e,r);break;case ee.CommentItemMore:this.handleCommentItemMore(e);break;case ee.CommentItemOk:this.handleCommentItemOk(e,r);break;case ee.CommentItemCancel:this.handleCommentItemCancel(e,r);break;case ee.CommentItemDelete:break;case ee.CommentItemEdit:break;case ee.QuickReply:this.handleQuickReply(e);break;case ee.QuickReplyOk:this.handleQuickReplyOk(e);break;case ee.QuickReplyCancel:this.handleQuickReplyCancel(e);break;default:const l=s;sm.debug(`not implement handler for ${l}`)}});this.groupList=t,this.commentsProvider=e}destroy(){}}const lm=I("comment-group-list");class QW extends Lf{constructor(e,r,i){super(e,r,i,As(e,r),{});m(this,"groupItemHandlers");m(this,"closeEditing",e=>{const r=this.items.find(i=>i.comment.id===e);r&&([r,...r.childrenList.items].forEach(i=>{!i.getCommentEditor().editor.readonly&&i.getCommentEditor().isEmpty()&&this.groupItemHandlers.handleCommentItemCancel(r,i.comment.id)}),r.quickReply.getReplyEditor().isEmpty()&&r.quickReply.cancel())});m(this,"setFirstEditingCommentActive",()=>{const e=this.findFirstEditingComment();e!==-1&&this.setActiveItem(e)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleContainerClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target.closest(".comment-group-item-root");if(!r)return;const i=LW(e.target),o=this.items.findIndex(s=>s.root===r);if(o!==-1){this.activeIndex!==o&&this.setActiveItem(o);const{groupItemHandlers:s}=this;s.execute(e.target,this.items[o],i,o)}});m(this,"handleDocumentClick",e=>{if(!e.target||!(e.target instanceof Element)||e.target.closest(".comment-group-item-root.active"))return;const i=this.items[this.activeIndex];!i||[i.findCommentItem(i.comment.id),...i.childrenList.items].some(s=>{var c;const l=(c=s==null?void 0:s.moreMenu.tippyInstance)==null?void 0:c.popper;return!!(l!=null&&l.contains(e.target))})||i!=null&&i.comment&&setTimeout(()=>{this.closeEditing(i.comment.id)})});m(this,"handleSelectionChanged",()=>{setTimeout(()=>{var r;const e=e4(this.editor);if(e.length>0){if(((r=this.activeItem)==null?void 0:r.comment.id)&&e.includes(this.activeItem.comment.id))return;const i=e[0],o=this.items.findIndex(s=>s.comment.groupId===i);this.setActiveItem(o),this.emit("selectionOnComment")}else this.setActiveItem(-1)})});m(this,"handleEditorResize",()=>{this.updateItemsLayout()});m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"handleItemResize",()=>{this.updateItemsLayout()});m(this,"handleScroll",e=>{if(e.deltaY>=0||this.editor.scrollContainer.scrollTop!==0)return;const r=Ae(e.clientX,e.clientY);if(!r||!(r instanceof HTMLElement)||!this.editor.scrollContainer.contains(r))return;const i=this.container.querySelector(".comment-group-item-root");if(!i)return;const o=Number.parseFloat(i.style.top),s=Number.parseFloat(i.getAttribute("data-target-top")||"0");!Number.isNaN(o)&&!Number.isNaN(s)&&o<s&&f4(this.editor,this.items,null,Math.min(o+(0-e.deltaY)*3,s))});m(this,"updateGroupItemSwitch",()=>{const e=this.activeItem;p(lm,e,"invalid activeItem"),e.updateSwitchButton()});m(this,"updateComments",ke.default(()=>{const e=As(this.editor,this.commentsProvider);let r=!1;for(let i=0;i<e.length;i++){const o=e[i];if(!this.findGroupItem(o.groupId)){this.handleCreateComment(o,!1),r=!0;continue}}for(let i=this.items.length-1;i>=0;i--){const o=this.items[i];e.findIndex(s=>s.groupId===o.comment.groupId)===-1&&(this.deleteItem(o.comment.id),r=!0)}r&&(this.updateItemsLayout(),this.emit("commentCountChanged"))},100));this.updateItemsLayout(),this.bindEvents(),this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("resize",this.handleEditorResize),this.editor.addListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.addEventListener("wheel",this.handleScroll,{passive:!1}),this.items.forEach(o=>o.addListener("resize",this.handleItemResize)),this.groupItemHandlers=new YW(this,r),document.addEventListener("click",this.handleDocumentClick)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("resize",this.handleEditorResize),this.editor.removeListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.removeEventListener("wheel",this.handleScroll),super.destroy(),this.unbindEvents(),this.removeAllListeners(),document.removeEventListener("click",this.handleDocumentClick)}updateItemsLayout(){f4(this.editor,this.items,this.activeItem)}bindEvents(){this.container.addEventListener("click",this.handleContainerClick)}unbindEvents(){this.container.removeEventListener("click",this.handleContainerClick)}createItem(e,r){const i=new qW(this.editor,this.commentsProvider,e,this);return r==="insert"&&(z(i.root,"no-animation"),i.root.style.opacity="0",setTimeout(()=>{ot(i.root,"no-animation"),i.root.style.opacity="1"},150)),i}findInsertPos(e){const i=As(this.editor,this.commentsProvider).findIndex(o=>o.id===e.id);return i===-1||i>this.items.length?-1:i}insertItem(e,r){const i=super.insertItem(e);return i?(r!=null&&r.active&&this.setActiveItem(this.items.indexOf(i)),this.updateItemsLayout(),i.addListener("resize",this.handleItemResize),i):null}findFirstEditingComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if((!i.quickReply.getReplyEditor().isEmpty()||e)&&!i.quickReply.getReplyEditor().editor.readonly)return r;const o=[i,...i.childrenList.items];for(let s=0;s<o.length;s++){const l=o[s];if(!l.getCommentEditor().editor.readonly&&(!l.getCommentEditor().isEmpty()||e))return r}}return-1}isEditing(){return this.findFirstEditingComment()!==-1}setActiveItem(e,r){if(p(lm,e>=-1&&e<this.items.length,`invalid index: ${e}`),e===this.activeIndex)return;const i=this.container.querySelector(".comment-group-item-root.active");if(i){const o=this.items[this.activeIndex];setTimeout(()=>{this.closeEditing(o.comment.id)}),ot(i,"active")}if(e!==-1){const o=this.items[e];z(o.root,"active"),this.updateItemsLayout(),this.updateGroupItemSwitch()}this.emit("activeItemChanged",e,r)}get activeIndex(){const e=this.container.querySelector(".comment-group-item-root.active");return e?this.items.findIndex(r=>r.root===e):-1}get activeItem(){const e=this.activeIndex;return e===-1?null:this.items[e]}handleCreateComment(e,r){if(cc(e)){const l=this.findGroupItem(e.groupId);l&&l.childrenList.insertItem(e)}const i=this.findItem(e.id);p(lm,!i,"comment group item has already exists");const o={children:[],...e};p(lm,o.children,"not a comment group");const s=this.insertItem(o,{active:r});if(!!s&&r){const l=this.items.indexOf(s);this.setActiveItem(l),s.quickReply.hide(),setTimeout(()=>{s.edit()},300)}}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?(this.deleteItem(i.comment.id),this.updateItemsLayout()):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&(this.deleteItem(i.comment.id),this.updateItemsLayout());return}}}handleUpdateComment(e){const r=this.findItemAsGroupId(e.groupId);if(r&&r.comment.id!==e.id){r.handleUpdateChildComment(e);return}const i=this.findItem(e.id);i&&i.handleUpdateMainComment(e)}}const JW="comment-mini";I("comment-list");class ZW extends ye.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"groupsContainer");m(this,"list");m(this,"handleSelectionOnComment",()=>{this.emit("onSelectComment")});m(this,"updateCommentCount",()=>{var r,i;const e=OW(this.editor,this.commentsProvider);(i=(r=this.commentOptions)==null?void 0:r.onCommentCountChange)==null||i.call(r,e)});m(this,"handleActiveItemChanged",(e,r)=>{var o,s;const i=this.list.activeItem;r4(this.editor,(s=(o=i==null?void 0:i.comment)==null?void 0:o.groupId)!=null?s:"",r)});m(this,"handleItemLayoutUpdated",()=>{var r,i;const e=wt(this.root,JW);(i=(r=this.commentOptions)==null?void 0:r.onUpdateLayout)==null||i.call(r,this.editor,{expand:e})});this.editor=e,this.commentsProvider=r,this.root=v("div",["editor-web-comment-root"],null),this.groupsContainer=v("div",["comment-groups-container"],this.root),this.list=this.createList(),this.commentsProvider.addListener(this),this.list.addListener("activeItemChanged",this.handleActiveItemChanged),this.list.addListener("itemLayoutUpdated",this.handleItemLayoutUpdated),this.list.addListener("selectionOnComment",this.handleSelectionOnComment),this.list.addListener("commentCountChanged",this.updateCommentCount),this.updateCommentCount()}get commentOptions(){return this.editor.getComponentOptions("comment")}destroy(){this.list.removeAllListeners(),this.commentsProvider.removeListener(this),this.list.destroy(),this.root.remove()}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r),this.updateCommentCount()}onDeleteComment(e,r){this.list.handleDeleteComment(e),this.updateCommentCount()}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}createList(){return new QW(this.editor,this.commentsProvider,this.groupsContainer)}isEditing(){return this.list.isEditing()}setFirstEditingCommentActive(){this.list.setFirstEditingCommentActive()}show(e){var r;if(ot(this.root,"hidden"),e){const i=this.list.findItemIndex(e);this.list.setActiveItem(i)}(r=this.commentOptions)==null||r.controller.showCommentList()}hide(){z(this.root,"hidden")}}class tq extends Lf{constructor({editor:t,parent:e,commentsProvider:r,comments:i}){super(t,r,e,i,{})}findInsertPos(){return this.items.length}createItem(t){const{editor:e,commentsProvider:r}=this;return new l4(e,r,t)}destroy(){this.items.forEach(t=>{t.destroy()})}}const am=I("mobile-comment-group-item"),eq=20;class nq extends ye.TypedEmitter{constructor(e,r,i){super();m(this,"root");m(this,"childrenList");m(this,"mainItem");m(this,"scroller");m(this,"createRoot",()=>v("div",["mobile-group-item-root"],null));m(this,"createMainItem",e=>{const{editor:r,commentsProvider:i,comment:o}=this,s=new l4(r,i,o);return e.append(s.root),s});m(this,"createChildrenList",e=>{const{editor:r,commentsProvider:i,comment:o}=this,s=v("div",["mobile-comment-children-list-container"],e);return new tq({editor:r,commentsProvider:i,comments:o.children,parent:s})});m(this,"handleTouchEnd",()=>{var o;const{scroller:e}=this,{pullThreshold:r=eq}=(o=this.editor.getComponentOptions("comment"))!=null?o:{};let i=null;if(e.y>e.minScrollY+r?(i=this.root.previousElementSibling,i||this.emit("onReachTop")):e.y<e.maxScrollY-r&&(i=this.root.nextElementSibling,i||this.emit("onReachBottom")),i){const s=i.id;this.emit("onSwitchGroup",s,qw)}});m(this,"refreshScroller",()=>{this.scroller.refresh()});this.editor=e,this.commentsProvider=r,this.comment=i,this.root=v("div",["mobile-group-item-root"],null),this.root.id=i.groupId;const o=v("div",["mobile-group-item"],this.root),s=v("div",["mobile-group-item-space"],null),l=v("div",["mobile-group-item-abstract"],null);l.textContent=i.abstract;const c=v("div",["mobile-group-item-list-container"],null);this.mainItem=this.createMainItem(c),this.childrenList=this.createChildrenList(c),o.append(s,l,c),this.scroller=new kb.default(this.root,{stopPropagation:!0,click:!0}),this.scroller.on("touchEnd",this.handleTouchEnd)}get commentCount(){return Xw(this.root,".mobile-group-item")}handleUpdateChildComment(e){p(am,e.groupId===this.mainItem.comment.id,"invalid child comment");const r=this.childrenList.findItem(e.id);if(!r){am.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(am,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(am,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}destroy(){this.mainItem.destroy(),this.childrenList.destroy(),this.scroller.off("touchEnd",this.handleTouchEnd),this.scroller.destroy(),this.root.remove(),this.removeAllListeners()}}const ZE=I("mobile-group-list");class rq extends Lf{constructor(e,r,i,o){super(e,r,i,As(e,r),{});m(this,"scroller");m(this,"refreshScroller",()=>{this.scroller.refresh(),this.items.forEach(e=>{e.refreshScroller()})});m(this,"deleteItem",e=>{if(this.items.length<=1)return super.deleteItem(e);const r=this.findItemIndex(e);let i=null;return r===0?i=this.items[r+1].root.id:i=this.items[r-1].root.id,super.deleteItem(e)?(this.scrollToGroup(i,qw),!0):!1});m(this,"setupGroupItem",e=>{e.on("onSwitchGroup",this.scrollToGroup),e.on("onReachBottom",this.handleReachBottom),e.on("onReachTop",this.handleReachTop),e.refreshScroller()});m(this,"handleReachBottom",()=>{this.emit("onReachBottom")});m(this,"handleReachTop",()=>{this.emit("onReachTop")});m(this,"scrollToGroup",(e,r=0)=>{const i=this.findGroupItem(e);p(ZE,i,"invalid scroll target"),this.scroller.scrollToElement(i.root,r,!1,!1),r4(this.editor,i.comment.groupId)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"updateComments",ke.default(()=>{const e=As(this.editor,this.commentsProvider);for(let r=0;r<e.length;r++){const i=e[r];if(!this.findGroupItem(i.groupId)){this.handleCreateComment(i,!1);continue}}for(let r=this.items.length-1;r>=0;r--){const i=this.items[r];e.findIndex(o=>o.groupId===i.comment.groupId)===-1&&this.deleteItem(i.comment.id)}},100));this.scroller=new kb.default(o),this.scroller.disable(),this.editor.addListener("docChanged",this.handleDocChanged),this.items.forEach(this.setupGroupItem)}createItem(e){return new nq(this.editor,this.commentsProvider,e)}insertItem(e){const r=super.insertItem(e);return r?(this.setupGroupItem(r),r):null}findInsertPos(e){const i=As(this.editor,this.commentsProvider).findIndex(o=>o.id===e.id);return i===-1||i>this.items.length?-1:i}setActiveItem(e){this.scrollToGroup(e)}handleCreateComment(e,r){if(cc(e)){const s=this.findGroupItem(e.groupId);s&&s.childrenList.insertItem(e)}const i=this.findItem(e.id);p(ZE,!i,"comment group item has already exists");const o={children:[],...e};p(ZE,o.children,"not a comment group"),this.insertItem(o),this.scroller.refresh()}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?this.deleteItem(i.comment.id):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&this.deleteItem(i.comment.id);return}}}handleUpdateComment(e){if(cc(e)){const i=this.commentsProvider.getComment(e.groupId),o=this.findItem(i.id);o&&o.handleUpdateChildComment(e);return}const r=this.findItem(e.id);r&&r.handleUpdateMainComment(e)}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),this.scroller.destroy(),this.items.forEach(e=>e.destroy())}}const iq=I("mobile-comment-list"),{t:d4}=D;class oq extends ye.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"list");m(this,"mask");m(this,"pullInfoContainer");m(this,"handleRootClick",e=>{const r=e.target;p(iq,r instanceof Element,"invalid target"),!(r.closest(".mobile-group-item-abstract")||r.closest(".mobile-group-item-list-container"))&&(this.hide(),this.emit("onCommentListClose"))});m(this,"hidePullInfo",ke.default(()=>{ot(this.pullInfoContainer,"active")},1e3*3));m(this,"handleReachBottom",()=>{this.showPullInfo("bottom")});m(this,"handleReachTop",()=>{this.showPullInfo("top")});m(this,"show",e=>{var r;ot(this.root,"hidden"),z(document.documentElement,"disabled-scroll"),(r=this.commentOptions)==null||r.controller.showCommentList(),queueMicrotask(()=>{this.list.refreshScroller(),e&&this.list.setActiveItem(e)})});m(this,"hide",()=>{z(this.root,"hidden"),ot(document.documentElement,"disabled-scroll")});this.editor=e,this.commentsProvider=r,this.root=v("div",["editor-mobile-comments-root"],null),this.mask=v("div",["mobile-comment-mask"],this.root);const i=v("div",["mobile-comment-groups-container"],this.root),o=v("div",["mobile-comment-groups-scroll-container"],i);this.list=new rq(this.editor,this.commentsProvider,o,i),this.pullInfoContainer=this.createPullInfo(),this.commentsProvider.addListener(this),this.list.on("onReachBottom",this.handleReachBottom),this.list.on("onReachTop",this.handleReachTop),this.root.onclick=this.handleRootClick}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}get commentOptions(){return this.editor.getComponentOptions("comment")}createPullInfo(){const e=v("div",["mobile-comment-pull-info-container"],this.root);return v("div",["mobile-comment-pull-info"],e),e}showPullInfo(e){const r=d4(e==="bottom"?"comment.isLast":"comment.isFirst");this.pullInfoContainer.firstElementChild.textContent=r,z(this.pullInfoContainer,"active"),this.hidePullInfo()}isEditing(){return!1}destroy(){this.list.removeAllListeners(),this.list.destroy(),this.root.onclick=null}}function h4(n,t){const e=As(n,t),r=new Map;for(const i of e){const o=Yw(n,i.groupId);if(!!o)if(r.has(o)){const s=r.get(o);t4(i).forEach(c=>{s==null||s.commentIds.add(c.id)})}else{const s=t4(i),l=new Set(s.map(c=>c.id));r.set(o,{commentIds:l,firstComment:i})}}return Array.from(r.entries()).map(([i,o])=>({blockId:i,...o}))}const sq=I("mini-group-item");class lq{constructor(t,e){m(this,"root");m(this,"blockId");m(this,"comment");m(this,"miniCommentItem");m(this,"updateCommentItemCount",()=>{this.miniCommentItem.updateCount(this.commentCount)});this.editor=t,this.commentGroup=e,this.root=v("div",["mini-group-item"],null),this.comment=e.firstComment,this.miniCommentItem=new HW(this.comment.id,this.root),this.blockId=this.getBlockId(),setTimeout(()=>{this.alignToBlock()}),this.updateCommentItemCount()}getBlockId(){return Yw(this.editor,this.comment.groupId)}get commentCount(){return this.commentGroup.commentIds.size}alignToBlock(){const t=this.getBlockId();if(!t)return;const e=this.editor.getBlockById(t);p(sq,e,`The blockId: ${t} not exist in doc`);const r=this.editor.scrollContainer.getBoundingClientRect(),i=this.editor.scrollContainer.scrollTop,s=e.getBoundingClientRect().top-r.top+i;requestAnimationFrame(()=>{this.root.style.transform=`translateY(${s}px)`})}destroy(){this.root.remove()}}class aq extends Lf{constructor(e,r,i){super(e,r,i,h4(e,r),{});m(this,"fixListOps",ke.default(()=>{this.items.forEach(e=>{e.alignToBlock()})},100));m(this,"handleDocChanged",ke.default(()=>{this.updateMiniCommentsGroup()},100));m(this,"updateMiniCommentsGroup",()=>{const e=h4(this.editor,this.commentsProvider);this.reloadList(e)});this.editor=e,this.commentsProvider=r,this.editor.addListener("docChanged",this.handleDocChanged),this.editor.addListener("resize",this.fixListOps)}createItem(e){return new lq(this.editor,e)}findInsertPos(){return-1}handleCreateComment(e,r){this.updateMiniCommentsGroup()}handleDeleteComment(e){this.updateMiniCommentsGroup()}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),super.destroy(),this.removeAllListeners()}}const cq=I("mini-comments-list");class uq extends ye.TypedEmitter{constructor(e,r){super();m(this,"list");m(this,"root");m(this,"createList",()=>{const e=v("div",["comment-groups-container"],this.root);return this.editor.domEvents.addEventListener(e,"click",this.handleListContainerClick),new aq(this.editor,this.commentsProvider,e)});m(this,"handleListContainerClick",(e,r)=>{const i=r.target;p(cq,i instanceof HTMLElement,"The target is not a valid html element");const o=i.closest(".mini-comment-item");o&&this.emit("onItemClick",o.id)});this.editor=e,this.commentsProvider=r,this.root=v("div",["editor-mini-comment-root"],null),this.list=this.createList(),this.commentsProvider.addListener(this)}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){}show(){ot(this.root,"hidden")}hide(){z(this.root,"hidden")}destroy(){this.list.destroy(),this.removeAllListeners()}}function m4(n,t,e){if(!t.start.isSimple()||!t.end.isSimple())return;const r=t.block,i=ve(n,r,t.start.offset,t.end.offset),o=`comment-${e.id.toLocaleLowerCase()}`,s=e.id;QB(n,r,i,o,s)}function fq(n,t,e){const r=Ci(n).map(s=>s.block),i=GE(n,r),o=im({editor:n,abstract:i});return n.undoManager.runInGroup(()=>{Ci(n,{simpleBlockOnly:!0}).forEach(c=>{!rt(n,c.block)||m4(n,c,o)});const l=io();e.localCreateComment(o,l)}),o}class dq{constructor(t,e){m(this,"id","CommentsCommandProvider");this.provider=t,this.editorComments=e}getAvailableCommands(t,e,r){const i=t.selection.range;if(rt(t,e)&&!r.isCollapsed()&&i.isSimple()){const o=lt(e),s=Dt(e),l=Nr(t,e);return[{id:"add-comment",name:D.t("comment.command"),blockId:o,blockType:s,blockKind:l,groupIndex:1e3,icon:ul}]}return[]}hideToolbar(t){const e=t.findCustom("toolbar-handler");e==null||e.disableTextToolbar(),e==null||e.hide(),setTimeout(()=>{e==null||e.enableTextToolbar()},300)}executeRangeCommand(t,e,r,i,o){if(r.id==="add-comment"){this.editorComments.showCommentList();const s=fq(t,e,this.provider);return o["add-comment"]=s,this.hideToolbar(t),!0}return!1}}class g4{constructor(t,e){m(this,"commentList",null);m(this,"mobileCommentList",null);m(this,"miniCommentList");m(this,"showComment",(t,e)=>{var r,i;t==="mini"&&this.miniCommentList.show(),t==="mobile"&&((r=this.mobileCommentList)==null||r.show(e)),t==="web"&&((i=this.commentList)==null||i.show(e))});m(this,"showCommentList",t=>{this.isMobile?this.showComment("mobile",t):this.showComment("web",t)});m(this,"handleCommentListClose",()=>{this.showComment("mini")});m(this,"handleOnSelectComment",()=>{this.showComment("web")});m(this,"handleMiniCommentItemClick",t=>{this.showCommentList(t)});this.editor=t,this.provider=e,t.editorCommandProviders.registerCommandProvider(new dq(e,this)),t.blockHooks.push(new RW(this.provider,this)),this.isMobile?(this.mobileCommentList=new oq(this.editor,this.provider),this.mobileCommentList.on("onCommentListClose",this.handleCommentListClose)):(this.commentList=new ZW(this.editor,this.provider),this.commentList.on("onSelectComment",this.handleOnSelectComment)),this.miniCommentList=new uq(this.editor,this.provider),this.miniCommentList.on("onItemClick",this.handleMiniCommentItemClick),this.editor.input.addHandler(new wW)}get commentProvider(){return this.provider}get isMobile(){return ie.isMobile}destroy(){var t,e;(t=this.commentList)==null||t.destroy(),(e=this.mobileCommentList)==null||e.destroy(),this.miniCommentList.destroy()}setFirstEditingCommentActive(){var t;(t=this.commentList)==null||t.setFirstEditingCommentActive()}isEditing(){var t,e;return((t=this.commentList)==null?void 0:t.isEditing())||((e=this.mobileCommentList)==null?void 0:e.isEditing())||!1}mount(t){var e;t.container&&this.commentList&&t.container.append((e=this.commentList)==null?void 0:e.root),t.miniContainer&&t.miniContainer.append(this.miniCommentList.root),t.mobileContainer&&this.mobileCommentList&&t.mobileContainer.append(this.mobileCommentList.root)}}const Bat="",hq={comment:{count:"\u6279\u6CE8 ({num})",hide:"\u9690\u85CF\u6279\u6CE8",show:"\u663E\u793A\u6279\u6CE8",reply:"\u56DE\u590D",quicklyReply:"\u56DE\u590D...",send:"\u786E\u5B9A",placeholder:"\u6DFB\u52A0\u6279\u6CE8...",replyPlaceholder:"\u6DFB\u52A0\u6279\u6CE8\u6216@\u4ED6\u4EBA",edit:"\u7F16\u8F91",delete:"\u5220\u9664",image:"\u56FE\u7247",sendTitle:"\u6309Enter\u53D1\u9001\u6279\u6CE8",replyTitle:"\u6309Enter\u56DE\u590D\u6279\u6CE8",isFirst:"\u5DF2\u7ECF\u662F\u7B2C\u4E00\u6761\u6279\u6CE8",isLast:"\u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u6761\u6279\u6CE8",more:"\u66F4\u591A",comment:"\u6279\u6CE8",command:"\u6279\u6CE8",quickMenuCommand:"\u6DFB\u52A0\u6279\u6CE8"}},mq={comment:{count:"Annotations ({num})",hide:"Hide Annotations",show:"Show Annotations",reply:"Reply",quicklyReply:"Reply...",send:"Confirm",placeholder:"Add a annotation...",replyPlaceholder:"Add annotation or mention someone",edit:"Edit",delete:"Delete",image:"Image",sendTitle:"Press Enter to post annotation",replyTitle:"Press Enter to reply to annotation",isFirst:"This is already the first comment",isLast:"This is already the last comment",more:"More",comment:"Annotation",command:"Annotation",quickMenuCommand:"Add annotation"}},gq={comment:{count:"\u6CE8\u91C8 ({num})",hide:"\u6CE8\u91C8\u3092\u975E\u8868\u793A",show:"\u6CE8\u91C8\u3092\u8868\u793A",reply:"\u8FD4\u4FE1",quicklyReply:"\u8FD4\u4FE1...",send:"\u78BA\u5B9A",placeholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0...",replyPlaceholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0\u3059\u308B\u304B\u30E1\u30F3\u30D0\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3",edit:"\u7DE8\u96C6",delete:"\u524A\u9664",image:"\u753B\u50CF",sendTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u9001\u4FE1",replyTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u8FD4\u4FE1",isFirst:"\u6700\u521D\u306E\u6CE8\u91C8\u3067\u3059",isLast:"\u6700\u5F8C\u306E\u6CE8\u91C8\u3067\u3059",more:"\u305D\u306E\u4ED6",comment:"\u6CE8\u91C8",command:"\u6CE8\u91C8",quickMenuCommand:"\u6CE8\u91C8\u3092\u8FFD\u52A0"}};D.mergeLang({"zh-CN":hq,"en-US":mq,"ja-JP":gq});class p4{renderText(t,e,r){const i=[],o={};return Object.entries(r).forEach(([s,l])=>{s.startsWith("comment-")&&(i.push("comment"),o[s]=l)}),{classes:i,attributes:o}}renderBox(t,e,r){const i=[],o={};return Object.entries(r).forEach(([s,l])=>{s.startsWith("comment-")&&(i.push("comment"),o[s]=l)}),{classes:i,attributes:o}}renderBlock(t,e,r){const i=r.comments;if(!i||i.length===0)return{};const o=["comment"],s={};return i.forEach(l=>{s[`comment-${l.toLocaleLowerCase()}`]=l}),{classes:o,attributes:s}}updateBlock(t,e,r,i){const o=i.comments;ot(r,"comment"),Array.from(r.attributes).forEach(s=>{s.name.startsWith("comment-")&&r.removeAttribute(s.name)}),!(!o||o.length===0)&&(z(r,"comment"),o.forEach(s=>{r.setAttribute(`comment-${s.toLocaleLowerCase()}`,s)}))}}class pq{constructor(t){m(this,"handleUpdateCompositionText",(t,e,r,i,o)=>{const s=t.getFocusedBlock(),l=t.getFirstBlock();s===l&&this.applyPlaceholder(t)});m(this,"handleSelectionChange",t=>{this.applyPlaceholder(t)});m(this,"applyPlaceholder",t=>{const e=t.getFirstBlock();df(t,e,D.t("comment.replyPlaceholder"))});this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange)}}function Cq(n,t,e){const r=n.getBlockData(t),i=r.comments;if((i==null?void 0:i.indexOf(e))!==-1){const s=new Set(i);s.delete(e),n.updateBlockData(t,{comments:Array.from(s)})}const o=r.text;if(!!o&&rt(n,t)){const s=v1(o,`comment-${e.toLocaleLowerCase()}`,e,{handleBox:!0,ignoreValue:!1});Gc.default(o,s)||n.setBlockText(t,s)}}const Eq=I("editor-comment");function xq(n){const t=n.getCustom("editor-comments");if(p(Eq,t,"the editor comment not exist"),t.showCommentList(),n.selection.range.isCollapsed()){const s=n.selection.startBlock,l=qo(s);if(l.length>=2){const{containerId:c}=l[l.length-1],d=Z(Ur(n,c));if(d&&Dt(d)==="code"){WE(n,d,t.commentProvider);return}}WE(n,s,t.commentProvider);return}const e=Ci(n,{simpleBlockOnly:!0}),r=e.map(s=>s.block),i=GE(n,r),o=im({editor:n,abstract:i});n.undoManager.runInGroup(()=>{e.forEach(l=>{rt(n,l.block)?m4(n,l,o):Gw(n,l.block,o)});const s=io();t.commentProvider.localCreateComment(o,s)})}const tx=I("text-styles");function Aq(n){const t=r=>{if(!r.attributes)return new Map;const i=Object.entries(r.attributes).filter(([o])=>!!o.startsWith("style-"));return new Map(i)};if(n.length===0)return new Map;let e=t(n[0]);for(let r=1;r<n.length;r++){if(to(n[r]))continue;const i=t(n[r]);e=new Map(Array.from(e.entries()).filter(([o,s])=>i.get(o)===s))}return e}function bq(n,t,e,r,i){p(tx,e.isSimple(),"invalid range");const{start:o,end:s}=e;p(tx,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range"),p(tx,r.startsWith("style-"),"invalid style");let c=n.getBlockText(t);return r==="style-sub"?c=va(o.offset,s.offset-o.offset,c,"style-super",i,{ignoreValue:!0}):r==="style-super"&&(c=va(o.offset,s.offset-o.offset,c,"style-sub",i,{ignoreValue:!0})),i===!1||i===void 0||i===null?c=va(o.offset,s.offset-o.offset,c,r,void 0,{ignoreValue:!0}):c=mu(o.offset,s.offset-o.offset,c,r,i),n.setBlockText(t,c),c}const vl=I("text-commands");function C4(n){const t={id:"more",name:D.t("commands.more"),icon:zp,childrenType:"menu",childrenPlacement:"bottom-start",manualShowChildren:!0,children:[]},e={"style-bold":[D.t("commands.bold"),qe("CtrlOrCmd+B"),ZT],"style-italic":[D.t("commands.italic"),qe("CtrlOrCmd+I"),ty],"style-underline":[D.t("commands.underline"),qe("CtrlOrCmd+U"),ey],"style-strikethrough":[D.t("commands.strikethrough"),qe("CtrlOrCmd+D"),ny],"style-code":[D.t("commands.code"),void 0,ry]},r={"style-super":[D.t("commands.superscript"),void 0,oy],"style-sub":[D.t("commands.subscript"),void 0,iy]};if(gn(n)===0){const l=Object.entries(e).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h}));return t.children=Object.entries(r).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h})),l.concat(t)}const i=Aq(n);function o([l,[c,d,h]]){const C=i.get(l);return C!==void 0?{id:l,name:c,value:C,states:C===!0?["checked"]:void 0,icon:h,desc:d}:{id:l,name:c,icon:h,desc:d}}const s=Object.entries(e).map(o);return t.children=Object.entries(r).map(o),s.concat(t)}function vq(n,t){const e=lt(t),r=Dt(t),i=Nr(n,t);return C4([]).map(o=>({blockId:e,blockType:r,blockKind:i,...o,groupIndex:500}))}function Bq(n,t,e){p(vl,e.isSimple(),"nor a simple range");const{start:r,end:i}=e;p(vl,r.isSimple(),"is not a simple block position"),p(vl,i.isSimple(),"is not a simple block position"),p(vl,rt(n,t),"invalid block type, not a text kind block");const o=lt(t);p(vl,r.blockId===o&&i.blockId===o,"invalid range");const s=n.getBlockText(t);let l=[];r.offset===i.offset?r.offset!==0&&(l=Je(s,r.offset-1,1).middle):l=Je(s,r.offset,i.offset-r.offset).middle;const c=Dt(t),d=Nr(n,t);return C4(l).map((h,C)=>({blockId:o,blockType:c,blockKind:d,...h,groupIndex:500,order:C*100}))}function Tq(n,t,e,r,i,o){if(!rt(n,t))return!1;if(!r.startsWith("style-"))return vl.warn(`unknown command: ${r}`),!1;const s=i==null?void 0:i.value,l=typeof s;if(l!=="string"&&l!=="number"&&l!=="boolean"&&l!=="undefined")return vl.warn(`invalid value type, accept string | number | boolean | undefined, current is ${l}`),!1;const c=bq(n,t,e,r,s);return o.result=c,!0}const yq=I("text-command-provider");class Di{constructor(t){m(this,"id","TextCommandProvider");m(this,"emptyTextBlockAttributes",new Map);m(this,"colorItem");m(this,"updateButtonColor",t=>{const e=t5(this.editor,t,this.getEmptyTextBlockColor);this.colorItem.updateButtonColor(e)});m(this,"handleChangeColor",(t,e)=>{if(t==="color"||t==="backgroundColor")JB(this.editor,t,e,this.setEmptyTextBlockColor);else{const r=["clearAll","clearColor","clearBackground"];ZB(this.editor,r[e],this.setEmptyTextBlockColor)}this.colorItem.setLatestColors(t,e)});m(this,"getEmptyTextBlockColor",(t,e)=>{const r=this.getEmptyBlockTextAttributes(t,e);return B1(r)});m(this,"setEmptyTextBlockColor",(t,e,r,i)=>{var s;const o=(s=this.emptyTextBlockAttributes.get(e))!=null?s:{};G3(o,r,i),this.emptyTextBlockAttributes.set(e,o)});this.editor=t,this.colorItem=t.addCustom("text-color-item",()=>new By(t)),this.colorItem.addListener("onClick",this.handleChangeColor)}destroy(){this.colorItem.destroy()}getAvailableCommands(t,e,r){if(!rt(t,e))return[];if(Jr(t))return[];let i;dt(t,e)===0?i=this.getCommandsOnEmptyText(t,e).map(Di.toTextCommand):i=Bq(t,e,r).map(Di.toTextCommand),this.updateButtonColor(r);const s={...this.colorItem,blockId:lt(e),blockKind:Nr(t,e),blockType:Dt(e),groupIndex:500,order:350};return i.push(s),i}executeCommand(t,e,r,i,o,s){if(!rt(t,e)||Jr(t))return!1;let l=o.value;l===void 0&&(l=!i.value);const c=Di.fromTextCommandId(i.id);if(c.startsWith("style-")){if(c==="style-font")return this.handleChangeColor(o.type,l),!0;if(dt(t,e)===0)return this.executeCommandOnEmptyText(e,i,{value:l})}return Tq(t,e,r,c,{value:l},s)}executeCommandOnEmptyText(t,e,r){let i=this.emptyTextBlockAttributes.get(lt(t));i||(i={},this.emptyTextBlockAttributes.set(lt(t),i));const o=Di.fromTextCommandId(e.id),s=r.value;return s==null||s===!1?(delete i[o],!0):(i[o]=r.value,!0)}getCommandsOnEmptyText(t,e){const r=vq(t,e);return this.setCommandsStates(r,e)}setCommandsStates(t,e){var o;const r=lt(e),i=(o=this.emptyTextBlockAttributes.get(r))!=null?o:{};return t.map(s=>{const l=i[s.id],c=l?["checked"]:void 0;return s.children&&(s.children=this.setCommandsStates(s.children,e)),{...s,value:l,states:c}})}getEmptyBlockTextAttributes(t,e){var i;const r=mt.default((i=this.emptyTextBlockAttributes.get(e))!=null?i:{});if(Array.from(Object.entries(r)).forEach(([o,s])=>{s||delete r[o]}),Object.keys(r).length!==0)return r}static toTextCommand(t){return t.children&&(t.children=t.children.map(Di.toTextCommand)),{...t,id:`text/${t.id}`}}static fromTextCommandId(t){const e="text/";return p(yq,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(Di.toTextCommand)}static fromTextCommands(t){return t.map(Di.fromTextCommand)}}function E4(n){const t=n.findCustom("toolbar-handler");t==null||t.disableTextToolbar(),t==null||t.hide(),setTimeout(()=>{t==null||t.enableTextToolbar()},300)}function kq(n){n.undoManager.canUndo()&&E4(n)}function Rq(n){n.undoManager.canRedo()&&E4(n)}const wq={"CtrlOrCmd+Z":kq,"CtrlOrCmd+Shift+Z":Rq},Sq={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"}},Lq={commands:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code",subscript:"Subscript",superscript:"Superscript",more:"More"}},Iq={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"}};D.mergeLang({"zh-CN":Sq,"en-US":Lq,"ja-JP":Iq});const Dq={embedProperties:{edit:"\u7F16\u8F91",addComment:"\u6DFB\u52A0\u6279\u6CE8"}},_q={embedProperties:{edit:"Edit",addComment:"Add annotation"}},Mq={embedProperties:{edit:"\u7DE8\u96C6",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0"}};D.mergeLang({"zh-CN":Dq,"en-US":_q,"ja-JP":Mq});const x4=I("embed-block-properties");function If(n,t){var e;for(const r of n.blockHooks){const i=(e=r.commands)==null?void 0:e.call(r,n,t);if(!!i&&i.group==="block-comment-actions")return i.executeCommand(n,t,i.commands[0]),!0}return!1}class ex{constructor(t,e,r){m(this,"group","hovering-toolbar");m(this,"_commands",[{id:"edit",name:D.t("embedProperties.edit"),icon:s0},{id:"add-comment",name:D.t("embedProperties.addComment"),icon:ul}]);this.editor=t,this.block=e,this.properties=r}get commands(){var i,o,s;if(this.editor.readonly)return[];let t=this._commands;const{enableComments:e=!0}=this.editor.options;e||(t=t.filter(l=>l.id!=="add-comment")),t.forEach(l=>{(l.id==="add-comment"||l.id==="edit")&&(l.states=this.editor.isBlockWritable(this.block)?[]:["disabled"])});let r=(i=this.properties)!=null&&i.presetIds?t.filter(l=>{var c,d;return(d=(c=this.properties)==null?void 0:c.presetIds)==null?void 0:d.includes(l.id)}):[...t];return(s=(o=this.properties)==null?void 0:o.extCommands)!=null&&s.length&&(r.length&&r.push({id:et(),type:"separator",name:""}),r.push(...this.properties.extCommands)),r.length<=3&&(r=r.filter(l=>l.id!=="separator")),r}executeCommand(t,e,r){var i,o;if(!((o=(i=this.properties)==null?void 0:i.handleExecuteCommand)!=null&&o.call(i,t,e,r))){if(r.id==="add-comment"){If(t,e)||x4.error("failed to add comment to block");return}x4.error(`unknown command: ${JSON.stringify(r)}`)}}}function nx(n,t,e){return{blockCommands:{"hovering-toolbar":new ex(n,t,e)}}}class Df{constructor(t){m(this,"blockResizer");m(this,"handleResizing",(t,e)=>{var i,o;const r=t.getBlock();if(r){if(((o=(i=Qt(this.editor,r)).notify)==null?void 0:o.call(i,this.editor,"resize",{block:r,rect:e}))===!0)return;const s=Math.max(e.height,100),d={...this.editor.getBlockData(r).embedData,height:s};this.editor.updateEmbedData(r,d)}});m(this,"handleHoveringBlockChange",(t,e)=>{e&&pe(e)&&wt(e,"resizable")&&this.disableResizer(),t&&pe(t)&&wt(t,"resizable")&&this.editor.isBlockWritable(t)&&this.tryEnableResizer(t)});this.editor=t,Re.get(t).addListener("change",this.handleHoveringBlockChange),this.blockResizer=new mf(this.editor,{resize:["bottom"]}),this.blockResizer.addListener("resizing",this.handleResizing)}destroy(){Re.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}tryEnableResizer(t){this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}static get(t){return t.addCustom("EmbedBlockResizer",()=>new Df(t))}static register(t,e){return z(e,"resizable"),t.addCustom("EmbedBlockResizer",()=>new Df(t))}}var A4=(n=>(n.Card="card",n.Preview="preview",n))(A4||{});const Uq=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
735
|
+
</svg>`,vat="",om="reply-editor-editing",{t:JE}=D;class WW{constructor(t,e,r,i){m(this,"root");m(this,"components");m(this,"handleFocus",()=>{const{replyEditor:t,okButton:e}=this.components;t.isEmpty()&&(e.disabled=!0)});m(this,"handleDocChange",()=>{const{replyEditor:t,okButton:e}=this.components,r=t.getDoc();O1(r)?e.disabled=!0:e.disabled=!1});m(this,"getReplyEditor",()=>this.components.replyEditor);m(this,"showReplyEditor",()=>{wt(this.root,om)||(z(this.root,om),this.components.replyEditor.edit())});m(this,"hideReplyEditor",()=>{!wt(this.root,om)||ot(this.root,om)});m(this,"reply",()=>{const{mainEditor:t,comment:e,components:{replyEditor:r},commentsProvider:i}=this,o=r.getDoc(),s=im({editor:t,commentGroupId:e.groupId,abstract:this.groupItem.comment.abstract});i.localCreateComment(s,o),this.hideReplyEditor(),r.clear()});m(this,"cancel",()=>{const{replyEditor:t}=this.components;this.hideReplyEditor(),t.clear()});m(this,"hide",()=>{wt(this.root,"hidden")||z(this.root,"hidden")});m(this,"show",()=>{ot(this.root,"hidden")});this.mainEditor=t,this.commentsProvider=e,this.comment=r,this.groupItem=i,this.root=v("div",["comment-quick-reply"],null),this.components=this.createQuickReply()}createQuickReply(){const{commentsProvider:t}=this,e=El(this.root,ee.QuickReply,JE("comment.placeholder"));po(e,ee.QuickReply),e.classList.add("quick-reply-button");const r=v("div",["quick-reply-editor"],this.root),i=io(),o=new QE(this.mainEditor,t,i);o.editor.addListener("docChanged",this.handleDocChange),o.editor.addListener("focus",this.handleFocus),o.editor.input.addHandler(new FW(this.groupItem)),r.append(o.root);const s=v("div",["reply-editor-actions"],r),l=br(ee.QuickReplyCancel,JE("common.cancel"));po(l,ee.QuickReplyCancel);const c=br(ee.QuickReplyOk,JE("comment.send"),void 0,["primary","disabled"]);return po(c,ee.QuickReplyOk),s.append(l,c),this.hideReplyEditor(),{replyTextButton:e,replyEditor:o,replyEditorContainer:r,okButton:c}}destroy(){this.components.replyEditor.destroy()}}const bs=I("comment-group-item");class qW extends ye.TypedEmitter{constructor(e,r,i,o){super();m(this,"root");m(this,"header");m(this,"mainItem");m(this,"childrenList");m(this,"resizeObserver");m(this,"quickReply");m(this,"createRoot",()=>v("div",["comment-group-item-root"],null));m(this,"createChildrenList",()=>{const e=v("div",["comment-children-list-container"],this.root);return new jW({editor:this.editor,commentsProvider:this.commentsProvider,comments:this.comment.children,parent:e,groupList:this.groupList,groupItem:this})});m(this,"updateLastCommentItem",()=>{const e=Array.from(this.root.querySelectorAll(":scope .comment-item-root"));p(bs,e.length!==0,"current group item not exist comment-item"),e.forEach(i=>{ot(i,Ww)});const r=e[e.length-1];z(r,Ww)});m(this,"updateSwitchButton",()=>{const e=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-up"]'),r=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-down"]');p(bs,e,"switchUpButton not exist"),p(bs,r,"switchDownButton not exist"),ot(r,"disabled"),ot(e,"disabled"),this.root.previousElementSibling===null&&z(e,"disabled"),this.root.nextElementSibling===null&&z(r,"disabled")});m(this,"handleReadonlyChanged",e=>{e.readonly?z(this.root,"readonly"):ot(this.root,"readonly")});m(this,"getCommentEditor",()=>this.mainItem.getCommentEditor());m(this,"handleResize",()=>{this.emit("resize")});this.editor=e,this.commentsProvider=r,this.comment=i,this.groupList=o,this.root=this.createRoot(),this.header=this.createHeader(),this.mainItem=this.createItem(),this.childrenList=this.createChildrenList(),this.quickReply=this.createQuickReply(),this.editor.on("readonlyChanged",this.handleReadonlyChanged),this.resizeObserver=new Vs(this.handleResize),this.resizeObserver.observe(this.root),this.updateLastCommentItem()}get commentCount(){return Xw(this.root)}createQuickReply(){const{editor:e,commentsProvider:r,comment:i}=this,o=new WW(e,r,i,this);return this.root.append(o.root),o}createHeader(){const{comment:e}=this,r=v("div",["comment-item-head"],this.root),i=v("span",["item-head-quote"],r);i.innerText=e.abstract;const o=v("span",["item-head-switch"],r),s=El(o,ee.SwitchUp,"up",zW),l=El(o,ee.SwitchDown,"down",GW);return po(s,ee.SwitchUp),po(l,ee.SwitchDown),r}createItem(){const e=v("div",["comment-item-container"],this.root),{editor:r,commentsProvider:i,comment:o,groupList:s}=this,l=new s4({mainEditor:r,commentsProvider:i,comment:o,groupList:s,groupItem:this});return e.appendChild(l.root),l}findCommentItem(e){return e?e===this.mainItem.comment.id?this.mainItem:this.childrenList.items.find(r=>r.comment.id===e):null}handleCreateComment(e){return p(bs,cc(e),"invalid comment, not a child comment"),p(bs,e.groupId===this.comment.id,"invalid comment, not a child comment"),this.childrenList.createItem(e)}handleUpdateChildComment(e){const r=this.childrenList.findItem(e.id);if(!r){bs.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(bs,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(bs,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}edit(){this.mainItem.edit()}destroy(){this.quickReply.destroy(),this.mainItem.destroy(),this.childrenList.destroy(),this.root.remove(),this.resizeObserver.disconnect(),this.removeAllListeners(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}}const XW=I("arrange=items"),a4=20;function c4(n,t){const e=n.rootContainer.querySelector(`[comment-${t.toLocaleLowerCase()}=${t}]`);if(!e)return-1;const r=n.scrollContainer.getBoundingClientRect(),i=n.scrollContainer.scrollTop;return e.getBoundingClientRect().top-r.top+i}function u4(n,t){return Number.parseInt(t.root.style.top,10)}function f4(n,t,e,r){let i=0;e&&(i=t.indexOf(e),i===-1&&(i=0));for(let o=i;o<t.length;o++){const s=t[o],l=s.comment,c=c4(n,l.groupId);if(s.root.setAttribute("data-target-top",c.toString()),o===i){if(r!==void 0){const C=t[0];C.root.style.top=`${r}px`}else s.root.style.top=`${c}px`;continue}const d=t[o-1],h=u4(n,d)+d.root.getBoundingClientRect().height;h>c?s.root.style.top=`${h+a4}px`:s.root.style.top=`${c}px`}for(let o=i-1;o>=0;o--){const s=t[o],l=s.comment,c=c4(n,l.groupId);s.root.setAttribute("data-target-top",c.toString());const d=s.root.getBoundingClientRect(),h=c+d.height,C=t[o+1];p(XW,C,"no next item");const E=u4(n,C);E<h?s.root.style.top=`${E-d.height-a4}px`:s.root.style.top=`${c}px`}setTimeout(()=>{n.scrollContainer.dispatchEvent(new Event("scroll"))},350)}const sm=I("comment-group-item-handler");class YW{constructor(t,e){m(this,"handleSwitchUp",t=>{const e=Math.max(0,t-1);this.groupList.setActiveItem(e,"prev"),this.groupList.updateItemsLayout()});m(this,"handleSwitchDown",t=>{const e=Math.min(t+1,this.groupList.items.length);this.groupList.setActiveItem(e,"next"),this.groupList.updateItemsLayout()});m(this,"handleQuickReply",t=>{const{quickReply:e}=t;e.showReplyEditor()});m(this,"handleQuickReplyOk",t=>{const{quickReply:e}=t;e.reply(),t.updateLastCommentItem()});m(this,"handleQuickReplyCancel",t=>{const{quickReply:e}=t;e.cancel()});m(this,"handleCommentItemReply",(t,e)=>{const r=t.findCommentItem(e);p(sm,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t;i.show(),i.showReplyEditor();const{comment:o}=r,s=i.getReplyEditor(),l=s.editor.getFocusedBlock(),c={type:"mention",id:et(),box:!0,created:Date.now(),text:o.displayName,iconUrl:o.avatarUrl,mentionId:o.userId};s.editor.insertBoxToBlock(l,0,c)});m(this,"handleCommentItemMore",t=>{const{quickReply:e}=t;e.hideReplyEditor(),e.getReplyEditor().clear()});m(this,"handleCommentItemOk",(t,e)=>{const r=t.findCommentItem(e);p(sm,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t,{comment:o,getCommentEditor:s}=r,l=s(),c=l.getDoc();this.commentsProvider.localUpdateComment(o,c),l.readonly(),i.show()});m(this,"handleCommentItemCancel",(t,e)=>{var c,d;const r=t.findCommentItem(e);p(sm,r,`the commentItem: ${e} not exist `);const i=this.commentsProvider.getComment(r.comment.id);let o=!1;if((c=i.blocks)!=null&&c.length||(o=!0),((d=i.blocks)==null?void 0:d.length)===1){const h=i.blocks[0];o=!!h.text&&gn(h.text)===0}if(o){this.commentsProvider.localDeleteComment(r.comment.id);return}const{quickReply:s}=t,l=r.getCommentEditor();l.setDoc(r.doc),l.readonly(),s.show()});m(this,"handleCommentItemEdit",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e;t.getCommentEditor().edit(),r.hide()});m(this,"handleCommentItemDelete",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e,{comment:i}=t;this.commentsProvider.localDeleteComment(i.id),r.show()});m(this,"execute",(t,e,r,i)=>{const o=IW(t);if(!o||_W(o))return;const s=DW(o);switch(s){case ee.SwitchUp:this.handleSwitchUp(i);break;case ee.SwitchDown:this.handleSwitchDown(i);break;case ee.CommentItemReply:this.handleCommentItemReply(e,r);break;case ee.CommentItemMore:this.handleCommentItemMore(e);break;case ee.CommentItemOk:this.handleCommentItemOk(e,r);break;case ee.CommentItemCancel:this.handleCommentItemCancel(e,r);break;case ee.CommentItemDelete:break;case ee.CommentItemEdit:break;case ee.QuickReply:this.handleQuickReply(e);break;case ee.QuickReplyOk:this.handleQuickReplyOk(e);break;case ee.QuickReplyCancel:this.handleQuickReplyCancel(e);break;default:const l=s;sm.debug(`not implement handler for ${l}`)}});this.groupList=t,this.commentsProvider=e}destroy(){}}const lm=I("comment-group-list");class QW extends Lf{constructor(e,r,i){super(e,r,i,As(e,r),{});m(this,"groupItemHandlers");m(this,"closeEditing",e=>{const r=this.items.find(i=>i.comment.id===e);r&&([r,...r.childrenList.items].forEach(i=>{!i.getCommentEditor().editor.readonly&&i.getCommentEditor().isEmpty()&&this.groupItemHandlers.handleCommentItemCancel(r,i.comment.id)}),r.quickReply.getReplyEditor().isEmpty()&&r.quickReply.cancel())});m(this,"setFirstEditingCommentActive",()=>{const e=this.findFirstEditingComment();e!==-1&&this.setActiveItem(e)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleContainerClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target.closest(".comment-group-item-root");if(!r)return;const i=LW(e.target),o=this.items.findIndex(s=>s.root===r);if(o!==-1){this.activeIndex!==o&&this.setActiveItem(o);const{groupItemHandlers:s}=this;s.execute(e.target,this.items[o],i,o)}});m(this,"handleDocumentClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target;if(r.closest(".comment-group-item-root.active")||r.closest(".editor-context-menu"))return;const s=this.items[this.activeIndex];!s||[s.findCommentItem(s.comment.id),...s.childrenList.items].some(c=>{var h;const d=(h=c==null?void 0:c.moreMenu.tippyInstance)==null?void 0:h.popper;return!!(d!=null&&d.contains(r))})||s!=null&&s.comment&&setTimeout(()=>{this.closeEditing(s.comment.id)})});m(this,"handleSelectionChanged",()=>{setTimeout(()=>{var r;const e=e4(this.editor);if(e.length>0){if(((r=this.activeItem)==null?void 0:r.comment.id)&&e.includes(this.activeItem.comment.id))return;const i=e[0],o=this.items.findIndex(s=>s.comment.groupId===i);this.setActiveItem(o),this.emit("selectionOnComment")}else this.setActiveItem(-1)})});m(this,"handleEditorResize",()=>{this.updateItemsLayout()});m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"handleItemResize",()=>{this.updateItemsLayout()});m(this,"handleScroll",e=>{if(e.deltaY>=0||this.editor.scrollContainer.scrollTop!==0)return;const r=Ae(e.clientX,e.clientY);if(!r||!(r instanceof HTMLElement)||!this.editor.scrollContainer.contains(r))return;const i=this.container.querySelector(".comment-group-item-root");if(!i)return;const o=Number.parseFloat(i.style.top),s=Number.parseFloat(i.getAttribute("data-target-top")||"0");!Number.isNaN(o)&&!Number.isNaN(s)&&o<s&&f4(this.editor,this.items,null,Math.min(o+(0-e.deltaY)*3,s))});m(this,"updateGroupItemSwitch",()=>{const e=this.activeItem;p(lm,e,"invalid activeItem"),e.updateSwitchButton()});m(this,"updateComments",ke.default(()=>{const e=As(this.editor,this.commentsProvider);let r=!1;for(let i=0;i<e.length;i++){const o=e[i];if(!this.findGroupItem(o.groupId)){this.handleCreateComment(o,!1),r=!0;continue}}for(let i=this.items.length-1;i>=0;i--){const o=this.items[i];e.findIndex(s=>s.groupId===o.comment.groupId)===-1&&(this.deleteItem(o.comment.id),r=!0)}r&&(this.updateItemsLayout(),this.emit("commentCountChanged"))},100));this.updateItemsLayout(),this.bindEvents(),this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("resize",this.handleEditorResize),this.editor.addListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.addEventListener("wheel",this.handleScroll,{passive:!1}),this.items.forEach(o=>o.addListener("resize",this.handleItemResize)),this.groupItemHandlers=new YW(this,r),document.addEventListener("click",this.handleDocumentClick)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("resize",this.handleEditorResize),this.editor.removeListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.removeEventListener("wheel",this.handleScroll),super.destroy(),this.unbindEvents(),this.removeAllListeners(),document.removeEventListener("click",this.handleDocumentClick)}updateItemsLayout(){f4(this.editor,this.items,this.activeItem)}bindEvents(){this.container.addEventListener("click",this.handleContainerClick)}unbindEvents(){this.container.removeEventListener("click",this.handleContainerClick)}createItem(e,r){const i=new qW(this.editor,this.commentsProvider,e,this);return r==="insert"&&(z(i.root,"no-animation"),i.root.style.opacity="0",setTimeout(()=>{ot(i.root,"no-animation"),i.root.style.opacity="1"},150)),i}findInsertPos(e){const i=As(this.editor,this.commentsProvider).findIndex(o=>o.id===e.id);return i===-1||i>this.items.length?-1:i}insertItem(e,r){const i=super.insertItem(e);return i?(r!=null&&r.active&&this.setActiveItem(this.items.indexOf(i)),this.updateItemsLayout(),i.addListener("resize",this.handleItemResize),i):null}findFirstEditingComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if((!i.quickReply.getReplyEditor().isEmpty()||e)&&!i.quickReply.getReplyEditor().editor.readonly)return r;const o=[i,...i.childrenList.items];for(let s=0;s<o.length;s++){const l=o[s];if(!l.getCommentEditor().editor.readonly&&(!l.getCommentEditor().isEmpty()||e))return r}}return-1}isEditing(){return this.findFirstEditingComment()!==-1}setActiveItem(e,r){if(p(lm,e>=-1&&e<this.items.length,`invalid index: ${e}`),e===this.activeIndex)return;const i=this.container.querySelector(".comment-group-item-root.active");if(i){const o=this.items[this.activeIndex];setTimeout(()=>{this.closeEditing(o.comment.id)}),ot(i,"active")}if(e!==-1){const o=this.items[e];z(o.root,"active"),this.updateItemsLayout(),this.updateGroupItemSwitch()}this.emit("activeItemChanged",e,r)}get activeIndex(){const e=this.container.querySelector(".comment-group-item-root.active");return e?this.items.findIndex(r=>r.root===e):-1}get activeItem(){const e=this.activeIndex;return e===-1?null:this.items[e]}handleCreateComment(e,r){if(cc(e)){const l=this.findGroupItem(e.groupId);l&&l.childrenList.insertItem(e)}const i=this.findItem(e.id);p(lm,!i,"comment group item has already exists");const o={children:[],...e};p(lm,o.children,"not a comment group");const s=this.insertItem(o,{active:r});if(!!s&&r){const l=this.items.indexOf(s);this.setActiveItem(l),s.quickReply.hide(),setTimeout(()=>{s.edit()},300)}}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?(this.deleteItem(i.comment.id),this.updateItemsLayout()):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&(this.deleteItem(i.comment.id),this.updateItemsLayout());return}}}handleUpdateComment(e){const r=this.findItemAsGroupId(e.groupId);if(r&&r.comment.id!==e.id){r.handleUpdateChildComment(e);return}const i=this.findItem(e.id);i&&i.handleUpdateMainComment(e)}}const JW="comment-mini";I("comment-list");class ZW extends ye.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"groupsContainer");m(this,"list");m(this,"handleSelectionOnComment",()=>{this.emit("onSelectComment")});m(this,"updateCommentCount",()=>{var r,i;const e=OW(this.editor,this.commentsProvider);(i=(r=this.commentOptions)==null?void 0:r.onCommentCountChange)==null||i.call(r,e)});m(this,"handleActiveItemChanged",(e,r)=>{var o,s;const i=this.list.activeItem;r4(this.editor,(s=(o=i==null?void 0:i.comment)==null?void 0:o.groupId)!=null?s:"",r)});m(this,"handleItemLayoutUpdated",()=>{var r,i;const e=wt(this.root,JW);(i=(r=this.commentOptions)==null?void 0:r.onUpdateLayout)==null||i.call(r,this.editor,{expand:e})});this.editor=e,this.commentsProvider=r,this.root=v("div",["editor-web-comment-root"],null),this.groupsContainer=v("div",["comment-groups-container"],this.root),this.list=this.createList(),this.commentsProvider.addListener(this),this.list.addListener("activeItemChanged",this.handleActiveItemChanged),this.list.addListener("itemLayoutUpdated",this.handleItemLayoutUpdated),this.list.addListener("selectionOnComment",this.handleSelectionOnComment),this.list.addListener("commentCountChanged",this.updateCommentCount),this.updateCommentCount()}get commentOptions(){return this.editor.getComponentOptions("comment")}destroy(){this.list.removeAllListeners(),this.commentsProvider.removeListener(this),this.list.destroy(),this.root.remove()}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r),this.updateCommentCount()}onDeleteComment(e,r){this.list.handleDeleteComment(e),this.updateCommentCount()}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}createList(){return new QW(this.editor,this.commentsProvider,this.groupsContainer)}isEditing(){return this.list.isEditing()}setFirstEditingCommentActive(){this.list.setFirstEditingCommentActive()}show(e){var r;if(ot(this.root,"hidden"),e){const i=this.list.findItemIndex(e);this.list.setActiveItem(i)}(r=this.commentOptions)==null||r.controller.showCommentList()}hide(){z(this.root,"hidden")}}class tq extends Lf{constructor({editor:t,parent:e,commentsProvider:r,comments:i}){super(t,r,e,i,{})}findInsertPos(){return this.items.length}createItem(t){const{editor:e,commentsProvider:r}=this;return new l4(e,r,t)}destroy(){this.items.forEach(t=>{t.destroy()})}}const am=I("mobile-comment-group-item"),eq=20;class nq extends ye.TypedEmitter{constructor(e,r,i){super();m(this,"root");m(this,"childrenList");m(this,"mainItem");m(this,"scroller");m(this,"createRoot",()=>v("div",["mobile-group-item-root"],null));m(this,"createMainItem",e=>{const{editor:r,commentsProvider:i,comment:o}=this,s=new l4(r,i,o);return e.append(s.root),s});m(this,"createChildrenList",e=>{const{editor:r,commentsProvider:i,comment:o}=this,s=v("div",["mobile-comment-children-list-container"],e);return new tq({editor:r,commentsProvider:i,comments:o.children,parent:s})});m(this,"handleTouchEnd",()=>{var o;const{scroller:e}=this,{pullThreshold:r=eq}=(o=this.editor.getComponentOptions("comment"))!=null?o:{};let i=null;if(e.y>e.minScrollY+r?(i=this.root.previousElementSibling,i||this.emit("onReachTop")):e.y<e.maxScrollY-r&&(i=this.root.nextElementSibling,i||this.emit("onReachBottom")),i){const s=i.id;this.emit("onSwitchGroup",s,qw)}});m(this,"refreshScroller",()=>{this.scroller.refresh()});this.editor=e,this.commentsProvider=r,this.comment=i,this.root=v("div",["mobile-group-item-root"],null),this.root.id=i.groupId;const o=v("div",["mobile-group-item"],this.root),s=v("div",["mobile-group-item-space"],null),l=v("div",["mobile-group-item-abstract"],null);l.textContent=i.abstract;const c=v("div",["mobile-group-item-list-container"],null);this.mainItem=this.createMainItem(c),this.childrenList=this.createChildrenList(c),o.append(s,l,c),this.scroller=new kb.default(this.root,{stopPropagation:!0,click:!0}),this.scroller.on("touchEnd",this.handleTouchEnd)}get commentCount(){return Xw(this.root,".mobile-group-item")}handleUpdateChildComment(e){p(am,e.groupId===this.mainItem.comment.id,"invalid child comment");const r=this.childrenList.findItem(e.id);if(!r){am.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(am,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(am,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}destroy(){this.mainItem.destroy(),this.childrenList.destroy(),this.scroller.off("touchEnd",this.handleTouchEnd),this.scroller.destroy(),this.root.remove(),this.removeAllListeners()}}const ZE=I("mobile-group-list");class rq extends Lf{constructor(e,r,i,o){super(e,r,i,As(e,r),{});m(this,"scroller");m(this,"refreshScroller",()=>{this.scroller.refresh(),this.items.forEach(e=>{e.refreshScroller()})});m(this,"deleteItem",e=>{if(this.items.length<=1)return super.deleteItem(e);const r=this.findItemIndex(e);let i=null;return r===0?i=this.items[r+1].root.id:i=this.items[r-1].root.id,super.deleteItem(e)?(this.scrollToGroup(i,qw),!0):!1});m(this,"setupGroupItem",e=>{e.on("onSwitchGroup",this.scrollToGroup),e.on("onReachBottom",this.handleReachBottom),e.on("onReachTop",this.handleReachTop),e.refreshScroller()});m(this,"handleReachBottom",()=>{this.emit("onReachBottom")});m(this,"handleReachTop",()=>{this.emit("onReachTop")});m(this,"scrollToGroup",(e,r=0)=>{const i=this.findGroupItem(e);p(ZE,i,"invalid scroll target"),this.scroller.scrollToElement(i.root,r,!1,!1),r4(this.editor,i.comment.groupId)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"updateComments",ke.default(()=>{const e=As(this.editor,this.commentsProvider);for(let r=0;r<e.length;r++){const i=e[r];if(!this.findGroupItem(i.groupId)){this.handleCreateComment(i,!1);continue}}for(let r=this.items.length-1;r>=0;r--){const i=this.items[r];e.findIndex(o=>o.groupId===i.comment.groupId)===-1&&this.deleteItem(i.comment.id)}},100));this.scroller=new kb.default(o),this.scroller.disable(),this.editor.addListener("docChanged",this.handleDocChanged),this.items.forEach(this.setupGroupItem)}createItem(e){return new nq(this.editor,this.commentsProvider,e)}insertItem(e){const r=super.insertItem(e);return r?(this.setupGroupItem(r),r):null}findInsertPos(e){const i=As(this.editor,this.commentsProvider).findIndex(o=>o.id===e.id);return i===-1||i>this.items.length?-1:i}setActiveItem(e){this.scrollToGroup(e)}handleCreateComment(e,r){if(cc(e)){const s=this.findGroupItem(e.groupId);s&&s.childrenList.insertItem(e)}const i=this.findItem(e.id);p(ZE,!i,"comment group item has already exists");const o={children:[],...e};p(ZE,o.children,"not a comment group"),this.insertItem(o),this.scroller.refresh()}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?this.deleteItem(i.comment.id):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&this.deleteItem(i.comment.id);return}}}handleUpdateComment(e){if(cc(e)){const i=this.commentsProvider.getComment(e.groupId),o=this.findItem(i.id);o&&o.handleUpdateChildComment(e);return}const r=this.findItem(e.id);r&&r.handleUpdateMainComment(e)}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),this.scroller.destroy(),this.items.forEach(e=>e.destroy())}}const iq=I("mobile-comment-list"),{t:d4}=D;class oq extends ye.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"list");m(this,"mask");m(this,"pullInfoContainer");m(this,"handleRootClick",e=>{const r=e.target;p(iq,r instanceof Element,"invalid target"),!(r.closest(".mobile-group-item-abstract")||r.closest(".mobile-group-item-list-container"))&&(this.hide(),this.emit("onCommentListClose"))});m(this,"hidePullInfo",ke.default(()=>{ot(this.pullInfoContainer,"active")},1e3*3));m(this,"handleReachBottom",()=>{this.showPullInfo("bottom")});m(this,"handleReachTop",()=>{this.showPullInfo("top")});m(this,"show",e=>{var r;ot(this.root,"hidden"),z(document.documentElement,"disabled-scroll"),(r=this.commentOptions)==null||r.controller.showCommentList(),queueMicrotask(()=>{this.list.refreshScroller(),e&&this.list.setActiveItem(e)})});m(this,"hide",()=>{z(this.root,"hidden"),ot(document.documentElement,"disabled-scroll")});this.editor=e,this.commentsProvider=r,this.root=v("div",["editor-mobile-comments-root"],null),this.mask=v("div",["mobile-comment-mask"],this.root);const i=v("div",["mobile-comment-groups-container"],this.root),o=v("div",["mobile-comment-groups-scroll-container"],i);this.list=new rq(this.editor,this.commentsProvider,o,i),this.pullInfoContainer=this.createPullInfo(),this.commentsProvider.addListener(this),this.list.on("onReachBottom",this.handleReachBottom),this.list.on("onReachTop",this.handleReachTop),this.root.onclick=this.handleRootClick}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}get commentOptions(){return this.editor.getComponentOptions("comment")}createPullInfo(){const e=v("div",["mobile-comment-pull-info-container"],this.root);return v("div",["mobile-comment-pull-info"],e),e}showPullInfo(e){const r=d4(e==="bottom"?"comment.isLast":"comment.isFirst");this.pullInfoContainer.firstElementChild.textContent=r,z(this.pullInfoContainer,"active"),this.hidePullInfo()}isEditing(){return!1}destroy(){this.list.removeAllListeners(),this.list.destroy(),this.root.onclick=null}}function h4(n,t){const e=As(n,t),r=new Map;for(const i of e){const o=Yw(n,i.groupId);if(!!o)if(r.has(o)){const s=r.get(o);t4(i).forEach(c=>{s==null||s.commentIds.add(c.id)})}else{const s=t4(i),l=new Set(s.map(c=>c.id));r.set(o,{commentIds:l,firstComment:i})}}return Array.from(r.entries()).map(([i,o])=>({blockId:i,...o}))}const sq=I("mini-group-item");class lq{constructor(t,e){m(this,"root");m(this,"blockId");m(this,"comment");m(this,"miniCommentItem");m(this,"updateCommentItemCount",()=>{this.miniCommentItem.updateCount(this.commentCount)});this.editor=t,this.commentGroup=e,this.root=v("div",["mini-group-item"],null),this.comment=e.firstComment,this.miniCommentItem=new HW(this.comment.id,this.root),this.blockId=this.getBlockId(),setTimeout(()=>{this.alignToBlock()}),this.updateCommentItemCount()}getBlockId(){return Yw(this.editor,this.comment.groupId)}get commentCount(){return this.commentGroup.commentIds.size}alignToBlock(){const t=this.getBlockId();if(!t)return;const e=this.editor.getBlockById(t);p(sq,e,`The blockId: ${t} not exist in doc`);const r=this.editor.scrollContainer.getBoundingClientRect(),i=this.editor.scrollContainer.scrollTop,s=e.getBoundingClientRect().top-r.top+i;requestAnimationFrame(()=>{this.root.style.transform=`translateY(${s}px)`})}destroy(){this.root.remove()}}class aq extends Lf{constructor(e,r,i){super(e,r,i,h4(e,r),{});m(this,"fixListOps",ke.default(()=>{this.items.forEach(e=>{e.alignToBlock()})},100));m(this,"handleDocChanged",ke.default(()=>{this.updateMiniCommentsGroup()},100));m(this,"updateMiniCommentsGroup",()=>{const e=h4(this.editor,this.commentsProvider);this.reloadList(e)});this.editor=e,this.commentsProvider=r,this.editor.addListener("docChanged",this.handleDocChanged),this.editor.addListener("resize",this.fixListOps)}createItem(e){return new lq(this.editor,e)}findInsertPos(){return-1}handleCreateComment(e,r){this.updateMiniCommentsGroup()}handleDeleteComment(e){this.updateMiniCommentsGroup()}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),super.destroy(),this.removeAllListeners()}}const cq=I("mini-comments-list");class uq extends ye.TypedEmitter{constructor(e,r){super();m(this,"list");m(this,"root");m(this,"createList",()=>{const e=v("div",["comment-groups-container"],this.root);return this.editor.domEvents.addEventListener(e,"click",this.handleListContainerClick),new aq(this.editor,this.commentsProvider,e)});m(this,"handleListContainerClick",(e,r)=>{const i=r.target;p(cq,i instanceof HTMLElement,"The target is not a valid html element");const o=i.closest(".mini-comment-item");o&&this.emit("onItemClick",o.id)});this.editor=e,this.commentsProvider=r,this.root=v("div",["editor-mini-comment-root"],null),this.list=this.createList(),this.commentsProvider.addListener(this)}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){}show(){ot(this.root,"hidden")}hide(){z(this.root,"hidden")}destroy(){this.list.destroy(),this.removeAllListeners()}}function m4(n,t,e){if(!t.start.isSimple()||!t.end.isSimple())return;const r=t.block,i=ve(n,r,t.start.offset,t.end.offset),o=`comment-${e.id.toLocaleLowerCase()}`,s=e.id;QB(n,r,i,o,s)}function fq(n,t,e){const r=Ci(n).map(s=>s.block),i=GE(n,r),o=im({editor:n,abstract:i});return n.undoManager.runInGroup(()=>{Ci(n,{simpleBlockOnly:!0}).forEach(c=>{!rt(n,c.block)||m4(n,c,o)});const l=io();e.localCreateComment(o,l)}),o}class dq{constructor(t,e){m(this,"id","CommentsCommandProvider");this.provider=t,this.editorComments=e}getAvailableCommands(t,e,r){const i=t.selection.range;if(rt(t,e)&&!r.isCollapsed()&&i.isSimple()){const o=lt(e),s=Dt(e),l=Nr(t,e);return[{id:"add-comment",name:D.t("comment.command"),blockId:o,blockType:s,blockKind:l,groupIndex:1e3,icon:ul}]}return[]}hideToolbar(t){const e=t.findCustom("toolbar-handler");e==null||e.disableTextToolbar(),e==null||e.hide(),setTimeout(()=>{e==null||e.enableTextToolbar()},300)}executeRangeCommand(t,e,r,i,o){if(r.id==="add-comment"){this.editorComments.showCommentList();const s=fq(t,e,this.provider);return o["add-comment"]=s,this.hideToolbar(t),!0}return!1}}class g4{constructor(t,e){m(this,"commentList",null);m(this,"mobileCommentList",null);m(this,"miniCommentList");m(this,"showComment",(t,e)=>{var r,i;t==="mini"&&this.miniCommentList.show(),t==="mobile"&&((r=this.mobileCommentList)==null||r.show(e)),t==="web"&&((i=this.commentList)==null||i.show(e))});m(this,"showCommentList",t=>{this.isMobile?this.showComment("mobile",t):this.showComment("web",t)});m(this,"handleCommentListClose",()=>{this.showComment("mini")});m(this,"handleOnSelectComment",()=>{this.showComment("web")});m(this,"handleMiniCommentItemClick",t=>{this.showCommentList(t)});this.editor=t,this.provider=e,t.editorCommandProviders.registerCommandProvider(new dq(e,this)),t.blockHooks.push(new RW(this.provider,this)),this.isMobile?(this.mobileCommentList=new oq(this.editor,this.provider),this.mobileCommentList.on("onCommentListClose",this.handleCommentListClose)):(this.commentList=new ZW(this.editor,this.provider),this.commentList.on("onSelectComment",this.handleOnSelectComment)),this.miniCommentList=new uq(this.editor,this.provider),this.miniCommentList.on("onItemClick",this.handleMiniCommentItemClick),this.editor.input.addHandler(new wW)}get commentProvider(){return this.provider}get isMobile(){return ie.isMobile}destroy(){var t,e;(t=this.commentList)==null||t.destroy(),(e=this.mobileCommentList)==null||e.destroy(),this.miniCommentList.destroy()}setFirstEditingCommentActive(){var t;(t=this.commentList)==null||t.setFirstEditingCommentActive()}isEditing(){var t,e;return((t=this.commentList)==null?void 0:t.isEditing())||((e=this.mobileCommentList)==null?void 0:e.isEditing())||!1}mount(t){var e;t.container&&this.commentList&&t.container.append((e=this.commentList)==null?void 0:e.root),t.miniContainer&&t.miniContainer.append(this.miniCommentList.root),t.mobileContainer&&this.mobileCommentList&&t.mobileContainer.append(this.mobileCommentList.root)}}const Bat="",hq={comment:{count:"\u6279\u6CE8 ({num})",hide:"\u9690\u85CF\u6279\u6CE8",show:"\u663E\u793A\u6279\u6CE8",reply:"\u56DE\u590D",quicklyReply:"\u56DE\u590D...",send:"\u786E\u5B9A",placeholder:"\u6DFB\u52A0\u6279\u6CE8...",replyPlaceholder:"\u6DFB\u52A0\u6279\u6CE8\u6216@\u4ED6\u4EBA",edit:"\u7F16\u8F91",delete:"\u5220\u9664",image:"\u56FE\u7247",sendTitle:"\u6309Enter\u53D1\u9001\u6279\u6CE8",replyTitle:"\u6309Enter\u56DE\u590D\u6279\u6CE8",isFirst:"\u5DF2\u7ECF\u662F\u7B2C\u4E00\u6761\u6279\u6CE8",isLast:"\u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u6761\u6279\u6CE8",more:"\u66F4\u591A",comment:"\u6279\u6CE8",command:"\u6279\u6CE8",quickMenuCommand:"\u6DFB\u52A0\u6279\u6CE8"}},mq={comment:{count:"Annotations ({num})",hide:"Hide Annotations",show:"Show Annotations",reply:"Reply",quicklyReply:"Reply...",send:"Confirm",placeholder:"Add a annotation...",replyPlaceholder:"Add annotation or mention someone",edit:"Edit",delete:"Delete",image:"Image",sendTitle:"Press Enter to post annotation",replyTitle:"Press Enter to reply to annotation",isFirst:"This is already the first comment",isLast:"This is already the last comment",more:"More",comment:"Annotation",command:"Annotation",quickMenuCommand:"Add annotation"}},gq={comment:{count:"\u6CE8\u91C8 ({num})",hide:"\u6CE8\u91C8\u3092\u975E\u8868\u793A",show:"\u6CE8\u91C8\u3092\u8868\u793A",reply:"\u8FD4\u4FE1",quicklyReply:"\u8FD4\u4FE1...",send:"\u78BA\u5B9A",placeholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0...",replyPlaceholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0\u3059\u308B\u304B\u30E1\u30F3\u30D0\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3",edit:"\u7DE8\u96C6",delete:"\u524A\u9664",image:"\u753B\u50CF",sendTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u9001\u4FE1",replyTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u8FD4\u4FE1",isFirst:"\u6700\u521D\u306E\u6CE8\u91C8\u3067\u3059",isLast:"\u6700\u5F8C\u306E\u6CE8\u91C8\u3067\u3059",more:"\u305D\u306E\u4ED6",comment:"\u6CE8\u91C8",command:"\u6CE8\u91C8",quickMenuCommand:"\u6CE8\u91C8\u3092\u8FFD\u52A0"}};D.mergeLang({"zh-CN":hq,"en-US":mq,"ja-JP":gq});class p4{renderText(t,e,r){const i=[],o={};return Object.entries(r).forEach(([s,l])=>{s.startsWith("comment-")&&(i.push("comment"),o[s]=l)}),{classes:i,attributes:o}}renderBox(t,e,r){const i=[],o={};return Object.entries(r).forEach(([s,l])=>{s.startsWith("comment-")&&(i.push("comment"),o[s]=l)}),{classes:i,attributes:o}}renderBlock(t,e,r){const i=r.comments;if(!i||i.length===0)return{};const o=["comment"],s={};return i.forEach(l=>{s[`comment-${l.toLocaleLowerCase()}`]=l}),{classes:o,attributes:s}}updateBlock(t,e,r,i){const o=i.comments;ot(r,"comment"),Array.from(r.attributes).forEach(s=>{s.name.startsWith("comment-")&&r.removeAttribute(s.name)}),!(!o||o.length===0)&&(z(r,"comment"),o.forEach(s=>{r.setAttribute(`comment-${s.toLocaleLowerCase()}`,s)}))}}class pq{constructor(t){m(this,"handleUpdateCompositionText",(t,e,r,i,o)=>{const s=t.getFocusedBlock(),l=t.getFirstBlock();s===l&&this.applyPlaceholder(t)});m(this,"handleSelectionChange",t=>{this.applyPlaceholder(t)});m(this,"applyPlaceholder",t=>{const e=t.getFirstBlock();df(t,e,D.t("comment.replyPlaceholder"))});this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange)}}function Cq(n,t,e){const r=n.getBlockData(t),i=r.comments;if((i==null?void 0:i.indexOf(e))!==-1){const s=new Set(i);s.delete(e),n.updateBlockData(t,{comments:Array.from(s)})}const o=r.text;if(!!o&&rt(n,t)){const s=v1(o,`comment-${e.toLocaleLowerCase()}`,e,{handleBox:!0,ignoreValue:!1});Gc.default(o,s)||n.setBlockText(t,s)}}const Eq=I("editor-comment");function xq(n){const t=n.getCustom("editor-comments");if(p(Eq,t,"the editor comment not exist"),t.showCommentList(),n.selection.range.isCollapsed()){const s=n.selection.startBlock,l=qo(s);if(l.length>=2){const{containerId:c}=l[l.length-1],d=Z(Ur(n,c));if(d&&Dt(d)==="code"){WE(n,d,t.commentProvider);return}}WE(n,s,t.commentProvider);return}const e=Ci(n,{simpleBlockOnly:!0}),r=e.map(s=>s.block),i=GE(n,r),o=im({editor:n,abstract:i});n.undoManager.runInGroup(()=>{e.forEach(l=>{rt(n,l.block)?m4(n,l,o):Gw(n,l.block,o)});const s=io();t.commentProvider.localCreateComment(o,s)})}const tx=I("text-styles");function Aq(n){const t=r=>{if(!r.attributes)return new Map;const i=Object.entries(r.attributes).filter(([o])=>!!o.startsWith("style-"));return new Map(i)};if(n.length===0)return new Map;let e=t(n[0]);for(let r=1;r<n.length;r++){if(to(n[r]))continue;const i=t(n[r]);e=new Map(Array.from(e.entries()).filter(([o,s])=>i.get(o)===s))}return e}function bq(n,t,e,r,i){p(tx,e.isSimple(),"invalid range");const{start:o,end:s}=e;p(tx,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range"),p(tx,r.startsWith("style-"),"invalid style");let c=n.getBlockText(t);return r==="style-sub"?c=va(o.offset,s.offset-o.offset,c,"style-super",i,{ignoreValue:!0}):r==="style-super"&&(c=va(o.offset,s.offset-o.offset,c,"style-sub",i,{ignoreValue:!0})),i===!1||i===void 0||i===null?c=va(o.offset,s.offset-o.offset,c,r,void 0,{ignoreValue:!0}):c=mu(o.offset,s.offset-o.offset,c,r,i),n.setBlockText(t,c),c}const vl=I("text-commands");function C4(n){const t={id:"more",name:D.t("commands.more"),icon:zp,childrenType:"menu",childrenPlacement:"bottom-start",manualShowChildren:!0,children:[]},e={"style-bold":[D.t("commands.bold"),qe("CtrlOrCmd+B"),ZT],"style-italic":[D.t("commands.italic"),qe("CtrlOrCmd+I"),ty],"style-underline":[D.t("commands.underline"),qe("CtrlOrCmd+U"),ey],"style-strikethrough":[D.t("commands.strikethrough"),qe("CtrlOrCmd+D"),ny],"style-code":[D.t("commands.code"),void 0,ry]},r={"style-super":[D.t("commands.superscript"),void 0,oy],"style-sub":[D.t("commands.subscript"),void 0,iy]};if(gn(n)===0){const l=Object.entries(e).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h}));return t.children=Object.entries(r).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h})),l.concat(t)}const i=Aq(n);function o([l,[c,d,h]]){const C=i.get(l);return C!==void 0?{id:l,name:c,value:C,states:C===!0?["checked"]:void 0,icon:h,desc:d}:{id:l,name:c,icon:h,desc:d}}const s=Object.entries(e).map(o);return t.children=Object.entries(r).map(o),s.concat(t)}function vq(n,t){const e=lt(t),r=Dt(t),i=Nr(n,t);return C4([]).map(o=>({blockId:e,blockType:r,blockKind:i,...o,groupIndex:500}))}function Bq(n,t,e){p(vl,e.isSimple(),"nor a simple range");const{start:r,end:i}=e;p(vl,r.isSimple(),"is not a simple block position"),p(vl,i.isSimple(),"is not a simple block position"),p(vl,rt(n,t),"invalid block type, not a text kind block");const o=lt(t);p(vl,r.blockId===o&&i.blockId===o,"invalid range");const s=n.getBlockText(t);let l=[];r.offset===i.offset?r.offset!==0&&(l=Je(s,r.offset-1,1).middle):l=Je(s,r.offset,i.offset-r.offset).middle;const c=Dt(t),d=Nr(n,t);return C4(l).map((h,C)=>({blockId:o,blockType:c,blockKind:d,...h,groupIndex:500,order:C*100}))}function Tq(n,t,e,r,i,o){if(!rt(n,t))return!1;if(!r.startsWith("style-"))return vl.warn(`unknown command: ${r}`),!1;const s=i==null?void 0:i.value,l=typeof s;if(l!=="string"&&l!=="number"&&l!=="boolean"&&l!=="undefined")return vl.warn(`invalid value type, accept string | number | boolean | undefined, current is ${l}`),!1;const c=bq(n,t,e,r,s);return o.result=c,!0}const yq=I("text-command-provider");class Di{constructor(t){m(this,"id","TextCommandProvider");m(this,"emptyTextBlockAttributes",new Map);m(this,"colorItem");m(this,"updateButtonColor",t=>{const e=t5(this.editor,t,this.getEmptyTextBlockColor);this.colorItem.updateButtonColor(e)});m(this,"handleChangeColor",(t,e)=>{if(t==="color"||t==="backgroundColor")JB(this.editor,t,e,this.setEmptyTextBlockColor);else{const r=["clearAll","clearColor","clearBackground"];ZB(this.editor,r[e],this.setEmptyTextBlockColor)}this.colorItem.setLatestColors(t,e)});m(this,"getEmptyTextBlockColor",(t,e)=>{const r=this.getEmptyBlockTextAttributes(t,e);return B1(r)});m(this,"setEmptyTextBlockColor",(t,e,r,i)=>{var s;const o=(s=this.emptyTextBlockAttributes.get(e))!=null?s:{};G3(o,r,i),this.emptyTextBlockAttributes.set(e,o)});this.editor=t,this.colorItem=t.addCustom("text-color-item",()=>new By(t)),this.colorItem.addListener("onClick",this.handleChangeColor)}destroy(){this.colorItem.destroy()}getAvailableCommands(t,e,r){if(!rt(t,e))return[];if(Jr(t))return[];let i;dt(t,e)===0?i=this.getCommandsOnEmptyText(t,e).map(Di.toTextCommand):i=Bq(t,e,r).map(Di.toTextCommand),this.updateButtonColor(r);const s={...this.colorItem,blockId:lt(e),blockKind:Nr(t,e),blockType:Dt(e),groupIndex:500,order:350};return i.push(s),i}executeCommand(t,e,r,i,o,s){if(!rt(t,e)||Jr(t))return!1;let l=o.value;l===void 0&&(l=!i.value);const c=Di.fromTextCommandId(i.id);if(c.startsWith("style-")){if(c==="style-font")return this.handleChangeColor(o.type,l),!0;if(dt(t,e)===0)return this.executeCommandOnEmptyText(e,i,{value:l})}return Tq(t,e,r,c,{value:l},s)}executeCommandOnEmptyText(t,e,r){let i=this.emptyTextBlockAttributes.get(lt(t));i||(i={},this.emptyTextBlockAttributes.set(lt(t),i));const o=Di.fromTextCommandId(e.id),s=r.value;return s==null||s===!1?(delete i[o],!0):(i[o]=r.value,!0)}getCommandsOnEmptyText(t,e){const r=vq(t,e);return this.setCommandsStates(r,e)}setCommandsStates(t,e){var o;const r=lt(e),i=(o=this.emptyTextBlockAttributes.get(r))!=null?o:{};return t.map(s=>{const l=i[s.id],c=l?["checked"]:void 0;return s.children&&(s.children=this.setCommandsStates(s.children,e)),{...s,value:l,states:c}})}getEmptyBlockTextAttributes(t,e){var i;const r=mt.default((i=this.emptyTextBlockAttributes.get(e))!=null?i:{});if(Array.from(Object.entries(r)).forEach(([o,s])=>{s||delete r[o]}),Object.keys(r).length!==0)return r}static toTextCommand(t){return t.children&&(t.children=t.children.map(Di.toTextCommand)),{...t,id:`text/${t.id}`}}static fromTextCommandId(t){const e="text/";return p(yq,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(Di.toTextCommand)}static fromTextCommands(t){return t.map(Di.fromTextCommand)}}function E4(n){const t=n.findCustom("toolbar-handler");t==null||t.disableTextToolbar(),t==null||t.hide(),setTimeout(()=>{t==null||t.enableTextToolbar()},300)}function kq(n){n.undoManager.canUndo()&&E4(n)}function Rq(n){n.undoManager.canRedo()&&E4(n)}const wq={"CtrlOrCmd+Z":kq,"CtrlOrCmd+Shift+Z":Rq},Sq={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"}},Lq={commands:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code",subscript:"Subscript",superscript:"Superscript",more:"More"}},Iq={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"}};D.mergeLang({"zh-CN":Sq,"en-US":Lq,"ja-JP":Iq});const Dq={embedProperties:{edit:"\u7F16\u8F91",addComment:"\u6DFB\u52A0\u6279\u6CE8"}},_q={embedProperties:{edit:"Edit",addComment:"Add annotation"}},Mq={embedProperties:{edit:"\u7DE8\u96C6",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0"}};D.mergeLang({"zh-CN":Dq,"en-US":_q,"ja-JP":Mq});const x4=I("embed-block-properties");function If(n,t){var e;for(const r of n.blockHooks){const i=(e=r.commands)==null?void 0:e.call(r,n,t);if(!!i&&i.group==="block-comment-actions")return i.executeCommand(n,t,i.commands[0]),!0}return!1}class ex{constructor(t,e,r){m(this,"group","hovering-toolbar");m(this,"_commands",[{id:"edit",name:D.t("embedProperties.edit"),icon:s0},{id:"add-comment",name:D.t("embedProperties.addComment"),icon:ul}]);this.editor=t,this.block=e,this.properties=r}get commands(){var i,o,s;if(this.editor.readonly)return[];let t=this._commands;const{enableComments:e=!0}=this.editor.options;e||(t=t.filter(l=>l.id!=="add-comment")),t.forEach(l=>{(l.id==="add-comment"||l.id==="edit")&&(l.states=this.editor.isBlockWritable(this.block)?[]:["disabled"])});let r=(i=this.properties)!=null&&i.presetIds?t.filter(l=>{var c,d;return(d=(c=this.properties)==null?void 0:c.presetIds)==null?void 0:d.includes(l.id)}):[...t];return(s=(o=this.properties)==null?void 0:o.extCommands)!=null&&s.length&&(r.length&&r.push({id:et(),type:"separator",name:""}),r.push(...this.properties.extCommands)),r.length<=3&&(r=r.filter(l=>l.id!=="separator")),r}executeCommand(t,e,r){var i,o;if(!((o=(i=this.properties)==null?void 0:i.handleExecuteCommand)!=null&&o.call(i,t,e,r))){if(r.id==="add-comment"){If(t,e)||x4.error("failed to add comment to block");return}x4.error(`unknown command: ${JSON.stringify(r)}`)}}}function nx(n,t,e){return{blockCommands:{"hovering-toolbar":new ex(n,t,e)}}}class Df{constructor(t){m(this,"blockResizer");m(this,"handleResizing",(t,e)=>{var i,o;const r=t.getBlock();if(r){if(((o=(i=Qt(this.editor,r)).notify)==null?void 0:o.call(i,this.editor,"resize",{block:r,rect:e}))===!0)return;const s=Math.max(e.height,100),d={...this.editor.getBlockData(r).embedData,height:s};this.editor.updateEmbedData(r,d)}});m(this,"handleHoveringBlockChange",(t,e)=>{e&&pe(e)&&wt(e,"resizable")&&this.disableResizer(),t&&pe(t)&&wt(t,"resizable")&&this.editor.isBlockWritable(t)&&this.tryEnableResizer(t)});this.editor=t,Re.get(t).addListener("change",this.handleHoveringBlockChange),this.blockResizer=new mf(this.editor,{resize:["bottom"]}),this.blockResizer.addListener("resizing",this.handleResizing)}destroy(){Re.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}tryEnableResizer(t){this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}static get(t){return t.addCustom("EmbedBlockResizer",()=>new Df(t))}static register(t,e){return z(e,"resizable"),t.addCustom("EmbedBlockResizer",()=>new Df(t))}}var A4=(n=>(n.Card="card",n.Preview="preview",n))(A4||{});const Uq=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
736
736
|
<path d="M6.49669 1C4.80282 1 3.0118 2.3515 3.0118 3.76237L3 10.6206M6.49669 1C8.41943 1 10.0154 2.60058 10.0154 4.17342M6.49669 1C7.43289 1 8.28684 1.42118 8.90405 1.96796C9.50746 2.50252 10.0154 3.29036 10.0154 4.17342M10.0154 4.17342L10.0154 9.61446C10.0154 10.4166 9.23033 11.2316 8 11.2316C6.91283 11.2316 6.01026 10.5735 6.01026 9.87981L5.98457 5.04102M3 10.6206C3 13.1126 5.38055 15 8 15M3 10.6206C3 12.9301 5.13252 15 8 15M8 15C10.6194 15 13 13.1988 13 10.7068M8 15C10.8675 15 13 13.0162 13 10.7068M13 10.7068V5.04102" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>
|
|
737
737
|
<path d="M13 4V10C13 12.7614 10.7614 15 8 15C5.23858 15 3 12.7614 3 10V4.5" stroke="currentColor"/>
|
|
738
738
|
<path d="M10 9V4.5C10 2.567 8.433 1 6.5 1C4.567 1 3 2.567 3 4.5" stroke="currentColor"/>
|
|
@@ -959,4 +959,4 @@ ${o.mermaidText}
|
|
|
959
959
|
${o.flowchartText}
|
|
960
960
|
\`\`\`\`\`\``}return""}const LJ={embedType:"flowchart",convertFrom:RJ,handleUpdateBlock:kJ,createEmbedContent:yJ,getBlockProperties:wJ,convertTo:SJ},IJ=I("plantuml-helper");function yS(n,t){var l;let r=((l=(n.getComponentOptions("plantuml")||{}).cdn)==null?void 0:l.plantuml)||aJ;r.endsWith("/")||(r+="/");const i=i9.default.encode(t);p(IJ,i,i),r+=i;const s=new URLSearchParams(document.location.search).get("doc");return Fg(r,{id:`${s}-${et()}`})}async function DJ(n,t){try{const e=await xx(n,t);return(await n.doc.uploadResource(e)).resourceId}catch{return Promise.resolve(t)}}class Cc extends Bx{constructor(t){super(t,"plantuml","plantumlText")}static get(t,e){return t.addCustom(`plantuml-${e.id}`,()=>new Cc(t))}code2ObjectUrl(t){return Promise.resolve(yS(this.editor,t))}code2ResourceId(t){const e=yS(this.editor,t);return DJ(this.editor,e)}destroy(){}}function _J(n,t,e){Cc.get(n,e).createEmbedContent(t,e)}function MJ(n,t,e){const r=Cc.get(n,e),i=Nt(t);return r.updateEmbedContent(i,e),!0}function UJ(n,t,e){const{data:r}=e,i=n.getBlockString(t).trim();if(!r||r.embedType!=="plantuml"||i!=="```plantuml"||!rt(n,t))return null;const o={src:"",plantumlText:""};return{blockData:{id:et(),type:"embed",embedType:"plantuml",embedData:o},onConverted:(c,d)=>{Cc.get(c,c.getBlockData(d)).editGraph(Nt(d))}}}function OJ(n,t){return Cc.get(n,n.getBlockData(t)).getBlockProperties(t)}function NJ(n,t,e,r){const{embedData:i}=t,o=i;if(r==="html")return o.src?`<img src="${n.doc.buildResourceUrl(o.src,{withToken:!0})}" />`:o.flowchartText?`<div>${o.flowchartText}</div>`:"<p>[plantuml]</p>";if(r==="markdown"){if(o.src)return`})`;if(o.flowchartText)return`\`\`\`plantuml\`\`\`
|
|
961
961
|
${o.flowchartText}
|
|
962
|
-
\`\`\`\`\`\``}return""}const PJ={embedType:"plantuml",convertFrom:UJ,handleUpdateBlock:MJ,createEmbedContent:_J,getBlockProperties:OJ,convertTo:NJ},Hat="",FJ="hr",KJ={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},VJ={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},$J={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};D.mergeLang({"zh-CN":KJ,"en-US":VJ,"ja-JP":$J});function HJ(n,t){const e=v("div",["editor-embed-container"],t);v("hr",["editor-embed-hr"],e)}function jJ(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function zJ(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:D.t("dividingLine.type"),icon:FT,order:500,group:"common",subText:kn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,FJ,{})}}}function GJ(n,t,e){const{data:r}=e;if(!r||r.embedType!=="dividing-line"||!rt(n,t))return null;const i={};return{blockData:{id:et(),type:"embed",embedType:"hr",embedData:i}}}function WJ(){return{abstract:D.t("dividingLine.abstract")}}const qJ={embedType:"hr",createEmbedContent:HJ,convertTo:jJ,getOptions:zJ,convertFrom:GJ,getBlockProperties:WJ},jat="",zat="",XJ={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>',maxSizeFailed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6</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"}}},YJ={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>',maxSizeFailed:'<div class="line-1">{name} upload failed</div><div class="line-2">The file size exceeds limit. Please choose another file.</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"}}},QJ={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>',maxSizeFailed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u30D5\u30A1\u30A4\u30EB\u306E\u30B5\u30A4\u30BA\u304C\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u308B\u305F\u3081\u3001\u4ED6\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044</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"}}};D.mergeLang({"zh-CN":XJ,"en-US":YJ,"ja-JP":QJ});var ni=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(ni||{}),Of=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(Of||{});const kS=10*1024*1024,JJ=["wav","mp3","aac","ogg","webm","flac"],ZJ=["ogg","mp4","webm"],tZ=()=>{};function RS(n){var h,C,E,x,B,k;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:r,callbacks:i}=t,o=(C=e==null?void 0:e.audio)!=null?C:JJ,s=(E=e==null?void 0:e.video)!=null?E:ZJ,l=(x=r==null?void 0:r.audio)!=null?x:kS,c=(B=r==null?void 0:r.video)!=null?B:kS,d=(k=i==null?void 0:i.onError)!=null?k:tZ;return{allowedMedias:{audio:o,video:s},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function eZ(n,t){const e=o=>o.map(s=>`.${s}`).join(","),{allowedMedias:r}=RS(n),i=r[t];return i?e(i):"*"}function nZ(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:o}=RS(t),{[e]:s}=r,{[e]:l}=o;if(s&&n.size>s){const d=new Error("media is too large");throw d.code=`MaxMediaSize-${e}`,i!=null&&i.onError&&(i==null||i.onError(t,d)),d}const c=eu(n.name);if(l&&!l.includes(c.toLowerCase())){const d=new Error(`media file is not allowed: ${c}`);throw d.code="NotAllowedFile",i!=null&&i.onError&&(i==null||i.onError(t,d)),d}}function rZ(n){return n===Of.Empty||n===Of.Error}const en=I("media");class iZ extends ye.TypedEmitter{constructor(e){super();m(this,"mediaContainer",null);m(this,"media",null);m(this,"abstract",null);m(this,"handleMediaLoadError",(e,r)=>{if(!r.target||!(r.target instanceof Node)||!(r.target instanceof Element?r.target:r.target.parentElement))return;const o=Z(r.target);if(!o||!o.contains(this.mediaContainer))return;const s=this.renderError();this.updateMediaContent(s),this.emit("mediaError",e,"load_error",lt(o))});m(this,"handleUploadFile",async e=>{p(en,this.abstract,"no abstract"),p(en,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=Z(this.mediaContainer);p(en,i,"The block element not exist");const o=r.getBlockData(i);try{const{resourceId:s}=await r.doc.uploadResource(e,{onProgress:C=>{this.renderProgress(C,e)}}),{name:l,type:c,size:d}=e,h={...o,embedData:{...o.embedData,src:s,fileName:l,fileSize:d,fileType:c}};r.updateBlockData(i,h)}catch(s){en.error(s),this.emit("mediaError",r,"upload_error",o.id),this.renderRetry(e,s)}ot(i,"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){p(en,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(en,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:o}=this.abstract;p(en,this.mediaContainer,"The media element not exist");const s=Z(this.mediaContainer);p(en,s,"The block element not exist");const l=e.getBlockData(s),c=v("div",["media-error","embed-selected-content","embed-hover-content"],null),d=v("span",["media-error-icon"],c);d.innerHTML=i;const h=v("div",[],c);h.innerHTML=D.t("media.load.failed",{name:o}),c.appendChild(h);const C=h.querySelector(".retry-upload");return p(en,C,"The element not exist"),e.domEvents.addEventListener(C,"click",(E,x)=>{const B=v("div",["media-element"],null),k=this.getResourceUrl(l),w=r(E,B,l,k);this.unbindMediaEvent(),this.media=w,this.bindMediaEvent(),this.updateMediaContent(B)}),this.setFullScreen(),c}renderRetry(e,r){var E,x;p(en,this.abstract,"no abstract");const{editor:i}=this.options,{mediaIcon:o,mediaName:s}=this.abstract,l=v("div",["media-error","embed-selected-content","embed-hover-content"],null),c=v("span",["media-error-icon"],l);c.innerHTML=o;const d=v("div",[],l);let h=D.t("media.upload.failed",{name:s});(((E=r.response)==null?void 0:E.status)===420||((x=r.response)==null?void 0:x.status)===413)&&(h=D.t("media.upload.maxSizeFailed",{name:s})),d.innerHTML=h,l.appendChild(d);const C=d.querySelector(".retry-upload");C&&i.domEvents.addEventListener(C,"click",()=>{i.readonly||(p(en,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(en,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope .media-progress"),o=e===-1||e===100?100:e;if(i){const{updateProgressElement:s}=this.options;s(i,o)}else{const{createProgressElement:s}=this.options,l=Z(this.mediaContainer);p(en,l,"The element not exist"),z(l,"media-block-uploading");const c=v("div",["media-progress"],null);s(c,o,r),this.updateMediaContent(c)}this.setFullScreen()}renderMediaElement(e,r){p(en,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:o,updateMediaElement:s,editor:l}=this.options,c=this.getResourceUrl(e,r);if(i){const d=s(l,i,e,c);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent()}else{const d=v("div",["media-element"],null),h=o(l,d,e,c);this.unbindMediaEvent(),this.media=h,this.bindMediaEvent(),this.updateMediaContent(d)}}renderEmpty(e){p(en,this.abstract,"no abstract"),p(en,this.mediaContainer,"The media element not exist");const r=v("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);r.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(r);const{editor:i}=this.options;i.findBlockById(e.id)&&this.emit("mediaError",i,"empty",e.id),this.setFullScreen()}getResourceUrl(e,r){const{src:i}=e.embedData,{editor:o}=this.options;return o.doc.buildResourceUrl(i,{syncNewResources:async(s,l)=>{var d,h;if(!r)return;await o.doc.addResources([s]);const c=(h=(d=o.doc).getServerMeta)==null?void 0:h.call(d).appId;if(l!==e.embedData.src&&c&&e.embedData.src.includes(c)){const C=Z(r);if(C&&!o.readonly&&o.isBlockWritable(C)){const E=mt.default(e);E.embedData.src=s,o.updateBlockData(C,E)}}}})}setFullScreen(){p(en,this.mediaContainer,"The media element not exist"),z(this.mediaContainer,"full-screen")}removeFullScreen(){p(en,this.mediaContainer,"The media element not exist"),ot(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=Z(r);p(en,i,"The block element not exist");const{align:o}=e;e.embedType==="video"&&(i.hasAttribute("data-style-align")&&i.removeAttribute("data-style-align"),i.setAttribute("data-style-align",o))}render(e,r){const{src:i}=e.embedData;(!this.mediaContainer||!r.contains(this.mediaContainer))&&(this.mediaContainer=v("div",["media"],r)),this.updateBlockAlign(e,r),rZ(i)?i===Of.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}I("media-embed");const oZ="left";class wS{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var C;const{containerId:r,blockIndex:i}=e;let o;(C=e.data)!=null&&C.file&&(o=e.data.file);const s=eZ(t,this.embedType);if(o=o!=null?o:await ga(s,{}),!o)return null;const{mediaType:l}=this.getAbstract();try{nZ(o,t,l)}catch{return null}const c={id:et(),type:"embed",embedType:this.embedType,embedData:{src:Of.Empty}};l==="video"&&(c.align=oZ);const d=t.insertBlock(r,i,c);return await this.getMedia(t,c.id).handleUploadFile(o),d})}getMedia(t,e){const r=t.addCustom(`media-${e}`,()=>new iZ({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return r.setAbstract({...this.getAbstract()}),r}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:r,order:i,group:o}=this.getAbstract();return{name:r,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:i,group:o,subText:kn(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,r){const{id:i}=r;this.getMedia(t,i).render(r,e)}handleUpdateBlock(t,e,r){const{id:i}=r,o=this.getMedia(t,i),s=Nt(e);return o.render(r,s),!0}handleDeleteBlock(t,e){const r=e.id,i=this.getMedia(t,r);i.removeAllListeners(),i.destroy()}convertTo(t,e,r,i){const o=e.embedData,s=t.doc.buildResourceUrl(o.src,{withToken:!0});return i==="html"?`<${o.type} src="${s}" />`:i==="markdown"?``:s}}function SS(n,t){const e=v("div",["uploading-progress-mask"],n),r=v("div",["uploading-progress-bar"],e),i=v("div",["uploading-progress-bar-value"],r);i.style.width=`${t}%`}function LS(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const sZ=I("media-audio");class lZ extends wS{constructor(){super(...arguments);m(this,"embedType",ni.AUDIO);m(this,"updateProgressElement",LS);m(this,"createMediaElement",(e,r,i,o)=>{const s=v("div",["audio-container","embed-hover-content","embed-selected-content"],r),l=v("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=o,setTimeout(()=>{this.getMedia(e,i.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:OT,mediaName:D.t(`media.${ni.AUDIO}.menuItem`),menuItem:D.t(`media.${ni.AUDIO}.menuItem`),order:800,mediaType:ni.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${ni.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .audio-container > audio");return p(sZ,s,"The media element not exist"),s.src!==o&&(s.src=o),s}createProgressElement(e,r){const i=v("audio",[],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,i.src="about:blank",SS(e,r)}}const aZ=new lZ;I("video-resizer");function IS(n){return n&&pe(n)&&$e(n)==="video"}const cZ=50;class Tx{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&IS(e)&&this.disableBlockResize(e),t&&IS(t)&&this.editor.isBlockWritable(t))){const r=this.getVideoElement(t);if(!r)return;this.enableBlockResize(t,r)}});m(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const r=t.getBlock();if(!r)return;const i=r.getBoundingClientRect().width,o=Math.min(Math.max(e.width,cZ),i);this.currentResizableElement.style.width=`${o}px`,this.currentResizableElement.style.pointerEvents="none"});m(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const r=this.editor.getBlockData(e),{width:i}=this.currentResizableElement.getBoundingClientRect();this.currentResizableElement.style.pointerEvents="auto",this.editor.updateBlockData(e,{...r,width:i})});this.editor=t,Re.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,Re.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return Nt(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const r=this.editor.addCustom(`${lt(t)}-resizer`,()=>new mf(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));r.enableResize(t,e),r.removeListener("resizing",this.handleResizing),r.removeListener("resized",this.handleResized),r.addListener("resizing",this.handleResizing),r.addListener("resized",this.handleResized),this.currentResizableElement=e}}const uZ=I("video");class fZ extends wS{constructor(){super(...arguments);m(this,"embedType",ni.VIDEO);m(this,"updateProgressElement",LS);m(this,"createMediaElement",(e,r,i,o)=>{const s=v("div",["video-container","embed-selected-content","drag-preview-element"],r),l=v("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=o,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new Tx(e)),this.getMedia(e,i.id).removeListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).addListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).removeFullScreen()}),i.width&&(l.style.width=`${i.width}px`),l});m(this,"createProgressElement",(e,r,i)=>{const o=v("video",["progress-video"],e);o.innerHTML="Your browser does not support the <code>audio</code> element.",o.controls=!0,SS(e,r),ma(i).then(s=>{const l=e.querySelector(".progress-video");l&&r1(e)&&(l.src=s)})})}getAbstract(){return{mediaName:D.t(`media.${ni.VIDEO}.menuItem`),mediaIcon:NT,menuItem:D.t(`media.${ni.VIDEO}.menuItem`),order:700,mediaType:ni.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${ni.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const o=e.addCustom("video-resizer",()=>new Tx(e)),s=e.getBlockById(i);o.disableBlockResize(s)}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .video-container > video");p(uZ,s,"The media element not exist"),s.src!==o&&(s.src=o),i.width?s.style.width=`${i.width}px`:s.style.width="";const l=e.getBlockById(i.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new Tx(e)).updateResizer(l)}),s}}const dZ=new fZ,DS=[aE,pE,CE,kk],yx=[bS,hQ,bJ,LJ,PJ,BK,qJ,dZ,aZ,yz,J4,sX],_S=[Pk,eS,T4,Hk];function hZ(n,t,e){var i,o,s,l;_r.level=(i=e.logLevel)!=null?i:Ho.DEBUG;const r=Su(n,t,{components:{blocks:[...DS,...((o=e==null?void 0:e.components)==null?void 0:o.blocks)||[]],embeds:[...yx,...((s=e.components)==null?void 0:s.embeds)||[]],boxes:[..._S,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new HC],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new cx(r)),r.addCustom("editor-tooltip",()=>new sf(r)),r.addListener("clickLink",(c,d,h)=>{var E;if((E=e==null?void 0:e.events)!=null&&E.onClickLink){e.events.onClickLink(c,d,h);return}const C=h.getAttribute("link");C&&(c.readonly||d.ctrlKey||d.metaKey)&&window.open(C,"_blank")}),r}class MS{constructor(t){this.createOptions=t,t.lang&&D.setLang(t.lang)}createHistoryEditor(t,e){return hZ(t,e,this.createOptions)}}function US(n,{root:t,childDoc:e,doc:r}){var h,C;e.uploadResource=r.uploadResource.bind(r),e.buildResourceUrl=r.buildResourceUrl.bind(r);const i=n.getComponentOptions("comment"),o={image:{defaultAlign:"left"},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0},...i==null?void 0:i.componentsOptions},s=[];n.editorBlocks.forEach(E=>{E.blockType==="text"||E.blockType==="embed"||s.push(E)});const l=[];n.editorEmbeds.forEach(E=>{l.push(E)});const c=[];n.editorBoxes.forEach(E=>{E.boxType==="text"||E.boxType==="br"||E.boxType==="image"||E.boxType==="anchor"||c.push(E)});const d=Su(t,e,{shortcuts:[Oh],components:{blocks:s,commandProviders:[new m0],decorators:[new V0],embeds:l,boxes:c,options:o}});if(d.input.addHandler(new H0),d.input.addHandler(new OE(d)),d.input.addHandler(new $E(d)),d.input.addHandler(new pq(d)),d.input.addHandler(new W0),d.addCustom("image-paste-handler",()=>new UE(d)),ie.isMobile||d.addCustom("editor-tooltip",()=>new sf(d)),n.options.enableContextMenu!==!1&&d.addCustom("editor-context-menu",E=>new zE(E)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new tS(d,{...E}))}if((C=n.options.componentsOptions)!=null&&C.comment){const E=n.options.componentsOptions.comment;E.onCommentEditorClick&&d.addListener("click",E.onCommentEditorClick)}return d}function mZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const o=Z(i);o&&r.add(o)}),r.forEach(i=>{Cq(n,i,t)})}class gZ{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 r=e.groupId;this.getComments().filter(o=>o.groupId===r).length===0&&mZ(this.editor,r)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return US(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class pZ{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 Vp(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 US(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const CZ={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}",limitedEnvTips:"\u7531\u4E8E\u6D4F\u89C8\u5668\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528 {shortCut} \u7C98\u8D34"}},EZ={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}",limitedEnvTips:"Press {shortCut} to paste due to browser restrictions"}},xZ={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",limitedEnvTips:"\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u5236\u9650\u306B\u3088\u308A\u3001\u300C{shortCut}\u300D\u3092\u4F7F\u7528\u3057\u3066\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044"}};D.mergeLang({"zh-CN":CZ,"en-US":EZ,"ja-JP":xZ});const AZ="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=",bZ=()=>Kg(AZ),vZ=I("image-to-docx");async function BZ(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>{t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=e,r.src=n})}async function OS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await ma(new File([t],"",{})),r=await BZ(e);return r.width===void 0||r.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||r.width*n.height/r.height,height:n.height||r.height*n.width/r.width,buffer:t}:{width:r.width,height:r.height,buffer:t}}catch(e){vZ.error(e);return}}function TZ(n,t){let e=n.filter(s=>s!=null);const r=t-(e.length-1)*20,i=.87,o=e.reduce((s,l)=>s+l.width,0);return o>r&&(e=e.map(s=>({width:s.width*r/o,height:s.height*r/o,buffer:s.buffer}))),e.map(s=>({width:s.width*i,height:s.height*i,buffer:s.buffer}))}function yZ(n,t,e){if(!e||typeof e!="object")return;const r=e,i=n.filter(s=>s!=null),o=t-(i.length-1)*20;i.forEach((s,l)=>{if(i.length===1&&r.widthPercent){const d=r.widthPercent,h=s.width;s.width=o*(d/100),s.height*=s.width/h;return}const c=`${l}_flex`;if(r[c]){const d=r[c],h=s.width;s.width=o*d,s.height*=s.width/h}})}function NS(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let r;switch(e%3){case 0:r=Et.LevelFormat.DECIMAL;break;case 1:r=Et.LevelFormat.LOWER_LETTER;break;default:r=Et.LevelFormat.LOWER_ROMAN;break}return{level:e,format:r,text:`%${e+1}. `,alignment:Et.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(e+1)),hanging:Et.convertInchesToTwip(.2)}}}}})}function kZ(){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:Et.LevelFormat.BULLET,text:t,alignment:Et.AlignmentType.START,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(n+1)),hanging:Et.convertInchesToTwip(.2)}}}}})}function RZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Et.LevelFormat.BULLET,text:"\u2611",alignment:Et.AlignmentType.START,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(n+1)),hanging:Et.convertInchesToTwip(.2)}}}}))}function wZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Et.LevelFormat.BULLET,text:"\u2610",alignment:Et.AlignmentType.START,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(n+1)),hanging:Et.convertInchesToTwip(.2)}}}}))}var Nf=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(Nf||{});const SZ=[{levels:NS(),reference:"number-numbering-reference"},{levels:kZ(),reference:"number-bullet-reference"},{levels:RZ(),reference:"checked-bullet-reference"},{levels:wZ(),reference:"unchecked-bullet-reference"}];function LZ(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 IZ(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 DZ(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 _Z=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function PS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(_Z);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},r=e(t[1]),i=e(t[2]),o=e(t[3]);return`${r}${i}${o}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function fn(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 FS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(fn(n,i))return i}}function pm(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function kx(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function KS(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function MZ(n){const t=fn(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const r of e){const i=r.split(":");if(i.length!==2)continue;const o=i[0].trim().toLowerCase(),s=i[1].trim().toLowerCase();o==="font-size"&&pm(n,"inline-style-font-size",s),o==="color"&&pm(n,"inline-style-color",s),o==="background-color"&&pm(n,"inline-style-background-color",s),o==="font-family"&&pm(n,"inline-style-font-family",s)}}function UZ(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function OZ(n){const t=`${fn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function NZ(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 PZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function FZ(n){return fn(n,"inline-style-font-family")}function KZ(n){const t=fn(n,"inline-style-background-color");return PS(t)}function VZ(n){const t=fn(n,"inline-style-color");return PS(t)}function $Z(n){MZ(n);const t=fn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!fn(n,"style-code"),link:KS(fn(n,"link")),size:OZ(n),text:t?PZ(n):NZ(n)||n.insert,bold:!!fn(n,"style-bold"),underline:!!fn(n,"style-underline"),italics:!!fn(n,"style-italic"),strike:!!fn(n,"style-strikethrough"),superScript:!!fn(n,"style-super"),subScript:!!fn(n,"style-sub"),math:fn(n,"type")==="math"?fn(n,"src"):void 0,mention:t,fontFamily:FZ(n),background:KZ(n),color:t?"338fe5":LZ(FS(n,"style-color-",6))||VZ(n),highlight:FS(n,"style-bg-color-",13)}}function HZ(){return[new Et.Paragraph({border:{top:{color:"auto",style:Et.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Et.Paragraph({spacing:{line:0}})]}function jZ(){return new Et.Paragraph({children:[new Et.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function zZ(){return new Et.Paragraph({children:[new Et.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function GZ(n,t){return new Et.Paragraph({children:[new Et.ExternalHyperlink({children:[new Et.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function VS(n){if(n.heading!=null)return`Heading${n.heading}`}function $S(n){if(n.alignment!=null){if(n.alignment==="center")return Et.AlignmentType.CENTER;if(n.alignment==="right")return Et.AlignmentType.RIGHT;if(n.alignment==="left")return Et.AlignmentType.LEFT}}function WZ(n){if(n.indent)return{left:Et.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Et.convertInchesToTwip(.3*n.padding)}}function qZ(n){return{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function XZ(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function HS(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const r=n.size||t,i=r!=null?Math.floor(r*1.5+.5):void 0;return new Et.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Et.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:i,style:e,font:n.fontFamily?XZ(n.fontFamily):void 0,shading:n.background?qZ(n.background):void 0,color:n.color,highlight:IZ(n.highlight)})}function YZ(n,t){if(n.link)return new Et.ExternalHyperlink({children:[HS(n,t)],link:n.link})}async function jS(n,t,e,r,i){const[o]=await i(n,t,e);if(o==null)return;const s=await OS({width:r||0,height:0,src:e},o);return new Et.ImageRun({data:o,transformation:{width:(s==null?void 0:s.width)||100,height:(s==null?void 0:s.height)||20}})}function QZ(n){if(n.heading||n.heading)return n.heading}function JZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function ZZ(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function ttt(n,t){var r;const e=[];if(n.text&&Array.isArray(n.text)){for(let i=0;i<n.text.length;i++){const o=n.text[i];if(((r=o.attributes)==null?void 0:r.box)===!0&&t){const s=await t(o);if(s){n.text.splice(i+1,0,...s);continue}}e.push($Z(o))}return e}}function ett(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 ntt(n,t){if(n.type==="embed"&&n.embedType&&kx(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(r=>{const i=t(r),o=n.embedData[`${i}_width`],s=n.embedData[`${i}_height`];return{src:r,width:o,height:s}})}function rtt(n){if(n.padding)return n.padding}function itt(n){return!!(n.type==="embed"&&n.embedType&&kx(n.embedType)&&n.embedData&&n.embedData.src)}async function Cm(n,t,e){return{quoted:!!n.quoted,heading:QZ(n),alignment:JZ(n),indent:ZZ(n),padding:rtt(n),texts:await ttt(n,e),list:ett(n),images:ntt(n,t),border:itt(n)}}async function ott(n,t,e,r){const i=[];if(!n.children)return[];for(const o of n.children){const s=[];for(const l of t.blocks[o])s.push(await Cm(l,e,r));i.push(s)}return i}const stt=I("to-docx");function ltt(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 att(n,t,e,r){const i=!!n.hasColTitle,o=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let d=0;d<e;d++)(i&&d===0||o&&c===0||s&&c%2===1)&&(r[c][d].color=l)}function ctt(n){p(stt,n.children,"no table children");const t=n.rows,e=n.cols,r=n.colsWidth;if(r)for(let s=0;s<r.length;s++)r[s]===0&&(r[s]=100);const i=ltt(t,e);let o=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(i[s][l].originalWidth=r?r[l]:void 0,i[s][l].from!==void 0)continue;const c=n.children[o];o+=1,i[s][l].cellId=c,i[s][l].color=DZ(n[`${c}_background`]),i[s][l].width=r?r[l]:100,i[s][l].align=n[`${c}_align`];const d=n[`${c}_rowSpan`]||1,h=n[`${c}_colSpan`]||1;if(i[s][l].rowSpan=d,i[s][l].colSpan=h,d>1||h>1){let C=0;for(let E=0;E<d;E++)for(let x=0;x<h;x++)E===0&&(C+=r?r[l+x]:80),!(E===0&&x===0)&&(i[s+E][l+x].from=[s,l]);i[s][l].width=C}}return att(n,t,e,i),i}async function utt(n,t,e,r,i,o,s,l,c,d){async function h(E){if(l&&E.type!=="_exportVirtualBlock"){const x=await l(i,o,E);if(x){await r.addDoc(n,x,d);return}}if(E.type==="text"||E.textOnly===!0){const x=await Cm(E,s,c);await r.addTextBlock(x);return}if(E.type==="code"){const x=await ott(E,e,s,c);await r.addCodeBlockObject(x);return}if(E.type==="list"&&E.textOnly!==!0){const x=await Cm(E,s,c);await r.addListBlockObject(n,x);return}if(E.type==="embed"&&E.embedType){const x=E,B=x.embedData,k=x.embedType;if(kx(k)){const w=await Cm(E,s,c);await r.addImagesBlockObject(E,w,d)}else E.embedType==="hr"?r.addSeparatorBlock():E.embedType==="video"?r.addVideoPlaceholder():E.embedType==="audio"?r.addAudioPlaceholder():E.embedType==="webpage"?r.addHyperlinkParagraph(KS(B.src),B.title):r.addOtherEmbedBlock(k,E.embedData);return}if(E.type==="table"){let x=[];if(E.colsWidth)x=E.colsWidth;else{const k=E.cols;x=new Array(k);for(let w=0;w<x.length;w++)x[w]=100;E.colsWidth=x}const B=ctt(E);await r.addTableMatrix(x,B,e),r.addEmptyParagraph()}E.type==="_exportVirtualBlock"&&await r.addVirtualBlock(E.id,e,d)}function C(E){var k;const x=((k=E==null?void 0:E.embedData)==null?void 0:k.exportSpec)||(E==null?void 0:E.exportSpec);if(!x)return[E];const B=[];for(const{type:w,data:U}of x){if(w==="text"){const M={id:et(),text:[{insert:U}],type:"text"};B.push(M);continue}if(w==="image"){const M={id:et(),type:"embed",embedType:"image",align:"left",embedData:{src:U}};B.push(M);continue}if(w==="link"){const M={id:et(),type:"embed",embedType:"webpage",embedData:{src:U.url,title:U.title}};B.push(M);continue}if(w==="block")for(const M of U){if(!e.blocks[M])continue;const Y={id:M,type:"_exportVirtualBlock"};B.push(Y)}}return B}for(const E of t)for(const x of C(E))!x||await h(x)}function ftt(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const dtt=I("to-docx");class htt{constructor(t,e,r,i,o,s){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=r,this.readImageFunc=i,this.convertBlocksFunc=o,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Et.Paragraph({heading:VS(t),alignment:$S(t),children:await this.paragraphsFromBlockTexts(t),indent:WZ(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new Et.Paragraph({text:`[${D.t("docx.imageExportFailed")}]`,shading:{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=UZ(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const o=YZ(i,e);o&&r.push(o);continue}if(i.box&&i.box.type&&i.box.type==="br"){r.push(new Et.TextRun({text:"",break:1}));continue}if(i.box&&i.box.type&&i.box.type==="image"){const o=await jS(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);o&&r.push(o);continue}if(i.math){const o=await jS(this.appId,this.docId,i.math,0,this.readImageFunc);o&&r.push(o);continue}r.push(HS(i,e))}return r}async addCodeBlockObject(t){for(const e of t)for(const r of e){const i={style:Et.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Et.Paragraph({style:"Code",border:{left:{...i},right:{...i},top:{...i},bottom:{...i}},children:await this.paragraphsFromBlockTexts(r)}))}}async addListBlockObject(t,e){if(e.list==null)return;let r;const i=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[i])r=this.state.listInstMap[i];else if(r=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[i]=r,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${r}`,l=NS([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:r}),this.state.listRefMap[i]=s}else e.list.ordered?this.state.listRefMap[i]=Nf.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[i]=Nf.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[i]=Nf.UNCHECKED:this.state.listRefMap[i]=Nf.BULLET;const o=VS(e);e.texts&&this.paragraphs.push(new Et.Paragraph({heading:o,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[i],level:e.list.level-1,instance:r}}))}imageDimWithBufferToImageRun(t){return new Et.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e,r){if(e.images==null){if(t.type==="embed"&&t.embedType==="image"){const{src:c}=t.embedData;c||this.addEmptyImagePlaceHolder()}return}const i=[],o=await Promise.all(e.images.map(async c=>{const[d,h]=await this.readImageFunc(this.appId,this.docId,c.src);if(d){const C=await OS(c,d);if(C)return C}i.push(h)}));yZ(o,r,t.embedData);const s=TZ(o,r),l={style:Et.BorderStyle.SINGLE,color:"#DEDEDE"};s.length&&this.paragraphs.push(new Et.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:$S(e)||Et.AlignmentType.CENTER,children:s.map(c=>this.imageDimWithBufferToImageRun(c)).flatMap((c,d,h)=>c==null?[]:h.length-1!==d?[c,new Et.TextRun({text:" "})]:c)})),i.forEach(c=>{this.addHyperlinkParagraph(c)})}addSeparatorBlock(){HZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Et.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(jZ())}addAudioPlaceholder(){this.paragraphs.push(zZ())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(GZ(t,e))}async addTableMatrix(t,e,r){const i=t.map(o=>o!==0?o*15:1500);this.paragraphs.push(new Et.Table({rows:await this.generateTableRows(e,r),columnWidths:i}))}async generateRowCells(t,e){const r=[];for(const i of t){const o=i.cellId;if(o===void 0)continue;const s=i.width*.9;r.push(new Et.TableCell({children:await this.convertBlocksFunc(o,e.blocks[o],e,this.appId,this.docId,this.state,s),columnSpan:i.colSpan,rowSpan:i.rowSpan,width:{type:Et.WidthType.DXA,size:i.width*15},shading:i.color?{fill:i.color,type:Et.ShadingType.CLEAR,color:"auto"}:void 0}))}return r}async generateTableRows(t,e){const r=[];for(const i of t)r.push(new Et.TableRow({children:await this.generateRowCells(i,e)}));return r}async addDoc(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,r);i&&(this.paragraphs=this.paragraphs.concat(i))}async addVirtualBlock(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks[t],e,this.appId,this.docId,this.state,r);this.paragraphs.push(...i)}async addOtherEmbedBlock(){}}class mtt{constructor(t,e,r,i,o,s,l,c){m(this,"convertBlocks",async(t,e,r,i,o,s,l=720)=>{const c=new htt(i,o,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await utt(t,e,r,c,i,o,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=r,this.readImage=i,this.defaultFontSize=o,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=c}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,r){const i=new Et.ImportDotx,o=this.templateData?await i.extract(this.templateData):void 0,s=t.blocks.root;p(dtt,s,"data must have blocks");const l=ftt(),c=await this.convertBlocks("blocks",s,t,e,r,l),d=this.backgroundImageOptions?{default:new Et.Header({children:[new Et.Paragraph({children:[new Et.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new Et.Document({numbering:{config:[...SZ,...l.levelConfigs]},sections:[{headers:d,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:o});return Et.Packer.toBlob(h)}}async function gtt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let o=await aS(i);if(!o)return[void 0,i];if(o.type.indexOf("/svg")!==-1){const l=await oS(o);l&&(o=new File([l],o.name))}return[await o.arrayBuffer(),i]}async function ptt(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)return r.toStandardDoc(n,e,t)}async function Ctt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function Ett(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=bZ());const o=n.doc.toJSON(),s=(C,E,x)=>gtt(n,C,E,x),l=async(C,E,x)=>ptt(n,o,x),c=async C=>Ctt(n,C),h=await new mtt(e,o,Md.default,s,void 0,l,c,i).convert("_appId","_docId");if(r){const C=URL.createObjectURL(h),E=document.createElement("a");E.setAttribute("download",`${lS(n)}.docx`),E.setAttribute("href",`${C}`),E.click(),E.remove()}return h}const Rx=I("create-editor");async function xtt(n,t){var s,l,c,d,h,C,E,x,B,k,w,U,M,F,Y,X;p(Rx,n,"app does not exists"),t.lang&&D.setLang(t.lang),_r.level=(s=t.logLevel)!=null?s:Ho.DEBUG;const e=t.onReauth?async()=>{var Ct;const G=t.user.userId,st=t.docId,pt=await((Ct=t.onReauth)==null?void 0:Ct.call(t,G,st,t.permission));return{userId:G,docId:st,permission:t.permission,appId:t.appId,token:pt,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,r={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},i=await Hu.load(r),o=Su(n,i,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,enableContextMenu:t==null?void 0:t.enableContextMenu,components:{blocks:[...DS,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...yx,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[..._S,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new m0,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new V0,new Hp],insertions:[$1],blockHooks:[new LE,new ZR,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new p4,new HC,...((E=t.components)==null?void 0:E.textRenders)||[]],options:{...t.componentsOptions}},shortcuts:[wq,rH,gz,cE,$w,cF,rE,dX,Oh,nF,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(o.editorCommandProviders.registerCommandProvider(new Di(o)),o.input.addHandler(new eY),o.input.addHandler(new H0),o.input.addHandler(new wK),o.input.addHandler(new lz),o.input.addHandler(new EE(o,{hideTitle:t.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0,applyContentPlaceholder:(x=t.placeholder)==null?void 0:x.applyContentPlaceholder})),o.input.addHandler(new M0(o,(B=t.componentsOptions)==null?void 0:B.quickMenu)),o.input.addHandler(new OE(o)),o.input.addHandler(new $E(o)),o.input.addHandler(new W0),o.doc.registerCallback(new nY(o)),o.addCustom("remote-cursor",()=>new oT(o)),o.addCustom("block-menu",G=>new nw(G)),ie.isMobile||o.addCustom("editor-tooltip",()=>new sf(o)),t!=null&&t.enableComments&&o.addCustom("editor-comments",G=>new g4(G,new gZ(G))),t.enableContextMenu!==!1&&o.addCustom("editor-context-menu",G=>new zE(G)),o.addCustom("create-options",()=>new Sb(o,t)),o.addCustom("drop-target",()=>new Tf(o)),o.addCustom("list-to-mindmap",()=>new R0(o)),o.addCustom("list-to-mention",()=>new BY(o)),o.addCustom("mobile-helper",()=>new zY(o)),o.addCustom("code-caret",()=>new Z$(o)),o.addCustom("image-paste-handler",()=>new UE(o)),(k=t.componentsOptions)!=null&&k.mention){const G=t.componentsOptions.mention;o.addCustom("mention",()=>new tS(o,G))}if(o.addCustom("heading-collapse",()=>new cx(o)),o.addCustom(mm,G=>new px(G)),ec.register(o),Tf.register(o),Ts.register(o),Es.register(o),o.addListener("clickLink",(G,st,pt)=>{var yt;if((yt=t==null?void 0:t.events)!=null&&yt.onClickLink){t.events.onClickLink(G,st,pt);return}const Ct=pt.getAttribute("link");Ct&&(G.readonly||st.ctrlKey||st.metaKey)&&window.open(Ct,"_blank")}),(U=(w=t.componentsOptions)==null?void 0:w.remoteCarets)!=null&&U.onUserChanged){const G=(F=(M=t.componentsOptions)==null?void 0:M.remoteCarets)==null?void 0:F.onUserChanged;o.doc.getRemoteUsers().on("change",st=>{G(o,st)})}return(X=(Y=t.componentsOptions)==null?void 0:Y.templates)!=null&&X.templates.length&&(o.addListener("docChanged",()=>{hm(o)}),o.addListener("resize",()=>{hm(o,{reset:!0})}),setTimeout(()=>{hm(o)},100)),o.doc.registerCallback({onError:async G=>{if(G.code==="ResetDoc"){Rx.error(`reset doc: ${G.message}`);const st=await Hu.load(r);o.doc.reset(st)}}}),o.version="1.1.17-beta.6",_r.level===Ho.DEBUG&&(window.setReauthFail=G=>{window.isReauthError=G},window.reConnect=G=>o.doc.externalDoc.client.connection.reConnect(G)),o}function Att(n){return n.toJSON!==void 0}async function btt(n,t,e){var o,s,l,c,d,h,C,E;p(Rx,n,"app does not exists");const r=Att(t)?t:new bp(t,{serverUrl:e.serverUrl||""});e.lang&&D.setLang(e.lang),_r.level=(o=e.logLevel)!=null?o:Ho.DEBUG;const i=Su(n,r,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[aE,pE,CE,kk,...(l=(s=e.components)==null?void 0:s.blocks)!=null?l:[]],commandProviders:[new m0],decorators:[new V0,new Hp],embeds:[...yx,...((c=e.components)==null?void 0:c.embeds)||[]],boxes:[Pk,eS,T4,Hk,...((d=e.components)==null?void 0:d.boxes)||[]],insertions:[$1],blockHooks:[new LE,...((h=e.components)==null?void 0:h.blockHooks)||[]],textRenders:[new p4,new HC,...((C=e.components)==null?void 0:C.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[cE,$w,rE,Oh]});return i.editorCommandProviders.registerCommandProvider(new Di(i)),i.input.addHandler(new H0),i.input.addHandler(new EE(i,{hideTitle:e.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new M0(i,(E=e.componentsOptions)==null?void 0:E.quickMenu)),i.input.addHandler(new OE(i)),i.input.addHandler(new $E(i)),i.input.addHandler(new W0),i.addCustom("block-menu",x=>new nw(x)),ie.isMobile||i.addCustom("editor-tooltip",()=>new sf(i)),i.addCustom("image-paste-handler",()=>new UE(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",x=>new g4(x,new pZ(x,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",x=>new zE(x)),i.addCustom("heading-collapse",()=>new cx(i)),i.addListener("clickLink",(x,B,k)=>{var U;if((U=e==null?void 0:e.events)!=null&&U.onClickLink){e.events.onClickLink(x,B,k);return}const w=k.getAttribute("link");w&&(x.readonly||B.ctrlKey||B.metaKey)&&window.open(w,"_blank")}),i.addCustom(mm,x=>new px(x)),ec.register(i),i.version="1.1.17-beta.6",i}async function vtt(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await Wh.load({auth:r,serverUrl:e});if(!((h=i.getVersionHelper)==null?void 0:h.call(i)))throw new Error("the editor does not support to show versions");const s=n.getCustom("create-options");if(!s)throw new Error("the editor does not support to show versions");const l=s.getData(),c=new MS(l),d=n.addCustom("version-dialog",()=>new K4(i,c));return d.show(t),d}b.tippy=t9,b.AnchorBox=TB,b.AuthError=Vu,b.AuthHeader=cl,b.AutoScroll=Qd,b.BaseURLHeader=Na,b.BasicCommands=YF,b.BlockExclusiveHook=ZR,b.BlockLockerHook=LE,b.BlockLockerPasteHandler=W0,b.BlockResizer=mf,b.BrBox=AB,b.CodeBlock=pE,b.CodeLineBlock=CE,b.CodeTextDecorator=V0,b.DOC_RE_AUTH_KEYS=mm,b.DefaultShortcuts=Oh,b.DocIdError=zU,b.DocReAuthCallbacks=px,b.DragDrop=Wb,b.DrawioEmbed=bS,b.EditorBlocks=r3,b.EditorBoxes=vB,b.EditorCommandProviders=x2,b.EditorComplexBlockPosition=Kr,b.EditorComplexSelectionRange=pi,b.EditorDecorators=wB,b.EditorEmbeds=o3,b.EditorInsertions=RB,b.EditorSimpleBlockPosition=Ye,b.EditorSimpleSelectionRange=rn,b.EmbedBlock=l3,b.EmbedBlockResizer=Df,b.EnforceWithDocumentTitleHandler=EE,b.EventCallbacks=fa,b.FILL_CHAR=g8,b.FileExtError=GU,b.GroupOrder=Lk,b.HeadingBlockScrollListener=pY,b.ImageBox=BB,b.InlineBoxCommandProvider=jk,b.InputtingInsertion=yB,b.LocalDoc=bp,b.LogLevel=Ho,b.Logger=_r,b.MIN_DISTANCE_THRESHOLD=zb,b.ManualCloseDialog=zu,b.ManualMenu=ls,b.ManualToolbar=ju,b.MarkdownInputHandler=H0,b.MaxUserError=Mp,b.Mindmap=k0,b.OnesEditorAutoSuggest=uC,b.OnesEditorCustomDataWrapper=Sb,b.OnesEditorExclusiveBlock=Es,b.OnesEditorHoveringBlock=Re,b.OnesEditorIcons=IO,b.OnesEditorQuickMenu=M0,b.OnesEditorToc=Uf,b.OnesEditorTocProvider=Ts,b.OnesEditorToolbar=ec,b.OnesEditorTooltip=sf,b.OnesEditorVersionsDialog=K4,b.PermissionError=Gh,b.Popup=Va,b.ReAuthToolbar=cS,b.RemoteCarets=oT,b.RemoteCaretsDecorator=Hp,b.RemoteCaretsInsertion=$1,b.RemoteUsers=Lu,b.RequestReloadError=$u,b.RichText=pn,b.ShareDBDoc=Hu,b.ShareDBDocVersionsProvider=MS,b.ShareDBServer=Wh,b.SimpleCache=Nb,b.StandardEmbedBlockCommands=ex,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=b1,b.TEXT_STYLE_COLOR_PREFIX=A1,b.TableBlock=aE,b.TableBlockCommandProvider=m0,b.TableShortcuts=cE,b.TextBlock=Nn,b.TextBox=xB,b.TextColorItem=By,b.TextStyleShortcuts=rE,b.TocEmbed=J4,b.ZERO_WIDTH_SPACE_CHAR=Yc,b.abbreviation=Jd,b.addAttribute=lh,b.addClass=z,b.addCommentToBlock=If,b.addDays=cI,b.addMetaToDoc=Ru,b.addMonths=aI,b.animateScrollTo=Gs,b.applyPlaceholderToBlock=df,b.assert=p,b.autoShowHideTemplates=hm,b.bindKeyDownEvent=Hd,b.blockToDoc=gp,b.blockToHtml=z1,b.blockToMarkdown=Bh,b.blockToText=vh,b.blocksToDoc=$5,b.clearAllSelection=Nv,b.clientType=ie,b.cloneBlock=ts,b.cloneChildContainer=ep,b.cloneDoc=np,b.cloneText=uB,b.commentToShareDbComment=$p,b.compareElement=Vd,b.comparePosition=d1,b.complexBlockAdjustSelectionPos=ih,b.complexBlockFindNearestChildBlock=l7,b.complexBlockGetAllChildContainers=an,b.complexBlockGetBottomChildContainers=f3,b.complexBlockGetDeepFirstChild=a3,b.complexBlockGetFirstSimpleChild=m1,b.complexBlockGetLastSimpleChild=xa,b.complexBlockGetSelectedContainers=Ea,b.complexBlockGetTopChildContainers=u3,b.containerToDoc=H5,b.continuousScroll=cv,b.convertBlockFrom=nh,b.convertImageFileToPng=oS,b.convertImageSrcToPng=FY,b.converterIntercept=$0,b.copyBlockAttributes=KB,b.copyResourcesFromDoc=Ap,b.createBlockAnchor=Zi,b.createBlockCaretAnchor=h3,b.createBlockContentElement=Zs,b.createBlockElement=wv,b.createBlockSimpleDocRange=Ch,b.createBlockSimpleRange=ve,b.createBoxContentElement=Iv,b.createBoxElement=Sv,b.createBoxOp=cB,b.createChildContainer=e3,b.createComplexBlockPosition=xe,b.createComplexDocPos=gB,b.createComplexDocRange=E8,b.createContainer=dB,b.createContainerElement=Yg,b.createDeleteOps=oB,b.createEditor=Su,b.createEditorSelectionRange=Qe,b.createElement=v,b.createEmptyContainer=oo,b.createEmptyDoc=io,b.createEmptyTextBlockData=gh,b.createExpandedRange=Fd,b.createIconButton=Hs,b.createImage=Lg,b.createInsertOps=hh,b.createInsertionContentElement=Mv,b.createInsertionElement=Dv,b.createLocalEditor=btt,b.createOnesEditor=xtt,b.createRange=Pb,b.createRichText=ol,b.createRootContainer=t3,b.createSimpleBlockPosition=at,b.createSimpleDocPos=mB,b.createTextBlockData=Ai,b.createTextButton=El,b.createTextOp=Er,b.createTextWithReplaceSoftReturn=_1,b.daysAfter=zg,b.deleteText=U1,b.diffDays=uI,b.disablePageScroll=$g,b.docToHtml=UB,b.docToHtmlFragment=Au,b.docToMarkdown=OB,b.docToText=Zo,b.downloadImageToFile=aS,b.downloadObjectToFile=xx,b.downloadSvgToString=dS,b.editLink=nf,b.editorAddComment=xq,b.editorAddTextAttribute=QB,b.editorAutoInsertBlock=VB,b.editorBreakTextBlock=Sa,b.editorClearCompositionText=X1,b.editorClearSelectedContents=wh,b.editorCopyBlock=Ep,b.editorCopyDoc=Uh,b.editorDeleteBlock=J1,b.editorDeleteBlockText=Y1,b.editorDeleteBlockWithoutChildren=kh,b.editorDeleteChildContainer=p_,b.editorDeleteChildContainers=$B,b.editorFocusToBlock=tp,b.editorFocusToEnd=U_,b.editorGetBlockData=Jo,b.editorGetBlockText=yn,b.editorGetBlockTextEx=xh,b.editorGetBoxData=CB,b.editorHandleKeyboardEvent=e2,b.editorInsertBlock=wa,b.editorInsertBoxToBlock=PB,b.editorInsertDoc=XB,b.editorInsertDocAt=rp,b.editorInsertText=q1,b.editorInsertTextToBlock=NB,b.editorInsertTextToBlockEx=W1,b.editorMergeTextBlock=HB,b.editorMoveDown=u5,b.editorMoveEnd=up,b.editorMoveHome=A5,b.editorMoveLeft=l5,b.editorMoveLineEnd=w5,b.editorMoveLineHome=R5,b.editorMovePageDown=M5,b.editorMovePageUp=_5,b.editorMoveRight=a5,b.editorMoveUp=c5,b.editorMoveWordEnd=C5,b.editorMoveWordLeft=p5,b.editorRangeClearColor=ZB,b.editorRangeGetColor=t5,b.editorRangeSetColor=JB,b.editorRemoveTextAttribute=A_,b.editorReplaceBlockText=Sh,b.editorReplaceContainer=YB,b.editorRunOnce=vp,b.editorSelectAll=dp,b.editorSelectContainer=Dh,b.editorSelectDown=f5,b.editorSelectEnd=fp,b.editorSelectHome=b5,b.editorSelectLeft=d5,b.editorSelectLineEnd=k5,b.editorSelectLineHome=y5,b.editorSelectPageDown=N5,b.editorSelectPageUp=O5,b.editorSelectRight=h5,b.editorSelectUp=m5,b.editorSelectWordEnd=x5,b.editorSelectWordLeft=E5,b.editorSetTextColor=La,b.editorShowFindDialog=fW,b.editorToDocx=Ett,b.editorUpdateBlockData=Lh,b.editorUpdateCompositionText=FB,b.editorUpdateEmbedData=WB,b.enablePageScroll=Hg,b.escapeHtmlText=jd,b.escapeRegExp=Xg,b.escapeSpace=z9,b.exclusiveBlock=RE,b.executeBlockCommand=Gv,b.executeEmbedBlockCommand=zv,b.executeRangeCommand=E2,b.fileToDataUrl=ma,b.findAfterOffsetNotType=F1,b.findAllText=hp,b.findBlockByIndex=Av,b.findEventTargetBlock=Vb,b.findInsertionById=_v,b.findNextOffset=P8,b.findNextVisibleSimpleBlock=B2,b.findPrevOffset=N8,b.findPrevOffsetNotType=P1,b.findPrevSimpleBlockBeforeChildContainer=c3,b.findPrevVisibleSimpleBlock=v2,b.findTarget=ha,b.findWordEnd=V1,b.findWordLeft=K1,b.format=nu,b.formatBytes=uv,b.formatDate=Wg,b.fragmentToHtml=iv,b.fromBase64=Jc,b.fromBase64ToBlob=Kg,b.fromBase64ToUint8Array=nI,b.fromDocRange=Xo,b.fromNowString=qg,b.genId=et,b.getAllChildBlocks=E1,b.getAllQuickMenuItems=nE,b.getAllSelectedBlocks=Ci,b.getAttributesAt=Ba,b.getBlockBackground=Zg,b.getBlockByIndex=zo,b.getBlockCaretRect=Wo,b.getBlockClass=Qt,b.getBlockClassByType=Ys,b.getBlockClientRects=Yi,b.getBlockCommandsWithHook=s1,b.getBlockContent=Nt,b.getBlockHeading=lu,b.getBlockId=lt,b.getBlockIndex=vt,b.getBlockInfo=xf,b.getBlockKind=Nr,b.getBlockMinWidth=Fv,b.getBlockNearestRangeFromPoint=p1,b.getBlockOptions=BI,b.getBlockPath=qo,b.getBlockProperties=$v,b.getBlockRangeFromPoint=oh,b.getBlockStyles=vI,b.getBlockTextLength=dt,b.getBlockTools=oe,b.getBlockType=Dt,b.getBoxContent=e1,b.getBoxId=Lv,b.getBoxTypeFromElement=su,b.getChildBlockCount=Or,b.getChildBlocks=fe,b.getChildOffset=Yo,b.getColorFromAttributes=B1,b.getColorFromContent=Zd,b.getComplexBlockClass=hr,b.getContainerBlockPath=Qv,b.getContainerBlocks=Ov,b.getContainerBlocksElement=iu,b.getContainerById=Ur,b.getContainerId=ct,b.getContainerMinWidth=u1,b.getContainerToolsElement=xI,b.getContainerWidth=n3,b.getDistanceSquare=jo,b.getElementFromPoint=Ae,b.getElementOffset=Xc,b.getElementScale=dr,b.getEmbedType=$e,b.getExistsBlockTools=th,b.getExistsContainerById=ru,b.getFileExt=eu,b.getFirstChildBlock=be,b.getFirstClientRect=Kd,b.getHeadingBlockChildren=Ca,b.getHeadingMenuOptions=YC,b.getHorizontalPadding=Dg,b.getInsertionContent=n1,b.getLastChildBlock=Ue,b.getLastClientRect=js,b.getListAllNextBrothers=Ya,b.getLogger=I,b.getNextBlock=Jt,b.getNextHiddenBlocks=Xv,b.getNextValidOffset=rl,b.getNextVisibleBlock=gr,b.getOffsetFromPoint=Ig,b.getOffsetInfoAfter=Cu,b.getOffsetInfoBefore=Ah,b.getOpAt=F3,b.getOpLength=sh,b.getParentBlock=Z,b.getParentBlockExcludeSelf=Js,b.getParentBox=t1,b.getParentContainer=it,b.getPrevBlock=Oe,b.getPrevValidOffset=Qo,b.getPrevVisibleBlock=mr,b.getRangeCommands=p2,b.getReferenceClientRect=nk,b.getRootBlock=o1,b.getScrollContainer=Xe,b.getSpecialBlockCommands=Hv,b.getStandardEmbedBlockProperties=nx,b.getTextAfterOffset=U8,b.getTextAttributes=G1,b.getTextBeforeOffset=O8,b.getTextBlockChild=uu,b.getTextBlockClass=vv,b.getTextBlockContentChildTextLength=Cr,b.getTextBlockContentChildType=Yv,b.getTextBlockContentChildren=gi,b.getTextLength=gn,b.getTextOpLength=x1,b.getTextWidth=qd,b.getToolbar=A0,b.handleBlockElementUpdated=Kv,b.hasAltOnly=Q9,b.hasClass=wt,b.hasCtrlOrCmd=Zb,b.hasCtrlOrCmdOnly=Y9,b.hashCode=Cv,b.hideBlock=Rv,b.hideTemplates=iS,b.htmlToFragment=Wd,b.i18n=D,b.includeBigTable=lN,b.injectDocToHtmlFragment=ku,b.injectStyle=jb,b.inputActions=eM,b.insertEmptyBlock=kI,b.insertEmptyEmbedBlock=l1,b.insertText=ro,b.intersectionCommands=MM,b.isBackspace=ev,b.isBlock=Qs,b.isBlockLocked=G0,b.isBlockLockedByOthers=SE,b.isBlockLockedBySelf=Af,b.isBlockTools=kv,b.isBox=eh,b.isBoxOp=to,b.isCJK=Qb,b.isChildContainer=Fr,b.isChildNode=re,b.isCodeBlock=Zr,b.isCollapsedHeadingBlock=mi,b.isCollapsedRange=C8,b.isComplexBlockPosition=el,b.isComplexKindBlock=It,b.isContainer=Xi,b.isContainerSelectedAllChildBlocks=P5,b.isControlEvent=qs,b.isDelete=Z9,b.isDraggingFiles=Xd,b.isElementVisible=Ug,b.isEmbedBlock=pe,b.isEmptyContainer=fu,b.isEmptyDoc=O1,b.isEmptyTextBlock=se,b.isEmptyTextBlockWithoutCompositionText=ff,b.isEnterOnly=tv,b.isEscape=Gd,b.isExclusiveBlock=Ef,b.isExpandedHeadingBlock=qv,b.isFirefox=Wc,b.isFirstChildBlockInComplexBlock=s7,b.isHeadingBlock=ln,b.isHighSurrogate=V9,b.isInBlock=r1,b.isInBlockTools=pa,b.isLetter=Yb,b.isLowSurrogate=$9,b.isMatchShortcut=di,b.isMoveForward=q9,b.isNavigationEvent=W9,b.isNavigationKey=Jb,b.isNodeRemoved=qc,b.isNumber=Xb,b.isPrintableKey=Pg,b.isRootBlock=pr,b.isRootContainer=qt,b.isSafari=$s,b.isSameDay=Gg,b.isSelectBoxOnly=Jr,b.isShiftEnter=J9,b.isShiftTab=eI,b.isShortcutEvent=X9,b.isSimpleBlock=bI,b.isSimpleBlockPosition=Vr,b.isSimplePos=hB,b.isSimpleRange=ph,b.isSpace=zd,b.isTab=tI,b.isTextBlockContentBoxChild=Qn,b.isTextBlockContentChild=au,b.isTextBlockContentInsertionChild=Ji,b.isTextBlockContentTextChild=cu,b.isTextKindBlock=rt,b.isTextKindBlockType=ou,b.isTitleBlock=qi,b.isToday=fv,b.isValidOffset=On,b.isVisibleBlock=Go,b.isYesterday=dv,b.loadJs=Kb,b.loadJsPromise=zs,b.lockers=Mr,b.mergeCommands=x0,b.mergeDocs=sl,b.mergeOps=M1,b.mergeText=h8,b.multiSplitText=V3,b.overflowText=hv,b.parseShortcut=nv,b.patchNode=Zc,b.pointInRect=Ws,b.rangeAddAttribute=mu,b.rangeGetTextColor=q3,b.rangeRemoveAttribute=va,b.rangeSetTextColor=z3,b.rangeTransformText=H3,b.registerDragDrop=Og,b.removeAttribute=v1,b.removeClass=ot,b.removeLastBr=c8,b.removePlaceholderFromBlock=yR,b.removeStyle=Hb,b.replaceAll=fI,b.replaceAllCaseInsensitive=dI,b.replaceAllText=K5,b.replaceText=mh,b.requestDownload=Yd,b.resetListStart=Ja,b.scrollIntoView=xu,b.scrollable=av,b.selectFile=ga,b.selectedBlockToDoc=_h,b.selectionToDoc=Ia,b.setAttributes=$d,b.setClipboardData=tu,b.setClipboardDataByEvent=oI,b.setColorToAttributes=G3,b.setDataset=_g,b.setDefaultCursor=Qc,b.setStyles=Mg,b.shareDBCommentToDocObject=Vp,b.shareDBDocCommentToComment=rT,b.shortcutToDisplayText=qe,b.showBlock=Jg,b.showDocVersions=vtt,b.showTemplates=mx,b.splitText=Mn,b.splitToThree=Je,b.stringToDataUrl=Vg,b.stringToObjectUrl=jg,b.subText=$3,b.textNodeOffsetFromPoint=Fb,b.titleFromEditor=lS,b.toBase64URL=hi,b.toMindmap=y0,b.toPlainText=de,b.toPlainTextKeepLength=N1,b.trimChar=Ng,b.unexclusiveBlock=wE,b.unicodeLength=H9,b.unicodeSubstr=j9,b.updateBlockSelection=Pv,b.updateOpAttributes=fB,b.updateTextBlockContent=M8,b.updateUrl=Fg;for(const n in ye)n!=="default"&&!b.hasOwnProperty(n)&&Object.defineProperty(b,n,{enumerable:!0,get:()=>ye[n]});Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
962
|
+
\`\`\`\`\`\``}return""}const PJ={embedType:"plantuml",convertFrom:UJ,handleUpdateBlock:MJ,createEmbedContent:_J,getBlockProperties:OJ,convertTo:NJ},Hat="",FJ="hr",KJ={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},VJ={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},$J={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};D.mergeLang({"zh-CN":KJ,"en-US":VJ,"ja-JP":$J});function HJ(n,t){const e=v("div",["editor-embed-container"],t);v("hr",["editor-embed-hr"],e)}function jJ(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function zJ(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:D.t("dividingLine.type"),icon:FT,order:500,group:"common",subText:kn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,FJ,{})}}}function GJ(n,t,e){const{data:r}=e;if(!r||r.embedType!=="dividing-line"||!rt(n,t))return null;const i={};return{blockData:{id:et(),type:"embed",embedType:"hr",embedData:i}}}function WJ(){return{abstract:D.t("dividingLine.abstract")}}const qJ={embedType:"hr",createEmbedContent:HJ,convertTo:jJ,getOptions:zJ,convertFrom:GJ,getBlockProperties:WJ},jat="",zat="",XJ={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>',maxSizeFailed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6</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"}}},YJ={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>',maxSizeFailed:'<div class="line-1">{name} upload failed</div><div class="line-2">The file size exceeds limit. Please choose another file.</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"}}},QJ={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>',maxSizeFailed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u30D5\u30A1\u30A4\u30EB\u306E\u30B5\u30A4\u30BA\u304C\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u308B\u305F\u3081\u3001\u4ED6\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044</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"}}};D.mergeLang({"zh-CN":XJ,"en-US":YJ,"ja-JP":QJ});var ni=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(ni||{}),Of=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(Of||{});const kS=10*1024*1024,JJ=["wav","mp3","aac","ogg","webm","flac"],ZJ=["ogg","mp4","webm"],tZ=()=>{};function RS(n){var h,C,E,x,B,k;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:r,callbacks:i}=t,o=(C=e==null?void 0:e.audio)!=null?C:JJ,s=(E=e==null?void 0:e.video)!=null?E:ZJ,l=(x=r==null?void 0:r.audio)!=null?x:kS,c=(B=r==null?void 0:r.video)!=null?B:kS,d=(k=i==null?void 0:i.onError)!=null?k:tZ;return{allowedMedias:{audio:o,video:s},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function eZ(n,t){const e=o=>o.map(s=>`.${s}`).join(","),{allowedMedias:r}=RS(n),i=r[t];return i?e(i):"*"}function nZ(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:o}=RS(t),{[e]:s}=r,{[e]:l}=o;if(s&&n.size>s){const d=new Error("media is too large");throw d.code=`MaxMediaSize-${e}`,i!=null&&i.onError&&(i==null||i.onError(t,d)),d}const c=eu(n.name);if(l&&!l.includes(c.toLowerCase())){const d=new Error(`media file is not allowed: ${c}`);throw d.code="NotAllowedFile",i!=null&&i.onError&&(i==null||i.onError(t,d)),d}}function rZ(n){return n===Of.Empty||n===Of.Error}const en=I("media");class iZ extends ye.TypedEmitter{constructor(e){super();m(this,"mediaContainer",null);m(this,"media",null);m(this,"abstract",null);m(this,"handleMediaLoadError",(e,r)=>{if(!r.target||!(r.target instanceof Node)||!(r.target instanceof Element?r.target:r.target.parentElement))return;const o=Z(r.target);if(!o||!o.contains(this.mediaContainer))return;const s=this.renderError();this.updateMediaContent(s),this.emit("mediaError",e,"load_error",lt(o))});m(this,"handleUploadFile",async e=>{p(en,this.abstract,"no abstract"),p(en,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=Z(this.mediaContainer);p(en,i,"The block element not exist");const o=r.getBlockData(i);try{const{resourceId:s}=await r.doc.uploadResource(e,{onProgress:C=>{this.renderProgress(C,e)}}),{name:l,type:c,size:d}=e,h={...o,embedData:{...o.embedData,src:s,fileName:l,fileSize:d,fileType:c}};r.updateBlockData(i,h)}catch(s){en.error(s),this.emit("mediaError",r,"upload_error",o.id),this.renderRetry(e,s)}ot(i,"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){p(en,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(en,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:o}=this.abstract;p(en,this.mediaContainer,"The media element not exist");const s=Z(this.mediaContainer);p(en,s,"The block element not exist");const l=e.getBlockData(s),c=v("div",["media-error","embed-selected-content","embed-hover-content"],null),d=v("span",["media-error-icon"],c);d.innerHTML=i;const h=v("div",[],c);h.innerHTML=D.t("media.load.failed",{name:o}),c.appendChild(h);const C=h.querySelector(".retry-upload");return p(en,C,"The element not exist"),e.domEvents.addEventListener(C,"click",(E,x)=>{const B=v("div",["media-element"],null),k=this.getResourceUrl(l),w=r(E,B,l,k);this.unbindMediaEvent(),this.media=w,this.bindMediaEvent(),this.updateMediaContent(B)}),this.setFullScreen(),c}renderRetry(e,r){var E,x;p(en,this.abstract,"no abstract");const{editor:i}=this.options,{mediaIcon:o,mediaName:s}=this.abstract,l=v("div",["media-error","embed-selected-content","embed-hover-content"],null),c=v("span",["media-error-icon"],l);c.innerHTML=o;const d=v("div",[],l);let h=D.t("media.upload.failed",{name:s});(((E=r.response)==null?void 0:E.status)===420||((x=r.response)==null?void 0:x.status)===413)&&(h=D.t("media.upload.maxSizeFailed",{name:s})),d.innerHTML=h,l.appendChild(d);const C=d.querySelector(".retry-upload");C&&i.domEvents.addEventListener(C,"click",()=>{i.readonly||(p(en,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(en,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope .media-progress"),o=e===-1||e===100?100:e;if(i){const{updateProgressElement:s}=this.options;s(i,o)}else{const{createProgressElement:s}=this.options,l=Z(this.mediaContainer);p(en,l,"The element not exist"),z(l,"media-block-uploading");const c=v("div",["media-progress"],null);s(c,o,r),this.updateMediaContent(c)}this.setFullScreen()}renderMediaElement(e,r){p(en,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:o,updateMediaElement:s,editor:l}=this.options,c=this.getResourceUrl(e,r);if(i){const d=s(l,i,e,c);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent()}else{const d=v("div",["media-element"],null),h=o(l,d,e,c);this.unbindMediaEvent(),this.media=h,this.bindMediaEvent(),this.updateMediaContent(d)}}renderEmpty(e){p(en,this.abstract,"no abstract"),p(en,this.mediaContainer,"The media element not exist");const r=v("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);r.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(r);const{editor:i}=this.options;i.findBlockById(e.id)&&this.emit("mediaError",i,"empty",e.id),this.setFullScreen()}getResourceUrl(e,r){const{src:i}=e.embedData,{editor:o}=this.options;return o.doc.buildResourceUrl(i,{syncNewResources:async(s,l)=>{var d,h;if(!r)return;await o.doc.addResources([s]);const c=(h=(d=o.doc).getServerMeta)==null?void 0:h.call(d).appId;if(l!==e.embedData.src&&c&&e.embedData.src.includes(c)){const C=Z(r);if(C&&!o.readonly&&o.isBlockWritable(C)){const E=mt.default(e);E.embedData.src=s,o.updateBlockData(C,E)}}}})}setFullScreen(){p(en,this.mediaContainer,"The media element not exist"),z(this.mediaContainer,"full-screen")}removeFullScreen(){p(en,this.mediaContainer,"The media element not exist"),ot(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=Z(r);p(en,i,"The block element not exist");const{align:o}=e;e.embedType==="video"&&(i.hasAttribute("data-style-align")&&i.removeAttribute("data-style-align"),i.setAttribute("data-style-align",o))}render(e,r){const{src:i}=e.embedData;(!this.mediaContainer||!r.contains(this.mediaContainer))&&(this.mediaContainer=v("div",["media"],r)),this.updateBlockAlign(e,r),rZ(i)?i===Of.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}I("media-embed");const oZ="left";class wS{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var C;const{containerId:r,blockIndex:i}=e;let o;(C=e.data)!=null&&C.file&&(o=e.data.file);const s=eZ(t,this.embedType);if(o=o!=null?o:await ga(s,{}),!o)return null;const{mediaType:l}=this.getAbstract();try{nZ(o,t,l)}catch{return null}const c={id:et(),type:"embed",embedType:this.embedType,embedData:{src:Of.Empty}};l==="video"&&(c.align=oZ);const d=t.insertBlock(r,i,c);return await this.getMedia(t,c.id).handleUploadFile(o),d})}getMedia(t,e){const r=t.addCustom(`media-${e}`,()=>new iZ({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return r.setAbstract({...this.getAbstract()}),r}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:r,order:i,group:o}=this.getAbstract();return{name:r,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:i,group:o,subText:kn(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,r){const{id:i}=r;this.getMedia(t,i).render(r,e)}handleUpdateBlock(t,e,r){const{id:i}=r,o=this.getMedia(t,i),s=Nt(e);return o.render(r,s),!0}handleDeleteBlock(t,e){const r=e.id,i=this.getMedia(t,r);i.removeAllListeners(),i.destroy()}convertTo(t,e,r,i){const o=e.embedData,s=t.doc.buildResourceUrl(o.src,{withToken:!0});return i==="html"?`<${o.type} src="${s}" />`:i==="markdown"?``:s}}function SS(n,t){const e=v("div",["uploading-progress-mask"],n),r=v("div",["uploading-progress-bar"],e),i=v("div",["uploading-progress-bar-value"],r);i.style.width=`${t}%`}function LS(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const sZ=I("media-audio");class lZ extends wS{constructor(){super(...arguments);m(this,"embedType",ni.AUDIO);m(this,"updateProgressElement",LS);m(this,"createMediaElement",(e,r,i,o)=>{const s=v("div",["audio-container","embed-hover-content","embed-selected-content"],r),l=v("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=o,setTimeout(()=>{this.getMedia(e,i.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:OT,mediaName:D.t(`media.${ni.AUDIO}.menuItem`),menuItem:D.t(`media.${ni.AUDIO}.menuItem`),order:800,mediaType:ni.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${ni.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .audio-container > audio");return p(sZ,s,"The media element not exist"),s.src!==o&&(s.src=o),s}createProgressElement(e,r){const i=v("audio",[],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,i.src="about:blank",SS(e,r)}}const aZ=new lZ;I("video-resizer");function IS(n){return n&&pe(n)&&$e(n)==="video"}const cZ=50;class Tx{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&IS(e)&&this.disableBlockResize(e),t&&IS(t)&&this.editor.isBlockWritable(t))){const r=this.getVideoElement(t);if(!r)return;this.enableBlockResize(t,r)}});m(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const r=t.getBlock();if(!r)return;const i=r.getBoundingClientRect().width,o=Math.min(Math.max(e.width,cZ),i);this.currentResizableElement.style.width=`${o}px`,this.currentResizableElement.style.pointerEvents="none"});m(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const r=this.editor.getBlockData(e),{width:i}=this.currentResizableElement.getBoundingClientRect();this.currentResizableElement.style.pointerEvents="auto",this.editor.updateBlockData(e,{...r,width:i})});this.editor=t,Re.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,Re.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return Nt(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const r=this.editor.addCustom(`${lt(t)}-resizer`,()=>new mf(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));r.enableResize(t,e),r.removeListener("resizing",this.handleResizing),r.removeListener("resized",this.handleResized),r.addListener("resizing",this.handleResizing),r.addListener("resized",this.handleResized),this.currentResizableElement=e}}const uZ=I("video");class fZ extends wS{constructor(){super(...arguments);m(this,"embedType",ni.VIDEO);m(this,"updateProgressElement",LS);m(this,"createMediaElement",(e,r,i,o)=>{const s=v("div",["video-container","embed-selected-content","drag-preview-element"],r),l=v("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=o,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new Tx(e)),this.getMedia(e,i.id).removeListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).addListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).removeFullScreen()}),i.width&&(l.style.width=`${i.width}px`),l});m(this,"createProgressElement",(e,r,i)=>{const o=v("video",["progress-video"],e);o.innerHTML="Your browser does not support the <code>audio</code> element.",o.controls=!0,SS(e,r),ma(i).then(s=>{const l=e.querySelector(".progress-video");l&&r1(e)&&(l.src=s)})})}getAbstract(){return{mediaName:D.t(`media.${ni.VIDEO}.menuItem`),mediaIcon:NT,menuItem:D.t(`media.${ni.VIDEO}.menuItem`),order:700,mediaType:ni.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${ni.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const o=e.addCustom("video-resizer",()=>new Tx(e)),s=e.getBlockById(i);o.disableBlockResize(s)}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .video-container > video");p(uZ,s,"The media element not exist"),s.src!==o&&(s.src=o),i.width?s.style.width=`${i.width}px`:s.style.width="";const l=e.getBlockById(i.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new Tx(e)).updateResizer(l)}),s}}const dZ=new fZ,DS=[aE,pE,CE,kk],yx=[bS,hQ,bJ,LJ,PJ,BK,qJ,dZ,aZ,yz,J4,sX],_S=[Pk,eS,T4,Hk];function hZ(n,t,e){var i,o,s,l;_r.level=(i=e.logLevel)!=null?i:Ho.DEBUG;const r=Su(n,t,{components:{blocks:[...DS,...((o=e==null?void 0:e.components)==null?void 0:o.blocks)||[]],embeds:[...yx,...((s=e.components)==null?void 0:s.embeds)||[]],boxes:[..._S,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new HC],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new cx(r)),r.addCustom("editor-tooltip",()=>new sf(r)),r.addListener("clickLink",(c,d,h)=>{var E;if((E=e==null?void 0:e.events)!=null&&E.onClickLink){e.events.onClickLink(c,d,h);return}const C=h.getAttribute("link");C&&(c.readonly||d.ctrlKey||d.metaKey)&&window.open(C,"_blank")}),r}class MS{constructor(t){this.createOptions=t,t.lang&&D.setLang(t.lang)}createHistoryEditor(t,e){return hZ(t,e,this.createOptions)}}function US(n,{root:t,childDoc:e,doc:r}){var h,C;e.uploadResource=r.uploadResource.bind(r),e.buildResourceUrl=r.buildResourceUrl.bind(r);const i=n.getComponentOptions("comment"),o={image:{defaultAlign:"left"},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0},...i==null?void 0:i.componentsOptions},s=[];n.editorBlocks.forEach(E=>{E.blockType==="text"||E.blockType==="embed"||s.push(E)});const l=[];n.editorEmbeds.forEach(E=>{l.push(E)});const c=[];n.editorBoxes.forEach(E=>{E.boxType==="text"||E.boxType==="br"||E.boxType==="image"||E.boxType==="anchor"||c.push(E)});const d=Su(t,e,{shortcuts:[Oh],components:{blocks:s,commandProviders:[new m0],decorators:[new V0],embeds:l,boxes:c,options:o}});if(d.input.addHandler(new H0),d.input.addHandler(new OE(d)),d.input.addHandler(new $E(d)),d.input.addHandler(new pq(d)),d.input.addHandler(new W0),d.addCustom("image-paste-handler",()=>new UE(d)),ie.isMobile||d.addCustom("editor-tooltip",()=>new sf(d)),n.options.enableContextMenu!==!1&&d.addCustom("editor-context-menu",E=>new zE(E)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new tS(d,{...E}))}if((C=n.options.componentsOptions)!=null&&C.comment){const E=n.options.componentsOptions.comment;E.onCommentEditorClick&&d.addListener("click",E.onCommentEditorClick)}return d}function mZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const o=Z(i);o&&r.add(o)}),r.forEach(i=>{Cq(n,i,t)})}class gZ{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 r=e.groupId;this.getComments().filter(o=>o.groupId===r).length===0&&mZ(this.editor,r)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return US(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class pZ{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 Vp(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 US(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const CZ={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}",limitedEnvTips:"\u7531\u4E8E\u6D4F\u89C8\u5668\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528 {shortCut} \u7C98\u8D34"}},EZ={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}",limitedEnvTips:"Press {shortCut} to paste due to browser restrictions"}},xZ={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",limitedEnvTips:"\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u5236\u9650\u306B\u3088\u308A\u3001\u300C{shortCut}\u300D\u3092\u4F7F\u7528\u3057\u3066\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044"}};D.mergeLang({"zh-CN":CZ,"en-US":EZ,"ja-JP":xZ});const AZ="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=",bZ=()=>Kg(AZ),vZ=I("image-to-docx");async function BZ(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>{t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=e,r.src=n})}async function OS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await ma(new File([t],"",{})),r=await BZ(e);return r.width===void 0||r.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||r.width*n.height/r.height,height:n.height||r.height*n.width/r.width,buffer:t}:{width:r.width,height:r.height,buffer:t}}catch(e){vZ.error(e);return}}function TZ(n,t){let e=n.filter(s=>s!=null);const r=t-(e.length-1)*20,i=.87,o=e.reduce((s,l)=>s+l.width,0);return o>r&&(e=e.map(s=>({width:s.width*r/o,height:s.height*r/o,buffer:s.buffer}))),e.map(s=>({width:s.width*i,height:s.height*i,buffer:s.buffer}))}function yZ(n,t,e){if(!e||typeof e!="object")return;const r=e,i=n.filter(s=>s!=null),o=t-(i.length-1)*20;i.forEach((s,l)=>{if(i.length===1&&r.widthPercent){const d=r.widthPercent,h=s.width;s.width=o*(d/100),s.height*=s.width/h;return}const c=`${l}_flex`;if(r[c]){const d=r[c],h=s.width;s.width=o*d,s.height*=s.width/h}})}function NS(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let r;switch(e%3){case 0:r=Et.LevelFormat.DECIMAL;break;case 1:r=Et.LevelFormat.LOWER_LETTER;break;default:r=Et.LevelFormat.LOWER_ROMAN;break}return{level:e,format:r,text:`%${e+1}. `,alignment:Et.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(e+1)),hanging:Et.convertInchesToTwip(.2)}}}}})}function kZ(){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:Et.LevelFormat.BULLET,text:t,alignment:Et.AlignmentType.START,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(n+1)),hanging:Et.convertInchesToTwip(.2)}}}}})}function RZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Et.LevelFormat.BULLET,text:"\u2611",alignment:Et.AlignmentType.START,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(n+1)),hanging:Et.convertInchesToTwip(.2)}}}}))}function wZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Et.LevelFormat.BULLET,text:"\u2610",alignment:Et.AlignmentType.START,style:{paragraph:{indent:{left:Et.convertInchesToTwip(.3*(n+1)),hanging:Et.convertInchesToTwip(.2)}}}}))}var Nf=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(Nf||{});const SZ=[{levels:NS(),reference:"number-numbering-reference"},{levels:kZ(),reference:"number-bullet-reference"},{levels:RZ(),reference:"checked-bullet-reference"},{levels:wZ(),reference:"unchecked-bullet-reference"}];function LZ(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 IZ(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 DZ(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 _Z=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function PS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(_Z);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},r=e(t[1]),i=e(t[2]),o=e(t[3]);return`${r}${i}${o}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function fn(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 FS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(fn(n,i))return i}}function pm(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function kx(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function KS(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function MZ(n){const t=fn(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const r of e){const i=r.split(":");if(i.length!==2)continue;const o=i[0].trim().toLowerCase(),s=i[1].trim().toLowerCase();o==="font-size"&&pm(n,"inline-style-font-size",s),o==="color"&&pm(n,"inline-style-color",s),o==="background-color"&&pm(n,"inline-style-background-color",s),o==="font-family"&&pm(n,"inline-style-font-family",s)}}function UZ(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function OZ(n){const t=`${fn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function NZ(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 PZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function FZ(n){return fn(n,"inline-style-font-family")}function KZ(n){const t=fn(n,"inline-style-background-color");return PS(t)}function VZ(n){const t=fn(n,"inline-style-color");return PS(t)}function $Z(n){MZ(n);const t=fn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!fn(n,"style-code"),link:KS(fn(n,"link")),size:OZ(n),text:t?PZ(n):NZ(n)||n.insert,bold:!!fn(n,"style-bold"),underline:!!fn(n,"style-underline"),italics:!!fn(n,"style-italic"),strike:!!fn(n,"style-strikethrough"),superScript:!!fn(n,"style-super"),subScript:!!fn(n,"style-sub"),math:fn(n,"type")==="math"?fn(n,"src"):void 0,mention:t,fontFamily:FZ(n),background:KZ(n),color:t?"338fe5":LZ(FS(n,"style-color-",6))||VZ(n),highlight:FS(n,"style-bg-color-",13)}}function HZ(){return[new Et.Paragraph({border:{top:{color:"auto",style:Et.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Et.Paragraph({spacing:{line:0}})]}function jZ(){return new Et.Paragraph({children:[new Et.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function zZ(){return new Et.Paragraph({children:[new Et.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function GZ(n,t){return new Et.Paragraph({children:[new Et.ExternalHyperlink({children:[new Et.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function VS(n){if(n.heading!=null)return`Heading${n.heading}`}function $S(n){if(n.alignment!=null){if(n.alignment==="center")return Et.AlignmentType.CENTER;if(n.alignment==="right")return Et.AlignmentType.RIGHT;if(n.alignment==="left")return Et.AlignmentType.LEFT}}function WZ(n){if(n.indent)return{left:Et.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Et.convertInchesToTwip(.3*n.padding)}}function qZ(n){return{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function XZ(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function HS(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const r=n.size||t,i=r!=null?Math.floor(r*1.5+.5):void 0;return new Et.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Et.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:i,style:e,font:n.fontFamily?XZ(n.fontFamily):void 0,shading:n.background?qZ(n.background):void 0,color:n.color,highlight:IZ(n.highlight)})}function YZ(n,t){if(n.link)return new Et.ExternalHyperlink({children:[HS(n,t)],link:n.link})}async function jS(n,t,e,r,i){const[o]=await i(n,t,e);if(o==null)return;const s=await OS({width:r||0,height:0,src:e},o);return new Et.ImageRun({data:o,transformation:{width:(s==null?void 0:s.width)||100,height:(s==null?void 0:s.height)||20}})}function QZ(n){if(n.heading||n.heading)return n.heading}function JZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function ZZ(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function ttt(n,t){var r;const e=[];if(n.text&&Array.isArray(n.text)){for(let i=0;i<n.text.length;i++){const o=n.text[i];if(((r=o.attributes)==null?void 0:r.box)===!0&&t){const s=await t(o);if(s){n.text.splice(i+1,0,...s);continue}}e.push($Z(o))}return e}}function ett(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 ntt(n,t){if(n.type==="embed"&&n.embedType&&kx(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(r=>{const i=t(r),o=n.embedData[`${i}_width`],s=n.embedData[`${i}_height`];return{src:r,width:o,height:s}})}function rtt(n){if(n.padding)return n.padding}function itt(n){return!!(n.type==="embed"&&n.embedType&&kx(n.embedType)&&n.embedData&&n.embedData.src)}async function Cm(n,t,e){return{quoted:!!n.quoted,heading:QZ(n),alignment:JZ(n),indent:ZZ(n),padding:rtt(n),texts:await ttt(n,e),list:ett(n),images:ntt(n,t),border:itt(n)}}async function ott(n,t,e,r){const i=[];if(!n.children)return[];for(const o of n.children){const s=[];for(const l of t.blocks[o])s.push(await Cm(l,e,r));i.push(s)}return i}const stt=I("to-docx");function ltt(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 att(n,t,e,r){const i=!!n.hasColTitle,o=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let d=0;d<e;d++)(i&&d===0||o&&c===0||s&&c%2===1)&&(r[c][d].color=l)}function ctt(n){p(stt,n.children,"no table children");const t=n.rows,e=n.cols,r=n.colsWidth;if(r)for(let s=0;s<r.length;s++)r[s]===0&&(r[s]=100);const i=ltt(t,e);let o=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(i[s][l].originalWidth=r?r[l]:void 0,i[s][l].from!==void 0)continue;const c=n.children[o];o+=1,i[s][l].cellId=c,i[s][l].color=DZ(n[`${c}_background`]),i[s][l].width=r?r[l]:100,i[s][l].align=n[`${c}_align`];const d=n[`${c}_rowSpan`]||1,h=n[`${c}_colSpan`]||1;if(i[s][l].rowSpan=d,i[s][l].colSpan=h,d>1||h>1){let C=0;for(let E=0;E<d;E++)for(let x=0;x<h;x++)E===0&&(C+=r?r[l+x]:80),!(E===0&&x===0)&&(i[s+E][l+x].from=[s,l]);i[s][l].width=C}}return att(n,t,e,i),i}async function utt(n,t,e,r,i,o,s,l,c,d){async function h(E){if(l&&E.type!=="_exportVirtualBlock"){const x=await l(i,o,E);if(x){await r.addDoc(n,x,d);return}}if(E.type==="text"||E.textOnly===!0){const x=await Cm(E,s,c);await r.addTextBlock(x);return}if(E.type==="code"){const x=await ott(E,e,s,c);await r.addCodeBlockObject(x);return}if(E.type==="list"&&E.textOnly!==!0){const x=await Cm(E,s,c);await r.addListBlockObject(n,x);return}if(E.type==="embed"&&E.embedType){const x=E,B=x.embedData,k=x.embedType;if(kx(k)){const w=await Cm(E,s,c);await r.addImagesBlockObject(E,w,d)}else E.embedType==="hr"?r.addSeparatorBlock():E.embedType==="video"?r.addVideoPlaceholder():E.embedType==="audio"?r.addAudioPlaceholder():E.embedType==="webpage"?r.addHyperlinkParagraph(KS(B.src),B.title):r.addOtherEmbedBlock(k,E.embedData);return}if(E.type==="table"){let x=[];if(E.colsWidth)x=E.colsWidth;else{const k=E.cols;x=new Array(k);for(let w=0;w<x.length;w++)x[w]=100;E.colsWidth=x}const B=ctt(E);await r.addTableMatrix(x,B,e),r.addEmptyParagraph()}E.type==="_exportVirtualBlock"&&await r.addVirtualBlock(E.id,e,d)}function C(E){var k;const x=((k=E==null?void 0:E.embedData)==null?void 0:k.exportSpec)||(E==null?void 0:E.exportSpec);if(!x)return[E];const B=[];for(const{type:w,data:U}of x){if(w==="text"){const M={id:et(),text:[{insert:U}],type:"text"};B.push(M);continue}if(w==="image"){const M={id:et(),type:"embed",embedType:"image",align:"left",embedData:{src:U}};B.push(M);continue}if(w==="link"){const M={id:et(),type:"embed",embedType:"webpage",embedData:{src:U.url,title:U.title}};B.push(M);continue}if(w==="block")for(const M of U){if(!e.blocks[M])continue;const Y={id:M,type:"_exportVirtualBlock"};B.push(Y)}}return B}for(const E of t)for(const x of C(E))!x||await h(x)}function ftt(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const dtt=I("to-docx");class htt{constructor(t,e,r,i,o,s){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=r,this.readImageFunc=i,this.convertBlocksFunc=o,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Et.Paragraph({heading:VS(t),alignment:$S(t),children:await this.paragraphsFromBlockTexts(t),indent:WZ(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new Et.Paragraph({text:`[${D.t("docx.imageExportFailed")}]`,shading:{type:Et.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=UZ(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const o=YZ(i,e);o&&r.push(o);continue}if(i.box&&i.box.type&&i.box.type==="br"){r.push(new Et.TextRun({text:"",break:1}));continue}if(i.box&&i.box.type&&i.box.type==="image"){const o=await jS(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);o&&r.push(o);continue}if(i.math){const o=await jS(this.appId,this.docId,i.math,0,this.readImageFunc);o&&r.push(o);continue}r.push(HS(i,e))}return r}async addCodeBlockObject(t){for(const e of t)for(const r of e){const i={style:Et.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Et.Paragraph({style:"Code",border:{left:{...i},right:{...i},top:{...i},bottom:{...i}},children:await this.paragraphsFromBlockTexts(r)}))}}async addListBlockObject(t,e){if(e.list==null)return;let r;const i=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[i])r=this.state.listInstMap[i];else if(r=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[i]=r,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${r}`,l=NS([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:r}),this.state.listRefMap[i]=s}else e.list.ordered?this.state.listRefMap[i]=Nf.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[i]=Nf.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[i]=Nf.UNCHECKED:this.state.listRefMap[i]=Nf.BULLET;const o=VS(e);e.texts&&this.paragraphs.push(new Et.Paragraph({heading:o,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[i],level:e.list.level-1,instance:r}}))}imageDimWithBufferToImageRun(t){return new Et.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e,r){if(e.images==null){if(t.type==="embed"&&t.embedType==="image"){const{src:c}=t.embedData;c||this.addEmptyImagePlaceHolder()}return}const i=[],o=await Promise.all(e.images.map(async c=>{const[d,h]=await this.readImageFunc(this.appId,this.docId,c.src);if(d){const C=await OS(c,d);if(C)return C}i.push(h)}));yZ(o,r,t.embedData);const s=TZ(o,r),l={style:Et.BorderStyle.SINGLE,color:"#DEDEDE"};s.length&&this.paragraphs.push(new Et.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:$S(e)||Et.AlignmentType.CENTER,children:s.map(c=>this.imageDimWithBufferToImageRun(c)).flatMap((c,d,h)=>c==null?[]:h.length-1!==d?[c,new Et.TextRun({text:" "})]:c)})),i.forEach(c=>{this.addHyperlinkParagraph(c)})}addSeparatorBlock(){HZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Et.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(jZ())}addAudioPlaceholder(){this.paragraphs.push(zZ())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(GZ(t,e))}async addTableMatrix(t,e,r){const i=t.map(o=>o!==0?o*15:1500);this.paragraphs.push(new Et.Table({rows:await this.generateTableRows(e,r),columnWidths:i}))}async generateRowCells(t,e){const r=[];for(const i of t){const o=i.cellId;if(o===void 0)continue;const s=i.width*.9;r.push(new Et.TableCell({children:await this.convertBlocksFunc(o,e.blocks[o],e,this.appId,this.docId,this.state,s),columnSpan:i.colSpan,rowSpan:i.rowSpan,width:{type:Et.WidthType.DXA,size:i.width*15},shading:i.color?{fill:i.color,type:Et.ShadingType.CLEAR,color:"auto"}:void 0}))}return r}async generateTableRows(t,e){const r=[];for(const i of t)r.push(new Et.TableRow({children:await this.generateRowCells(i,e)}));return r}async addDoc(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,r);i&&(this.paragraphs=this.paragraphs.concat(i))}async addVirtualBlock(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks[t],e,this.appId,this.docId,this.state,r);this.paragraphs.push(...i)}async addOtherEmbedBlock(){}}class mtt{constructor(t,e,r,i,o,s,l,c){m(this,"convertBlocks",async(t,e,r,i,o,s,l=720)=>{const c=new htt(i,o,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await utt(t,e,r,c,i,o,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=r,this.readImage=i,this.defaultFontSize=o,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=c}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,r){const i=new Et.ImportDotx,o=this.templateData?await i.extract(this.templateData):void 0,s=t.blocks.root;p(dtt,s,"data must have blocks");const l=ftt(),c=await this.convertBlocks("blocks",s,t,e,r,l),d=this.backgroundImageOptions?{default:new Et.Header({children:[new Et.Paragraph({children:[new Et.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new Et.Document({numbering:{config:[...SZ,...l.levelConfigs]},sections:[{headers:d,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:o});return Et.Packer.toBlob(h)}}async function gtt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let o=await aS(i);if(!o)return[void 0,i];if(o.type.indexOf("/svg")!==-1){const l=await oS(o);l&&(o=new File([l],o.name))}return[await o.arrayBuffer(),i]}async function ptt(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)return r.toStandardDoc(n,e,t)}async function Ctt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function Ett(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=bZ());const o=n.doc.toJSON(),s=(C,E,x)=>gtt(n,C,E,x),l=async(C,E,x)=>ptt(n,o,x),c=async C=>Ctt(n,C),h=await new mtt(e,o,Md.default,s,void 0,l,c,i).convert("_appId","_docId");if(r){const C=URL.createObjectURL(h),E=document.createElement("a");E.setAttribute("download",`${lS(n)}.docx`),E.setAttribute("href",`${C}`),E.click(),E.remove()}return h}const Rx=I("create-editor");async function xtt(n,t){var s,l,c,d,h,C,E,x,B,k,w,U,M,F,Y,X;p(Rx,n,"app does not exists"),t.lang&&D.setLang(t.lang),_r.level=(s=t.logLevel)!=null?s:Ho.DEBUG;const e=t.onReauth?async()=>{var Ct;const G=t.user.userId,st=t.docId,pt=await((Ct=t.onReauth)==null?void 0:Ct.call(t,G,st,t.permission));return{userId:G,docId:st,permission:t.permission,appId:t.appId,token:pt,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,r={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},i=await Hu.load(r),o=Su(n,i,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,enableContextMenu:t==null?void 0:t.enableContextMenu,components:{blocks:[...DS,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...yx,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[..._S,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new m0,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new V0,new Hp],insertions:[$1],blockHooks:[new LE,new ZR,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new p4,new HC,...((E=t.components)==null?void 0:E.textRenders)||[]],options:{...t.componentsOptions}},shortcuts:[wq,rH,gz,cE,$w,cF,rE,dX,Oh,nF,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(o.editorCommandProviders.registerCommandProvider(new Di(o)),o.input.addHandler(new eY),o.input.addHandler(new H0),o.input.addHandler(new wK),o.input.addHandler(new lz),o.input.addHandler(new EE(o,{hideTitle:t.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0,applyContentPlaceholder:(x=t.placeholder)==null?void 0:x.applyContentPlaceholder})),o.input.addHandler(new M0(o,(B=t.componentsOptions)==null?void 0:B.quickMenu)),o.input.addHandler(new OE(o)),o.input.addHandler(new $E(o)),o.input.addHandler(new W0),o.doc.registerCallback(new nY(o)),o.addCustom("remote-cursor",()=>new oT(o)),o.addCustom("block-menu",G=>new nw(G)),ie.isMobile||o.addCustom("editor-tooltip",()=>new sf(o)),t!=null&&t.enableComments&&o.addCustom("editor-comments",G=>new g4(G,new gZ(G))),t.enableContextMenu!==!1&&o.addCustom("editor-context-menu",G=>new zE(G)),o.addCustom("create-options",()=>new Sb(o,t)),o.addCustom("drop-target",()=>new Tf(o)),o.addCustom("list-to-mindmap",()=>new R0(o)),o.addCustom("list-to-mention",()=>new BY(o)),o.addCustom("mobile-helper",()=>new zY(o)),o.addCustom("code-caret",()=>new Z$(o)),o.addCustom("image-paste-handler",()=>new UE(o)),(k=t.componentsOptions)!=null&&k.mention){const G=t.componentsOptions.mention;o.addCustom("mention",()=>new tS(o,G))}if(o.addCustom("heading-collapse",()=>new cx(o)),o.addCustom(mm,G=>new px(G)),ec.register(o),Tf.register(o),Ts.register(o),Es.register(o),o.addListener("clickLink",(G,st,pt)=>{var yt;if((yt=t==null?void 0:t.events)!=null&&yt.onClickLink){t.events.onClickLink(G,st,pt);return}const Ct=pt.getAttribute("link");Ct&&(G.readonly||st.ctrlKey||st.metaKey)&&window.open(Ct,"_blank")}),(U=(w=t.componentsOptions)==null?void 0:w.remoteCarets)!=null&&U.onUserChanged){const G=(F=(M=t.componentsOptions)==null?void 0:M.remoteCarets)==null?void 0:F.onUserChanged;o.doc.getRemoteUsers().on("change",st=>{G(o,st)})}return(X=(Y=t.componentsOptions)==null?void 0:Y.templates)!=null&&X.templates.length&&(o.addListener("docChanged",()=>{hm(o)}),o.addListener("resize",()=>{hm(o,{reset:!0})}),setTimeout(()=>{hm(o)},100)),o.doc.registerCallback({onError:async G=>{if(G.code==="ResetDoc"){Rx.error(`reset doc: ${G.message}`);const st=await Hu.load(r);o.doc.reset(st)}}}),o.version="1.1.17-beta.8",_r.level===Ho.DEBUG&&(window.setReauthFail=G=>{window.isReauthError=G},window.reConnect=G=>o.doc.externalDoc.client.connection.reConnect(G)),o}function Att(n){return n.toJSON!==void 0}async function btt(n,t,e){var o,s,l,c,d,h,C,E;p(Rx,n,"app does not exists");const r=Att(t)?t:new bp(t,{serverUrl:e.serverUrl||""});e.lang&&D.setLang(e.lang),_r.level=(o=e.logLevel)!=null?o:Ho.DEBUG;const i=Su(n,r,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[aE,pE,CE,kk,...(l=(s=e.components)==null?void 0:s.blocks)!=null?l:[]],commandProviders:[new m0],decorators:[new V0,new Hp],embeds:[...yx,...((c=e.components)==null?void 0:c.embeds)||[]],boxes:[Pk,eS,T4,Hk,...((d=e.components)==null?void 0:d.boxes)||[]],insertions:[$1],blockHooks:[new LE,...((h=e.components)==null?void 0:h.blockHooks)||[]],textRenders:[new p4,new HC,...((C=e.components)==null?void 0:C.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[cE,$w,rE,Oh]});return i.editorCommandProviders.registerCommandProvider(new Di(i)),i.input.addHandler(new H0),i.input.addHandler(new EE(i,{hideTitle:e.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new M0(i,(E=e.componentsOptions)==null?void 0:E.quickMenu)),i.input.addHandler(new OE(i)),i.input.addHandler(new $E(i)),i.input.addHandler(new W0),i.addCustom("block-menu",x=>new nw(x)),ie.isMobile||i.addCustom("editor-tooltip",()=>new sf(i)),i.addCustom("image-paste-handler",()=>new UE(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",x=>new g4(x,new pZ(x,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",x=>new zE(x)),i.addCustom("heading-collapse",()=>new cx(i)),i.addListener("clickLink",(x,B,k)=>{var U;if((U=e==null?void 0:e.events)!=null&&U.onClickLink){e.events.onClickLink(x,B,k);return}const w=k.getAttribute("link");w&&(x.readonly||B.ctrlKey||B.metaKey)&&window.open(w,"_blank")}),i.addCustom(mm,x=>new px(x)),ec.register(i),i.version="1.1.17-beta.8",i}async function vtt(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await Wh.load({auth:r,serverUrl:e});if(!((h=i.getVersionHelper)==null?void 0:h.call(i)))throw new Error("the editor does not support to show versions");const s=n.getCustom("create-options");if(!s)throw new Error("the editor does not support to show versions");const l=s.getData(),c=new MS(l),d=n.addCustom("version-dialog",()=>new K4(i,c));return d.show(t),d}b.tippy=t9,b.AnchorBox=TB,b.AuthError=Vu,b.AuthHeader=cl,b.AutoScroll=Qd,b.BaseURLHeader=Na,b.BasicCommands=YF,b.BlockExclusiveHook=ZR,b.BlockLockerHook=LE,b.BlockLockerPasteHandler=W0,b.BlockResizer=mf,b.BrBox=AB,b.CodeBlock=pE,b.CodeLineBlock=CE,b.CodeTextDecorator=V0,b.DOC_RE_AUTH_KEYS=mm,b.DefaultShortcuts=Oh,b.DocIdError=zU,b.DocReAuthCallbacks=px,b.DragDrop=Wb,b.DrawioEmbed=bS,b.EditorBlocks=r3,b.EditorBoxes=vB,b.EditorCommandProviders=x2,b.EditorComplexBlockPosition=Kr,b.EditorComplexSelectionRange=pi,b.EditorDecorators=wB,b.EditorEmbeds=o3,b.EditorInsertions=RB,b.EditorSimpleBlockPosition=Ye,b.EditorSimpleSelectionRange=rn,b.EmbedBlock=l3,b.EmbedBlockResizer=Df,b.EnforceWithDocumentTitleHandler=EE,b.EventCallbacks=fa,b.FILL_CHAR=g8,b.FileExtError=GU,b.GroupOrder=Lk,b.HeadingBlockScrollListener=pY,b.ImageBox=BB,b.InlineBoxCommandProvider=jk,b.InputtingInsertion=yB,b.LocalDoc=bp,b.LogLevel=Ho,b.Logger=_r,b.MIN_DISTANCE_THRESHOLD=zb,b.ManualCloseDialog=zu,b.ManualMenu=ls,b.ManualToolbar=ju,b.MarkdownInputHandler=H0,b.MaxUserError=Mp,b.Mindmap=k0,b.OnesEditorAutoSuggest=uC,b.OnesEditorCustomDataWrapper=Sb,b.OnesEditorExclusiveBlock=Es,b.OnesEditorHoveringBlock=Re,b.OnesEditorIcons=IO,b.OnesEditorQuickMenu=M0,b.OnesEditorToc=Uf,b.OnesEditorTocProvider=Ts,b.OnesEditorToolbar=ec,b.OnesEditorTooltip=sf,b.OnesEditorVersionsDialog=K4,b.PermissionError=Gh,b.Popup=Va,b.ReAuthToolbar=cS,b.RemoteCarets=oT,b.RemoteCaretsDecorator=Hp,b.RemoteCaretsInsertion=$1,b.RemoteUsers=Lu,b.RequestReloadError=$u,b.RichText=pn,b.ShareDBDoc=Hu,b.ShareDBDocVersionsProvider=MS,b.ShareDBServer=Wh,b.SimpleCache=Nb,b.StandardEmbedBlockCommands=ex,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=b1,b.TEXT_STYLE_COLOR_PREFIX=A1,b.TableBlock=aE,b.TableBlockCommandProvider=m0,b.TableShortcuts=cE,b.TextBlock=Nn,b.TextBox=xB,b.TextColorItem=By,b.TextStyleShortcuts=rE,b.TocEmbed=J4,b.ZERO_WIDTH_SPACE_CHAR=Yc,b.abbreviation=Jd,b.addAttribute=lh,b.addClass=z,b.addCommentToBlock=If,b.addDays=cI,b.addMetaToDoc=Ru,b.addMonths=aI,b.animateScrollTo=Gs,b.applyPlaceholderToBlock=df,b.assert=p,b.autoShowHideTemplates=hm,b.bindKeyDownEvent=Hd,b.blockToDoc=gp,b.blockToHtml=z1,b.blockToMarkdown=Bh,b.blockToText=vh,b.blocksToDoc=$5,b.clearAllSelection=Nv,b.clientType=ie,b.cloneBlock=ts,b.cloneChildContainer=ep,b.cloneDoc=np,b.cloneText=uB,b.commentToShareDbComment=$p,b.compareElement=Vd,b.comparePosition=d1,b.complexBlockAdjustSelectionPos=ih,b.complexBlockFindNearestChildBlock=l7,b.complexBlockGetAllChildContainers=an,b.complexBlockGetBottomChildContainers=f3,b.complexBlockGetDeepFirstChild=a3,b.complexBlockGetFirstSimpleChild=m1,b.complexBlockGetLastSimpleChild=xa,b.complexBlockGetSelectedContainers=Ea,b.complexBlockGetTopChildContainers=u3,b.containerToDoc=H5,b.continuousScroll=cv,b.convertBlockFrom=nh,b.convertImageFileToPng=oS,b.convertImageSrcToPng=FY,b.converterIntercept=$0,b.copyBlockAttributes=KB,b.copyResourcesFromDoc=Ap,b.createBlockAnchor=Zi,b.createBlockCaretAnchor=h3,b.createBlockContentElement=Zs,b.createBlockElement=wv,b.createBlockSimpleDocRange=Ch,b.createBlockSimpleRange=ve,b.createBoxContentElement=Iv,b.createBoxElement=Sv,b.createBoxOp=cB,b.createChildContainer=e3,b.createComplexBlockPosition=xe,b.createComplexDocPos=gB,b.createComplexDocRange=E8,b.createContainer=dB,b.createContainerElement=Yg,b.createDeleteOps=oB,b.createEditor=Su,b.createEditorSelectionRange=Qe,b.createElement=v,b.createEmptyContainer=oo,b.createEmptyDoc=io,b.createEmptyTextBlockData=gh,b.createExpandedRange=Fd,b.createIconButton=Hs,b.createImage=Lg,b.createInsertOps=hh,b.createInsertionContentElement=Mv,b.createInsertionElement=Dv,b.createLocalEditor=btt,b.createOnesEditor=xtt,b.createRange=Pb,b.createRichText=ol,b.createRootContainer=t3,b.createSimpleBlockPosition=at,b.createSimpleDocPos=mB,b.createTextBlockData=Ai,b.createTextButton=El,b.createTextOp=Er,b.createTextWithReplaceSoftReturn=_1,b.daysAfter=zg,b.deleteText=U1,b.diffDays=uI,b.disablePageScroll=$g,b.docToHtml=UB,b.docToHtmlFragment=Au,b.docToMarkdown=OB,b.docToText=Zo,b.downloadImageToFile=aS,b.downloadObjectToFile=xx,b.downloadSvgToString=dS,b.editLink=nf,b.editorAddComment=xq,b.editorAddTextAttribute=QB,b.editorAutoInsertBlock=VB,b.editorBreakTextBlock=Sa,b.editorClearCompositionText=X1,b.editorClearSelectedContents=wh,b.editorCopyBlock=Ep,b.editorCopyDoc=Uh,b.editorDeleteBlock=J1,b.editorDeleteBlockText=Y1,b.editorDeleteBlockWithoutChildren=kh,b.editorDeleteChildContainer=p_,b.editorDeleteChildContainers=$B,b.editorFocusToBlock=tp,b.editorFocusToEnd=U_,b.editorGetBlockData=Jo,b.editorGetBlockText=yn,b.editorGetBlockTextEx=xh,b.editorGetBoxData=CB,b.editorHandleKeyboardEvent=e2,b.editorInsertBlock=wa,b.editorInsertBoxToBlock=PB,b.editorInsertDoc=XB,b.editorInsertDocAt=rp,b.editorInsertText=q1,b.editorInsertTextToBlock=NB,b.editorInsertTextToBlockEx=W1,b.editorMergeTextBlock=HB,b.editorMoveDown=u5,b.editorMoveEnd=up,b.editorMoveHome=A5,b.editorMoveLeft=l5,b.editorMoveLineEnd=w5,b.editorMoveLineHome=R5,b.editorMovePageDown=M5,b.editorMovePageUp=_5,b.editorMoveRight=a5,b.editorMoveUp=c5,b.editorMoveWordEnd=C5,b.editorMoveWordLeft=p5,b.editorRangeClearColor=ZB,b.editorRangeGetColor=t5,b.editorRangeSetColor=JB,b.editorRemoveTextAttribute=A_,b.editorReplaceBlockText=Sh,b.editorReplaceContainer=YB,b.editorRunOnce=vp,b.editorSelectAll=dp,b.editorSelectContainer=Dh,b.editorSelectDown=f5,b.editorSelectEnd=fp,b.editorSelectHome=b5,b.editorSelectLeft=d5,b.editorSelectLineEnd=k5,b.editorSelectLineHome=y5,b.editorSelectPageDown=N5,b.editorSelectPageUp=O5,b.editorSelectRight=h5,b.editorSelectUp=m5,b.editorSelectWordEnd=x5,b.editorSelectWordLeft=E5,b.editorSetTextColor=La,b.editorShowFindDialog=fW,b.editorToDocx=Ett,b.editorUpdateBlockData=Lh,b.editorUpdateCompositionText=FB,b.editorUpdateEmbedData=WB,b.enablePageScroll=Hg,b.escapeHtmlText=jd,b.escapeRegExp=Xg,b.escapeSpace=z9,b.exclusiveBlock=RE,b.executeBlockCommand=Gv,b.executeEmbedBlockCommand=zv,b.executeRangeCommand=E2,b.fileToDataUrl=ma,b.findAfterOffsetNotType=F1,b.findAllText=hp,b.findBlockByIndex=Av,b.findEventTargetBlock=Vb,b.findInsertionById=_v,b.findNextOffset=P8,b.findNextVisibleSimpleBlock=B2,b.findPrevOffset=N8,b.findPrevOffsetNotType=P1,b.findPrevSimpleBlockBeforeChildContainer=c3,b.findPrevVisibleSimpleBlock=v2,b.findTarget=ha,b.findWordEnd=V1,b.findWordLeft=K1,b.format=nu,b.formatBytes=uv,b.formatDate=Wg,b.fragmentToHtml=iv,b.fromBase64=Jc,b.fromBase64ToBlob=Kg,b.fromBase64ToUint8Array=nI,b.fromDocRange=Xo,b.fromNowString=qg,b.genId=et,b.getAllChildBlocks=E1,b.getAllQuickMenuItems=nE,b.getAllSelectedBlocks=Ci,b.getAttributesAt=Ba,b.getBlockBackground=Zg,b.getBlockByIndex=zo,b.getBlockCaretRect=Wo,b.getBlockClass=Qt,b.getBlockClassByType=Ys,b.getBlockClientRects=Yi,b.getBlockCommandsWithHook=s1,b.getBlockContent=Nt,b.getBlockHeading=lu,b.getBlockId=lt,b.getBlockIndex=vt,b.getBlockInfo=xf,b.getBlockKind=Nr,b.getBlockMinWidth=Fv,b.getBlockNearestRangeFromPoint=p1,b.getBlockOptions=BI,b.getBlockPath=qo,b.getBlockProperties=$v,b.getBlockRangeFromPoint=oh,b.getBlockStyles=vI,b.getBlockTextLength=dt,b.getBlockTools=oe,b.getBlockType=Dt,b.getBoxContent=e1,b.getBoxId=Lv,b.getBoxTypeFromElement=su,b.getChildBlockCount=Or,b.getChildBlocks=fe,b.getChildOffset=Yo,b.getColorFromAttributes=B1,b.getColorFromContent=Zd,b.getComplexBlockClass=hr,b.getContainerBlockPath=Qv,b.getContainerBlocks=Ov,b.getContainerBlocksElement=iu,b.getContainerById=Ur,b.getContainerId=ct,b.getContainerMinWidth=u1,b.getContainerToolsElement=xI,b.getContainerWidth=n3,b.getDistanceSquare=jo,b.getElementFromPoint=Ae,b.getElementOffset=Xc,b.getElementScale=dr,b.getEmbedType=$e,b.getExistsBlockTools=th,b.getExistsContainerById=ru,b.getFileExt=eu,b.getFirstChildBlock=be,b.getFirstClientRect=Kd,b.getHeadingBlockChildren=Ca,b.getHeadingMenuOptions=YC,b.getHorizontalPadding=Dg,b.getInsertionContent=n1,b.getLastChildBlock=Ue,b.getLastClientRect=js,b.getListAllNextBrothers=Ya,b.getLogger=I,b.getNextBlock=Jt,b.getNextHiddenBlocks=Xv,b.getNextValidOffset=rl,b.getNextVisibleBlock=gr,b.getOffsetFromPoint=Ig,b.getOffsetInfoAfter=Cu,b.getOffsetInfoBefore=Ah,b.getOpAt=F3,b.getOpLength=sh,b.getParentBlock=Z,b.getParentBlockExcludeSelf=Js,b.getParentBox=t1,b.getParentContainer=it,b.getPrevBlock=Oe,b.getPrevValidOffset=Qo,b.getPrevVisibleBlock=mr,b.getRangeCommands=p2,b.getReferenceClientRect=nk,b.getRootBlock=o1,b.getScrollContainer=Xe,b.getSpecialBlockCommands=Hv,b.getStandardEmbedBlockProperties=nx,b.getTextAfterOffset=U8,b.getTextAttributes=G1,b.getTextBeforeOffset=O8,b.getTextBlockChild=uu,b.getTextBlockClass=vv,b.getTextBlockContentChildTextLength=Cr,b.getTextBlockContentChildType=Yv,b.getTextBlockContentChildren=gi,b.getTextLength=gn,b.getTextOpLength=x1,b.getTextWidth=qd,b.getToolbar=A0,b.handleBlockElementUpdated=Kv,b.hasAltOnly=Q9,b.hasClass=wt,b.hasCtrlOrCmd=Zb,b.hasCtrlOrCmdOnly=Y9,b.hashCode=Cv,b.hideBlock=Rv,b.hideTemplates=iS,b.htmlToFragment=Wd,b.i18n=D,b.includeBigTable=lN,b.injectDocToHtmlFragment=ku,b.injectStyle=jb,b.inputActions=eM,b.insertEmptyBlock=kI,b.insertEmptyEmbedBlock=l1,b.insertText=ro,b.intersectionCommands=MM,b.isBackspace=ev,b.isBlock=Qs,b.isBlockLocked=G0,b.isBlockLockedByOthers=SE,b.isBlockLockedBySelf=Af,b.isBlockTools=kv,b.isBox=eh,b.isBoxOp=to,b.isCJK=Qb,b.isChildContainer=Fr,b.isChildNode=re,b.isCodeBlock=Zr,b.isCollapsedHeadingBlock=mi,b.isCollapsedRange=C8,b.isComplexBlockPosition=el,b.isComplexKindBlock=It,b.isContainer=Xi,b.isContainerSelectedAllChildBlocks=P5,b.isControlEvent=qs,b.isDelete=Z9,b.isDraggingFiles=Xd,b.isElementVisible=Ug,b.isEmbedBlock=pe,b.isEmptyContainer=fu,b.isEmptyDoc=O1,b.isEmptyTextBlock=se,b.isEmptyTextBlockWithoutCompositionText=ff,b.isEnterOnly=tv,b.isEscape=Gd,b.isExclusiveBlock=Ef,b.isExpandedHeadingBlock=qv,b.isFirefox=Wc,b.isFirstChildBlockInComplexBlock=s7,b.isHeadingBlock=ln,b.isHighSurrogate=V9,b.isInBlock=r1,b.isInBlockTools=pa,b.isLetter=Yb,b.isLowSurrogate=$9,b.isMatchShortcut=di,b.isMoveForward=q9,b.isNavigationEvent=W9,b.isNavigationKey=Jb,b.isNodeRemoved=qc,b.isNumber=Xb,b.isPrintableKey=Pg,b.isRootBlock=pr,b.isRootContainer=qt,b.isSafari=$s,b.isSameDay=Gg,b.isSelectBoxOnly=Jr,b.isShiftEnter=J9,b.isShiftTab=eI,b.isShortcutEvent=X9,b.isSimpleBlock=bI,b.isSimpleBlockPosition=Vr,b.isSimplePos=hB,b.isSimpleRange=ph,b.isSpace=zd,b.isTab=tI,b.isTextBlockContentBoxChild=Qn,b.isTextBlockContentChild=au,b.isTextBlockContentInsertionChild=Ji,b.isTextBlockContentTextChild=cu,b.isTextKindBlock=rt,b.isTextKindBlockType=ou,b.isTitleBlock=qi,b.isToday=fv,b.isValidOffset=On,b.isVisibleBlock=Go,b.isYesterday=dv,b.loadJs=Kb,b.loadJsPromise=zs,b.lockers=Mr,b.mergeCommands=x0,b.mergeDocs=sl,b.mergeOps=M1,b.mergeText=h8,b.multiSplitText=V3,b.overflowText=hv,b.parseShortcut=nv,b.patchNode=Zc,b.pointInRect=Ws,b.rangeAddAttribute=mu,b.rangeGetTextColor=q3,b.rangeRemoveAttribute=va,b.rangeSetTextColor=z3,b.rangeTransformText=H3,b.registerDragDrop=Og,b.removeAttribute=v1,b.removeClass=ot,b.removeLastBr=c8,b.removePlaceholderFromBlock=yR,b.removeStyle=Hb,b.replaceAll=fI,b.replaceAllCaseInsensitive=dI,b.replaceAllText=K5,b.replaceText=mh,b.requestDownload=Yd,b.resetListStart=Ja,b.scrollIntoView=xu,b.scrollable=av,b.selectFile=ga,b.selectedBlockToDoc=_h,b.selectionToDoc=Ia,b.setAttributes=$d,b.setClipboardData=tu,b.setClipboardDataByEvent=oI,b.setColorToAttributes=G3,b.setDataset=_g,b.setDefaultCursor=Qc,b.setStyles=Mg,b.shareDBCommentToDocObject=Vp,b.shareDBDocCommentToComment=rT,b.shortcutToDisplayText=qe,b.showBlock=Jg,b.showDocVersions=vtt,b.showTemplates=mx,b.splitText=Mn,b.splitToThree=Je,b.stringToDataUrl=Vg,b.stringToObjectUrl=jg,b.subText=$3,b.textNodeOffsetFromPoint=Fb,b.titleFromEditor=lS,b.toBase64URL=hi,b.toMindmap=y0,b.toPlainText=de,b.toPlainTextKeepLength=N1,b.trimChar=Ng,b.unexclusiveBlock=wE,b.unicodeLength=H9,b.unicodeSubstr=j9,b.updateBlockSelection=Pv,b.updateOpAttributes=fB,b.updateTextBlockContent=M8,b.updateUrl=Fg;for(const n in ye)n!=="default"&&!b.hasOwnProperty(n)&&Object.defineProperty(b,n,{enumerable:!0,get:()=>ye[n]});Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|