(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-034978b9"],{"053c":function(t,e,i){"use strict";var n=i("1e42");const o=["backgroundColor","backgroundImage","backgroundRepeat","backgroundPosition","backgroundSize"];class r{static setBackgroundStyle(t,e){if(!t)return;if(!r.cacheStyle){r.cacheStyle={};let e=window.getComputedStyle(t);o.forEach(t=>{r.cacheStyle[t]=e[t]})}let{backgroundColor:i,backgroundImage:n,backgroundRepeat:s,backgroundPosition:a,backgroundSize:h}=e;t.style.backgroundColor=i,n&&"none"!==n?(t.style.backgroundImage=`url(${n})`,t.style.backgroundRepeat=s,t.style.backgroundPosition=a,t.style.backgroundSize=h):t.style.backgroundImage="none"}static removeBackgroundStyle(t){r.cacheStyle&&(o.forEach(e=>{t.style[e]=r.cacheStyle[e]}),r.cacheStyle=null)}constructor(t){this.ctx=t,this._markerPath=null,this._marker=null,this._gradient=null}merge(t,e){let i=this.ctx.mindMap.getNodeThemeConfig?this.ctx.mindMap.getNodeThemeConfig(this.ctx):this.ctx.mindMap.themeConfig,n=null,o=!1;e?(o=!0,n=i):n=this.ctx.isGeneralization?i.generalization:0===this.ctx.layerIndex?i.root:1===this.ctx.layerIndex?i.second:i.node;let r="";return r=void 0!==this.getSelfStyle(t)?this.getSelfStyle(t):void 0!==n[t]?n[t]:i[t],o||this.addToEffectiveStyles({[t]:r}),r}getStyle(t,e){return this.merge(t,e)}getSelfStyle(t){return this.ctx.getData(t)}addToEffectiveStyles(t){this.ctx.effectiveStyles={...this.ctx.effectiveStyles,...t}}rect(t){this.shape(t),t.radius(this.merge("borderRadius"))}shape(t){const e={gradientStyle:this.merge("gradientStyle"),startColor:this.merge("startColor"),endColor:this.merge("endColor"),startDir:this.merge("startDir"),endDir:this.merge("endDir"),fillColor:this.merge("fillColor"),borderColor:this.merge("borderColor"),borderWidth:this.merge("borderWidth"),borderDasharray:this.merge("borderDasharray")};e.gradientStyle?(this._gradient||(this._gradient=this.ctx.nodeDraw.gradient("linear")),this._gradient.update(t=>{t.stop(0,e.startColor),t.stop(1,e.endColor)}),this._gradient.from(...e.startDir).to(...e.endDir),t.fill(this._gradient)):t.fill({color:e.fillColor}),t.stroke({color:e.borderColor,width:e.borderWidth,dasharray:e.borderDasharray})}text(t){const e={color:this.merge("color"),fontFamily:this.merge("fontFamily"),fontSize:this.merge("fontSize"),fontWeight:this.merge("fontWeight"),fontStyle:this.merge("fontStyle"),textDecoration:this.merge("textDecoration")};t.fill({color:e.color}).css({"font-family":e.fontFamily,"font-size":e.fontSize+"px","font-weight":e.fontWeight,"font-style":e.fontStyle,"text-decoration":e.textDecoration})}domText(t,e=1){const i={color:this.merge("color"),fontFamily:this.merge("fontFamily"),fontSize:this.merge("fontSize"),fontWeight:this.merge("fontWeight"),fontStyle:this.merge("fontStyle"),textDecoration:this.merge("textDecoration"),textAlign:this.merge("textAlign")};t.style.color=i.color,t.style.textDecoration=i.textDecoration,t.style.fontFamily=i.fontFamily,t.style.fontSize=i.fontSize*e+"px",t.style.fontWeight=i.fontWeight||"normal",t.style.fontStyle=i.fontStyle,t.style.textAlign=i.textAlign}tagText(t,e){t.fill({color:"#fff"}).css({"font-size":e.fontSize+"px"})}tagRect(t,e){t.fill({color:e.fill}),e.radius&&t.radius(e.radius)}iconNode(t,e){const i=e||this.merge("color");t.attr({fill:i,style:"fill: "+i})}line(t,{width:e,color:i,dasharray:n}={},o,r){const{customHandleLine:s}=this.ctx.mindMap.opt;"function"===typeof s&&s(this.ctx,t,{width:e,color:i,dasharray:n}),t.stroke({color:i,dasharray:n,width:e}).fill({color:"none"});const a=r&&r.style;if(o&&a){const e=this.merge("showLineMarker",!0);if(e){a._marker=a._marker||a.createMarker(),a._markerPath.stroke({color:i}).fill({color:i}),t.attr("marker-start",""),t.attr("marker-end","");const e=a.merge("lineMarkerDir");t.marker(e,a._marker)}else a._marker&&(t.attr("marker-start",""),t.attr("marker-end",""),a._marker.remove(),a._marker=null)}else t.attr("marker-start",""),t.attr("marker-end",""),a&&a._marker&&(a._marker.remove(),a._marker=null)}createMarker(){return this.ctx.lineDraw.marker(20,20,t=>{t.ref(8,5),t.size(20,20),t.attr("markerUnits","userSpaceOnUse"),t.attr("orient","auto-start-reverse"),this._markerPath=t.path("M0,0 L2,5 L0,10 L10,5 Z")})}generalizationLine(t){t.stroke({width:this.merge("generalizationLineWidth",!0),color:this.merge("generalizationLineColor",!0)}).fill({color:"none"})}iconBtn(t,e,i){let{color:n,fill:o,fontSize:r,fontColor:s}=this.ctx.mindMap.opt.expandBtnStyle||{color:"#808080",fill:"#fff",fontSize:12,strokeColor:"#333333",fontColor:"#333333"};t.fill({color:n}),e.fill({color:n}),i.fill({color:o}),this.ctx.mindMap.opt.isShowExpandNum&&t.attr({"font-size":r+"px","font-color":s})}hasCustomStyle(){let t=!1;return Object.keys(this.ctx.getData()).forEach(e=>{Object(n["g"])(e)&&(t=!0)}),t}getCustomStyle(){const t={};return Object.keys(this.ctx.getData()).forEach(e=>{Object(n["g"])(e)&&(t[e]=this.ctx.getData(e))}),t}hoverNode(t){const e=this.merge("hoverRectColor")||this.ctx.mindMap.opt.hoverRectColor,i=this.merge("hoverRectRadius");t.radius(i).fill("none").stroke({color:e})}onRemove(){this._marker&&(this._marker.remove(),this._marker=null),this._markerPath&&(this._markerPath.remove(),this._markerPath=null),this._gradient&&(this._gradient.remove(),this._gradient=null)}}r.cacheStyle=null,e["a"]=r},"08af":function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n=i("1e42");const o=t=>{if(!t)return"";const e=t.text||"";return t.richText?Object(n["lb"])(e):e},r=t=>new Array(t).fill("#").join(""),s=t=>new Array(t-6).fill(" ").join("")+"*",a=t=>{const e=Object(n["mb"])(t).filter(t=>t&&t.data);let i="";return e.forEach((t,a)=>{Object(n["Db"])(t,null,(t,e,n,a)=>{if(!t||!t.data)return;const h=a+1;i+=h<=6?r(h):s(h),i+=" "+o(t.data);const d=t.data.generalization;if(Array.isArray(d))i+=d.map(t=>` [${o(t)}]`);else if(d&&d.text){const t=o(d);i+=` [${t}]`}i+="\n\n",t.data.note&&(i+=t.data.note+"\n\n")},()=>{},!0),a0}function d(){const t=this.formatGetGeneralization();return!!t.find(t=>!t.range||t.range.length<=0)}function l(t){return this._generalizationList.findIndex(e=>e.generalizationNode.uid===t.uid)}function c(){if(this.isGeneralization||!this.checkHasGeneralization())return;let t=0,e=0;const i=this.formatGetGeneralization();i.forEach((i,n)=>{let o=this._generalizationList[n];o||(o=this._generalizationList[n]={}),o.node=this,o.range=i.range,o.generalizationLine||(o.generalizationLine=this.lineDraw.path()),o.generalizationNode||(o.generalizationNode=new Gt({data:{inserting:i.inserting,data:i},uid:Object(s["u"])(),renderer:this.renderer,mindMap:this.mindMap,isGeneralization:!0})),delete i.inserting,o.generalizationNode.generalizationBelongNode=this,o.generalizationNode.width>t&&(t=o.generalizationNode.width),o.generalizationNode.height>e&&(e=o.generalizationNode.height),i.isActive&&this.renderer.addNodeToActiveList(o.generalizationNode)}),this._generalizationNodeWidth=t,this._generalizationNodeHeight=e}function u(){this.isGeneralization||(this.removeGeneralization(),this.createGeneralizationNode())}function f(t){if(this.isGeneralization)return;this.updateGeneralizationData();const e=this.formatGetGeneralization();if(e.length<=0||!1===this.getData("expand"))return void this.removeGeneralization();e.length!==this._generalizationList.length&&this.removeGeneralization(),this.createGeneralizationNode();const i=this.getLayoutInstance();i.renderGeneralization(this._generalizationList),this._generalizationList.forEach(e=>{this.style.generalizationLine(e.generalizationLine),e.generalizationNode.render(()=>{},t)})}function p(){const t=this.getChildrenLength(),e=this.formatGetGeneralization(),i=[];e.forEach(e=>{e.range?e.range.length>0&&e.range[0]<=t-1&&e.range[1]<=t-1&&i.push(e):i.push(e)}),i.length!==e.length&&this.setData({generalization:i})}function g(){this.isGeneralization||(this._generalizationList.forEach(t=>{t.generalizationNode.style.onRemove(),t.generalizationLine&&(t.generalizationLine.remove(),t.generalizationLine=null),t.generalizationNode&&(this.renderer.removeNodeFromActiveList(t.generalizationNode),t.generalizationNode.remove(),t.generalizationNode=null)}),this._generalizationList=[],this.generalizationBelongNode&&this.nodeDraw.find(".generalization_"+this.generalizationBelongNode.uid).remove())}function m(){this.isGeneralization||this._generalizationList.forEach(t=>{t.generalizationLine&&t.generalizationLine.hide(),t.generalizationNode&&t.generalizationNode.hide()})}function b(){this.isGeneralization||this._generalizationList.forEach(t=>{t.generalizationLine&&t.generalizationLine.show(),t.generalizationNode&&t.generalizationNode.show()})}function x(t){this._generalizationList.forEach(e=>{e.generalizationLine.opacity(t),e.generalizationNode.group.opacity(t)})}function y(){const t=this.generalizationBelongNode,e=t.formatGetGeneralization(),i=t.getGeneralizationNodeIndex(this),n=e[i],o=this.getStyle("hoverRectColor"),r=o||this.mindMap.opt.hoverRectColor,s=r?{stroke:r}:null;Array.isArray(n.range)&&n.range.length>0?this.mindMap.renderer.highlightNode(t,n.range,s):this.mindMap.renderer.highlightNode(t,null,s)}function w(){this.mindMap.renderer.closeHighlightNode()}var C={formatGetGeneralization:a,checkHasGeneralization:h,checkHasSelfGeneralization:d,getGeneralizationNodeIndex:l,createGeneralizationNode:c,updateGeneralization:u,updateGeneralizationData:p,renderGeneralization:f,removeGeneralization:g,hideGeneralization:m,showGeneralization:b,setGeneralizationOpacity:x,handleGeneralizationMouseenter:y,handleGeneralizationMouseleave:w},v=(i("13d5"),i("3887"));function _(){if(this._openExpandNode)return;const{expandBtnSize:t,expandBtnIcon:e,isShowExpandNum:i}=this.mindMap.opt;let{close:n,open:o}=e||{};i?(this._openExpandNode=new r["j"],this._openExpandNode.addClass("smm-expand-btn-text"),this._openExpandNode.attr({"text-anchor":"middle","dominant-baseline":"middle",x:t/2,y:2})):(this._openExpandNode=Object(r["i"])(o||v["a"].open).size(t,t),this._openExpandNode.x(0).y(-t/2)),this._closeExpandNode=Object(r["i"])(n||v["a"].close).size(t,t),this._closeExpandNode.x(0).y(-t/2),this._fillExpandNode=(new r["b"]).size(t),this._fillExpandNode.x(0).y(-t/2),this.style.iconBtn(this._openExpandNode,this._closeExpandNode,this._fillExpandNode)}function M(t=[]){return t.reduce((t,e)=>t+this.sumNode(e.children||[]),t.length)}function E(){let t,{expand:e}=this.getData();if(e!==this._lastExpandBtnType&&(this._expandBtn&&this._expandBtn.clear(),this.createExpandNodeContent(),!1===e?(t=this._openExpandNode,this._lastExpandBtnType=!1):(t=this._closeExpandNode,this._lastExpandBtnType=!0),this._expandBtn)){let{isShowExpandNum:i,expandBtnStyle:n,expandBtnNumHandler:o}=this.mindMap.opt;if(i)if(e)this._fillExpandNode.stroke("none");else{this._fillExpandNode.stroke({color:n.strokeColor});let e=this.sumNode(this.nodeData.children||[]);if("function"===typeof o){const t=o(e,this);Object(s["fb"])(t)||(e=t)}t.text(String(e))}this._expandBtn.add(this._fillExpandNode).add(t)}}function N(){if(!this._expandBtn)return;const t=this.getLayoutInstance();t.renderExpandBtn(this,this._expandBtn)}function T(){this.nodeData.data.isFlowChart||this.getChildrenLength()<=0||this.isRoot&&!this.mindMap.opt.allowRootNodeCollapse||(this._expandBtn||(this._expandBtn=new r["d"],this._expandBtn.on("mouseover",t=>{t.stopPropagation(),this._expandBtn.css({cursor:"pointer"})}),this._expandBtn.on("mouseout",t=>{t.stopPropagation(),this._expandBtn.css({cursor:"auto"})}),this._expandBtn.on("click",t=>{t.stopPropagation(),this.mindMap.execCommand("SET_NODE_EXPAND",this,!this.getData("expand")),this.mindMap.emit("expand_btn_click",this)}),this._expandBtn.on("dblclick",t=>{t.stopPropagation()}),this._expandBtn.addClass("smm-expand-btn")),this.group.add(this._expandBtn),this._showExpandBtn=!0,this.updateExpandBtnNode(),this.updateExpandBtnPos())}function L(){this._expandBtn&&this._showExpandBtn&&(this._expandBtn.remove(),this._showExpandBtn=!1)}function S(){const{alwaysShowExpandBtn:t,notShowExpandBtn:e}=this.mindMap.opt;t||e||setTimeout(()=>{this.renderExpandBtn()},0)}function D(){const{alwaysShowExpandBtn:t,notShowExpandBtn:e}=this.mindMap.opt;if(t||this._isMouseenter||e)return;let{isActive:i,expand:n}=this.getData();!i&&n&&setTimeout(()=>{this.removeExpandBtn()},0)}var R={createExpandNodeContent:_,updateExpandBtnNode:E,updateExpandBtnPos:N,renderExpandBtn:T,removeExpandBtn:L,showExpandBtn:S,hideExpandBtn:D,sumNode:M};function z(t={}){this.mindMap.execCommand("SET_NODE_DATA",this,t)}function A(t,e,i){this.mindMap.execCommand("SET_NODE_TEXT",this,t,e,i)}function O(t){this.mindMap.execCommand("SET_NODE_IMAGE",this,t)}function k(t){this.mindMap.execCommand("SET_NODE_ICON",this,t)}function I(t,e){this.mindMap.execCommand("SET_NODE_HYPERLINK",this,t,e)}function B(t){this.mindMap.execCommand("SET_NODE_NOTE",this,t)}function F(t,e){this.mindMap.execCommand("SET_NODE_ATTACHMENT",this,t,e)}function P(t,e){this.mindMap.execCommand("SET_NODE_SIYUAN_HYPERLINK",this,t,e)}function W(t,e){this.mindMap.execCommand("SET_NODE_SIYUAN_PDF_HYPERLINK",this,t,e)}function H(t){this.mindMap.execCommand("SET_NODE_TAG",this,t)}function j(t){this.mindMap.execCommand("SET_NODE_SHAPE",this,t)}function G(t,e){this.mindMap.execCommand("SET_NODE_STYLE",this,t,e)}function $(t){this.mindMap.execCommand("SET_NODE_STYLES",this,t)}var U={setData:z,setText:A,setImage:O,setIcon:k,setHyperlink:I,setNote:B,setAttachment:F,setSiyuanHyperlink:P,setSiyuanPDFHyperlink:W,setTag:H,setShape:j,setStyle:G,setStyles:$},Y=i("723f"),X=i("4013");const V=(t,e)=>{const i=new r["d"],n=(new r["j"]).text(t);return e.text(n),i.add(n),i.bbox()},K={radius:3,fontSize:12,fill:"",height:20,paddingX:8};function q(){const t=this.getData("image");if(!t)return;const e=this.getImgShowSize(),i=(new r["e"]).load(t).size(...e),{defaultNodeImage:n}=this.mindMap.opt;if(n){const e=new Image;e.onerror=()=>{i.load(n)},e.src=t}return this.getData("imageTitle")&&i.attr("title",this.getData("imageTitle")),i.on("click",t=>{this.mindMap.emit("node_img_click",this,i,t)}),i.on("dblclick",t=>{this.mindMap.emit("node_img_dblclick",this,t,i)}),i.on("mouseenter",t=>{this.mindMap.emit("node_img_mouseenter",this,i,t)}),i.on("mouseleave",t=>{this.mindMap.emit("node_img_mouseleave",this,i,t)}),i.on("mousemove",t=>{this.mindMap.emit("node_img_mousemove",this,i,t)}),{node:i,width:e[0],height:e[1]}}function Z(){const{custom:t,width:e,height:i}=this.getData("imageSize");return t?[e,i]:Object(s["ub"])(e,i,this.mindMap.themeConfig.imgMaxWidth,this.mindMap.themeConfig.imgMaxHeight)}function Q(){let t=this.getData();if(!t.icon||t.icon.length<=0)return[];let e=this.mindMap.themeConfig.iconSize;return t.icon.map(t=>{let i=Y["a"].getNodeIconListIcon(t,this.mindMap.opt.iconList||[]),n=null;return n=/^{this.mindMap.emit("node_icon_click",this,t,e,n)}),n.on("mouseenter",e=>{this.mindMap.emit("node_icon_mouseenter",this,t,e,n)}),n.on("mouseleave",e=>{this.mindMap.emit("node_icon_mouseleave",this,t,e,n)}),{node:n,width:e,height:e}})}function J(t){const e=this.hasCustomWidth();let i="string"===typeof t?t:this.getData("text"),{textAutoWrapWidth:n,emptyTextMeasureHeightText:o}=this.mindMap.opt;n=e?this.customTextWidth:n;const a=new r["d"];let h=!1;this.getData("resetRichText")&&(delete this.nodeData.data.resetRichText,h=!0),h&&!Object(s["fb"])(i)&&(i=Object(s["h"])(i)?Object(s["sb"])(i):`

${i}

`,this.setData({text:i}));const d=[],l=Object(s["M"])(this);Object.keys(l).forEach(t=>{d.push([t,l[t]])}),this.mindMap.commonCaches.measureRichtextNodeTextSizeEl||(this.mindMap.commonCaches.measureRichtextNodeTextSizeEl=document.createElement("div"),this.mindMap.commonCaches.measureRichtextNodeTextSizeEl.style.position="fixed",this.mindMap.commonCaches.measureRichtextNodeTextSizeEl.style.left="-999999px",this.mindMap.el.appendChild(this.mindMap.commonCaches.measureRichtextNodeTextSizeEl));const c=this.mindMap.commonCaches.measureRichtextNodeTextSizeEl;d.forEach(([t,e])=>{c.style[t]=e}),c.style.lineHeight=1.2;const u=`
${i}
`;c.innerHTML=u;const f=c.children[0];f.classList.add("smm-richtext-node-wrap"),Object(s["b"])(f),f.style.maxWidth=n+"px",f.style.width=e?this.customTextWidth+"px":"";let{width:p,height:g}=f.getBoundingClientRect();if(g<=0){c.innerHTML=`

${o}

`;let t=c.children[0];t.classList.add("smm-richtext-node-wrap"),g=t.getBoundingClientRect().height,c.innerHTML=u}p=Math.min(Math.ceil(p)+1,n),g=Math.ceil(g),a.attr("data-width",p),a.attr("data-height",g);const m=Object(s["s"])({el:c.children[0],width:p,height:g}),b={"line-height":1.2};return d.forEach(([t,e])=>{b[Object(s["e"])(t)]=e}),m.css(b),a.add(m),{node:a,nodeContent:m,width:p,height:g}}function tt(t){if(this.getData("needUpdate")&&delete this.nodeData.data.needUpdate,this.getData("richText"))return this.createRichTextNode(t);const e="string"===typeof t?t:this.getData("text");this.getData("resetRichText")&&delete this.nodeData.data.resetRichText;const i=new r["d"],n=this.getStyle("fontSize",!1),o=this.getStyle("textAlign",!1);let a=[];Object(s["fb"])(e)||(a=String(e).split(/\n/gim));const{textAutoWrapWidth:h,emptyTextMeasureHeightText:d}=this.mindMap.opt;let l=a.length>1;a.forEach((t,e)=>{let i=t.split(""),n=[],o=[];while(i.length){let t=i.shift(),e=[...o,t].join("");V(e,this.style).width<=h?o.push(t):(n.push(o.join("")),o=[t])}o.length>0&&n.push(o.join("")),n.length>1&&(l=!0),a[e]=n.join("\n")}),a=a.join("\n").replace(/\n$/g,"").split(/\n/gim),a.forEach((t,e)=>{""===t&&(t="\ufeff");const s=(new r["j"]).text(t);s.addClass("smm-text-node-wrap"),s.attr("text-anchor",{left:"start",center:"middle",right:"end"}[o]||"start"),this.style.text(s),s.y(n*X["h"]*e+(X["h"]-1)*n/2),i.add(s)});let{width:c,height:u}=i.bbox();if(u<=0){const t=(new r["j"]).text(d);this.style.text(t);const e=t.bbox();u=e.height}return c=Math.min(Math.ceil(c),h),u=Math.ceil(u),i.attr("data-width",c),i.attr("data-height",u),i.attr("data-ismultiLine",l||a.length>1),{node:i,width:c,height:u}}function et(){const{hyperlink:t,hyperlinkTitle:e}=this.getData();if(!t)return;const{customHyperlinkJump:i,hyperlinkIcon:n}=this.mindMap.opt,{icon:o,style:s}=n,a=this.getNodeIconSize("hyperlinkIcon"),h=(new r["i"]).size(a,a),d=(new r["a"]).to(t).target("_blank");d.node.addEventListener("click",e=>{"function"===typeof i&&(e.preventDefault(),i(t,this)),this.mindMap.emit("node_kmind_hyperlinkClick",this,e,h)}),d.on("contextmenu",t=>{this.mindMap.emit("node_kmind_hyperlinkContextmenu",this,t,h)}),d.on("mouseenter",t=>{this.mindMap.emit("node_kmind_hyperlinkMouseenter",this,t,h)}),d.on("mouseleave",t=>{this.mindMap.emit("node_kmind_hyperlinkMouseleave",this,t,h)}),e&&h.add(Object(r["i"])(`${e}`)),d.rect(a,a).fill({color:"transparent"});const l=Object(r["i"])(o||Y["a"].hyperlink).size(a,a);return this.style.iconNode(l,s.color),d.add(l),h.add(d),{node:h,width:a,height:a}}function it(){const t=this.getData("tag");if(!t||t.length<=0)return[];let{maxTag:e,tagsColorMap:i}=this.mindMap.opt;i=i||{};const n=[];return t.slice(0,e).forEach((t,e)=>{let o="",a={...K};"string"===typeof t?o=t:(o=t.text,a={...K,...t.style});const h="undefined"!==typeof a.width,d=new r["d"];d.on("click",()=>{this.mindMap.emit("node_tag_click",this,t,e,d)});const l=(new r["j"]).text(o).attr("cursor","pointer");this.style.tagText(l,a);const{width:c,height:u}=l.bbox(),f=h?a.width:c+2*a.paddingX,p=h?Math.max(f,c):f,g=Math.max(a.height,u);h?l.x((p-c)/2):l.x(h?0:a.paddingX),l.cy(-g/2);const m=(new r["h"]).size(f,a.height).cy(-g/2).attr("cursor","pointer");h&&m.x((p-f)/2),this.style.tagRect(m,{...a,fill:a.fill||i[l.node.textContent]||Object(s["F"])(l.node.textContent)}),d.add(m).add(l),n.push({node:d,width:p,height:g})}),n}function nt(){if(!this.getData("note"))return null;const{icon:t,style:e}=this.mindMap.opt.noteIcon,i=this.getNodeIconSize("noteIcon"),n=(new r["i"]).attr("cursor","pointer").addClass("smm-node-note").size(i,i);n.add((new r["h"]).size(i,i).fill({color:"transparent"}));const o=Object(r["i"])(t||Y["a"].note).size(i,i);if(this.style.iconNode(o,e.color),n.add(o),!this.mindMap.opt.customNoteContentShow){if(!this.noteEl){this.noteEl=document.createElement("div"),this.noteEl.style.cssText=`\n position: fixed;\n padding: 10px;\n border-radius: 5px;\n box-shadow: 0 2px 5px rgb(0 0 0 / 10%);\n display: none;\n background-color: #fff;\n z-index: ${this.mindMap.opt.nodeNoteTooltipZIndex}\n `;const t=this.mindMap.opt.customInnerElsAppendTo||document.body;t.appendChild(this.noteEl)}this.noteEl.innerText=this.getData("note")}return n.on("mouseover",()=>{const{left:t,top:e}=this.getNoteContentPosition();this.mindMap.opt.customNoteContentShow?this.mindMap.opt.customNoteContentShow.show(this.getData("note"),t,e,this):(this.noteEl.style.left=t+"px",this.noteEl.style.top=e+"px",this.noteEl.style.display="block")}),n.on("mouseout",()=>{this.mindMap.opt.customNoteContentShow?this.mindMap.opt.customNoteContentShow.hide():this.noteEl.style.display="none"}),n.on("click",t=>{this.mindMap.emit("node_note_click",this,t,n)}),n.on("dblclick",t=>{this.mindMap.emit("node_note_dblclick",this,t,n)}),{node:n,width:i,height:i}}function ot(){const{attachmentUrl:t,attachmentName:e}=this.getData();if(!t)return;const i=this.getNodeIconSize("attachmentIcon"),{icon:n,style:o}=this.mindMap.opt.attachmentIcon,s=(new r["i"]).attr("cursor","pointer").size(i,i);e&&s.add(Object(r["i"])(`${e}`)),s.add((new r["h"]).size(i,i).fill({color:"transparent"}));const a=Object(r["i"])(n||Y["a"].attachment).size(i,i);return this.style.iconNode(a,o.color),s.add(a),s.on("click",t=>{this.mindMap.emit("node_attachmentClick",this,t,s)}),s.on("contextmenu",t=>{this.mindMap.emit("node_attachmentContextmenu",this,t,s)}),{node:s,width:i,height:i}}function rt(){const{siyuanHyperlink:t,siyuanHyperlinkTitle:e}=this.getData();if(!t)return;const{customSiyuanHyperlinkJump:i}=this.mindMap.opt,n=this.mindMap.themeConfig.iconSize,o=(new r["i"]).size(n,n),s=(new r["a"]).to(t).target("_blank");s.node.addEventListener("click",e=>{"function"===typeof i&&(e.preventDefault(),i(t,this)),this.mindMap.emit("node_siyuanHyperlinkClick",this,e,o)}),e&&o.add(Object(r["i"])(`${e}`)),s.rect(n,n).fill({color:"transparent"});const a=Object(r["i"])(Y["a"].siyuan).size(n,n);return this.style.iconNode(a),s.add(a),s.on("contextmenu",t=>{this.mindMap.emit("node_siyuanHyperlinkContextmenu",this,t,o)}),s.on("mouseenter",t=>{this.mindMap.emit("node_siyuanHyperlinkMouseenter",this,t,o)}),s.on("mouseleave",t=>{this.mindMap.emit("node_siyuanHyperlinkMouseleave",this,t,o)}),o.add(s),{node:o,width:n,height:n}}function st(){const{siyuanPDFLinkData:t}=this.getData();if(!t||!t.siyuanPDFHyperlink)return;const{siyuanPDFHyperlink:e,siyuanPDFHyperlinkTitle:i}=t,{customSiyuanPDFHyperlinkJump:n}=this.mindMap.opt,o=this.mindMap.themeConfig.iconSize,s=(new r["i"]).size(o,o),a=(new r["a"]).to(e).target("_blank");a.node.addEventListener("click",t=>{"function"===typeof n?(t.preventDefault(),n(e,this)):(t.preventDefault(),window.open(e,"_blank")),this.mindMap.emit("node_siyuanPDFHyperlinkClick",this,t,s)}),i&&s.add(Object(r["i"])(`${i}`)),a.rect(o,o).fill({color:"transparent"});const h=Object(r["i"])(Y["a"].siyuanPDFLink).size(o,o);return this.style.iconNode(h),a.add(h),a.on("contextmenu",t=>{this.mindMap.emit("node_siyuanPDFHyperlinkContextmenu",this,t,s)}),a.on("mouseenter",t=>{this.mindMap.emit("node_siyuanPDFHyperlinkMouseenter",this,t,s)}),a.on("mouseleave",t=>{this.mindMap.emit("node_siyuanPDFHyperlinkMouseleave",this,t,s)}),s.add(a),{node:s,width:o,height:o}}function at(t){const{style:e}=this.mindMap.opt[t];return Object(s["fb"])(e.size)?this.mindMap.themeConfig.iconSize:e.size}function ht(){const t=this.getNodeIconSize("noteIcon"),{scaleY:e}=this.mindMap.view.getTransformData().transform,i=t*e;let{left:n,top:o}=this._noteData.node.node.getBoundingClientRect();return o+=i,{left:n,top:o}}function dt(t){const e=this.nodeData&&this.nodeData.data,i=e&&"number"===typeof e.customHeight&&e.customHeight>0,n="number"===typeof this._customNodeHeight&&this._customNodeHeight>0,o=t&&"function"===typeof t.getAttribute?t.getAttribute("data-smm-measure"):null;if("fixed"===o){const t=160,o=this.customTextWidth||this.mindMap.opt.textAutoWrapWidth,r=n?this._customNodeHeight:i?e.customHeight:t;return{width:o,height:r}}this.mindMap.commonCaches.measureCustomNodeContentSizeEl||(this.mindMap.commonCaches.measureCustomNodeContentSizeEl=document.createElement("div"),this.mindMap.commonCaches.measureCustomNodeContentSizeEl.style.cssText="\n position: fixed;\n left: -99999px;\n top: -99999px;\n ",this.mindMap.el.appendChild(this.mindMap.commonCaches.measureCustomNodeContentSizeEl)),this.mindMap.commonCaches.measureCustomNodeContentSizeEl.innerHTML="",this.mindMap.commonCaches.measureCustomNodeContentSizeEl.appendChild(t);let r=this.mindMap.commonCaches.measureCustomNodeContentSizeEl.getBoundingClientRect();return{width:r.width,height:r.height}}function lt(){return!!this._customNodeContent}var ct={createImgNode:q,getImgShowSize:Z,createIconNode:Q,createRichTextNode:J,createTextNode:tt,createHyperlinkNode:et,createTagNode:it,createNoteNode:nt,createAttachmentNode:ot,createSiyuanHyperlinkNode:rt,createSiyuanPDFLinkNode:st,getNoteContentPosition:ht,getNodeIconSize:at,measureCustomNodeContentSize:dt,isUseCustomNodeContent:lt};function ut(){if(this.getChildrenLength()<=0||this.isRoot)return;const{alwaysShowExpandBtn:t,notShowExpandBtn:e,expandBtnSize:i}=this.mindMap.opt;if(!t&&!e){let{width:t,height:e}=this;this._unVisibleRectRegionNode||(this._unVisibleRectRegionNode=new r["h"],this._unVisibleRectRegionNode.fill({color:"transparent"})),this.group.add(this._unVisibleRectRegionNode);const n=this.getLayoutInstance();n.renderExpandBtnRect(this._unVisibleRectRegionNode,i,t,e,this)}}function ft(){this._unVisibleRectRegionNode&&(this._unVisibleRectRegionNode.remove(),this._unVisibleRectRegionNode=null)}function pt(){this.needRerenderExpandBtnPlaceholderRect&&(this.needRerenderExpandBtnPlaceholderRect=!1,this.renderExpandBtnPlaceholderRect()),this.getChildrenLength()>0?this._unVisibleRectRegionNode||this.renderExpandBtnPlaceholderRect():this._unVisibleRectRegionNode&&this.clearExpandBtnPlaceholderRect()}var gt={renderExpandBtnPlaceholderRect:ut,clearExpandBtnPlaceholderRect:ft,updateExpandBtnPlaceholderRect:pt};function mt(){const{isUseCustomNodeContent:t,customCreateNodeContent:e}=this.mindMap.opt,i=this.checkEnableDragModifyNodeWidth(),n=t&&e;(i||n)&&(this._dragHandleNodes=null,this.dragHandleWidth=4,this.dragHandleMousedownX=0,this.isDragHandleMousedown=!1,this.dragHandleIndex=0,this.dragHandleMousedownCustomTextWidth=0,this.dragHandleMousedownBodyCursor="",this.dragHandleMousedownLeft=0,this._customSizeHandle=null,this.isCustomSizeMousedown=!1,this.customSizeMousedownX=0,this.customSizeMousedownY=0,this.customSizeStartWidth=0,this.customSizeStartHeight=0,this.onDragMousemoveHandle=this.onDragMousemoveHandle.bind(this),window.addEventListener("mousemove",this.onDragMousemoveHandle),this.onDragMouseupHandle=this.onDragMouseupHandle.bind(this),window.addEventListener("mouseup",this.onDragMouseupHandle),this.mindMap.on("node_mouseup",this.onDragMouseupHandle))}function bt(t){const{minNodeTextModifyWidth:e,maxNodeTextModifyWidth:i,isUseCustomNodeContent:n,customCreateNodeContent:o}=this.mindMap.opt,r=n&&o&&this._customNodeContent;if(this.isCustomSizeMousedown&&r){t.stopPropagation(),t.preventDefault();const{scaleX:n,scaleY:o}=this.mindMap.draw.transform(),r=(t.clientX-this.customSizeMousedownX)/n,s=(t.clientY-this.customSizeMousedownY)/o;let a=this.customSizeStartWidth+r,h=this.customSizeStartHeight+s;return a=Math.max(a,e),-1!==i&&(a=Math.min(a,i)),h=Math.max(h,60),document.body.style.cursor="se-resize",this.group.css({cursor:"se-resize"}),this.customTextWidth=a,this._customNodeHeight=h,this._customNodeContent&&this._customNodeContent.style&&(this._customNodeContent.style.width=a+"px",this._customNodeContent.style.height=h+"px"),void this.reRender([],{ignoreUpdateCustomTextWidth:!0})}if(!this.isDragHandleMousedown)return;t.stopPropagation(),t.preventDefault(),document.body.style.cursor="ew-resize",this.group.css({cursor:"ew-resize"});const{scaleX:s}=this.mindMap.draw.transform(),a=t.clientX-this.dragHandleMousedownX;let h=this.dragHandleMousedownCustomTextWidth+(0===this.dragHandleIndex?-a:a)/s;if(h=Math.max(h,e),-1!==i&&(h=Math.min(h,i)),!r&&this.getData("image")){const t=this.getImgShowSize();this._rectInfo.textContentWidth-this.customTextWidth+h<=t[0]&&(h=t[0]+this.customTextWidth-this._rectInfo.textContentWidth)}this.customTextWidth=h,0===this.dragHandleIndex&&(this.left=this.dragHandleMousedownLeft+a/s),this.reRender(r?[]:["text"],{ignoreUpdateCustomTextWidth:!0})}function xt(){if(this.isCustomSizeMousedown)return document.body.style.cursor=this.dragHandleMousedownBodyCursor,this.group.css({cursor:"default"}),this.isCustomSizeMousedown=!1,this.setData({customTextWidth:this.customTextWidth,customHeight:this._customNodeHeight}),this.mindMap.render(),void this.mindMap.emit("dragModifyNodeSizeEnd",this);this.isDragHandleMousedown&&(document.body.style.cursor=this.dragHandleMousedownBodyCursor,this.group.css({cursor:"default"}),this.isDragHandleMousedown=!1,this.dragHandleMousedownX=0,this.dragHandleIndex=0,this.dragHandleMousedownCustomTextWidth=0,this.setData({customTextWidth:this.customTextWidth}),this.mindMap.render(),this.mindMap.emit("dragModifyNodeWidthEnd",this))}function yt(){const t=[new r["h"],new r["h"]];return t.forEach((t,e)=>{t.size(this.dragHandleWidth,this.height).fill({color:"transparent"}).css({cursor:"ew-resize"}),t.on("mousedown",t=>{t.stopPropagation(),t.preventDefault(),this.dragHandleMousedownX=t.clientX,this.dragHandleIndex=e,this.dragHandleMousedownCustomTextWidth=void 0===this.customTextWidth?this._textData?this._textData.width:this.width:this.customTextWidth,this.dragHandleMousedownBodyCursor=document.body.style.cursor,this.dragHandleMousedownLeft=this.left,this.isDragHandleMousedown=!0})}),t}function wt(){const{isUseCustomNodeContent:t,customCreateNodeContent:e}=this.mindMap.opt,i=t&&e&&this._customNodeContent;if(this.checkEnableDragModifyNodeWidth()&&(this._dragHandleNodes||(this._dragHandleNodes=this.createDragHandleNode()),this.getData("isActive")?(this._dragHandleNodes.forEach(t=>{t.height(this.height),this.group.add(t)}),this._dragHandleNodes[1].x(this.width-this.dragHandleWidth)):this._dragHandleNodes&&this._dragHandleNodes.forEach(t=>{t.remove()})),i){if(!this._customSizeHandle){const t=10,e=new r["h"];e.size(t,t).fill({color:"transparent"}).css({cursor:"se-resize"}),e.on("mousedown",t=>{t.stopPropagation(),t.preventDefault(),this.customSizeMousedownX=t.clientX,this.customSizeMousedownY=t.clientY,this.customSizeStartWidth=this.customTextWidth||this.width,this.customSizeStartHeight=this._customNodeHeight||this.height,this.dragHandleMousedownBodyCursor=document.body.style.cursor,this.isCustomSizeMousedown=!0}),this._customSizeHandle=e}if(this.getData("isActive")){const t=this._customSizeHandle,e=t.height();t.x(this.width-e).y(this.height-e),this.group.add(t)}else this._customSizeHandle&&this._customSizeHandle.remove()}}var Ct={initDragHandle:mt,onDragMousemoveHandle:bt,onDragMouseupHandle:xt,createDragHandleNode:yt,updateDragHandle:wt};function vt(){this.mindMap.cooperate&&(this._userListGroup=new r["d"],this.group.add(this._userListGroup))}function _t(t){const{avatarSize:e,fontSize:i}=this.mindMap.opt.cooperateStyle,n=new r["d"],o=t.isMore?t.name:String(t.name)[0],a=(new r["b"]).size(e,e);a.fill({color:t.color||Object(s["F"])(o)});const h=(new r["j"]).text(o).fill({color:"#fff"}).css({"font-size":i+"px"}).dx(-i/2).dy((e-i)/2);return n.add(a).add(h),n}function Mt(t){const{avatarSize:e}=this.mindMap.opt.cooperateStyle;return(new r["e"]).load(t.avatar).size(e,e)}function Et(){if(!this._userListGroup)return;const{avatarSize:t}=this.mindMap.opt.cooperateStyle;this._userListGroup.clear();const e=this.userList.length,i=Math.floor(this.width/t),n=[];e>i?n.push(...this.userList.slice(0,i-1),{isMore:!0,name:"+"+(e-i+1)}):n.push(...this.userList),n.forEach((e,i)=>{let n=null;n=e.avatar?this.createImageAvatar(e):this.createTextAvatar(e),n.on("click",t=>{this.mindMap.emit("node_cooperate_avatar_click",e,this,n,t)}),n.on("mouseenter",t=>{this.mindMap.emit("node_cooperate_avatar_mouseenter",e,this,n,t)}),n.on("mouseleave",t=>{this.mindMap.emit("node_cooperate_avatar_mouseleave",e,this,n,t)}),n.x(i*t).cy(-t/2),this._userListGroup.add(n)})}function Nt(t){this.userList.find(e=>e.id==t.id)||(this.userList.push(t),this.updateUserListNode())}function Tt(t){const e=this.userList.findIndex(e=>e.id==t.id);-1!==e&&(this.userList.splice(e,1),this.updateUserListNode())}function Lt(){this.userList=[],this.updateUserListNode()}var St={createUserListNode:vt,updateUserListNode:Et,createTextAvatar:_t,createImageAvatar:Mt,addUser:Nt,removeUser:Tt,emptyUser:Lt};function Dt(){this.isGeneralization||(this._quickCreateChildBtn=null,this._showQuickCreateChildBtn=!1)}function Rt(){if(this.nodeData.data.isFlowChart)return;if(this.isGeneralization||this.getChildrenLength()>0)return;if(this._quickCreateChildBtn)this.group.add(this._quickCreateChildBtn);else{const{quickCreateChildBtnIcon:t,expandBtnStyle:e,expandBtnSize:i}=this.mindMap.opt,{icon:n,style:o}=t;let{color:s,fill:a}=e||{color:"#808080",fill:"#fff"};s=o.color||s;const h=Object(r["i"])(n||v["a"].quickCreateChild).size(i,i);h.css({cursor:"pointer"}),h.x(0).y(-i/2),this.style.iconNode(h,s);const d=(new r["b"]).size(i);d.x(0).y(-i/2),d.fill({color:a}).css({cursor:"pointer"}),this._quickCreateChildBtn=new r["d"],this._quickCreateChildBtn.add(d).add(h),this._quickCreateChildBtn.on("click",t=>{t.stopPropagation(),this.mindMap.emit("quick_create_btn_click",this);const{customQuickCreateChildBtnClick:e}=this.mindMap.opt;"function"!==typeof e?this.mindMap.execCommand("INSERT_CHILD_NODE",!0,[this]):e(this)}),this._quickCreateChildBtn.on("dblclick",t=>{t.stopPropagation()}),this._quickCreateChildBtn.addClass("smm-quick-create-child-btn"),this.group.add(this._quickCreateChildBtn)}this._showQuickCreateChildBtn=!0;const t=this.getLayoutInstance();t.renderExpandBtn(this,this._quickCreateChildBtn)}function zt(){this.isGeneralization||this._quickCreateChildBtn&&this._showQuickCreateChildBtn&&(this._quickCreateChildBtn.remove(),this._showQuickCreateChildBtn=!1)}function At(){if(this.isGeneralization)return;const{isActive:t}=this.getData();t||this.removeQuickCreateChildBtn()}var Ot={initQuickCreateChildBtn:Dt,showQuickCreateChildBtn:Rt,removeQuickCreateChildBtn:zt,hideQuickCreateChildBtn:At};function kt(t,e,i,n,o){const{imgTextMargin:r}=this.mindMap.opt;return"v"===t?n>0&&o>0?r:0:e>0&&i>0?r:0}function It(t){let e=0,i=this._tagData.reduce((t,i)=>(e=Math.max(e,i.height),t+i.width),0);return i+=(this._tagData.length-1)*t,{width:i,height:e}}function Bt(){if(this.isUseCustomNodeContent()){const t=this.measureCustomNodeContentSize(this._customNodeContent);return{width:this.hasCustomWidth()?this.customTextWidth:t.width,height:t.height}}const{TAG_PLACEMENT:t,IMG_PLACEMENT:e}=X["a"],{textContentMargin:i}=this.mindMap.opt,n=this.getStyle("tagPlacement")||t.RIGHT,o=n===t.BOTTOM,r=this.getStyle("imgPlacement")||e.TOP;let s=0,a=0,h=0,d=0,l=0,c=0,u=0;if(this._imgData&&(s=this._imgData.width,a=this._imgData.height),this.mindMap.nodeInnerPrefixList.forEach(t=>{const e=this[`_${t.name}Data`];e&&(h+=e.width,d=Math.max(d,e.height),u++)}),this._prefixData&&(h+=this._prefixData.width,d=Math.max(d,this._prefixData.height),u++),this._iconData.length>0&&(h+=this._iconData.reduce((t,e)=>(d=Math.max(d,e.height),t+e.width),0)+(this._iconData.length-1)*i,u++),this._textData&&(h+=this._textData.width,d=Math.max(d,this._textData.height),u++),this._hyperlinkData&&(h+=this._hyperlinkData.width,d=Math.max(d,this._hyperlinkData.height),u++),this._tagData.length>0){const{width:t,height:e}=this.getTagContentSize(i);o?(l=t,c=e):(h+=t,d=Math.max(d,e),u++)}this._noteData&&(h+=this._noteData.width,d=Math.max(d,this._noteData.height),u++),this._attachmentData&&(h+=this._attachmentData.width,d=Math.max(d,this._attachmentData.height),u++),this._siyuanHyperlinkData&&(h+=this._siyuanHyperlinkData.width,d=Math.max(d,this._siyuanHyperlinkData.height)),this._siyuanPDFLinkData&&(h+=this._siyuanPDFLinkData.width,d=Math.max(d,this._siyuanPDFLinkData.height)),this._postfixData&&(h+=this._postfixData.width,d=Math.max(d,this._postfixData.height),u++),h+=(u-1)*i,o&&h>0&&c>0&&(this._rectInfo.textContentWidthWithoutTag=h,h=Math.max(h,l),d=d+i+c),this._rectInfo.textContentWidth=h,this._rectInfo.textContentHeight=d;let f=0,p=0;[e.TOP,e.BOTTOM].includes(r)?(f=Math.max(s,h),p=a+d+this.getImgTextMarin("v",0,0,a,d)):(f=s+h+this.getImgTextMarin("h",s,h),p=Math.max(a,d));const{paddingX:g,paddingY:m}=this.getPaddingVale(),{paddingX:b,paddingY:x}=this.shapeInstance.getShapePadding(f,p,g,m);this.shapePadding.paddingX=b,this.shapePadding.paddingY=x;const y=this.getBorderWidth();return{width:f+2*g+2*b+y,height:p+2*m+2*x+y}}function Ft(){if(!this.group)return;this.group.clear();const{hoverRectPadding:t,openRealtimeRenderOnNodeTextEdit:e,textContentMargin:i,addCustomContentToNode:n}=this.mindMap.opt,{width:o,height:a}=this;let{paddingX:h,paddingY:d}=this.getPaddingVale();const l=this.getBorderWidth()/2;h+=this.shapePadding.paddingX+l,d+=this.shapePadding.paddingY+l,this.shapeNode=this.shapeInstance.createShape(),this.shapeNode.addClass("smm-node-shape"),this.shapeNode.translate(l,l),this.style.shape(this.shapeNode),this.group.add(this.shapeNode),this.renderExpandBtnPlaceholderRect(),this.createUserListNode&&this.createUserListNode(),this.isGeneralization&&this.generalizationBelongNode&&this.group.addClass("generalization_"+this.generalizationBelongNode.uid);const c=()=>{this.hoverNode=(new r["h"]).size(o+2*t,a+2*t).x(-t).y(-t),this.hoverNode.addClass("smm-hover-node"),this.nodeData.data.isFlowChart&&this.hoverNode.css("pointer-events","none"),this.style.hoverNode(this.hoverNode,o,a),this.group.add(this.hoverNode)};if(this.isUseCustomNodeContent()){const t=Object(s["s"])({el:this._customNodeContent,width:o,height:a});return this.group.add(t),void c()}const{IMG_PLACEMENT:u,TAG_PLACEMENT:f}=X["a"],p=this.getStyle("imgPlacement")||u.TOP,g=this.getStyle("tagPlacement")||f.RIGHT,m=g===f.BOTTOM;let{textContentWidth:b,textContentHeight:x,textContentWidthWithoutTag:y}=this._rectInfo;const w=x;let C=0,v=0;const _=this._tagData&&this._tagData.length>0;if(_){const t=this.getTagContentSize(i);C=t.width,v=t.height,m&&(x-=v+i)}let M=0,E=0;if(this._imgData)switch(M=this._imgData.width,E=this._imgData.height,this.group.add(this._imgData.node),p){case u.TOP:this._imgData.node.cx(o/2).y(d);break;case u.BOTTOM:this._imgData.node.cx(o/2).y(a-d-E);break;case u.LEFT:this._imgData.node.x(h).cy(a/2);break;case u.RIGHT:this._imgData.node.x(o-h-M).cy(a/2);break;default:break}let N=new r["d"],T=0;if(_&&m&&(T=y{const e=this[`_${t.name}Data`];e&&(e.node.x(T).y((x-e.height)/2),N.add(e.node),T+=e.width+i)}),this._prefixData){const t=Object(s["s"])({el:this._prefixData.el,width:this._prefixData.width,height:this._prefixData.height});t.x(T).y((x-this._prefixData.height)/2),N.add(t),T+=this._prefixData.width+i}let L=new r["d"];if(this._iconData&&this._iconData.length>0){let t=0;this._iconData.forEach(e=>{e.node.x(T+t).y((x-e.height)/2),L.add(e.node),t+=e.width+i}),N.add(L),T+=t}if(this._textData){const t=this._textData.node.attr("data-offsetx")||0;this._textData.node.attr("data-offsetx",T),(this._textData.nodeContent||this._textData.node).x(-t).x(T).y((x-this._textData.height)/2),e&&this._textData.node.opacity(this.mindMap.renderer.textEdit.getCurrentEditNode()===this?0:1),N.add(this._textData.node),T+=this._textData.width+i}this._hyperlinkData&&(this._hyperlinkData.node.x(T).y((x-this._hyperlinkData.height)/2),N.add(this._hyperlinkData.node),T+=this._hyperlinkData.width+i);let S=new r["d"];if(_)if(m){let t=0;this._tagData.forEach(e=>{e.node.x(t).y((v-e.height)/2),S.add(e.node),t+=e.width+i}),S.x((b-C)/2).y(w-v),N.add(S)}else{let t=0;this._tagData.forEach(e=>{e.node.x(T+t).y((x-e.height)/2),S.add(e.node),t+=e.width+i}),N.add(S),T+=t}if(this._noteData&&(this._noteData.node.x(T).y((x-this._noteData.height)/2),N.add(this._noteData.node),T+=this._noteData.width+i),this._attachmentData&&(this._attachmentData.node.x(T).y((x-this._attachmentData.height)/2),N.add(this._attachmentData.node),T+=this._attachmentData.width+i),this._siyuanHyperlinkData&&(this._siyuanHyperlinkData.node.x(T).y((x-this._siyuanHyperlinkData.height)/2),N.add(this._siyuanHyperlinkData.node),T+=this._siyuanHyperlinkData.width),this._siyuanPDFLinkData&&(this._siyuanPDFLinkData.node.x(T).y((x-this._siyuanPDFLinkData.height)/2),N.add(this._siyuanPDFLinkData.node),T+=this._siyuanPDFLinkData.width),this._postfixData){const t=Object(s["s"])({el:this._postfixData.el,width:this._postfixData.width,height:this._postfixData.height});t.x(T).y((x-this._postfixData.height)/2),N.add(t),T+=this._postfixData.width}this.group.add(N);let{width:D,height:R}=N.bbox();(!Number.isFinite(D)||D<=0)&&(D=b||y||0),(!Number.isFinite(R)||R<=0)&&(R=w||x||0);let z=0,A=0;switch(p){case u.TOP:z=o/2-D/2,A=d+E+this.getImgTextMarin("v",0,0,E,w);break;case u.BOTTOM:z=o/2-D/2,A=d;break;case u.LEFT:z=M+h+this.getImgTextMarin("h",M,b),A=a/2-R/2;break;case u.RIGHT:z=h,A=a/2-R/2;break}if(N.translate(z,A),c(),this._customContentAddToNodeAdd&&this._customContentAddToNodeAdd.el){const t=Object(s["s"])(this._customContentAddToNodeAdd);this.group.add(t),n&&"function"===typeof n.handle&&n.handle({content:this._customContentAddToNodeAdd,element:t,node:this})}this.nodeData.data.isFlowChart&&this._flowChartConnector&&setTimeout(()=>{this._flowChartConnector&&this._flowChartConnector.renderConnectors()},0),this.mindMap.emit("node_layout_end",this)}var Pt={getImgTextMarin:kt,getTagContentSize:It,getNodeRect:Bt,layout:Ft},Wt=i("8d8b"),Ht=i("14d0");class jt{constructor(t={}){this.opt=t,this.nodeData=this.handleData(t.data||{}),this.nodeDataSnapshot="",this.uid=t.uid,this.mindMap=t.mindMap,this.renderer=t.renderer,this.draw=this.mindMap.draw,this.nodeDraw=this.mindMap.nodeDraw,this.lineDraw=this.mindMap.lineDraw,this.style=new n["a"](this),this.effectiveStyles={},this.shapeInstance=new o["a"](this),this.shapePadding={paddingX:0,paddingY:0},this.isRoot=void 0!==t.isRoot&&t.isRoot,this.isGeneralization=void 0!==t.isGeneralization&&t.isGeneralization,this.generalizationBelongNode=null,this.layerIndex=void 0===t.layerIndex?0:t.layerIndex,this.width=t.width||0,this.height=t.height||0,this.customTextWidth=t.data.data.customTextWidth||void 0,this._left=t.left||0,this._top=t.top||0,this.customLeft=t.data.data.customLeft||void 0,this.customTop=t.data.data.customTop||void 0,this.isDrag=!1,this.parent=t.parent||null,this.children=t.children||[],this.userList=[],this.group=null,this.shapeNode=null,this.hoverNode=null,this._customNodeContent=null,this._imgData=null,this._iconData=null,this._textData=null,this._hyperlinkData=null,this._tagData=null,this._noteData=null,this.noteEl=null,this.noteContentIsShow=!1,this._attachmentData=null,this._siyuanHyperlinkData=null,this._siyuanPDFLinkData=null,this._prefixData=null,this._postfixData=null,this._expandBtn=null,this._lastExpandBtnType=null,this._showExpandBtn=!1,this._openExpandNode=null,this._closeExpandNode=null,this._fillExpandNode=null,this._userListGroup=null,this._lines=[],this._generalizationList=[],this._unVisibleRectRegionNode=null,this._isMouseenter=!1,this._customContentAddToNodeAdd=null,this._rectInfo={textContentWidth:0,textContentHeight:0,textContentWidthWithoutTag:0},this._generalizationNodeWidth=0,this._generalizationNodeHeight=0,this.expandBtnSize=this.mindMap.opt.expandBtnSize,this.isMultipleChoice=!1,this.needLayout=!1,this.isHide=!1;const e=Object.getPrototypeOf(this);e.bindEvent||(Object.keys(Pt).forEach(t=>{e[t]=Pt[t]}),Object.keys(C).forEach(t=>{e[t]=C[t]}),Object.keys(R).forEach(t=>{e[t]=R[t]}),Object.keys(gt).forEach(t=>{e[t]=gt[t]}),Object.keys(U).forEach(t=>{e[t]=U[t]}),Object.keys(ct).forEach(t=>{e[t]=ct[t]}),this.mindMap.cooperate&&Object.keys(St).forEach(t=>{e[t]=St[t]}),Object.keys(Ct).forEach(t=>{e[t]=Ct[t]}),this.mindMap.opt.isShowCreateChildBtnIcon&&(Object.keys(Ot).forEach(t=>{e[t]=Ot[t]}),this.initQuickCreateChildBtn()),e.bindEvent=!0),this.getSize(),this.updateGeneralization(),this.initDragHandle(),this.nodeData.data.isFlowChart&&(Wt["default"].applyBehavior(this),this._flowChartConnector=new Ht["default"](this))}get left(){return this.customLeft||this._left}set left(t){this._left=t}get top(){return this.customTop||this._top}set top(t){this._top=t}reset(){this.children=[],this.parent=null,this.isRoot=!1,this.layerIndex=0,this.left=0,this.top=0}resetWhenDelete(){this._isMouseenter=!1}handleData(t){return t.data.expand=!1!==t.data.expand,t.data.isActive=!0===t.data.isActive,t.children=t.children||[],t}createNodeData(t){const{isUseCustomNodeContent:e,customCreateNodeContent:i,createNodePrefixContent:n,createNodePostfixContent:o,addCustomContentToNode:r}=this.mindMap.opt,a=["custom","image","icon","text","hyperlink","tag","note","attachment","prefix","postfix",...this.mindMap.nodeInnerPrefixList.map(t=>t.name)],h={};Array.isArray(t)?a.forEach(e=>{t.includes(e)&&(h[e]=!0)}):a.forEach(t=>{h[t]=!0}),e&&i&&h.custom&&(this._customNodeContent=i(this)),this._customNodeContent?Object(s["b"])(this._customNodeContent):(h.image&&(this._imgData=this.createImgNode()),h.icon&&(this._iconData=this.createIconNode()),h.text&&(this._textData=this.createTextNode()),h.hyperlink&&(this._hyperlinkData=this.createHyperlinkNode()),h.tag&&(this._tagData=this.createTagNode()),h.note&&(this._noteData=this.createNoteNode()),h.attachment&&(this._attachmentData=this.createAttachmentNode()),this.mindMap.nodeInnerPrefixList.forEach(t=>{h[t.name]&&(this[`_${t.name}Data`]=t.createContent(this))}),this._siyuanHyperlinkData=this.createSiyuanHyperlinkNode(),this._siyuanPDFLinkData=this.createSiyuanPDFLinkNode(),h.prefix&&(this._prefixData=n?n(this):null,this._prefixData&&this._prefixData.el&&Object(s["b"])(this._prefixData.el)),h.postfix&&(this._postfixData=o?o(this):null,this._postfixData&&this._postfixData.el&&Object(s["b"])(this._postfixData.el)),r&&"function"===typeof r.create&&(this._customContentAddToNodeAdd=r.create(this),this._customContentAddToNodeAdd&&this._customContentAddToNodeAdd.el&&Object(s["b"])(this._customContentAddToNodeAdd.el)))}getSize(t,e={}){const i=e.ignoreUpdateCustomTextWidth||!1;i||(this.customTextWidth=this.getData("customTextWidth")||void 0),this.customLeft=this.getData("customLeft")||void 0,this.customTop=this.getData("customTop")||void 0,this.createNodeData(t);const{width:n,height:o}=this.getNodeRect(),r=this.width!==n||this.height!==o;return this.width=n,this.height=o,r}bindGroupEvent(){const t=t=>Object(s["ab"])(this.mindMap,t);this.group.on("click",e=>{if(!t(e)){if(this.mindMap.emit("node_click",this,e),this.isMultipleChoice)return e.stopPropagation(),void(this.isMultipleChoice=!1);this.mindMap.opt.onlyOneEnableActiveNodeOnCooperate&&this.userList.length>0||this.active(e)}}),this.group.on("mousedown",e=>{if(t(e))return;const{readonly:i,enableCtrlKeyNodeSelection:n,useLeftKeySelectionRightKeyDrag:o,mousedownEventPreventDefault:r}=this.mindMap.opt;if(r&&e.preventDefault(),i||(this.isRoot?3!==e.which||o||e.stopPropagation():2!==e.which&&e.stopPropagation()),!i&&(e.ctrlKey||e.metaKey)&&n){this.isMultipleChoice=!0;const t=this.getData("isActive");t||this.mindMap.emit("before_node_active",this,this.renderer.activeNodeList),this.mindMap.renderer[t?"removeNodeFromActiveList":"addNodeToActiveList"](this,!0),this.renderer.emitNodeActiveEvent(t?null:this)}this.mindMap.emit("node_mousedown",this,e)}),this.group.on("mouseup",e=>{t(e)||(this.isRoot||2===e.which||this.mindMap.opt.readonly||e.stopPropagation(),this.mindMap.emit("node_mouseup",this,e))}),this.group.on("mouseenter",e=>{t(e)||this.isDrag||(this._isMouseenter=!0,this.nodeData.data.isFlowChart?this._flowChartConnector&&setTimeout(()=>{this._isMouseenter&&this._flowChartConnector&&this._flowChartConnector.showConnectors()},10):this.showExpandBtn(),this.isGeneralization&&this.handleGeneralizationMouseenter(),this.mindMap.emit("node_mouseenter",this,e))}),this.group.on("mouseleave",e=>{t(e)||this._isMouseenter&&(this._isMouseenter=!1,this.nodeData.data.isFlowChart?this._flowChartConnector&&this._flowChartConnector.hideConnectors():this.hideExpandBtn(),this.isGeneralization&&this.handleGeneralizationMouseleave(),this.mindMap.emit("node_mouseleave",this,e))}),this.group.on("dblclick",e=>{if(t(e))return;const{readonly:i,onlyOneEnableActiveNodeOnCooperate:n}=this.mindMap.opt;i||e.ctrlKey||e.metaKey||(e.stopPropagation(),n&&this.userList.length>0||this.mindMap.emit("node_dblclick",this,e))}),this.group.on("contextmenu",e=>{if(t(e))return;const{readonly:i,useLeftKeySelectionRightKeyDrag:n}=this.mindMap.opt;i||e.ctrlKey||(e.stopPropagation(),e.preventDefault(),this.mindMap.select&&!n&&this.mindMap.select.hasSelectRange()||(this.getData("isActive")&&1===this.renderer.activeNodeList.length||(this.renderer.clearActiveNodeList(),this.active(e)),this.mindMap.emit("node_contextmenu",e,this)))})}active(t){this.mindMap.opt.readonly||(t&&t.stopPropagation(),this.getData("isActive")||(this.mindMap.emit("before_node_active",this,this.renderer.activeNodeList),this.renderer.clearActiveNodeList(),this.renderer.addNodeToActiveList(this,!0),this.renderer.emitNodeActiveEvent(this)))}deactivate(){this.mindMap.renderer.removeNodeFromActiveList(this),this.mindMap.renderer.emitNodeActiveEvent()}update(t){if(!this.group)return;this.updateNodeActiveClass();const{alwaysShowExpandBtn:e,notShowExpandBtn:i,isShowCreateChildBtnIcon:n}=this.mindMap.opt,o=this.getChildrenLength();if(!i)if(e)this._expandBtn&&o<=0?this.removeExpandBtn():this.renderExpandBtn();else{const{isActive:t,expand:e}=this.getData();o<=0?this.removeExpandBtn():!e||t||this._isMouseenter?this.nodeData.data.isFlowChart||this.showExpandBtn():this.hideExpandBtn()}if(n)if(o>0||this.nodeData.data.isFlowChart)this.removeQuickCreateChildBtn();else{const{isActive:t}=this.getData();t?this.showQuickCreateChildBtn():this.hideQuickCreateChildBtn()}this.updateDragHandle(),this.renderGeneralization(t),this.updateUserListNode&&this.updateUserListNode();const r=this.group.transform();this.nodeDataSnapshot=JSON.stringify(this.getData()),this.left===r.translateX&&this.top===r.translateY||this.group.translate(this.left-r.translateX,this.top-r.translateY)}getNodePosInClient(t,e){const i=this.mindMap.draw.transform(),{scaleX:n,scaleY:o,translateX:r,translateY:s}=i,a=t*n+r,h=e*o+s;return{left:a,top:h}}checkIsInClient(t=0){const{left:e,top:i}=this.getNodePosInClient(this.left,this.top);return e+this.width>0-t&&i+this.height>0-t&&e{}),e=!1,i=!1){this.renderLine();const{openPerformance:n,performanceConfig:o}=this.mindMap.opt;if(e||!n||this.checkIsInClient(o.padding)||this.isRoot?this.group?(this.nodeDraw.has(this.group)||this.nodeDraw.add(this.group),this.needLayout&&(this.needLayout=!1,this.layout()),this.updateExpandBtnPlaceholderRect(),this.update(e)):(this.group=new r["d"],this.group.addClass("smm-node"),this.group.attr("data-id",this.uid),this.group.css({cursor:"default"}),this.bindGroupEvent(),this.nodeDraw.add(this.group),this.layout(),this.update(e)):n&&o.removeNodeWhenOutCanvas&&this.removeSelf(),this.children&&this.children.length&&!1!==this.getData("expand")&&!this.nodeData.data.isFlowChart){let n=0;this.children.forEach(o=>{const r=()=>{o.render(()=>{n++,n>=this.children.length&&t()},e,i)};i?setTimeout(r,0):r()})}else t();this.nodeData.inserting&&(delete this.nodeData.inserting,this.active(),this.mindMap.emit("node_dblclick",this,null,!0))}removeSelf(){this.group&&(this.group.remove(),this.removeGeneralization())}remove(){this.group&&(this.group.remove(),this.removeGeneralization(),this.removeLine(),this.children&&this.children.length&&this.children.forEach(t=>{t.remove()}))}destroy(){this.removeLine(),this.parent&&this.parent.removeLine(),this.group&&(this.emptyUser&&this.emptyUser(),this.resetWhenDelete(),this.group.remove(),this.removeGeneralization(),this.group=null,this.style.onRemove())}hide(){if(this.group&&this.group.hide(),this.hideGeneralization(),this.parent){const t=this.parent.children.indexOf(this);this.parent._lines[t]&&this.parent._lines[t].hide(),this._lines.forEach(t=>{t.hide()})}this.children&&this.children.length&&this.children.forEach(t=>{t.hide()})}show(){if(this.group){if(this.group.show(),this.showGeneralization(),this.parent){const t=this.parent.children.indexOf(this);this.parent._lines[t]&&this.parent._lines[t].show(),this._lines.forEach(t=>{t.show()})}this.children&&this.children.length&&this.children.forEach(t=>{t.show()})}}setOpacity(t){this.group&&this.group.opacity(t),this._lines.forEach(e=>{e.opacity(t)}),this.children.forEach(e=>{e.setOpacity(t)}),this.setGeneralizationOpacity(t)}hideChildren(){this._lines.forEach(t=>{t.hide()}),this.children&&this.children.length&&this.children.forEach(t=>{t.hide()})}showChildren(){this._lines.forEach(t=>{t.show()}),this.children&&this.children.length&&this.children.forEach(t=>{t.show()})}startDrag(){this.isDrag=!0,this.group&&this.group.addClass("smm-node-dragging")}endDrag(){this.isDrag=!1,this.group&&this.group.removeClass("smm-node-dragging")}renderLine(t=!1){if(!1===this.getData("expand"))return;let e=this.getChildrenLength();const i=this.getLayoutInstance();let n=this.mindMap.opt.layout;i&&i.getLayoutType&&(n=i.getLayoutType()),n!==X["a"].LAYOUT.FISHBONE||!this.isRoot&&1!==this.layerIndex||(e=0,this._lines.length>0&&(this._lines.forEach(t=>{t.remove()}),this._lines=[])),e>this._lines.length?new Array(e-this._lines.length).fill(0).forEach(()=>{this._lines.push(this.lineDraw.path())}):e{t.remove()}),this._lines=this._lines.slice(0,e)),i.renderLine(this,this._lines,(...t)=>{this.styleLine(...t)},this.style.getStyle("lineStyle",!0)),t&&this.children&&this.children.length>0&&this.children.forEach(e=>{e.renderLine(t)})}getShape(){return this.mindMap.themeConfig.nodeUseLineStyle?X["a"].SHAPE.RECTANGLE:this.style.getStyle("shape",!1,!1)}hasCustomPosition(){return void 0!==this.customLeft&&void 0!==this.customTop}ancestorHasCustomPosition(){let t=this;while(t){if(t.hasCustomPosition())return!0;t=t.parent}return!1}ancestorHasGeneralization(){let t=this.parent;while(t){if(t.checkHasGeneralization())return!0;t=t.parent}return!1}addChildren(t){this.children.push(t)}styleLine(t,e,i){const{enableInheritAncestorLineStyle:n}=this.mindMap.opt,o=n?"getSelfInhertStyle":"getSelfStyle",r=e[o]("lineWidth")||e.getStyle("lineWidth",!0),s=e[o]("lineColor")||this.getRainbowLineColor(e)||e.getStyle("lineColor",!0),a=e[o]("lineDasharray")||e.getStyle("lineDasharray",!0);this.style.line(t,{width:r,color:s,dasharray:a},i,e)}getRainbowLineColor(t){return this.mindMap.rainbowLines?this.mindMap.rainbowLines.getNodeColor(t):""}removeLine(){this._lines.forEach(t=>{t.remove()}),this._lines=[]}isAncestor(t){if(this.uid===t.uid)return!1;let e=t.parent;while(e){if(this.uid===e.uid)return!0;e=e.parent}return!1}isParent(t){if(this.uid===t.uid)return!1;const e=t.parent;return!(!e||this.uid!==e.uid)}isBrother(t){return!(!this.parent||this.uid===t.uid)&&this.parent.children.find(e=>e.uid===t.uid)}getIndexInBrothers(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.uid===this.uid):-1}getPaddingVale(){return{paddingX:this.getStyle("paddingX"),paddingY:this.getStyle("paddingY")}}getStyle(t,e){const i=this.style.merge(t,e);return void 0===i?"":i}getSelfStyle(t){return this.style.getSelfStyle(t)}getParentSelfStyle(t){return this.parent?this.parent.getSelfStyle(t)||this.parent.getParentSelfStyle(t):null}getSelfInhertStyle(t){return this.getSelfStyle(t)||this.getParentSelfStyle(t)}getBorderWidth(){return this.style.merge("borderWidth",!1)||0}getData(t){return t?this.nodeData.data[t]:this.nodeData.data}getPureData(t=!0,e=!1){return Object(s["q"])({},this,t,e)}getAncestorNodes(){const t=[];let e=this.parent;while(e)t.unshift(e),e=e.parent;return t}hasCustomStyle(){return this.style.hasCustomStyle()}getRect(){return this.group?this.group.rbox():null}getRectInSvg(){const{scaleX:t,scaleY:e,translateX:i,translateY:n}=this.mindMap.draw.transform();let{left:o,top:r,width:s,height:a}=this;const h=(o+s)*t+i,d=(r+a)*e+n;return o=o*t+i,r=r*e+n,{left:o,right:h,top:r,bottom:d,width:s*t,height:a*e}}highlight(){this.group&&this.group.addClass("smm-node-highlight")}closeHighlight(){this.group&&this.group.removeClass("smm-node-highlight")}fakeClone(){const t=new jt({...this.opt,uid:Object(s["u"])()});return Object.keys(this).forEach(e=>{t[e]=this[e]}),t}createSvgTextNode(t=""){return(new r["j"]).text(t)}getSvgObjects(){return{SVG:r["i"],G:r["d"],Rect:r["h"]}}checkEnableDragModifyNodeWidth(){const{enableDragModifyNodeWidth:t}=this.mindMap.opt;return t&&this.mindMap.richText}hasCustomWidth(){return void 0!==this.customTextWidth}getChildrenLength(){return this.nodeData.children?this.nodeData.children.length:0}getLayoutInstance(){if(this.renderer.isMultiRoot){let t=this;while(t.parent)t=t.parent;if(t._layoutInstance)return t._layoutInstance}return this.renderer.layout}}var Gt=e["a"]=jt},"13cc":function(t,e,i){"use strict";var n={backgroundColor:"rgb(17, 17, 84)",lineColor:"rgb(255, 0, 214)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 181, 0)",associativeLineColor:"rgb(255, 255, 255)",associativeLineTextColor:"rgb(255, 255, 255)",root:{fillColor:"rgb(251, 233, 248)",color:"rgb(208, 5, 176)",borderColor:"rgb(255, 0, 214)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"transparent",color:"rgb(248, 177, 237)",borderColor:"",borderWidth:3,fontSize:18},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(255, 181, 0)",borderWidth:2,color:"rgb(17, 17, 84)"}},o={backgroundColor:"rgb(0, 21, 21)",lineColor:"rgb(0, 139, 146)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgba(2, 167, 240, 0.5)",associativeLineColor:"rgb(255, 255, 255)",associativeLineTextColor:"rgb(255, 255, 255)",root:{fillColor:"rgb(0, 243, 255)",color:"rgb(0, 21, 21)",borderColor:"#fff",borderWidth:3,fontSize:24,shape:"parallelogram"},second:{fillColor:"rgb(0, 21, 21)",color:"#fff",borderColor:"#fff",borderWidth:3,fontSize:18,shape:"diamond"},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(0, 117, 255)",borderWidth:2,color:"rgb(0, 21, 21)"}},r={backgroundColor:"rgb(0, 0, 0)",lineColor:"rgb(172, 172, 172)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(172, 172, 172)",associativeLineColor:"rgb(57, 130, 252)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"#fff",color:"rgb(241, 79, 81)",borderColor:"",borderWidth:0,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(241, 79, 81)",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(241, 79, 81)"}},s={backgroundColor:"rgb(32, 34, 43)",lineColor:"rgb(90, 136, 116)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(90, 136, 116)",associativeLineColor:"rgb(57, 130, 252)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(1, 192, 116)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(48, 51, 63)",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"rgb(1, 192, 116)",borderColor:"",borderWidth:0,color:"#fff"}},a={lineColor:"rgb(75, 81, 78)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 119, 34)",backgroundColor:"rgb(27, 31, 34)",root:{fillColor:"rgb(36, 179, 96)",color:"#fff",borderColor:"",borderWidth:0},second:{fillColor:"rgb(254, 199, 13)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"rgb(204, 204, 204)"},generalization:{fillColor:"transparent",borderColor:"rgb(255, 119, 34)",borderWidth:2,color:"rgb(204, 204, 204)"}},h={lineColor:"rgb(17, 68, 23)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#fff",backgroundColor:"rgb(15, 16, 17)",root:{fillColor:"rgb(28, 178, 43)",color:"#fff",fontSize:24,borderRadius:10},second:{fillColor:"rgb(55, 56, 58)",color:"rgb(147,148,149)",fontSize:18,borderRadius:10,borderWidth:0},node:{fontSize:14,color:"rgb(147, 148, 149)"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"#333"}},d={lineColor:"#fff",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",backgroundColor:"rgb(58, 65, 68)",backgroundImage:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowQzg5QTQ0NDhENzgxMUUzOENGREE4QTg0RDgzRTZDNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowQzg5QTQ0NThENzgxMUUzOENGREE4QTg0RDgzRTZDNyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMwOEQ1NDRGOEQ3NzExRTM4Q0ZEQThBODREODNFNkM3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMwOEQ1NDUwOEQ3NzExRTM4Q0ZEQThBODREODNFNkM3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+e9P33AAAACVJREFUeNpisXJ0YUACTAyoAMr/+eM7EGGRZ4FQ7BycEAZAgAEAHbEGtkoQm/wAAAAASUVORK5CYII=",backgroundRepeat:"repeat",backgroundSize:"auto",root:{fillColor:"rgb(233, 223, 152)",color:"#333",fontSize:24,borderRadius:21},second:{fillColor:"rgb(164, 197, 192)",borderColor:"transparent",color:"#333",fontSize:16,borderRadius:10},node:{fontSize:12,color:"#fff",fontWeight:"bold"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"#333"}},l={backgroundColor:"rgb(27, 31, 34)",lineColor:"rgb(75, 81, 78)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 119, 34)",root:{fillColor:"rgb(36, 179, 96)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(254, 199, 13)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(204, 204, 204)"},generalization:{fontSize:14,fillColor:"rgb(27, 31, 34)",borderColor:"rgb(255, 119, 34)",borderWidth:2,color:"rgb(204, 204, 204)"}},c={backgroundColor:"rgb(32, 37, 49)",lineColor:"rgb(137, 167, 196)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 119, 34)",root:{fillColor:"rgb(23, 153, 243)",color:"rgb(255, 255, 255)",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(70, 78, 94)",color:"rgb(209, 210, 210)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(204, 204, 204)"},generalization:{fontSize:14,fillColor:"rgb(255, 119, 34)",borderColor:"",borderWidth:2,color:"#fff"}},u={backgroundColor:"rgb(18, 20, 20)",lineColor:"rgb(205, 186, 156)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(245, 224, 191)",root:{fillColor:"rgb(255, 208, 124)",color:"rgb(111, 61, 6)",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(66, 57, 46)",color:"rgb(225, 201, 158)",borderColor:"rgb(245, 224, 191)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(231, 203, 155)"},generalization:{fontSize:14,fillColor:"rgb(56, 45, 34)",borderColor:"rgb(104, 84, 61)",borderWidth:2,color:"rgb(242, 216, 176)"}},f={backgroundColor:"#070616",lineColor:"#fff",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",root:{fillColor:"#ff6811",color:"#110501",borderColor:"#ff6811",borderWidth:0,fontSize:24},second:{fillColor:"#070616",color:"#a9a4a9",borderColor:"#ff6811",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#a9a4a9"},generalization:{fontSize:14,fillColor:"",borderColor:"#ff6811",borderWidth:2,color:"#a9a4a9"}},p={backgroundColor:"#16181d",lineColor:"#7da578",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#7da578",associativeLineColor:"#7da578",associativeLineTextColor:"#9ce81d",associativeLineActiveColor:"#9ce81d",root:{fillColor:"#9ce81d",color:"#15521b",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#24272f",color:"#97b65e",borderColor:"#80a97a",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#789e73"},generalization:{fontSize:14,fillColor:"#9ce81d",borderColor:"",borderWidth:0,color:"#13501b"}},g={backgroundColor:"#051422",lineColor:"#55dff3",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#55dff3",associativeLineColor:"#55dff3",associativeLineTextColor:"#78b3ff",associativeLineActiveColor:"#78b3ff",root:{fillColor:"#55dff3",color:"#0f4956",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#0b1632",color:"#fff",borderColor:"#78b3ff",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#78b3ff"},generalization:{fontSize:14,fillColor:"#55dff3",borderColor:"",borderWidth:0,color:"#0f4956"}},m={backgroundColor:"#192b3b",lineColor:"#4986bc",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#4986bc",associativeLineColor:"#4986bc",associativeLineTextColor:"#679fba",associativeLineActiveColor:"#679fba",root:{fillColor:"#3462b0",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#679fba",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#679fba"},generalization:{fontSize:14,fillColor:"#3462b0",borderColor:"",borderWidth:0,color:"#fff"}},b=[{name:"脑图经典",value:"classic",theme:d},{name:"黑色幽默",value:"blackHumour",theme:l},{name:"深夜办公室",value:"lateNightOffice",theme:c},{name:"黑金",value:"blackGold",theme:u},{name:"橙汁",value:"orangeJuice",theme:f},{name:"霓虹灯",value:"neonLamp",theme:n},{name:"暗夜冰刃",value:"darkNightLceBlade",theme:o},{name:"暗色",value:"dark",theme:h},{name:"暗色2",value:"dark2",theme:a},{name:"暗色3",value:"dark3",theme:r},{name:"暗色4",value:"dark4",theme:s},{name:"暗色5",value:"dark5",theme:p},{name:"暗色6",value:"dark6",theme:g},{name:"暗色7",value:"dark7",theme:m}].map(t=>({...t,dark:!0})),x={lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(51, 51, 51)",root:{fillColor:"rgb(22, 22, 22)",color:"#fff",borderColor:"rgb(22, 22, 22)",borderWidth:3,fontSize:24},second:{fillColor:"rgb(244, 246, 253)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"transparent",borderColor:"rgb(34, 34, 34)",borderWidth:2,color:"rgb(34, 34, 34)"}},y={backgroundColor:"rgb(187, 241, 250)",lineColor:"rgb(74, 139, 170)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 168, 101)",root:{fillColor:"rgb(51, 149, 255)",color:"#fff",borderColor:"rgb(51, 149, 255)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(74, 139, 170)",color:"#fff",borderColor:"",borderWidth:3,fontSize:18},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(255, 168, 101)",borderWidth:2,color:"#000"}},w={backgroundColor:"rgb(236, 254, 255)",lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(51, 51, 51)",root:{fillColor:"rgb(39, 222, 232)",color:"rgb(26, 26, 26)",borderColor:"rgb(26, 26, 26)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(235, 255, 187)",color:"rgb(0, 0, 0)",borderColor:"rgb(51, 51, 51)",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(26, 26, 26)",borderWidth:2,color:"rgb(26, 26, 26)"}},C={backgroundColor:"rgb(255, 251, 231)",lineColor:"rgb(110, 165, 79)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(136, 100, 0)",root:{fillColor:"rgb(254, 92, 92)",color:"#fff",borderColor:"rgb(18, 187, 55)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(209, 237, 176)",color:"rgb(85, 136, 55)",borderColor:"",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(26, 26, 26)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(136, 100, 0)",borderWidth:2,color:"rgb(136, 100, 0)"}},v={backgroundColor:"rgb(231, 245, 255)",lineColor:"rgb(96, 189, 255)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(0, 155, 255)",root:{fillColor:"rgb(96, 189, 255)",color:"#fff",borderColor:"#fff",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"#fff",color:"rgb(0, 149, 255)",borderColor:"",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(0, 66, 157)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(0, 155, 255)",borderWidth:2,color:"rgb(0, 155, 255)"}},_={backgroundColor:"rgb(252, 245, 241)",lineColor:"rgb(144, 114, 110)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(128, 154, 151)",associativeLineColor:"rgb(166, 124, 106)",associativeLineTextColor:"rgb(166, 124, 106)",root:{fillColor:"rgb(207, 121, 105)",color:"#fff",borderColor:"rgb(207, 121, 105)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(239, 210, 207)",color:"rgb(144, 79, 68)",borderColor:"rgb(222, 186, 183)",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(131, 90, 64)"},generalization:{fontSize:14,fillColor:"rgb(172, 202, 199)",borderColor:"rgb(172, 202, 199)",borderWidth:2,color:"rgb(91, 102, 97)"}},M={backgroundColor:"rgb(233, 245, 241)",lineColor:"rgb(34, 34, 34)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(34, 34, 34)",associativeLineColor:"rgb(56, 44, 116)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(56, 44, 116)",color:"#fff",borderColor:"rgb(56, 44, 116)",borderWidth:0,fontSize:24},second:{fillColor:"rgb(161, 213, 188)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"rgb(56, 44, 116)",borderColor:"",borderWidth:0,color:"#fff"}},E={backgroundColor:"rgb(255, 255, 255)",lineColor:"rgb(0, 0, 0)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(0, 0, 0)",associativeLineColor:"rgb(152, 162, 171)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(237, 182, 72)",color:"rgb(0, 0, 0)",borderColor:"rgb(0, 0, 0)",borderWidth:2,fontSize:24},second:{fillColor:"rgb(114, 158, 28)",color:"#fff",borderColor:"rgb(0, 0, 0)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(10, 2, 2)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(10, 2, 2)"}},N={backgroundColor:"rgb(255, 255, 255)",lineColor:"rgb(237, 185, 81)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(226, 90, 64)",associativeLineColor:"rgb(152, 162, 171)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(226, 90, 64)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(43, 118, 239)",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(43, 118, 239)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(43, 118, 239)"}},T={backgroundColor:"rgb(219, 255, 211)",lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 127, 71)",associativeLineColor:"rgb(160, 220, 63)",associativeLineTextColor:"rgb(160, 220, 63)",root:{fillColor:"rgb(15, 198, 113)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"#fff",color:"rgb(26, 26, 26)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"rgb(255, 127, 71)",borderColor:"",borderWidth:0,color:"#fff"}},L={lineColor:"#fff",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",backgroundColor:"rgb(80, 156, 170)",root:{fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(65, 89, 158)"},second:{fillColor:"rgb(251, 227, 188)",color:"rgb(65, 89, 158)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"rgb(65, 89, 158)"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"rgb(65, 89, 158)"}},S={lineColor:"rgb(51, 51, 51)",lineWidth:2,generalizationLineWidth:3,generalizationLineColor:"rgb(51, 51, 51)",backgroundColor:"#fff",root:{fillColor:"rgb(18, 187, 55)",color:"#fff",fontSize:24,borderRadius:10},second:{fillColor:"rgb(241, 242, 241)",borderColor:"transparent",color:"#1a1a1a",fontSize:18,borderRadius:10},node:{fontSize:14,color:"#1a1a1a"},generalization:{fillColor:"#fff",borderColor:"rgb(51, 51, 51)",borderWidth:2,color:"#1a1a1a"}},D={lineColor:"rgb(94, 202, 110)",lineWidth:2,generalizationLineWidth:3,generalizationLineColor:"#1a1a1a",backgroundColor:"rgb(241, 241, 241)",root:{fillColor:"rgb(255, 245, 214)",color:"#1a1a1a",fontSize:24,borderRadius:10,borderColor:"rgb(249, 199, 84)",borderWidth:1},second:{fillColor:"rgb(255, 245, 214)",borderColor:"rgb(249, 199, 84)",borderWidth:1,color:"#1a1a1a",fontSize:18,borderRadius:10},node:{fontSize:14,color:"#1a1a1a"},generalization:{fillColor:"#fff",borderColor:"#1a1a1a",color:"#1a1a1a",borderWidth:2}},R={lineColor:"rgb(123, 199, 120)",backgroundColor:"rgb(236, 245, 231)",generalizationLineWidth:2,generalizationLineColor:"rgb(123, 199, 120)",root:{fillColor:"rgb(253, 244, 217)",color:"#222"},second:{fillColor:"rgb(253, 244, 217)",color:"#222",borderColor:"rgb(242, 200, 104)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"rgb(123, 199, 120)",borderColor:"transparent",borderWidth:2,color:"#fff"}},z={lineColor:"rgb(51, 51, 51)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(51, 51, 51)",backgroundColor:"rgb(239, 248, 250)",root:{fillColor:"rgb(255, 255, 255)",color:"#222"},second:{fillColor:"rgb(255, 255, 255)",color:"#222",borderColor:"rgb(255, 255, 255)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"rgb(51, 51, 51)",color:"#333"}},A={lineColor:"rgb(115, 161, 191)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(115, 161, 191)"},second:{fillColor:"rgb(238, 243, 246)",color:"#333",borderColor:"rgb(115, 161, 191)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}},O={lineColor:"rgb(191, 115, 148)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(191, 115, 148)"},second:{fillColor:"rgb(246, 238, 242)",color:"#333",borderColor:"rgb(191, 115, 148)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}},k={lineColor:"rgb(191, 147, 115)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(191, 147, 115)"},second:{fillColor:"rgb(246, 242, 238)",color:"#333",borderColor:"rgb(191, 147, 115)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}},I={lineColor:"#333",backgroundColor:"#d1f6ec",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"#1fb27d"},second:{fillColor:"#fff",color:"#565656",borderColor:"transparent",borderWidth:0},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}},B={lineColor:"rgb(191, 115, 115)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(191, 115, 115)"},second:{fillColor:"rgb(246, 238, 238)",color:"#333",borderColor:"rgb(191, 115, 115)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}},F={lineColor:"rgb(123, 115, 191)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(123, 115, 191)"},second:{fillColor:"rgb(239, 238, 246)",color:"#333",borderColor:"rgb(123, 115, 191)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}},P={lineColor:"rgb(166, 101, 106)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",backgroundColor:"rgb(255, 208, 211)",root:{fillColor:"rgb(139, 109, 225)",borderColor:"",borderWidth:0},second:{fillColor:"rgb(243, 104, 138)",color:"#fff",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"#222"}},W={lineColor:"rgb(104, 204, 202)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(90, 206, 241)",backgroundColor:"rgb(239, 255, 255)",root:{fillColor:"rgb(0, 192, 184)",borderColor:"",borderWidth:0},second:{fillColor:"#fff",color:"#222",borderColor:"rgb(184, 235, 233)",borderWidth:2,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"rgb(90, 206, 241)",borderColor:"transparent",color:"#fff"}},H={lineColor:"rgb(51, 56, 62)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(127, 93, 64)",backgroundColor:"#fff",root:{fillColor:"rgb(51, 56, 62)",color:"rgb(247, 208, 160)",borderColor:"",borderWidth:0},second:{fillColor:"rgb(239, 209, 176)",color:"rgb(81, 58, 42)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"rgb(127, 93, 64)",borderColor:"transparent",color:"rgb(255, 214, 175)"}},j={lineColor:"rgb(254, 146, 0)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 222, 69)",backgroundColor:"rgb(255, 246, 243)",root:{fillColor:"rgb(255, 112, 52)",color:"#fff",borderColor:"",borderWidth:0},second:{fillColor:"#fff",color:"rgb(51, 51, 51)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"rgb(255, 222, 69)",borderColor:"transparent",color:"rgb(51, 51, 51)"}},G={lineColor:"rgb(40, 193, 84)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(251, 158, 0)",backgroundColor:"rgb(238, 255, 243)",root:{fillColor:"rgb(25, 193, 73)",color:"#fff",borderColor:"",borderWidth:0},second:{fillColor:"#fff",color:"rgb(69, 149, 96)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"#fff",borderColor:"rgb(251, 158, 0)",borderWidth:2,color:"rgb(51, 51, 51)"}},$={lineColor:"rgb(30, 53, 86)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(56, 123, 233)",backgroundColor:"rgb(241, 241, 241)",root:{fillColor:"rgb(30, 53, 86)",color:"#fff",fontSize:24,borderRadius:10,borderColor:"rgb(189, 197, 201)",borderWidth:2},second:{fillColor:"rgb(169, 218, 218)",borderColor:"rgb(30, 53, 86)",borderWidth:2,color:"#fff",fontSize:18,borderRadius:10},node:{fontSize:14,color:"rgb(30, 53, 86)",borderColor:"rgb(30, 53, 86)",borderWidth:1,marginY:20},generalization:{fillColor:"rgb(56, 123, 233)",borderColor:"rgb(56, 123, 233)",color:"#fff",borderWidth:0}},U={lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#222",backgroundColor:"rgb(248, 215, 49)",root:{fillColor:"rgb(55, 165, 255)",borderColor:"rgb(51, 51, 51)",borderWidth:3},second:{fillColor:"rgb(255, 160, 36)",color:"#222",borderColor:"rgb(51, 51, 51)",borderWidth:3,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{borderColor:"#222",borderWidth:3,color:"#222"}},Y={lineColor:"rgb(34, 34, 34)",lineWidth:4,generalizationLineWidth:4,generalizationLineColor:"rgb(34, 34, 34)",root:{fillColor:"#fff",color:"rgb(34, 34, 34)",borderColor:"rgb(34, 34, 34)",borderWidth:3,fontSize:24},second:{fillColor:"rgb(241, 246, 248)",color:"rgb(34, 34, 34)",borderColor:"rgb(34, 34, 34)",borderWidth:3,fontSize:18},node:{fontSize:14,color:"rgb(34, 34, 34)"},generalization:{fontSize:14,fillColor:"transparent",borderColor:"rgb(34, 34, 34)",borderWidth:2,color:"rgb(34, 34, 34)"}},X={lineColor:"rgb(113, 195, 169)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(113, 195, 169)",root:{fillColor:"rgb(16, 160, 121)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(240, 252, 249)",color:"rgb(50, 113, 96)",borderColor:"rgb(113, 195, 169)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(10, 59, 43)"},generalization:{fontSize:14,fillColor:"rgb(246, 238, 211)",borderColor:"",borderWidth:0,color:"rgb(173, 91, 12)"}},V={lineColor:"rgb(173, 123, 91)",lineWidth:4,generalizationLineWidth:4,generalizationLineColor:"rgb(173, 123, 91)",root:{fillColor:"rgb(202, 117, 79)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(245, 231, 216)",color:"rgb(125, 86, 42)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(96, 71, 47)"},generalization:{fontSize:14,fillColor:"rgb(255, 249, 239)",borderColor:"rgb(173, 123, 91)",borderWidth:2,color:"rgb(122, 83, 44)"}},K={backgroundColor:"rgb(255, 238, 228)",lineColor:"rgb(230, 138, 131)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(222, 101, 85)",root:{fillColor:"rgb(207, 44, 44)",color:"rgb(255, 233, 157)",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(255, 255, 255)",color:"rgb(211, 58, 21)",borderColor:"rgb(222, 101, 85)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(144, 71, 43)"},generalization:{fontSize:14,fillColor:"rgb(255, 247, 211)",borderColor:"rgb(255, 202, 162)",borderWidth:2,color:"rgb(187, 101, 69)"}},q={backgroundColor:"#e6f1de",lineColor:"#f5ffad",lineWidth:4,generalizationLineWidth:3,generalizationLineColor:"#749336",root:{fillColor:"#94c143",color:"#fff",borderColor:"#94c143",borderWidth:0,fontSize:24},second:{fillColor:"#cee498",color:"#749336",borderColor:"#aec668",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#749336"},generalization:{fontSize:14,fillColor:"#cee498",borderColor:"#aec668",borderWidth:2,color:"#749336"}},Z={backgroundColor:"#fff2df",lineColor:"#b0bc47",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#b0bc47",root:{fillColor:"#e68112",color:"#fff",borderColor:"#e68112",borderWidth:0,fontSize:24},second:{fillColor:"#ffd683",color:"#8c5416",borderColor:"#b0bc47",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#8c5416"},generalization:{fontSize:14,fillColor:"#ffd683",borderColor:"#b0bc47",borderWidth:2,color:"#8c5416"}},Q={backgroundColor:"#fff",lineColor:"#36aaa9",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#36aaa9",associativeLineColor:"#3e58ea",associativeLineTextColor:"#679fba",associativeLineActiveColor:"#50a4b4",root:{fillColor:"#3e58ea",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#e3fbff",color:"#58aabc",borderColor:"#50a4b4",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#50a4b4"},generalization:{fontSize:14,fillColor:"#3e58ea",borderColor:"",borderWidth:0,color:"#fff"}},J={backgroundColor:"#fffcf2",lineColor:"#333333",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#ffda60",associativeLineColor:"#ffda60",associativeLineTextColor:"#333333",associativeLineActiveColor:"#333333",root:{fillColor:"#ffda60",color:"#3b3a37",borderColor:"#343334",borderWidth:2,fontSize:24},second:{fillColor:"#fff",color:"#131312",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#131312"},generalization:{fontSize:14,fillColor:"#ffda60",borderColor:"",borderWidth:0,color:"#464339"}},tt={backgroundColor:"#fffef6",lineColor:"#273d62",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#273d62",associativeLineColor:"#9edeee",associativeLineTextColor:"#395c85",associativeLineActiveColor:"#273d62",root:{fillColor:"#273d62",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#9edeee",color:"#406080",borderColor:"#395c85",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#395c85"},generalization:{fontSize:14,fillColor:"#273d62",borderColor:"",borderWidth:0,color:"#fff"}},et={backgroundColor:"#ffffff",lineColor:"#333333",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#2176ef",associativeLineColor:"#2176ef",associativeLineTextColor:"#343433",associativeLineActiveColor:"#343433",root:{fillColor:"#2176ef",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#fff9e4",color:"#4c4b46",borderColor:"#343433",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#343433"},generalization:{fontSize:14,fillColor:"#2176ef",borderColor:"",borderWidth:0,color:"#fff"}},it={backgroundColor:"#ffffff",lineColor:"#35b398",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#21c384",associativeLineColor:"#21c384",associativeLineTextColor:"#4d754b",associativeLineActiveColor:"#f5ffe6",root:{fillColor:"#21c384",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#f5ffe6",color:"#386437",borderColor:"#35b398",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#326032"},generalization:{fontSize:14,fillColor:"#21c384",borderColor:"",borderWidth:0,color:"#fff"}},nt={backgroundColor:"#ffffff",lineColor:"#333333",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#ffd613",associativeLineColor:"#ffd613",associativeLineTextColor:"#2d2b23",associativeLineActiveColor:"#d1ebf8",root:{fillColor:"#ffd613",color:"#2d2b23",borderColor:"#1f2021",borderWidth:2,fontSize:24},second:{fillColor:"#d1ebf8",color:"#717b80",borderColor:"#333333",borderWidth:2,fontSize:18,borderRadius:5},node:{fontSize:14,color:"#333333"},generalization:{fontSize:14,fillColor:"#ffd613",borderColor:"",borderWidth:0,color:"#2d2b23"}},ot={backgroundColor:"#ffeed2",lineColor:"#976a43",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#19807e",associativeLineColor:"#19807e",associativeLineTextColor:"#764014",associativeLineActiveColor:"#976a43",root:{fillColor:"#19807e",color:"#f3f0b8",borderColor:"",borderWidth:0,fontSize:24,shape:"circle"},second:{fillColor:"#eacdb3",color:"#7f4d1f",borderColor:"#764014",borderWidth:2,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"#764014"},generalization:{fontSize:14,fillColor:"#19807e",borderColor:"",borderWidth:0,color:"#f3f0b8"}},rt={backgroundColor:"#c8e4ea",lineColor:"#3e416c",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#3e416c",associativeLineColor:"#ffdb9c",associativeLineTextColor:"#383b70",associativeLineActiveColor:"#3e416c",root:{fillColor:"#383b70",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#ffdb9c",color:"#5e5c76",borderColor:"#3e416c",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#3e416c"},generalization:{fontSize:14,fillColor:"#383b70",borderColor:"",borderWidth:0,color:"#fff"}},st=[{name:"天清绿",value:"skyGreen",theme:L},{name:"经典绿",value:"classicGreen",theme:R},{name:"经典蓝",value:"classicBlue",theme:z},{name:"天空蓝",value:"blueSky",theme:A},{name:"脑残粉",value:"brainImpairedPink",theme:O},{name:"泥土黄",value:"earthYellow",theme:k},{name:"清新绿",value:"freshGreen",theme:I},{name:"清新红",value:"freshRed",theme:B},{name:"浪漫紫",value:"romanticPurple",theme:F},{name:"粉红葡萄",value:"pinkGrape",theme:P},{name:"薄荷",value:"mint",theme:W},{name:"金色vip",value:"gold",theme:H},{name:"活力橙",value:"vitalityOrange",theme:j},{name:"绿叶",value:"greenLeaf",theme:G},{name:"小黄人",value:"minions",theme:U},{name:"简约黑",value:"simpleBlack",theme:Y},{name:"课程绿",value:"courseGreen",theme:X},{name:"咖啡",value:"coffee",theme:V},{name:"红色精神",value:"redSpirit",theme:K},{name:"牛油果",value:"avocado",theme:q},{name:"秋天",value:"autumn",theme:Z},{name:"奥利奥",value:"oreo",theme:x},{name:"浅海",value:"shallowSea",theme:y},{name:"柠檬气泡",value:"lemonBubbles",theme:w},{name:"玫瑰",value:"rose",theme:C},{name:"海蓝线",value:"seaBlueLine",theme:v},{name:"莫兰迪",value:"morandi",theme:_},{name:"仙人掌",value:"cactus",theme:T},{name:"脑图经典2",value:"classic2",theme:S},{name:"脑图经典3",value:"classic3",theme:D},{name:"脑图经典4",value:"classic4",theme:$},{name:"脑图经典5",value:"classic5",theme:M},{name:"脑图经典6",value:"classic6",theme:E},{name:"脑图经典7",value:"classic7",theme:N},{name:"脑图经典8",value:"classic8",theme:Q},{name:"脑图经典9",value:"classic9",theme:J},{name:"脑图经典10",value:"classic10",theme:tt},{name:"脑图经典11",value:"classic11",theme:et},{name:"脑图经典12",value:"classic12",theme:it},{name:"脑图经典13",value:"classic13",theme:nt},{name:"脑图经典14",value:"classic14",theme:ot},{name:"脑图经典15",value:"classic15",theme:rt}].map(t=>({...t,dark:!1}));const at=[...b,...st],ht={darkList:b,lightList:st,init(t){at.forEach(e=>{t.defineTheme(e.value,e.theme)})},remove(t){at.forEach(e=>{t.removeTheme(e.value)})}};e["a"]=ht},"13d5":function(t,e,i){"use strict";var n=i("23e7"),o=i("d58f").left,r=i("a640"),s=i("2d00"),a=i("605d"),h=!a&&s>79&&s<83,d=h||!r("reduce");n({target:"Array",proto:!0,forced:d},{reduce:function(t){var e=arguments.length;return o(this,t,e,e>1?arguments[1]:void 0)}})},"14d0":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return r}));i("14d9");var n=i("8a19"),o=i("6f5e");class r{constructor(t){this.node=t,this.mindMap=t.mindMap,this.connectors=[],this.config={...o["FLOWCHART_DEFAULT_CONFIG"],...t.nodeData.data.flowchart||{}}}renderConnectors(){if(!this.config.showConnectors)return;this.clearConnectors();const{width:t,height:e}=this.node,i=this.config.connectorPositions||["top","right","bottom","left"];i.forEach(i=>{const n=this.createConnector(i,t,e);n&&this.connectors.push(n)})}createConnector(t,e,i){const o=this.config.connectorSize,r=this.config.connectorColor,{x:s,y:a}=this.getConnectorPosition(t,e,i),h=(new n["b"]).size(o).fill(r).stroke({color:"#fff",width:2}).center(s,a).css({cursor:"crosshair",opacity:.3,transition:"opacity 0.2s","pointer-events":"all","z-index":1e3}).addClass("smm-flowchart-connector").addClass("smm-flowchart-connector-"+t);return h.data("position",t),h.data("nodeUid",this.node.uid),this.bindConnectorEvents(h),this.node.group.add(h),h.front(),h}getConnectorPosition(t,e,i){const n=this.config.connectorSize/2,o={top:{x:e/2,y:-n},right:{x:e+n,y:i/2},bottom:{x:e/2,y:i+n},left:{x:-n,y:i/2}};return o[t]||{x:0,y:0}}bindConnectorEvents(t){t.on("mouseenter",()=>{t.animate(100).attr({opacity:1}),t.fill(this.config.connectorActiveColor)}),t.on("mouseleave",()=>{this.isDragging||(t.animate(100).attr({opacity:.3}),t.fill(this.config.connectorColor))}),t.on("click",e=>{e.stopPropagation(),this.mindMap.emit("flowchart_connector_click",{connector:t,node:this.node,position:t.data("position")})}),t.on("mousedown",e=>{e.stopPropagation(),this.mindMap.emit("flowchart_connector_drag_start",{connector:t,node:this.node,position:t.data("position"),event:e})})}showConnectors(){this.connectors.forEach(t=>{t.animate(200).attr({opacity:1}),t.stroke({color:this.config.connectorActiveColor,width:2})})}hideConnectors(){this.connectors.forEach(t=>{t.animate(200).attr({opacity:.3}),t.stroke({color:"#fff",width:2})})}clearConnectors(){this.connectors.forEach(t=>{t.remove()}),this.connectors=[]}updateConnectorPositions(){const{width:t,height:e}=this.node;this.connectors.forEach(i=>{const n=i.data("position"),{x:o,y:r}=this.getConnectorPosition(n,t,e);i.center(o,r)})}getConnectorByPosition(t){return this.connectors.find(e=>e.data("position")===t)}getConnectorAbsolutePosition(t){const e=this.getConnectorByPosition(t);if(!e)return null;const{x:i,y:n}=this.getConnectorPosition(t,this.node.width,this.node.height);return{x:this.node.left+i,y:this.node.top+n}}}},"1e42":function(t,e,i){"use strict";i.d(e,"Db",(function(){return l})),i.d(e,"d",(function(){return c})),i.d(e,"vb",(function(){return u})),i.d(e,"ub",(function(){return f})),i.d(e,"Q",(function(){return p})),i.d(e,"yb",(function(){return g})),i.d(e,"r",(function(){return m})),i.d(e,"q",(function(){return b})),i.d(e,"Z",(function(){return x})),i.d(e,"ob",(function(){return y})),i.d(e,"y",(function(){return w})),i.d(e,"Bb",(function(){return C})),i.d(e,"w",(function(){return v})),i.d(e,"c",(function(){return _})),i.d(e,"x",(function(){return M})),i.d(e,"e",(function(){return E})),i.d(e,"kb",(function(){return N})),i.d(e,"j",(function(){return T})),i.d(e,"R",(function(){return S})),i.d(e,"pb",(function(){return D})),i.d(e,"I",(function(){return R})),i.d(e,"u",(function(){return z})),i.d(e,"hb",(function(){return A})),i.d(e,"rb",(function(){return O})),i.d(e,"fb",(function(){return I})),i.d(e,"h",(function(){return F})),i.d(e,"tb",(function(){return W})),i.d(e,"gb",(function(){return H})),i.d(e,"eb",(function(){return j})),i.d(e,"U",(function(){return G})),i.d(e,"lb",(function(){return Y})),i.d(e,"Ab",(function(){return V})),i.d(e,"sb",(function(){return q})),i.d(e,"bb",(function(){return Z})),i.d(e,"O",(function(){return Q})),i.d(e,"g",(function(){return J})),i.d(e,"cb",(function(){return tt})),i.d(e,"jb",(function(){return et})),i.d(e,"S",(function(){return it})),i.d(e,"nb",(function(){return nt})),i.d(e,"o",(function(){return ot})),i.d(e,"A",(function(){return rt})),i.d(e,"wb",(function(){return st})),i.d(e,"a",(function(){return at})),i.d(e,"v",(function(){return ht})),i.d(e,"B",(function(){return dt})),i.d(e,"J",(function(){return lt})),i.d(e,"K",(function(){return ct})),i.d(e,"F",(function(){return ut})),i.d(e,"Y",(function(){return ft})),i.d(e,"db",(function(){return pt})),i.d(e,"f",(function(){return gt})),i.d(e,"xb",(function(){return mt})),i.d(e,"H",(function(){return bt})),i.d(e,"qb",(function(){return xt})),i.d(e,"X",(function(){return yt})),i.d(e,"i",(function(){return wt})),i.d(e,"G",(function(){return Ct})),i.d(e,"t",(function(){return vt})),i.d(e,"n",(function(){return _t})),i.d(e,"k",(function(){return Mt})),i.d(e,"l",(function(){return Et})),i.d(e,"m",(function(){return Nt})),i.d(e,"W",(function(){return Tt})),i.d(e,"mb",(function(){return Lt})),i.d(e,"Cb",(function(){return St})),i.d(e,"T",(function(){return Dt})),i.d(e,"P",(function(){return Rt})),i.d(e,"V",(function(){return zt})),i.d(e,"N",(function(){return At})),i.d(e,"L",(function(){return Ot})),i.d(e,"E",(function(){return It})),i.d(e,"D",(function(){return Bt})),i.d(e,"z",(function(){return Ft})),i.d(e,"s",(function(){return Pt})),i.d(e,"C",(function(){return Wt})),i.d(e,"b",(function(){return Ht})),i.d(e,"zb",(function(){return jt})),i.d(e,"ib",(function(){return Gt})),i.d(e,"M",(function(){return $t})),i.d(e,"p",(function(){return Ut})),i.d(e,"ab",(function(){return Yt}));i("14d9"),i("13d5");var n=i("0f9c"),o=i("4013");function r(t){this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)}r.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30,this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0},r.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^e[1&t];for(;i>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};var s=i("8a19"),a=i("682c"),h=i.n(a),d=i("4699");const l=(t,e,i,n,o,r=0,s=0,a=[])=>{let h=!1;if(i&&(h=i(t,e,o,r,s,a)),!h&&t.children&&t.children.length>0){let e=r+1;t.children.forEach((o,r)=>{l(o,t,i,n,!1,e,r,[...a,t])})}n&&n(t,e,o,r,s,a)},c=(t,e)=>{let i=[t],n=!1;"stop"===e(t,null)&&(n=!0);while(i.length){if(n)break;let t=i.shift();t.children&&t.children.length&&t.children.forEach(o=>{n||(i.push(o),"stop"===e(o,t)&&(n=!0))})}},u=(t,e,i,n)=>{let o=[],r=t/e,s=i/n;return o=r>s?[i,i/r]:[r*n,n],o},f=(t,e,i,n)=>{let o=t/e,r=[];if(i&&n)if(t<=i&&e<=n)r=[t,e];else{let t=i/n;r=o>t?[i,i/o]:[o*n,n]}else i?r=t<=i?[t,e]:[i,i/o]:n&&(r=e<=n?[t,e]:[o*n,n]);return r},p=t=>{t=t.replace(/
/gim,"\n");let e=document.createElement("div");return e.innerHTML=t,t=e.textContent,t},g=t=>{try{return JSON.parse(JSON.stringify(t))}catch(e){return null}},m=(t,e,i=!1)=>{if(!e||!e.data)return null;if(t.data=g(e.data),i&&t.data){t.data.isActive=!1;const e=Wt(t.data);e.forEach(t=>{t.isActive=!1})}return t.children=[],e.children&&e.children.length>0&&e.children.forEach((e,n)=>{const o=m({},e,i);o&&(t.children[n]=o)}),Object.keys(e).forEach(i=>{["data","children"].includes(i)||/^_/.test(i)||(t[i]=e[i])}),t},b=(t,e,i=!1,n=!0)=>{const o=e.nodeData?e.nodeData:e;return t.data=g(o.data),n?delete t.data.uid:t.data.uid||(t.data.uid=z()),i&&(t.data.isActive=!1),t.children=[],e.children&&e.children.length>0?e.children.forEach((e,o)=>{t.children[o]=b({},e,i,n)}):e.nodeData&&e.nodeData.children&&e.nodeData.children.length>0&&e.nodeData.children.forEach((e,o)=>{t.children[o]=b({},e,i,n)}),Object.keys(o).forEach(e=>{["data","children"].includes(e)||/^_/.test(e)||(t[e]=o[e])}),t},x=(t,e=!1)=>new Promise((i,n)=>{const o=new Image;o.setAttribute("crossOrigin","anonymous"),o.onload=()=>{try{let t=document.createElement("canvas");t.width=o.width,t.height=o.height;let n=t.getContext("2d");n.drawImage(o,0,0,o.width,o.height),e?t.toBlob(t=>{i(t)}):i(t.toDataURL())}catch(t){n(t)}},o.onerror=t=>{n(t)},o.src=t}),y=t=>{if(!/^data:/.test(t))return t;let[e,i]=t.split(","),n=/^data:[^/]+\/([^;]+);/.exec(e),o=n[1];return{type:o,base64:i}},w=(t,e)=>{let i=document.createElement("a");i.href=t,i.download=e,i.click()},C=(t,e=300,i)=>{let n=null;return(...o)=>{n||(n=setTimeout(()=>{t.call(i,...o),n=null},e))}},v=(t,e=300,i)=>{let n=null;return(...o)=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,t.apply(i,o)},e)}},_=(t,e=(()=>{}))=>{let i=0,n=t.length;if(n<=0)return e();let o=()=>{i>=n?e():(t[i](),setTimeout(()=>{i++,o()},0))};o()},M=t=>t*(Math.PI/180),E=t=>t.replace(/([a-z])([A-Z])/g,(...t)=>t[1]+"-"+t[2].toLowerCase());const N=function(t,e){let i=!1,n=null,o=()=>{i=!1,e?t.call(e):t()};if("undefined"!==typeof MutationObserver){let t=1,e=new MutationObserver(o),i=document.createTextNode(t);e.observe(i,{characterData:!0}),n=function(){t=(t+1)%2,i.data=t}}else n=setTimeout;return function(){i||(i=!0,n(o,0))}},T=(t,e,i=0,n=0)=>{let o=t.elRect,{scaleX:r,scaleY:s,translateX:a,translateY:h}=t.draw.transform(),{left:d,top:l,width:c,height:u}=e,f=(d+c)*r+a,p=(l+u)*s+h;d=d*r+a,l=l*s+h;let g=0,m=0;return d<0+i&&(g=-d+i),f>o.width-i&&(g=-(f-o.width)-i),l<0+n&&(m=-l+n),p>o.height-n&&(m=-(p-o.height)-n),{isOuter:0!==g||0!==m,offsetLeft:g,offsetTop:m}};let L=null;const S=t=>(L||(L=document.createElement("div")),L.innerHTML=t,L.textContent),D=t=>new Promise((e,i)=>{let n=new FileReader;n.onload=t=>{e(t.target.result)},n.onerror=t=>{i(t)},n.readAsDataURL(t)});const R=t=>new Promise(e=>{let i=new Image;i.src=t,i.onload=()=>{e({width:i.width,height:i.height})},i.onerror=()=>{e({width:0,height:0})}}),z=()=>{const t=(new Date).toISOString().replace(/[-:TZ]/g,"").replace(".",""),e=Object(n["a"])().split("-")[0];return`kmind-node-${t}-${e}`},A=t=>new Promise((e,i)=>{let n=new FileReader;n.readAsDataURL(t),n.onload=async t=>{let i=t.target.result,n=await R(i);e({url:i,size:n})},n.onerror=t=>{i(t)}}),O=t=>([[" "," "]].forEach(e=>{t=t.replace(new RegExp(e[0],"g"),e[1])}),t),k=t=>Object.prototype.toString.call(t).slice(8,-1),I=t=>null===t||void 0===t||""===t;let B=null;const F=t=>{B||(B=document.createElement("div")),B.innerHTML=t;for(let e=B.childNodes,i=e.length;i--;)if(1==e[i].nodeType)return!0;return!1};let P=null;const W=(t,e,i)=>{P||(P=document.createElement("div")),P.innerHTML=t;let n=t=>{let o=t.childNodes;o.forEach(o=>{1===o.nodeType?n(o):3===o.nodeType&&t.replaceChild(document.createTextNode(o.nodeValue.replace(new RegExp(e,"g"),i)),o)})};return n(P),P.innerHTML};const H=t=>(t=String(t).replace(/\s+/g,""),["#fff","#ffffff","#FFF","#FFFFFF","rgb(255,255,255)"].includes(t)||/rgba\(255,255,255,[^)]+\)/.test(t)),j=t=>(t=String(t).replace(/\s+/g,""),["","transparent"].includes(t)||/rgba\(\d+,\d+,\d+,0\)/.test(t)),G=t=>{let{lineColor:e,root:i,second:n,node:o}=t,r=[e,i.fillColor,i.color,n.fillColor,n.color,o.fillColor,o.color,i.borderColor,n.borderColor,o.borderColor];for(let s=0;s{const e=t=>{const i=t.childNodes;i.forEach(t=>{1===t.nodeType&&(t.classList.contains("ql-formula")?t.parentNode.removeChild(t):e(t))})};e(t)};let U=null;const Y=t=>{U||(U=document.createElement("div")),U.innerHTML=t;const e=U.childNodes;let i="";for(let n=0;n{X||(X=document.createElement("div")),X.innerHTML=t;const e=X.childNodes;let i=[],n="";for(let o=0;o`

${ft(t)}

`).join("")};let K=null;const q=t=>{K||(K=document.createElement("div")),K.innerHTML=t;const e=K.querySelectorAll(".ql-formula");Array.from(e).forEach(t=>{const e=document.createTextNode("$smmformula$");t.parentNode.replaceChild(e,t)});const i=K.childNodes;let n=[];for(let o=0;o`

${ft(t)}

`).join(""),e.length>0){t=t.replace(/\$smmformula\$/g,''),K.innerHTML=t;const i=K.querySelectorAll(".smmformula");Array.from(i).forEach((t,i)=>{t.parentNode.replaceChild(e[i],t)}),t=K.innerHTML}return t},Z=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Q=(t,e)=>{const i={};return Object.keys(e).forEach(n=>{const o=t[n],r=e[n];if(k(o)===k(r)){if("Object"===k(o)){if(JSON.stringify(o)!==JSON.stringify(r))return void(i[n]=r)}else if(o!==r)return void(i[n]=r)}else i[n]=r}),i},J=t=>!/^_/.test(t)&&!o["g"].includes(t),tt=t=>{const e=[...d["c"]],i=Object.keys(t);for(let n=0;nt.reduce((t,e)=>{const i=t.find(t=>t.type===e.type);return i?e.list.forEach(t=>{const e=i.list.find(e=>e.name===t.name);e?e.icon=t.icon:i.list.push(t)}):t.push({...e}),t},[]),it=t=>{let e=[];return t.forEach(i=>{t.find(t=>t.uid!==i.uid&&t.isAncestor(i))||e.push(i)}),e},nt=t=>{const e={},i={};t.forEach(t=>{const n=t.parent;if(n){const o=n.uid;i[o]=n;const r=t.getIndexInBrothers(),s={node:t,index:r};e[o]?e[o].find(t=>t.index===s.index)||e[o].push(s):e[o]=[s]}});const n=[];return Object.keys(e).forEach(t=>{if(e[t].length>1){const o=e[t].map(t=>t.index).sort((t,e)=>t-e);n.push({node:i[t],range:[o[0],o[o.length-1]]})}else n.push({node:e[t][0].node})}),n},ot=(t,e,i,n,o,r,s,a)=>e>o&&r>t&&n>s&&a>i,rt=t=>{let e=window.getSelection(),i=document.createRange();i.selectNodeContents(t),i.collapse(),e.removeAllRanges(),e.addRange(i)},st=t=>{let e=window.getSelection(),i=document.createRange();i.selectNodeContents(t),e.removeAllRanges(),e.addRange(i)},at=(t,e={})=>{e={...e};const i=e&&e.richText;i&&e.resetRichText&&delete e.resetRichText;const n=t=>{t.forEach(t=>{t.data={...t.data,...e},t.children&&t.children.length>0&&n(t.children)})};return n(t),t},ht=(t,e=!1,i=null,n=!1)=>{const o=t=>{t.forEach(t=>{if(t.data||(t.data={}),(e||I(t.data.uid))&&(t.data.uid=z()),n){const i=Wt(t.data);i.forEach(t=>{(e||I(t.uid))&&(t.uid=z())})}i&&i(t),t.children&&t.children.length>0&&o(t.children)})};return o(t),t},dt=t=>t?Array.isArray(t)?t:[t]:[],lt=t=>t.parent?t.parent.nodeData.children.findIndex(e=>e.data.uid===t.uid):0,ct=(t,e)=>e.findIndex(e=>e.uid===t.uid),ut=t=>{let e=0;for(let o=0;o([["&","&"],["<","<"],[">",">"]].forEach(e=>{t=t.replace(new RegExp(e[0],"g"),e[1])}),t),pt=(t,e)=>{const i=k(t);if(i!==k(e))return!1;if("Object"===i){const i=Object.keys(t),n=Object.keys(e);if(i.length!==n.length)return!1;for(let o=0;onavigator.clipboard&&"function"===typeof navigator.clipboard.read,mt=t=>{navigator.clipboard&&navigator.clipboard.writeText&&navigator.clipboard.writeText(JSON.stringify(t))},bt=async()=>{let t=null,e=null;if(gt()){const i=await navigator.clipboard.read();if(i&&i.length>0)for(const n of i)for(const i of n.types)if(/^image\//.test(i))e=await n.getType(i);else if("text/plain"===i){const e=await n.getType(i);t=await e.text()}}return{text:t,img:e}},xt=t=>{if(!t||!t.parent)return;const e=lt(t);if(-1===e)return;t.parent.nodeData.children.splice(e,1);const i=t.parent.nodeData.data;if(i&&i.generalization){const t=Array.isArray(i.generalization)?i.generalization:[i.generalization];t.forEach(t=>{if(t&&t.range&&Array.isArray(t.range)&&2===t.range.length){const[i,n]=t.range;ei&&e<=n&&(t.range=[i,n-1])}}),Array.isArray(i.generalization)&&(i.generalization=i.generalization.filter(t=>!t._shouldRemove),i.generalization.forEach(t=>{void 0!==t._shouldRemove&&delete t._shouldRemove}))}},yt=t=>(o["j"].forEach(e=>{t=t.replace(new RegExp(`<${e}([^>]*)>`,"g"),`<${e} $1 />`)}),t),wt=(t,e)=>{if(t.length!==e.length)return!1;for(let i=0;ie.uid===t[i].uid))return!1;return!0},Ct=()=>{const t=navigator.userAgent.match(/\s+Chrome\/(.*)\s+/);return t&&t[1]?Number.parseFloat(t[1]):""},vt=t=>({simpleMindMap:!0,data:t}),_t=t=>{let e=null;if("string"===typeof t)try{const i=JSON.parse(t);"object"===typeof i&&i.simpleMindMap&&(e=i.data)}catch(n){}else"object"===typeof t&&t.simpleMindMap&&(e=t.data);const i=!!e;return{isSmm:i,data:i?e:String(t)}},Mt=t=>{var e,i;const n=t.split("-");return 2===n.length&&(14===(null===n||void 0===n||null===(e=n[0])||void 0===e?void 0:e.length)&&7===(null===n||void 0===n||null===(i=n[1])||void 0===i?void 0:i.length))},Et=t=>{let e=!1,i="",n="";return t.startsWith("siyuan://blocks/")&&(e=!0,i=t),{isSiyuanLink:e,siyuanLink:i,siyuanLinkTitle:n}},Nt=t=>{let e=!1,i="",n="",o="";if("string"===typeof t){const r=/<<(assets[/][^/]+\.pdf)[/]([^ ]+) "([^"]+)">>\s*\n*!\[\]\((assets\/[^)]+)\)/,s=t.match(r),a=/<<(assets[/][^/]+\.pdf)[/]([^ ]+) "([^"]+)">>$/,h=t.match(a),d=/<<(assets[/][^/]+\.pdf)[/]([^ ]+) "([^"]*)">>$/,l=t.match(d);if(s||h||l){const t=s||h||l,r=t[1],a=t[2],d=t[3];e=!0,n=d,s&&s[4]&&(o="/"+s[4]);const c={type:"pdf",path:r,id:a};o&&(c.imageUrl=o),i="siyuan://plugins/kmind-plugin?data="+JSON.stringify(c)}}return{isSiyuanPdfUrl:e,siyuanPdfUrl:i,siyuanPdfUrlTitle:n,siyuanPdfImageUrl:o}},Tt=(t,e)=>{t.preventDefault();const i=window.getSelection();if(!i.rangeCount)return;i.deleteFromDocument(),e=e||t.clipboardData.getData("text"),e=ft(e),e=S(e);const n=e.split(/\n/g),o=document.createDocumentFragment();n.forEach((t,e)=>{const i=document.createTextNode(t);if(o.appendChild(i),et?Array.isArray(t)?t.filter(t=>!!t):t.multiRoot&&Array.isArray(t.roots)?t.roots.filter(t=>!!t):[t]:[],St=t=>{const e={};if(!t)return e;const i=Lt(t),n=(t,i)=>{if(!t||!t.data||!t.data.uid)return;const o=t.data.uid;i&&i.children.push(o),e[o]={isRoot:!i,data:{...t.data},children:[]},t.children&&t.children.length>0&&t.children.forEach(t=>{n(t,e[o])})};return i.forEach(t=>n(t,null)),e},Dt=(t,e,i,n)=>Math.sqrt(Math.pow(t-i,2)+Math.pow(e-n,2)),Rt=(t,e)=>{const i=t.x+t.width/2,n=t.y+t.height/2,o=e.x+e.width/2,r=e.y+e.height/2;return io&&no&&n>r?"right-bottom":ir?"left-bottom":io&&n===r?"right":i===o&&nr?"bottom":"overlap"},zt=({addContentToHeader:t,addContentToFooter:e})=>{const i=[];let n=null,o=0,r=null,s=0;const a=(t,e)=>{if("function"===typeof t){const n=t();if(!n)return;const{el:o,cssText:r,height:s}=n;if(o instanceof HTMLElement){Ht(o);const t=Pt({el:o,height:s});e(t,s)}r&&i.push(r)}};return a(t,(t,e)=>{n=t,o=e}),a(e,(t,e)=>{r=t,s=e}),{cssTextList:i,header:n,headerHeight:o,footer:r,footerHeight:s}},At=(t,e=0,i=0,n=0,o=0,r=!1,s=!1)=>{let a=1/0,h=-1/0,d=1/0,l=-1/0;const c=(t,e)=>{if((!e||!r)&&t.group)try{const{x:e,y:i,width:n,height:o}=t.group.findOne(".smm-node-shape").rbox();eh&&(h=e+n),il&&(l=i+o)}catch(i){}!s&&t._generalizationList.length>0&&t._generalizationList.forEach(t=>{c(t.generalizationNode)}),t.children&&t.children.forEach(t=>{c(t)})};return c(t,!0),a=a-e+n,d=d-i+o,h=h-e+n,l=l-i+o,{left:a,top:d,width:h-a,height:l-d}},Ot=(t,e=0,i=0,n=0,o=0)=>{let r=1/0,s=-1/0,a=1/0,h=-1/0;return t.forEach(t=>{const{left:d,top:l,width:c,height:u}=At(t,e,i,n,o,!1,!0);ds&&(s=d+c),lh&&(h=l+u)}),{left:r,top:a,width:s-r,height:h-a}},kt=()=>document.documentElement.requestFullScreen?"fullscreenchange":document.documentElement.webkitRequestFullScreen?"webkitfullscreenchange":document.documentElement.mozRequestFullScreen?"mozfullscreenchange":document.documentElement.msRequestFullscreen?"msfullscreenchange":void 0,It=kt(),Bt=t=>{t.requestFullScreen?t.requestFullScreen():t.webkitRequestFullScreen?t.webkitRequestFullScreen():t.mozRequestFullScreen&&t.mozRequestFullScreen()},Ft=()=>{document.fullscreenElement&&(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen&&document.mozCancelFullScreen())},Pt=({el:t,width:e,height:i})=>{const n=new s["c"];return void 0!==e&&n.width(e),void 0!==i&&n.height(i),n.add(t),n},Wt=t=>{const e=t.generalization;return e?Array.isArray(e)?e:[e]:[]},Ht=t=>{t.setAttribute("xmlns","http://www.w3.org/1999/xhtml")},jt=t=>(t=[...t],t.sort((t,e)=>t.sortIndex-e.sortIndex),t),Gt=(t,e)=>h()(t,e,{arrayMerge:(t,e)=>e}),$t=t=>{const e={};return o["i"].forEach(i=>{let n=t.style.merge(i);"fontSize"===i&&(n+="px"),e[i]=n}),e},Ut=(t,e)=>{const i=String(t).split("."),n=String(e).split("."),o=Math.max(i.length,n.length);for(let r=0;re)return">";if(t{if(!t||!t.opt||!e)return!1;const{customCheckIsFromCustomNodeContent:i}=t.opt;if("function"===typeof i)try{if(i(e,t))return!0}catch(s){}const n="[data-smm-stop-event]",o=e.target;if(o&&"function"===typeof o.closest&&o.closest(n))return!0;const r="function"===typeof e.composedPath?e.composedPath():e.path||[];if(Array.isArray(r)&&r.length)for(let a=0;a{let e=Object.keys(t);for(let i=0;it===e[i]))return!1;return!0},r=["lineColor","lineDasharray","lineWidth","lineMarkerDir","lineFlow","lineFlowDuration","lineFlowForward"]},"46c4":function(t,e,i){"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},5388:function(t,e,i){"use strict";var n=i("c65b");t.exports=function(t,e,i){var o,r,s=i?t:t.iterator,a=t.next;while(!(o=n(a,s)).done)if(r=e(o.value),void 0!==r)return r}},5494:function(t,e,i){"use strict";var n=i("83ab"),o=i("e330"),r=i("edd0"),s=URLSearchParams.prototype,a=o(s.forEach);n&&!("size"in s)&&r(s,"size",{get:function(){var t=0;return a(this,(function(){t++})),t},configurable:!0,enumerable:!0})},"5c06":function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s}));var n=i("8a19"),o=i("4013");class r{constructor(t){this.node=t,this.mindMap=t.mindMap}getShapePadding(t,e,i,n){const r=this.node.getShape(),s=15,a=5,h=t+2*i,d=e+2*n,l=Math.abs(h-d);switch(r){case o["a"].SHAPE.ROUNDED_RECTANGLE:return{paddingX:e>t?(e-t)/2:0,paddingY:0};case o["a"].SHAPE.DIAMOND:return{paddingX:t/2,paddingY:e/2};case o["a"].SHAPE.PARALLELOGRAM:return{paddingX:i<=0?s:0,paddingY:0};case o["a"].SHAPE.OUTER_TRIANGULAR_RECTANGLE:return{paddingX:i<=0?s:0,paddingY:0};case o["a"].SHAPE.INNER_TRIANGULAR_RECTANGLE:return{paddingX:i<=0?s:0,paddingY:0};case o["a"].SHAPE.ELLIPSE:return{paddingX:i<=0?s:0,paddingY:n<=0?a:0};case o["a"].SHAPE.CIRCLE:return{paddingX:d>h?l/2:0,paddingY:d{let e=String(t).split(/\s+/);return e.map(t=>{if(/^[\d.]+/.test(t)){let e=/^([\d.]+)(.*)$/.exec(t);return[Number(e[1]),e[2]]}return t})},s=(t,e)=>t*e,a=(t,e)=>e/t,h={left:0,top:0,center:50,bottom:100,right:100},d=({backgroundSize:t,drawOpt:e,imageRatio:i,canvasWidth:n,canvasHeight:o,canvasRatio:h})=>{if(t){let d=r(t);if("auto"===d[0]&&"auto"===d[1])return;if("cover"===d[0])return void(i>h?(e.height=o,e.width=s(i,o)):(e.width=n,e.height=a(i,n)));if("contain"===d[0])return void(i>h?(e.width=n,e.height=a(i,n)):(e.height=o,e.width=s(i,o)));let l=-1;d[0]&&(Array.isArray(d[0])?"%"===d[0][1]?(e.width=d[0][0]/100*n,l=e.width):(e.width=d[0][0],l=d[0][0]):"auto"===d[0]&&d[1]&&("%"===d[1][1]?e.width=s(i,d[1][0]/100*o):e.width=s(i,d[1][0]))),d[1]&&Array.isArray(d[1])?"%"===d[1][1]?e.height=d[1][0]/100*o:e.height=d[1][0]:-1!==l&&(e.height=a(i,l))}},l=({backgroundPosition:t,drawOpt:e,imgWidth:i,imgHeight:n,canvasWidth:o,canvasHeight:s})=>{if(t){let a=r(t);if(a=a.map(t=>"string"===typeof t&&void 0!==h[t]?[h[t],"%"]:t),Array.isArray(a[0])){if(1===a.length&&a.push([50,"%"]),"%"===a[0][1]){let t=a[0][0]/100*o,n=a[0][0]/100*i;e.x=t-n}else e.x=a[0][0];if("%"===a[1][1]){let t=a[1][0]/100*s,i=a[1][0]/100*n;e.y=t-i}else e.y=a[1][0]}}},c=({ctx:t,image:e,backgroundRepeat:i,drawOpt:n,imgWidth:o,imgHeight:s,canvasWidth:a,canvasHeight:h})=>{if(i){let d=n.x,l=n.y,c=Math.ceil(d/o),f=Math.ceil(l/s),p=d-c*o,g=l-f*s,m=r(i);if("no-repeat"===m[0]||o>=a&&s>=h)return;if("repeat-x"===m[0]&&a>o){let i=p;while(is){let i=g;while(is){let o=g;while(o{t.drawImage(e,i.sx,i.sy,i.swidth,i.sheight,i.x,i.y,i.width,i.height)},f=(t,e,i,n,{backgroundSize:o,backgroundPosition:r,backgroundRepeat:s},a=(()=>{}))=>{let h=e/i,f=new Image;f.src=n,f.onload=()=>{let n=f.width,p=f.height,g=n/p,m={sx:0,sy:0,swidth:n,sheight:p,x:0,y:0,width:n,height:p};d({backgroundSize:o,drawOpt:m,imageRatio:g,canvasWidth:e,canvasHeight:i,canvasRatio:h}),l({backgroundPosition:r,drawOpt:m,imgWidth:m.width,imgHeight:m.height,imageRatio:g,canvasWidth:e,canvasHeight:i,canvasRatio:h});let b=c({ctx:t,image:f,backgroundRepeat:s,drawOpt:m,imgWidth:m.width,imgHeight:m.height,imageRatio:g,canvasWidth:e,canvasHeight:i,canvasRatio:h});b||u(t,f,m),a()},f.onerror=t=>{a(t)}};var p=f,g=i("08af"),m=i("4013"),b=i("de81");class x{constructor(t){this.mindMap=t.mindMap}async export(t,e=!0,i="思维导图",...o){if(this[t]){const r=await this[t](i,...o);return e&&Object(n["y"])(r,i+"."+t),r}return null}createTransformImgTaskList(t,e,i,o){const r=t.find(e);return r.map(async t=>{const e=o(t);if(/^data:/.test(e)||"none"===e)return;const r=await Object(n["Z"])(e);t.attr(i,r)})}async getSvgData(t){let{exportPaddingX:e,exportPaddingY:i,errorHandler:r,resetCss:s,addContentToHeader:a,addContentToFooter:h,handleBeingExportSvg:d}=this.mindMap.opt,{svg:l,svgHTML:c,clipData:u}=this.mindMap.getSvgData({paddingX:e,paddingY:i,addContentToHeader:a,addContentToFooter:h,node:t});u&&(u.paddingX=e,u.paddingY=i);let f=!1;const p=this.createTransformImgTaskList(l,"image","href",t=>t.attr("href")||t.attr("xlink:href")),g=this.createTransformImgTaskList(l,"img","src",t=>t.attr("src")),b=[...p,...g];try{await Promise.all(b)}catch(x){r(m["b"].EXPORT_LOAD_IMAGE_ERROR,x)}if(this.mindMap.richText){const t=l.find("foreignObject");if(t.length>0&&(t[0].add(Object(o["i"])(``)),f=!0),this.mindMap.formula){const e=l.find(".ql-formula");if(e.length>0){const e=this.mindMap.formula.getStyleText();if(e){const i=document.createElement("style");i.innerHTML=e,Object(n["b"])(i),t[0].add(i),f=!0}}}}return"function"===typeof d&&(f=!0,l=d(l)),(b.length>0||f)&&(c=l.svg()),{node:l,str:c,clipData:u}}svgToPng(t,e,i=null){const{maxCanvasSize:o,minExportImgCanvasScale:r}=this.mindMap.opt;return new Promise((s,a)=>{const h=new Image;h.setAttribute("crossOrigin","anonymous"),h.onload=async()=>{try{const t=document.createElement("canvas"),a=Math.max(window.devicePixelRatio,r);let d=h.width,l=h.height,c=0,u=0;i&&(c=i.paddingX,u=i.paddingY,d=i.width+2*c,l=i.height+2*u);let f=d*a,p=l*a;if(f>o||p>o){let t=null,e=null;f>o?t=o:p>o&&(e=o);const i=Object(n["ub"])(f,p,t,e);f=i[0],p=i[1]}t.width=f,t.height=p;const g=f/a,m=p/a;t.style.width=g+"px",t.style.height=m+"px";const b=t.getContext("2d");b.scale(a,a),e||await this.drawBackgroundToCanvas(b,g,m),i?b.drawImage(h,i.left,i.top,i.width,i.height,c,u,i.width,i.height):b.drawImage(h,0,0,g,m),s(t.toDataURL())}catch(t){a(t)}},h.onerror=t=>{a(t)},h.src=t})}drawBackgroundToCanvas(t,e,i){return new Promise((n,o)=>{const{backgroundColor:r="#fff",backgroundImage:s,backgroundRepeat:a="no-repeat",backgroundPosition:h="center center",backgroundSize:d="cover"}=this.mindMap.themeConfig;t.save(),t.rect(0,0,e,i),t.fillStyle=r,t.fill(),t.restore(),s&&"none"!==s?(t.save(),p(t,e,i,s,{backgroundRepeat:a,backgroundPosition:h,backgroundSize:d},e=>{e?o(e):n(),t.restore()})):n()})}drawBackgroundToSvg(t){return new Promise(async e=>{const{backgroundColor:i="#fff",backgroundImage:o,backgroundRepeat:r="repeat"}=this.mindMap.themeConfig;if(t.css("background-color",i),o&&"none"!==o){const i=await Object(n["Z"])(o);t.css("background-image",`url(${i})`),t.css("background-repeat",r),e()}else e()})}async png(t,e=!1,i=null){this.handleNodeExport(i);const{str:n,clipData:o}=await this.getSvgData(i),r=await this.fixSvgStrAndToBlob(n),s=await this.svgToPng(r,e,o);return s}handleNodeExport(t){if(t&&t.getData("isActive")){t.deactivate();const{alwaysShowExpandBtn:e,notShowExpandBtn:i}=this.mindMap.opt;e||i||!t.getData("expand")||t.removeExpandBtn()}}async pdf(t,e=!1){if(!this.mindMap.doExportPDF)throw new Error("请注册ExportPDF插件");const i=await this.png(t,e),n=await this.mindMap.doExportPDF.pdf(i);return n}async xmind(t){if(!this.mindMap.doExportXMind)throw new Error("请注册ExportXMind插件");const e=this.mindMap.getData(),i=await this.mindMap.doExportXMind.xmind(e,t),o=await Object(n["pb"])(i);return o}async svg(t){const{node:e}=await this.getSvgData();e.first().before(Object(o["i"])(`${t}`)),await this.drawBackgroundToSvg(e);const i=e.svg(),n=await this.fixSvgStrAndToBlob(i);return n}async fixSvgStrAndToBlob(t){t=Object(n["rb"])(t),t=Object(n["X"])(t);const e=new Blob([t],{type:"image/svg+xml"}),i=await Object(n["pb"])(e);return i}async json(t,e=!0){const i=this.mindMap.getData(e),o=JSON.stringify(i),r=new Blob([o]),s=await Object(n["pb"])(r);return s}async smm(t,e){const i=await this.json(t,e);return i}async md(){const t=this.mindMap.getData(),e=Object(g["a"])(t),i=new Blob([e]),o=await Object(n["pb"])(i);return o}async txt(){const t=this.mindMap.getData(),e=Object(b["a"])(t),i=new Blob([e]),o=await Object(n["pb"])(i);return o}}x.instanceName="doExport";e["a"]=x},"682c":function(t,e,i){"use strict";var n=function(t){return o(t)&&!r(t)};function o(t){return!!t&&"object"===typeof t}function r(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||h(t)}var s="function"===typeof Symbol&&Symbol.for,a=s?Symbol.for("react.element"):60103;function h(t){return t.$$typeof===a}function d(t){return Array.isArray(t)?[]:{}}function l(t,e){var i=e&&!0===e.clone;return i&&n(t)?f(d(t),t,e):t}function c(t,e,i){var o=t.slice();return e.forEach((function(e,r){"undefined"===typeof o[r]?o[r]=l(e,i):n(e)?o[r]=f(t[r],e,i):-1===t.indexOf(e)&&o.push(l(e,i))})),o}function u(t,e,i){var o={};return n(t)&&Object.keys(t).forEach((function(e){o[e]=l(t[e],i)})),Object.keys(e).forEach((function(r){n(e[r])&&t[r]?o[r]=f(t[r],e[r],i):o[r]=l(e[r],i)})),o}function f(t,e,i){var n=Array.isArray(e),o=Array.isArray(t),r=i||{arrayMerge:c},s=n===o;if(s){if(n){var a=r.arrayMerge||c;return a(t,e,i)}return u(t,e,i)}return l(e,i)}f.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce((function(t,i){return f(t,i,e)}))};var p=f;t.exports=p},"68df":function(t,e,i){"use strict";var n=i("dc19"),o=i("8e16"),r=i("384f"),s=i("7f65");t.exports=function(t){var e=n(this),i=s(t);return!(o(e)>i.size)&&!1!==r(e,(function(t){if(!i.includes(t))return!1}),!0)}},"6f5e":function(t,e,i){"use strict";i.r(e),i.d(e,"FLOWCHART_NODE_TYPES",(function(){return n})),i.d(e,"FLOWCHART_LINE_TYPES",(function(){return o})),i.d(e,"FLOWCHART_NODE_STYLES",(function(){return r})),i.d(e,"CONNECTOR_POSITIONS",(function(){return s})),i.d(e,"FLOWCHART_DEFAULT_CONFIG",(function(){return a}));const n={PROCESS:"process",DECISION:"decision",START:"start",END:"end",SUBPROCESS:"subprocess",DATA:"data",DOCUMENT:"document",DATABASE:"database",PREPARATION:"preparation"},o={STRAIGHT:"straight",ORTHOGONAL:"orthogonal",CURVE:"curve"},r={[n.PROCESS]:{shape:"rectangle",backgroundColor:"#e1f5fe",borderColor:"#01579b",borderWidth:2},[n.DECISION]:{shape:"diamond",backgroundColor:"#fff3e0",borderColor:"#e65100",borderWidth:2},[n.START]:{shape:"circle",backgroundColor:"#e8f5e9",borderColor:"#1b5e20",borderWidth:2},[n.END]:{shape:"circle",backgroundColor:"#ffebee",borderColor:"#b71c1c",borderWidth:2},[n.SUBPROCESS]:{shape:"roundedRectangle",backgroundColor:"#f3e5f5",borderColor:"#4a148c",borderWidth:2},[n.DATA]:{shape:"parallelogram",backgroundColor:"#fce4ec",borderColor:"#880e4f",borderWidth:2},[n.DOCUMENT]:{shape:"rectangle",backgroundColor:"#efebe9",borderColor:"#3e2723",borderWidth:2},[n.DATABASE]:{shape:"rectangle",backgroundColor:"#e0f2f1",borderColor:"#004d40",borderWidth:2},[n.PREPARATION]:{shape:"rectangle",backgroundColor:"#fff8e1",borderColor:"#f57f17",borderWidth:2}},s=["top","right","bottom","left"],a={gridSize:20,snapToGrid:!0,showConnectors:!0,connectorSize:8,connectorColor:"#666",connectorActiveColor:"#2196f3",defaultNodeType:n.PROCESS,defaultLineType:o.ORTHOGONAL}},"70cc":function(t,e,i){"use strict";i("79a4")},7145:function(t,e,i){"use strict";i("d9e2"),i("14d9");var n=i("4013");class o{constructor(t={}){this.opt=t,this.mindMap=this.opt.mindMap,this.scale=1,this.sx=0,this.sy=0,this.x=0,this.y=0,this.firstDrag=!0,this.setTransformData(this.mindMap.opt.viewData),this.bind()}bind(){this.mindMap.keyCommand.addShortcut("Control+=",()=>{this.enlarge()}),this.mindMap.keyCommand.addShortcut("Control+-",()=>{this.narrow()}),this.mindMap.keyCommand.addShortcut("Control+i",()=>{this.fit()}),this.mindMap.event.on("mousedown",t=>{const{isDisableDrag:e,mousedownEventPreventDefault:i}=this.mindMap.opt;e||(i&&t.preventDefault(),this.sx=this.x,this.sy=this.y)}),this.mindMap.event.on("drag",(t,e)=>{t.ctrlKey||t.metaKey||this.mindMap.opt.isDisableDrag||(this.firstDrag&&(this.firstDrag=!1,this.mindMap.renderer.activeNodeList.length>0&&this.mindMap.execCommand("CLEAR_ACTIVE_NODE")),this.x=this.sx+e.mousemoveOffset.x,this.y=this.sy+e.mousemoveOffset.y,this.transform())}),this.mindMap.event.on("mouseup",()=>{this.firstDrag=!0}),this.mindMap.event.on("mousewheel",(t,e,i,o)=>{const{customHandleMousewheel:r,mousewheelAction:s,mouseScaleCenterUseMousePosition:a,mousewheelMoveStep:h,mousewheelZoomActionReverse:d,disableMouseWheelZoom:l,translateRatio:c}=this.mindMap.opt;if(r&&"function"===typeof r)return r(t);if(s===n["a"].MOUSE_WHEEL_ACTION.ZOOM||t.ctrlKey||t.metaKey){if(l)return;const{x:i,y:r}=this.mindMap.toPos(t.clientX,t.clientY),s=a?i:void 0,h=a?r:void 0;switch(o&&(e.includes(n["a"].DIR.LEFT)||e.includes(n["a"].DIR.RIGHT))&&(e=e.filter(t=>![n["a"].DIR.LEFT,n["a"].DIR.RIGHT].includes(t))),!0){case e.includes(n["a"].DIR.UP||n["a"].DIR.LEFT):d?this.enlarge(s,h,o):this.narrow(s,h,o);break;case e.includes(n["a"].DIR.DOWN||n["a"].DIR.RIGHT):d?this.narrow(s,h,o):this.enlarge(s,h,o);break}}else{let i=0,r=0;o?(i=Math.abs(t.wheelDeltaX),r=Math.abs(t.wheelDeltaY)):i=r=h;let s=0,a=0;e.includes(n["a"].DIR.DOWN)&&(a=-r),e.includes(n["a"].DIR.UP)&&(a=r),e.includes(n["a"].DIR.LEFT)&&(s=i),e.includes(n["a"].DIR.RIGHT)&&(s=-i),this.translateXY(s*c,a*c)}}),this.mindMap.on("resize",()=>{this.checkNeedMindMapInCanvas()&&this.transform()})}getTransformData(){return{transform:this.mindMap.draw.transform(),state:{scale:this.scale,x:this.x,y:this.y,sx:this.sx,sy:this.sy}}}setTransformData(t){t&&(Object.keys(t.state).forEach(e=>{this[e]=t.state[e]}),this.mindMap.draw.transform({...t.transform}),this.mindMap.emit("view_data_change",this.getTransformData()),this.emitEvent("scale"),this.emitEvent("translate"))}translateXY(t,e){0===t&&0===e||(this.x+=t,this.y+=e,this.transform(),this.emitEvent("translate"))}translateX(t){0!==t&&(this.x+=t,this.transform(),this.emitEvent("translate"))}translateXTo(t){this.x=t,this.transform(),this.emitEvent("translate")}translateY(t){0!==t&&(this.y+=t,this.transform(),this.emitEvent("translate"))}translateYTo(t){this.y=t,this.transform(),this.emitEvent("translate")}transform(){try{this.limitMindMapInCanvas()}catch(t){}this.mindMap.draw.transform({origin:[0,0],scale:this.scale,translate:[this.x,this.y]}),this.mindMap.emit("view_data_change",this.getTransformData())}reset(){const t=1!==this.scale,e=0!==this.x||0!==this.y;this.scale=1,this.x=0,this.y=0,this.transform(),t&&this.emitEvent("scale"),e&&this.emitEvent("translate")}narrow(t,e,i){let{scaleRatio:n,minZoomRatio:o}=this.mindMap.opt;n/=i?5:1;const r=Math.max(this.scale-n,o/100);this.scaleInCenter(r,t,e),this.transform(),this.emitEvent("scale")}enlarge(t,e,i){let{scaleRatio:n,maxZoomRatio:o}=this.mindMap.opt;n/=i?5:1;let r=0;r=-1===o?this.scale+n:Math.min(this.scale+n,o/100),this.scaleInCenter(r,t,e),this.transform(),this.emitEvent("scale")}scaleInCenter(t,e,i){void 0!==e&&void 0!==i||(e=this.mindMap.width/2,i=this.mindMap.height/2);const n=this.scale,o=1-t/n,r=(e-this.x)*o,s=(i-this.y)*o;this.x+=r,this.y+=s,this.scale=t}setScale(t,e,i){void 0!==e&&void 0!==i?this.scaleInCenter(t,e,i):this.scale=t,this.transform(),this.emitEvent("scale")}fit(t=(()=>{}),e=!1,i){i=void 0===i?this.mindMap.opt.fitPadding:i;const n=this.mindMap.draw,o=n.transform(),r=t()||n.rbox(),s=r.width/o.scaleX,a=r.height/o.scaleY,h=s/a;let{width:d,height:l}=this.mindMap.elRect;d-=2*i,l-=2*i;const c=d/l;let u=0,f="";if(s<=d&&a<=l&&!e)u=1,f=1;else{let t=0,e=0;h>c?(t=d,e=d/h,f=2):(e=l,t=l*h,f=3),u=t/s}this.setScale(u);const p=t()||n.rbox();p.x-=this.mindMap.elRect.left,p.y-=this.mindMap.elRect.top;let g=0,m=0;1===f?(g=-p.x+i+(d-p.width)/2,m=-p.y+i+(l-p.height)/2):2===f?(g=-p.x+i,m=-p.y+i+(l-p.height)/2):3===f&&(g=-p.x+i+(d-p.width)/2,m=-p.y+i),this.translateXY(g,m)}checkNeedMindMapInCanvas(){if(this.mindMap.demonstrate&&this.mindMap.demonstrate.isInDemonstrate)return!1;const{isLimitMindMapInCanvasWhenHasScrollbar:t,isLimitMindMapInCanvas:e}=this.mindMap.opt;return this.mindMap.scrollbar?t:e}limitMindMapInCanvas(){if(!this.checkNeedMindMapInCanvas())return;let{scale:t,left:e,top:i,right:n,bottom:o}=this.getPositionLimit();const r=(this.mindMap.width-this.mindMap.initWidth)/2*t,s=(this.mindMap.height-this.mindMap.initHeight)/2*t,a=this.scale/t;e*=a,n*=a,i*=a,o*=a;const h=this.mindMap.width/2,d=this.mindMap.height/2,l=this.scale-1;e-=l*h-r,n-=l*h-r,i-=l*d-s,o-=l*d-s,this.x>e&&(this.x=e),this.xi&&(this.y=i),this.y{const n=t.group.rbox();e=Math.min(e,n.x),i=Math.min(i,n.y),r=Math.max(r,n.x2),s=Math.max(s,n.y2)}),o={x:e,y:i,x2:r,y2:s,width:r-e,height:s-i}}else o={x:0,y:0,x2:0,y2:0,width:0,height:0};const r=this.mindMap.renderer.layout.getRootCenterOffset(o.width,o.height),s=o.x-i.x-r.x*t,a=o.x-i.x2-r.x*t,h=o.y-i.y-r.y*e,d=o.y-i.y2-r.y*e;return{scale:t,left:s,right:a,top:h,bottom:d}}emitEvent(t){switch(t){case"scale":this.mindMap.emit("scale",this.scale);case"translate":this.mindMap.emit("translate",this.x,this.y)}}}var r=o,s=i("91d2"),a=i.n(s),h=i("1e42");class d extends a.a{constructor(t={}){super(),this.opt=t,this.mindMap=t.mindMap,this.isLeftMousedown=!1,this.isRightMousedown=!1,this.isMiddleMousedown=!1,this.mousedownPos={x:0,y:0},this.mousemovePos={x:0,y:0},this.mousemoveOffset={x:0,y:0},this.bindFn(),this.bind()}bindFn(){this.onBodyMousedown=this.onBodyMousedown.bind(this),this.onBodyClick=this.onBodyClick.bind(this),this.onDrawClick=this.onDrawClick.bind(this),this.onMousedown=this.onMousedown.bind(this),this.onMousemove=this.onMousemove.bind(this),this.onMouseup=this.onMouseup.bind(this),this.onNodeMouseup=this.onNodeMouseup.bind(this),this.onMousewheel=this.onMousewheel.bind(this),this.onContextmenu=this.onContextmenu.bind(this),this.onSvgMousedown=this.onSvgMousedown.bind(this),this.onKeyup=this.onKeyup.bind(this),this.onMouseenter=this.onMouseenter.bind(this),this.onMouseleave=this.onMouseleave.bind(this)}bind(){document.body.addEventListener("mousedown",this.onBodyMousedown),document.body.addEventListener("click",this.onBodyClick),this.mindMap.svg.on("click",this.onDrawClick),this.mindMap.el.addEventListener("mousedown",this.onMousedown),this.mindMap.svg.on("mousedown",this.onSvgMousedown),window.addEventListener("mousemove",this.onMousemove),window.addEventListener("mouseup",this.onMouseup),this.on("node_mouseup",this.onNodeMouseup),this.mindMap.el.addEventListener("wheel",this.onMousewheel),this.mindMap.svg.on("contextmenu",this.onContextmenu),this.mindMap.svg.on("mouseenter",this.onMouseenter),this.mindMap.svg.on("mouseleave",this.onMouseleave),window.addEventListener("keyup",this.onKeyup)}unbind(){document.body.removeEventListener("mousedown",this.onBodyMousedown),document.body.removeEventListener("click",this.onBodyClick),this.mindMap.svg.off("click",this.onDrawClick),this.mindMap.el.removeEventListener("mousedown",this.onMousedown),window.removeEventListener("mousemove",this.onMousemove),window.removeEventListener("mouseup",this.onMouseup),this.off("node_mouseup",this.onNodeMouseup),this.mindMap.el.removeEventListener("wheel",this.onMousewheel),this.mindMap.svg.off("contextmenu",this.onContextmenu),this.mindMap.svg.off("mouseenter",this.onMouseenter),this.mindMap.svg.off("mouseleave",this.onMouseleave),window.removeEventListener("keyup",this.onKeyup)}onDrawClick(t){Object(h["ab"])(this.mindMap,t)||this.emit("draw_click",t)}onBodyMousedown(t){this.emit("body_mousedown",t)}onBodyClick(t){this.emit("body_click",t)}onSvgMousedown(t){this.emit("svg_mousedown",t)}onMousedown(t){Object(h["ab"])(this.mindMap,t)||(1===t.which?this.isLeftMousedown=!0:3===t.which?this.isRightMousedown=!0:2===t.which&&(this.isMiddleMousedown=!0),this.mousedownPos.x=t.clientX,this.mousedownPos.y=t.clientY,this.emit("mousedown",t,this))}onMousemove(t){let{useLeftKeySelectionRightKeyDrag:e}=this.mindMap.opt;this.mousemovePos.x=t.clientX,this.mousemovePos.y=t.clientY,this.mousemoveOffset.x=t.clientX-this.mousedownPos.x,this.mousemoveOffset.y=t.clientY-this.mousedownPos.y,this.emit("mousemove",t,this),(this.isMiddleMousedown||(e?this.isRightMousedown:this.isLeftMousedown))&&(t.preventDefault(),this.emit("drag",t,this))}onMouseup(t){this.onNodeMouseup(),this.emit("mouseup",t,this)}onNodeMouseup(){this.isLeftMousedown=!1,this.isRightMousedown=!1,this.isMiddleMousedown=!1}onMousewheel(t){t.stopPropagation(),t.preventDefault();const e=[];t.deltaY<0&&e.push(n["a"].DIR.UP),t.deltaY>0&&e.push(n["a"].DIR.DOWN),t.deltaX<0&&e.push(n["a"].DIR.LEFT),t.deltaX>0&&e.push(n["a"].DIR.RIGHT);let i=!1;const{customCheckIsTouchPad:o}=this.mindMap.opt;i="function"===typeof o?o(t):Math.abs(t.deltaY)<=10,this.emit("mousewheel",t,e,this,i)}onContextmenu(t){Object(h["ab"])(this.mindMap,t)||(t.preventDefault(),t.ctrlKey||this.emit("contextmenu",t))}onKeyup(t){this.emit("keyup",t)}onMouseenter(t){this.emit("svg_mouseenter",t)}onMouseleave(t){this.emit("svg_mouseleave",t)}}var l=d,c=i("682c"),u=i.n(c),f=(i("13d5"),i("7c25"));class p extends f["a"]{constructor(t={},e){super(t),this.isUseLeft=e===n["a"].LAYOUT.LOGICAL_STRUCTURE_LEFT}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedTopValue()},()=>{this.adjustTopValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){let i=0;Object(h["Db"])(t,null,(t,n,o,r,s,a)=>{let h=this.createNode(t,n,o,r,s,a);if(h.sortIndex=i,i++,o){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)h.left=t.data.customLeft,h.top=t.data.customTop;else if(this.setNodeCenter(h),void 0!==e&&null!==e){const t=150;h.top+=e*t}void 0!==e&&null!==e||(this.root=h)}else this.isUseLeft?h.left=n._node.left-h.width-this.getMarginX(r):h.left=n._node.left+n._node.width+this.getMarginX(r);if(!t.data.expand)return!0},(t,e,i,n)=>{let o=!1===t.data.expand?0:t._node.children.length;t._node.childrenAreaHeight=o?t._node.children.reduce((t,e)=>t+e.height,0)+(o+1)*this.getMarginY(n+1):0;let r=t._node.checkHasGeneralization()?t._node._generalizationNodeHeight+this.getMarginY(n+1):0;t._node.childrenAreaHeight2=Math.max(t._node.childrenAreaHeight,r)},!0,0)}computedTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(t.getData("expand")&&t.children&&t.children.length){let e=this.getMarginY(n+1),i=t.top+t.height/2-t.childrenAreaHeight/2,o=i+e;t.children.forEach(t=>{t.top=o,o+=t.height+e})}},null,!0)}adjustTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;let o=t.childrenAreaHeight2-2*this.getMarginY(n+1)-t.height;o>0&&this.updateBrothers(t,o/2)},null,!0)}updateBrothers(t,e){if(t.parent){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((i,o)=>{if(i.uid===t.uid||i.hasCustomPosition())return;let r=0;on&&(r=e),i.top+=r,i.children&&i.children.length&&this.updateChildren(i.children,"top",r)}),this.updateBrothers(t.parent,e)}}renderLine(t,e,i,n){"curve"===n?this.renderLineCurve(t,e,i):"direct"===n?this.renderLineDirect(t,e,i):"brace"===n?this.renderLineBrace(t,e,i):this.renderLineStraight(t,e,i)}renderLineStraight(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s,expandBtnSize:a}=t;const{alwaysShowExpandBtn:h,notShowExpandBtn:d}=this.mindMap.opt;h&&!d||(a=0);let l=this.getMarginX(t.layerIndex+1),c=.6*(l-a);this.isUseLeft&&(c*=-1);let u=this.mindMap.themeConfig.nodeUseLineStyle;t.children.forEach((h,d)=>{let l;l=this.isUseLeft?0===t.layerIndex?n:n-a:0===t.layerIndex?n+r:n+r+a;let f=o+s/2,p=this.isUseLeft?h.left+h.width:h.left,g=h.top+h.height/2,m=u?h.width*(this.isUseLeft?-1:1):0;f=u&&!t.isRoot?f+s/2:f,g=u?g+h.height/2:g;let b=this.createFoldLine([[l,f],[l+c,f],[l+c,g],[p+m,g]]);this.setLineStyle(i,e[d],b,h)})}renderLineDirect(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s,expandBtnSize:a}=t;const{alwaysShowExpandBtn:h,notShowExpandBtn:d}=this.mindMap.opt;h&&!d||(a=0);const{nodeUseLineStyle:l}=this.mindMap.themeConfig;t.children.forEach((h,d)=>{0===t.layerIndex&&(a=0);let c=this.isUseLeft?n-a:n+r+a,u=o+s/2,f=this.isUseLeft?h.left+h.width:h.left,p=h.top+h.height/2;u=l&&!t.isRoot?u+s/2:u,p=l?p+h.height/2:p;let g=l?` L ${this.isUseLeft?h.left:h.left+h.width},${p}`:"",m=`M ${c},${u} L ${f},${p}`+g;this.setLineStyle(i,e[d],m,h)})}renderLineCurve(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s,expandBtnSize:a}=t;const{alwaysShowExpandBtn:h,notShowExpandBtn:d}=this.mindMap.opt;h&&!d||(a=0);const{nodeUseLineStyle:l,rootLineStartPositionKeepSameInCurve:c,rootLineKeepSameInCurve:u}=this.mindMap.themeConfig;t.children.forEach((h,d)=>{let f;0===t.layerIndex&&(a=0),f=this.isUseLeft?0!==t.layerIndex||c?n-a:n+r/2:0!==t.layerIndex||c?n+r+a:n+r/2;let p,g=o+s/2,m=this.isUseLeft?h.left+h.width:h.left,b=h.top+h.height/2,x="";g=l&&!t.isRoot?g+s/2:g,b=l?b+h.height/2:b,p=this.isUseLeft?l?` L ${h.left},${b}`:"":l?` L ${h.left+h.width},${b}`:"",x=t.isRoot&&!u?this.quadraticCurvePath(f,g,m,b)+p:this.cubicBezierPath(f,g,m,b)+p,this.setLineStyle(i,e[d],x,h)})}renderLineBrace(t,e,i){if(t.children.length<=0)return[];const{left:n,top:o,width:r,height:s,expandBtnSize:a}=t,{alwaysShowExpandBtn:h,notShowExpandBtn:d}=this.mindMap.opt;let l=a;h&&!d||(l=0),0===t.layerIndex&&(l=0);const{braceCurveSize:c=12}=this.mindMap.themeConfig,u=this.getMarginX(t.layerIndex+1),f=t.children,p=o+s/2;if(1===f.length){const t=f[0],o=t.top+t.height/2;let s,a;this.isUseLeft?(s=n-l,a=t.left+t.width):(s=n+r+l,a=t.left);const h=(s+a)/2,d=(p+o)/2,c=Math.abs(a-s),u=c/3,g=`M ${h-u/2},${d} L ${h+u/2},${d}`;this.setLineStyle(i,e[0],g,t,!0)}else{const t=f[0],o=f[f.length-1],s=t.top+t.height/2,a=o.top+o.height/2;let h;h=this.isUseLeft?n-l-.4*u:n+r+l+.4*u;const d=this.createBracePath(h,s,a,p,this.isUseLeft,c);this.setLineStyle(i,e[0],d,t,!1);for(let i=1;i{let{left:e,top:i,bottom:n,right:o,generalizationLineMargin:r,generalizationNodeMargin:s}=this.getNodeGeneralizationRenderBoundaries(t,"h"),a=this.isUseLeft?e-r:o+r,h=a,d=i,l=a,c=n,u=h+(this.isUseLeft?-20:20),f=d+(c-d)/2,p=`M ${h},${d} Q ${u},${f} ${l},${c}`;t.generalizationLine.plot(p),t.generalizationNode.left=a+(this.isUseLeft?-s:s)-(this.isUseLeft?t.generalizationNode.width:0),t.generalizationNode.top=i+(n-i-t.generalizationNode.height)/2})}renderExpandBtnRect(t,e,i,n){this.isUseLeft?t.size(e,n).x(-e).y(0):t.size(e,n).x(i).y(0)}}var g=p;class m extends f["a"]{constructor(t={}){super(t)}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedTopValue()},()=>{this.adjustTopValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){Object(h["Db"])(t,null,(t,i,o,r,s,a)=>{let h=this.createNode(t,i,o,r,s,a);if(o){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)h.left=t.data.customLeft,h.top=t.data.customTop;else if(this.setNodeCenter(h),void 0!==e&&null!==e){const t=150;h.top+=e*t}}else i._node.dir?h.dir=i._node.dir:h.dir=h.getData("dir")||(s%2===0?n["a"].LAYOUT_GROW_DIR.RIGHT:n["a"].LAYOUT_GROW_DIR.LEFT),h.left=h.dir===n["a"].LAYOUT_GROW_DIR.RIGHT?i._node.left+i._node.width+this.getMarginX(r):i._node.left-this.getMarginX(r)-h.width;if(!t.data.expand)return!0},(t,e,i,o)=>{if(!t.data.expand)return t._node.leftChildrenAreaHeight=0,void(t._node.rightChildrenAreaHeight=0);let r=0,s=0,a=0,h=0;t._node.children.forEach(t=>{t.dir===n["a"].LAYOUT_GROW_DIR.LEFT?(r++,a+=t.height):(s++,h+=t.height)}),t._node.leftChildrenAreaHeight=a+(r+1)*this.getMarginY(o+1),t._node.rightChildrenAreaHeight=h+(s+1)*this.getMarginY(o+1);let d=t._node.checkHasGeneralization()?t._node._generalizationNodeHeight+this.getMarginY(o+1):0;t._node.leftChildrenAreaHeight2=Math.max(t._node.leftChildrenAreaHeight,d),t._node.rightChildrenAreaHeight2=Math.max(t._node.rightChildrenAreaHeight,d)},!0,0)}computedTopValue(){Object(h["Db"])(this.root,null,(t,e,i,o)=>{if(t.getData("expand")&&t.children&&t.children.length){let e=this.getMarginY(o+1),i=t.top+t.height/2+e,r=i-t.leftChildrenAreaHeight/2,s=i-t.rightChildrenAreaHeight/2;t.children.forEach(t=>{t.dir===n["a"].LAYOUT_GROW_DIR.LEFT?(t.top=r,r+=t.height+e):(t.top=s,s+=t.height+e)})}},null,!0)}adjustTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;let o=2*this.getMarginY(n+1)+t.height,r=t.leftChildrenAreaHeight2-o,s=t.rightChildrenAreaHeight2-o;(r>0||s>0)&&this.updateBrothers(t,r/2,s/2)},null,!0)}updateBrothers(t,e,i){if(t.parent){let o=t.parent.children.filter(e=>e.dir===t.dir),r=Object(h["K"])(t,o);o.forEach((t,o)=>{if(t.hasCustomPosition())return;let s=0,a=t.dir===n["a"].LAYOUT_GROW_DIR.LEFT?e:i;or&&(s=a),t.top+=s,t.children&&t.children.length&&this.updateChildren(t.children,"top",s)}),this.updateBrothers(t.parent,e,i)}}renderLine(t,e,i,n){"curve"===n?this.renderLineCurve(t,e,i):"direct"===n?this.renderLineDirect(t,e,i):"brace"===n?this.renderLineBrace(t,e,i):this.renderLineStraight(t,e,i)}renderLineStraight(t,e,i){if(t.children.length<=0)return[];let{left:o,top:r,width:s,height:a,expandBtnSize:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(h=0);let c=this.getMarginX(t.layerIndex+1),u=.6*(c-h),f=this.mindMap.themeConfig.nodeUseLineStyle;t.children.forEach((d,l)=>{let c=0,p=0,g=f?d.width:0;d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?(p=-u,c=0===t.layerIndex?o:o-h,g=-g):(p=u,c=0===t.layerIndex?o+s:o+s+h);let m=r+a/2,b=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?d.left+d.width:d.left,x=d.top+d.height/2;m=f&&!t.isRoot?m+a/2:m,x=f?x+d.height/2:x;let y=this.createFoldLine([[c,m],[c+p,m],[c+p,x],[b+g,x]]);this.setLineStyle(i,e[l],y,d)})}renderLineDirect(t,e,i){if(t.children.length<=0)return[];let{left:o,top:r,width:s,height:a,expandBtnSize:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(h=0);const{nodeUseLineStyle:c}=this.mindMap.themeConfig;t.children.forEach((d,l)=>{0===t.layerIndex&&(h=0);let u=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?o-h:o+s+h,f=r+a/2,p=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?d.left+d.width:d.left,g=d.top+d.height/2;f=c&&!t.isRoot?f+a/2:f,g=c?g+d.height/2:g;let m="";c&&(m=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?` L ${d.left},${g}`:` L ${d.left+d.width},${g}`);let b=`M ${u},${f} L ${p},${g}`+m;this.setLineStyle(i,e[l],b,d)})}renderLineCurve(t,e,i){if(t.children.length<=0)return[];let{left:o,top:r,width:s,height:a,expandBtnSize:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(h=0);const{nodeUseLineStyle:c,rootLineKeepSameInCurve:u,rootLineStartPositionKeepSameInCurve:f}=this.mindMap.themeConfig;t.children.forEach((d,l)=>{0===t.layerIndex&&(h=0);let p=0!==t.layerIndex||f?d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?o-h:o+s+h:o+s/2,g=r+a/2,m=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?d.left+d.width:d.left,b=d.top+d.height/2,x="";g=c&&!t.isRoot?g+a/2:g,b=c?b+d.height/2:b;let y="";c&&(y=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?` L ${d.left},${b}`:` L ${d.left+d.width},${b}`),x=t.isRoot&&!u?this.quadraticCurvePath(p,g,m,b)+y:this.cubicBezierPath(p,g,m,b)+y,this.setLineStyle(i,e[l],x,d)})}renderLineBrace(t,e,i){if(t.children.length<=0)return[];const{left:o,top:r,width:s,height:a,expandBtnSize:h}=t,{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;let c=h;d&&!l||(c=0),0===t.layerIndex&&(c=0);const{braceCurveSize:u=15}=this.mindMap.themeConfig,f=this.getMarginX(t.layerIndex+1),p=t.children.filter(t=>t.dir===n["a"].LAYOUT_GROW_DIR.LEFT),g=t.children.filter(t=>t.dir===n["a"].LAYOUT_GROW_DIR.RIGHT);if(g.length>0){const n=r+a/2;if(1===g.length){const r=g[0],a=r.top+r.height/2,h=o+s+c,d=r.left,l=(h+d)/2,u=(n+a)/2,f=d-h,p=f/3,m=`M ${l-p/2},${u} L ${l+p/2},${u}`;this.setLineStyle(i,e[t.children.indexOf(r)],m,r,!0)}else{const r=g[0],a=g[g.length-1],h=r.top+r.height/2,d=a.top+a.height/2,l=o+s+c+.4*f,p=this.createBracePath(l,h,d,n,!1,u);this.setLineStyle(i,e[t.children.indexOf(g[0])],p,g[0],!1);for(let i=1;i0){const n=r+a/2;if(1===p.length){const r=p[0],s=r.top+r.height/2,a=o-c,h=r.left+r.width,d=(h+a)/2,l=(n+s)/2,u=a-h,f=u/3,g=`M ${d-f/2},${l} L ${d+f/2},${l}`;this.setLineStyle(i,e[t.children.indexOf(r)],g,r,!0)}else{const r=p[0],s=p[p.length-1],a=r.top+r.height/2,h=s.top+s.height/2,d=o-c-.4*f,l=this.createBracePath(d,a,h,n,!0,u);this.setLineStyle(i,e[t.children.indexOf(p[0])],l,p[0],!1);for(let i=1;i{let e=t.node.dir===n["a"].LAYOUT_GROW_DIR.LEFT,{top:i,bottom:o,left:r,right:s,generalizationLineMargin:a,generalizationNodeMargin:h}=this.getNodeGeneralizationRenderBoundaries(t,"h"),d=e?r-a:s+a,l=d,c=i,u=d,f=o,p=l+(e?-20:20),g=c+(f-c)/2,m=`M ${l},${c} Q ${p},${g} ${u},${f}`;t.generalizationLine.plot(m),t.generalizationNode.left=d+(e?-h:h)-(e?t.generalizationNode.width:0),t.generalizationNode.top=i+(o-i-t.generalizationNode.height)/2})}renderExpandBtnRect(t,e,i,o,r){r.dir===n["a"].LAYOUT_GROW_DIR.LEFT?t.size(e,o).x(-e).y(0):t.size(e,o).x(i).y(0)}}var b=m;class x extends f["a"]{constructor(t={}){super(t)}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedLeftTopValue()},()=>{this.adjustLeftTopValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){Object(h["Db"])(t,null,(t,i,n,o,r,s)=>{let a=this.createNode(t,i,n,o,r,s);if(n){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)a.left=t.data.customLeft,a.top=t.data.customTop;else if(this.setNodeCenter(a),void 0!==e&&null!==e){const t=200;a.top+=e*t}}else i._node.isRoot&&(a.top=i._node.top+i._node.height+this.getMarginX(o));if(!t.data.expand)return!0},(t,e,i,n)=>{if(i){let e=!1===t.data.expand?0:t._node.children.length;t._node.childrenAreaWidth=e?t._node.children.reduce((t,e)=>t+e.width,0)+(e+1)*this.getMarginX(n+1):0}},!0,0)}computedLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(t.getData("expand")&&t.children&&t.children.length){let e=this.getMarginX(n+1),o=this.getMarginY(n+1);if(i){let i=t.left+t.width/2-t.childrenAreaWidth/2,n=i+e;t.children.forEach(t=>{t.left=n,n+=t.width+e})}else{let e=t.top+this.getNodeHeightWithGeneralization(t)+o+(this.getNodeActChildrenLength(t)>0?t.expandBtnSize:0);t.children.forEach(i=>{i.left=t.left+.5*t.width,i.top=e,e+=this.getNodeHeightWithGeneralization(i)+o+(this.getNodeActChildrenLength(i)>0?i.expandBtnSize:0)})}}},null,!0)}adjustLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;if(e&&e.isRoot){let e=this.getNodeAreaWidth(t,!0),i=e-t.width;i>0&&this.updateBrothersLeft(t,i)}let o=t.children.length;if(e&&!e.isRoot&&o>0){let e=this.getMarginY(n+1),i=t.children.reduce((t,e)=>t+this.getNodeHeightWithGeneralization(e)+(this.getNodeActChildrenLength(e)>0?e.expandBtnSize:0),0)+o*e;this.updateBrothersTop(t,i)}},(t,e,i)=>{if(i){let{right:e,left:i}=this.getNodeBoundaries(t,"h"),n=e-i,o=t.left-i-(n-t.width)/2;this.updateChildren(t.children,"left",o)}},!0)}updateBrothersLeft(t,e){if(t.parent){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((t,i)=>{t.hasCustomPosition()||i<=n||(t.left+=e,t.children&&t.children.length&&this.updateChildren(t.children,"left",e))}),this.updateBrothersLeft(t.parent,e)}}updateBrothersTop(t,e){if(t.parent&&!t.parent.isRoot){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((t,i)=>{if(t.hasCustomPosition())return;let o=0;i>n&&(o=e),t.top+=o,t.children&&t.children.length&&this.updateChildren(t.children,"top",o)}),this.updateBrothersTop(t.parent,e)}}renderLine(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s,expandBtnSize:a}=t;const{alwaysShowExpandBtn:h,notShowExpandBtn:d}=this.mindMap.opt;h&&!d||(a=0);let l=t.children.length,c=this.getMarginX(t.layerIndex+1);if(t.isRoot){let a=n+r/2,h=o+s,d=.7*c,u=1/0,f=-1/0;t.children.forEach((t,n)=>{let o=t.left+t.width/2,r=t.top;of&&(f=o);let s=this.mindMap.themeConfig.nodeUseLineStyle?` L ${t.left},${r} L ${t.left+t.width},${r}`:"",a=`M ${o},${h+d} L ${o},${h+d>r?r+t.height:r}`+s;this.setLineStyle(i,e[n],a,t)}),u=Math.min(u,a),f=Math.max(f,a);let p=this.lineDraw.path();if(t.style.line(p),p.plot(this.transformPath(`M ${a},${h} L ${a},${h+d}`)),t._lines.push(p),i&&i(p,t),l>0){let e=this.lineDraw.path();t.style.line(e),e.plot(this.transformPath(`M ${u},${h+d} L ${f},${h+d}`)),t._lines.push(e),i&&i(e,t)}}else{let n=o+s,r=-1/0,h=t.left+.3*t.width;if(t.children.forEach((s,a)=>{let d=s.top+s.height/2;d>r&&(r=d);let l="",c=s.left,u=s.left+s.widthh&&(f=!0,d=s.top,r=d),d>o&&d0){let e=this.lineDraw.path();a=l>0?a:0,t.style.line(e),r{let{top:e,bottom:i,right:n,generalizationLineMargin:o,generalizationNodeMargin:r}=this.getNodeGeneralizationRenderBoundaries(t,"h"),s=n+o,a=e,h=n+o,d=i,l=s+20,c=a+(d-a)/2,u=`M ${s},${a} Q ${l},${c} ${h},${d}`;t.generalizationLine.plot(this.transformPath(u)),t.generalizationNode.left=n+r,t.generalizationNode.top=e+(i-e-t.generalizationNode.height)/2})}renderExpandBtnRect(t,e,i,n,o){t.size(i,e).x(0).y(n)}}var y=x;class w extends f["a"]{constructor(t={}){super(t)}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedLeftValue()},()=>{this.adjustLeftValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){Object(h["Db"])(t,null,(t,i,n,o,r,s)=>{let a=this.createNode(t,i,n,o,r,s);if(n){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)a.left=t.data.customLeft,a.top=t.data.customTop;else if(this.setNodeCenter(a),void 0!==e&&null!==e){const t=200;a.top+=e*t}}else a.top=i._node.top+i._node.height+this.getMarginX(o);if(!t.data.expand)return!0},(t,e,i,n)=>{let o=!1===t.data.expand?0:t._node.children.length;t._node.childrenAreaWidth=o?t._node.children.reduce((t,e)=>t+e.width,0)+(o+1)*this.getMarginY(n+1):0;let r=t._node.checkHasGeneralization()?t._node._generalizationNodeWidth+this.getMarginY(n+1):0;t._node.childrenAreaWidth2=Math.max(t._node.childrenAreaWidth,r)},!0,0)}computedLeftValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(t.getData("expand")&&t.children&&t.children.length){let e=this.getMarginY(n+1),i=t.left+t.width/2-t.childrenAreaWidth/2,o=i+e;t.children.forEach(t=>{t.left=o,o+=t.width+e})}},null,!0)}adjustLeftValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;let o=t.childrenAreaWidth2-2*this.getMarginY(n+1)-t.width;o>0&&this.updateBrothers(t,o/2)},null,!0)}updateBrothers(t,e){if(t.parent){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((t,i)=>{if(t.hasCustomPosition())return;let o=0;in&&(o=e),t.left+=o,t.children&&t.children.length&&this.updateChildren(t.children,"left",o)}),this.updateBrothers(t.parent,e)}}renderLine(t,e,i,n){"curve"===n?this.renderLineCurve(t,e,i):"direct"===n?this.renderLineDirect(t,e,i):this.renderLineStraight(t,e,i)}renderLineCurve(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s,expandBtnSize:a}=t;const{alwaysShowExpandBtn:h,notShowExpandBtn:d}=this.mindMap.opt;h&&!d||(a=0);const{nodeUseLineStyle:l,rootLineStartPositionKeepSameInCurve:c,rootLineKeepSameInCurve:u}=this.mindMap.themeConfig;t.children.forEach((h,d)=>{0===t.layerIndex&&(a=0);let f=n+r/2,p=0!==t.layerIndex||c?o+s+a:o+s/2,g=h.left+h.width/2,m=h.top,b="",x=l?` L ${h.left},${m} L ${h.left+h.width},${m}`:"";b=t.isRoot&&!u?this.quadraticCurvePath(f,p,g,m,!0)+x:this.cubicBezierPath(f,p,g,m,!0)+x,this.setLineStyle(i,e[d],b,h)})}renderLineDirect(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s}=t;const{nodeUseLineStyle:a}=this.mindMap.themeConfig;let h=n+r/2,d=o+s;t.children.forEach((t,n)=>{let o=t.left+t.width/2,r=t.top,s=a?` L ${t.left},${r} L ${t.left+t.width},${r}`:"",l=`M ${h},${d} L ${o},${r}`+s;this.setLineStyle(i,e[n],l,t)})}renderLineStraight(t,e,i){if(t.children.length<=0)return[];let{left:n,top:o,width:r,height:s,expandBtnSize:a,isRoot:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(a=0);let c=n+r/2,u=o+s,f=this.getMarginX(t.layerIndex+1),p=.7*f,g=1/0,m=-1/0,b=t.children.length;t.children.forEach((t,n)=>{let o=t.left+t.width/2,r=u+p>t.top?t.top+t.height:t.top;om&&(m=o);let s=this.mindMap.themeConfig.nodeUseLineStyle?` L ${t.left},${r} L ${t.left+t.width},${r}`:"",a=`M ${o},${u+p} L ${o},${r}`+s;this.setLineStyle(i,e[n],a,t)}),g=Math.min(c,g),m=Math.max(c,m);let x=this.lineDraw.path();if(t.style.line(x),a=b>0&&!h?a:0,x.plot(this.transformPath(`M ${c},${u+a} L ${c},${u+p}`)),t._lines.push(x),i&&i(x,t),b>0){let e=this.lineDraw.path();t.style.line(e),e.plot(this.transformPath(`M ${g},${u+p} L ${m},${u+p}`)),t._lines.push(e),i&&i(e,t)}}renderExpandBtn(t,e){let{width:i,height:n,expandBtnSize:o}=t,{translateX:r,translateY:s}=e.transform();e.translate(i/2-o/2-r,n+o/2-s)}renderGeneralization(t){t.forEach(t=>{let{bottom:e,left:i,right:n,generalizationLineMargin:o,generalizationNodeMargin:r}=this.getNodeGeneralizationRenderBoundaries(t,"v"),s=i,a=e+o,h=n,d=e+o,l=s+(h-s)/2,c=a+20,u=`M ${s},${a} Q ${l},${c} ${h},${d}`;t.generalizationLine.plot(this.transformPath(u)),t.generalizationNode.top=e+r,t.generalizationNode.left=i+(n-i-t.generalizationNode.width)/2})}renderExpandBtnRect(t,e,i,n,o){t.size(i,e).x(0).y(n)}}var C=w;class v extends f["a"]{constructor(t={},e){super(t),this.layout=e}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedLeftTopValue()},()=>{this.adjustLeftTopValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){Object(h["Db"])(t,null,(t,i,o,r,s,a)=>{let h=this.createNode(t,i,o,r,s,a);if(o){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)h.left=t.data.customLeft,h.top=t.data.customTop;else if(this.setNodeCenter(h),void 0!==e&&null!==e){const t=200;h.top+=e*t}}else this.layout===n["a"].LAYOUT.TIMELINE2?i._node.dir?h.dir=i._node.dir:h.dir=s%2===0?n["a"].LAYOUT_GROW_DIR.BOTTOM:n["a"].LAYOUT_GROW_DIR.TOP:h.dir="",i._node.isRoot&&(h.top=i._node.top+(t._node.height>i._node.height?-(t._node.height-i._node.height)/2:(i._node.height-t._node.height)/2));if(!t.data.expand)return!0},null,!0,0)}computedLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n,o)=>{if(t.getData("expand")&&t.children&&t.children.length){let e=this.getMarginX(n+1),o=this.getMarginY(n+1);if(i){let i=t.left+t.width,n=i+e;t.children.forEach(t=>{t.left=n,n+=t.width+e})}else{let e=t.top+t.height+o+(this.getNodeActChildrenLength(t)>0?t.expandBtnSize:0);t.children.forEach(i=>{i.left=t.left+.5*t.width,i.top=e,e+=i.height+o+(this.getNodeActChildrenLength(i)>0?i.expandBtnSize:0)})}}},null,!0)}adjustLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;t.isRoot&&this.updateBrothersLeft(t);let o=t.children.length;if(e&&!e.isRoot&&o>0){let e=this.getMarginY(n+1),i=t.children.reduce((t,e)=>t+e.height+(this.getNodeActChildrenLength(e)>0?e.expandBtnSize:0),0)+o*e;this.updateBrothersTop(t,i)}},(t,e,i,o)=>{e&&e.isRoot&&t.dir===n["a"].LAYOUT_GROW_DIR.TOP&&t.children.forEach(e=>{let i=this.getNodeAreaHeight(e),n=e.top;e.top=t.top-(e.top-t.top)-i+t.height,this.updateChildren(e.children,"top",e.top-n)})},!0)}getNodeAreaHeight(t){let e=0,i=t=>{e+=t.height+(this.getNodeActChildrenLength(t)>0?t.expandBtnSize:0)+this.getMarginY(t.layerIndex),t.children.length&&t.children.forEach(t=>{i(t)})};return i(t),e}updateBrothersLeft(t){let e=t.children,i=0;e.forEach(t=>{t.left+=i,t.children&&t.children.length&&this.updateChildren(t.children,"left",i);let{left:e,right:n}=this.getNodeBoundaries(t,"h"),o=n-e,r=o-t.width;r>0&&(i+=r)})}updateBrothersTop(t,e){if(t.parent&&!t.parent.isRoot){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((t,i)=>{if(t.hasCustomPosition())return;let o=0;i>n&&(o=e),t.top+=o,t.children&&t.children.length&&this.updateChildren(t.children,"top",o)}),this.updateBrothersTop(t.parent,e)}}renderLine(t,e,i){if(t.children.length<=0)return[];let{left:o,top:r,width:s,height:a,expandBtnSize:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(h=0);let c=t.children.length;if(t.isRoot){let n=t;t.children.forEach((o,r)=>{let s=n.left+n.width,a=o.left,h=t.top+t.height/2,d=`M ${s},${h} L ${a},${h}`;this.setLineStyle(i,e[r],d,o),n=o})}else{let o=-1/0,s=1/0,d=t.left+.3*t.width;if(t.children.forEach((t,n)=>{let r=t.top+t.height/2;r>o&&(o=r),r0){let e=this.lineDraw.path();h=c>0?h:0,t.parent&&t.parent.isRoot&&t.dir===n["a"].LAYOUT_GROW_DIR.TOP?e.plot(this.transformPath(`M ${d},${r} L ${d},${s}`)):e.plot(this.transformPath(`M ${d},${r+a+h} L ${d},${o}`)),t.style.line(e),t._lines.push(e),i&&i(e,t)}}}renderExpandBtn(t,e){let{width:i,height:o,expandBtnSize:r,isRoot:s}=t;if(!s){let{translateX:s,translateY:a}=e.transform();t.parent&&t.parent.isRoot&&t.dir===n["a"].LAYOUT_GROW_DIR.TOP?e.translate(.3*i-r/2-s,-r/2-a):e.translate(.3*i-r/2-s,o+r/2-a)}}renderGeneralization(t){t.forEach(t=>{let{top:e,bottom:i,right:n,generalizationLineMargin:o,generalizationNodeMargin:r}=this.getNodeGeneralizationRenderBoundaries(t,"h"),s=n+o,a=e,h=n+o,d=i,l=s+20,c=a+(d-a)/2,u=`M ${s},${a} Q ${l},${c} ${h},${d}`;t.generalizationLine.plot(this.transformPath(u)),t.generalizationNode.left=n+r,t.generalizationNode.top=e+(i-e-t.generalizationNode.height)/2})}renderExpandBtnRect(t,e,i,o,r){if(this.layout===n["a"].LAYOUT.TIMELINE)t.size(i,e).x(0).y(o);else{let s="";s=r.dir===n["a"].LAYOUT_GROW_DIR.TOP&&1===r.layerIndex?n["a"].LAYOUT_GROW_DIR.TOP:n["a"].LAYOUT_GROW_DIR.BOTTOM,s===n["a"].LAYOUT_GROW_DIR.TOP?t.size(i,e).x(0).y(-e):t.size(i,e).x(0).y(o)}}}var _=v;class M extends f["a"]{constructor(t={},e){super(t),this.layout=e}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedTopValue()},()=>{this.adjustLeftTopValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){Object(h["Db"])(t,null,(t,i,o,r,s,a)=>{let h=this.createNode(t,i,o,r,s,a);if(o){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)h.left=t.data.customLeft,h.top=t.data.customTop;else if(this.setNodeCenter(h),void 0!==e&&null!==e){const t=300;h.left+=e*t}}else i._node.dir?h.dir=i._node.dir:h.dir=s%2===0?n["a"].LAYOUT_GROW_DIR.RIGHT:n["a"].LAYOUT_GROW_DIR.LEFT,i._node.isRoot?h.left=i._node.left+(t._node.width>i._node.width?-(t._node.width-i._node.width)/2:(i._node.width-t._node.width)/2):h.left=h.dir===n["a"].LAYOUT_GROW_DIR.RIGHT?i._node.left+i._node.width+this.getMarginX(r):i._node.left-this.getMarginX(r)-h.width;if(!t.data.expand)return!0},(t,e,i,n)=>{if(i)return;let o=!1===t.data.expand?0:t._node.children.length;t._node.childrenAreaHeight=o?t._node.children.reduce((t,e)=>t+e.height,0)+(o+1)*this.getMarginY(n+1):0},!0,0)}computedTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n,o)=>{if(t.getData("expand")&&t.children&&t.children.length){let e=this.getMarginY(n+1);if(i){let i=t.top+t.height,n=i+e;t.children.forEach(t=>{t.top=n,n+=t.height+e})}else{let e=this.getMarginY(n+1),i=t.top+t.height/2+e,o=i-t.childrenAreaHeight/2;t.children.forEach(t=>{t.top=o,o+=t.height+e})}}},null,!0)}adjustLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;if(i)return;let o=2*this.getMarginY(n+1)+t.height,r=t.childrenAreaHeight-o;r>0&&this.updateBrothers(t,r/2)},null,!0)}updateBrothers(t,e){if(t.parent){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((i,o)=>{if(i.hasCustomPosition())return;if(!t.parent.isRoot&&i.uid===t.uid)return;let r=0;t.parent.isRoot?r=on?2*e:e:on&&(r=e),i.top+=r,i.children&&i.children.length&&this.updateChildren(i.children,"top",r)}),this.updateBrothers(t.parent,e)}}updateBrothersTop(t,e){if(t.parent&&!t.parent.isRoot){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((t,i)=>{if(t.hasCustomPosition())return;let o=0;i>n&&(o=e),t.top+=o,t.children&&t.children.length&&this.updateChildren(t.children,"top",o)}),this.updateBrothersTop(t.parent,e)}}renderLine(t,e,i,n){"curve"===n?this.renderLineCurve(t,e,i):"direct"===n?this.renderLineDirect(t,e,i):this.renderLineStraight(t,e,i)}renderLineStraight(t,e,i){if(t.children.length<=0)return[];let{expandBtnSize:o}=t;const{alwaysShowExpandBtn:r,notShowExpandBtn:s}=this.mindMap.opt;if(r&&!s||(o=0),t.isRoot){let n=t;t.children.forEach((o,r)=>{let s=n.top+n.height,a=o.top,h=t.left+t.width/2,d=`M ${h},${s} L ${h},${a}`;this.setLineStyle(i,e[r],d,o),n=o})}else if(t.dir===n["a"].LAYOUT_GROW_DIR.RIGHT){let n=t.left+t.width,r=t.top+t.height/2,s=this.getMarginX(t.layerIndex+1),a=.6*(s-o);t.children.forEach((t,o)=>{let s=t.left,h=t.top+t.height/2,d=this.createFoldLine([[n,r],[n+a,r],[n+a,h],[s,h]]);this.setLineStyle(i,e[o],d,t)})}else{let n=t.left,r=t.top+t.height/2,s=this.getMarginX(t.layerIndex+1),a=.6*(s-o);t.children.forEach((t,o)=>{let s=t.left+t.width,h=t.top+t.height/2,d=this.createFoldLine([[n,r],[n-a,r],[n-a,h],[s,h]]);this.setLineStyle(i,e[o],d,t)})}}renderLineDirect(t,e,i){if(t.children.length<=0)return[];let{left:o,top:r,width:s,height:a,expandBtnSize:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(h=0),t.children.forEach((d,l)=>{if(t.isRoot){let n=t;t.children.forEach((o,r)=>{let s=n.top+n.height,a=o.top,h=t.left+t.width/2,d=`M ${h},${s} L ${h},${a}`;this.setLineStyle(i,e[r],d,o),n=o})}else{let t=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?o-h:o+s+h,c=r+a/2,u=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?d.left+d.width:d.left,f=d.top+d.height/2,p=`M ${t},${c} L ${u},${f}`;this.setLineStyle(i,e[l],p,d)}})}renderLineCurve(t,e,i){if(t.children.length<=0)return[];let{left:o,top:r,width:s,height:a,expandBtnSize:h}=t;const{alwaysShowExpandBtn:d,notShowExpandBtn:l}=this.mindMap.opt;d&&!l||(h=0),t.children.forEach((d,l)=>{if(t.isRoot){let n=t;t.children.forEach((o,r)=>{let s=n.top+n.height,a=o.top,h=t.left+t.width/2,d=`M ${h},${s} L ${h},${a}`;this.setLineStyle(i,e[r],d,o),n=o})}else{let t=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?o-h:o+s+h,c=r+a/2,u=d.dir===n["a"].LAYOUT_GROW_DIR.LEFT?d.left+d.width:d.left,f=d.top+d.height/2,p=this.cubicBezierPath(t,c,u,f);this.setLineStyle(i,e[l],p,d)}})}renderExpandBtn(t,e){let{width:i,height:o,expandBtnSize:r,isRoot:s}=t;if(!s){let{translateX:s,translateY:a}=e.transform();t.dir===n["a"].LAYOUT_GROW_DIR.RIGHT?e.translate(i-s,o/2-a):e.translate(-r-s,o/2-a)}}renderGeneralization(t){t.forEach(t=>{let e=t.node.dir===n["a"].LAYOUT_GROW_DIR.LEFT,{top:i,bottom:o,left:r,right:s,generalizationLineMargin:a,generalizationNodeMargin:h}=this.getNodeGeneralizationRenderBoundaries(t,"h"),d=e?r-a:s+a,l=d,c=i,u=d,f=o,p=l+(e?-20:20),g=c+(f-c)/2,m=`M ${l},${c} Q ${p},${g} ${u},${f}`;t.generalizationLine.plot(this.transformPath(m)),t.generalizationNode.left=d+(e?-h:h)-(e?t.generalizationNode.width:0),t.generalizationNode.top=i+(o-i-t.generalizationNode.height)/2})}renderExpandBtnRect(t,e,i,o,r){r.dir===n["a"].LAYOUT_GROW_DIR.LEFT?t.size(e,o).x(-e).y(0):t.size(e,o).x(i).y(0)}}var E=M,N={top:{renderExpandBtn({node:t,btn:e,expandBtnSize:i,translateX:n,translateY:o,width:r,height:s}){t.parent&&t.parent.isRoot?e.translate(.3*r-i/2-n,-i/2-o):e.translate(.3*r-i/2-n,s+i/2-o)},renderLine({node:t,line:e,top:i,x:n,lineLength:o,height:r,expandBtnSize:s,maxy:a,ctx:d}){t.parent&&t.parent.isRoot?e.plot(d.transformPath(`M ${n},${i} L ${n+o},${i-Math.tan(Object(h["x"])(d.mindMap.opt.fishboneDeg))*o}`)):e.plot(d.transformPath(`M ${n},${i+r+s} L ${n},${a}`))},computedLeftTopValue({layerIndex:t,node:e,ctx:i}){if(t>=1&&e.children){let n=i.getMarginY(t+1),o=e.left+e.width*i.childIndent,r=e.top+e.height+(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0)+n;e.children.forEach(t=>{t.left=o,t.top+=r,r+=t.height+(i.getNodeActChildrenLength(t)>0?t.expandBtnSize:0)+n})}},adjustLeftTopValueBefore({node:t,parent:e,ctx:i,layerIndex:n}){let o=t.children.length,r=i.getMarginY(n+1);if(e&&!e.isRoot&&o>0){let e=t.children.reduce((t,e)=>t+e.height+(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0)+r,0);i.updateBrothersTop(t,e)}},adjustLeftTopValueAfter({parent:t,node:e,ctx:i}){if(t&&t.isRoot){let t=i.getMarginY(e.layerIndex+1),n=e.expandBtnSize+t;e.children.forEach(t=>{let o=i.getNodeAreaHeight(t),r=t.top,s=t.left;t.top=e.top-(t.top-e.top)-o+e.height,t.left=e.left+e.width*i.indent+(o+n)/Math.tan(Object(h["x"])(i.mindMap.opt.fishboneDeg)),n+=o,i.updateChildrenPro(t.children,{top:t.top-r,left:t.left-s})})}}},bottom:{renderExpandBtn({node:t,btn:e,expandBtnSize:i,translateX:n,translateY:o,width:r,height:s}){t.parent&&t.parent.isRoot?e.translate(.3*r-i/2-n,s+i/2-o):e.translate(.3*r-i/2-n,-i/2-o)},renderLine({node:t,line:e,top:i,x:n,lineLength:o,height:r,miny:s,ctx:a}){t.parent&&t.parent.isRoot?e.plot(a.transformPath(`M ${n},${i+r} L ${n+o},${i+r+Math.tan(Object(h["x"])(a.mindMap.opt.fishboneDeg))*o}`)):e.plot(a.transformPath(`M ${n},${i} L ${n},${s}`))},computedLeftTopValue({layerIndex:t,node:e,ctx:i}){let n=i.getMarginY(t+1);if(1===t&&e.children){let t=e.left+e.width*i.childIndent,o=e.top+e.height+(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0)+n;e.children.forEach(e=>{e.left=t,e.top=o+(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0),o+=e.height+(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0)+n})}if(t>1&&e.children){let t=e.left+e.width*i.childIndent,o=e.top-(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0)-n;e.children.forEach(e=>{e.left=t,e.top=o-e.height,o-=e.height+(i.getNodeActChildrenLength(e)>0?e.expandBtnSize:0)+n})}},adjustLeftTopValueBefore({node:t,ctx:e,layerIndex:i}){let n=e.getMarginY(i+1),o=t.children.length;if(i>2&&o>0){let i=t.children.reduce((t,i)=>t+i.height+(e.getNodeActChildrenLength(i)>0?i.expandBtnSize:0)+n,0);e.updateBrothersTop(t,-i)}},adjustLeftTopValueAfter({parent:t,node:e,ctx:i}){if(t&&t.isRoot){let t=i.getMarginY(e.layerIndex+1),n=0,o=e.expandBtnSize;e.children.forEach(r=>{let s=i.getNodeActChildrenLength(r)>0,a=i.getNodeAreaHeight(r),d=s?a-r.height-(s?r.expandBtnSize:0):0;d-=s?t:0;let l=n+d,c=r.left;r.top+=l,r.left=e.left+e.width*i.indent+(a+o)/Math.tan(Object(h["x"])(i.mindMap.opt.fishboneDeg)),n+=d,o+=a,i.updateChildrenPro(r.children,{top:l,left:r.left-c})})}}}};class T extends f["a"]{constructor(t={}){super(t),this.indent=.3,this.childIndent=.5}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedLeftTopValue()},()=>{this.adjustLeftTopValue()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){Object(h["Db"])(t,null,(t,i,o,r,s,a)=>{let h=this.createNode(t,i,o,r,s,a);if(o){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)h.left=t.data.customLeft,h.top=t.data.customTop;else if(this.setNodeCenter(h),void 0!==e&&null!==e){const t=250;h.top+=e*t}}else if(i._node.dir?h.dir=i._node.dir:h.dir=s%2===0?n["a"].LAYOUT_GROW_DIR.TOP:n["a"].LAYOUT_GROW_DIR.BOTTOM,i._node.isRoot){let t=this.getMarginY(r);this.checkIsTop(h)?h.top=i._node.top-h.height-t:h.top=i._node.top+i._node.height+t}if(!t.data.expand)return!0},null,!0,0)}computedLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(t.isRoot){let e=this.getMarginX(n+1),i=t.left+t.width+t.height+e,o=t.left+t.width+t.height+e;t.children.forEach(t=>{this.checkIsTop(t)?(t.left=i,i+=t.width+e):(t.left=o+20,o+=t.width+e)})}let o={layerIndex:n,node:t,ctx:this};this.checkIsTop(t)?N.top.computedLeftTopValue(o):N.bottom.computedLeftTopValue(o)},null,!0)}adjustLeftTopValue(){Object(h["Db"])(this.root,null,(t,e,i,n)=>{if(!t.getData("expand"))return;let o={node:t,parent:e,layerIndex:n,ctx:this};this.checkIsTop(t)?N.top.adjustLeftTopValueBefore(o):N.bottom.adjustLeftTopValueBefore(o)},(t,e)=>{let i={parent:e,node:t,ctx:this};if(this.checkIsTop(t)?N.top.adjustLeftTopValueAfter(i):N.bottom.adjustLeftTopValueAfter(i),t.isRoot){let e=0,i=0;t.children.forEach(t=>{if(this.checkIsTop(t)){t.left+=e,this.updateChildren(t.children,"left",e);let{left:i,right:n}=this.getNodeBoundaries(t,"h");e+=n-i}else{t.left+=i,this.updateChildren(t.children,"left",i);let{left:e,right:n}=this.getNodeBoundaries(t,"h");i+=n-e}})}},!0)}getNodeAreaHeight(t){let e=0,i=t=>{let n=this.getMarginY(t.layerIndex);e+=t.height+(this.getNodeActChildrenLength(t)>0?t.expandBtnSize:0)+n,t.children.length&&t.children.forEach(t=>{i(t)})};return i(t),e}updateBrothersLeft(t){let e=t.children,i=0;e.forEach(t=>{t.left+=i,t.children&&t.children.length&&this.updateChildren(t.children,"left",i);let{left:e,right:n}=this.getNodeBoundaries(t,"h"),o=n-e,r=o-t.width;r>0&&(i+=r)})}updateBrothersTop(t,e){if(t.parent&&!t.parent.isRoot){let i=t.parent.children,n=Object(h["K"])(t,i);i.forEach((t,i)=>{if(t.hasCustomPosition())return;let o=0;i>n&&(o=e),t.top+=o,t.children&&t.children.length&&this.updateChildren(t.children,"top",o)}),this.checkIsTop(t)?this.updateBrothersTop(t.parent,e):this.updateBrothersTop(t.parent,3===t.layerIndex?0:e)}}checkIsTop(t){return t.dir===n["a"].LAYOUT_GROW_DIR.TOP}renderLine(t,e,i){if(1!==t.layerIndex&&t.children.length<=0)return[];let{top:n,height:o,expandBtnSize:r}=t;const{alwaysShowExpandBtn:s,notShowExpandBtn:a}=this.mindMap.opt;s&&!a||(r=0);let d=t.children.length;if(t.isRoot){let e=-1/0;t.children.forEach(n=>{n.left>e&&(e=n.left);let o=this.getMarginY(n.layerIndex),r=n.left,s=t.height/2+o,a=s/Math.tan(Object(h["x"])(this.mindMap.opt.fishboneDeg)),d=this.lineDraw.path();this.checkIsTop(n)?d.plot(this.transformPath(`M ${r-a},${n.top+n.height+s} L ${n.left},${n.top+n.height}`)):d.plot(this.transformPath(`M ${r-a},${n.top-s} L ${r},${n.top}`)),t.style.line(d),t._lines.push(d),i&&i(d,t)});let n=t.top+t.height/2,o=t.height/2+this.getMarginY(t.layerIndex+1),r=this.lineDraw.path();r.plot(this.transformPath(`M ${t.left+t.width},${n} L ${e-o/Math.tan(Object(h["x"])(this.mindMap.opt.fishboneDeg))},${n}`)),t.style.line(r),t._lines.push(r),i&&i(r,t)}else{let s=-1/0,a=1/0,h=-1/0,l=t.left+t.width*this.indent;if(t.children.forEach((n,o)=>{n.left>h&&(h=n.left);let r=n.top+n.height/2;if(r>s&&(s=r),r1){let t=`M ${l},${r} L ${n.left},${r}`;this.setLineStyle(i,e[o],t,n)}}),d>=0){let e=this.lineDraw.path();r=d>0?r:0;let c=h-t.left-t.width*this.indent;c=Math.max(c,0);let u={node:t,line:e,top:n,x:l,lineLength:c,height:o,expandBtnSize:r,maxy:s,miny:a,ctx:this};this.checkIsTop(t)?N.top.renderLine(u):N.bottom.renderLine(u),t.style.line(e),t._lines.push(e),i&&i(e,t)}}}renderExpandBtn(t,e){let{width:i,height:n,expandBtnSize:o,isRoot:r}=t;if(!r){let{translateX:r,translateY:s}=e.transform(),a={node:t,btn:e,expandBtnSize:o,translateX:r,translateY:s,width:i,height:n};this.checkIsTop(t)?N.top.renderExpandBtn(a):N.bottom.renderExpandBtn(a)}}renderGeneralization(t){t.forEach(t=>{let{top:e,bottom:i,right:n,generalizationLineMargin:o,generalizationNodeMargin:r}=this.getNodeGeneralizationRenderBoundaries(t,"h"),s=n+o,a=e,h=n+o,d=i,l=s+20,c=a+(d-a)/2,u=`M ${s},${a} Q ${l},${c} ${h},${d}`;t.generalizationLine.plot(this.transformPath(u)),t.generalizationNode.left=n+r,t.generalizationNode.top=e+(i-e-t.generalizationNode.height)/2})}renderExpandBtnRect(t,e,i,o,r){let s="";s=r.dir===n["a"].LAYOUT_GROW_DIR.TOP?1===r.layerIndex?n["a"].LAYOUT_GROW_DIR.TOP:n["a"].LAYOUT_GROW_DIR.BOTTOM:1===r.layerIndex?n["a"].LAYOUT_GROW_DIR.BOTTOM:n["a"].LAYOUT_GROW_DIR.TOP,s===n["a"].LAYOUT_GROW_DIR.TOP?t.size(i,e).x(0).y(-e):t.size(i,e).x(0).y(o)}getLayoutType(){return n["a"].LAYOUT.FISHBONE}}var L=T;class S extends f["a"]{constructor(t={}){super(t);const e=this.mindMap.opt.radialLayoutConfig||{};this.startRadius=e.startRadius||120,this.radiusIncrement=e.radiusIncrement||150,this.startAngle=e.startAngle||0,this.endAngle=e.endAngle||360,this.minNodeSpacing=e.minNodeSpacing||20,this.radiusGrowthStrategy=e.radiusGrowthStrategy||"auto",this.exponentialGrowthFactor=e.exponentialGrowthFactor||1.5,this.autoAdjustRadius=!1!==e.autoAdjustRadius,this.angleDistribution=e.angleDistribution||"uniform",this.customRadiusCalculator=e.customRadiusCalculator||null}doLayout(t,e,i){const n=e||this.renderer.renderTree;let o=[()=>{this.computedBaseValue(n,i)},()=>{this.computedRadialPosition()},()=>{t(this.root)}];Object(h["c"])(o)}computedBaseValue(t,e){let i=0;Object(h["Db"])(t,null,(t,n,o,r,s,a)=>{let h=this.createNode(t,n,o,r,s,a);if(h.sortIndex=i,i++,o){const i=void 0!==t.data.customLeft&&void 0!==t.data.customTop;if(i)h.left=t.data.customLeft,h.top=t.data.customTop;else if(this.setNodeCenter(h),void 0!==e&&null!==e){const t=300;h.left+=e*t}void 0!==e&&null!==e||(this.root=h)}if(!t.data.expand)return!0},null,!0,0)}computedRadialPosition(){if(!this.root)return;const t=this.root.left+this.root.width/2,e=this.root.top+this.root.height/2;this.layoutSubtree(this.root,t,e,this.startAngle,this.endAngle,0)}layoutSubtree(t,e,i,n,o,r){if(!t.getData("expand")||!t.children||0===t.children.length)return;const s=t.children,a=s.length;let h=0,d=0;const l=[];s.forEach(t=>{const e=Math.max(t.width,t.height);h+=e+this.minNodeSpacing,d=Math.max(d,e),l.push(e)});let c=this.calculateRadius(r,a,h,n,o);const u=this.calculateNodePositions(s,c,n,o,e,i,l);s.forEach((t,n)=>{const{x:o,y:s,childStartAngle:a,childEndAngle:h}=u[n];t.left=o-t.width/2,t.top=s-t.height/2,this.layoutSubtree(t,e,i,a,h,r+1)})}calculateRadius(t,e,i,n,o){if(this.customRadiusCalculator)return this.customRadiusCalculator(t,e,i);let r;switch(this.radiusGrowthStrategy){case"fixed":if("function"===typeof this.radiusIncrement){r=this.startRadius;for(let e=0;es&&(r=i/e)}break}return r}calculateNodePositions(t,e,i,n,o,r,s){const a=[],h=n-i;if(1===t.length){const t=i+h/2,s=t*Math.PI/180;a.push({x:o+e*Math.cos(s),y:r+e*Math.sin(s),childStartAngle:i,childEndAngle:n})}else if("weighted"===this.angleDistribution){const n=this.calculateSubtreeWeights(t),s=n.reduce((t,e)=>t+e,0);let d=i;t.forEach((t,i)=>{const l=n[i]/s*h,c=d+l/2,u=c*Math.PI/180;a.push({x:o+e*Math.cos(u),y:r+e*Math.sin(u),childStartAngle:d,childEndAngle:d+l}),d+=l})}else{const n=t.length,s=h/n;t.forEach((t,n)=>{const h=i+s*(n+.5),d=h*Math.PI/180;a.push({x:o+e*Math.cos(d),y:r+e*Math.sin(d),childStartAngle:i+s*n,childEndAngle:i+s*(n+1)})})}return a}calculateSubtreeWeights(t){return t.map(t=>t.getData("expand")&&t.children&&0!==t.children.length?this.countSubtreeNodes(t):1)}countSubtreeNodes(t){let e=1;return t.getData("expand")&&t.children&&t.children.length>0&&t.children.forEach(t=>{e+=this.countSubtreeNodes(t)}),e}renderLine(t,e,i,n){"curve"===n?this.renderLineCurve(t,e,i):this.renderLineStraight(t,e,i)}renderLineStraight(t,e,i){if(t.children.length<=0)return[];const{left:n,top:o,width:r,height:s}=t,a=n+r/2,h=o+s/2;t.children.forEach((t,n)=>{const o=t.left+t.width/2,r=t.top+t.height/2,s=this.createFoldLine([[a,h],[o,r]]);this.setLineStyle(i,e[n],s,t)})}renderLineCurve(t,e,i){if(t.children.length<=0)return[];const{left:n,top:o,width:r,height:s}=t,a=n+r/2,h=o+s/2;t.children.forEach((t,n)=>{const o=t.left+t.width/2,r=t.top+t.height/2,s=o-a,d=r-h,l=(Math.sqrt(s*s+d*d),a+.3*s),c=h,u=a+.7*s,f=r,p=`M ${a},${h} C ${l},${c} ${u},${f} ${o},${r}`;this.setLineStyle(i,e[n],p,t)})}renderExpandBtn(t,e,i){if(!t.children||0===t.children.length)return;const{left:n,top:o,width:r,height:s}=t,a=n+r/2,h=o+s/2;let d=0,l=0;if(t.children.forEach(t=>{const e=t.left+t.width/2,i=t.top+t.height/2,n=e-a,o=i-h,r=Math.atan2(o,n);d+=r,l++}),l>0){const i=d/l,n=30,o=a+(r/2+n)*Math.cos(i),c=h+(s/2+n)*Math.sin(i);t._unExpandBtnSize=e,t._expandBtn.translate(o-e/2,c-e/2)}}renderGeneralization(t){}getMarginX(t){return 0}getMarginY(t){return 0}renderExpandBtnRect(t,e,i,n){t.size(e,e).x(i/2-e/2).y(n)}}var D=S;class R{constructor(t){this.renderer=t,this.mindMap=t.mindMap,this.currentNode=null,this.textEditNode=null,this.showTextEdit=!1,this.cacheEditingText="",this.hasBodyMousedown=!1,this.textNodePaddingX=5,this.textNodePaddingY=3,this.isNeedUpdateTextEditNode=!1,this.bindEvent()}bindEvent(){this.show=this.show.bind(this),this.onScale=this.onScale.bind(this),this.onKeydown=this.onKeydown.bind(this),this.mindMap.on("node_dblclick",(t,e,i)=>{this.show({node:t,e:e,isInserting:i})}),this.mindMap.on("draw_click",()=>{this.hideEditTextBox()}),this.mindMap.on("body_mousedown",()=>{this.hasBodyMousedown=!0}),this.mindMap.on("body_click",()=>{this.hasBodyMousedown&&(this.hasBodyMousedown=!1,this.mindMap.opt.isEndNodeTextEditOnClickOuter&&this.hideEditTextBox())}),this.mindMap.on("svg_mousedown",()=>{this.hideEditTextBox()}),this.mindMap.on("expand_btn_click",()=>{this.hideEditTextBox()}),this.mindMap.on("before_node_active",()=>{this.hideEditTextBox()}),this.mindMap.on("mousewheel",()=>{this.mindMap.opt.mousewheelAction===n["a"].MOUSE_WHEEL_ACTION.MOVE&&this.hideEditTextBox()}),this.mindMap.keyCommand.addShortcut("F2",()=>{this.renderer.activeNodeList.length<=0||this.show({node:this.renderer.activeNodeList[0]})}),this.mindMap.on("scale",this.onScale),this.mindMap.opt.enableAutoEnterTextEditWhenKeydown&&window.addEventListener("keydown",this.onKeydown),this.mindMap.on("beforeDestroy",()=>{this.unBindEvent()}),this.mindMap.on("after_update_config",(t,e)=>{t.openRealtimeRenderOnNodeTextEdit!==e.openRealtimeRenderOnNodeTextEdit&&(this.mindMap.richText?this.mindMap.richText.onOpenRealtimeRenderOnNodeTextEditConfigUpdate(t.openRealtimeRenderOnNodeTextEdit):this.onOpenRealtimeRenderOnNodeTextEditConfigUpdate(t.openRealtimeRenderOnNodeTextEdit)),t.enableAutoEnterTextEditWhenKeydown!==e.enableAutoEnterTextEditWhenKeydown&&window[t.enableAutoEnterTextEditWhenKeydown?"addEventListener":"removeEventListener"]("keydown",this.onKeydown)}),this.mindMap.on("afterExecCommand",()=>{this.isShowTextEdit()&&(this.isNeedUpdateTextEditNode=!0)}),this.mindMap.on("node_tree_render_end",()=>{this.isShowTextEdit()&&this.isNeedUpdateTextEditNode&&(this.isNeedUpdateTextEditNode=!1,this.updateTextEditNode())})}unBindEvent(){window.removeEventListener("keydown",this.onKeydown)}onKeydown(t){if(t.target!==document.body)return;const e=this.mindMap.renderer.activeNodeList;if(e.length<=0||e.length>1)return;const i=e[0];i&&this.checkIsAutoEnterTextEditKey(t)&&(t.preventDefault(),this.show({node:i,e:t,isInserting:!1,isFromKeyDown:!0}))}checkIsAutoEnterTextEditKey(t){const e=t.keyCode;return(229===e||e>=65&&e<=90||e>=48&&e<=57)&&!this.mindMap.keyCommand.hasCombinationKey(t)}registerTmpShortcut(){this.mindMap.keyCommand.addShortcut("Enter",()=>{this.hideEditTextBox()}),this.mindMap.keyCommand.addShortcut("Tab",()=>{this.hideEditTextBox()})}isShowTextEdit(){return this.mindMap.richText?this.mindMap.richText.showTextEdit:this.showTextEdit}async show({node:t,isInserting:e=!1,isFromKeyDown:i=!1,isFromScale:o=!1}){if(t.isUseCustomNodeContent())return;const r=this.getCurrentEditNode();r&&this.hideEditTextBox();const{beforeTextEdit:s,openRealtimeRenderOnNodeTextEdit:a}=this.mindMap.opt;if("function"===typeof s){let i=!1;try{i=await s(t,e)}catch(p){i=!1,this.mindMap.opt.errorHandler(n["b"].BEFORE_TEXT_EDIT_ERROR,p)}if(!i)return}const{offsetLeft:d,offsetTop:l}=Object(h["j"])(this.mindMap,t);this.mindMap.view.translateXY(d,l);const c=t._textData.node;a&&c.show();const u=c.node.getBoundingClientRect();a&&c.hide();const f={node:t,rect:u,isInserting:e,isFromKeyDown:i,isFromScale:o};this.mindMap.richText?this.mindMap.richText.showEditText(f):(this.currentNode=t,this.showEditTextBox(f))}onOpenRealtimeRenderOnNodeTextEditConfigUpdate(t){this.textEditNode&&(this.textEditNode.style.background=t?"transparent":this.currentNode?this.getBackground(this.currentNode):"",this.textEditNode.style.boxShadow=t?"none":"0 0 20px rgba(0,0,0,.5)")}onScale(){const t=this.getCurrentEditNode();t&&(this.mindMap.richText?(this.mindMap.richText.cacheEditingText=this.mindMap.richText.getEditText(),this.mindMap.richText.showTextEdit=!1):(this.cacheEditingText=this.getEditText(),this.showTextEdit=!1),this.show({node:t,isFromScale:!0}))}showEditTextBox({node:t,rect:e,isInserting:i,isFromKeyDown:o,isFromScale:r}){if(this.showTextEdit)return;const{nodeTextEditZIndex:s,textAutoWrapWidth:a,selectTextOnEnterEditText:d,openRealtimeRenderOnNodeTextEdit:l,autoEmptyTextWhenKeydownEnterEdit:c}=this.mindMap.opt;if(r||this.mindMap.emit("before_show_text_edit"),this.registerTmpShortcut(),!this.textEditNode){this.textEditNode=document.createElement("div"),this.textEditNode.classList.add(n["a"].EDIT_NODE_CLASS.SMM_NODE_EDIT_WRAP),this.textEditNode.style.cssText=`\n position: fixed;\n box-sizing: border-box;\n ${l?"":"box-shadow: 0 0 20px rgba(0,0,0,.5);"}\n padding: ${this.textNodePaddingY}px ${this.textNodePaddingX}px;\n margin-left: -${this.textNodePaddingX}px;\n margin-top: -${this.textNodePaddingY}px;\n outline: none; \n word-break: break-all;\n line-break: anywhere;\n `,this.textEditNode.setAttribute("contenteditable",!0),this.textEditNode.addEventListener("keyup",t=>{t.stopPropagation()}),this.textEditNode.addEventListener("click",t=>{t.stopPropagation()}),this.textEditNode.addEventListener("mousedown",t=>{t.stopPropagation()}),this.textEditNode.addEventListener("keydown",t=>{this.checkIsAutoEnterTextEditKey(t)&&t.stopPropagation();const e=t.ctrlKey||t.metaKey,i=t.key.toLowerCase(),n=["a","c","v","x","z","y"];if(e&&n.includes(i)&&(t.stopPropagation(),"a"===i)){t.preventDefault();const e=window.getSelection(),i=document.createRange();i.selectNodeContents(this.textEditNode),e.removeAllRanges(),e.addRange(i)}}),this.textEditNode.addEventListener("paste",t=>{const e=t.clipboardData.getData("text"),{isSmm:i,data:n}=Object(h["n"])(e);i&&n[0]&&n[0].data?Object(h["W"])(t,Object(h["R"])(n[0].data.text)):Object(h["W"])(t),this.emitTextChangeEvent()}),this.textEditNode.addEventListener("input",()=>{this.emitTextChangeEvent()});const t=this.mindMap.opt.customInnerElsAppendTo||document.body;t.appendChild(this.textEditNode)}const u=this.mindMap.view.scale,f=t.style.merge("fontSize"),p=(this.cacheEditingText||t.getData("text")).split(/\n/gim).map(t=>Object(h["Y"])(t)),g="true"===t._textData.node.attr("data-ismultiLine");t.style.domText(this.textEditNode,u),l||(this.textEditNode.style.background=this.getBackground(t)),this.textEditNode.style.zIndex=s,this.textEditNode.innerHTML=o&&c?"":p.join("
"),this.textEditNode.style.minWidth=e.width+2*this.textNodePaddingX+"px",this.textEditNode.style.minHeight=e.height+"px",this.textEditNode.style.left=Math.floor(e.left)+"px",this.textEditNode.style.top=Math.floor(e.top)+"px",this.textEditNode.style.display="block",this.textEditNode.style.maxWidth=a*u+"px",g?(this.textEditNode.style.lineHeight=n["h"],this.textEditNode.style.transform=`translateY(${(n["h"]-1)*f/2*u}px)`):this.textEditNode.style.lineHeight="normal",this.showTextEdit=!0,i||d&&!o?Object(h["wb"])(this.textEditNode):Object(h["A"])(this.textEditNode),this.cacheEditingText=""}emitTextChangeEvent(){this.mindMap.emit("node_text_edit_change",{node:this.currentNode,text:this.getEditText(),richText:!1})}updateTextEditNode(){if(this.mindMap.richText)return void this.mindMap.richText.updateTextEditNode();if(!this.showTextEdit||!this.currentNode)return;const t=this.currentNode._textData.node.node.getBoundingClientRect();this.textEditNode.style.minWidth=t.width+2*this.textNodePaddingX+"px",this.textEditNode.style.minHeight=t.height+2*this.textNodePaddingY+"px",this.textEditNode.style.left=Math.floor(t.left)+"px",this.textEditNode.style.top=Math.floor(t.top)+"px"}getBackground(t){const e=t.style.merge("gradientStyle");if(e){const e=t.style.merge("startColor"),i=t.style.merge("endColor");return`linear-gradient(to right, ${e}, ${i})`}{const e=t.style.merge("fillColor"),i=t.style.merge("color");return"transparent"===e?Object(h["gb"])(i)?Object(h["U"])(this.mindMap.themeConfig):"#fff":e}}removeTextEditEl(){if(this.mindMap.richText)return void this.mindMap.richText.removeTextEditEl();if(!this.textEditNode)return;const t=this.mindMap.opt.customInnerElsAppendTo||document.body;t.removeChild(this.textEditNode)}getEditText(){return Object(h["Q"])(this.textEditNode.innerHTML)}hideEditTextBox(){if(this.mindMap.richText)return this.mindMap.richText.hideEditText();if(!this.showTextEdit)return;const t=this.currentNode,e=this.getEditText();this.currentNode=null,this.textEditNode.style.display="none",this.textEditNode.innerHTML="",this.textEditNode.style.fontFamily="inherit",this.textEditNode.style.fontSize="inherit",this.textEditNode.style.fontWeight="normal",this.textEditNode.style.transform="translateY(0)",this.showTextEdit=!1,this.mindMap.execCommand("SET_NODE_TEXT",t,e),this.mindMap.render(),this.mindMap.emit("hide_text_edit",this.textEditNode,this.renderer.activeNodeList,t)}getCurrentEditNode(){return this.mindMap.richText?this.mindMap.richText.node:this.currentNode}}var z=i("5c06"),A=i("4699"),O=i("8a19");const k={[n["a"].LAYOUT.LOGICAL_STRUCTURE]:g,[n["a"].LAYOUT.LOGICAL_STRUCTURE_LEFT]:g,[n["a"].LAYOUT.MIND_MAP]:b,[n["a"].LAYOUT.CATALOG_ORGANIZATION]:y,[n["a"].LAYOUT.ORGANIZATION_STRUCTURE]:C,[n["a"].LAYOUT.TIMELINE]:_,[n["a"].LAYOUT.TIMELINE2]:_,[n["a"].LAYOUT.VERTICAL_TIMELINE]:E,[n["a"].LAYOUT.FISHBONE]:L,[n["a"].LAYOUT.RADIAL]:D};class I{constructor(t={}){this.opt=t,this.mindMap=t.mindMap,this.themeConfig=this.mindMap.themeConfig,this.mindMap.opt.data?Array.isArray(this.mindMap.opt.data)?this.renderTree=this.mindMap.opt.data.map(t=>u()({},t)):this.renderTree=u()({},this.mindMap.opt.data):this.renderTree=null,this.isMultiRoot=this.mindMap.isMultiRoot||!1,this.reRender=!1,this.isRendering=!1,this.hasWaitRendering=!1,this.waitRenderingParams=[],this.nodeCache={},this.lastNodeCache={},this.renderSource="",this.activeNodeList=[],this.root=null,this.textEdit=new R(this),this.beingCopyData=null,this.highlightBoxNode=null,this.highlightBoxNodeStyle=null,this.lastActiveNodeList=[],this.setLayout(),this.bindEvent(),this.registerCommands(),this.registerShortcutKeys()}setLayout(){const{layout:t}=this.mindMap.opt;this.layout=new(k[t]?k[t]:k[n["a"].LAYOUT.LOGICAL_STRUCTURE])(this,t)}setData(t){this.isMultiRoot=this.mindMap.isMultiRoot,this.isMultiRoot?Array.isArray(t)?this.renderTree=t:this.renderTree=t?[t]:[]:Array.isArray(t)&&t.length>0?this.renderTree=t[0]:this.renderTree=t||null}bindEvent(){const{openPerformance:t,performanceConfig:e,openRealtimeRenderOnNodeTextEdit:i}=this.mindMap.opt;this.mindMap.on("draw_click",t=>{this.clearActiveNodeListOnDrawClick(t,"click")}),this.mindMap.on("contextmenu",t=>{this.clearActiveNodeListOnDrawClick(t,"contextmenu")}),this.mindMap.svg.on("dblclick",t=>{this.mindMap.isMultiRoot&&!1!==this.mindMap.opt.enableDblclickCreateRootNode?this.handleCanvasDoubleClick(t):this.mindMap.opt.enableDblclickBackToRootNode&&this.setRootNodeCenter()});const n=Object(h["Bb"])(()=>{this.root&&(this.mindMap.emit("node_tree_render_start"),this.root.render(()=>{this.mindMap.emit("node_tree_render_end")},!1,!0))},e.time);t&&this.mindMap.on("view_data_change",n),this.onNodeTextEditChange=Object(h["w"])(this.onNodeTextEditChange,100,this),i&&this.mindMap.on("node_text_edit_change",this.onNodeTextEditChange),this.mindMap.on("after_update_config",(t,e)=>{t.openPerformance!==e.openPerformance&&(this.mindMap[t.openPerformance?"on":"off"]("view_data_change",n),this.forceLoadNode()),t.openRealtimeRenderOnNodeTextEdit!==e.openRealtimeRenderOnNodeTextEdit&&this.mindMap[t.openRealtimeRenderOnNodeTextEdit?"on":"off"]("node_text_edit_change",this.onNodeTextEditChange)})}handleCanvasDoubleClick(t){const e=t.target;if(e&&(e.classList.contains("smm-node")||e.closest(".smm-node")))return;const{x:i,y:n}=this.mindMap.toPos(t.clientX,t.clientY),{scaleX:o,scaleY:r,translateX:s,translateY:a}=this.mindMap.draw.transform(),h=(i-s)/o,d=(n-a)/r;this.mindMap.addRootNode({data:{text:this.mindMap.opt.defaultCreateRootText||"新根节点",expand:!0},children:[]},-1,t=>{t&&(t.left=h,t.top=d,t.customLeft=h,t.customTop=d,t.nodeData.data.customLeft=h,t.nodeData.data.customTop=d,this.mindMap.execCommand("SET_NODE_ACTIVE",t,!0),this.mindMap.emit("node_created",t),this.mindMap.render())})}onNodeTextEditChange({node:t,text:e}){t._textData=t.createTextNode(e);const{width:i,height:n}=t.getNodeRect();t.width=i,t.height=n,t.layout(),this.mindMap.render(()=>{this.textEdit.updateTextEditNode()})}forceLoadNode(t){t=t||this.root,t&&(this.mindMap.emit("node_tree_render_start"),t.render(()=>{this.mindMap.emit("node_tree_render_end")},!0))}registerCommands(){this.selectAll=this.selectAll.bind(this),this.mindMap.command.add("SELECT_ALL",this.selectAll),this.back=this.back.bind(this),this.mindMap.command.add("BACK",this.back),this.forward=this.forward.bind(this),this.mindMap.command.add("FORWARD",this.forward),this.insertNode=this.insertNode.bind(this),this.mindMap.command.add("INSERT_NODE",this.insertNode),this.insertMultiNode=this.insertMultiNode.bind(this),this.mindMap.command.add("INSERT_MULTI_NODE",this.insertMultiNode),this.insertChildNode=this.insertChildNode.bind(this),this.mindMap.command.add("INSERT_CHILD_NODE",this.insertChildNode),this.insertMultiChildNode=this.insertMultiChildNode.bind(this),this.mindMap.command.add("INSERT_MULTI_CHILD_NODE",this.insertMultiChildNode),this.insertParentNode=this.insertParentNode.bind(this),this.mindMap.command.add("INSERT_PARENT_NODE",this.insertParentNode),this.upNode=this.upNode.bind(this),this.mindMap.command.add("UP_NODE",this.upNode),this.downNode=this.downNode.bind(this),this.mindMap.command.add("DOWN_NODE",this.downNode),this.moveUpOneLevel=this.moveUpOneLevel.bind(this),this.mindMap.command.add("MOVE_UP_ONE_LEVEL",this.moveUpOneLevel),this.insertAfter=this.insertAfter.bind(this),this.mindMap.command.add("INSERT_AFTER",this.insertAfter),this.insertBefore=this.insertBefore.bind(this),this.mindMap.command.add("INSERT_BEFORE",this.insertBefore),this.moveNodeTo=this.moveNodeTo.bind(this),this.mindMap.command.add("MOVE_NODE_TO",this.moveNodeTo),this.removeNode=this.removeNode.bind(this),this.mindMap.command.add("REMOVE_NODE",this.removeNode),this.removeCurrentNode=this.removeCurrentNode.bind(this),this.mindMap.command.add("REMOVE_CURRENT_NODE",this.removeCurrentNode),this.pasteNode=this.pasteNode.bind(this),this.mindMap.command.add("PASTE_NODE",this.pasteNode),this.cutNode=this.cutNode.bind(this),this.mindMap.command.add("CUT_NODE",this.cutNode),this.setNodeStyle=this.setNodeStyle.bind(this),this.mindMap.command.add("SET_NODE_STYLE",this.setNodeStyle),this.setNodeStyles=this.setNodeStyles.bind(this),this.mindMap.command.add("SET_NODE_STYLES",this.setNodeStyles),this.setNodeActive=this.setNodeActive.bind(this),this.mindMap.command.add("SET_NODE_ACTIVE",this.setNodeActive),this.clearActiveNode=this.clearActiveNode.bind(this),this.mindMap.command.add("CLEAR_ACTIVE_NODE",this.clearActiveNode),this.setNodeExpand=this.setNodeExpand.bind(this),this.mindMap.command.add("SET_NODE_EXPAND",this.setNodeExpand),this.expandAllNode=this.expandAllNode.bind(this),this.mindMap.command.add("EXPAND_ALL",this.expandAllNode),this.unexpandAllNode=this.unexpandAllNode.bind(this),this.mindMap.command.add("UNEXPAND_ALL",this.unexpandAllNode),this.expandToLevel=this.expandToLevel.bind(this),this.mindMap.command.add("UNEXPAND_TO_LEVEL",this.expandToLevel),this.setNodeData=this.setNodeData.bind(this),this.mindMap.command.add("SET_NODE_DATA",this.setNodeData),this.setNodeText=this.setNodeText.bind(this),this.mindMap.command.add("SET_NODE_TEXT",this.setNodeText),this.setNodeImage=this.setNodeImage.bind(this),this.mindMap.command.add("SET_NODE_IMAGE",this.setNodeImage),this.setNodeIcon=this.setNodeIcon.bind(this),this.mindMap.command.add("SET_NODE_ICON",this.setNodeIcon),this.setNodeHyperlink=this.setNodeHyperlink.bind(this),this.mindMap.command.add("SET_NODE_HYPERLINK",this.setNodeHyperlink),this.setNodeNote=this.setNodeNote.bind(this),this.mindMap.command.add("SET_NODE_NOTE",this.setNodeNote),this.setNodeAttachment=this.setNodeAttachment.bind(this),this.mindMap.command.add("SET_NODE_ATTACHMENT",this.setNodeAttachment),this.setNodeSiyuanHyperlink=this.setNodeSiyuanHyperlink.bind(this),this.mindMap.command.add("SET_NODE_SIYUAN_HYPERLINK",this.setNodeSiyuanHyperlink),this.setNodeSiyuanPDFHyperlink=this.setNodeSiyuanPDFHyperlink.bind(this),this.mindMap.command.add("SET_NODE_SIYUAN_PDF_HYPERLINK",this.setNodeSiyuanPDFHyperlink),this.setNodeTag=this.setNodeTag.bind(this),this.mindMap.command.add("SET_NODE_TAG",this.setNodeTag),this.insertFormula=this.insertFormula.bind(this),this.mindMap.command.add("INSERT_FORMULA",this.insertFormula),this.addGeneralization=this.addGeneralization.bind(this),this.mindMap.command.add("ADD_GENERALIZATION",this.addGeneralization),this.removeGeneralization=this.removeGeneralization.bind(this),this.mindMap.command.add("REMOVE_GENERALIZATION",this.removeGeneralization),this.setNodeCustomPosition=this.setNodeCustomPosition.bind(this),this.mindMap.command.add("SET_NODE_CUSTOM_POSITION",this.setNodeCustomPosition),this.resetLayout=this.resetLayout.bind(this),this.mindMap.command.add("RESET_LAYOUT",this.resetLayout),this.setNodeShape=this.setNodeShape.bind(this),this.mindMap.command.add("SET_NODE_SHAPE",this.setNodeShape),this.goTargetNode=this.goTargetNode.bind(this),this.mindMap.command.add("GO_TARGET_NODE",this.goTargetNode),this.removeCustomStyles=this.removeCustomStyles.bind(this),this.mindMap.command.add("REMOVE_CUSTOM_STYLES",this.removeCustomStyles),this.removeAllNodeCustomStyles=this.removeAllNodeCustomStyles.bind(this),this.mindMap.command.add("REMOVE_ALL_NODE_CUSTOM_STYLES",this.removeAllNodeCustomStyles)}registerShortcutKeys(){this.mindMap.keyCommand.addShortcut("Tab",()=>{this.mindMap.execCommand("INSERT_CHILD_NODE")}),this.mindMap.keyCommand.addShortcut("Insert",()=>{this.mindMap.execCommand("INSERT_CHILD_NODE")}),this.mindMap.keyCommand.addShortcut("Enter",()=>{this.mindMap.execCommand("INSERT_NODE")}),this.mindMap.keyCommand.addShortcut("Shift+Tab",()=>{this.mindMap.execCommand("INSERT_PARENT_NODE")}),this.mindMap.keyCommand.addShortcut("Control+g",()=>{this.mindMap.execCommand("ADD_GENERALIZATION")}),this.toggleActiveExpand=this.toggleActiveExpand.bind(this),this.mindMap.keyCommand.addShortcut("/",this.toggleActiveExpand),this.mindMap.keyCommand.addShortcut("Del|Backspace",()=>{this.mindMap.execCommand("REMOVE_NODE")}),this.mindMap.keyCommand.addShortcut("Shift+Backspace",()=>{this.mindMap.execCommand("REMOVE_CURRENT_NODE")}),this.mindMap.on("before_show_text_edit",()=>{this.startTextEdit()}),this.mindMap.on("hide_text_edit",()=>{this.endTextEdit()}),this.mindMap.keyCommand.addShortcut("Control+a",()=>{this.mindMap.execCommand("SELECT_ALL")}),this.mindMap.keyCommand.addShortcut("Control+l",()=>{this.mindMap.execCommand("RESET_LAYOUT")}),this.mindMap.keyCommand.addShortcut("Control+Up",()=>{this.mindMap.execCommand("UP_NODE")}),this.mindMap.keyCommand.addShortcut("Control+Down",()=>{this.mindMap.execCommand("DOWN_NODE")}),this.mindMap.keyCommand.addShortcut("Control+c",()=>{this.copy()}),this.mindMap.keyCommand.addShortcut("Control+x",()=>{this.cut()}),this.mindMap.keyCommand.addShortcut("Control+v",()=>{this.paste()}),this.mindMap.keyCommand.addShortcut("Control+Enter",()=>{this.setRootNodeCenter()})}emitNodeActiveEvent(t=null,e=[...this.activeNodeList]){const i=!Object(h["i"])(this.lastActiveNodeList,e);if(!i)return;this.lastActiveNodeList=[...e];const n=t||e[0]||null,o=this.mindMap.getRootIndexByNode?this.mindMap.getRootIndexByNode(n):null;this.mindMap.batchExecution.push("emitNodeActiveEvent",()=>{this.mindMap.emit("node_active",t,e),this.mindMap.emit("active_root_change",o,n,e)})}clearActiveNodeListOnDrawClick(t,e){if(this.activeNodeList.length<=0)return;let i=!0;const{useLeftKeySelectionRightKeyDrag:n}=this.mindMap.opt;if("contextmenu"===e?!n:n){const e=this.mindMap.event.mousedownPos;i=Math.abs(t.clientX-e.x)<=5&&Math.abs(t.clientY-e.y)<=5}i&&this.mindMap.execCommand("CLEAR_ACTIVE_NODE")}startTextEdit(){if(!this.textEditShortcutsBackup){this.textEditShortcutsBackup={};const t=["Enter","Tab","Del","Backspace","Delete","Left","Up","Right","Down","/","Control+a"];t.forEach(t=>{const e=this.mindMap.keyCommand.getShortcutFn(t);e&&e.length>0&&(this.textEditShortcutsBackup[t]=[...e],this.mindMap.keyCommand.removeShortcut(t))})}}endTextEdit(){this.textEditShortcutsBackup&&(Object.entries(this.textEditShortcutsBackup).forEach(([t,e])=>{e.forEach(e=>{this.mindMap.keyCommand.addShortcut(t,e)})}),this.textEditShortcutsBackup=null)}clearCache(){this.layout.lru.clear(),this.nodeCache={},this.lastNodeCache={}}render(t=(()=>{}),e){if(e===n["a"].CHANGE_THEME&&this.resetUnExpandNodeStyle(),this.isRendering)return this.hasWaitRendering=!0,void(this.waitRenderingParams=[t,e]);if(this.isRendering=!0,this.renderSource=e,this.lastNodeCache=this.nodeCache,this.nodeCache={},this.reRender&&this.clearActiveNodeList(),!this.renderTree)return this.isRendering=!1,void this.mindMap.emit("node_tree_render_end");if(this.mindMap.emit("node_tree_render_start"),this.isMultiRoot&&Array.isArray(this.renderTree)){this.roots=[];let e=0;const i=this.renderTree.length;if(0===i)return this.isRendering=!1,void this.mindMap.emit("node_tree_render_end");this.renderTree.forEach((o,r)=>{let s=o.data&&o.data.layout||this.mindMap.opt.layout,a=new(k[s]||k[n["a"].LAYOUT.LOGICAL_STRUCTURE])(this,s);a.doLayout(n=>{this.roots[r]=n,n.rootIndex=r,n._layoutInstance=a,n.render(()=>{if(e++,e===i){if(this.mindMap.emit("root_nodes_change",this.roots),this.isRendering=!1,t&&t(),this.hasWaitRendering){const t=this.waitRenderingParams;this.hasWaitRendering=!1,this.waitRenderingParams=[],this.render(...t)}else this.renderSource="",this.reRender&&(this.reRender=!1);this.mindMap.emit("node_tree_render_end")}})},o,r)}),Object.keys(this.lastNodeCache).forEach(t=>{this.nodeCache[t]||(this.removeNodeFromActiveList(this.lastNodeCache[t]),this.emitNodeActiveEvent(),this.lastNodeCache[t].destroy())})}else this.root=null,this.layout.doLayout(e=>{Object.keys(this.lastNodeCache).forEach(t=>{this.nodeCache[t]||(this.removeNodeFromActiveList(this.lastNodeCache[t]),this.emitNodeActiveEvent(),this.lastNodeCache[t].destroy())}),this.root=e,this.mindMap.emit("root_nodes_change",[this.root]),this.root.render(()=>{if(this.isRendering=!1,t&&t(),this.hasWaitRendering){const t=this.waitRenderingParams;this.hasWaitRendering=!1,this.waitRenderingParams=[],this.render(...t)}else this.renderSource="",this.reRender&&(this.reRender=!1);this.mindMap.emit("node_tree_render_end")})});this.emitNodeActiveEvent()}resetUnExpandNodeStyle(){this.renderTree&&(this.isMultiRoot&&Array.isArray(this.renderTree)?this.renderTree.forEach(t=>{Object(h["Db"])(t,null,t=>{if(!t.data.expand)return Object(h["Db"])(t,null,t=>{t.data["needUpdate"]=!0}),!0})}):Object(h["Db"])(this.renderTree,null,t=>{if(!t.data.expand)return Object(h["Db"])(t,null,t=>{t.data["needUpdate"]=!0}),!0}))}clearActiveNode(){this.activeNodeList.length<=0||(this.clearActiveNodeList(),this.emitNodeActiveEvent(null,[]))}clearActiveNodeList(){this.activeNodeList.forEach(t=>{this.mindMap.execCommand("SET_NODE_ACTIVE",t,!1)}),this.activeNodeList=[]}addNodeToActiveList(t,e=!1){if(this.mindMap.opt.onlyOneEnableActiveNodeOnCooperate&&t.userList.length>0)return;const i=this.findActiveNodeIndex(t);-1===i&&(e||this.mindMap.emit("before_node_active",t,this.activeNodeList),this.mindMap.execCommand("SET_NODE_ACTIVE",t,!0),this.activeNodeList.push(t))}removeNodeFromActiveList(t){let e=this.findActiveNodeIndex(t);-1!==e&&(this.mindMap.execCommand("SET_NODE_ACTIVE",t,!1),this.activeNodeList.splice(e,1))}activeMultiNode(t=[]){t.forEach(t=>{this.mindMap.emit("before_node_active",t,this.activeNodeList),this.addNodeToActiveList(t,!0),this.emitNodeActiveEvent(t)})}cancelActiveMultiNode(t=[]){t.forEach(t=>{this.removeNodeFromActiveList(t),this.emitNodeActiveEvent(null)})}findActiveNodeIndex(t){return Object(h["K"])(t,this.activeNodeList)}selectAll(){this.mindMap.opt.readonly||(this.isMultiRoot&&this.roots?this.roots.forEach(t=>{t&&Object(h["Db"])(t,null,t=>{t.getData("isActive")||this.addNodeToActiveList(t),t._generalizationList&&t._generalizationList.length>0&&t._generalizationList.forEach(t=>{const e=t.generalizationNode;e.getData("isActive")||this.addNodeToActiveList(e)})},null,!0,0,0)}):this.root&&Object(h["Db"])(this.root,null,t=>{t.getData("isActive")||this.addNodeToActiveList(t),t._generalizationList&&t._generalizationList.length>0&&t._generalizationList.forEach(t=>{const e=t.generalizationNode;e.getData("isActive")||this.addNodeToActiveList(e)})},null,!0,0,0),this.emitNodeActiveEvent())}back(t){this.backForward("back",t)}forward(t){this.backForward("forward",t)}backForward(t,e){this.mindMap.execCommand("CLEAR_ACTIVE_NODE");const i=this.mindMap.command[t](e);i&&(this.renderTree=i,this.mindMap.render()),this.mindMap.emit("data_change",i)}getNewNodeBehavior(t=!1,e=!1){const{createNewNodeBehavior:i}=this.mindMap.opt;let o=!1,r=!1;switch(i){case n["a"].CREATE_NEW_NODE_BEHAVIOR.DEFAULT:o=e||!t,r=!e&&t;break;case n["a"].CREATE_NEW_NODE_BEHAVIOR.NOT_ACTIVE:o=!1,r=!1;break;case n["a"].CREATE_NEW_NODE_BEHAVIOR.ACTIVE_ONLY:o=!0,r=!1;break;default:break}return{focusNewNode:o,inserting:r}}insertNode(t=!0,e=[],i=null,n=[]){if(e=Object(h["B"])(e),this.activeNodeList.length<=0&&e.length<=0)return;this.textEdit.hideEditTextBox();const{defaultInsertSecondLevelNodeText:o,defaultInsertBelowSecondLevelNodeText:r}=this.mindMap.opt,s=e.length>0?e:this.activeNodeList,a=s.length>1,d=this.hasRichTextPlugin(),{focusNewNode:l,inserting:c}=this.getNewNodeBehavior(t,a),u={expand:!0,richText:d,isActive:l};d&&(u.resetRichText=!0),n=Object(h["a"])(n,u);const f=i&&i.richText;let p=!1;s.forEach(t=>{if(t.isGeneralization||t.isRoot)return;n=Object(h["yb"])(n);const e=t.parent,s=1===t.layerIndex,a=s?o:r,d=Object(h["J"])(t);f&&u.resetRichText&&delete u.resetRichText;const l={inserting:c,data:{text:a,...u,uid:Object(h["u"])(),...i||{}},children:[...Object(h["v"])(n,p)]};p=!0,e.nodeData.children.splice(d+1,0,l)}),l&&this.clearActiveNodeList(),this.mindMap.render()}insertMultiNode(t,e){if(!e||e.length<=0)return;if(t=Object(h["B"])(t),this.activeNodeList.length<=0&&t.length<=0)return;this.textEdit.hideEditTextBox();const i=t.length>0?t:this.activeNodeList,n=this.hasRichTextPlugin(),{focusNewNode:o}=this.getNewNodeBehavior(!1,!0),r={expand:!0,richText:n,isActive:o};n&&(r.resetRichText=!0),e=Object(h["a"])(e,r);let s=!1;i.forEach(t=>{if(t.isGeneralization||t.isRoot)return;e=Object(h["yb"])(e);const i=t.parent,n=Object(h["J"])(t),o=Object(h["v"])(e,s);s=!0,i.nodeData.children.splice(n+1,0,...o)}),o&&this.clearActiveNodeList(),this.mindMap.render()}insertChildNode(t=!0,e=[],i=null,n=[]){if(e=Object(h["B"])(e),this.activeNodeList.length<=0&&e.length<=0)return;this.textEdit.hideEditTextBox();const{defaultInsertSecondLevelNodeText:o,defaultInsertBelowSecondLevelNodeText:r}=this.mindMap.opt,s=e.length>0?e:this.activeNodeList,a=s.length>1,d=this.hasRichTextPlugin(),{focusNewNode:l,inserting:c}=this.getNewNodeBehavior(t,a),u={expand:!0,richText:d,isActive:l};d&&(u.resetRichText=!0),n=Object(h["a"])(n,u);const f=i&&i.richText;let p=!1;s.forEach(t=>{if(t.isGeneralization)return;n=Object(h["yb"])(n),t.nodeData.children||(t.nodeData.children=[]);const e=t.isRoot?o:r;f&&u.resetRichText&&delete u.resetRichText;const s={inserting:c,data:{text:e,uid:Object(h["u"])(),...u,...i||{}},children:[...Object(h["v"])(n,p)]};p=!0,t.nodeData.children.push(s),t.setData({expand:!0})}),l&&this.clearActiveNodeList(),this.mindMap.render()}insertMultiChildNode(t,e){if(!e||e.length<=0)return;if(t=Object(h["B"])(t),this.activeNodeList.length<=0&&t.length<=0)return;this.textEdit.hideEditTextBox();const i=t.length>0?t:this.activeNodeList,n=this.hasRichTextPlugin(),{focusNewNode:o}=this.getNewNodeBehavior(!1,!0),r={expand:!0,richText:n,isActive:o};n&&(r.resetRichText=!0),e=Object(h["a"])(e,r);let s=!1;i.forEach(t=>{t.isGeneralization||(e=Object(h["yb"])(e),t.nodeData.children||(t.nodeData.children=[]),e=Object(h["v"])(e,s),s=!0,t.nodeData.children.push(...e),t.setData({expand:!0}))}),o&&this.clearActiveNodeList(),this.mindMap.render()}insertParentNode(t=!0,e,i){if(e=Object(h["B"])(e),this.activeNodeList.length<=0&&e.length<=0)return;this.textEdit.hideEditTextBox();const{defaultInsertSecondLevelNodeText:n,defaultInsertBelowSecondLevelNodeText:o}=this.mindMap.opt,r=e.length>0?e:this.activeNodeList,s=r.length>1,a=this.hasRichTextPlugin(),{focusNewNode:d,inserting:l}=this.getNewNodeBehavior(t,s),c={expand:!0,richText:a,isActive:d};a&&(c.resetRichText=!0);const u=i&&i.richText;r.forEach(t=>{if(t.isGeneralization||t.isRoot)return;const e=1===t.layerIndex?n:o;u&&c.resetRichText&&delete c.resetRichText;const r={inserting:l,data:{text:e,uid:Object(h["u"])(),...c,...i||{}},children:[t.nodeData]},s=t.parent,a=Object(h["J"])(t);s.nodeData.children.splice(a,1,r)}),d&&this.clearActiveNodeList(),this.mindMap.render()}upNode(t){if(this.activeNodeList.length<=0&&!t)return;const e=t?[t]:this.activeNodeList,i=e[0];if(i.isRoot)return;let n=i.parent,o=n.children,r=Object(h["K"])(i,o);if(-1===r||0===r)return;let s=r-1;o.splice(r,1),o.splice(s,0,i),n.nodeData.children.splice(r,1),n.nodeData.children.splice(s,0,i.nodeData),this.mindMap.render()}downNode(t){if(this.activeNodeList.length<=0&&!t)return;const e=t?[t]:this.activeNodeList,i=e[0];if(i.isRoot)return;let n=i.parent,o=n.children,r=Object(h["K"])(i,o);if(-1===r||r===o.length-1)return;let s=r+1;o.splice(r,1),o.splice(s,0,i),n.nodeData.children.splice(r,1),n.nodeData.children.splice(s,0,i.nodeData),this.mindMap.render()}moveUpOneLevel(t){if(t=t||this.activeNodeList[0],!t||t.isRoot||t.layerIndex<=1)return;const e=t.parent,i=e.parent,n=Object(h["K"])(t,e.children),o=Object(h["K"])(e,i.children);e.nodeData.children.splice(n,1),i.nodeData.children.splice(o+1,0,t.nodeData),this.mindMap.render()}_handleRemoveCustomStyles(t){let e=!1;return Object.keys(t).forEach(i=>{Object(h["g"])(i)&&(e=!0,delete t[i])}),this.hasRichTextPlugin()&&(e=!0,t.resetRichText=!0),e}removeCustomStyles(t){if(t=t||this.activeNodeList[0],!t)return;const e=this._handleRemoveCustomStyles(t.getData());e&&this.reRenderNodeCheckChange(t)}removeAllNodeCustomStyles(t){t=Object(h["B"])(t);let e=!1;if(t.length>0)t.forEach(t=>{const i=this._handleRemoveCustomStyles(t.getData());i&&(e=!0)});else{if(!this.renderTree)return;Object(h["Db"])(this.renderTree,null,t=>{const i=this._handleRemoveCustomStyles(t.data);i&&(e=!0);const n=Object(h["C"])(t.data);n.length>0&&n.forEach(t=>{const i=this._handleRemoveCustomStyles(t);i&&(e=!0)})})}e&&this.mindMap.reRender()}copy(){this.beingCopyData=this.copyNode(),this.beingCopyData&&(this.mindMap.opt.disabledClipboard||Object(h["xb"])(Object(h["t"])(this.beingCopyData)))}cut(){this.mindMap.execCommand("CUT_NODE",t=>{this.beingCopyData=t,this.mindMap.opt.disabledClipboard||Object(h["xb"])(Object(h["t"])(t))})}handlePaste(t){const{disabledClipboard:e}=this.mindMap.opt;if(e)return;const i=t.clipboardData||t.originalEvent.clipboardData,n=i.items;let o=null,r="";Array.from(n).forEach(t=>{t.type.indexOf("image")>-1&&(o=t.getAsFile()),t.type.indexOf("text")>-1&&(r=i.getData("text"))}),this.paste()}async paste(){const{errorHandler:t,handleIsSplitByWrapOnPasteCreateNewNode:e,handleNodePasteImg:i,disabledClipboard:o,onlyPasteTextWhenHasImgAndText:r}=this.mindMap.opt;if(!o&&Object(h["f"])())try{const o=await Object(h["H"])();let a=o.text||"",d=o.img||null;if(a){let i=null,o=!0,r=null,d=null,l=null,c=null,u=null;if(this.mindMap.opt.customHandleClipboardText)try{const t=await this.mindMap.opt.customHandleClipboardText(a);if(!Object(h["fb"])(t)){o=!1;const e=Object(h["n"])(t);e.isSmm?i=e.data:a=e.data;const n=Object(h["l"])(a);n.isSiyuanLink&&(r=n.siyuanLink,d=n.siyuanLinkTitle);const s=Object(h["m"])(a);s.isSiyuanPdfUrl&&(l=s.siyuanPdfUrl,c=s.siyuanPdfUrlTitle,u=s.siyuanPdfImageUrl)}}catch(s){t(n["b"].CUSTOM_HANDLE_CLIPBOARD_TEXT_ERROR,s)}if(o){const t=Object(h["n"])(a);t.isSmm?i=t.data:a=t.data;const e=Object(h["l"])(a);e.isSiyuanLink&&(r=e.siyuanLink,d=e.siyuanLinkTitle);const n=Object(h["m"])(a);n.isSiyuanPdfUrl&&(l=n.siyuanPdfUrl,c=n.siyuanPdfUrlTitle)}if(i)this.mindMap.execCommand("INSERT_MULTI_CHILD_NODE",[],Array.isArray(i)?i:[i]);else if(r)this.activeNodeList.length>0&&this.activeNodeList.forEach(t=>{this.mindMap.execCommand("SET_NODE_HYPERLINK",t,r,d)});else if(l)this.activeNodeList.length>0&&this.activeNodeList.forEach(t=>{this.mindMap.execCommand("SET_NODE_SIYUAN_PDF_HYPERLINK",t,l,c)});else{this.hasRichTextPlugin()&&(a=Object(h["Y"])(a));const t=a.split(new RegExp("\r?\n|(?!!t);t.length>1&&e?e().then(()=>{this.mindMap.execCommand("INSERT_MULTI_CHILD_NODE",[],t.map(t=>({data:{text:t},children:[]})))}).catch(()=>{this.mindMap.execCommand("INSERT_CHILD_NODE",!1,[],{text:a})}):this.mindMap.execCommand("INSERT_CHILD_NODE",!1,[],{text:a})}}if(d&&(!a||!r))try{let t=null;t=i&&"function"===typeof i?await i(d):await Object(h["hb"])(d),this.activeNodeList.length>0&&this.activeNodeList.forEach(e=>{this.mindMap.execCommand("SET_NODE_IMAGE",e,{url:t.url,title:"",width:t.size.width,height:t.size.height})})}catch(s){t(n["b"].LOAD_CLIPBOARD_IMAGE_ERROR,s)}}catch(s){t(n["b"].READ_CLIPBOARD_ERROR,s)}else this.beingCopyData&&this.mindMap.execCommand("PASTE_NODE",this.beingCopyData)}insertBefore(t,e){this.insertTo(t,e,"before")}insertAfter(t,e){this.insertTo(t,e,"after")}insertTo(t,e,i="before"){let n=Object(h["B"])(t);this.isMultiRoot||(n=n.filter(t=>!t.isRoot)),"after"===i&&n.reverse(),n.forEach(t=>{if(this.isMultiRoot&&t.isRoot)this.removeRootNode(t),delete t.nodeData.data.customLeft,delete t.nodeData.data.customTop;else{let e=t.parent,i=e.children,n=Object(h["K"])(t,i);if(-1===n)return;i.splice(n,1),e.nodeData.children.splice(n,1)}let n=e.parent,o=n.children,r=Object(h["K"])(e,o);-1!==r&&("after"===i&&r++,o.splice(r,0,t),n.nodeData.children.splice(r,0,t.nodeData),this.clearNodeStyleCache(t),this.markNodeAndChildrenNeedUpdate(t))}),this.mindMap.render()}removeNode(t=[]){if(t=Object(h["B"])(t),this.activeNodeList.length<=0&&t.length<=0)return;let e=null,i=t.length>0,n=i?t:this.activeNodeList,o=n.find(t=>t.isRoot);if(o)if(this.isMultiRoot){const t=o.nodeData.children&&o.nodeData.children.length>0;if(t)this.clearActiveNodeList(),o.children=[],o.nodeData.children=[];else{const t=this.roots?this.roots.length:1;if(t<=1)return void this.mindMap.emit("delete_last_root_node_prevented",o);const i=this.roots?this.roots.indexOf(o):-1;-1!==i&&this.roots&&(i0&&(e=this.roots[i-1])),this.clearActiveNodeList(),this.removeRootNode(o)}}else this.clearActiveNodeList(),o.children=[],o.nodeData.children=[];else{e=this.getNextActiveNode(n);for(let t=0;t0,i=e?t:this.activeNodeList;i=i.filter(t=>!t.isRoot);let n=this.getNextActiveNode(i);for(let o=0;o{if(t&&t.range&&Array.isArray(t.range)&&2===t.range.length){const[e,o]=t.range;if(i=e&&i<=o){const i=n-1;t.range=[e,o+i]}}})}}}this.activeNodeList=[],n&&this.addNodeToActiveList(n),this.emitNodeActiveEvent(),this.mindMap.render()}getNextActiveNode(t){if(1!==t.length)return null;if(-1===this.findActiveNodeIndex(t[0]))return null;let e=null;if(1===this.activeNodeList.length&&!this.activeNodeList[0].isGeneralization&&this.mindMap.opt.deleteNodeActive){const t=this.activeNodeList[0],i=t.parent.children,n=Object(h["K"])(t,i);e=n0?i[n-1]:t.parent}return e}copyNode(){if(this.activeNodeList.length<=0)return null;let t=Object(h["S"])(this.activeNodeList);return t=Object(h["zb"])(t),t.map(t=>Object(h["q"])({},t,!0))}cutNode(t){if(this.activeNodeList.length<=0)return;let e=Object(h["S"])(this.activeNodeList).filter(t=>!t.isRoot);e=Object(h["zb"])(e);const i=e.map(t=>Object(h["q"])({},t,!0));e.forEach(t=>{Object(h["qb"])(t)}),this.clearActiveNodeList(),this.mindMap.render(),t&&"function"===typeof t&&t(i)}moveNodeTo(t,e){let i=Object(h["B"])(t);this.isMultiRoot||(i=i.filter(t=>!t.isRoot)),i.forEach(t=>{this.removeNodeFromActiveList(t),this.isMultiRoot&&t.isRoot?(this.removeRootNode(t),delete t.nodeData.data.customLeft,delete t.nodeData.data.customTop):Object(h["qb"])(t),e.setData({expand:!0}),e.nodeData.children.push(t.nodeData),this.clearNodeStyleCache(t),this.markNodeAndChildrenNeedUpdate(t)}),this.emitNodeActiveEvent(),this.mindMap.render()}clearNodeStyleCache(t){t&&(t.effectiveStyles&&(t.effectiveStyles={}),t.style&&(t.style._gradient=null,t.style._marker=null,t.style.effectiveStyles&&(t.style.effectiveStyles={})),t.children&&t.children.length>0&&t.children.forEach(t=>{this.clearNodeStyleCache(t)}))}markNodeAndChildrenNeedUpdate(t){t&&(t.nodeData.data.needUpdate=!0,t.children&&t.children.length>0&&t.children.forEach(t=>{this.markNodeAndChildrenNeedUpdate(t)}))}removeRootNode(t){if(!this.isMultiRoot||!this.roots||!Array.isArray(this.renderTree))return;const e=this.roots.indexOf(t);-1!==e&&this.roots.splice(e,1);const i=this.renderTree.findIndex(e=>e===t.nodeData);-1!==i&&this.renderTree.splice(i,1)}pasteNode(t){t=Object(h["B"])(t),this.mindMap.execCommand("INSERT_MULTI_CHILD_NODE",[],t)}setNodeStyle(t,e,i){const n={[e]:i};this.setNodeDataRender(t,n),A["c"].includes(e)&&(t.parent||t).renderLine(!0)}setNodeStyles(t,e){const i={...e};this.setNodeDataRender(t,i);let n=Object.keys(e),o=!1;n.forEach(t=>{A["c"].includes(t)&&(o=!0)}),o&&(t.parent||t).renderLine(!0)}setNodeActive(t,e){this.mindMap.execCommand("SET_NODE_DATA",t,{isActive:e}),t.updateNodeByActive(e)}setNodeExpand(t,e){this.mindMap.execCommand("SET_NODE_DATA",t,{expand:e}),this.mindMap.render()}expandAllNode(t=""){if(!this.renderTree)return;const e=(i,n)=>{n||i.data.uid!==t||(n=!0),n&&!i.data.expand&&(i.data.expand=!0),i.children&&i.children.length>0&&i.children.forEach(t=>{e(t,n)})};e(this.renderTree,!t),this.mindMap.render()}unexpandAllNode(t=!0,e=""){if(!this.renderTree)return;const i=(t,n,o)=>{o||t.data.uid!==e||(o=!0),o&&(!n||this.mindMap.opt.allowRootNodeCollapse)&&t.children&&t.children.length>0&&(t.data.expand=!1),t.children&&t.children.length>0&&t.children.forEach(t=>{i(t,!1,o)})};i(this.renderTree,!0,!e),this.mindMap.render(()=>{t&&this.setRootNodeCenter()})}expandToLevel(t){this.renderTree&&(Object(h["Db"])(this.renderTree,null,(e,i,n,o)=>{const r=o0&&(e.data.expand=!1)},null,!0,0,0),this.mindMap.render())}toggleActiveExpand(){this.activeNodeList.forEach(t=>{t.nodeData.children.length<=0||t.isRoot&&!this.mindMap.opt.allowRootNodeCollapse||this.toggleNodeExpand(t)})}toggleNodeExpand(t){this.mindMap.execCommand("SET_NODE_EXPAND",t,!t.getData("expand"))}setNodeText(t,e,i,n){i=void 0===i?t.getData("richText"):i,this.setNodeDataRender(t,{text:e,richText:i,resetRichText:n})}setNodeImage(t,e){const{url:i,title:n,width:o,height:r,custom:s=!1}=e||{url:"",title:"",width:0,height:0,custom:!1};this.setNodeDataRender(t,{image:i,imageTitle:n||"",imageSize:{width:o,height:r,custom:s}})}setNodeIcon(t,e){this.setNodeDataRender(t,{icon:e})}setNodeHyperlink(t,e,i=""){this.setNodeDataRender(t,{hyperlink:e,hyperlinkTitle:i})}setNodeNote(t,e){this.setNodeDataRender(t,{note:e})}setNodeAttachment(t,e,i=""){this.setNodeDataRender(t,{attachmentUrl:e,attachmentName:i})}setNodeSiyuanHyperlink(t,e,i=""){this.setNodeDataRender(t,{siyuanHyperlink:e,siyuanHyperlinkTitle:i})}setNodeSiyuanPDFHyperlink(t,e,i=""){this.setNodeDataRender(t,{siyuanPDFLinkData:e?{siyuanPDFHyperlink:e,siyuanPDFHyperlinkTitle:i}:null})}setNodeTag(t,e){this.setNodeDataRender(t,{tag:e})}insertFormula(t,e=[]){if(!this.hasRichTextPlugin()||!this.mindMap.formula)return;e=Object(h["B"])(e);const i=e.length>0?e:this.activeNodeList;i.forEach(e=>{this.mindMap.formula.insertFormulaToNode(e,t)})}addGeneralization(t,e=!0){if(this.activeNodeList.length<=0)return;const i=this.activeNodeList.filter(t=>!t.isRoot&&!t.isGeneralization&&!t.checkHasSelfGeneralization()),n=Object(h["nb"])(i);if(n.length<=0)return;const o=this.hasRichTextPlugin(),{focusNewNode:r,inserting:s}=this.getNewNodeBehavior(e,n.length>1);let a=!1;const d=t&&t.richText;n.forEach(e=>{const i={inserting:s,...t||{text:this.mindMap.opt.defaultGeneralizationText},range:e.range||null,uid:Object(h["u"])(),richText:o,isActive:r};o&&!d&&(i.resetRichText=o);let n=e.node.getData("generalization");if(n=n?Array.isArray(n)?n:[n]:[],e.range){const t=!!n.find(t=>t.range&&t.range[0]===e.range[0]&&t.range[1]===e.range[1]);if(t)return;n.push(i)}else n.push(i);a=!0,this.mindMap.execCommand("SET_NODE_DATA",e.node,{generalization:n}),e.node.setData({expand:!0})}),a&&(r&&this.clearActiveNodeList(),this.mindMap.render(()=>{this.mindMap.render()}))}removeGeneralization(){this.activeNodeList.length<=0||(this.activeNodeList.forEach(t=>{t.checkHasGeneralization()&&this.mindMap.execCommand("SET_NODE_DATA",t,{generalization:null})}),this.mindMap.render(),this.closeHighlightNode())}setNodeCustomPosition(t,e,i){let n=[t]||!1;n.forEach(t=>{this.mindMap.execCommand("SET_NODE_DATA",t,{customLeft:e,customTop:i})})}resetLayout(){Object(h["Db"])(this.root,null,t=>{t.customLeft=void 0,t.customTop=void 0,this.mindMap.execCommand("SET_NODE_DATA",t,{customLeft:void 0,customTop:void 0}),this.mindMap.render()},null,!0,0,0)}setNodeShape(t,e){if(!e||!z["b"].includes(e))return;let i=[t]||!1;i.forEach(t=>{this.setNodeStyle(t,"shape",e)})}goTargetNode(t,e=(()=>{})){let i="string"===typeof t?t:t.getData("uid");i&&this.expandToNodeUid(i,()=>{let t=this.findNodeByUid(i);t&&(t.active(),this.moveNodeToCenter(t),e(t))})}setNodeData(t,e){Object.keys(e).forEach(i=>{t.nodeData.data[i]=e[i]})}setNodeDataRender(t,e,i=!1){if(this.mindMap.execCommand("SET_NODE_DATA",t,e),Object(h["cb"])(e))return console.log("不需要重新渲染"),void this.mindMap.emit("node_tree_render_end");this.reRenderNodeCheckChange(t,i)}reRenderNodeCheckChange(t,e){let i=t.reRender();i?e||this.mindMap.render():this.mindMap.emit("node_tree_render_end")}moveNodeToCenter(t,e){let{resetScaleOnMoveNodeToCenter:i}=this.mindMap.opt;void 0!==e&&(i=e);let{transform:n,state:o}=this.mindMap.view.getTransformData(),{left:r,top:s,width:a,height:h}=t;i||(r*=n.scaleX,s*=n.scaleY,a*=n.scaleX,h*=n.scaleY);let d=this.mindMap.width/2,l=this.mindMap.height/2,c=r+a/2,u=s+h/2,f=d-o.x,p=l-o.y,g=f-c,m=p-u;this.mindMap.view.translateX(g),this.mindMap.view.translateY(m),i&&this.mindMap.view.setScale(1)}setRootNodeCenter(){this.isMultiRoot&&this.roots&&this.roots.length>0?this.moveNodeToCenter(this.roots[0]):this.root&&this.moveNodeToCenter(this.root)}expandToNodeUid(t,e=(()=>{})){if(!this.renderTree)return void e();let i=[],n=!1;const o={},r=this.isMultiRoot?Array.isArray(this.renderTree)?this.renderTree:[]:this.renderTree?[this.renderTree]:[];r.some(e=>{if(!e)return!1;let r=!1;return Object(h["d"])(e,(e,s)=>{if(!e||!e.data)return;if(o[e.data.uid]=s?[...o[s.data.uid]||[],s]:[],e.data.uid===t)return i=o[e.data.uid]||[],r=!0,"stop";const a=Object(h["C"])(e.data);return a.forEach(a=>{a.uid===t&&(i=s?[...o[s.data.uid]||[],s,e]:[e],n=!0,r=!0)}),r?"stop":void 0}),r});let s=!1;if(i.forEach(t=>{t.data.expand||(s=!0,t.data.expand=!0)}),n){const t=i[i.length-1];t&&Object(h["Db"])(t,null,t=>{t&&t.data&&(t.data.expand||(s=!0,t.data.expand=!0))})}s?this.mindMap.render(e):e()}findNodeByUid(t){const e=this.isMultiRoot?this.roots||[]:this.root?[this.root]:[];if(!e.length)return;let i=null;return e.some(e=>!!e&&Object(h["Db"])(e,null,e=>{if(e.getData("uid")===t)return i=e,!0;let n=!1;return(e._generalizationList||[]).forEach(e=>{e.generalizationNode.getData("uid")===t&&(i=e.generalizationNode,n=!0)}),!!n||void 0})),i}highlightNode(t,e,i){if(this.isRendering)return;i={stroke:"rgb(94, 200, 248)",fill:"transparent",...i||{}},this.highlightBoxNode?this.highlightBoxNodeStyle&&(this.highlightBoxNodeStyle.stroke===i.stroke&&this.highlightBoxNodeStyle.fill===i.fill||this.highlightBoxNode.stroke({color:i.stroke||"transparent"}).fill({color:i.fill||"transparent"})):this.highlightBoxNode=(new O["g"]).stroke({color:i.stroke||"transparent"}).fill({color:i.fill||"transparent"}),this.highlightBoxNodeStyle={...i};let n=1/0,o=1/0,r=-1/0,s=-1/0;if(e){const i=t.children.slice(e[0],e[1]+1);i.forEach(t=>{t.leftr&&(r=e),i>s&&(s=i)})}else n=t.left,o=t.top,r=t.left+t.width,s=t.top+t.height;this.highlightBoxNode.plot([[n,o],[r,o],[r,s],[n,s]]),this.mindMap.otherDraw.add(this.highlightBoxNode)}closeHighlightNode(){this.highlightBoxNode&&this.highlightBoxNode.remove()}hasRichTextPlugin(){return!!this.mindMap.richText}}var B=I,F={default:A["b"]},P=i("053c"),W=(i("88e6"),i("70cc"),i("eb03"),i("22e5"),i("c01e"),i("fa76"),i("8306"),i("eb04"));class H{constructor(t){this.opt=t,this.mindMap=t.mindMap,this.shortcutMap={},this.shortcutMapCache={},this.isPause=!1,this.isInSvg=!1,this.instanceId=this.mindMap.uid||Date.now(),this.shouldRespond=!1,this.editModeShortcuts=new Set(["Control+a","Control+c","Control+v","Control+x","Control+z","Control+y"]),this.bindEvent()}markAsActive(){H.ACTIVE_INSTANCE_ID=this.instanceId}isContainerVisible(){try{const t=this.mindMap.el;if(!t)return!1;if(t.getClientRects&&0===t.getClientRects().length)return!1;const e=t.getBoundingClientRect();if(!e||e.width<=0||e.height<=0)return!1;const i=window.getComputedStyle?window.getComputedStyle(t):null;return!i||"hidden"!==i.visibility&&"none"!==i.display}catch(t){return!0}}extendKeyMap(t,e){W["a"][t]=e}removeKeyMap(t){"undefined"!==typeof W["a"][t]&&delete W["a"][t]}pause(){this.isPause=!0}recovery(){this.isPause=!1}save(){Object.keys(this.shortcutMapCache).length>0||(this.shortcutMapCache=this.shortcutMap,this.shortcutMap={})}restore(){Object.keys(this.shortcutMapCache).length<=0||(this.shortcutMap=this.shortcutMapCache,this.shortcutMapCache={})}bindEvent(){this.onKeydown=this.onKeydown.bind(this),this.onKeydownCaptureGlobal=this.onKeydownCaptureGlobal.bind(this),this.mindMap.on("svg_mouseenter",()=>{this.isInSvg=!0,this.shouldRespond=!0,this.markAsActive()}),this.mindMap.on("svg_mouseleave",()=>{this.mindMap.renderer.textEdit.isShowTextEdit()||this.mindMap.associativeLine&&this.mindMap.associativeLine.showTextEdit||(this.isInSvg=!1,this.shouldRespond=!1)}),this.mindMap.el.addEventListener("click",()=>{this.shouldRespond=!0,this.markAsActive()}),this.mindMap.el.addEventListener("blur",t=>{this.mindMap.el.contains(t.relatedTarget)||(this.shouldRespond=!1)},!0),document.addEventListener("keydown",this.onKeydownCaptureGlobal,!0),window.addEventListener("keydown",this.onKeydown),this.mindMap.on("beforeDestroy",()=>{this.unBindEvent(),H.ACTIVE_INSTANCE_ID===this.instanceId&&(H.ACTIVE_INSTANCE_ID=null)})}unBindEvent(){document.removeEventListener("keydown",this.onKeydownCaptureGlobal,!0),window.removeEventListener("keydown",this.onKeydown)}defaultEnableCheck(t){const e=t.target;return e===document.body||e.classList.contains(n["a"].EDIT_NODE_CLASS.SMM_NODE_EDIT_WRAP)||e.classList.contains(n["a"].EDIT_NODE_CLASS.RICH_TEXT_EDIT_WRAP)||e.classList.contains(n["a"].EDIT_NODE_CLASS.ASSOCIATIVE_LINE_TEXT_EDIT_WRAP)}onKeydownCaptureGlobal(t){if(!this.isContainerVisible())return void(this.shouldRespond=!1);if(H.ACTIVE_INSTANCE_ID&&H.ACTIVE_INSTANCE_ID!==this.instanceId)return;const e=t.target,i=document.activeElement,n=this.mindMap.el.contains(e),o=this.mindMap.el.contains(i),r=e===document.body,s=n||o||r&&this.shouldRespond;if(!s)return;const{enableShortcutOnlyWhenMouseInSvg:a,customCheckEnableShortcut:h}=this.mindMap.opt,d="function"===typeof h?h:this.defaultEnableCheck;if(!d(t))return;if(!this.shouldRespond&&a)return;if(this.isPause||a&&!this.isInSvg)return;let l=!1,c="";if(Object.keys(this.shortcutMap).forEach(e=>{this.checkKey(t,e)&&(l=!0,c=e)}),l){this.checkKey(t,"Control+v")||t.preventDefault(),t.stopImmediatePropagation();const{beforeShortcutRun:e}=this.mindMap.opt;if("function"===typeof e){const t=e(c,[...this.mindMap.renderer.activeNodeList]);if(t)return}this.shortcutMap[c].forEach(t=>{t()})}}onKeydown(t){const{enableShortcutOnlyWhenMouseInSvg:e,beforeShortcutRun:i,customCheckEnableShortcut:n}=this.mindMap.opt;if(!this.isContainerVisible())return void(this.shouldRespond=!1);if(H.ACTIVE_INSTANCE_ID&&H.ACTIVE_INSTANCE_ID!==this.instanceId)return;const o="function"===typeof n?n:this.defaultEnableCheck;o(t)&&(!this.shouldRespond&&e||this.isPause||e&&!this.isInSvg||Object.keys(this.shortcutMap).forEach(e=>{if(this.checkKey(t,e)){if(this.checkKey(t,"Control+v")||(t.stopPropagation(),t.preventDefault()),"function"===typeof i){const t=i(e,[...this.mindMap.renderer.activeNodeList]);if(t)return}this.shortcutMap[e].forEach(t=>{t()})}}))}checkKey(t,e){let i=this.getOriginEventCodeArr(t),n=this.getKeyCodeArr(e);if(i.length!==n.length)return!1;for(let o=0;ot===i[o]);if(-1===t)return!1;n.splice(t,1)}return!0}getOriginEventCodeArr(t){let e=[];return(t.ctrlKey||t.metaKey)&&e.push(W["a"]["Control"]),t.altKey&&e.push(W["a"]["Alt"]),t.shiftKey&&e.push(W["a"]["Shift"]),e.includes(t.keyCode)||e.push(t.keyCode),e}hasCombinationKey(t){return t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}getKeyCodeArr(t){let e=t.split(/\s*\+\s*/),i=[];return e.forEach(t=>{i.push(W["a"][t])}),i}addShortcut(t,e){t.split(/\s*\|\s*/).forEach(t=>{this.shortcutMap[t]?this.shortcutMap[t].push(e):this.shortcutMap[t]=[e]})}removeShortcut(t,e){t.split(/\s*\|\s*/).forEach(t=>{if(this.shortcutMap[t])if(e){let i=this.shortcutMap[t].findIndex(t=>t===e);-1!==i&&this.shortcutMap[t].splice(i,1)}else this.shortcutMap[t]=[],delete this.shortcutMap[t]})}getShortcutFn(t){let e=[];return t.split(/\s*\|\s*/).forEach(t=>{e=this.shortcutMap[t]||[]}),e}configureEditModeShortcuts(t){this.editModeShortcuts=new Set(t)}isEditModeShortcut(t){return this.editModeShortcuts.has(t)}}H.ACTIVE_INSTANCE_ID=null;var j=i("a06c");class G{constructor(t={}){this.opt=t,this.mindMap=t.mindMap,this.commands={},this.history=[],this.activeHistoryIndex=0,this.registerShortcutKeys(),this.originAddHistory=this.addHistory.bind(this),this.addHistory=Object(h["Bb"])(this.addHistory,this.mindMap.opt.addHistoryTime,this),this.isPause=!1}pause(){this.isPause=!0}recovery(){this.isPause=!1}clearHistory(){this.history=[],this.activeHistoryIndex=0,this.mindMap.emit("back_forward",0,0)}registerShortcutKeys(){this.mindMap.keyCommand.addShortcut("Control+z",()=>{this.mindMap.execCommand("BACK")}),this.mindMap.keyCommand.addShortcut("Control+y",()=>{this.mindMap.execCommand("FORWARD")})}exec(t,...e){if(this.commands[t]){if(this.commands[t].forEach(t=>{t(...e)}),this.mindMap.emit("afterExecCommand",t,...e),["BACK","FORWARD","SET_NODE_ACTIVE","CLEAR_ACTIVE_NODE"].includes(t))return;this.addHistory()}}add(t,e){this.commands[t]?this.commands[t].push(e):this.commands[t]=[e]}remove(t,e){if(this.commands[t])if(e){let i=this.commands[t].find(t=>t===e);-1!==i&&this.commands[t].splice(i,1)}else this.commands[t]=[],delete this.commands[t]}addHistory(){if(this.mindMap.opt.readonly||this.isPause)return;const t=this.history.length>0?this.history[this.activeHistoryIndex]:null,e=this.getCopyData();t!==e&&(t&&JSON.stringify(t)===JSON.stringify(e)||(this.emitDataUpdatesEvent(t,e),this.history=this.history.slice(0,this.activeHistoryIndex+1),this.history.push(Object(h["yb"])(e)),this.history.length>this.mindMap.opt.maxHistoryCount&&this.history.shift(),this.activeHistoryIndex=this.history.length-1,this.mindMap.emit("data_change",e),this.mindMap.emit("back_forward",this.activeHistoryIndex,this.history.length)))}back(t=1){if(!this.mindMap.opt.readonly&&this.activeHistoryIndex-t>=0){const e=this.history[this.activeHistoryIndex];this.activeHistoryIndex-=t,this.mindMap.emit("back_forward",this.activeHistoryIndex,this.history.length);const i=Object(h["yb"])(this.history[this.activeHistoryIndex]);return this.emitDataUpdatesEvent(e,i),i}}forward(t=1){if(this.mindMap.opt.readonly)return;let e=this.history.length;if(this.activeHistoryIndex+t<=e-1){const e=this.history[this.activeHistoryIndex];this.activeHistoryIndex+=t,this.mindMap.emit("back_forward",this.activeHistoryIndex,this.history.length);const i=Object(h["yb"])(this.history[this.activeHistoryIndex]);return this.emitDataUpdatesEvent(e,i),i}}getCopyData(){if(!this.mindMap.renderer.renderTree)return null;if(this.mindMap.isMultiRoot&&Array.isArray(this.mindMap.renderer.renderTree)){const t=this.mindMap.renderer.renderTree.map(t=>Object(h["r"])({},t,!0));return t}{const t=Object(h["r"])({},this.mindMap.renderer.renderTree,!0);return t.smmVersion=j.version,t}}removeDataUid(t){t=Object(h["yb"])(t);let e=t=>{delete t.data.uid,t.children&&t.children.length>0&&t.children.forEach(t=>{e(t)})};return e(t),t}emitDataUpdatesEvent(t,e){try{const i="data_change_detail",n=this.mindMap.event.listenerCount(i);if(n>0&&t&&e){const n=Object(h["yb"])(Object(h["Cb"])(t)),o=Object(h["yb"])(Object(h["Cb"])(e)),r=[],s=(t,e)=>(t.children&&t.children.length>0&&t.children.forEach((i,n)=>{t.children[n]="string"===typeof i?e[i]:e[i.data.uid],s(t.children[n],e)}),t);Object.keys(o).forEach(t=>{n[t]?Object(h["db"])(n[t],o[t])||r.push({action:"update",oldData:s(n[t],n),data:s(o[t],o)}):r.push({action:"create",data:s(o[t],o)})}),Object.keys(n).forEach(t=>{o[t]||r.push({action:"delete",data:s(n[t],n)})}),r.length>0&&this.mindMap.emit(i,r)}}catch(i){this.mindMap.opt.errorHandler(n["b"].DATA_CHANGE_DETAIL_EVENT_ERROR,i)}}}var $=G;class U{constructor(){this.has={},this.queue=[],this.nextTick=Object(h["kb"])(this.flush,this)}push(t,e){this.has[t]?this.replaceTask(t,e):(this.has[t]=!0,this.queue.push({name:t,fn:e}),this.nextTick())}replaceTask(t,e){const i=this.queue.findIndex(e=>e.name===t);-1!==i&&(this.queue[i]={name:t,fn:e})}flush(){let t=this.queue.slice(0);this.queue=[],t.forEach(({name:t,fn:e})=>{this.has[t]=!1,e()})}}var Y=U;const X={el:null,data:null,viewData:null,readonly:!1,layout:n["a"].LAYOUT.LOGICAL_STRUCTURE,fishboneDeg:45,theme:"default",themeConfig:{},scaleRatio:.2,translateRatio:1,minZoomRatio:20,maxZoomRatio:400,customCheckIsTouchPad:null,mouseScaleCenterUseMousePosition:!0,maxTag:5,expandBtnSize:20,imgTextMargin:5,textContentMargin:2,customNoteContentShow:null,textAutoWrapWidth:500,customHandleMousewheel:null,mousewheelAction:n["a"].MOUSE_WHEEL_ACTION.MOVE,mousewheelMoveStep:100,mousewheelZoomActionReverse:!0,defaultInsertSecondLevelNodeText:"二级节点",defaultInsertBelowSecondLevelNodeText:"分支主题",defaultCreateRootText:"新根节点",dragCreateRootHintText:"松手即可创建新根节点",expandBtnStyle:{color:"#808080",fill:"#fff",fontSize:13,strokeColor:"#333333"},expandBtnIcon:{open:"",close:""},expandBtnNumHandler:null,isShowExpandNum:!0,enableShortcutOnlyWhenMouseInSvg:!0,customCheckEnableShortcut:null,initRootNodePosition:null,nodeTextEditZIndex:3e3,nodeNoteTooltipZIndex:3e3,isEndNodeTextEditOnClickOuter:!0,maxHistoryCount:500,containerSizeRetryConfig:{enable:!0,maxRetries:10,retryDelay:100,exponentialBackoff:!0,onRetry:null,fallbackToAsync:!0},alwaysShowExpandBtn:!1,notShowExpandBtn:!1,iconList:[],maxNodeCacheCount:1e3,fitPadding:50,enableCtrlKeyNodeSelection:!0,useLeftKeySelectionRightKeyDrag:!1,beforeTextEdit:null,isUseCustomNodeContent:!1,customCreateNodeContent:null,customCheckIsFromCustomNodeContent:null,customInnerElsAppendTo:null,enableAutoEnterTextEditWhenKeydown:!1,autoEmptyTextWhenKeydownEnterEdit:!1,customHandleClipboardText:null,disableMouseWheelZoom:!1,errorHandler:(t,e)=>{console.error(t,e)},enableDblclickBackToRootNode:!1,enableDblclickCreateRootNode:!0,dragToEmptySpaceCreateRootTime:2e3,hoverRectColor:"rgb(94, 200, 248)",hoverRectPadding:2,selectTextOnEnterEditText:!1,deleteNodeActive:!0,fit:!1,allowRootNodeCollapse:!0,tagsColorMap:{},cooperateStyle:{avatarSize:22,fontSize:12},onlyOneEnableActiveNodeOnCooperate:!1,defaultGeneralizationText:"概要",handleIsSplitByWrapOnPasteCreateNewNode:null,addHistoryTime:100,isDisableDrag:!1,createNewNodeBehavior:n["a"].CREATE_NEW_NODE_BEHAVIOR.DEFAULT,defaultNodeImage:"",isLimitMindMapInCanvas:!1,handleNodePasteImg:null,customCreateNodePath:null,customCreateNodePolygon:null,customTransformNodeLinePath:null,beforeShortcutRun:null,resetScaleOnMoveNodeToCenter:!1,createNodePrefixContent:null,createNodePostfixContent:null,disabledClipboard:!1,customHyperlinkJump:null,customSiyuanHyperlinkJump:null,customSiyuanPDFHyperlinkJump:null,openPerformance:!1,performanceConfig:{time:250,padding:100,removeNodeWhenOutCanvas:!0},emptyTextMeasureHeightText:"abc123我和你",openRealtimeRenderOnNodeTextEdit:!1,mousedownEventPreventDefault:!1,onlyPasteTextWhenHasImgAndText:!0,enableDragModifyNodeWidth:!0,minNodeTextModifyWidth:20,maxNodeTextModifyWidth:-1,customHandleLine:null,addHistoryOnInit:!0,noteIcon:{icon:"",style:{}},hyperlinkIcon:{icon:"",style:{}},attachmentIcon:{icon:"",style:{}},isShowCreateChildBtnIcon:!0,quickCreateChildBtnIcon:{icon:"",style:{}},customQuickCreateChildBtnClick:null,addCustomContentToNode:null,enableInheritAncestorLineStyle:!0,selectTranslateStep:3,selectTranslateLimit:20,enableFreeDrag:!1,dragPreviewMode:"node",dragPreviewSubtreeMaxNodeCount:120,autoMoveWhenMouseInEdgeOnDrag:!0,dragMultiNodeRectConfig:{width:40,height:20,fill:"rgb(94, 200, 248)"},dragPlaceholderRectFill:"rgb(94, 200, 248)",dragPlaceholderLineConfig:{color:"rgb(94, 200, 248)",width:2},dragOpacityConfig:{cloneNodeOpacity:.5,beingDragNodeOpacity:.3},handleDragCloneNode:null,beforeDragEnd:null,beforeDragStart:null,dragCreateRootTipConfig:{borderColor:"#667eea",borderWidth:2,borderDasharray:"8 4",borderAnimationDuration:.6,textColor:"#667eea",textSize:12,padding:8,borderRadius:8},watermarkConfig:{onlyExport:!1,text:"",lineSpacing:100,textSpacing:100,angle:30,textStyle:{color:"#999",opacity:.5,fontSize:14},belowNode:!1},exportPaddingX:10,exportPaddingY:10,resetCss:"\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n ",minExportImgCanvasScale:2,addContentToHeader:null,addContentToFooter:null,handleBeingExportSvg:null,maxCanvasSize:16384,defaultAssociativeLineText:"关联",associativeLineIsAlwaysAboveNode:!0,associativeLineDragMode:"hideAll",associativeLineInitPointsPosition:{from:"",to:""},enableAdjustAssociativeLinePoints:!0,beforeAssociativeLineConnection:null,disableTouchZoom:!1,minTouchZoomScale:20,maxTouchZoomScale:-1,isLimitMindMapInCanvasWhenHasScrollbar:!0,isOnlySearchCurrentRenderNodes:!1,beforeCooperateUpdate:null,rainbowLinesConfig:{open:!1,colorsList:[]},demonstrateConfig:null,enableEditFormulaInRichTextEdit:!0,katexFontPath:"https://unpkg.com/katex@0.16.11/dist/",getKatexOutputType:null,transformRichTextOnEnterEdit:null,beforeHideRichTextEdit:null,outerFramePaddingX:10,outerFramePaddingY:10,outerFrameDragPreviewMode:"frame",outerFrameDragPreviewSubtreeMaxNodeCount:120,onlyPainterNodeCustomStyles:!1,beforeDeleteNodeImg:null,imgResizeBtnSize:25,minImgResizeWidth:50,minImgResizeHeight:50,maxImgResizeWidthInheritTheme:!1,maxImgResizeWidth:1/0,maxImgResizeHeight:1/0,customDeleteBtnInnerHTML:"",customResizeBtnInnerHTML:"",radialLayoutConfig:{startRadius:120,radiusIncrement:150,minNodeSpacing:20,radiusGrowthStrategy:"auto",exponentialGrowthFactor:1.5,autoAdjustRadius:!0,angleDistribution:"uniform",startAngle:0,endAngle:360,customRadiusCalculator:null},editModeShortcuts:["Control+a","Control+c","Control+v","Control+x","Control+z","Control+y"]};class V{constructor(t={}){if(V.instanceCount++,this.opt=this.handleOpt(u()(X,t)),this.opt.data=this.handleData(this.opt.data),this.el=this.opt.el,!this.el)throw new Error("缺少容器元素el");this._initialized=!1,this._destroyed=!1,this._initializeContainer(),this.cssEl=null,this.cssTextMap={},this.nodeInnerPrefixList=[],this.initContainer(),this.initTheme(),this.initCache(),this.event=new l({mindMap:this}),this.keyCommand=new H({mindMap:this}),this.opt.editModeShortcuts&&this.keyCommand.configureEditModeShortcuts(this.opt.editModeShortcuts),this.command=new $({mindMap:this}),this.renderer=new B({mindMap:this}),this.view=new r({mindMap:this}),this.batchExecution=new Y,V.pluginList.forEach(t=>{this.initPlugin(t)}),this.addCss(),this.render(this.opt.fit?()=>this.view.fit():()=>{}),this.opt.addHistoryOnInit&&this.opt.data&&this.command.addHistory()}handleOpt(t){return n["f"].includes(t.layout)||(t.layout=n["a"].LAYOUT.LOGICAL_STRUCTURE),t.theme=t.theme&&F[t.theme]?t.theme:"default",t}handleData(t){if(Object(h["fb"])(t))return null;if(Array.isArray(t)||!t||"object"!==typeof t||t.data||t.root&&(t=t.root),Array.isArray(t)){if(t=Object(h["yb"])(t),!t)return null;this.isMultiRoot=!0;const e=t.map(t=>(t&&"object"===typeof t||(t={data:{text:"Root"},children:[]}),t.data||(t.data={text:"Root"}),this.opt.allowRootNodeCollapse||!1!==t.data.expand||(t.data.expand=!0),Object(h["v"])([t],!1,null,!0),t));return e}if(Object.keys(t).length<=0)return null;if(t=Object(h["yb"])(t||{}),!t)return null;if(t.multiRoot&&Array.isArray(t.roots)){this.isMultiRoot=!0;const e=t.roots.map(t=>(t&&"object"===typeof t||(t={data:{text:"Root"},children:[]}),t.data||(t.data={text:"Root"}),this.opt.allowRootNodeCollapse||!1!==t.data.expand||(t.data.expand=!0),Object(h["v"])([t],!1,null,!0),t));return e}return this.isMultiRoot=!1,t.data||(t.data={text:"Root"}),this.opt.allowRootNodeCollapse||!1!==t.data.expand||(t.data.expand=!0),Object(h["v"])([t],!1,null,!0),t}initContainer(){const{associativeLineIsAlwaysAboveNode:t}=this.opt;this.el.classList.add("smm-mind-map-container");const e=()=>{this.associativeLineDraw=this.draw.group(),this.associativeLineDraw.addClass("smm-associative-line-container")};this.svg=Object(O["i"])().addTo(this.el).size(this.width,this.height),this.draw=this.svg.group(),this.draw.addClass("smm-container"),this.lineDraw=this.draw.group(),this.lineDraw.addClass("smm-line-container"),t||e(),this.nodeDraw=this.draw.group(),this.nodeDraw.addClass("smm-node-container"),t&&e(),this.otherDraw=this.draw.group(),this.otherDraw.addClass("smm-other-container")}clearDraw(){this.lineDraw.clear(),this.associativeLineDraw.clear(),this.nodeDraw.clear(),this.otherDraw.clear()}appendCss(t,e){this.cssTextMap[t]=e,this.removeCss(),this.addCss()}removeAppendCss(t){this.cssTextMap[t]&&(delete this.cssTextMap[t],this.removeCss(),this.addCss())}joinCss(){return n["c"]+Object.keys(this.cssTextMap).map(t=>this.cssTextMap[t]).join("\n")}addCss(){this.cssEl=document.createElement("style"),this.cssEl.type="text/css",this.cssEl.innerHTML=this.joinCss(),document.head.appendChild(this.cssEl)}removeCss(){this.cssEl&&document.head.removeChild(this.cssEl)}render(t,e=""){this.batchExecution.push("render",()=>{this.initTheme(),this.renderer.render(t,e)})}reRender(t,e=""){this.renderer.reRender=!0,this.renderer.clearCache(),this.clearDraw(),this.render(t,e)}getElRectInfo(){if(!this._destroyed&&(this.elRect=this.el.getBoundingClientRect(),this.width=this.elRect.width,this.height=this.elRect.height,this.width<=0||this.height<=0))throw new Error("容器元素el的宽高不能为0")}_initializeContainer(){if(this.opt.containerSizeRetryConfig.enable)try{this.getElRectInfo(),this._initialized=!0,this.initWidth=this.width,this.initHeight=this.height}catch(t){if(!this.opt.containerSizeRetryConfig.fallbackToAsync)throw t;this.width=100,this.height=100,this._initPromise=this.delayedInit()}else this.getElRectInfo(),this._initialized=!0,this.initWidth=this.width,this.initHeight=this.height}async delayedInit(){try{await this.getElRectInfoWithRetry(this.opt.containerSizeRetryConfig),this._initialized=!0,this.initWidth=this.width,this.initHeight=this.height,this.svg&&this.svg.size(this.width,this.height),this.renderer&&this.render(),this.emit("delayedInitComplete")}catch(t){throw this.opt.errorHandler&&this.opt.errorHandler("DELAYED_INIT_ERROR",t),t}}async waitForInit(){return this._initialized?Promise.resolve():this._initPromise?this._initPromise:this.delayedInit()}async getElRectInfoWithRetry(t={}){const{maxRetries:e=10,retryDelay:i=100,exponentialBackoff:n=!0,onRetry:o=null}=t;let r=0,s=null;const a=()=>{try{return this.elRect=this.el.getBoundingClientRect(),this.width=this.elRect.width,this.height=this.elRect.height,this.width>0&&this.height>0}catch(t){return s=t,!1}};return a()?Promise.resolve():new Promise((t,s)=>{const h=()=>{if(r++,r>e)return void s(new Error(`容器元素el的宽高不能为0,已重试${e}次`));o&&o(r,e);const d=n?i*Math.pow(2,r-1):i;setTimeout(()=>{a()?t():h()},Math.min(d,5e3))};h()})}resize(){if(this._destroyed)return;const t=this.width,e=this.height;try{this.getElRectInfo(),this.svg.size(this.width,this.height),t===this.width&&e===this.height||this.demonstrate&&this.demonstrate.isInDemonstrate||this.render(),this.emit("resize")}catch(i){if(this._destroyed)return;if(!this.opt.containerSizeRetryConfig.enable)throw i;this.getElRectInfoWithRetry(this.opt.containerSizeRetryConfig).then(()=>{this._destroyed||(this.svg.size(this.width,this.height),t===this.width&&e===this.height||this.demonstrate&&this.demonstrate.isInDemonstrate||this.render(),this.emit("resize"))}).catch(t=>{this._destroyed||this.opt.errorHandler&&this.opt.errorHandler("CONTAINER_SIZE_ERROR",t)})}}on(t,e){this.event.on(t,e)}emit(t,...e){this.event.emit(t,...e)}off(t,e){this.event.off(t,e)}initCache(){this.commonCaches={measureCustomNodeContentSizeEl:null,measureRichtextNodeTextSizeEl:null}}initTheme(){this.themeConfig=Object(h["ib"])(F[this.opt.theme]||F.default,this.opt.themeConfig),P["a"].setBackgroundStyle(this.el,this.themeConfig)}getNodeThemeConfig(t){if(this.isMultiRoot&&t){let e=t;while(e&&e.parent)e=e.parent;if(e&&e.nodeData&&e.nodeData.data){const t=e.nodeData.data;if(t.theme)return Object(h["ib"])(F[t.theme]||F.default,t.themeConfig||{})}}return this.themeConfig}setTheme(t,e=!1){this.execCommand("CLEAR_ACTIVE_NODE"),this.opt.theme=t,e||this.render(null,n["a"].CHANGE_THEME),this.emit("view_theme_change",t)}refreshTheme(){this.render(null,n["a"].CHANGE_THEME)}getTheme(){return this.opt.theme}setThemeConfig(t,e=!1){const i=Object(h["O"])(this.themeConfig,t);if(this.opt.themeConfig=t,!e){const t=Object(A["a"])(i);this.render(null,t?"":n["a"].CHANGE_THEME)}}getCustomThemeConfig(){return this.opt.themeConfig}getThemeConfig(t){return void 0===t?this.themeConfig:this.themeConfig[t]}getConfig(t){return void 0===t?this.opt:this.opt[t]}updateConfig(t={}){this.emit("before_update_config",this.opt);const e={...this.opt};this.opt=this.handleOpt(u.a.all([X,this.opt,t])),this.emit("after_update_config",this.opt,e)}getLayout(){return this.opt.layout}setLayout(t,e=!1){n["f"].includes(t)||(t=n["a"].LAYOUT.LOGICAL_STRUCTURE),this.opt.layout=t,this.view.reset(),this.renderer.setLayout(),e||this.render(null,n["a"].CHANGE_LAYOUT),this.emit("layout_change",t)}execCommand(...t){this.command.exec(...t)}updateData(t){t=this.handleData(t),this.emit("before_update_data",t),this.renderer.setData(t),this.render(),this.command.addHistory(),this.emit("update_data",t)}setData(t){t=this.handleData(t),this.emit("before_set_data",t),this.opt.data=t,this.execCommand("CLEAR_ACTIVE_NODE"),this.command.clearHistory(),this.command.addHistory(),this.renderer.setData(t),this.reRender(()=>{},n["a"].SET_DATA),this.emit("set_data",t)}setFullData(t){t.multiRoot&&t.roots?this.setData({multiRoot:!0,roots:t.roots}):t.root&&this.setData(t.root),t.layout&&this.setLayout(t.layout),t.theme&&(t.theme.template&&this.setTheme(t.theme.template),t.theme.config&&this.setThemeConfig(t.theme.config)),t.view&&this.view.setTransformData(t.view)}getData(t){let e=this.command.getCopyData(),i={};return i=t?{layout:this.getLayout(),root:e,theme:{template:this.getTheme(),config:this.getCustomThemeConfig()},view:this.view.getTransformData()}:e,this.isMultiRoot&&(t?(i.multiRoot=!0,i.roots=i.root,delete i.root):i={multiRoot:!0,roots:i}),Object(h["yb"])(i)}async export(...t){try{if(!this.doExport)throw new Error("请注册Export插件!");let e=await this.doExport.export(...t);return e}catch(e){this.opt.errorHandler(n["b"].EXPORT_ERROR,e)}}toPos(t,e){return{x:t-this.elRect.left,y:e-this.elRect.top}}setMode(t){if(![n["a"].MODE.READONLY,n["a"].MODE.EDIT].includes(t))return;const e=t===n["a"].MODE.READONLY;e!==this.opt.readonly&&(e&&(this.renderer.textEdit.isShowTextEdit()&&(this.renderer.textEdit.hideEditTextBox(),this.command.originAddHistory()),this.execCommand("CLEAR_ACTIVE_NODE")),this.opt.readonly=e,!e&&this.command.history.length<=0&&this.command.originAddHistory(),this.emit("mode_change",t))}getSvgData({paddingX:t=0,paddingY:e=0,ignoreWatermark:i=!1,addContentToHeader:n,addContentToFooter:o,node:r}={}){const{watermarkConfig:s,openPerformance:a}=this.opt;a&&this.renderer.forceLoadNode(r);const{cssTextList:d,header:l,headerHeight:c,footer:u,footerHeight:f}=Object(h["V"])({addContentToHeader:n,addContentToFooter:o}),p=this.svg,g=this.draw,m=p.width(),b=p.height(),x=g.transform(),y=this.elRect;g.scale(1/x.scaleX,1/x.scaleY);const w=g.rbox();let C=null;r&&(C=Object(h["N"])(r,w.x,w.y,t,e));const v=0;w.width+=2*t,w.height+=2*e+v+c+f,g.translate(t,e),p.size(w.width,w.height),g.translate(-w.x+y.left,-w.y+y.top);let _=p.clone();const M=this.watermark&&this.watermark.hasWatermark();if(!i&&M){this.watermark.isInExport=!0;const{onlyExport:t}=s,e=w.width>m||w.height>b;e?(this.width=w.width,this.height=w.height,this.watermark.onResize(),_=p.clone(),this.width=m,this.height=b,this.watermark.onResize()):t&&(this.watermark.onResize(),_=p.clone()),t&&this.watermark.clear(),this.watermark.isInExport=!1}[this.joinCss(),...d].forEach(t=>{_.add(Object(O["i"])(``))}),l&&c>0&&(_.findOne(".smm-container").translate(0,c),l.width(w.width),l.y(e),_.add(l,0)),u&&f>0&&(u.width(w.width),u.y(w.height-e-f),_.add(u));const E=p.find("defs"),N=_.find("defs");return E.forEach((t,e)=>{const i=N[e];if(!i)return;const n=t.children(),o=i.children();for(let r=0;r0&&(this.renderer.renderTree=e[0]),this.render()}addRootNode(t={},e=-1,i=null){this.isMultiRoot||this.setMultiRootMode(!0);let n=this.renderer.renderTree;Array.isArray(n)||(n=n?[n]:[],this.renderer.renderTree=n);const o=n.length,r={data:{text:this.opt.defaultCreateRootText||"新根节点",expand:!0,uid:Object(h["u"])(),...t.data},children:t.children||[]};return Object(h["v"])([r],!1,null,!0),e>=0&&e{if(this.renderer.roots&&this.renderer.roots.length>o){const t=this.renderer.roots[this.renderer.roots.length-1];i&&"function"===typeof i&&i(t)}}),this.command.addHistory(),r}removeRootNode(t){if(!this.isMultiRoot||!Array.isArray(this.renderer.renderTree))return;const e=this.renderer.renderTree;t>=0&&t0?t.roots[0]:t}setRootLayout(t,e){if(!this.isMultiRoot||!Array.isArray(this.renderer.renderTree))return;const i=this.renderer.renderTree;t>=0&&t{var i;return t===e||(null===t||void 0===t?void 0:t.uid)===(null===(i=e)||void 0===i?void 0:i.uid)});return n>=0?n:null}setRootTheme(t,e,i={}){if(!this.isMultiRoot||!Array.isArray(this.renderer.renderTree))return;const o=this.renderer.renderTree;t>=0&&t{const n=t.getData(i);void 0!==n&&null!==n&&(e.data[i]=n)}),e.data.text||(e.data.text="节点"),e.data.uid||(e.data.uid=t.uid||Object(h["u"])()),t.children&&t.children.length>0&&(e.children=t.children.map(t=>this.copyNodeData(t))),e}getRootTheme(t){if(!this.isMultiRoot||!Array.isArray(this.renderer.renderTree))return{theme:this.opt.theme,themeConfig:this.opt.themeConfig};if(null===t||void 0===t||t<0||t>=this.renderer.renderTree.length)return{theme:this.opt.theme,themeConfig:this.opt.themeConfig};const e=this.renderer.renderTree;return t>=0&&t0&&(i.data.expand=!1),this.execCommand("REMOVE_NODE",[t]),this.addRootNode(i)}else t.nodeData.data||(t.nodeData.data={}),t.nodeData.data.isFlowChart=!0,t.nodeData.data.flowchart={nodeType:e,showConnectors:!0,connectorPositions:["top","right","bottom","left"],preventOverlap:!0,hideExpandBtn:!0,hideAddBtn:!0},t._isFlowChartNode=!0,t.freePosition=!0,t._flowChartConnector||Promise.resolve().then(i.bind(null,"14d0")).then(e=>{const i=e.default;t._flowChartConnector=new i(t),t.group&&t._flowChartConnector.renderConnectors()}),t.children&&t.children.length>0&&(t.nodeData.data.expand=!1,t.hideChildren()),t.setData({isFlowChart:!0,flowchart:t.nodeData.data.flowchart,expand:!1}),t.reRender();else console.error("节点数据为空",t)}convertNodeToNormal(t){t&&t.nodeData&&t.nodeData.data.isFlowChart&&(delete t.nodeData.data.isFlowChart,delete t.nodeData.data.flowchart,t._isFlowChartNode=!1,t.freePosition=!1,t.children&&t.children.length>0&&(t.nodeData.data.expand=!0,t.showChildren()),t.setData({expand:!0}),t.reRender())}destroy(){this._destroyed=!0,this.emit("beforeDestroy"),this.renderer.textEdit.hideEditTextBox(),this.renderer.textEdit.removeTextEditEl(),[...V.pluginList].forEach(t=>{this[t.instanceName]&&this[t.instanceName].beforePluginDestroy&&this[t.instanceName].beforePluginDestroy(),this[t.instanceName]=null}),this.event.unbind(),this.svg.remove(),P["a"].removeBackgroundStyle(this.el),this.el.classList.remove("smm-mind-map-container"),this.el.innerHTML="",this.el=null,this.removeCss(),V.instanceCount--}}V.pluginList=[],V.usePlugin=(t,e={})=>(-1!==V.hasPlugin(t)||(t.pluginOpt=e,V.pluginList.push(t)),V),V.hasPlugin=t=>V.pluginList.findIndex(e=>e===t),V.instanceCount=0,V.defineTheme=(t,e={})=>{if(F[t])return new Error("该主题名称已存在");F[t]=Object(h["ib"])(A["b"],e)},V.updateTheme=(t,e={})=>{F[t]=Object(h["ib"])(A["b"],e)},V.removeTheme=t=>{F[t]&&(F[t]=null)};e["a"]=V},"723f":function(t,e,i){"use strict";i.d(e,"b",(function(){return l}));var n=i("1e42");const o='',r='',s='',a='',h='\n\n\n\n\n\n\n\n',d='\nCreated with Fabric.js 5.2.4\n\n\n\n\n\n\n\n\n\n\n\t\t\n\n\n\t\t\n\n\n\t\t\n\n\n\t\t\n\n\n\n\n\n\n\n',l=[{name:"优先级图标",type:"priority",list:[{name:"1",icon:''},{name:"2",icon:''},{name:"3",icon:''},{name:"4",icon:''},{name:"5",icon:''},{name:"6",icon:''},{name:"7",icon:''},{name:"8",icon:''},{name:"9",icon:''},{name:"10",icon:''}]},{name:"进度图标",type:"progress",list:[{name:"1",icon:''},{name:"2",icon:''},{name:"3",icon:''},{name:"4",icon:''},{name:"5",icon:''},{name:"6",icon:''},{name:"7",icon:''},{name:"8",icon:''}]},{name:"表情图标",type:"expression",list:[{name:"1",icon:''},{name:"2",icon:''},{name:"3",icon:''},{name:"4",icon:''},{name:"5",icon:''},{name:"6",icon:''},{name:"7",icon:''},{name:"8",icon:''},{name:"9",icon:''},{name:"10",icon:''},{name:"11",icon:''},{name:"12",icon:''},{name:"13",icon:''},{name:"14",icon:''},{name:"15",icon:''},{name:"16",icon:''},{name:"17",icon:''},{name:"18",icon:''},{name:"19",icon:''},{name:"20",icon:''}]},{name:"标记图标",type:"sign",list:[{name:"1",icon:''},{name:"2",icon:''},{name:"3",icon:''},{name:"4",icon:''},{name:"5",icon:''},{name:"6",icon:''},{name:"7",icon:''},{name:"8",icon:''},{name:"9",icon:''},{name:"10",icon:''},{name:"11",icon:''},{name:"12",icon:''},{name:"13",icon:''},{name:"14",icon:''},{name:"15",icon:''},{name:"16",icon:''},{name:"17",icon:''},{name:"18",icon:''},{name:"19",icon:''},{name:"20",icon:''},{name:"21",icon:''},{name:"22",icon:''},{name:"23",icon:''}]}],c=(t,e=[])=>{let i=t.split("_");const o=Object(n["jb"])([...l,...e]);let r=o.find(t=>t.type===i[0]);if(r){let t=r.list.find(t=>t.name===i[1]);return t?t.icon:""}return""};e["a"]={siyuanPDFLink:o,hyperlink:r,note:s,attachment:a,siyuan:h,siyuanLink:d,nodeIconList:l,getNodeIconListIcon:c}},"72c3":function(t,e,i){"use strict";var n=i("23e7"),o=i("e9bc"),r=i("dad2");n({target:"Set",proto:!0,real:!0,forced:!r("union")},{union:o})},"79a4":function(t,e,i){"use strict";var n=i("23e7"),o=i("d039"),r=i("953b"),s=i("dad2"),a=!s("intersection")||o((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}));n({target:"Set",proto:!0,real:!0,forced:a},{intersection:r})},"7c25":function(t,e,i){"use strict";i("d9e2"),i("14d9");var n=i("108f"),o=i("4013");class r{constructor(t){this.max=t||1e3,this.size=0,this.pool=new Map}add(t,e){const i=this.has(t);return!(!i&&this.size>=this.max)&&(this.delete(t),this.pool.set(t,e),this.size++,!0)}delete(t){this.pool.has(t)&&(this.pool.delete(t),this.size--)}has(t){return this.pool.has(t)}get(t){if(this.pool.has(t))return this.pool.get(t)}clear(){this.size=0,this.pool=new Map}}var s=i("1e42");class a{constructor(t){this.renderer=t,this.mindMap=t.mindMap,this.draw=this.mindMap.draw,this.lineDraw=this.mindMap.lineDraw,this.root=null,this.lru=new r(this.mindMap.opt.maxNodeCacheCount),this.rootNodeCenterOffset=null,this.rootNodeCenterOffsetKey=""}doLayout(t,e,i){throw new Error("【computed】方法为必要方法,需要子类进行重写!")}renderLine(){throw new Error("【renderLine】方法为必要方法,需要子类进行重写!")}renderExpandBtn(){throw new Error("【renderExpandBtn】方法为必要方法,需要子类进行重写!")}renderGeneralization(){}cacheNode(t,e){this.renderer.nodeCache[t]=e,this.lru.add(t,e)}checkIsNeedResizeSources(){return[o["a"].CHANGE_THEME].includes(this.renderer.renderSource)}checkIsLayerTypeChange(t,e){return!(t>=2&&e>=2)&&(t>=2&&e<2||(t<2&&e>=2||void 0))}checkIsLayoutChangeRerenderExpandBtnPlaceholderRect(t){this.renderer.renderSource===o["a"].CHANGE_LAYOUT&&(t.needRerenderExpandBtnPlaceholderRect=!0)}checkIsNodeDataChange(t,e){return t&&(t="string"===typeof t?JSON.parse(t):t,t.isActive=e.isActive,t.expand=e.expand,t=JSON.stringify(t)),t!==JSON.stringify(e)}createNode(t,e,i,o,r,a){t||(t={data:{}}),t.data||(t.data={});const h={};this.mindMap.nodeInnerPrefixList.forEach(i=>{if(i.createNodeData){const[n,s]=i.createNodeData({data:t,parent:e,ancestors:a,layerIndex:o,index:r});h[n]=s}});const d=t.data.uid;let l=null;if(t&&t._node&&!this.renderer.reRender){l=t._node;const n=this.checkIsLayerTypeChange(l.layerIndex,o);l.reset(),l.layerIndex=o,i?l.isRoot=!0:l.parent=e._node,this.cacheNode(t._node.uid,l),this.checkIsLayoutChangeRerenderExpandBtnPlaceholderRect(l);let r=!1;this.mindMap.nodeInnerPrefixList.forEach(t=>{if(t.updateNodeData){const e=t.updateNodeData(l,h);e&&(r=e)}});const s=this.checkIsNeedResizeSources(),a=this.checkIsNodeDataChange(t._node.nodeDataSnapshot,t.data);(s||a||n||l.getData("resetRichText")||l.getData("needUpdate")||r)&&(l.getSize(),l.needLayout=!0),this.checkGetGeneralizationChange(l,s)}else if(!this.lru.has(d)&&!this.renderer.lastNodeCache[d]||this.renderer.reRender){const r=d||Object(s["u"])();l=new n["a"]({data:t,uid:r,renderer:this.renderer,mindMap:this.mindMap,draw:this.draw,layerIndex:o,isRoot:i,parent:i?null:e._node,...h}),t.data.uid=r,this.cacheNode(r,l),t._node=l}else{l=this.lru.get(d)||this.renderer.lastNodeCache[d];const n=JSON.stringify(l.getData()),r=this.checkIsLayerTypeChange(l.layerIndex,o);l.reset(),l.nodeData=l.handleData(t||{}),l.layerIndex=o,i?l.isRoot=!0:l.parent=e._node,this.cacheNode(d,l),this.checkIsLayoutChangeRerenderExpandBtnPlaceholderRect(l),t._node=l;const s=this.checkIsNeedResizeSources(),a=this.checkIsNodeDataChange(n,t.data);let c=!1;this.mindMap.nodeInnerPrefixList.forEach(t=>{if(t.updateNodeData){const e=t.updateNodeData(l,h);e&&(c=e)}}),(s||a||r||l.getData("resetRichText")||l.getData("needUpdate")||c)&&(l.getSize(),l.needLayout=!0),this.checkGetGeneralizationChange(l,s)}return t.data.isActive&&this.renderer.addNodeToActiveList(l),-1!==this.mindMap.renderer.findActiveNodeIndex(l)&&l.setData({isActive:!0}),i?this.root=l:e._node.addChildren(l),l}checkGetGeneralizationChange(t,e){const i=t.getData("generalization");i&&t._generalizationList&&t._generalizationList.length>0&&t._generalizationList.forEach((t,n)=>{const o=t.generalizationNode,r=o.getData(),s=i[n];(e||s&&JSON.stringify(r)!==JSON.stringify(s))&&(s&&(o.nodeData.data=s),o.getSize(),o.needLayout=!0)})}formatPosition(t,e,i){return"number"===typeof t?t:void 0!==o["d"][t]?e*o["d"][t]:/^\d\d*%$/.test(t)?Number.parseFloat(t)/100*e:(e-i)/2}formatInitRootNodePosition(t){const{CENTER:e}=o["a"].INIT_ROOT_NODE_POSITION;return(!t||!Array.isArray(t)||t.length<2)&&(t=[e,e]),t}setNodeCenter(t,e){let{initRootNodePosition:i}=this.mindMap.opt;i=this.formatInitRootNodePosition(e||i),t.left=this.formatPosition(i[0],this.mindMap.width,t.width),t.top=this.formatPosition(i[1],this.mindMap.height,t.height)}getRootCenterOffset(t,e){let{initRootNodePosition:i}=this.mindMap.opt;const{CENTER:n}=o["a"].INIT_ROOT_NODE_POSITION;i=this.formatInitRootNodePosition(i);const r=`${this.mindMap.width}x${this.mindMap.height}|${i[0]},${i[1]}`;if(this.rootNodeCenterOffset&&this.rootNodeCenterOffsetKey===r)return this.rootNodeCenterOffset;if(this.rootNodeCenterOffsetKey=r,i[0]===n&&i[1]===n)this.rootNodeCenterOffset={x:0,y:0};else{const i={width:t,height:e},o={width:t,height:e};this.setNodeCenter(i,[n,n]),this.setNodeCenter(o),this.rootNodeCenterOffset={x:o.left-i.left,y:o.top-i.top}}return this.rootNodeCenterOffset}updateChildren(t,e,i){t.forEach(t=>{t[e]+=i,t.children&&t.children.length&&!t.hasCustomPosition()&&this.updateChildren(t.children,e,i)})}updateChildrenPro(t,e){t.forEach(t=>{Object.keys(e).forEach(i=>{t[i]+=e[i]}),t.children&&t.children.length&&!t.hasCustomPosition()&&this.updateChildrenPro(t.children,e)})}getNodeAreaWidth(t,e=!1){let i=[],n=0,o=(t,r)=>{e&&t.checkHasGeneralization()&&(n+=t._generalizationNodeWidth),t.children.length?(r+=t.width/2,t.children.forEach(t=>{o(t,r)})):(r+=t.width,i.push(r))};return o(t,0),Math.max(...i)+n}quadraticCurvePath(t,e,i,n,o=!1){let r,s;return o?(r=t+.8*(i-t),s=e+.2*(n-e)):(r=t+.2*(i-t),s=e+.8*(n-e)),`M ${t},${e} Q ${r},${s} ${i},${n}`}cubicBezierPath(t,e,i,n,o=!1){let r,s,a,h;return o?(r=t,s=e+(n-e)/2,a=i,h=s):(r=t+(i-t)/2,s=e,a=r,h=n),`M ${t},${e} C ${r},${s} ${a},${h} ${i},${n}`}computeNewPoint(t,e,i=0){return t[0]===e[0]?e[1]>t[1]?[e[0],e[1]-i]:[e[0],e[1]+i]:t[1]===e[1]?e[0]>t[0]?[e[0]-i,e[1]]:[e[0]+i,e[1]]:void 0}createBracePath(t,e,i,n,o,r=15){const s=o?-1:1,a=n-e,h=i-n,d=Math.min(r,a/2),l=Math.min(r,h/2),c=Math.min(d,l),u=[`M ${t+d*s},${e}`,`Q ${t},${e} ${t},${e+d}`,`L ${t},${n-d}`,`Q ${t},${n} ${t-c*s},${n}`,`Q ${t},${n} ${t},${n+l}`,`L ${t},${i-l}`,`Q ${t},${i} ${t+l*s},${i}`].join(" ");return u}createBracePathWithAllChildren(t,e,i,n,o,r=15){return this.createBracePath(t,e,i,n,o,r)}createFoldLine(t){const{lineRadius:e}=this.mindMap.themeConfig,i=t.length;let n="",o="";if(i>=3&&e>0){const n=t[i-3],r=t[i-2],s=t[i-1],a=n[0].toFixed(0)===r[0].toFixed(0)&&r[0].toFixed(0)===s[0].toFixed(0)||n[1].toFixed(0)===r[1].toFixed(0)&&r[1].toFixed(0)===s[1].toFixed(0);if(!a){const a=this.computeNewPoint(n,r,e),h=this.computeNewPoint(s,r,e);o=`Q ${r[0]},${r[1]} ${h[0]},${h[1]}`,t.splice(i-2,1,a,o)}}return t.forEach((t,e)=>{if("string"===typeof t)n+=t;else{const[i,o]=t;n+=0===e?`M ${i},${o}`:`L ${i},${o}`}}),n}getMarginX(t){const{themeConfig:e,opt:i}=this.mindMap,{second:n,node:o}=e,r=2*i.hoverRectPadding;return 1===t?n.marginX+r:o.marginX+r}getMarginY(t){const{themeConfig:e,opt:i}=this.mindMap,{second:n,node:o}=e,r=2*i.hoverRectPadding;return 1===t?n.marginY+r:o.marginY+r}getNodeWidthWithGeneralization(t){return Math.max(t.width,t.checkHasGeneralization()?t._generalizationNodeWidth:0)}getNodeHeightWithGeneralization(t){return Math.max(t.height,t.checkHasGeneralization()?t._generalizationNodeHeight:0)}getNodeBoundaries(t,e){let{generalizationLineMargin:i,generalizationNodeMargin:n}=this.mindMap.themeConfig,o=t=>{let i=1/0,r=-1/0,s=1/0,a=-1/0;t.children&&t.children.length>0&&t.children.forEach(t=>{let{left:h,right:d,top:l,bottom:c}=o(t),u=t.checkHasGeneralization()&&t.getData("expand")?t._generalizationNodeWidth+n:0,f=t.checkHasGeneralization()&&t.getData("expand")?t._generalizationNodeHeight+n:0;h-("h"===e?u:0)r&&(r=d+("h"===e?u:0)),la&&(a=c+("v"===e?f:0))});let h={left:t.left,right:t.left+t.width,top:t.top,bottom:t.top+t.height};return{left:h.leftr?h.right:r,top:h.topa?h.bottom:a}},{left:r,right:s,top:a,bottom:h}=o(t);return{left:r,right:s,top:a,bottom:h,generalizationLineMargin:i,generalizationNodeMargin:n}}getChildrenBoundaries(t,e,i=0,n){let{generalizationLineMargin:o,generalizationNodeMargin:r}=this.mindMap.themeConfig;const s=t.children.slice(i,n+1);let a=1/0,h=-1/0,d=1/0,l=-1/0;return s.forEach(t=>{const i=this.getNodeBoundaries(t,e);a=i.lefth?i.right:h,d=i.topl?i.bottom:l}),{left:a,right:h,top:d,bottom:l,generalizationLineMargin:o,generalizationNodeMargin:r}}getNodeGeneralizationRenderBoundaries(t,e){let i=null;return i=t.range?this.getChildrenBoundaries(t.node,e,t.range[0],t.range[1]):this.getNodeBoundaries(t.node,e),i}getNodeActChildrenLength(t){return t.nodeData.children&&t.nodeData.children.length}setLineStyle(t,e,i,n,o=!0){e&&e.plot?(e.plot(this.transformPath(i)),t&&t(e,n,o)):console.warn("setLineStyle: line object is undefined or invalid",{line:e,childNode:n})}transformPath(t){const{customTransformNodeLinePath:e}=this.mindMap.opt;return e?e(t):t}getLayoutType(){return this.mindMap.opt.layout}}e["a"]=a},"7f65":function(t,e,i){"use strict";var n=i("59ed"),o=i("825a"),r=i("c65b"),s=i("5926"),a=i("46c4"),h="Invalid size",d=RangeError,l=TypeError,c=Math.max,u=function(t,e){this.set=t,this.size=c(e,0),this.has=n(t.has),this.keys=n(t.keys)};u.prototype={getIterator:function(){return a(o(r(this.keys,this.set)))},includes:function(t){return r(this.has,this.set,t)}},t.exports=function(t){o(t);var e=+t.size;if(e!==e)throw new l(h);var i=s(e);if(i<0)throw new d(h);return new u(t,i)}},8306:function(t,e,i){"use strict";i("72c3")},"83b9":function(t,e,i){"use strict";var n=i("cb27"),o=i("384f"),r=n.Set,s=n.add;t.exports=function(t){var e=new r;return o(t,(function(t){s(e,t)})),e}},"88a7":function(t,e,i){"use strict";var n=i("cb2d"),o=i("e330"),r=i("577e"),s=i("d6d6"),a=URLSearchParams,h=a.prototype,d=o(h.append),l=o(h["delete"]),c=o(h.forEach),u=o([].push),f=new a("a=1&a=2&b=3");f["delete"]("a",1),f["delete"]("b",void 0),f+""!=="a=2"&&n(h,"delete",(function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return l(this,t);var n=[];c(this,(function(t,e){u(n,{key:e,value:t})})),s(e,1);var o,a=r(t),h=r(i),f=0,p=0,g=!1,m=n.length;while(f=0;e--)k(t.children[e]);return t.id?(t.id=O(t.nodeName),t):t}function I(t,e){let i,n;for(t=Array.isArray(t)?t:[t],n=t.length-1;n>=0;n--)for(i in e)t[n].prototype[i]=e[i]}function B(t){return function(...e){const i=e[e.length-1];return!i||i.constructor!==Object||i instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(i)}}function F(){return this.parent().children()}function P(){return this.parent().index(this)}function W(){return this.siblings()[this.position()+1]}function H(){return this.siblings()[this.position()-1]}function j(){const t=this.position(),e=this.parent();return e.add(this.remove(),t+1),this}function G(){const t=this.position(),e=this.parent();return e.add(this.remove(),t?t-1:0),this}function $(){const t=this.parent();return t.add(this.remove()),this}function U(){const t=this.parent();return t.add(this.remove(),0),this}function Y(t){t=T(t),t.remove();const e=this.position();return this.parent().add(t,e),this}function X(t){t=T(t),t.remove();const e=this.position();return this.parent().add(t,e+1),this}function V(t){return t=T(t),t.before(this),this}function K(t){return t=T(t),t.after(this),this}r("Dom",{siblings:F,position:P,next:W,prev:H,forward:j,backward:G,front:$,back:U,before:Y,after:X,insertBefore:V,insertAfter:K});const q=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Q=/rgb\((\d+),(\d+),(\d+)\)/,J=/(#[a-z_][a-z0-9\-_]*)/i,tt=/\)\s*,?\s*/,et=/\s/g,it=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,nt=/^rgb\(/,ot=/^(\s+)?$/,rt=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,st=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,at=/[\s,]+/,ht=/[MLHVCSQTAZ]/i;function dt(){const t=this.attr("class");return null==t?[]:t.trim().split(at)}function lt(t){return-1!==this.classes().indexOf(t)}function ct(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this}function ut(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this}function ft(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}function pt(t,e){const i={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);i[e[0]]=e[1]})),i;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);i[e]=this.node.style[t]}return i}if("string"===typeof t)return this.node.style[u(t)];if("object"===typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||ot.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||ot.test(e)?"":e),this}function gt(){return this.css("display","")}function mt(){return this.css("display","none")}function bt(){return"none"!==this.css("display")}function xt(t,e,i){if(null==t)return this.data(d(l(this.node.attributes,t=>0===t.nodeName.indexOf("data-")),t=>t.nodeName.slice(5)));if(t instanceof Array){const e={};for(const i of t)e[i]=this.data(i);return e}if("object"===typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(n){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===i||"string"===typeof e||"number"===typeof e?e:JSON.stringify(e));return this}function yt(t,e){if("object"===typeof arguments[0])for(const i in t)this.remember(i,t[i]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this}function wt(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this}function Ct(){return this._memory=this._memory||{}}function vt(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}function _t(t){const e=Math.round(t),i=Math.max(0,Math.min(255,e)),n=i.toString(16);return 1===n.length?"0"+n:n}function Mt(t,e){for(let i=e.length;i--;)if(null==t[e[i]])return!1;return!0}function Et(t,e){const i=Mt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Mt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Mt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Mt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Mt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Mt(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return i.space=e||i.space,i}function Nt(t){return"lab"===t||"xyz"===t||"lch"===t}function Tt(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}r("Dom",{classes:dt,hasClass:lt,addClass:ct,removeClass:ut,toggleClass:ft}),r("Dom",{css:pt,show:gt,hide:mt,visible:bt}),r("Dom",{data:xt}),r("Dom",{remember:yt,forget:wt,memory:Ct});class Lt{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof Lt||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"===typeof t.r&&"number"===typeof t.g&&"number"===typeof t.b}static random(t="vibrant",e,i){const{random:n,round:o,sin:r,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,i=360*n(),o=new Lt(t,e,i,"lch");return o}if("sine"===t){e=null==e?n():e;const t=o(80*r(2*s*e/.5+.01)+150),i=o(50*r(2*s*e/.5+4.6)+200),a=o(100*r(2*s*e/.5+2.3)+150),h=new Lt(t,i,a);return h}if("pastel"===t){const t=8*n()+86,e=17*n()+9,i=360*n(),o=new Lt(t,e,i,"lch");return o}if("dark"===t){const t=10+10*n(),e=50*n()+86,i=360*n(),o=new Lt(t,e,i,"lch");return o}if("rgb"===t){const t=255*n(),e=255*n(),i=255*n(),o=new Lt(t,e,i);return o}if("lab"===t){const t=100*n(),e=256*n()-128,i=256*n()-128,o=new Lt(t,e,i,"lab");return o}if("grey"===t){const t=255*n(),e=new Lt(t,t,t);return e}throw new Error("Unsupported random color mode")}static test(t){return"string"===typeof t&&(it.test(t)||nt.test(t))}cmyk(){const{_a:t,_b:e,_c:i}=this.rgb(),[n,o,r]=[t,e,i].map(t=>t/255),s=Math.min(1-n,1-o,1-r);if(1===s)return new Lt(0,0,0,1,"cmyk");const a=(1-n-s)/(1-s),h=(1-o-s)/(1-s),d=(1-r-s)/(1-s),l=new Lt(a,h,d,s,"cmyk");return l}hsl(){const{_a:t,_b:e,_c:i}=this.rgb(),[n,o,r]=[t,e,i].map(t=>t/255),s=Math.max(n,o,r),a=Math.min(n,o,r),h=(s+a)/2,d=s===a,l=s-a,c=d?0:h>.5?l/(2-s-a):l/(s+a),u=d?0:s===n?((o-r)/l+(oparseInt(t));Object.assign(this,{_a:i,_b:n,_c:o,_d:0,space:"rgb"})}else{if(!it.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,i,n,o]=Z.exec(vt(t)).map(e);Object.assign(this,{_a:i,_b:n,_c:o,_d:0,space:"rgb"})}}const{_a:r,_b:s,_c:a,_d:h}=this,d="rgb"===this.space?{r:r,g:s,b:a}:"xyz"===this.space?{x:r,y:s,z:a}:"hsl"===this.space?{h:r,s:s,l:a}:"lab"===this.space?{l:r,a:s,b:a}:"lch"===this.space?{l:r,c:s,h:a}:"cmyk"===this.space?{c:r,m:s,y:a,k:h}:{};Object.assign(this,d)}lab(){const{x:t,y:e,z:i}=this.xyz(),n=116*e-16,o=500*(t-e),r=200*(e-i),s=new Lt(n,o,r,"lab");return s}lch(){const{l:t,a:e,b:i}=this.lab(),n=Math.sqrt(e**2+i**2);let o=180*Math.atan2(i,e)/Math.PI;o<0&&(o*=-1,o=360-o);const r=new Lt(t,n,o,"lch");return r}rgb(){if("rgb"===this.space)return this;if(Nt(this.space)){let{x:t,y:e,z:i}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:o,b:r}=this;if("lch"===this.space){const{c:t,h:e}=this,i=Math.PI/180;o=t*Math.cos(i*e),r=t*Math.sin(i*e)}const s=(n+16)/116,a=o/500+s,h=s-r/200,d=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-d)/c),e=1*(s**3>l?s**3:(s-d)/c),i=1.08883*(h**3>l?h**3:(h-d)/c)}const n=3.2406*t+-1.5372*e+-.4986*i,o=-.9689*t+1.8758*e+.0415*i,r=.0557*t+-.204*e+1.057*i,s=Math.pow,a=.0031308,h=n>a?1.055*s(n,1/2.4)-.055:12.92*n,d=o>a?1.055*s(o,1/2.4)-.055:12.92*o,l=r>a?1.055*s(r,1/2.4)-.055:12.92*r,c=new Lt(255*h,255*d,255*l);return c}if("hsl"===this.space){let{h:t,s:e,l:i}=this;if(t/=360,e/=100,i/=100,0===e){i*=255;const t=new Lt(i,i,i);return t}const n=i<.5?i*(1+e):i+e-i*e,o=2*i-n,r=255*Tt(o,n,t+1/3),s=255*Tt(o,n,t),a=255*Tt(o,n,t-1/3),h=new Lt(r,s,a);return h}if("cmyk"===this.space){const{c:t,m:e,y:i,k:n}=this,o=255*(1-Math.min(1,t*(1-n)+n)),r=255*(1-Math.min(1,e*(1-n)+n)),s=255*(1-Math.min(1,i*(1-n)+n)),a=new Lt(o,r,s);return a}return this}toArray(){const{_a:t,_b:e,_c:i,_d:n,space:o}=this;return[t,e,i,n,o]}toHex(){const[t,e,i]=this._clamped().map(_t);return`#${t}${e}${i}`}toRgb(){const[t,e,i]=this._clamped(),n=`rgb(${t},${e},${i})`;return n}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:i}=this.rgb(),[n,o,r]=[t,e,i].map(t=>t/255),s=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,d=(.4124*s+.3576*a+.1805*h)/.95047,l=(.2126*s+.7152*a+.0722*h)/1,c=(.0193*s+.1192*a+.9505*h)/1.08883,u=d>.008856?Math.pow(d,1/3):7.787*d+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116,g=new Lt(u,f,p,"xyz");return g}_clamped(){const{_a:t,_b:e,_c:i}=this.rgb(),{max:n,min:o,round:r}=Math,s=t=>n(0,o(r(t),255));return[t,e,i].map(s)}}class St{constructor(...t){this.init(...t)}clone(){return new St(this)}init(t,e){const i={x:0,y:0},n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"===typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?i.x:n.x,this.y=null==n.y?i.y:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){zt.isMatrixLike(t)||(t=new zt(t));const{x:e,y:i}=this;return this.x=t.a*e+t.c*i+t.e,this.y=t.b*e+t.d*i+t.f,this}}function Dt(t,e){return new St(t,e).transformO(this.screenCTM().inverseO())}function Rt(t,e,i){return Math.abs(e-t)<(i||1e-6)}class zt{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,i=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,o=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,r=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,s=t.scale&&t.scale.length?t.scale[0]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleX)?t.scaleX*i:i,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,d=t.rotate||t.theta||0,l=new St(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,u=l.y,f=new St(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,g=f.y,m=new St(t.translate||t.tx||t.translateX,t.ty||t.translateY),b=m.x,x=m.y,y=new St(t.relative||t.rx||t.relativeX,t.ry||t.relativeY),w=y.x,C=y.y;return{scaleX:s,scaleY:a,skewX:o,skewY:r,shear:h,theta:d,rx:w,ry:C,tx:b,ty:x,ox:c,oy:u,px:p,py:g}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,i){const n=t.a*e.a+t.c*e.b,o=t.b*e.a+t.d*e.b,r=t.a*e.c+t.c*e.d,s=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return i.a=n,i.b=o,i.c=r,i.d=s,i.e=a,i.f=h,i}around(t,e,i){return this.clone().aroundO(t,e,i)}aroundO(t,e,i){const n=t||0,o=e||0;return this.translateO(-n,-o).lmultiplyO(i).translateO(n,o)}clone(){return new zt(this)}decompose(t=0,e=0){const i=this.a,n=this.b,o=this.c,r=this.d,s=this.e,a=this.f,h=i*r-n*o,d=h>0?1:-1,l=d*Math.sqrt(i*i+n*n),c=Math.atan2(d*n,d*i),u=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),g=(i*o+n*r)/h,m=o*l/(g*i-n)||r*l/(g*n+i),b=s-t+t*f*l+e*(g*f*l-p*m),x=a-e+t*p*l+e*(g*p*l+f*m);return{scaleX:l,scaleY:m,shear:g,rotate:u,translateX:b,translateY:x,originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new zt(t);return Rt(this.a,e.a)&&Rt(this.b,e.b)&&Rt(this.c,e.c)&&Rt(this.d,e.d)&&Rt(this.e,e.e)&&Rt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=zt.fromArray([1,0,0,1,0,0]);return t=t instanceof ue?t.matrixify():"string"===typeof t?zt.fromArray(t.split(at).map(parseFloat)):Array.isArray(t)?zt.fromArray(t):"object"===typeof t&&zt.isMatrixLike(t)?t:"object"===typeof t?(new zt).transform(t):6===arguments.length?zt.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,i=this.c,n=this.d,o=this.e,r=this.f,s=t*n-e*i;if(!s)throw new Error("Cannot invert "+this);const a=n/s,h=-e/s,d=-i/s,l=t/s,c=-(a*o+d*r),u=-(h*o+l*r);return this.a=a,this.b=h,this.c=d,this.d=l,this.e=c,this.f=u,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=this,i=t instanceof zt?t:new zt(t);return zt.matrixMultiply(i,e,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=this,i=t instanceof zt?t:new zt(t);return zt.matrixMultiply(e,i,this)}rotate(t,e,i){return this.clone().rotateO(t,e,i)}rotateO(t,e=0,i=0){t=c(t);const n=Math.cos(t),o=Math.sin(t),{a:r,b:s,c:a,d:h,e:d,f:l}=this;return this.a=r*n-s*o,this.b=s*n+r*o,this.c=a*n-h*o,this.d=h*n+a*o,this.e=d*n-l*o+i*o-e*n+e,this.f=l*n+d*o-e*o-i*n+i,this}scale(t,e,i,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,i=0,n=0){3===arguments.length&&(n=i,i=e,e=t);const{a:o,b:r,c:s,d:a,e:h,f:d}=this;return this.a=o*t,this.b=r*e,this.c=s*t,this.d=a*e,this.e=h*t-i*t+i,this.f=d*e-n*e+n,this}shear(t,e,i){return this.clone().shearO(t,e,i)}shearO(t,e=0,i=0){const{a:n,b:o,c:r,d:s,e:a,f:h}=this;return this.a=n+o*t,this.c=r+s*t,this.e=a+h*t-i*t,this}skew(t,e,i,n){return this.clone().skewO(...arguments)}skewO(t,e=t,i=0,n=0){3===arguments.length&&(n=i,i=e,e=t),t=c(t),e=c(e);const o=Math.tan(t),r=Math.tan(e),{a:s,b:a,c:h,d:d,e:l,f:u}=this;return this.a=s+a*o,this.b=a+s*r,this.c=h+d*o,this.d=d+h*r,this.e=l+u*o-n*o,this.f=u+l*r-i*r,this}skewX(t,e,i){return this.skew(t,0,e,i)}skewY(t,e,i){return this.skew(0,t,e,i)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(zt.isMatrixLike(t)){const e=new zt(t);return e.multiplyO(this)}const e=zt.formatTransforms(t),i=this,{x:n,y:o}=new St(e.ox,e.oy).transform(i),r=(new zt).translateO(e.rx,e.ry).lmultiplyO(i).translateO(-n,-o).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,o);if(isFinite(e.px)||isFinite(e.py)){const t=new St(n,o).transform(r),i=isFinite(e.px)?e.px-t.x:0,s=isFinite(e.py)?e.py-t.y:0;r.translateO(i,s)}return r.translateO(e.tx,e.ty),r}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function At(){return new zt(this.node.getCTM())}function Ot(){if("function"===typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new zt(e)}return new zt(this.node.getScreenCTM())}function kt(){if(!kt.nodes){const t=T().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;kt.nodes={svg:t,path:e}}if(!kt.nodes.svg.node.parentNode){const t=v.document.body||v.document.documentElement;kt.nodes.svg.addTo(t)}return kt.nodes}function It(t){return!t.width&&!t.height&&!t.x&&!t.y}function Bt(t){return t===v.document||(v.document.documentElement.contains||function(t){while(t.parentNode)t=t.parentNode;return t===v.document}).call(v.document.documentElement,t)}R(zt,"Matrix");class Ft{constructor(...t){this.init(...t)}addOffset(){return this.x+=v.window.pageXOffset,this.y+=v.window.pageYOffset,new Ft(this)}init(t){const e=[0,0,0,0];return t="string"===typeof t?t.split(at).map(parseFloat):Array.isArray(t)?t:"object"===typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):e,this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return It(this)}merge(t){const e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,o=Math.max(this.y+this.height,t.y+t.height)-i;return new Ft(e,i,n,o)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof zt||(t=new zt(t));let e=1/0,i=-1/0,n=1/0,o=-1/0;const r=[new St(this.x,this.y),new St(this.x2,this.y),new St(this.x,this.y2),new St(this.x2,this.y2)];return r.forEach((function(r){r=r.transform(t),e=Math.min(e,r.x),i=Math.max(i,r.x),n=Math.min(n,r.y),o=Math.max(o,r.y)})),new Ft(e,n,i-e,o-n)}}function Pt(t,e,i){let n;try{if(n=e(t.node),It(n)&&!Bt(t.node))throw new Error("Element not in the dom")}catch(o){n=i(t)}return n}function Wt(){const t=t=>t.getBBox(),e=t=>{try{const e=t.clone().addTo(kt().svg).show(),i=e.node.getBBox();return e.remove(),i}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}},i=Pt(this,t,e),n=new Ft(i);return n}function Ht(t){const e=t=>t.getBoundingClientRect(),i=t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)},n=Pt(this,e,i),o=new Ft(n);return t?o.transform(t.screenCTM().inverseO()):o.addOffset()}function jt(t,e){const i=this.bbox();return t>i.x&&e>i.y&&tt.call(e,e,i,n)):this.map(i=>i[t](...e))},toArray(){return Array.prototype.concat.apply([],this)}});const $t=["toArray","constructor","each"];function Ut(t,e){return new Gt(d((e||v.document).querySelectorAll(t),(function(t){return S(t)})))}function Yt(t){return Ut(t,this.node)}function Xt(t){return S(this.node.querySelector(t))}Gt.extend=function(t){t=t.reduce((t,e)=>($t.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t),{}),I([Gt],t)};let Vt=0;const Kt={};function qt(t){let e=t.getEventHolder();return e===v.window&&(e=Kt),e.events||(e.events={}),e.events}function Zt(t){return t.getEventTarget()}function Qt(t){let e=t.getEventHolder();e===v.window&&(e=Kt),e.events&&(e.events={})}function Jt(t,e,i,n,o){const r=i.bind(n||t),s=T(t),a=qt(s),h=Zt(s);e=Array.isArray(e)?e:e.split(at),i._svgjsListenerId||(i._svgjsListenerId=++Vt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][i._svgjsListenerId]=r,h.addEventListener(e,r,o||!1)}))}function te(t,e,i,n){const o=T(t),r=qt(o),s=Zt(o);("function"!==typeof i||(i=i._svgjsListenerId,i))&&(e=Array.isArray(e)?e:(e||"").split(at),e.forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,d;if(i)r[e]&&r[e][a||"*"]&&(s.removeEventListener(e,r[e][a||"*"][i],n||!1),delete r[e][a||"*"][i]);else if(e&&a){if(r[e]&&r[e][a]){for(d in r[e][a])te(s,[e,a].join("."),d);delete r[e][a]}}else if(a)for(t in r)for(h in r[t])a===h&&te(s,[t,a].join("."));else if(e){if(r[e]){for(h in r[e])te(s,[e,h].join("."));delete r[e]}}else{for(t in r)te(s,t);Qt(o)}})))}function ee(t,e,i,n){const o=Zt(t);return e instanceof v.window.Event||(e=new v.window.CustomEvent(e,{detail:i,cancelable:!0,...n})),o.dispatchEvent(e),e}class ie extends _{addEventListener(){}dispatch(t,e,i){return ee(this,t,e,i)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const i=e[t.type];for(const n in i)for(const e in i[n])i[n][e](t);return!t.defaultPrevented}fire(t,e,i){return this.dispatch(t,e,i),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,i){return te(this,t,e,i),this}on(t,e,i,n){return Jt(this,t,e,i,n),this}removeEventListener(){}}function ne(){}R(ie,"EventTarget");const oe={duration:400,ease:">",delay:0},re={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class se extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"===typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(at).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class ae{constructor(...t){this.init(...t)}convert(t){return new ae(this.value,t)}divide(t){return t=new ae(t),new ae(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"===typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"===typeof t?(e=t.match(q),e&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5])):t instanceof ae&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new ae(t),new ae(this-t,this.unit||t.unit)}plus(t){return t=new ae(t),new ae(this+t,this.unit||t.unit)}times(t){return t=new ae(t),new ae(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const he=[];function de(t){he.push(t)}function le(t,e,i){if(null==t){t={},e=this.node.attributes;for(const i of e)t[i.nodeName]=rt.test(i.nodeValue)?parseFloat(i.nodeValue):i.nodeValue;return t}if(t instanceof Array)return t.reduce((t,e)=>(t[e]=this.attr(e),t),{});if("object"===typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return e=this.node.getAttribute(t),null==e?re[t]:rt.test(e)?parseFloat(e):e;e=he.reduce((e,i)=>i(t,e,this),e),"number"===typeof e?e=new ae(e):Lt.isColor(e)?e=new Lt(e):e.constructor===Array&&(e=new se(e)),"leading"===t?this.leading&&this.leading(e):"string"===typeof i?this.node.setAttributeNS(i,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this}class ce extends ie{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return t=T(t),t.removeNamespace&&this.node instanceof v.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return T(t).put(this,e)}children(){return new Gt(d(this.node.children,(function(t){return S(t)})))}clear(){while(this.node.hasChildNodes())this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let i=this.node.cloneNode(t);return e&&(i=k(i)),new this.constructor(i)}each(t,e){const i=this.children();let n,o;for(n=0,o=i.length;n=0}html(t,e){return this.xml(t,e,x)}id(t){return"undefined"!==typeof t||this.node.id||(this.node.id=O(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return i&&i.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"===typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=T(t),this.add(t,e),t}putIn(t,e){return T(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=T(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const i=10**t,n=this.attr(e);for(const o in n)"number"===typeof n[o]&&(n[o]=Math.round(n[o]*i)/i);return this.attr(n),this}svg(t,e){return this.xml(t,e,b)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const i=e.index(this);return e.put(t,i).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,i){if("boolean"===typeof t&&(i=e,e=t,t=null),null==t||"function"===typeof t){e=null==e||e,this.writeDataToDom();let i=this;if(null!=t){if(i=S(i.node.cloneNode(!0)),e){const e=t(i);if(i=e||i,!1===e)return""}i.each((function(){const e=t(this),i=e||this;!1===e?this.remove():e&&this!==i&&this.replace(i)}),!0)}return e?i.node.outerHTML:i.node.innerHTML}e=null!=e&&e;const n=N("wrapper",i),o=v.document.createDocumentFragment();n.innerHTML=t;for(let s=n.children.length;s--;)o.appendChild(n.firstElementChild);const r=this.parent();return e?this.replace(o)&&r:this.add(o)}}I(ce,{attr:le,find:Yt,findOne:Xt}),R(ce,"Dom");class ue extends ce{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new ae(t).plus(this.x()))}dy(t=0){return this.y(new ae(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"===typeof t;e||(t=T(t));const i=new Gt;let n=this;while((n=n.parent())&&n.node!==v.document&&"#document-fragment"!==n.nodeName){if(i.push(n),!e&&n.node===t.node)break;if(e&&n.matches(t))break;if(n.node===this.root().node)return null}return i}reference(t){if(t=this.attr(t),!t)return null;const e=(t+"").match(J);return e?T(e[1]):null}root(){const t=this.parent(z(E));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const i=g(this,t,e);return this.width(new ae(i.width)).height(new ae(i.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}I(ue,{bbox:Wt,rbox:Ht,inside:jt,point:Dt,ctm:At,screenCTM:Ot}),R(ue,"Element");const fe={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let i;e[t]=function(e){if("undefined"===typeof e)return this.attr(t);if("string"===typeof e||e instanceof Lt||Lt.isRgb(e)||e instanceof ue)this.attr(t,e);else for(i=fe[t].length-1;i>=0;i--)null!=e[fe[t][i]]&&this.attr(fe.prefix(t,fe[t][i]),e[fe[t][i]]);return this},r(["Element","Runner"],e)})),r(["Element","Runner"],{matrix:function(t,e,i,n,o,r){return null==t?new zt(this):this.attr("transform",new zt(t,e,i,n,o,r))},rotate:function(t,e,i){return this.transform({rotate:t,ox:e,oy:i},!0)},skew:function(t,e,i,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:i},!0):this.transform({skew:[t,e],ox:i,oy:n},!0)},shear:function(t,e,i){return this.transform({shear:t,ox:e,oy:i},!0)},scale:function(t,e,i,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:i},!0):this.transform({scale:[t,e],ox:i,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),r("radius",{radius:function(t,e=t){const i=(this._element||this).type;return"radialGradient"===i?this.attr("r",new ae(t)):this.rx(t).ry(e)}}),r("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new St(this.node.getPointAtLength(t))}}),r(["Element","Runner"],{font:function(t,e){if("object"===typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});const pe=["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){const i=function(t){return null===t?this.off(e):this.on(e,t),this};return t[e]=i,t}),{});function ge(){return this.attr("transform",null)}function me(){const t=(this.attr("transform")||"").split(tt).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(at).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(zt.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new zt);return t}function be(t,e){if(this===t)return this;const i=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(i)),this}function xe(t){return this.toParent(this.root(),t)}function ye(t,e){if(null==t||"string"===typeof t){const e=new zt(this).decompose();return null==t?e:e[t]}zt.isMatrixLike(t)||(t={...t,origin:m(t,this)});const i=!0===e?this:e||!1,n=new zt(i).transform(t);return this.attr("transform",n)}r("Element",pe),r("Element",{untransform:ge,matrixify:me,toParent:be,toRoot:xe,transform:ye});class we extends ue{flatten(t=this,e){return this.each((function(){if(this instanceof we)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(i,n){return n[n.length-i-1].toParent(t,e)})),this.remove()}}R(we,"Container");class Ce extends we{constructor(t,e=t){super(L("defs",t),e)}flatten(){return this}ungroup(){return this}}R(Ce,"Defs");class ve extends ue{}function _e(t){return this.attr("rx",t)}function Me(t){return this.attr("ry",t)}function Ee(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ne(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Te(t){return this.attr("cx",t)}function Le(t){return this.attr("cy",t)}function Se(t){return null==t?2*this.rx():this.rx(new ae(t).divide(2))}function De(t){return null==t?2*this.ry():this.ry(new ae(t).divide(2))}R(ve,"Shape");var Re={__proto__:null,rx:_e,ry:Me,x:Ee,y:Ne,cx:Te,cy:Le,width:Se,height:De};class ze extends ve{constructor(t,e=t){super(L("ellipse",t),e)}size(t,e){const i=g(this,t,e);return this.rx(new ae(i.width).divide(2)).ry(new ae(i.height).divide(2))}}I(ze,Re),r("Container",{ellipse:B((function(t=0,e=t){return this.put(new ze).size(t,e).move(0,0)}))}),R(ze,"Ellipse");class Ae extends ce{constructor(t=v.document.createDocumentFragment()){super(t)}xml(t,e,i){if("boolean"===typeof t&&(i=e,e=t,t=null),null==t||"function"===typeof t){const t=new ce(N("wrapper",i));return t.add(this.node.cloneNode(!0)),t.xml(!1,i)}return super.xml(t,!1,i)}}function Oe(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new ae(t),fy:new ae(e)}):this.attr({x1:new ae(t),y1:new ae(e)})}function ke(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new ae(t),cy:new ae(e)}):this.attr({x2:new ae(t),y2:new ae(e)})}R(Ae,"Fragment");var Ie={__proto__:null,from:Oe,to:ke};class Be extends we{constructor(t,e){super(L(t+"Gradient","string"===typeof t?null:t),e)}attr(t,e,i){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,i)}bbox(){return new Ft}targets(){return Ut("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"===typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}I(Be,Ie),r({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:B((function(t,e){return this.put(new Be(t)).update(e)}))}}),R(Be,"Gradient");class Fe extends we{constructor(t,e=t){super(L("pattern",t),e)}attr(t,e,i){return"transform"===t&&(t="patternTransform"),super.attr(t,e,i)}bbox(){return new Ft}targets(){return Ut("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"===typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}r({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:B((function(t,e,i){return this.put(new Fe).update(i).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),R(Fe,"Pattern");class Pe extends ve{constructor(t,e=t){super(L("image",t),e)}load(t,e){if(!t)return this;const i=new v.window.Image;return Jt(i,"load",(function(t){const n=this.parent(Fe);0===this.width()&&0===this.height()&&this.size(i.width,i.height),n instanceof Fe&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"===typeof e&&e.call(this,t)}),this),Jt(i,"load error",(function(){te(i)})),this.attr("href",i.src=t,w)}}de((function(t,e,i){return"fill"!==t&&"stroke"!==t||st.test(e)&&(e=i.root().defs().image(e)),e instanceof Pe&&(e=i.root().defs().pattern(0,0,t=>{t.add(e)})),e})),r({Container:{image:B((function(t,e){return this.put(new Pe).size(0,0).load(t,e)}))}}),R(Pe,"Image");class We extends se{bbox(){let t=-1/0,e=-1/0,i=1/0,n=1/0;return this.forEach((function(o){t=Math.max(o[0],t),e=Math.max(o[1],e),i=Math.min(o[0],i),n=Math.min(o[1],n)})),new Ft(i,n,t-i,e-n)}move(t,e){const i=this.bbox();if(t-=i.x,e-=i.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(at).map(parseFloat),t.length%2!==0&&t.pop();for(let i=0,n=t.length;i=0;i--)n.width&&(this[i][0]=(this[i][0]-n.x)*t/n.width+n.x),n.height&&(this[i][1]=(this[i][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,i=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,i,n){return function(o){return o<0?t>0?e/t*o:i>0?n/i*o:0:o>1?i<1?(1-n)/(1-i)*o+(n-i)/(1-i):t<1?(1-e)/(1-t)*o+(e-t)/(1-t):1:3*o*(1-o)**2*e+3*o**2*(1-o)*n+o**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let i=t;return"none"===e?--i:"both"===e&&++i,(n,o=!1)=>{let r=Math.floor(n*t);const s=n*r%1===0;return"start"!==e&&"both"!==e||++r,o&&s&&--r,n>=0&&r<0&&(r=0),n<=1&&r>i&&(r=i),r/i}}};class Ze{done(){return!1}}class Qe extends Ze{constructor(t=oe.ease){super(),this.ease=qe[t]||t}step(t,e,i){return"number"!==typeof t?i<1?t:e:t+(e-t)*this.ease(i)}}class Je extends Ze{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,i,n){return this.stepper(t,e,i,n)}}function ti(){const t=(this._duration||500)/1e3,e=this._overshoot||0,i=1e-10,n=Math.PI,o=Math.log(e/100+i),r=-o/Math.sqrt(n*n+o*o),s=3.9/(r*t);this.d=2*r*s,this.k=s*s}class ei extends Je{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,i,n){if("string"===typeof t)return t;if(n.done=i===1/0,i===1/0)return e;if(0===i)return t;i>100&&(i=16),i/=1e3;const o=n.velocity||0,r=-this.d*o-this.k*(t-e),s=t+o*i+r*i*i/2;return n.velocity=o+r*i,n.done=Math.abs(e-s)+Math.abs(o)<.002,n.done?e:s}}I(ei,{duration:Ke("_duration",ti),overshoot:Ke("_overshoot",ti)});class ii extends Je{constructor(t=.1,e=.01,i=0,n=1e3){super(),this.p(t).i(e).d(i).windup(n)}step(t,e,i,n){if("string"===typeof t)return t;if(n.done=i===1/0,i===1/0)return e;if(0===i)return t;const o=e-t;let r=(n.integral||0)+o*i;const s=(o-(n.error||0))/i,a=this._windup;return!1!==a&&(r=Math.max(-a,Math.min(r,a))),n.error=o,n.integral=r,n.done=Math.abs(o)<.001,n.done?e:t+(this.P*o+this.I*r+this.D*s)}}I(ii,{windup:Ke("_windup"),p:Ke("P"),i:Ke("I"),d:Ke("D")});const ni={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},oi={M:function(t,e,i){return e.x=i.x=t[0],e.y=i.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,i){return e.x=i.x,e.y=i.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ri="mlhvqtcsaz".split("");for(let An=0,On=ri.length;An=0;o--)n=this[o][0],"M"===n||"L"===n||"T"===n?(this[o][1]+=t,this[o][2]+=e):"H"===n?this[o][1]+=t:"V"===n?this[o][1]+=e:"C"===n||"S"===n||"Q"===n?(this[o][1]+=t,this[o][2]+=e,this[o][3]+=t,this[o][4]+=e,"C"===n&&(this[o][5]+=t,this[o][6]+=e)):"A"===n&&(this[o][6]+=t,this[o][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),fi(t)}size(t,e){const i=this.bbox();let n,o;for(i.width=0===i.width?1:i.width,i.height=0===i.height?1:i.height,n=this.length-1;n>=0;n--)o=this[n][0],"M"===o||"L"===o||"T"===o?(this[n][1]=(this[n][1]-i.x)*t/i.width+i.x,this[n][2]=(this[n][2]-i.y)*e/i.height+i.y):"H"===o?this[n][1]=(this[n][1]-i.x)*t/i.width+i.x:"V"===o?this[n][1]=(this[n][1]-i.y)*e/i.height+i.y:"C"===o||"S"===o||"Q"===o?(this[n][1]=(this[n][1]-i.x)*t/i.width+i.x,this[n][2]=(this[n][2]-i.y)*e/i.height+i.y,this[n][3]=(this[n][3]-i.x)*t/i.width+i.x,this[n][4]=(this[n][4]-i.y)*e/i.height+i.y,"C"===o&&(this[n][5]=(this[n][5]-i.x)*t/i.width+i.x,this[n][6]=(this[n][6]-i.y)*e/i.height+i.y)):"A"===o&&(this[n][1]=this[n][1]*t/i.width,this[n][2]=this[n][2]*e/i.height,this[n][6]=(this[n][6]-i.x)*t/i.width+i.x,this[n][7]=(this[n][7]-i.y)*e/i.height+i.y);return this}toString(){return pi(this)}}const mi=t=>{const e=typeof t;return"number"===e?ae:"string"===e?Lt.isColor(t)?Lt:at.test(t)?ht.test(t)?gi:se:q.test(t)?ae:xi:vi.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?se:"object"===e?Ci:xi};class bi{constructor(t){this._stepper=t||new Qe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){const t=this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0);return t}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(mi(t));let e=new this._type(t);return this._type===Lt&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Ci&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class xi{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class yi{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,yi.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}yi.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const wi=(t,e)=>t[0]e[0]?1:0;class Ci{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let i=0,n=e.length;it.concat(e),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;while(e.length){const i=e.shift(),n=e.shift(),o=e.shift(),r=e.splice(0,o);t[i]=new n(r)}return t}}const vi=[xi,yi,Ci];function _i(t=[]){vi.push(...[].concat(t))}function Mi(){I(vi,{to(t){return(new bi).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,i,n,o){const r=function(t,r){return n.step(t,e[r],i,o[r],o)};return this.fromArray(t.map(r))}})}class Ei extends ve{constructor(t,e=t){super(L("path",t),e)}array(){return this._array||(this._array=new gi(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"===typeof t?t:this._array=new gi(t))}size(t,e){const i=g(this,t,e);return this.attr("d",this.array().size(i.width,i.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ni(){return this._array||(this._array=new We(this.attr("points")))}function Ti(){return delete this._array,this}function Li(t,e){return this.attr("points",this.array().move(t,e))}function Si(t){return null==t?this.array():this.clear().attr("points","string"===typeof t?t:this._array=new We(t))}function Di(t,e){const i=g(this,t,e);return this.attr("points",this.array().size(i.width,i.height))}Ei.prototype.MorphArray=gi,r({Container:{path:B((function(t){return this.put(new Ei).plot(t||new gi)}))}}),R(Ei,"Path");var Ri={__proto__:null,array:Ni,clear:Ti,move:Li,plot:Si,size:Di};class zi extends ve{constructor(t,e=t){super(L("polygon",t),e)}}r({Container:{polygon:B((function(t){return this.put(new zi).plot(t||new We)}))}}),I(zi,Ye),I(zi,Ri),R(zi,"Polygon");class Ai extends ve{constructor(t,e=t){super(L("polyline",t),e)}}r({Container:{polyline:B((function(t){return this.put(new Ai).plot(t||new We)}))}}),I(Ai,Ye),I(Ai,Ri),R(Ai,"Polyline");class Oi extends ve{constructor(t,e=t){super(L("rect",t),e)}}I(Oi,{rx:_e,ry:Me}),r({Container:{rect:B((function(t,e){return this.put(new Oi).size(t,e)}))}}),R(Oi,"Rect");class ki{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e="undefined"!==typeof t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ii={nextDraw:null,frames:new ki,timeouts:new ki,immediates:new ki,timer:()=>v.window.performance||v.window.Date,transforms:[],frame(t){const e=Ii.frames.push({run:t});return null===Ii.nextDraw&&(Ii.nextDraw=v.window.requestAnimationFrame(Ii._draw)),e},timeout(t,e){e=e||0;const i=Ii.timer().now()+e,n=Ii.timeouts.push({run:t,time:i});return null===Ii.nextDraw&&(Ii.nextDraw=v.window.requestAnimationFrame(Ii._draw)),n},immediate(t){const e=Ii.immediates.push(t);return null===Ii.nextDraw&&(Ii.nextDraw=v.window.requestAnimationFrame(Ii._draw)),e},cancelFrame(t){null!=t&&Ii.frames.remove(t)},clearTimeout(t){null!=t&&Ii.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ii.immediates.remove(t)},_draw(t){let e=null;const i=Ii.timeouts.last();while(e=Ii.timeouts.shift())if(t>=e.time?e.run():Ii.timeouts.push(e),e===i)break;let n=null;const o=Ii.frames.last();while(n!==o&&(n=Ii.frames.shift()))n.run(t);let r=null;while(r=Ii.immediates.shift())r();Ii.nextDraw=Ii.timeouts.first()||Ii.frames.first()?v.window.requestAnimationFrame(Ii._draw):null}},Bi=function(t){const e=t.start,i=t.runner.duration(),n=e+i;return{start:e,duration:i,end:n,runner:t.runner}},Fi=function(){const t=v.window;return(t.performance||t.Date).now()};class Pi extends ie{constructor(t=Fi){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0,i=t?t.start:this._time;return i+e}getEndTimeOfTimeline(){const t=this._runners.map(t=>t.start+t.runner.duration());return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const i=Math.abs(e);return this.speed(t?-i:i)}schedule(t,e,i){if(null==t)return this._runners.map(Bi);let n=0;const o=this.getEndTime();if(e=e||0,null==i||"last"===i||"after"===i)n=o;else if("absolute"===i||"start"===i)n=e,e=0;else if("now"===i)n=this._time;else if("relative"===i){const i=this.getRunnerInfoById(t.id);i&&(n=i.start+e,e=0)}else{if("with-last"!==i)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo(),e=t?t.start:this._time;n=e}}t.unschedule(),t.timeline(this);const r=t.persist(),s={persist:null===r?this._persist:r,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort((t,e)=>t.start-e.start),this._runnerIds=this._runners.map(t=>t.runner.id),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ii.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ii.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let i=e-this._lastSourceTime;t&&(i=0);const n=this._speed*i+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let r=this._runners.length;r--;){const t=this._runners[r],e=t.runner,i=this._time-t.start;i<=0&&e.reset()}let o=!1;for(let r=0,s=this._runners.length;r0?this._continue():(this.pause(),this.fire("finished")),this}}r({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Pi,this._timeline):(this._timeline=t,this)}}});class Wi extends ie{constructor(t){super(),this.id=Wi.id++,t=null==t?oe.duration:t,t="function"===typeof t?new Je(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"===typeof t&&t,this._isDeclarative=t instanceof Je,this._stepper=this._isDeclarative?t:new Qe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new zt,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,i){let n=1,o=!1,r=0;return t=t||oe.duration,e=e||oe.delay,i=i||"last","object"!==typeof t||t instanceof Ze||(e=t.delay||e,i=t.when||i,o=t.swing||o,n=t.times||n,r=t.wait||r,t=t.duration||oe.duration),{duration:t,delay:e,swing:o,times:n,wait:r,when:i}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,i){const n=Wi.sanitise(t,e,i),o=new Wi(n.duration);return this._timeline&&o.timeline(this._timeline),this._element&&o.element(this._element),o.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new zt,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter(t=>!t.isTransform))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Qe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,i){return"object"===typeof t&&(e=t.swing,i=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=i||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),i=this._time-t*e,n=i/this._duration;return Math.min(t+n,this._times)}const i=Math.floor(t),n=t%1,o=e*i+this._duration*n;return this.time(o)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,i=this._duration,n=this._wait,o=this._times,r=this._swing,s=this._reverse;let a;if(null==t){const t=function(t){const e=r*Math.floor(t%(2*(n+i))/(n+i)),o=e&&!s||!e&&s,a=Math.pow(-1,o)*(t%(n+i))/i+o,h=Math.max(Math.min(a,1),0);return h},h=o*(n+i)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),o=this._lastTime<=0&&this._time>0,r=this._lastTime=n;this._lastTime=this._time,o&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!r&&this._time>=n,this._reseted=!1;let a=!1;return(i||s)&&(this._initialise(i),this.transforms=new zt,a=this._run(s?t:e),this.fire("step",this)),this.done=this.done||a&&s,r&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return"undefined"===typeof t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,i=this._queue.length;et.lmultiplyO(e),Gi=t=>t.transforms;function $i(){const t=this._transformationRunners.runners,e=t.map(Gi).reduce(ji,new zt);this.transform(e),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ui{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Hi).forEach(t=>t.clearTransformsFromQueue()),this}edit(t,e){const i=this.ids.indexOf(t+1);return this.ids.splice(i,1,t+1),this.runners.splice(i,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id).map(Gi).reduce(ji,new zt)},_addRunner(t){this._transformationRunners.add(t),Ii.cancelImmediate(this._frameId),this._frameId=Ii.immediate($i.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ui).add(new Hi(new zt(this))))}}});const Yi=(t,e)=>t.filter(t=>!e.includes(t));I(Wi,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,i){if("string"===typeof e)return this.styleAttr(t,{[e]:i});let n=e;if(this._tryRetarget(t,n))return this;let o=new bi(this._stepper).to(n),r=Object.keys(n);return this.queue((function(){o=o.from(this.element()[t](r))}),(function(e){return this.element()[t](o.at(e).valueOf()),o.done()}),(function(e){const i=Object.keys(e),s=Yi(i,r);if(s.length){const e=this.element()[t](s),i=new Ci(o.from()).valueOf();Object.assign(i,e),o.from(i)}const a=new Ci(o.to()).valueOf();Object.assign(a,e),o.to(a),r=i,n=e})),this._rememberMorpher(t,o),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let i=new bi(this._stepper).to(new ae(t));return this.queue((function(){i=i.from(this.element().zoom())}),(function(t){return this.element().zoom(i.at(t),e),i.done()}),(function(t,n){e=n,i.to(t)})),this._rememberMorpher("zoom",i),this},transform(t,e,i){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=zt.isMatrixLike(t);i=null!=t.affine?t.affine:null!=i?i:!n;const o=new bi(this._stepper).type(i?yi:zt);let r,s,a,h,d;function l(){s=s||this.element(),r=r||m(t,s),d=new zt(e?void 0:s),s._addRunner(this),e||s._clearTransformRunnersBefore(this)}function c(l){e||this.clearTransform();const{x:c,y:u}=new St(r).transform(s._currentTransform(this));let f=new zt({...t,origin:[c,u]}),p=this._isDeclarative&&a?a:d;if(i){f=f.decompose(c,u),p=p.decompose(c,u);const t=f.rotate,e=p.rotate,i=[t-360,t,t+360],n=i.map(t=>Math.abs(t-e)),o=Math.min(...n),r=n.indexOf(o);f.rotate=i[r]}e&&(n||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),o.from(p),o.to(f);const g=o.at(l);return h=g.rotate,a=new zt(g),this.addTransform(a),s._addRunner(this),o.done()}function u(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(r=m(e,s)),t={...e,origin:r}}return this.queue(l,c,u,!0),this._isDeclarative&&this._rememberMorpher("transform",o),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new ae(e),this._tryRetarget(t,e))return this;const i=new bi(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),i.from(n),i.to(n+e)}),(function(e){return this.element()[t](i.at(e)),i.done()}),(function(t){i.to(n+new ae(t))})),this._rememberMorpher(t,i),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const i=new bi(this._stepper).to(e);return this.queue((function(){i.from(this.element()[t]())}),(function(e){return this.element()[t](i.at(e)),i.done()})),this._rememberMorpher(t,i),this},_queueNumber(t,e){return this._queueObject(t,new ae(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let i;return t&&e||(i=this._element.bbox()),t||(t=i.width/i.height*e),e||(e=i.height/i.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,i,n){if(4===arguments.length)return this.plot([t,e,i,n]);if(this._tryRetarget("plot",t))return this;const o=new bi(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){o.from(this._element.array())}),(function(t){return this._element.plot(o.at(t)),o.done()})),this._rememberMorpher("plot",o),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,i,n){return this._queueObject("viewbox",new Ft(t,e,i,n))},update(t){return"object"!==typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),I(Wi,{rx:_e,ry:Me,from:Oe,to:ke}),R(Wi,"Runner");class Xi extends we{constructor(t,e=t){super(L("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new Ce):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof v.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:b,version:"1.1"}).attr("xmlns:xlink",w,y).attr("xmlns:svgjs",C,y):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,y).attr("xmlns:svgjs",null,y)}root(){return this.isRoot()?this:super.root()}}r({Container:{nested:B((function(){return this.put(new Xi)}))}}),R(Xi,"Svg",!0);class Vi extends we{constructor(t,e=t){super(L("symbol",t),e)}}function Ki(t){return!1===this._build&&this.clear(),this.node.appendChild(v.document.createTextNode(t)),this}function qi(){return this.node.getComputedTextLength()}function Zi(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Qi(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function Ji(t,e,i=this.bbox()){return this.x(t,i).y(e,i)}function tn(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function en(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nn(t,e,i=this.bbox()){return this.cx(t,i).cy(e,i)}function on(t){return this.attr("x",t)}function rn(t){return this.attr("y",t)}function sn(t,e){return this.ax(t).ay(e)}function an(t){return this._build=!!t,this}r({Container:{symbol:B((function(){return this.put(new Vi)}))}}),R(Vi,"Symbol");var hn={__proto__:null,plain:Ki,length:qi,x:Zi,y:Qi,move:Ji,cx:tn,cy:en,center:nn,ax:on,ay:rn,amove:sn,build:an};class dn extends ve{constructor(t,e=t){super(L("text",t),e),this.dom.leading=new ae(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new ae(t),this.rebuild())}rebuild(t){if("boolean"===typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const i=this.dom.leading;this.each((function(n){const o=v.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=i*new ae(o);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=r:(this.attr("dy",n?r+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new ae(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let i=0;t="";for(let n=0,o=e.length;n{let o;try{o=i.bbox()}catch(h){return}const r=new zt(i),s=r.translate(t,e).transform(r.inverse()),a=new St(o.x,o.y).transform(s);i.move(a.x,a.y)}),this}function gn(t){return this.dmove(t,0)}function mn(t){return this.dmove(0,t)}function bn(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function xn(t=0,e=0,i=this.bbox()){const n=t-i.x,o=e-i.y;return this.dmove(n,o)}function yn(t,e,i=this.bbox()){const n=g(this,t,e,i),o=n.width/i.width,r=n.height/i.height;return this.children().forEach((t,e)=>{const n=new St(i).transform(new zt(t).inverse());t.scale(o,r,n.x,n.y)}),this}function wn(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function Cn(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function vn(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}r({Container:{foreignObject:B((function(t,e){return this.put(new fn).size(t,e)}))}}),R(fn,"ForeignObject");var _n={__proto__:null,dmove:pn,dx:gn,dy:mn,height:bn,move:xn,size:yn,width:wn,x:Cn,y:vn};class Mn extends we{constructor(t,e=t){super(L("g",t),e)}}I(Mn,_n),r({Container:{group:B((function(){return this.put(new Mn)}))}}),R(Mn,"G");class En extends we{constructor(t,e=t){super(L("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}I(En,_n),r({Container:{link:B((function(t){return this.put(new En).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const i=e.index(t);return e.add(this,i),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new En,this.wrap(e)),"function"===typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),R(En,"A");class Nn extends we{constructor(t,e=t){super(L("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return Ut("svg [mask*="+this.id()+"]")}}r({Container:{mask:B((function(){return this.defs().put(new Nn)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nn?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),R(Nn,"Mask");class Tn extends ue{constructor(t,e=t){super(L("stop",t),e)}update(t){return("number"===typeof t||t instanceof ae)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new ae(t.offset)),this}}function Ln(t,e){if(!t)return"";if(!e)return t;let i=t+"{";for(const n in e)i+=f(n)+":"+e[n]+";";return i+="}",i}r({Gradient:{stop:function(t,e,i){return this.put(new Tn).update(t,e,i)}}}),R(Tn,"Stop");class Sn extends ue{constructor(t,e=t){super(L("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,i={}){return this.rule("@font-face",{fontFamily:t,src:e,...i})}rule(t,e){return this.addText(Ln(t,e))}}r("Dom",{style(t,e){return this.put(new Sn).rule(t,e)},fontface(t,e,i){return this.put(new Sn).font(t,e,i)}}),R(Sn,"Style");class Dn extends dn{constructor(t,e=t){super(L("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let i=null;return e&&(i=e.plot(t)),null==t?i:this}track(){return this.reference("href")}}r({Container:{textPath:B((function(t,e){return t instanceof dn||(t=this.text(t)),t.path(e)}))},Text:{path:B((function(t,e=!0){const i=new Dn;let n;if(t instanceof Ei||(t=this.defs().path(t)),i.attr("href","#"+t,w),e)while(n=this.node.firstChild)i.node.appendChild(n);return this.put(i)})),textPath(){return this.findOne("textPath")}},Path:{text:B((function(t){return t instanceof dn||(t=(new dn).addTo(this.parent()).text(t)),t.path(this)})),targets(){return Ut("svg textPath").filter(t=>(t.attr("href")||"").includes(this.id()))}}}),Dn.prototype.MorphArray=gi,R(Dn,"TextPath");class Rn extends ve{constructor(t,e=t){super(L("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}r({Container:{use:B((function(t,e){return this.put(new Rn).use(t,e)}))}}),R(Rn,"Use");const zn=T;I([Xi,Vi,Pe,Fe,Ve],s("viewbox")),I([Xe,Ai,zi,Ei],s("marker")),I(dn,s("Text")),I(Ei,s("Path")),I(Ce,s("Defs")),I([dn,ln],s("Tspan")),I([Oi,ze,Be,Wi],s("radius")),I(ie,s("EventTarget")),I(ce,s("Dom")),I(ue,s("Element")),I(ve,s("Shape")),I([we,Ae],s("Container")),I(Be,s("Gradient")),I(Wi,s("Runner")),Gt.extend(a()),_i([ae,Lt,Ft,zt,se,We,gi,St]),Mi()},"8b00":function(t,e,i){"use strict";var n=i("23e7"),o=i("68df"),r=i("dad2");n({target:"Set",proto:!0,real:!0,forced:!r("isSubsetOf")},{isSubsetOf:o})},"8d8b":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return n}));class n{static applyBehavior(t){t.nodeData.data.isFlowChart&&(t._isFlowChartNode=!0,t.freePosition=!0)}static isFlowChartNode(t){return t&&t.data&&!0===t.data.isFlowChart}static getFlowChartConfig(t){return this.isFlowChartNode(t)?t.data.flowchart||{}:null}static setFlowChartConfig(t,e){t.data||(t.data={}),t.data.isFlowChart=!0,t.data.flowchart={...t.data.flowchart,...e}}static convertToFlowChart(t,e={}){const i={nodeType:"process",showConnectors:!0,connectorPositions:["top","right","bottom","left"],preventOverlap:!0,hideExpandBtn:!0,hideAddBtn:!0};this.setFlowChartConfig(t,{...i,...e})}static convertToNormal(t){t.data&&(delete t.data.isFlowChart,delete t.data.flowchart)}}},"8e16":function(t,e,i){"use strict";var n=i("7282"),o=i("cb27");t.exports=n(o.proto,"size","get")||function(t){return t.size}},"91d2":function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,n,r){if("function"!==typeof i)throw new TypeError("The listener must be a function");var a=new s(i,n||t,r),h=o?o+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function d(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(o=!1)),d.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(o?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},d.prototype.listeners=function(t){var e=o?o+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,s=new Array(r);ni.size?h(i.getIterator(),(function(t){c(e,t)&&l(o,t)})):a(e,(function(t){i.includes(t)&&l(o,t)})),o}},9961:function(t,e,i){"use strict";var n=i("dc19"),o=i("cb27"),r=i("83b9"),s=i("7f65"),a=i("5388"),h=o.add,d=o.has,l=o.remove;t.exports=function(t){var e=n(this),i=s(t).getIterator(),o=r(e);return a(i,(function(t){d(e,t)?l(o,t):h(o,t)})),o}},a06c:function(t){t.exports=JSON.parse('{"name":"simple-mind-map","version":"0.13.1","description":"一个简单的web在线思维导图","authors":[{"name":"街角小林","email":"1013335014@qq.com"},{"name":"理想青年实验室","url":"http://lxqnsys.com/"}],"types":"./types/index.d.ts","typings":"./types/index.d.ts","license":"MIT","repository":{"type":"git","url":"https://github.com/wanglin2/mind-map"},"scripts":{"lint":"eslint src/","format":"prettier --write .","types":"npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types --target es2017 --skipLibCheck & node ./bin/createPluginsTypeFiles.js","wsServe":"node ./bin/wsServer.mjs"},"module":"index.js","main":"./dist/simpleMindMap.umd.min.js","dependencies":{"@svgdotjs/svg.js":"3.2.0","deepmerge":"^1.5.2","eventemitter3":"^4.0.7","jszip":"^3.10.1","katex":"^0.16.8","mdast-util-from-markdown":"^1.3.0","pdf-lib":"^1.17.1","quill":"^2.0.3","tern":"^0.24.3","uuid":"^9.0.0","ws":"^7.5.9","xml-js":"^1.6.11","y-webrtc":"^10.2.5","yjs":"^13.6.8"},"keywords":["javascript","svg","mind-map","mindMap","MindMap"],"devDependencies":{"eslint":"^8.25.0","prettier":"^2.7.1"},"volta":{"node":"18.20.4"}}')},a4e7:function(t,e,i){"use strict";var n=i("23e7"),o=i("395e"),r=i("dad2");n({target:"Set",proto:!0,real:!0,forced:!r("isSupersetOf")},{isSupersetOf:o})},a5f7:function(t,e,i){"use strict";var n=i("dc19"),o=i("cb27"),r=i("83b9"),s=i("8e16"),a=i("7f65"),h=i("384f"),d=i("5388"),l=o.has,c=o.remove;t.exports=function(t){var e=n(this),i=a(t),o=r(e);return s(e)<=i.size?h(e,(function(t){i.includes(t)&&c(o,t)})):d(i.getIterator(),(function(t){l(e,t)&&c(o,t)})),o}},a640:function(t,e,i){"use strict";var n=i("d039");t.exports=function(t,e){var i=[][t];return!!i&&n((function(){i.call(null,e||function(){return 1},1)}))}},b4bc:function(t,e,i){"use strict";var n=i("dc19"),o=i("cb27").has,r=i("8e16"),s=i("7f65"),a=i("384f"),h=i("5388"),d=i("2a62");t.exports=function(t){var e=n(this),i=s(t);if(r(e)<=i.size)return!1!==a(e,(function(t){if(i.includes(t))return!1}),!0);var l=i.getIterator();return!1!==h(l,(function(t){if(o(e,t))return d(l,"normal",!1)}))}},c01e:function(t,e,i){"use strict";i("a4e7")},c1a1:function(t,e,i){"use strict";var n=i("23e7"),o=i("b4bc"),r=i("dad2");n({target:"Set",proto:!0,real:!0,forced:!r("isDisjointFrom")},{isDisjointFrom:o})},cb27:function(t,e,i){"use strict";var n=i("e330"),o=Set.prototype;t.exports={Set:Set,add:n(o.add),has:n(o.has),remove:n(o["delete"]),proto:o}},d58f:function(t,e,i){"use strict";var n=i("59ed"),o=i("7b0b"),r=i("44ad"),s=i("07fa"),a=TypeError,h="Reduce of empty array with no initial value",d=function(t){return function(e,i,d,l){var c=o(e),u=r(c),f=s(c);if(n(i),0===f&&d<2)throw new a(h);var p=t?f-1:0,g=t?-1:1;if(d<2)while(1){if(p in u){l=u[p],p+=g;break}if(p+=g,t?p<0:f<=p)throw new a(h)}for(;t?p>=0:f>p;p+=g)p in u&&(l=i(l,u[p],p,c));return l}};t.exports={left:d(!1),right:d(!0)}},d6d6:function(t,e,i){"use strict";var n=TypeError;t.exports=function(t,e){if(t{if(!t)return"";const e=t.text||"";return t.richText?Object(n["lb"])(e):e},r=t=>new Array(t).fill(" ").join(""),s=t=>{const e=Object(n["mb"])(t).filter(t=>t&&t.data);let i="";return e.forEach((t,s)=>{Object(n["Db"])(t,null,(t,e,n,s)=>{if(!t||!t.data)return;i+=r(s),i+=" "+o(t.data);const a=t.data.generalization;Array.isArray(a)?i+=a.map(t=>` [${o(t)}]`):a&&a.text&&(i+=` [${o(a)}]`),i+="\n\n"},()=>{},!0),s{n[t]=e+65});const o=n},fa76:function(t,e,i){"use strict";i("1e5a")}}]);