mind-elixir 5.2.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var MindElixirLite=function(){"use strict";const Je="",Qe="",Z={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"}},tt={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},et=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)et(t.children[n],t)},nt=(t,e,n)=>{if(t.expanded=e,t.children)if(n===void 0||n>0){const o=n!==void 0?n-1:void 0;t.children.forEach(s=>{nt(s,e,o)})}else t.children.forEach(o=>{nt(o,!1)})};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,h=r+a,u=r-a;return{x1:n+Math.cos(Math.PI*h/180)*c,y1:o-Math.sin(Math.PI*h/180)*c,x2:n+Math.cos(Math.PI*u/180)*c,y2:o-Math.sin(Math.PI*u/180)*c}}function W(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const At=function(){const t=W();return{topic:this.newTopicName,id:t}},D=(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])},ct=t=>t?t.tagName==="ME-TPC":!1,lt=t=>{const e=/translate\(([^,]+),\s*([^)]+)\)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},at=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)}}};var P=(t=>(t.LHS="lhs",t.RHS="rhs",t))(P||{});const dt=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 Nt(t){const{dragMoveHelper:e}=t;let n=0;t.spacePressed=!1;const o=l=>{var v,C;if(l.button!==0)return;if((v=t.helper1)!=null&&v.moved){t.helper1.clear();return}if((C=t.helper2)!=null&&C.moved){t.helper2.clear();return}if(e.moved){e.clear();return}const d=l.target;if(d.tagName==="ME-EPD")l.ctrlKey||l.metaKey?t.expandNodeAll(d.previousSibling):t.expandNode(d.previousSibling);else if(d.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(d);else if(!t.editable)return;if(d.classList.contains("svg-label")){const x=d.dataset.svgId,S=d.dataset.type,L=document.getElementById(x);if(L){if(S==="arrow"){t.selectArrow(L);return}else if(S==="summary"){t.selectSummary(L);return}}}if(d.closest(".topiclinks")){const x=d.closest("g");if(x){t.selectArrow(x);return}}if(d.closest(".summary")){const x=d.closest("g");if(x){t.selectSummary(x);return}}},s=l=>{if(!t.editable)return;const d=l.target;if(ct(d)&&t.beginEdit(d),d.classList.contains("svg-label")){const v=d.dataset.svgId,C=d.dataset.type,x=document.getElementById(v);if(x){if(C==="arrow"){t.editArrowLabel(x);return}else if(C==="summary"){t.editSummary(x);return}}}if(d.closest(".topiclinks")){const v=d.closest("g");if(v){t.editArrowLabel(v);return}}if(d.closest(".summary")){const v=d.closest("g");if(v){t.editSummary(v);return}}},i=l=>{if(l.pointerType==="mouse")return;const d=new Date().getTime(),y=d-n;y<300&&y>0&&s(l),n=d},r=l=>{l.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"),l.preventDefault())},c=l=>{l.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))},a=l=>{e.moved=!1;const d=t.spacePressed&&l.button===0&&l.pointerType==="mouse",y=t.mouseSelectionButton===0?2:0,b=l.button===y&&l.pointerType==="mouse";if(!d&&!b)return;e.x=l.clientX,e.y=l.clientY;const v=l.target;(d||v.className!=="circle"&&v.contentEditable!=="plaintext-only")&&(e.mousedown=!0,v.setPointerCapture(l.pointerId))},h=l=>{if(l.target.contentEditable!=="plaintext-only"||t.spacePressed&&e.mousedown){const d=l.clientX-e.x,y=l.clientY-e.y;e.onMove(d,y)}e.x=l.clientX,e.y=l.clientY},u=l=>{if(!e.mousedown)return;const d=l.target;d.hasPointerCapture&&d.hasPointerCapture(l.pointerId)&&d.releasePointerCapture(l.pointerId),e.clear()},p=()=>{e.mousedown&&e.clear()},g=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const d=l.target;ct(d)&&!d.classList.contains("selected")&&t.selectNode(d),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",l)},200)},w=l=>{l.stopPropagation(),l.preventDefault(),l.ctrlKey||l.metaKey?l.deltaY<0?dt(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&dt(t,"out",t.dragMoveHelper):l.shiftKey?t.move(-l.deltaY,0):t.move(-l.deltaX,-l.deltaY)},{container:f}=t;return at([{dom:f,evt:"pointerdown",func:a},{dom:f,evt:"pointermove",func:h},{dom:f,evt:"pointerup",func:u},{dom:f,evt:"pointerup",func:i},{dom:f,evt:"click",func:o},{dom:f,evt:"dblclick",func:s},{dom:f,evt:"contextmenu",func:g},{dom:f,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:w},{dom:f,evt:"blur",func:p},{dom:document,evt:"keydown",func:r},{dom:document,evt:"keyup",func:c}])}function Dt(){return{handlers:{},addListener:function(t,e){this.handlers[t]===void 0&&(this.handlers[t]=[]),this.handlers[t].push(e)},fire:function(t,...e){if(this.handlers[t]instanceof Array){const n=this.handlers[t];for(let o=0;o<n.length;o++)n[o](...e)}},removeListener:function(t,e){if(!this.handlers[t])return;const n=this.handlers[t];if(!e)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===e&&this.handlers[t].splice(o,1)}}}const z=document,Mt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);ft.call(this,t,this.nodeData),t.draggable=!1;const e=z.createElement("me-root");e.appendChild(t);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}Pt(this,n,e)},Pt=function(t,e,n){const o=z.createElement("me-main");o.className=P.LHS;const s=z.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=z.createElement("me-children");for(let o=0;o<e.length;o++){const s=e[o],{grp:i}=t.createWrapper(s);n.appendChild(i)}return n},k=document,ht=function(t,e){const o=(this!=null&&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},ft=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 ft.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 ut(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}=D(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 Je="",Qe="",Z={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"}},tt={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},et=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)et(t.children[n],t)},nt=(t,e,n)=>{if(t.expanded=e,t.children)if(n===void 0||n>0){const o=n!==void 0?n-1:void 0;t.children.forEach(s=>{nt(s,e,o)})}else t.children.forEach(o=>{nt(o,!1)})};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,u=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*u/180)*c,y2:o-Math.sin(Math.PI*u/180)*c}}function W(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const Dt=function(){const t=W();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])},ct=t=>t?t.tagName==="ME-TPC":!1,lt=t=>{const e=/translate\(([^,]+),\s*([^)]+)\)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},at=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)}}},H={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=>{var v,C;if(l.button!==0)return;if((v=t.helper1)!=null&&v.moved){t.helper1.clear();return}if((C=t.helper2)!=null&&C.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;if(h.classList.contains("svg-label")){const x=h.dataset.svgId,S=h.dataset.type,L=document.getElementById(x);if(L){if(S==="arrow"){t.selectArrow(L);return}else if(S==="summary"){t.selectSummary(L);return}}}if(h.closest(".topiclinks")){const x=h.closest("g");if(x){t.selectArrow(x);return}}if(h.closest(".summary")){const x=h.closest("g");if(x){t.selectSummary(x);return}}},s=l=>{if(!t.editable)return;const h=l.target;if(ct(h)&&t.beginEdit(h),h.classList.contains("svg-label")){const v=h.dataset.svgId,C=h.dataset.type,x=document.getElementById(v);if(x){if(C==="arrow"){t.editArrowLabel(x);return}else if(C==="summary"){t.editSummary(x);return}}}if(h.closest(".topiclinks")){const v=h.closest("g");if(v){t.editArrowLabel(v);return}}if(h.closest(".summary")){const v=h.closest("g");if(v){t.editSummary(v);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"),l.preventDefault())},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,b=l.button===y&&l.pointerType==="mouse";if(!h&&!b)return;e.x=l.clientX,e.y=l.clientY;const v=l.target;(h||v.className!=="circle"&&v.contentEditable!=="plaintext-only")&&(e.mousedown=!0,v.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},u=l=>{if(!e.mousedown)return;const h=l.target;h.hasPointerCapture&&h.hasPointerCapture(l.pointerId)&&h.releasePointerCapture(l.pointerId),e.clear()},p=()=>{e.mousedown&&e.clear()},g=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const h=l.target;ct(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:f}=t;return at([{dom:f,evt:"pointerdown",func:a},{dom:f,evt:"pointermove",func:d},{dom:f,evt:"pointerup",func:u},{dom:f,evt:"pointerup",func:i},{dom:f,evt:"click",func:o},{dom:f,evt:"dblclick",func:s},{dom:f,evt:"contextmenu",func:g},{dom:f,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:w},{dom:f,evt:"blur",func:p},{dom:document,evt:"keydown",func:r},{dom:document,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 z=document,Mt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);ft.call(this,t,this.nodeData),t.draggable=!1;const e=z.createElement("me-root");e.appendChild(t);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}Pt(this,n,e)},Pt=function(t,e,n){const o=z.createElement("me-main");o.className=H.LHS;const s=z.createElement("me-main");s.className=H.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=z.createElement("me-children");for(let o=0;o<e.length;o++){const s=e[o],{grp:i}=t.createWrapper(s);n.appendChild(i)}return n},k=document,dt=function(t,e){const o=(this!=null&&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},ft=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 ft.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 ut(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=`
2
2
  left: ${s}px;
3
3
  top: ${i}px;
4
4
  min-width:${t.offsetWidth-8}px;
@@ -7,9 +7,9 @@ var MindElixirLite=function(){"use strict";const Je="",Qe="",Z={name:"Latte",typ
7
7
  margin:${r.margin};
8
8
  background-color:${r.backgroundColor!=="rgba(0, 0, 0, 0)"&&r.backgroundColor};
9
9
  border: ${r.border};
10
- border-radius:${r.borderRadius}; `,this.direction===0&&(e.style.right="0"),ut(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",()=>{var a;if(!e)return;e.remove();const c=((a=e.textContent)==null?void 0:a.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},B=document,A="http://www.w3.org/2000/svg",j=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 h="label-"+c;return a.id=h,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},pt=function(t,e,n){const o=B.createElementNS(A,"path");return E(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},G=function(t){const e=B.createElementNS(A,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},gt=function(){const t=B.createElementNS(A,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Vt=function(t,e,n,o){const s=B.createElementNS(A,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const a=r.d,h=B.createElementNS(A,"path"),u={d:a,stroke:(o==null?void 0:o.stroke)||"rgb(227, 125, 116)",fill:"none","stroke-linecap":(o==null?void 0:o.strokeLinecap)||"cap","stroke-width":String((o==null?void 0:o.strokeWidth)||"2")};(o==null?void 0:o.opacity)!==void 0&&(u.opacity=String(o.opacity)),E(h,u),c===0&&h.setAttribute("stroke-dasharray",(o==null?void 0:o.strokeDasharray)||"8,2");const p=B.createElementNS(A,"path");E(p,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(p),s.appendChild(h),s[r.name]=h}),s},mt=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=`
10
+ border-radius:${r.borderRadius}; `,this.direction===0&&(e.style.right="0"),ut(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",()=>{var a;if(!e)return;e.remove();const c=((a=e.textContent)==null?void 0:a.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},B=document,D="http://www.w3.org/2000/svg",j=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},pt=function(t,e,n){const o=B.createElementNS(D,"path");return E(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},G=function(t){const e=B.createElementNS(D,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},gt=function(){const t=B.createElementNS(D,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Vt=function(t,e,n,o){const s=B.createElementNS(D,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const a=r.d,d=B.createElementNS(D,"path"),u={d:a,stroke:(o==null?void 0:o.stroke)||"rgb(227, 125, 116)",fill:"none","stroke-linecap":(o==null?void 0:o.strokeLinecap)||"cap","stroke-width":String((o==null?void 0:o.strokeWidth)||"2")};(o==null?void 0:o.opacity)!==void 0&&(u.opacity=String(o.opacity)),E(d,u),c===0&&d.setAttribute("stroke-dasharray",(o==null?void 0:o.strokeDasharray)||"8,2");const p=B.createElementNS(D,"path");E(p,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(p),s.appendChild(d),s[r.name]=d}),s},mt=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
11
  left:${e.style.left};
12
12
  top:${e.style.top};
13
13
  max-width: 200px;
14
- `,ut(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",()=>{var r;if(!s)return;const i=((r=s.textContent)==null?void 0:r.trim())||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(e.textContent=n.label,j(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Rt=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],h=a.querySelector("me-tpc"),{offsetLeft:u,offsetTop:p}=D(this.nodes,h),g=h.offsetWidth,w=h.offsetHeight,f=a.parentNode.className,m=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:p,cL:u,cW:g,cH:w,direction:f,containerHeight:this.nodes.offsetHeight}),l=this.theme.palette,d=h.nodeObj.branchColor||l[c%l.length];if(h.style.borderColor=d,this.lines.appendChild(pt(m,d,"3")),t&&t!==a)continue;const y=G("subLines"),b=a.lastChild;b.tagName==="svg"&&b.remove(),a.appendChild(y),yt(this,y,d,a,f,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},yt=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,h=r.offsetLeft,u=r.offsetWidth,p=r.offsetHeight;for(let g=0;g<c.length;g++){const w=c[g],f=w.firstChild,m=f.offsetTop,l=f.offsetLeft,d=f.offsetWidth,y=f.offsetHeight,b=f.firstChild.nodeObj.branchColor||n,v=t.generateSubBranch({pT:a,pL:h,pW:u,pH:p,cT:m,cL:l,cW:d,cH:y,direction:s,isFirst:i});e.appendChild(pt(v,b,"2"));const C=f.children[1];if(C){if(!C.expanded)continue}else continue;yt(t,e,b,w,s)}},nn="",Yt='<?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>',zt='<?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>',jt='<?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>',Xt='<?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>',qt='<?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>',_t='<?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>',Ut='<?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>',on="",Kt={side:Yt,left:zt,right:jt,full:Xt,living:qt,zoomin:_t,zoomout:Ut},H=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=Kt[e],n};function Jt(t){const e=document.createElement("div"),n=H("fullscreen","full"),o=H("toCenter","living"),s=H("zoomout","zoomout"),i=H("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 Qt(t){const e=document.createElement("div"),n=H("tbltl","left"),o=H("tbltr","right"),s=H("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 Zt(t){t.container.append(Jt(t)),t.container.append(Qt(t))}const te=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?tt:Z).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()},ee=function(t){const n=t.parentElement.parentElement.lastElementChild;(n==null?void 0:n.tagName)==="svg"&&(n==null||n.remove())};function ne(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const oe=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,h=i-c,u=r-a;this.move(-h,-u,!0)}},se=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},ie=function(t){this.selection.select(t)},re=function(t){this.selection.deselect(t)},ce=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},le=function(){const t=ne(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ae=function(){return JSON.parse(this.getDataString())},de=function(){this.editable=!0},he=function(){this.editable=!1},fe=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}=wt(this),c=this.map.style.transform,{x:a,y:h}=lt(c),u=a-i,p=h-r,g=this.scaleVal,w=(-o+u)*(1-t/g),f=(-s+p)*(1-t/g);this.map.style.transform=`translate(${a-w}px, ${h-f}px) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},ue=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)},pe=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i}=this,r=o.style.transform;let{x:c,y:a}=lt(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})},wt=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 h,u;return t.alignment==="root"?(h=e.offsetWidth/2-r-c/2,u=e.offsetHeight/2-i-a/2,n.style.transformOrigin=`${r+c/2}px 50%`):(h=(e.offsetWidth-o.offsetWidth)/2,u=(e.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:h,dy:u}},ge=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:ce,disableEdit:he,enableEdit:de,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":"",ee(t),n.expanded){const p=this.createChildren(n.children.map(g=>this.createWrapper(g).grp));i.parentNode.appendChild(p)}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},h=s.x-a.x,u=s.y-a.y;this.move(h,u),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};nt(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:ae,getDataString:le,initLeft:function(){this.direction=0,this.refresh(),this.toCenter()},initRight:function(){this.direction=1,this.refresh(),this.toCenter()},initSide:function(){this.direction=2,this.refresh(),this.toCenter()},install:function(t){t(this)},move:pe,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)),et(this.nodeData),this.layout(),this.linkDiv()},scale:fe,scaleFit:ue,scrollIntoView:oe,selectNode:se,selectNodes:ie,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t}=this,{dx:e,dy:n}=wt(this);t.style.transform=`translate(${e}px, ${n}px) scale(${this.scaleVal})`},unselectNodes:re},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=at([{dom:e,evt:"pointermove",func:this.handlePointerMove},{dom:e,evt:"pointerleave",func:this.handleClear},{dom:e,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},me="#4dc4ff";function bt(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 ye(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),j(t))}function X(t,e,n,o,s){E(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function xt(t,e,n,o,s,i,r,c,a,h){var m;const u=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;if(t.line.setAttribute("d",u),h.style){const l=h.style;l.stroke&&t.line.setAttribute("stroke",l.stroke),l.strokeWidth&&t.line.setAttribute("stroke-width",String(l.strokeWidth)),l.strokeDasharray&&t.line.setAttribute("stroke-dasharray",l.strokeDasharray),l.strokeLinecap&&t.line.setAttribute("stroke-linecap",l.strokeLinecap),l.opacity!==void 0&&t.line.setAttribute("opacity",String(l.opacity))}const p=t.querySelectorAll('path[stroke="transparent"]');p.length>0&&p[0].setAttribute("d",u);const g=Y(i,r,c,a);if(g){const l=`M ${g.x1} ${g.y1} L ${c} ${a} L ${g.x2} ${g.y2}`;if(t.arrow1.setAttribute("d",l),p.length>1&&p[1].setAttribute("d",l),h.style){const d=h.style;d.stroke&&t.arrow1.setAttribute("stroke",d.stroke),d.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(d.strokeWidth)),d.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",d.strokeLinecap),d.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(d.opacity))}}if(h.bidirectional){const l=Y(o,s,e,n);if(l){const d=`M ${l.x1} ${l.y1} L ${e} ${n} L ${l.x2} ${l.y2}`;if(t.arrow2.setAttribute("d",d),p.length>2&&p[2].setAttribute("d",d),h.style){const y=h.style;y.stroke&&t.arrow2.setAttribute("stroke",y.stroke),y.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(y.strokeWidth)),y.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",y.strokeLinecap),y.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(y.opacity))}}}const{x:w,y:f}=bt(e,n,o,s,i,r,c,a);if(t.labelEl&&ye(t.labelEl,w,f),(m=h.style)!=null&&m.labelColor){const l=t.labelEl;l&&(l.style.color=h.style.labelColor)}Le(t)}function q(t,e,n){const{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,a=s+r/2,h=c+n.x,u=a+n.y;return{w:i,h:r,cx:c,cy:a,ctrlX:h,ctrlY:u}}function I(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){var L;if(!e||!n)return;const i=q(t,e,o.delta1),r=q(t,n,o.delta2),{x:c,y:a}=I(i),{ctrlX:h,ctrlY:u}=i,{ctrlX:p,ctrlY:g}=r,{x:w,y:f}=I(r),m=Y(p,g,w,f);if(!m)return;const l=`M ${m.x1} ${m.y1} L ${w} ${f} L ${m.x2} ${m.y2}`;let d="";if(o.bidirectional){const $=Y(h,u,c,a);if(!$)return;d=`M ${$.x1} ${$.y1} L ${c} ${a} L ${$.x2} ${$.y2}`}const y=Vt(`M ${c} ${a} C ${h} ${u} ${p} ${g} ${w} ${f}`,l,d,o.style),{x:b,y:v}=bt(c,a,h,u,p,g,w,f),C=((L=o.style)==null?void 0:L.labelColor)||"rgb(235, 95, 82)",x="arrow-"+o.id;y.id=x;const S=ot(o.label,b,v,{anchor:"middle",color:C,dataType:"arrow",svgId:x});y.labelEl=S,y.arrowObj=o,y.dataset.linkid=o.id,t.labelContainer.appendChild(S),t.linkSvgGroup.appendChild(y),j(S),s||(t.arrows.push(o),t.currentArrow=y,Ct(t,o,i,r))},we=function(t,e,n={}){const o={id:W(),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})},ve=function(t){_(this);const e={...t,id:W()};st(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},be=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;_(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}})},xe=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=q(this,n,e.delta1),i=q(this,o,e.delta2);Ct(this,e,s,i)},Ce=function(){_(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},Se=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)},Ee=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Le=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"))},_=function(t){var e,n;(e=t.helper1)==null||e.destroy(),(n=t.helper2)==null||n.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&Ee(t.currentArrow)},Ct=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:a,nodes:h,map:u,currentArrow:p,bus:g}=t;if(!p)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",h.appendChild(s),h.appendChild(i),h.appendChild(r),Se(p,me);let{x:w,y:f}=I(n),{ctrlX:m,ctrlY:l}=n,{ctrlX:d,ctrlY:y}=o,{x:b,y:v}=I(o);i.style.cssText=`top:${l}px;left:${m}px;`,r.style.cssText=`top:${y}px;left:${d}px;`,X(c,w,f,m,l),X(a,d,y,b,v),t.helper1=vt.create(i),t.helper2=vt.create(r),t.helper1.init(u,(C,x)=>{m=m+C/t.scaleVal,l=l+x/t.scaleVal;const S=I({...n,ctrlX:m,ctrlY:l});w=S.x,f=S.y,i.style.top=l+"px",i.style.left=m+"px",xt(p,w,f,m,l,d,y,b,v,e),X(c,w,f,m,l),e.delta1.x=m-n.cx,e.delta1.y=l-n.cy,g.fire("updateArrowDelta",e)}),t.helper2.init(u,(C,x)=>{d=d+C/t.scaleVal,y=y+x/t.scaleVal;const S=I({...o,ctrlX:d,ctrlY:y});b=S.x,v=S.y,r.style.top=y+"px",r.style.left=d+"px",xt(p,w,f,m,l,d,y,b,v,e),X(a,d,y,b,v),e.delta2.x=d-o.cx,e.delta2.y=y-o.cy,g.fire("updateArrowDelta",e)})};function ke(){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 Te(t){_(this),t&&t.labelEl&&mt(this,t.labelEl,t.arrowObj)}function $e(){this.arrows=this.arrows.filter(t=>R(t.from,this.nodeData)&&R(t.to,this.nodeData))}const Ae=Object.freeze(Object.defineProperty({__proto__:null,createArrow:we,createArrowFrom:ve,editArrowLabel:Te,removeArrow:be,renderArrow:ke,selectArrow:xe,tidyArrow:$e,unselectArrow:Ce},Symbol.toStringTag,{value:"Module"})),Ne=function(t){var a,h;if(t.length===0)throw new Error("No selected node.");if(t.length===1){const u=t[0].nodeObj,p=t[0].nodeObj.parent;if(!p)throw new Error("Can not select root node.");const g=p.children.findIndex(w=>u===w);return{parent:p.id,start:g,end:g}}let e=0;const n=t.map(u=>{let p=u.nodeObj;const g=[];for(;p.parent;){const w=p.parent,f=w.children,m=f==null?void 0:f.indexOf(p);p=w,g.unshift({node:p,index:m})}return g.length>e&&(e=g.length),g});let o=0;t:for(;o<e;o++){const u=(a=n[0][o])==null?void 0:a.node;for(let p=1;p<n.length;p++)if(((h=n[p][o])==null?void 0:h.node)!==u)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(u=>u[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}},De=function(t){const e=document.createElementNS(A,"g");return e.setAttribute("id",t),e},St=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},Me=t=>t.parentElement.parentElement,Pe=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){var Et;const{id:n,label:o,parent:s,start:i,end:r,style:c}=e,{nodes:a,theme:h,summarySvg:u}=t,g=t.findEle(s).nodeObj,w=Pe(t,e);let f=1/0,m=0,l=0,d=0;for(let V=i;V<=r;V++){const Lt=(Et=g.children)==null?void 0:Et[V];if(!Lt)return t.removeSummary(n),null;const J=Me(t.findEle(Lt.id)),{offsetLeft:Q,offsetTop:kt}=D(a,J),Tt=i===r?10:20;V===i&&(l=kt+Tt),V===r&&(d=kt+J.offsetHeight-Tt),Q<f&&(f=Q),J.offsetWidth+Q>m&&(m=J.offsetWidth+Q)}let y,b;const v=g.parent?10:0,C=l+v,x=d+v,S=(C+x)/2,L=(c==null?void 0:c.stroke)||h.cssVar["--color"],$=(c==null?void 0:c.labelColor)||h.cssVar["--color"],F="s-"+n;w===P.LHS?(y=St(`M ${f+10} ${C} c -5 0 -10 5 -10 10 L ${f} ${x-10} c 0 5 5 10 10 10 M ${f} ${S} h -10`,L),b=ot(o,f-20,S,{anchor:"end",color:$,dataType:"summary",svgId:F})):(y=St(`M ${m-10} ${C} c 5 0 10 5 10 10 L ${m} ${x-10} c 0 5 -5 10 -10 10 M ${m} ${S} h 10`,L),b=ot(o,m+20,S,{anchor:"start",color:$,dataType:"summary",svgId:F}));const M=De(F);return M.appendChild(y),t.labelContainer.appendChild(b),j(b),M.summaryObj=e,M.labelEl=b,u.appendChild(M),M},He=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}=Ne(e),c={id:W(),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=W(),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&&mt(this,t.labelEl,t.summaryObj)},removeSummary:function(t){var n,o;const e=this.summaries.findIndex(s=>s.id===t);e>-1&&(this.summaries.splice(e,1),(n=this.nodes.querySelector("#s-"+t))==null||n.remove(),(o=this.nodes.querySelector("#label-s-"+t))==null||o.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(){var t,e;(e=(t=this.currentSummary)==null?void 0:t.labelEl)==null||e.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),T="http://www.w3.org/2000/svg";function Be(t,e){const n=document.createElementNS(T,"svg");return E(n,{version:"1.1",xmlns:T,height:t,width:e}),n}function Ie(t,e){return(parseInt(t)-parseInt(e))/2}function Oe(t,e,n,o){const s=document.createElementNS(T,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
15
- `).forEach((c,a)=>{const h=document.createElementNS(T,"text");E(h,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Ie(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}`}),h.innerHTML=c,s.appendChild(h)}),s}function We(t,e,n,o){var c;let s="";(c=t.nodeObj)!=null&&c.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(T,"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 Ge(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=document.createElementNS(T,"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 U(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=D(t.nodes,e),r=document.createElementNS(T,"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(T,"g");c.appendChild(r);let a;return n?a=We(e,o,s,i):a=Oe(e,o,s,i),c.appendChild(a),c}function Fe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=document.createElementNS(T,"a"),r=document.createElementNS(T,"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 Ve(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=document.createElementNS(T,"image");return E(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const K=100,Re='<?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">',Ye=(t,e=!1)=>{var p,g,w;const n=t.nodes,o=n.offsetHeight+K*2,s=n.offsetWidth+K*2,i=Be(o+"px",s+"px"),r=document.createElementNS(T,"svg"),c=document.createElementNS(T,"rect");E(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(f=>{const m=f.cloneNode(!0),{offsetLeft:l,offsetTop:d}=D(n,f.parentElement);m.setAttribute("x",`${l}`),m.setAttribute("y",`${d}`),r.appendChild(m)});const a=(p=n.querySelector(".lines"))==null?void 0:p.cloneNode(!0);a&&r.appendChild(a);const h=(g=n.querySelector(".topiclinks"))==null?void 0:g.cloneNode(!0);h&&r.appendChild(h);const u=(w=n.querySelector(".summary"))==null?void 0:w.cloneNode(!0);return u&&r.appendChild(u),n.querySelectorAll("me-tpc").forEach(f=>{f.nodeObj.dangerouslySetInnerHTML?r.appendChild(U(t,f,!e)):(r.appendChild(Ge(t,f)),r.appendChild(U(t,f.text,!e)))}),n.querySelectorAll(".tags > span").forEach(f=>{r.appendChild(U(t,f))}),n.querySelectorAll(".icons > span").forEach(f=>{r.appendChild(U(t,f))}),n.querySelectorAll(".hyper-link").forEach(f=>{r.appendChild(Fe(t,f))}),n.querySelectorAll("img").forEach(f=>{r.appendChild(Ve(t,f))}),E(r,{x:K+"",y:K+"",overflow:"visible"}),i.appendChild(r),i},ze=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Re+t.outerHTML);function je(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 Xe={getObjById:R,generateNewObj:At,layout:Mt,linkDiv:Rt,editTopic:Gt,createWrapper:Bt,createParent:It,createChildren:Ot,createTopic:Wt,findEle:ht,changeTheme:te,...ge,...{},...Ae,...He,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await je(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=Ye(this,t),o=ze(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,et(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Zt(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){var t;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,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function qe({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,containerHeight:h}){let u=e+n/2;const p=t+o/2;let g;a===P.LHS?g=i+r:g=i;const w=s+c/2,m=(1-Math.abs(w-p)/h)*.25*(n/2);return a===P.LHS?u=u-n/10-m:u=u+n/10+m,`M ${u} ${p} Q ${u} ${w} ${g} ${w}`}function _e({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,isFirst:h}){const u=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let p=0,g=0;h?p=t+o/2:p=t+o;const w=s+c;let f=0,m=0,l=0;const d=Math.abs(p-w)/300*u;return a===P.LHS?(l=e,f=l+u,m=l-u,g=i+u,`M ${f} ${p} C ${l} ${p} ${l+d} ${w} ${m} ${w} H ${g}`):(l=e+n,f=l-u,m=l+u,g=i+r-u,`M ${f} ${p} C ${l} ${p} ${l-d} ${w} ${m} ${w} H ${g}`)}const Ue="5.2.0";function Ke(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 O=document;function N({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:c,mouseSelectionButton:a,selectionContainer:h,before:u,newTopicName:p,allowUndo:g,generateMainBranch:w,generateSubBranch:f,overflowHidden:m,theme:l,alignment:d,scaleSensitivity:y,scaleMax:b,scaleMin:v,handleWheel:C,markdown:x,imageProxy:S}){let L=null;const $=Object.prototype.toString.call(t);if($==="[object HTMLDivElement]"?L=t:$==="[object String]"&&(L=document.querySelector(t)),!L)throw new Error("MindElixir: el is not a valid element");L.style.position="relative",L.innerHTML="",this.el=L,this.disposable=[],this.before=u||{},this.locale=n||"en",this.newTopicName=p||"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=g??!0,this.scaleSensitivity=y??.1,this.scaleMax=b??1.4,this.scaleMin=v??.2,this.generateMainBranch=w||qe,this.generateSubBranch=f||_e,this.overflowHidden=m??!1,this.alignment=d??"root",this.handleWheel=C??!0,this.markdown=x||void 0,this.imageProxy=S||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=Ke(this),this.bus=Dt(),this.container=O.createElement("div"),this.selectionContainer=h||this.container,this.container.className="map-container";const F=window.matchMedia("(prefers-color-scheme: dark)");this.theme=l||(F.matches?tt:Z);const M=O.createElement("div");M.className="map-canvas",this.map=M,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=O.createElement("me-nodes"),this.lines=G("lines"),this.summarySvg=G("summary"),this.linkController=G("linkcontroller"),this.P2=O.createElement("div"),this.P3=O.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=gt(),this.line2=gt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=G("topiclinks"),this.labelContainer=O.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Nt(this))}return N.prototype=Xe,Object.defineProperty(N.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),N.LEFT=0,N.RIGHT=1,N.SIDE=2,N.THEME=Z,N.DARK_THEME=tt,N.version=Ue,N.E=ht,N}();
14
+ `,ut(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",()=>{var r;if(!s)return;const i=((r=s.textContent)==null?void 0:r.trim())||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(e.textContent=n.label,j(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Rt=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:u,offsetTop:p}=N(this.nodes,d),g=d.offsetWidth,w=d.offsetHeight,f=a.parentNode.className,m=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:p,cL:u,cW:g,cH:w,direction:f,containerHeight:this.nodes.offsetHeight}),l=this.theme.palette,h=d.nodeObj.branchColor||l[c%l.length];if(d.style.borderColor=h,this.lines.appendChild(pt(m,h,"3")),t&&t!==a)continue;const y=G("subLines"),b=a.lastChild;b.tagName==="svg"&&b.remove(),a.appendChild(y),yt(this,y,h,a,f,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},yt=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,u=r.offsetWidth,p=r.offsetHeight;for(let g=0;g<c.length;g++){const w=c[g],f=w.firstChild,m=f.offsetTop,l=f.offsetLeft,h=f.offsetWidth,y=f.offsetHeight,b=f.firstChild.nodeObj.branchColor||n,v=t.generateSubBranch({pT:a,pL:d,pW:u,pH:p,cT:m,cL:l,cW:h,cH:y,direction:s,isFirst:i});e.appendChild(pt(v,b,"2"));const C=f.children[1];if(C){if(!C.expanded)continue}else continue;yt(t,e,b,w,s)}},nn="",Yt='<?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>',zt='<?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>',jt='<?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>',Xt='<?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>',qt='<?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>',_t='<?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>',Ut='<?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>',on="",Kt={side:Yt,left:zt,right:jt,full:Xt,living:qt,zoomin:_t,zoomout:Ut},P=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=Kt[e],n};function Jt(t){const e=document.createElement("div"),n=P("fullscreen","full"),o=P("toCenter","living"),s=P("zoomout","zoomout"),i=P("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 Qt(t){const e=document.createElement("div"),n=P("tbltl","left"),o=P("tbltr","right"),s=P("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 Zt(t){t.container.append(Jt(t)),t.container.append(Qt(t))}const te=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?tt:Z).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()},ee=function(t){const n=t.parentElement.parentElement.lastElementChild;(n==null?void 0:n.tagName)==="svg"&&(n==null||n.remove())};function ne(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const oe=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,u=r-a;this.move(-d,-u,!0)}},se=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},ie=function(t){this.selection.select(t)},re=function(t){this.selection.deselect(t)},ce=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},le=function(){const t=ne(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ae=function(){return JSON.parse(this.getDataString())},he=function(){this.editable=!0},de=function(){this.editable=!1},fe=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}=wt(this),c=this.map.style.transform,{x:a,y:d}=lt(c),u=a-i,p=d-r,g=this.scaleVal,w=(-o+u)*(1-t/g),f=(-s+p)*(1-t/g);this.map.style.transform=`translate(${a-w}px, ${d-f}px) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},ue=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)},pe=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i}=this,r=o.style.transform;let{x:c,y:a}=lt(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})},wt=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,u;return t.alignment==="root"?(d=e.offsetWidth/2-r-c/2,u=e.offsetHeight/2-i-a/2,n.style.transformOrigin=`${r+c/2}px 50%`):(d=(e.offsetWidth-o.offsetWidth)/2,u=(e.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:d,dy:u}},ge=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:ce,disableEdit:de,enableEdit:he,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":"",ee(t),n.expanded){const p=this.createChildren(n.children.map(g=>this.createWrapper(g).grp));i.parentNode.appendChild(p)}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,u=s.y-a.y;this.move(d,u),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};nt(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:ae,getDataString:le,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:pe,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)),et(this.nodeData),this.layout(),this.linkDiv()},scale:fe,scaleFit:ue,scrollIntoView:oe,selectNode:se,selectNodes:ie,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t}=this,{dx:e,dy:n}=wt(this);t.style.transform=`translate(${e}px, ${n}px) scale(${this.scaleVal})`},unselectNodes:re},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=at([{dom:e,evt:"pointermove",func:this.handlePointerMove},{dom:e,evt:"pointerleave",func:this.handleClear},{dom:e,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},me="#4dc4ff";function bt(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 ye(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),j(t))}function X(t,e,n,o,s){E(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function xt(t,e,n,o,s,i,r,c,a,d){var m;const u=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;if(t.line.setAttribute("d",u),d.style){const l=d.style;l.stroke&&t.line.setAttribute("stroke",l.stroke),l.strokeWidth&&t.line.setAttribute("stroke-width",String(l.strokeWidth)),l.strokeDasharray&&t.line.setAttribute("stroke-dasharray",l.strokeDasharray),l.strokeLinecap&&t.line.setAttribute("stroke-linecap",l.strokeLinecap),l.opacity!==void 0&&t.line.setAttribute("opacity",String(l.opacity))}const p=t.querySelectorAll('path[stroke="transparent"]');p.length>0&&p[0].setAttribute("d",u);const g=Y(i,r,c,a);if(g){const l=`M ${g.x1} ${g.y1} L ${c} ${a} L ${g.x2} ${g.y2}`;if(t.arrow1.setAttribute("d",l),p.length>1&&p[1].setAttribute("d",l),d.style){const h=d.style;h.stroke&&t.arrow1.setAttribute("stroke",h.stroke),h.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(h.strokeWidth)),h.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",h.strokeLinecap),h.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(h.opacity))}}if(d.bidirectional){const l=Y(o,s,e,n);if(l){const h=`M ${l.x1} ${l.y1} L ${e} ${n} L ${l.x2} ${l.y2}`;if(t.arrow2.setAttribute("d",h),p.length>2&&p[2].setAttribute("d",h),d.style){const y=d.style;y.stroke&&t.arrow2.setAttribute("stroke",y.stroke),y.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(y.strokeWidth)),y.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",y.strokeLinecap),y.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(y.opacity))}}}const{x:w,y:f}=bt(e,n,o,s,i,r,c,a);if(t.labelEl&&ye(t.labelEl,w,f),(m=d.style)!=null&&m.labelColor){const l=t.labelEl;l&&(l.style.color=d.style.labelColor)}Le(t)}function q(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,u=a+n.y;return{w:i,h:r,cx:c,cy:a,ctrlX:d,ctrlY:u}}function I(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){var L;if(!e||!n)return;const i=q(t,e,o.delta1),r=q(t,n,o.delta2),{x:c,y:a}=I(i),{ctrlX:d,ctrlY:u}=i,{ctrlX:p,ctrlY:g}=r,{x:w,y:f}=I(r),m=Y(p,g,w,f);if(!m)return;const l=`M ${m.x1} ${m.y1} L ${w} ${f} L ${m.x2} ${m.y2}`;let h="";if(o.bidirectional){const $=Y(d,u,c,a);if(!$)return;h=`M ${$.x1} ${$.y1} L ${c} ${a} L ${$.x2} ${$.y2}`}const y=Vt(`M ${c} ${a} C ${d} ${u} ${p} ${g} ${w} ${f}`,l,h,o.style),{x:b,y:v}=bt(c,a,d,u,p,g,w,f),C=((L=o.style)==null?void 0:L.labelColor)||"rgb(235, 95, 82)",x="arrow-"+o.id;y.id=x;const S=ot(o.label,b,v,{anchor:"middle",color:C,dataType:"arrow",svgId:x});y.labelEl=S,y.arrowObj=o,y.dataset.linkid=o.id,t.labelContainer.appendChild(S),t.linkSvgGroup.appendChild(y),j(S),s||(t.arrows.push(o),t.currentArrow=y,Ct(t,o,i,r))},we=function(t,e,n={}){const o={id:W(),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})},ve=function(t){_(this);const e={...t,id:W()};st(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},be=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;_(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}})},xe=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=q(this,n,e.delta1),i=q(this,o,e.delta2);Ct(this,e,s,i)},Ce=function(){_(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},Se=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)},Ee=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Le=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"))},_=function(t){var e,n;(e=t.helper1)==null||e.destroy(),(n=t.helper2)==null||n.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&Ee(t.currentArrow)},Ct=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:a,nodes:d,map:u,currentArrow:p,bus:g}=t;if(!p)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",d.appendChild(s),d.appendChild(i),d.appendChild(r),Se(p,me);let{x:w,y:f}=I(n),{ctrlX:m,ctrlY:l}=n,{ctrlX:h,ctrlY:y}=o,{x:b,y:v}=I(o);i.style.cssText=`top:${l}px;left:${m}px;`,r.style.cssText=`top:${y}px;left:${h}px;`,X(c,w,f,m,l),X(a,h,y,b,v),t.helper1=vt.create(i),t.helper2=vt.create(r),t.helper1.init(u,(C,x)=>{m=m+C/t.scaleVal,l=l+x/t.scaleVal;const S=I({...n,ctrlX:m,ctrlY:l});w=S.x,f=S.y,i.style.top=l+"px",i.style.left=m+"px",xt(p,w,f,m,l,h,y,b,v,e),X(c,w,f,m,l),e.delta1.x=m-n.cx,e.delta1.y=l-n.cy,g.fire("updateArrowDelta",e)}),t.helper2.init(u,(C,x)=>{h=h+C/t.scaleVal,y=y+x/t.scaleVal;const S=I({...o,ctrlX:h,ctrlY:y});b=S.x,v=S.y,r.style.top=y+"px",r.style.left=h+"px",xt(p,w,f,m,l,h,y,b,v,e),X(a,h,y,b,v),e.delta2.x=h-o.cx,e.delta2.y=y-o.cy,g.fire("updateArrowDelta",e)})};function ke(){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 Te(t){_(this),t&&t.labelEl&&mt(this,t.labelEl,t.arrowObj)}function $e(){this.arrows=this.arrows.filter(t=>R(t.from,this.nodeData)&&R(t.to,this.nodeData))}const De=Object.freeze(Object.defineProperty({__proto__:null,createArrow:we,createArrowFrom:ve,editArrowLabel:Te,removeArrow:be,renderArrow:ke,selectArrow:xe,tidyArrow:$e,unselectArrow:Ce},Symbol.toStringTag,{value:"Module"})),Ae=function(t){var a,d;if(t.length===0)throw new Error("No selected node.");if(t.length===1){const u=t[0].nodeObj,p=t[0].nodeObj.parent;if(!p)throw new Error("Can not select root node.");const g=p.children.findIndex(w=>u===w);return{parent:p.id,start:g,end:g}}let e=0;const n=t.map(u=>{let p=u.nodeObj;const g=[];for(;p.parent;){const w=p.parent,f=w.children,m=f==null?void 0:f.indexOf(p);p=w,g.unshift({node:p,index:m})}return g.length>e&&(e=g.length),g});let o=0;t:for(;o<e;o++){const u=(a=n[0][o])==null?void 0:a.node;for(let p=1;p<n.length;p++)if(((d=n[p][o])==null?void 0:d.node)!==u)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(u=>u[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}},Ne=function(t){const e=document.createElementNS(D,"g");return e.setAttribute("id",t),e},St=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},Me=t=>t.parentElement.parentElement,Pe=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){var Et;const{id:n,label:o,parent:s,start:i,end:r,style:c}=e,{nodes:a,theme:d,summarySvg:u}=t,g=t.findEle(s).nodeObj,w=Pe(t,e);let f=1/0,m=0,l=0,h=0;for(let V=i;V<=r;V++){const Lt=(Et=g.children)==null?void 0:Et[V];if(!Lt)return t.removeSummary(n),null;const J=Me(t.findEle(Lt.id)),{offsetLeft:Q,offsetTop:kt}=N(a,J),Tt=i===r?10:20;V===i&&(l=kt+Tt),V===r&&(h=kt+J.offsetHeight-Tt),Q<f&&(f=Q),J.offsetWidth+Q>m&&(m=J.offsetWidth+Q)}let y,b;const v=g.parent?10:0,C=l+v,x=h+v,S=(C+x)/2,L=(c==null?void 0:c.stroke)||d.cssVar["--color"],$=(c==null?void 0:c.labelColor)||d.cssVar["--color"],F="s-"+n;w===H.LHS?(y=St(`M ${f+10} ${C} c -5 0 -10 5 -10 10 L ${f} ${x-10} c 0 5 5 10 10 10 M ${f} ${S} h -10`,L),b=ot(o,f-20,S,{anchor:"end",color:$,dataType:"summary",svgId:F})):(y=St(`M ${m-10} ${C} c 5 0 10 5 10 10 L ${m} ${x-10} c 0 5 -5 10 -10 10 M ${m} ${S} h 10`,L),b=ot(o,m+20,S,{anchor:"start",color:$,dataType:"summary",svgId:F}));const M=Ne(F);return M.appendChild(y),t.labelContainer.appendChild(b),j(b),M.summaryObj=e,M.labelEl=b,u.appendChild(M),M},He=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}=Ae(e),c={id:W(),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=W(),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&&mt(this,t.labelEl,t.summaryObj)},removeSummary:function(t){var n,o;const e=this.summaries.findIndex(s=>s.id===t);e>-1&&(this.summaries.splice(e,1),(n=this.nodes.querySelector("#s-"+t))==null||n.remove(),(o=this.nodes.querySelector("#label-s-"+t))==null||o.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(){var t,e;(e=(t=this.currentSummary)==null?void 0:t.labelEl)==null||e.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),T="http://www.w3.org/2000/svg";function Be(t,e){const n=document.createElementNS(T,"svg");return E(n,{version:"1.1",xmlns:T,height:t,width:e}),n}function Ie(t,e){return(parseInt(t)-parseInt(e))/2}function Oe(t,e,n,o){const s=document.createElementNS(T,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
15
+ `).forEach((c,a)=>{const d=document.createElementNS(T,"text");E(d,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Ie(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 We(t,e,n,o){var c;let s="";(c=t.nodeObj)!=null&&c.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(T,"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 Ge(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(T,"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 U(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=N(t.nodes,e),r=document.createElementNS(T,"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(T,"g");c.appendChild(r);let a;return n?a=We(e,o,s,i):a=Oe(e,o,s,i),c.appendChild(a),c}function Fe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(T,"a"),r=document.createElementNS(T,"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 Ve(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=N(t.nodes,e),i=document.createElementNS(T,"image");return E(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const K=100,Re='<?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">',Ye=(t,e=!1)=>{var p,g,w;const n=t.nodes,o=n.offsetHeight+K*2,s=n.offsetWidth+K*2,i=Be(o+"px",s+"px"),r=document.createElementNS(T,"svg"),c=document.createElementNS(T,"rect");E(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(f=>{const m=f.cloneNode(!0),{offsetLeft:l,offsetTop:h}=N(n,f.parentElement);m.setAttribute("x",`${l}`),m.setAttribute("y",`${h}`),r.appendChild(m)});const a=(p=n.querySelector(".lines"))==null?void 0:p.cloneNode(!0);a&&r.appendChild(a);const d=(g=n.querySelector(".topiclinks"))==null?void 0:g.cloneNode(!0);d&&r.appendChild(d);const u=(w=n.querySelector(".summary"))==null?void 0:w.cloneNode(!0);return u&&r.appendChild(u),n.querySelectorAll("me-tpc").forEach(f=>{f.nodeObj.dangerouslySetInnerHTML?r.appendChild(U(t,f,!e)):(r.appendChild(Ge(t,f)),r.appendChild(U(t,f.text,!e)))}),n.querySelectorAll(".tags > span").forEach(f=>{r.appendChild(U(t,f))}),n.querySelectorAll(".icons > span").forEach(f=>{r.appendChild(U(t,f))}),n.querySelectorAll(".hyper-link").forEach(f=>{r.appendChild(Fe(t,f))}),n.querySelectorAll("img").forEach(f=>{r.appendChild(Ve(t,f))}),E(r,{x:K+"",y:K+"",overflow:"visible"}),i.appendChild(r),i},ze=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Re+t.outerHTML);function je(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 Xe={getObjById:R,generateNewObj:Dt,layout:Mt,linkDiv:Rt,editTopic:Gt,createWrapper:Bt,createParent:It,createChildren:Ot,createTopic:Wt,findEle:dt,changeTheme:te,...ge,...{},...De,...He,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await je(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=Ye(this,t),o=ze(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,et(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Zt(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){var t;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,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function qe({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,containerHeight:d}){let u=e+n/2;const p=t+o/2;let g;a===H.LHS?g=i+r:g=i;const w=s+c/2,m=(1-Math.abs(w-p)/d)*.25*(n/2);return a===H.LHS?u=u-n/10-m:u=u+n/10+m,`M ${u} ${p} Q ${u} ${w} ${g} ${w}`}function _e({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:a,isFirst:d}){const u=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let p=0,g=0;d?p=t+o/2:p=t+o;const w=s+c;let f=0,m=0,l=0;const h=Math.abs(p-w)/300*u;return a===H.LHS?(l=e,f=l+u,m=l-u,g=i+u,`M ${f} ${p} C ${l} ${p} ${l+h} ${w} ${m} ${w} H ${g}`):(l=e+n,f=l-u,m=l+u,g=i+r-u,`M ${f} ${p} C ${l} ${p} ${l-h} ${w} ${m} ${w} H ${g}`)}const Ue="5.2.1";function Ke(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 O=document;function A({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:c,mouseSelectionButton:a,selectionContainer:d,before:u,newTopicName:p,allowUndo:g,generateMainBranch:w,generateSubBranch:f,overflowHidden:m,theme:l,alignment:h,scaleSensitivity:y,scaleMax:b,scaleMin:v,handleWheel:C,markdown:x,imageProxy:S}){let L=null;const $=Object.prototype.toString.call(t);if($==="[object HTMLDivElement]"?L=t:$==="[object String]"&&(L=document.querySelector(t)),!L)throw new Error("MindElixir: el is not a valid element");L.style.position="relative",L.innerHTML="",this.el=L,this.disposable=[],this.before=u||{},this.locale=n||"en",this.newTopicName=p||"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=g??!0,this.scaleSensitivity=y??.1,this.scaleMax=b??1.4,this.scaleMin=v??.2,this.generateMainBranch=w||qe,this.generateSubBranch=f||_e,this.overflowHidden=m??!1,this.alignment=h??"root",this.handleWheel=C??!0,this.markdown=x||void 0,this.imageProxy=S||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=Ke(this),this.bus=Nt(),this.container=O.createElement("div"),this.selectionContainer=d||this.container,this.container.className="map-container";const F=window.matchMedia("(prefers-color-scheme: dark)");this.theme=l||(F.matches?tt:Z);const M=O.createElement("div");M.className="map-canvas",this.map=M,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=O.createElement("me-nodes"),this.lines=G("lines"),this.summarySvg=G("summary"),this.linkController=G("linkcontroller"),this.P2=O.createElement("div"),this.P3=O.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=gt(),this.line2=gt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=G("topiclinks"),this.labelContainer=O.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=Xe,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=Z,A.DARK_THEME=tt,A.version=Ue,A.E=dt,A}();