@ones-editor/editor 0.0.3-beta.80 → 0.0.3-beta.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -684,8 +684,8 @@ width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
|
684
684
|
<rect width="6" height="7" fill="white" transform="translate(6 6)"/>
|
|
685
685
|
</clipPath>
|
|
686
686
|
</defs>
|
|
687
|
-
</svg>`,k6={dwg:[],rvt:[],skp:[],img:["image/png","image/jpg","image/jpeg","image/bmp","image/ico","image/icon","image/gif"],txt:["text/plain"],zip:["application/zip","application/x-rar-compressed","application/x-7z-compressed","application/x-tar","application/x-bzip2","application/java-archive"],ppt:["application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"],excel:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],pdf:["application/pdf"],word:["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},Df={dwg:t$,rvt:e$,skp:n$,img:o$,txt:r$,zip:y6,rar:y6,ppt:i$,excel:s$,pdf:l$,word:c$};function w6(n,t){const e=Object.keys(k6);for(let r=0;r<e.length;r+=1){const i=e[r];if(k6[i].includes(t))return Df[i]}const o=Iu(n.toLowerCase());return Df[o]?Df[o]:a$}async function u$(n,t,e){var k;const{fileName:o,fileType:r,fileSize:i}=e,s=b("div",["card-root"],t),l=b("div",["file-icon"],s),{renderFileCardIcon:c}=((k=n.options.componentsOptions)==null?void 0:k.file)||{};if(!c)l.innerHTML=w6(o,r);else{const v=c&&await c(n,e);v?l.append(v):l.innerHTML=w6(o,r)}const a=b("div",["file-details"],s),d=Iu(o),f=o.length-d.length-3,m=b("div",["file-name"],a);f>0?(b("span",["file-name-pre"],m,o.slice(0,f)),b("span",[],m,o.slice(f))):m.textContent=o,b("div",["file-size"],a,Xm(i));const p=b("div",["file-actions"],s),A=b("button",["download"],p);return A.innerHTML=Sf,{card:s,downloadButton:A}}const UV="";function B6(n,t){const o=n.getBlockData(t).embedData,r=n.options.componentsOptions.file;if(r!=null&&r.onDownloadFile){r.onDownloadFile(n,o);return}const i=n.doc.buildResourceUrl(o.src,{downloadFileName:o.fileName});$l(i,o.fileName)}async function d$(n,t,e){const{embedData:o}=e,r=o,{card:i,downloadButton:s}=await u$(n,t,r);n.domEvents.addEventListener(s,"click",(l,c)=>{if(!c.target)return;const a=U(c.target);!a||B6(l,a)}),n.domEvents.addEventListener(i,"click",(l,c)=>{if(!c.target)return;const a=U(c.target);if(!a||xr(c,"button"))return;const d=l.options.componentsOptions.file;if(d!=null&&d.onClick){d.onClick(l,a,c);return}const m=l.getBlockData(a).embedData,p=l.doc.buildResourceUrl(m.src,{downloadFileName:m.fileName});$l(p,m.fileName)})}class h${constructor(
|
|
687
|
+
</svg>`,k6={dwg:[],rvt:[],skp:[],img:["image/png","image/jpg","image/jpeg","image/bmp","image/ico","image/icon","image/gif"],txt:["text/plain"],zip:["application/zip","application/x-rar-compressed","application/x-7z-compressed","application/x-tar","application/x-bzip2","application/java-archive"],ppt:["application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"],excel:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],pdf:["application/pdf"],word:["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},Df={dwg:t$,rvt:e$,skp:n$,img:o$,txt:r$,zip:y6,rar:y6,ppt:i$,excel:s$,pdf:l$,word:c$};function w6(n,t){const e=Object.keys(k6);for(let r=0;r<e.length;r+=1){const i=e[r];if(k6[i].includes(t))return Df[i]}const o=Iu(n.toLowerCase());return Df[o]?Df[o]:a$}async function u$(n,t,e){var k;const{fileName:o,fileType:r,fileSize:i}=e,s=b("div",["card-root"],t),l=b("div",["file-icon"],s),{renderFileCardIcon:c}=((k=n.options.componentsOptions)==null?void 0:k.file)||{};if(!c)l.innerHTML=w6(o,r);else{const v=c&&await c(n,e);v?l.append(v):l.innerHTML=w6(o,r)}const a=b("div",["file-details"],s),d=Iu(o),f=o.length-d.length-3,m=b("div",["file-name"],a);f>0?(b("span",["file-name-pre"],m,o.slice(0,f)),b("span",[],m,o.slice(f))):m.textContent=o,b("div",["file-size"],a,Xm(i));const p=b("div",["file-actions"],s),A=b("button",["download"],p);return A.innerHTML=Sf,{card:s,downloadButton:A}}const UV="";function B6(n,t){const o=n.getBlockData(t).embedData,r=n.options.componentsOptions.file;if(r!=null&&r.onDownloadFile){r.onDownloadFile(n,o);return}const i=n.doc.buildResourceUrl(o.src,{downloadFileName:o.fileName});$l(i,o.fileName)}async function d$(n,t,e){const{embedData:o}=e,r=o,{card:i,downloadButton:s}=await u$(n,t,r);n.domEvents.addEventListener(s,"click",(l,c)=>{if(!c.target)return;const a=U(c.target);!a||B6(l,a)}),n.domEvents.addEventListener(i,"click",(l,c)=>{if(!c.target)return;const a=U(c.target);if(!a||xr(c,"button"))return;const d=l.options.componentsOptions.file;if(d!=null&&d.onClick){d.onClick(l,a,c);return}const m=l.getBlockData(a).embedData,p=l.doc.buildResourceUrl(m.src,{downloadFileName:m.fileName});$l(p,m.fileName)})}class h${constructor(){h(this,"group","file-card");h(this,"commands",[{id:"download",name:"Download",icon:Sf},{id:"sep",name:"",type:"separator"},{id:"to-link",name:"To link",icon:C6},{id:"to-card",name:"To card",icon:A6,states:["checked"]},{id:"sep",name:"",type:"separator"},{id:"add-comment",name:"Add Comment",icon:Ts}])}executeCommand(t,e,o){if(o.id==="to-link"){const r=z(e),i=V(r),s=K(e),l=t.getBlockData(e),{embedData:c}=l,a=c,d={id:P(),box:!0,type:"file",created:Date.now(),src:a.src,fileName:a.fileName,fileSize:a.fileSize,fileType:a.fileType};t.undoManager.runInGroup(()=>{t.deleteBlock(e);const f=[op(d)];t.insertTextBlock(f,i,s)})}else o.id==="download"?B6(t,e):o.id==="add-comment"&&la(t,e)}}function f$(n,t){const e=n.getBlockData(t),{embedData:o,id:r}=e,i=o;return{blockCommands:{"hovering-toolbar":new h$},abstract:i.fileName}}function m$(n,t,e,o){const{embedData:r}=t,i=r;return o==="html"?i.src?`<p><a href="${n.doc.buildResourceUrl(i.src,{withToken:!0})}" >${i.fileName}</a></p>`:`<p>[${i.fileName}]</p>`:o==="markdown"?i.src?`})
|
|
688
688
|
`:`[${i.fileName}]
|
|
689
689
|
`:i.src?`[${i.fileName}](${n.doc.buildResourceUrl(i.src,{withToken:!0})})`:`[${i.fileName}]`}const g$={embedType:"office",createEmbedContent:d$,getBlockProperties:f$,convertTo:m$};function p$(n){const t=/(\s|^)(http|https):\/\/[\w\-]+(\.[\w\-]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$/;return t.test(n)?n.search(t):-1}function C$(n){const t=n.selection.range;if(!t.isCollapsed()||!t.isSimple())return;const{start:e}=t,o=n.getBlockById(e.blockId);if(!_(n,o))return;const r=n.getBlockText(o),s=ld(r).slice(0,e.offset),l=p$(s);if(l===-1)return;const c=s.slice(l),a=s.length;let d=Yi(l,a-l,r,"link",c);return d=po(d,a," ",null),n.setBlockText(o,d),n.selection.selectBlock(o,a+1),!0}const A$={Space:C$},VV="",b$={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 <a href="" class="retry-upload">\u91CD\u8BD5</a></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 <a href="" class="retry-upload">\u91CD\u8BD5</a></div>'},audio:{menuItem:"\u97F3\u9891",abstract:"\u97F3\u9891"},video:{menuItem:"\u89C6\u9891",abstract:"\u89C6\u9891"}}},v$={media:{upload:{failed:'<div class="line-1">{name} upload failed</div><div class="line-2">The network service is abnormal, you can <a href="" class="retry-upload">Try again</a></div>'},load:{failed:'<div class="line-1">{name} loading failed</div><div class="line-2">The network service is abnormal, you can <a href="" class="retry-upload">Try again</a></div>'},audio:{menuItem:"Audio",abstract:"Audio"},video:{menuItem:"Video",abstract:"Video"}}};T.mergeLang({"zh-CN":b$,"en-US":v$});var gn=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(gn||{}),ul=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(ul||{});const E6=10*1024*1024,y$=["wav","mp3","aac","ogg","webm","flac"],k$=["ogg","mp4","webm"],w$=()=>{};function I6(n){var d,f,m,p,A,k;const t=(d=n.getComponentOptions("media"))!=null?d:{},{allowedMedias:e,maxSize:o,callbacks:r}=t,i=(f=e==null?void 0:e.audio)!=null?f:y$,s=(m=e==null?void 0:e.video)!=null?m:k$,l=(p=o==null?void 0:o.audio)!=null?p:E6,c=(A=o==null?void 0:o.video)!=null?A:E6,a=(k=r==null?void 0:r.onError)!=null?k:w$;return{allowedMedias:{audio:i,video:s},maxSize:{audio:l,video:c},callbacks:{onError:a}}}const B$=w("file-utils");function E$(n){u(B$,n instanceof File,`The file: ${n} isn't instance of File`);const{name:t}=n;if(!t)return"";const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1)}function x6(n,t){const e=i=>i.map(s=>`.${s}`).join(","),{allowedMedias:o}=I6(n),r=o[t];return r?e(r):"*"}function I$(n,t,e){const{maxSize:o,callbacks:r,allowedMedias:i}=I6(t),{[e]:s}=o,{[e]:l}=i;if(s&&n.size>s){const a=new Error("media is too large");return a.code=`MaxMediaSize-${e}`,r!=null&&r.onError&&(r==null||r.onError(t,a)),a}const c=E$(n);if(l&&!l.includes(c)){const a=new Error(`media file is not allowed: ${c}`);return a.code="NotAllowedFile",r!=null&&r.onError&&(r==null||r.onError(t,a)),a}return!0}function x$(n){return n===ul.Empty||n===ul.Error}const ue=w("media");class T${constructor(t){h(this,"mediaContainer",null);h(this,"media",null);h(this,"abstract",null);h(this,"handleMediaLoadError",(t,e)=>{if(!e.target||!(e.target instanceof Node)||!(e.target instanceof Element?e.target:e.target.parentElement))return;const r=U(e.target);if(!r||!r.contains(this.mediaContainer))return;const i=this.renderError();this.updateMediaContent(i)});h(this,"handleRetry",async t=>{if(t.readonly)return;u(ue,this.abstract,"no abstract");const{mediaType:e}=this.abstract,o=x6(t,e),r=await Qo(o);this.handleUploadFile(r)});h(this,"handleUploadFile",async t=>{u(ue,this.abstract,"no abstract"),u(ue,this.mediaContainer,"The media element not exist");const{editor:e}=this.options,{mediaType:o}=this.abstract,r=U(this.mediaContainer);u(ue,r,"The block element not exist");const i=e.getBlockData(r);if(!!I$(t,e,o)){try{const{resourceId:s}=await e.doc.uploadResource(t,{onProgress:f=>{this.renderProgress(f,t)}}),{name:l,type:c,size:a}=t,d={...i,embedData:{...i.embedData,src:s,fileName:l,fileSize:a,fileType:c}};e.updateBlockData(r,d)}catch{this.renderRetry()}H(r,"media-block-uploading")}});h(this,"destroy",()=>{this.mediaContainer=null});this.options=t}bindMediaEvent(){const{editor:t}=this.options;this.media&&t.domEvents.addEventListener(this.media,"error",this.handleMediaLoadError)}unbindMediaEvent(){const{editor:t}=this.options;this.media&&t.domEvents.removeEventListener(this.media,"error",this.handleMediaLoadError)}updateMediaContent(t){u(ue,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(t)}renderError(){u(ue,this.abstract,"no abstract");const{editor:t,createMediaElement:e}=this.options,{mediaIcon:o,mediaName:r}=this.abstract;u(ue,this.mediaContainer,"The media element not exist");const i=U(this.mediaContainer);u(ue,i,"The block element not exist");const s=t.getBlockData(i),l=s.embedData.src,c=b("div",["media-error","embed-selected-content","embed-hover-content"],null),a=b("span",["media-error-icon"],c);a.innerHTML=o;const d=b("div",[],c);d.innerHTML=T.t("media.load.failed",{name:r}),c.appendChild(d);const f=d.querySelector("a");return u(ue,f,"The element not exist"),t.domEvents.addEventListener(f,"click",(m,p)=>{if(p.preventDefault(),p.target instanceof HTMLElement&&p.target.tagName==="A"){const A=b("div",["media-element"],null),k=this.getResourceUrl(l),v=e(m,A,s,k);this.unbindMediaEvent(),this.media=v,this.bindMediaEvent(),this.updateMediaContent(A)}}),c}renderRetry(){u(ue,this.abstract,"no abstract");const{editor:t}=this.options,{mediaIcon:e,mediaName:o}=this.abstract,r=b("div",["media-error","embed-selected-content","embed-hover-content"],null),i=b("span",["media-error-icon"],r);i.innerHTML=e;const s=b("div",[],r);s.innerHTML=T.t("media.upload.failed",{name:o}),r.appendChild(s);const l=s.querySelector("a");u(ue,l,"The element not exist"),t.domEvents.addEventListener(l,"click",this.handleRetry),this.updateMediaContent(r)}renderProgress(t,e){u(ue,this.mediaContainer,"The media element not exist");const o=this.mediaContainer.querySelector(":scope .media-progress"),r=t===-1||t===100?100:t;if(o){const{updateProgressElement:i}=this.options;i(o,r)}else{const{createProgressElement:i}=this.options,s=U(this.mediaContainer);u(ue,s,"The element not exist"),M(s,"media-block-uploading");const l=b("div",["media-progress"],null);i(l,r,e),this.updateMediaContent(l)}}renderMediaElement(t){u(ue,this.mediaContainer,"The media element not exist");const e=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:o,updateMediaElement:r,editor:i}=this.options,s=this.getResourceUrl(t.embedData.src);if(e){const l=r(i,e,t,s);this.unbindMediaEvent(),this.media=l,this.bindMediaEvent()}else{const l=b("div",["media-element"],null),c=o(i,l,t,s);this.unbindMediaEvent(),this.media=c,this.bindMediaEvent(),this.updateMediaContent(l)}}renderEmpty(){u(ue,this.abstract,"no abstract"),u(ue,this.mediaContainer,"The media element not exist");const t=b("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);t.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(t)}getResourceUrl(t){const{editor:e}=this.options;return e.doc.buildResourceUrl(t)}render(t,e){const{src:o}=t.embedData;(!this.mediaContainer||!e.contains(this.mediaContainer))&&(this.mediaContainer=b("div",["media"],e)),x$(o)?o===ul.Empty&&this.renderEmpty():this.renderMediaElement(t)}setAbstract(t){this.abstract=t}}w("media-embed");class T6{constructor(){h(this,"handleInsertEmptyEmbed",async(t,e)=>{var d;const{containerId:o,blockIndex:r}=e;let i;(d=e.data)!=null&&d.file&&(i=e.data.file);const s=x6(t,this.embedType);if(i=i!=null?i:await Qo(s,{}),!i)return null;const l={id:P(),type:"embed",embedType:this.embedType,embedData:{src:ul.Empty}},c=t.insertBlock(o,r,l);return await this.getMedia(t,l.id).handleUploadFile(i),c})}getMedia(t,e){const o=t.addCustom(`media-${e}`,()=>new T$({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return o.setAbstract({...this.abstract}),o}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:o,order:r,group:i}=this.abstract;return{name:o,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:r,group:i,subText:Ce(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,o){const{id:r}=o;this.getMedia(t,r).render(o,e)}handleUpdateBlock(t,e,o){const{id:r}=o,i=this.getMedia(t,r),s=st(e);return i.render(o,s),!0}handleDeleteBlock(t,e){const o=e.id;this.getMedia(t,o).destroy()}convertTo(t,e,o,r){const i=e.embedData,s=t.doc.buildResourceUrl(i.src,{withToken:!0});return r==="html"?`<${i.type} src="${s}" />`:r==="markdown"?``:s}}function S6(n,t){const e=b("div",["uploading-progress-mask"],n),o=b("div",["uploading-progress-bar"],e),r=b("div",["uploading-progress-bar-value"],o);r.style.width=`${t}%`}function D6(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const S$=w("media-audio");class D$ extends T6{constructor(){super(...arguments);h(this,"embedType",gn.AUDIO);h(this,"abstract",{mediaIcon:Gw,mediaName:T.t(`media.${gn.AUDIO}.menuItem`),menuItem:T.t(`media.${gn.AUDIO}.menuItem`),order:800,mediaType:gn.AUDIO,group:"common"});h(this,"updateProgressElement",D6)}getBlockProperties(){return{abstract:`[${T.t(`media.${gn.AUDIO}.abstract`)}]`}}createMediaElement(e,o,r,i){const s=b("div",["audio-container","embed-hover-content","embed-selected-content"],o),l=b("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=i,l}updateMediaElement(e,o,r,i){const s=o.querySelector(":scope .audio-container > audio");return u(S$,s,"The media element not exist"),s.src!==i&&(s.src=i),s}createProgressElement(e,o){const r=b("audio",[],e);r.innerHTML="Your browser does not support the <code>audio</code> element.",r.controls=!0,r.src="about:blank",S6(e,o)}}const Lf=new D$;w("video-resizer");function L6(n){return n&&Te(n)&&Ne(n)==="video"}const L$=50;class M${constructor(t){h(this,"currentResizableElement",null);h(this,"resizing",!1);h(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&(e&&L6(e)&&this.disableBlockResize(e),t&&L6(t))){const o=this.getVideoElement(t);if(!o)return;this.enableBlockResize(t,o)}});h(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const o=t.getBlock();if(!o)return;const r=o.getBoundingClientRect().width,i=Math.min(Math.max(e.width,L$),r);this.currentResizableElement.style.width=`${i}px`});h(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const o=this.editor.getBlockData(e),{width:r}=this.currentResizableElement.getBoundingClientRect();this.editor.updateBlockData(e,{...o,width:r})});this.editor=t,$t.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,$t.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return st(t).querySelector(":scope .video-container > video")}disableBlockResize(t){const e=this.editor.findCustom(`${j(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const o=this.editor.addCustom(`${j(t)}-resizer`,()=>new sa(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));o.enableResize(t,e),o.removeListener("resizing",this.handleResizing),o.removeListener("resized",this.handleResized),o.addListener("resizing",this.handleResizing),o.addListener("resized",this.handleResized),this.currentResizableElement=e}}const R$=w("video");class O$ extends T6{constructor(){super(...arguments);h(this,"embedType",gn.VIDEO);h(this,"abstract",{mediaName:T.t(`media.${gn.VIDEO}.menuItem`),mediaIcon:Zw,menuItem:T.t(`media.${gn.VIDEO}.menuItem`),order:700,mediaType:gn.VIDEO,group:"common"});h(this,"updateProgressElement",D6);h(this,"createProgressElement",(e,o,r)=>{const i=b("video",["progress-video"],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,S6(e,o),Tr(r).then(s=>{const l=e.querySelector(".progress-video");l&&Pu(e)&&(l.src=s)})})}getBlockProperties(){return{abstract:`[${T.t(`media.${gn.VIDEO}.abstract`)}]`}}createMediaElement(e,o,r,i){const s=b("div",["video-container","embed-selected-content","drag-preview-element"],o),l=b("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=i,e.addCustom("video-resizer",()=>new M$(e)),r.width&&(l.style.width=`${r.width}px`),l}updateMediaElement(e,o,r,i){const s=o.querySelector(":scope .video-container > video");return u(R$,s,"The media element not exist"),s.src!==i&&(s.src=i),s}}const Mf=new O$,qV="",N$={version:{latest:"\u5F53\u524D\u7248\u672C",insert:"{name} \u6DFB\u52A0",delete:"{name} \u5220\u9664",goBack:"\u8FD4\u56DE",revertVersion:"\u8FD8\u539F\u5185\u5BB9",play:"\u64AD\u653E\u5386\u53F2\u64CD\u4F5C",versionList:"\u5386\u53F2\u7248\u672C {count}",unknown:"\u672A\u77E5\u7248\u672C",restoreFrom:"\u56DE\u6EDA\u81EA\u7248\u672C {from}",restoreInfo:"\u56DE\u6EDA\u7684\u7248\u672C\u6682\u4E0D\u652F\u6301\u4E0E\u4E0A\u4E00\u7248\u672C\u5BF9\u6BD4"}},P$={version:{latest:"Latest",insert:"Added by {name}",delete:"Deleted by {name}",goBack:"Back",revertVersion:"Revert",play:"Play",versionList:"Versions ({count})",unknown:"Unknown version",restoreFrom:"Reverted from {from}",restoreInfo:"The rolled back version does not currently support comparison with the previous version."}};T.mergeLang({"zh-CN":N$,"en-US":P$});var M6=(n=>(n.NEW="history-new",n.NEW_CHILD="history-new-child",n.DELETED="history-deleted",n.UPDATED="history-updated",n.HISTORY="history",n))(M6||{});const vi="--op-color",yi="--op-selected-color",WV="";class $${constructor(t){h(this,"root");this.content=t;const e=b("div",["dialog-root"],null);e.append(t),this.root=e}show(t=document.body){t.append(this.root)}hide(){this.root.remove()}destroy(){}}const{t:ki}=T,R6=w("version-list");class _${constructor(t){h(this,"activeVersionElement");h(this,"versionsList");h(this,"versionsListHeader");h(this,"handleClickVersionItem",t=>{const o=t.target.closest(".dialog-version-list-item");if(this.isVersionElement(o)){this.toggleActiveVersionElement(o);const r=this.getVersionFromElement(o),{onSelectVersion:i}=this.options;i(r)}});this.options=t;const{versions:e,defaultSelectedIndex:o=0}=t,r=b("div",["version-dialog-list-header"],null,"count");r.innerText=ki("version.versionList",{count:`${e.length}`});const i=b("div",["version-dialog-list"],null),s=this.convertVersionsToFragment(e);i.append(s);const l=i.children[o];M(l,"active"),this.activeVersionElement=l,this.versionsList=i,this.versionsListHeader=r,i.onclick=this.handleClickVersionItem}get isSelectedFirstVersion(){return!!this.activeVersionElement&&this.versionsList.firstChild===this.activeVersionElement}get isSelectedLastVersion(){return!!this.activeVersionElement&&this.versionsList.lastChild===this.activeVersionElement}get beforeVersion(){return u(R6,this.activeVersionElement,"No active version element"),this.activeVersionElement.nextElementSibling?this.activeVersionElement.nextElementSibling.versionData:null}get beforeMajorVersion(){u(R6,this.activeVersionElement,"No active version element");let t=this.activeVersionElement.nextElementSibling;for(;t;){if(t.versionData.type)return t.versionData;t=t.nextElementSibling}return null}convertVersionsToFragment(t){const e=document.createDocumentFragment(),o=i=>{var l;let s;if(i.version!==-1){const c=new Date((l=i.created)!=null?l:i.version);s=`${c.toLocaleDateString()} ${c.toLocaleTimeString()}`}else s=ki("version.latest");return s},r=(i,s,l,c=!1)=>{var p;const a=b("div",["dialog-version-list-item"],e);a.versionData=i,s&&M(a,"child");const d=b("div",["dialog-version-list-item-title"],a);if(b("div",["dialog-version-list-item-date"],d,o(i)),c&&b("div",["dialog-version-list-item-now-ver"],d,ki("version.latest")),typeof i.source=="object"&&((p=i.source)==null?void 0:p.restore)){const A=i.source.restore,k=l.find(R=>R.version==A),v=k?o(k):ki("version.unknown"),x=ki("version.restoreFrom",{from:v}),E=ki("version.restoreInfo"),L=b("div",["dialog-version-item-from-container"],a);b("div",["dialog-version-item-from-main"],L,x),b("div",["dialog-version-item-from-info"],L,E)}const f=b("ul",["dialog-version-list-item-authors"],a),m=A=>{const k=b("li",["dialog-version-list-item-author"],f),v=b("span",["dialog-version-list-item-mark-author"],k);v.style.background=this.options.getMarkColor(A),b("span",["dialog-version-list-item-author-name"],k,A.displayName)};if(this.options.useCreatedBy)if(i.createdBy){const A=i.createdBy;m(A)}else i.authors&&i.authors.length>0&&i.authors.forEach(A=>{m(A)});else if(i.authors&&i.authors.length>0)i.authors.forEach(A=>{m(A)});else if(i.createdBy){const A=i.createdBy;m(A)}};return t.forEach((i,s)=>{r(i,!1,t,s===0),i.minorVersions&&i.minorVersions.length>0&&i.minorVersions.forEach(l=>{r(l,!0,t,!1)})}),e}isVersionElement(t){return t?rt(t,"dialog-version-list-item"):!1}getVersionFromElement(t){return t.versionData}get activeVersion(){return this.getVersionFromElement(this.activeVersionElement)}toggleActiveVersionElement(t){this.activeVersionElement!==t&&(H(this.activeVersionElement,"active"),M(t,"active"),this.activeVersionElement=t)}selectVersionByVersionNum(t){const e=Array.from(this.versionsList.children).find(o=>o.versionData.version===t);return this.isVersionElement(e)?(this.toggleActiveVersionElement(e),this.getVersionFromElement(e)):null}render(t){t.innerHTML="",t.append(this.versionsListHeader,this.versionsList)}destroy(){this.versionsList.onclick=null}}class F${constructor(t,e){this.doc=t,this.user=e}onDeleteBlock(t,e){this.doc.onDeleteBlock(t,e,this.user)}onInsertBlock(t,e,o){this.doc.onInsertBlock(t,e,o,this.user)}onUpdateBlockText(t,e,o){this.doc.onUpdateBlockText(t,e,o,this.user)}onUpdateBlockData(t,e,o){this.doc.onUpdateBlockData(t,e,o,this.user)}onCreateContainer(t,e){this.doc.onCreateContainer(t,e,this.user)}onCreateComment(){}onDeleteComment(){}onDeleteContainer(){}onUpdateComment(){}}function H$(n){return new Promise(t=>{setTimeout(t,n)})}async function j$(n,t,e,o){for(const r of e){const i=new F$(n,r.user);t.parseHistoryData(r,i),o.play&&await H$(o.speed||150)}}const z$=`<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
|
|
690
690
|
<path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>
|
|
691
|
-
</svg>`,{t:Rf}=T;class U${constructor(t){h(this,"goBackButton");h(this,"playButton");h(this,"revertButton");this.options=t;const e=b("button",["dialog-text-button"],null),o=b("span",["dialog-button-icon"],e);o.innerHTML=z$,b("span",["dialog-button-text"],e,Rf("version.goBack"));const r=b("button",["dialog-version-button"],null,Rf("version.play")),i=b("button",["dialog-version-button"],null,Rf("version.revertVersion"));this.goBackButton=e,this.playButton=r,this.revertButton=i,this.bindEvent()}bindEvent(){const{onBack:t,onPlay:e,onRevert:o}=this.options;this.playButton.onclick=e,this.goBackButton.onclick=t,this.revertButton.onclick=o}disabledButton(){}render(t,e=!1){e||t.append(this.goBackButton,this.playButton,this.revertButton)}destroy(){this.playButton.onclick=null,this.goBackButton.onclick=null,this.revertButton.onclick=null}}const be=w("split-text-actions");function O6(n){return n.length>2?!1:n.length===1?n[0].insert!==void 0:(u(be,n.length===2,`invalid text actions: ${JSON.stringify(n)}`),n[0].retain===void 0?!1:n[1].insert!==void 0)}function N6(n){return n.length>2?!1:n.length===1?n[0].delete!==void 0:(u(be,n.length===2,`invalid text actions: ${JSON.stringify(n)}`),n[0].retain===void 0?!1:n[1].delete!==void 0)}function P6(n){return n.length>2?!1:n.length===1?n[0].insert===void 0&&n[0].delete===void 0&&n[0].attributes!==void 0:(u(be,n.length===2,`invalid text actions: ${JSON.stringify(n)}`),n[0].retain===void 0?!1:n[1].attributes!==void 0)}function V$(n){const t=[],e=Q.default(n);if(e.length===0)return[];if(e.length===1)return[n];if(e.length===2&&(N6(n)||O6(n)||P6(n)))return[n];const o=(i,s)=>i>0?[{retain:i},s]:[s];let r=0;for(;e.length>0;){const i=e[0];if(i.retain!==void 0&&i.attributes===void 0){u(be,i.retain>0,`invalid text op: ${JSON.stringify(i)}`),u(be,e.length>1,`invalid text op: ${JSON.stringify(i)}`);const s=e[1];u(be,s.delete||s.insert!==void 0||s.attributes!==void 0,`invalid next text op: ${JSON.stringify(s)}`),r+=i.retain,t.push(o(r,s)),s.delete!==void 0?r-=s.delete:s.insert!==void 0?r+=s.insert.length:(u(be,s.attributes!==void 0,`invalid next text op: ${JSON.stringify(s)}`),u(be,s.retain!==void 0,`invalid next text op: ${JSON.stringify(s)}`),r+=s.retain),e.splice(0,2)}else u(be,i.delete||i.insert!==void 0||i.attributes!==void 0,`invalid next text op: ${JSON.stringify(i)}`),t.push(o(r,i)),e.shift(),i.retain!==void 0&&(u(be,i.attributes!==void 0,`invalid next text op: ${JSON.stringify(i)}`),r+=i.retain),i.insert&&(r+=i.insert.length)}return t}function $6(n){if(u(be,n.length===1||n.length===2,`not a single action op: ${JSON.stringify(n)}`),n.length===1)return 0;const t=n[0].retain;return u(be,typeof t=="number"&&t>0,`invalid retain: ${JSON.stringify(n)}`),t}let _6=0;function q$(n,t,e){const o=_6;_6+=1;const r=vt(n);return{insert:" ",attributes:{box:!0,id:P(),type:"history-deleted-box",user:e,created:Date.now(),text:r,deletedOffset:t,deletedOrder:o}}}function W$(n,t,e){const o=$6(t),r=t.length===1?t[0].delete:t[1].delete;u(be,typeof r=="number",`not a delete op: ${JSON.stringify(t)}`);const{left:i,middle:s,right:l}=Gt(n,o,r),c=q$(s,o,e);return[...i,c,...l]}function G$(n,t,e){const o=$6(t),r=t.length===1?t[0].insert:t[1].insert;u(be,typeof r=="string",`invalid insert op: ${JSON.stringify(t)}`);const i=t.length===1?t[0].attributes:t[1].attributes,l=Jl([{insert:r,attributes:i}],"insertedBy",e);return po(n,o,l,null)}function Z$(n,t,e){const o=V$(t).reverse();let r=n;for(const i of o)N6(i)?r=W$(r,i,e):O6(i)?r=G$(r,i,e):(u(be,P6(i),`unknown op: ${JSON.stringify(i)}`),r=ce.apply(r,i));return r}const Q$=w("history-update-block-text");function F6(n){const t=[],e=[];let o=0;return n.forEach(r=>{var i;if((i=r.attributes)!=null&&i.box){const s=r.attributes;if(s.type==="history-deleted-box"){t.push({boxData:s,offset:o});return}}e.push(r),o+=nd(r)}),t.sort((r,i)=>i.offset-r.offset),{deletedBoxes:t,newText:e}}function Y$(n,t,e){let o=n;return t.forEach(r=>{const i=ce.transformCursor(r.offset,e,!1);o=po(o,i,[{insert:" ",attributes:r.boxData}],null)}),o}function J$(n){n.sort((t,e)=>t.boxData.deletedOffset!==e.boxData.deletedOffset?t.boxData.deletedOffset-e.boxData.deletedOffset:t.boxData.deletedOrder-e.boxData.deletedOrder)}function K$(n){if(n.length<=1)return n;const t=n[0].offset;n.forEach(e=>{u(Q$,e.offset===t,`invalid boxes group, ${JSON.stringify(n)}`)}),J$(n);for(let e=n.length-1;e>=1;e--){const o=n[e],r=n[e-1];o.boxData.user.userId===r.boxData.user.userId&&(r.boxData.text+=o.boxData.text,n.splice(e,1))}return n}function X$(n){let{newText:t,deletedBoxes:e}=F6(n);const o=new Map;return e.forEach(i=>{let s=o.get(i.offset);s||(s=[],o.set(i.offset,s)),s.push(i),s.sort((l,c)=>l.boxData.deletedOffset-c.boxData.deletedOffset)}),Array.from(o.values()).sort((i,s)=>s[0].offset-i[0].offset).forEach(i=>{const s=i[0].offset;K$(i).reverse().forEach(l=>{t=po(t,s,[{insert:" ",attributes:l.boxData}],null)})}),t}function t_(n,t,e){let{newText:o,deletedBoxes:r}=F6(n);return o=Z$(o,t,e),o=Y$(o,r,t),o=X$(o),o}const On=w("history-doc");function Nn(n){u(On,!1,"no local actions for history doc")}class e_ extends Pi{constructor(e,o){super();h(this,"doc");h(this,"editor");this.doc=Q.default(e),this.editor=o}beginBatchUpdate(){return 0}endBatchUpdate(){return 0}toJSON(){return Q.default(this.doc)}getContainerBlocks(e){return this.doc.blocks[e]}getBlockData(e,o){const r=this.getContainerBlocks(e);u(On,r,`no container data: ${e}`);const i=r[o];return u(On,i,`no block data: ${o}`),i}localUpdateBlockText(){Nn()}localUpdateBlockData(){Nn()}localInsertBlock(){Nn()}localDeleteBlock(){Nn()}localInsertChildContainer(){Nn()}localDeleteChildContainers(){Nn()}uploadResource(){Nn()}async addResources(e){Nn()}getServerMeta(){var e,o,r;return(r=(o=(e=this.editor.doc.externalDoc).getServerMeta)==null?void 0:o.call(e))!=null?r:{}}buildResourceUrl(e){return this.editor.doc.externalDoc.buildResourceUrl(e)}request(){Nn()}broadcastMessage(){Nn()}getUser(){return{permission:"w",userId:"-",displayName:"-",avatarUrl:"-",rainbowIndex:0}}getRemoteUsers(){return new vc}destroy(){this.clearCallbacks()}transformBlockIndex(e,o,r){const i=this.doc.blocks[e];u(On,i,`no container blocks: ${e}`);let s=0;for(let l=0;l<i.length;l++)if(!i[l].deletedBy){if(s===o)return l;s++}return r&&u(On,!1,`invalid block index: ${o}, blocks: ${JSON.stringify(i)}`),u(On,s===o,`invalid block index: ${o}, blocks: ${JSON.stringify(i)}`),i.length}onDeleteBlock(e,o,r){const i=this.transformBlockIndex(e,o,!0),l=this.doc.blocks[e][i];u(On,!l.deleted,`block has already deleted: ${e}/${o}`),l.deletedBy=r,this.callbacks.forEach(c=>{var a;return(a=c.onUpdateBlockData)==null?void 0:a.call(c,e,i,{insert:{},delete:[]},!0)})}onInsertBlock(e,o,r,i){const s=this.transformBlockIndex(e,o,!1),l=this.doc.blocks[e],c=Q.default(r);c.insertedBy=i,l.splice(s,0,c),this.callbacks.forEach(a=>{var d;return(d=a.onInsertBlock)==null?void 0:d.call(a,e,s,c,!0)})}onUpdateBlockText(e,o,r,i){const s=this.transformBlockIndex(e,o,!0),c=this.doc.blocks[e][s];u(On,!c.deleted,`block has already deleted: ${e}/${o}`);const a=c.text;u(On,a,`no text for block: ${JSON.stringify(c)}`);const d=t_(a,r,i);c.text=d,this.callbacks.forEach(f=>{var m;return(m=f.onUpdateBlockText)==null?void 0:m.call(f,e,o,r,!0)})}onUpdateBlockData(e,o,r,i){const s=this.transformBlockIndex(e,o,!0),l=this.doc.blocks[e],c=l[s];u(On,!c.deleted,`block has already deleted: ${e}/${o}`);const a=Q.default(c);a.updatedBy=i,r.delete.forEach(d=>delete a[d]),Object.entries(r.insert).forEach(([d,f])=>{a[d]=f}),l[s]=a,this.callbacks.forEach(d=>{var f;return(f=d.onUpdateBlockData)==null?void 0:f.call(d,e,s,r,!0)})}onCreateContainer(e,o,r){this.doc.blocks[e]=Q.default(o),this.callbacks.forEach(i=>{var s;return(s=i.onInsertChildContainer)==null?void 0:s.call(i,e,o,!0)})}}const{t:H6}=T;function wi(n,t){return t==="insert"?H6("version.insert",{name:n.displayName}):H6("version.delete",{name:n.displayName})}function br(n,t){const{userId:e}=t;return["flag","selection"].reduce((r,i)=>{const s=n.doc.getRemoteUsers().getFixedUserColor(e,i);return r[i]=s,r},{})}class n_{renderText(t,e,o){if(!o.box&&o.insertedBy){const r=o.insertedBy,{flag:i,selection:s}=br(t,o.insertedBy);return{classes:["history-inserted-text"],attributes:{"history-inserted-by":r.displayName,"data-op-description":wi(r,"insert")},styles:{[vi]:i,[yi]:s}}}return{}}renderBlock(t,e,o){if(o.deletedBy){const r=o.deletedBy,{flag:i,selection:s}=br(t,r);return{classes:["history-deleted-block"],attributes:{"history-deleted-by":r.displayName,"data-op-description":wi(r,"delete")},styles:{[vi]:i,[yi]:s}}}if(o.insertedBy){const r=o.insertedBy,{flag:i,selection:s}=br(t,r);return{classes:["history-inserted-block"],attributes:{"history-inserted-by":r.displayName,"data-op-description":wi(r,"insert")},styles:{[vi]:i,[yi]:s}}}return{}}updateBlock(t,e,o,r){if(r.deletedBy){const i=r.deletedBy,{flag:s,selection:l}=br(t,i);M(o,"history-deleted-block"),fu(o,{"history-inserted-by":i.displayName,"data-op-description":wi(i,"delete")}),mu(o,{[vi]:s,[yi]:l});return}if(r.insertedBy){const i=r.insertedBy,{flag:s,selection:l}=br(t,i);M(o,"history-inserted-block"),fu(o,{"history-inserted-by":i.displayName,"data-op-description":wi(i,"insert")}),mu(o,{[vi]:s,[yi]:l})}}}const j6=w("history-deleted-box");function o_(n,t,e,o){const r=o;u(j6,r.text,`no text for text box data: ${JSON.stringify(o)}`),u(j6,typeof r.text=="string",`invalid text type for text box data: ${JSON.stringify(o)}`);const i=b("span",["history-deleted-box"],e,r.text),s=r.user,{flag:l,selection:c}=br(n,s);i.setAttribute("history-deleted-by",s.displayName),i.setAttribute("data-op-description",wi(s,"delete")),i.style.setProperty(vi,l),i.style.setProperty(yi,c)}function r_(n,t,e,o){return t.text}const i_={boxType:"history-deleted-box",updateBoxContent:o_,convertTo:r_},Ee=w("version-dialog");class s_{constructor(t,e){h(this,"editor");h(this,"dialog",null);h(this,"oldViewer",null);h(this,"versionOptions");h(this,"versionList",null);h(this,"actionButtons",null);h(this,"provider");h(this,"components");h(this,"handleClose",()=>{var t;(t=this.dialog)==null||t.hide()});h(this,"handlePlay",()=>{var e;u(Ee,this.versionList,"The versionList did not render");const t=(e=this.versionList)==null?void 0:e.activeVersion;u(Ee,t,`The version: ${t} is invalid`),this.viewVersion(t,{play:!0,speed:150})});h(this,"handleRevert",async()=>{var e,o;u(Ee,this.versionList,"The versionList did not render");const t=(e=this.versionList)==null?void 0:e.activeVersion;u(Ee,t,`The version: ${t} is invalid`),await this.versionHelper.revertVersion(t.version),(o=this.dialog)==null||o.hide()});h(this,"handleSelectVersion",t=>{u(Ee,t,`The version: ${t} is invalid`),this.viewVersion(t)});h(this,"viewVersion",async(t,e={play:!1,speed:1e3})=>{var p,A,k;this.oldViewer&&(this.oldViewer.destroy(),this.oldViewer=null),u(Ee,this.versionList,"The versionList did not render"),u(Ee,this.actionButtons,"The actionButtons did not render");const o=t.type==="minor"?this.versionList.beforeVersion:this.versionList.beforeMajorVersion,r=o?o.version:0,i=this.versionList.isSelectedFirstVersion,s=this.versionList.isSelectedLastVersion;this.actionButtons.revertButton.disabled=i,this.actionButtons.playButton.disabled=i;let l=(p=this.versionOptions)==null?void 0:p.hideOps;if((A=this.versionOptions)!=null&&A.onWillChangeVersion){const v=this.versionOptions.onWillChangeVersion(this.editor,t,i,s);v!=null&&v.hideOps&&(l=!0)}let c,a;if(l)c=await this.versionHelper.getVersion(t.version),a=[];else{const v=await this.versionHelper.getHistoryData(t.version,r);c=v.doc,a=v.historyData}const{editorElement:d}=this.components;d.innerHTML="";const f=new e_(c,this.editor),m=this.provider.createHistoryEditor(d,f);m.editorBlockRenders.registerRender(new n_),m.editorBoxes.registerBoxClass(i_),M(m.rootElement,M6.HISTORY);try{await j$(f,this.versionHelper,a,e)}finally{this.oldViewer=m}(k=this.versionOptions)!=null&&k.onVersionChanged&&this.versionOptions.onVersionChanged(this.editor,m,t,i,s)});h(this,"setShowOps",t=>{var e;if(this.versionOptions){this.versionOptions.hideOps=!t;const o=(e=this.versionList)==null?void 0:e.activeVersion;u(Ee,o,`The version: ${o} is invalid`),this.viewVersion(o)}});this.editor=t,this.provider=e;const o=b("div",["version-dialog"],null),r=b("div",["version-dialog-note-viewer"],o),i=b("div",["version-dialog-action-container"],r),s=b("div",["version-dialog-editor"],r),l=b("div",["version-dialog-versions-list"],o);this.components={root:o,editorElement:s,actionContainer:i,versionsListContainer:l}}get versionHelper(){u(Ee,this.editor.doc.getVersionHelper,"Can not get getVersionHelper from doc");const t=this.editor.doc.getVersionHelper();return u(Ee,t,"current doc does not support version"),t}renderContent(t){var s,l;const{actionContainer:e,versionsListContainer:o}=this.components;e.innerHTML="";const r=new U$({onBack:this.handleClose,onPlay:this.handlePlay,onRevert:this.handleRevert});r.render(e,(s=this.versionOptions)==null?void 0:s.hideActions),this.actionButtons=r,o.innerHTML="";const i=new _$({versions:t,useCreatedBy:(l=this.versionOptions)==null?void 0:l.useCreatedBy,onSelectVersion:this.handleSelectVersion,getMarkColor:c=>{const{flag:a}=br(this.editor,c);return a}});i.render(o),this.versionList=i}initViewVersion(){var t;if((t=this.versionOptions)!=null&&t.initSelectedVersion){u(Ee,this.versionList,"The versionList did not render");const{initSelectedVersion:e}=this.versionOptions,o=this.versionList.selectVersionByVersionNum(e);u(Ee,o,`The version: ${o} is invalid`),this.viewVersion(o)}else{u(Ee,this.versionList,"The versionList did not render");const e=this.versionList.activeVersion;u(Ee,e,`The version: ${e} is invalid`),this.viewVersion(e)}}async show(t){this.versionOptions={...this.versionOptions,...t};const e=await this.versionHelper.getVersions();if(this.versionOptions.hideNonVersionedOps&&e.length&&e[0].version===-1&&e.shift(),this.versionOptions.onVersionsLoaded&&this.versionOptions.onVersionsLoaded(this.editor,e),this.renderContent(e),this.initViewVersion(),!this.dialog){const{root:o}=this.components;this.dialog=new $$(o)}this.dialog.show(t.container)}destroy(){var t,e,o;(t=this.dialog)==null||t.destroy(),(e=this.versionList)==null||e.destroy(),(o=this.actionButtons)==null||o.destroy()}}function l_(n,t,e){const o=n.addCustom("version-dialog",()=>new s_(n,t));return o.show(e),{setShowOps:o.setShowOps}}const GV="",c_=w("heading-collapse");function Of(n){var e;const t=Number.parseInt((e=n.getAttribute("data-style-heading"))!=null?e:"",10);return u(c_,t,"not a heading block"),t}function Ve(n){return!!n.getAttribute("data-style-heading")}function a_(n){return!rt(n,"heading-collapsed")}function vr(n){return rt(n,"heading-collapsed")}function z6(n){if(bt(n))return!1;const e=z(n);return Ct(e)}const u_=w("heading-collapse");function Nf(n){u(u_,Ve(n),"not a heading block");const t=[],e=Of(n);let o=dt(n);for(;o&&!(Ve(o)&&Of(o)<=e);)t.push(o),o=dt(o);return t}function U6(n,t){if(!Wn(t))return;n.selection.selectBlock(t,0),Nf(t).forEach(o=>{rg(o)}),M(t,"heading-collapsed")}function Bi(n,t){Nf(t).forEach(o=>{ig(o)}),H(t,"heading-collapsed")}function d_(n,t){a_(t)?U6(n,t):Bi(n,t)}const h_=[Ch,Ah,bh,vh,yh,kh,wh,Bh];function f_(n){const t=b("button",["heading-collapse-button"],null);return t.setAttribute(`data-editor-tooltip-${n.clientId}`,"Collapse / Expand"),t.innerHTML=ph,t}function V6(n){return ga(n).querySelector("button.heading-collapse-button")}function q6(n,t){V6(t)||z6(t)||!Wn(t)||G1(t,f_(n),-1)}function m_(n){var t;(t=V6(n))==null||t.remove()}function W6(n,t){ga(t).querySelector("button.heading-collapse-button")||q6(n,t)}function g_(n){const t=Of(n),e=b("button",["heading-marker"],null);return e.innerHTML=h_[t-1],e}function G6(n){return ga(n).querySelector("button.heading-marker")}function Pf(n){G6(n)||z6(n)||!Wn(n)||G1(n,g_(n),1)}function Z6(n){const t=G6(n);t==null||t.remove()}function Q6(n){Z6(n),Ve(n)&&Pf(n)}class p_{handleDrop(t,e,o,r){if(Pl(e)||!Ve(e)||!vr(e))return;const i=Nf(e);i.unshift(e);const s=i.reverse();let l=null;return t.doc.beginBatchUpdate(),s.forEach((c,a,d)=>{const f=t.getBlockData(c),m=bo(t.editorBlocks,t.doc.toJSON(),f),p=t.insertDocAt(o,r,m)[0];a===d.length-1&&(l=p)}),t.doc.endBatchUpdate(),t.doc.beginBatchUpdate(),s.forEach(c=>{t.deleteBlock(c)}),t.doc.endBatchUpdate(),l&&U6(t,l),!0}}const C_=w("heading-collapse");class A_{constructor(t){h(this,"handleLoad",()=>{this.showCollapseButtons()});h(this,"handleHoverBlock",(t,e)=>{e&&(H(e,"hovering-heading"),Ve(e)&&Ct(z(e))&&(Pf(e),vr(e)||m_(e))),t&&Ve(t)&&Ct(z(t))&&(M(t,"hovering-heading"),Z6(t),q6(this.editor,t))});h(this,"handleClick",(t,e)=>{const o=xr(e,"button.heading-collapse-button");if(!o)return;const r=U(o);!r||(u(C_,Ve(r),"not a heading block"),d_(this.editor,r),W6(this.editor,r))});this.editor=t,t.addListener("load",this.handleLoad),t.addListener("click",this.handleClick),$t.get(t).addListener("change",this.handleHoverBlock),this.showCollapseButtons(),setTimeout(()=>{ol.get(t).addHandler(new p_)})}showCollapseButtons(){const t=Mt(this.editor.rootContainer).filter(Ve);t.length!==0&&(t[0]===Ft(this.editor.rootContainer)&&t.splice(0,1),t.forEach(Pf))}destroy(){this.editor.removeListener("load",this.handleLoad),this.editor.removeListener("click",this.handleClick)}}function La(n){const t=n.selection.range;if(t.isCollapsed()||t.start.blockId===t.end.blockId)return;const e=n.getBlockById(t.start.blockId),o=n.getBlockById(t.end.blockId);vr(e)&&Bi(n,e),vr(o)&&Bi(n,o)}function b_(n){La(n);const t=n.getFocusedBlock();!Ve(t)||vr(t)&&Bi(n,t)}function v_(n){La(n);const t=n.getFocusedBlock();if(!Ve(t))return;const e=n.selection.range.focus;!e.isSimple()||e.offset===G(n,t)&&vr(t)&&Bi(n,t)}function y_(n){La(n);const t=n.getFocusedBlock();if(!Ve(t))return;const e=n.selection.range.focus;!e.isSimple()||e.offset===0&&vr(t)&&Bi(n,t)}class k_{handleBeforeKeyDown(t,e){return vu(e.key)&&La(t),e.key==="Enter"?(b_(t),!1):e.key==="Delete"?(v_(t),!1):(e.key==="Backspace"&&y_(t),!1)}}class w_{constructor(t){this.editor=t}onInsertBlock(t,e,o,r){this.updateBlockIfNeeded(o.id)}onUpdateBlockData(t,e,o,r){const i=this.editor.doc.getBlockData(t,e);this.updateBlockIfNeeded(i.id,o)}updateBlockIfNeeded(t,e){setTimeout(()=>{const o=this.editor.findBlockById(t);if(!!o){if(!Ve(o)){e&&e.delete.includes("heading")&&Q6(o);return}rt(o,"hovering-heading")&&W6(this.editor,o),Q6(o)}},100)}}function B_(n){return!!n.heading}function Y6(n){var e;const t=n.heading;return(e=Number.parseInt(`${t}`,10))!=null?e:1}function J6(n,t){var e;return{parentNode:t,children:[],text:vt((e=n.text)!=null?e:[]),level:Y6(n),block:n}}class dl{constructor(){h(this,"nodes",[])}appendBlock(t){const e=this.findParent(Y6(t),this.nodes);e?e.children.push(J6(t,e)):this.nodes.push(J6(t,null))}findParent(t,e){const o=e[e.length-1];if(!o||t<=1)return null;if(o.level===t-1)return o;const r=this.findParent(t,o.children);return r||(o.level<t?o:null)}static buildToc(t){const e=new dl,o=t.blocks.root;for(let r=0;r<o.length;r++){const i=o[r];B_(i)&&e.appendBlock(i)}return e}}class yr extends Yt.TypedEmitter{constructor(e){super();h(this,"toc",new dl);h(this,"updateToc",ee.default(()=>{this.updateTocNow()},500));this.editor=e,e.doc.registerCallback(this),this.updateToc()}destroy(){this.editor.doc.unregisterCallback(this)}isHeadingBlock(e){return!!e.heading}onInsertBlock(e,o,r,i){e==="root"&&this.isHeadingBlock(r)&&this.updateToc()}onDeleteBlock(e,o,r){e==="root"&&this.updateToc()}onUpdateBlockText(e,o,r,i){if(e!=="root")return;const s=this.editor.doc.getBlockData(e,o);this.isHeadingBlock(s)&&this.updateToc()}onUpdateBlockData(e,o,r,i){if(e!=="root")return;const s=this.editor.doc.getBlockData(e,o);this.isHeadingBlock(s)&&this.updateToc()}static register(e){return e.addCustom("editor-toc",()=>new yr(e))}static get(e){return e.getCustom("editor-toc")}updateTocNow(){this.toc=dl.buildToc(this.editor.doc.toJSON()),this.emit("change",this.editor,this.toc)}}const ZV="";function E_(n){return n.nodes.length===0?!0:n.nodes.length>1?!1:n.nodes[0].children.length===0}function $f(n,t){t.forEach(e=>{const o=b("div",["toc-node"],n),r=b("div",["toc-title"],o);if(b("span",["toc-text"],r,e.text).setAttribute("data-block-id",e.block.id),e.children.length>0){const s=b("div",["toc-children"],o);$f(s,e.children)}})}function I_(n,t){const e=xr(t,".toc-text");if(!e)return;const o=e.getAttribute("data-block-id");if(!o)return;const r=n.findBlockById(o);!r||(t.preventDefault(),t.stopPropagation(),n.selection.selectBlock(r,0))}function K6(n,t,e){if(H(t,"loading"),t.innerHTML="",E_(e)){b("div",["toc-empty-message"],t,"No toc");return}e.nodes.length===1?$f(t,e.nodes[0].children):$f(t,e.nodes),Jd(n,"toc-click-handler",()=>{n.addListener("click",I_)})}class x_{constructor(t){h(this,"handleUpdateToc",(t,e)=>{Array.from(t.rootContainer.querySelectorAll('.embed-block[data-type="editor-block"][data-embed-type="toc"]')).forEach(r=>{const i=r.querySelector(".editor-toc-container");i&&K6(t,i,e)})});this.editor=t,yr.register(t).addListener("change",this.handleUpdateToc)}destroy(){yr.register(this.editor).removeListener("change",this.handleUpdateToc)}get toc(){return yr.register(this.editor).toc}}function T_(n,t){const e=b("div",["editor-toc-container"],t),r=n.addCustom("init-editor-toc",()=>new x_(n)).toc;r.nodes.length===0?M(e,"loading"):K6(n,e,r)}function S_(n,t,e,o){return o==="markdown"?"[toc]":""}function D_(n,t,e){const{data:o}=e;if(!o||o.embedType!=="toc"||!_(n,t))return null;const r={};return{blockData:{id:P(),type:"embed",embedType:"toc",embedData:r}}}const X6={embedType:"toc",createEmbedContent:T_,convertTo:S_,convertFrom:D_};function L_(n){return!!n.getAttribute("data-style-heading")}function _f(n,t){return L_(t)&&G(n,t)>0}function M_(n){const t=bn(n.rootElement);let e=0,o=0,r=0;if(t===document.documentElement){const i=n.rootContainer.getBoundingClientRect();e=i.left+i.width/2,o=10,r=t.offsetHeight}else{const i=t.getBoundingClientRect();e=i.left+i.width/2,o=i.top+10,r=i.bottom}for(;o<r;){const i=document.elementsFromPoint(e,o);for(let s=0;s<i.length;s++){const l=U(i[s]);if(l&&n.rootContainer.contains(l))return l}o+=10}return null}function Ff(n,t){let e=t;for(;e&&!_f(n,e);)e=dt(e);return e}function t9(n){if(bt(n))return!1;const e=z(n);return Ct(e)}function Ma(n,t){let e=t;for(;e&&!_f(n,e);)e=bt(e),e&&t9(e)&&(e=null);return e}const R_=.3;class O_ extends Yt.TypedEmitter{constructor(e){super();h(this,"scrollContainer");h(this,"scrollEventTarget");h(this,"scrollStatus",{curHeadingBlock:null,previousHeadingBlock:null,nextHeadingBlock:null});h(this,"handleScroll",ee.default(()=>{const e={curHeadingBlock:null,previousHeadingBlock:null,nextHeadingBlock:null};let o=M_(this.editor);if(o&&(o=_u(o)),!o||!this.scrollContainer){this.setStatus(e);return}if(t9(o)&&(o=dt(o)),!o){this.setStatus(e);return}if(_f(this.editor,o)){e.curHeadingBlock=o,e.previousHeadingBlock=Ma(this.editor,o),e.nextHeadingBlock=Ff(this.editor,o),this.setStatus(e);return}const r=this.scrollContainer.getBoundingClientRect(),i=Ff(this.editor,o);if(i){const l=i.getBoundingClientRect();if(l.top>r.top&&l.top<r.top+r.height*R_){e.curHeadingBlock=i,e.previousHeadingBlock=Ma(this.editor,i),e.nextHeadingBlock=Ff(this.editor,i),this.setStatus(e);return}e.nextHeadingBlock=i}const s=Ma(this.editor,o);s&&(e.curHeadingBlock=s,e.previousHeadingBlock=Ma(this.editor,s)),this.setStatus(e)},200));this.editor=e,setTimeout(()=>{this.start()},50)}setStatus(e){this.scrollStatus.previousHeadingBlock===e.previousHeadingBlock&&this.scrollStatus.nextHeadingBlock===e.nextHeadingBlock&&this.scrollStatus.previousHeadingBlock===e.previousHeadingBlock||(this.scrollStatus=e,this.emit("change",this.editor,e))}start(){this.stop(),this.scrollContainer=bn(this.editor.rootElement),this.scrollEventTarget=this.scrollContainer===document.documentElement?document:this.scrollContainer,this.scrollEventTarget.addEventListener("scroll",this.handleScroll),this.handleScroll()}stop(){this.scrollEventTarget&&this.scrollEventTarget.removeEventListener("scroll",this.handleScroll)}destroy(){this.stop(),this.scrollEventTarget=void 0}}class N_{constructor(t,e){h(this,"suggest");h(this,"onShow",(t,e,o,r)=>{const i=this.editor.getBlockByIndex(e,o);if(!Wn(i)){const s=U(z(i));if(s&&it(s)==="code")return!1}return!0});h(this,"onClickItem",(t,e,o)=>{const r=e.data,i={id:P(),type:"mention",box:!0,created:Date.now(),iconUrl:r.avatarUrl,text:r.displayName,mentionId:r.userId},s=this.editor.selection.range;if(!s.isCollapsed()||!s.isSimple())return;const l=s.focus,c=this.editor.getBlockById(l.blockId);this.editor.insertBoxToBlock(c,l.offset,i)});h(this,"queryItems",async(t,e)=>(await this.options.queryUsers(this.editor,e)).map(i=>({id:i.userId,name:i.displayName,icon:`<img src="${i.avatarUrl}" class="mention-user-avatar">`,element:i.element,data:i,subText:i.email})));this.editor=t,this.options=e,this.suggest=new Mh(t,{id:"editor-mention",trigger:["@"],autoDeleteTrigger:!0,showLoading:!0,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems})}destroy(){}}w("mathjax-box");function P_(n,t,e,o){const r=o,i=b("a",["mention-container"],e);b("span",["mention-name"],i,`@${r.text}`),i.setAttribute("data-mention-id",r.mentionId)}function $_(n,t,e){}function __(n,t,e,o){return`@${t.text}`}const Hf={boxType:"mention",updateBoxContent:P_,handleClickBox:$_,convertTo:__};function F_(n){const t=b("div",["mention-button-wrap"],null),e=Bo("mention-button",T.t("list.mention.tooltip"),iB,[],n.clientId);return t.appendChild(e),t}class H_{constructor(t){h(this,"mentionButton");h(this,"handleHoveringBlock",t=>{var e;!this.editor.isWritable()||(t&&this.shouldBlockShowMention(t)?Rt(t).appendChild(this.mentionButton):(e=this.mentionButton)==null||e.remove())});h(this,"handleMouseDown",(t,e)=>{e.preventDefault(),e.stopPropagation();const o=U(this.mentionButton);if(!o||!_(t,o))return;const r=t.selection.range.focus;if(!r.isSimple())return;let i;t.selection.focusedBlock!==o?i=G(t,o):i=r.offset,setTimeout(()=>{const s=t.insertTextToBlock(o,i,"@");i+=1;const l=vt(ve(s,i).left);this.editor.selection.selectBlock(o,i),this.editor.focus(),t.getCustom("mention").suggest.popup(o,i,l,"@")})});h(this,"destroy",()=>{$t.get(this.editor).removeListener("change",this.handleHoveringBlock)});this.editor=t,this.mentionButton=F_(t),$t.get(this.editor).addListener("change",this.handleHoveringBlock),t.domEvents.addEventListener(this.mentionButton,"mousedown",this.handleMouseDown)}shouldBlockShowMention(t){if(!_(this.editor,t)||!ut(t))return!1;const e=ze(t);return!(e==="ordered"||e==="unordered")}}const QV="",j_={templates:{title:"\u9009\u62E9\u6A21\u677F\uFF0C\u5FEB\u901F\u521B\u5EFA",create:"\u65B0\u5EFA\u6A21\u677F",choose:"\u5168\u90E8\u6A21\u677F",customizedMark:"\u81EA\u5B9A\u4E49"}},z_={templates:{title:"Choose a template",create:"New template",choose:"All templates",customizedMark:"Custom"}};T.mergeLang({"zh-CN":j_,"en-US":z_});const YV="",U_="data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIHZpZXdCb3g9IjAgMCAxMjAgMTIwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTQ4IDU5QzQ4IDU0LjU4MTcgNTEuNTgxNyA1MSA1NiA1MUg5M0M5OC41MjI4IDUxIDEwMyA1NS40NzcyIDEwMyA2MVY4OEMxMDMgOTEuODY2IDk5Ljg2NiA5NSA5NiA5NUg1NkM1MS41ODE3IDk1IDQ4IDkxLjQxODMgNDggODdWNTlaIiBmaWxsPSIjRDZFOUZBIi8+CjxwYXRoIGQ9Ik0xOCA2NEMxOCA2Mi4zNDMxIDE5LjM0MzEgNjEgMjEgNjFINTZDNjAuNDE4MyA2MSA2NCA2NC41ODE3IDY0IDY5VjgzQzY0IDg1LjIwOTEgNjIuMjA5MSA4NyA2MCA4N0gyNkMyMS41ODE3IDg3IDE4IDgzLjQxODMgMTggNzlWNjRaIiBmaWxsPSIjRUFFNEY2Ii8+CjxyZWN0IHg9IjI0IiB5PSIzMSIgd2lkdGg9IjY1IiBoZWlnaHQ9IjUwIiByeD0iNSIgZmlsbD0iIzk5QzdGMiIvPgo8cmVjdCB4PSIzMy41IiB5PSI0MyIgd2lkdGg9IjQ2IiBoZWlnaHQ9IjUiIHJ4PSIyLjUiIGZpbGw9IndoaXRlIi8+CjxyZWN0IHg9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wOSA5OC45MzYyIDIxNi42N0M5OC45MzYyIDIxNS4wMzEgOTcuNjA3MyAyMTMuNzAyIDk1Ljk2ODEgMjEzLjcwMkg5MC4wMzE5WiIgZmlsbD0iIzkxRDlCRSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEyNTZfMzcxNjgiPgo8cmVjdCB3aWR0aD0iMzcyIiBoZWlnaHQ9IjI3OSIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",e9=w("templates");function jf(n){const t=n.rootElement.querySelector(":scope .editor-templates");if(!t)return null;const e=t.querySelector(":scope .editor-templates-cards");return u(e9,e,"no card container"),{root:t,cardContainer:e}}function q_(n){const t=jf(n);if(t)return t.cardContainer.innerHTML="",t;const e=b("div",["editor-templates"],n.rootElement);b("div",["editor-templates-title"],e,T.t("templates.title"));const o=b("div",["editor-templates-cards"],e);return{root:e,cardContainer:o}}function n9(n,t,e,o,r){var f;const i=(f=n.options.componentsOptions)==null?void 0:f.templates,s=b("div",["editor-template-card",...o],null),l=b("div",["editor-template-thumb-container"],s),c=b("img",["editor-template-thumb"],l);c.src=t,c.style.display="none",c.onerror=()=>{var p;const m=(p=i==null?void 0:i.placeHolderImageSrc)!=null?p:V_;c.src!==m&&(c.src=m)},c.onload=()=>{c.style.display=""};const a=b("div",["editor-template-name"],s),d=b("span",[],a,e);return i!=null&&i.showTemplateTitleAttr&&d.setAttribute("title",e),s.onclick=()=>r(s),s}function W_(n,t){return t.thumbnailUrl?t.thumbnailUrl:n.doc.buildResourceUrl("thumbnail.png")}function G_(n,t){const e=W_(n,t);return n9(n,e,t.name,[],async()=>{var r,i;const o=(r=n.options.componentsOptions)==null?void 0:r.templates;(i=o==null?void 0:o.onApplyTemplate)==null||i.call(o,n,t)})}function Z_(n,t){return n9(n,t,T.t("templates.choose"),["more"],()=>{var o,r;const e=(o=n.options.componentsOptions)==null?void 0:o.templates;(r=e==null?void 0:e.onChooseTemplate)==null||r.call(e,n)})}function Q_(n,t){var f,m;const e=(f=n.options.componentsOptions)==null?void 0:f.templates;if(!e)return;const r=Jt(n.rootContainer).getBoundingClientRect().width;let i=1;const s=U_,l=jf(n);if(l){if(t!=null&&t.reset){const p=Array.from(l.cardContainer.children),A=l.cardContainer.firstElementChild;if(u(e9,A,"no first card"),rt(A,"new")||rt(A,"more"))return;const k=window.getComputedStyle(A),v=parseFloat(k.marginLeft),x=parseFloat(k.marginRight),E=A.getBoundingClientRect().width+v+x;i=Math.floor(r/E);const R=Math.max(1,i-1-1),$=p.length-1;p.forEach((q,ot)=>{ot>R&&ot<$?q.style.display="none":(ot>=$&&rt(q,"more"),q.style.display="")})}return}const c=e.templates,{cardContainer:a}=q_(n);c.forEach((p,A)=>{const k=G_(n,p);if(A>0&&A>=i&&(k.style.display="none"),a.appendChild(k),A===0){const v=window.getComputedStyle(k),x=parseFloat(v.marginLeft),E=parseFloat(v.marginRight),L=k.getBoundingClientRect().width+x+E;i=Math.floor(r/L)-1}});const d=Z_(n,s);a.appendChild(d),(m=e==null?void 0:e.onTemplateChooserStatusChanged)==null||m.call(e,n,a,"visible")}const o9=ee.default(Q_,50);function Y_(n){var o,r;const t=jf(n);if(!t)return;t.root.remove();const e=(o=n.options.componentsOptions)==null?void 0:o.templates;(r=e==null?void 0:e.onTemplateChooserStatusChanged)==null||r.call(e,n,null,"hide")}function J_(n){const t=n.blocks.root;if(t.length===0)return!0;if(t.length>5)return!1;const e=[...t];e[0].type==="text"&&e[0].heading&&e.splice(0,1);const o=r=>{var i;return r.type!=="text"&&r.type!=="list"?!1:r.text?((i=r.text)==null?void 0:i.length)===0:!0};return e.every(r=>o(r))}function zf(n,t){J_(n.doc.toJSON())?o9(n,t):(o9.cancel(),Y_(n))}const K_=800;class X_{constructor(t){h(this,"longPressTimeout",0);h(this,"handleSelectionChange",()=>{});h(this,"handleLongPress",t=>{const e=t.touches[0],o=Vl(this.editor,e.clientX,e.clientY);!o||console.log(o)});h(this,"handleTouchStart",t=>{t.touches.length===1&&(this.longPressTimeout=window.setTimeout(()=>{this.handleLongPress(t)},K_))});h(this,"handleTouchEnd",t=>{this.longPressTimeout&&(window.clearTimeout(this.longPressTimeout),this.longPressTimeout=0)});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChange),document.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchend",this.handleTouchEnd)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChange),document.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("touchend",this.handleTouchEnd)}}class hl{constructor(t,e){h(this,"_decrypted",!1);this.editor=t,this.blockData=e}get decrypted(){return this._decrypted||this.blockData.owner===this.editor.doc.getUser().userId}setDecrypted(){this._decrypted=!0}destroy(){}static getState(t,e){return t.addCustom(`encrypted-block-${e.id}`,()=>new hl(t,e))}}const JV="",Po=w("encrypted-block");function tF(n,t,e,o,r){const i=r,s=lo(o,"div"),l=hl.getState(n,i);if(l.decrypted)n.createChildContainer(t,s,i.children[0]),M(o,"decrypted");else{M(o,"encrypted");const c=Rt(o),a=b("div",["password-container"],c),d=b("input",[],a);d.type="text",d.onkeydown=f=>{if(f.key==="Enter"){const m=d.value;if(i.password===Er.default(`${i.owner}-${m}`)){l.setDecrypted(),n.reloadBlock(o);const p=qu(n,n.getBlockById(i.id));p&&(n.selection.selectBlock(p,0),n.focus())}}}}return s}function eF(n,t,e,o){const r=document.elementsFromPoint(e,o)[0];if(!r||!t.contains(r)||!n.contains(t)||!vn(r))return null;const i=r;if(n.getBlockData(t).children[0]!==V(i))return null;const l=Bt(t,V(i));return new tn(n,{anchor:l,focus:l})}function nF(n,t,e,o){if(hl.getState(n,n.getBlockData(t)).decrypted)return null;if(o==="ArrowDown"||o==="ArrowRight"){const s=dt(t);return s?F(s,G(n,s),"end"):F(t,1,"end")}const i=bt(t);return F(i||t,0,"home")}function oF(n,t){return n.getBoundingClientRect()}function rF(n,t,e,o){if(e.isSimple()){u(Po,o.isSimple(),"from is simple position but to is not simple position"),Po.debug("full select table"),M(t,"full-selected");return}u(Po,!o.isSimple(),"from is complex position but end is simple position");const r=e,i=o;u(Po,r.blockId===i.blockId,"only allow update one table selection"),u(Po,r.childContainerId===i.childContainerId,"only one container");const s=n.getBlockData(t),l=n.getContainerById(s.children[0]);M(l,"selected")}function iF(n){n.rootContainer.querySelectorAll('[data-type="editor-block"][data-block-type="encrypted"]').forEach(t=>{H(t,"full-selected"),t.querySelectorAll("selected").forEach(e=>{H(e,"selected")})})}function sF(n,t){const e=n.getBlockData(t);return hl.getState(n,e).decrypted?[n.getContainerById(e.children[0])]:[]}function lF(n,t,e,o,r){return null}function cF(n,t,e,o){u(Po,e.blockId===o.blockId,"only allow select in single block"),u(Po,j(t)===e.blockId,"only allow select in single block");const r=n.getBlockData(t);return u(Po,e.childContainerId===r.children[0],"only one container"),[n.getContainerById(r.children[0])]}function aF(n){return{name:"EncryptedBlock",insertBlockCommandItems:[{id:"insert-encrypted-block",name:"Encrypted Block"}],async handleInsertEmptyBlock(t,e){const o=Bn(t.doc),r={id:P(),type:"encrypted",children:[o],owner:t.doc.getUser().userId,ownerDisplayName:t.doc.getUser().displayName,password:Er.default(`${t.doc.getUser().userId}-1234`)},i=t.doc.getContainerBlocks(o)[0];return t.insertBlock(e.containerId,e.blockIndex,r,Ot(t,i.id,0))}}}function uF(n,t,e,o){return o==="text"||o==="markdown"?"[Encrypted Block]":"<p>[Encrypted Block]</p>"}const dF={blockType:"encrypted",blockKind:"complex",enableKeyboardSelect:!0,createBlockContent:tF,getBlockTextLength:()=>1,getRangeFromPoint:eF,moveCaret:nF,getCaretRect:oF,updateSelection:rF,clearSelection:iF,getChildContainers:sF,getNextContainer:lF,getSelectedContainers:cF,getOptions:aF,convertTo:uF};function hF(n,t,e){const o=hs(n,t,{components:{blocks:[Ws,Qs,dF],decorators:[new Js],embeds:[va,$1,cf,af,uf,k1,df,Mf,Lf],boxes:[ta],options:{...e.componentsOptions}}});return o.readonly=!0,o}class fF{constructor(t){this.createOptions=t}createHistoryEditor(t,e){return hF(t,e,this.createOptions)}}w("create-editor");function r9({root:n,childDoc:t,doc:e}){t.uploadResource=e.uploadResource.bind(e),t.buildResourceUrl=e.buildResourceUrl.bind(e);const o=hs(n,t,{shortcuts:[Ac],components:{blocks:[Ws,Qs],decorators:[new Js],embeds:[G4,va,$1,cf,af,uf,k1,df,Mf,Lf],boxes:[ta,Hf],options:{image:{defaultAlign:"left"}}}});return o.input.addHandler(new ca),o.input.addHandler(new hf(o)),o.input.addHandler(new SP(o)),o.input.addHandler(new Y1),o}function mF(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),o=new Set;e.forEach(r=>{const i=U(r);i&&o.add(i)}),o.forEach(r=>{DP(n,r,t)})}class gF{constructor(t){h(this,"listeners",new Set);h(this,"doc");this.editor=t,this.doc=this.editor.doc.externalDoc,this.doc.registerCallback(this)}getComments(){return this.doc.getComments()}getComment(t){return this.doc.getComment(t)}getCommentDoc(t){return this.doc.getCommentDoc(t)}localCreateComment(t,e){this.doc.localCreateComment(t,e)}localDeleteComment(t){const e=this.getComment(t);this.doc.localDeleteComment(t);const o=e.groupId;this.getComments().filter(i=>i.groupId===o).length===0&&mF(this.editor,o)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return r9({root:t,childDoc:e,doc:this.doc})}}class pF{constructor(t,e){h(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 fh(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 r9({root:t,childDoc:e,doc:this.localDoc})}}const CF={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"}}},AF={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"}}};T.mergeLang({"zh-CN":CF,"en-US":AF});function bF(n){let t;return n.forEach((e,o)=>{o.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function vF(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),o=bF(t.headers).toLocaleLowerCase();let r="";if(o){const s=au.default[o].extensions;s&&s.length>0&&(r=s[0])}return new File([e],`${Date.now()}.${r}`,{type:o})}catch{return null}}function yF(n){const o=new DOMParser().parseFromString(n,"text/html").querySelector("svg");if(!o)return null;const r=o.getAttribute("viewBox");if(!r)return null;const i=r.split(" ");if(i.length===4){const s=i[2],l=i[3];return o.setAttribute("width",s),o.setAttribute("height",l),o.outerHTML}return null}function i9(n,t,e=!0){const o=new Image,r=document.createElement("canvas"),i=r.getContext("2d");if(!i){t(new Error("failed to get context"),null);return}o.onload=()=>{if(r.width=o.naturalWidth,r.height=o.naturalHeight,e&&(r.width===0||r.height===0)){const s=n.substring(26);if(s){const l=atob(s),c=yF(l);if(c){Bu(c,"image/svg+xml").then(a=>{i9(a,t,!1)});return}}t(null,null);return}i.drawImage(o,0,0),r.toBlob(s=>{t(null,s)},"image/png")},o.src=n}async function kF(n){const t=await Tr(n);return new Promise((e,o)=>{i9(t,(r,i)=>{if(r){o(r);return}if(!i){o(new Error("Failed to get image blob"));return}e(i)})})}const s9="Untitled";function wF(n){const t=Ft(n.rootContainer);return!t||!_(n,t)?s9:n.getBlockString(t)||s9}const BF="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0lMtqwzAQRfeF/oPRtsRKuiilxMmij2UbaArdKvI4EdULaZzH33fsJKYUJy5NsjHIM/feowHNcLw2OllCiMrZjA3SPkvASpcrO8/Yx/Sld8+SiMLmQjsLGdtAZOPR9d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G9tWG1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",EF=()=>wu(BF);async function IF(n){return new Promise((t,e)=>{const o=new Image;o.onload=()=>{t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=e,o.src=n})}async function l9(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};const e=await Tr(new File([t],"",{})),o=await IF(e);return o.width===void 0||o.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||o.width*n.height/o.height,height:n.height||o.height*n.width/o.width,buffer:t}:{width:o.width,height:o.height,buffer:t}}function xF(n,t){let e=n.filter(s=>s!=null);const o=t-(e.length-1)*20,r=.87,i=e.reduce((s,l)=>s+l.width,0);return i>o&&(e=e.map(s=>({width:s.width*o/i,height:s.height*o/i,buffer:s.buffer}))),e.map(s=>({width:s.width*r,height:s.height*r,buffer:s.buffer}))}function c9(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let o;switch(e%3){case 0:o=Y.LevelFormat.DECIMAL;break;case 1:o=Y.LevelFormat.LOWER_LETTER;break;default:o=Y.LevelFormat.LOWER_ROMAN;break}return{level:e,format:o,text:`%${e+1}. `,alignment:Y.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(e+1)),hanging:Y.convertInchesToTwip(.2)}}}}})}function TF(){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:Y.LevelFormat.BULLET,text:t,alignment:Y.AlignmentType.START,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(n+1)),hanging:Y.convertInchesToTwip(.2)}}}}})}function SF(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Y.LevelFormat.BULLET,text:"\u2611",alignment:Y.AlignmentType.START,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(n+1)),hanging:Y.convertInchesToTwip(.2)}}}}))}function DF(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Y.LevelFormat.BULLET,text:"\u2610",alignment:Y.AlignmentType.START,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(n+1)),hanging:Y.convertInchesToTwip(.2)}}}}))}var fl=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(fl||{});const LF=[{levels:c9(),reference:"number-numbering-reference"},{levels:TF(),reference:"number-bullet-reference"},{levels:SF(),reference:"checked-bullet-reference"},{levels:DF(),reference:"unchecked-bullet-reference"}];function MF(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 RF(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 OF(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 NF=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function a9(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(NF);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},o=e(t[1]),r=e(t[2]),i=e(t[3]);return`${o}${r}${i}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function oe(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 u9(n,t,e){for(let o=0;o<=e;++o){const r=`${t}${o}`;if(oe(n,r))return r}}function Ra(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function Uf(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"}function d9(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function PF(n){const t=oe(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const o of e){const r=o.split(":");if(r.length!==2)continue;const i=r[0].trim().toLowerCase(),s=r[1].trim().toLowerCase();i==="font-size"&&Ra(n,"inline-style-font-size",s),i==="color"&&Ra(n,"inline-style-color",s),i==="background-color"&&Ra(n,"inline-style-background-color",s),i==="font-family"&&Ra(n,"inline-style-font-family",s)}}function $F(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function _F(n){const t=`${oe(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function FF(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 HF(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function jF(n){return oe(n,"inline-style-font-family")}function zF(n){const t=oe(n,"inline-style-background-color");return a9(t)}function UF(n){const t=oe(n,"inline-style-color");return a9(t)}function VF(n){PF(n);const t=oe(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!oe(n,"style-code"),link:d9(oe(n,"link")),size:_F(n),text:t?HF(n):FF(n)||n.insert,bold:!!oe(n,"style-bold"),underline:!!oe(n,"style-underline"),italics:!!oe(n,"style-italic"),strike:!!oe(n,"style-strikethrough"),superScript:!!oe(n,"style-super"),subScript:!!oe(n,"style-sub"),math:oe(n,"type")==="math"?oe(n,"src"):void 0,mention:t,fontFamily:jF(n),background:zF(n),color:t?"338fe5":MF(u9(n,"style-color-",6))||UF(n),highlight:u9(n,"style-bg-color-",13)}}function qF(){return[new Y.Paragraph({border:{top:{color:"auto",style:Y.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Y.Paragraph({spacing:{line:0}})]}function WF(){return new Y.Paragraph({children:[new Y.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Y.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function GF(){return new Y.Paragraph({children:[new Y.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Y.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function ZF(n,t){return new Y.Paragraph({children:[new Y.ExternalHyperlink({children:[new Y.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function h9(n){if(n.heading!=null)return`Heading${n.heading}`}function f9(n){if(n.alignment!=null){if(n.alignment==="center")return Y.AlignmentType.CENTER;if(n.alignment==="right")return Y.AlignmentType.RIGHT;if(n.alignment==="left")return Y.AlignmentType.LEFT}}function QF(n){if(n.indent)return{left:Y.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Y.convertInchesToTwip(.3*n.padding)}}function YF(n){return{type:Y.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function JF(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function m9(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const o=n.size||t,r=o!=null?Math.floor(o*1.5+.5):void 0;return new Y.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Y.UnderlineType.SINGLE}:void 0,italics:n.italics||void 0,strike:n.strike||void 0,superScript:n.superScript||void 0,subScript:n.subScript||void 0,size:r,style:e,font:n.fontFamily?JF(n.fontFamily):void 0,shading:n.background?YF(n.background):void 0,color:n.color,highlight:RF(n.highlight)})}function KF(n,t){if(n.link)return new Y.ExternalHyperlink({children:[m9(n,t)],link:n.link})}async function g9(n,t,e,o,r){const i=await r(n,t,e);if(i==null)return;const s=await l9({width:o||0,height:0,src:e},i);return new Y.ImageRun({data:i,transformation:{width:s.width||100,height:s.height||20}})}function XF(n){if(n.heading||n.heading)return n.heading}function tH(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function eH(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function nH(n,t){var o;const e=[];if(n.text&&Array.isArray(n.text)){for(let r=0;r<n.text.length;r++){const i=n.text[r];if(((o=i.attributes)==null?void 0:o.box)===!0&&t){const s=await t(i);if(s){n.text.splice(r+1,0,...s);continue}}e.push(VF(i))}return e}}function oH(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 rH(n,t){if(n.type==="embed"&&n.embedType&&Uf(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(o=>{const r=t(o),i=n.embedData[`${r}_width`],s=n.embedData[`${r}_height`];return{src:o,width:i,height:s}})}function iH(n){if(n.padding)return n.padding}function sH(n){return!!(n.type==="embed"&&n.embedType&&Uf(n.embedType)&&n.embedData&&n.embedData.src)}async function Oa(n,t,e){return{quoted:!!n.quoted,heading:XF(n),alignment:tH(n),indent:eH(n),padding:iH(n),texts:await nH(n,e),list:oH(n),images:rH(n,t),border:sH(n)}}async function lH(n,t,e,o){const r=[];if(!n.children)return[];for(const i of n.children){const s=[];for(const l of t.blocks[i])s.push(await Oa(l,e,o));r.push(s)}return r}const cH=w("to-docx");function aH(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 uH(n,t,e,o){const r=!!n.hasColTitle,i=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let a=0;a<e;a++)(r&&a===0||i&&c===0||s&&c%2===1)&&(o[c][a].color=l)}function dH(n){u(cH,n.children,"no table children");const t=n.rows,e=n.cols,o=n.colsWidth;if(o)for(let s=0;s<o.length;s++)o[s]===0&&(o[s]=100);const r=aH(t,e);let i=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(r[s][l].originalWidth=o?o[l]:void 0,r[s][l].from!==void 0)continue;const c=n.children[i];i+=1,r[s][l].cellId=c,r[s][l].color=OF(n[`${c}_background`]),r[s][l].width=o?o[l]:100,r[s][l].align=n[`${c}_align`];const a=n[`${c}_rowSpan`]||1,d=n[`${c}_colSpan`]||1;if(r[s][l].rowSpan=a,r[s][l].colSpan=d,a>1||d>1){let f=0;for(let m=0;m<a;m++)for(let p=0;p<d;p++)m===0&&(f+=o?o[l+p]:80),!(m===0&&p===0)&&(r[s+m][l+p].from=[s,l]);r[s][l].width=f}}return uH(n,t,e,r),r}async function hH(n,t,e,o,r,i,s,l,c,a){async function d(p){if(l){const A=await l(r,i,p);if(A){await o.addDoc(n,A,a);return}}if(p.type==="text"||p.textOnly===!0){const A=await Oa(p,s,c);await o.addTextBlock(A);return}if(p.type==="code"){const A=await lH(p,e,s,c);await o.addCodeBlockObject(A);return}if(p.type==="list"&&p.textOnly!==!0){const A=await Oa(p,s,c);await o.addListBlockObject(n,A);return}if(p.type==="embed"&&p.embedType){const A=p,k=A.embedData,v=A.embedType;if(Uf(v)){const x=await Oa(p,s,c);await o.addImagesBlockObject(x,a)}else p.embedType==="hr"?o.addSeparatorBlock():p.embedType==="video"?o.addVideoPlaceholder():p.embedType==="audio"?o.addAudioPlaceholder():p.embedType==="webpage"?o.addHyperlinkParagraph(d9(k.src),k.title):o.addOtherEmbedBlock(v,p.embedData);return}if(p.type==="table"){let A=[];if(p.colsWidth)A=p.colsWidth;else{const v=p.cols;A=new Array(v);for(let x=0;x<A.length;x++)A[x]=100;p.colsWidth=A}const k=dH(p);await o.addTableMatrix(A,k,e),o.addEmptyParagraph()}}function f(p){const A=[];for(const{type:k,data:v}of p.embedData.exportSpec){if(k==="text"){const x={id:P(),text:[{insert:v}],type:"text"};A.push(x);continue}if(k==="image"){const x={id:P(),type:"embed",embedType:"image",align:"left",embedData:{src:v}};A.push(x);continue}if(k==="link"){const x={id:P(),type:"embed",embedType:"webpage",embedData:{src:v.url,title:v.title}};A.push(x);continue}}return A}function m(p){var A;return(A=p==null?void 0:p.embedData)!=null&&A.exportSpec?f(p):[p]}for(const p of t)for(const A of m(p))await d(A)}function fH(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const mH=w("to-docx");class gH{constructor(t,e,o,r,i,s){h(this,"paragraphs");this.appId=t,this.docId=e,this.state=o,this.readImageFunc=r,this.convertBlocksFunc=i,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Y.Paragraph({heading:h9(t),alignment:f9(t),children:await this.paragraphsFromBlockTexts(t),indent:QF(t)}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=$F(this.defaultFontSize,t.heading),o=[];for(const r of t.texts){if(r.link){const i=KF(r,e);i&&o.push(i);continue}if(r.box&&r.box.type&&r.box.type==="br"){o.push(new Y.TextRun({text:"",break:1}));continue}if(r.box&&r.box.type&&r.box.type==="image"){const i=await g9(this.appId,this.docId,r.box.src,r.box.width,this.readImageFunc);i&&o.push(i);continue}if(r.math){const i=await g9(this.appId,this.docId,r.math,0,this.readImageFunc);i&&o.push(i);continue}o.push(m9(r,e))}return o}async addCodeBlockObject(t){for(const e of t)for(const o of e){const r={style:Y.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Y.Paragraph({style:"Code",border:{left:{...r},right:{...r},top:{...r},bottom:{...r}},children:await this.paragraphsFromBlockTexts(o)}))}}async addListBlockObject(t,e){if(e.list==null)return;let o;const r=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[r])o=this.state.listInstMap[r];else if(o=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[r]=o,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${o}`,l=c9([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:o}),this.state.listRefMap[r]=s}else e.list.ordered?this.state.listRefMap[r]=fl.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[r]=fl.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[r]=fl.UNCHECKED:this.state.listRefMap[r]=fl.BULLET;const i=h9(e);e.texts&&this.paragraphs.push(new Y.Paragraph({heading:i,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[r],level:e.list.level-1,instance:o}}))}imageDimWithBufferToImageRun(t){return new Y.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e){if(t.images==null)return;const o=await Promise.all(t.images.map(async s=>{const l=await this.readImageFunc(this.appId,this.docId,s.src);if(l)return l9(s,l)})),r=xF(o,e),i={style:Y.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Y.Paragraph({border:t.border?{left:{...i},right:{...i},top:{...i},bottom:{...i}}:void 0,alignment:f9(t)||Y.AlignmentType.CENTER,children:r.map(s=>this.imageDimWithBufferToImageRun(s)).flatMap((s,l,c)=>s==null?[]:c.length-1!==l?[s,new Y.TextRun({text:" "})]:s)}))}addSeparatorBlock(){qF().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Y.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(WF())}addAudioPlaceholder(){this.paragraphs.push(GF())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(ZF(t,e))}async addTableMatrix(t,e,o){const r=t.map(i=>i!==0?i*15:1500);this.paragraphs.push(new Y.Table({rows:await this.generateTableRows(e,o),columnWidths:r}))}async generateRowCells(t,e){const o=[];for(const r of t){const i=r.cellId;if(i===void 0)continue;const s=r.width*.9;o.push(new Y.TableCell({children:await this.convertBlocksFunc(i,e.blocks[i],e,this.appId,this.docId,this.state,s),columnSpan:r.colSpan,rowSpan:r.rowSpan,width:{type:Y.WidthType.DXA,size:r.width*15},shading:r.color?{fill:r.color,type:Y.ShadingType.CLEAR,color:"auto"}:void 0}))}return o}async generateTableRows(t,e){const o=[];for(const r of t)o.push(new Y.TableRow({children:await this.generateRowCells(r,e)}));return o}async addDoc(t,e,o){const r=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,o);r&&(this.paragraphs=this.paragraphs.concat(r))}async addOtherEmbedBlock(){}}class pH{constructor(t,e,o,r,i,s,l,c){h(this,"convertBlocks",async(t,e,o,r,i,s,l=720)=>{const c=new gH(r,i,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await hH(t,e,o,c,r,i,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=o,this.readImage=r,this.defaultFontSize=i,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=c}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,o){const r=new Y.ImportDotx,i=this.templateData?await r.extract(this.templateData):void 0,s=t.blocks.root;u(mH,s,"data must have blocks");const l=fH(),c=await this.convertBlocks("blocks",s,t,e,o,l),a=this.backgroundImageOptions?{default:new Y.Header({children:[new Y.Paragraph({children:[new Y.ImageRun(this.backgroundImageOptions)]})]})}:{},d=new Y.Document({numbering:{config:[...LF,...l.levelConfigs]},sections:[{headers:a,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:i});return Y.Packer.toBlob(d)}}async function CH(n,t,e,o){const r=n.doc.buildResourceUrl(o,{withToken:!0});let i=await vF(r);if(!i)return;if(i.type.indexOf("/svg")!==-1){const l=await kF(i);l&&(i=new File([l],i.name))}return await i.arrayBuffer()}async function AH(n,t,e){const o=n.editorBlocks.getBlockClass(e.type);if(o.toStandardDoc)return o.toStandardDoc(n,e,t)}async function bH(n,t){const e=t.attributes,o=n.editorBoxes.getBoxClass(e.type);if(o.toStandardText)return o.toStandardText(n,e)}async function vH(n,t){let{template:e,download:o,backgroundImageOptions:r}=t!=null?t:{};e||(e=EF());const i=n.doc.toJSON(),s=(f,m,p)=>CH(n,f,m,p),l=async(f,m,p)=>AH(n,i,p),c=async f=>bH(n,f),d=await new pH(e,i,Er.default,s,void 0,l,c,r).convert("_appId","_docId");if(o){const f=URL.createObjectURL(d),m=document.createElement("a");m.setAttribute("download",`${wF(n)}.docx`),m.setAttribute("href",`${f}`),m.click(),m.remove()}return d}const Vf=w("create-editor"),p9=[va,$1,cf,af,uf,k1,df,Mf,Lf,G4,X6,g$];async function yH(n,t){var s,l,c,a,d,f,m,p,A,k,v,x,E;u(Vf,n,"app does not exists"),t.lang&&T.setLang(t.lang),so.level=(s=t.logLevel)!=null?s:Ni.DEBUG;const e=t.onReauth?async()=>{var q;const L=t.user.userId,R=t.docId,$=await((q=t.onReauth)==null?void 0:q.call(t,L,R,t.permission));return{userId:L,docId:R,permission:t.permission,appId:t.appId,token:$,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,o={auth:{appId:t.appId,docId:t.docId,userId:t.user.userId,permission:t.permission,token:t.token,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl},serverUrl:t.serverUrl,reauthFunc:e,disableLogout:t.disableLogout},r=await Es.load(o),i=hs(n,r,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,components:{blocks:[Ws,Qs,V1,MC],commandProviders:[new jh,...((l=t.components)==null?void 0:l.commandProviders)||[]],decorators:[new Js,new gh],embeds:[...p9,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[ta,Hf,v6,...((a=t.components)==null?void 0:a.boxes)||[]],insertions:[Cd],blockHooks:[new F4,new X4,...((d=t.components)==null?void 0:d.blockHooks)||[]],textRenders:[new m6,new tI],options:{...t.componentsOptions}},shortcuts:[YD,xM,L1,V3,eI,E1,A$,Ac],colors:["#338FE5","#24B47E","#F0A100","#E52727","#9678D3","#2CB2AE","#EB6414","#8AAB3F"]});if(i.editorCommandProviders.registerCommandProvider(new Rn(i)),i.input.addHandler(new k_),i.input.addHandler(new ca),i.input.addHandler(new Zx),i.input.addHandler(new vM),i.input.addHandler(new Zs(i,{headingLevel:1,titlePlaceholder:T.t("placeholder.common.title"),contentPlaceholder:T.t("placeholder.common.content"),readonlyTitlePlaceholder:T.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new ea(i,(f=t.componentsOptions)==null?void 0:f.quickMenu)),i.input.addHandler(new hf(i)),i.input.addHandler(new N3(i)),i.input.addHandler(new WD),i.input.addHandler(new Y1),i.doc.registerCallback(new w_(i)),i.addCustom("remote-cursor",()=>new l5(i)),i.addCustom("block-menu",L=>new U4(L)),i.addCustom("editor-tooltip",()=>new B1(i)),t!=null&&t.enableComments&&i.addCustom("editor-comments",L=>new f6(L,new gF(L))),i.addCustom("create-options",()=>new Am(i,t)),i.addCustom("drop-target",()=>new ol(i)),i.addCustom("list-to-mindmap",()=>new Jc(i)),i.addCustom("list-to-mention",()=>new H_(i)),i.addCustom("mobile-helper",()=>new X_(i)),i.addCustom("code-caret",()=>new qD(i)),(m=t.componentsOptions)!=null&&m.mention){const L=t.componentsOptions.mention;i.addCustom("mention",()=>new N_(i,L))}if(i.addCustom("heading-collapse",()=>new A_(i)),ii.register(i),ol.register(i),yr.register(i),Oo.register(i),(A=(p=t.componentsOptions)==null?void 0:p.remoteCarets)!=null&&A.onUserChanged){const L=(v=(k=t.componentsOptions)==null?void 0:k.remoteCarets)==null?void 0:v.onUserChanged;i.doc.getRemoteUsers().on("change",R=>{L(i,R)})}return(E=(x=t.componentsOptions)==null?void 0:x.templates)!=null&&E.templates.length&&(i.addListener("docChanged",()=>{zf(i)}),i.addListener("resize",()=>{zf(i,{reset:!0})}),setTimeout(()=>{zf(i)},100)),i.doc.registerCallback({onError:async L=>{if(L.code==="ResetDoc"){Vf.error(`reset doc: ${L.message}`);const R=await Es.load(o);i.doc.reset(R)}}}),i}function kH(n){return n.toJSON!==void 0}async function wH(n,t,e){var i,s,l;u(Vf,n,"app does not exists");const o=kH(t)?t:new Yd(t,{serverUrl:e.serverUrl||""});e.lang&&T.setLang(e.lang);const r=hs(n,o,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[Ws,Qs,V1,MC],commandProviders:[new jh],decorators:[new Js,new gh],embeds:[...p9,...((i=e.components)==null?void 0:i.embeds)||[]],boxes:[ta,Hf,v6],insertions:[Cd],blockHooks:[new F4,...((s=e.components)==null?void 0:s.blockHooks)||[]],textRenders:[new m6],options:{...e.componentsOptions}},shortcuts:[L1,V3,E1,Ac]});return r.editorCommandProviders.registerCommandProvider(new Rn(r)),r.input.addHandler(new ca),r.input.addHandler(new Zs(r,{headingLevel:1,titlePlaceholder:T.t("placeholder.common.title"),contentPlaceholder:T.t("placeholder.common.content"),readonlyTitlePlaceholder:T.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),r.input.addHandler(new ea(r,(l=e.componentsOptions)==null?void 0:l.quickMenu)),r.input.addHandler(new hf(r)),r.input.addHandler(new N3(r)),r.input.addHandler(new Y1),r.addCustom("block-menu",c=>new U4(c)),r.addCustom("editor-tooltip",()=>new B1(r)),e!=null&&e.enableComments&&r.addCustom("editor-comments",c=>new f6(c,new pF(c,o))),r.addListener("clickLink",(c,a,d)=>{var m;if((m=e==null?void 0:e.events)!=null&&m.onClickLink){e.events.onClickLink(c,a,d);return}const f=d.getAttribute("link");f&&(c.readonly||a.ctrlKey||a.metaKey)&&window.open(f,"_blank")}),ii.register(r),r}function BH(n,t){var l;const e=n.doc;if(!((l=e.getVersionHelper)==null?void 0:l.call(e)))throw new Error("the editor does not support to show versions");const r=n.getCustom("create-options");if(!r)throw new Error("the editor does not support to show versions");const i=r.getData(),s=new fF(i);return l_(n,s,t)}g.tippy=i8,g.AuthError=Tc,g.AuthHeader=Bs,g.AutoScroll=Km,g.BaseURLHeader=Sc,g.BasicCommands=kx,g.BlockExclusiveHook=X4,g.BlockResizer=sa,g.BrBox=Lp,g.CodeBlock=Qs,g.CodeLineBlock=V1,g.CodeTextDecorator=Js,g.DefaultShortcuts=Ac,g.DocIdError=Qk,g.DragDrop=Rm,g.DrawioEmbed=va,g.EditorBlocks=Tg,g.EditorBoxes=Rp,g.EditorCommandProviders=k2,g.EditorComplexBlockPosition=Xe,g.EditorComplexSelectionRange=tn,g.EditorDecorators=$p,g.EditorEmbeds=Dg,g.EditorInsertions=Pp,g.EditorSimpleBlockPosition=qt,g.EditorSimpleSelectionRange=Kt,g.EmbedBlock=Mg,g.EnforceWithDocumentTitleHandler=Zs,g.EventCallbacks=Pi,g.FILL_CHAR=pb,g.FileExtError=Yk,g.HeadingBlockScrollListener=O_,g.InputtingInsertion=Op,g.LocalDoc=Yd,g.LogLevel=Ni,g.Logger=so,g.MIN_DISTANCE_THRESHOLD=Lm,g.ManualCloseDialog=Ds,g.ManualMenu=cr,g.ManualToolbar=Ss,g.MarkdownInputHandler=ca,g.MaxUserError=ch,g.OnesEditorAutoSuggest=Mh,g.OnesEditorCustomDataWrapper=Am,g.OnesEditorExclusiveBlock=Oo,g.OnesEditorHoveringBlock=$t,g.OnesEditorQuickMenu=ea,g.OnesEditorToc=dl,g.OnesEditorTocProvider=yr,g.OnesEditorToolbar=ii,g.OnesEditorTooltip=B1,g.PermissionError=Zk,g.Popup=Is,g.RemoteCarets=l5,g.RemoteCaretsDecorator=gh,g.RemoteCaretsInsertion=Cd,g.RemoteUsers=vc,g.RequestReloadError=ws,g.RichText=ce,g.ShareDBDoc=Es,g.SimpleCache=vm,g.StandardEmbedBlockCommands=N1,g.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=rd,g.TEXT_STYLE_COLOR_PREFIX=od,g.TableBlock=Ws,g.TableBlockCommandProvider=jh,g.TableShortcuts=L1,g.TextBlock=ye,g.TextBox=Dp,g.TextStyleShortcuts=E1,g.TocEmbed=X6,g.ZERO_WIDTH_SPACE_CHAR=$i,g.addAttribute=Jl,g.addClass=M,g.addCommentToBlock=la,g.addDays=Z8,g.addMetaToDoc=us,g.addMonths=G8,g.animateScrollTo=pu,g.applyPlaceholderToBlock=aa,g.assert=u,g.blockToDoc=Wd,g.blockToHtml=yd,g.blockToMarkdown=kd,g.blockToText=lc,g.blocksToDoc=Pv,g.clearAllSelection=Ag,g.clientType=xt,g.cloneBlock=bo,g.cloneChildContainer=Md,g.cloneDoc=Rd,g.cloneText=hp,g.commentToShareDbComment=mh,g.compareElement=Dl,g.comparePosition=Uu,g.complexBlockAdjustSelectionPos=Ul,g.complexBlockFindNearestChildBlock=Pg,g.complexBlockGeFirstSimpleChild=qu,g.complexBlockGetAllChildContainers=Se,g.complexBlockGetBottomChildContainers=Ng,g.complexBlockGetLastSimpleChild=Vi,g.complexBlockGetSelectedContainers=Rr,g.complexBlockGetTopChildContainers=Og,g.containerToDoc=K0,g.continuousScroll=Jm,g.convertBlockFrom=jl,g.copyBlockAttributes=Yp,g.createBlockAnchor=fo,g.createBlockCaretAnchor=jg,g.createBlockContentElement=lo,g.createBlockElement=lg,g.createBlockSimpleDocRange=nc,g.createBlockSimpleRange=Ot,g.createBoxContentElement=ug,g.createBoxElement=cg,g.createBoxOp=op,g.createChildContainer=xp,g.createComplexBlockPosition=Bt,g.createComplexDocPos=Ap,g.createComplexDocRange=bb,g.createContainer=gp,g.createContainerElement=fd,g.createDeleteOps=Xg,g.createEditor=hs,g.createEditorSelectionRange=Wt,g.createElement=b,g.createEmptyContainer=Bn,g.createEmptyDoc=or,g.createEmptyTextBlockData=Xl,g.createExpandedRange=Tl,g.createIconButton=Ir,g.createImage=ym,g.createInsertOps=Yl,g.createInsertionContentElement=fg,g.createInsertionElement=dg,g.createLocalEditor=wH,g.createOnesEditor=yH,g.createRange=km,g.createRichText=Co,g.createRootContainer=Ip,g.createSimpleBlockPosition=F,g.createSimpleDocPos=Cp,g.createTextBlockData=Vn,g.createTextButton=mr,g.createTextOp=_e,g.createTextWithReplaceSoftReturn=Xu,g.daysAfter=Tu,g.deleteText=ed,g.diffDays=Q8,g.disablePageScroll=qm,g.docToHtml=Vp,g.docToHtmlFragment=ts,g.docToMarkdown=$r,g.docToText=cc,g.downloadObjectToFile=nf,g.downloadSvgToString=t3,g.editLink=Hs,g.editorAddComment=MP,g.editorAddTextAttribute=l0,g.editorAutoInsertBlock=Jp,g.editorBreakTextBlock=Hr,g.editorClearCompositionText=Qp,g.editorClearSelectedContents=Dd,g.editorCopyBlock=Cc,g.editorDeleteBlock=Td,g.editorDeleteBlockText=Ed,g.editorDeleteBlockWithoutChildren=xd,g.editorDeleteChildContainer=gv,g.editorDeleteChildContainers=Kp,g.editorFocusToBlock=Ld,g.editorFocusToEnd=Y0,g.editorGetBlockData=Ao,g.editorGetBlockText=ge,g.editorGetBlockTextEx=rc,g.editorGetBoxData=vp,g.editorHandleKeyboardEvent=o2,g.editorInsertBlock=Fr,g.editorInsertBoxToBlock=Gp,g.editorInsertDoc=i0,g.editorInsertDocAt=Od,g.editorInsertText=Bd,g.editorInsertTextToBlock=Wp,g.editorInsertTextToBlockEx=wd,g.editorMergeTextBlock=Xp,g.editorMoveDown=b0,g.editorMoveEnd=S0,g.editorMoveHome=D0,g.editorMoveLeft=p0,g.editorMoveLineEnd=_0,g.editorMoveLineHome=$0,g.editorMovePageDown=V0,g.editorMovePageUp=U0,g.editorMoveRight=C0,g.editorMoveUp=A0,g.editorMoveWordEnd=I0,g.editorMoveWordLeft=E0,g.editorRangeClearColor=a0,g.editorRangeGetColor=Nd,g.editorRangeSetColor=c0,g.editorRemoveTextAttribute=bv,g.editorReplaceBlockText=hc,g.editorReplaceContainer=s0,g.editorRunOnce=Jd,g.editorSelectAll=Q0,g.editorSelectContainer=Vd,g.editorSelectDown=v0,g.editorSelectEnd=zd,g.editorSelectHome=L0,g.editorSelectLeft=y0,g.editorSelectLineEnd=P0,g.editorSelectLineHome=N0,g.editorSelectPageDown=W0,g.editorSelectPageUp=q0,g.editorSelectRight=k0,g.editorSelectUp=w0,g.editorSelectWordEnd=T0,g.editorSelectWordLeft=x0,g.editorSetTextColor=jr,g.editorShowFindDialog=HN,g.editorToDocx=vH,g.editorUpdateBlockData=fc,g.editorUpdateCompositionText=Zp,g.editorUpdateEmbedData=o0,g.enablePageScroll=Wm,g.escapeHtmlText=Tm,g.escapeRegExp=Lu,g.escapeSpace=D8,g.exclusiveBlock=J4,g.executeBlockCommand=xg,g.executeEmbedBlockCommand=Ig,g.executeRangeCommand=y2,g.fileToDataUrl=Tr,g.findAfterOffsetNotType=ud,g.findAllText=cd,g.findEventTargetBlock=Im,g.findInsertionById=hg,g.findNextOffset=Pb,g.findPrevOffset=Nb,g.findPrevOffsetNotType=ad,g.findPrevSimpleBlockBeforeChildContainer=Rg,g.findTarget=xr,g.findWordEnd=hd,g.findWordLeft=dd,g.format=xu,g.formatBytes=Xm,g.formatDate=ng,g.fragmentToHtml=Gm,g.fromBase64=Ml,g.fromBase64ToBlob=wu,g.fromBase64ToUint8Array=z8,g.fromDocRange=ho,g.fromNowString=Du,g.genId=P,g.getAllChildBlocks=Gu,g.getAllQuickMenuItems=w1,g.getAllSelectedBlocks=en,g.getAttributesAt=Ji,g.getBlockBackground=sg,g.getBlockByIndex=Sr,g.getBlockCaretRect=Ye,g.getBlockClass=pt,g.getBlockClassByType=Mr,g.getBlockClientRects=co,g.getBlockCommandsWithHook=Fu,g.getBlockContent=st,g.getBlockId=j,g.getBlockIndex=K,g.getBlockKind=Je,g.getBlockMinWidth=vg,g.getBlockNearestRangeFromPoint=Fg,g.getBlockOptions=tA,g.getBlockPath=ao,g.getBlockProperties=wg,g.getBlockRangeFromPoint=Vl,g.getBlockStyles=X8,g.getBlockTextLength=G,g.getBlockTools=Rt,g.getBlockType=it,g.getBoxContent=Ou,g.getBoxId=ag,g.getBoxTypeFromElement=ji,g.getChildBlockCount=Ze,g.getChildBlocks=Mt,g.getChildOffset=mo,g.getColorFromAttributes=sd,g.getComplexBlockClass=xe,g.getContainerBlockPath=wp,g.getContainerBlocks=Cg,g.getContainerBlocksElement=sc,g.getContainerById=Pr,g.getContainerId=V,g.getContainerMinWidth=gd,g.getContainerToolsElement=$b,g.getContainerWidth=Tp,g.getDistanceSquare=An,g.getElementOffset=_i,g.getEmbedType=Ne,g.getExistsBlockTools=Hl,g.getExistsContainerById=kp,g.getFileExt=Iu,g.getFirstChildBlock=Ft,g.getFirstClientRect=Sl,g.getHeadingMenuOptions=A1,g.getHorizontalPadding=du,g.getInsertionContent=Nu,g.getLastChildBlock=Jt,g.getLastClientRect=Vo,g.getListAllNextBrothers=zs,g.getLogger=w,g.getNextBlock=dt,g.getNextValidOffset=tr,g.getNextVisibleBlock=Lr,g.getOffsetInfoAfter=Xi,g.getOffsetInfoBefore=ic,g.getOpAt=ip,g.getOpLength=nd,g.getParentBlock=U,g.getParentBlockExcludeSelf=Fl,g.getParentBox=Ru,g.getParentContainer=z,g.getPrevBlock=bt,g.getPrevValidOffset=go,g.getPrevVisibleBlock=Dr,g.getRangeCommands=b2,g.getRootBlock=_u,g.getScrollContainer=bn,g.getSpecialBlockCommands=Bg,g.getStandardEmbedBlockProperties=P1,g.getTextAfterOffset=Rb,g.getTextBeforeOffset=Ob,g.getTextBlockChild=ql,g.getTextBlockClass=gg,g.getTextBlockContentChildTextLength=$e,g.getTextBlockContentChildType=Hg,g.getTextBlockContentChildren=yn,g.getTextLength=me,g.getTextOpLength=Zu,g.getTextWidth=Ol,g.getToolbar=Vc,g.handleBlockElementUpdated=yg,g.hasAltOnly=P8,g.hasClass=rt,g.hasCtrlOrCmd=Hm,g.hasCtrlOrCmdOnly=N8,g.hideBlock=rg,g.htmlToFragment=Rl,g.i18n=T,g.injectDocToHtmlFragment=as,g.injectStyle=Dm,g.insertEmptyBlock=nA,g.insertEmptyEmbedBlock=Hu,g.insertText=po,g.intersectionCommands=zy,g.isBackspace=zm,g.isBlock=Jo,g.isBox=Mu,g.isCJK=$m,g.isChildContainer=Ke,g.isChildNode=wt,g.isCollapsedRange=Ab,g.isComplexBlockPosition=zu,g.isComplexKindBlock=at,g.isContainer=vn,g.isContainerSelectedAllChildBlocks=G0,g.isControlEvent=Go,g.isDelete=_8,g.isDraggingFiles=Pl,g.isElementVisible=gu,g.isEmbedBlock=Te,g.isEmptyContainer=pd,g.isEmptyDoc=tc,g.isEmptyTextBlock=Tt,g.isEmptyTextBlockWithoutCompositionText=Gs,g.isEnterOnly=jm,g.isEscape=yu,g.isFirefox=bu,g.isFirstChildBlockInComplexBlock=LA,g.isHighSurrogate=B8,g.isInBlock=Pu,g.isInBlockTools=zi,g.isLetter=Pm,g.isLowSurrogate=uu,g.isMatchShortcut=jn,g.isMoveForward=R8,g.isNavigationEvent=M8,g.isNavigationKey=Fm,g.isNodeRemoved=Bm,g.isNumber=Nm,g.isPrintableKey=vu,g.isRootBlock=Wn,g.isRootContainer=Ct,g.isSafari=_m,g.isSameDay=Su,g.isShiftEnter=$8,g.isShiftTab=H8,g.isShortcutEvent=O8,g.isSimpleBlock=K8,g.isSimpleBlockPosition=uo,g.isSimplePos=pp,g.isSimpleRange=ec,g.isSpace=Ll,g.isTab=F8,g.isTextBlockContentBoxChild=Pe,g.isTextBlockContentChild=qi,g.isTextBlockContentInsertionChild=Un,g.isTextBlockContentTextChild=Wi,g.isTextKindBlock=_,g.isTextKindBlockType=Ui,g.isToday=tg,g.isValidOffset=le,g.isVisibleBlock=_l,g.isYesterday=eg,g.loadJs=Em,g.loadJsPromise=qo,g.lockers=Ge,g.mergeCommands=Uc,g.mergeDocs=rr,g.mergeOps=td,g.mergeText=hb,g.multiSplitText=Vg,g.parseShortcut=Um,g.patchNode=Hi,g.pointInRect=Wo,g.rangeAddAttribute=Yi,g.rangeGetTextColor=dp,g.rangeRemoveAttribute=Nr,g.rangeSetTextColor=cp,g.rangeTransformText=sp,g.registerDragDrop=Cu,g.removeAttribute=id,g.removeClass=H,g.removeLastBr=cb,g.removePlaceholderFromBlock=f4,g.removeStyle=Sm,g.replaceAll=Y8,g.replaceAllCaseInsensitive=J8,g.replaceAllText=mp,g.replaceText=Kl,g.requestDownload=$l,g.resetListStart=Vs,g.scrollable=Ym,g.selectFile=Qo,g.selectedBlockToDoc=gc,g.selectionToDoc=cs,g.setAttributes=fu,g.setClipboardData=Nl,g.setClipboardDataByEvent=W8,g.setColorToAttributes=ap,g.setDataset=hu,g.setDefaultCursor=Fi,g.setStyles=mu,g.shareDBCommentToDocObject=fh,g.shareDBDocCommentToComment=i5,g.shortcutToDisplayText=j8,g.showBlock=ig,g.showDocVersions=BH,g.splitText=ve,g.splitToThree=Gt,g.stringToDataUrl=Bu,g.stringToObjectUrl=Eu,g.subText=qg,g.textNodeOffsetFromPoint=wm,g.toBase64URL=Zo,g.toPlainText=vt,g.toPlainTextKeepLength=ld,g.trimChar=Au,g.unexclusiveBlock=K4,g.unicodeLength=E8,g.unicodeSubstr=I8,g.updateBlockSelection=bg,g.updateOpAttributes=fp,g.updateTextBlockContent=Mb,g.updateUrl=ku,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
691
|
+
</svg>`,{t:Rf}=T;class U${constructor(t){h(this,"goBackButton");h(this,"playButton");h(this,"revertButton");this.options=t;const e=b("button",["dialog-text-button"],null),o=b("span",["dialog-button-icon"],e);o.innerHTML=z$,b("span",["dialog-button-text"],e,Rf("version.goBack"));const r=b("button",["dialog-version-button"],null,Rf("version.play")),i=b("button",["dialog-version-button"],null,Rf("version.revertVersion"));this.goBackButton=e,this.playButton=r,this.revertButton=i,this.bindEvent()}bindEvent(){const{onBack:t,onPlay:e,onRevert:o}=this.options;this.playButton.onclick=e,this.goBackButton.onclick=t,this.revertButton.onclick=o}disabledButton(){}render(t,e=!1){e||t.append(this.goBackButton,this.playButton,this.revertButton)}destroy(){this.playButton.onclick=null,this.goBackButton.onclick=null,this.revertButton.onclick=null}}const be=w("split-text-actions");function O6(n){return n.length>2?!1:n.length===1?n[0].insert!==void 0:(u(be,n.length===2,`invalid text actions: ${JSON.stringify(n)}`),n[0].retain===void 0?!1:n[1].insert!==void 0)}function N6(n){return n.length>2?!1:n.length===1?n[0].delete!==void 0:(u(be,n.length===2,`invalid text actions: ${JSON.stringify(n)}`),n[0].retain===void 0?!1:n[1].delete!==void 0)}function P6(n){return n.length>2?!1:n.length===1?n[0].insert===void 0&&n[0].delete===void 0&&n[0].attributes!==void 0:(u(be,n.length===2,`invalid text actions: ${JSON.stringify(n)}`),n[0].retain===void 0?!1:n[1].attributes!==void 0)}function V$(n){const t=[],e=Q.default(n);if(e.length===0)return[];if(e.length===1)return[n];if(e.length===2&&(N6(n)||O6(n)||P6(n)))return[n];const o=(i,s)=>i>0?[{retain:i},s]:[s];let r=0;for(;e.length>0;){const i=e[0];if(i.retain!==void 0&&i.attributes===void 0){u(be,i.retain>0,`invalid text op: ${JSON.stringify(i)}`),u(be,e.length>1,`invalid text op: ${JSON.stringify(i)}`);const s=e[1];u(be,s.delete||s.insert!==void 0||s.attributes!==void 0,`invalid next text op: ${JSON.stringify(s)}`),r+=i.retain,t.push(o(r,s)),s.delete!==void 0?r-=s.delete:s.insert!==void 0?r+=s.insert.length:(u(be,s.attributes!==void 0,`invalid next text op: ${JSON.stringify(s)}`),u(be,s.retain!==void 0,`invalid next text op: ${JSON.stringify(s)}`),r+=s.retain),e.splice(0,2)}else u(be,i.delete||i.insert!==void 0||i.attributes!==void 0,`invalid next text op: ${JSON.stringify(i)}`),t.push(o(r,i)),e.shift(),i.retain!==void 0&&(u(be,i.attributes!==void 0,`invalid next text op: ${JSON.stringify(i)}`),r+=i.retain),i.insert&&(r+=i.insert.length)}return t}function $6(n){if(u(be,n.length===1||n.length===2,`not a single action op: ${JSON.stringify(n)}`),n.length===1)return 0;const t=n[0].retain;return u(be,typeof t=="number"&&t>0,`invalid retain: ${JSON.stringify(n)}`),t}let _6=0;function q$(n,t,e){const o=_6;_6+=1;const r=vt(n);return{insert:" ",attributes:{box:!0,id:P(),type:"history-deleted-box",user:e,created:Date.now(),text:r,deletedOffset:t,deletedOrder:o}}}function W$(n,t,e){const o=$6(t),r=t.length===1?t[0].delete:t[1].delete;u(be,typeof r=="number",`not a delete op: ${JSON.stringify(t)}`);const{left:i,middle:s,right:l}=Gt(n,o,r),c=q$(s,o,e);return[...i,c,...l]}function G$(n,t,e){const o=$6(t),r=t.length===1?t[0].insert:t[1].insert;u(be,typeof r=="string",`invalid insert op: ${JSON.stringify(t)}`);const i=t.length===1?t[0].attributes:t[1].attributes,l=Jl([{insert:r,attributes:i}],"insertedBy",e);return po(n,o,l,null)}function Z$(n,t,e){const o=V$(t).reverse();let r=n;for(const i of o)N6(i)?r=W$(r,i,e):O6(i)?r=G$(r,i,e):(u(be,P6(i),`unknown op: ${JSON.stringify(i)}`),r=ce.apply(r,i));return r}const Q$=w("history-update-block-text");function F6(n){const t=[],e=[];let o=0;return n.forEach(r=>{var i;if((i=r.attributes)!=null&&i.box){const s=r.attributes;if(s.type==="history-deleted-box"){t.push({boxData:s,offset:o});return}}e.push(r),o+=nd(r)}),t.sort((r,i)=>i.offset-r.offset),{deletedBoxes:t,newText:e}}function Y$(n,t,e){let o=n;return t.forEach(r=>{const i=ce.transformCursor(r.offset,e,!1);o=po(o,i,[{insert:" ",attributes:r.boxData}],null)}),o}function J$(n){n.sort((t,e)=>t.boxData.deletedOffset!==e.boxData.deletedOffset?t.boxData.deletedOffset-e.boxData.deletedOffset:t.boxData.deletedOrder-e.boxData.deletedOrder)}function K$(n){if(n.length<=1)return n;const t=n[0].offset;n.forEach(e=>{u(Q$,e.offset===t,`invalid boxes group, ${JSON.stringify(n)}`)}),J$(n);for(let e=n.length-1;e>=1;e--){const o=n[e],r=n[e-1];o.boxData.user.userId===r.boxData.user.userId&&(r.boxData.text+=o.boxData.text,n.splice(e,1))}return n}function X$(n){let{newText:t,deletedBoxes:e}=F6(n);const o=new Map;return e.forEach(i=>{let s=o.get(i.offset);s||(s=[],o.set(i.offset,s)),s.push(i),s.sort((l,c)=>l.boxData.deletedOffset-c.boxData.deletedOffset)}),Array.from(o.values()).sort((i,s)=>s[0].offset-i[0].offset).forEach(i=>{const s=i[0].offset;K$(i).reverse().forEach(l=>{t=po(t,s,[{insert:" ",attributes:l.boxData}],null)})}),t}function t_(n,t,e){let{newText:o,deletedBoxes:r}=F6(n);return o=Z$(o,t,e),o=Y$(o,r,t),o=X$(o),o}const On=w("history-doc");function Nn(n){u(On,!1,"no local actions for history doc")}class e_ extends Pi{constructor(e,o){super();h(this,"doc");h(this,"editor");this.doc=Q.default(e),this.editor=o}beginBatchUpdate(){return 0}endBatchUpdate(){return 0}toJSON(){return Q.default(this.doc)}getContainerBlocks(e){return this.doc.blocks[e]}getBlockData(e,o){const r=this.getContainerBlocks(e);u(On,r,`no container data: ${e}`);const i=r[o];return u(On,i,`no block data: ${o}`),i}localUpdateBlockText(){Nn()}localUpdateBlockData(){Nn()}localInsertBlock(){Nn()}localDeleteBlock(){Nn()}localInsertChildContainer(){Nn()}localDeleteChildContainers(){Nn()}uploadResource(){Nn()}async addResources(e){Nn()}getServerMeta(){var e,o,r;return(r=(o=(e=this.editor.doc.externalDoc).getServerMeta)==null?void 0:o.call(e))!=null?r:{}}buildResourceUrl(e){return this.editor.doc.externalDoc.buildResourceUrl(e)}request(){Nn()}broadcastMessage(){Nn()}getUser(){return{permission:"w",userId:"-",displayName:"-",avatarUrl:"-",rainbowIndex:0}}getRemoteUsers(){return new vc}destroy(){this.clearCallbacks()}transformBlockIndex(e,o,r){const i=this.doc.blocks[e];u(On,i,`no container blocks: ${e}`);let s=0;for(let l=0;l<i.length;l++)if(!i[l].deletedBy){if(s===o)return l;s++}return r&&u(On,!1,`invalid block index: ${o}, blocks: ${JSON.stringify(i)}`),u(On,s===o,`invalid block index: ${o}, blocks: ${JSON.stringify(i)}`),i.length}onDeleteBlock(e,o,r){const i=this.transformBlockIndex(e,o,!0),l=this.doc.blocks[e][i];u(On,!l.deleted,`block has already deleted: ${e}/${o}`),l.deletedBy=r,this.callbacks.forEach(c=>{var a;return(a=c.onUpdateBlockData)==null?void 0:a.call(c,e,i,{insert:{},delete:[]},!0)})}onInsertBlock(e,o,r,i){const s=this.transformBlockIndex(e,o,!1),l=this.doc.blocks[e],c=Q.default(r);c.insertedBy=i,l.splice(s,0,c),this.callbacks.forEach(a=>{var d;return(d=a.onInsertBlock)==null?void 0:d.call(a,e,s,c,!0)})}onUpdateBlockText(e,o,r,i){const s=this.transformBlockIndex(e,o,!0),c=this.doc.blocks[e][s];u(On,!c.deleted,`block has already deleted: ${e}/${o}`);const a=c.text;u(On,a,`no text for block: ${JSON.stringify(c)}`);const d=t_(a,r,i);c.text=d,this.callbacks.forEach(f=>{var m;return(m=f.onUpdateBlockText)==null?void 0:m.call(f,e,o,r,!0)})}onUpdateBlockData(e,o,r,i){const s=this.transformBlockIndex(e,o,!0),l=this.doc.blocks[e],c=l[s];u(On,!c.deleted,`block has already deleted: ${e}/${o}`);const a=Q.default(c);a.updatedBy=i,r.delete.forEach(d=>delete a[d]),Object.entries(r.insert).forEach(([d,f])=>{a[d]=f}),l[s]=a,this.callbacks.forEach(d=>{var f;return(f=d.onUpdateBlockData)==null?void 0:f.call(d,e,s,r,!0)})}onCreateContainer(e,o,r){this.doc.blocks[e]=Q.default(o),this.callbacks.forEach(i=>{var s;return(s=i.onInsertChildContainer)==null?void 0:s.call(i,e,o,!0)})}}const{t:H6}=T;function wi(n,t){return t==="insert"?H6("version.insert",{name:n.displayName}):H6("version.delete",{name:n.displayName})}function br(n,t){const{userId:e}=t;return["flag","selection"].reduce((r,i)=>{const s=n.doc.getRemoteUsers().getFixedUserColor(e,i);return r[i]=s,r},{})}class n_{renderText(t,e,o){if(!o.box&&o.insertedBy){const r=o.insertedBy,{flag:i,selection:s}=br(t,o.insertedBy);return{classes:["history-inserted-text"],attributes:{"history-inserted-by":r.displayName,"data-op-description":wi(r,"insert")},styles:{[vi]:i,[yi]:s}}}return{}}renderBlock(t,e,o){if(o.deletedBy){const r=o.deletedBy,{flag:i,selection:s}=br(t,r);return{classes:["history-deleted-block"],attributes:{"history-deleted-by":r.displayName,"data-op-description":wi(r,"delete")},styles:{[vi]:i,[yi]:s}}}if(o.insertedBy){const r=o.insertedBy,{flag:i,selection:s}=br(t,r);return{classes:["history-inserted-block"],attributes:{"history-inserted-by":r.displayName,"data-op-description":wi(r,"insert")},styles:{[vi]:i,[yi]:s}}}return{}}updateBlock(t,e,o,r){if(r.deletedBy){const i=r.deletedBy,{flag:s,selection:l}=br(t,i);M(o,"history-deleted-block"),fu(o,{"history-inserted-by":i.displayName,"data-op-description":wi(i,"delete")}),mu(o,{[vi]:s,[yi]:l});return}if(r.insertedBy){const i=r.insertedBy,{flag:s,selection:l}=br(t,i);M(o,"history-inserted-block"),fu(o,{"history-inserted-by":i.displayName,"data-op-description":wi(i,"insert")}),mu(o,{[vi]:s,[yi]:l})}}}const j6=w("history-deleted-box");function o_(n,t,e,o){const r=o;u(j6,r.text,`no text for text box data: ${JSON.stringify(o)}`),u(j6,typeof r.text=="string",`invalid text type for text box data: ${JSON.stringify(o)}`);const i=b("span",["history-deleted-box"],e,r.text),s=r.user,{flag:l,selection:c}=br(n,s);i.setAttribute("history-deleted-by",s.displayName),i.setAttribute("data-op-description",wi(s,"delete")),i.style.setProperty(vi,l),i.style.setProperty(yi,c)}function r_(n,t,e,o){return t.text}const i_={boxType:"history-deleted-box",updateBoxContent:o_,convertTo:r_},Ee=w("version-dialog");class s_{constructor(t,e){h(this,"editor");h(this,"dialog",null);h(this,"oldViewer",null);h(this,"versionOptions");h(this,"versionList",null);h(this,"actionButtons",null);h(this,"provider");h(this,"components");h(this,"handleClose",()=>{var t;(t=this.dialog)==null||t.hide()});h(this,"handlePlay",()=>{var e;u(Ee,this.versionList,"The versionList did not render");const t=(e=this.versionList)==null?void 0:e.activeVersion;u(Ee,t,`The version: ${t} is invalid`),this.viewVersion(t,{play:!0,speed:150})});h(this,"handleRevert",async()=>{var e,o;u(Ee,this.versionList,"The versionList did not render");const t=(e=this.versionList)==null?void 0:e.activeVersion;u(Ee,t,`The version: ${t} is invalid`),await this.versionHelper.revertVersion(t.version),(o=this.dialog)==null||o.hide()});h(this,"handleSelectVersion",t=>{u(Ee,t,`The version: ${t} is invalid`),this.viewVersion(t)});h(this,"viewVersion",async(t,e={play:!1,speed:1e3})=>{var p,A,k;this.oldViewer&&(this.oldViewer.destroy(),this.oldViewer=null),u(Ee,this.versionList,"The versionList did not render"),u(Ee,this.actionButtons,"The actionButtons did not render");const o=t.type==="minor"?this.versionList.beforeVersion:this.versionList.beforeMajorVersion,r=o?o.version:0,i=this.versionList.isSelectedFirstVersion,s=this.versionList.isSelectedLastVersion;this.actionButtons.revertButton.disabled=i,this.actionButtons.playButton.disabled=i;let l=(p=this.versionOptions)==null?void 0:p.hideOps;if((A=this.versionOptions)!=null&&A.onWillChangeVersion){const v=this.versionOptions.onWillChangeVersion(this.editor,t,i,s);v!=null&&v.hideOps&&(l=!0)}let c,a;if(l)c=await this.versionHelper.getVersion(t.version),a=[];else{const v=await this.versionHelper.getHistoryData(t.version,r);c=v.doc,a=v.historyData}const{editorElement:d}=this.components;d.innerHTML="";const f=new e_(c,this.editor),m=this.provider.createHistoryEditor(d,f);m.editorBlockRenders.registerRender(new n_),m.editorBoxes.registerBoxClass(i_),M(m.rootElement,M6.HISTORY);try{await j$(f,this.versionHelper,a,e)}finally{this.oldViewer=m}(k=this.versionOptions)!=null&&k.onVersionChanged&&this.versionOptions.onVersionChanged(this.editor,m,t,i,s)});h(this,"setShowOps",t=>{var e;if(this.versionOptions){this.versionOptions.hideOps=!t;const o=(e=this.versionList)==null?void 0:e.activeVersion;u(Ee,o,`The version: ${o} is invalid`),this.viewVersion(o)}});this.editor=t,this.provider=e;const o=b("div",["version-dialog"],null),r=b("div",["version-dialog-note-viewer"],o),i=b("div",["version-dialog-action-container"],r),s=b("div",["version-dialog-editor"],r),l=b("div",["version-dialog-versions-list"],o);this.components={root:o,editorElement:s,actionContainer:i,versionsListContainer:l}}get versionHelper(){u(Ee,this.editor.doc.getVersionHelper,"Can not get getVersionHelper from doc");const t=this.editor.doc.getVersionHelper();return u(Ee,t,"current doc does not support version"),t}renderContent(t){var s,l;const{actionContainer:e,versionsListContainer:o}=this.components;e.innerHTML="";const r=new U$({onBack:this.handleClose,onPlay:this.handlePlay,onRevert:this.handleRevert});r.render(e,(s=this.versionOptions)==null?void 0:s.hideActions),this.actionButtons=r,o.innerHTML="";const i=new _$({versions:t,useCreatedBy:(l=this.versionOptions)==null?void 0:l.useCreatedBy,onSelectVersion:this.handleSelectVersion,getMarkColor:c=>{const{flag:a}=br(this.editor,c);return a}});i.render(o),this.versionList=i}initViewVersion(){var t;if((t=this.versionOptions)!=null&&t.initSelectedVersion){u(Ee,this.versionList,"The versionList did not render");const{initSelectedVersion:e}=this.versionOptions,o=this.versionList.selectVersionByVersionNum(e);u(Ee,o,`The version: ${o} is invalid`),this.viewVersion(o)}else{u(Ee,this.versionList,"The versionList did not render");const e=this.versionList.activeVersion;u(Ee,e,`The version: ${e} is invalid`),this.viewVersion(e)}}async show(t){this.versionOptions={...this.versionOptions,...t};const e=await this.versionHelper.getVersions();if(this.versionOptions.hideNonVersionedOps&&e.length&&e[0].version===-1&&e.shift(),this.versionOptions.onVersionsLoaded&&this.versionOptions.onVersionsLoaded(this.editor,e),this.renderContent(e),this.initViewVersion(),!this.dialog){const{root:o}=this.components;this.dialog=new $$(o)}this.dialog.show(t.container)}destroy(){var t,e,o;(t=this.dialog)==null||t.destroy(),(e=this.versionList)==null||e.destroy(),(o=this.actionButtons)==null||o.destroy()}}function l_(n,t,e){const o=n.addCustom("version-dialog",()=>new s_(n,t));return o.show(e),{setShowOps:o.setShowOps}}const GV="",c_=w("heading-collapse");function Of(n){var e;const t=Number.parseInt((e=n.getAttribute("data-style-heading"))!=null?e:"",10);return u(c_,t,"not a heading block"),t}function Ve(n){return!!n.getAttribute("data-style-heading")}function a_(n){return!rt(n,"heading-collapsed")}function vr(n){return rt(n,"heading-collapsed")}function z6(n){if(bt(n))return!1;const e=z(n);return Ct(e)}const u_=w("heading-collapse");function Nf(n){u(u_,Ve(n),"not a heading block");const t=[],e=Of(n);let o=dt(n);for(;o&&!(Ve(o)&&Of(o)<=e);)t.push(o),o=dt(o);return t}function U6(n,t){if(!Wn(t))return;n.selection.selectBlock(t,0),Nf(t).forEach(o=>{rg(o)}),M(t,"heading-collapsed")}function Bi(n,t){Nf(t).forEach(o=>{ig(o)}),H(t,"heading-collapsed")}function d_(n,t){a_(t)?U6(n,t):Bi(n,t)}const h_=[Ch,Ah,bh,vh,yh,kh,wh,Bh];function f_(n){const t=b("button",["heading-collapse-button"],null);return t.setAttribute(`data-editor-tooltip-${n.clientId}`,"Collapse / Expand"),t.innerHTML=ph,t}function V6(n){return ga(n).querySelector("button.heading-collapse-button")}function q6(n,t){V6(t)||z6(t)||!Wn(t)||G1(t,f_(n),-1)}function m_(n){var t;(t=V6(n))==null||t.remove()}function W6(n,t){ga(t).querySelector("button.heading-collapse-button")||q6(n,t)}function g_(n){const t=Of(n),e=b("button",["heading-marker"],null);return e.innerHTML=h_[t-1],e}function G6(n){return ga(n).querySelector("button.heading-marker")}function Pf(n){G6(n)||z6(n)||!Wn(n)||G1(n,g_(n),1)}function Z6(n){const t=G6(n);t==null||t.remove()}function Q6(n){Z6(n),Ve(n)&&Pf(n)}class p_{handleDrop(t,e,o,r){if(Pl(e)||!Ve(e)||!vr(e))return;const i=Nf(e);i.unshift(e);const s=i.reverse();let l=null;return t.doc.beginBatchUpdate(),s.forEach((c,a,d)=>{const f=t.getBlockData(c),m=bo(t.editorBlocks,t.doc.toJSON(),f),p=t.insertDocAt(o,r,m)[0];a===d.length-1&&(l=p)}),t.doc.endBatchUpdate(),t.doc.beginBatchUpdate(),s.forEach(c=>{t.deleteBlock(c)}),t.doc.endBatchUpdate(),l&&U6(t,l),!0}}const C_=w("heading-collapse");class A_{constructor(t){h(this,"handleLoad",()=>{this.showCollapseButtons()});h(this,"handleHoverBlock",(t,e)=>{e&&(H(e,"hovering-heading"),Ve(e)&&Ct(z(e))&&(Pf(e),vr(e)||m_(e))),t&&Ve(t)&&Ct(z(t))&&(M(t,"hovering-heading"),Z6(t),q6(this.editor,t))});h(this,"handleClick",(t,e)=>{const o=xr(e,"button.heading-collapse-button");if(!o)return;const r=U(o);!r||(u(C_,Ve(r),"not a heading block"),d_(this.editor,r),W6(this.editor,r))});this.editor=t,t.addListener("load",this.handleLoad),t.addListener("click",this.handleClick),$t.get(t).addListener("change",this.handleHoverBlock),this.showCollapseButtons(),setTimeout(()=>{ol.get(t).addHandler(new p_)})}showCollapseButtons(){const t=Mt(this.editor.rootContainer).filter(Ve);t.length!==0&&(t[0]===Ft(this.editor.rootContainer)&&t.splice(0,1),t.forEach(Pf))}destroy(){this.editor.removeListener("load",this.handleLoad),this.editor.removeListener("click",this.handleClick)}}function La(n){const t=n.selection.range;if(t.isCollapsed()||t.start.blockId===t.end.blockId)return;const e=n.getBlockById(t.start.blockId),o=n.getBlockById(t.end.blockId);vr(e)&&Bi(n,e),vr(o)&&Bi(n,o)}function b_(n){La(n);const t=n.getFocusedBlock();!Ve(t)||vr(t)&&Bi(n,t)}function v_(n){La(n);const t=n.getFocusedBlock();if(!Ve(t))return;const e=n.selection.range.focus;!e.isSimple()||e.offset===G(n,t)&&vr(t)&&Bi(n,t)}function y_(n){La(n);const t=n.getFocusedBlock();if(!Ve(t))return;const e=n.selection.range.focus;!e.isSimple()||e.offset===0&&vr(t)&&Bi(n,t)}class k_{handleBeforeKeyDown(t,e){return vu(e.key)&&La(t),e.key==="Enter"?(b_(t),!1):e.key==="Delete"?(v_(t),!1):(e.key==="Backspace"&&y_(t),!1)}}class w_{constructor(t){this.editor=t}onInsertBlock(t,e,o,r){this.updateBlockIfNeeded(o.id)}onUpdateBlockData(t,e,o,r){const i=this.editor.doc.getBlockData(t,e);this.updateBlockIfNeeded(i.id,o)}updateBlockIfNeeded(t,e){setTimeout(()=>{const o=this.editor.findBlockById(t);if(!!o){if(!Ve(o)){e&&e.delete.includes("heading")&&Q6(o);return}rt(o,"hovering-heading")&&W6(this.editor,o),Q6(o)}},100)}}function B_(n){return!!n.heading}function Y6(n){var e;const t=n.heading;return(e=Number.parseInt(`${t}`,10))!=null?e:1}function J6(n,t){var e;return{parentNode:t,children:[],text:vt((e=n.text)!=null?e:[]),level:Y6(n),block:n}}class dl{constructor(){h(this,"nodes",[])}appendBlock(t){const e=this.findParent(Y6(t),this.nodes);e?e.children.push(J6(t,e)):this.nodes.push(J6(t,null))}findParent(t,e){const o=e[e.length-1];if(!o||t<=1)return null;if(o.level===t-1)return o;const r=this.findParent(t,o.children);return r||(o.level<t?o:null)}static buildToc(t){const e=new dl,o=t.blocks.root;for(let r=0;r<o.length;r++){const i=o[r];B_(i)&&e.appendBlock(i)}return e}}class yr extends Yt.TypedEmitter{constructor(e){super();h(this,"toc",new dl);h(this,"updateToc",ee.default(()=>{this.updateTocNow()},500));this.editor=e,e.doc.registerCallback(this),this.updateToc()}destroy(){this.editor.doc.unregisterCallback(this)}isHeadingBlock(e){return!!e.heading}onInsertBlock(e,o,r,i){e==="root"&&this.isHeadingBlock(r)&&this.updateToc()}onDeleteBlock(e,o,r){e==="root"&&this.updateToc()}onUpdateBlockText(e,o,r,i){if(e!=="root")return;const s=this.editor.doc.getBlockData(e,o);this.isHeadingBlock(s)&&this.updateToc()}onUpdateBlockData(e,o,r,i){if(e!=="root")return;const s=this.editor.doc.getBlockData(e,o);this.isHeadingBlock(s)&&this.updateToc()}static register(e){return e.addCustom("editor-toc",()=>new yr(e))}static get(e){return e.getCustom("editor-toc")}updateTocNow(){this.toc=dl.buildToc(this.editor.doc.toJSON()),this.emit("change",this.editor,this.toc)}}const ZV="";function E_(n){return n.nodes.length===0?!0:n.nodes.length>1?!1:n.nodes[0].children.length===0}function $f(n,t){t.forEach(e=>{const o=b("div",["toc-node"],n),r=b("div",["toc-title"],o);if(b("span",["toc-text"],r,e.text).setAttribute("data-block-id",e.block.id),e.children.length>0){const s=b("div",["toc-children"],o);$f(s,e.children)}})}function I_(n,t){const e=xr(t,".toc-text");if(!e)return;const o=e.getAttribute("data-block-id");if(!o)return;const r=n.findBlockById(o);!r||(t.preventDefault(),t.stopPropagation(),n.selection.selectBlock(r,0))}function K6(n,t,e){if(H(t,"loading"),t.innerHTML="",E_(e)){b("div",["toc-empty-message"],t,"No toc");return}e.nodes.length===1?$f(t,e.nodes[0].children):$f(t,e.nodes),Jd(n,"toc-click-handler",()=>{n.addListener("click",I_)})}class x_{constructor(t){h(this,"handleUpdateToc",(t,e)=>{Array.from(t.rootContainer.querySelectorAll('.embed-block[data-type="editor-block"][data-embed-type="toc"]')).forEach(r=>{const i=r.querySelector(".editor-toc-container");i&&K6(t,i,e)})});this.editor=t,yr.register(t).addListener("change",this.handleUpdateToc)}destroy(){yr.register(this.editor).removeListener("change",this.handleUpdateToc)}get toc(){return yr.register(this.editor).toc}}function T_(n,t){const e=b("div",["editor-toc-container"],t),r=n.addCustom("init-editor-toc",()=>new x_(n)).toc;r.nodes.length===0?M(e,"loading"):K6(n,e,r)}function S_(n,t,e,o){return o==="markdown"?"[toc]":""}function D_(n,t,e){const{data:o}=e;if(!o||o.embedType!=="toc"||!_(n,t))return null;const r={};return{blockData:{id:P(),type:"embed",embedType:"toc",embedData:r}}}const X6={embedType:"toc",createEmbedContent:T_,convertTo:S_,convertFrom:D_};function L_(n){return!!n.getAttribute("data-style-heading")}function _f(n,t){return L_(t)&&G(n,t)>0}function M_(n){const t=bn(n.rootElement);let e=0,o=0,r=0;if(t===document.documentElement){const i=n.rootContainer.getBoundingClientRect();e=i.left+i.width/2,o=10,r=t.offsetHeight}else{const i=t.getBoundingClientRect();e=i.left+i.width/2,o=i.top+10,r=i.bottom}for(;o<r;){const i=document.elementsFromPoint(e,o);for(let s=0;s<i.length;s++){const l=U(i[s]);if(l&&n.rootContainer.contains(l))return l}o+=10}return null}function Ff(n,t){let e=t;for(;e&&!_f(n,e);)e=dt(e);return e}function t9(n){if(bt(n))return!1;const e=z(n);return Ct(e)}function Ma(n,t){let e=t;for(;e&&!_f(n,e);)e=bt(e),e&&t9(e)&&(e=null);return e}const R_=.3;class O_ extends Yt.TypedEmitter{constructor(e){super();h(this,"scrollContainer");h(this,"scrollEventTarget");h(this,"scrollStatus",{curHeadingBlock:null,previousHeadingBlock:null,nextHeadingBlock:null});h(this,"handleScroll",ee.default(()=>{const e={curHeadingBlock:null,previousHeadingBlock:null,nextHeadingBlock:null};let o=M_(this.editor);if(o&&(o=_u(o)),!o||!this.scrollContainer){this.setStatus(e);return}if(t9(o)&&(o=dt(o)),!o){this.setStatus(e);return}if(_f(this.editor,o)){e.curHeadingBlock=o,e.previousHeadingBlock=Ma(this.editor,o),e.nextHeadingBlock=Ff(this.editor,o),this.setStatus(e);return}const r=this.scrollContainer.getBoundingClientRect(),i=Ff(this.editor,o);if(i){const l=i.getBoundingClientRect();if(l.top>r.top&&l.top<r.top+r.height*R_){e.curHeadingBlock=i,e.previousHeadingBlock=Ma(this.editor,i),e.nextHeadingBlock=Ff(this.editor,i),this.setStatus(e);return}e.nextHeadingBlock=i}const s=Ma(this.editor,o);s&&(e.curHeadingBlock=s,e.previousHeadingBlock=Ma(this.editor,s)),this.setStatus(e)},200));this.editor=e,setTimeout(()=>{this.start()},50)}setStatus(e){this.scrollStatus.previousHeadingBlock===e.previousHeadingBlock&&this.scrollStatus.nextHeadingBlock===e.nextHeadingBlock&&this.scrollStatus.previousHeadingBlock===e.previousHeadingBlock||(this.scrollStatus=e,this.emit("change",this.editor,e))}start(){this.stop(),this.scrollContainer=bn(this.editor.rootElement),this.scrollEventTarget=this.scrollContainer===document.documentElement?document:this.scrollContainer,this.scrollEventTarget.addEventListener("scroll",this.handleScroll),this.handleScroll()}stop(){this.scrollEventTarget&&this.scrollEventTarget.removeEventListener("scroll",this.handleScroll)}destroy(){this.stop(),this.scrollEventTarget=void 0}}class N_{constructor(t,e){h(this,"suggest");h(this,"onShow",(t,e,o,r)=>{const i=this.editor.getBlockByIndex(e,o);if(!Wn(i)){const s=U(z(i));if(s&&it(s)==="code")return!1}return!0});h(this,"onClickItem",(t,e,o)=>{const r=e.data,i={id:P(),type:"mention",box:!0,created:Date.now(),iconUrl:r.avatarUrl,text:r.displayName,mentionId:r.userId},s=this.editor.selection.range;if(!s.isCollapsed()||!s.isSimple())return;const l=s.focus,c=this.editor.getBlockById(l.blockId);this.editor.insertBoxToBlock(c,l.offset,i)});h(this,"queryItems",async(t,e)=>(await this.options.queryUsers(this.editor,e)).map(i=>({id:i.userId,name:i.displayName,icon:`<img src="${i.avatarUrl}" class="mention-user-avatar">`,element:i.element,data:i,subText:i.email})));this.editor=t,this.options=e,this.suggest=new Mh(t,{id:"editor-mention",trigger:["@"],autoDeleteTrigger:!0,showLoading:!0,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems})}destroy(){}}w("mathjax-box");function P_(n,t,e,o){const r=o,i=b("a",["mention-container"],e);b("span",["mention-name"],i,`@${r.text}`),i.setAttribute("data-mention-id",r.mentionId)}function $_(n,t,e){}function __(n,t,e,o){return`@${t.text}`}const Hf={boxType:"mention",updateBoxContent:P_,handleClickBox:$_,convertTo:__};function F_(n){const t=b("div",["mention-button-wrap"],null),e=Bo("mention-button",T.t("list.mention.tooltip"),iB,[],n.clientId);return t.appendChild(e),t}class H_{constructor(t){h(this,"mentionButton");h(this,"handleHoveringBlock",t=>{var e;!this.editor.isWritable()||(t&&this.shouldBlockShowMention(t)?Rt(t).appendChild(this.mentionButton):(e=this.mentionButton)==null||e.remove())});h(this,"handleMouseDown",(t,e)=>{e.preventDefault(),e.stopPropagation();const o=U(this.mentionButton);if(!o||!_(t,o))return;const r=t.selection.range.focus;if(!r.isSimple())return;let i;t.selection.focusedBlock!==o?i=G(t,o):i=r.offset,setTimeout(()=>{const s=t.insertTextToBlock(o,i,"@");i+=1;const l=vt(ve(s,i).left);this.editor.selection.selectBlock(o,i),this.editor.focus(),t.getCustom("mention").suggest.popup(o,i,l,"@")})});h(this,"destroy",()=>{$t.get(this.editor).removeListener("change",this.handleHoveringBlock)});this.editor=t,this.mentionButton=F_(t),$t.get(this.editor).addListener("change",this.handleHoveringBlock),t.domEvents.addEventListener(this.mentionButton,"mousedown",this.handleMouseDown)}shouldBlockShowMention(t){if(!_(this.editor,t)||!ut(t))return!1;const e=ze(t);return!(e==="ordered"||e==="unordered")}}const QV="",j_={templates:{title:"\u9009\u62E9\u6A21\u677F\uFF0C\u5FEB\u901F\u521B\u5EFA",create:"\u65B0\u5EFA\u6A21\u677F",choose:"\u5168\u90E8\u6A21\u677F",customizedMark:"\u81EA\u5B9A\u4E49"}},z_={templates:{title:"Choose a template",create:"New template",choose:"All templates",customizedMark:"Custom"}};T.mergeLang({"zh-CN":j_,"en-US":z_});const YV="",U_="data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIHZpZXdCb3g9IjAgMCAxMjAgMTIwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9z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3NyAyMTguMzA5IDgxLjEyNzcgMjE2LjY3QzgxLjEyNzcgMjE1LjAzMSA3OS43OTg5IDIxMy43MDIgNzguMTU5NiAyMTMuNzAySDcyLjIyMzVaIiBmaWxsPSIjRjdEMDdGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAuMDMxOCAxODkuOTU4Qzg4LjM5MjYgMTg5Ljk1OCA4Ny4wNjM3IDE5MS4yODYgODcuMDYzNyAxOTIuOTI2Qzg3LjA2MzcgMTk0LjU2NSA4OC4zOTI2IDE5NS44OTQgOTAuMDMxOCAxOTUuODk0SDk1Ljk2OEM5Ny42MDcyIDE5NS44OTQgOTguOTM2MSAxOTQuNTY1IDk4LjkzNjEgMTkyLjkyNkM5OC45MzYxIDE5MS4yODYgOTcuNjA3MiAxODkuOTU4IDk1Ljk2OCAxODkuOTU4SDkwLjAzMThaTTkwLjAzMTkgMjEzLjcwMkM4OC4zOTI3IDIxMy43MDIgODcuMDYzOCAyMTUuMDMxIDg3LjA2MzggMjE2LjY3Qzg3LjA2MzggMjE4LjMwOSA4OC4zOTI3IDIxOS42MzggOTAuMDMxOSAyMTkuNjM4SDk1Ljk2ODFDOTcuNjA3MyAyMTkuNjM4IDk4LjkzNjIgMjE4LjMwOSA5OC45MzYyIDIxNi42N0M5OC45MzYyIDIxNS4wMzEgOTcuNjA3MyAyMTMuNzAyIDk1Ljk2ODEgMjEzLjcwMkg5MC4wMzE5WiIgZmlsbD0iIzkxRDlCRSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEyNTZfMzcxNjgiPgo8cmVjdCB3aWR0aD0iMzcyIiBoZWlnaHQ9IjI3OSIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",e9=w("templates");function jf(n){const t=n.rootElement.querySelector(":scope .editor-templates");if(!t)return null;const e=t.querySelector(":scope .editor-templates-cards");return u(e9,e,"no card container"),{root:t,cardContainer:e}}function q_(n){const t=jf(n);if(t)return t.cardContainer.innerHTML="",t;const e=b("div",["editor-templates"],n.rootElement);b("div",["editor-templates-title"],e,T.t("templates.title"));const o=b("div",["editor-templates-cards"],e);return{root:e,cardContainer:o}}function n9(n,t,e,o,r){var f;const i=(f=n.options.componentsOptions)==null?void 0:f.templates,s=b("div",["editor-template-card",...o],null),l=b("div",["editor-template-thumb-container"],s),c=b("img",["editor-template-thumb"],l);c.src=t,c.style.display="none",c.onerror=()=>{var p;const m=(p=i==null?void 0:i.placeHolderImageSrc)!=null?p:V_;c.src!==m&&(c.src=m)},c.onload=()=>{c.style.display=""};const a=b("div",["editor-template-name"],s),d=b("span",[],a,e);return i!=null&&i.showTemplateTitleAttr&&d.setAttribute("title",e),s.onclick=()=>r(s),s}function W_(n,t){return t.thumbnailUrl?t.thumbnailUrl:n.doc.buildResourceUrl("thumbnail.png")}function G_(n,t){const e=W_(n,t);return n9(n,e,t.name,[],async()=>{var r,i;const o=(r=n.options.componentsOptions)==null?void 0:r.templates;(i=o==null?void 0:o.onApplyTemplate)==null||i.call(o,n,t)})}function Z_(n,t){return n9(n,t,T.t("templates.choose"),["more"],()=>{var o,r;const e=(o=n.options.componentsOptions)==null?void 0:o.templates;(r=e==null?void 0:e.onChooseTemplate)==null||r.call(e,n)})}function Q_(n,t){var f,m;const e=(f=n.options.componentsOptions)==null?void 0:f.templates;if(!e)return;const r=Jt(n.rootContainer).getBoundingClientRect().width;let i=1;const s=U_,l=jf(n);if(l){if(t!=null&&t.reset){const p=Array.from(l.cardContainer.children),A=l.cardContainer.firstElementChild;if(u(e9,A,"no first card"),rt(A,"new")||rt(A,"more"))return;const k=window.getComputedStyle(A),v=parseFloat(k.marginLeft),x=parseFloat(k.marginRight),E=A.getBoundingClientRect().width+v+x;i=Math.floor(r/E);const R=Math.max(1,i-1-1),$=p.length-1;p.forEach((q,ot)=>{ot>R&&ot<$?q.style.display="none":(ot>=$&&rt(q,"more"),q.style.display="")})}return}const c=e.templates,{cardContainer:a}=q_(n);c.forEach((p,A)=>{const k=G_(n,p);if(A>0&&A>=i&&(k.style.display="none"),a.appendChild(k),A===0){const v=window.getComputedStyle(k),x=parseFloat(v.marginLeft),E=parseFloat(v.marginRight),L=k.getBoundingClientRect().width+x+E;i=Math.floor(r/L)-1}});const d=Z_(n,s);a.appendChild(d),(m=e==null?void 0:e.onTemplateChooserStatusChanged)==null||m.call(e,n,a,"visible")}const o9=ee.default(Q_,50);function Y_(n){var o,r;const t=jf(n);if(!t)return;t.root.remove();const e=(o=n.options.componentsOptions)==null?void 0:o.templates;(r=e==null?void 0:e.onTemplateChooserStatusChanged)==null||r.call(e,n,null,"hide")}function J_(n){const t=n.blocks.root;if(t.length===0)return!0;if(t.length>5)return!1;const e=[...t];e[0].type==="text"&&e[0].heading&&e.splice(0,1);const o=r=>{var i;return r.type!=="text"&&r.type!=="list"?!1:r.text?((i=r.text)==null?void 0:i.length)===0:!0};return e.every(r=>o(r))}function zf(n,t){J_(n.doc.toJSON())?o9(n,t):(o9.cancel(),Y_(n))}const K_=800;class X_{constructor(t){h(this,"longPressTimeout",0);h(this,"handleSelectionChange",()=>{});h(this,"handleLongPress",t=>{const e=t.touches[0],o=Vl(this.editor,e.clientX,e.clientY);!o||console.log(o)});h(this,"handleTouchStart",t=>{t.touches.length===1&&(this.longPressTimeout=window.setTimeout(()=>{this.handleLongPress(t)},K_))});h(this,"handleTouchEnd",t=>{this.longPressTimeout&&(window.clearTimeout(this.longPressTimeout),this.longPressTimeout=0)});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChange),document.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchend",this.handleTouchEnd)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChange),document.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("touchend",this.handleTouchEnd)}}class hl{constructor(t,e){h(this,"_decrypted",!1);this.editor=t,this.blockData=e}get decrypted(){return this._decrypted||this.blockData.owner===this.editor.doc.getUser().userId}setDecrypted(){this._decrypted=!0}destroy(){}static getState(t,e){return t.addCustom(`encrypted-block-${e.id}`,()=>new hl(t,e))}}const JV="",Po=w("encrypted-block");function tF(n,t,e,o,r){const i=r,s=lo(o,"div"),l=hl.getState(n,i);if(l.decrypted)n.createChildContainer(t,s,i.children[0]),M(o,"decrypted");else{M(o,"encrypted");const c=Rt(o),a=b("div",["password-container"],c),d=b("input",[],a);d.type="text",d.onkeydown=f=>{if(f.key==="Enter"){const m=d.value;if(i.password===Er.default(`${i.owner}-${m}`)){l.setDecrypted(),n.reloadBlock(o);const p=qu(n,n.getBlockById(i.id));p&&(n.selection.selectBlock(p,0),n.focus())}}}}return s}function eF(n,t,e,o){const r=document.elementsFromPoint(e,o)[0];if(!r||!t.contains(r)||!n.contains(t)||!vn(r))return null;const i=r;if(n.getBlockData(t).children[0]!==V(i))return null;const l=Bt(t,V(i));return new tn(n,{anchor:l,focus:l})}function nF(n,t,e,o){if(hl.getState(n,n.getBlockData(t)).decrypted)return null;if(o==="ArrowDown"||o==="ArrowRight"){const s=dt(t);return s?F(s,G(n,s),"end"):F(t,1,"end")}const i=bt(t);return F(i||t,0,"home")}function oF(n,t){return n.getBoundingClientRect()}function rF(n,t,e,o){if(e.isSimple()){u(Po,o.isSimple(),"from is simple position but to is not simple position"),Po.debug("full select table"),M(t,"full-selected");return}u(Po,!o.isSimple(),"from is complex position but end is simple position");const r=e,i=o;u(Po,r.blockId===i.blockId,"only allow update one table selection"),u(Po,r.childContainerId===i.childContainerId,"only one container");const s=n.getBlockData(t),l=n.getContainerById(s.children[0]);M(l,"selected")}function iF(n){n.rootContainer.querySelectorAll('[data-type="editor-block"][data-block-type="encrypted"]').forEach(t=>{H(t,"full-selected"),t.querySelectorAll("selected").forEach(e=>{H(e,"selected")})})}function sF(n,t){const e=n.getBlockData(t);return hl.getState(n,e).decrypted?[n.getContainerById(e.children[0])]:[]}function lF(n,t,e,o,r){return null}function cF(n,t,e,o){u(Po,e.blockId===o.blockId,"only allow select in single block"),u(Po,j(t)===e.blockId,"only allow select in single block");const r=n.getBlockData(t);return u(Po,e.childContainerId===r.children[0],"only one container"),[n.getContainerById(r.children[0])]}function aF(n){return{name:"EncryptedBlock",insertBlockCommandItems:[{id:"insert-encrypted-block",name:"Encrypted Block"}],async handleInsertEmptyBlock(t,e){const o=Bn(t.doc),r={id:P(),type:"encrypted",children:[o],owner:t.doc.getUser().userId,ownerDisplayName:t.doc.getUser().displayName,password:Er.default(`${t.doc.getUser().userId}-1234`)},i=t.doc.getContainerBlocks(o)[0];return t.insertBlock(e.containerId,e.blockIndex,r,Ot(t,i.id,0))}}}function uF(n,t,e,o){return o==="text"||o==="markdown"?"[Encrypted Block]":"<p>[Encrypted Block]</p>"}const dF={blockType:"encrypted",blockKind:"complex",enableKeyboardSelect:!0,createBlockContent:tF,getBlockTextLength:()=>1,getRangeFromPoint:eF,moveCaret:nF,getCaretRect:oF,updateSelection:rF,clearSelection:iF,getChildContainers:sF,getNextContainer:lF,getSelectedContainers:cF,getOptions:aF,convertTo:uF};function hF(n,t,e){const o=hs(n,t,{components:{blocks:[Ws,Qs,dF],decorators:[new Js],embeds:[va,$1,cf,af,uf,k1,df,Mf,Lf],boxes:[ta],options:{...e.componentsOptions}}});return o.readonly=!0,o}class fF{constructor(t){this.createOptions=t}createHistoryEditor(t,e){return hF(t,e,this.createOptions)}}w("create-editor");function r9({root:n,childDoc:t,doc:e}){t.uploadResource=e.uploadResource.bind(e),t.buildResourceUrl=e.buildResourceUrl.bind(e);const o=hs(n,t,{shortcuts:[Ac],components:{blocks:[Ws,Qs],decorators:[new Js],embeds:[G4,va,$1,cf,af,uf,k1,df,Mf,Lf],boxes:[ta,Hf],options:{image:{defaultAlign:"left"}}}});return o.input.addHandler(new ca),o.input.addHandler(new hf(o)),o.input.addHandler(new SP(o)),o.input.addHandler(new Y1),o}function mF(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),o=new Set;e.forEach(r=>{const i=U(r);i&&o.add(i)}),o.forEach(r=>{DP(n,r,t)})}class gF{constructor(t){h(this,"listeners",new Set);h(this,"doc");this.editor=t,this.doc=this.editor.doc.externalDoc,this.doc.registerCallback(this)}getComments(){return this.doc.getComments()}getComment(t){return this.doc.getComment(t)}getCommentDoc(t){return this.doc.getCommentDoc(t)}localCreateComment(t,e){this.doc.localCreateComment(t,e)}localDeleteComment(t){const e=this.getComment(t);this.doc.localDeleteComment(t);const o=e.groupId;this.getComments().filter(i=>i.groupId===o).length===0&&mF(this.editor,o)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(o=>o.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return r9({root:t,childDoc:e,doc:this.doc})}}class pF{constructor(t,e){h(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 fh(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 r9({root:t,childDoc:e,doc:this.localDoc})}}const CF={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"}}},AF={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"}}};T.mergeLang({"zh-CN":CF,"en-US":AF});function bF(n){let t;return n.forEach((e,o)=>{o.toLocaleLowerCase()==="content-type"&&(t=e)}),t!=null?t:""}async function vF(n){try{const t=await fetch(n,{credentials:"same-origin"}),e=await t.blob(),o=bF(t.headers).toLocaleLowerCase();let r="";if(o){const s=au.default[o].extensions;s&&s.length>0&&(r=s[0])}return new File([e],`${Date.now()}.${r}`,{type:o})}catch{return null}}function yF(n){const o=new DOMParser().parseFromString(n,"text/html").querySelector("svg");if(!o)return null;const r=o.getAttribute("viewBox");if(!r)return null;const i=r.split(" ");if(i.length===4){const s=i[2],l=i[3];return o.setAttribute("width",s),o.setAttribute("height",l),o.outerHTML}return null}function i9(n,t,e=!0){const o=new Image,r=document.createElement("canvas"),i=r.getContext("2d");if(!i){t(new Error("failed to get context"),null);return}o.onload=()=>{if(r.width=o.naturalWidth,r.height=o.naturalHeight,e&&(r.width===0||r.height===0)){const s=n.substring(26);if(s){const l=atob(s),c=yF(l);if(c){Bu(c,"image/svg+xml").then(a=>{i9(a,t,!1)});return}}t(null,null);return}i.drawImage(o,0,0),r.toBlob(s=>{t(null,s)},"image/png")},o.src=n}async function kF(n){const t=await Tr(n);return new Promise((e,o)=>{i9(t,(r,i)=>{if(r){o(r);return}if(!i){o(new Error("Failed to get image blob"));return}e(i)})})}const s9="Untitled";function wF(n){const t=Ft(n.rootContainer);return!t||!_(n,t)?s9:n.getBlockString(t)||s9}const BF="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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>{const o=new Image;o.onload=()=>{t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=e,o.src=n})}async function l9(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};const e=await Tr(new File([t],"",{})),o=await IF(e);return o.width===void 0||o.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||o.width*n.height/o.height,height:n.height||o.height*n.width/o.width,buffer:t}:{width:o.width,height:o.height,buffer:t}}function xF(n,t){let e=n.filter(s=>s!=null);const o=t-(e.length-1)*20,r=.87,i=e.reduce((s,l)=>s+l.width,0);return i>o&&(e=e.map(s=>({width:s.width*o/i,height:s.height*o/i,buffer:s.buffer}))),e.map(s=>({width:s.width*r,height:s.height*r,buffer:s.buffer}))}function c9(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let o;switch(e%3){case 0:o=Y.LevelFormat.DECIMAL;break;case 1:o=Y.LevelFormat.LOWER_LETTER;break;default:o=Y.LevelFormat.LOWER_ROMAN;break}return{level:e,format:o,text:`%${e+1}. `,alignment:Y.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(e+1)),hanging:Y.convertInchesToTwip(.2)}}}}})}function TF(){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:Y.LevelFormat.BULLET,text:t,alignment:Y.AlignmentType.START,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(n+1)),hanging:Y.convertInchesToTwip(.2)}}}}})}function SF(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Y.LevelFormat.BULLET,text:"\u2611",alignment:Y.AlignmentType.START,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(n+1)),hanging:Y.convertInchesToTwip(.2)}}}}))}function DF(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Y.LevelFormat.BULLET,text:"\u2610",alignment:Y.AlignmentType.START,style:{paragraph:{indent:{left:Y.convertInchesToTwip(.3*(n+1)),hanging:Y.convertInchesToTwip(.2)}}}}))}var fl=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(fl||{});const LF=[{levels:c9(),reference:"number-numbering-reference"},{levels:TF(),reference:"number-bullet-reference"},{levels:SF(),reference:"checked-bullet-reference"},{levels:DF(),reference:"unchecked-bullet-reference"}];function MF(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 RF(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 OF(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 NF=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function a9(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(NF);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},o=e(t[1]),r=e(t[2]),i=e(t[3]);return`${o}${r}${i}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function oe(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 u9(n,t,e){for(let o=0;o<=e;++o){const r=`${t}${o}`;if(oe(n,r))return r}}function Ra(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function Uf(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"}function d9(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function PF(n){const t=oe(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const o of e){const r=o.split(":");if(r.length!==2)continue;const i=r[0].trim().toLowerCase(),s=r[1].trim().toLowerCase();i==="font-size"&&Ra(n,"inline-style-font-size",s),i==="color"&&Ra(n,"inline-style-color",s),i==="background-color"&&Ra(n,"inline-style-background-color",s),i==="font-family"&&Ra(n,"inline-style-font-family",s)}}function $F(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function _F(n){const t=`${oe(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function FF(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 HF(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function jF(n){return oe(n,"inline-style-font-family")}function zF(n){const t=oe(n,"inline-style-background-color");return a9(t)}function UF(n){const t=oe(n,"inline-style-color");return a9(t)}function VF(n){PF(n);const t=oe(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!oe(n,"style-code"),link:d9(oe(n,"link")),size:_F(n),text:t?HF(n):FF(n)||n.insert,bold:!!oe(n,"style-bold"),underline:!!oe(n,"style-underline"),italics:!!oe(n,"style-italic"),strike:!!oe(n,"style-strikethrough"),superScript:!!oe(n,"style-super"),subScript:!!oe(n,"style-sub"),math:oe(n,"type")==="math"?oe(n,"src"):void 0,mention:t,fontFamily:jF(n),background:zF(n),color:t?"338fe5":MF(u9(n,"style-color-",6))||UF(n),highlight:u9(n,"style-bg-color-",13)}}function qF(){return[new Y.Paragraph({border:{top:{color:"auto",style:Y.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Y.Paragraph({spacing:{line:0}})]}function WF(){return new Y.Paragraph({children:[new Y.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Y.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function GF(){return new Y.Paragraph({children:[new Y.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Y.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function ZF(n,t){return new Y.Paragraph({children:[new Y.ExternalHyperlink({children:[new Y.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function h9(n){if(n.heading!=null)return`Heading${n.heading}`}function f9(n){if(n.alignment!=null){if(n.alignment==="center")return Y.AlignmentType.CENTER;if(n.alignment==="right")return Y.AlignmentType.RIGHT;if(n.alignment==="left")return Y.AlignmentType.LEFT}}function QF(n){if(n.indent)return{left:Y.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Y.convertInchesToTwip(.3*n.padding)}}function YF(n){return{type:Y.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function JF(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function m9(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const o=n.size||t,r=o!=null?Math.floor(o*1.5+.5):void 0;return new Y.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Y.UnderlineType.SINGLE}:void 0,italics:n.italics||void 0,strike:n.strike||void 0,superScript:n.superScript||void 0,subScript:n.subScript||void 0,size:r,style:e,font:n.fontFamily?JF(n.fontFamily):void 0,shading:n.background?YF(n.background):void 0,color:n.color,highlight:RF(n.highlight)})}function KF(n,t){if(n.link)return new Y.ExternalHyperlink({children:[m9(n,t)],link:n.link})}async function g9(n,t,e,o,r){const i=await r(n,t,e);if(i==null)return;const s=await l9({width:o||0,height:0,src:e},i);return new Y.ImageRun({data:i,transformation:{width:s.width||100,height:s.height||20}})}function XF(n){if(n.heading||n.heading)return n.heading}function tH(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function eH(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function nH(n,t){var o;const e=[];if(n.text&&Array.isArray(n.text)){for(let r=0;r<n.text.length;r++){const i=n.text[r];if(((o=i.attributes)==null?void 0:o.box)===!0&&t){const s=await t(i);if(s){n.text.splice(r+1,0,...s);continue}}e.push(VF(i))}return e}}function oH(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 rH(n,t){if(n.type==="embed"&&n.embedType&&Uf(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(o=>{const r=t(o),i=n.embedData[`${r}_width`],s=n.embedData[`${r}_height`];return{src:o,width:i,height:s}})}function iH(n){if(n.padding)return n.padding}function sH(n){return!!(n.type==="embed"&&n.embedType&&Uf(n.embedType)&&n.embedData&&n.embedData.src)}async function Oa(n,t,e){return{quoted:!!n.quoted,heading:XF(n),alignment:tH(n),indent:eH(n),padding:iH(n),texts:await nH(n,e),list:oH(n),images:rH(n,t),border:sH(n)}}async function lH(n,t,e,o){const r=[];if(!n.children)return[];for(const i of n.children){const s=[];for(const l of t.blocks[i])s.push(await Oa(l,e,o));r.push(s)}return r}const cH=w("to-docx");function aH(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 uH(n,t,e,o){const r=!!n.hasColTitle,i=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let a=0;a<e;a++)(r&&a===0||i&&c===0||s&&c%2===1)&&(o[c][a].color=l)}function dH(n){u(cH,n.children,"no table children");const t=n.rows,e=n.cols,o=n.colsWidth;if(o)for(let s=0;s<o.length;s++)o[s]===0&&(o[s]=100);const r=aH(t,e);let i=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(r[s][l].originalWidth=o?o[l]:void 0,r[s][l].from!==void 0)continue;const c=n.children[i];i+=1,r[s][l].cellId=c,r[s][l].color=OF(n[`${c}_background`]),r[s][l].width=o?o[l]:100,r[s][l].align=n[`${c}_align`];const a=n[`${c}_rowSpan`]||1,d=n[`${c}_colSpan`]||1;if(r[s][l].rowSpan=a,r[s][l].colSpan=d,a>1||d>1){let f=0;for(let m=0;m<a;m++)for(let p=0;p<d;p++)m===0&&(f+=o?o[l+p]:80),!(m===0&&p===0)&&(r[s+m][l+p].from=[s,l]);r[s][l].width=f}}return uH(n,t,e,r),r}async function hH(n,t,e,o,r,i,s,l,c,a){async function d(p){if(l){const A=await l(r,i,p);if(A){await o.addDoc(n,A,a);return}}if(p.type==="text"||p.textOnly===!0){const A=await Oa(p,s,c);await o.addTextBlock(A);return}if(p.type==="code"){const A=await lH(p,e,s,c);await o.addCodeBlockObject(A);return}if(p.type==="list"&&p.textOnly!==!0){const A=await Oa(p,s,c);await o.addListBlockObject(n,A);return}if(p.type==="embed"&&p.embedType){const A=p,k=A.embedData,v=A.embedType;if(Uf(v)){const x=await Oa(p,s,c);await o.addImagesBlockObject(x,a)}else p.embedType==="hr"?o.addSeparatorBlock():p.embedType==="video"?o.addVideoPlaceholder():p.embedType==="audio"?o.addAudioPlaceholder():p.embedType==="webpage"?o.addHyperlinkParagraph(d9(k.src),k.title):o.addOtherEmbedBlock(v,p.embedData);return}if(p.type==="table"){let A=[];if(p.colsWidth)A=p.colsWidth;else{const v=p.cols;A=new Array(v);for(let x=0;x<A.length;x++)A[x]=100;p.colsWidth=A}const k=dH(p);await o.addTableMatrix(A,k,e),o.addEmptyParagraph()}}function f(p){const A=[];for(const{type:k,data:v}of p.embedData.exportSpec){if(k==="text"){const x={id:P(),text:[{insert:v}],type:"text"};A.push(x);continue}if(k==="image"){const x={id:P(),type:"embed",embedType:"image",align:"left",embedData:{src:v}};A.push(x);continue}if(k==="link"){const x={id:P(),type:"embed",embedType:"webpage",embedData:{src:v.url,title:v.title}};A.push(x);continue}}return A}function m(p){var A;return(A=p==null?void 0:p.embedData)!=null&&A.exportSpec?f(p):[p]}for(const p of t)for(const A of m(p))await d(A)}function fH(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const mH=w("to-docx");class gH{constructor(t,e,o,r,i,s){h(this,"paragraphs");this.appId=t,this.docId=e,this.state=o,this.readImageFunc=r,this.convertBlocksFunc=i,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Y.Paragraph({heading:h9(t),alignment:f9(t),children:await this.paragraphsFromBlockTexts(t),indent:QF(t)}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=$F(this.defaultFontSize,t.heading),o=[];for(const r of t.texts){if(r.link){const i=KF(r,e);i&&o.push(i);continue}if(r.box&&r.box.type&&r.box.type==="br"){o.push(new Y.TextRun({text:"",break:1}));continue}if(r.box&&r.box.type&&r.box.type==="image"){const i=await g9(this.appId,this.docId,r.box.src,r.box.width,this.readImageFunc);i&&o.push(i);continue}if(r.math){const i=await g9(this.appId,this.docId,r.math,0,this.readImageFunc);i&&o.push(i);continue}o.push(m9(r,e))}return o}async addCodeBlockObject(t){for(const e of t)for(const o of e){const r={style:Y.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Y.Paragraph({style:"Code",border:{left:{...r},right:{...r},top:{...r},bottom:{...r}},children:await this.paragraphsFromBlockTexts(o)}))}}async addListBlockObject(t,e){if(e.list==null)return;let o;const r=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[r])o=this.state.listInstMap[r];else if(o=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[r]=o,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${o}`,l=c9([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:o}),this.state.listRefMap[r]=s}else e.list.ordered?this.state.listRefMap[r]=fl.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[r]=fl.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[r]=fl.UNCHECKED:this.state.listRefMap[r]=fl.BULLET;const i=h9(e);e.texts&&this.paragraphs.push(new Y.Paragraph({heading:i,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[r],level:e.list.level-1,instance:o}}))}imageDimWithBufferToImageRun(t){return new Y.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e){if(t.images==null)return;const o=await Promise.all(t.images.map(async s=>{const l=await this.readImageFunc(this.appId,this.docId,s.src);if(l)return l9(s,l)})),r=xF(o,e),i={style:Y.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Y.Paragraph({border:t.border?{left:{...i},right:{...i},top:{...i},bottom:{...i}}:void 0,alignment:f9(t)||Y.AlignmentType.CENTER,children:r.map(s=>this.imageDimWithBufferToImageRun(s)).flatMap((s,l,c)=>s==null?[]:c.length-1!==l?[s,new Y.TextRun({text:" "})]:s)}))}addSeparatorBlock(){qF().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Y.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(WF())}addAudioPlaceholder(){this.paragraphs.push(GF())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(ZF(t,e))}async addTableMatrix(t,e,o){const r=t.map(i=>i!==0?i*15:1500);this.paragraphs.push(new Y.Table({rows:await this.generateTableRows(e,o),columnWidths:r}))}async generateRowCells(t,e){const o=[];for(const r of t){const i=r.cellId;if(i===void 0)continue;const s=r.width*.9;o.push(new Y.TableCell({children:await this.convertBlocksFunc(i,e.blocks[i],e,this.appId,this.docId,this.state,s),columnSpan:r.colSpan,rowSpan:r.rowSpan,width:{type:Y.WidthType.DXA,size:r.width*15},shading:r.color?{fill:r.color,type:Y.ShadingType.CLEAR,color:"auto"}:void 0}))}return o}async generateTableRows(t,e){const o=[];for(const r of t)o.push(new Y.TableRow({children:await this.generateRowCells(r,e)}));return o}async addDoc(t,e,o){const r=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,o);r&&(this.paragraphs=this.paragraphs.concat(r))}async addOtherEmbedBlock(){}}class pH{constructor(t,e,o,r,i,s,l,c){h(this,"convertBlocks",async(t,e,o,r,i,s,l=720)=>{const c=new gH(r,i,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await hH(t,e,o,c,r,i,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=o,this.readImage=r,this.defaultFontSize=i,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=c}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,o){const r=new Y.ImportDotx,i=this.templateData?await r.extract(this.templateData):void 0,s=t.blocks.root;u(mH,s,"data must have blocks");const l=fH(),c=await this.convertBlocks("blocks",s,t,e,o,l),a=this.backgroundImageOptions?{default:new Y.Header({children:[new Y.Paragraph({children:[new Y.ImageRun(this.backgroundImageOptions)]})]})}:{},d=new Y.Document({numbering:{config:[...LF,...l.levelConfigs]},sections:[{headers:a,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:i});return Y.Packer.toBlob(d)}}async function CH(n,t,e,o){const r=n.doc.buildResourceUrl(o,{withToken:!0});let i=await vF(r);if(!i)return;if(i.type.indexOf("/svg")!==-1){const l=await kF(i);l&&(i=new File([l],i.name))}return await i.arrayBuffer()}async function AH(n,t,e){const o=n.editorBlocks.getBlockClass(e.type);if(o.toStandardDoc)return o.toStandardDoc(n,e,t)}async function bH(n,t){const e=t.attributes,o=n.editorBoxes.getBoxClass(e.type);if(o.toStandardText)return o.toStandardText(n,e)}async function vH(n,t){let{template:e,download:o,backgroundImageOptions:r}=t!=null?t:{};e||(e=EF());const i=n.doc.toJSON(),s=(f,m,p)=>CH(n,f,m,p),l=async(f,m,p)=>AH(n,i,p),c=async f=>bH(n,f),d=await new pH(e,i,Er.default,s,void 0,l,c,r).convert("_appId","_docId");if(o){const f=URL.createObjectURL(d),m=document.createElement("a");m.setAttribute("download",`${wF(n)}.docx`),m.setAttribute("href",`${f}`),m.click(),m.remove()}return d}const Vf=w("create-editor"),p9=[va,$1,cf,af,uf,k1,df,Mf,Lf,G4,X6,g$];async function yH(n,t){var s,l,c,a,d,f,m,p,A,k,v,x,E;u(Vf,n,"app does not exists"),t.lang&&T.setLang(t.lang),so.level=(s=t.logLevel)!=null?s:Ni.DEBUG;const e=t.onReauth?async()=>{var q;const L=t.user.userId,R=t.docId,$=await((q=t.onReauth)==null?void 0:q.call(t,L,R,t.permission));return{userId:L,docId:R,permission:t.permission,appId:t.appId,token:$,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,o={auth:{appId:t.appId,docId:t.docId,userId:t.user.userId,permission:t.permission,token:t.token,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl},serverUrl:t.serverUrl,reauthFunc:e,disableLogout:t.disableLogout},r=await Es.load(o),i=hs(n,r,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,components:{blocks:[Ws,Qs,V1,MC],commandProviders:[new jh,...((l=t.components)==null?void 0:l.commandProviders)||[]],decorators:[new Js,new gh],embeds:[...p9,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[ta,Hf,v6,...((a=t.components)==null?void 0:a.boxes)||[]],insertions:[Cd],blockHooks:[new F4,new X4,...((d=t.components)==null?void 0:d.blockHooks)||[]],textRenders:[new m6,new tI],options:{...t.componentsOptions}},shortcuts:[YD,xM,L1,V3,eI,E1,A$,Ac],colors:["#338FE5","#24B47E","#F0A100","#E52727","#9678D3","#2CB2AE","#EB6414","#8AAB3F"]});if(i.editorCommandProviders.registerCommandProvider(new Rn(i)),i.input.addHandler(new k_),i.input.addHandler(new ca),i.input.addHandler(new Zx),i.input.addHandler(new vM),i.input.addHandler(new Zs(i,{headingLevel:1,titlePlaceholder:T.t("placeholder.common.title"),contentPlaceholder:T.t("placeholder.common.content"),readonlyTitlePlaceholder:T.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new ea(i,(f=t.componentsOptions)==null?void 0:f.quickMenu)),i.input.addHandler(new hf(i)),i.input.addHandler(new N3(i)),i.input.addHandler(new WD),i.input.addHandler(new Y1),i.doc.registerCallback(new w_(i)),i.addCustom("remote-cursor",()=>new l5(i)),i.addCustom("block-menu",L=>new U4(L)),i.addCustom("editor-tooltip",()=>new B1(i)),t!=null&&t.enableComments&&i.addCustom("editor-comments",L=>new f6(L,new gF(L))),i.addCustom("create-options",()=>new Am(i,t)),i.addCustom("drop-target",()=>new ol(i)),i.addCustom("list-to-mindmap",()=>new Jc(i)),i.addCustom("list-to-mention",()=>new H_(i)),i.addCustom("mobile-helper",()=>new X_(i)),i.addCustom("code-caret",()=>new qD(i)),(m=t.componentsOptions)!=null&&m.mention){const L=t.componentsOptions.mention;i.addCustom("mention",()=>new N_(i,L))}if(i.addCustom("heading-collapse",()=>new A_(i)),ii.register(i),ol.register(i),yr.register(i),Oo.register(i),(A=(p=t.componentsOptions)==null?void 0:p.remoteCarets)!=null&&A.onUserChanged){const L=(v=(k=t.componentsOptions)==null?void 0:k.remoteCarets)==null?void 0:v.onUserChanged;i.doc.getRemoteUsers().on("change",R=>{L(i,R)})}return(E=(x=t.componentsOptions)==null?void 0:x.templates)!=null&&E.templates.length&&(i.addListener("docChanged",()=>{zf(i)}),i.addListener("resize",()=>{zf(i,{reset:!0})}),setTimeout(()=>{zf(i)},100)),i.doc.registerCallback({onError:async L=>{if(L.code==="ResetDoc"){Vf.error(`reset doc: ${L.message}`);const R=await Es.load(o);i.doc.reset(R)}}}),i}function kH(n){return n.toJSON!==void 0}async function wH(n,t,e){var i,s,l,c;u(Vf,n,"app does not exists");const o=kH(t)?t:new Yd(t,{serverUrl:e.serverUrl||""});e.lang&&T.setLang(e.lang);const r=hs(n,o,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[Ws,Qs,V1,MC],commandProviders:[new jh],decorators:[new Js,new gh],embeds:[...p9,...((i=e.components)==null?void 0:i.embeds)||[]],boxes:[ta,Hf,v6,...((s=e.components)==null?void 0:s.boxes)||[]],insertions:[Cd],blockHooks:[new F4,...((l=e.components)==null?void 0:l.blockHooks)||[]],textRenders:[new m6],options:{...e.componentsOptions}},shortcuts:[L1,V3,E1,Ac]});return r.editorCommandProviders.registerCommandProvider(new Rn(r)),r.input.addHandler(new ca),r.input.addHandler(new Zs(r,{headingLevel:1,titlePlaceholder:T.t("placeholder.common.title"),contentPlaceholder:T.t("placeholder.common.content"),readonlyTitlePlaceholder:T.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),r.input.addHandler(new ea(r,(c=e.componentsOptions)==null?void 0:c.quickMenu)),r.input.addHandler(new hf(r)),r.input.addHandler(new N3(r)),r.input.addHandler(new Y1),r.addCustom("block-menu",a=>new U4(a)),r.addCustom("editor-tooltip",()=>new B1(r)),e!=null&&e.enableComments&&r.addCustom("editor-comments",a=>new f6(a,new pF(a,o))),r.addListener("clickLink",(a,d,f)=>{var p;if((p=e==null?void 0:e.events)!=null&&p.onClickLink){e.events.onClickLink(a,d,f);return}const m=f.getAttribute("link");m&&(a.readonly||d.ctrlKey||d.metaKey)&&window.open(m,"_blank")}),ii.register(r),r}function BH(n,t){var l;const e=n.doc;if(!((l=e.getVersionHelper)==null?void 0:l.call(e)))throw new Error("the editor does not support to show versions");const r=n.getCustom("create-options");if(!r)throw new Error("the editor does not support to show versions");const i=r.getData(),s=new fF(i);return l_(n,s,t)}g.tippy=i8,g.AuthError=Tc,g.AuthHeader=Bs,g.AutoScroll=Km,g.BaseURLHeader=Sc,g.BasicCommands=kx,g.BlockExclusiveHook=X4,g.BlockResizer=sa,g.BrBox=Lp,g.CodeBlock=Qs,g.CodeLineBlock=V1,g.CodeTextDecorator=Js,g.DefaultShortcuts=Ac,g.DocIdError=Qk,g.DragDrop=Rm,g.DrawioEmbed=va,g.EditorBlocks=Tg,g.EditorBoxes=Rp,g.EditorCommandProviders=k2,g.EditorComplexBlockPosition=Xe,g.EditorComplexSelectionRange=tn,g.EditorDecorators=$p,g.EditorEmbeds=Dg,g.EditorInsertions=Pp,g.EditorSimpleBlockPosition=qt,g.EditorSimpleSelectionRange=Kt,g.EmbedBlock=Mg,g.EnforceWithDocumentTitleHandler=Zs,g.EventCallbacks=Pi,g.FILL_CHAR=pb,g.FileExtError=Yk,g.HeadingBlockScrollListener=O_,g.InputtingInsertion=Op,g.LocalDoc=Yd,g.LogLevel=Ni,g.Logger=so,g.MIN_DISTANCE_THRESHOLD=Lm,g.ManualCloseDialog=Ds,g.ManualMenu=cr,g.ManualToolbar=Ss,g.MarkdownInputHandler=ca,g.MaxUserError=ch,g.OnesEditorAutoSuggest=Mh,g.OnesEditorCustomDataWrapper=Am,g.OnesEditorExclusiveBlock=Oo,g.OnesEditorHoveringBlock=$t,g.OnesEditorQuickMenu=ea,g.OnesEditorToc=dl,g.OnesEditorTocProvider=yr,g.OnesEditorToolbar=ii,g.OnesEditorTooltip=B1,g.PermissionError=Zk,g.Popup=Is,g.RemoteCarets=l5,g.RemoteCaretsDecorator=gh,g.RemoteCaretsInsertion=Cd,g.RemoteUsers=vc,g.RequestReloadError=ws,g.RichText=ce,g.ShareDBDoc=Es,g.SimpleCache=vm,g.StandardEmbedBlockCommands=N1,g.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=rd,g.TEXT_STYLE_COLOR_PREFIX=od,g.TableBlock=Ws,g.TableBlockCommandProvider=jh,g.TableShortcuts=L1,g.TextBlock=ye,g.TextBox=Dp,g.TextStyleShortcuts=E1,g.TocEmbed=X6,g.ZERO_WIDTH_SPACE_CHAR=$i,g.addAttribute=Jl,g.addClass=M,g.addCommentToBlock=la,g.addDays=Z8,g.addMetaToDoc=us,g.addMonths=G8,g.animateScrollTo=pu,g.applyPlaceholderToBlock=aa,g.assert=u,g.blockToDoc=Wd,g.blockToHtml=yd,g.blockToMarkdown=kd,g.blockToText=lc,g.blocksToDoc=Pv,g.clearAllSelection=Ag,g.clientType=xt,g.cloneBlock=bo,g.cloneChildContainer=Md,g.cloneDoc=Rd,g.cloneText=hp,g.commentToShareDbComment=mh,g.compareElement=Dl,g.comparePosition=Uu,g.complexBlockAdjustSelectionPos=Ul,g.complexBlockFindNearestChildBlock=Pg,g.complexBlockGeFirstSimpleChild=qu,g.complexBlockGetAllChildContainers=Se,g.complexBlockGetBottomChildContainers=Ng,g.complexBlockGetLastSimpleChild=Vi,g.complexBlockGetSelectedContainers=Rr,g.complexBlockGetTopChildContainers=Og,g.containerToDoc=K0,g.continuousScroll=Jm,g.convertBlockFrom=jl,g.copyBlockAttributes=Yp,g.createBlockAnchor=fo,g.createBlockCaretAnchor=jg,g.createBlockContentElement=lo,g.createBlockElement=lg,g.createBlockSimpleDocRange=nc,g.createBlockSimpleRange=Ot,g.createBoxContentElement=ug,g.createBoxElement=cg,g.createBoxOp=op,g.createChildContainer=xp,g.createComplexBlockPosition=Bt,g.createComplexDocPos=Ap,g.createComplexDocRange=bb,g.createContainer=gp,g.createContainerElement=fd,g.createDeleteOps=Xg,g.createEditor=hs,g.createEditorSelectionRange=Wt,g.createElement=b,g.createEmptyContainer=Bn,g.createEmptyDoc=or,g.createEmptyTextBlockData=Xl,g.createExpandedRange=Tl,g.createIconButton=Ir,g.createImage=ym,g.createInsertOps=Yl,g.createInsertionContentElement=fg,g.createInsertionElement=dg,g.createLocalEditor=wH,g.createOnesEditor=yH,g.createRange=km,g.createRichText=Co,g.createRootContainer=Ip,g.createSimpleBlockPosition=F,g.createSimpleDocPos=Cp,g.createTextBlockData=Vn,g.createTextButton=mr,g.createTextOp=_e,g.createTextWithReplaceSoftReturn=Xu,g.daysAfter=Tu,g.deleteText=ed,g.diffDays=Q8,g.disablePageScroll=qm,g.docToHtml=Vp,g.docToHtmlFragment=ts,g.docToMarkdown=$r,g.docToText=cc,g.downloadObjectToFile=nf,g.downloadSvgToString=t3,g.editLink=Hs,g.editorAddComment=MP,g.editorAddTextAttribute=l0,g.editorAutoInsertBlock=Jp,g.editorBreakTextBlock=Hr,g.editorClearCompositionText=Qp,g.editorClearSelectedContents=Dd,g.editorCopyBlock=Cc,g.editorDeleteBlock=Td,g.editorDeleteBlockText=Ed,g.editorDeleteBlockWithoutChildren=xd,g.editorDeleteChildContainer=gv,g.editorDeleteChildContainers=Kp,g.editorFocusToBlock=Ld,g.editorFocusToEnd=Y0,g.editorGetBlockData=Ao,g.editorGetBlockText=ge,g.editorGetBlockTextEx=rc,g.editorGetBoxData=vp,g.editorHandleKeyboardEvent=o2,g.editorInsertBlock=Fr,g.editorInsertBoxToBlock=Gp,g.editorInsertDoc=i0,g.editorInsertDocAt=Od,g.editorInsertText=Bd,g.editorInsertTextToBlock=Wp,g.editorInsertTextToBlockEx=wd,g.editorMergeTextBlock=Xp,g.editorMoveDown=b0,g.editorMoveEnd=S0,g.editorMoveHome=D0,g.editorMoveLeft=p0,g.editorMoveLineEnd=_0,g.editorMoveLineHome=$0,g.editorMovePageDown=V0,g.editorMovePageUp=U0,g.editorMoveRight=C0,g.editorMoveUp=A0,g.editorMoveWordEnd=I0,g.editorMoveWordLeft=E0,g.editorRangeClearColor=a0,g.editorRangeGetColor=Nd,g.editorRangeSetColor=c0,g.editorRemoveTextAttribute=bv,g.editorReplaceBlockText=hc,g.editorReplaceContainer=s0,g.editorRunOnce=Jd,g.editorSelectAll=Q0,g.editorSelectContainer=Vd,g.editorSelectDown=v0,g.editorSelectEnd=zd,g.editorSelectHome=L0,g.editorSelectLeft=y0,g.editorSelectLineEnd=P0,g.editorSelectLineHome=N0,g.editorSelectPageDown=W0,g.editorSelectPageUp=q0,g.editorSelectRight=k0,g.editorSelectUp=w0,g.editorSelectWordEnd=T0,g.editorSelectWordLeft=x0,g.editorSetTextColor=jr,g.editorShowFindDialog=HN,g.editorToDocx=vH,g.editorUpdateBlockData=fc,g.editorUpdateCompositionText=Zp,g.editorUpdateEmbedData=o0,g.enablePageScroll=Wm,g.escapeHtmlText=Tm,g.escapeRegExp=Lu,g.escapeSpace=D8,g.exclusiveBlock=J4,g.executeBlockCommand=xg,g.executeEmbedBlockCommand=Ig,g.executeRangeCommand=y2,g.fileToDataUrl=Tr,g.findAfterOffsetNotType=ud,g.findAllText=cd,g.findEventTargetBlock=Im,g.findInsertionById=hg,g.findNextOffset=Pb,g.findPrevOffset=Nb,g.findPrevOffsetNotType=ad,g.findPrevSimpleBlockBeforeChildContainer=Rg,g.findTarget=xr,g.findWordEnd=hd,g.findWordLeft=dd,g.format=xu,g.formatBytes=Xm,g.formatDate=ng,g.fragmentToHtml=Gm,g.fromBase64=Ml,g.fromBase64ToBlob=wu,g.fromBase64ToUint8Array=z8,g.fromDocRange=ho,g.fromNowString=Du,g.genId=P,g.getAllChildBlocks=Gu,g.getAllQuickMenuItems=w1,g.getAllSelectedBlocks=en,g.getAttributesAt=Ji,g.getBlockBackground=sg,g.getBlockByIndex=Sr,g.getBlockCaretRect=Ye,g.getBlockClass=pt,g.getBlockClassByType=Mr,g.getBlockClientRects=co,g.getBlockCommandsWithHook=Fu,g.getBlockContent=st,g.getBlockId=j,g.getBlockIndex=K,g.getBlockKind=Je,g.getBlockMinWidth=vg,g.getBlockNearestRangeFromPoint=Fg,g.getBlockOptions=tA,g.getBlockPath=ao,g.getBlockProperties=wg,g.getBlockRangeFromPoint=Vl,g.getBlockStyles=X8,g.getBlockTextLength=G,g.getBlockTools=Rt,g.getBlockType=it,g.getBoxContent=Ou,g.getBoxId=ag,g.getBoxTypeFromElement=ji,g.getChildBlockCount=Ze,g.getChildBlocks=Mt,g.getChildOffset=mo,g.getColorFromAttributes=sd,g.getComplexBlockClass=xe,g.getContainerBlockPath=wp,g.getContainerBlocks=Cg,g.getContainerBlocksElement=sc,g.getContainerById=Pr,g.getContainerId=V,g.getContainerMinWidth=gd,g.getContainerToolsElement=$b,g.getContainerWidth=Tp,g.getDistanceSquare=An,g.getElementOffset=_i,g.getEmbedType=Ne,g.getExistsBlockTools=Hl,g.getExistsContainerById=kp,g.getFileExt=Iu,g.getFirstChildBlock=Ft,g.getFirstClientRect=Sl,g.getHeadingMenuOptions=A1,g.getHorizontalPadding=du,g.getInsertionContent=Nu,g.getLastChildBlock=Jt,g.getLastClientRect=Vo,g.getListAllNextBrothers=zs,g.getLogger=w,g.getNextBlock=dt,g.getNextValidOffset=tr,g.getNextVisibleBlock=Lr,g.getOffsetInfoAfter=Xi,g.getOffsetInfoBefore=ic,g.getOpAt=ip,g.getOpLength=nd,g.getParentBlock=U,g.getParentBlockExcludeSelf=Fl,g.getParentBox=Ru,g.getParentContainer=z,g.getPrevBlock=bt,g.getPrevValidOffset=go,g.getPrevVisibleBlock=Dr,g.getRangeCommands=b2,g.getRootBlock=_u,g.getScrollContainer=bn,g.getSpecialBlockCommands=Bg,g.getStandardEmbedBlockProperties=P1,g.getTextAfterOffset=Rb,g.getTextBeforeOffset=Ob,g.getTextBlockChild=ql,g.getTextBlockClass=gg,g.getTextBlockContentChildTextLength=$e,g.getTextBlockContentChildType=Hg,g.getTextBlockContentChildren=yn,g.getTextLength=me,g.getTextOpLength=Zu,g.getTextWidth=Ol,g.getToolbar=Vc,g.handleBlockElementUpdated=yg,g.hasAltOnly=P8,g.hasClass=rt,g.hasCtrlOrCmd=Hm,g.hasCtrlOrCmdOnly=N8,g.hideBlock=rg,g.htmlToFragment=Rl,g.i18n=T,g.injectDocToHtmlFragment=as,g.injectStyle=Dm,g.insertEmptyBlock=nA,g.insertEmptyEmbedBlock=Hu,g.insertText=po,g.intersectionCommands=zy,g.isBackspace=zm,g.isBlock=Jo,g.isBox=Mu,g.isCJK=$m,g.isChildContainer=Ke,g.isChildNode=wt,g.isCollapsedRange=Ab,g.isComplexBlockPosition=zu,g.isComplexKindBlock=at,g.isContainer=vn,g.isContainerSelectedAllChildBlocks=G0,g.isControlEvent=Go,g.isDelete=_8,g.isDraggingFiles=Pl,g.isElementVisible=gu,g.isEmbedBlock=Te,g.isEmptyContainer=pd,g.isEmptyDoc=tc,g.isEmptyTextBlock=Tt,g.isEmptyTextBlockWithoutCompositionText=Gs,g.isEnterOnly=jm,g.isEscape=yu,g.isFirefox=bu,g.isFirstChildBlockInComplexBlock=LA,g.isHighSurrogate=B8,g.isInBlock=Pu,g.isInBlockTools=zi,g.isLetter=Pm,g.isLowSurrogate=uu,g.isMatchShortcut=jn,g.isMoveForward=R8,g.isNavigationEvent=M8,g.isNavigationKey=Fm,g.isNodeRemoved=Bm,g.isNumber=Nm,g.isPrintableKey=vu,g.isRootBlock=Wn,g.isRootContainer=Ct,g.isSafari=_m,g.isSameDay=Su,g.isShiftEnter=$8,g.isShiftTab=H8,g.isShortcutEvent=O8,g.isSimpleBlock=K8,g.isSimpleBlockPosition=uo,g.isSimplePos=pp,g.isSimpleRange=ec,g.isSpace=Ll,g.isTab=F8,g.isTextBlockContentBoxChild=Pe,g.isTextBlockContentChild=qi,g.isTextBlockContentInsertionChild=Un,g.isTextBlockContentTextChild=Wi,g.isTextKindBlock=_,g.isTextKindBlockType=Ui,g.isToday=tg,g.isValidOffset=le,g.isVisibleBlock=_l,g.isYesterday=eg,g.loadJs=Em,g.loadJsPromise=qo,g.lockers=Ge,g.mergeCommands=Uc,g.mergeDocs=rr,g.mergeOps=td,g.mergeText=hb,g.multiSplitText=Vg,g.parseShortcut=Um,g.patchNode=Hi,g.pointInRect=Wo,g.rangeAddAttribute=Yi,g.rangeGetTextColor=dp,g.rangeRemoveAttribute=Nr,g.rangeSetTextColor=cp,g.rangeTransformText=sp,g.registerDragDrop=Cu,g.removeAttribute=id,g.removeClass=H,g.removeLastBr=cb,g.removePlaceholderFromBlock=f4,g.removeStyle=Sm,g.replaceAll=Y8,g.replaceAllCaseInsensitive=J8,g.replaceAllText=mp,g.replaceText=Kl,g.requestDownload=$l,g.resetListStart=Vs,g.scrollable=Ym,g.selectFile=Qo,g.selectedBlockToDoc=gc,g.selectionToDoc=cs,g.setAttributes=fu,g.setClipboardData=Nl,g.setClipboardDataByEvent=W8,g.setColorToAttributes=ap,g.setDataset=hu,g.setDefaultCursor=Fi,g.setStyles=mu,g.shareDBCommentToDocObject=fh,g.shareDBDocCommentToComment=i5,g.shortcutToDisplayText=j8,g.showBlock=ig,g.showDocVersions=BH,g.splitText=ve,g.splitToThree=Gt,g.stringToDataUrl=Bu,g.stringToObjectUrl=Eu,g.subText=qg,g.textNodeOffsetFromPoint=wm,g.toBase64URL=Zo,g.toPlainText=vt,g.toPlainTextKeepLength=ld,g.trimChar=Au,g.unexclusiveBlock=K4,g.unicodeLength=E8,g.unicodeSubstr=I8,g.updateBlockSelection=bg,g.updateOpAttributes=fp,g.updateTextBlockContent=Mb,g.updateUrl=ku,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|