mind-elixir 5.6.0 → 5.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var MindElixir=(function(){"use strict";const ve={name:"Latte",type:"light",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#4c4f69","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--main-bgcolor-transparent":"rgba(255, 255, 255, 0.8)","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#4dc4ff","--accent-color":"#e64553","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px"}},be={name:"Dark",type:"dark",palette:["#848FA0","#748BE9","#D2F9FE","#4145A5","#789AFA","#706CF4","#EF987F","#775DD5","#FCEECF","#DA7FBC"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#2d3748","--root-border-color":"rgba(255, 255, 255, 0.1)","--main-color":"#ffffff","--main-bgcolor":"#4c4f69","--main-bgcolor-transparent":"rgba(76, 79, 105, 0.8)","--topic-padding":"3px","--color":"#cccccc","--bgcolor":"#252526","--selected":"#4dc4ff","--accent-color":"#789AFA","--panel-color":"#ffffff","--panel-bgcolor":"#2d3748","--panel-border-color":"#696969","--map-padding":"50px 80px"}};function we(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const ie=function(e,t){if(t.id===e)return t;if(t.children&&t.children.length){for(let n=0;n<t.children.length;n++){const o=ie(e,t.children[n]);if(o)return o}return null}else return null},z=(e,t)=>{if(e.parent=t,e.children)for(let n=0;n<e.children.length;n++)z(e.children[n],e)},V=(e,t,n)=>{if(e.expanded=t,e.children)if(n===void 0||n>0){const o=n!==void 0?n-1:void 0;e.children.forEach(s=>{V(s,t,o)})}else e.children.forEach(o=>{V(o,!1)})};function xe(e){if(e.id=G(),e.children)for(let t=0;t<e.children.length;t++)xe(e.children[t])}function re(e,t,n,o){const s=n-e,i=o-t,r=Math.atan2(i,s)*180/Math.PI,c=12,a=30,d=(r+180-a)*Math.PI/180,h=(r+180+a)*Math.PI/180;return{x1:n+Math.cos(d)*c,y1:o+Math.sin(d)*c,x2:n+Math.cos(h)*c,y2:o+Math.sin(h)*c}}function G(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const vt=function(){const e=G();return{topic:this.newTopicName,id:e}};function Ce(e){return JSON.parse(JSON.stringify(e,(n,o)=>{if(n!=="parent")return o}))}const j=(e,t)=>{let n=0,o=0;for(;t&&t!==e;)n+=t.offsetLeft,o+=t.offsetTop,t=t.offsetParent;return{offsetLeft:n,offsetTop:o}},A=(e,t)=>{for(const n in t)e.setAttribute(n,t[n])},le=e=>e?e.tagName==="ME-TPC":!1,Ee=e=>e.filter(t=>t.nodeObj.parent).filter((t,n,o)=>{for(let s=0;s<o.length;s++){if(t===o[s])continue;const{parent:i}=t.nodeObj;if(i===o[s].nodeObj)return!1}return!0}),Se=e=>{const t=/translate3d\(([^,]+),\s*([^,]+)/,n=e.match(t);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},He=function(e){for(let t=0;t<e.length;t++){const{dom:n,evt:o,func:s}=e[t];n.addEventListener(o,s)}return function(){for(let n=0;n<e.length;n++){const{dom:o,evt:s,func:i}=e[n];o.removeEventListener(s,i)}}},Re=(e,t)=>{const n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)},B={LHS:"lhs",RHS:"rhs"},bt=e=>{const t=e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},wt=e=>{const t=e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},xt=e=>{e.selectNode(e.map.querySelector("me-root>me-tpc"))},Ct=function(e,t){const n=t.parentElement.parentElement.parentElement.previousSibling;if(n){const o=n.firstChild;e.selectNode(o)}},Et=function(e,t){const n=t.parentElement.nextSibling;if(n&&n.firstChild){const o=n.firstChild.firstChild.firstChild;e.selectNode(o)}},Be=function(e,t){const n=e.currentNode||e.currentNodes?.[0];if(!n)return;const o=n.nodeObj,s=n.offsetParent.offsetParent.parentElement;o.parent?s.className===t?Et(e,n):o.parent?.parent?Ct(e,n):xt(e):t===B.LHS?bt(e):wt(e)},Ie=function(e,t){const n=e.currentNode;if(!n||!n.nodeObj.parent)return;const s=t+"Sibling",i=n.parentElement.parentElement[s];i?e.selectNode(i.firstChild.firstChild):e.selectNode(n)},U=function(e,t,n){const{scaleVal:o,scaleSensitivity:s}=e;switch(t){case"in":e.scale(o+s,n);break;case"out":e.scale(o-s,n)}};function St(e,t){t=t===!0?{}:t;const n=()=>{e.currentArrow?e.removeArrow():e.currentSummary?e.removeSummary(e.currentSummary.summaryObj.id):e.currentNodes&&e.removeNodes(e.currentNodes)};let o=!1,s=null;const i=r=>{const c=e.nodeData;if(r.key==="0")for(const a of c.children)V(a,!1);if(r.key==="=")for(const a of c.children)V(a,!0);if(["1","2","3","4","5","6","7","8","9"].includes(r.key))for(const a of c.children)V(a,!0,Number(r.key)-1);e.refresh(),e.toCenter(),o=!1,s&&(clearTimeout(s),s=null,e.container.removeEventListener("keydown",i))},l={Enter:r=>{r.shiftKey?e.insertSibling("before"):r.ctrlKey||r.metaKey?e.insertParent():e.insertSibling("after")},Tab:()=>{e.addChild()},F1:()=>{e.toCenter()},F2:()=>{e.currentSummary?e.editSummary(e.currentSummary):e.currentArrow?e.editArrowLabel(e.currentArrow):e.beginEdit()},ArrowUp:r=>{if(r.altKey)e.moveUpNode();else{if(r.metaKey||r.ctrlKey)return e.initSide();Ie(e,"previous")}},ArrowDown:r=>{r.altKey?e.moveDownNode():Ie(e,"next")},ArrowLeft:r=>{if(r.metaKey||r.ctrlKey)return e.initLeft();Be(e,B.LHS)},ArrowRight:r=>{if(r.metaKey||r.ctrlKey)return e.initRight();Be(e,B.RHS)},PageUp:()=>e.moveUpNode(),PageDown:()=>{e.moveDownNode()},c:r=>{(r.metaKey||r.ctrlKey)&&(e.waitCopy=e.currentNodes)},x:r=>{(r.metaKey||r.ctrlKey)&&(e.waitCopy=e.currentNodes,n())},v:r=>{!e.waitCopy||!e.currentNode||(r.metaKey||r.ctrlKey)&&(e.waitCopy.length===1?e.copyNode(e.waitCopy[0],e.currentNode):e.copyNodes(e.waitCopy,e.currentNode))},"=":r=>{(r.metaKey||r.ctrlKey)&&U(e,"in")},"-":r=>{(r.metaKey||r.ctrlKey)&&U(e,"out")},0:r=>{if(r.metaKey||r.ctrlKey){if(o)return;e.scale(1)}},k:r=>{(r.metaKey||r.ctrlKey)&&(o=!0,s&&(clearTimeout(s),e.container.removeEventListener("keydown",i)),s=window.setTimeout(()=>{o=!1,s=null},2e3),e.container.addEventListener("keydown",i))},Delete:n,Backspace:n,...t};e.container.onkeydown=r=>{if(r.preventDefault(),!e.editable)return;const c=l[r.key];c&&c(r)}}const Ne=document,Nt=function(e,t){if(!t)return ce(e),e;let n=e.querySelector(".insert-preview");const o=`insert-preview ${t} show`;return n||(n=Ne.createElement("div"),e.appendChild(n)),n.className=o,e},ce=function(e){if(!e)return;const t=e.querySelectorAll(".insert-preview");for(const n of t||[])n.remove()},Fe=function(e,t){for(const n of t){const o=n.parentElement.parentElement.contains(e);if(!(e&&e.tagName==="ME-TPC"&&e!==n&&!o&&e.nodeObj.parent))return!1}return!0},kt=function(e){const t=document.createElement("div");return t.className="mind-elixir-ghost",e.container.appendChild(t),t};class Tt{mind;isMoving=!1;interval=null;speed=20;constructor(t){this.mind=t}move(t,n){this.isMoving||(this.isMoving=!0,this.interval=setInterval(()=>{this.mind.move(t*this.speed*this.mind.scaleVal,n*this.speed*this.mind.scaleVal)},100))}stop(){this.isMoving=!1,this.interval&&(clearInterval(this.interval),this.interval=null)}}function _t(e){return{isDragging:!1,insertType:null,meet:null,ghost:kt(e),edgeMoveController:new Tt(e),startX:0,startY:0,pointerId:null}}const Lt=5;function Ye(e,t,n,o=!1){if(e.spacePressed)return!1;const s=n.target;if(s?.tagName!=="ME-TPC"||!s.nodeObj.parent)return!1;t.startX=n.clientX,t.startY=n.clientY,t.pointerId=n.pointerId,e.selection.cancel();let i=e.currentNodes;return i?.includes(s)||(e.selectNode(s),i=e.currentNodes),e.dragged=i,o&&Xe(e,t),!0}function We(e,t,n){e.style.transform=`translate(${t+10}px, ${n+10}px)`,e.style.display="block"}function Xe(e,t){const{dragged:n}=e;if(!n)return;const o=document.activeElement;o&&o.isContentEditable&&o.blur(),t.isDragging=!0,n.length>1?t.ghost.innerHTML=n.length+"":t.ghost.innerHTML=n[0].innerHTML;for(const s of n)s.parentElement.parentElement.style.opacity="0.5";e.dragMoveHelper.clear()}function At(e,t,n){const{dragged:o}=e;if(!o||t.pointerId!==n.pointerId)return;const s=n.clientX-t.startX,i=n.clientY-t.startY,l=Math.sqrt(s*s+i*i);if(!t.isDragging&&l>Lt&&Xe(e,t),!t.isDragging)return;We(t.ghost,n.clientX,n.clientY);const r=e.container.getBoundingClientRect();n.clientX<r.x+50?t.edgeMoveController.move(1,0):n.clientX>r.x+r.width-50?t.edgeMoveController.move(-1,0):n.clientY<r.y+50?t.edgeMoveController.move(0,1):n.clientY>r.y+r.height-50?t.edgeMoveController.move(0,-1):t.edgeMoveController.stop(),ce(t.meet);const c=12*e.scaleVal,a=Ne.elementFromPoint(n.clientX,n.clientY-c);if(Fe(a,o)){t.meet=a;const d=a.getBoundingClientRect(),h=d.y;n.clientY>h+d.height?t.insertType="after":t.insertType="in"}else{const d=Ne.elementFromPoint(n.clientX,n.clientY+c);if(Fe(d,o)){t.meet=d;const u=d.getBoundingClientRect().y;n.clientY<u?t.insertType="before":t.insertType="in"}else t.insertType=null,t.meet=null}t.meet&&Nt(t.meet,t.insertType)}function Mt(e,t,n){const{dragged:o}=e;if(!(!o||t.pointerId!==n.pointerId)){t.edgeMoveController.stop();for(const s of o)s.parentElement.parentElement.style.opacity="1";t.ghost.style.display="none",t.ghost.innerHTML="",t.isDragging&&t.meet&&(ce(t.meet),t.insertType==="before"?e.moveNodeBefore(o,t.meet):t.insertType==="after"?e.moveNodeAfter(o,t.meet):t.insertType==="in"&&e.moveNodeIn(o,t.meet)),e.dragged=null,t.isDragging=!1,t.insertType=null,t.meet=null,t.pointerId=null}}function ke(e,t){const{dragged:n}=e;if(n){t.edgeMoveController.stop();for(const o of n)o.parentElement.parentElement.style.opacity="1";t.meet&&ce(t.meet),t.ghost.style.display="none",t.ghost.innerHTML="",e.dragged=null,t.isDragging=!1,t.insertType=null,t.meet=null,t.pointerId=null}}function Dt(e){return()=>{}}function Pt(e){const{dragMoveHelper:t}=e;let n=0;e.spacePressed=!1;let o=null;const s=new Map,i=e.draggable?_t(e):null;let l=null,r=null,c=null,a=null;const d=500,h=10,u=()=>{l!==null&&(clearTimeout(l),l=null,r=null,c=null,a=null)},y=(f,w)=>{f.hasPointerCapture&&f.hasPointerCapture(w)&&f.releasePointerCapture(w)},v=(f,w)=>{const k=f.closest(".svg-label");if(k){const M=k.dataset.svgId,ye=k.dataset.type,se=document.getElementById(M);if(se){if(ye==="arrow")return w?e.editArrowLabel(se):e.selectArrow(se),!0;if(ye==="summary")return w?e.editSummary(se):e.selectSummary(se),!0}}if(f.closest(".topiclinks")){const M=f.closest("g");if(M)return w?e.editArrowLabel(M):e.selectArrow(M),!0}if(f.closest(".summary")){const M=f.closest("g");if(M)return w?e.editSummary(M):e.selectSummary(M),!0}return!1},p=f=>{if(f.button!==0)return;if(e.helper1?.moved){e.helper1.clear();return}if(e.helper2?.moved){e.helper2.clear();return}if(t.moved){t.clear();return}if(i?.isDragging)return;const w=f.target;if(w.tagName==="ME-EPD")f.ctrlKey||f.metaKey?e.expandNodeAll(w.previousSibling):e.expandNode(w.previousSibling);else if(w.tagName==="ME-TPC"&&e.currentNodes.length>1)e.selectNode(w);else if(!e.editable)return;v(w,!1)},g=f=>{if(!e.editable)return;const w=f.target;le(w)&&e.beginEdit(w),v(w,!0)},m=f=>{if(f.pointerType==="mouse"||s.size>1)return;const w=new Date().getTime(),k=w-n;k<300&&k>0&&g(f),n=w},b=f=>{f.code==="Space"&&(e.spacePressed=!0,e.container.classList.add("space-pressed"))},x=f=>{f.code==="Space"&&(e.spacePressed=!1,e.container.classList.remove("space-pressed"))},L=f=>{if(f.pointerType==="touch"&&(s.set(f.pointerId,{x:f.clientX,y:f.clientY}),s.size===2)){const[M,ye]=Array.from(s.values());o=Re(M,ye),u()}t.moved=!1;const w=f.target,k=e.mouseSelectionButton===0?2:0;if(i&&(f.button===0||f.pointerType==="touch")){if(f.pointerType==="touch"&&s.size>1)(i.isDragging||i.pointerId!==null)&&ke(e,i);else if(f.pointerType==="touch"&&s.size===1)(le(w)||w.closest("me-tpc"))&&(r={x:f.clientX,y:f.clientY},c=w,a=f.pointerId,l=window.setTimeout(()=>{Ye(e,i,f,!0)&&(c&&c.setPointerCapture(f.pointerId),We(i.ghost,f.clientX,f.clientY)),l=null,r=null,c=null,a=null},d));else if(f.pointerType==="mouse"&&Ye(e,i,f,!1)){w.setPointerCapture(f.pointerId);return}}const $=e.spacePressed&&f.button===0&&f.pointerType==="mouse",X=f.button===k&&f.pointerType==="mouse"||f.pointerType==="touch";!$&&!X||(t.x=f.clientX,t.y=f.clientY,w.className!=="circle"&&w.contentEditable!=="plaintext-only"&&(t.mousedown=!0,w.setPointerCapture(f.pointerId)))},T=f=>{if(f.pointerType==="touch"&&s.has(f.pointerId)){if(s.set(f.pointerId,{x:f.clientX,y:f.clientY}),l!==null&&r!==null&&f.pointerId===a){const w=f.clientX-r.x,k=f.clientY-r.y;Math.sqrt(w*w+k*k)>h&&u()}if(s.size>=2){const[w,k]=Array.from(s.values()),$=Re(w,k);if(o==null)o=$;else{const X=$-o;Math.abs(X)>8&&(X>0?U(e,"in",{x:(w.x+k.x)/2,y:(w.y+k.y)/2}):U(e,"out",{x:(w.x+k.x)/2,y:(w.y+k.y)/2}),o=$)}return}}if(!(i&&i.pointerId!==null&&(At(e,i,f),i.isDragging))){if(f.target.contentEditable!=="plaintext-only"||e.spacePressed&&t.mousedown){const w=f.clientX-t.x,k=f.clientY-t.y;t.onMove(w,k)}t.x=f.clientX,t.y=f.clientY}},E=f=>{if(f.pointerType==="touch"&&(s.delete(f.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId!==null){const w=i.isDragging;if(Mt(e,i,f),y(f.target,f.pointerId),w)return}t.mousedown&&(y(f.target,f.pointerId),t.clear())},C=()=>{u(),t.mousedown&&t.clear(),i&&(i.isDragging||i.pointerId!==null)&&ke(e,i)},S=f=>{f.pointerType==="touch"&&(s.delete(f.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId===f.pointerId&&ke(e,i),E(f)},N=f=>{if(f.preventDefault(),f.button!==2||!e.editable)return;const w=f.target;le(w)&&!w.classList.contains("selected")&&e.selectNode(w),setTimeout(()=>{e.dragMoveHelper.moved||e.bus.fire("showContextMenu",f)},200)},O=f=>{f.stopPropagation(),f.preventDefault(),f.ctrlKey||f.metaKey?f.deltaY<0?U(e,"in",e.dragMoveHelper):e.scaleVal-e.scaleSensitivity>0&&U(e,"out",e.dragMoveHelper):f.shiftKey?e.move(-f.deltaY,0):e.move(-f.deltaX,-f.deltaY)},{container:_}=e;return He([{dom:_,evt:"pointerdown",func:L},{dom:_,evt:"pointermove",func:T},{dom:_,evt:"pointerup",func:E},{dom:_,evt:"pointercancel",func:S},{dom:_,evt:"pointerdown",func:m},{dom:_,evt:"click",func:p},{dom:_,evt:"dblclick",func:g},{dom:_,evt:"contextmenu",func:N},{dom:_,evt:"wheel",func:typeof e.handleWheel=="function"?e.handleWheel:O},{dom:_,evt:"blur",func:C},{dom:_,evt:"keydown",func:b},{dom:_,evt:"keyup",func:x}])}function Ot(){return{handlers:{},addListener:function(e,t){this.handlers[e]===void 0&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e,...t){if(this.handlers[e]instanceof Array){const n=this.handlers[e];for(let o=0;o<n.length;o++)n[o](...t)}},removeListener:function(e,t){if(!this.handlers[e])return;const n=this.handlers[e];if(!t)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===t&&this.handlers[e].splice(o,1)}}}const ae=document,$t=function(){this.nodes.innerHTML="";const e=this.createTopic(this.nodeData);Te.call(this,e,this.nodeData),e.draggable=!1;const t=ae.createElement("me-root");t.appendChild(e);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}jt(this,n,t)},jt=function(e,t,n){const o=ae.createElement("me-main");o.className=B.LHS;const s=ae.createElement("me-main");s.className=B.RHS;for(let i=0;i<t.length;i++){const l=t[i],{grp:r}=e.createWrapper(l);e.direction===2?l.direction===0?o.appendChild(r):s.appendChild(r):e.direction===0?o.appendChild(r):s.appendChild(r)}e.nodes.appendChild(o),e.nodes.appendChild(n),e.nodes.appendChild(s),e.nodes.appendChild(e.lines),e.nodes.appendChild(e.labelContainer)},Ht=function(e,t){const n=ae.createElement("me-children");for(let o=0;o<t.length;o++){const s=t[o],{grp:i}=e.createWrapper(s);n.appendChild(i)}return n},D=document,ze=function(e,t){const o=(this?.el?this.el:t||document).querySelector(`[data-nodeid="me${e}"]`);if(!o)throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);return o},Te=function(e,t){if(e.innerHTML="",t.style){const n=t.style;for(const o in n)e.style[o]=n[o]}if(t.dangerouslySetInnerHTML){e.innerHTML=t.dangerouslySetInnerHTML;return}if(t.image){const n=t.image;if(n.url&&n.width&&n.height){const o=D.createElement("img");o.src=this.imageProxy?this.imageProxy(n.url):n.url,o.style.width=n.width+"px",o.style.height=n.height+"px",n.fit&&(o.style.objectFit=n.fit),e.appendChild(o),e.image=o}}else e.image&&(e.image=void 0);{const n=D.createElement("span");n.className="text",this.markdown?n.innerHTML=this.markdown(t.topic,t):n.textContent=t.topic,e.appendChild(n),e.text=n}if(t.hyperLink){const n=D.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=t.hyperLink,e.appendChild(n),e.link=n}else e.link&&(e.link=void 0);if(t.icons&&t.icons.length){const n=D.createElement("span");n.className="icons",n.innerHTML=t.icons.map(o=>`<span>${we(o)}</span>`).join(""),e.appendChild(n),e.icons=n}else e.icons&&(e.icons=void 0);if(t.tags&&t.tags.length){const n=D.createElement("div");n.className="tags",t.tags.forEach(o=>{const s=D.createElement("span");typeof o=="string"?s.textContent=o:(s.textContent=o.text,o.className&&(s.className=o.className),o.style&&Object.assign(s.style,o.style)),n.appendChild(s)}),e.appendChild(n),e.tags=n}else e.tags&&(e.tags=void 0)},Rt=function(e,t){const n=D.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(e);if(n.appendChild(o),!t&&e.children&&e.children.length>0){const i=_e(e.expanded);if(o.appendChild(i),e.expanded!==!1){const l=Ht(this,e.children);n.appendChild(l)}}return{grp:n,top:o,tpc:s}},Bt=function(e){const t=D.createElement("me-parent"),n=this.createTopic(e);return Te.call(this,n,e),t.appendChild(n),{p:t,tpc:n}},It=function(e){const t=D.createElement("me-children");return t.append(...e),t},Ft=function(e){const t=D.createElement("me-tpc");return t.nodeObj=e,t.dataset.nodeid="me"+e.id,t};function Ge(e){const t=D.createRange();t.selectNodeContents(e);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}const Yt=function(e){if(!e)return;const t=D.createElement("div"),n=e.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=j(this.nodes,e);this.nodes.appendChild(t),t.id="input-box",t.textContent=o,t.contentEditable="plaintext-only",t.spellcheck=!1;const l=getComputedStyle(e);t.style.cssText=`
1
+ var MindElixir=(function(Y){"use strict";const re={name:"Latte",type:"light",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#4c4f69","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--main-bgcolor-transparent":"rgba(255, 255, 255, 0.8)","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#4dc4ff","--accent-color":"#e64553","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px 80px"}},le={name:"Dark",type:"dark",palette:["#848FA0","#748BE9","#D2F9FE","#4145A5","#789AFA","#706CF4","#EF987F","#775DD5","#FCEECF","#DA7FBC"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#2d3748","--root-border-color":"rgba(255, 255, 255, 0.1)","--main-color":"#ffffff","--main-bgcolor":"#4c4f69","--main-bgcolor-transparent":"rgba(76, 79, 105, 0.8)","--topic-padding":"3px","--color":"#cccccc","--bgcolor":"#252526","--selected":"#4dc4ff","--accent-color":"#789AFA","--panel-color":"#ffffff","--panel-bgcolor":"#2d3748","--panel-border-color":"#696969","--map-padding":"50px 80px"}};function xe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const ce=function(e,t){if(t.id===e)return t;if(t.children&&t.children.length){for(let n=0;n<t.children.length;n++){const o=ce(e,t.children[n]);if(o)return o}return null}else return null},G=(e,t)=>{if(e.parent=t,e.children)for(let n=0;n<e.children.length;n++)G(e.children[n],e)},U=(e,t,n)=>{if(e.expanded=t,e.children)if(n===void 0||n>0){const o=n!==void 0?n-1:void 0;e.children.forEach(s=>{U(s,t,o)})}else e.children.forEach(o=>{U(o,!1)})};function Ce(e){if(e.id=K(),e.children)for(let t=0;t<e.children.length;t++)Ce(e.children[t])}function ae(e,t,n,o){const s=n-e,i=o-t,r=Math.atan2(i,s)*180/Math.PI,c=12,a=30,d=(r+180-a)*Math.PI/180,h=(r+180+a)*Math.PI/180;return{x1:n+Math.cos(d)*c,y1:o+Math.sin(d)*c,x2:n+Math.cos(h)*c,y2:o+Math.sin(h)*c}}function K(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const bt=function(){const e=K();return{topic:this.newTopicName,id:e}};function Ee(e){return JSON.parse(JSON.stringify(e,(n,o)=>{if(n!=="parent")return o}))}const j=(e,t)=>{let n=0,o=0;for(;t&&t!==e;)n+=t.offsetLeft,o+=t.offsetTop,t=t.offsetParent;return{offsetLeft:n,offsetTop:o}},A=(e,t)=>{for(const n in t)e.setAttribute(n,t[n])},de=e=>e?e.tagName==="ME-TPC":!1,Se=e=>e.filter(t=>t.nodeObj.parent).filter((t,n,o)=>{for(let s=0;s<o.length;s++){if(t===o[s])continue;const{parent:i}=t.nodeObj;if(i===o[s].nodeObj)return!1}return!0}),Ne=e=>{const t=/translate3d\(([^,]+),\s*([^,]+)/,n=e.match(t);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},Re=function(e){for(let t=0;t<e.length;t++){const{dom:n,evt:o,func:s}=e[t];n.addEventListener(o,s)}return function(){for(let n=0;n<e.length;n++){const{dom:o,evt:s,func:i}=e[n];o.removeEventListener(s,i)}}},Ie=(e,t)=>{const n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)},I={LHS:"lhs",RHS:"rhs"},wt=e=>{const t=e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},xt=e=>{const t=e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},Ct=e=>{e.selectNode(e.map.querySelector("me-root>me-tpc"))},Et=function(e,t){const n=t.parentElement.parentElement.parentElement.previousSibling;if(n){const o=n.firstChild;e.selectNode(o)}},St=function(e,t){const n=t.parentElement.nextSibling;if(n&&n.firstChild){const o=n.firstChild.firstChild.firstChild;e.selectNode(o)}},Be=function(e,t){const n=e.currentNode||e.currentNodes?.[0];if(!n)return;const o=n.nodeObj,s=n.offsetParent.offsetParent.parentElement;o.parent?s.className===t?St(e,n):o.parent?.parent?Et(e,n):Ct(e):t===I.LHS?wt(e):xt(e)},Fe=function(e,t){const n=e.currentNode;if(!n||!n.nodeObj.parent)return;const s=t+"Sibling",i=n.parentElement.parentElement[s];i?e.selectNode(i.firstChild.firstChild):e.selectNode(n)},J=function(e,t,n){const{scaleVal:o,scaleSensitivity:s}=e;switch(t){case"in":e.scale(o+s,n);break;case"out":e.scale(o-s,n)}};function Nt(e,t){t=t===!0?{}:t;const n=()=>{e.currentArrow?e.removeArrow():e.currentSummary?e.removeSummary(e.currentSummary.summaryObj.id):e.currentNodes&&e.removeNodes(e.currentNodes)};let o=!1,s=null;const i=r=>{const c=e.nodeData;if(r.key==="0")for(const a of c.children)U(a,!1);if(r.key==="=")for(const a of c.children)U(a,!0);if(["1","2","3","4","5","6","7","8","9"].includes(r.key))for(const a of c.children)U(a,!0,Number(r.key)-1);e.refresh(),e.toCenter(),o=!1,s&&(clearTimeout(s),s=null,e.container.removeEventListener("keydown",i))},l={Enter:r=>{r.shiftKey?e.insertSibling("before"):r.ctrlKey||r.metaKey?e.insertParent():e.insertSibling("after")},Tab:()=>{e.addChild()},F1:()=>{e.toCenter()},F2:()=>{e.currentSummary?e.editSummary(e.currentSummary):e.currentArrow?e.editArrowLabel(e.currentArrow):e.beginEdit()},ArrowUp:r=>{if(r.altKey)e.moveUpNode();else{if(r.metaKey||r.ctrlKey)return e.initSide();Fe(e,"previous")}},ArrowDown:r=>{r.altKey?e.moveDownNode():Fe(e,"next")},ArrowLeft:r=>{if(r.metaKey||r.ctrlKey)return e.initLeft();Be(e,I.LHS)},ArrowRight:r=>{if(r.metaKey||r.ctrlKey)return e.initRight();Be(e,I.RHS)},PageUp:()=>e.moveUpNode(),PageDown:()=>{e.moveDownNode()},c:r=>{(r.metaKey||r.ctrlKey)&&(e.waitCopy=e.currentNodes)},x:r=>{(r.metaKey||r.ctrlKey)&&(e.waitCopy=e.currentNodes,n())},v:r=>{!e.waitCopy||!e.currentNode||(r.metaKey||r.ctrlKey)&&(e.waitCopy.length===1?e.copyNode(e.waitCopy[0],e.currentNode):e.copyNodes(e.waitCopy,e.currentNode))},"=":r=>{(r.metaKey||r.ctrlKey)&&J(e,"in")},"-":r=>{(r.metaKey||r.ctrlKey)&&J(e,"out")},0:r=>{if(r.metaKey||r.ctrlKey){if(o)return;e.scale(1)}},k:r=>{(r.metaKey||r.ctrlKey)&&(o=!0,s&&(clearTimeout(s),e.container.removeEventListener("keydown",i)),s=window.setTimeout(()=>{o=!1,s=null},2e3),e.container.addEventListener("keydown",i))},Delete:n,Backspace:n,...t};e.container.onkeydown=r=>{if(r.preventDefault(),!e.editable)return;const c=l[r.key];c&&c(r)}}const Te=document,Tt=function(e,t){if(!t)return he(e),e;let n=e.querySelector(".insert-preview");const o=`insert-preview ${t} show`;return n||(n=Te.createElement("div"),e.appendChild(n)),n.className=o,e},he=function(e){if(!e)return;const t=e.querySelectorAll(".insert-preview");for(const n of t||[])n.remove()},Ye=function(e,t){for(const n of t){const o=n.parentElement.parentElement.contains(e);if(!(e&&e.tagName==="ME-TPC"&&e!==n&&!o&&e.nodeObj.parent))return!1}return!0},kt=function(e){const t=document.createElement("div");return t.className="mind-elixir-ghost",e.container.appendChild(t),t};class _t{mind;isMoving=!1;interval=null;speed=20;constructor(t){this.mind=t}move(t,n){this.isMoving||(this.isMoving=!0,this.interval=setInterval(()=>{this.mind.move(t*this.speed*this.mind.scaleVal,n*this.speed*this.mind.scaleVal)},100))}stop(){this.isMoving=!1,this.interval&&(clearInterval(this.interval),this.interval=null)}}function Lt(e){return{isDragging:!1,insertType:null,meet:null,ghost:kt(e),edgeMoveController:new _t(e),startX:0,startY:0,pointerId:null}}const At=5;function We(e,t,n,o=!1){if(e.spacePressed)return!1;const s=n.target;if(s?.tagName!=="ME-TPC"||!s.nodeObj.parent)return!1;t.startX=n.clientX,t.startY=n.clientY,t.pointerId=n.pointerId,e.selection.cancel();let i=e.currentNodes;return i?.includes(s)||(e.selectNode(s),i=e.currentNodes),e.dragged=i,o&&ze(e,t),!0}function Xe(e,t,n){e.style.transform=`translate(${t+10}px, ${n+10}px)`,e.style.display="block"}function ze(e,t){const{dragged:n}=e;if(!n)return;const o=document.activeElement;o&&o.isContentEditable&&o.blur(),t.isDragging=!0,n.length>1?t.ghost.innerHTML=n.length+"":t.ghost.innerHTML=n[0].innerHTML;for(const s of n)s.parentElement.parentElement.style.opacity="0.5";e.dragMoveHelper.clear()}function Mt(e,t,n){const{dragged:o}=e;if(!o||t.pointerId!==n.pointerId)return;const s=n.clientX-t.startX,i=n.clientY-t.startY,l=Math.sqrt(s*s+i*i);if(!t.isDragging&&l>At&&ze(e,t),!t.isDragging)return;Xe(t.ghost,n.clientX,n.clientY);const r=e.container.getBoundingClientRect();n.clientX<r.x+50?t.edgeMoveController.move(1,0):n.clientX>r.x+r.width-50?t.edgeMoveController.move(-1,0):n.clientY<r.y+50?t.edgeMoveController.move(0,1):n.clientY>r.y+r.height-50?t.edgeMoveController.move(0,-1):t.edgeMoveController.stop(),he(t.meet);const c=12*e.scaleVal,a=Te.elementFromPoint(n.clientX,n.clientY-c);if(Ye(a,o)){t.meet=a;const d=a.getBoundingClientRect(),h=d.y;n.clientY>h+d.height?t.insertType="after":t.insertType="in"}else{const d=Te.elementFromPoint(n.clientX,n.clientY+c);if(Ye(d,o)){t.meet=d;const u=d.getBoundingClientRect().y;n.clientY<u?t.insertType="before":t.insertType="in"}else t.insertType=null,t.meet=null}t.meet&&Tt(t.meet,t.insertType)}function Dt(e,t,n){const{dragged:o}=e;if(!(!o||t.pointerId!==n.pointerId)){t.edgeMoveController.stop();for(const s of o)s.parentElement.parentElement.style.opacity="1";t.ghost.style.display="none",t.ghost.innerHTML="",t.isDragging&&t.meet&&(he(t.meet),t.insertType==="before"?e.moveNodeBefore(o,t.meet):t.insertType==="after"?e.moveNodeAfter(o,t.meet):t.insertType==="in"&&e.moveNodeIn(o,t.meet)),e.dragged=null,t.isDragging=!1,t.insertType=null,t.meet=null,t.pointerId=null}}function ke(e,t){const{dragged:n}=e;if(n){t.edgeMoveController.stop();for(const o of n)o.parentElement.parentElement.style.opacity="1";t.meet&&he(t.meet),t.ghost.style.display="none",t.ghost.innerHTML="",e.dragged=null,t.isDragging=!1,t.insertType=null,t.meet=null,t.pointerId=null}}function Pt(e){return()=>{}}function Ot(e){const{dragMoveHelper:t}=e;let n=0;e.spacePressed=!1;let o=null;const s=new Map,i=e.draggable?Lt(e):null;let l=null,r=null,c=null,a=null;const d=500,h=10,u=()=>{l!==null&&(clearTimeout(l),l=null,r=null,c=null,a=null)},y=(f,w)=>{f.hasPointerCapture&&f.hasPointerCapture(w)&&f.releasePointerCapture(w)},v=(f,w)=>{const T=f.closest(".svg-label");if(T){const M=T.dataset.svgId,we=T.dataset.type,ie=document.getElementById(M);if(ie){if(we==="arrow")return w?e.editArrowLabel(ie):e.selectArrow(ie),!0;if(we==="summary")return w?e.editSummary(ie):e.selectSummary(ie),!0}}if(f.closest(".topiclinks")){const M=f.closest("g");if(M)return w?e.editArrowLabel(M):e.selectArrow(M),!0}if(f.closest(".summary")){const M=f.closest("g");if(M)return w?e.editSummary(M):e.selectSummary(M),!0}return!1},p=f=>{if(f.button!==0)return;if(e.helper1?.moved){e.helper1.clear();return}if(e.helper2?.moved){e.helper2.clear();return}if(t.moved){t.clear();return}if(i?.isDragging)return;const w=f.target;if(w.tagName==="ME-EPD")f.ctrlKey||f.metaKey?e.expandNodeAll(w.previousSibling):e.expandNode(w.previousSibling);else if(w.tagName==="ME-TPC"&&e.currentNodes.length>1)e.selectNode(w);else if(!e.editable)return;v(w,!1)},g=f=>{if(!e.editable)return;const w=f.target;de(w)&&e.beginEdit(w),v(w,!0)},m=f=>{if(f.pointerType==="mouse"||s.size>1)return;const w=new Date().getTime(),T=w-n;T<300&&T>0&&g(f),n=w},b=f=>{f.code==="Space"&&(e.spacePressed=!0,e.container.classList.add("space-pressed"))},x=f=>{f.code==="Space"&&(e.spacePressed=!1,e.container.classList.remove("space-pressed"))},L=f=>{if(f.pointerType==="touch"&&(s.set(f.pointerId,{x:f.clientX,y:f.clientY}),s.size===2)){const[M,we]=Array.from(s.values());o=Ie(M,we),u()}t.moved=!1;const w=f.target,T=e.mouseSelectionButton===0?2:0;if(i&&(f.button===0||f.pointerType==="touch")){if(f.pointerType==="touch"&&s.size>1)(i.isDragging||i.pointerId!==null)&&ke(e,i);else if(f.pointerType==="touch"&&s.size===1)(de(w)||w.closest("me-tpc"))&&(r={x:f.clientX,y:f.clientY},c=w,a=f.pointerId,l=window.setTimeout(()=>{We(e,i,f,!0)&&(c&&c.setPointerCapture(f.pointerId),Xe(i.ghost,f.clientX,f.clientY)),l=null,r=null,c=null,a=null},d));else if(f.pointerType==="mouse"&&We(e,i,f,!1)){w.setPointerCapture(f.pointerId);return}}const $=e.spacePressed&&f.button===0&&f.pointerType==="mouse",z=f.button===T&&f.pointerType==="mouse"||f.pointerType==="touch";!$&&!z||(t.x=f.clientX,t.y=f.clientY,w.className!=="circle"&&w.contentEditable!=="plaintext-only"&&(t.mousedown=!0,w.setPointerCapture(f.pointerId)))},k=f=>{if(f.pointerType==="touch"&&s.has(f.pointerId)){if(s.set(f.pointerId,{x:f.clientX,y:f.clientY}),l!==null&&r!==null&&f.pointerId===a){const w=f.clientX-r.x,T=f.clientY-r.y;Math.sqrt(w*w+T*T)>h&&u()}if(s.size>=2){const[w,T]=Array.from(s.values()),$=Ie(w,T);if(o==null)o=$;else{const z=$-o;Math.abs(z)>8&&(z>0?J(e,"in",{x:(w.x+T.x)/2,y:(w.y+T.y)/2}):J(e,"out",{x:(w.x+T.x)/2,y:(w.y+T.y)/2}),o=$)}return}}if(!(i&&i.pointerId!==null&&(Mt(e,i,f),i.isDragging))){if(f.target.contentEditable!=="plaintext-only"||e.spacePressed&&t.mousedown){const w=f.clientX-t.x,T=f.clientY-t.y;t.onMove(w,T)}t.x=f.clientX,t.y=f.clientY}},E=f=>{if(f.pointerType==="touch"&&(s.delete(f.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId!==null){const w=i.isDragging;if(Dt(e,i,f),y(f.target,f.pointerId),w)return}t.mousedown&&(y(f.target,f.pointerId),t.clear())},C=()=>{u(),t.mousedown&&t.clear(),i&&(i.isDragging||i.pointerId!==null)&&ke(e,i)},S=f=>{f.pointerType==="touch"&&(s.delete(f.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId===f.pointerId&&ke(e,i),E(f)},N=f=>{if(f.preventDefault(),f.button!==2||!e.editable)return;const w=f.target;de(w)&&!w.classList.contains("selected")&&e.selectNode(w),setTimeout(()=>{e.dragMoveHelper.moved||e.bus.fire("showContextMenu",f)},200)},O=f=>{f.stopPropagation(),f.preventDefault(),f.ctrlKey||f.metaKey?f.deltaY<0?J(e,"in",e.dragMoveHelper):e.scaleVal-e.scaleSensitivity>0&&J(e,"out",e.dragMoveHelper):f.shiftKey?e.move(-f.deltaY,0):e.move(-f.deltaX,-f.deltaY)},{container:_}=e;return Re([{dom:_,evt:"pointerdown",func:L},{dom:_,evt:"pointermove",func:k},{dom:_,evt:"pointerup",func:E},{dom:_,evt:"pointercancel",func:S},{dom:_,evt:"pointerdown",func:m},{dom:_,evt:"click",func:p},{dom:_,evt:"dblclick",func:g},{dom:_,evt:"contextmenu",func:N},{dom:_,evt:"wheel",func:typeof e.handleWheel=="function"?e.handleWheel:O},{dom:_,evt:"blur",func:C},{dom:_,evt:"keydown",func:b},{dom:_,evt:"keyup",func:x}])}function $t(){return{handlers:{},addListener:function(e,t){this.handlers[e]===void 0&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e,...t){if(this.handlers[e]instanceof Array){const n=this.handlers[e];for(let o=0;o<n.length;o++)n[o](...t)}},removeListener:function(e,t){if(!this.handlers[e])return;const n=this.handlers[e];if(!t)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===t&&this.handlers[e].splice(o,1)}}}const fe=document,jt=function(){this.nodes.innerHTML="";const e=this.createTopic(this.nodeData);_e.call(this,e,this.nodeData),e.draggable=!1;const t=fe.createElement("me-root");t.appendChild(e);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}Ht(this,n,t)},Ht=function(e,t,n){const o=fe.createElement("me-main");o.className=I.LHS;const s=fe.createElement("me-main");s.className=I.RHS;for(let i=0;i<t.length;i++){const l=t[i],{grp:r}=e.createWrapper(l);e.direction===2?l.direction===0?o.appendChild(r):s.appendChild(r):e.direction===0?o.appendChild(r):s.appendChild(r)}e.nodes.appendChild(o),e.nodes.appendChild(n),e.nodes.appendChild(s),e.nodes.appendChild(e.lines),e.nodes.appendChild(e.labelContainer)},Rt=function(e,t){const n=fe.createElement("me-children");for(let o=0;o<t.length;o++){const s=t[o],{grp:i}=e.createWrapper(s);n.appendChild(i)}return n},D=document,Ge=function(e,t){const o=(this?.el?this.el:t||document).querySelector(`[data-nodeid="me${e}"]`);if(!o)throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);return o},_e=function(e,t){if(e.innerHTML="",t.style){const n=t.style;for(const o in n)e.style[o]=n[o]}if(t.dangerouslySetInnerHTML){e.innerHTML=t.dangerouslySetInnerHTML;return}if(t.image){const n=t.image;if(n.url&&n.width&&n.height){const o=D.createElement("img");o.src=this.imageProxy?this.imageProxy(n.url):n.url,o.style.width=n.width+"px",o.style.height=n.height+"px",n.fit&&(o.style.objectFit=n.fit),e.appendChild(o),e.image=o}}else e.image&&(e.image=void 0);{const n=D.createElement("span");n.className="text",this.markdown?n.innerHTML=this.markdown(t.topic,t):n.textContent=t.topic,e.appendChild(n),e.text=n}if(t.hyperLink){const n=D.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=t.hyperLink,e.appendChild(n),e.link=n}else e.link&&(e.link=void 0);if(t.icons&&t.icons.length){const n=D.createElement("span");n.className="icons",n.innerHTML=t.icons.map(o=>`<span>${xe(o)}</span>`).join(""),e.appendChild(n),e.icons=n}else e.icons&&(e.icons=void 0);if(t.tags&&t.tags.length){const n=D.createElement("div");n.className="tags",t.tags.forEach(o=>{const s=D.createElement("span");typeof o=="string"?s.textContent=o:(s.textContent=o.text,o.className&&(s.className=o.className),o.style&&Object.assign(s.style,o.style)),n.appendChild(s)}),e.appendChild(n),e.tags=n}else e.tags&&(e.tags=void 0)},It=function(e,t){const n=D.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(e);if(n.appendChild(o),!t&&e.children&&e.children.length>0){const i=Le(e.expanded);if(o.appendChild(i),e.expanded!==!1){const l=Rt(this,e.children);n.appendChild(l)}}return{grp:n,top:o,tpc:s}},Bt=function(e){const t=D.createElement("me-parent"),n=this.createTopic(e);return _e.call(this,n,e),t.appendChild(n),{p:t,tpc:n}},Ft=function(e){const t=D.createElement("me-children");return t.append(...e),t},Yt=function(e){const t=D.createElement("me-tpc");return t.nodeObj=e,t.dataset.nodeid="me"+e.id,t};function Ke(e){const t=D.createRange();t.selectNodeContents(e);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}const Wt=function(e){if(!e)return;const t=D.createElement("div"),n=e.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=j(this.nodes,e);this.nodes.appendChild(t),t.id="input-box",t.textContent=o,t.contentEditable="plaintext-only",t.spellcheck=!1;const l=getComputedStyle(e);t.style.cssText=`
2
2
  left: ${s}px;
3
3
  top: ${i}px;
4
4
  min-width:${e.offsetWidth-8}px;
@@ -8,9 +8,9 @@ var MindElixir=(function(){"use strict";const ve={name:"Latte",type:"light",pale
8
8
  margin:${l.margin};
9
9
  background-color:${l.backgroundColor!=="rgba(0, 0, 0, 0)"&&l.backgroundColor};
10
10
  border: ${l.border};
11
- border-radius:${l.borderRadius}; `,this.direction===0&&(t.style.right="0"),Ge(t),this.bus.fire("operation",{name:"beginEdit",obj:e.nodeObj}),t.addEventListener("keydown",r=>{r.stopPropagation();const c=r.key;if(c==="Enter"||c==="Tab"){if(r.shiftKey)return;r.preventDefault(),t.blur(),this.container.focus()}}),t.addEventListener("blur",()=>{if(!t)return;t.remove();const r=t.textContent?.trim()||"";r===o||r===""||(n.topic=r,this.markdown?e.text.innerHTML=this.markdown(n.topic,n):e.text.textContent=r,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},_e=function(e){const t=D.createElement("me-epd");return t.expanded=e!==!1,t.className=e!==!1?"minus":"",t},J=document,I="http://www.w3.org/2000/svg",de=function(e){const t=e.clientWidth,n=e.clientHeight,o=e.dataset,s=Number(o.x),i=Number(o.y),l=o.anchor;let r=s;l==="middle"?r=s-t/2:l==="end"&&(r=s-t),e.style.left=`${r}px`,e.style.top=`${i-n/2}px`,e.style.visibility="visible"},Le=function(e,t,n,o){const{anchor:s="middle",color:i,dataType:l,svgId:r}=o,c=document.createElement("div");c.className="svg-label",c.style.color=i||"#666";const a="label-"+r;return c.id=a,c.innerHTML=e,c.dataset.type=l,c.dataset.svgId=r,c.dataset.x=t.toString(),c.dataset.y=n.toString(),c.dataset.anchor=s,c},Ke=function(e,t,n){const o=J.createElementNS(I,"path");return A(o,{d:e,stroke:t||"#666",fill:"none","stroke-width":n}),o},ne=function(e){const t=J.createElementNS(I,"svg");return t.setAttribute("class",e),t.setAttribute("overflow","visible"),t},qe=function(){const e=J.createElementNS(I,"line");return e.setAttribute("stroke","#4dc4ff"),e.setAttribute("fill","none"),e.setAttribute("stroke-width","2"),e.setAttribute("opacity","0.45"),e},Wt=function(e,t,n,o){const s=J.createElementNS(I,"g");return[{name:"line",d:e},{name:"arrow1",d:t},{name:"arrow2",d:n}].forEach((l,r)=>{const c=l.d,a=J.createElementNS(I,"path"),d={d:c,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(d.opacity=String(o.opacity)),A(a,d),r===0&&a.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const h=J.createElementNS(I,"path");A(h,{d:c,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(h),s.appendChild(a),s[l.name]=a}),s},Ve=function(e,t,n){if(!t)return;const o=n.label,s=t.cloneNode(!0);e.nodes.appendChild(s),s.id="input-box",s.textContent=o,s.contentEditable="plaintext-only",s.spellcheck=!1,s.style.cssText=`
11
+ border-radius:${l.borderRadius}; `,this.direction===0&&(t.style.right="0"),Ke(t),this.bus.fire("operation",{name:"beginEdit",obj:e.nodeObj}),t.addEventListener("keydown",r=>{r.stopPropagation();const c=r.key;if(c==="Enter"||c==="Tab"){if(r.shiftKey)return;r.preventDefault(),t.blur(),this.container.focus()}}),t.addEventListener("blur",()=>{if(!t)return;t.remove();const r=t.textContent?.trim()||"";r===o||r===""||(n.topic=r,this.markdown?e.text.innerHTML=this.markdown(n.topic,n):e.text.textContent=r,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},Le=function(e){const t=D.createElement("me-epd");return t.expanded=e!==!1,t.className=e!==!1?"minus":"",t},Z=document,B="http://www.w3.org/2000/svg",ue=function(e){const t=e.clientWidth,n=e.clientHeight,o=e.dataset,s=Number(o.x),i=Number(o.y),l=o.anchor;let r=s;l==="middle"?r=s-t/2:l==="end"&&(r=s-t),e.style.left=`${r}px`,e.style.top=`${i-n/2}px`,e.style.visibility="visible"},Ae=function(e,t,n,o){const{anchor:s="middle",color:i,dataType:l,svgId:r}=o,c=document.createElement("div");c.className="svg-label",c.style.color=i||"#666";const a="label-"+r;return c.id=a,c.innerHTML=e,c.dataset.type=l,c.dataset.svgId=r,c.dataset.x=t.toString(),c.dataset.y=n.toString(),c.dataset.anchor=s,c},qe=function(e,t,n){const o=Z.createElementNS(B,"path");return A(o,{d:e,stroke:t||"#666",fill:"none","stroke-width":n}),o},oe=function(e){const t=Z.createElementNS(B,"svg");return t.setAttribute("class",e),t.setAttribute("overflow","visible"),t},Ve=function(){const e=Z.createElementNS(B,"line");return e.setAttribute("stroke","#4dc4ff"),e.setAttribute("fill","none"),e.setAttribute("stroke-width","2"),e.setAttribute("opacity","0.45"),e},Xt=function(e,t,n,o){const s=Z.createElementNS(B,"g");return[{name:"line",d:e},{name:"arrow1",d:t},{name:"arrow2",d:n}].forEach((l,r)=>{const c=l.d,a=Z.createElementNS(B,"path"),d={d:c,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(d.opacity=String(o.opacity)),A(a,d),r===0&&a.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const h=Z.createElementNS(B,"path");A(h,{d:c,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(h),s.appendChild(a),s[l.name]=a}),s},Ue=function(e,t,n){if(!t)return;const o=n.label,s=t.cloneNode(!0);e.nodes.appendChild(s),s.id="input-box",s.textContent=o,s.contentEditable="plaintext-only",s.spellcheck=!1,s.style.cssText=`
12
12
  left:${t.style.left};
13
13
  top:${t.style.top};
14
14
  max-width: 200px;
15
- `,Ge(s),e.scrollIntoView(s),s.addEventListener("keydown",i=>{i.stopPropagation();const l=i.key;if(l==="Enter"||l==="Tab"){if(i.shiftKey)return;i.preventDefault(),s.blur(),e.container.focus()}}),s.addEventListener("blur",()=>{if(!s)return;const i=s.textContent?.trim()||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(e.markdown?t.innerHTML=e.markdown(n.label,n):t.textContent=n.label,de(t),"parent"in n?e.bus.fire("operation",{name:"finishEditSummary",obj:n}):e.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Xt=function(e){const t=this.map.querySelector("me-root"),n=t.offsetTop,o=t.offsetLeft,s=t.offsetWidth,i=t.offsetHeight,l=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let r=0;r<l.length;r++){const c=l[r],a=c.querySelector("me-tpc"),{offsetLeft:d,offsetTop:h}=j(this.nodes,a),u=a.offsetWidth,y=a.offsetHeight,v=c.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:h,cL:d,cW:u,cH:y,direction:v,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,m=a.nodeObj.branchColor||g[r%g.length];if(a.style.borderColor=m,this.lines.appendChild(Ke(p,m,"3")),e&&e!==c)continue;const b=ne("subLines"),x=c.lastChild;x.tagName==="svg"&&x.remove(),c.appendChild(b),Ue(this,b,m,c,v,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},Ue=function(e,t,n,o,s,i){const l=o.firstChild,r=o.children[1].children;if(r.length===0)return;const c=l.offsetTop,a=l.offsetLeft,d=l.offsetWidth,h=l.offsetHeight;for(let u=0;u<r.length;u++){const y=r[u],v=y.firstChild,p=v.offsetTop,g=v.offsetLeft,m=v.offsetWidth,b=v.offsetHeight,x=v.firstChild.nodeObj.branchColor||n,L=e.generateSubBranch({pT:c,pL:a,pW:d,pH:h,cT:p,cL:g,cW:m,cH:b,direction:s,isFirst:i});t.appendChild(Ke(L,x,"2"));const T=v.children[1];if(T){if(!T.expanded)continue}else continue;Ue(e,t,x,y,s)}},Je={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},Ze={cn:Je,zh_CN:Je,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",linkBidirectional:"雙向連接",clickTips:"請點擊目標節點",summary:"摘要"},en:{addChild:"Add child",addParent:"Add parent",addSibling:"Add sibling",removeNode:"Remove node",focus:"Focus Mode",cancelFocus:"Cancel Focus Mode",moveUp:"Move up",moveDown:"Move down",link:"Link",linkBidirectional:"Bidirectional Link",clickTips:"Please click the target node",summary:"Summary"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",linkBidirectional:"Двунаправленная ссылка",clickTips:"Пожалуйста, нажмите на целевой узел",summary:"Описание"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",linkBidirectional:"双方向リンク",clickTips:"ターゲットノードをクリックしてください",summary:"概要"},pt:{addChild:"Adicionar item filho",addParent:"Adicionar item pai",addSibling:"Adicionar item irmao",removeNode:"Remover item",focus:"Modo Foco",cancelFocus:"Cancelar Modo Foco",moveUp:"Mover para cima",moveDown:"Mover para baixo",link:"Link",linkBidirectional:"Link bidirecional",clickTips:"Favor clicar no item alvo",summary:"Resumo"},it:{addChild:"Aggiungi figlio",addParent:"Aggiungi genitore",addSibling:"Aggiungi fratello",removeNode:"Rimuovi nodo",focus:"Modalità Focus",cancelFocus:"Annulla Modalità Focus",moveUp:"Sposta su",moveDown:"Sposta giù",link:"Collega",linkBidirectional:"Collegamento bidirezionale",clickTips:"Si prega di fare clic sul nodo di destinazione",summary:"Unisci nodi"},es:{addChild:"Agregar hijo",addParent:"Agregar padre",addSibling:"Agregar hermano",removeNode:"Eliminar nodo",focus:"Modo Enfoque",cancelFocus:"Cancelar Modo Enfoque",moveUp:"Mover hacia arriba",moveDown:"Mover hacia abajo",link:"Enlace",linkBidirectional:"Enlace bidireccional",clickTips:"Por favor haga clic en el nodo de destino",summary:"Resumen"},fr:{addChild:"Ajout enfant",addParent:"Ajout parent",addSibling:"Ajout voisin",removeNode:"Supprimer",focus:"Cibler",cancelFocus:"Retour",moveUp:"Monter",moveDown:"Descendre",link:"Lier",linkBidirectional:"Lien bidirectionnel",clickTips:"Cliquer sur le noeud cible",summary:"Annoter"},ko:{addChild:"자식 추가",addParent:"부모 추가",addSibling:"형제 추가",removeNode:"노드 삭제",focus:"포커스 모드",cancelFocus:"포커스 모드 취소",moveUp:"위로 이동",moveDown:"아래로 이동",link:"연결",linkBidirectional:"양방향 연결",clickTips:"대상 노드를 클릭하십시오",summary:"요약"},ro:{addChild:"Adaugă sub-nod",addParent:"Adaugă nod părinte",addSibling:"Adaugă nod la același nivel",removeNode:"Șterge nodul",focus:"Focalizare",cancelFocus:"Anulează focalizarea",moveUp:"Mută în sus",moveDown:"Mută în jos",link:"Creează legătură",linkBidirectional:"Creează legătură bidirecțională",clickTips:"Click pe nodul țintă",summary:"Rezumat"}};function zt(e,t){t=t===!0?{focus:!0,link:!0}:t;const n=E=>{const C=document.createElement("div");return C.innerText=E,C.className="tips",C},o=(E,C,S)=>{const N=document.createElement("li");return N.id=E,N.innerHTML=`<span>${we(C)}</span><span ${S?'class="key"':""}>${we(S)}</span>`,N},s=Ze[e.locale]?e.locale:"en",i=Ze[s],l=o("cm-add_child",i.addChild,"Tab"),r=o("cm-add_parent",i.addParent,"Ctrl + Enter"),c=o("cm-add_sibling",i.addSibling,"Enter"),a=o("cm-remove_child",i.removeNode,"Delete"),d=o("cm-fucus",i.focus,""),h=o("cm-unfucus",i.cancelFocus,""),u=o("cm-up",i.moveUp,"PgUp"),y=o("cm-down",i.moveDown,"Pgdn"),v=o("cm-link",i.link,""),p=o("cm-link-bidirectional",i.linkBidirectional,""),g=o("cm-summary",i.summary,""),m=document.createElement("ul");if(m.className="menu-list",m.appendChild(l),m.appendChild(r),m.appendChild(c),m.appendChild(a),t.focus&&(m.appendChild(d),m.appendChild(h)),m.appendChild(u),m.appendChild(y),m.appendChild(g),t.link&&(m.appendChild(v),m.appendChild(p)),t&&t.extend)for(let E=0;E<t.extend.length;E++){const C=t.extend[E],S=o(C.name,C.name,C.key||"");m.appendChild(S),S.onclick=N=>{C.onclick(N)}}const b=document.createElement("div");b.className="context-menu",b.appendChild(m),b.hidden=!0,e.container.append(b);let x=!0;const L=E=>{const C=E.target;if(le(C)){C.parentElement.tagName==="ME-ROOT"?x=!0:x=!1,x?(d.className="disabled",u.className="disabled",y.className="disabled",r.className="disabled",c.className="disabled",a.className="disabled"):(d.className="",u.className="",y.className="",r.className="",c.className="",a.className=""),b.hidden=!1,m.style.top="",m.style.bottom="",m.style.left="",m.style.right="";const S=m.getBoundingClientRect(),N=m.offsetHeight,O=m.offsetWidth,_=E.clientY-S.top,F=E.clientX-S.left;N+_>window.innerHeight?(m.style.top="",m.style.bottom="0px"):(m.style.bottom="",m.style.top=_+15+"px"),O+F>window.innerWidth?(m.style.left="",m.style.right="0px"):(m.style.right="",m.style.left=F+10+"px")}};e.bus.addListener("showContextMenu",L),b.onclick=E=>{E.target===b&&(b.hidden=!0)},l.onclick=()=>{e.addChild(),b.hidden=!0},r.onclick=()=>{e.insertParent(),b.hidden=!0},c.onclick=()=>{x||(e.insertSibling("after"),b.hidden=!0)},a.onclick=()=>{x||(e.removeNodes(e.currentNodes||[]),b.hidden=!0)},d.onclick=()=>{x||(e.focusNode(e.currentNode),b.hidden=!0)},h.onclick=()=>{e.cancelFocus(),b.hidden=!0},u.onclick=()=>{x||(e.moveUpNode(),b.hidden=!0)},y.onclick=()=>{x||(e.moveDownNode(),b.hidden=!0)};const T=E=>{b.hidden=!0;const C=e.currentNode,S=n(i.clickTips);e.container.appendChild(S),e.map.addEventListener("click",N=>{N.preventDefault(),S.remove();const O=N.target;(O.parentElement.tagName==="ME-PARENT"||O.parentElement.tagName==="ME-ROOT")&&e.createArrow(C,O,E)},{once:!0})};return v.onclick=()=>T(),p.onclick=()=>T({bidirectional:!0}),g.onclick=()=>{b.hidden=!0,e.createSummary(),e.unselectNodes(e.currentNodes)},()=>{l.onclick=null,r.onclick=null,c.onclick=null,a.onclick=null,d.onclick=null,h.onclick=null,u.onclick=null,y.onclick=null,v.onclick=null,g.onclick=null,b.onclick=null,e.container.oncontextmenu=null}}const Gt=function(e){return["createSummary","removeSummary","finishEditSummary"].includes(e.name)?{type:"summary",value:e.obj.id}:["createArrow","removeArrow","finishEditArrowLabel"].includes(e.name)?{type:"arrow",value:e.obj.id}:["removeNodes","copyNodes","moveNodeBefore","moveNodeAfter","moveNodeIn"].includes(e.name)?{type:"nodes",value:e.objs.map(t=>t.id)}:{type:"nodes",value:[e.obj.id]}};function Kt(e){let t=[],n=-1,o=e.getData(),s=[];e.undo=function(){if(n>-1){const c=t[n];o=c.prev,e.refresh(c.prev);try{c.currentTarget.type==="nodes"&&(c.operation==="removeNodes"?e.selectNodes(c.currentTarget.value.map(a=>this.findEle(a))):e.selectNodes(c.currentSelected.map(a=>this.findEle(a))))}catch{}finally{n--}}},e.redo=function(){if(n<t.length-1){n++;const c=t[n];o=c.next,e.refresh(c.next);try{c.currentTarget.type==="nodes"&&(c.operation==="removeNodes"?e.selectNodes(c.currentSelected.map(a=>this.findEle(a))):e.selectNodes(c.currentTarget.value.map(a=>this.findEle(a))))}catch{}}};const i=function(c){if(c.name==="beginEdit")return;t=t.slice(0,n+1);const a=e.getData(),d={prev:o,operation:c.name,currentSelected:s.map(h=>h.id),currentTarget:Gt(c),next:a};t.push(d),o=a,n=t.length-1},l=function(c){(c.metaKey||c.ctrlKey)&&(c.shiftKey&&c.key==="Z"||c.key==="y")?e.redo():(c.metaKey||c.ctrlKey)&&c.key==="z"&&e.undo()},r=function(){s=e.currentNodes.map(c=>c.nodeObj)};return e.bus.addListener("operation",i),e.bus.addListener("selectNodes",r),e.container.addEventListener("keydown",l),()=>{e.bus.removeListener("operation",i),e.bus.removeListener("selectNodes",r),e.container.removeEventListener("keydown",l)}}const qt={side:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>',left:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>',right:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>',full:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',living:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>',zoomin:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>',zoomout:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>'},K=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=qt[t],n};function Vt(e){const t=document.createElement("div"),n=K("fullscreen","full"),o=K("toCenter","living"),s=K("zoomout","zoomout"),i=K("zoomin","zoomin");t.appendChild(n),t.appendChild(o),t.appendChild(s),t.appendChild(i),t.className="mind-elixir-toolbar rb";let l=null;const r=()=>{const a=e.container.getBoundingClientRect(),d=Se(e.map.style.transform),h=a.width/2,u=a.height/2,y=(h-d.x)/e.scaleVal,v=(u-d.y)/e.scaleVal;l={containerRect:a,currentTransform:d,mapCenterX:y,mapCenterY:v}},c=()=>{if(l){const a=e.container.getBoundingClientRect(),d=a.width/2,h=a.height/2,u=d-l.mapCenterX*e.scaleVal,y=h-l.mapCenterY*e.scaleVal,v=u-l.currentTransform.x,p=y-l.currentTransform.y;e.move(v,p)}};return e.el.addEventListener("fullscreenchange",c),n.onclick=()=>{r(),document.fullscreenElement!==e.el?e.el.requestFullscreen():document.exitFullscreen()},o.onclick=()=>{e.toCenter()},s.onclick=()=>{e.scale(e.scaleVal-e.scaleSensitivity)},i.onclick=()=>{e.scale(e.scaleVal+e.scaleSensitivity)},t}function Ut(e){const t=document.createElement("div"),n=K("tbltl","left"),o=K("tbltr","right"),s=K("tblts","side");return t.appendChild(n),t.appendChild(o),t.appendChild(s),t.className="mind-elixir-toolbar lt",n.onclick=()=>{e.initLeft()},o.onclick=()=>{e.initRight()},s.onclick=()=>{e.initSide()},t}function Jt(e){e.container.append(Vt(e)),e.container.append(Ut(e))}class Zt{_listeners=new Map;addEventListener(t,n){const o=this._listeners.get(t)??new Set;return this._listeners.set(t,o),o.add(n),this}removeEventListener(t,n){return this._listeners.get(t)?.delete(n),this}dispatchEvent(t,...n){let o=!0;for(const s of this._listeners.get(t)??[])o=s(...n)!==!1&&o;return o}unbindAllListeners(){this._listeners.clear()}on=this.addEventListener;off=this.removeEventListener;emit=this.dispatchEvent}const Qe=(e,t="px")=>typeof e=="number"?e+t:e,Y=({style:e},t,n)=>{if(typeof t=="object")for(const[o,s]of Object.entries(t))s!==void 0&&(e[o]=Qe(s));else n!==void 0&&(e[t]=Qe(n))},et=(e=0,t=0,n=0,o=0)=>{const s={x:e,y:t,width:n,height:o,top:t,left:e,right:e+n,bottom:t+o};return{...s,toJSON:()=>JSON.stringify(s)}},Qt=e=>{let t,n=-1,o=!1;return{next:(...s)=>{t=s,o||(o=!0,n=requestAnimationFrame(()=>{e(...t),o=!1}))},cancel:()=>{cancelAnimationFrame(n),o=!1}}},tt=(e,t,n="touch")=>{switch(n){case"center":{const o=t.left+t.width/2,s=t.top+t.height/2;return o>=e.left&&o<=e.right&&s>=e.top&&s<=e.bottom}case"cover":return t.left>=e.left&&t.top>=e.top&&t.right<=e.right&&t.bottom<=e.bottom;case"touch":return e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}},en=()=>matchMedia("(hover: none), (pointer: coarse)").matches,tn=()=>"safari"in window,Ae=e=>Array.isArray(e)?e:[e],nt=e=>(t,n,o,s={})=>{(t instanceof HTMLCollection||t instanceof NodeList)&&(t=Array.from(t)),n=Ae(n),t=Ae(t);for(const i of t)if(i)for(const l of n)i[e](l,o,{capture:!1,...s})},W=nt("addEventListener"),H=nt("removeEventListener"),he=e=>{const{clientX:t,clientY:n,target:o}=e.touches?.[0]??e;return{x:t,y:n,target:o}},Z=(e,t=document)=>Ae(e).map(n=>typeof n=="string"?Array.from(t.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),nn=(e,t)=>t.some(n=>typeof n=="number"?e.button===n:typeof n=="object"?n.button!==e.button?!1:n.modifiers.every(o=>{switch(o){case"alt":return e.altKey;case"ctrl":return e.ctrlKey||e.metaKey;case"shift":return e.shiftKey}}):!1),{abs:q,max:ot,min:st,ceil:it}=Math,rt=(e=[])=>({stored:e,selected:[],touched:[],changed:{added:[],removed:[]}});class on extends Zt{static version="mind-elixir-fork";_options;_selection=rt();_area;_clippingElement;_targetElement;_targetBoundary;_targetBoundaryScrolled=!0;_targetRect;_selectables=[];_latestElement;_areaLocation={y1:0,x2:0,y2:0,x1:0};_areaRect=et();_singleClick=!0;_frame;_scrollAvailable=!0;_scrollingActive=!1;_scrollSpeed={x:0,y:0};_scrollDelta={x:0,y:0};_lastMousePosition={x:0,y:0};constructor(t){super(),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",mindElixirInstance:void 0,...t,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...t.behaviour,startThreshold:t.behaviour?.startThreshold?typeof t.behaviour.startThreshold=="number"?t.behaviour.startThreshold:{x:10,y:10,...t.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...t.behaviour?.scrolling,startScrollMargins:{x:0,y:0,...t.behaviour?.scrolling?.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...t.features,singleTap:{allow:!0,intersect:"native",...t.features?.singleTap}}};for(const i of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[i]=="function"&&(this[i]=this[i].bind(this));const{document:n,selectionAreaClass:o,selectionContainerClass:s}=this._options;this._area=n.createElement("div"),this._clippingElement=n.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(o),s&&this._clippingElement.classList.add(s),Y(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),Y(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=Qt(i=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",i),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(t=!0){const{document:n,features:o}=this._options,s=t?W:H;s(n,"mousedown",this._onTapStart),o.touch&&s(n,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(t,n=!1){const{x:o,y:s,target:i}=he(t),{document:l,startAreas:r,boundaries:c,features:a,behaviour:d}=this._options,h=i.getBoundingClientRect();if(t instanceof MouseEvent&&!nn(t,d.triggers))return;const u=Z(r,l),y=Z(c,l);this._targetElement=y.find(m=>tt(m.getBoundingClientRect(),h));const v=t.composedPath(),p=u.find(m=>v.includes(m));if(this._targetBoundary=y.find(m=>v.includes(m)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",t)===!1)return;this._areaLocation={x1:o,y1:s,x2:0,y2:0};const g=l.scrollingElement??l.body;this._scrollDelta={x:g.scrollLeft,y:g.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),W(l,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),W(l,["mouseup","touchcancel","touchend"],this._onTapStop),W(l,"scroll",this._onScroll),a.deselectOnBlur&&(this._targetBoundaryScrolled=!1,W(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(t){const{singleTap:{intersect:n},range:o}=this._options.features,s=he(t);let i;if(n==="native")i=s.target;else if(n==="touch"){this.resolveSelectables();const{x:r,y:c}=s;i=this._selectables.find(a=>{const{right:d,left:h,top:u,bottom:y}=a.getBoundingClientRect();return r<d&&r>h&&c<y&&c>u})}if(!i)return;for(this.resolveSelectables();!this._selectables.includes(i);)if(i.parentElement)i=i.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:l}=this._selection;if(this._emitEvent("start",t),t.shiftKey&&o&&this._latestElement){const r=this._latestElement,[c,a]=r.compareDocumentPosition(i)&4?[i,r]:[r,i],d=[...this._selectables.filter(h=>h.compareDocumentPosition(c)&4&&h.compareDocumentPosition(a)&2),c,a];this.select(d),this._latestElement=r}else l.includes(i)&&(l.length===1||t.ctrlKey||l.every(r=>this._selection.stored.includes(r)))?this.deselect(i):(this.select(i),this._latestElement=i)}_delayedTapMove(t){const{container:n,document:o,behaviour:{startThreshold:s}}=this._options,{x1:i,y1:l}=this._areaLocation,{x:r,y:c}=he(t);if(typeof s=="number"&&q(r+c-(i+l))>=s||typeof s=="object"&&q(r-i)>=s.x||q(c-l)>=s.y){if(H(o,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",t)===!1){H(o,["mouseup","touchcancel","touchend"],this._onTapStop);return}W(o,["mousemove","touchmove"],this._onTapMove,{passive:!1}),Y(this._area,"display","block"),Z(n,o)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(W(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),W(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(a=>this._targetElement.contains(a))),this._setupSelectionArea(),this._emitEvent("start",t),this._onTapMove(t)}this._handleMoveEvent(t)}_setupSelectionArea(){const{_clippingElement:t,_targetElement:n,_area:o}=this,s=this._targetRect=n.getBoundingClientRect();this._scrollAvailable?(Y(t,{top:s.top,left:s.left,width:s.width,height:s.height}),Y(o,{marginTop:-s.top,marginLeft:-s.left})):(Y(t,{top:0,left:0,width:"100%",height:"100%"}),Y(o,{marginTop:0,marginLeft:0}))}_onTapMove(t){const{_scrollSpeed:n,_areaLocation:o,_options:s,_frame:i}=this,{speedDivider:l}=s.behaviour.scrolling;this._targetElement;const{x:r,y:c}=he(t);if(o.x2=r,o.y2=c,this._lastMousePosition.x=r,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(n.y||n.x)){this._scrollingActive=!0;const a=()=>{if(!n.x&&!n.y){this._scrollingActive=!1;return}const d=this._options.mindElixirInstance;if(d&&d.move){const h=n.x?it(n.x/l):0,u=n.y?it(n.y/l):0;(h||u)&&(d.move(-h,-u),o.x1-=h,o.y1-=u)}i.next(t),requestAnimationFrame(a)};requestAnimationFrame(a)}else i.next(t);this._handleMoveEvent(t)}_handleMoveEvent(t){const{features:n}=this._options;(n.touch&&en()||this._scrollAvailable&&tn())&&t.preventDefault()}_onScroll(){const{_scrollDelta:t,_options:{document:n}}=this,{scrollTop:o,scrollLeft:s}=n.scrollingElement??n.body;this._areaLocation.x1+=t.x-s,this._areaLocation.y1+=t.y-o,t.x=s,t.y=o,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,H(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(t){const{manualSpeed:n}=this._options.behaviour.scrolling,o=t.deltaY?t.deltaY>0?1:-1:0,s=t.deltaX?t.deltaX>0?1:-1:0;this._scrollSpeed.y+=o*n,this._scrollSpeed.x+=s*n,this._onTapMove(t),t.preventDefault()}_keyboardScroll(t){const{manualSpeed:n}=this._options.behaviour.scrolling,o=t.key==="ArrowLeft"?-1:t.key==="ArrowRight"?1:0,s=t.key==="ArrowUp"?-1:t.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(o)*n,this._scrollSpeed.y+=Math.sign(s)*n,t.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:t,_areaLocation:n,_targetElement:o,_options:s}=this,i=this._targetRect,{x1:l,y1:r}=n;let{x2:c,y2:a}=n;const{behaviour:{scrolling:{startScrollMargins:d}}}=s;c<i.left+d.x?(t.x=-q(i.left-c+d.x),c=c<i.left?i.left:c):c>i.right-d.x?(t.x=q(i.left+i.width-c-d.x),c=c>i.right?i.right:c):t.x=0,a<i.top+d.y?(t.y=-q(i.top-a+d.y),a=a<i.top?i.top:a):a>i.bottom-d.y?(t.y=q(i.top+i.height-a-d.y),a=a>i.bottom?i.bottom:a):t.y=0;const h=st(l,c),u=st(r,a),y=ot(l,c),v=ot(r,a);this._areaRect=et(h,u,y-h,v-u)}_redrawSelectionArea(){const{x:t,y:n,width:o,height:s}=this._areaRect,{style:i}=this._area;i.left=`${t}px`,i.top=`${n}px`,i.width=`${o}px`,i.height=`${s}px`}_onTapStop(t,n){const{document:o,features:s}=this._options,{_singleClick:i}=this;H(this._targetElement,"scroll",this._onStartAreaScroll),H(o,["mousemove","touchmove"],this._delayedTapMove),H(o,["touchmove","mousemove"],this._onTapMove),H(o,["mouseup","touchcancel","touchend"],this._onTapStop),H(o,"scroll",this._onScroll),this._keepSelection(),t&&i&&s.singleTap.allow?this._onSingleTap(t):!i&&!n&&(this._updateElementSelection(),this._emitEvent("stop",t)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,H(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),H(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),this._frame?.cancel(),Y(this._area,"display","none")}_updateElementSelection(){const{_selectables:t,_options:n,_selection:o,_areaRect:s}=this,{stored:i,selected:l,touched:r}=o,{intersect:c,overlap:a}=n.behaviour,d=a==="invert",h=[],u=[],y=[];for(let p=0;p<t.length;p++){const g=t[p];if(tt(s,g.getBoundingClientRect(),c)){if(l.includes(g))i.includes(g)&&!r.includes(g)&&r.push(g);else if(d&&i.includes(g)){y.push(g);continue}else u.push(g);h.push(g)}}d&&u.push(...i.filter(p=>!l.includes(p)));const v=a==="keep";for(let p=0;p<l.length;p++){const g=l[p];!h.includes(g)&&!(v&&i.includes(g))&&y.push(g)}o.selected=h,o.changed={added:u,removed:y},this._latestElement=void 0}_emitEvent(t,n){return this.emit(t,{event:n,store:this._selection,selection:this})}_keepSelection(){const{_options:t,_selection:n}=this,{selected:o,changed:s,touched:i,stored:l}=n,r=o.filter(c=>!l.includes(c));switch(t.behaviour.overlap){case"drop":{n.stored=[...r,...l.filter(c=>!i.includes(c))];break}case"invert":{n.stored=[...r,...l.filter(c=>!s.removed.includes(c))];break}case"keep":{n.stored=[...l,...o.filter(c=>!l.includes(c))];break}}}trigger(t,n=!0){this._onTapStart(t,n)}resolveSelectables(){this._selectables=Z(this._options.selectables,this._options.document)}clearSelection(t=!0,n=!1){const{selected:o,stored:s,changed:i}=this._selection;i.added=[],i.removed.push(...o,...t?s:[]),n||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=rt(t?[]:s)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(t){Object.assign(this._areaLocation,t),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(t=!1){this._onTapStop(null,!t)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}enable=this._toggleStartEvents;disable=this._toggleStartEvents.bind(this,!1);select(t,n=!1){const{changed:o,selected:s,stored:i}=this._selection,l=Z(t,this._options.document).filter(r=>!s.includes(r)&&!i.includes(r));return i.push(...l),s.push(...l),o.added.push(...l),o.removed=[],this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null)),l}deselect(t,n=!1){const{selected:o,stored:s,changed:i}=this._selection,l=Z(t,this._options.document).filter(r=>o.includes(r)||s.includes(r));this._selection.stored=s.filter(r=>!l.includes(r)),this._selection.selected=o.filter(r=>!l.includes(r)),this._selection.changed.added=[],this._selection.changed.removed.push(...l.filter(r=>!i.removed.includes(r))),this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null))}}function sn(e){const t=e.mouseSelectionButton===2?[2]:[0],n=new on({selectables:[".map-container me-tpc"],boundaries:[e.container],container:e.selectionContainer,mindElixirInstance:e,features:{touch:!1},behaviour:{triggers:t,scrolling:{speedDivider:10,startScrollMargins:{x:50,y:50}}}}).on("beforestart",({event:o})=>{if(e.spacePressed)return!1;const s=o.target;if(s.id==="input-box"||s.className==="circle"||e.container.querySelector(".context-menu")?.contains(s))return!1;if(!o.ctrlKey&&!o.metaKey){if(s.tagName==="ME-TPC"&&s.classList.contains("selected"))return!1;e.clearSelection()}const i=n.getSelectionArea();return i.style.background="#4f90f22d",i.style.border="1px solid #4f90f2",i.parentElement&&(i.parentElement.style.zIndex="9999"),!0}).on("move",({store:{changed:{added:o,removed:s}}})=>{if(o.length>0||s.length>0,o.length>0){for(const i of o)i.className="selected";e.currentNodes=[...e.currentNodes,...o],e.bus.fire("selectNodes",o.map(i=>i.nodeObj))}if(s.length>0){for(const i of s)i.classList.remove("selected");e.currentNodes=e.currentNodes.filter(i=>!s?.includes(i)),e.bus.fire("unselectNodes",s.map(i=>i.nodeObj))}});e.selection=n}const rn=function(e,t=!0){this.theme=e;const o={...(e.type==="dark"?be:ve).cssVar,...e.cssVar},s=Object.keys(o);for(let i=0;i<s.length;i++){const l=s[i];this.container.style.setProperty(l,o[l])}t&&this.refresh()},Q=e=>{const t=e.parent?.children,n=t?.indexOf(e)??0;return{siblings:t,index:n}};function ln(e){const{siblings:t,index:n}=Q(e);if(t===void 0)return;const o=t[n];n===0?(t[n]=t[t.length-1],t[t.length-1]=o):(t[n]=t[n-1],t[n-1]=o)}function cn(e){const{siblings:t,index:n}=Q(e);if(t===void 0)return;const o=t[n];n===t.length-1?(t[n]=t[0],t[0]=o):(t[n]=t[n+1],t[n+1]=o)}function lt(e){const{siblings:t,index:n}=Q(e);return t===void 0?0:(t.splice(n,1),t.length)}function an(e,t,n){const{siblings:o,index:s}=Q(n);o!==void 0&&(t==="before"?o.splice(s,0,e):o.splice(s+1,0,e))}function dn(e,t){const{siblings:n,index:o}=Q(e);n!==void 0&&(n[o]=t,t.children=[e])}function hn(e,t,n){if(lt(t),n.parent?.parent||(t.direction=n.direction),e==="in")n.children?n.children.push(t):n.children=[t];else{t.direction!==void 0&&(t.direction=n.direction);const{siblings:o,index:s}=Q(n);if(o===void 0)return;e==="before"?o.splice(s,0,t):o.splice(s+1,0,t)}}const fn=function({map:e,direction:t},n){if(t===0)return 0;if(t===1)return 1;if(t===2){const o=e.querySelector(".lhs")?.childElementCount||0,s=e.querySelector(".rhs")?.childElementCount||0;return o<=s?(n.direction=0,0):(n.direction=1,1)}},ct=function(e,t,n){const o=n.children[0].children[0],s=t.parentElement;if(s.tagName==="ME-PARENT"){if(oe(o),s.children[1])s.nextSibling.appendChild(n);else{const i=e.createChildren([n]);s.appendChild(_e(!0)),s.insertAdjacentElement("afterend",i)}e.linkDiv(n.offsetParent)}else s.tagName==="ME-ROOT"&&(fn(e,o.nodeObj)===0?e.container.querySelector(".lhs")?.appendChild(n):e.container.querySelector(".rhs")?.appendChild(n),e.linkDiv())},un=function(e,t){const n=e.parentNode;if(t===0){const o=n.parentNode.parentNode;o.tagName!=="ME-MAIN"&&(o.previousSibling.children[1].remove(),o.remove())}n.parentNode.remove()},at={before:"beforebegin",after:"afterend"},oe=function(e){const n=e.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()},pn=function(e,t){const n=e.nodeObj,o=Ce(n);o.style&&t.style&&(t.style=Object.assign(o.style,t.style));const s=Object.assign(n,t);Te.call(this,e,s),this.linkDiv(),this.bus.fire("operation",{name:"reshapeNode",obj:s,origin:o})},Me=function(e,t,n){if(!t)return null;const o=t.nodeObj;o.expanded===!1&&(e.expandNode(t,!0),t=e.findEle(o.id));const s=n||e.generateNewObj();o.children?o.children.push(s):o.children=[s],z(e.nodeData);const{grp:i,top:l}=e.createWrapper(s);return ct(e,t,i),{newTop:l,newNodeObj:s}},gn=function(e,t,n){const o=t||this.currentNode;if(!o)return;const s=o.nodeObj;if(s.parent){if(!s.parent?.parent&&this.direction===2){const a=this.map.querySelector(".lhs")?.childElementCount||0,d=this.map.querySelector(".rhs")?.childElementCount||0;if(!a||!d){this.addChild(this.findEle(s.parent.id),n);return}}}else{this.addChild();return}const i=n||this.generateNewObj();if(!s.parent?.parent){const a=o.closest("me-main").className===B.LHS?0:1;i.direction=a}an(i,e,s),z(this.nodeData);const l=o.parentElement,{grp:r,top:c}=this.createWrapper(i);l.parentElement.insertAdjacentElement(at[e],r),this.linkDiv(r.offsetParent),n||this.editTopic(c.firstChild),this.bus.fire("operation",{name:"insertSibling",type:e,obj:i}),this.selectNode(c.firstChild,!0)},mn=function(e,t){const n=e||this.currentNode;if(!n)return;oe(n);const o=n.nodeObj;if(!o.parent)return;const s=t||this.generateNewObj();dn(o,s),z(this.nodeData);const i=n.parentElement.parentElement,{grp:l,top:r}=this.createWrapper(s,!0);r.appendChild(_e(!0)),i.insertAdjacentElement("afterend",l);const c=this.createChildren([i]);r.insertAdjacentElement("afterend",c),this.linkDiv(),t||this.editTopic(r.firstChild),this.selectNode(r.firstChild,!0),this.bus.fire("operation",{name:"insertParent",obj:s})},yn=function(e,t){const n=e||this.currentNode;if(!n)return;const o=Me(this,n,t);if(!o)return;const{newTop:s,newNodeObj:i}=o;this.bus.fire("operation",{name:"addChild",obj:i}),t||this.editTopic(s.firstChild),this.selectNode(s.firstChild,!0)},vn=function(e,t){const n=Ce(e.nodeObj);xe(n);const o=Me(this,t,n);if(!o)return;const{newNodeObj:s}=o;this.selectNode(this.findEle(s.id)),this.bus.fire("operation",{name:"copyNode",obj:s})},bn=function(e,t){e=Ee(e);const n=[];for(let o=0;o<e.length;o++){const s=e[o],i=Ce(s.nodeObj);xe(i);const l=Me(this,t,i);if(!l)return;const{newNodeObj:r}=l;n.push(r)}this.unselectNodes(this.currentNodes),this.selectNodes(n.map(o=>this.findEle(o.id))),this.bus.fire("operation",{name:"copyNodes",objs:n})},wn=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;ln(n);const o=t.parentNode.parentNode;o.parentNode.insertBefore(o,o.previousSibling),this.linkDiv(),this.bus.fire("operation",{name:"moveUpNode",obj:n})},xn=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;cn(n);const o=t.parentNode.parentNode;o.nextSibling?o.nextSibling.insertAdjacentElement("afterend",o):o.parentNode.prepend(o),this.linkDiv(),this.bus.fire("operation",{name:"moveDownNode",obj:n})},Cn=function(e){if(e.length===0)return;e=Ee(e);for(const n of e){const o=n.nodeObj,s=lt(o);un(n,s)}const t=e[e.length-1];this.selectNode(this.findEle(t.nodeObj.parent.id)),this.linkDiv(),this.bus.fire("operation",{name:"removeNodes",objs:e.map(n=>n.nodeObj)})},De=(e,t,n,o)=>{e=Ee(e);let s=n.nodeObj;t==="in"&&s.expanded===!1&&(o.expandNode(n,!0),n=o.findEle(s.id),s=n.nodeObj),t==="after"&&(e=e.reverse());const i=[];for(const r of e){const c=r.nodeObj;if(hn(t,c,s),z(o.nodeData),t==="in"){const a=r.parentElement;ct(o,n,a.parentElement)}else{oe(r);const a=r.parentElement.parentNode;i.includes(a.parentElement)||i.push(a.parentElement),n.parentElement.parentNode.insertAdjacentElement(at[t],a)}}for(const r of i)r.childElementCount===0&&r.tagName!=="ME-MAIN"&&(r.previousSibling.children[1].remove(),r.remove());o.linkDiv(),o.scrollIntoView(e[e.length-1]);const l=t==="before"?"moveNodeBefore":t==="after"?"moveNodeAfter":"moveNodeIn";o.bus.fire("operation",{name:l,objs:e.map(r=>r.nodeObj),toObj:s})},dt=Object.freeze(Object.defineProperty({__proto__:null,addChild:yn,beginEdit:function(e){const t=e||this.currentNode;t&&(t.nodeObj.dangerouslySetInnerHTML||this.editTopic(t))},copyNode:vn,copyNodes:bn,insertParent:mn,insertSibling:gn,moveDownNode:xn,moveNodeAfter:function(e,t){De(e,"after",t,this)},moveNodeBefore:function(e,t){De(e,"before",t,this)},moveNodeIn:function(e,t){De(e,"in",t,this)},moveUpNode:wn,removeNodes:Cn,reshapeNode:pn,rmSubline:oe,setNodeTopic:function(e,t){e.text.textContent=t,e.nodeObj.topic=t,this.linkDiv()}},Symbol.toStringTag,{value:"Module"}));function En(e){return{nodeData:e.isFocusMode?e.nodeDataBackup:e.nodeData,arrows:e.arrows,summaries:e.summaries,direction:e.direction,theme:e.theme}}const Sn=function(e){const t=this.container,n=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(n.top>o.bottom-50||n.bottom<o.top+50||n.left>o.right-50||n.right<o.left+50){const i=n.left+n.width/2,l=n.top+n.height/2,r=o.left+o.width/2,c=o.top+o.height/2,a=i-r,d=l-c;this.move(-a,-d,!0)}},Nn=function(e,t,n){this.clearSelection(),this.scrollIntoView(e),this.selection.select(e),t&&this.bus.fire("selectNewNode",e.nodeObj)},kn=function(e){this.selection.select(e)},Tn=function(e){this.selection?.deselect(e)},_n=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},Ln=function(){const e=En(this);return JSON.stringify(e,(t,n)=>{if(!(t==="parent"&&typeof n!="string"))return n})},An=function(){return JSON.parse(this.getDataString())},Mn=function(){this.editable=!0},Dn=function(){this.editable=!1},Pn=function(e,t={x:0,y:0}){if(e<this.scaleMin&&e<this.scaleVal||e>this.scaleMax&&e>this.scaleVal)return;const n=this.container.getBoundingClientRect(),o=t.x?t.x-n.left-n.width/2:0,s=t.y?t.y-n.top-n.height/2:0,{dx:i,dy:l}=Pe(this),r=this.map.style.transform,{x:c,y:a}=Se(r),d=c-i,h=a-l,u=this.scaleVal,y=(-o+d)*(1-e/u),v=(-s+h)*(1-e/u);this.map.style.transform=`translate3d(${c-y}px, ${a-v}px, 0) scale(${e})`,this.scaleVal=e,this.bus.fire("scale",e)},On=function(){const e=this.nodes.offsetHeight/this.container.offsetHeight,t=this.nodes.offsetWidth/this.container.offsetWidth,n=1/Math.max(1,Math.max(e,t));this.scaleVal=n;const{dx:o,dy:s}=Pe(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},$n=function(e,t,n=!1){const{map:o,scaleVal:s,bus:i,container:l,nodes:r}=this;if(n&&o.style.transition==="transform 0.3s")return;const c=o.style.transform;let{x:a,y:d}=Se(c);const h=l.getBoundingClientRect(),u=r.getBoundingClientRect(),y=u.left<h.right&&u.right>h.left,v=u.top<h.bottom&&u.bottom>h.top;if(y){const p=u.left+e,g=u.right+e;(p>=h.right||g<=h.left)&&(e=0)}if(v){const p=u.top+t,g=u.bottom+t;(p>=h.bottom||g<=h.top)&&(t=0)}a+=e,d+=t,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${a}px, ${d}px, 0) scale(${s})`,i.fire("move",{dx:e,dy:t})},Pe=(e,t=!1)=>{const{container:n,map:o,nodes:s}=e;let i,l;if(e.alignment==="nodes"||t)i=(n.offsetWidth-s.offsetWidth)/2,l=(n.offsetHeight-s.offsetHeight)/2,o.style.transformOrigin="50% 50%";else{const r=o.querySelector("me-root"),c=r.offsetTop,a=r.offsetLeft,d=r.offsetWidth,h=r.offsetHeight;i=n.offsetWidth/2-a-d/2,l=n.offsetHeight/2-c-h/2,o.style.transformOrigin=`${a+d/2}px 50%`}return{dx:i,dy:l}},jn=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:function(){this.isFocusMode=!1,this.tempDirection!==null&&(this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},clearSelection:_n,disableEdit:Dn,enableEdit:Mn,expandNode:function(e,t){const n=e.nodeObj;typeof t=="boolean"?n.expanded=t:n.expanded!==!1?n.expanded=!1:n.expanded=!0;const o=e.getBoundingClientRect(),s={x:o.left,y:o.top},i=e.parentNode,l=i.children[1];if(l.expanded=n.expanded,l.className=n.expanded?"minus":"",oe(e),n.expanded){const h=this.createChildren(n.children.map(u=>this.createWrapper(u).grp));i.parentNode.appendChild(h)}else i.parentNode.children[1].remove();this.linkDiv(e.closest("me-main > me-wrapper"));const r=e.getBoundingClientRect(),c={x:r.left,y:r.top},a=s.x-c.x,d=s.y-c.y;this.move(a,d),this.bus.fire("expandNode",n)},expandNodeAll:function(e,t){const n=e.nodeObj,o=e.getBoundingClientRect(),s={x:o.left,y:o.top};V(n,t??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),l={x:i.left,y:i.top},r=s.x-l.x,c=s.y-l.y;this.move(r,c)},focusNode:function(e){e.nodeObj.parent&&(this.clearSelection(),this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=e.nodeObj,this.initRight(),this.toCenter())},getData:An,getDataString:Ln,initLeft:function(){this.direction=0,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initRight:function(){this.direction=1,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initSide:function(){this.direction=2,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},install:function(e){e(this)},move:$n,refresh:function(e){this.clearSelection(),e&&(e=JSON.parse(JSON.stringify(e)),this.nodeData=e.nodeData,this.arrows=e.arrows||[],this.summaries=e.summaries||[],e.theme&&this.changeTheme(e.theme)),z(this.nodeData),this.layout(),this.linkDiv()},scale:Pn,scaleFit:On,scrollIntoView:Sn,selectNode:Nn,selectNodes:kn,setLocale:function(e){this.locale=e,this.refresh()},toCenter:function(){const{map:e,container:t}=this,{dx:n,dy:o}=Pe(this);t.scrollTop=0,t.scrollLeft=0,e.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:Tn},Symbol.toStringTag,{value:"Module"})),ht={create:function(e){return{dom:e,moved:!1,pointerdown:!1,lastX:0,lastY:0,handlePointerMove(t){if(this.pointerdown){this.moved=!0;const n=t.clientX-this.lastX,o=t.clientY-this.lastY;this.lastX=t.clientX,this.lastY=t.clientY,this.cb&&this.cb(n,o)}},handlePointerDown(t){t.button===0&&(this.pointerdown=!0,this.lastX=t.clientX,this.lastY=t.clientY,this.dom.setPointerCapture(t.pointerId))},handleClear(t){this.pointerdown=!1,t.pointerId!==void 0&&this.dom.releasePointerCapture(t.pointerId)},cb:null,init(t,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.destroy=He([{dom:t,evt:"pointermove",func:this.handlePointerMove},{dom:t,evt:"pointerleave",func:this.handleClear},{dom:t,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},Hn="#4dc4ff";function ft(e,t,n,o,s,i,l,r){return{x:e/8+n*3/8+s*3/8+l/8,y:t/8+o*3/8+i*3/8+r/8}}function Rn(e,t,n){e&&(e.dataset.x=t.toString(),e.dataset.y=n.toString(),de(e))}function fe(e,t,n,o,s){A(e,{x1:t+"",y1:n+"",x2:o+"",y2:s+""})}function ut(e,t,n,o,s,i,l,r,c,a){const d=`M ${t} ${n} C ${o} ${s} ${i} ${l} ${r} ${c}`;if(e.line.setAttribute("d",d),a.style){const p=a.style;p.stroke&&e.line.setAttribute("stroke",p.stroke),p.strokeWidth&&e.line.setAttribute("stroke-width",String(p.strokeWidth)),p.strokeDasharray&&e.line.setAttribute("stroke-dasharray",p.strokeDasharray),p.strokeLinecap&&e.line.setAttribute("stroke-linecap",p.strokeLinecap),p.opacity!==void 0&&e.line.setAttribute("opacity",String(p.opacity))}const h=e.querySelectorAll('path[stroke="transparent"]');h.length>0&&h[0].setAttribute("d",d);const u=re(i,l,r,c);if(u){const p=`M ${u.x1} ${u.y1} L ${r} ${c} L ${u.x2} ${u.y2}`;if(e.arrow1.setAttribute("d",p),h.length>1&&h[1].setAttribute("d",p),a.style){const g=a.style;g.stroke&&e.arrow1.setAttribute("stroke",g.stroke),g.strokeWidth&&e.arrow1.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeLinecap&&e.arrow1.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&e.arrow1.setAttribute("opacity",String(g.opacity))}}if(a.bidirectional){const p=re(o,s,t,n);if(p){const g=`M ${p.x1} ${p.y1} L ${t} ${n} L ${p.x2} ${p.y2}`;if(e.arrow2.setAttribute("d",g),h.length>2&&h[2].setAttribute("d",g),a.style){const m=a.style;m.stroke&&e.arrow2.setAttribute("stroke",m.stroke),m.strokeWidth&&e.arrow2.setAttribute("stroke-width",String(m.strokeWidth)),m.strokeLinecap&&e.arrow2.setAttribute("stroke-linecap",m.strokeLinecap),m.opacity!==void 0&&e.arrow2.setAttribute("opacity",String(m.opacity))}}}const{x:y,y:v}=ft(t,n,o,s,i,l,r,c);if(e.labelEl&&Rn(e.labelEl,y,v),a.style?.labelColor){const p=e.labelEl;p&&(p.style.color=a.style.labelColor)}Gn(e)}function ue(e,t,n){const{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=t.offsetWidth,l=t.offsetHeight,r=o+i/2,c=s+l/2,a=r+n.x,d=c+n.y;return{w:i,h:l,cx:r,cy:c,ctrlX:a,ctrlY:d}}function ee(e){let t,n;const o=(e.cy-e.ctrlY)/(e.ctrlX-e.cx);return o>e.h/e.w||o<-e.h/e.w?e.cy-e.ctrlY<0?(t=e.cx-e.h/2/o,n=e.cy+e.h/2):(t=e.cx+e.h/2/o,n=e.cy-e.h/2):e.cx-e.ctrlX<0?(t=e.cx+e.w/2,n=e.cy-e.w*o/2):(t=e.cx-e.w/2,n=e.cy+e.w*o/2),{x:t,y:n}}const Oe=function(e,t,n,o,s){if(!t||!n)return;const i=ue(e,t,o.delta1),l=ue(e,n,o.delta2),{x:r,y:c}=ee(i),{ctrlX:a,ctrlY:d}=i,{ctrlX:h,ctrlY:u}=l,{x:y,y:v}=ee(l),p=re(h,u,y,v);if(!p)return;const g=`M ${p.x1} ${p.y1} L ${y} ${v} L ${p.x2} ${p.y2}`;let m="";if(o.bidirectional){const N=re(a,d,r,c);if(!N)return;m=`M ${N.x1} ${N.y1} L ${r} ${c} L ${N.x2} ${N.y2}`}const b=Wt(`M ${r} ${c} C ${a} ${d} ${h} ${u} ${y} ${v}`,g,m,o.style),{x,y:L}=ft(r,c,a,d,h,u,y,v),T=o.style?.labelColor||"rgb(235, 95, 82)",E="arrow-"+o.id;b.id=E;const C=e.markdown?e.markdown(o.label,o):o.label,S=Le(C,x,L,{anchor:"middle",color:T,dataType:"arrow",svgId:E});b.labelEl=S,b.arrowObj=o,b.dataset.linkid=o.id,e.labelContainer.appendChild(S),e.linkSvgGroup.appendChild(b),de(S),s||(e.arrows.push(o),e.currentArrow=b,pt(e,o,i,l))},Bn=function(e,t,n={}){const o=j(this.nodes,e),s=j(this.nodes,t),i=o.offsetLeft+e.offsetWidth/2,l=o.offsetTop+e.offsetHeight/2,r=s.offsetLeft+t.offsetWidth/2,c=s.offsetTop+t.offsetHeight/2,a=r-i,d=c-l,h=Math.sqrt(a*a+d*d),u=Math.max(50,Math.min(200,h*.3)),y=Math.abs(a),v=Math.abs(d);let p,g;if(y>v*1.5){const b=a>0?e.offsetWidth/2:-e.offsetWidth/2,x=a>0?-t.offsetWidth/2:t.offsetWidth/2;p={x:b+(a>0?u:-u),y:0},g={x:x+(a>0?-u:u),y:0}}else if(v>y*1.5){const b=d>0?e.offsetHeight/2:-e.offsetHeight/2,x=d>0?-t.offsetHeight/2:t.offsetHeight/2;p={x:0,y:b+(d>0?u:-u)},g={x:0,y:x+(d>0?-u:u)}}else{const b=Math.atan2(d,a),x=e.offsetWidth/2*Math.cos(b),L=e.offsetHeight/2*Math.sin(b),T=-(t.offsetWidth/2)*Math.cos(b),E=-(t.offsetHeight/2)*Math.sin(b),C=u*.7*(a>0?1:-1),S=u*.7*(d>0?1:-1);p={x:x+C,y:L+S},g={x:T-C,y:E-S}}const m={id:G(),label:"Custom Link",from:e.nodeObj.id,to:t.nodeObj.id,delta1:p,delta2:g,...n};Oe(this,e,t,m),this.bus.fire("operation",{name:"createArrow",obj:m})},In=function(e){pe(this);const t={...e,id:G()};Oe(this,this.findEle(t.from),this.findEle(t.to),t),this.bus.fire("operation",{name:"createArrow",obj:t})},Fn=function(e){let t;if(e?t=e:t=this.currentArrow,!t)return;pe(this);const n=t.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),t.labelEl?.remove(),t.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},Yn=function(e){this.currentArrow=e;const t=e.arrowObj,n=this.findEle(t.from),o=this.findEle(t.to),s=ue(this,n,t.delta1),i=ue(this,o,t.delta2);pt(this,t,s,i)},Wn=function(){pe(this),this.currentArrow=null},$e=function(e,t){const n=document.createElementNS(I,"path");return A(n,{d:e,stroke:t,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},Xn=function(e,t){const n=document.createElementNS(I,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=$e(e.line.getAttribute("d"),t);n.appendChild(o);const s=$e(e.arrow1.getAttribute("d"),t);if(n.appendChild(s),e.arrow2.getAttribute("d")){const i=$e(e.arrow2.getAttribute("d"),t);n.appendChild(i)}e.insertBefore(n,e.firstChild)},zn=function(e){const t=e.querySelector(".arrow-highlight");t&&t.remove()},Gn=function(e){const t=e.querySelector(".arrow-highlight");if(!t)return;const n=t.querySelectorAll("path");n.length>=1&&n[0].setAttribute("d",e.line.getAttribute("d")),n.length>=2&&n[1].setAttribute("d",e.arrow1.getAttribute("d")),n.length>=3&&e.arrow2.getAttribute("d")&&n[2].setAttribute("d",e.arrow2.getAttribute("d"))},pe=function(e){e.helper1?.destroy(),e.helper2?.destroy(),e.linkController.style.display="none",e.P2.style.display="none",e.P3.style.display="none",e.currentArrow&&zn(e.currentArrow)},pt=function(e,t,n,o){const{linkController:s,P2:i,P3:l,line1:r,line2:c,nodes:a,map:d,currentArrow:h,bus:u}=e;if(!h)return;s.style.display="initial",i.style.display="initial",l.style.display="initial",a.appendChild(s),a.appendChild(i),a.appendChild(l),Xn(h,Hn);let{x:y,y:v}=ee(n),{ctrlX:p,ctrlY:g}=n,{ctrlX:m,ctrlY:b}=o,{x,y:L}=ee(o);i.style.cssText=`top:${g}px;left:${p}px;`,l.style.cssText=`top:${b}px;left:${m}px;`,fe(r,y,v,p,g),fe(c,m,b,x,L),e.helper1=ht.create(i),e.helper2=ht.create(l),e.helper1.init(d,(T,E)=>{p=p+T/e.scaleVal,g=g+E/e.scaleVal;const C=ee({...n,ctrlX:p,ctrlY:g});y=C.x,v=C.y,i.style.top=g+"px",i.style.left=p+"px",ut(h,y,v,p,g,m,b,x,L,t),fe(r,y,v,p,g),t.delta1.x=p-n.cx,t.delta1.y=g-n.cy,u.fire("updateArrowDelta",t)}),e.helper2.init(d,(T,E)=>{m=m+T/e.scaleVal,b=b+E/e.scaleVal;const C=ee({...o,ctrlX:m,ctrlY:b});x=C.x,L=C.y,l.style.top=b+"px",l.style.left=m+"px",ut(h,y,v,p,g,m,b,x,L,t),fe(c,m,b,x,L),t.delta2.x=m-o.cx,t.delta2.y=b-o.cy,u.fire("updateArrowDelta",t)})};function Kn(){this.linkSvgGroup.innerHTML="",this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach(t=>t.remove());for(let t=0;t<this.arrows.length;t++){const n=this.arrows[t];try{Oe(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function qn(e){pe(this),e&&e.labelEl&&Ve(this,e.labelEl,e.arrowObj)}function Vn(){this.arrows=this.arrows.filter(e=>ie(e.from,this.nodeData)&&ie(e.to,this.nodeData))}const Un=Object.freeze(Object.defineProperty({__proto__:null,createArrow:Bn,createArrowFrom:In,editArrowLabel:qn,removeArrow:Fn,renderArrow:Kn,selectArrow:Yn,tidyArrow:Vn,unselectArrow:Wn},Symbol.toStringTag,{value:"Module"})),Jn=function(e){if(e.length===0)throw new Error("No selected node.");if(e.length===1){const c=e[0].nodeObj,a=e[0].nodeObj.parent;if(!a)throw new Error("Can not select root node.");const d=a.children.findIndex(h=>c===h);return{parent:a.id,start:d,end:d}}let t=0;const n=e.map(c=>{let a=c.nodeObj;const d=[];for(;a.parent;){const h=a.parent,y=h.children?.indexOf(a);a=h,d.unshift({node:a,index:y})}return d.length>t&&(t=d.length),d});let o=0;e:for(;o<t;o++){const c=n[0][o]?.node;for(let a=1;a<n.length;a++)if(n[a][o]?.node!==c)break e}if(!o)throw new Error("Can not select root node.");const s=n.map(c=>c[o-1].index).sort(),i=s[0]||0,l=s[s.length-1]||0,r=n[0][o-1].node;if(!r.parent)throw new Error("Please select nodes in the same main topic.");return{parent:r.id,start:i,end:l}},Zn=function(e){const t=document.createElementNS(I,"g");return t.setAttribute("id",e),t},gt=function(e,t){const n=document.createElementNS(I,"path");return A(n,{d:e,stroke:t||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Qn=e=>e.parentElement.parentElement,eo=function(e,{parent:t,start:n}){const o=e.findEle(t),s=o.nodeObj;let i;return s.parent?i=o.closest("me-main").className:i=e.findEle(s.children[n].id).closest("me-main").className,i},je=function(e,t){const{id:n,label:o,parent:s,start:i,end:l,style:r}=t,{nodes:c,theme:a,summarySvg:d}=e,u=e.findEle(s).nodeObj,y=eo(e,t);let v=1/0,p=0,g=0,m=0;for(let f=i;f<=l;f++){const w=u.children?.[f];if(!w)return e.removeSummary(n),null;const k=Qn(e.findEle(w.id)),{offsetLeft:$,offsetTop:X}=j(c,k),M=i===l?10:20;f===i&&(g=X+M),f===l&&(m=X+k.offsetHeight-M),$<v&&(v=$),k.offsetWidth+$>p&&(p=k.offsetWidth+$)}let b,x;const L=u.parent?10:0,T=g+L,E=m+L,C=(T+E)/2,S=r?.stroke||a.cssVar["--color"],N=r?.labelColor||a.cssVar["--color"],O="s-"+n,_=e.markdown?e.markdown(o,t):o;y===B.LHS?(b=gt(`M ${v+10} ${T} c -5 0 -10 5 -10 10 L ${v} ${E-10} c 0 5 5 10 10 10 M ${v} ${C} h -10`,S),x=Le(_,v-20,C,{anchor:"end",color:N,dataType:"summary",svgId:O})):(b=gt(`M ${p-10} ${T} c 5 0 10 5 10 10 L ${p} ${E-10} c 0 5 -5 10 -10 10 M ${p} ${C} h 10`,S),x=Le(_,p+20,C,{anchor:"start",color:N,dataType:"summary",svgId:O}));const F=Zn(O);return F.appendChild(b),e.labelContainer.appendChild(x),de(x),F.summaryObj=t,F.labelEl=x,d.appendChild(F),F},to=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(e={}){if(!this.currentNodes)return;const{currentNodes:t,summaries:n,bus:o}=this,{parent:s,start:i,end:l}=Jn(t),r={id:G(),parent:s,start:i,end:l,label:"summary",style:e.style},c=je(this,r);n.push(r),this.editSummary(c),o.fire("operation",{name:"createSummary",obj:r})},createSummaryFrom:function(e){const t=G(),n={...e,id:t};je(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(e){e&&e.labelEl&&Ve(this,e.labelEl,e.summaryObj)},removeSummary:function(e){const t=this.summaries.findIndex(n=>n.id===e);t>-1&&(this.summaries.splice(t,1),this.nodes.querySelector("#s-"+e)?.remove(),this.nodes.querySelector("#label-s-"+e)?.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:e}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(e=>{try{je(this,e)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(e){const t=e.labelEl;t&&t.classList.add("selected"),this.currentSummary=e},unselectSummary:function(){this.currentSummary?.labelEl?.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),P="http://www.w3.org/2000/svg";function no(e,t){const n=document.createElementNS(P,"svg");return A(n,{version:"1.1",xmlns:P,height:e,width:t}),n}function oo(e,t){return(parseInt(e)-parseInt(t))/2}function so(e,t,n,o){const s=document.createElementNS(P,"g");let i="";return e.text?i=e.text.textContent:i=e.childNodes[0].textContent,i.split(`
16
- `).forEach((r,c)=>{const a=document.createElementNS(P,"text");A(a,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+oo(t.lineHeight,t.fontSize)*(c+1)+parseFloat(t.fontSize)*(c+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),a.innerHTML=r,s.appendChild(a)}),s}function io(e,t,n,o){let s="";e.nodeObj?.dangerouslySetInnerHTML?s=e.nodeObj.dangerouslySetInnerHTML:e.text?s=e.text.textContent:s=e.childNodes[0].textContent;const i=document.createElementNS(P,"foreignObject");A(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const l=document.createElement("div");return A(l,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),l.innerHTML=s,i.appendChild(l),i}function ro(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=document.createElementNS(P,"rect");return A(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function ge(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=j(e.nodes,t),l=document.createElementNS(P,"rect");A(l,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const r=document.createElementNS(P,"g");r.appendChild(l);let c;return n?c=io(t,o,s,i):c=so(t,o,s,i),r.appendChild(c),r}function lo(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=document.createElementNS(P,"a"),l=document.createElementNS(P,"text");return A(l,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),l.innerHTML=t.textContent,i.appendChild(l),i.setAttribute("href",t.href),i}function co(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=document.createElementNS(P,"image");return A(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const me=100,ao='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',ho=(e,t=!1)=>{const n=e.nodes,o=n.offsetHeight+me*2,s=n.offsetWidth+me*2,i=no(o+"px",s+"px"),l=document.createElementNS(P,"svg"),r=document.createElementNS(P,"rect");A(r,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(r),n.querySelectorAll(".subLines").forEach(h=>{const u=h.cloneNode(!0),{offsetLeft:y,offsetTop:v}=j(n,h.parentElement);u.setAttribute("x",`${y}`),u.setAttribute("y",`${v}`),l.appendChild(u)});const c=n.querySelector(".lines")?.cloneNode(!0);c&&l.appendChild(c);const a=n.querySelector(".topiclinks")?.cloneNode(!0);a&&l.appendChild(a);const d=n.querySelector(".summary")?.cloneNode(!0);return d&&l.appendChild(d),n.querySelectorAll("me-tpc").forEach(h=>{h.nodeObj.dangerouslySetInnerHTML?l.appendChild(ge(e,h,!t)):(l.appendChild(ro(e,h)),l.appendChild(ge(e,h.text,!t)))}),n.querySelectorAll(".tags > span").forEach(h=>{l.appendChild(ge(e,h))}),n.querySelectorAll(".icons > span").forEach(h=>{l.appendChild(ge(e,h))}),n.querySelectorAll(".hyper-link").forEach(h=>{l.appendChild(lo(e,h))}),n.querySelectorAll("img").forEach(h=>{l.appendChild(co(e,h))}),A(l,{x:me+"",y:me+"",overflow:"visible"}),i.appendChild(l),i},fo=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),ao+e.outerHTML);function uo(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=s=>{t(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(e)})}const po=Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await uo(n);return new Promise((s,i)=>{const l=new Image;l.setAttribute("crossOrigin","anonymous"),l.onload=()=>{const r=document.createElement("canvas");r.width=l.width,r.height=l.height,r.getContext("2d").drawImage(l,0,0),r.toBlob(s,"image/png",1)},l.src=o,l.onerror=i})},exportSvg:function(e=!1,t){const n=ho(this,e),o=fo(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"}));function go(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const mt=Object.keys(dt),yt={};for(let e=0;e<mt.length;e++){const t=mt[e];yt[t]=go(dt[t],t)}const mo={getObjById:ie,generateNewObj:vt,layout:$t,linkDiv:Xt,editTopic:Yt,createWrapper:Rt,createParent:Bt,createChildren:It,createTopic:Ft,findEle:ze,changeTheme:rn,...jn,...yt,...Un,...to,...po,init(e){if(e=JSON.parse(JSON.stringify(e)),!e||!e.nodeData)return new Error("MindElixir: `data` is required");e.direction!==void 0&&(this.direction=e.direction),this.changeTheme(e.theme||this.theme,!1),this.nodeData=e.nodeData,z(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&Jt(this),this.keypress&&St(this,this.keypress),this.editable&&sn(this),this.contextMenu&&this.disposable.push(zt(this,this.contextMenu)),this.draggable&&this.disposable.push(Dt()),this.allowUndo&&this.disposable.push(Kt(this)),this.layout(),this.linkDiv(),this.toCenter()},destroy(){this.disposable.forEach(e=>e()),this.el&&(this.el.innerHTML=""),this.el=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,this.selection?.destroy(),this.selection=void 0}};function yo({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,containerHeight:a}){let d=t+n/2;const h=e+o/2;let u;c===B.LHS?u=i+l:u=i;const y=s+r/2,p=(1-Math.abs(y-h)/a)*.25*(n/2);return c===B.LHS?d=d-n/10-p:d=d+n/10+p,`M ${d} ${h} Q ${d} ${y} ${u} ${y}`}function vo({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,isFirst:a}){const d=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let h=0,u=0;a?h=e+o/2:h=e+o;const y=s+r;let v=0,p=0,g=0;const m=Math.abs(h-y)/300*d;return c===B.LHS?(g=t,v=g+d,p=g-d,u=i+d,`M ${v} ${h} C ${g} ${h} ${g+m} ${y} ${p} ${y} H ${u}`):(g=t+n,v=g-d,p=g+d,u=i+l-d,`M ${v} ${h} C ${g} ${h} ${g-m} ${y} ${p} ${y} H ${u}`)}const bo="5.6.0";function wo(e){return{x:0,y:0,moved:!1,mousedown:!1,onMove(t,n){this.mousedown&&(this.moved=!0,e.move(t,n))},clear(){this.mousedown=!1}}}const te=document;function R({el:e,direction:t,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:l,keypress:r,mouseSelectionButton:c,selectionContainer:a,before:d,newTopicName:h,allowUndo:u,generateMainBranch:y,generateSubBranch:v,overflowHidden:p,theme:g,alignment:m,scaleSensitivity:b,scaleMax:x,scaleMin:L,handleWheel:T,markdown:E,imageProxy:C}){let S=null;const N=Object.prototype.toString.call(e);if(N==="[object HTMLDivElement]"?S=e:N==="[object String]"&&(S=document.querySelector(e)),!S)throw new Error("MindElixir: el is not a valid element");S.style.position="relative",S.innerHTML="",this.el=S,this.disposable=[],this.before=d||{},this.locale=n||"en",this.newTopicName=h||"New Node",this.contextMenu=i??!0,this.toolBar=l??!0,this.keypress=r??!0,this.mouseSelectionButton=c??0,this.direction=t??1,this.draggable=o??!0,this.editable=s??!0,this.allowUndo=u??!0,this.scaleSensitivity=b??.1,this.scaleMax=x??1.4,this.scaleMin=L??.2,this.generateMainBranch=y||yo,this.generateSubBranch=v||vo,this.overflowHidden=p??!1,this.alignment=m??"root",this.handleWheel=T??!0,this.markdown=E||void 0,this.imageProxy=C||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=wo(this),this.bus=Ot(),this.container=te.createElement("div"),this.selectionContainer=a||this.container,this.container.className="map-container";const O=window.matchMedia("(prefers-color-scheme: dark)");this.theme=g||(O.matches?be:ve);const _=te.createElement("div");_.className="map-canvas",this.map=_,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=te.createElement("me-nodes"),this.lines=ne("lines"),this.summarySvg=ne("summary"),this.linkController=ne("linkcontroller"),this.P2=te.createElement("div"),this.P3=te.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=qe(),this.line2=qe(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=ne("topiclinks"),this.labelContainer=te.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Pt(this))}return R.prototype=mo,Object.defineProperty(R.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),R.LEFT=0,R.RIGHT=1,R.SIDE=2,R.THEME=ve,R.DARK_THEME=be,R.version=bo,R.E=ze,R.new=e=>({nodeData:{id:G(),topic:e||"new topic",children:[]}}),R})();
15
+ `,Ke(s),e.scrollIntoView(s),s.addEventListener("keydown",i=>{i.stopPropagation();const l=i.key;if(l==="Enter"||l==="Tab"){if(i.shiftKey)return;i.preventDefault(),s.blur(),e.container.focus()}}),s.addEventListener("blur",()=>{if(!s)return;const i=s.textContent?.trim()||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(e.markdown?t.innerHTML=e.markdown(n.label,n):t.textContent=n.label,ue(t),"parent"in n?e.bus.fire("operation",{name:"finishEditSummary",obj:n}):e.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},zt=function(e){const t=this.map.querySelector("me-root"),n=t.offsetTop,o=t.offsetLeft,s=t.offsetWidth,i=t.offsetHeight,l=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let r=0;r<l.length;r++){const c=l[r],a=c.querySelector("me-tpc"),{offsetLeft:d,offsetTop:h}=j(this.nodes,a),u=a.offsetWidth,y=a.offsetHeight,v=c.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:h,cL:d,cW:u,cH:y,direction:v,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,m=a.nodeObj.branchColor||g[r%g.length];if(a.style.borderColor=m,this.lines.appendChild(qe(p,m,"3")),e&&e!==c)continue;const b=oe("subLines"),x=c.lastChild;x.tagName==="svg"&&x.remove(),c.appendChild(b),Je(this,b,m,c,v,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},Je=function(e,t,n,o,s,i){const l=o.firstChild,r=o.children[1].children;if(r.length===0)return;const c=l.offsetTop,a=l.offsetLeft,d=l.offsetWidth,h=l.offsetHeight;for(let u=0;u<r.length;u++){const y=r[u],v=y.firstChild,p=v.offsetTop,g=v.offsetLeft,m=v.offsetWidth,b=v.offsetHeight,x=v.firstChild.nodeObj.branchColor||n,L=e.generateSubBranch({pT:c,pL:a,pW:d,pH:h,cT:p,cL:g,cW:m,cH:b,direction:s,isFirst:i});t.appendChild(qe(L,x,"2"));const k=v.children[1];if(k){if(!k.expanded)continue}else continue;Je(e,t,x,y,s)}},Ze={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},Qe={cn:Ze,zh_CN:Ze,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",linkBidirectional:"雙向連接",clickTips:"請點擊目標節點",summary:"摘要"},en:{addChild:"Add child",addParent:"Add parent",addSibling:"Add sibling",removeNode:"Remove node",focus:"Focus Mode",cancelFocus:"Cancel Focus Mode",moveUp:"Move up",moveDown:"Move down",link:"Link",linkBidirectional:"Bidirectional Link",clickTips:"Please click the target node",summary:"Summary"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",linkBidirectional:"Двунаправленная ссылка",clickTips:"Пожалуйста, нажмите на целевой узел",summary:"Описание"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",linkBidirectional:"双方向リンク",clickTips:"ターゲットノードをクリックしてください",summary:"概要"},pt:{addChild:"Adicionar item filho",addParent:"Adicionar item pai",addSibling:"Adicionar item irmao",removeNode:"Remover item",focus:"Modo Foco",cancelFocus:"Cancelar Modo Foco",moveUp:"Mover para cima",moveDown:"Mover para baixo",link:"Link",linkBidirectional:"Link bidirecional",clickTips:"Favor clicar no item alvo",summary:"Resumo"},it:{addChild:"Aggiungi figlio",addParent:"Aggiungi genitore",addSibling:"Aggiungi fratello",removeNode:"Rimuovi nodo",focus:"Modalità Focus",cancelFocus:"Annulla Modalità Focus",moveUp:"Sposta su",moveDown:"Sposta giù",link:"Collega",linkBidirectional:"Collegamento bidirezionale",clickTips:"Si prega di fare clic sul nodo di destinazione",summary:"Unisci nodi"},es:{addChild:"Agregar hijo",addParent:"Agregar padre",addSibling:"Agregar hermano",removeNode:"Eliminar nodo",focus:"Modo Enfoque",cancelFocus:"Cancelar Modo Enfoque",moveUp:"Mover hacia arriba",moveDown:"Mover hacia abajo",link:"Enlace",linkBidirectional:"Enlace bidireccional",clickTips:"Por favor haga clic en el nodo de destino",summary:"Resumen"},fr:{addChild:"Ajout enfant",addParent:"Ajout parent",addSibling:"Ajout voisin",removeNode:"Supprimer",focus:"Cibler",cancelFocus:"Retour",moveUp:"Monter",moveDown:"Descendre",link:"Lier",linkBidirectional:"Lien bidirectionnel",clickTips:"Cliquer sur le noeud cible",summary:"Annoter"},ko:{addChild:"자식 추가",addParent:"부모 추가",addSibling:"형제 추가",removeNode:"노드 삭제",focus:"포커스 모드",cancelFocus:"포커스 모드 취소",moveUp:"위로 이동",moveDown:"아래로 이동",link:"연결",linkBidirectional:"양방향 연결",clickTips:"대상 노드를 클릭하십시오",summary:"요약"},ro:{addChild:"Adaugă sub-nod",addParent:"Adaugă nod părinte",addSibling:"Adaugă nod la același nivel",removeNode:"Șterge nodul",focus:"Focalizare",cancelFocus:"Anulează focalizarea",moveUp:"Mută în sus",moveDown:"Mută în jos",link:"Creează legătură",linkBidirectional:"Creează legătură bidirecțională",clickTips:"Click pe nodul țintă",summary:"Rezumat"}};function Gt(e,t){t=t===!0?{focus:!0,link:!0}:t;const n=E=>{const C=document.createElement("div");return C.innerText=E,C.className="tips",C},o=(E,C,S)=>{const N=document.createElement("li");return N.id=E,N.innerHTML=`<span>${xe(C)}</span><span ${S?'class="key"':""}>${xe(S)}</span>`,N},s=Qe[e.locale]?e.locale:"en",i=Qe[s],l=o("cm-add_child",i.addChild,"Tab"),r=o("cm-add_parent",i.addParent,"Ctrl + Enter"),c=o("cm-add_sibling",i.addSibling,"Enter"),a=o("cm-remove_child",i.removeNode,"Delete"),d=o("cm-fucus",i.focus,""),h=o("cm-unfucus",i.cancelFocus,""),u=o("cm-up",i.moveUp,"PgUp"),y=o("cm-down",i.moveDown,"Pgdn"),v=o("cm-link",i.link,""),p=o("cm-link-bidirectional",i.linkBidirectional,""),g=o("cm-summary",i.summary,""),m=document.createElement("ul");if(m.className="menu-list",m.appendChild(l),m.appendChild(r),m.appendChild(c),m.appendChild(a),t.focus&&(m.appendChild(d),m.appendChild(h)),m.appendChild(u),m.appendChild(y),m.appendChild(g),t.link&&(m.appendChild(v),m.appendChild(p)),t&&t.extend)for(let E=0;E<t.extend.length;E++){const C=t.extend[E],S=o(C.name,C.name,C.key||"");m.appendChild(S),S.onclick=N=>{C.onclick(N)}}const b=document.createElement("div");b.className="context-menu",b.appendChild(m),b.hidden=!0,e.container.append(b);let x=!0;const L=E=>{const C=E.target;if(de(C)){C.parentElement.tagName==="ME-ROOT"?x=!0:x=!1,x?(d.className="disabled",u.className="disabled",y.className="disabled",r.className="disabled",c.className="disabled",a.className="disabled"):(d.className="",u.className="",y.className="",r.className="",c.className="",a.className=""),b.hidden=!1,m.style.top="",m.style.bottom="",m.style.left="",m.style.right="";const S=m.getBoundingClientRect(),N=m.offsetHeight,O=m.offsetWidth,_=E.clientY-S.top,F=E.clientX-S.left;N+_>window.innerHeight?(m.style.top="",m.style.bottom="0px"):(m.style.bottom="",m.style.top=_+15+"px"),O+F>window.innerWidth?(m.style.left="",m.style.right="0px"):(m.style.right="",m.style.left=F+10+"px")}};e.bus.addListener("showContextMenu",L),b.onclick=E=>{E.target===b&&(b.hidden=!0)},l.onclick=()=>{e.addChild(),b.hidden=!0},r.onclick=()=>{e.insertParent(),b.hidden=!0},c.onclick=()=>{x||(e.insertSibling("after"),b.hidden=!0)},a.onclick=()=>{x||(e.removeNodes(e.currentNodes||[]),b.hidden=!0)},d.onclick=()=>{x||(e.focusNode(e.currentNode),b.hidden=!0)},h.onclick=()=>{e.cancelFocus(),b.hidden=!0},u.onclick=()=>{x||(e.moveUpNode(),b.hidden=!0)},y.onclick=()=>{x||(e.moveDownNode(),b.hidden=!0)};const k=E=>{b.hidden=!0;const C=e.currentNode,S=n(i.clickTips);e.container.appendChild(S),e.map.addEventListener("click",N=>{N.preventDefault(),S.remove();const O=N.target;(O.parentElement.tagName==="ME-PARENT"||O.parentElement.tagName==="ME-ROOT")&&e.createArrow(C,O,E)},{once:!0})};return v.onclick=()=>k(),p.onclick=()=>k({bidirectional:!0}),g.onclick=()=>{b.hidden=!0,e.createSummary(),e.unselectNodes(e.currentNodes)},()=>{l.onclick=null,r.onclick=null,c.onclick=null,a.onclick=null,d.onclick=null,h.onclick=null,u.onclick=null,y.onclick=null,v.onclick=null,g.onclick=null,b.onclick=null,e.container.oncontextmenu=null}}const Kt=function(e){return["createSummary","removeSummary","finishEditSummary"].includes(e.name)?{type:"summary",value:e.obj.id}:["createArrow","removeArrow","finishEditArrowLabel"].includes(e.name)?{type:"arrow",value:e.obj.id}:["removeNodes","copyNodes","moveNodeBefore","moveNodeAfter","moveNodeIn"].includes(e.name)?{type:"nodes",value:e.objs.map(t=>t.id)}:{type:"nodes",value:[e.obj.id]}};function qt(e){let t=[],n=-1,o=e.getData(),s=[];e.undo=function(){if(n>-1){const c=t[n];o=c.prev,e.refresh(c.prev);try{c.currentTarget.type==="nodes"&&(c.operation==="removeNodes"?e.selectNodes(c.currentTarget.value.map(a=>this.findEle(a))):e.selectNodes(c.currentSelected.map(a=>this.findEle(a))))}catch{}finally{n--}}},e.redo=function(){if(n<t.length-1){n++;const c=t[n];o=c.next,e.refresh(c.next);try{c.currentTarget.type==="nodes"&&(c.operation==="removeNodes"?e.selectNodes(c.currentSelected.map(a=>this.findEle(a))):e.selectNodes(c.currentTarget.value.map(a=>this.findEle(a))))}catch{}}};const i=function(c){if(c.name==="beginEdit")return;t=t.slice(0,n+1);const a=e.getData(),d={prev:o,operation:c.name,currentSelected:s.map(h=>h.id),currentTarget:Kt(c),next:a};t.push(d),o=a,n=t.length-1},l=function(c){(c.metaKey||c.ctrlKey)&&(c.shiftKey&&c.key==="Z"||c.key==="y")?e.redo():(c.metaKey||c.ctrlKey)&&c.key==="z"&&e.undo()},r=function(){s=e.currentNodes.map(c=>c.nodeObj)};return e.bus.addListener("operation",i),e.bus.addListener("selectNodes",r),e.container.addEventListener("keydown",l),()=>{e.bus.removeListener("operation",i),e.bus.removeListener("selectNodes",r),e.container.removeEventListener("keydown",l)}}const Vt={side:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>',left:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>',right:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>',full:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',living:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>',zoomin:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>',zoomout:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>'},q=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=Vt[t],n};function Ut(e){const t=document.createElement("div"),n=q("fullscreen","full"),o=q("toCenter","living"),s=q("zoomout","zoomout"),i=q("zoomin","zoomin");t.appendChild(n),t.appendChild(o),t.appendChild(s),t.appendChild(i),t.className="mind-elixir-toolbar rb";let l=null;const r=()=>{const a=e.container.getBoundingClientRect(),d=Ne(e.map.style.transform),h=a.width/2,u=a.height/2,y=(h-d.x)/e.scaleVal,v=(u-d.y)/e.scaleVal;l={containerRect:a,currentTransform:d,mapCenterX:y,mapCenterY:v}},c=()=>{if(l){const a=e.container.getBoundingClientRect(),d=a.width/2,h=a.height/2,u=d-l.mapCenterX*e.scaleVal,y=h-l.mapCenterY*e.scaleVal,v=u-l.currentTransform.x,p=y-l.currentTransform.y;e.move(v,p)}};return e.el.addEventListener("fullscreenchange",c),n.onclick=()=>{r(),document.fullscreenElement!==e.el?e.el.requestFullscreen():document.exitFullscreen()},o.onclick=()=>{e.toCenter()},s.onclick=()=>{e.scale(e.scaleVal-e.scaleSensitivity)},i.onclick=()=>{e.scale(e.scaleVal+e.scaleSensitivity)},t}function Jt(e){const t=document.createElement("div"),n=q("tbltl","left"),o=q("tbltr","right"),s=q("tblts","side");return t.appendChild(n),t.appendChild(o),t.appendChild(s),t.className="mind-elixir-toolbar lt",n.onclick=()=>{e.initLeft()},o.onclick=()=>{e.initRight()},s.onclick=()=>{e.initSide()},t}function Zt(e){e.container.append(Ut(e)),e.container.append(Jt(e))}class Qt{_listeners=new Map;addEventListener(t,n){const o=this._listeners.get(t)??new Set;return this._listeners.set(t,o),o.add(n),this}removeEventListener(t,n){return this._listeners.get(t)?.delete(n),this}dispatchEvent(t,...n){let o=!0;for(const s of this._listeners.get(t)??[])o=s(...n)!==!1&&o;return o}unbindAllListeners(){this._listeners.clear()}on=this.addEventListener;off=this.removeEventListener;emit=this.dispatchEvent}const et=(e,t="px")=>typeof e=="number"?e+t:e,W=({style:e},t,n)=>{if(typeof t=="object")for(const[o,s]of Object.entries(t))s!==void 0&&(e[o]=et(s));else n!==void 0&&(e[t]=et(n))},tt=(e=0,t=0,n=0,o=0)=>{const s={x:e,y:t,width:n,height:o,top:t,left:e,right:e+n,bottom:t+o};return{...s,toJSON:()=>JSON.stringify(s)}},en=e=>{let t,n=-1,o=!1;return{next:(...s)=>{t=s,o||(o=!0,n=requestAnimationFrame(()=>{e(...t),o=!1}))},cancel:()=>{cancelAnimationFrame(n),o=!1}}},nt=(e,t,n="touch")=>{switch(n){case"center":{const o=t.left+t.width/2,s=t.top+t.height/2;return o>=e.left&&o<=e.right&&s>=e.top&&s<=e.bottom}case"cover":return t.left>=e.left&&t.top>=e.top&&t.right<=e.right&&t.bottom<=e.bottom;case"touch":return e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}},tn=()=>matchMedia("(hover: none), (pointer: coarse)").matches,nn=()=>"safari"in window,Me=e=>Array.isArray(e)?e:[e],ot=e=>(t,n,o,s={})=>{(t instanceof HTMLCollection||t instanceof NodeList)&&(t=Array.from(t)),n=Me(n),t=Me(t);for(const i of t)if(i)for(const l of n)i[e](l,o,{capture:!1,...s})},X=ot("addEventListener"),H=ot("removeEventListener"),pe=e=>{const{clientX:t,clientY:n,target:o}=e.touches?.[0]??e;return{x:t,y:n,target:o}},Q=(e,t=document)=>Me(e).map(n=>typeof n=="string"?Array.from(t.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),on=(e,t)=>t.some(n=>typeof n=="number"?e.button===n:typeof n=="object"?n.button!==e.button?!1:n.modifiers.every(o=>{switch(o){case"alt":return e.altKey;case"ctrl":return e.ctrlKey||e.metaKey;case"shift":return e.shiftKey}}):!1),{abs:V,max:st,min:it,ceil:rt}=Math,lt=(e=[])=>({stored:e,selected:[],touched:[],changed:{added:[],removed:[]}});class sn extends Qt{static version="mind-elixir-fork";_options;_selection=lt();_area;_clippingElement;_targetElement;_targetBoundary;_targetBoundaryScrolled=!0;_targetRect;_selectables=[];_latestElement;_areaLocation={y1:0,x2:0,y2:0,x1:0};_areaRect=tt();_singleClick=!0;_frame;_scrollAvailable=!0;_scrollingActive=!1;_scrollSpeed={x:0,y:0};_scrollDelta={x:0,y:0};_lastMousePosition={x:0,y:0};constructor(t){super(),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",mindElixirInstance:void 0,...t,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...t.behaviour,startThreshold:t.behaviour?.startThreshold?typeof t.behaviour.startThreshold=="number"?t.behaviour.startThreshold:{x:10,y:10,...t.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...t.behaviour?.scrolling,startScrollMargins:{x:0,y:0,...t.behaviour?.scrolling?.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...t.features,singleTap:{allow:!0,intersect:"native",...t.features?.singleTap}}};for(const i of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[i]=="function"&&(this[i]=this[i].bind(this));const{document:n,selectionAreaClass:o,selectionContainerClass:s}=this._options;this._area=n.createElement("div"),this._clippingElement=n.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(o),s&&this._clippingElement.classList.add(s),W(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),W(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=en(i=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",i),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(t=!0){const{document:n,features:o}=this._options,s=t?X:H;s(n,"mousedown",this._onTapStart),o.touch&&s(n,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(t,n=!1){const{x:o,y:s,target:i}=pe(t),{document:l,startAreas:r,boundaries:c,features:a,behaviour:d}=this._options,h=i.getBoundingClientRect();if(t instanceof MouseEvent&&!on(t,d.triggers))return;const u=Q(r,l),y=Q(c,l);this._targetElement=y.find(m=>nt(m.getBoundingClientRect(),h));const v=t.composedPath(),p=u.find(m=>v.includes(m));if(this._targetBoundary=y.find(m=>v.includes(m)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",t)===!1)return;this._areaLocation={x1:o,y1:s,x2:0,y2:0};const g=l.scrollingElement??l.body;this._scrollDelta={x:g.scrollLeft,y:g.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),X(l,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),X(l,["mouseup","touchcancel","touchend"],this._onTapStop),X(l,"scroll",this._onScroll),a.deselectOnBlur&&(this._targetBoundaryScrolled=!1,X(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(t){const{singleTap:{intersect:n},range:o}=this._options.features,s=pe(t);let i;if(n==="native")i=s.target;else if(n==="touch"){this.resolveSelectables();const{x:r,y:c}=s;i=this._selectables.find(a=>{const{right:d,left:h,top:u,bottom:y}=a.getBoundingClientRect();return r<d&&r>h&&c<y&&c>u})}if(!i)return;for(this.resolveSelectables();!this._selectables.includes(i);)if(i.parentElement)i=i.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:l}=this._selection;if(this._emitEvent("start",t),t.shiftKey&&o&&this._latestElement){const r=this._latestElement,[c,a]=r.compareDocumentPosition(i)&4?[i,r]:[r,i],d=[...this._selectables.filter(h=>h.compareDocumentPosition(c)&4&&h.compareDocumentPosition(a)&2),c,a];this.select(d),this._latestElement=r}else l.includes(i)&&(l.length===1||t.ctrlKey||l.every(r=>this._selection.stored.includes(r)))?this.deselect(i):(this.select(i),this._latestElement=i)}_delayedTapMove(t){const{container:n,document:o,behaviour:{startThreshold:s}}=this._options,{x1:i,y1:l}=this._areaLocation,{x:r,y:c}=pe(t);if(typeof s=="number"&&V(r+c-(i+l))>=s||typeof s=="object"&&V(r-i)>=s.x||V(c-l)>=s.y){if(H(o,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",t)===!1){H(o,["mouseup","touchcancel","touchend"],this._onTapStop);return}X(o,["mousemove","touchmove"],this._onTapMove,{passive:!1}),W(this._area,"display","block"),Q(n,o)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(X(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),X(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(a=>this._targetElement.contains(a))),this._setupSelectionArea(),this._emitEvent("start",t),this._onTapMove(t)}this._handleMoveEvent(t)}_setupSelectionArea(){const{_clippingElement:t,_targetElement:n,_area:o}=this,s=this._targetRect=n.getBoundingClientRect();this._scrollAvailable?(W(t,{top:s.top,left:s.left,width:s.width,height:s.height}),W(o,{marginTop:-s.top,marginLeft:-s.left})):(W(t,{top:0,left:0,width:"100%",height:"100%"}),W(o,{marginTop:0,marginLeft:0}))}_onTapMove(t){const{_scrollSpeed:n,_areaLocation:o,_options:s,_frame:i}=this,{speedDivider:l}=s.behaviour.scrolling;this._targetElement;const{x:r,y:c}=pe(t);if(o.x2=r,o.y2=c,this._lastMousePosition.x=r,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(n.y||n.x)){this._scrollingActive=!0;const a=()=>{if(!n.x&&!n.y){this._scrollingActive=!1;return}const d=this._options.mindElixirInstance;if(d&&d.move){const h=n.x?rt(n.x/l):0,u=n.y?rt(n.y/l):0;(h||u)&&(d.move(-h,-u),o.x1-=h,o.y1-=u)}i.next(t),requestAnimationFrame(a)};requestAnimationFrame(a)}else i.next(t);this._handleMoveEvent(t)}_handleMoveEvent(t){const{features:n}=this._options;(n.touch&&tn()||this._scrollAvailable&&nn())&&t.preventDefault()}_onScroll(){const{_scrollDelta:t,_options:{document:n}}=this,{scrollTop:o,scrollLeft:s}=n.scrollingElement??n.body;this._areaLocation.x1+=t.x-s,this._areaLocation.y1+=t.y-o,t.x=s,t.y=o,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,H(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(t){const{manualSpeed:n}=this._options.behaviour.scrolling,o=t.deltaY?t.deltaY>0?1:-1:0,s=t.deltaX?t.deltaX>0?1:-1:0;this._scrollSpeed.y+=o*n,this._scrollSpeed.x+=s*n,this._onTapMove(t),t.preventDefault()}_keyboardScroll(t){const{manualSpeed:n}=this._options.behaviour.scrolling,o=t.key==="ArrowLeft"?-1:t.key==="ArrowRight"?1:0,s=t.key==="ArrowUp"?-1:t.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(o)*n,this._scrollSpeed.y+=Math.sign(s)*n,t.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:t,_areaLocation:n,_targetElement:o,_options:s}=this,i=this._targetRect,{x1:l,y1:r}=n;let{x2:c,y2:a}=n;const{behaviour:{scrolling:{startScrollMargins:d}}}=s;c<i.left+d.x?(t.x=-V(i.left-c+d.x),c=c<i.left?i.left:c):c>i.right-d.x?(t.x=V(i.left+i.width-c-d.x),c=c>i.right?i.right:c):t.x=0,a<i.top+d.y?(t.y=-V(i.top-a+d.y),a=a<i.top?i.top:a):a>i.bottom-d.y?(t.y=V(i.top+i.height-a-d.y),a=a>i.bottom?i.bottom:a):t.y=0;const h=it(l,c),u=it(r,a),y=st(l,c),v=st(r,a);this._areaRect=tt(h,u,y-h,v-u)}_redrawSelectionArea(){const{x:t,y:n,width:o,height:s}=this._areaRect,{style:i}=this._area;i.left=`${t}px`,i.top=`${n}px`,i.width=`${o}px`,i.height=`${s}px`}_onTapStop(t,n){const{document:o,features:s}=this._options,{_singleClick:i}=this;H(this._targetElement,"scroll",this._onStartAreaScroll),H(o,["mousemove","touchmove"],this._delayedTapMove),H(o,["touchmove","mousemove"],this._onTapMove),H(o,["mouseup","touchcancel","touchend"],this._onTapStop),H(o,"scroll",this._onScroll),this._keepSelection(),t&&i&&s.singleTap.allow?this._onSingleTap(t):!i&&!n&&(this._updateElementSelection(),this._emitEvent("stop",t)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,H(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),H(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),this._frame?.cancel(),W(this._area,"display","none")}_updateElementSelection(){const{_selectables:t,_options:n,_selection:o,_areaRect:s}=this,{stored:i,selected:l,touched:r}=o,{intersect:c,overlap:a}=n.behaviour,d=a==="invert",h=[],u=[],y=[];for(let p=0;p<t.length;p++){const g=t[p];if(nt(s,g.getBoundingClientRect(),c)){if(l.includes(g))i.includes(g)&&!r.includes(g)&&r.push(g);else if(d&&i.includes(g)){y.push(g);continue}else u.push(g);h.push(g)}}d&&u.push(...i.filter(p=>!l.includes(p)));const v=a==="keep";for(let p=0;p<l.length;p++){const g=l[p];!h.includes(g)&&!(v&&i.includes(g))&&y.push(g)}o.selected=h,o.changed={added:u,removed:y},this._latestElement=void 0}_emitEvent(t,n){return this.emit(t,{event:n,store:this._selection,selection:this})}_keepSelection(){const{_options:t,_selection:n}=this,{selected:o,changed:s,touched:i,stored:l}=n,r=o.filter(c=>!l.includes(c));switch(t.behaviour.overlap){case"drop":{n.stored=[...r,...l.filter(c=>!i.includes(c))];break}case"invert":{n.stored=[...r,...l.filter(c=>!s.removed.includes(c))];break}case"keep":{n.stored=[...l,...o.filter(c=>!l.includes(c))];break}}}trigger(t,n=!0){this._onTapStart(t,n)}resolveSelectables(){this._selectables=Q(this._options.selectables,this._options.document)}clearSelection(t=!0,n=!1){const{selected:o,stored:s,changed:i}=this._selection;i.added=[],i.removed.push(...o,...t?s:[]),n||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=lt(t?[]:s)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(t){Object.assign(this._areaLocation,t),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(t=!1){this._onTapStop(null,!t)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}enable=this._toggleStartEvents;disable=this._toggleStartEvents.bind(this,!1);select(t,n=!1){const{changed:o,selected:s,stored:i}=this._selection,l=Q(t,this._options.document).filter(r=>!s.includes(r)&&!i.includes(r));return i.push(...l),s.push(...l),o.added.push(...l),o.removed=[],this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null)),l}deselect(t,n=!1){const{selected:o,stored:s,changed:i}=this._selection,l=Q(t,this._options.document).filter(r=>o.includes(r)||s.includes(r));this._selection.stored=s.filter(r=>!l.includes(r)),this._selection.selected=o.filter(r=>!l.includes(r)),this._selection.changed.added=[],this._selection.changed.removed.push(...l.filter(r=>!i.removed.includes(r))),this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null))}}function rn(e){const t=e.mouseSelectionButton===2?[2]:[0],n=new sn({selectables:[".map-container me-tpc"],boundaries:[e.container],container:e.selectionContainer,mindElixirInstance:e,features:{touch:!1},behaviour:{triggers:t,scrolling:{speedDivider:10,startScrollMargins:{x:50,y:50}}}}).on("beforestart",({event:o})=>{if(e.spacePressed)return!1;const s=o.target;if(s.id==="input-box"||s.className==="circle"||e.container.querySelector(".context-menu")?.contains(s))return!1;if(!o.ctrlKey&&!o.metaKey){if(s.tagName==="ME-TPC"&&s.classList.contains("selected"))return!1;e.clearSelection()}const i=n.getSelectionArea();return i.style.background="#4f90f22d",i.style.border="1px solid #4f90f2",i.parentElement&&(i.parentElement.style.zIndex="9999"),!0}).on("move",({store:{changed:{added:o,removed:s}}})=>{if(o.length>0||s.length>0,o.length>0){for(const i of o)i.className="selected";e.currentNodes=[...e.currentNodes,...o],e.bus.fire("selectNodes",o.map(i=>i.nodeObj))}if(s.length>0){for(const i of s)i.classList.remove("selected");e.currentNodes=e.currentNodes.filter(i=>!s?.includes(i)),e.bus.fire("unselectNodes",s.map(i=>i.nodeObj))}});e.selection=n}const ln=function(e,t=!0){this.theme=e;const o={...(e.type==="dark"?le:re).cssVar,...e.cssVar},s=Object.keys(o);for(let i=0;i<s.length;i++){const l=s[i];this.container.style.setProperty(l,o[l])}t&&this.refresh()},ee=e=>{const t=e.parent?.children,n=t?.indexOf(e)??0;return{siblings:t,index:n}};function cn(e){const{siblings:t,index:n}=ee(e);if(t===void 0)return;const o=t[n];n===0?(t[n]=t[t.length-1],t[t.length-1]=o):(t[n]=t[n-1],t[n-1]=o)}function an(e){const{siblings:t,index:n}=ee(e);if(t===void 0)return;const o=t[n];n===t.length-1?(t[n]=t[0],t[0]=o):(t[n]=t[n+1],t[n+1]=o)}function ct(e){const{siblings:t,index:n}=ee(e);return t===void 0?0:(t.splice(n,1),t.length)}function dn(e,t,n){const{siblings:o,index:s}=ee(n);o!==void 0&&(t==="before"?o.splice(s,0,e):o.splice(s+1,0,e))}function hn(e,t){const{siblings:n,index:o}=ee(e);n!==void 0&&(n[o]=t,t.children=[e])}function fn(e,t,n){if(ct(t),n.parent?.parent||(t.direction=n.direction),e==="in")n.children?n.children.push(t):n.children=[t];else{t.direction!==void 0&&(t.direction=n.direction);const{siblings:o,index:s}=ee(n);if(o===void 0)return;e==="before"?o.splice(s,0,t):o.splice(s+1,0,t)}}const un=function({map:e,direction:t},n){if(t===0)return 0;if(t===1)return 1;if(t===2){const o=e.querySelector(".lhs")?.childElementCount||0,s=e.querySelector(".rhs")?.childElementCount||0;return o<=s?(n.direction=0,0):(n.direction=1,1)}},at=function(e,t,n){const o=n.children[0].children[0],s=t.parentElement;if(s.tagName==="ME-PARENT"){if(se(o),s.children[1])s.nextSibling.appendChild(n);else{const i=e.createChildren([n]);s.appendChild(Le(!0)),s.insertAdjacentElement("afterend",i)}e.linkDiv(n.offsetParent)}else s.tagName==="ME-ROOT"&&(un(e,o.nodeObj)===0?e.container.querySelector(".lhs")?.appendChild(n):e.container.querySelector(".rhs")?.appendChild(n),e.linkDiv())},pn=function(e,t){const n=e.parentNode;if(t===0){const o=n.parentNode.parentNode;o.tagName!=="ME-MAIN"&&(o.previousSibling.children[1].remove(),o.remove())}n.parentNode.remove()},dt={before:"beforebegin",after:"afterend"},se=function(e){const n=e.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()},gn=function(e,t){const n=e.nodeObj,o=Ee(n);o.style&&t.style&&(t.style=Object.assign(o.style,t.style));const s=Object.assign(n,t);_e.call(this,e,s),this.linkDiv(),this.bus.fire("operation",{name:"reshapeNode",obj:s,origin:o})},De=function(e,t,n){if(!t)return null;const o=t.nodeObj;o.expanded===!1&&(e.expandNode(t,!0),t=e.findEle(o.id));const s=n||e.generateNewObj();o.children?o.children.push(s):o.children=[s],G(e.nodeData);const{grp:i,top:l}=e.createWrapper(s);return at(e,t,i),{newTop:l,newNodeObj:s}},mn=function(e,t,n){const o=t||this.currentNode;if(!o)return;const s=o.nodeObj;if(s.parent){if(!s.parent?.parent&&this.direction===2){const a=this.map.querySelector(".lhs")?.childElementCount||0,d=this.map.querySelector(".rhs")?.childElementCount||0;if(!a||!d){this.addChild(this.findEle(s.parent.id),n);return}}}else{this.addChild();return}const i=n||this.generateNewObj();if(!s.parent?.parent){const a=o.closest("me-main").className===I.LHS?0:1;i.direction=a}dn(i,e,s),G(this.nodeData);const l=o.parentElement,{grp:r,top:c}=this.createWrapper(i);l.parentElement.insertAdjacentElement(dt[e],r),this.linkDiv(r.offsetParent),n||this.editTopic(c.firstChild),this.bus.fire("operation",{name:"insertSibling",type:e,obj:i}),this.selectNode(c.firstChild,!0)},yn=function(e,t){const n=e||this.currentNode;if(!n)return;se(n);const o=n.nodeObj;if(!o.parent)return;const s=t||this.generateNewObj();hn(o,s),G(this.nodeData);const i=n.parentElement.parentElement,{grp:l,top:r}=this.createWrapper(s,!0);r.appendChild(Le(!0)),i.insertAdjacentElement("afterend",l);const c=this.createChildren([i]);r.insertAdjacentElement("afterend",c),this.linkDiv(),t||this.editTopic(r.firstChild),this.selectNode(r.firstChild,!0),this.bus.fire("operation",{name:"insertParent",obj:s})},vn=function(e,t){const n=e||this.currentNode;if(!n)return;const o=De(this,n,t);if(!o)return;const{newTop:s,newNodeObj:i}=o;this.bus.fire("operation",{name:"addChild",obj:i}),t||this.editTopic(s.firstChild),this.selectNode(s.firstChild,!0)},bn=function(e,t){const n=Ee(e.nodeObj);Ce(n);const o=De(this,t,n);if(!o)return;const{newNodeObj:s}=o;this.selectNode(this.findEle(s.id)),this.bus.fire("operation",{name:"copyNode",obj:s})},wn=function(e,t){e=Se(e);const n=[];for(let o=0;o<e.length;o++){const s=e[o],i=Ee(s.nodeObj);Ce(i);const l=De(this,t,i);if(!l)return;const{newNodeObj:r}=l;n.push(r)}this.unselectNodes(this.currentNodes),this.selectNodes(n.map(o=>this.findEle(o.id))),this.bus.fire("operation",{name:"copyNodes",objs:n})},xn=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;cn(n);const o=t.parentNode.parentNode;o.parentNode.insertBefore(o,o.previousSibling),this.linkDiv(),this.bus.fire("operation",{name:"moveUpNode",obj:n})},Cn=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;an(n);const o=t.parentNode.parentNode;o.nextSibling?o.nextSibling.insertAdjacentElement("afterend",o):o.parentNode.prepend(o),this.linkDiv(),this.bus.fire("operation",{name:"moveDownNode",obj:n})},En=function(e){if(e.length===0)return;e=Se(e);for(const n of e){const o=n.nodeObj,s=ct(o);pn(n,s)}const t=e[e.length-1];this.selectNode(this.findEle(t.nodeObj.parent.id)),this.linkDiv(),this.bus.fire("operation",{name:"removeNodes",objs:e.map(n=>n.nodeObj)})},Pe=(e,t,n,o)=>{e=Se(e);let s=n.nodeObj;t==="in"&&s.expanded===!1&&(o.expandNode(n,!0),n=o.findEle(s.id),s=n.nodeObj),t==="after"&&(e=e.reverse());const i=[];for(const r of e){const c=r.nodeObj;if(fn(t,c,s),G(o.nodeData),t==="in"){const a=r.parentElement;at(o,n,a.parentElement)}else{se(r);const a=r.parentElement.parentNode;i.includes(a.parentElement)||i.push(a.parentElement),n.parentElement.parentNode.insertAdjacentElement(dt[t],a)}}for(const r of i)r.childElementCount===0&&r.tagName!=="ME-MAIN"&&(r.previousSibling.children[1].remove(),r.remove());o.linkDiv(),o.scrollIntoView(e[e.length-1]);const l=t==="before"?"moveNodeBefore":t==="after"?"moveNodeAfter":"moveNodeIn";o.bus.fire("operation",{name:l,objs:e.map(r=>r.nodeObj),toObj:s})},ht=Object.freeze(Object.defineProperty({__proto__:null,addChild:vn,beginEdit:function(e){const t=e||this.currentNode;t&&(t.nodeObj.dangerouslySetInnerHTML||this.editTopic(t))},copyNode:bn,copyNodes:wn,insertParent:yn,insertSibling:mn,moveDownNode:Cn,moveNodeAfter:function(e,t){Pe(e,"after",t,this)},moveNodeBefore:function(e,t){Pe(e,"before",t,this)},moveNodeIn:function(e,t){Pe(e,"in",t,this)},moveUpNode:xn,removeNodes:En,reshapeNode:gn,rmSubline:se,setNodeTopic:function(e,t){e.text.textContent=t,e.nodeObj.topic=t,this.linkDiv()}},Symbol.toStringTag,{value:"Module"}));function Sn(e){return{nodeData:e.isFocusMode?e.nodeDataBackup:e.nodeData,arrows:e.arrows,summaries:e.summaries,direction:e.direction,theme:e.theme}}const Nn=function(e){const t=this.container,n=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(n.top>o.bottom-50||n.bottom<o.top+50||n.left>o.right-50||n.right<o.left+50){const i=n.left+n.width/2,l=n.top+n.height/2,r=o.left+o.width/2,c=o.top+o.height/2,a=i-r,d=l-c;this.move(-a,-d,!0)}},Tn=function(e,t,n){this.clearSelection(),this.scrollIntoView(e),this.selection.select(e),t&&this.bus.fire("selectNewNode",e.nodeObj)},kn=function(e){this.selection.select(e)},_n=function(e){this.selection?.deselect(e)},Ln=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},An=function(){const e=Sn(this);return JSON.stringify(e,(t,n)=>{if(!(t==="parent"&&typeof n!="string"))return n})},Mn=function(){return JSON.parse(this.getDataString())},Dn=function(){this.editable=!0},Pn=function(){this.editable=!1},On=function(e,t={x:0,y:0}){if(e<this.scaleMin&&e<this.scaleVal||e>this.scaleMax&&e>this.scaleVal)return;const n=this.container.getBoundingClientRect(),o=t.x?t.x-n.left-n.width/2:0,s=t.y?t.y-n.top-n.height/2:0,{dx:i,dy:l}=Oe(this),r=this.map.style.transform,{x:c,y:a}=Ne(r),d=c-i,h=a-l,u=this.scaleVal,y=(-o+d)*(1-e/u),v=(-s+h)*(1-e/u);this.map.style.transform=`translate3d(${c-y}px, ${a-v}px, 0) scale(${e})`,this.scaleVal=e,this.bus.fire("scale",e)},$n=function(){const e=this.nodes.offsetHeight/this.container.offsetHeight,t=this.nodes.offsetWidth/this.container.offsetWidth,n=1/Math.max(1,Math.max(e,t));this.scaleVal=n;const{dx:o,dy:s}=Oe(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},jn=function(e,t,n=!1){const{map:o,scaleVal:s,bus:i,container:l,nodes:r}=this;if(n&&o.style.transition==="transform 0.3s")return;const c=o.style.transform;let{x:a,y:d}=Ne(c);const h=l.getBoundingClientRect(),u=r.getBoundingClientRect(),y=u.left<h.right&&u.right>h.left,v=u.top<h.bottom&&u.bottom>h.top;if(y){const p=u.left+e,g=u.right+e;(p>=h.right||g<=h.left)&&(e=0)}if(v){const p=u.top+t,g=u.bottom+t;(p>=h.bottom||g<=h.top)&&(t=0)}a+=e,d+=t,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${a}px, ${d}px, 0) scale(${s})`,i.fire("move",{dx:e,dy:t})},Oe=(e,t=!1)=>{const{container:n,map:o,nodes:s}=e;let i,l;if(e.alignment==="nodes"||t)i=(n.offsetWidth-s.offsetWidth)/2,l=(n.offsetHeight-s.offsetHeight)/2,o.style.transformOrigin="50% 50%";else{const r=o.querySelector("me-root"),c=r.offsetTop,a=r.offsetLeft,d=r.offsetWidth,h=r.offsetHeight;i=n.offsetWidth/2-a-d/2,l=n.offsetHeight/2-c-h/2,o.style.transformOrigin=`${a+d/2}px 50%`}return{dx:i,dy:l}},Hn=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:function(){this.isFocusMode=!1,this.tempDirection!==null&&(this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},clearSelection:Ln,disableEdit:Pn,enableEdit:Dn,expandNode:function(e,t){const n=e.nodeObj;typeof t=="boolean"?n.expanded=t:n.expanded!==!1?n.expanded=!1:n.expanded=!0;const o=e.getBoundingClientRect(),s={x:o.left,y:o.top},i=e.parentNode,l=i.children[1];if(l.expanded=n.expanded,l.className=n.expanded?"minus":"",se(e),n.expanded){const h=this.createChildren(n.children.map(u=>this.createWrapper(u).grp));i.parentNode.appendChild(h)}else i.parentNode.children[1].remove();this.linkDiv(e.closest("me-main > me-wrapper"));const r=e.getBoundingClientRect(),c={x:r.left,y:r.top},a=s.x-c.x,d=s.y-c.y;this.move(a,d),this.bus.fire("expandNode",n)},expandNodeAll:function(e,t){const n=e.nodeObj,o=e.getBoundingClientRect(),s={x:o.left,y:o.top};U(n,t??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),l={x:i.left,y:i.top},r=s.x-l.x,c=s.y-l.y;this.move(r,c)},focusNode:function(e){e.nodeObj.parent&&(this.clearSelection(),this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=e.nodeObj,this.initRight(),this.toCenter())},getData:Mn,getDataString:An,initLeft:function(){this.direction=0,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initRight:function(){this.direction=1,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initSide:function(){this.direction=2,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},install:function(e){e(this)},move:jn,refresh:function(e){this.clearSelection(),e&&(e=JSON.parse(JSON.stringify(e)),this.nodeData=e.nodeData,this.arrows=e.arrows||[],this.summaries=e.summaries||[],e.theme&&this.changeTheme(e.theme)),G(this.nodeData),this.layout(),this.linkDiv()},scale:On,scaleFit:$n,scrollIntoView:Nn,selectNode:Tn,selectNodes:kn,setLocale:function(e){this.locale=e,this.refresh()},toCenter:function(){const{map:e,container:t}=this,{dx:n,dy:o}=Oe(this);t.scrollTop=0,t.scrollLeft=0,e.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:_n},Symbol.toStringTag,{value:"Module"})),ft={create:function(e){return{dom:e,moved:!1,pointerdown:!1,lastX:0,lastY:0,handlePointerMove(t){if(this.pointerdown){this.moved=!0;const n=t.clientX-this.lastX,o=t.clientY-this.lastY;this.lastX=t.clientX,this.lastY=t.clientY,this.cb&&this.cb(n,o)}},handlePointerDown(t){t.button===0&&(this.pointerdown=!0,this.lastX=t.clientX,this.lastY=t.clientY,this.dom.setPointerCapture(t.pointerId))},handleClear(t){this.pointerdown=!1,t.pointerId!==void 0&&this.dom.releasePointerCapture(t.pointerId)},cb:null,init(t,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.destroy=Re([{dom:t,evt:"pointermove",func:this.handlePointerMove},{dom:t,evt:"pointerleave",func:this.handleClear},{dom:t,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},Rn="#4dc4ff";function ut(e,t,n,o,s,i,l,r){return{x:e/8+n*3/8+s*3/8+l/8,y:t/8+o*3/8+i*3/8+r/8}}function In(e,t,n){e&&(e.dataset.x=t.toString(),e.dataset.y=n.toString(),ue(e))}function ge(e,t,n,o,s){A(e,{x1:t+"",y1:n+"",x2:o+"",y2:s+""})}function pt(e,t,n,o,s,i,l,r,c,a){const d=`M ${t} ${n} C ${o} ${s} ${i} ${l} ${r} ${c}`;if(e.line.setAttribute("d",d),a.style){const p=a.style;p.stroke&&e.line.setAttribute("stroke",p.stroke),p.strokeWidth&&e.line.setAttribute("stroke-width",String(p.strokeWidth)),p.strokeDasharray&&e.line.setAttribute("stroke-dasharray",p.strokeDasharray),p.strokeLinecap&&e.line.setAttribute("stroke-linecap",p.strokeLinecap),p.opacity!==void 0&&e.line.setAttribute("opacity",String(p.opacity))}const h=e.querySelectorAll('path[stroke="transparent"]');h.length>0&&h[0].setAttribute("d",d);const u=ae(i,l,r,c);if(u){const p=`M ${u.x1} ${u.y1} L ${r} ${c} L ${u.x2} ${u.y2}`;if(e.arrow1.setAttribute("d",p),h.length>1&&h[1].setAttribute("d",p),a.style){const g=a.style;g.stroke&&e.arrow1.setAttribute("stroke",g.stroke),g.strokeWidth&&e.arrow1.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeLinecap&&e.arrow1.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&e.arrow1.setAttribute("opacity",String(g.opacity))}}if(a.bidirectional){const p=ae(o,s,t,n);if(p){const g=`M ${p.x1} ${p.y1} L ${t} ${n} L ${p.x2} ${p.y2}`;if(e.arrow2.setAttribute("d",g),h.length>2&&h[2].setAttribute("d",g),a.style){const m=a.style;m.stroke&&e.arrow2.setAttribute("stroke",m.stroke),m.strokeWidth&&e.arrow2.setAttribute("stroke-width",String(m.strokeWidth)),m.strokeLinecap&&e.arrow2.setAttribute("stroke-linecap",m.strokeLinecap),m.opacity!==void 0&&e.arrow2.setAttribute("opacity",String(m.opacity))}}}const{x:y,y:v}=ut(t,n,o,s,i,l,r,c);if(e.labelEl&&In(e.labelEl,y,v),a.style?.labelColor){const p=e.labelEl;p&&(p.style.color=a.style.labelColor)}Kn(e)}function me(e,t,n){const{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=t.offsetWidth,l=t.offsetHeight,r=o+i/2,c=s+l/2,a=r+n.x,d=c+n.y;return{w:i,h:l,cx:r,cy:c,ctrlX:a,ctrlY:d}}function te(e){let t,n;const o=(e.cy-e.ctrlY)/(e.ctrlX-e.cx);return o>e.h/e.w||o<-e.h/e.w?e.cy-e.ctrlY<0?(t=e.cx-e.h/2/o,n=e.cy+e.h/2):(t=e.cx+e.h/2/o,n=e.cy-e.h/2):e.cx-e.ctrlX<0?(t=e.cx+e.w/2,n=e.cy-e.w*o/2):(t=e.cx-e.w/2,n=e.cy+e.w*o/2),{x:t,y:n}}const $e=function(e,t,n,o,s){if(!t||!n)return;const i=me(e,t,o.delta1),l=me(e,n,o.delta2),{x:r,y:c}=te(i),{ctrlX:a,ctrlY:d}=i,{ctrlX:h,ctrlY:u}=l,{x:y,y:v}=te(l),p=ae(h,u,y,v);if(!p)return;const g=`M ${p.x1} ${p.y1} L ${y} ${v} L ${p.x2} ${p.y2}`;let m="";if(o.bidirectional){const N=ae(a,d,r,c);if(!N)return;m=`M ${N.x1} ${N.y1} L ${r} ${c} L ${N.x2} ${N.y2}`}const b=Xt(`M ${r} ${c} C ${a} ${d} ${h} ${u} ${y} ${v}`,g,m,o.style),{x,y:L}=ut(r,c,a,d,h,u,y,v),k=o.style?.labelColor||"rgb(235, 95, 82)",E="arrow-"+o.id;b.id=E;const C=e.markdown?e.markdown(o.label,o):o.label,S=Ae(C,x,L,{anchor:"middle",color:k,dataType:"arrow",svgId:E});b.labelEl=S,b.arrowObj=o,b.dataset.linkid=o.id,e.labelContainer.appendChild(S),e.linkSvgGroup.appendChild(b),ue(S),s||(e.arrows.push(o),e.currentArrow=b,gt(e,o,i,l))},Bn=function(e,t,n={}){const o=j(this.nodes,e),s=j(this.nodes,t),i=o.offsetLeft+e.offsetWidth/2,l=o.offsetTop+e.offsetHeight/2,r=s.offsetLeft+t.offsetWidth/2,c=s.offsetTop+t.offsetHeight/2,a=r-i,d=c-l,h=Math.sqrt(a*a+d*d),u=Math.max(50,Math.min(200,h*.3)),y=Math.abs(a),v=Math.abs(d);let p,g;if(y>v*1.5){const b=a>0?e.offsetWidth/2:-e.offsetWidth/2,x=a>0?-t.offsetWidth/2:t.offsetWidth/2;p={x:b+(a>0?u:-u),y:0},g={x:x+(a>0?-u:u),y:0}}else if(v>y*1.5){const b=d>0?e.offsetHeight/2:-e.offsetHeight/2,x=d>0?-t.offsetHeight/2:t.offsetHeight/2;p={x:0,y:b+(d>0?u:-u)},g={x:0,y:x+(d>0?-u:u)}}else{const b=Math.atan2(d,a),x=e.offsetWidth/2*Math.cos(b),L=e.offsetHeight/2*Math.sin(b),k=-(t.offsetWidth/2)*Math.cos(b),E=-(t.offsetHeight/2)*Math.sin(b),C=u*.7*(a>0?1:-1),S=u*.7*(d>0?1:-1);p={x:x+C,y:L+S},g={x:k-C,y:E-S}}const m={id:K(),label:"Custom Link",from:e.nodeObj.id,to:t.nodeObj.id,delta1:p,delta2:g,...n};$e(this,e,t,m),this.bus.fire("operation",{name:"createArrow",obj:m})},Fn=function(e){ye(this);const t={...e,id:K()};$e(this,this.findEle(t.from),this.findEle(t.to),t),this.bus.fire("operation",{name:"createArrow",obj:t})},Yn=function(e){let t;if(e?t=e:t=this.currentArrow,!t)return;ye(this);const n=t.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),t.labelEl?.remove(),t.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},Wn=function(e){this.currentArrow=e;const t=e.arrowObj,n=this.findEle(t.from),o=this.findEle(t.to),s=me(this,n,t.delta1),i=me(this,o,t.delta2);gt(this,t,s,i)},Xn=function(){ye(this),this.currentArrow=null},je=function(e,t){const n=document.createElementNS(B,"path");return A(n,{d:e,stroke:t,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},zn=function(e,t){const n=document.createElementNS(B,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=je(e.line.getAttribute("d"),t);n.appendChild(o);const s=je(e.arrow1.getAttribute("d"),t);if(n.appendChild(s),e.arrow2.getAttribute("d")){const i=je(e.arrow2.getAttribute("d"),t);n.appendChild(i)}e.insertBefore(n,e.firstChild)},Gn=function(e){const t=e.querySelector(".arrow-highlight");t&&t.remove()},Kn=function(e){const t=e.querySelector(".arrow-highlight");if(!t)return;const n=t.querySelectorAll("path");n.length>=1&&n[0].setAttribute("d",e.line.getAttribute("d")),n.length>=2&&n[1].setAttribute("d",e.arrow1.getAttribute("d")),n.length>=3&&e.arrow2.getAttribute("d")&&n[2].setAttribute("d",e.arrow2.getAttribute("d"))},ye=function(e){e.helper1?.destroy(),e.helper2?.destroy(),e.linkController.style.display="none",e.P2.style.display="none",e.P3.style.display="none",e.currentArrow&&Gn(e.currentArrow)},gt=function(e,t,n,o){const{linkController:s,P2:i,P3:l,line1:r,line2:c,nodes:a,map:d,currentArrow:h,bus:u}=e;if(!h)return;s.style.display="initial",i.style.display="initial",l.style.display="initial",a.appendChild(s),a.appendChild(i),a.appendChild(l),zn(h,Rn);let{x:y,y:v}=te(n),{ctrlX:p,ctrlY:g}=n,{ctrlX:m,ctrlY:b}=o,{x,y:L}=te(o);i.style.cssText=`top:${g}px;left:${p}px;`,l.style.cssText=`top:${b}px;left:${m}px;`,ge(r,y,v,p,g),ge(c,m,b,x,L),e.helper1=ft.create(i),e.helper2=ft.create(l),e.helper1.init(d,(k,E)=>{p=p+k/e.scaleVal,g=g+E/e.scaleVal;const C=te({...n,ctrlX:p,ctrlY:g});y=C.x,v=C.y,i.style.top=g+"px",i.style.left=p+"px",pt(h,y,v,p,g,m,b,x,L,t),ge(r,y,v,p,g),t.delta1.x=p-n.cx,t.delta1.y=g-n.cy,u.fire("updateArrowDelta",t)}),e.helper2.init(d,(k,E)=>{m=m+k/e.scaleVal,b=b+E/e.scaleVal;const C=te({...o,ctrlX:m,ctrlY:b});x=C.x,L=C.y,l.style.top=b+"px",l.style.left=m+"px",pt(h,y,v,p,g,m,b,x,L,t),ge(c,m,b,x,L),t.delta2.x=m-o.cx,t.delta2.y=b-o.cy,u.fire("updateArrowDelta",t)})};function qn(){this.linkSvgGroup.innerHTML="",this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach(t=>t.remove());for(let t=0;t<this.arrows.length;t++){const n=this.arrows[t];try{$e(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function Vn(e){ye(this),e&&e.labelEl&&Ue(this,e.labelEl,e.arrowObj)}function Un(){this.arrows=this.arrows.filter(e=>ce(e.from,this.nodeData)&&ce(e.to,this.nodeData))}const Jn=Object.freeze(Object.defineProperty({__proto__:null,createArrow:Bn,createArrowFrom:Fn,editArrowLabel:Vn,removeArrow:Yn,renderArrow:qn,selectArrow:Wn,tidyArrow:Un,unselectArrow:Xn},Symbol.toStringTag,{value:"Module"})),Zn=function(e){if(e.length===0)throw new Error("No selected node.");if(e.length===1){const c=e[0].nodeObj,a=e[0].nodeObj.parent;if(!a)throw new Error("Can not select root node.");const d=a.children.findIndex(h=>c===h);return{parent:a.id,start:d,end:d}}let t=0;const n=e.map(c=>{let a=c.nodeObj;const d=[];for(;a.parent;){const h=a.parent,y=h.children?.indexOf(a);a=h,d.unshift({node:a,index:y})}return d.length>t&&(t=d.length),d});let o=0;e:for(;o<t;o++){const c=n[0][o]?.node;for(let a=1;a<n.length;a++)if(n[a][o]?.node!==c)break e}if(!o)throw new Error("Can not select root node.");const s=n.map(c=>c[o-1].index).sort(),i=s[0]||0,l=s[s.length-1]||0,r=n[0][o-1].node;if(!r.parent)throw new Error("Please select nodes in the same main topic.");return{parent:r.id,start:i,end:l}},Qn=function(e){const t=document.createElementNS(B,"g");return t.setAttribute("id",e),t},mt=function(e,t){const n=document.createElementNS(B,"path");return A(n,{d:e,stroke:t||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},eo=e=>e.parentElement.parentElement,to=function(e,{parent:t,start:n}){const o=e.findEle(t),s=o.nodeObj;let i;return s.parent?i=o.closest("me-main").className:i=e.findEle(s.children[n].id).closest("me-main").className,i},He=function(e,t){const{id:n,label:o,parent:s,start:i,end:l,style:r}=t,{nodes:c,theme:a,summarySvg:d}=e,u=e.findEle(s).nodeObj,y=to(e,t);let v=1/0,p=0,g=0,m=0;for(let f=i;f<=l;f++){const w=u.children?.[f];if(!w)return e.removeSummary(n),null;const T=eo(e.findEle(w.id)),{offsetLeft:$,offsetTop:z}=j(c,T),M=i===l?10:20;f===i&&(g=z+M),f===l&&(m=z+T.offsetHeight-M),$<v&&(v=$),T.offsetWidth+$>p&&(p=T.offsetWidth+$)}let b,x;const L=u.parent?10:0,k=g+L,E=m+L,C=(k+E)/2,S=r?.stroke||a.cssVar["--color"],N=r?.labelColor||a.cssVar["--color"],O="s-"+n,_=e.markdown?e.markdown(o,t):o;y===I.LHS?(b=mt(`M ${v+10} ${k} c -5 0 -10 5 -10 10 L ${v} ${E-10} c 0 5 5 10 10 10 M ${v} ${C} h -10`,S),x=Ae(_,v-20,C,{anchor:"end",color:N,dataType:"summary",svgId:O})):(b=mt(`M ${p-10} ${k} c 5 0 10 5 10 10 L ${p} ${E-10} c 0 5 -5 10 -10 10 M ${p} ${C} h 10`,S),x=Ae(_,p+20,C,{anchor:"start",color:N,dataType:"summary",svgId:O}));const F=Qn(O);return F.appendChild(b),e.labelContainer.appendChild(x),ue(x),F.summaryObj=t,F.labelEl=x,d.appendChild(F),F},no=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(e={}){if(!this.currentNodes)return;const{currentNodes:t,summaries:n,bus:o}=this,{parent:s,start:i,end:l}=Zn(t),r={id:K(),parent:s,start:i,end:l,label:"summary",style:e.style},c=He(this,r);n.push(r),this.editSummary(c),o.fire("operation",{name:"createSummary",obj:r})},createSummaryFrom:function(e){const t=K(),n={...e,id:t};He(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(e){e&&e.labelEl&&Ue(this,e.labelEl,e.summaryObj)},removeSummary:function(e){const t=this.summaries.findIndex(n=>n.id===e);t>-1&&(this.summaries.splice(t,1),this.nodes.querySelector("#s-"+e)?.remove(),this.nodes.querySelector("#label-s-"+e)?.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:e}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(e=>{try{He(this,e)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(e){const t=e.labelEl;t&&t.classList.add("selected"),this.currentSummary=e},unselectSummary:function(){this.currentSummary?.labelEl?.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),P="http://www.w3.org/2000/svg";function oo(e,t){const n=document.createElementNS(P,"svg");return A(n,{version:"1.1",xmlns:P,height:e,width:t}),n}function so(e,t){return(parseInt(e)-parseInt(t))/2}function io(e,t,n,o){const s=document.createElementNS(P,"g");let i="";return e.text?i=e.text.textContent:i=e.childNodes[0].textContent,i.split(`
16
+ `).forEach((r,c)=>{const a=document.createElementNS(P,"text");A(a,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+so(t.lineHeight,t.fontSize)*(c+1)+parseFloat(t.fontSize)*(c+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),a.innerHTML=r,s.appendChild(a)}),s}function ro(e,t,n,o){let s="";e.nodeObj?.dangerouslySetInnerHTML?s=e.nodeObj.dangerouslySetInnerHTML:e.text?s=e.text.textContent:s=e.childNodes[0].textContent;const i=document.createElementNS(P,"foreignObject");A(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const l=document.createElement("div");return A(l,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),l.innerHTML=s,i.appendChild(l),i}function lo(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=document.createElementNS(P,"rect");return A(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function ve(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=j(e.nodes,t),l=document.createElementNS(P,"rect");A(l,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const r=document.createElementNS(P,"g");r.appendChild(l);let c;return n?c=ro(t,o,s,i):c=io(t,o,s,i),r.appendChild(c),r}function co(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=document.createElementNS(P,"a"),l=document.createElementNS(P,"text");return A(l,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),l.innerHTML=t.textContent,i.appendChild(l),i.setAttribute("href",t.href),i}function ao(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=j(e.nodes,t),i=document.createElementNS(P,"image");return A(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const be=100,ho='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',fo=(e,t=!1)=>{const n=e.nodes,o=n.offsetHeight+be*2,s=n.offsetWidth+be*2,i=oo(o+"px",s+"px"),l=document.createElementNS(P,"svg"),r=document.createElementNS(P,"rect");A(r,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(r),n.querySelectorAll(".subLines").forEach(h=>{const u=h.cloneNode(!0),{offsetLeft:y,offsetTop:v}=j(n,h.parentElement);u.setAttribute("x",`${y}`),u.setAttribute("y",`${v}`),l.appendChild(u)});const c=n.querySelector(".lines")?.cloneNode(!0);c&&l.appendChild(c);const a=n.querySelector(".topiclinks")?.cloneNode(!0);a&&l.appendChild(a);const d=n.querySelector(".summary")?.cloneNode(!0);return d&&l.appendChild(d),n.querySelectorAll("me-tpc").forEach(h=>{h.nodeObj.dangerouslySetInnerHTML?l.appendChild(ve(e,h,!t)):(l.appendChild(lo(e,h)),l.appendChild(ve(e,h.text,!t)))}),n.querySelectorAll(".tags > span").forEach(h=>{l.appendChild(ve(e,h))}),n.querySelectorAll(".icons > span").forEach(h=>{l.appendChild(ve(e,h))}),n.querySelectorAll(".hyper-link").forEach(h=>{l.appendChild(co(e,h))}),n.querySelectorAll("img").forEach(h=>{l.appendChild(ao(e,h))}),A(l,{x:be+"",y:be+"",overflow:"visible"}),i.appendChild(l),i},uo=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),ho+e.outerHTML);function po(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=s=>{t(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(e)})}const go=Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await po(n);return new Promise((s,i)=>{const l=new Image;l.setAttribute("crossOrigin","anonymous"),l.onload=()=>{const r=document.createElement("canvas");r.width=l.width,r.height=l.height,r.getContext("2d").drawImage(l,0,0),r.toBlob(s,"image/png",1)},l.src=o,l.onerror=i})},exportSvg:function(e=!1,t){const n=fo(this,e),o=uo(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"}));function mo(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const yt=Object.keys(ht),vt={};for(let e=0;e<yt.length;e++){const t=yt[e];vt[t]=mo(ht[t],t)}const yo={getObjById:ce,generateNewObj:bt,layout:jt,linkDiv:zt,editTopic:Wt,createWrapper:It,createParent:Bt,createChildren:Ft,createTopic:Yt,findEle:Ge,changeTheme:ln,...Hn,...vt,...Jn,...no,...go,init(e){if(e=JSON.parse(JSON.stringify(e)),!e||!e.nodeData)return new Error("MindElixir: `data` is required");e.direction!==void 0&&(this.direction=e.direction),this.changeTheme(e.theme||this.theme,!1),this.nodeData=e.nodeData,G(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&Zt(this),this.keypress&&Nt(this,this.keypress),this.editable&&rn(this),this.contextMenu&&this.disposable.push(Gt(this,this.contextMenu)),this.draggable&&this.disposable.push(Pt()),this.allowUndo&&this.disposable.push(qt(this)),this.layout(),this.linkDiv(),this.toCenter()},destroy(){this.disposable.forEach(e=>e()),this.el&&(this.el.innerHTML=""),this.el=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,this.selection?.destroy(),this.selection=void 0}};function vo({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,containerHeight:a}){let d=t+n/2;const h=e+o/2;let u;c===I.LHS?u=i+l:u=i;const y=s+r/2,p=(1-Math.abs(y-h)/a)*.25*(n/2);return c===I.LHS?d=d-n/10-p:d=d+n/10+p,`M ${d} ${h} Q ${d} ${y} ${u} ${y}`}function bo({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,isFirst:a}){const d=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let h=0,u=0;a?h=e+o/2:h=e+o;const y=s+r;let v=0,p=0,g=0;const m=Math.abs(h-y)/300*d;return c===I.LHS?(g=t,v=g+d,p=g-d,u=i+d,`M ${v} ${h} C ${g} ${h} ${g+m} ${y} ${p} ${y} H ${u}`):(g=t+n,v=g-d,p=g+d,u=i+l-d,`M ${v} ${h} C ${g} ${h} ${g-m} ${y} ${p} ${y} H ${u}`)}const wo="5.6.1";function xo(e){return{x:0,y:0,moved:!1,mousedown:!1,onMove(t,n){this.mousedown&&(this.moved=!0,e.move(t,n))},clear(){this.mousedown=!1}}}const ne=document;function R({el:e,direction:t,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:l,keypress:r,mouseSelectionButton:c,selectionContainer:a,before:d,newTopicName:h,allowUndo:u,generateMainBranch:y,generateSubBranch:v,overflowHidden:p,theme:g,alignment:m,scaleSensitivity:b,scaleMax:x,scaleMin:L,handleWheel:k,markdown:E,imageProxy:C}){let S=null;const N=Object.prototype.toString.call(e);if(N==="[object HTMLDivElement]"?S=e:N==="[object String]"&&(S=document.querySelector(e)),!S)throw new Error("MindElixir: el is not a valid element");S.style.position="relative",S.innerHTML="",this.el=S,this.disposable=[],this.before=d||{},this.locale=n||"en",this.newTopicName=h||"New Node",this.contextMenu=i??!0,this.toolBar=l??!0,this.keypress=r??!0,this.mouseSelectionButton=c??0,this.direction=t??1,this.draggable=o??!0,this.editable=s??!0,this.allowUndo=u??!0,this.scaleSensitivity=b??.1,this.scaleMax=x??1.4,this.scaleMin=L??.2,this.generateMainBranch=y||vo,this.generateSubBranch=v||bo,this.overflowHidden=p??!1,this.alignment=m??"root",this.handleWheel=k??!0,this.markdown=E||void 0,this.imageProxy=C||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=xo(this),this.bus=$t(),this.container=ne.createElement("div"),this.selectionContainer=a||this.container,this.container.className="map-container";const O=window.matchMedia("(prefers-color-scheme: dark)");this.theme=g||(O.matches?le:re);const _=ne.createElement("div");_.className="map-canvas",this.map=_,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=ne.createElement("me-nodes"),this.lines=oe("lines"),this.summarySvg=oe("summary"),this.linkController=oe("linkcontroller"),this.P2=ne.createElement("div"),this.P3=ne.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Ve(),this.line2=Ve(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=oe("topiclinks"),this.labelContainer=ne.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Ot(this))}return R.prototype=yo,Object.defineProperty(R.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),R.LEFT=0,R.RIGHT=1,R.SIDE=2,R.THEME=re,R.DARK_THEME=le,R.version=wo,R.E=Ge,R.new=e=>({nodeData:{id:K(),topic:e||"new topic",children:[]}}),Y.DARK_THEME=le,Y.LEFT=0,Y.RIGHT=1,Y.SIDE=2,Y.THEME=re,Y.default=R,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Y})({});
@@ -1,4 +1,4 @@
1
- const Se = {
1
+ const es = 0, ts = 1, ns = 2, Se = {
2
2
  name: "Latte",
3
3
  type: "light",
4
4
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -23,7 +23,7 @@ const Se = {
23
23
  "--panel-color": "#444446",
24
24
  "--panel-bgcolor": "#ffffff",
25
25
  "--panel-border-color": "#eaeaea",
26
- "--map-padding": "50px"
26
+ "--map-padding": "50px 80px"
27
27
  }
28
28
  }, Ne = {
29
29
  name: "Dark",
@@ -2689,7 +2689,7 @@ function Jo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: r, direction:
2689
2689
  const m = Math.abs(h - y) / 300 * d;
2690
2690
  return c === B.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${y} ${p} ${y} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${y} ${p} ${y} H ${u}`);
2691
2691
  }
2692
- const Zo = "5.6.0";
2692
+ const Zo = "5.6.1";
2693
2693
  function Qo(e) {
2694
2694
  return {
2695
2695
  x: 0,
@@ -2763,5 +2763,10 @@ I.new = (e) => ({
2763
2763
  }
2764
2764
  });
2765
2765
  export {
2766
+ Ne as DARK_THEME,
2767
+ es as LEFT,
2768
+ ts as RIGHT,
2769
+ ns as SIDE,
2770
+ Se as THEME,
2766
2771
  I as default
2767
2772
  };
@@ -1,4 +1,4 @@
1
- var MindElixirLite=(function(){"use strict";const ct={name:"Latte",type:"light",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#4c4f69","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--main-bgcolor-transparent":"rgba(255, 255, 255, 0.8)","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#4dc4ff","--accent-color":"#e64553","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px"}},lt={name:"Dark",type:"dark",palette:["#848FA0","#748BE9","#D2F9FE","#4145A5","#789AFA","#706CF4","#EF987F","#775DD5","#FCEECF","#DA7FBC"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#2d3748","--root-border-color":"rgba(255, 255, 255, 0.1)","--main-color":"#ffffff","--main-bgcolor":"#4c4f69","--main-bgcolor-transparent":"rgba(76, 79, 105, 0.8)","--topic-padding":"3px","--color":"#cccccc","--bgcolor":"#252526","--selected":"#4dc4ff","--accent-color":"#789AFA","--panel-color":"#ffffff","--panel-bgcolor":"#2d3748","--panel-border-color":"#696969","--map-padding":"50px 80px"}};function Bt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const U=function(t,e){if(e.id===t)return e;if(e.children&&e.children.length){for(let n=0;n<e.children.length;n++){const o=U(t,e.children[n]);if(o)return o}return null}else return null},at=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)at(t.children[n],t)},wt=(t,e,n)=>{t.expanded=e,t.children&&t.children.forEach(o=>{wt(o,e)})};function K(t,e,n,o){const s=n-t,i=o-e,c=Math.atan2(i,s)*180/Math.PI,a=12,l=30,h=(c+180-l)*Math.PI/180,f=(c+180+l)*Math.PI/180;return{x1:n+Math.cos(h)*a,y1:o+Math.sin(h)*a,x2:n+Math.cos(f)*a,y2:o+Math.sin(f)*a}}function j(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const Rt=function(){const t=j();return{topic:this.newTopicName,id:t}},I=(t,e)=>{let n=0,o=0;for(;e&&e!==t;)n+=e.offsetLeft,o+=e.offsetTop,e=e.offsetParent;return{offsetLeft:n,offsetTop:o}},D=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},dt=t=>t?t.tagName==="ME-TPC":!1,ht=t=>{const e=/translate3d\(([^,]+),\s*([^,]+)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},bt=function(t){for(let e=0;e<t.length;e++){const{dom:n,evt:o,func:s}=t[e];n.addEventListener(o,s)}return function(){for(let n=0;n<t.length;n++){const{dom:o,evt:s,func:i}=t[n];o.removeEventListener(s,i)}}},xt=(t,e)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},X={LHS:"lhs",RHS:"rhs"},J=function(t,e,n){const{scaleVal:o,scaleSensitivity:s}=t;switch(e){case"in":t.scale(o+s,n);break;case"out":t.scale(o-s,n)}},ft=document,Wt=function(t,e){if(!e)return Q(t),t;let n=t.querySelector(".insert-preview");const o=`insert-preview ${e} show`;return n||(n=ft.createElement("div"),t.appendChild(n)),n.className=o,t},Q=function(t){if(!t)return;const e=t.querySelectorAll(".insert-preview");for(const n of e||[])n.remove()},Ct=function(t,e){for(const n of e){const o=n.parentElement.parentElement.contains(t);if(!(t&&t.tagName==="ME-TPC"&&t!==n&&!o&&t.nodeObj.parent))return!1}return!0},Xt=function(t){const e=document.createElement("div");return e.className="mind-elixir-ghost",t.container.appendChild(e),e};class Gt{mind;isMoving=!1;interval=null;speed=20;constructor(e){this.mind=e}move(e,n){this.isMoving||(this.isMoving=!0,this.interval=setInterval(()=>{this.mind.move(e*this.speed*this.mind.scaleVal,n*this.speed*this.mind.scaleVal)},100))}stop(){this.isMoving=!1,this.interval&&(clearInterval(this.interval),this.interval=null)}}function Vt(t){return{isDragging:!1,insertType:null,meet:null,ghost:Xt(t),edgeMoveController:new Gt(t),startX:0,startY:0,pointerId:null}}const zt=5;function Et(t,e,n,o=!1){if(t.spacePressed)return!1;const s=n.target;if(s?.tagName!=="ME-TPC"||!s.nodeObj.parent)return!1;e.startX=n.clientX,e.startY=n.clientY,e.pointerId=n.pointerId,t.selection.cancel();let i=t.currentNodes;return i?.includes(s)||(t.selectNode(s),i=t.currentNodes),t.dragged=i,o&&Tt(t,e),!0}function St(t,e,n){t.style.transform=`translate(${e+10}px, ${n+10}px)`,t.style.display="block"}function Tt(t,e){const{dragged:n}=t;if(!n)return;const o=document.activeElement;o&&o.isContentEditable&&o.blur(),e.isDragging=!0,n.length>1?e.ghost.innerHTML=n.length+"":e.ghost.innerHTML=n[0].innerHTML;for(const s of n)s.parentElement.parentElement.style.opacity="0.5";t.dragMoveHelper.clear()}function Ft(t,e,n){const{dragged:o}=t;if(!o||e.pointerId!==n.pointerId)return;const s=n.clientX-e.startX,i=n.clientY-e.startY,r=Math.sqrt(s*s+i*i);if(!e.isDragging&&r>zt&&Tt(t,e),!e.isDragging)return;St(e.ghost,n.clientX,n.clientY);const c=t.container.getBoundingClientRect();n.clientX<c.x+50?e.edgeMoveController.move(1,0):n.clientX>c.x+c.width-50?e.edgeMoveController.move(-1,0):n.clientY<c.y+50?e.edgeMoveController.move(0,1):n.clientY>c.y+c.height-50?e.edgeMoveController.move(0,-1):e.edgeMoveController.stop(),Q(e.meet);const a=12*t.scaleVal,l=ft.elementFromPoint(n.clientX,n.clientY-a);if(Ct(l,o)){e.meet=l;const h=l.getBoundingClientRect(),f=h.y;n.clientY>f+h.height?e.insertType="after":e.insertType="in"}else{const h=ft.elementFromPoint(n.clientX,n.clientY+a);if(Ct(h,o)){e.meet=h;const u=h.getBoundingClientRect().y;n.clientY<u?e.insertType="before":e.insertType="in"}else e.insertType=null,e.meet=null}e.meet&&Wt(e.meet,e.insertType)}function jt(t,e,n){const{dragged:o}=t;if(!(!o||e.pointerId!==n.pointerId)){e.edgeMoveController.stop();for(const s of o)s.parentElement.parentElement.style.opacity="1";e.ghost.style.display="none",e.ghost.innerHTML="",e.isDragging&&e.meet&&(Q(e.meet),e.insertType==="before"?t.moveNodeBefore(o,e.meet):e.insertType==="after"?t.moveNodeAfter(o,e.meet):e.insertType==="in"&&t.moveNodeIn(o,e.meet)),t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}function ut(t,e){const{dragged:n}=t;if(n){e.edgeMoveController.stop();for(const o of n)o.parentElement.parentElement.style.opacity="1";e.meet&&Q(e.meet),e.ghost.style.display="none",e.ghost.innerHTML="",t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}function qt(t){const{dragMoveHelper:e}=t;let n=0;t.spacePressed=!1;let o=null;const s=new Map,i=t.draggable?Vt(t):null;let r=null,c=null,a=null,l=null;const h=500,f=10,u=()=>{r!==null&&(clearTimeout(r),r=null,c=null,a=null,l=null)},y=(d,v)=>{d.hasPointerCapture&&d.hasPointerCapture(v)&&d.releasePointerCapture(v)},m=(d,v)=>{const C=d.closest(".svg-label");if(C){const $=C.dataset.svgId,rt=C.dataset.type,_=document.getElementById($);if(_){if(rt==="arrow")return v?t.editArrowLabel(_):t.selectArrow(_),!0;if(rt==="summary")return v?t.editSummary(_):t.selectSummary(_),!0}}if(d.closest(".topiclinks")){const $=d.closest("g");if($)return v?t.editArrowLabel($):t.selectArrow($),!0}if(d.closest(".summary")){const $=d.closest("g");if($)return v?t.editSummary($):t.selectSummary($),!0}return!1},p=d=>{if(d.button!==0)return;if(t.helper1?.moved){t.helper1.clear();return}if(t.helper2?.moved){t.helper2.clear();return}if(e.moved){e.clear();return}if(i?.isDragging)return;const v=d.target;if(v.tagName==="ME-EPD")d.ctrlKey||d.metaKey?t.expandNodeAll(v.previousSibling):t.expandNode(v.previousSibling);else if(v.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(v);else if(!t.editable)return;m(v,!1)},g=d=>{if(!t.editable)return;const v=d.target;dt(v)&&t.beginEdit(v),m(v,!0)},w=d=>{if(d.pointerType==="mouse"||s.size>1)return;const v=new Date().getTime(),C=v-n;C<300&&C>0&&g(d),n=v},b=d=>{d.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},x=d=>{d.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))},S=d=>{if(d.pointerType==="touch"&&(s.set(d.pointerId,{x:d.clientX,y:d.clientY}),s.size===2)){const[$,rt]=Array.from(s.values());o=xt($,rt),u()}e.moved=!1;const v=d.target,C=t.mouseSelectionButton===0?2:0;if(i&&(d.button===0||d.pointerType==="touch")){if(d.pointerType==="touch"&&s.size>1)(i.isDragging||i.pointerId!==null)&&ut(t,i);else if(d.pointerType==="touch"&&s.size===1)(dt(v)||v.closest("me-tpc"))&&(c={x:d.clientX,y:d.clientY},a=v,l=d.pointerId,r=window.setTimeout(()=>{Et(t,i,d,!0)&&(a&&a.setPointerCapture(d.pointerId),St(i.ghost,d.clientX,d.clientY)),r=null,c=null,a=null,l=null},h));else if(d.pointerType==="mouse"&&Et(t,i,d,!1)){v.setPointerCapture(d.pointerId);return}}const H=t.spacePressed&&d.button===0&&d.pointerType==="mouse",B=d.button===C&&d.pointerType==="mouse"||d.pointerType==="touch";!H&&!B||(e.x=d.clientX,e.y=d.clientY,v.className!=="circle"&&v.contentEditable!=="plaintext-only"&&(e.mousedown=!0,v.setPointerCapture(d.pointerId)))},T=d=>{if(d.pointerType==="touch"&&s.has(d.pointerId)){if(s.set(d.pointerId,{x:d.clientX,y:d.clientY}),r!==null&&c!==null&&d.pointerId===l){const v=d.clientX-c.x,C=d.clientY-c.y;Math.sqrt(v*v+C*C)>f&&u()}if(s.size>=2){const[v,C]=Array.from(s.values()),H=xt(v,C);if(o==null)o=H;else{const B=H-o;Math.abs(B)>8&&(B>0?J(t,"in",{x:(v.x+C.x)/2,y:(v.y+C.y)/2}):J(t,"out",{x:(v.x+C.x)/2,y:(v.y+C.y)/2}),o=H)}return}}if(!(i&&i.pointerId!==null&&(Ft(t,i,d),i.isDragging))){if(d.target.contentEditable!=="plaintext-only"||t.spacePressed&&e.mousedown){const v=d.clientX-e.x,C=d.clientY-e.y;e.onMove(v,C)}e.x=d.clientX,e.y=d.clientY}},k=d=>{if(d.pointerType==="touch"&&(s.delete(d.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId!==null){const v=i.isDragging;if(jt(t,i,d),y(d.target,d.pointerId),v)return}e.mousedown&&(y(d.target,d.pointerId),e.clear())},E=()=>{u(),e.mousedown&&e.clear(),i&&(i.isDragging||i.pointerId!==null)&&ut(t,i)},L=d=>{d.pointerType==="touch"&&(s.delete(d.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId===d.pointerId&&ut(t,i),k(d)},P=d=>{if(d.preventDefault(),d.button!==2||!t.editable)return;const v=d.target;dt(v)&&!v.classList.contains("selected")&&t.selectNode(v),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",d)},200)},W=d=>{d.stopPropagation(),d.preventDefault(),d.ctrlKey||d.metaKey?d.deltaY<0?J(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&J(t,"out",t.dragMoveHelper):d.shiftKey?t.move(-d.deltaY,0):t.move(-d.deltaX,-d.deltaY)},{container:M}=t;return bt([{dom:M,evt:"pointerdown",func:S},{dom:M,evt:"pointermove",func:T},{dom:M,evt:"pointerup",func:k},{dom:M,evt:"pointercancel",func:L},{dom:M,evt:"pointerdown",func:w},{dom:M,evt:"click",func:p},{dom:M,evt:"dblclick",func:g},{dom:M,evt:"contextmenu",func:P},{dom:M,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:W},{dom:M,evt:"blur",func:E},{dom:M,evt:"keydown",func:b},{dom:M,evt:"keyup",func:x}])}function _t(){return{handlers:{},addListener:function(t,e){this.handlers[t]===void 0&&(this.handlers[t]=[]),this.handlers[t].push(e)},fire:function(t,...e){if(this.handlers[t]instanceof Array){const n=this.handlers[t];for(let o=0;o<n.length;o++)n[o](...e)}},removeListener:function(t,e){if(!this.handlers[t])return;const n=this.handlers[t];if(!e)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===e&&this.handlers[t].splice(o,1)}}}const Z=document,Ut=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);Mt.call(this,t,this.nodeData),t.draggable=!1;const e=Z.createElement("me-root");e.appendChild(t);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}Kt(this,n,e)},Kt=function(t,e,n){const o=Z.createElement("me-main");o.className=X.LHS;const s=Z.createElement("me-main");s.className=X.RHS;for(let i=0;i<e.length;i++){const r=e[i],{grp:c}=t.createWrapper(r);t.direction===2?r.direction===0?o.appendChild(c):s.appendChild(c):t.direction===0?o.appendChild(c):s.appendChild(c)}t.nodes.appendChild(o),t.nodes.appendChild(n),t.nodes.appendChild(s),t.nodes.appendChild(t.lines),t.nodes.appendChild(t.labelContainer)},Jt=function(t,e){const n=Z.createElement("me-children");for(let o=0;o<e.length;o++){const s=e[o],{grp:i}=t.createWrapper(s);n.appendChild(i)}return n},N=document,Lt=function(t,e){const o=(this?.el?this.el:e||document).querySelector(`[data-nodeid="me${t}"]`);if(!o)throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);return o},Mt=function(t,e){if(t.innerHTML="",e.style){const n=e.style;for(const o in n)t.style[o]=n[o]}if(e.dangerouslySetInnerHTML){t.innerHTML=e.dangerouslySetInnerHTML;return}if(e.image){const n=e.image;if(n.url&&n.width&&n.height){const o=N.createElement("img");o.src=this.imageProxy?this.imageProxy(n.url):n.url,o.style.width=n.width+"px",o.style.height=n.height+"px",n.fit&&(o.style.objectFit=n.fit),t.appendChild(o),t.image=o}}else t.image&&(t.image=void 0);{const n=N.createElement("span");n.className="text",this.markdown?n.innerHTML=this.markdown(e.topic,e):n.textContent=e.topic,t.appendChild(n),t.text=n}if(e.hyperLink){const n=N.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=e.hyperLink,t.appendChild(n),t.link=n}else t.link&&(t.link=void 0);if(e.icons&&e.icons.length){const n=N.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${Bt(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=N.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=N.createElement("span");typeof o=="string"?s.textContent=o:(s.textContent=o.text,o.className&&(s.className=o.className),o.style&&Object.assign(s.style,o.style)),n.appendChild(s)}),t.appendChild(n),t.tags=n}else t.tags&&(t.tags=void 0)},Qt=function(t,e){const n=N.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=oe(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=Jt(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},Zt=function(t){const e=N.createElement("me-parent"),n=this.createTopic(t);return Mt.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},te=function(t){const e=N.createElement("me-children");return e.append(...t),e},ee=function(t){const e=N.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e};function kt(t){const e=N.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const ne=function(t){if(!t)return;const e=N.createElement("div"),n=t.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=I(this.nodes,t);this.nodes.appendChild(e),e.id="input-box",e.textContent=o,e.contentEditable="plaintext-only",e.spellcheck=!1;const r=getComputedStyle(t);e.style.cssText=`
1
+ var MindElixirLite=(function(R){"use strict";const K={name:"Latte",type:"light",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#4c4f69","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--main-bgcolor-transparent":"rgba(255, 255, 255, 0.8)","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#4dc4ff","--accent-color":"#e64553","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px 80px"}},J={name:"Dark",type:"dark",palette:["#848FA0","#748BE9","#D2F9FE","#4145A5","#789AFA","#706CF4","#EF987F","#775DD5","#FCEECF","#DA7FBC"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#2d3748","--root-border-color":"rgba(255, 255, 255, 0.1)","--main-color":"#ffffff","--main-bgcolor":"#4c4f69","--main-bgcolor-transparent":"rgba(76, 79, 105, 0.8)","--topic-padding":"3px","--color":"#cccccc","--bgcolor":"#252526","--selected":"#4dc4ff","--accent-color":"#789AFA","--panel-color":"#ffffff","--panel-bgcolor":"#2d3748","--panel-border-color":"#696969","--map-padding":"50px 80px"}};function Bt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const Q=function(t,e){if(e.id===t)return e;if(e.children&&e.children.length){for(let n=0;n<e.children.length;n++){const o=Q(t,e.children[n]);if(o)return o}return null}else return null},dt=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)dt(t.children[n],t)},bt=(t,e,n)=>{t.expanded=e,t.children&&t.children.forEach(o=>{bt(o,e)})};function Z(t,e,n,o){const s=n-t,i=o-e,l=Math.atan2(i,s)*180/Math.PI,a=12,c=30,h=(l+180-c)*Math.PI/180,f=(l+180+c)*Math.PI/180;return{x1:n+Math.cos(h)*a,y1:o+Math.sin(h)*a,x2:n+Math.cos(f)*a,y2:o+Math.sin(f)*a}}function q(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const Wt=function(){const t=q();return{topic:this.newTopicName,id:t}},I=(t,e)=>{let n=0,o=0;for(;e&&e!==t;)n+=e.offsetLeft,o+=e.offsetTop,e=e.offsetParent;return{offsetLeft:n,offsetTop:o}},k=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},ht=t=>t?t.tagName==="ME-TPC":!1,ft=t=>{const e=/translate3d\(([^,]+),\s*([^,]+)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},xt=function(t){for(let e=0;e<t.length;e++){const{dom:n,evt:o,func:s}=t[e];n.addEventListener(o,s)}return function(){for(let n=0;n<t.length;n++){const{dom:o,evt:s,func:i}=t[n];o.removeEventListener(s,i)}}},Ct=(t,e)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},G={LHS:"lhs",RHS:"rhs"},tt=function(t,e,n){const{scaleVal:o,scaleSensitivity:s}=t;switch(e){case"in":t.scale(o+s,n);break;case"out":t.scale(o-s,n)}},ut=document,Xt=function(t,e){if(!e)return et(t),t;let n=t.querySelector(".insert-preview");const o=`insert-preview ${e} show`;return n||(n=ut.createElement("div"),t.appendChild(n)),n.className=o,t},et=function(t){if(!t)return;const e=t.querySelectorAll(".insert-preview");for(const n of e||[])n.remove()},Et=function(t,e){for(const n of e){const o=n.parentElement.parentElement.contains(t);if(!(t&&t.tagName==="ME-TPC"&&t!==n&&!o&&t.nodeObj.parent))return!1}return!0},Gt=function(t){const e=document.createElement("div");return e.className="mind-elixir-ghost",t.container.appendChild(e),e};class Vt{mind;isMoving=!1;interval=null;speed=20;constructor(e){this.mind=e}move(e,n){this.isMoving||(this.isMoving=!0,this.interval=setInterval(()=>{this.mind.move(e*this.speed*this.mind.scaleVal,n*this.speed*this.mind.scaleVal)},100))}stop(){this.isMoving=!1,this.interval&&(clearInterval(this.interval),this.interval=null)}}function zt(t){return{isDragging:!1,insertType:null,meet:null,ghost:Gt(t),edgeMoveController:new Vt(t),startX:0,startY:0,pointerId:null}}const Ft=5;function St(t,e,n,o=!1){if(t.spacePressed)return!1;const s=n.target;if(s?.tagName!=="ME-TPC"||!s.nodeObj.parent)return!1;e.startX=n.clientX,e.startY=n.clientY,e.pointerId=n.pointerId,t.selection.cancel();let i=t.currentNodes;return i?.includes(s)||(t.selectNode(s),i=t.currentNodes),t.dragged=i,o&&Lt(t,e),!0}function Tt(t,e,n){t.style.transform=`translate(${e+10}px, ${n+10}px)`,t.style.display="block"}function Lt(t,e){const{dragged:n}=t;if(!n)return;const o=document.activeElement;o&&o.isContentEditable&&o.blur(),e.isDragging=!0,n.length>1?e.ghost.innerHTML=n.length+"":e.ghost.innerHTML=n[0].innerHTML;for(const s of n)s.parentElement.parentElement.style.opacity="0.5";t.dragMoveHelper.clear()}function jt(t,e,n){const{dragged:o}=t;if(!o||e.pointerId!==n.pointerId)return;const s=n.clientX-e.startX,i=n.clientY-e.startY,r=Math.sqrt(s*s+i*i);if(!e.isDragging&&r>Ft&&Lt(t,e),!e.isDragging)return;Tt(e.ghost,n.clientX,n.clientY);const l=t.container.getBoundingClientRect();n.clientX<l.x+50?e.edgeMoveController.move(1,0):n.clientX>l.x+l.width-50?e.edgeMoveController.move(-1,0):n.clientY<l.y+50?e.edgeMoveController.move(0,1):n.clientY>l.y+l.height-50?e.edgeMoveController.move(0,-1):e.edgeMoveController.stop(),et(e.meet);const a=12*t.scaleVal,c=ut.elementFromPoint(n.clientX,n.clientY-a);if(Et(c,o)){e.meet=c;const h=c.getBoundingClientRect(),f=h.y;n.clientY>f+h.height?e.insertType="after":e.insertType="in"}else{const h=ut.elementFromPoint(n.clientX,n.clientY+a);if(Et(h,o)){e.meet=h;const u=h.getBoundingClientRect().y;n.clientY<u?e.insertType="before":e.insertType="in"}else e.insertType=null,e.meet=null}e.meet&&Xt(e.meet,e.insertType)}function qt(t,e,n){const{dragged:o}=t;if(!(!o||e.pointerId!==n.pointerId)){e.edgeMoveController.stop();for(const s of o)s.parentElement.parentElement.style.opacity="1";e.ghost.style.display="none",e.ghost.innerHTML="",e.isDragging&&e.meet&&(et(e.meet),e.insertType==="before"?t.moveNodeBefore(o,e.meet):e.insertType==="after"?t.moveNodeAfter(o,e.meet):e.insertType==="in"&&t.moveNodeIn(o,e.meet)),t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}function pt(t,e){const{dragged:n}=t;if(n){e.edgeMoveController.stop();for(const o of n)o.parentElement.parentElement.style.opacity="1";e.meet&&et(e.meet),e.ghost.style.display="none",e.ghost.innerHTML="",t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}function _t(t){const{dragMoveHelper:e}=t;let n=0;t.spacePressed=!1;let o=null;const s=new Map,i=t.draggable?zt(t):null;let r=null,l=null,a=null,c=null;const h=500,f=10,u=()=>{r!==null&&(clearTimeout(r),r=null,l=null,a=null,c=null)},y=(d,v)=>{d.hasPointerCapture&&d.hasPointerCapture(v)&&d.releasePointerCapture(v)},m=(d,v)=>{const C=d.closest(".svg-label");if(C){const $=C.dataset.svgId,at=C.dataset.type,U=document.getElementById($);if(U){if(at==="arrow")return v?t.editArrowLabel(U):t.selectArrow(U),!0;if(at==="summary")return v?t.editSummary(U):t.selectSummary(U),!0}}if(d.closest(".topiclinks")){const $=d.closest("g");if($)return v?t.editArrowLabel($):t.selectArrow($),!0}if(d.closest(".summary")){const $=d.closest("g");if($)return v?t.editSummary($):t.selectSummary($),!0}return!1},p=d=>{if(d.button!==0)return;if(t.helper1?.moved){t.helper1.clear();return}if(t.helper2?.moved){t.helper2.clear();return}if(e.moved){e.clear();return}if(i?.isDragging)return;const v=d.target;if(v.tagName==="ME-EPD")d.ctrlKey||d.metaKey?t.expandNodeAll(v.previousSibling):t.expandNode(v.previousSibling);else if(v.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(v);else if(!t.editable)return;m(v,!1)},g=d=>{if(!t.editable)return;const v=d.target;ht(v)&&t.beginEdit(v),m(v,!0)},w=d=>{if(d.pointerType==="mouse"||s.size>1)return;const v=new Date().getTime(),C=v-n;C<300&&C>0&&g(d),n=v},b=d=>{d.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},x=d=>{d.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))},S=d=>{if(d.pointerType==="touch"&&(s.set(d.pointerId,{x:d.clientX,y:d.clientY}),s.size===2)){const[$,at]=Array.from(s.values());o=Ct($,at),u()}e.moved=!1;const v=d.target,C=t.mouseSelectionButton===0?2:0;if(i&&(d.button===0||d.pointerType==="touch")){if(d.pointerType==="touch"&&s.size>1)(i.isDragging||i.pointerId!==null)&&pt(t,i);else if(d.pointerType==="touch"&&s.size===1)(ht(v)||v.closest("me-tpc"))&&(l={x:d.clientX,y:d.clientY},a=v,c=d.pointerId,r=window.setTimeout(()=>{St(t,i,d,!0)&&(a&&a.setPointerCapture(d.pointerId),Tt(i.ghost,d.clientX,d.clientY)),r=null,l=null,a=null,c=null},h));else if(d.pointerType==="mouse"&&St(t,i,d,!1)){v.setPointerCapture(d.pointerId);return}}const H=t.spacePressed&&d.button===0&&d.pointerType==="mouse",B=d.button===C&&d.pointerType==="mouse"||d.pointerType==="touch";!H&&!B||(e.x=d.clientX,e.y=d.clientY,v.className!=="circle"&&v.contentEditable!=="plaintext-only"&&(e.mousedown=!0,v.setPointerCapture(d.pointerId)))},T=d=>{if(d.pointerType==="touch"&&s.has(d.pointerId)){if(s.set(d.pointerId,{x:d.clientX,y:d.clientY}),r!==null&&l!==null&&d.pointerId===c){const v=d.clientX-l.x,C=d.clientY-l.y;Math.sqrt(v*v+C*C)>f&&u()}if(s.size>=2){const[v,C]=Array.from(s.values()),H=Ct(v,C);if(o==null)o=H;else{const B=H-o;Math.abs(B)>8&&(B>0?tt(t,"in",{x:(v.x+C.x)/2,y:(v.y+C.y)/2}):tt(t,"out",{x:(v.x+C.x)/2,y:(v.y+C.y)/2}),o=H)}return}}if(!(i&&i.pointerId!==null&&(jt(t,i,d),i.isDragging))){if(d.target.contentEditable!=="plaintext-only"||t.spacePressed&&e.mousedown){const v=d.clientX-e.x,C=d.clientY-e.y;e.onMove(v,C)}e.x=d.clientX,e.y=d.clientY}},D=d=>{if(d.pointerType==="touch"&&(s.delete(d.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId!==null){const v=i.isDragging;if(qt(t,i,d),y(d.target,d.pointerId),v)return}e.mousedown&&(y(d.target,d.pointerId),e.clear())},E=()=>{u(),e.mousedown&&e.clear(),i&&(i.isDragging||i.pointerId!==null)&&pt(t,i)},L=d=>{d.pointerType==="touch"&&(s.delete(d.pointerId),s.size<2&&(o=null),u()),i&&i.pointerId===d.pointerId&&pt(t,i),D(d)},P=d=>{if(d.preventDefault(),d.button!==2||!t.editable)return;const v=d.target;ht(v)&&!v.classList.contains("selected")&&t.selectNode(v),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",d)},200)},X=d=>{d.stopPropagation(),d.preventDefault(),d.ctrlKey||d.metaKey?d.deltaY<0?tt(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&tt(t,"out",t.dragMoveHelper):d.shiftKey?t.move(-d.deltaY,0):t.move(-d.deltaX,-d.deltaY)},{container:M}=t;return xt([{dom:M,evt:"pointerdown",func:S},{dom:M,evt:"pointermove",func:T},{dom:M,evt:"pointerup",func:D},{dom:M,evt:"pointercancel",func:L},{dom:M,evt:"pointerdown",func:w},{dom:M,evt:"click",func:p},{dom:M,evt:"dblclick",func:g},{dom:M,evt:"contextmenu",func:P},{dom:M,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:X},{dom:M,evt:"blur",func:E},{dom:M,evt:"keydown",func:b},{dom:M,evt:"keyup",func:x}])}function Ut(){return{handlers:{},addListener:function(t,e){this.handlers[t]===void 0&&(this.handlers[t]=[]),this.handlers[t].push(e)},fire:function(t,...e){if(this.handlers[t]instanceof Array){const n=this.handlers[t];for(let o=0;o<n.length;o++)n[o](...e)}},removeListener:function(t,e){if(!this.handlers[t])return;const n=this.handlers[t];if(!e)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===e&&this.handlers[t].splice(o,1)}}}const nt=document,Kt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);Dt.call(this,t,this.nodeData),t.draggable=!1;const e=nt.createElement("me-root");e.appendChild(t);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}Jt(this,n,e)},Jt=function(t,e,n){const o=nt.createElement("me-main");o.className=G.LHS;const s=nt.createElement("me-main");s.className=G.RHS;for(let i=0;i<e.length;i++){const r=e[i],{grp:l}=t.createWrapper(r);t.direction===2?r.direction===0?o.appendChild(l):s.appendChild(l):t.direction===0?o.appendChild(l):s.appendChild(l)}t.nodes.appendChild(o),t.nodes.appendChild(n),t.nodes.appendChild(s),t.nodes.appendChild(t.lines),t.nodes.appendChild(t.labelContainer)},Qt=function(t,e){const n=nt.createElement("me-children");for(let o=0;o<e.length;o++){const s=e[o],{grp:i}=t.createWrapper(s);n.appendChild(i)}return n},N=document,Mt=function(t,e){const o=(this?.el?this.el:e||document).querySelector(`[data-nodeid="me${t}"]`);if(!o)throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);return o},Dt=function(t,e){if(t.innerHTML="",e.style){const n=e.style;for(const o in n)t.style[o]=n[o]}if(e.dangerouslySetInnerHTML){t.innerHTML=e.dangerouslySetInnerHTML;return}if(e.image){const n=e.image;if(n.url&&n.width&&n.height){const o=N.createElement("img");o.src=this.imageProxy?this.imageProxy(n.url):n.url,o.style.width=n.width+"px",o.style.height=n.height+"px",n.fit&&(o.style.objectFit=n.fit),t.appendChild(o),t.image=o}}else t.image&&(t.image=void 0);{const n=N.createElement("span");n.className="text",this.markdown?n.innerHTML=this.markdown(e.topic,e):n.textContent=e.topic,t.appendChild(n),t.text=n}if(e.hyperLink){const n=N.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=e.hyperLink,t.appendChild(n),t.link=n}else t.link&&(t.link=void 0);if(e.icons&&e.icons.length){const n=N.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${Bt(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=N.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=N.createElement("span");typeof o=="string"?s.textContent=o:(s.textContent=o.text,o.className&&(s.className=o.className),o.style&&Object.assign(s.style,o.style)),n.appendChild(s)}),t.appendChild(n),t.tags=n}else t.tags&&(t.tags=void 0)},Zt=function(t,e){const n=N.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=se(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=Qt(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},te=function(t){const e=N.createElement("me-parent"),n=this.createTopic(t);return Dt.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},ee=function(t){const e=N.createElement("me-children");return e.append(...t),e},ne=function(t){const e=N.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e};function kt(t){const e=N.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const oe=function(t){if(!t)return;const e=N.createElement("div"),n=t.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=I(this.nodes,t);this.nodes.appendChild(e),e.id="input-box",e.textContent=o,e.contentEditable="plaintext-only",e.spellcheck=!1;const r=getComputedStyle(t);e.style.cssText=`
2
2
  left: ${s}px;
3
3
  top: ${i}px;
4
4
  min-width:${t.offsetWidth-8}px;
@@ -8,9 +8,9 @@ var MindElixirLite=(function(){"use strict";const ct={name:"Latte",type:"light",
8
8
  margin:${r.margin};
9
9
  background-color:${r.backgroundColor!=="rgba(0, 0, 0, 0)"&&r.backgroundColor};
10
10
  border: ${r.border};
11
- border-radius:${r.borderRadius}; `,this.direction===0&&(e.style.right="0"),kt(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",c=>{c.stopPropagation();const a=c.key;if(a==="Enter"||a==="Tab"){if(c.shiftKey)return;c.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{if(!e)return;e.remove();const c=e.textContent?.trim()||"";c===o||c===""||(n.topic=c,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=c,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},oe=function(t){const e=N.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},G=document,O="http://www.w3.org/2000/svg",tt=function(t){const e=t.clientWidth,n=t.clientHeight,o=t.dataset,s=Number(o.x),i=Number(o.y),r=o.anchor;let c=s;r==="middle"?c=s-e/2:r==="end"&&(c=s-e),t.style.left=`${c}px`,t.style.top=`${i-n/2}px`,t.style.visibility="visible"},pt=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:c}=o,a=document.createElement("div");a.className="svg-label",a.style.color=i||"#666";const l="label-"+c;return a.id=l,a.innerHTML=t,a.dataset.type=r,a.dataset.svgId=c,a.dataset.x=e.toString(),a.dataset.y=n.toString(),a.dataset.anchor=s,a},Dt=function(t,e,n){const o=G.createElementNS(O,"path");return D(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},q=function(t){const e=G.createElementNS(O,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},$t=function(){const t=G.createElementNS(O,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},se=function(t,e,n,o){const s=G.createElementNS(O,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const a=r.d,l=G.createElementNS(O,"path"),h={d:a,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(h.opacity=String(o.opacity)),D(l,h),c===0&&l.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const f=G.createElementNS(O,"path");D(f,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(f),s.appendChild(l),s[r.name]=l}),s},Nt=function(t,e,n){if(!e)return;const o=n.label,s=e.cloneNode(!0);t.nodes.appendChild(s),s.id="input-box",s.textContent=o,s.contentEditable="plaintext-only",s.spellcheck=!1,s.style.cssText=`
11
+ border-radius:${r.borderRadius}; `,this.direction===0&&(e.style.right="0"),kt(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",l=>{l.stopPropagation();const a=l.key;if(a==="Enter"||a==="Tab"){if(l.shiftKey)return;l.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{if(!e)return;e.remove();const l=e.textContent?.trim()||"";l===o||l===""||(n.topic=l,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=l,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},se=function(t){const e=N.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},V=document,O="http://www.w3.org/2000/svg",ot=function(t){const e=t.clientWidth,n=t.clientHeight,o=t.dataset,s=Number(o.x),i=Number(o.y),r=o.anchor;let l=s;r==="middle"?l=s-e/2:r==="end"&&(l=s-e),t.style.left=`${l}px`,t.style.top=`${i-n/2}px`,t.style.visibility="visible"},gt=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:l}=o,a=document.createElement("div");a.className="svg-label",a.style.color=i||"#666";const c="label-"+l;return a.id=c,a.innerHTML=t,a.dataset.type=r,a.dataset.svgId=l,a.dataset.x=e.toString(),a.dataset.y=n.toString(),a.dataset.anchor=s,a},$t=function(t,e,n){const o=V.createElementNS(O,"path");return k(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},_=function(t){const e=V.createElementNS(O,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},Nt=function(){const t=V.createElementNS(O,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},ie=function(t,e,n,o){const s=V.createElementNS(O,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,l)=>{const a=r.d,c=V.createElementNS(O,"path"),h={d:a,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(h.opacity=String(o.opacity)),k(c,h),l===0&&c.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const f=V.createElementNS(O,"path");k(f,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(f),s.appendChild(c),s[r.name]=c}),s},At=function(t,e,n){if(!e)return;const o=n.label,s=e.cloneNode(!0);t.nodes.appendChild(s),s.id="input-box",s.textContent=o,s.contentEditable="plaintext-only",s.spellcheck=!1,s.style.cssText=`
12
12
  left:${e.style.left};
13
13
  top:${e.style.top};
14
14
  max-width: 200px;
15
- `,kt(s),t.scrollIntoView(s),s.addEventListener("keydown",i=>{i.stopPropagation();const r=i.key;if(r==="Enter"||r==="Tab"){if(i.shiftKey)return;i.preventDefault(),s.blur(),t.container.focus()}}),s.addEventListener("blur",()=>{if(!s)return;const i=s.textContent?.trim()||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(t.markdown?e.innerHTML=t.markdown(n.label,n):e.textContent=n.label,tt(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},ie=function(t){const e=this.map.querySelector("me-root"),n=e.offsetTop,o=e.offsetLeft,s=e.offsetWidth,i=e.offsetHeight,r=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let c=0;c<r.length;c++){const a=r[c],l=a.querySelector("me-tpc"),{offsetLeft:h,offsetTop:f}=I(this.nodes,l),u=l.offsetWidth,y=l.offsetHeight,m=a.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:f,cL:h,cW:u,cH:y,direction:m,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,w=l.nodeObj.branchColor||g[c%g.length];if(l.style.borderColor=w,this.lines.appendChild(Dt(p,w,"3")),t&&t!==a)continue;const b=q("subLines"),x=a.lastChild;x.tagName==="svg"&&x.remove(),a.appendChild(b),At(this,b,w,a,m,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},At=function(t,e,n,o,s,i){const r=o.firstChild,c=o.children[1].children;if(c.length===0)return;const a=r.offsetTop,l=r.offsetLeft,h=r.offsetWidth,f=r.offsetHeight;for(let u=0;u<c.length;u++){const y=c[u],m=y.firstChild,p=m.offsetTop,g=m.offsetLeft,w=m.offsetWidth,b=m.offsetHeight,x=m.firstChild.nodeObj.branchColor||n,S=t.generateSubBranch({pT:a,pL:l,pW:h,pH:f,cT:p,cL:g,cW:w,cH:b,direction:s,isFirst:i});e.appendChild(Dt(S,x,"2"));const T=m.children[1];if(T){if(!T.expanded)continue}else continue;At(t,e,x,y,s)}},re={side:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>',left:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>',right:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>',full:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',living:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>',zoomin:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>',zoomout:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>'},R=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=re[e],n};function ce(t){const e=document.createElement("div"),n=R("fullscreen","full"),o=R("toCenter","living"),s=R("zoomout","zoomout"),i=R("zoomin","zoomin");e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb";let r=null;const c=()=>{const l=t.container.getBoundingClientRect(),h=ht(t.map.style.transform),f=l.width/2,u=l.height/2,y=(f-h.x)/t.scaleVal,m=(u-h.y)/t.scaleVal;r={containerRect:l,currentTransform:h,mapCenterX:y,mapCenterY:m}},a=()=>{if(r){const l=t.container.getBoundingClientRect(),h=l.width/2,f=l.height/2,u=h-r.mapCenterX*t.scaleVal,y=f-r.mapCenterY*t.scaleVal,m=u-r.currentTransform.x,p=y-r.currentTransform.y;t.move(m,p)}};return t.el.addEventListener("fullscreenchange",a),n.onclick=()=>{c(),document.fullscreenElement!==t.el?t.el.requestFullscreen():document.exitFullscreen()},o.onclick=()=>{t.toCenter()},s.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},i.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function le(t){const e=document.createElement("div"),n=R("tbltl","left"),o=R("tbltr","right"),s=R("tblts","side");return e.appendChild(n),e.appendChild(o),e.appendChild(s),e.className="mind-elixir-toolbar lt",n.onclick=()=>{t.initLeft()},o.onclick=()=>{t.initRight()},s.onclick=()=>{t.initSide()},e}function ae(t){t.container.append(ce(t)),t.container.append(le(t))}const de=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?lt:ct).cssVar,...t.cssVar},s=Object.keys(o);for(let i=0;i<s.length;i++){const r=s[i];this.container.style.setProperty(r,o[r])}e&&this.refresh()},he=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function fe(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const ue=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom-50||n.bottom<o.top+50||n.left>o.right-50||n.right<o.left+50){const i=n.left+n.width/2,r=n.top+n.height/2,c=o.left+o.width/2,a=o.top+o.height/2,l=i-c,h=r-a;this.move(-l,-h,!0)}},pe=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},ge=function(t){this.selection.select(t)},me=function(t){this.selection?.deselect(t)},ye=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},ve=function(){const t=fe(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},we=function(){return JSON.parse(this.getDataString())},be=function(){this.editable=!0},xe=function(){this.editable=!1},Ce=function(t,e={x:0,y:0}){if(t<this.scaleMin&&t<this.scaleVal||t>this.scaleMax&&t>this.scaleVal)return;const n=this.container.getBoundingClientRect(),o=e.x?e.x-n.left-n.width/2:0,s=e.y?e.y-n.top-n.height/2:0,{dx:i,dy:r}=gt(this),c=this.map.style.transform,{x:a,y:l}=ht(c),h=a-i,f=l-r,u=this.scaleVal,y=(-o+h)*(1-t/u),m=(-s+f)*(1-t/u);this.map.style.transform=`translate3d(${a-y}px, ${l-m}px, 0) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},Ee=function(){const t=this.nodes.offsetHeight/this.container.offsetHeight,e=this.nodes.offsetWidth/this.container.offsetWidth,n=1/Math.max(1,Math.max(t,e));this.scaleVal=n;const{dx:o,dy:s}=gt(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},Se=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i,container:r,nodes:c}=this;if(n&&o.style.transition==="transform 0.3s")return;const a=o.style.transform;let{x:l,y:h}=ht(a);const f=r.getBoundingClientRect(),u=c.getBoundingClientRect(),y=u.left<f.right&&u.right>f.left,m=u.top<f.bottom&&u.bottom>f.top;if(y){const p=u.left+t,g=u.right+t;(p>=f.right||g<=f.left)&&(t=0)}if(m){const p=u.top+e,g=u.bottom+e;(p>=f.bottom||g<=f.top)&&(e=0)}l+=t,h+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${l}px, ${h}px, 0) scale(${s})`,i.fire("move",{dx:t,dy:e})},gt=(t,e=!1)=>{const{container:n,map:o,nodes:s}=t;let i,r;if(t.alignment==="nodes"||e)i=(n.offsetWidth-s.offsetWidth)/2,r=(n.offsetHeight-s.offsetHeight)/2,o.style.transformOrigin="50% 50%";else{const c=o.querySelector("me-root"),a=c.offsetTop,l=c.offsetLeft,h=c.offsetWidth,f=c.offsetHeight;i=n.offsetWidth/2-l-h/2,r=n.offsetHeight/2-a-f/2,o.style.transformOrigin=`${l+h/2}px 50%`}return{dx:i,dy:r}},Te=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:function(){this.isFocusMode=!1,this.tempDirection!==null&&(this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},clearSelection:ye,disableEdit:xe,enableEdit:be,expandNode:function(t,e){const n=t.nodeObj;typeof e=="boolean"?n.expanded=e:n.expanded!==!1?n.expanded=!1:n.expanded=!0;const o=t.getBoundingClientRect(),s={x:o.left,y:o.top},i=t.parentNode,r=i.children[1];if(r.expanded=n.expanded,r.className=n.expanded?"minus":"",he(t),n.expanded){const f=this.createChildren(n.children.map(u=>this.createWrapper(u).grp));i.parentNode.appendChild(f)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const c=t.getBoundingClientRect(),a={x:c.left,y:c.top},l=s.x-a.x,h=s.y-a.y;this.move(l,h),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};wt(n,e??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),r={x:i.left,y:i.top},c=s.x-r.x,a=s.y-r.y;this.move(c,a)},focusNode:function(t){t.nodeObj.parent&&(this.clearSelection(),this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=t.nodeObj,this.initRight(),this.toCenter())},getData:we,getDataString:ve,initLeft:function(){this.direction=0,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initRight:function(){this.direction=1,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initSide:function(){this.direction=2,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},install:function(t){t(this)},move:Se,refresh:function(t){this.clearSelection(),t&&(t=JSON.parse(JSON.stringify(t)),this.nodeData=t.nodeData,this.arrows=t.arrows||[],this.summaries=t.summaries||[],t.theme&&this.changeTheme(t.theme)),at(this.nodeData),this.layout(),this.linkDiv()},scale:Ce,scaleFit:Ee,scrollIntoView:ue,selectNode:pe,selectNodes:ge,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=gt(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:me},Symbol.toStringTag,{value:"Module"})),Pt={create:function(t){return{dom:t,moved:!1,pointerdown:!1,lastX:0,lastY:0,handlePointerMove(e){if(this.pointerdown){this.moved=!0;const n=e.clientX-this.lastX,o=e.clientY-this.lastY;this.lastX=e.clientX,this.lastY=e.clientY,this.cb&&this.cb(n,o)}},handlePointerDown(e){e.button===0&&(this.pointerdown=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.dom.setPointerCapture(e.pointerId))},handleClear(e){this.pointerdown=!1,e.pointerId!==void 0&&this.dom.releasePointerCapture(e.pointerId)},cb:null,init(e,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.destroy=bt([{dom:e,evt:"pointermove",func:this.handlePointerMove},{dom:e,evt:"pointerleave",func:this.handleClear},{dom:e,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},Le="#4dc4ff";function Ht(t,e,n,o,s,i,r,c){return{x:t/8+n*3/8+s*3/8+r/8,y:e/8+o*3/8+i*3/8+c/8}}function Me(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),tt(t))}function et(t,e,n,o,s){D(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function It(t,e,n,o,s,i,r,c,a,l){const h=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;if(t.line.setAttribute("d",h),l.style){const p=l.style;p.stroke&&t.line.setAttribute("stroke",p.stroke),p.strokeWidth&&t.line.setAttribute("stroke-width",String(p.strokeWidth)),p.strokeDasharray&&t.line.setAttribute("stroke-dasharray",p.strokeDasharray),p.strokeLinecap&&t.line.setAttribute("stroke-linecap",p.strokeLinecap),p.opacity!==void 0&&t.line.setAttribute("opacity",String(p.opacity))}const f=t.querySelectorAll('path[stroke="transparent"]');f.length>0&&f[0].setAttribute("d",h);const u=K(i,r,c,a);if(u){const p=`M ${u.x1} ${u.y1} L ${c} ${a} L ${u.x2} ${u.y2}`;if(t.arrow1.setAttribute("d",p),f.length>1&&f[1].setAttribute("d",p),l.style){const g=l.style;g.stroke&&t.arrow1.setAttribute("stroke",g.stroke),g.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(g.opacity))}}if(l.bidirectional){const p=K(o,s,e,n);if(p){const g=`M ${p.x1} ${p.y1} L ${e} ${n} L ${p.x2} ${p.y2}`;if(t.arrow2.setAttribute("d",g),f.length>2&&f[2].setAttribute("d",g),l.style){const w=l.style;w.stroke&&t.arrow2.setAttribute("stroke",w.stroke),w.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(w.strokeWidth)),w.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",w.strokeLinecap),w.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(w.opacity))}}}const{x:y,y:m}=Ht(e,n,o,s,i,r,c,a);if(t.labelEl&&Me(t.labelEl,y,m),l.style?.labelColor){const p=t.labelEl;p&&(p.style.color=l.style.labelColor)}Ie(t)}function nt(t,e,n){const{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,a=s+r/2,l=c+n.x,h=a+n.y;return{w:i,h:r,cx:c,cy:a,ctrlX:l,ctrlY:h}}function V(t){let e,n;const o=(t.cy-t.ctrlY)/(t.ctrlX-t.cx);return o>t.h/t.w||o<-t.h/t.w?t.cy-t.ctrlY<0?(e=t.cx-t.h/2/o,n=t.cy+t.h/2):(e=t.cx+t.h/2/o,n=t.cy-t.h/2):t.cx-t.ctrlX<0?(e=t.cx+t.w/2,n=t.cy-t.w*o/2):(e=t.cx-t.w/2,n=t.cy+t.w*o/2),{x:e,y:n}}const mt=function(t,e,n,o,s){if(!e||!n)return;const i=nt(t,e,o.delta1),r=nt(t,n,o.delta2),{x:c,y:a}=V(i),{ctrlX:l,ctrlY:h}=i,{ctrlX:f,ctrlY:u}=r,{x:y,y:m}=V(r),p=K(f,u,y,m);if(!p)return;const g=`M ${p.x1} ${p.y1} L ${y} ${m} L ${p.x2} ${p.y2}`;let w="";if(o.bidirectional){const P=K(l,h,c,a);if(!P)return;w=`M ${P.x1} ${P.y1} L ${c} ${a} L ${P.x2} ${P.y2}`}const b=se(`M ${c} ${a} C ${l} ${h} ${f} ${u} ${y} ${m}`,g,w,o.style),{x,y:S}=Ht(c,a,l,h,f,u,y,m),T=o.style?.labelColor||"rgb(235, 95, 82)",k="arrow-"+o.id;b.id=k;const E=t.markdown?t.markdown(o.label,o):o.label,L=pt(E,x,S,{anchor:"middle",color:T,dataType:"arrow",svgId:k});b.labelEl=L,b.arrowObj=o,b.dataset.linkid=o.id,t.labelContainer.appendChild(L),t.linkSvgGroup.appendChild(b),tt(L),s||(t.arrows.push(o),t.currentArrow=b,Ot(t,o,i,r))},ke=function(t,e,n={}){const o=I(this.nodes,t),s=I(this.nodes,e),i=o.offsetLeft+t.offsetWidth/2,r=o.offsetTop+t.offsetHeight/2,c=s.offsetLeft+e.offsetWidth/2,a=s.offsetTop+e.offsetHeight/2,l=c-i,h=a-r,f=Math.sqrt(l*l+h*h),u=Math.max(50,Math.min(200,f*.3)),y=Math.abs(l),m=Math.abs(h);let p,g;if(y>m*1.5){const b=l>0?t.offsetWidth/2:-t.offsetWidth/2,x=l>0?-e.offsetWidth/2:e.offsetWidth/2;p={x:b+(l>0?u:-u),y:0},g={x:x+(l>0?-u:u),y:0}}else if(m>y*1.5){const b=h>0?t.offsetHeight/2:-t.offsetHeight/2,x=h>0?-e.offsetHeight/2:e.offsetHeight/2;p={x:0,y:b+(h>0?u:-u)},g={x:0,y:x+(h>0?-u:u)}}else{const b=Math.atan2(h,l),x=t.offsetWidth/2*Math.cos(b),S=t.offsetHeight/2*Math.sin(b),T=-(e.offsetWidth/2)*Math.cos(b),k=-(e.offsetHeight/2)*Math.sin(b),E=u*.7*(l>0?1:-1),L=u*.7*(h>0?1:-1);p={x:x+E,y:S+L},g={x:T-E,y:k-L}}const w={id:j(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,delta1:p,delta2:g,...n};mt(this,t,e,w),this.bus.fire("operation",{name:"createArrow",obj:w})},De=function(t){ot(this);const e={...t,id:j()};mt(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},$e=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;ot(this);const n=e.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),e.labelEl?.remove(),e.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},Ne=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=nt(this,n,e.delta1),i=nt(this,o,e.delta2);Ot(this,e,s,i)},Ae=function(){ot(this),this.currentArrow=null},yt=function(t,e){const n=document.createElementNS(O,"path");return D(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},Pe=function(t,e){const n=document.createElementNS(O,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=yt(t.line.getAttribute("d"),e);n.appendChild(o);const s=yt(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=yt(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},He=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Ie=function(t){const e=t.querySelector(".arrow-highlight");if(!e)return;const n=e.querySelectorAll("path");n.length>=1&&n[0].setAttribute("d",t.line.getAttribute("d")),n.length>=2&&n[1].setAttribute("d",t.arrow1.getAttribute("d")),n.length>=3&&t.arrow2.getAttribute("d")&&n[2].setAttribute("d",t.arrow2.getAttribute("d"))},ot=function(t){t.helper1?.destroy(),t.helper2?.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&He(t.currentArrow)},Ot=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:a,nodes:l,map:h,currentArrow:f,bus:u}=t;if(!f)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",l.appendChild(s),l.appendChild(i),l.appendChild(r),Pe(f,Le);let{x:y,y:m}=V(n),{ctrlX:p,ctrlY:g}=n,{ctrlX:w,ctrlY:b}=o,{x,y:S}=V(o);i.style.cssText=`top:${g}px;left:${p}px;`,r.style.cssText=`top:${b}px;left:${w}px;`,et(c,y,m,p,g),et(a,w,b,x,S),t.helper1=Pt.create(i),t.helper2=Pt.create(r),t.helper1.init(h,(T,k)=>{p=p+T/t.scaleVal,g=g+k/t.scaleVal;const E=V({...n,ctrlX:p,ctrlY:g});y=E.x,m=E.y,i.style.top=g+"px",i.style.left=p+"px",It(f,y,m,p,g,w,b,x,S,e),et(c,y,m,p,g),e.delta1.x=p-n.cx,e.delta1.y=g-n.cy,u.fire("updateArrowDelta",e)}),t.helper2.init(h,(T,k)=>{w=w+T/t.scaleVal,b=b+k/t.scaleVal;const E=V({...o,ctrlX:w,ctrlY:b});x=E.x,S=E.y,r.style.top=b+"px",r.style.left=w+"px",It(f,y,m,p,g,w,b,x,S,e),et(a,w,b,x,S),e.delta2.x=w-o.cx,e.delta2.y=b-o.cy,u.fire("updateArrowDelta",e)})};function Oe(){this.linkSvgGroup.innerHTML="",this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach(e=>e.remove());for(let e=0;e<this.arrows.length;e++){const n=this.arrows[e];try{mt(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function Ye(t){ot(this),t&&t.labelEl&&Nt(this,t.labelEl,t.arrowObj)}function Be(){this.arrows=this.arrows.filter(t=>U(t.from,this.nodeData)&&U(t.to,this.nodeData))}const Re=Object.freeze(Object.defineProperty({__proto__:null,createArrow:ke,createArrowFrom:De,editArrowLabel:Ye,removeArrow:$e,renderArrow:Oe,selectArrow:Ne,tidyArrow:Be,unselectArrow:Ae},Symbol.toStringTag,{value:"Module"})),We=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const a=t[0].nodeObj,l=t[0].nodeObj.parent;if(!l)throw new Error("Can not select root node.");const h=l.children.findIndex(f=>a===f);return{parent:l.id,start:h,end:h}}let e=0;const n=t.map(a=>{let l=a.nodeObj;const h=[];for(;l.parent;){const f=l.parent,y=f.children?.indexOf(l);l=f,h.unshift({node:l,index:y})}return h.length>e&&(e=h.length),h});let o=0;t:for(;o<e;o++){const a=n[0][o]?.node;for(let l=1;l<n.length;l++)if(n[l][o]?.node!==a)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(a=>a[o-1].index).sort(),i=s[0]||0,r=s[s.length-1]||0,c=n[0][o-1].node;if(!c.parent)throw new Error("Please select nodes in the same main topic.");return{parent:c.id,start:i,end:r}},Xe=function(t){const e=document.createElementNS(O,"g");return e.setAttribute("id",t),e},Yt=function(t,e){const n=document.createElementNS(O,"path");return D(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Ge=t=>t.parentElement.parentElement,Ve=function(t,{parent:e,start:n}){const o=t.findEle(e),s=o.nodeObj;let i;return s.parent?i=o.closest("me-main").className:i=t.findEle(s.children[n].id).closest("me-main").className,i},vt=function(t,e){const{id:n,label:o,parent:s,start:i,end:r,style:c}=e,{nodes:a,theme:l,summarySvg:h}=t,u=t.findEle(s).nodeObj,y=Ve(t,e);let m=1/0,p=0,g=0,w=0;for(let d=i;d<=r;d++){const v=u.children?.[d];if(!v)return t.removeSummary(n),null;const C=Ge(t.findEle(v.id)),{offsetLeft:H,offsetTop:B}=I(a,C),$=i===r?10:20;d===i&&(g=B+$),d===r&&(w=B+C.offsetHeight-$),H<m&&(m=H),C.offsetWidth+H>p&&(p=C.offsetWidth+H)}let b,x;const S=u.parent?10:0,T=g+S,k=w+S,E=(T+k)/2,L=c?.stroke||l.cssVar["--color"],P=c?.labelColor||l.cssVar["--color"],W="s-"+n,M=t.markdown?t.markdown(o,e):o;y===X.LHS?(b=Yt(`M ${m+10} ${T} c -5 0 -10 5 -10 10 L ${m} ${k-10} c 0 5 5 10 10 10 M ${m} ${E} h -10`,L),x=pt(M,m-20,E,{anchor:"end",color:P,dataType:"summary",svgId:W})):(b=Yt(`M ${p-10} ${T} c 5 0 10 5 10 10 L ${p} ${k-10} c 0 5 -5 10 -10 10 M ${p} ${E} h 10`,L),x=pt(M,p+20,E,{anchor:"start",color:P,dataType:"summary",svgId:W}));const F=Xe(W);return F.appendChild(b),t.labelContainer.appendChild(x),tt(x),F.summaryObj=e,F.labelEl=x,h.appendChild(F),F},ze=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(t={}){if(!this.currentNodes)return;const{currentNodes:e,summaries:n,bus:o}=this,{parent:s,start:i,end:r}=We(e),c={id:j(),parent:s,start:i,end:r,label:"summary",style:t.style},a=vt(this,c);n.push(c),this.editSummary(a),o.fire("operation",{name:"createSummary",obj:c})},createSummaryFrom:function(t){const e=j(),n={...t,id:e};vt(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelEl&&Nt(this,t.labelEl,t.summaryObj)},removeSummary:function(t){const e=this.summaries.findIndex(n=>n.id===t);e>-1&&(this.summaries.splice(e,1),this.nodes.querySelector("#s-"+t)?.remove(),this.nodes.querySelector("#label-s-"+t)?.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:t}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(t=>{try{vt(this,t)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(t){const e=t.labelEl;e&&e.classList.add("selected"),this.currentSummary=t},unselectSummary:function(){this.currentSummary?.labelEl?.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),A="http://www.w3.org/2000/svg";function Fe(t,e){const n=document.createElementNS(A,"svg");return D(n,{version:"1.1",xmlns:A,height:t,width:e}),n}function je(t,e){return(parseInt(t)-parseInt(e))/2}function qe(t,e,n,o){const s=document.createElementNS(A,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
16
- `).forEach((c,a)=>{const l=document.createElementNS(A,"text");D(l,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+je(e.lineHeight,e.fontSize)*(a+1)+parseFloat(e.fontSize)*(a+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),l.innerHTML=c,s.appendChild(l)}),s}function _e(t,e,n,o){let s="";t.nodeObj?.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(A,"foreignObject");D(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return D(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Ue(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=document.createElementNS(A,"rect");return D(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function st(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=I(t.nodes,e),r=document.createElementNS(A,"rect");D(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const c=document.createElementNS(A,"g");c.appendChild(r);let a;return n?a=_e(e,o,s,i):a=qe(e,o,s,i),c.appendChild(a),c}function Ke(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=document.createElementNS(A,"a"),r=document.createElementNS(A,"text");return D(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=e.textContent,i.appendChild(r),i.setAttribute("href",e.href),i}function Je(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=document.createElementNS(A,"image");return D(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const it=100,Qe='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Ze=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+it*2,s=n.offsetWidth+it*2,i=Fe(o+"px",s+"px"),r=document.createElementNS(A,"svg"),c=document.createElementNS(A,"rect");D(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(f=>{const u=f.cloneNode(!0),{offsetLeft:y,offsetTop:m}=I(n,f.parentElement);u.setAttribute("x",`${y}`),u.setAttribute("y",`${m}`),r.appendChild(u)});const a=n.querySelector(".lines")?.cloneNode(!0);a&&r.appendChild(a);const l=n.querySelector(".topiclinks")?.cloneNode(!0);l&&r.appendChild(l);const h=n.querySelector(".summary")?.cloneNode(!0);return h&&r.appendChild(h),n.querySelectorAll("me-tpc").forEach(f=>{f.nodeObj.dangerouslySetInnerHTML?r.appendChild(st(t,f,!e)):(r.appendChild(Ue(t,f)),r.appendChild(st(t,f.text,!e)))}),n.querySelectorAll(".tags > span").forEach(f=>{r.appendChild(st(t,f))}),n.querySelectorAll(".icons > span").forEach(f=>{r.appendChild(st(t,f))}),n.querySelectorAll(".hyper-link").forEach(f=>{r.appendChild(Ke(t,f))}),n.querySelectorAll("img").forEach(f=>{r.appendChild(Je(t,f))}),D(r,{x:it+"",y:it+"",overflow:"visible"}),i.appendChild(r),i},tn=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Qe+t.outerHTML);function en(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=s=>{e(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(t)})}const nn={getObjById:U,generateNewObj:Rt,layout:Ut,linkDiv:ie,editTopic:ne,createWrapper:Qt,createParent:Zt,createChildren:te,createTopic:ee,findEle:Lt,changeTheme:de,...Te,...{},...Re,...ze,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await en(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const c=document.createElement("canvas");c.width=r.width,c.height=r.height,c.getContext("2d").drawImage(r,0,0),c.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(t=!1,e){const n=Ze(this,t),o=tn(n,e);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"})),init(t){if(t=JSON.parse(JSON.stringify(t)),!t||!t.nodeData)return new Error("MindElixir: `data` is required");t.direction!==void 0&&(this.direction=t.direction),this.changeTheme(t.theme||this.theme,!1),this.nodeData=t.nodeData,at(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&ae(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){this.disposable.forEach(t=>t()),this.el&&(this.el.innerHTML=""),this.el=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,this.selection?.destroy(),this.selection=void 0}};function on({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,containerHeight:l}){let h=e+n/2;const f=t+o/2;let u;a===X.LHS?u=i+r:u=i;const y=s+c/2,p=(1-Math.abs(y-f)/l)*.25*(n/2);return a===X.LHS?h=h-n/10-p:h=h+n/10+p,`M ${h} ${f} Q ${h} ${y} ${u} ${y}`}function sn({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,isFirst:l}){const h=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let f=0,u=0;l?f=t+o/2:f=t+o;const y=s+c;let m=0,p=0,g=0;const w=Math.abs(f-y)/300*h;return a===X.LHS?(g=e,m=g+h,p=g-h,u=i+h,`M ${m} ${f} C ${g} ${f} ${g+w} ${y} ${p} ${y} H ${u}`):(g=e+n,m=g-h,p=g+h,u=i+r-h,`M ${m} ${f} C ${g} ${f} ${g-w} ${y} ${p} ${y} H ${u}`)}const rn="5.6.0";function cn(t){return{x:0,y:0,moved:!1,mousedown:!1,onMove(e,n){this.mousedown&&(this.moved=!0,t.move(e,n))},clear(){this.mousedown=!1}}}const z=document;function Y({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:c,mouseSelectionButton:a,selectionContainer:l,before:h,newTopicName:f,allowUndo:u,generateMainBranch:y,generateSubBranch:m,overflowHidden:p,theme:g,alignment:w,scaleSensitivity:b,scaleMax:x,scaleMin:S,handleWheel:T,markdown:k,imageProxy:E}){let L=null;const P=Object.prototype.toString.call(t);if(P==="[object HTMLDivElement]"?L=t:P==="[object String]"&&(L=document.querySelector(t)),!L)throw new Error("MindElixir: el is not a valid element");L.style.position="relative",L.innerHTML="",this.el=L,this.disposable=[],this.before=h||{},this.locale=n||"en",this.newTopicName=f||"New Node",this.contextMenu=i??!0,this.toolBar=r??!0,this.keypress=c??!0,this.mouseSelectionButton=a??0,this.direction=e??1,this.draggable=o??!0,this.editable=s??!0,this.allowUndo=u??!0,this.scaleSensitivity=b??.1,this.scaleMax=x??1.4,this.scaleMin=S??.2,this.generateMainBranch=y||on,this.generateSubBranch=m||sn,this.overflowHidden=p??!1,this.alignment=w??"root",this.handleWheel=T??!0,this.markdown=k||void 0,this.imageProxy=E||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=cn(this),this.bus=_t(),this.container=z.createElement("div"),this.selectionContainer=l||this.container,this.container.className="map-container";const W=window.matchMedia("(prefers-color-scheme: dark)");this.theme=g||(W.matches?lt:ct);const M=z.createElement("div");M.className="map-canvas",this.map=M,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=z.createElement("me-nodes"),this.lines=q("lines"),this.summarySvg=q("summary"),this.linkController=q("linkcontroller"),this.P2=z.createElement("div"),this.P3=z.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=$t(),this.line2=$t(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=q("topiclinks"),this.labelContainer=z.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(qt(this))}return Y.prototype=nn,Object.defineProperty(Y.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),Y.LEFT=0,Y.RIGHT=1,Y.SIDE=2,Y.THEME=ct,Y.DARK_THEME=lt,Y.version=rn,Y.E=Lt,Y})();
15
+ `,kt(s),t.scrollIntoView(s),s.addEventListener("keydown",i=>{i.stopPropagation();const r=i.key;if(r==="Enter"||r==="Tab"){if(i.shiftKey)return;i.preventDefault(),s.blur(),t.container.focus()}}),s.addEventListener("blur",()=>{if(!s)return;const i=s.textContent?.trim()||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(t.markdown?e.innerHTML=t.markdown(n.label,n):e.textContent=n.label,ot(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},re=function(t){const e=this.map.querySelector("me-root"),n=e.offsetTop,o=e.offsetLeft,s=e.offsetWidth,i=e.offsetHeight,r=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let l=0;l<r.length;l++){const a=r[l],c=a.querySelector("me-tpc"),{offsetLeft:h,offsetTop:f}=I(this.nodes,c),u=c.offsetWidth,y=c.offsetHeight,m=a.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:f,cL:h,cW:u,cH:y,direction:m,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,w=c.nodeObj.branchColor||g[l%g.length];if(c.style.borderColor=w,this.lines.appendChild($t(p,w,"3")),t&&t!==a)continue;const b=_("subLines"),x=a.lastChild;x.tagName==="svg"&&x.remove(),a.appendChild(b),Pt(this,b,w,a,m,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},Pt=function(t,e,n,o,s,i){const r=o.firstChild,l=o.children[1].children;if(l.length===0)return;const a=r.offsetTop,c=r.offsetLeft,h=r.offsetWidth,f=r.offsetHeight;for(let u=0;u<l.length;u++){const y=l[u],m=y.firstChild,p=m.offsetTop,g=m.offsetLeft,w=m.offsetWidth,b=m.offsetHeight,x=m.firstChild.nodeObj.branchColor||n,S=t.generateSubBranch({pT:a,pL:c,pW:h,pH:f,cT:p,cL:g,cW:w,cH:b,direction:s,isFirst:i});e.appendChild($t(S,x,"2"));const T=m.children[1];if(T){if(!T.expanded)continue}else continue;Pt(t,e,x,y,s)}},le={side:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>',left:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>',right:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>',full:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',living:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>',zoomin:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>',zoomout:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>'},W=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=le[e],n};function ce(t){const e=document.createElement("div"),n=W("fullscreen","full"),o=W("toCenter","living"),s=W("zoomout","zoomout"),i=W("zoomin","zoomin");e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb";let r=null;const l=()=>{const c=t.container.getBoundingClientRect(),h=ft(t.map.style.transform),f=c.width/2,u=c.height/2,y=(f-h.x)/t.scaleVal,m=(u-h.y)/t.scaleVal;r={containerRect:c,currentTransform:h,mapCenterX:y,mapCenterY:m}},a=()=>{if(r){const c=t.container.getBoundingClientRect(),h=c.width/2,f=c.height/2,u=h-r.mapCenterX*t.scaleVal,y=f-r.mapCenterY*t.scaleVal,m=u-r.currentTransform.x,p=y-r.currentTransform.y;t.move(m,p)}};return t.el.addEventListener("fullscreenchange",a),n.onclick=()=>{l(),document.fullscreenElement!==t.el?t.el.requestFullscreen():document.exitFullscreen()},o.onclick=()=>{t.toCenter()},s.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},i.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function ae(t){const e=document.createElement("div"),n=W("tbltl","left"),o=W("tbltr","right"),s=W("tblts","side");return e.appendChild(n),e.appendChild(o),e.appendChild(s),e.className="mind-elixir-toolbar lt",n.onclick=()=>{t.initLeft()},o.onclick=()=>{t.initRight()},s.onclick=()=>{t.initSide()},e}function de(t){t.container.append(ce(t)),t.container.append(ae(t))}const he=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?J:K).cssVar,...t.cssVar},s=Object.keys(o);for(let i=0;i<s.length;i++){const r=s[i];this.container.style.setProperty(r,o[r])}e&&this.refresh()},fe=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function ue(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const pe=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom-50||n.bottom<o.top+50||n.left>o.right-50||n.right<o.left+50){const i=n.left+n.width/2,r=n.top+n.height/2,l=o.left+o.width/2,a=o.top+o.height/2,c=i-l,h=r-a;this.move(-c,-h,!0)}},ge=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},me=function(t){this.selection.select(t)},ye=function(t){this.selection?.deselect(t)},ve=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},we=function(){const t=ue(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},be=function(){return JSON.parse(this.getDataString())},xe=function(){this.editable=!0},Ce=function(){this.editable=!1},Ee=function(t,e={x:0,y:0}){if(t<this.scaleMin&&t<this.scaleVal||t>this.scaleMax&&t>this.scaleVal)return;const n=this.container.getBoundingClientRect(),o=e.x?e.x-n.left-n.width/2:0,s=e.y?e.y-n.top-n.height/2:0,{dx:i,dy:r}=mt(this),l=this.map.style.transform,{x:a,y:c}=ft(l),h=a-i,f=c-r,u=this.scaleVal,y=(-o+h)*(1-t/u),m=(-s+f)*(1-t/u);this.map.style.transform=`translate3d(${a-y}px, ${c-m}px, 0) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},Se=function(){const t=this.nodes.offsetHeight/this.container.offsetHeight,e=this.nodes.offsetWidth/this.container.offsetWidth,n=1/Math.max(1,Math.max(t,e));this.scaleVal=n;const{dx:o,dy:s}=mt(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},Te=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i,container:r,nodes:l}=this;if(n&&o.style.transition==="transform 0.3s")return;const a=o.style.transform;let{x:c,y:h}=ft(a);const f=r.getBoundingClientRect(),u=l.getBoundingClientRect(),y=u.left<f.right&&u.right>f.left,m=u.top<f.bottom&&u.bottom>f.top;if(y){const p=u.left+t,g=u.right+t;(p>=f.right||g<=f.left)&&(t=0)}if(m){const p=u.top+e,g=u.bottom+e;(p>=f.bottom||g<=f.top)&&(e=0)}c+=t,h+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${c}px, ${h}px, 0) scale(${s})`,i.fire("move",{dx:t,dy:e})},mt=(t,e=!1)=>{const{container:n,map:o,nodes:s}=t;let i,r;if(t.alignment==="nodes"||e)i=(n.offsetWidth-s.offsetWidth)/2,r=(n.offsetHeight-s.offsetHeight)/2,o.style.transformOrigin="50% 50%";else{const l=o.querySelector("me-root"),a=l.offsetTop,c=l.offsetLeft,h=l.offsetWidth,f=l.offsetHeight;i=n.offsetWidth/2-c-h/2,r=n.offsetHeight/2-a-f/2,o.style.transformOrigin=`${c+h/2}px 50%`}return{dx:i,dy:r}},Le=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:function(){this.isFocusMode=!1,this.tempDirection!==null&&(this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},clearSelection:ve,disableEdit:Ce,enableEdit:xe,expandNode:function(t,e){const n=t.nodeObj;typeof e=="boolean"?n.expanded=e:n.expanded!==!1?n.expanded=!1:n.expanded=!0;const o=t.getBoundingClientRect(),s={x:o.left,y:o.top},i=t.parentNode,r=i.children[1];if(r.expanded=n.expanded,r.className=n.expanded?"minus":"",fe(t),n.expanded){const f=this.createChildren(n.children.map(u=>this.createWrapper(u).grp));i.parentNode.appendChild(f)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const l=t.getBoundingClientRect(),a={x:l.left,y:l.top},c=s.x-a.x,h=s.y-a.y;this.move(c,h),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};bt(n,e??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),r={x:i.left,y:i.top},l=s.x-r.x,a=s.y-r.y;this.move(l,a)},focusNode:function(t){t.nodeObj.parent&&(this.clearSelection(),this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=t.nodeObj,this.initRight(),this.toCenter())},getData:be,getDataString:we,initLeft:function(){this.direction=0,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initRight:function(){this.direction=1,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initSide:function(){this.direction=2,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},install:function(t){t(this)},move:Te,refresh:function(t){this.clearSelection(),t&&(t=JSON.parse(JSON.stringify(t)),this.nodeData=t.nodeData,this.arrows=t.arrows||[],this.summaries=t.summaries||[],t.theme&&this.changeTheme(t.theme)),dt(this.nodeData),this.layout(),this.linkDiv()},scale:Ee,scaleFit:Se,scrollIntoView:pe,selectNode:ge,selectNodes:me,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=mt(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:ye},Symbol.toStringTag,{value:"Module"})),Ht={create:function(t){return{dom:t,moved:!1,pointerdown:!1,lastX:0,lastY:0,handlePointerMove(e){if(this.pointerdown){this.moved=!0;const n=e.clientX-this.lastX,o=e.clientY-this.lastY;this.lastX=e.clientX,this.lastY=e.clientY,this.cb&&this.cb(n,o)}},handlePointerDown(e){e.button===0&&(this.pointerdown=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.dom.setPointerCapture(e.pointerId))},handleClear(e){this.pointerdown=!1,e.pointerId!==void 0&&this.dom.releasePointerCapture(e.pointerId)},cb:null,init(e,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.destroy=xt([{dom:e,evt:"pointermove",func:this.handlePointerMove},{dom:e,evt:"pointerleave",func:this.handleClear},{dom:e,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},Me="#4dc4ff";function It(t,e,n,o,s,i,r,l){return{x:t/8+n*3/8+s*3/8+r/8,y:e/8+o*3/8+i*3/8+l/8}}function De(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),ot(t))}function st(t,e,n,o,s){k(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function Ot(t,e,n,o,s,i,r,l,a,c){const h=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${l} ${a}`;if(t.line.setAttribute("d",h),c.style){const p=c.style;p.stroke&&t.line.setAttribute("stroke",p.stroke),p.strokeWidth&&t.line.setAttribute("stroke-width",String(p.strokeWidth)),p.strokeDasharray&&t.line.setAttribute("stroke-dasharray",p.strokeDasharray),p.strokeLinecap&&t.line.setAttribute("stroke-linecap",p.strokeLinecap),p.opacity!==void 0&&t.line.setAttribute("opacity",String(p.opacity))}const f=t.querySelectorAll('path[stroke="transparent"]');f.length>0&&f[0].setAttribute("d",h);const u=Z(i,r,l,a);if(u){const p=`M ${u.x1} ${u.y1} L ${l} ${a} L ${u.x2} ${u.y2}`;if(t.arrow1.setAttribute("d",p),f.length>1&&f[1].setAttribute("d",p),c.style){const g=c.style;g.stroke&&t.arrow1.setAttribute("stroke",g.stroke),g.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(g.opacity))}}if(c.bidirectional){const p=Z(o,s,e,n);if(p){const g=`M ${p.x1} ${p.y1} L ${e} ${n} L ${p.x2} ${p.y2}`;if(t.arrow2.setAttribute("d",g),f.length>2&&f[2].setAttribute("d",g),c.style){const w=c.style;w.stroke&&t.arrow2.setAttribute("stroke",w.stroke),w.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(w.strokeWidth)),w.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",w.strokeLinecap),w.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(w.opacity))}}}const{x:y,y:m}=It(e,n,o,s,i,r,l,a);if(t.labelEl&&De(t.labelEl,y,m),c.style?.labelColor){const p=t.labelEl;p&&(p.style.color=c.style.labelColor)}Oe(t)}function it(t,e,n){const{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,l=o+i/2,a=s+r/2,c=l+n.x,h=a+n.y;return{w:i,h:r,cx:l,cy:a,ctrlX:c,ctrlY:h}}function z(t){let e,n;const o=(t.cy-t.ctrlY)/(t.ctrlX-t.cx);return o>t.h/t.w||o<-t.h/t.w?t.cy-t.ctrlY<0?(e=t.cx-t.h/2/o,n=t.cy+t.h/2):(e=t.cx+t.h/2/o,n=t.cy-t.h/2):t.cx-t.ctrlX<0?(e=t.cx+t.w/2,n=t.cy-t.w*o/2):(e=t.cx-t.w/2,n=t.cy+t.w*o/2),{x:e,y:n}}const yt=function(t,e,n,o,s){if(!e||!n)return;const i=it(t,e,o.delta1),r=it(t,n,o.delta2),{x:l,y:a}=z(i),{ctrlX:c,ctrlY:h}=i,{ctrlX:f,ctrlY:u}=r,{x:y,y:m}=z(r),p=Z(f,u,y,m);if(!p)return;const g=`M ${p.x1} ${p.y1} L ${y} ${m} L ${p.x2} ${p.y2}`;let w="";if(o.bidirectional){const P=Z(c,h,l,a);if(!P)return;w=`M ${P.x1} ${P.y1} L ${l} ${a} L ${P.x2} ${P.y2}`}const b=ie(`M ${l} ${a} C ${c} ${h} ${f} ${u} ${y} ${m}`,g,w,o.style),{x,y:S}=It(l,a,c,h,f,u,y,m),T=o.style?.labelColor||"rgb(235, 95, 82)",D="arrow-"+o.id;b.id=D;const E=t.markdown?t.markdown(o.label,o):o.label,L=gt(E,x,S,{anchor:"middle",color:T,dataType:"arrow",svgId:D});b.labelEl=L,b.arrowObj=o,b.dataset.linkid=o.id,t.labelContainer.appendChild(L),t.linkSvgGroup.appendChild(b),ot(L),s||(t.arrows.push(o),t.currentArrow=b,Yt(t,o,i,r))},ke=function(t,e,n={}){const o=I(this.nodes,t),s=I(this.nodes,e),i=o.offsetLeft+t.offsetWidth/2,r=o.offsetTop+t.offsetHeight/2,l=s.offsetLeft+e.offsetWidth/2,a=s.offsetTop+e.offsetHeight/2,c=l-i,h=a-r,f=Math.sqrt(c*c+h*h),u=Math.max(50,Math.min(200,f*.3)),y=Math.abs(c),m=Math.abs(h);let p,g;if(y>m*1.5){const b=c>0?t.offsetWidth/2:-t.offsetWidth/2,x=c>0?-e.offsetWidth/2:e.offsetWidth/2;p={x:b+(c>0?u:-u),y:0},g={x:x+(c>0?-u:u),y:0}}else if(m>y*1.5){const b=h>0?t.offsetHeight/2:-t.offsetHeight/2,x=h>0?-e.offsetHeight/2:e.offsetHeight/2;p={x:0,y:b+(h>0?u:-u)},g={x:0,y:x+(h>0?-u:u)}}else{const b=Math.atan2(h,c),x=t.offsetWidth/2*Math.cos(b),S=t.offsetHeight/2*Math.sin(b),T=-(e.offsetWidth/2)*Math.cos(b),D=-(e.offsetHeight/2)*Math.sin(b),E=u*.7*(c>0?1:-1),L=u*.7*(h>0?1:-1);p={x:x+E,y:S+L},g={x:T-E,y:D-L}}const w={id:q(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,delta1:p,delta2:g,...n};yt(this,t,e,w),this.bus.fire("operation",{name:"createArrow",obj:w})},$e=function(t){rt(this);const e={...t,id:q()};yt(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},Ne=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;rt(this);const n=e.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),e.labelEl?.remove(),e.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},Ae=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=it(this,n,e.delta1),i=it(this,o,e.delta2);Yt(this,e,s,i)},Pe=function(){rt(this),this.currentArrow=null},vt=function(t,e){const n=document.createElementNS(O,"path");return k(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},He=function(t,e){const n=document.createElementNS(O,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=vt(t.line.getAttribute("d"),e);n.appendChild(o);const s=vt(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=vt(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},Ie=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Oe=function(t){const e=t.querySelector(".arrow-highlight");if(!e)return;const n=e.querySelectorAll("path");n.length>=1&&n[0].setAttribute("d",t.line.getAttribute("d")),n.length>=2&&n[1].setAttribute("d",t.arrow1.getAttribute("d")),n.length>=3&&t.arrow2.getAttribute("d")&&n[2].setAttribute("d",t.arrow2.getAttribute("d"))},rt=function(t){t.helper1?.destroy(),t.helper2?.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&Ie(t.currentArrow)},Yt=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:l,line2:a,nodes:c,map:h,currentArrow:f,bus:u}=t;if(!f)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",c.appendChild(s),c.appendChild(i),c.appendChild(r),He(f,Me);let{x:y,y:m}=z(n),{ctrlX:p,ctrlY:g}=n,{ctrlX:w,ctrlY:b}=o,{x,y:S}=z(o);i.style.cssText=`top:${g}px;left:${p}px;`,r.style.cssText=`top:${b}px;left:${w}px;`,st(l,y,m,p,g),st(a,w,b,x,S),t.helper1=Ht.create(i),t.helper2=Ht.create(r),t.helper1.init(h,(T,D)=>{p=p+T/t.scaleVal,g=g+D/t.scaleVal;const E=z({...n,ctrlX:p,ctrlY:g});y=E.x,m=E.y,i.style.top=g+"px",i.style.left=p+"px",Ot(f,y,m,p,g,w,b,x,S,e),st(l,y,m,p,g),e.delta1.x=p-n.cx,e.delta1.y=g-n.cy,u.fire("updateArrowDelta",e)}),t.helper2.init(h,(T,D)=>{w=w+T/t.scaleVal,b=b+D/t.scaleVal;const E=z({...o,ctrlX:w,ctrlY:b});x=E.x,S=E.y,r.style.top=b+"px",r.style.left=w+"px",Ot(f,y,m,p,g,w,b,x,S,e),st(a,w,b,x,S),e.delta2.x=w-o.cx,e.delta2.y=b-o.cy,u.fire("updateArrowDelta",e)})};function Ye(){this.linkSvgGroup.innerHTML="",this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach(e=>e.remove());for(let e=0;e<this.arrows.length;e++){const n=this.arrows[e];try{yt(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function Re(t){rt(this),t&&t.labelEl&&At(this,t.labelEl,t.arrowObj)}function Be(){this.arrows=this.arrows.filter(t=>Q(t.from,this.nodeData)&&Q(t.to,this.nodeData))}const We=Object.freeze(Object.defineProperty({__proto__:null,createArrow:ke,createArrowFrom:$e,editArrowLabel:Re,removeArrow:Ne,renderArrow:Ye,selectArrow:Ae,tidyArrow:Be,unselectArrow:Pe},Symbol.toStringTag,{value:"Module"})),Xe=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const a=t[0].nodeObj,c=t[0].nodeObj.parent;if(!c)throw new Error("Can not select root node.");const h=c.children.findIndex(f=>a===f);return{parent:c.id,start:h,end:h}}let e=0;const n=t.map(a=>{let c=a.nodeObj;const h=[];for(;c.parent;){const f=c.parent,y=f.children?.indexOf(c);c=f,h.unshift({node:c,index:y})}return h.length>e&&(e=h.length),h});let o=0;t:for(;o<e;o++){const a=n[0][o]?.node;for(let c=1;c<n.length;c++)if(n[c][o]?.node!==a)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(a=>a[o-1].index).sort(),i=s[0]||0,r=s[s.length-1]||0,l=n[0][o-1].node;if(!l.parent)throw new Error("Please select nodes in the same main topic.");return{parent:l.id,start:i,end:r}},Ge=function(t){const e=document.createElementNS(O,"g");return e.setAttribute("id",t),e},Rt=function(t,e){const n=document.createElementNS(O,"path");return k(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Ve=t=>t.parentElement.parentElement,ze=function(t,{parent:e,start:n}){const o=t.findEle(e),s=o.nodeObj;let i;return s.parent?i=o.closest("me-main").className:i=t.findEle(s.children[n].id).closest("me-main").className,i},wt=function(t,e){const{id:n,label:o,parent:s,start:i,end:r,style:l}=e,{nodes:a,theme:c,summarySvg:h}=t,u=t.findEle(s).nodeObj,y=ze(t,e);let m=1/0,p=0,g=0,w=0;for(let d=i;d<=r;d++){const v=u.children?.[d];if(!v)return t.removeSummary(n),null;const C=Ve(t.findEle(v.id)),{offsetLeft:H,offsetTop:B}=I(a,C),$=i===r?10:20;d===i&&(g=B+$),d===r&&(w=B+C.offsetHeight-$),H<m&&(m=H),C.offsetWidth+H>p&&(p=C.offsetWidth+H)}let b,x;const S=u.parent?10:0,T=g+S,D=w+S,E=(T+D)/2,L=l?.stroke||c.cssVar["--color"],P=l?.labelColor||c.cssVar["--color"],X="s-"+n,M=t.markdown?t.markdown(o,e):o;y===G.LHS?(b=Rt(`M ${m+10} ${T} c -5 0 -10 5 -10 10 L ${m} ${D-10} c 0 5 5 10 10 10 M ${m} ${E} h -10`,L),x=gt(M,m-20,E,{anchor:"end",color:P,dataType:"summary",svgId:X})):(b=Rt(`M ${p-10} ${T} c 5 0 10 5 10 10 L ${p} ${D-10} c 0 5 -5 10 -10 10 M ${p} ${E} h 10`,L),x=gt(M,p+20,E,{anchor:"start",color:P,dataType:"summary",svgId:X}));const j=Ge(X);return j.appendChild(b),t.labelContainer.appendChild(x),ot(x),j.summaryObj=e,j.labelEl=x,h.appendChild(j),j},Fe=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(t={}){if(!this.currentNodes)return;const{currentNodes:e,summaries:n,bus:o}=this,{parent:s,start:i,end:r}=Xe(e),l={id:q(),parent:s,start:i,end:r,label:"summary",style:t.style},a=wt(this,l);n.push(l),this.editSummary(a),o.fire("operation",{name:"createSummary",obj:l})},createSummaryFrom:function(t){const e=q(),n={...t,id:e};wt(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelEl&&At(this,t.labelEl,t.summaryObj)},removeSummary:function(t){const e=this.summaries.findIndex(n=>n.id===t);e>-1&&(this.summaries.splice(e,1),this.nodes.querySelector("#s-"+t)?.remove(),this.nodes.querySelector("#label-s-"+t)?.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:t}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(t=>{try{wt(this,t)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(t){const e=t.labelEl;e&&e.classList.add("selected"),this.currentSummary=t},unselectSummary:function(){this.currentSummary?.labelEl?.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),A="http://www.w3.org/2000/svg";function je(t,e){const n=document.createElementNS(A,"svg");return k(n,{version:"1.1",xmlns:A,height:t,width:e}),n}function qe(t,e){return(parseInt(t)-parseInt(e))/2}function _e(t,e,n,o){const s=document.createElementNS(A,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
16
+ `).forEach((l,a)=>{const c=document.createElementNS(A,"text");k(c,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+qe(e.lineHeight,e.fontSize)*(a+1)+parseFloat(e.fontSize)*(a+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),c.innerHTML=l,s.appendChild(c)}),s}function Ue(t,e,n,o){let s="";t.nodeObj?.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(A,"foreignObject");k(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return k(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Ke(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=document.createElementNS(A,"rect");return k(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function lt(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=I(t.nodes,e),r=document.createElementNS(A,"rect");k(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const l=document.createElementNS(A,"g");l.appendChild(r);let a;return n?a=Ue(e,o,s,i):a=_e(e,o,s,i),l.appendChild(a),l}function Je(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=document.createElementNS(A,"a"),r=document.createElementNS(A,"text");return k(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=e.textContent,i.appendChild(r),i.setAttribute("href",e.href),i}function Qe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=I(t.nodes,e),i=document.createElementNS(A,"image");return k(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const ct=100,Ze='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',tn=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+ct*2,s=n.offsetWidth+ct*2,i=je(o+"px",s+"px"),r=document.createElementNS(A,"svg"),l=document.createElementNS(A,"rect");k(l,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(l),n.querySelectorAll(".subLines").forEach(f=>{const u=f.cloneNode(!0),{offsetLeft:y,offsetTop:m}=I(n,f.parentElement);u.setAttribute("x",`${y}`),u.setAttribute("y",`${m}`),r.appendChild(u)});const a=n.querySelector(".lines")?.cloneNode(!0);a&&r.appendChild(a);const c=n.querySelector(".topiclinks")?.cloneNode(!0);c&&r.appendChild(c);const h=n.querySelector(".summary")?.cloneNode(!0);return h&&r.appendChild(h),n.querySelectorAll("me-tpc").forEach(f=>{f.nodeObj.dangerouslySetInnerHTML?r.appendChild(lt(t,f,!e)):(r.appendChild(Ke(t,f)),r.appendChild(lt(t,f.text,!e)))}),n.querySelectorAll(".tags > span").forEach(f=>{r.appendChild(lt(t,f))}),n.querySelectorAll(".icons > span").forEach(f=>{r.appendChild(lt(t,f))}),n.querySelectorAll(".hyper-link").forEach(f=>{r.appendChild(Je(t,f))}),n.querySelectorAll("img").forEach(f=>{r.appendChild(Qe(t,f))}),k(r,{x:ct+"",y:ct+"",overflow:"visible"}),i.appendChild(r),i},en=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Ze+t.outerHTML);function nn(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=s=>{e(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(t)})}const on={getObjById:Q,generateNewObj:Wt,layout:Kt,linkDiv:re,editTopic:oe,createWrapper:Zt,createParent:te,createChildren:ee,createTopic:ne,findEle:Mt,changeTheme:he,...Le,...{},...We,...Fe,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await nn(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const l=document.createElement("canvas");l.width=r.width,l.height=r.height,l.getContext("2d").drawImage(r,0,0),l.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(t=!1,e){const n=tn(this,t),o=en(n,e);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"})),init(t){if(t=JSON.parse(JSON.stringify(t)),!t||!t.nodeData)return new Error("MindElixir: `data` is required");t.direction!==void 0&&(this.direction=t.direction),this.changeTheme(t.theme||this.theme,!1),this.nodeData=t.nodeData,dt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&de(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){this.disposable.forEach(t=>t()),this.el&&(this.el.innerHTML=""),this.el=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,this.selection?.destroy(),this.selection=void 0}};function sn({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:a,containerHeight:c}){let h=e+n/2;const f=t+o/2;let u;a===G.LHS?u=i+r:u=i;const y=s+l/2,p=(1-Math.abs(y-f)/c)*.25*(n/2);return a===G.LHS?h=h-n/10-p:h=h+n/10+p,`M ${h} ${f} Q ${h} ${y} ${u} ${y}`}function rn({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:a,isFirst:c}){const h=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let f=0,u=0;c?f=t+o/2:f=t+o;const y=s+l;let m=0,p=0,g=0;const w=Math.abs(f-y)/300*h;return a===G.LHS?(g=e,m=g+h,p=g-h,u=i+h,`M ${m} ${f} C ${g} ${f} ${g+w} ${y} ${p} ${y} H ${u}`):(g=e+n,m=g-h,p=g+h,u=i+r-h,`M ${m} ${f} C ${g} ${f} ${g-w} ${y} ${p} ${y} H ${u}`)}const ln="5.6.1";function cn(t){return{x:0,y:0,moved:!1,mousedown:!1,onMove(e,n){this.mousedown&&(this.moved=!0,t.move(e,n))},clear(){this.mousedown=!1}}}const F=document;function Y({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:l,mouseSelectionButton:a,selectionContainer:c,before:h,newTopicName:f,allowUndo:u,generateMainBranch:y,generateSubBranch:m,overflowHidden:p,theme:g,alignment:w,scaleSensitivity:b,scaleMax:x,scaleMin:S,handleWheel:T,markdown:D,imageProxy:E}){let L=null;const P=Object.prototype.toString.call(t);if(P==="[object HTMLDivElement]"?L=t:P==="[object String]"&&(L=document.querySelector(t)),!L)throw new Error("MindElixir: el is not a valid element");L.style.position="relative",L.innerHTML="",this.el=L,this.disposable=[],this.before=h||{},this.locale=n||"en",this.newTopicName=f||"New Node",this.contextMenu=i??!0,this.toolBar=r??!0,this.keypress=l??!0,this.mouseSelectionButton=a??0,this.direction=e??1,this.draggable=o??!0,this.editable=s??!0,this.allowUndo=u??!0,this.scaleSensitivity=b??.1,this.scaleMax=x??1.4,this.scaleMin=S??.2,this.generateMainBranch=y||sn,this.generateSubBranch=m||rn,this.overflowHidden=p??!1,this.alignment=w??"root",this.handleWheel=T??!0,this.markdown=D||void 0,this.imageProxy=E||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=cn(this),this.bus=Ut(),this.container=F.createElement("div"),this.selectionContainer=c||this.container,this.container.className="map-container";const X=window.matchMedia("(prefers-color-scheme: dark)");this.theme=g||(X.matches?J:K);const M=F.createElement("div");M.className="map-canvas",this.map=M,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=F.createElement("me-nodes"),this.lines=_("lines"),this.summarySvg=_("summary"),this.linkController=_("linkcontroller"),this.P2=F.createElement("div"),this.P3=F.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Nt(),this.line2=Nt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=_("topiclinks"),this.labelContainer=F.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(_t(this))}return Y.prototype=on,Object.defineProperty(Y.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),Y.LEFT=0,Y.RIGHT=1,Y.SIDE=2,Y.THEME=K,Y.DARK_THEME=J,Y.version=ln,Y.E=Mt,R.DARK_THEME=J,R.LEFT=0,R.RIGHT=1,R.SIDE=2,R.THEME=K,R.default=Y,Object.defineProperties(R,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),R})({});
@@ -1,4 +1,4 @@
1
- const ft = {
1
+ const Bn = 0, Rn = 1, Wn = 2, ft = {
2
2
  name: "Latte",
3
3
  type: "light",
4
4
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -23,7 +23,7 @@ const ft = {
23
23
  "--panel-color": "#444446",
24
24
  "--panel-bgcolor": "#ffffff",
25
25
  "--panel-border-color": "#eaeaea",
26
- "--map-padding": "50px"
26
+ "--map-padding": "50px 80px"
27
27
  }
28
28
  }, ut = {
29
29
  name: "Dark",
@@ -1440,7 +1440,7 @@ function In({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
1440
1440
  const w = Math.abs(f - y) / 300 * h;
1441
1441
  return a === F.LHS ? (g = e, m = g + h, p = g - h, u = i + h, `M ${m} ${f} C ${g} ${f} ${g + w} ${y} ${p} ${y} H ${u}`) : (g = e + n, m = g - h, p = g + h, u = i + r - h, `M ${m} ${f} C ${g} ${f} ${g - w} ${y} ${p} ${y} H ${u}`);
1442
1442
  }
1443
- const On = "5.6.0";
1443
+ const On = "5.6.1";
1444
1444
  function Yn(t) {
1445
1445
  return {
1446
1446
  x: 0,
@@ -1507,5 +1507,10 @@ Y.DARK_THEME = ut;
1507
1507
  Y.version = On;
1508
1508
  Y.E = $t;
1509
1509
  export {
1510
+ ut as DARK_THEME,
1511
+ Bn as LEFT,
1512
+ Rn as RIGHT,
1513
+ Wn as SIDE,
1514
+ ft as THEME,
1510
1515
  Y as default
1511
1516
  };
@@ -109,6 +109,7 @@ export interface MindElixirCtor {
109
109
  }
110
110
  declare const _default: MindElixirCtor;
111
111
  export default _default;
112
+ export { LEFT, RIGHT, SIDE, THEME, DARK_THEME };
112
113
  export type * from './utils/pubsub';
113
114
  export type * from './types/index';
114
115
  export type * from './types/dom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mind-elixir",
3
- "version": "5.6.0",
3
+ "version": "5.6.1",
4
4
  "type": "module",
5
5
  "description": "Mind elixir is a free open source mind map core.",
6
6
  "keywords": [
package/readme.md CHANGED
@@ -22,6 +22,9 @@
22
22
  <a href="https://bundlephobia.com/result?p=mind-elixir">
23
23
  <img src="https://badgen.net/bundlephobia/dependency-count/mind-elixir" alt="dependency-count">
24
24
  </a>
25
+ <a href="https://dependents.info/SSShooter/mind-elixir-core">
26
+ <img src="https://dependents.info/SSShooter/mind-elixir-core/badge" alt="dependents count badge" />
27
+ </a>
25
28
  <a href="https://packagephobia.com/result?p=mind-elixir">
26
29
  <img src="https://packagephobia.com/badge?p=mind-elixir" alt="package size">
27
30
  </a>
@@ -72,6 +75,7 @@ Mind elixir is a open source JavaScript mind map core. You can use it with any f
72
75
  <details>
73
76
  <summary>Table of Contents</summary>
74
77
 
78
+ - [Used by](#used-by)
75
79
  - [Features](#features)
76
80
  - [🎨 **User Experience**](#-user-experience)
77
81
  - [⚡ **Performance \& Architecture**](#-performance--architecture)
@@ -102,6 +106,12 @@ Mind elixir is a open source JavaScript mind map core. You can use it with any f
102
106
 
103
107
  </details>
104
108
 
109
+ ## Used by
110
+
111
+ <a href="https://dependents.info/SSShooter/mind-elixir-core">
112
+ <img src="https://dependents.info/SSShooter/mind-elixir-core/image" alt="network dependents image" />
113
+ </a>
114
+
105
115
  ## Try now
106
116
 
107
117
  ![mindelixir](https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/screenshot5_2.jpg)