mind-elixir 5.3.4 → 5.3.6

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 fe={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","--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"}},ue={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","--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 pe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const Z=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=Z(e,t.children[n]);if(o)return o}return null}else return null},O=(e,t)=>{if(e.parent=t,e.children)for(let n=0;n<e.children.length;n++)O(e.children[n],e)},K=(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=>{K(s,t,o)})}else e.children.forEach(o=>{K(o,!1)})};function ge(e){if(e.id=I(),e.children)for(let t=0;t<e.children.length;t++)ge(e.children[t])}function Q(e,t,n,o){const s=o-t,i=e-n;let l=Math.atan(Math.abs(s)/Math.abs(i))/3.14*180;if(isNaN(l))return;i<0&&s>0&&(l=180-l),i<0&&s<0&&(l=180+l),i>0&&s<0&&(l=360-l);const r=12,c=30,a=l+c,h=l-c;return{x1:n+Math.cos(Math.PI*a/180)*r,y1:o-Math.sin(Math.PI*a/180)*r,x2:n+Math.cos(Math.PI*h/180)*r,y2:o-Math.sin(Math.PI*h/180)*r}}function I(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const ft=function(){const e=I();return{topic:this.newTopicName,id:e}};function me(e){return JSON.parse(JSON.stringify(e,(n,o)=>{if(n!=="parent")return o}))}const $=(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}},k=(e,t)=>{for(const n in t)e.setAttribute(n,t[n])},ye=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}),Le=e=>{const t=/translate\(([^,]+),\s*([^)]+)\)/,n=e.match(t);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},ve=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)}}},D={LHS:"lhs",RHS:"rhs"},ut=e=>{const t=e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},pt=e=>{const t=e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},gt=e=>{e.selectNode(e.map.querySelector("me-root>me-tpc"))},mt=function(e,t){const n=t.parentElement.parentElement.parentElement.previousSibling;if(n){const o=n.firstChild;e.selectNode(o)}},yt=function(e,t){const n=t.parentElement.nextSibling;if(n&&n.firstChild){const o=n.firstChild.firstChild.firstChild;e.selectNode(o)}},Ae=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?yt(e,n):o.parent?.parent?mt(e,n):gt(e):t===D.LHS?ut(e):pt(e)},Me=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)},te=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 vt(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)K(a,!1);if(r.key==="=")for(const a of c.children)K(a,!0);if(["1","2","3","4","5","6","7","8","9"].includes(r.key))for(const a of c.children)K(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();Me(e,"previous")}},ArrowDown:r=>{r.altKey?e.moveDownNode():Me(e,"next")},ArrowLeft:r=>{if(r.metaKey||r.ctrlKey)return e.initLeft();Ae(e,D.LHS)},ArrowRight:r=>{if(r.metaKey||r.ctrlKey)return e.initRight();Ae(e,D.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)&&te(e,"in")},"-":r=>{(r.metaKey||r.ctrlKey)&&te(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)}}function bt(e){const{dragMoveHelper:t}=e;let n=0;e.spacePressed=!1;const o=d=>{if(d.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}const f=d.target;if(f.tagName==="ME-EPD")d.ctrlKey||d.metaKey?e.expandNodeAll(f.previousSibling):e.expandNode(f.previousSibling);else if(f.tagName==="ME-TPC"&&e.currentNodes.length>1)e.selectNode(f);else if(!e.editable)return;const y=f.closest(".svg-label");if(y){const E=y.dataset.svgId,x=y.dataset.type,b=document.getElementById(E);if(b){if(x==="arrow"){e.selectArrow(b);return}else if(x==="summary"){e.selectSummary(b);return}}}if(f.closest(".topiclinks")){const E=f.closest("g");if(E){e.selectArrow(E);return}}if(f.closest(".summary")){const E=f.closest("g");if(E){e.selectSummary(E);return}}},s=d=>{if(!e.editable)return;const f=d.target;ye(f)&&e.beginEdit(f);const y=f.closest(".svg-label");if(y){const E=y.dataset.svgId,x=y.dataset.type,b=document.getElementById(E);if(b){if(x==="arrow"){e.editArrowLabel(b);return}else if(x==="summary"){e.editSummary(b);return}}}if(f.closest(".topiclinks")){const E=f.closest("g");if(E){e.editArrowLabel(E);return}}if(f.closest(".summary")){const E=f.closest("g");if(E){e.editSummary(E);return}}},i=d=>{if(d.pointerType==="mouse")return;const f=new Date().getTime(),y=f-n;y<300&&y>0&&s(d),n=f},l=d=>{d.code==="Space"&&(e.spacePressed=!0,e.container.classList.add("space-pressed"))},r=d=>{d.code==="Space"&&(e.spacePressed=!1,e.container.classList.remove("space-pressed"))},c=d=>{t.moved=!1;const f=e.spacePressed&&d.button===0&&d.pointerType==="mouse",y=e.mouseSelectionButton===0?2:0,w=d.button===y&&d.pointerType==="mouse";if(!f&&!w)return;t.x=d.clientX,t.y=d.clientY;const S=d.target;(f||S.className!=="circle"&&S.contentEditable!=="plaintext-only")&&(t.mousedown=!0,S.setPointerCapture(d.pointerId))},a=d=>{if(d.target.contentEditable!=="plaintext-only"||e.spacePressed&&t.mousedown){const f=d.clientX-t.x,y=d.clientY-t.y;t.onMove(f,y)}t.x=d.clientX,t.y=d.clientY},h=d=>{if(!t.mousedown)return;const f=d.target;f.hasPointerCapture&&f.hasPointerCapture(d.pointerId)&&f.releasePointerCapture(d.pointerId),t.clear()},u=()=>{t.mousedown&&t.clear()},g=d=>{if(d.preventDefault(),d.button!==2||!e.editable)return;const f=d.target;ye(f)&&!f.classList.contains("selected")&&e.selectNode(f),setTimeout(()=>{e.dragMoveHelper.moved||e.bus.fire("showContextMenu",d)},200)},v=d=>{d.stopPropagation(),d.preventDefault(),d.ctrlKey||d.metaKey?d.deltaY<0?te(e,"in",e.dragMoveHelper):e.scaleVal-e.scaleSensitivity>0&&te(e,"out",e.dragMoveHelper):d.shiftKey?e.move(-d.deltaY,0):e.move(-d.deltaX,-d.deltaY)},{container:m}=e;return ve([{dom:m,evt:"pointerdown",func:c},{dom:m,evt:"pointermove",func:a},{dom:m,evt:"pointerup",func:h},{dom:m,evt:"pointerup",func:i},{dom:m,evt:"click",func:o},{dom:m,evt:"dblclick",func:s},{dom:m,evt:"contextmenu",func:g},{dom:m,evt:"wheel",func:typeof e.handleWheel=="function"?e.handleWheel:v},{dom:m,evt:"blur",func:u},{dom:m,evt:"keydown",func:l},{dom:m,evt:"keyup",func:r}])}function wt(){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 ne=document,xt=function(){this.nodes.innerHTML="";const e=this.createTopic(this.nodeData);be.call(this,e,this.nodeData),e.draggable=!1;const t=ne.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)})}Et(this,n,t)},Et=function(e,t,n){const o=ne.createElement("me-main");o.className=D.LHS;const s=ne.createElement("me-main");s.className=D.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)},Ct=function(e,t){const n=ne.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},_=document,De=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},be=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=_.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=_.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=_.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=_.createElement("span");n.className="icons",n.innerHTML=t.icons.map(o=>`<span>${pe(o)}</span>`).join(""),e.appendChild(n),e.icons=n}else e.icons&&(e.icons=void 0);if(t.tags&&t.tags.length){const n=_.createElement("div");n.className="tags",t.tags.forEach(o=>{const s=_.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)},St=function(e,t){const n=_.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(e);if(n.appendChild(o),!t&&e.children&&e.children.length>0){const i=we(e.expanded);if(o.appendChild(i),e.expanded!==!1){const l=Ct(this,e.children);n.appendChild(l)}}return{grp:n,top:o,tpc:s}},Nt=function(e){const t=_.createElement("me-parent"),n=this.createTopic(e);return be.call(this,n,e),t.appendChild(n),{p:t,tpc:n}},kt=function(e){const t=_.createElement("me-children");return t.append(...e),t},_t=function(e){const t=_.createElement("me-tpc");return t.nodeObj=e,t.dataset.nodeid="me"+e.id,t.draggable=this.draggable,t};function Pe(e){const t=_.createRange();t.selectNodeContents(e);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}const Tt=function(e){if(!e)return;const t=_.createElement("div"),n=e.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=$(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(){"use strict";const fe={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","--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"}},ue={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","--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 pe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const Z=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=Z(e,t.children[n]);if(o)return o}return null}else return null},O=(e,t)=>{if(e.parent=t,e.children)for(let n=0;n<e.children.length;n++)O(e.children[n],e)},K=(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=>{K(s,t,o)})}else e.children.forEach(o=>{K(o,!1)})};function ge(e){if(e.id=I(),e.children)for(let t=0;t<e.children.length;t++)ge(e.children[t])}function Q(e,t,n,o){const s=o-t,i=e-n;let l=Math.atan(Math.abs(s)/Math.abs(i))/3.14*180;if(isNaN(l))return;i<0&&s>0&&(l=180-l),i<0&&s<0&&(l=180+l),i>0&&s<0&&(l=360-l);const r=12,c=30,a=l+c,h=l-c;return{x1:n+Math.cos(Math.PI*a/180)*r,y1:o-Math.sin(Math.PI*a/180)*r,x2:n+Math.cos(Math.PI*h/180)*r,y2:o-Math.sin(Math.PI*h/180)*r}}function I(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const ft=function(){const e=I();return{topic:this.newTopicName,id:e}};function me(e){return JSON.parse(JSON.stringify(e,(n,o)=>{if(n!=="parent")return o}))}const $=(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}},k=(e,t)=>{for(const n in t)e.setAttribute(n,t[n])},ye=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}),Le=e=>{const t=/translate\(([^,]+),\s*([^)]+)\)/,n=e.match(t);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},ve=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)}}},D={LHS:"lhs",RHS:"rhs"},ut=e=>{const t=e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},pt=e=>{const t=e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");e.selectNode(t[Math.ceil(t.length/2)-1])},gt=e=>{e.selectNode(e.map.querySelector("me-root>me-tpc"))},mt=function(e,t){const n=t.parentElement.parentElement.parentElement.previousSibling;if(n){const o=n.firstChild;e.selectNode(o)}},yt=function(e,t){const n=t.parentElement.nextSibling;if(n&&n.firstChild){const o=n.firstChild.firstChild.firstChild;e.selectNode(o)}},Ae=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?yt(e,n):o.parent?.parent?mt(e,n):gt(e):t===D.LHS?ut(e):pt(e)},Me=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)},te=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 vt(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)K(a,!1);if(r.key==="=")for(const a of c.children)K(a,!0);if(["1","2","3","4","5","6","7","8","9"].includes(r.key))for(const a of c.children)K(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();Me(e,"previous")}},ArrowDown:r=>{r.altKey?e.moveDownNode():Me(e,"next")},ArrowLeft:r=>{if(r.metaKey||r.ctrlKey)return e.initLeft();Ae(e,D.LHS)},ArrowRight:r=>{if(r.metaKey||r.ctrlKey)return e.initRight();Ae(e,D.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)&&te(e,"in")},"-":r=>{(r.metaKey||r.ctrlKey)&&te(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)}}function bt(e){const{dragMoveHelper:t}=e;let n=0;e.spacePressed=!1;const o=d=>{if(d.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}const f=d.target;if(f.tagName==="ME-EPD")d.ctrlKey||d.metaKey?e.expandNodeAll(f.previousSibling):e.expandNode(f.previousSibling);else if(f.tagName==="ME-TPC"&&e.currentNodes.length>1)e.selectNode(f);else if(!e.editable)return;const y=f.closest(".svg-label");if(y){const E=y.dataset.svgId,x=y.dataset.type,b=document.getElementById(E);if(b){if(x==="arrow"){e.selectArrow(b);return}else if(x==="summary"){e.selectSummary(b);return}}}if(f.closest(".topiclinks")){const E=f.closest("g");if(E){e.selectArrow(E);return}}if(f.closest(".summary")){const E=f.closest("g");if(E){e.selectSummary(E);return}}},s=d=>{if(!e.editable)return;const f=d.target;ye(f)&&e.beginEdit(f);const y=f.closest(".svg-label");if(y){const E=y.dataset.svgId,x=y.dataset.type,b=document.getElementById(E);if(b){if(x==="arrow"){e.editArrowLabel(b);return}else if(x==="summary"){e.editSummary(b);return}}}if(f.closest(".topiclinks")){const E=f.closest("g");if(E){e.editArrowLabel(E);return}}if(f.closest(".summary")){const E=f.closest("g");if(E){e.editSummary(E);return}}},i=d=>{if(d.pointerType==="mouse")return;const f=new Date().getTime(),y=f-n;y<300&&y>0&&s(d),n=f},l=d=>{d.code==="Space"&&(e.spacePressed=!0,e.container.classList.add("space-pressed"))},r=d=>{d.code==="Space"&&(e.spacePressed=!1,e.container.classList.remove("space-pressed"))},c=d=>{t.moved=!1;const f=e.spacePressed&&d.button===0&&d.pointerType==="mouse",y=e.mouseSelectionButton===0?2:0,w=d.button===y&&d.pointerType==="mouse"||d.pointerType==="touch";if(!f&&!w)return;t.x=d.clientX,t.y=d.clientY;const S=d.target;(f||S.className!=="circle"&&S.contentEditable!=="plaintext-only")&&(t.mousedown=!0,S.setPointerCapture(d.pointerId))},a=d=>{if(d.target.contentEditable!=="plaintext-only"||e.spacePressed&&t.mousedown){const f=d.clientX-t.x,y=d.clientY-t.y;t.onMove(f,y)}t.x=d.clientX,t.y=d.clientY},h=d=>{if(!t.mousedown)return;const f=d.target;f.hasPointerCapture&&f.hasPointerCapture(d.pointerId)&&f.releasePointerCapture(d.pointerId),t.clear()},u=()=>{t.mousedown&&t.clear()},g=d=>{if(d.preventDefault(),d.button!==2||!e.editable)return;const f=d.target;ye(f)&&!f.classList.contains("selected")&&e.selectNode(f),setTimeout(()=>{e.dragMoveHelper.moved||e.bus.fire("showContextMenu",d)},200)},v=d=>{d.stopPropagation(),d.preventDefault(),d.ctrlKey||d.metaKey?d.deltaY<0?te(e,"in",e.dragMoveHelper):e.scaleVal-e.scaleSensitivity>0&&te(e,"out",e.dragMoveHelper):d.shiftKey?e.move(-d.deltaY,0):e.move(-d.deltaX,-d.deltaY)},{container:m}=e;return ve([{dom:m,evt:"pointerdown",func:c},{dom:m,evt:"pointermove",func:a},{dom:m,evt:"pointerup",func:h},{dom:m,evt:"pointerup",func:i},{dom:m,evt:"click",func:o},{dom:m,evt:"dblclick",func:s},{dom:m,evt:"contextmenu",func:g},{dom:m,evt:"wheel",func:typeof e.handleWheel=="function"?e.handleWheel:v},{dom:m,evt:"blur",func:u},{dom:m,evt:"keydown",func:l},{dom:m,evt:"keyup",func:r}])}function wt(){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 ne=document,xt=function(){this.nodes.innerHTML="";const e=this.createTopic(this.nodeData);be.call(this,e,this.nodeData),e.draggable=!1;const t=ne.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)})}Et(this,n,t)},Et=function(e,t,n){const o=ne.createElement("me-main");o.className=D.LHS;const s=ne.createElement("me-main");s.className=D.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)},Ct=function(e,t){const n=ne.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},_=document,De=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},be=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=_.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=_.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=_.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=_.createElement("span");n.className="icons",n.innerHTML=t.icons.map(o=>`<span>${pe(o)}</span>`).join(""),e.appendChild(n),e.icons=n}else e.icons&&(e.icons=void 0);if(t.tags&&t.tags.length){const n=_.createElement("div");n.className="tags",t.tags.forEach(o=>{const s=_.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)},St=function(e,t){const n=_.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(e);if(n.appendChild(o),!t&&e.children&&e.children.length>0){const i=we(e.expanded);if(o.appendChild(i),e.expanded!==!1){const l=Ct(this,e.children);n.appendChild(l)}}return{grp:n,top:o,tpc:s}},Nt=function(e){const t=_.createElement("me-parent"),n=this.createTopic(e);return be.call(this,n,e),t.appendChild(n),{p:t,tpc:n}},kt=function(e){const t=_.createElement("me-children");return t.append(...e),t},_t=function(e){const t=_.createElement("me-tpc");return t.nodeObj=e,t.dataset.nodeid="me"+e.id,t.draggable=this.draggable,t};function Pe(e){const t=_.createRange();t.selectNodeContents(e);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}const Tt=function(e){if(!e)return;const t=_.createElement("div"),n=e.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=$(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;
@@ -12,5 +12,5 @@ var MindElixir=(function(){"use strict";const fe={name:"Latte",type:"light",pale
12
12
  left:${t.style.left};
13
13
  top:${t.style.top};
14
14
  max-width: 200px;
15
- `,Pe(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,oe(t),"parent"in n?e.bus.fire("operation",{name:"finishEditSummary",obj:n}):e.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},At=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:h,offsetTop:u}=$(this.nodes,a),g=a.offsetWidth,v=a.offsetHeight,m=c.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:u,cL:h,cW:g,cH:v,direction:m,containerHeight:this.nodes.offsetHeight}),d=this.theme.palette,f=a.nodeObj.branchColor||d[r%d.length];if(a.style.borderColor=f,this.lines.appendChild($e(p,f,"3")),e&&e!==c)continue;const y=X("subLines"),w=c.lastChild;w.tagName==="svg"&&w.remove(),c.appendChild(y),He(this,y,f,c,m,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},He=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,h=l.offsetWidth,u=l.offsetHeight;for(let g=0;g<r.length;g++){const v=r[g],m=v.firstChild,p=m.offsetTop,d=m.offsetLeft,f=m.offsetWidth,y=m.offsetHeight,w=m.firstChild.nodeObj.branchColor||n,S=e.generateSubBranch({pT:c,pL:a,pW:h,pH:u,cT:p,cL:d,cW:f,cH:y,direction:s,isFirst:i});t.appendChild($e(S,w,"2"));const E=m.children[1];if(E){if(!E.expanded)continue}else continue;He(e,t,w,v,s)}},Be={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},Re={cn:Be,zh_CN:Be,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:"요약"}};function Mt(e,t){t=t===!0?{focus:!0,link:!0}:t;const n=x=>{const b=document.createElement("div");return b.innerText=x,b.className="tips",b},o=(x,b,C)=>{const N=document.createElement("li");return N.id=x,N.innerHTML=`<span>${pe(b)}</span><span ${C?'class="key"':""}>${pe(C)}</span>`,N},s=Re[e.locale]?e.locale:"en",i=Re[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"),h=o("cm-fucus",i.focus,""),u=o("cm-unfucus",i.cancelFocus,""),g=o("cm-up",i.moveUp,"PgUp"),v=o("cm-down",i.moveDown,"Pgdn"),m=o("cm-link",i.link,""),p=o("cm-link-bidirectional",i.linkBidirectional,""),d=o("cm-summary",i.summary,""),f=document.createElement("ul");if(f.className="menu-list",f.appendChild(l),f.appendChild(r),f.appendChild(c),f.appendChild(a),t.focus&&(f.appendChild(h),f.appendChild(u)),f.appendChild(g),f.appendChild(v),f.appendChild(d),t.link&&(f.appendChild(m),f.appendChild(p)),t&&t.extend)for(let x=0;x<t.extend.length;x++){const b=t.extend[x],C=o(b.name,b.name,b.key||"");f.appendChild(C),C.onclick=N=>{b.onclick(N)}}const y=document.createElement("div");y.className="context-menu",y.appendChild(f),y.hidden=!0,e.container.append(y);let w=!0;const S=x=>{const b=x.target;if(ye(b)){b.parentElement.tagName==="ME-ROOT"?w=!0:w=!1,w?(h.className="disabled",g.className="disabled",v.className="disabled",r.className="disabled",c.className="disabled",a.className="disabled"):(h.className="",g.className="",v.className="",r.className="",c.className="",a.className=""),y.hidden=!1,f.style.top="",f.style.bottom="",f.style.left="",f.style.right="";const C=f.getBoundingClientRect(),N=f.offsetHeight,M=f.offsetWidth,B=x.clientY-C.top,R=x.clientX-C.left;N+B>window.innerHeight?(f.style.top="",f.style.bottom="0px"):(f.style.bottom="",f.style.top=B+15+"px"),M+R>window.innerWidth?(f.style.left="",f.style.right="0px"):(f.style.right="",f.style.left=R+10+"px")}};e.bus.addListener("showContextMenu",S),y.onclick=x=>{x.target===y&&(y.hidden=!0)},l.onclick=()=>{e.addChild(),y.hidden=!0},r.onclick=()=>{e.insertParent(),y.hidden=!0},c.onclick=()=>{w||(e.insertSibling("after"),y.hidden=!0)},a.onclick=()=>{w||(e.removeNodes(e.currentNodes||[]),y.hidden=!0)},h.onclick=()=>{w||(e.focusNode(e.currentNode),y.hidden=!0)},u.onclick=()=>{e.cancelFocus(),y.hidden=!0},g.onclick=()=>{w||(e.moveUpNode(),y.hidden=!0)},v.onclick=()=>{w||(e.moveDownNode(),y.hidden=!0)};const E=x=>{y.hidden=!0;const b=e.currentNode,C=n(i.clickTips);e.container.appendChild(C),e.map.addEventListener("click",N=>{N.preventDefault(),C.remove();const M=N.target;(M.parentElement.tagName==="ME-PARENT"||M.parentElement.tagName==="ME-ROOT")&&e.createArrow(b,M,x)},{once:!0})};return m.onclick=()=>E(),p.onclick=()=>E({bidirectional:!0}),d.onclick=()=>{y.hidden=!0,e.createSummary(),e.unselectNodes(e.currentNodes)},()=>{l.onclick=null,r.onclick=null,c.onclick=null,a.onclick=null,h.onclick=null,u.onclick=null,g.onclick=null,v.onclick=null,m.onclick=null,d.onclick=null,y.onclick=null,e.container.oncontextmenu=null}}const Ee=document,Dt=function(e,t){if(!t)return Ce(e),e;let n=e.querySelector(".insert-preview");const o=`insert-preview ${t} show`;return n||(n=Ee.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()},Ie=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},Pt=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,clearInterval(this.interval)}}function Ot(e){let t=null,n=null;const o=Pt(e),s=new $t(e),i=a=>{if(e.spacePressed){a.preventDefault();return}e.selection.cancel();const h=a.target;if(h?.tagName!=="ME-TPC"){a.preventDefault();return}let u=e.currentNodes;u?.includes(h)||(e.selectNode(h),u=e.currentNodes),e.dragged=u,u.length>1?o.innerHTML=u.length+"":o.innerHTML=h.innerHTML;for(const g of u)g.parentElement.parentElement.style.opacity="0.5";a.dataTransfer.setDragImage(o,0,0),a.dataTransfer.dropEffect="move",e.dragMoveHelper.clear()},l=a=>{const{dragged:h}=e;if(!h)return;s.stop();for(const g of h)g.parentElement.parentElement.style.opacity="1";const u=a.target;u.style.opacity="",n&&(Ce(n),t==="before"?e.moveNodeBefore(h,n):t==="after"?e.moveNodeAfter(h,n):t==="in"&&e.moveNodeIn(h,n),e.dragged=null,o.innerHTML="")},r=a=>{a.preventDefault();const h=12*e.scaleVal,{dragged:u}=e;if(!u)return;const g=e.container.getBoundingClientRect();a.clientX<g.x+50?s.move(1,0):a.clientX>g.x+g.width-50?s.move(-1,0):a.clientY<g.y+50?s.move(0,1):a.clientY>g.y+g.height-50?s.move(0,-1):s.stop(),Ce(n);const v=Ee.elementFromPoint(a.clientX,a.clientY-h);if(Ie(v,u)){n=v;const m=v.getBoundingClientRect(),p=m.y;a.clientY>p+m.height?t="after":t="in"}else{const m=Ee.elementFromPoint(a.clientX,a.clientY+h),p=m.getBoundingClientRect();if(Ie(m,u)){n=m;const d=p.y;a.clientY<d?t="before":t="in"}else t=n=null}n&&Dt(n,t)};return ve([{dom:e.map,evt:"dragstart",func:i},{dom:e.map,evt:"dragend",func:l},{dom:e.map,evt:"dragover",func:r}])}const jt=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 Ht(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(),h={prev:o,operation:c.name,currentSelected:s.map(u=>u.id),currentTarget:jt(c),next:a};t.push(h),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 Bt={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>'},F=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=Bt[t],n};function Rt(e){const t=document.createElement("div"),n=F("fullscreen","full"),o=F("toCenter","living"),s=F("zoomout","zoomout"),i=F("zoomin","zoomin"),l=document.createElement("span");return l.innerText="100%",t.appendChild(n),t.appendChild(o),t.appendChild(s),t.appendChild(i),t.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===e.el?document.exitFullscreen():e.el.requestFullscreen()},o.onclick=()=>{e.toCenter()},s.onclick=()=>{e.scale(e.scaleVal-e.scaleSensitivity)},i.onclick=()=>{e.scale(e.scaleVal+e.scaleSensitivity)},t}function It(e){const t=document.createElement("div"),n=F("tbltl","left"),o=F("tbltr","right"),s=F("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 Ft(e){e.container.append(Rt(e)),e.container.append(It(e))}class Wt{_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 Fe=(e,t="px")=>typeof e=="number"?e+t:e,j=({style:e},t,n)=>{if(typeof t=="object")for(const[o,s]of Object.entries(t))s!==void 0&&(e[o]=Fe(s));else n!==void 0&&(e[t]=Fe(n))},We=(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)}},Kt=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}}},Ke=(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}},Gt=()=>matchMedia("(hover: none), (pointer: coarse)").matches,Yt=()=>"safari"in window,Se=e=>Array.isArray(e)?e:[e],Ge=e=>(t,n,o,s={})=>{(t instanceof HTMLCollection||t instanceof NodeList)&&(t=Array.from(t)),n=Se(n),t=Se(t);for(const i of t)if(i)for(const l of n)i[e](l,o,{capture:!1,...s})},H=Ge("addEventListener"),L=Ge("removeEventListener"),se=e=>{const{clientX:t,clientY:n,target:o}=e.touches?.[0]??e;return{x:t,y:n,target:o}},Y=(e,t=document)=>Se(e).map(n=>typeof n=="string"?Array.from(t.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),zt=(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:W,max:Ye,min:ze,ceil:qe}=Math,Ve=(e=[])=>({stored:e,selected:[],touched:[],changed:{added:[],removed:[]}});class qt extends Wt{static version="mind-elixir-fork";_options;_selection=Ve();_area;_clippingElement;_targetElement;_targetBoundary;_targetBoundaryScrolled=!0;_targetRect;_selectables=[];_latestElement;_areaLocation={y1:0,x2:0,y2:0,x1:0};_areaRect=We();_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),j(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),j(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=Kt(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?H:L;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}=se(t),{document:l,startAreas:r,boundaries:c,features:a,behaviour:h}=this._options,u=i.getBoundingClientRect();if(t instanceof MouseEvent&&!zt(t,h.triggers))return;const g=Y(r,l),v=Y(c,l);this._targetElement=v.find(f=>Ke(f.getBoundingClientRect(),u));const m=t.composedPath(),p=g.find(f=>m.includes(f));if(this._targetBoundary=v.find(f=>m.includes(f)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",t)===!1)return;this._areaLocation={x1:o,y1:s,x2:0,y2:0};const d=l.scrollingElement??l.body;this._scrollDelta={x:d.scrollLeft,y:d.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),H(l,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),H(l,["mouseup","touchcancel","touchend"],this._onTapStop),H(l,"scroll",this._onScroll),a.deselectOnBlur&&(this._targetBoundaryScrolled=!1,H(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(t){const{singleTap:{intersect:n},range:o}=this._options.features,s=se(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:h,left:u,top:g,bottom:v}=a.getBoundingClientRect();return r<h&&r>u&&c<v&&c>g})}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],h=[...this._selectables.filter(u=>u.compareDocumentPosition(c)&4&&u.compareDocumentPosition(a)&2),c,a];this.select(h),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}=se(t);if(typeof s=="number"&&W(r+c-(i+l))>=s||typeof s=="object"&&W(r-i)>=s.x||W(c-l)>=s.y){if(L(o,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",t)===!1){L(o,["mouseup","touchcancel","touchend"],this._onTapStop);return}H(o,["mousemove","touchmove"],this._onTapMove,{passive:!1}),j(this._area,"display","block"),Y(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&&(H(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),H(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?(j(t,{top:s.top,left:s.left,width:s.width,height:s.height}),j(o,{marginTop:-s.top,marginLeft:-s.left})):(j(t,{top:0,left:0,width:"100%",height:"100%"}),j(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}=se(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 h=this._options.mindElixirInstance;if(h&&h.move){const u=n.x?qe(n.x/l):0,g=n.y?qe(n.y/l):0;(u||g)&&(h.move(-u,-g),o.x1-=u,o.y1-=g)}i.next(t),requestAnimationFrame(a)};requestAnimationFrame(a)}else i.next(t);this._handleMoveEvent(t)}_handleMoveEvent(t){const{features:n}=this._options;(n.touch&&Gt()||this._scrollAvailable&&Yt())&&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,L(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:h}}}=s;c<i.left+h.x?(t.x=-W(i.left-c+h.x),c=c<i.left?i.left:c):c>i.right-h.x?(t.x=W(i.left+i.width-c-h.x),c=c>i.right?i.right:c):t.x=0,a<i.top+h.y?(t.y=-W(i.top-a+h.y),a=a<i.top?i.top:a):a>i.bottom-h.y?(t.y=W(i.top+i.height-a-h.y),a=a>i.bottom?i.bottom:a):t.y=0;const u=ze(l,c),g=ze(r,a),v=Ye(l,c),m=Ye(r,a);this._areaRect=We(u,g,v-u,m-g)}_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;L(this._targetElement,"scroll",this._onStartAreaScroll),L(o,["mousemove","touchmove"],this._delayedTapMove),L(o,["touchmove","mousemove"],this._onTapMove),L(o,["mouseup","touchcancel","touchend"],this._onTapStop),L(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,L(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),L(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),this._frame?.cancel(),j(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,h=a==="invert",u=[],g=[],v=[];for(let p=0;p<t.length;p++){const d=t[p];if(Ke(s,d.getBoundingClientRect(),c)){if(l.includes(d))i.includes(d)&&!r.includes(d)&&r.push(d);else if(h&&i.includes(d)){v.push(d);continue}else g.push(d);u.push(d)}}h&&g.push(...i.filter(p=>!l.includes(p)));const m=a==="keep";for(let p=0;p<l.length;p++){const d=l[p];!u.includes(d)&&!(m&&i.includes(d))&&v.push(d)}o.selected=u,o.changed={added:g,removed:v},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=Y(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=Ve(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=Y(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=Y(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 Vt(e){const t=e.mouseSelectionButton===2?[2]:[0],n=new qt({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 Xt=function(e,t=!0){this.theme=e;const o={...(e.type==="dark"?ue:fe).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()},z=e=>{const t=e.parent?.children,n=t?.indexOf(e)??0;return{siblings:t,index:n}};function Ut(e){const{siblings:t,index:n}=z(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 Jt(e){const{siblings:t,index:n}=z(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 Xe(e){const{siblings:t,index:n}=z(e);return t===void 0?0:(t.splice(n,1),t.length)}function Zt(e,t,n){const{siblings:o,index:s}=z(n);o!==void 0&&(t==="before"?o.splice(s,0,e):o.splice(s+1,0,e))}function Qt(e,t){const{siblings:n,index:o}=z(e);n!==void 0&&(n[o]=t,t.children=[e])}function Ue(e,t,n){if(Xe(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}=z(n);if(o===void 0)return;e==="before"?o.splice(s,0,t):o.splice(s+1,0,t)}}const en=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)}},Je=function(e,t,n){const o=n.children[0].children[0],s=t.parentElement;if(s.tagName==="ME-PARENT"){if(U(o),s.children[1])s.nextSibling.appendChild(n);else{const i=e.createChildren([n]);s.appendChild(we(!0)),s.insertAdjacentElement("afterend",i)}e.linkDiv(n.offsetParent)}else s.tagName==="ME-ROOT"&&(en(e,o.nodeObj)===0?e.container.querySelector(".lhs")?.appendChild(n):e.container.querySelector(".rhs")?.appendChild(n),e.linkDiv())},tn=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()},Ze={before:"beforebegin",after:"afterend"},U=function(e){const n=e.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()},nn=function(e,t){const n=e.nodeObj,o=me(n);o.style&&t.style&&(t.style=Object.assign(o.style,t.style));const s=Object.assign(n,t);be.call(this,e,s),this.linkDiv(),this.bus.fire("operation",{name:"reshapeNode",obj:s,origin:o})},Ne=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],O(e.nodeData);const{grp:i,top:l}=e.createWrapper(s);return Je(e,t,i),{newTop:l,newNodeObj:s}},on=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,h=this.map.querySelector(".rhs")?.childElementCount||0;if(!a||!h){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===D.LHS?0:1;i.direction=a}Zt(i,e,s),O(this.nodeData);const l=o.parentElement,{grp:r,top:c}=this.createWrapper(i);l.parentElement.insertAdjacentElement(Ze[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)},sn=function(e,t){const n=e||this.currentNode;if(!n)return;U(n);const o=n.nodeObj;if(!o.parent)return;const s=t||this.generateNewObj();Qt(o,s),O(this.nodeData);const i=n.parentElement.parentElement,{grp:l,top:r}=this.createWrapper(s,!0);r.appendChild(we(!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})},rn=function(e,t){const n=e||this.currentNode;if(!n)return;const o=Ne(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)},ln=function(e,t){const n=me(e.nodeObj);ge(n);const o=Ne(this,t,n);if(!o)return;const{newNodeObj:s}=o;this.selectNode(this.findEle(s.id)),this.bus.fire("operation",{name:"copyNode",obj:s})},cn=function(e,t){e=ee(e);const n=[];for(let o=0;o<e.length;o++){const s=e[o],i=me(s.nodeObj);ge(i);const l=Ne(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})},an=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;Ut(n);const o=t.parentNode.parentNode;o.parentNode.insertBefore(o,o.previousSibling),this.linkDiv(),this.bus.fire("operation",{name:"moveUpNode",obj:n})},dn=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;Jt(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})},hn=function(e){if(e.length===0)return;e=ee(e);for(const n of e){const o=n.nodeObj,s=Xe(o);tn(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)})},fn=function(e,t){e=ee(e);const n=t.nodeObj;n.expanded===!1&&(this.expandNode(t,!0),t=this.findEle(n.id));for(const o of e){const s=o.nodeObj;Ue("in",s,n),O(this.nodeData);const i=o.parentElement;Je(this,t,i.parentElement)}this.linkDiv(),this.bus.fire("operation",{name:"moveNodeIn",objs:e.map(o=>o.nodeObj),toObj:n})},Qe=(e,t,n,o)=>{e=ee(e),t==="after"&&(e=e.reverse());const s=n.nodeObj,i=[];for(const l of e){const r=l.nodeObj;Ue(t,r,s),O(o.nodeData),U(l);const c=l.parentElement.parentNode;i.includes(c.parentElement)||i.push(c.parentElement),n.parentElement.parentNode.insertAdjacentElement(Ze[t],c)}for(const l of i)l.childElementCount===0&&l.tagName!=="ME-MAIN"&&(l.previousSibling.children[1].remove(),l.remove());o.linkDiv(),o.bus.fire("operation",{name:t==="before"?"moveNodeBefore":"moveNodeAfter",objs:e.map(l=>l.nodeObj),toObj:s})},et=Object.freeze(Object.defineProperty({__proto__:null,addChild:rn,beginEdit:function(e){const t=e||this.currentNode;t&&(t.nodeObj.dangerouslySetInnerHTML||this.editTopic(t))},copyNode:ln,copyNodes:cn,insertParent:sn,insertSibling:on,moveDownNode:dn,moveNodeAfter:function(e,t){Qe(e,"after",t,this)},moveNodeBefore:function(e,t){Qe(e,"before",t,this)},moveNodeIn:fn,moveUpNode:an,removeNodes:hn,reshapeNode:nn,rmSubline:U,setNodeTopic:function(e,t){e.text.textContent=t,e.nodeObj.topic=t,this.linkDiv()}},Symbol.toStringTag,{value:"Module"}));function un(e){return{nodeData:e.isFocusMode?e.nodeDataBackup:e.nodeData,arrows:e.arrows,summaries:e.summaries,direction:e.direction,theme:e.theme}}const pn=function(e){const t=this.container,n=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(n.top>o.bottom||n.bottom<o.top||n.left>o.right||n.right<o.left){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,h=l-c;this.move(-a,-h,!0)}},gn=function(e,t,n){this.clearSelection(),this.scrollIntoView(e),this.selection.select(e),t&&this.bus.fire("selectNewNode",e.nodeObj)},mn=function(e){this.selection.select(e)},yn=function(e){this.selection.deselect(e)},vn=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},bn=function(){const e=un(this);return JSON.stringify(e,(t,n)=>{if(!(t==="parent"&&typeof n!="string"))return n})},wn=function(){return JSON.parse(this.getDataString())},xn=function(){this.editable=!0},En=function(){this.editable=!1},Cn=function(e,t={x:0,y:0}){if(e<this.scaleMin||e>this.scaleMax)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}=tt(this),r=this.map.style.transform,{x:c,y:a}=Le(r),h=c-i,u=a-l,g=this.scaleVal,v=(-o+h)*(1-e/g),m=(-s+u)*(1-e/g);this.map.style.transform=`translate(${c-v}px, ${a-m}px) scale(${e})`,this.scaleVal=e,this.bus.fire("scale",e)},Sn=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,this.map.style.transform="scale("+n+")",this.bus.fire("scale",n)},Nn=function(e,t,n=!1){const{map:o,scaleVal:s,bus:i}=this,l=o.style.transform;let{x:r,y:c}=Le(l);r+=e,c+=t,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate(${r}px, ${c}px) scale(${s})`,i.fire("move",{dx:e,dy:t})},tt=e=>{const{container:t,map:n,nodes:o}=e,s=n.querySelector("me-root"),i=s.offsetTop,l=s.offsetLeft,r=s.offsetWidth,c=s.offsetHeight;let a,h;return e.alignment==="root"?(a=t.offsetWidth/2-l-r/2,h=t.offsetHeight/2-i-c/2,n.style.transformOrigin=`${l+r/2}px 50%`):(a=(t.offsetWidth-o.offsetWidth)/2,h=(t.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:a,dy:h}},kn=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:vn,disableEdit:En,enableEdit:xn,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":"",U(e),n.expanded){const u=this.createChildren(n.children.map(g=>this.createWrapper(g).grp));i.parentNode.appendChild(u)}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,h=s.y-c.y;this.move(a,h),this.bus.fire("expandNode",n)},expandNodeAll:function(e,t){const n=e.nodeObj,o=e.getBoundingClientRect(),s={x:o.left,y:o.top};K(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:wn,getDataString:bn,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:Nn,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)),O(this.nodeData),this.layout(),this.linkDiv()},scale:Cn,scaleFit:Sn,scrollIntoView:pn,selectNode:gn,selectNodes:mn,setLocale:function(e){this.locale=e,this.refresh()},toCenter:function(){const{map:e,container:t}=this,{dx:n,dy:o}=tt(this);t.scrollTop=0,t.scrollLeft=0,e.style.transform=`translate(${n}px, ${o}px) scale(${this.scaleVal})`},unselectNodes:yn},Symbol.toStringTag,{value:"Module"})),nt={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=ve([{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}}}},_n="#4dc4ff";function ot(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 Tn(e,t,n){e&&(e.dataset.x=t.toString(),e.dataset.y=n.toString(),oe(e))}function ie(e,t,n,o,s){k(e,{x1:t+"",y1:n+"",x2:o+"",y2:s+""})}function st(e,t,n,o,s,i,l,r,c,a){const h=`M ${t} ${n} C ${o} ${s} ${i} ${l} ${r} ${c}`;if(e.line.setAttribute("d",h),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 u=e.querySelectorAll('path[stroke="transparent"]');u.length>0&&u[0].setAttribute("d",h);const g=Q(i,l,r,c);if(g){const p=`M ${g.x1} ${g.y1} L ${r} ${c} L ${g.x2} ${g.y2}`;if(e.arrow1.setAttribute("d",p),u.length>1&&u[1].setAttribute("d",p),a.style){const d=a.style;d.stroke&&e.arrow1.setAttribute("stroke",d.stroke),d.strokeWidth&&e.arrow1.setAttribute("stroke-width",String(d.strokeWidth)),d.strokeLinecap&&e.arrow1.setAttribute("stroke-linecap",d.strokeLinecap),d.opacity!==void 0&&e.arrow1.setAttribute("opacity",String(d.opacity))}}if(a.bidirectional){const p=Q(o,s,t,n);if(p){const d=`M ${p.x1} ${p.y1} L ${t} ${n} L ${p.x2} ${p.y2}`;if(e.arrow2.setAttribute("d",d),u.length>2&&u[2].setAttribute("d",d),a.style){const f=a.style;f.stroke&&e.arrow2.setAttribute("stroke",f.stroke),f.strokeWidth&&e.arrow2.setAttribute("stroke-width",String(f.strokeWidth)),f.strokeLinecap&&e.arrow2.setAttribute("stroke-linecap",f.strokeLinecap),f.opacity!==void 0&&e.arrow2.setAttribute("opacity",String(f.opacity))}}}const{x:v,y:m}=ot(t,n,o,s,i,l,r,c);if(e.labelEl&&Tn(e.labelEl,v,m),a.style?.labelColor){const p=e.labelEl;p&&(p.style.color=a.style.labelColor)}jn(e)}function re(e,t,n){const{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=t.offsetWidth,l=t.offsetHeight,r=o+i/2,c=s+l/2,a=r+n.x,h=c+n.y;return{w:i,h:l,cx:r,cy:c,ctrlX:a,ctrlY:h}}function q(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 ke=function(e,t,n,o,s){if(!t||!n)return;const i=re(e,t,o.delta1),l=re(e,n,o.delta2),{x:r,y:c}=q(i),{ctrlX:a,ctrlY:h}=i,{ctrlX:u,ctrlY:g}=l,{x:v,y:m}=q(l),p=Q(u,g,v,m);if(!p)return;const d=`M ${p.x1} ${p.y1} L ${v} ${m} L ${p.x2} ${p.y2}`;let f="";if(o.bidirectional){const N=Q(a,h,r,c);if(!N)return;f=`M ${N.x1} ${N.y1} L ${r} ${c} L ${N.x2} ${N.y2}`}const y=Lt(`M ${r} ${c} C ${a} ${h} ${u} ${g} ${v} ${m}`,d,f,o.style),{x:w,y:S}=ot(r,c,a,h,u,g,v,m),E=o.style?.labelColor||"rgb(235, 95, 82)",x="arrow-"+o.id;y.id=x;const b=e.markdown?e.markdown(o.label,o):o.label,C=xe(b,w,S,{anchor:"middle",color:E,dataType:"arrow",svgId:x});y.labelEl=C,y.arrowObj=o,y.dataset.linkid=o.id,e.labelContainer.appendChild(C),e.linkSvgGroup.appendChild(y),oe(C),s||(e.arrows.push(o),e.currentArrow=y,it(e,o,i,l))},Ln=function(e,t,n={}){const o={id:I(),label:"Custom Link",from:e.nodeObj.id,to:t.nodeObj.id,delta1:{x:e.offsetWidth/2+100,y:0},delta2:{x:t.offsetWidth/2+100,y:0},...n};ke(this,e,t,o),this.bus.fire("operation",{name:"createArrow",obj:o})},An=function(e){le(this);const t={...e,id:I()};ke(this,this.findEle(t.from),this.findEle(t.to),t),this.bus.fire("operation",{name:"createArrow",obj:t})},Mn=function(e){let t;if(e?t=e:t=this.currentArrow,!t)return;le(this);const n=t.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),t.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},Dn=function(e){this.currentArrow=e;const t=e.arrowObj,n=this.findEle(t.from),o=this.findEle(t.to),s=re(this,n,t.delta1),i=re(this,o,t.delta2);it(this,t,s,i)},Pn=function(){le(this),this.currentArrow=null},_e=function(e,t){const n=document.createElementNS(P,"path");return k(n,{d:e,stroke:t,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},$n=function(e,t){const n=document.createElementNS(P,"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)},On=function(e){const t=e.querySelector(".arrow-highlight");t&&t.remove()},jn=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"))},le=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&&On(e.currentArrow)},it=function(e,t,n,o){const{linkController:s,P2:i,P3:l,line1:r,line2:c,nodes:a,map:h,currentArrow:u,bus:g}=e;if(!u)return;s.style.display="initial",i.style.display="initial",l.style.display="initial",a.appendChild(s),a.appendChild(i),a.appendChild(l),$n(u,_n);let{x:v,y:m}=q(n),{ctrlX:p,ctrlY:d}=n,{ctrlX:f,ctrlY:y}=o,{x:w,y:S}=q(o);i.style.cssText=`top:${d}px;left:${p}px;`,l.style.cssText=`top:${y}px;left:${f}px;`,ie(r,v,m,p,d),ie(c,f,y,w,S),e.helper1=nt.create(i),e.helper2=nt.create(l),e.helper1.init(h,(E,x)=>{p=p+E/e.scaleVal,d=d+x/e.scaleVal;const b=q({...n,ctrlX:p,ctrlY:d});v=b.x,m=b.y,i.style.top=d+"px",i.style.left=p+"px",st(u,v,m,p,d,f,y,w,S,t),ie(r,v,m,p,d),t.delta1.x=p-n.cx,t.delta1.y=d-n.cy,g.fire("updateArrowDelta",t)}),e.helper2.init(h,(E,x)=>{f=f+E/e.scaleVal,y=y+x/e.scaleVal;const b=q({...o,ctrlX:f,ctrlY:y});w=b.x,S=b.y,l.style.top=y+"px",l.style.left=f+"px",st(u,v,m,p,d,f,y,w,S,t),ie(c,f,y,w,S),t.delta2.x=f-o.cx,t.delta2.y=y-o.cy,g.fire("updateArrowDelta",t)})};function Hn(){this.linkSvgGroup.innerHTML="";for(let e=0;e<this.arrows.length;e++){const t=this.arrows[e];try{ke(this,this.findEle(t.from),this.findEle(t.to),t,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function Bn(e){le(this),e&&e.labelEl&&je(this,e.labelEl,e.arrowObj)}function Rn(){this.arrows=this.arrows.filter(e=>Z(e.from,this.nodeData)&&Z(e.to,this.nodeData))}const In=Object.freeze(Object.defineProperty({__proto__:null,createArrow:Ln,createArrowFrom:An,editArrowLabel:Bn,removeArrow:Mn,renderArrow:Hn,selectArrow:Dn,tidyArrow:Rn,unselectArrow:Pn},Symbol.toStringTag,{value:"Module"})),Fn=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 h=a.children.findIndex(u=>c===u);return{parent:a.id,start:h,end:h}}let t=0;const n=e.map(c=>{let a=c.nodeObj;const h=[];for(;a.parent;){const u=a.parent,v=u.children?.indexOf(a);a=u,h.unshift({node:a,index:v})}return h.length>t&&(t=h.length),h});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}},Wn=function(e){const t=document.createElementNS(P,"g");return t.setAttribute("id",e),t},rt=function(e,t){const n=document.createElementNS(P,"path");return k(n,{d:e,stroke:t||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Kn=e=>e.parentElement.parentElement,Gn=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},Te=function(e,t){const{id:n,label:o,parent:s,start:i,end:l,style:r}=t,{nodes:c,theme:a,summarySvg:h}=e,g=e.findEle(s).nodeObj,v=Gn(e,t);let m=1/0,p=0,d=0,f=0;for(let J=i;J<=l;J++){const at=g.children?.[J];if(!at)return e.removeSummary(n),null;const de=Kn(e.findEle(at.id)),{offsetLeft:he,offsetTop:dt}=$(c,de),ht=i===l?10:20;J===i&&(d=dt+ht),J===l&&(f=dt+de.offsetHeight-ht),he<m&&(m=he),de.offsetWidth+he>p&&(p=de.offsetWidth+he)}let y,w;const S=g.parent?10:0,E=d+S,x=f+S,b=(E+x)/2,C=r?.stroke||a.cssVar["--color"],N=r?.labelColor||a.cssVar["--color"],M="s-"+n,B=e.markdown?e.markdown(o,t):o;v===D.LHS?(y=rt(`M ${m+10} ${E} c -5 0 -10 5 -10 10 L ${m} ${x-10} c 0 5 5 10 10 10 M ${m} ${b} h -10`,C),w=xe(B,m-20,b,{anchor:"end",color:N,dataType:"summary",svgId:M})):(y=rt(`M ${p-10} ${E} c 5 0 10 5 10 10 L ${p} ${x-10} c 0 5 -5 10 -10 10 M ${p} ${b} h 10`,C),w=xe(B,p+20,b,{anchor:"start",color:N,dataType:"summary",svgId:M}));const R=Wn(M);return R.appendChild(y),e.labelContainer.appendChild(w),oe(w),R.summaryObj=t,R.labelEl=w,h.appendChild(R),R},Yn=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}=Fn(t),r={id:I(),parent:s,start:i,end:l,label:"summary",style:e.style},c=Te(this,r);n.push(r),this.editSummary(c),o.fire("operation",{name:"createSummary",obj:r})},createSummaryFrom:function(e){const t=I(),n={...e,id:t};Te(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(e){e&&e.labelEl&&je(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{Te(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"})),T="http://www.w3.org/2000/svg";function zn(e,t){const n=document.createElementNS(T,"svg");return k(n,{version:"1.1",xmlns:T,height:e,width:t}),n}function qn(e,t){return(parseInt(e)-parseInt(t))/2}function Vn(e,t,n,o){const s=document.createElementNS(T,"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(T,"text");k(a,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+qn(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 Xn(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(T,"foreignObject");k(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const l=document.createElement("div");return k(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 Un(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=document.createElementNS(T,"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 ce(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=$(e.nodes,t),l=document.createElementNS(T,"rect");k(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(T,"g");r.appendChild(l);let c;return n?c=Xn(t,o,s,i):c=Vn(t,o,s,i),r.appendChild(c),r}function Jn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=document.createElementNS(T,"a"),l=document.createElementNS(T,"text");return k(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 Zn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=document.createElementNS(T,"image");return k(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const ae=100,Qn='<?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">',eo=(e,t=!1)=>{const n=e.nodes,o=n.offsetHeight+ae*2,s=n.offsetWidth+ae*2,i=zn(o+"px",s+"px"),l=document.createElementNS(T,"svg"),r=document.createElementNS(T,"rect");k(r,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(r),n.querySelectorAll(".subLines").forEach(u=>{const g=u.cloneNode(!0),{offsetLeft:v,offsetTop:m}=$(n,u.parentElement);g.setAttribute("x",`${v}`),g.setAttribute("y",`${m}`),l.appendChild(g)});const c=n.querySelector(".lines")?.cloneNode(!0);c&&l.appendChild(c);const a=n.querySelector(".topiclinks")?.cloneNode(!0);a&&l.appendChild(a);const h=n.querySelector(".summary")?.cloneNode(!0);return h&&l.appendChild(h),n.querySelectorAll("me-tpc").forEach(u=>{u.nodeObj.dangerouslySetInnerHTML?l.appendChild(ce(e,u,!t)):(l.appendChild(Un(e,u)),l.appendChild(ce(e,u.text,!t)))}),n.querySelectorAll(".tags > span").forEach(u=>{l.appendChild(ce(e,u))}),n.querySelectorAll(".icons > span").forEach(u=>{l.appendChild(ce(e,u))}),n.querySelectorAll(".hyper-link").forEach(u=>{l.appendChild(Jn(e,u))}),n.querySelectorAll("img").forEach(u=>{l.appendChild(Zn(e,u))}),k(l,{x:ae+"",y:ae+"",overflow:"visible"}),i.appendChild(l),i},to=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),Qn+e.outerHTML);function no(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 oo=Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await no(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=eo(this,e),o=to(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"}));function so(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const lt=Object.keys(et),ct={};for(let e=0;e<lt.length;e++){const t=lt[e];ct[t]=so(et[t],t)}const io={getObjById:Z,generateNewObj:ft,layout:xt,linkDiv:At,editTopic:Tt,createWrapper:St,createParent:Nt,createChildren:kt,createTopic:_t,findEle:De,changeTheme:Xt,...kn,...ct,...In,...Yn,...oo,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,O(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&Ft(this),this.keypress&&vt(this,this.keypress),this.editable&&Vt(this),this.contextMenu&&this.disposable.push(Mt(this,this.contextMenu)),this.draggable&&this.disposable.push(Ot(this)),this.allowUndo&&this.disposable.push(Ht(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 ro({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,containerHeight:a}){let h=t+n/2;const u=e+o/2;let g;c===D.LHS?g=i+l:g=i;const v=s+r/2,p=(1-Math.abs(v-u)/a)*.25*(n/2);return c===D.LHS?h=h-n/10-p:h=h+n/10+p,`M ${h} ${u} Q ${h} ${v} ${g} ${v}`}function lo({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,isFirst:a}){const h=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let u=0,g=0;a?u=e+o/2:u=e+o;const v=s+r;let m=0,p=0,d=0;const f=Math.abs(u-v)/300*h;return c===D.LHS?(d=t,m=d+h,p=d-h,g=i+h,`M ${m} ${u} C ${d} ${u} ${d+f} ${v} ${p} ${v} H ${g}`):(d=t+n,m=d-h,p=d+h,g=i+l-h,`M ${m} ${u} C ${d} ${u} ${d-f} ${v} ${p} ${v} H ${g}`)}const co="5.3.4";function ao(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 V=document;function A({el:e,direction:t,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:l,keypress:r,mouseSelectionButton:c,selectionContainer:a,before:h,newTopicName:u,allowUndo:g,generateMainBranch:v,generateSubBranch:m,overflowHidden:p,theme:d,alignment:f,scaleSensitivity:y,scaleMax:w,scaleMin:S,handleWheel:E,markdown:x,imageProxy:b}){let C=null;const N=Object.prototype.toString.call(e);if(N==="[object HTMLDivElement]"?C=e:N==="[object String]"&&(C=document.querySelector(e)),!C)throw new Error("MindElixir: el is not a valid element");C.style.position="relative",C.innerHTML="",this.el=C,this.disposable=[],this.before=h||{},this.locale=n||"en",this.newTopicName=u||"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=g??!0,this.scaleSensitivity=y??.1,this.scaleMax=w??1.4,this.scaleMin=S??.2,this.generateMainBranch=v||ro,this.generateSubBranch=m||lo,this.overflowHidden=p??!1,this.alignment=f??"root",this.handleWheel=E??!0,this.markdown=x||void 0,this.imageProxy=b||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=ao(this),this.bus=wt(),this.container=V.createElement("div"),this.selectionContainer=a||this.container,this.container.className="map-container";const M=window.matchMedia("(prefers-color-scheme: dark)");this.theme=d||(M.matches?ue:fe);const B=V.createElement("div");B.className="map-canvas",this.map=B,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=V.createElement("me-nodes"),this.lines=X("lines"),this.summarySvg=X("summary"),this.linkController=X("linkcontroller"),this.P2=V.createElement("div"),this.P3=V.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Oe(),this.line2=Oe(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=X("topiclinks"),this.labelContainer=V.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(bt(this))}return A.prototype=io,Object.defineProperty(A.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),A.LEFT=0,A.RIGHT=1,A.SIDE=2,A.THEME=fe,A.DARK_THEME=ue,A.version=co,A.E=De,A.new=e=>({nodeData:{id:I(),topic:e||"new topic",children:[]}}),A})();
15
+ `,Pe(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,oe(t),"parent"in n?e.bus.fire("operation",{name:"finishEditSummary",obj:n}):e.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},At=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:h,offsetTop:u}=$(this.nodes,a),g=a.offsetWidth,v=a.offsetHeight,m=c.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:u,cL:h,cW:g,cH:v,direction:m,containerHeight:this.nodes.offsetHeight}),d=this.theme.palette,f=a.nodeObj.branchColor||d[r%d.length];if(a.style.borderColor=f,this.lines.appendChild($e(p,f,"3")),e&&e!==c)continue;const y=X("subLines"),w=c.lastChild;w.tagName==="svg"&&w.remove(),c.appendChild(y),He(this,y,f,c,m,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},He=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,h=l.offsetWidth,u=l.offsetHeight;for(let g=0;g<r.length;g++){const v=r[g],m=v.firstChild,p=m.offsetTop,d=m.offsetLeft,f=m.offsetWidth,y=m.offsetHeight,w=m.firstChild.nodeObj.branchColor||n,S=e.generateSubBranch({pT:c,pL:a,pW:h,pH:u,cT:p,cL:d,cW:f,cH:y,direction:s,isFirst:i});t.appendChild($e(S,w,"2"));const E=m.children[1];if(E){if(!E.expanded)continue}else continue;He(e,t,w,v,s)}},Be={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},Re={cn:Be,zh_CN:Be,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:"요약"}};function Mt(e,t){t=t===!0?{focus:!0,link:!0}:t;const n=x=>{const b=document.createElement("div");return b.innerText=x,b.className="tips",b},o=(x,b,C)=>{const N=document.createElement("li");return N.id=x,N.innerHTML=`<span>${pe(b)}</span><span ${C?'class="key"':""}>${pe(C)}</span>`,N},s=Re[e.locale]?e.locale:"en",i=Re[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"),h=o("cm-fucus",i.focus,""),u=o("cm-unfucus",i.cancelFocus,""),g=o("cm-up",i.moveUp,"PgUp"),v=o("cm-down",i.moveDown,"Pgdn"),m=o("cm-link",i.link,""),p=o("cm-link-bidirectional",i.linkBidirectional,""),d=o("cm-summary",i.summary,""),f=document.createElement("ul");if(f.className="menu-list",f.appendChild(l),f.appendChild(r),f.appendChild(c),f.appendChild(a),t.focus&&(f.appendChild(h),f.appendChild(u)),f.appendChild(g),f.appendChild(v),f.appendChild(d),t.link&&(f.appendChild(m),f.appendChild(p)),t&&t.extend)for(let x=0;x<t.extend.length;x++){const b=t.extend[x],C=o(b.name,b.name,b.key||"");f.appendChild(C),C.onclick=N=>{b.onclick(N)}}const y=document.createElement("div");y.className="context-menu",y.appendChild(f),y.hidden=!0,e.container.append(y);let w=!0;const S=x=>{const b=x.target;if(ye(b)){b.parentElement.tagName==="ME-ROOT"?w=!0:w=!1,w?(h.className="disabled",g.className="disabled",v.className="disabled",r.className="disabled",c.className="disabled",a.className="disabled"):(h.className="",g.className="",v.className="",r.className="",c.className="",a.className=""),y.hidden=!1,f.style.top="",f.style.bottom="",f.style.left="",f.style.right="";const C=f.getBoundingClientRect(),N=f.offsetHeight,M=f.offsetWidth,B=x.clientY-C.top,R=x.clientX-C.left;N+B>window.innerHeight?(f.style.top="",f.style.bottom="0px"):(f.style.bottom="",f.style.top=B+15+"px"),M+R>window.innerWidth?(f.style.left="",f.style.right="0px"):(f.style.right="",f.style.left=R+10+"px")}};e.bus.addListener("showContextMenu",S),y.onclick=x=>{x.target===y&&(y.hidden=!0)},l.onclick=()=>{e.addChild(),y.hidden=!0},r.onclick=()=>{e.insertParent(),y.hidden=!0},c.onclick=()=>{w||(e.insertSibling("after"),y.hidden=!0)},a.onclick=()=>{w||(e.removeNodes(e.currentNodes||[]),y.hidden=!0)},h.onclick=()=>{w||(e.focusNode(e.currentNode),y.hidden=!0)},u.onclick=()=>{e.cancelFocus(),y.hidden=!0},g.onclick=()=>{w||(e.moveUpNode(),y.hidden=!0)},v.onclick=()=>{w||(e.moveDownNode(),y.hidden=!0)};const E=x=>{y.hidden=!0;const b=e.currentNode,C=n(i.clickTips);e.container.appendChild(C),e.map.addEventListener("click",N=>{N.preventDefault(),C.remove();const M=N.target;(M.parentElement.tagName==="ME-PARENT"||M.parentElement.tagName==="ME-ROOT")&&e.createArrow(b,M,x)},{once:!0})};return m.onclick=()=>E(),p.onclick=()=>E({bidirectional:!0}),d.onclick=()=>{y.hidden=!0,e.createSummary(),e.unselectNodes(e.currentNodes)},()=>{l.onclick=null,r.onclick=null,c.onclick=null,a.onclick=null,h.onclick=null,u.onclick=null,g.onclick=null,v.onclick=null,m.onclick=null,d.onclick=null,y.onclick=null,e.container.oncontextmenu=null}}const Ee=document,Dt=function(e,t){if(!t)return Ce(e),e;let n=e.querySelector(".insert-preview");const o=`insert-preview ${t} show`;return n||(n=Ee.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()},Ie=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},Pt=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,clearInterval(this.interval)}}function Ot(e){let t=null,n=null;const o=Pt(e),s=new $t(e),i=a=>{if(e.spacePressed){a.preventDefault();return}e.selection.cancel();const h=a.target;if(h?.tagName!=="ME-TPC"){a.preventDefault();return}let u=e.currentNodes;u?.includes(h)||(e.selectNode(h),u=e.currentNodes),e.dragged=u,u.length>1?o.innerHTML=u.length+"":o.innerHTML=h.innerHTML;for(const g of u)g.parentElement.parentElement.style.opacity="0.5";a.dataTransfer.setDragImage(o,0,0),a.dataTransfer.dropEffect="move",e.dragMoveHelper.clear()},l=a=>{const{dragged:h}=e;if(!h)return;s.stop();for(const g of h)g.parentElement.parentElement.style.opacity="1";const u=a.target;u.style.opacity="",n&&(Ce(n),t==="before"?e.moveNodeBefore(h,n):t==="after"?e.moveNodeAfter(h,n):t==="in"&&e.moveNodeIn(h,n),e.dragged=null,o.innerHTML="")},r=a=>{a.preventDefault();const h=12*e.scaleVal,{dragged:u}=e;if(!u)return;const g=e.container.getBoundingClientRect();a.clientX<g.x+50?s.move(1,0):a.clientX>g.x+g.width-50?s.move(-1,0):a.clientY<g.y+50?s.move(0,1):a.clientY>g.y+g.height-50?s.move(0,-1):s.stop(),Ce(n);const v=Ee.elementFromPoint(a.clientX,a.clientY-h);if(Ie(v,u)){n=v;const m=v.getBoundingClientRect(),p=m.y;a.clientY>p+m.height?t="after":t="in"}else{const m=Ee.elementFromPoint(a.clientX,a.clientY+h),p=m.getBoundingClientRect();if(Ie(m,u)){n=m;const d=p.y;a.clientY<d?t="before":t="in"}else t=n=null}n&&Dt(n,t)};return ve([{dom:e.map,evt:"dragstart",func:i},{dom:e.map,evt:"dragend",func:l},{dom:e.map,evt:"dragover",func:r}])}const jt=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 Ht(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(),h={prev:o,operation:c.name,currentSelected:s.map(u=>u.id),currentTarget:jt(c),next:a};t.push(h),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 Bt={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>'},F=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=Bt[t],n};function Rt(e){const t=document.createElement("div"),n=F("fullscreen","full"),o=F("toCenter","living"),s=F("zoomout","zoomout"),i=F("zoomin","zoomin"),l=document.createElement("span");return l.innerText="100%",t.appendChild(n),t.appendChild(o),t.appendChild(s),t.appendChild(i),t.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===e.el?document.exitFullscreen():e.el.requestFullscreen()},o.onclick=()=>{e.toCenter()},s.onclick=()=>{e.scale(e.scaleVal-e.scaleSensitivity)},i.onclick=()=>{e.scale(e.scaleVal+e.scaleSensitivity)},t}function It(e){const t=document.createElement("div"),n=F("tbltl","left"),o=F("tbltr","right"),s=F("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 Ft(e){e.container.append(Rt(e)),e.container.append(It(e))}class Wt{_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 Fe=(e,t="px")=>typeof e=="number"?e+t:e,j=({style:e},t,n)=>{if(typeof t=="object")for(const[o,s]of Object.entries(t))s!==void 0&&(e[o]=Fe(s));else n!==void 0&&(e[t]=Fe(n))},We=(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)}},Kt=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}}},Ke=(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}},Gt=()=>matchMedia("(hover: none), (pointer: coarse)").matches,Yt=()=>"safari"in window,Se=e=>Array.isArray(e)?e:[e],Ge=e=>(t,n,o,s={})=>{(t instanceof HTMLCollection||t instanceof NodeList)&&(t=Array.from(t)),n=Se(n),t=Se(t);for(const i of t)if(i)for(const l of n)i[e](l,o,{capture:!1,...s})},H=Ge("addEventListener"),L=Ge("removeEventListener"),se=e=>{const{clientX:t,clientY:n,target:o}=e.touches?.[0]??e;return{x:t,y:n,target:o}},Y=(e,t=document)=>Se(e).map(n=>typeof n=="string"?Array.from(t.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),zt=(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:W,max:Ye,min:ze,ceil:qe}=Math,Ve=(e=[])=>({stored:e,selected:[],touched:[],changed:{added:[],removed:[]}});class qt extends Wt{static version="mind-elixir-fork";_options;_selection=Ve();_area;_clippingElement;_targetElement;_targetBoundary;_targetBoundaryScrolled=!0;_targetRect;_selectables=[];_latestElement;_areaLocation={y1:0,x2:0,y2:0,x1:0};_areaRect=We();_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),j(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),j(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=Kt(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?H:L;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}=se(t),{document:l,startAreas:r,boundaries:c,features:a,behaviour:h}=this._options,u=i.getBoundingClientRect();if(t instanceof MouseEvent&&!zt(t,h.triggers))return;const g=Y(r,l),v=Y(c,l);this._targetElement=v.find(f=>Ke(f.getBoundingClientRect(),u));const m=t.composedPath(),p=g.find(f=>m.includes(f));if(this._targetBoundary=v.find(f=>m.includes(f)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",t)===!1)return;this._areaLocation={x1:o,y1:s,x2:0,y2:0};const d=l.scrollingElement??l.body;this._scrollDelta={x:d.scrollLeft,y:d.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),H(l,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),H(l,["mouseup","touchcancel","touchend"],this._onTapStop),H(l,"scroll",this._onScroll),a.deselectOnBlur&&(this._targetBoundaryScrolled=!1,H(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(t){const{singleTap:{intersect:n},range:o}=this._options.features,s=se(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:h,left:u,top:g,bottom:v}=a.getBoundingClientRect();return r<h&&r>u&&c<v&&c>g})}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],h=[...this._selectables.filter(u=>u.compareDocumentPosition(c)&4&&u.compareDocumentPosition(a)&2),c,a];this.select(h),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}=se(t);if(typeof s=="number"&&W(r+c-(i+l))>=s||typeof s=="object"&&W(r-i)>=s.x||W(c-l)>=s.y){if(L(o,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",t)===!1){L(o,["mouseup","touchcancel","touchend"],this._onTapStop);return}H(o,["mousemove","touchmove"],this._onTapMove,{passive:!1}),j(this._area,"display","block"),Y(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&&(H(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),H(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?(j(t,{top:s.top,left:s.left,width:s.width,height:s.height}),j(o,{marginTop:-s.top,marginLeft:-s.left})):(j(t,{top:0,left:0,width:"100%",height:"100%"}),j(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}=se(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 h=this._options.mindElixirInstance;if(h&&h.move){const u=n.x?qe(n.x/l):0,g=n.y?qe(n.y/l):0;(u||g)&&(h.move(-u,-g),o.x1-=u,o.y1-=g)}i.next(t),requestAnimationFrame(a)};requestAnimationFrame(a)}else i.next(t);this._handleMoveEvent(t)}_handleMoveEvent(t){const{features:n}=this._options;(n.touch&&Gt()||this._scrollAvailable&&Yt())&&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,L(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:h}}}=s;c<i.left+h.x?(t.x=-W(i.left-c+h.x),c=c<i.left?i.left:c):c>i.right-h.x?(t.x=W(i.left+i.width-c-h.x),c=c>i.right?i.right:c):t.x=0,a<i.top+h.y?(t.y=-W(i.top-a+h.y),a=a<i.top?i.top:a):a>i.bottom-h.y?(t.y=W(i.top+i.height-a-h.y),a=a>i.bottom?i.bottom:a):t.y=0;const u=ze(l,c),g=ze(r,a),v=Ye(l,c),m=Ye(r,a);this._areaRect=We(u,g,v-u,m-g)}_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;L(this._targetElement,"scroll",this._onStartAreaScroll),L(o,["mousemove","touchmove"],this._delayedTapMove),L(o,["touchmove","mousemove"],this._onTapMove),L(o,["mouseup","touchcancel","touchend"],this._onTapStop),L(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,L(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),L(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),this._frame?.cancel(),j(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,h=a==="invert",u=[],g=[],v=[];for(let p=0;p<t.length;p++){const d=t[p];if(Ke(s,d.getBoundingClientRect(),c)){if(l.includes(d))i.includes(d)&&!r.includes(d)&&r.push(d);else if(h&&i.includes(d)){v.push(d);continue}else g.push(d);u.push(d)}}h&&g.push(...i.filter(p=>!l.includes(p)));const m=a==="keep";for(let p=0;p<l.length;p++){const d=l[p];!u.includes(d)&&!(m&&i.includes(d))&&v.push(d)}o.selected=u,o.changed={added:g,removed:v},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=Y(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=Ve(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=Y(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=Y(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 Vt(e){const t=e.mouseSelectionButton===2?[2]:[0],n=new qt({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 Xt=function(e,t=!0){this.theme=e;const o={...(e.type==="dark"?ue:fe).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()},z=e=>{const t=e.parent?.children,n=t?.indexOf(e)??0;return{siblings:t,index:n}};function Ut(e){const{siblings:t,index:n}=z(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 Jt(e){const{siblings:t,index:n}=z(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 Xe(e){const{siblings:t,index:n}=z(e);return t===void 0?0:(t.splice(n,1),t.length)}function Zt(e,t,n){const{siblings:o,index:s}=z(n);o!==void 0&&(t==="before"?o.splice(s,0,e):o.splice(s+1,0,e))}function Qt(e,t){const{siblings:n,index:o}=z(e);n!==void 0&&(n[o]=t,t.children=[e])}function Ue(e,t,n){if(Xe(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}=z(n);if(o===void 0)return;e==="before"?o.splice(s,0,t):o.splice(s+1,0,t)}}const en=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)}},Je=function(e,t,n){const o=n.children[0].children[0],s=t.parentElement;if(s.tagName==="ME-PARENT"){if(U(o),s.children[1])s.nextSibling.appendChild(n);else{const i=e.createChildren([n]);s.appendChild(we(!0)),s.insertAdjacentElement("afterend",i)}e.linkDiv(n.offsetParent)}else s.tagName==="ME-ROOT"&&(en(e,o.nodeObj)===0?e.container.querySelector(".lhs")?.appendChild(n):e.container.querySelector(".rhs")?.appendChild(n),e.linkDiv())},tn=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()},Ze={before:"beforebegin",after:"afterend"},U=function(e){const n=e.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()},nn=function(e,t){const n=e.nodeObj,o=me(n);o.style&&t.style&&(t.style=Object.assign(o.style,t.style));const s=Object.assign(n,t);be.call(this,e,s),this.linkDiv(),this.bus.fire("operation",{name:"reshapeNode",obj:s,origin:o})},Ne=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],O(e.nodeData);const{grp:i,top:l}=e.createWrapper(s);return Je(e,t,i),{newTop:l,newNodeObj:s}},on=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,h=this.map.querySelector(".rhs")?.childElementCount||0;if(!a||!h){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===D.LHS?0:1;i.direction=a}Zt(i,e,s),O(this.nodeData);const l=o.parentElement,{grp:r,top:c}=this.createWrapper(i);l.parentElement.insertAdjacentElement(Ze[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)},sn=function(e,t){const n=e||this.currentNode;if(!n)return;U(n);const o=n.nodeObj;if(!o.parent)return;const s=t||this.generateNewObj();Qt(o,s),O(this.nodeData);const i=n.parentElement.parentElement,{grp:l,top:r}=this.createWrapper(s,!0);r.appendChild(we(!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})},rn=function(e,t){const n=e||this.currentNode;if(!n)return;const o=Ne(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)},ln=function(e,t){const n=me(e.nodeObj);ge(n);const o=Ne(this,t,n);if(!o)return;const{newNodeObj:s}=o;this.selectNode(this.findEle(s.id)),this.bus.fire("operation",{name:"copyNode",obj:s})},cn=function(e,t){e=ee(e);const n=[];for(let o=0;o<e.length;o++){const s=e[o],i=me(s.nodeObj);ge(i);const l=Ne(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})},an=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;Ut(n);const o=t.parentNode.parentNode;o.parentNode.insertBefore(o,o.previousSibling),this.linkDiv(),this.bus.fire("operation",{name:"moveUpNode",obj:n})},dn=function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;Jt(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})},hn=function(e){if(e.length===0)return;e=ee(e);for(const n of e){const o=n.nodeObj,s=Xe(o);tn(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)})},fn=function(e,t){e=ee(e);const n=t.nodeObj;n.expanded===!1&&(this.expandNode(t,!0),t=this.findEle(n.id));for(const o of e){const s=o.nodeObj;Ue("in",s,n),O(this.nodeData);const i=o.parentElement;Je(this,t,i.parentElement)}this.linkDiv(),this.bus.fire("operation",{name:"moveNodeIn",objs:e.map(o=>o.nodeObj),toObj:n})},Qe=(e,t,n,o)=>{e=ee(e),t==="after"&&(e=e.reverse());const s=n.nodeObj,i=[];for(const l of e){const r=l.nodeObj;Ue(t,r,s),O(o.nodeData),U(l);const c=l.parentElement.parentNode;i.includes(c.parentElement)||i.push(c.parentElement),n.parentElement.parentNode.insertAdjacentElement(Ze[t],c)}for(const l of i)l.childElementCount===0&&l.tagName!=="ME-MAIN"&&(l.previousSibling.children[1].remove(),l.remove());o.linkDiv(),o.bus.fire("operation",{name:t==="before"?"moveNodeBefore":"moveNodeAfter",objs:e.map(l=>l.nodeObj),toObj:s})},et=Object.freeze(Object.defineProperty({__proto__:null,addChild:rn,beginEdit:function(e){const t=e||this.currentNode;t&&(t.nodeObj.dangerouslySetInnerHTML||this.editTopic(t))},copyNode:ln,copyNodes:cn,insertParent:sn,insertSibling:on,moveDownNode:dn,moveNodeAfter:function(e,t){Qe(e,"after",t,this)},moveNodeBefore:function(e,t){Qe(e,"before",t,this)},moveNodeIn:fn,moveUpNode:an,removeNodes:hn,reshapeNode:nn,rmSubline:U,setNodeTopic:function(e,t){e.text.textContent=t,e.nodeObj.topic=t,this.linkDiv()}},Symbol.toStringTag,{value:"Module"}));function un(e){return{nodeData:e.isFocusMode?e.nodeDataBackup:e.nodeData,arrows:e.arrows,summaries:e.summaries,direction:e.direction,theme:e.theme}}const pn=function(e){const t=this.container,n=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(n.top>o.bottom||n.bottom<o.top||n.left>o.right||n.right<o.left){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,h=l-c;this.move(-a,-h,!0)}},gn=function(e,t,n){this.clearSelection(),this.scrollIntoView(e),this.selection.select(e),t&&this.bus.fire("selectNewNode",e.nodeObj)},mn=function(e){this.selection.select(e)},yn=function(e){this.selection.deselect(e)},vn=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},bn=function(){const e=un(this);return JSON.stringify(e,(t,n)=>{if(!(t==="parent"&&typeof n!="string"))return n})},wn=function(){return JSON.parse(this.getDataString())},xn=function(){this.editable=!0},En=function(){this.editable=!1},Cn=function(e,t={x:0,y:0}){if(e<this.scaleMin||e>this.scaleMax)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}=tt(this),r=this.map.style.transform,{x:c,y:a}=Le(r),h=c-i,u=a-l,g=this.scaleVal,v=(-o+h)*(1-e/g),m=(-s+u)*(1-e/g);this.map.style.transform=`translate(${c-v}px, ${a-m}px) scale(${e})`,this.scaleVal=e,this.bus.fire("scale",e)},Sn=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,this.map.style.transform="scale("+n+")",this.bus.fire("scale",n)},Nn=function(e,t,n=!1){const{map:o,scaleVal:s,bus:i}=this,l=o.style.transform;let{x:r,y:c}=Le(l);r+=e,c+=t,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate(${r}px, ${c}px) scale(${s})`,i.fire("move",{dx:e,dy:t})},tt=e=>{const{container:t,map:n,nodes:o}=e,s=n.querySelector("me-root"),i=s.offsetTop,l=s.offsetLeft,r=s.offsetWidth,c=s.offsetHeight;let a,h;return e.alignment==="root"?(a=t.offsetWidth/2-l-r/2,h=t.offsetHeight/2-i-c/2,n.style.transformOrigin=`${l+r/2}px 50%`):(a=(t.offsetWidth-o.offsetWidth)/2,h=(t.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:a,dy:h}},kn=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:vn,disableEdit:En,enableEdit:xn,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":"",U(e),n.expanded){const u=this.createChildren(n.children.map(g=>this.createWrapper(g).grp));i.parentNode.appendChild(u)}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,h=s.y-c.y;this.move(a,h),this.bus.fire("expandNode",n)},expandNodeAll:function(e,t){const n=e.nodeObj,o=e.getBoundingClientRect(),s={x:o.left,y:o.top};K(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:wn,getDataString:bn,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:Nn,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)),O(this.nodeData),this.layout(),this.linkDiv()},scale:Cn,scaleFit:Sn,scrollIntoView:pn,selectNode:gn,selectNodes:mn,setLocale:function(e){this.locale=e,this.refresh()},toCenter:function(){const{map:e,container:t}=this,{dx:n,dy:o}=tt(this);t.scrollTop=0,t.scrollLeft=0,e.style.transform=`translate(${n}px, ${o}px) scale(${this.scaleVal})`},unselectNodes:yn},Symbol.toStringTag,{value:"Module"})),nt={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=ve([{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}}}},_n="#4dc4ff";function ot(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 Tn(e,t,n){e&&(e.dataset.x=t.toString(),e.dataset.y=n.toString(),oe(e))}function ie(e,t,n,o,s){k(e,{x1:t+"",y1:n+"",x2:o+"",y2:s+""})}function st(e,t,n,o,s,i,l,r,c,a){const h=`M ${t} ${n} C ${o} ${s} ${i} ${l} ${r} ${c}`;if(e.line.setAttribute("d",h),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 u=e.querySelectorAll('path[stroke="transparent"]');u.length>0&&u[0].setAttribute("d",h);const g=Q(i,l,r,c);if(g){const p=`M ${g.x1} ${g.y1} L ${r} ${c} L ${g.x2} ${g.y2}`;if(e.arrow1.setAttribute("d",p),u.length>1&&u[1].setAttribute("d",p),a.style){const d=a.style;d.stroke&&e.arrow1.setAttribute("stroke",d.stroke),d.strokeWidth&&e.arrow1.setAttribute("stroke-width",String(d.strokeWidth)),d.strokeLinecap&&e.arrow1.setAttribute("stroke-linecap",d.strokeLinecap),d.opacity!==void 0&&e.arrow1.setAttribute("opacity",String(d.opacity))}}if(a.bidirectional){const p=Q(o,s,t,n);if(p){const d=`M ${p.x1} ${p.y1} L ${t} ${n} L ${p.x2} ${p.y2}`;if(e.arrow2.setAttribute("d",d),u.length>2&&u[2].setAttribute("d",d),a.style){const f=a.style;f.stroke&&e.arrow2.setAttribute("stroke",f.stroke),f.strokeWidth&&e.arrow2.setAttribute("stroke-width",String(f.strokeWidth)),f.strokeLinecap&&e.arrow2.setAttribute("stroke-linecap",f.strokeLinecap),f.opacity!==void 0&&e.arrow2.setAttribute("opacity",String(f.opacity))}}}const{x:v,y:m}=ot(t,n,o,s,i,l,r,c);if(e.labelEl&&Tn(e.labelEl,v,m),a.style?.labelColor){const p=e.labelEl;p&&(p.style.color=a.style.labelColor)}jn(e)}function re(e,t,n){const{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=t.offsetWidth,l=t.offsetHeight,r=o+i/2,c=s+l/2,a=r+n.x,h=c+n.y;return{w:i,h:l,cx:r,cy:c,ctrlX:a,ctrlY:h}}function q(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 ke=function(e,t,n,o,s){if(!t||!n)return;const i=re(e,t,o.delta1),l=re(e,n,o.delta2),{x:r,y:c}=q(i),{ctrlX:a,ctrlY:h}=i,{ctrlX:u,ctrlY:g}=l,{x:v,y:m}=q(l),p=Q(u,g,v,m);if(!p)return;const d=`M ${p.x1} ${p.y1} L ${v} ${m} L ${p.x2} ${p.y2}`;let f="";if(o.bidirectional){const N=Q(a,h,r,c);if(!N)return;f=`M ${N.x1} ${N.y1} L ${r} ${c} L ${N.x2} ${N.y2}`}const y=Lt(`M ${r} ${c} C ${a} ${h} ${u} ${g} ${v} ${m}`,d,f,o.style),{x:w,y:S}=ot(r,c,a,h,u,g,v,m),E=o.style?.labelColor||"rgb(235, 95, 82)",x="arrow-"+o.id;y.id=x;const b=e.markdown?e.markdown(o.label,o):o.label,C=xe(b,w,S,{anchor:"middle",color:E,dataType:"arrow",svgId:x});y.labelEl=C,y.arrowObj=o,y.dataset.linkid=o.id,e.labelContainer.appendChild(C),e.linkSvgGroup.appendChild(y),oe(C),s||(e.arrows.push(o),e.currentArrow=y,it(e,o,i,l))},Ln=function(e,t,n={}){const o={id:I(),label:"Custom Link",from:e.nodeObj.id,to:t.nodeObj.id,delta1:{x:e.offsetWidth/2+100,y:0},delta2:{x:t.offsetWidth/2+100,y:0},...n};ke(this,e,t,o),this.bus.fire("operation",{name:"createArrow",obj:o})},An=function(e){le(this);const t={...e,id:I()};ke(this,this.findEle(t.from),this.findEle(t.to),t),this.bus.fire("operation",{name:"createArrow",obj:t})},Mn=function(e){let t;if(e?t=e:t=this.currentArrow,!t)return;le(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}})},Dn=function(e){this.currentArrow=e;const t=e.arrowObj,n=this.findEle(t.from),o=this.findEle(t.to),s=re(this,n,t.delta1),i=re(this,o,t.delta2);it(this,t,s,i)},Pn=function(){le(this),this.currentArrow=null},_e=function(e,t){const n=document.createElementNS(P,"path");return k(n,{d:e,stroke:t,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},$n=function(e,t){const n=document.createElementNS(P,"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)},On=function(e){const t=e.querySelector(".arrow-highlight");t&&t.remove()},jn=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"))},le=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&&On(e.currentArrow)},it=function(e,t,n,o){const{linkController:s,P2:i,P3:l,line1:r,line2:c,nodes:a,map:h,currentArrow:u,bus:g}=e;if(!u)return;s.style.display="initial",i.style.display="initial",l.style.display="initial",a.appendChild(s),a.appendChild(i),a.appendChild(l),$n(u,_n);let{x:v,y:m}=q(n),{ctrlX:p,ctrlY:d}=n,{ctrlX:f,ctrlY:y}=o,{x:w,y:S}=q(o);i.style.cssText=`top:${d}px;left:${p}px;`,l.style.cssText=`top:${y}px;left:${f}px;`,ie(r,v,m,p,d),ie(c,f,y,w,S),e.helper1=nt.create(i),e.helper2=nt.create(l),e.helper1.init(h,(E,x)=>{p=p+E/e.scaleVal,d=d+x/e.scaleVal;const b=q({...n,ctrlX:p,ctrlY:d});v=b.x,m=b.y,i.style.top=d+"px",i.style.left=p+"px",st(u,v,m,p,d,f,y,w,S,t),ie(r,v,m,p,d),t.delta1.x=p-n.cx,t.delta1.y=d-n.cy,g.fire("updateArrowDelta",t)}),e.helper2.init(h,(E,x)=>{f=f+E/e.scaleVal,y=y+x/e.scaleVal;const b=q({...o,ctrlX:f,ctrlY:y});w=b.x,S=b.y,l.style.top=y+"px",l.style.left=f+"px",st(u,v,m,p,d,f,y,w,S,t),ie(c,f,y,w,S),t.delta2.x=f-o.cx,t.delta2.y=y-o.cy,g.fire("updateArrowDelta",t)})};function Hn(){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{ke(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function Bn(e){le(this),e&&e.labelEl&&je(this,e.labelEl,e.arrowObj)}function Rn(){this.arrows=this.arrows.filter(e=>Z(e.from,this.nodeData)&&Z(e.to,this.nodeData))}const In=Object.freeze(Object.defineProperty({__proto__:null,createArrow:Ln,createArrowFrom:An,editArrowLabel:Bn,removeArrow:Mn,renderArrow:Hn,selectArrow:Dn,tidyArrow:Rn,unselectArrow:Pn},Symbol.toStringTag,{value:"Module"})),Fn=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 h=a.children.findIndex(u=>c===u);return{parent:a.id,start:h,end:h}}let t=0;const n=e.map(c=>{let a=c.nodeObj;const h=[];for(;a.parent;){const u=a.parent,v=u.children?.indexOf(a);a=u,h.unshift({node:a,index:v})}return h.length>t&&(t=h.length),h});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}},Wn=function(e){const t=document.createElementNS(P,"g");return t.setAttribute("id",e),t},rt=function(e,t){const n=document.createElementNS(P,"path");return k(n,{d:e,stroke:t||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Kn=e=>e.parentElement.parentElement,Gn=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},Te=function(e,t){const{id:n,label:o,parent:s,start:i,end:l,style:r}=t,{nodes:c,theme:a,summarySvg:h}=e,g=e.findEle(s).nodeObj,v=Gn(e,t);let m=1/0,p=0,d=0,f=0;for(let J=i;J<=l;J++){const at=g.children?.[J];if(!at)return e.removeSummary(n),null;const de=Kn(e.findEle(at.id)),{offsetLeft:he,offsetTop:dt}=$(c,de),ht=i===l?10:20;J===i&&(d=dt+ht),J===l&&(f=dt+de.offsetHeight-ht),he<m&&(m=he),de.offsetWidth+he>p&&(p=de.offsetWidth+he)}let y,w;const S=g.parent?10:0,E=d+S,x=f+S,b=(E+x)/2,C=r?.stroke||a.cssVar["--color"],N=r?.labelColor||a.cssVar["--color"],M="s-"+n,B=e.markdown?e.markdown(o,t):o;v===D.LHS?(y=rt(`M ${m+10} ${E} c -5 0 -10 5 -10 10 L ${m} ${x-10} c 0 5 5 10 10 10 M ${m} ${b} h -10`,C),w=xe(B,m-20,b,{anchor:"end",color:N,dataType:"summary",svgId:M})):(y=rt(`M ${p-10} ${E} c 5 0 10 5 10 10 L ${p} ${x-10} c 0 5 -5 10 -10 10 M ${p} ${b} h 10`,C),w=xe(B,p+20,b,{anchor:"start",color:N,dataType:"summary",svgId:M}));const R=Wn(M);return R.appendChild(y),e.labelContainer.appendChild(w),oe(w),R.summaryObj=t,R.labelEl=w,h.appendChild(R),R},Yn=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}=Fn(t),r={id:I(),parent:s,start:i,end:l,label:"summary",style:e.style},c=Te(this,r);n.push(r),this.editSummary(c),o.fire("operation",{name:"createSummary",obj:r})},createSummaryFrom:function(e){const t=I(),n={...e,id:t};Te(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(e){e&&e.labelEl&&je(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{Te(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"})),T="http://www.w3.org/2000/svg";function zn(e,t){const n=document.createElementNS(T,"svg");return k(n,{version:"1.1",xmlns:T,height:e,width:t}),n}function qn(e,t){return(parseInt(e)-parseInt(t))/2}function Vn(e,t,n,o){const s=document.createElementNS(T,"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(T,"text");k(a,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+qn(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 Xn(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(T,"foreignObject");k(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const l=document.createElement("div");return k(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 Un(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=document.createElementNS(T,"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 ce(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=$(e.nodes,t),l=document.createElementNS(T,"rect");k(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(T,"g");r.appendChild(l);let c;return n?c=Xn(t,o,s,i):c=Vn(t,o,s,i),r.appendChild(c),r}function Jn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=document.createElementNS(T,"a"),l=document.createElementNS(T,"text");return k(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 Zn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=$(e.nodes,t),i=document.createElementNS(T,"image");return k(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const ae=100,Qn='<?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">',eo=(e,t=!1)=>{const n=e.nodes,o=n.offsetHeight+ae*2,s=n.offsetWidth+ae*2,i=zn(o+"px",s+"px"),l=document.createElementNS(T,"svg"),r=document.createElementNS(T,"rect");k(r,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(r),n.querySelectorAll(".subLines").forEach(u=>{const g=u.cloneNode(!0),{offsetLeft:v,offsetTop:m}=$(n,u.parentElement);g.setAttribute("x",`${v}`),g.setAttribute("y",`${m}`),l.appendChild(g)});const c=n.querySelector(".lines")?.cloneNode(!0);c&&l.appendChild(c);const a=n.querySelector(".topiclinks")?.cloneNode(!0);a&&l.appendChild(a);const h=n.querySelector(".summary")?.cloneNode(!0);return h&&l.appendChild(h),n.querySelectorAll("me-tpc").forEach(u=>{u.nodeObj.dangerouslySetInnerHTML?l.appendChild(ce(e,u,!t)):(l.appendChild(Un(e,u)),l.appendChild(ce(e,u.text,!t)))}),n.querySelectorAll(".tags > span").forEach(u=>{l.appendChild(ce(e,u))}),n.querySelectorAll(".icons > span").forEach(u=>{l.appendChild(ce(e,u))}),n.querySelectorAll(".hyper-link").forEach(u=>{l.appendChild(Jn(e,u))}),n.querySelectorAll("img").forEach(u=>{l.appendChild(Zn(e,u))}),k(l,{x:ae+"",y:ae+"",overflow:"visible"}),i.appendChild(l),i},to=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),Qn+e.outerHTML);function no(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 oo=Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await no(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=eo(this,e),o=to(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"}));function so(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const lt=Object.keys(et),ct={};for(let e=0;e<lt.length;e++){const t=lt[e];ct[t]=so(et[t],t)}const io={getObjById:Z,generateNewObj:ft,layout:xt,linkDiv:At,editTopic:Tt,createWrapper:St,createParent:Nt,createChildren:kt,createTopic:_t,findEle:De,changeTheme:Xt,...kn,...ct,...In,...Yn,...oo,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,O(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&Ft(this),this.keypress&&vt(this,this.keypress),this.editable&&Vt(this),this.contextMenu&&this.disposable.push(Mt(this,this.contextMenu)),this.draggable&&this.disposable.push(Ot(this)),this.allowUndo&&this.disposable.push(Ht(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 ro({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,containerHeight:a}){let h=t+n/2;const u=e+o/2;let g;c===D.LHS?g=i+l:g=i;const v=s+r/2,p=(1-Math.abs(v-u)/a)*.25*(n/2);return c===D.LHS?h=h-n/10-p:h=h+n/10+p,`M ${h} ${u} Q ${h} ${v} ${g} ${v}`}function lo({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:l,cH:r,direction:c,isFirst:a}){const h=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let u=0,g=0;a?u=e+o/2:u=e+o;const v=s+r;let m=0,p=0,d=0;const f=Math.abs(u-v)/300*h;return c===D.LHS?(d=t,m=d+h,p=d-h,g=i+h,`M ${m} ${u} C ${d} ${u} ${d+f} ${v} ${p} ${v} H ${g}`):(d=t+n,m=d-h,p=d+h,g=i+l-h,`M ${m} ${u} C ${d} ${u} ${d-f} ${v} ${p} ${v} H ${g}`)}const co="5.3.6";function ao(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 V=document;function A({el:e,direction:t,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:l,keypress:r,mouseSelectionButton:c,selectionContainer:a,before:h,newTopicName:u,allowUndo:g,generateMainBranch:v,generateSubBranch:m,overflowHidden:p,theme:d,alignment:f,scaleSensitivity:y,scaleMax:w,scaleMin:S,handleWheel:E,markdown:x,imageProxy:b}){let C=null;const N=Object.prototype.toString.call(e);if(N==="[object HTMLDivElement]"?C=e:N==="[object String]"&&(C=document.querySelector(e)),!C)throw new Error("MindElixir: el is not a valid element");C.style.position="relative",C.innerHTML="",this.el=C,this.disposable=[],this.before=h||{},this.locale=n||"en",this.newTopicName=u||"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=g??!0,this.scaleSensitivity=y??.1,this.scaleMax=w??1.4,this.scaleMin=S??.2,this.generateMainBranch=v||ro,this.generateSubBranch=m||lo,this.overflowHidden=p??!1,this.alignment=f??"root",this.handleWheel=E??!0,this.markdown=x||void 0,this.imageProxy=b||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=ao(this),this.bus=wt(),this.container=V.createElement("div"),this.selectionContainer=a||this.container,this.container.className="map-container";const M=window.matchMedia("(prefers-color-scheme: dark)");this.theme=d||(M.matches?ue:fe);const B=V.createElement("div");B.className="map-canvas",this.map=B,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=V.createElement("me-nodes"),this.lines=X("lines"),this.summarySvg=X("summary"),this.linkController=X("linkcontroller"),this.P2=V.createElement("div"),this.P3=V.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Oe(),this.line2=Oe(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=X("topiclinks"),this.labelContainer=V.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(bt(this))}return A.prototype=io,Object.defineProperty(A.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),A.LEFT=0,A.RIGHT=1,A.SIDE=2,A.THEME=fe,A.DARK_THEME=ue,A.version=co,A.E=De,A.new=e=>({nodeData:{id:I(),topic:e||"new topic",children:[]}}),A})();
@@ -69,16 +69,16 @@ const se = function(e, t) {
69
69
  if (e.parent = t, e.children)
70
70
  for (let n = 0; n < e.children.length; n++)
71
71
  R(e.children[n], e);
72
- }, z = (e, t, n) => {
72
+ }, q = (e, t, n) => {
73
73
  if (e.expanded = t, e.children)
74
74
  if (n === void 0 || n > 0) {
75
75
  const o = n !== void 0 ? n - 1 : void 0;
76
76
  e.children.forEach((s) => {
77
- z(s, t, o);
77
+ q(s, t, o);
78
78
  });
79
79
  } else
80
80
  e.children.forEach((o) => {
81
- z(o, !1);
81
+ q(o, !1);
82
82
  });
83
83
  };
84
84
  function xe(e) {
@@ -200,13 +200,13 @@ function vt(e, t) {
200
200
  const c = e.nodeData;
201
201
  if (r.key === "0")
202
202
  for (const a of c.children)
203
- z(a, !1);
203
+ q(a, !1);
204
204
  if (r.key === "=")
205
205
  for (const a of c.children)
206
- z(a, !0);
206
+ q(a, !0);
207
207
  if (["1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(r.key))
208
208
  for (const a of c.children)
209
- z(a, !0, Number(r.key) - 1);
209
+ q(a, !0, Number(r.key) - 1);
210
210
  e.refresh(), e.toCenter(), o = !1, s && (clearTimeout(s), s = null, e.container.removeEventListener("keydown", i));
211
211
  }, l = {
212
212
  Enter: (r) => {
@@ -377,7 +377,7 @@ function bt(e) {
377
377
  d.code === "Space" && (e.spacePressed = !1, e.container.classList.remove("space-pressed"));
378
378
  }, c = (d) => {
379
379
  t.moved = !1;
380
- const f = e.spacePressed && d.button === 0 && d.pointerType === "mouse", y = e.mouseSelectionButton === 0 ? 2 : 0, w = d.button === y && d.pointerType === "mouse";
380
+ const f = e.spacePressed && d.button === 0 && d.pointerType === "mouse", y = e.mouseSelectionButton === 0 ? 2 : 0, w = d.button === y && d.pointerType === "mouse" || d.pointerType === "touch";
381
381
  if (!f && !w) return;
382
382
  t.x = d.clientX, t.y = d.clientY;
383
383
  const S = d.target;
@@ -576,7 +576,7 @@ const Tt = function(e) {
576
576
  }, Ne = function(e) {
577
577
  const t = _.createElement("me-epd");
578
578
  return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
579
- }, q = document, M = "http://www.w3.org/2000/svg", de = function(e) {
579
+ }, z = document, M = "http://www.w3.org/2000/svg", de = function(e) {
580
580
  const t = e.clientWidth, n = e.clientHeight, o = e.dataset, s = Number(o.x), i = Number(o.y), l = o.anchor;
581
581
  let r = s;
582
582
  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";
@@ -586,7 +586,7 @@ const Tt = function(e) {
586
586
  const a = "label-" + r;
587
587
  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;
588
588
  }, Ze = function(e, t, n) {
589
- const o = q.createElementNS(M, "path");
589
+ const o = z.createElementNS(M, "path");
590
590
  return k(o, {
591
591
  d: e,
592
592
  stroke: t || "#666",
@@ -594,13 +594,13 @@ const Tt = function(e) {
594
594
  "stroke-width": n
595
595
  }), o;
596
596
  }, U = function(e) {
597
- const t = q.createElementNS(M, "svg");
597
+ const t = z.createElementNS(M, "svg");
598
598
  return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
599
599
  }, $e = function() {
600
- const e = q.createElementNS(M, "line");
600
+ const e = z.createElementNS(M, "line");
601
601
  return e.setAttribute("stroke", "#4dc4ff"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e.setAttribute("opacity", "0.45"), e;
602
602
  }, Lt = function(e, t, n, o) {
603
- const s = q.createElementNS(M, "g");
603
+ const s = z.createElementNS(M, "g");
604
604
  return [
605
605
  {
606
606
  name: "line",
@@ -615,7 +615,7 @@ const Tt = function(e) {
615
615
  d: n
616
616
  }
617
617
  ].forEach((l, r) => {
618
- const c = l.d, a = q.createElementNS(M, "path"), h = {
618
+ const c = l.d, a = z.createElementNS(M, "path"), h = {
619
619
  d: c,
620
620
  stroke: o?.stroke || "rgb(227, 125, 116)",
621
621
  fill: "none",
@@ -623,7 +623,7 @@ const Tt = function(e) {
623
623
  "stroke-width": String(o?.strokeWidth || "2")
624
624
  };
625
625
  o?.opacity !== void 0 && (h.opacity = String(o.opacity)), k(a, h), r === 0 && a.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
626
- const u = q.createElementNS(M, "path");
626
+ const u = z.createElementNS(M, "path");
627
627
  k(u, {
628
628
  d: c,
629
629
  stroke: "transparent",
@@ -1057,7 +1057,7 @@ const Bt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1057
1057
  const n = document.createElement("span");
1058
1058
  return n.id = e, n.innerHTML = Yt[t], n;
1059
1059
  };
1060
- function zt(e) {
1060
+ function qt(e) {
1061
1061
  const t = document.createElement("div"), n = F("fullscreen", "full"), o = F("toCenter", "living"), s = F("zoomout", "zoomout"), i = F("zoomin", "zoomin"), l = document.createElement("span");
1062
1062
  return l.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
1063
1063
  document.fullscreenElement === e.el ? document.exitFullscreen() : e.el.requestFullscreen();
@@ -1069,7 +1069,7 @@ function zt(e) {
1069
1069
  e.scale(e.scaleVal + e.scaleSensitivity);
1070
1070
  }, t;
1071
1071
  }
1072
- function qt(e) {
1072
+ function zt(e) {
1073
1073
  const t = document.createElement("div"), n = F("tbltl", "left"), o = F("tbltr", "right"), s = F("tblts", "side");
1074
1074
  return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
1075
1075
  e.initLeft();
@@ -1080,7 +1080,7 @@ function qt(e) {
1080
1080
  }, t;
1081
1081
  }
1082
1082
  function Vt(e) {
1083
- e.container.append(zt(e)), e.container.append(qt(e));
1083
+ e.container.append(qt(e)), e.container.append(zt(e));
1084
1084
  }
1085
1085
  class Xt {
1086
1086
  _listeners = /* @__PURE__ */ new Map();
@@ -1983,18 +1983,18 @@ const Nn = function(e) {
1983
1983
  y: r.top
1984
1984
  }, a = s.x - c.x, h = s.y - c.y;
1985
1985
  this.move(a, h), this.bus.fire("expandNode", n);
1986
- }, zn = function(e, t) {
1986
+ }, qn = function(e, t) {
1987
1987
  const n = e.nodeObj, o = e.getBoundingClientRect(), s = {
1988
1988
  x: o.left,
1989
1989
  y: o.top
1990
1990
  };
1991
- z(n, t ?? !n.expanded), this.refresh();
1991
+ q(n, t ?? !n.expanded), this.refresh();
1992
1992
  const i = this.findEle(n.id).getBoundingClientRect(), l = {
1993
1993
  x: i.left,
1994
1994
  y: i.top
1995
1995
  }, r = s.x - l.x, c = s.y - l.y;
1996
1996
  this.move(r, c);
1997
- }, qn = function(e) {
1997
+ }, zn = function(e) {
1998
1998
  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)), R(this.nodeData), this.layout(), this.linkDiv();
1999
1999
  }, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2000
2000
  __proto__: null,
@@ -2003,7 +2003,7 @@ const Nn = function(e) {
2003
2003
  disableEdit: Pn,
2004
2004
  enableEdit: Dn,
2005
2005
  expandNode: Yn,
2006
- expandNodeAll: zn,
2006
+ expandNodeAll: qn,
2007
2007
  focusNode: Rn,
2008
2008
  getData: Mn,
2009
2009
  getDataString: An,
@@ -2012,7 +2012,7 @@ const Nn = function(e) {
2012
2012
  initSide: Kn,
2013
2013
  install: Bn,
2014
2014
  move: jn,
2015
- refresh: qn,
2015
+ refresh: zn,
2016
2016
  scale: $n,
2017
2017
  scaleFit: On,
2018
2018
  scrollIntoView: Nn,
@@ -2076,7 +2076,7 @@ function te(e, t, n, o, s) {
2076
2076
  y2: s + ""
2077
2077
  });
2078
2078
  }
2079
- function ze(e, t, n, o, s, i, l, r, c, a) {
2079
+ function qe(e, t, n, o, s, i, l, r, c, a) {
2080
2080
  const h = `M ${t} ${n} C ${o} ${s} ${i} ${l} ${r} ${c}`;
2081
2081
  if (e.line.setAttribute("d", h), a.style) {
2082
2082
  const p = a.style;
@@ -2181,7 +2181,7 @@ const _e = function(e, t, n, o, s) {
2181
2181
  if (e ? t = e : t = this.currentArrow, !t) return;
2182
2182
  he(this);
2183
2183
  const n = t.arrowObj.id;
2184
- this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
2184
+ this.arrows = this.arrows.filter((o) => o.id !== n), t.labelEl?.remove(), t.remove(), this.bus.fire("operation", {
2185
2185
  name: "removeArrow",
2186
2186
  obj: {
2187
2187
  id: n
@@ -2232,19 +2232,19 @@ const _e = function(e, t, n, o, s) {
2232
2232
  i.style.cssText = `top:${d}px;left:${p}px;`, l.style.cssText = `top:${y}px;left:${f}px;`, te(r, v, m, p, d), te(c, f, y, w, S), e.helper1 = Ye.create(i), e.helper2 = Ye.create(l), e.helper1.init(h, (E, x) => {
2233
2233
  p = p + E / e.scaleVal, d = d + x / e.scaleVal;
2234
2234
  const b = Y({ ...n, ctrlX: p, ctrlY: d });
2235
- v = b.x, m = b.y, i.style.top = d + "px", i.style.left = p + "px", ze(u, v, m, p, d, f, y, w, S, t), te(r, v, m, p, d), t.delta1.x = p - n.cx, t.delta1.y = d - n.cy, g.fire("updateArrowDelta", t);
2235
+ v = b.x, m = b.y, i.style.top = d + "px", i.style.left = p + "px", qe(u, v, m, p, d, f, y, w, S, t), te(r, v, m, p, d), t.delta1.x = p - n.cx, t.delta1.y = d - n.cy, g.fire("updateArrowDelta", t);
2236
2236
  }), e.helper2.init(h, (E, x) => {
2237
2237
  f = f + E / e.scaleVal, y = y + x / e.scaleVal;
2238
2238
  const b = Y({ ...o, ctrlX: f, ctrlY: y });
2239
- w = b.x, S = b.y, l.style.top = y + "px", l.style.left = f + "px", ze(u, v, m, p, d, f, y, w, S, t), te(c, f, y, w, S), t.delta2.x = f - o.cx, t.delta2.y = y - o.cy, g.fire("updateArrowDelta", t);
2239
+ w = b.x, S = b.y, l.style.top = y + "px", l.style.left = f + "px", qe(u, v, m, p, d, f, y, w, S, t), te(c, f, y, w, S), t.delta2.x = f - o.cx, t.delta2.y = y - o.cy, g.fire("updateArrowDelta", t);
2240
2240
  });
2241
2241
  };
2242
2242
  function ro() {
2243
- this.linkSvgGroup.innerHTML = "";
2244
- for (let e = 0; e < this.arrows.length; e++) {
2245
- const t = this.arrows[e];
2243
+ this.linkSvgGroup.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((t) => t.remove());
2244
+ for (let t = 0; t < this.arrows.length; t++) {
2245
+ const n = this.arrows[t];
2246
2246
  try {
2247
- _e(this, this.findEle(t.from), this.findEle(t.to), t, !0);
2247
+ _e(this, this.findEle(n.from), this.findEle(n.to), n, !0);
2248
2248
  } catch {
2249
2249
  }
2250
2250
  }
@@ -2306,7 +2306,7 @@ const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2306
2306
  }, fo = function(e) {
2307
2307
  const t = document.createElementNS(M, "g");
2308
2308
  return t.setAttribute("id", e), t;
2309
- }, qe = function(e, t) {
2309
+ }, ze = function(e, t) {
2310
2310
  const n = document.createElementNS(M, "path");
2311
2311
  return k(n, {
2312
2312
  d: e,
@@ -2331,7 +2331,7 @@ const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2331
2331
  }
2332
2332
  let y, w;
2333
2333
  const S = g.parent ? 10 : 0, E = d + S, x = f + S, b = (E + x) / 2, C = r?.stroke || a.cssVar["--color"], N = r?.labelColor || a.cssVar["--color"], L = "s-" + n, O = e.markdown ? e.markdown(o, t) : o;
2334
- v === D.LHS ? (y = qe(`M ${m + 10} ${E} c -5 0 -10 5 -10 10 L ${m} ${x - 10} c 0 5 5 10 10 10 M ${m} ${b} h -10`, C), w = ge(O, m - 20, b, { anchor: "end", color: N, dataType: "summary", svgId: L })) : (y = qe(`M ${p - 10} ${E} c 5 0 10 5 10 10 L ${p} ${x - 10} c 0 5 -5 10 -10 10 M ${p} ${b} h 10`, C), w = ge(O, p + 20, b, { anchor: "start", color: N, dataType: "summary", svgId: L }));
2334
+ v === D.LHS ? (y = ze(`M ${m + 10} ${E} c -5 0 -10 5 -10 10 L ${m} ${x - 10} c 0 5 5 10 10 10 M ${m} ${b} h -10`, C), w = ge(O, m - 20, b, { anchor: "end", color: N, dataType: "summary", svgId: L })) : (y = ze(`M ${p - 10} ${E} c 5 0 10 5 10 10 L ${p} ${x - 10} c 0 5 -5 10 -10 10 M ${p} ${b} h 10`, C), w = ge(O, p + 20, b, { anchor: "start", color: N, dataType: "summary", svgId: L }));
2335
2335
  const j = fo(L);
2336
2336
  return j.appendChild(y), e.labelContainer.appendChild(w), de(w), j.summaryObj = t, j.labelEl = w, h.appendChild(j), j;
2337
2337
  }, go = function(e = {}) {
@@ -2589,7 +2589,7 @@ function Io({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: r, direction:
2589
2589
  const f = Math.abs(u - v) / 300 * h;
2590
2590
  return c === D.LHS ? (d = t, m = d + h, p = d - h, g = i + h, `M ${m} ${u} C ${d} ${u} ${d + f} ${v} ${p} ${v} H ${g}`) : (d = t + n, m = d - h, p = d + h, g = i + l - h, `M ${m} ${u} C ${d} ${u} ${d - f} ${v} ${p} ${v} H ${g}`);
2591
2591
  }
2592
- const Fo = "5.3.4";
2592
+ const Fo = "5.3.6";
2593
2593
  function Wo(e) {
2594
2594
  return {
2595
2595
  x: 0,
@@ -1,4 +1,4 @@
1
- var MindElixirLite=(function(){"use strict";const tt={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","--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"}},et={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","--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 $t(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const R=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=R(t,e.children[n]);if(o)return o}return null}else return null},nt=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)nt(t.children[n],t)},ct=(t,e,n)=>{t.expanded=e,t.children&&t.children.forEach(o=>{ct(o,e)})};function Y(t,e,n,o){const s=o-e,i=t-n;let r=Math.atan(Math.abs(s)/Math.abs(i))/3.14*180;if(isNaN(r))return;i<0&&s>0&&(r=180-r),i<0&&s<0&&(r=180+r),i>0&&s<0&&(r=360-r);const c=12,a=30,d=r+a,f=r-a;return{x1:n+Math.cos(Math.PI*d/180)*c,y1:o-Math.sin(Math.PI*d/180)*c,x2:n+Math.cos(Math.PI*f/180)*c,y2:o-Math.sin(Math.PI*f/180)*c}}function O(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const Dt=function(){const t=O();return{topic:this.newTopicName,id:t}},N=(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}},E=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},lt=t=>t?t.tagName==="ME-TPC":!1,at=t=>{const e=/translate\(([^,]+),\s*([^)]+)\)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},dt=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)}}},P={LHS:"lhs",RHS:"rhs"},ht=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)}};function At(t){const{dragMoveHelper:e}=t;let n=0;t.spacePressed=!1;const o=l=>{if(l.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}const h=l.target;if(h.tagName==="ME-EPD")l.ctrlKey||l.metaKey?t.expandNodeAll(h.previousSibling):t.expandNode(h.previousSibling);else if(h.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(h);else if(!t.editable)return;const y=h.closest(".svg-label");if(y){const b=y.dataset.svgId,S=y.dataset.type,x=document.getElementById(b);if(x){if(S==="arrow"){t.selectArrow(x);return}else if(S==="summary"){t.selectSummary(x);return}}}if(h.closest(".topiclinks")){const b=h.closest("g");if(b){t.selectArrow(b);return}}if(h.closest(".summary")){const b=h.closest("g");if(b){t.selectSummary(b);return}}},s=l=>{if(!t.editable)return;const h=l.target;lt(h)&&t.beginEdit(h);const y=h.closest(".svg-label");if(y){const b=y.dataset.svgId,S=y.dataset.type,x=document.getElementById(b);if(x){if(S==="arrow"){t.editArrowLabel(x);return}else if(S==="summary"){t.editSummary(x);return}}}if(h.closest(".topiclinks")){const b=h.closest("g");if(b){t.editArrowLabel(b);return}}if(h.closest(".summary")){const b=h.closest("g");if(b){t.editSummary(b);return}}},i=l=>{if(l.pointerType==="mouse")return;const h=new Date().getTime(),y=h-n;y<300&&y>0&&s(l),n=h},r=l=>{l.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},c=l=>{l.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))},a=l=>{e.moved=!1;const h=t.spacePressed&&l.button===0&&l.pointerType==="mouse",y=t.mouseSelectionButton===0?2:0,v=l.button===y&&l.pointerType==="mouse";if(!h&&!v)return;e.x=l.clientX,e.y=l.clientY;const C=l.target;(h||C.className!=="circle"&&C.contentEditable!=="plaintext-only")&&(e.mousedown=!0,C.setPointerCapture(l.pointerId))},d=l=>{if(l.target.contentEditable!=="plaintext-only"||t.spacePressed&&e.mousedown){const h=l.clientX-e.x,y=l.clientY-e.y;e.onMove(h,y)}e.x=l.clientX,e.y=l.clientY},f=l=>{if(!e.mousedown)return;const h=l.target;h.hasPointerCapture&&h.hasPointerCapture(l.pointerId)&&h.releasePointerCapture(l.pointerId),e.clear()},u=()=>{e.mousedown&&e.clear()},m=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const h=l.target;lt(h)&&!h.classList.contains("selected")&&t.selectNode(h),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",l)},200)},w=l=>{l.stopPropagation(),l.preventDefault(),l.ctrlKey||l.metaKey?l.deltaY<0?ht(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&ht(t,"out",t.dragMoveHelper):l.shiftKey?t.move(-l.deltaY,0):t.move(-l.deltaX,-l.deltaY)},{container:g}=t;return dt([{dom:g,evt:"pointerdown",func:a},{dom:g,evt:"pointermove",func:d},{dom:g,evt:"pointerup",func:f},{dom:g,evt:"pointerup",func:i},{dom:g,evt:"click",func:o},{dom:g,evt:"dblclick",func:s},{dom:g,evt:"contextmenu",func:m},{dom:g,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:w},{dom:g,evt:"blur",func:u},{dom:g,evt:"keydown",func:r},{dom:g,evt:"keyup",func:c}])}function Nt(){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 j=document,Mt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);ut.call(this,t,this.nodeData),t.draggable=!1;const e=j.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)})}Pt(this,n,e)},Pt=function(t,e,n){const o=j.createElement("me-main");o.className=P.LHS;const s=j.createElement("me-main");s.className=P.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)},Ht=function(t,e){const n=j.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},k=document,ft=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},ut=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=k.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=k.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=k.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=k.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${$t(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=k.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=k.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)},Bt=function(t,e){const n=k.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=Ft(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=Ht(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},It=function(t){const e=k.createElement("me-parent"),n=this.createTopic(t);return ut.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},Ot=function(t){const e=k.createElement("me-children");return e.append(...t),e},Wt=function(t){const e=k.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e.draggable=this.draggable,e};function pt(t){const e=k.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const Gt=function(t){if(!t)return;const e=k.createElement("div"),n=t.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=N(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(){"use strict";const tt={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","--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"}},et={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","--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 $t(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const R=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=R(t,e.children[n]);if(o)return o}return null}else return null},nt=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)nt(t.children[n],t)},ct=(t,e,n)=>{t.expanded=e,t.children&&t.children.forEach(o=>{ct(o,e)})};function Y(t,e,n,o){const s=o-e,i=t-n;let r=Math.atan(Math.abs(s)/Math.abs(i))/3.14*180;if(isNaN(r))return;i<0&&s>0&&(r=180-r),i<0&&s<0&&(r=180+r),i>0&&s<0&&(r=360-r);const c=12,a=30,d=r+a,f=r-a;return{x1:n+Math.cos(Math.PI*d/180)*c,y1:o-Math.sin(Math.PI*d/180)*c,x2:n+Math.cos(Math.PI*f/180)*c,y2:o-Math.sin(Math.PI*f/180)*c}}function O(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const At=function(){const t=O();return{topic:this.newTopicName,id:t}},N=(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}},E=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},lt=t=>t?t.tagName==="ME-TPC":!1,at=t=>{const e=/translate\(([^,]+),\s*([^)]+)\)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},dt=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)}}},P={LHS:"lhs",RHS:"rhs"},ht=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)}};function Dt(t){const{dragMoveHelper:e}=t;let n=0;t.spacePressed=!1;const o=l=>{if(l.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}const h=l.target;if(h.tagName==="ME-EPD")l.ctrlKey||l.metaKey?t.expandNodeAll(h.previousSibling):t.expandNode(h.previousSibling);else if(h.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(h);else if(!t.editable)return;const y=h.closest(".svg-label");if(y){const b=y.dataset.svgId,S=y.dataset.type,x=document.getElementById(b);if(x){if(S==="arrow"){t.selectArrow(x);return}else if(S==="summary"){t.selectSummary(x);return}}}if(h.closest(".topiclinks")){const b=h.closest("g");if(b){t.selectArrow(b);return}}if(h.closest(".summary")){const b=h.closest("g");if(b){t.selectSummary(b);return}}},s=l=>{if(!t.editable)return;const h=l.target;lt(h)&&t.beginEdit(h);const y=h.closest(".svg-label");if(y){const b=y.dataset.svgId,S=y.dataset.type,x=document.getElementById(b);if(x){if(S==="arrow"){t.editArrowLabel(x);return}else if(S==="summary"){t.editSummary(x);return}}}if(h.closest(".topiclinks")){const b=h.closest("g");if(b){t.editArrowLabel(b);return}}if(h.closest(".summary")){const b=h.closest("g");if(b){t.editSummary(b);return}}},i=l=>{if(l.pointerType==="mouse")return;const h=new Date().getTime(),y=h-n;y<300&&y>0&&s(l),n=h},r=l=>{l.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},c=l=>{l.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))},a=l=>{e.moved=!1;const h=t.spacePressed&&l.button===0&&l.pointerType==="mouse",y=t.mouseSelectionButton===0?2:0,v=l.button===y&&l.pointerType==="mouse"||l.pointerType==="touch";if(!h&&!v)return;e.x=l.clientX,e.y=l.clientY;const C=l.target;(h||C.className!=="circle"&&C.contentEditable!=="plaintext-only")&&(e.mousedown=!0,C.setPointerCapture(l.pointerId))},d=l=>{if(l.target.contentEditable!=="plaintext-only"||t.spacePressed&&e.mousedown){const h=l.clientX-e.x,y=l.clientY-e.y;e.onMove(h,y)}e.x=l.clientX,e.y=l.clientY},f=l=>{if(!e.mousedown)return;const h=l.target;h.hasPointerCapture&&h.hasPointerCapture(l.pointerId)&&h.releasePointerCapture(l.pointerId),e.clear()},u=()=>{e.mousedown&&e.clear()},m=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const h=l.target;lt(h)&&!h.classList.contains("selected")&&t.selectNode(h),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",l)},200)},w=l=>{l.stopPropagation(),l.preventDefault(),l.ctrlKey||l.metaKey?l.deltaY<0?ht(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&ht(t,"out",t.dragMoveHelper):l.shiftKey?t.move(-l.deltaY,0):t.move(-l.deltaX,-l.deltaY)},{container:g}=t;return dt([{dom:g,evt:"pointerdown",func:a},{dom:g,evt:"pointermove",func:d},{dom:g,evt:"pointerup",func:f},{dom:g,evt:"pointerup",func:i},{dom:g,evt:"click",func:o},{dom:g,evt:"dblclick",func:s},{dom:g,evt:"contextmenu",func:m},{dom:g,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:w},{dom:g,evt:"blur",func:u},{dom:g,evt:"keydown",func:r},{dom:g,evt:"keyup",func:c}])}function Nt(){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 j=document,Mt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);ut.call(this,t,this.nodeData),t.draggable=!1;const e=j.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)})}Pt(this,n,e)},Pt=function(t,e,n){const o=j.createElement("me-main");o.className=P.LHS;const s=j.createElement("me-main");s.className=P.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)},Ht=function(t,e){const n=j.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},L=document,ft=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},ut=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=L.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=L.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=L.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=L.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${$t(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=L.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=L.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)},Bt=function(t,e){const n=L.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=Ft(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=Ht(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},It=function(t){const e=L.createElement("me-parent"),n=this.createTopic(t);return ut.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},Ot=function(t){const e=L.createElement("me-children");return e.append(...t),e},Wt=function(t){const e=L.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e.draggable=this.draggable,e};function pt(t){const e=L.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const Gt=function(t){if(!t)return;const e=L.createElement("div"),n=t.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=N(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 tt={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"),pt(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}))})},Ft=function(t){const e=k.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},H=document,D="http://www.w3.org/2000/svg",X=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"},ot=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 d="label-"+c;return a.id=d,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},gt=function(t,e,n){const o=H.createElementNS(D,"path");return E(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},W=function(t){const e=H.createElementNS(D,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},mt=function(){const t=H.createElementNS(D,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},zt=function(t,e,n,o){const s=H.createElementNS(D,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const a=r.d,d=H.createElementNS(D,"path"),f={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&&(f.opacity=String(o.opacity)),E(d,f),c===0&&d.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const u=H.createElementNS(D,"path");E(u,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(u),s.appendChild(d),s[r.name]=d}),s},yt=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"),pt(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}))})},Ft=function(t){const e=L.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},H=document,A="http://www.w3.org/2000/svg",X=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"},ot=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 d="label-"+c;return a.id=d,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},gt=function(t,e,n){const o=H.createElementNS(A,"path");return E(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},W=function(t){const e=H.createElementNS(A,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},mt=function(){const t=H.createElementNS(A,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},zt=function(t,e,n,o){const s=H.createElementNS(A,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const a=r.d,d=H.createElementNS(A,"path"),f={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&&(f.opacity=String(o.opacity)),E(d,f),c===0&&d.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const u=H.createElementNS(A,"path");E(u,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(u),s.appendChild(d),s[r.name]=d}),s},yt=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
- `,pt(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,X(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Vt=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],d=a.querySelector("me-tpc"),{offsetLeft:f,offsetTop:u}=N(this.nodes,d),m=d.offsetWidth,w=d.offsetHeight,g=a.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:u,cL:f,cW:m,cH:w,direction:g,containerHeight:this.nodes.offsetHeight}),l=this.theme.palette,h=d.nodeObj.branchColor||l[c%l.length];if(d.style.borderColor=h,this.lines.appendChild(gt(p,h,"3")),t&&t!==a)continue;const y=W("subLines"),v=a.lastChild;v.tagName==="svg"&&v.remove(),a.appendChild(y),wt(this,y,h,a,g,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},wt=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,d=r.offsetLeft,f=r.offsetWidth,u=r.offsetHeight;for(let m=0;m<c.length;m++){const w=c[m],g=w.firstChild,p=g.offsetTop,l=g.offsetLeft,h=g.offsetWidth,y=g.offsetHeight,v=g.firstChild.nodeObj.branchColor||n,C=t.generateSubBranch({pT:a,pL:d,pW:f,pH:u,cT:p,cL:l,cW:h,cH:y,direction:s,isFirst:i});e.appendChild(gt(C,v,"2"));const b=g.children[1];if(b){if(!b.expanded)continue}else continue;wt(t,e,v,w,s)}},Rt={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>'},M=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=Rt[e],n};function Yt(t){const e=document.createElement("div"),n=M("fullscreen","full"),o=M("toCenter","living"),s=M("zoomout","zoomout"),i=M("zoomin","zoomin"),r=document.createElement("span");return r.innerText="100%",e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===t.el?document.exitFullscreen():t.el.requestFullscreen()},o.onclick=()=>{t.toCenter()},s.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},i.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function jt(t){const e=document.createElement("div"),n=M("tbltl","left"),o=M("tbltr","right"),s=M("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 Xt(t){t.container.append(Yt(t)),t.container.append(jt(t))}const qt=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?et:tt).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()},_t=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function Ut(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const Kt=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom||n.bottom<o.top||n.left>o.right||n.right<o.left){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,d=i-c,f=r-a;this.move(-d,-f,!0)}},Jt=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},Qt=function(t){this.selection.select(t)},Zt=function(t){this.selection.deselect(t)},te=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},ee=function(){const t=Ut(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ne=function(){return JSON.parse(this.getDataString())},oe=function(){this.editable=!0},se=function(){this.editable=!1},ie=function(t,e={x:0,y:0}){if(t<this.scaleMin||t>this.scaleMax)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}=bt(this),c=this.map.style.transform,{x:a,y:d}=at(c),f=a-i,u=d-r,m=this.scaleVal,w=(-o+f)*(1-t/m),g=(-s+u)*(1-t/m);this.map.style.transform=`translate(${a-w}px, ${d-g}px) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},re=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,this.map.style.transform="scale("+n+")",this.bus.fire("scale",n)},ce=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i}=this,r=o.style.transform;let{x:c,y:a}=at(r);c+=t,a+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate(${c}px, ${a}px) scale(${s})`,i.fire("move",{dx:t,dy:e})},bt=t=>{const{container:e,map:n,nodes:o}=t,s=n.querySelector("me-root"),i=s.offsetTop,r=s.offsetLeft,c=s.offsetWidth,a=s.offsetHeight;let d,f;return t.alignment==="root"?(d=e.offsetWidth/2-r-c/2,f=e.offsetHeight/2-i-a/2,n.style.transformOrigin=`${r+c/2}px 50%`):(d=(e.offsetWidth-o.offsetWidth)/2,f=(e.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:d,dy:f}},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:te,disableEdit:se,enableEdit:oe,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":"",_t(t),n.expanded){const u=this.createChildren(n.children.map(m=>this.createWrapper(m).grp));i.parentNode.appendChild(u)}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},d=s.x-a.x,f=s.y-a.y;this.move(d,f),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};ct(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:ne,getDataString:ee,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:ce,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)),nt(this.nodeData),this.layout(),this.linkDiv()},scale:ie,scaleFit:re,scrollIntoView:Kt,selectNode:Jt,selectNodes:Qt,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=bt(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate(${n}px, ${o}px) scale(${this.scaleVal})`},unselectNodes:Zt},Symbol.toStringTag,{value:"Module"})),vt={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=dt([{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}}}},ae="#4dc4ff";function xt(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 de(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),X(t))}function q(t,e,n,o,s){E(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function Ct(t,e,n,o,s,i,r,c,a,d){const f=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;if(t.line.setAttribute("d",f),d.style){const p=d.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 u=t.querySelectorAll('path[stroke="transparent"]');u.length>0&&u[0].setAttribute("d",f);const m=Y(i,r,c,a);if(m){const p=`M ${m.x1} ${m.y1} L ${c} ${a} L ${m.x2} ${m.y2}`;if(t.arrow1.setAttribute("d",p),u.length>1&&u[1].setAttribute("d",p),d.style){const l=d.style;l.stroke&&t.arrow1.setAttribute("stroke",l.stroke),l.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(l.strokeWidth)),l.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",l.strokeLinecap),l.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(l.opacity))}}if(d.bidirectional){const p=Y(o,s,e,n);if(p){const l=`M ${p.x1} ${p.y1} L ${e} ${n} L ${p.x2} ${p.y2}`;if(t.arrow2.setAttribute("d",l),u.length>2&&u[2].setAttribute("d",l),d.style){const h=d.style;h.stroke&&t.arrow2.setAttribute("stroke",h.stroke),h.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(h.strokeWidth)),h.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",h.strokeLinecap),h.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(h.opacity))}}}const{x:w,y:g}=xt(e,n,o,s,i,r,c,a);if(t.labelEl&&de(t.labelEl,w,g),d.style?.labelColor){const p=t.labelEl;p&&(p.style.color=d.style.labelColor)}we(t)}function _(t,e,n){const{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,a=s+r/2,d=c+n.x,f=a+n.y;return{w:i,h:r,cx:c,cy:a,ctrlX:d,ctrlY:f}}function B(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 st=function(t,e,n,o,s){if(!e||!n)return;const i=_(t,e,o.delta1),r=_(t,n,o.delta2),{x:c,y:a}=B(i),{ctrlX:d,ctrlY:f}=i,{ctrlX:u,ctrlY:m}=r,{x:w,y:g}=B(r),p=Y(u,m,w,g);if(!p)return;const l=`M ${p.x1} ${p.y1} L ${w} ${g} L ${p.x2} ${p.y2}`;let h="";if(o.bidirectional){const $=Y(d,f,c,a);if(!$)return;h=`M ${$.x1} ${$.y1} L ${c} ${a} L ${$.x2} ${$.y2}`}const y=zt(`M ${c} ${a} C ${d} ${f} ${u} ${m} ${w} ${g}`,l,h,o.style),{x:v,y:C}=xt(c,a,d,f,u,m,w,g),b=o.style?.labelColor||"rgb(235, 95, 82)",S="arrow-"+o.id;y.id=S;const x=t.markdown?t.markdown(o.label,o):o.label,T=ot(x,v,C,{anchor:"middle",color:b,dataType:"arrow",svgId:S});y.labelEl=T,y.arrowObj=o,y.dataset.linkid=o.id,t.labelContainer.appendChild(T),t.linkSvgGroup.appendChild(y),X(T),s||(t.arrows.push(o),t.currentArrow=y,St(t,o,i,r))},he=function(t,e,n={}){const o={id:O(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,delta1:{x:t.offsetWidth/2+100,y:0},delta2:{x:e.offsetWidth/2+100,y:0},...n};st(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},fe=function(t){U(this);const e={...t,id:O()};st(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},ue=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;U(this);const n=e.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),e.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},pe=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=_(this,n,e.delta1),i=_(this,o,e.delta2);St(this,e,s,i)},ge=function(){U(this),this.currentArrow=null},it=function(t,e){const n=document.createElementNS(D,"path");return E(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},me=function(t,e){const n=document.createElementNS(D,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=it(t.line.getAttribute("d"),e);n.appendChild(o);const s=it(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=it(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},ye=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},we=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"))},U=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&&ye(t.currentArrow)},St=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:a,nodes:d,map:f,currentArrow:u,bus:m}=t;if(!u)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",d.appendChild(s),d.appendChild(i),d.appendChild(r),me(u,ae);let{x:w,y:g}=B(n),{ctrlX:p,ctrlY:l}=n,{ctrlX:h,ctrlY:y}=o,{x:v,y:C}=B(o);i.style.cssText=`top:${l}px;left:${p}px;`,r.style.cssText=`top:${y}px;left:${h}px;`,q(c,w,g,p,l),q(a,h,y,v,C),t.helper1=vt.create(i),t.helper2=vt.create(r),t.helper1.init(f,(b,S)=>{p=p+b/t.scaleVal,l=l+S/t.scaleVal;const x=B({...n,ctrlX:p,ctrlY:l});w=x.x,g=x.y,i.style.top=l+"px",i.style.left=p+"px",Ct(u,w,g,p,l,h,y,v,C,e),q(c,w,g,p,l),e.delta1.x=p-n.cx,e.delta1.y=l-n.cy,m.fire("updateArrowDelta",e)}),t.helper2.init(f,(b,S)=>{h=h+b/t.scaleVal,y=y+S/t.scaleVal;const x=B({...o,ctrlX:h,ctrlY:y});v=x.x,C=x.y,r.style.top=y+"px",r.style.left=h+"px",Ct(u,w,g,p,l,h,y,v,C,e),q(a,h,y,v,C),e.delta2.x=h-o.cx,e.delta2.y=y-o.cy,m.fire("updateArrowDelta",e)})};function be(){this.linkSvgGroup.innerHTML="";for(let t=0;t<this.arrows.length;t++){const e=this.arrows[t];try{st(this,this.findEle(e.from),this.findEle(e.to),e,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function ve(t){U(this),t&&t.labelEl&&yt(this,t.labelEl,t.arrowObj)}function xe(){this.arrows=this.arrows.filter(t=>R(t.from,this.nodeData)&&R(t.to,this.nodeData))}const Ce=Object.freeze(Object.defineProperty({__proto__:null,createArrow:he,createArrowFrom:fe,editArrowLabel:ve,removeArrow:ue,renderArrow:be,selectArrow:pe,tidyArrow:xe,unselectArrow:ge},Symbol.toStringTag,{value:"Module"})),Se=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const a=t[0].nodeObj,d=t[0].nodeObj.parent;if(!d)throw new Error("Can not select root node.");const f=d.children.findIndex(u=>a===u);return{parent:d.id,start:f,end:f}}let e=0;const n=t.map(a=>{let d=a.nodeObj;const f=[];for(;d.parent;){const u=d.parent,w=u.children?.indexOf(d);d=u,f.unshift({node:d,index:w})}return f.length>e&&(e=f.length),f});let o=0;t:for(;o<e;o++){const a=n[0][o]?.node;for(let d=1;d<n.length;d++)if(n[d][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}},Ee=function(t){const e=document.createElementNS(D,"g");return e.setAttribute("id",t),e},Et=function(t,e){const n=document.createElementNS(D,"path");return E(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},ke=t=>t.parentElement.parentElement,Le=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},rt=function(t,e){const{id:n,label:o,parent:s,start:i,end:r,style:c}=e,{nodes:a,theme:d,summarySvg:f}=t,m=t.findEle(s).nodeObj,w=Le(t,e);let g=1/0,p=0,l=0,h=0;for(let V=i;V<=r;V++){const kt=m.children?.[V];if(!kt)return t.removeSummary(n),null;const Q=ke(t.findEle(kt.id)),{offsetLeft:Z,offsetTop:Lt}=N(a,Q),Tt=i===r?10:20;V===i&&(l=Lt+Tt),V===r&&(h=Lt+Q.offsetHeight-Tt),Z<g&&(g=Z),Q.offsetWidth+Z>p&&(p=Q.offsetWidth+Z)}let y,v;const C=m.parent?10:0,b=l+C,S=h+C,x=(b+S)/2,T=c?.stroke||d.cssVar["--color"],$=c?.labelColor||d.cssVar["--color"],G="s-"+n,F=t.markdown?t.markdown(o,e):o;w===P.LHS?(y=Et(`M ${g+10} ${b} c -5 0 -10 5 -10 10 L ${g} ${S-10} c 0 5 5 10 10 10 M ${g} ${x} h -10`,T),v=ot(F,g-20,x,{anchor:"end",color:$,dataType:"summary",svgId:G})):(y=Et(`M ${p-10} ${b} c 5 0 10 5 10 10 L ${p} ${S-10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`,T),v=ot(F,p+20,x,{anchor:"start",color:$,dataType:"summary",svgId:G}));const z=Ee(G);return z.appendChild(y),t.labelContainer.appendChild(v),X(v),z.summaryObj=e,z.labelEl=v,f.appendChild(z),z},Te=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}=Se(e),c={id:O(),parent:s,start:i,end:r,label:"summary",style:t.style},a=rt(this,c);n.push(c),this.editSummary(a),o.fire("operation",{name:"createSummary",obj:c})},createSummaryFrom:function(t){const e=O(),n={...t,id:e};rt(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelEl&&yt(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{rt(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"})),L="http://www.w3.org/2000/svg";function $e(t,e){const n=document.createElementNS(L,"svg");return E(n,{version:"1.1",xmlns:L,height:t,width:e}),n}function De(t,e){return(parseInt(t)-parseInt(e))/2}function Ae(t,e,n,o){const s=document.createElementNS(L,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
16
- `).forEach((c,a)=>{const d=document.createElementNS(L,"text");E(d,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+De(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}`}),d.innerHTML=c,s.appendChild(d)}),s}function Ne(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(L,"foreignObject");E(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return E(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 Me(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(L,"rect");return E(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 K(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=N(t.nodes,e),r=document.createElementNS(L,"rect");E(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(L,"g");c.appendChild(r);let a;return n?a=Ne(e,o,s,i):a=Ae(e,o,s,i),c.appendChild(a),c}function Pe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(L,"a"),r=document.createElementNS(L,"text");return E(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 He(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(L,"image");return E(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const J=100,Be='<?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">',Ie=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+J*2,s=n.offsetWidth+J*2,i=$e(o+"px",s+"px"),r=document.createElementNS(L,"svg"),c=document.createElementNS(L,"rect");E(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(u=>{const m=u.cloneNode(!0),{offsetLeft:w,offsetTop:g}=N(n,u.parentElement);m.setAttribute("x",`${w}`),m.setAttribute("y",`${g}`),r.appendChild(m)});const a=n.querySelector(".lines")?.cloneNode(!0);a&&r.appendChild(a);const d=n.querySelector(".topiclinks")?.cloneNode(!0);d&&r.appendChild(d);const f=n.querySelector(".summary")?.cloneNode(!0);return f&&r.appendChild(f),n.querySelectorAll("me-tpc").forEach(u=>{u.nodeObj.dangerouslySetInnerHTML?r.appendChild(K(t,u,!e)):(r.appendChild(Me(t,u)),r.appendChild(K(t,u.text,!e)))}),n.querySelectorAll(".tags > span").forEach(u=>{r.appendChild(K(t,u))}),n.querySelectorAll(".icons > span").forEach(u=>{r.appendChild(K(t,u))}),n.querySelectorAll(".hyper-link").forEach(u=>{r.appendChild(Pe(t,u))}),n.querySelectorAll("img").forEach(u=>{r.appendChild(He(t,u))}),E(r,{x:J+"",y:J+"",overflow:"visible"}),i.appendChild(r),i},Oe=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Be+t.outerHTML);function We(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 Ge={getObjById:R,generateNewObj:Dt,layout:Mt,linkDiv:Vt,editTopic:Gt,createWrapper:Bt,createParent:It,createChildren:Ot,createTopic:Wt,findEle:ft,changeTheme:qt,...le,...{},...Ce,...Te,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await We(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=Ie(this,t),o=Oe(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,nt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Xt(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 Fe({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,containerHeight:d}){let f=e+n/2;const u=t+o/2;let m;a===P.LHS?m=i+r:m=i;const w=s+c/2,p=(1-Math.abs(w-u)/d)*.25*(n/2);return a===P.LHS?f=f-n/10-p:f=f+n/10+p,`M ${f} ${u} Q ${f} ${w} ${m} ${w}`}function ze({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,isFirst:d}){const f=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let u=0,m=0;d?u=t+o/2:u=t+o;const w=s+c;let g=0,p=0,l=0;const h=Math.abs(u-w)/300*f;return a===P.LHS?(l=e,g=l+f,p=l-f,m=i+f,`M ${g} ${u} C ${l} ${u} ${l+h} ${w} ${p} ${w} H ${m}`):(l=e+n,g=l-f,p=l+f,m=i+r-f,`M ${g} ${u} C ${l} ${u} ${l-h} ${w} ${p} ${w} H ${m}`)}const Ve="5.3.4";function Re(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 I=document;function A({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:c,mouseSelectionButton:a,selectionContainer:d,before:f,newTopicName:u,allowUndo:m,generateMainBranch:w,generateSubBranch:g,overflowHidden:p,theme:l,alignment:h,scaleSensitivity:y,scaleMax:v,scaleMin:C,handleWheel:b,markdown:S,imageProxy:x}){let T=null;const $=Object.prototype.toString.call(t);if($==="[object HTMLDivElement]"?T=t:$==="[object String]"&&(T=document.querySelector(t)),!T)throw new Error("MindElixir: el is not a valid element");T.style.position="relative",T.innerHTML="",this.el=T,this.disposable=[],this.before=f||{},this.locale=n||"en",this.newTopicName=u||"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=m??!0,this.scaleSensitivity=y??.1,this.scaleMax=v??1.4,this.scaleMin=C??.2,this.generateMainBranch=w||Fe,this.generateSubBranch=g||ze,this.overflowHidden=p??!1,this.alignment=h??"root",this.handleWheel=b??!0,this.markdown=S||void 0,this.imageProxy=x||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=Re(this),this.bus=Nt(),this.container=I.createElement("div"),this.selectionContainer=d||this.container,this.container.className="map-container";const G=window.matchMedia("(prefers-color-scheme: dark)");this.theme=l||(G.matches?et:tt);const F=I.createElement("div");F.className="map-canvas",this.map=F,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=I.createElement("me-nodes"),this.lines=W("lines"),this.summarySvg=W("summary"),this.linkController=W("linkcontroller"),this.P2=I.createElement("div"),this.P3=I.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=mt(),this.line2=mt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=W("topiclinks"),this.labelContainer=I.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(At(this))}return A.prototype=Ge,Object.defineProperty(A.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),A.LEFT=0,A.RIGHT=1,A.SIDE=2,A.THEME=tt,A.DARK_THEME=et,A.version=Ve,A.E=ft,A})();
15
+ `,pt(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,X(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Vt=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],d=a.querySelector("me-tpc"),{offsetLeft:f,offsetTop:u}=N(this.nodes,d),m=d.offsetWidth,w=d.offsetHeight,g=a.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:u,cL:f,cW:m,cH:w,direction:g,containerHeight:this.nodes.offsetHeight}),l=this.theme.palette,h=d.nodeObj.branchColor||l[c%l.length];if(d.style.borderColor=h,this.lines.appendChild(gt(p,h,"3")),t&&t!==a)continue;const y=W("subLines"),v=a.lastChild;v.tagName==="svg"&&v.remove(),a.appendChild(y),wt(this,y,h,a,g,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},wt=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,d=r.offsetLeft,f=r.offsetWidth,u=r.offsetHeight;for(let m=0;m<c.length;m++){const w=c[m],g=w.firstChild,p=g.offsetTop,l=g.offsetLeft,h=g.offsetWidth,y=g.offsetHeight,v=g.firstChild.nodeObj.branchColor||n,C=t.generateSubBranch({pT:a,pL:d,pW:f,pH:u,cT:p,cL:l,cW:h,cH:y,direction:s,isFirst:i});e.appendChild(gt(C,v,"2"));const b=g.children[1];if(b){if(!b.expanded)continue}else continue;wt(t,e,v,w,s)}},Rt={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>'},M=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=Rt[e],n};function Yt(t){const e=document.createElement("div"),n=M("fullscreen","full"),o=M("toCenter","living"),s=M("zoomout","zoomout"),i=M("zoomin","zoomin"),r=document.createElement("span");return r.innerText="100%",e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===t.el?document.exitFullscreen():t.el.requestFullscreen()},o.onclick=()=>{t.toCenter()},s.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},i.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function jt(t){const e=document.createElement("div"),n=M("tbltl","left"),o=M("tbltr","right"),s=M("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 Xt(t){t.container.append(Yt(t)),t.container.append(jt(t))}const qt=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?et:tt).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()},_t=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function Ut(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const Kt=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom||n.bottom<o.top||n.left>o.right||n.right<o.left){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,d=i-c,f=r-a;this.move(-d,-f,!0)}},Jt=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},Qt=function(t){this.selection.select(t)},Zt=function(t){this.selection.deselect(t)},te=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},ee=function(){const t=Ut(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ne=function(){return JSON.parse(this.getDataString())},oe=function(){this.editable=!0},se=function(){this.editable=!1},ie=function(t,e={x:0,y:0}){if(t<this.scaleMin||t>this.scaleMax)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}=bt(this),c=this.map.style.transform,{x:a,y:d}=at(c),f=a-i,u=d-r,m=this.scaleVal,w=(-o+f)*(1-t/m),g=(-s+u)*(1-t/m);this.map.style.transform=`translate(${a-w}px, ${d-g}px) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},re=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,this.map.style.transform="scale("+n+")",this.bus.fire("scale",n)},ce=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i}=this,r=o.style.transform;let{x:c,y:a}=at(r);c+=t,a+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate(${c}px, ${a}px) scale(${s})`,i.fire("move",{dx:t,dy:e})},bt=t=>{const{container:e,map:n,nodes:o}=t,s=n.querySelector("me-root"),i=s.offsetTop,r=s.offsetLeft,c=s.offsetWidth,a=s.offsetHeight;let d,f;return t.alignment==="root"?(d=e.offsetWidth/2-r-c/2,f=e.offsetHeight/2-i-a/2,n.style.transformOrigin=`${r+c/2}px 50%`):(d=(e.offsetWidth-o.offsetWidth)/2,f=(e.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:d,dy:f}},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:te,disableEdit:se,enableEdit:oe,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":"",_t(t),n.expanded){const u=this.createChildren(n.children.map(m=>this.createWrapper(m).grp));i.parentNode.appendChild(u)}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},d=s.x-a.x,f=s.y-a.y;this.move(d,f),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};ct(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:ne,getDataString:ee,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:ce,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)),nt(this.nodeData),this.layout(),this.linkDiv()},scale:ie,scaleFit:re,scrollIntoView:Kt,selectNode:Jt,selectNodes:Qt,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=bt(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate(${n}px, ${o}px) scale(${this.scaleVal})`},unselectNodes:Zt},Symbol.toStringTag,{value:"Module"})),vt={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=dt([{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}}}},ae="#4dc4ff";function xt(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 de(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),X(t))}function q(t,e,n,o,s){E(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function Ct(t,e,n,o,s,i,r,c,a,d){const f=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;if(t.line.setAttribute("d",f),d.style){const p=d.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 u=t.querySelectorAll('path[stroke="transparent"]');u.length>0&&u[0].setAttribute("d",f);const m=Y(i,r,c,a);if(m){const p=`M ${m.x1} ${m.y1} L ${c} ${a} L ${m.x2} ${m.y2}`;if(t.arrow1.setAttribute("d",p),u.length>1&&u[1].setAttribute("d",p),d.style){const l=d.style;l.stroke&&t.arrow1.setAttribute("stroke",l.stroke),l.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(l.strokeWidth)),l.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",l.strokeLinecap),l.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(l.opacity))}}if(d.bidirectional){const p=Y(o,s,e,n);if(p){const l=`M ${p.x1} ${p.y1} L ${e} ${n} L ${p.x2} ${p.y2}`;if(t.arrow2.setAttribute("d",l),u.length>2&&u[2].setAttribute("d",l),d.style){const h=d.style;h.stroke&&t.arrow2.setAttribute("stroke",h.stroke),h.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(h.strokeWidth)),h.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",h.strokeLinecap),h.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(h.opacity))}}}const{x:w,y:g}=xt(e,n,o,s,i,r,c,a);if(t.labelEl&&de(t.labelEl,w,g),d.style?.labelColor){const p=t.labelEl;p&&(p.style.color=d.style.labelColor)}we(t)}function _(t,e,n){const{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,a=s+r/2,d=c+n.x,f=a+n.y;return{w:i,h:r,cx:c,cy:a,ctrlX:d,ctrlY:f}}function B(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 st=function(t,e,n,o,s){if(!e||!n)return;const i=_(t,e,o.delta1),r=_(t,n,o.delta2),{x:c,y:a}=B(i),{ctrlX:d,ctrlY:f}=i,{ctrlX:u,ctrlY:m}=r,{x:w,y:g}=B(r),p=Y(u,m,w,g);if(!p)return;const l=`M ${p.x1} ${p.y1} L ${w} ${g} L ${p.x2} ${p.y2}`;let h="";if(o.bidirectional){const $=Y(d,f,c,a);if(!$)return;h=`M ${$.x1} ${$.y1} L ${c} ${a} L ${$.x2} ${$.y2}`}const y=zt(`M ${c} ${a} C ${d} ${f} ${u} ${m} ${w} ${g}`,l,h,o.style),{x:v,y:C}=xt(c,a,d,f,u,m,w,g),b=o.style?.labelColor||"rgb(235, 95, 82)",S="arrow-"+o.id;y.id=S;const x=t.markdown?t.markdown(o.label,o):o.label,T=ot(x,v,C,{anchor:"middle",color:b,dataType:"arrow",svgId:S});y.labelEl=T,y.arrowObj=o,y.dataset.linkid=o.id,t.labelContainer.appendChild(T),t.linkSvgGroup.appendChild(y),X(T),s||(t.arrows.push(o),t.currentArrow=y,St(t,o,i,r))},he=function(t,e,n={}){const o={id:O(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,delta1:{x:t.offsetWidth/2+100,y:0},delta2:{x:e.offsetWidth/2+100,y:0},...n};st(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},fe=function(t){U(this);const e={...t,id:O()};st(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},ue=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;U(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}})},pe=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=_(this,n,e.delta1),i=_(this,o,e.delta2);St(this,e,s,i)},ge=function(){U(this),this.currentArrow=null},it=function(t,e){const n=document.createElementNS(A,"path");return E(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},me=function(t,e){const n=document.createElementNS(A,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=it(t.line.getAttribute("d"),e);n.appendChild(o);const s=it(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=it(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},ye=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},we=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"))},U=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&&ye(t.currentArrow)},St=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:a,nodes:d,map:f,currentArrow:u,bus:m}=t;if(!u)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",d.appendChild(s),d.appendChild(i),d.appendChild(r),me(u,ae);let{x:w,y:g}=B(n),{ctrlX:p,ctrlY:l}=n,{ctrlX:h,ctrlY:y}=o,{x:v,y:C}=B(o);i.style.cssText=`top:${l}px;left:${p}px;`,r.style.cssText=`top:${y}px;left:${h}px;`,q(c,w,g,p,l),q(a,h,y,v,C),t.helper1=vt.create(i),t.helper2=vt.create(r),t.helper1.init(f,(b,S)=>{p=p+b/t.scaleVal,l=l+S/t.scaleVal;const x=B({...n,ctrlX:p,ctrlY:l});w=x.x,g=x.y,i.style.top=l+"px",i.style.left=p+"px",Ct(u,w,g,p,l,h,y,v,C,e),q(c,w,g,p,l),e.delta1.x=p-n.cx,e.delta1.y=l-n.cy,m.fire("updateArrowDelta",e)}),t.helper2.init(f,(b,S)=>{h=h+b/t.scaleVal,y=y+S/t.scaleVal;const x=B({...o,ctrlX:h,ctrlY:y});v=x.x,C=x.y,r.style.top=y+"px",r.style.left=h+"px",Ct(u,w,g,p,l,h,y,v,C,e),q(a,h,y,v,C),e.delta2.x=h-o.cx,e.delta2.y=y-o.cy,m.fire("updateArrowDelta",e)})};function be(){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{st(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function ve(t){U(this),t&&t.labelEl&&yt(this,t.labelEl,t.arrowObj)}function xe(){this.arrows=this.arrows.filter(t=>R(t.from,this.nodeData)&&R(t.to,this.nodeData))}const Ce=Object.freeze(Object.defineProperty({__proto__:null,createArrow:he,createArrowFrom:fe,editArrowLabel:ve,removeArrow:ue,renderArrow:be,selectArrow:pe,tidyArrow:xe,unselectArrow:ge},Symbol.toStringTag,{value:"Module"})),Se=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const a=t[0].nodeObj,d=t[0].nodeObj.parent;if(!d)throw new Error("Can not select root node.");const f=d.children.findIndex(u=>a===u);return{parent:d.id,start:f,end:f}}let e=0;const n=t.map(a=>{let d=a.nodeObj;const f=[];for(;d.parent;){const u=d.parent,w=u.children?.indexOf(d);d=u,f.unshift({node:d,index:w})}return f.length>e&&(e=f.length),f});let o=0;t:for(;o<e;o++){const a=n[0][o]?.node;for(let d=1;d<n.length;d++)if(n[d][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}},Ee=function(t){const e=document.createElementNS(A,"g");return e.setAttribute("id",t),e},Et=function(t,e){const n=document.createElementNS(A,"path");return E(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Le=t=>t.parentElement.parentElement,ke=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},rt=function(t,e){const{id:n,label:o,parent:s,start:i,end:r,style:c}=e,{nodes:a,theme:d,summarySvg:f}=t,m=t.findEle(s).nodeObj,w=ke(t,e);let g=1/0,p=0,l=0,h=0;for(let V=i;V<=r;V++){const Lt=m.children?.[V];if(!Lt)return t.removeSummary(n),null;const Q=Le(t.findEle(Lt.id)),{offsetLeft:Z,offsetTop:kt}=N(a,Q),Tt=i===r?10:20;V===i&&(l=kt+Tt),V===r&&(h=kt+Q.offsetHeight-Tt),Z<g&&(g=Z),Q.offsetWidth+Z>p&&(p=Q.offsetWidth+Z)}let y,v;const C=m.parent?10:0,b=l+C,S=h+C,x=(b+S)/2,T=c?.stroke||d.cssVar["--color"],$=c?.labelColor||d.cssVar["--color"],G="s-"+n,F=t.markdown?t.markdown(o,e):o;w===P.LHS?(y=Et(`M ${g+10} ${b} c -5 0 -10 5 -10 10 L ${g} ${S-10} c 0 5 5 10 10 10 M ${g} ${x} h -10`,T),v=ot(F,g-20,x,{anchor:"end",color:$,dataType:"summary",svgId:G})):(y=Et(`M ${p-10} ${b} c 5 0 10 5 10 10 L ${p} ${S-10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`,T),v=ot(F,p+20,x,{anchor:"start",color:$,dataType:"summary",svgId:G}));const z=Ee(G);return z.appendChild(y),t.labelContainer.appendChild(v),X(v),z.summaryObj=e,z.labelEl=v,f.appendChild(z),z},Te=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}=Se(e),c={id:O(),parent:s,start:i,end:r,label:"summary",style:t.style},a=rt(this,c);n.push(c),this.editSummary(a),o.fire("operation",{name:"createSummary",obj:c})},createSummaryFrom:function(t){const e=O(),n={...t,id:e};rt(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelEl&&yt(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{rt(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"})),k="http://www.w3.org/2000/svg";function $e(t,e){const n=document.createElementNS(k,"svg");return E(n,{version:"1.1",xmlns:k,height:t,width:e}),n}function Ae(t,e){return(parseInt(t)-parseInt(e))/2}function De(t,e,n,o){const s=document.createElementNS(k,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
16
+ `).forEach((c,a)=>{const d=document.createElementNS(k,"text");E(d,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Ae(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}`}),d.innerHTML=c,s.appendChild(d)}),s}function Ne(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(k,"foreignObject");E(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return E(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 Me(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(k,"rect");return E(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 K(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=N(t.nodes,e),r=document.createElementNS(k,"rect");E(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(k,"g");c.appendChild(r);let a;return n?a=Ne(e,o,s,i):a=De(e,o,s,i),c.appendChild(a),c}function Pe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(k,"a"),r=document.createElementNS(k,"text");return E(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 He(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(k,"image");return E(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const J=100,Be='<?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">',Ie=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+J*2,s=n.offsetWidth+J*2,i=$e(o+"px",s+"px"),r=document.createElementNS(k,"svg"),c=document.createElementNS(k,"rect");E(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(u=>{const m=u.cloneNode(!0),{offsetLeft:w,offsetTop:g}=N(n,u.parentElement);m.setAttribute("x",`${w}`),m.setAttribute("y",`${g}`),r.appendChild(m)});const a=n.querySelector(".lines")?.cloneNode(!0);a&&r.appendChild(a);const d=n.querySelector(".topiclinks")?.cloneNode(!0);d&&r.appendChild(d);const f=n.querySelector(".summary")?.cloneNode(!0);return f&&r.appendChild(f),n.querySelectorAll("me-tpc").forEach(u=>{u.nodeObj.dangerouslySetInnerHTML?r.appendChild(K(t,u,!e)):(r.appendChild(Me(t,u)),r.appendChild(K(t,u.text,!e)))}),n.querySelectorAll(".tags > span").forEach(u=>{r.appendChild(K(t,u))}),n.querySelectorAll(".icons > span").forEach(u=>{r.appendChild(K(t,u))}),n.querySelectorAll(".hyper-link").forEach(u=>{r.appendChild(Pe(t,u))}),n.querySelectorAll("img").forEach(u=>{r.appendChild(He(t,u))}),E(r,{x:J+"",y:J+"",overflow:"visible"}),i.appendChild(r),i},Oe=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Be+t.outerHTML);function We(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 Ge={getObjById:R,generateNewObj:At,layout:Mt,linkDiv:Vt,editTopic:Gt,createWrapper:Bt,createParent:It,createChildren:Ot,createTopic:Wt,findEle:ft,changeTheme:qt,...le,...{},...Ce,...Te,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await We(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=Ie(this,t),o=Oe(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,nt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Xt(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 Fe({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,containerHeight:d}){let f=e+n/2;const u=t+o/2;let m;a===P.LHS?m=i+r:m=i;const w=s+c/2,p=(1-Math.abs(w-u)/d)*.25*(n/2);return a===P.LHS?f=f-n/10-p:f=f+n/10+p,`M ${f} ${u} Q ${f} ${w} ${m} ${w}`}function ze({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,isFirst:d}){const f=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let u=0,m=0;d?u=t+o/2:u=t+o;const w=s+c;let g=0,p=0,l=0;const h=Math.abs(u-w)/300*f;return a===P.LHS?(l=e,g=l+f,p=l-f,m=i+f,`M ${g} ${u} C ${l} ${u} ${l+h} ${w} ${p} ${w} H ${m}`):(l=e+n,g=l-f,p=l+f,m=i+r-f,`M ${g} ${u} C ${l} ${u} ${l-h} ${w} ${p} ${w} H ${m}`)}const Ve="5.3.6";function Re(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 I=document;function D({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:c,mouseSelectionButton:a,selectionContainer:d,before:f,newTopicName:u,allowUndo:m,generateMainBranch:w,generateSubBranch:g,overflowHidden:p,theme:l,alignment:h,scaleSensitivity:y,scaleMax:v,scaleMin:C,handleWheel:b,markdown:S,imageProxy:x}){let T=null;const $=Object.prototype.toString.call(t);if($==="[object HTMLDivElement]"?T=t:$==="[object String]"&&(T=document.querySelector(t)),!T)throw new Error("MindElixir: el is not a valid element");T.style.position="relative",T.innerHTML="",this.el=T,this.disposable=[],this.before=f||{},this.locale=n||"en",this.newTopicName=u||"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=m??!0,this.scaleSensitivity=y??.1,this.scaleMax=v??1.4,this.scaleMin=C??.2,this.generateMainBranch=w||Fe,this.generateSubBranch=g||ze,this.overflowHidden=p??!1,this.alignment=h??"root",this.handleWheel=b??!0,this.markdown=S||void 0,this.imageProxy=x||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=Re(this),this.bus=Nt(),this.container=I.createElement("div"),this.selectionContainer=d||this.container,this.container.className="map-container";const G=window.matchMedia("(prefers-color-scheme: dark)");this.theme=l||(G.matches?et:tt);const F=I.createElement("div");F.className="map-canvas",this.map=F,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=I.createElement("me-nodes"),this.lines=W("lines"),this.summarySvg=W("summary"),this.linkController=W("linkcontroller"),this.P2=I.createElement("div"),this.P3=I.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=mt(),this.line2=mt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=W("topiclinks"),this.labelContainer=I.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Dt(this))}return D.prototype=Ge,Object.defineProperty(D.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),D.LEFT=0,D.RIGHT=1,D.SIDE=2,D.THEME=tt,D.DARK_THEME=et,D.version=Ve,D.E=ft,D})();
@@ -224,7 +224,7 @@ function At(t) {
224
224
  l.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
225
225
  }, a = (l) => {
226
226
  e.moved = !1;
227
- const d = t.spacePressed && l.button === 0 && l.pointerType === "mouse", y = t.mouseSelectionButton === 0 ? 2 : 0, v = l.button === y && l.pointerType === "mouse";
227
+ const d = t.spacePressed && l.button === 0 && l.pointerType === "mouse", y = t.mouseSelectionButton === 0 ? 2 : 0, v = l.button === y && l.pointerType === "mouse" || l.pointerType === "touch";
228
228
  if (!d && !v) return;
229
229
  e.x = l.clientX, e.y = l.clientY;
230
230
  const C = l.target;
@@ -867,7 +867,7 @@ const it = function(t, e, n, o, s) {
867
867
  if (t ? e = t : e = this.currentArrow, !e) return;
868
868
  Z(this);
869
869
  const n = e.arrowObj.id;
870
- this.arrows = this.arrows.filter((o) => o.id !== n), e.remove(), this.bus.fire("operation", {
870
+ this.arrows = this.arrows.filter((o) => o.id !== n), e.labelEl?.remove(), e.remove(), this.bus.fire("operation", {
871
871
  name: "removeArrow",
872
872
  obj: {
873
873
  id: n
@@ -926,11 +926,11 @@ const it = function(t, e, n, o, s) {
926
926
  });
927
927
  };
928
928
  function Oe() {
929
- this.linkSvgGroup.innerHTML = "";
930
- for (let t = 0; t < this.arrows.length; t++) {
931
- const e = this.arrows[t];
929
+ this.linkSvgGroup.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((e) => e.remove());
930
+ for (let e = 0; e < this.arrows.length; e++) {
931
+ const n = this.arrows[e];
932
932
  try {
933
- it(this, this.findEle(e.from), this.findEle(e.to), e, !0);
933
+ it(this, this.findEle(n.from), this.findEle(n.to), n, !0);
934
934
  } catch {
935
935
  }
936
936
  }
@@ -1263,7 +1263,7 @@ function wn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
1263
1263
  const d = Math.abs(p - w) / 300 * f;
1264
1264
  return a === I.LHS ? (l = e, g = l + f, u = l - f, m = i + f, `M ${g} ${p} C ${l} ${p} ${l + d} ${w} ${u} ${w} H ${m}`) : (l = e + n, g = l - f, u = l + f, m = i + r - f, `M ${g} ${p} C ${l} ${p} ${l - d} ${w} ${u} ${w} H ${m}`);
1265
1265
  }
1266
- const bn = "5.3.4";
1266
+ const bn = "5.3.6";
1267
1267
  function vn(t) {
1268
1268
  return {
1269
1269
  x: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mind-elixir",
3
- "version": "5.3.4",
3
+ "version": "5.3.6",
4
4
  "type": "module",
5
5
  "description": "Mind elixir is a free open source mind map core.",
6
6
  "keywords": [