mind-elixir 2.0.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MindElixir.iife.js +11 -0
- package/dist/MindElixir.js +1419 -1
- package/dist/MindElixirLite.iife.js +9 -0
- package/dist/MindElixirLite.js +739 -1
- package/dist/example.iife.js +2 -0
- package/dist/example.js +241 -0
- package/dist/types/const.d.ts +10 -2
- package/dist/types/customLink.d.ts +27 -6
- package/dist/types/index.d.ts +91 -31
- package/dist/types/interact.d.ts +24 -24
- package/dist/types/linkDiv.d.ts +7 -7
- package/dist/types/methods.d.ts +71 -0
- package/dist/types/nodeOperation.d.ts +16 -20
- package/dist/types/types/dom.d.ts +12 -4
- package/dist/types/types/index.d.ts +49 -125
- package/dist/types/utils/LinkDragMoveHelper.d.ts +27 -2
- package/dist/types/utils/dom.d.ts +14 -8
- package/dist/types/utils/index.d.ts +5 -6
- package/dist/types/utils/layout.d.ts +4 -12
- package/dist/types/utils/pubsub.d.ts +36 -5
- package/dist/types/utils/theme.d.ts +4 -0
- package/package.json +31 -47
- package/readme.cn.md +0 -2
- package/readme.md +15 -2
- package/dist/example1.js +0 -1
- package/dist/example2.js +0 -1
- package/dist/types/index.lite.d.ts +0 -13
- package/dist/types/types/function.d.ts +0 -45
- package/dist/types/types/interact.d.ts +0 -14
- package/dist/types/types/linkDiv.d.ts +0 -18
package/dist/MindElixir.js
CHANGED
|
@@ -1 +1,1419 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MindElixir=t():e.MindElixir=t()}(self,(()=>(()=>{var e={74:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(81),o=n.n(i),r=n(645),s=n.n(r),a=n(667),l=n.n(a),c=new URL(n(848),n.b),d=new URL(n(295),n.b),h=s()(o()),p=l()(c),m=l()(d);h.push([e.id,".mind-elixir {\n --gap: 30px;\n --root-radius: 30px;\n --main-radius: 20px;\n --root-color: #ffffff;\n --root-bgcolor: #4c4f69;\n --main-color: #444446;\n --main-bgcolor: #ffffff;\n --topic-padding: 3px;\n --color: #777777;\n --bgcolor: #f6f6f6;\n position: relative;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n}\n.mind-elixir .hyper-link {\n text-decoration: none;\n}\n.map-container {\n user-select: none;\n height: 100%;\n width: 100%;\n overflow: scroll;\n font-size: 15px;\n}\n.map-container::-webkit-scrollbar {\n width: 0px;\n height: 0px;\n}\n.map-container .selected {\n box-shadow: 0 0 0 2px #4dc4ff;\n}\n.map-container .lhs {\n direction: rtl;\n}\n.map-container .lhs me-tpc {\n direction: ltr;\n}\n.map-container .map-canvas {\n height: 20000px;\n width: 20000px;\n position: relative;\n user-select: none;\n transition: transform 0.3s;\n transform: scale(1);\n background-color: var(--bgcolor);\n}\n.map-container .map-canvas me-root {\n position: absolute;\n padding: 10px var(--gap);\n color: var(--root-color);\n background-color: var(--root-bgcolor);\n border-radius: var(--root-radius);\n}\n.map-container .map-canvas me-root me-tpc {\n display: block;\n font-size: 25px;\n white-space: pre-wrap;\n}\n.map-container .map-canvas me-root me-tpc #input-box {\n padding: 10px var(--gap);\n}\n.map-container .main-node-container > me-wrapper {\n position: absolute;\n}\n.map-container .main-node-container > me-wrapper > me-parent {\n margin: var(--gap);\n background-color: var(--main-bgcolor);\n border: 2px solid var(--main-color);\n border-radius: var(--main-radius);\n padding: 0;\n}\n.map-container .main-node-container > me-wrapper > me-parent > me-tpc {\n border-radius: var(--main-radius);\n color: var(--main-color);\n padding: 8px var(--gap);\n}\n.map-container .main-node-container > me-wrapper > me-parent > me-tpc #input-box {\n padding: 8px var(--gap);\n}\n.map-container me-wrapper {\n display: block;\n pointer-events: none;\n}\n.map-container me-children,\n.map-container me-parent {\n display: inline-block;\n vertical-align: middle;\n}\n.map-container me-parent {\n position: relative;\n cursor: pointer;\n padding: 6px var(--gap);\n margin-top: 10px;\n}\n.map-container me-parent me-tpc {\n position: relative;\n display: block;\n border-radius: 3px;\n color: var(--color);\n pointer-events: all;\n max-width: 800px;\n white-space: pre-wrap;\n padding: var(--topic-padding);\n line-height: 1.2;\n}\n.map-container me-parent me-tpc .insert-preview {\n position: absolute;\n width: 100%;\n left: 0px;\n z-index: 9;\n}\n.map-container me-parent me-tpc .show {\n background: #7ad5ff;\n pointer-events: none;\n opacity: 0.7;\n}\n.map-container me-parent me-tpc .before {\n height: 14px;\n top: -14px;\n}\n.map-container me-parent me-tpc .in {\n height: 100%;\n top: 0px;\n}\n.map-container me-parent me-tpc .after {\n height: 14px;\n bottom: -14px;\n}\n.map-container me-parent me-epd {\n position: absolute;\n height: 18px;\n width: 18px;\n opacity: 0.8;\n background-image: url("+p+");\n background-repeat: no-repeat;\n background-size: contain;\n background-position: center;\n pointer-events: all;\n z-index: 9;\n}\n.map-container me-parent me-epd.minus {\n background-image: url("+m+") !important;\n transition: opacity 0.3s;\n opacity: 0;\n}\n.map-container me-parent me-epd.minus:hover {\n opacity: 0.8;\n}\n.map-container .icon {\n width: 1em;\n height: 1em;\n vertical-align: -0.15em;\n fill: currentColor;\n overflow: hidden;\n}\n.map-container .lines,\n.map-container .subLines,\n.map-container .topiclinks,\n.map-container .linkcontroller {\n position: absolute;\n height: 102%;\n width: 100%;\n top: 0;\n left: 0;\n}\n.map-container .topiclinks,\n.map-container .linkcontroller {\n pointer-events: none;\n}\n.map-container .topiclinks g,\n.map-container .linkcontroller g {\n pointer-events: all;\n}\n.map-container .lines,\n.map-container .subLines {\n pointer-events: none;\n z-index: -1;\n}\n.map-container .topiclinks *,\n.map-container .linkcontroller * {\n z-index: 100;\n}\n.map-container .topiclinks g {\n cursor: pointer;\n}\n.map-container #input-box {\n position: absolute;\n top: 0;\n left: 0;\n padding: var(--topic-padding);\n background-color: #fff;\n color: #666666;\n width: max-content;\n max-width: 800px;\n z-index: 11;\n direction: ltr;\n user-select: auto;\n}\n.map-container me-tpc > img {\n pointer-events: none;\n display: block;\n margin-top: 8px;\n}\n.map-container .circle {\n position: absolute;\n height: 10px;\n width: 10px;\n margin-top: -5px;\n margin-left: -5px;\n border-radius: 100%;\n background: #aaa;\n cursor: pointer;\n}\n.map-container .tags {\n direction: ltr;\n}\n.map-container .tags span {\n display: inline-block;\n border-radius: 3px;\n padding: 2px 4px;\n background: #d6f0f8;\n color: #276f86;\n margin: 0px;\n font-size: 12px;\n line-height: 16px;\n margin-right: 3px;\n margin-top: 2px;\n}\n.map-container .icons {\n display: inline-block;\n direction: ltr;\n margin-right: 10px;\n}\n.map-container .mind-elixir-ghost {\n box-sizing: content-box;\n opacity: 0.5;\n background-color: #f6f6f6;\n max-width: 200px;\n width: fit-content;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding: 8px 16px;\n border-radius: 6px;\n border: #666666 2px solid;\n}\n",""]);const u=h},165:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(81),o=n.n(i),r=n(645),s=n.n(r)()(o());s.push([e.id,".mind-elixir .context-menu {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99;\n}\n.mind-elixir .context-menu .menu-list {\n position: fixed;\n list-style: none;\n margin: 0;\n padding: 0;\n font: 300 15px 'Roboto', sans-serif;\n color: #333;\n box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.2);\n}\n.mind-elixir .context-menu .menu-list * {\n transition: color 0.4s, background-color 0.4s;\n}\n.mind-elixir .context-menu .menu-list li {\n min-width: 150px;\n overflow: hidden;\n white-space: nowrap;\n padding: 6px 10px;\n background-color: #fff;\n border-bottom: 1px solid #ecf0f1;\n}\n.mind-elixir .context-menu .menu-list li a {\n color: #333;\n text-decoration: none;\n}\n.mind-elixir .context-menu .menu-list li.disabled {\n color: #5e5e5e;\n background-color: #f7f7f7;\n}\n.mind-elixir .context-menu .menu-list li.disabled:hover {\n cursor: default;\n background-color: #f7f7f7;\n}\n.mind-elixir .context-menu .menu-list li:hover {\n cursor: pointer;\n background-color: #ecf0f1;\n}\n.mind-elixir .context-menu .menu-list li:first-child {\n border-radius: 5px 5px 0 0;\n}\n.mind-elixir .context-menu .menu-list li:last-child {\n border-bottom: 0;\n border-radius: 0 0 5px 5px;\n}\n.mind-elixir .context-menu .menu-list li span:last-child {\n float: right;\n}\n",""]);const a=s},787:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(81),o=n.n(i),r=n(645),s=n.n(r)()(o());s.push([e.id,".mind-elixir .mobile-menu {\n position: absolute;\n left: 20px;\n bottom: 70px;\n z-index: 99;\n margin: 0;\n padding: 0;\n color: #333;\n border-radius: 5px;\n box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.2);\n overflow: hidden;\n}\n.mind-elixir .mobile-menu * {\n transition: color 0.4s, background-color 0.4s;\n}\n.mind-elixir .mobile-menu div {\n float: left;\n text-align: center;\n width: 30px;\n overflow: hidden;\n white-space: nowrap;\n padding: 8px;\n background-color: #fff;\n border-bottom: 1px solid #ecf0f1;\n}\n.mind-elixir .mobile-menu div a {\n color: #333;\n text-decoration: none;\n}\n.mind-elixir .mobile-menu div.disabled {\n color: #5e5e5e;\n background-color: #f7f7f7;\n}\n.mind-elixir .mobile-menu div.disabled:hover {\n cursor: default;\n background-color: #f7f7f7;\n}\n.mind-elixir .mobile-menu div:hover {\n cursor: pointer;\n background-color: #ecf0f1;\n}\n",""]);const a=s},301:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(81),o=n.n(i),r=n(645),s=n.n(r)()(o());s.push([e.id,"@media (prefers-color-scheme: dark) {\n .mind-elixir-toolbar {\n background: #2d3748 !important;\n color: #fff !important;\n }\n}\n.mind-elixir-toolbar {\n font-family: iconfont;\n position: absolute;\n background: #fff;\n padding: 10px;\n border-radius: 5px;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n}\n.mind-elixir-toolbar svg {\n display: inline-block;\n}\n.mind-elixir-toolbar span:active {\n opacity: 0.5;\n}\n.mind-elixir-toolbar.rb {\n right: 20px;\n bottom: 20px;\n}\n.mind-elixir-toolbar.rb span + span {\n margin-left: 10px;\n}\n.mind-elixir-toolbar.lt {\n font-size: 20px;\n left: 20px;\n top: 20px;\n}\n.mind-elixir-toolbar.lt span {\n display: block;\n}\n.mind-elixir-toolbar.lt span + span {\n margin-top: 10px;\n}\n",""]);const a=s},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(i)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&s[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},81:e=>{"use strict";e.exports=function(e){return e[1]}},379:e=>{"use strict";var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var r={},s=[],a=0;a<e.length;a++){var l=e[a],c=i.base?l[0]+i.base:l[0],d=r[c]||0,h="".concat(c," ").concat(d);r[c]=d+1;var p=n(h),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(m);else{var u=o(m,i);i.byIndex=a,t.splice(a,0,{identifier:h,updater:u,references:1})}s.push(h)}return s}function o(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var r=i(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var a=n(r[s]);t[a].references--}for(var l=i(e,o),c=0;c<r.length;c++){var d=n(r[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}r=l}}},569:e=>{"use strict";var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},857:()=>{!function(e){var t,n,i,o,r,s,a='<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><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="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><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="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><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" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><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" ></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" ></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" ></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" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><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" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><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" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><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="" ></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="" ></path></symbol></svg>',l=(l=document.getElementsByTagName("script"))[l.length-1].getAttribute("data-injectcss");if(l&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console}}function c(){r||(r=!0,i())}t=function(){var e,t,n,i;(i=document.createElement("div")).innerHTML=a,a=null,(n=i.getElementsByTagName("svg")[0])&&(n.setAttribute("aria-hidden","true"),n.style.position="absolute",n.style.width=0,n.style.height=0,n.style.overflow="hidden",e=n,(t=document.body).firstChild?(i=e,(n=t.firstChild).parentNode.insertBefore(i,n)):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(n=function(){document.removeEventListener("DOMContentLoaded",n,!1),t()},document.addEventListener("DOMContentLoaded",n,!1)):document.attachEvent&&(i=t,o=e.document,r=!1,(s=function(){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(s,50)}c()})(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,c())})}(window)},848:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg=="},295:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+"}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={id:i,exports:{}};return e[i](r,r.exports,n),r.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.b=document.baseURI||self.location.href,n.nc=void 0;var i={};return(()=>{"use strict";n.d(i,{E:()=>ve,default:()=>Me});const e=30,t={name:"Latte",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--main-color":"#444446","--main-bgcolor":"#ffffff","--color":"#777777","--bgcolor":"#f6f6f6"}};function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,""")}const r=function(e,t){if(t.id===e)return t;if(t.children&&t.children.length){for(let n=0;n<t.children.length;n++){const i=r(e,t.children[n]);if(i)return i}return null}return null},s=(e,t)=>{if(e.parent=t,e.children)for(let t=0;t<e.children.length;t++)s(e.children[t],e)};function a(e){if(e.id=h(),e.children)for(let t=0;t<e.children.length;t++)a(e.children[t])}function l(e,t,n,i){const o=i-t,r=e-n;let s=Math.atan(Math.abs(o)/Math.abs(r))/3.14*180;r<0&&o>0&&(s=180-s),r<0&&o<0&&(s=180+s),r>0&&o<0&&(s=360-s);const a=s+30,l=s-30;return{x1:n+20*Math.cos(Math.PI*a/180),y1:i-20*Math.sin(Math.PI*a/180),x2:n+20*Math.cos(Math.PI*l/180),y2:i-20*Math.sin(Math.PI*l/180)}}function c(e,t,n){let i,o;const r=(e.cy-n)/(t-e.cx);return r>e.h/e.w||r<-e.h/e.w?e.cy-n<0?(i=e.cx-e.h/2/r,o=e.cy+e.h/2):(i=e.cx+e.h/2/r,o=e.cy-e.h/2):e.cx-t<0?(i=e.cx+e.w/2,o=e.cy-e.w*r/2):(i=e.cx-e.w/2,o=e.cy+e.w*r/2),{x:i,y:o}}function d(e,t,n){let i,o;const r=(e.cy-n)/(t-e.cx);return r>e.h/e.w||r<-e.h/e.w?e.cy-n<0?(i=e.cx-e.h/2/r,o=e.cy+e.h/2):(i=e.cx+e.h/2/r,o=e.cy-e.h/2):e.cx-t<0?(i=e.cx+e.w/2,o=e.cy-e.w*r/2):(i=e.cx-e.w/2,o=e.cy+e.w*r/2),{x:i,y:o}}function h(){return((new Date).getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const p=e=>{const t=e.parent.children,n=t.indexOf(e);return{siblings:t,index:n}};function m(e){const{siblings:t,index:n}=p(e);return t.splice(n,1),t.length}function u(e){return JSON.parse(JSON.stringify(e,((e,t)=>{if("parent"!==e)return t})))}const f=document,g=(e,t)=>{const n=(t?t.mindElixirBox:f).querySelector(`[data-nodeid=me${e}]`);return n||new Error(`findEle: ${e} not found`),n},b=function(e,t){if(e.textContent=t.topic,t.style&&(e.style.color=t.style.color||"",e.style.background=t.style.background||"",e.style.fontSize=t.style.fontSize+"px",e.style.fontWeight=t.style.fontWeight||"normal"),t.image){const n=t.image;if(n.url&&n.width&&n.height){const t=f.createElement("img");t.src=n.url,t.style.width=n.width+"px",t.style.height=n.height+"px",e.appendChild(t)}}if(t.hyperLink){const n=f.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=t.hyperLink,e.appendChild(n),e.linkContainer=n}else e.linkContainer&&(e.linkContainer.remove(),e.linkContainer=null);if(t.icons&&t.icons.length){const n=f.createElement("span");n.className="icons",n.innerHTML=t.icons.map((e=>`<span>${o(e)}</span>`)).join(""),e.appendChild(n)}if(t.tags&&t.tags.length){const n=f.createElement("div");n.className="tags",n.innerHTML=t.tags.map((e=>`<span>${o(e)}</span>`)).join(""),e.appendChild(n)}t.branchColor&&(e.style.borderColor=t.branchColor)};const v=function(e){const t=f.createElement("me-epd");return t.expanded=!1!==e,t.className=!1!==e?"minus":"",t},N=document,x=document,y="http://www.w3.org/2000/svg",M=function(e,t){const n=x.createElementNS(y,"path");return n.setAttribute("d",e),n.setAttribute("stroke",t||"#666"),n.setAttribute("fill","none"),n.setAttribute("stroke-width","3"),n},C=function(e){const t=x.createElementNS(y,"svg");return t.setAttribute("class",e),t},w=function(e,t,n,i){const o=x.createElementNS(y,"line");return o.setAttribute("x1",String(e)),o.setAttribute("y1",String(t)),o.setAttribute("x2",String(n)),o.setAttribute("y2",String(i)),o.setAttribute("stroke","#bbb"),o.setAttribute("fill","none"),o.setAttribute("stroke-width","2"),o},k=function(e,t){const n=x.createElementNS(y,"path");return n.setAttribute("d",e),n.setAttribute("stroke",t||"#555"),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","square"),n.setAttribute("stroke-width","2"),n};function z(e){return{nodeData:e.isFocusMode?e.nodeDataBackup:e.nodeData,linkData:e.linkData,direction:e.direction,theme:e.theme}}const E=function(e){var t;const n=e.parentElement.parentElement;"main-node-container"===n.parentElement.className&&(null===(t=n.lastChild)||void 0===t||t.remove(),n.style.cssText="",n.className="")},j=function(e,t){if(!e)return null;const n=e.nodeObj;!1===n.expanded&&(this.expandNode(e,!0),e=g(n.id));const i=t||this.generateNewObj();n.children?n.children.push(i):n.children=[i],s(this.nodeData);const o=e.parentElement,{grp:r,top:a}=this.createWrapper(i);if("ME-PARENT"===o.tagName){if(o.children[1])o.nextSibling.appendChild(r);else{const e=this.createChildren([r]);o.appendChild(v(!0)),o.insertAdjacentElement("afterend",e)}this.linkDiv(r.offsetParent)}else"ME-ROOT"===o.tagName&&(this.judgeDirection(r,i),o.nextSibling.appendChild(r),this.linkDiv());return{newTop:a,newNodeObj:i}},L={create:function(e){return{dom:e,mousedown:!1,lastX:0,lastY:0,handleMouseMove(e){if(e.stopPropagation(),this.mousedown){if(!this.lastX)return this.lastX=e.pageX,void(this.lastY=e.pageY);const t=this.lastX-e.pageX,n=this.lastY-e.pageY;this.cb&&this.cb(t,n),this.lastX=e.pageX,this.lastY=e.pageY}},handleMouseDown(e){e.stopPropagation(),this.mousedown=!0},handleClear(e){e.stopPropagation(),this.clear()},cb:null,init(e,t){this.cb=t,this.handleClear=this.handleClear.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),e.addEventListener("mousemove",this.handleMouseMove),e.addEventListener("mouseleave",this.handleClear),e.addEventListener("mouseup",this.handleClear),this.dom.addEventListener("mousedown",this.handleMouseDown)},destory(e){e.removeEventListener("mousemove",this.handleMouseMove),e.removeEventListener("mouseleave",this.handleClear),e.removeEventListener("mouseup",this.handleClear),this.dom.removeEventListener("mousedown",this.handleMouseDown)},clear(){this.mousedown=!1,this.lastX=0,this.lastY=0}}}};let D=P;const T=function(e,t,n){let i="";const o=t.offsetTop,r=t.offsetLeft,s=t.offsetWidth,a=t.offsetHeight;for(let t=0;t<e.length;t++){const l=e[t],c=l.children[0],d=c.offsetTop,h=c.offsetLeft,p=c.offsetWidth,m=c.offsetHeight,u=l.offsetParent.className;i+=D({pT:o,pL:r,pW:s,pH:a,cT:d,cL:h,cW:p,cH:m,direction:u,isFirst:n});const f=c.children[1];if(!f)continue;if(f.style.bottom=-f.offsetHeight/2+"px","lhs"===u?f.style.left="0px":"rhs"===u&&(f.style.left=c.offsetWidth+"px"),!f.expanded)continue;const g=l.children[1].children;g.length>0&&(i+=T(g,c))}return i};function A({x1:e,y1:t,x2:n,y2:i}){return`M ${e} 10000 V ${i>t?i-20:i+20} C ${e} ${i} ${e} ${i} ${n>e?e+20:e-20} ${i} H ${n}`}function S({x1:e,y1:t,x2:n,y2:i}){return`M ${e} ${t} Q ${e} ${i} ${n} ${i}`}function I({pT:t,pL:n,pW:i,pH:o,cT:r,cL:s,cW:a,cH:l,direction:c,isFirst:d}){let h;h=d?t+o/2:t+o;const p=r+l;let m=0,u=0,f=0;return"lhs"===c?(m=n+e,u=s,f=s+a):"rhs"===c&&(m=n+i-e,u=s+a,f=s),p<h+50&&p>h-50?`M ${m} ${h} H ${f} V ${p} H ${u}`:p>=h?`M ${m} ${h} H ${f} V ${p-8} A 8 8 0 0 ${m>u?1:0} ${m>u?f-8:f+8} ${p} H ${u}`:`M ${m} ${h} H ${f} V ${p+8} A 8 8 0 0 ${m>u?0:1} ${m>u?f-8:f+8} ${p} H ${u}`}function P({pT:t,pL:n,pW:i,pH:o,cT:r,cL:s,cW:a,cH:l,direction:c,isFirst:d}){let h=0,p=0;h=d?t+o/2:t+o;const m=r+l;let u=0,f=0,g=0;const b=Math.min(Math.abs(h-m)/800,1.2)*e;return"lhs"===c?(g=n,u=g+e,f=g-e,p=s+e,`M ${u} ${h} C ${g} ${h} ${g+b} ${m} ${f} ${m} H ${p}`):(g=n+i,u=g-e,f=g+e,p=s+a-e,`M ${u} ${h} C ${g} ${h} ${g-b} ${m} ${f} ${m} H ${p}`)}const $=function(t){const n=this.mainNodeHorizontalGap,i=this.mainNodeVerticalGap,o=this.root;o.style.cssText=`top:${1e4-o.offsetHeight/2}px;left:${1e4-o.offsetWidth/2}px;`;const r=this.mainNodes.children;this.lines.innerHTML="",D=2===this.subLinkStyle?I:P;let s,a=0,l="",c=0,d=0,h=0,p=0,m=0;if(2===this.direction){let e=0,t=0,n=0,o=0;for(let s=0;s<r.length;s++){const a=r[s];"lhs"===a.className?(p+=a.offsetHeight+i,n+=a.offsetHeight,e+=1):(m+=a.offsetHeight+i,o+=a.offsetHeight,t+=1)}p>m?(this.mapHeight=p,s=1e4-p/2,l="r",c=(p-o)/(t-1)):(this.mapHeight=m,s=1e4-m/2,l="l",c=(m-n)/(e-1))}else{for(let e=0;e<r.length;e++){a+=r[e].offsetHeight+i}this.mapHeight=a,s=1e4-a/2}const u=1e4-o.offsetWidth/2-n,f=1e4+o.offsetWidth/2+n;for(let n=0;n<r.length;n++){let a=1e4;const p=1e4;let m,g;const b=r[n],v=this.theme.palette,N=b.querySelector("me-tpc").nodeObj.branchColor||v[n%v.length],x=b.offsetHeight;"lhs"===b.className?(b.style.top=s+d+"px",b.style.left=u-b.offsetWidth+"px",m=u-e,g=s+d+x/2,d+="l"===l?x+c:x+i):(b.style.top=s+h+"px",b.style.left=f+"px",m=f+e,g=s+h+x/2,h+="r"===l?x+c:x+i);let y="";if(2===this.mainLinkStyle)2===this.direction&&(a="lhs"===b.className?1e4-o.offsetWidth/6:1e4+o.offsetWidth/6),y=A({x1:a,y1:p,x2:m,y2:g});else{const e=Math.abs(g-1e4)/(1e4-s);a="lhs"===b.className?1e4-o.offsetWidth/10-.25*(1-e)*(o.offsetWidth/2):1e4+o.offsetWidth/10+.25*(1-e)*(o.offsetWidth/2),y=S({x1:a,y1:p,x2:m,y2:g})}this.lines.appendChild(M(y,N));const w=b.children[0].children[1];if(w&&(w.style.top=(w.parentNode.offsetHeight-w.offsetHeight)/2+"px","lhs"===b.className?w.style.left="-40px":w.style.right="-40px"),(!t||t===r[n])&&b.childElementCount){const e=C("subLines"),t=b.lastChild;"svg"===t.tagName&&t.remove(),b.appendChild(e);const n=b.children[0],i=b.children[1].children,o=T(i,n,!0);e.appendChild(k(o,N))}}this.linkSvgGroup.innerHTML="";for(const e in this.linkData){const t=this.linkData[e];this.createLink(g(t.from),g(t.to),!0,t)}},O={afterMoving:!1,mousedown:!1,lastX:0,lastY:0,onMove(e,t){if(this.mousedown){if(this.afterMoving=!0,!this.lastX)return this.lastX=e.pageX,void(this.lastY=e.pageY);const n=this.lastX-e.pageX,i=this.lastY-e.pageY;t.scrollTo(t.scrollLeft+n,t.scrollTop+i),this.lastX=e.pageX,this.lastY=e.pageY}},clear(){this.afterMoving=!1,this.mousedown=!1,this.lastX=0,this.lastY=0}},H=e=>"ME-PARENT"===e.parentElement.tagName||"ME-ROOT"===e.parentElement.tagName;const Y={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",clickTips:"请点击目标节点"},B={cn:Y,zh_CN:Y,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",clickTips:"請點擊目標節點"},en:{addChild:"Add child",addParent:"Add parent",addSibling:"Add sibling",removeNode:"Remove node",focus:"Focus Mode",cancelFocus:"Cancel Focus Mode",moveUp:"Move up",moveDown:"Move down",link:"Link",clickTips:"Please click the target node"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",clickTips:"Пожалуйста, нажмите на целевой узел"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",clickTips:"ターゲットノードをクリックしてください"},pt:{addChild:"Adicionar item filho",addParent:"Adicionar item pai",addSibling:"Adicionar item irmao",removeNode:"Remover item",focus:"Modo Foco",cancelFocus:"Cancelar Modo Foco",moveUp:"Mover para cima",moveDown:"Mover para baixo",link:"Link",clickTips:"Favor clicar no item alvo"}};var R=n(379),V=n.n(R),Z=n(795),W=n.n(Z),F=n(569),U=n.n(F),X=n(565),G=n.n(X),_=n(216),q=n.n(_),J=n(589),Q=n.n(J),K=n(165),ee={};ee.styleTagTransform=Q(),ee.setAttributes=G(),ee.insert=U().bind(null,"head"),ee.domAPI=W(),ee.insertStyleElement=q();V()(K.Z,ee);K.Z&&K.Z.locals&&K.Z.locals;function te(e,t){const n=(e,t,n)=>{const i=document.createElement("li");return i.id=e,i.innerHTML=`<span>${o(t)}</span><span>${o(n)}</span>`,i},i=B[e.locale]?e.locale:"en",r=B[i],s=n("cm-add_child",r.addChild,"tab"),a=n("cm-add_parent",r.addParent,""),l=n("cm-add_sibling",r.addSibling,"enter"),c=n("cm-remove_child",r.removeNode,"delete"),d=n("cm-fucus",r.focus,""),h=n("cm-unfucus",r.cancelFocus,""),p=n("cm-up",r.moveUp,"PgUp"),m=n("cm-down",r.moveDown,"Pgdn"),u=n("cm-down",r.link,""),f=document.createElement("ul");if(f.className="menu-list",f.appendChild(s),f.appendChild(a),f.appendChild(l),f.appendChild(c),t&&!t.focus||(f.appendChild(d),f.appendChild(h)),f.appendChild(p),f.appendChild(m),t&&!t.link||f.appendChild(u),t&&t.extend)for(let e=0;e<t.extend.length;e++){const i=t.extend[e],o=n(i.name,i.name,i.key||"");f.appendChild(o),o.onclick=e=>{i.onclick(e)}}const g=document.createElement("div");g.className="context-menu",g.appendChild(f),g.hidden=!0,e.container.append(g);let b=!0;e.container.oncontextmenu=function(t){if(t.preventDefault(),!e.editable)return;const n=t.target;if("ME-TPC"===n.tagName){b="ME-ROOT"===n.parentElement.tagName,b?(d.className="disabled",p.className="disabled",m.className="disabled",l.className="disabled",c.className="disabled"):(d.className="",p.className="",m.className="",l.className="",c.className=""),e.selectNode(n),g.hidden=!1;const i=f.offsetHeight,o=f.offsetWidth;i+t.clientY>window.innerHeight?(f.style.top="",f.style.bottom="0px"):(f.style.bottom="",f.style.top=t.clientY+15+"px"),o+t.clientX>window.innerWidth?(f.style.left="",f.style.right="0px"):(f.style.right="",f.style.left=t.clientX+10+"px")}},g.onclick=e=>{e.target===g&&(g.hidden=!0)},s.onclick=()=>{e.addChild(),g.hidden=!0},a.onclick=()=>{e.insertParent(),g.hidden=!0},l.onclick=()=>{b||(e.insertSibling(),g.hidden=!0)},c.onclick=()=>{b||(e.removeNode(),g.hidden=!0)},d.onclick=()=>{b||(e.focusNode(e.currentNode),g.hidden=!0)},h.onclick=()=>{e.cancelFocus(),g.hidden=!0},p.onclick=()=>{b||(e.moveUpNode(),g.hidden=!0)},m.onclick=()=>{b||(e.moveDownNode(),g.hidden=!0)},u.onclick=()=>{g.hidden=!0;const t=e.currentNode,n=(e=>{const t=document.createElement("div");return t.innerText=e,t.style.cssText="position:absolute;bottom:20px;left:50%;transform:translateX(-50%);",t})(r.clickTips);e.container.appendChild(n),e.map.addEventListener("click",(i=>{i.preventDefault(),n.remove();const o=i.target;"ME-PARENT"!==o.parentElement.tagName&&"ME-ROOT"!==o.parentElement.tagName||e.createLink(t,e.currentNode)}),{once:!0})}}var ne=n(301),ie={};ie.styleTagTransform=Q(),ie.setAttributes=G(),ie.insert=U().bind(null,"head"),ie.domAPI=W(),ie.insertStyleElement=q();V()(ne.Z,ie);ne.Z&&ne.Z.locals&&ne.Z.locals;const oe=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=`<svg class="icon" aria-hidden="true">\n <use xlink:href="#icon-${t}"></use>\n </svg>`,n};function re(e){e.container.append(function(e){const t=document.createElement("div"),n=oe("fullscreen","full"),i=oe("toCenter","living"),o=oe("zoomout","move"),r=oe("zoomin","add");return document.createElement("span").innerText="100%",t.appendChild(n),t.appendChild(i),t.appendChild(o),t.appendChild(r),t.className="mind-elixir-toolbar rb",n.onclick=()=>{e.container.requestFullscreen()},i.onclick=()=>{e.toCenter()},o.onclick=()=>{e.scaleVal<.6||e.scale(e.scaleVal-=.2)},r.onclick=()=>{e.scaleVal>1.6||e.scale(e.scaleVal+=.2)},t}(e)),e.container.append(function(e){const t=document.createElement("div"),n=oe("tbltl","left"),i=oe("tbltr","right"),o=oe("tblts","side");return t.appendChild(n),t.appendChild(i),t.appendChild(o),t.className="mind-elixir-toolbar lt",n.onclick=()=>{e.initLeft()},i.onclick=()=>{e.initRight()},o.onclick=()=>{e.initSide()},t}(e))}const se=document,ae=function(e){if(!e)return;const t=e.getElementsByClassName("insert-preview");for(const e of t||[])e.remove()},le=function(e,t){const n=t.parentElement.parentElement.contains(e);return e&&"ME-TPC"===e.tagName&&e!==t&&!n&&!0!==e.nodeObj.root};function ce(e){let t=null,n=null,i=null;const o=function(e){const t=document.createElement("div");return t.className="mind-elixir-ghost",e.map.appendChild(t),t}(e);e.map.addEventListener("dragstart",(e=>{var n;t=e.target,t.parentElement.parentElement.style.opacity="0.5",o.innerHTML=t.innerHTML,null===(n=e.dataTransfer)||void 0===n||n.setDragImage(o,0,0),O.clear()})),e.map.addEventListener("dragend",(async o=>{if(!t)return;t.parentElement.parentElement.style.opacity="1";if(o.target.style.opacity="",!i)return;ae(i);const r=t.nodeObj;switch(n){case"before":e.moveNodeBefore(t,i),e.selectNode(g(r.id));break;case"after":e.moveNodeAfter(t,i),e.selectNode(g(r.id));break;case"in":e.moveNode(t,i)}t=null})),e.map.addEventListener("dragover",((e,t)=>{let n=Date.now();return function(...i){Date.now()-n>=t&&(e(...i),n=Date.now())}})((function(e){if(!t)return;ae(i);const o=se.elementFromPoint(e.clientX,e.clientY-12);if(le(o,t)){i=o;const t=o.getBoundingClientRect().y;e.clientY>t+o.clientHeight?n="after":e.clientY>t+o.clientHeight/2&&(n="in")}else{const o=se.elementFromPoint(e.clientX,e.clientY+12);if(le(o,t)){i=o;const t=o.getBoundingClientRect().y;e.clientY<t?n="before":e.clientY<t+o.clientHeight/2&&(n="in")}else n=i=null}i&&function(e,t){if(!t)return ae(e),e;const n=e.getElementsByClassName("insert-preview"),i=`insert-preview ${t} show`;if(n.length>0)n[0].className=i;else{const t=se.createElement("div");t.className=i,e.appendChild(t)}}(i,n)}),200))}var de=n(787),he={};he.styleTagTransform=Q(),he.setAttributes=G(),he.insert=U().bind(null,"head"),he.domAPI=W(),he.insertStyleElement=q();V()(de.Z,he);de.Z&&de.Z.locals&&de.Z.locals;const pe=function(e,t){},me={moveNode(e,t){e.moveNode(ve(t.obj.fromObj.id),ve(t.obj.originParentId))},moveNodeAfter:pe,moveNodeBefore:pe,removeNode(e,t){t.originSiblingId?e.insertBefore(ve(t.originSiblingId),t.obj):e.addChild(ve(t.originParentId),t.obj)},addChild(e,t){e.removeNode(ve(t.obj.id))},copyNode(e,t){e.removeNode(ve(t.obj.id))},reshapeNode:pe,insertSibling:pe,insertBefore:pe,insertParent:pe,moveUpNode:pe,moveDownNode:pe,beginEdit:pe,finishEdit(e,t){e.setNodeTopic(ve(t.obj.id),t.origin)}};const ue={create:()=>({handlers:{},showHandler:function(){},addListener:function(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e,...t){if(this.handlers[e]instanceof Array){const n=this.handlers[e];for(let e=0;e<n.length;e++)n[e](...t)}},removeListener:function(e,t){if(!this.handlers[e])return;const n=this.handlers[e];if(t){if(n.length)for(let i=0;i<n.length;i++)n[i]===t&&this.handlers[e].splice(i,1)}else n.length=0}})};var fe=n(74),ge={};ge.styleTagTransform=Q(),ge.setAttributes=G(),ge.insert=U().bind(null,"head"),ge.domAPI=W(),ge.insertStyleElement=q();V()(fe.Z,ge);fe.Z&&fe.Z.locals&&fe.Z.locals;var be;n(857);!function(e){e.moveNode="moveNode",e.moveNodeAfter="moveNodeAfter",e.moveNodeBefore="moveNodeBefore",e.removeNode="removeNode",e.addChild="addChild",e.copyNode="copyNode",e.reshapeNode="reshapeNode",e.insertSibling="insertSibling",e.insertBefore="insertBefore",e.insertParent="insertParent",e.moveUpNode="moveUpNode",e.moveDownNode="moveDownNode",e.beginEdit="beginEdit",e.finishEdit="finishEdit"}(be||(be={}));const ve=g,Ne=document;function xe({el:e,direction:n,locale:i,draggable:o,editable:r,contextMenu:s,contextMenuOption:a,toolBar:l,keypress:c,before:d,newTopicName:h,allowUndo:p,mainLinkStyle:m,subLinkStyle:u,overflowHidden:f,mainNodeHorizontalGap:g,mainNodeVerticalGap:b,mobileMenu:v,theme:N}){let x=null;const y=Object.prototype.toString.call(e);"[object HTMLDivElement]"===y?x=e:"[object String]"===y&&(x=document.querySelector(e)),x||new Error("MindElixir: el is not a valid element"),x.className+=" mind-elixir",x.innerHTML="",x.style.setProperty("--gap","30px"),this.mindElixirBox=x,this.before=d||{},this.locale=i||"en",this.contextMenuOption=a,this.contextMenu=void 0===s||s,this.toolBar=void 0===l||l,this.keypress=void 0===c||c,this.mobileMenu=v||!1,this.direction="number"==typeof n?n:1,this.draggable=void 0===o||o,this.newTopicName=h||"new node",this.editable=void 0===r||r,this.allowUndo=void 0!==p&&p,this.currentNode=null,this.currentLink=null,this.inputDiv=null,this.scaleVal=1,this.tempDirection=null,this.mainLinkStyle=m||0,this.subLinkStyle=u||0,this.overflowHidden=f||!1,this.mainNodeHorizontalGap=g||65,this.mainNodeVerticalGap=b||25,this.bus=ue.create(),this.container=Ne.createElement("div"),this.container.className="map-container",this.theme=N||t;const M=Ne.createElement("div");var k;M.className="map-canvas",this.map=M,this.map.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.mindElixirBox.appendChild(this.container),this.root=Ne.createElement("me-root"),this.mainNodes=Ne.createElement("me-children"),this.mainNodes.className="main-node-container",this.lines=C("lines"),this.linkController=C("linkcontroller"),this.P2=Ne.createElement("div"),this.P3=Ne.createElement("div"),this.P2.className=this.P3.className="circle",this.line1=w(0,0,0,0),this.line2=w(0,0,0,0),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=C("topiclinks"),this.map.appendChild(this.root),this.map.appendChild(this.mainNodes),this.map.appendChild(this.lines),this.map.appendChild(this.linkController),this.map.appendChild(this.linkSvgGroup),this.map.appendChild(this.P2),this.map.appendChild(this.P3),this.overflowHidden?this.container.style.overflow="hidden":((k=this).map.addEventListener("click",(e=>{var t;const n=e.target;if("ME-EPD"===n.tagName)k.expandNode(n.previousSibling);else{if(!k.editable)return;H(n)?k.selectNode(n,!1,e):"path"===n.tagName?"g"===(null===(t=null==n?void 0:n.parentElement)||void 0===t?void 0:t.tagName)&&k.selectLink(n.parentElement):"circle"===n.className||(k.unselectNode(),k.hideLinkController&&k.hideLinkController())}})),k.map.addEventListener("dblclick",(e=>{if(e.preventDefault(),!k.editable)return;const t=e.target;H(t)&&k.beginEdit(t)})),k.map.addEventListener("mousemove",(e=>{"true"!==e.target.contentEditable&&O.onMove(e,k.container)})),k.map.addEventListener("mousedown",(e=>{"true"!==e.target.contentEditable&&(O.afterMoving=!1,O.mousedown=!0)})),k.map.addEventListener("mouseleave",(()=>{O.clear()})),k.map.addEventListener("mouseup",(()=>{O.clear()})))}function ye(e,t){return async function(...n){const i=this.before[t];i&&await i.apply(this,n),e.apply(this,n)}}xe.prototype={fillParent:s,getObjById:r,generateNewObj:function(){const e=h();return{topic:this.newTopicName,id:e}},insertSibling:ye((function(e,t){const n=e||this.currentNode;if(!n)return;const i=n.nodeObj;if(!0===i.root)return void this.addChild();const o=t||this.generateNewObj();!function(e,t){const{siblings:n,index:i}=p(e);n.splice(i+1,0,t)}(i,o),s(this.nodeData);const r=n.parentElement,{grp:a,top:l}=this.createWrapper(o),c=r.parentNode.parentNode;c.insertBefore(a,r.parentNode.nextSibling),"main-node-container"===c.className?(this.judgeDirection(a,o),this.linkDiv()):this.linkDiv(a.offsetParent),t||this.createInputDiv(l.children[0]),this.selectNode(l.children[0],!0),this.bus.fire("operation",{name:"insertSibling",obj:o})}),"insertSibling"),insertBefore:ye((function(e,t){const n=e||this.currentNode;if(!n)return;const i=n.nodeObj;if(!0===i.root)return void this.addChild();const o=t||this.generateNewObj();!function(e,t){const{siblings:n,index:i}=p(e);n.splice(i,0,t)}(i,o),s(this.nodeData);const r=n.parentElement,{grp:a,top:l}=this.createWrapper(o),c=r.parentNode.parentNode;c.insertBefore(a,r.parentNode),"main-node-container"===c.className?(this.judgeDirection(a,o),this.linkDiv()):this.linkDiv(a.offsetParent),t||this.createInputDiv(l.children[0]),this.selectNode(l.children[0],!0),this.bus.fire("insertBefore",{name:"insertSibling",obj:o})}),"insertBefore"),insertParent:ye((function(e,t){var n;const i=e||this.currentNode;if(!i)return;const o=i.nodeObj;if(!0===o.root)return;const r=t||this.generateNewObj();!function(e,t){const{siblings:n,index:i}=p(e);n[i]=t,t.children=[e]}(o,r),s(this.nodeData);const a=i.parentElement.parentElement,{grp:l,top:c}=this.createWrapper(r,!0);c.appendChild(v(!0)),a.insertAdjacentElement("afterend",l);const d=this.createChildren([a]);c.insertAdjacentElement("afterend",d),"main-node-container"===a.parentNode.className?(l.className=a.className,a.className="",null===(n=a.querySelector(".subLines"))||void 0===n||n.remove(),this.linkDiv()):this.linkDiv(l.offsetParent),t||this.createInputDiv(c.children[0]),this.selectNode(c.children[0],!0),this.bus.fire("operation",{name:"insertParent",obj:r})}),"insertParent"),addChild:ye((function(e,t){const n=e||this.currentNode;if(!n)return;const i=j.call(this,n,t);if(!i)return;const{newTop:o,newNodeObj:r}=i;this.bus.fire("operation",{name:"addChild",obj:r}),t||this.createInputDiv(o.firstChild),this.selectNode(o.firstChild,!0)}),"addChild"),copyNode:ye((function(e,t){const n=u(e.nodeObj);a(n);const i=j.call(this,t,n);if(!i)return;const{newNodeObj:o}=i;this.bus.fire("operation",{name:"copyNode",obj:o})}),"copyNode"),moveNode:ye((function(e,t){var n;const i=e.nodeObj,o=t.nodeObj,r=null===(n=null==i?void 0:i.parent)||void 0===n?void 0:n.id;if(!1===o.expanded&&(this.expandNode(t,!0),e=g(i.id),t=g(o.id)),!function(e,t){let n=!0;for(;t.parent;){if(t.parent===e){n=!1;break}t=t.parent}return n}(i,o))return;!function(e,t){m(e),t.children?t.children.push(e):t.children=[e]}(i,o),s(this.nodeData);const a=e.parentElement,l=t.parentElement;if("ME-PARENT"===l.tagName)if(E(e),l.children[1])l.nextSibling.appendChild(a.parentElement);else{const e=this.createChildren([a.parentElement]);l.appendChild(v(!0)),l.parentElement.insertBefore(e,l.nextSibling)}else"ME-ROOT"===l.tagName&&(this.judgeDirection(a.parentElement,i),l.nextSibling.appendChild(a.parentElement));this.linkDiv(),this.bus.fire("operation",{name:"moveNode",obj:{fromObj:i,toObj:o,originParentId:r}})}),"moveNode"),removeNode:ye((function(e){var t;const n=e||this.currentNode;if(!n)return;const i=n.nodeObj;if(!0===i.root)throw new Error("Can not remove root node");const o=i.parent.children,r=o.findIndex((e=>e===i)),s=o[r+1],a=s&&s.id,l=m(i),c=n.parentNode;if(0===l){const e=c.parentNode.parentNode.previousSibling;"ME-ROOT"!==e.tagName&&e.children[1].remove(),this.selectParent()}else this.selectPrevSibling()||this.selectNextSibling()||this.selectParent();for(const e in this.linkData){const t=this.linkData[e];if(t.from===i.id||t.to===i.id){const t=this.mindElixirBox.querySelector(`[data-linkid=${this.linkData[e].id}]`);this.removeLink(t)}}c.parentNode.remove(),this.linkDiv(),this.bus.fire("operation",{name:"removeNode",obj:i,originSiblingId:a,originParentId:null===(t=null==i?void 0:i.parent)||void 0===t?void 0:t.id})}),"removeNode"),moveUpNode:ye((function(e){const t=e||this.currentNode;if(!t)return;const n=t.parentNode.parentNode,i=t.nodeObj;!function(e){const{siblings:t,index:n}=p(e),i=t[n];0===n?(t[n]=t[t.length-1],t[t.length-1]=i):(t[n]=t[n-1],t[n-1]=i)}(i),n.parentNode.insertBefore(n,n.previousSibling),this.linkDiv(),this.bus.fire("operation",{name:"moveUpNode",obj:i})}),"moveUpNode"),moveDownNode:ye((function(e){const t=e||this.currentNode;if(!t)return;const n=t.parentNode.parentNode,i=t.nodeObj;!function(e){const{siblings:t,index:n}=p(e),i=t[n];n===t.length-1?(t[n]=t[0],t[0]=i):(t[n]=t[n+1],t[n+1]=i)}(i),n.nextSibling?n.nextSibling.insertAdjacentElement("afterend",n):n.parentNode.prepend(n),this.linkDiv(),this.bus.fire("operation",{name:"moveDownNode",obj:i})}),"moveDownNode"),beginEdit:ye((function(e){const t=e||this.currentNode;t&&this.createInputDiv(t)}),"beginEdit"),moveNodeBefore:ye((function(e,t){const n=e.nodeObj,i=t.nodeObj,o=n.parent.id;!function(e,t){m(e);const{siblings:n,index:i}=p(t);n.splice(i,0,e)}(n,i),s(this.nodeData),E(e);const r=e.parentElement.parentNode,a=t.parentElement.parentNode;a.insertAdjacentElement("beforebegin",r),a.className&&(r.className=a.className),this.linkDiv(),this.bus.fire("operation",{name:"moveNodeBefore",obj:{fromObj:n,toObj:i,originParentId:o}})}),"moveNodeBefore"),moveNodeAfter:ye((function(e,t){const n=e.nodeObj,i=t.nodeObj,o=n.parent.id;!function(e,t){m(e);const{siblings:n,index:i}=p(t);n.splice(i+1,0,e)}(n,i),s(this.nodeData),E(e);const r=e.parentElement.parentElement,a=t.parentElement.parentElement;a.insertAdjacentElement("afterend",r),a.className&&(r.className=a.className),this.linkDiv(),this.bus.fire("operation",{name:"moveNodeAfter",obj:{fromObj:n,toObj:i,originParentId:o}})}),"moveNodeAfter"),reshapeNode:function(e,t){const n=e.nodeObj,i=u(n);i.style&&t.style&&(t.style=Object.assign(i.style,t.style));const o=Object.assign(n,t);b(e,o),this.linkDiv(),this.bus.fire("operation",{name:"reshapeNode",obj:o,origin:i})},judgeDirection:function(e,t){if(0===this.direction)e.className="lhs";else if(1===this.direction)e.className="rhs";else if(2===this.direction){N.querySelectorAll(".lhs").length<=N.querySelectorAll(".rhs").length?(e.className="lhs",t.direction=0):(e.className="rhs",t.direction=1)}},setNodeTopic:function(e,t){e.childNodes[0].textContent=t,e.nodeObj.topic=t,this.linkDiv()},createLink:function(e,t,n,i){const o=this.map.getBoundingClientRect();if(!e||!t)return;const r=e.getBoundingClientRect(),s=t.getBoundingClientRect(),a=(r.x+r.width/2-o.x)/this.scaleVal,p=(r.y+r.height/2-o.y)/this.scaleVal,m=(s.x+s.width/2-o.x)/this.scaleVal,u=(s.y+s.height/2-o.y)/this.scaleVal;let f,g,b,v;n&&i?(f=a+i.delta1.x,g=p+i.delta1.y,b=m+i.delta2.x,v=u+i.delta2.y):(p+u)/2-p<=r.height/2?(f=(r.x+r.width-o.x)/this.scaleVal+100,g=p,b=(s.x+s.width-o.x)/this.scaleVal+100,v=u):(f=(a+m)/2,g=(p+u)/2,b=(a+m)/2,v=(p+u)/2);const N={cx:a,cy:p,w:r.width,h:r.height},M={cx:m,cy:u,w:s.width,h:s.height},C=c(N,f,g),w=C.x,k=C.y,z=d(M,b,v),E=z.x,j=z.y,L=l(b,v,E,j),D={id:"",label:"",from:e.nodeObj.id,to:t.nodeObj.id,delta1:{x:f-a,y:g-p},delta2:{x:b-m,y:v-u}},T=function(e,t){const n=x.createElementNS(y,"g"),i=x.createElementNS(y,"path"),o=x.createElementNS(y,"path");return o.setAttribute("d",t),o.setAttribute("stroke","rgb(235, 95, 82)"),o.setAttribute("fill","none"),o.setAttribute("stroke-linecap","cap"),o.setAttribute("stroke-width","2"),i.setAttribute("d",e),i.setAttribute("stroke","rgb(235, 95, 82)"),i.setAttribute("fill","none"),i.setAttribute("stroke-linecap","cap"),i.setAttribute("stroke-width","2"),n.appendChild(i),n.appendChild(o),n}(`M ${w} ${k} C ${f} ${g} ${b} ${v} ${E} ${j}`,`M ${L.x1} ${L.y1} L ${E} ${j} L ${L.x2} ${L.y2}`);n&&i?(D.id=i.id,this.linkData[i.id]=D):(D.id=h(),this.linkData[D.id]=D,this.currentLink=T),T.linkObj=D,T.dataset.linkid=D.id,this.linkSvgGroup.appendChild(T),n||this.showLinkController(f,g,b,v,D,N,M)},removeLink:function(e){let t;if(t=e||this.currentLink,!t)return;this.hideLinkController();const n=t.linkObj.id;delete this.linkData[n],t.remove(),t=null},selectLink:function(e){this.currentLink=e;const t=e.linkObj;if(!t)return;const n=t.from,i=t.to,o=this.map.getBoundingClientRect(),r=g(n).getBoundingClientRect(),s=g(i).getBoundingClientRect(),a=(r.x+r.width/2-o.x)/this.scaleVal,l=(r.y+r.height/2-o.y)/this.scaleVal,c=(s.x+s.width/2-o.x)/this.scaleVal,d=(s.y+s.height/2-o.y)/this.scaleVal,h={cx:a,cy:l,w:r.width,h:r.height},p={cx:c,cy:d,w:s.width,h:s.height},m=a+t.delta1.x,u=l+t.delta1.y,f=c+t.delta2.x,b=d+t.delta2.y;this.showLinkController(m,u,f,b,t,h,p)},hideLinkController:function(){this.linkController.style.display="none",this.P2.style.display="none",this.P3.style.display="none"},showLinkController:function(e,t,n,i,o,r,s){this.linkController.style.display="initial",this.P2.style.display="initial",this.P3.style.display="initial";const a=c(r,e,t);let h=a.x,p=a.y;const m=d(s,n,i);let u=m.x,f=m.y;this.P2.style.cssText=`top:${t}px;left:${e}px;`,this.P3.style.cssText=`top:${i}px;left:${n}px;`,this.line1.setAttribute("x1",h),this.line1.setAttribute("y1",p),this.line1.setAttribute("x2",e),this.line1.setAttribute("y2",t),this.line2.setAttribute("x1",n),this.line2.setAttribute("y1",i),this.line2.setAttribute("x2",u),this.line2.setAttribute("y2",f),this.helper1&&(this.helper1.destory(this.map),this.helper2.destory(this.map)),this.helper1=L.create(this.P2),this.helper2=L.create(this.P3),this.helper1.init(this.map,((s,a)=>{var l;e-=s/this.scaleVal,t-=a/this.scaleVal;const d=c(r,e,t);h=d.x,p=d.y,this.P2.style.top=t+"px",this.P2.style.left=e+"px",null===(l=this.currentLink)||void 0===l||l.children[0].setAttribute("d",`M ${h} ${p} C ${e} ${t} ${n} ${i} ${u} ${f}`),this.line1.setAttribute("x1",h),this.line1.setAttribute("y1",p),this.line1.setAttribute("x2",e),this.line1.setAttribute("y2",t),o.delta1.x=e-r.cx,o.delta1.y=t-r.cy})),this.helper2.init(this.map,((r,a)=>{var c,m;n-=r/this.scaleVal,i-=a/this.scaleVal;const g=d(s,n,i);u=g.x,f=g.y;const b=l(n,i,u,f);this.P3.style.top=i+"px",this.P3.style.left=n+"px",null===(c=this.currentLink)||void 0===c||c.children[0].setAttribute("d",`M ${h} ${p} C ${e} ${t} ${n} ${i} ${u} ${f}`),null===(m=this.currentLink)||void 0===m||m.children[1].setAttribute("d",`M ${b.x1} ${b.y1} L ${u} ${f} L ${b.x2} ${b.y2}`),this.line2.setAttribute("x1",n),this.line2.setAttribute("y1",i),this.line2.setAttribute("x2",u),this.line2.setAttribute("y2",f),o.delta2.x=n-s.cx,o.delta2.y=i-s.cy}))},layout:function(){this.root.innerHTML="",this.mainNodes.innerHTML="";const e=this.createTopic(this.nodeData);b(e,this.nodeData),e.draggable=!1,this.root.appendChild(e);const t=this.nodeData.children;if(t&&0!==t.length){if(2===this.direction){let e=0,n=0;t.map((t=>{0===t.direction?e+=1:1===t.direction?n+=1:e<=n?(t.direction=0,e+=1):(t.direction=1,n+=1)}))}this.layoutChildren(t,this.mainNodes,this.direction)}},linkDiv:$,createInputDiv:function(e){if(!e)return;const t=f.createElement("div"),n=e.childNodes[0].textContent;e.appendChild(t),t.id="input-box",t.textContent=n,t.contentEditable="true",t.spellcheck=!1,t.style.cssText=`min-width:${e.offsetWidth-8}px;`,0===this.direction&&(t.style.right="0"),t.focus(),function(e){const t=f.createRange();t.selectNodeContents(e);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}(t),this.inputDiv=t,this.bus.fire("operation",{name:"beginEdit",obj:e.nodeObj}),t.addEventListener("keydown",(e=>{var t;e.stopPropagation();const n=e.key;if("Enter"===n||"Tab"===n){if(e.shiftKey)return;e.preventDefault(),null===(t=this.inputDiv)||void 0===t||t.blur(),this.map.focus()}})),t.addEventListener("blur",(()=>{var i;if(!t)return;const o=e.nodeObj,r=(null===(i=t.textContent)||void 0===i?void 0:i.trim())||"";o.topic=""===r?n:r,t.remove(),this.inputDiv=null,r!==n&&(e.childNodes[0].textContent=o.topic,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:o,origin:n}))}))},layoutChildren:function(e,t,n){let i;i=t||N.createElement("me-children");for(let t=0;t<e.length;t++){const o=e[t],r=N.createElement("me-wrapper");0===n?r.className="lhs":1===n?r.className="rhs":2===n&&(0===o.direction?r.className="lhs":1===o.direction&&(r.className="rhs"));const s=this.createParent(o);if(o.children&&o.children.length>0){if(s.appendChild(v(o.expanded)),r.appendChild(s),!1!==o.expanded){const e=this.layoutChildren(o.children);r.appendChild(e)}}else r.appendChild(s);i.appendChild(r)}return i},createWrapper:function(e,t){const n=f.createElement("me-wrapper"),i=this.createParent(e);if(n.appendChild(i),!t&&e.children&&e.children.length>0&&(i.appendChild(v(e.expanded)),!1!==e.expanded)){const t=this.layoutChildren(e.children);n.appendChild(t)}return{grp:n,top:i}},createParent:function(e){const t=f.createElement("me-parent"),n=this.createTopic(e);return b(n,e),t.appendChild(n),t},createChildren:function(e){const t=f.createElement("me-children");return t.append(...e),t},createTopic:function(e){const t=f.createElement("me-tpc");return t.nodeObj=e,t.dataset.nodeid="me"+e.id,t.draggable=this.draggable,t},selectNode:function(e,t,n){if(e){if("string"==typeof e){const t=g(e);if(!t)return;return this.selectNode(t)}this.currentNode&&(this.currentNode.className=""),e.className="selected",e.scrollIntoView({block:"nearest",inline:"nearest"}),this.currentNode=e,t?this.bus.fire("selectNewNode",e.nodeObj):this.bus.fire("selectNode",e.nodeObj,n)}},unselectNode:function(){this.currentNode&&(this.currentNode.className=""),this.currentNode=null,this.bus.fire("unselectNode")},selectNextSibling:function(){if(!this.currentNode||"meroot"===this.currentNode.dataset.nodeid)return!1;const e=this.currentNode.parentElement.parentElement.nextSibling;let t;const n=this.currentNode.parentElement.parentElement;if("rhs"===n.className||"lhs"===n.className){const e=this.mindElixirBox.querySelectorAll("."+n.className),i=Array.from(e).indexOf(n);if(!(i+1<e.length))return!1;t=e[i+1].firstChild.firstChild}else{if(!e)return!1;t=e.firstChild.firstChild}return this.selectNode(t),!0},selectPrevSibling:function(){if(!this.currentNode||"meroot"===this.currentNode.dataset.nodeid)return!1;const e=this.currentNode.parentElement.parentElement.previousSibling;let t;const n=this.currentNode.parentElement.parentElement;if("rhs"===n.className||"lhs"===n.className){const e=this.mindElixirBox.querySelectorAll("."+n.className),i=Array.from(e).indexOf(n);if(!(i-1>=0))return!1;t=e[i-1].firstChild.firstChild}else{if(!e)return!1;t=e.firstChild.firstChild}return this.selectNode(t),!0},selectFirstChild:function(){if(!this.currentNode)return;const e=this.currentNode.parentElement.nextSibling;if(e&&e.firstChild){const t=e.firstChild.firstChild.firstChild;this.selectNode(t)}},selectParent:function(){if(!this.currentNode||"meroot"===this.currentNode.dataset.nodeid)return;const e=this.currentNode.parentElement.parentElement.parentElement.previousSibling;if(e){const t=e.firstChild;this.selectNode(t)}},getDataString:function(){const e=z(this);return JSON.stringify(e,((e,t)=>{if("parent"!==e)return"from"===e||"to"===e?t.nodeObj.id:t}))},getData:function(){return JSON.parse(this.getDataString())},getDataMd:function(){const e=z(this).nodeData;let t="# "+e.topic+"\n\n";return function e(n,i){for(let o=0;o<n.length;o++)t+=i<=6?"".padStart(i,"#")+" "+n[o].topic+"\n\n":"".padStart(i-7,"\t")+"- "+n[o].topic+"\n",n[o].children&&e(n[o].children||[],i+1)}(e.children||[],2),t},scale:function(e){this.scaleVal=e,this.map.style.transform="scale("+e+")"},toCenter:function(){this.container.scrollTo(1e4-this.container.offsetWidth/2,1e4-this.container.offsetHeight/2)},focusNode:function(e){e.nodeObj.root||(null===this.tempDirection&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=e.nodeObj,this.nodeData.root=!0,this.initRight(),this.toCenter())},cancelFocus:function(){this.isFocusMode=!1,null!==this.tempDirection&&(delete this.nodeData.root,this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},initLeft:function(){this.direction=0,this.refresh()},initRight:function(){this.direction=1,this.refresh()},initSide:function(){this.direction=2,this.refresh()},setLocale:function(e){this.locale=e,this.refresh()},enableEdit:function(){this.editable=!0},disableEdit:function(){this.editable=!1},expandNode:function(e,t){const n=e.nodeObj;"boolean"==typeof t?n.expanded=t:!1!==n.expanded?n.expanded=!1:n.expanded=!0,this.layout(),this.linkDiv(),this.bus.fire("expandNode",n)},refresh:function(e){e&&(this.nodeData=e.nodeData,this.linkData=e.linkData||{}),this.fillParent(this.nodeData),this.layout(),this.linkDiv()},findEle:g,install:function(e){e(this)},init(e){if(!e||!e.nodeData)return new Error("MindElixir: `data` is required");var t;void 0!==e.direction&&(this.direction=e.direction),e.theme&&(this.theme=e.theme),this.nodeData=e.nodeData,this.linkData=e.linkData||{},this.toolBar&&re(this),this.keypress&&function(e){const t={13:()=>{e.insertSibling()},9:()=>{e.addChild()},113:()=>{e.beginEdit()},38:()=>{e.selectPrevSibling()},40:()=>{e.selectNextSibling()},37:()=>{e.currentNode&&("rhs"===e.currentNode.offsetParent.offsetParent.className?e.selectParent():("lhs"===e.currentNode.offsetParent.offsetParent.className||e.currentNode.nodeObj.root)&&e.selectFirstChild())},39:()=>{e.currentNode&&("rhs"===e.currentNode.offsetParent.offsetParent.className||e.currentNode.nodeObj.root?e.selectFirstChild():"lhs"===e.currentNode.offsetParent.offsetParent.className&&e.selectParent())},33(){e.moveUpNode()},34(){e.moveDownNode()},67:t=>{(t.metaKey||t.ctrlKey)&&(e.waitCopy=e.currentNode)},86:t=>{e.waitCopy&&e.currentNode&&(t.metaKey||t.ctrlKey)&&(e.copyNode(e.waitCopy,e.currentNode),e.waitCopy=null)},187:t=>{if(t.metaKey||t.ctrlKey){if(e.scaleVal>1.6)return;e.scale(e.scaleVal+=.2)}},189:t=>{if(t.metaKey||t.ctrlKey){if(e.scaleVal<.6)return;e.scale(e.scaleVal-=.2)}}};e.map.onkeydown=n=>{if(n.preventDefault(),e.editable&&n.target===n.currentTarget)if(8===n.keyCode||46===n.keyCode)e.currentLink?e.removeLink():e.removeNode();else{const e=t[n.keyCode];e&&e(n)}}}(this),this.allowUndo&&((t=this).history=[],t.isUndo=!1,t.undo=function(){const e=t.history.pop();e&&(t.isUndo=!0,me[e.name]?me[e.name](t,e):t.isUndo=!1)},t.bus.addListener("operation",(e=>{t.isUndo?t.isUndo=!1:["moveNode","removeNode","addChild","finishEdit","editStyle","editTags","editIcons"].includes(e.name)&&t.history.push(e)})),t.map.addEventListener("keydown",(e=>{t.allowUndo&&(e.metaKey||e.ctrlKey)&&"z"===e.key&&t.undo()}))),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&this.mobileMenu?function(e,t){const n=(e,t)=>{const n=document.createElement("div");return n.id=e,n.innerHTML=`<svg class="icon" aria-hidden="true">\n <use xlink:href="#icon-${t}"></use>\n </svg>`,n},i=n("cm-add_child","zijiedian"),o=n("cm-add_sibling","tongjijiedian-"),r=n("cm-remove_child","shanchu2"),s=n("cm-up","rising"),a=n("cm-down","falling"),l=n("cm-edit","edit"),c=document.createElement("ul");if(c.className="menu-list",t&&t.extend)for(let e=0;e<t.extend.length;e++){const i=t.extend[e],o=n(i.name,i.name);c.appendChild(o),o.onclick=e=>{i.onclick(e)}}const d=document.createElement("mmenu");d.className="mobile-menu",d.appendChild(i),d.appendChild(o),d.appendChild(r),d.appendChild(s),d.appendChild(a),d.appendChild(l),d.hidden=!0,e.container.append(d);let h=!0;e.bus.addListener("unselectNode",(function(){d.hidden=!0})),e.bus.addListener("selectNode",(function(e){d.hidden=!1,h=!!e.root})),d.onclick=e=>{e.target===d&&(d.hidden=!0)},i.onclick=()=>{e.addChild()},o.onclick=()=>{h||e.insertSibling()},r.onclick=()=>{h||e.removeNode()},s.onclick=t=>{h||e.moveUpNode()},a.onclick=t=>{h||e.moveDownNode()},l.onclick=t=>{e.beginEdit()}}(this):this.contextMenu&&te(this,this.contextMenuOption),this.draggable&&ce(this);const n=this.theme.cssVar,i=Object.keys(n);for(let e=0;e<i.length;e++){const t=i[e];this.mindElixirBox.style.setProperty(t,n[t])}s(this.nodeData),this.toCenter(),this.layout(),this.linkDiv()}},xe.LEFT=0,xe.RIGHT=1,xe.SIDE=2,xe.version="2.0.6",xe.E=g,xe.new=e=>({nodeData:{id:h(),topic:e||"new topic",root:!0,children:[]},linkData:{}});const Me=xe})(),i=i.default})()));
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(".mind-elixir{--gap: 30px;--root-radius: 30px;--main-radius: 20px;--root-color: #ffffff;--root-bgcolor: #4c4f69;--main-color: #444446;--main-bgcolor: #ffffff;--topic-padding: 3px;--color: #777777;--bgcolor: #f6f6f6;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif}.mind-elixir .hyper-link{text-decoration:none}.map-container{-webkit-user-select:none;user-select:none;height:100%;width:100%;overflow:scroll;font-size:15px}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{box-shadow:0 0 0 2px #4dc4ff}.map-container .lhs{direction:rtl}.map-container .lhs me-tpc{direction:ltr}.map-container .map-canvas{height:20000px;width:20000px;position:relative;-webkit-user-select:none;user-select:none;transition:transform .3s;transform:scale(1);background-color:var(--bgcolor)}.map-container .map-canvas me-nodes{position:absolute;display:flex;justify-content:center;align-items:center;height:fit-content;width:fit-content}.map-container .map-canvas me-root{padding:10px var(--gap);color:var(--root-color);background-color:var(--root-bgcolor);border-radius:var(--root-radius)}.map-container .map-canvas me-root me-tpc{display:block;font-size:25px;white-space:pre-wrap}.map-container .map-canvas me-root me-tpc #input-box{padding:10px var(--gap)}.map-container me-main>me-wrapper{position:relative;margin:20px 65px}.map-container me-main>me-wrapper>me-parent{margin:var(--gap);background-color:var(--main-bgcolor);border:2px solid var(--main-color);border-radius:var(--main-radius);padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);color:var(--main-color);padding:8px var(--gap)}.map-container me-main>me-wrapper>me-parent>me-tpc #input-box{padding:8px var(--gap)}.map-container me-wrapper{display:block;pointer-events:none}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--gap);margin-top:10px}.map-container me-parent me-tpc{position:relative;display:block;border-radius:3px;color:var(--color);pointer-events:all;max-width:800px;white-space:pre-wrap;padding:var(--topic-padding);line-height:1.2}.map-container me-parent me-tpc>div,.map-container me-parent me-tpc>span,.map-container me-parent me-tpc>img{pointer-events:none}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}.map-container me-parent me-epd.minus:hover{opacity:.8}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller{pointer-events:none}.map-container .topiclinks g,.map-container .linkcontroller g{pointer-events:all}.map-container .lines,.map-container .subLines{pointer-events:none;z-index:-1}.map-container .topiclinks *,.map-container .linkcontroller *{z-index:100}.map-container .topiclinks g{cursor:pointer}.map-container #input-box{position:absolute;top:0;left:0;padding:var(--topic-padding);background-color:#fff;color:#666;width:max-content;max-width:800px;z-index:11;direction:ltr;-webkit-user-select:auto;user-select:auto}.map-container me-tpc>img{pointer-events:none;display:block;margin-top:8px}.map-container .circle{position:absolute;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#aaa;cursor:pointer}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 3px 0 0;font-size:12px;line-height:16px}.map-container .icons{display:inline-block;direction:ltr;margin-right:10px}.map-container .mind-elixir-ghost{position:fixed;top:-100%;left:-100%;box-sizing:content-box;opacity:.5;background-color:#f6f6f6;max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px;border:#666666 2px solid}.mind-elixir .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.mind-elixir .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;font:300 15px Roboto,sans-serif;color:#333;box-shadow:0 12px 15px #0003}.mind-elixir .context-menu .menu-list *{transition:color .4s,background-color .4s}.mind-elixir .context-menu .menu-list li{min-width:150px;overflow:hidden;white-space:nowrap;padding:6px 10px;background-color:#fff;border-bottom:1px solid #ecf0f1}.mind-elixir .context-menu .menu-list li a{color:#333;text-decoration:none}.mind-elixir .context-menu .menu-list li.disabled{color:#5e5e5e;background-color:#f7f7f7}.mind-elixir .context-menu .menu-list li.disabled:hover{cursor:default;background-color:#f7f7f7}.mind-elixir .context-menu .menu-list li:hover{cursor:pointer;background-color:#ecf0f1}.mind-elixir .context-menu .menu-list li:first-child{border-radius:5px 5px 0 0}.mind-elixir .context-menu .menu-list li:last-child{border-bottom:0;border-radius:0 0 5px 5px}.mind-elixir .context-menu .menu-list li span:last-child{float:right}.mind-elixir .mobile-menu{position:absolute;left:20px;bottom:70px;z-index:99;margin:0;padding:0;color:#333;border-radius:5px;box-shadow:0 12px 15px #0003;overflow:hidden}.mind-elixir .mobile-menu *{transition:color .4s,background-color .4s}.mind-elixir .mobile-menu div{float:left;text-align:center;width:30px;overflow:hidden;white-space:nowrap;padding:8px;background-color:#fff;border-bottom:1px solid #ecf0f1}.mind-elixir .mobile-menu div a{color:#333;text-decoration:none}.mind-elixir .mobile-menu div.disabled{color:#5e5e5e;background-color:#f7f7f7}.mind-elixir .mobile-menu div.disabled:hover{cursor:default;background-color:#f7f7f7}.mind-elixir .mobile-menu div:hover{cursor:pointer;background-color:#ecf0f1}@media (prefers-color-scheme: dark){.mind-elixir-toolbar{background:#2d3748!important;color:#fff!important}}.mind-elixir-toolbar{font-family:iconfont;position:absolute;background:#fff;padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}")),document.head.appendChild(i)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(e) {
|
|
3
|
+
var t, n, i, o, s, r, a = '<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><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="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><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="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><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" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><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" ></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" ></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" ></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" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><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" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><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" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><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="" ></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="" ></path></symbol></svg>', l = (l = document.getElementsByTagName("script"))[l.length - 1].getAttribute("data-injectcss");
|
|
4
|
+
if (l && !e.__iconfont__svg__cssinject__) {
|
|
5
|
+
e.__iconfont__svg__cssinject__ = !0;
|
|
6
|
+
try {
|
|
7
|
+
document.write(
|
|
8
|
+
"<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>"
|
|
9
|
+
);
|
|
10
|
+
} catch (c) {
|
|
11
|
+
console && console.log(c);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function u() {
|
|
15
|
+
s || (s = !0, i());
|
|
16
|
+
}
|
|
17
|
+
t = function() {
|
|
18
|
+
var c, h, d, p;
|
|
19
|
+
(p = document.createElement("div")).innerHTML = a, a = null, (d = p.getElementsByTagName("svg")[0]) && (d.setAttribute("aria-hidden", "true"), d.style.position = "absolute", d.style.width = 0, d.style.height = 0, d.style.overflow = "hidden", c = d, (h = document.body).firstChild ? (p = c, (d = h.firstChild).parentNode.insertBefore(p, d)) : h.appendChild(c));
|
|
20
|
+
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (n = function() {
|
|
21
|
+
document.removeEventListener("DOMContentLoaded", n, !1), t();
|
|
22
|
+
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (i = t, o = e.document, s = !1, (r = function() {
|
|
23
|
+
try {
|
|
24
|
+
o.documentElement.doScroll("left");
|
|
25
|
+
} catch {
|
|
26
|
+
return void setTimeout(r, 50);
|
|
27
|
+
}
|
|
28
|
+
u();
|
|
29
|
+
})(), o.onreadystatechange = function() {
|
|
30
|
+
o.readyState == "complete" && (o.onreadystatechange = null, u());
|
|
31
|
+
});
|
|
32
|
+
})(window);
|
|
33
|
+
const x = 0, P = 1, _ = 2, M = 30, w = 8, le = {
|
|
34
|
+
name: "Latte",
|
|
35
|
+
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
36
|
+
cssVar: {
|
|
37
|
+
"--main-color": "#444446",
|
|
38
|
+
"--main-bgcolor": "#ffffff",
|
|
39
|
+
"--color": "#777777",
|
|
40
|
+
"--bgcolor": "#f6f6f6"
|
|
41
|
+
}
|
|
42
|
+
}, ce = {
|
|
43
|
+
name: "Dark",
|
|
44
|
+
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
45
|
+
cssVar: {
|
|
46
|
+
"--main-color": "#ffffff",
|
|
47
|
+
"--main-bgcolor": "#4c4f69",
|
|
48
|
+
"--color": "#cccccc",
|
|
49
|
+
"--bgcolor": "#252526"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function q(e) {
|
|
53
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
54
|
+
}
|
|
55
|
+
const Ce = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), ae = function(e, t) {
|
|
56
|
+
if (t.id === e)
|
|
57
|
+
return t;
|
|
58
|
+
if (t.children && t.children.length) {
|
|
59
|
+
for (let n = 0; n < t.children.length; n++) {
|
|
60
|
+
const i = ae(e, t.children[n]);
|
|
61
|
+
if (i)
|
|
62
|
+
return i;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
} else
|
|
66
|
+
return null;
|
|
67
|
+
}, L = (e, t) => {
|
|
68
|
+
if (e.parent = t, e.children)
|
|
69
|
+
for (let n = 0; n < e.children.length; n++)
|
|
70
|
+
L(e.children[n], e);
|
|
71
|
+
};
|
|
72
|
+
function de(e) {
|
|
73
|
+
if (e.id = I(), e.children)
|
|
74
|
+
for (let t = 0; t < e.children.length; t++)
|
|
75
|
+
de(e.children[t]);
|
|
76
|
+
}
|
|
77
|
+
const Ee = (e, t) => {
|
|
78
|
+
let n = Date.now();
|
|
79
|
+
return function(...i) {
|
|
80
|
+
Date.now() - n >= t && (e(...i), n = Date.now());
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
function he(e, t, n, i) {
|
|
84
|
+
const o = i - t, s = e - n;
|
|
85
|
+
let r = Math.atan(Math.abs(o) / Math.abs(s)) / 3.14 * 180;
|
|
86
|
+
s < 0 && o > 0 && (r = 180 - r), s < 0 && o < 0 && (r = 180 + r), s > 0 && o < 0 && (r = 360 - r);
|
|
87
|
+
const a = 20, l = 30, u = r + l, c = r - l;
|
|
88
|
+
return {
|
|
89
|
+
x1: n + Math.cos(Math.PI * u / 180) * a,
|
|
90
|
+
y1: i - Math.sin(Math.PI * u / 180) * a,
|
|
91
|
+
x2: n + Math.cos(Math.PI * c / 180) * a,
|
|
92
|
+
y2: i - Math.sin(Math.PI * c / 180) * a
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function U(e, t, n) {
|
|
96
|
+
let i, o;
|
|
97
|
+
const s = (e.cy - n) / (t - e.cx);
|
|
98
|
+
return s > e.h / e.w || s < -e.h / e.w ? e.cy - n < 0 ? (i = e.cx - e.h / 2 / s, o = e.cy + e.h / 2) : (i = e.cx + e.h / 2 / s, o = e.cy - e.h / 2) : e.cx - t < 0 ? (i = e.cx + e.w / 2, o = e.cy - e.w * s / 2) : (i = e.cx - e.w / 2, o = e.cy + e.w * s / 2), {
|
|
99
|
+
x: i,
|
|
100
|
+
y: o
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function G(e, t, n) {
|
|
104
|
+
let i, o;
|
|
105
|
+
const s = (e.cy - n) / (t - e.cx);
|
|
106
|
+
return s > e.h / e.w || s < -e.h / e.w ? e.cy - n < 0 ? (i = e.cx - e.h / 2 / s, o = e.cy + e.h / 2) : (i = e.cx + e.h / 2 / s, o = e.cy - e.h / 2) : e.cx - t < 0 ? (i = e.cx + e.w / 2, o = e.cy - e.w * s / 2) : (i = e.cx - e.w / 2, o = e.cy + e.w * s / 2), {
|
|
107
|
+
x: i,
|
|
108
|
+
y: o
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function I() {
|
|
112
|
+
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
113
|
+
}
|
|
114
|
+
const ke = function() {
|
|
115
|
+
const e = I();
|
|
116
|
+
return {
|
|
117
|
+
topic: this.newTopicName,
|
|
118
|
+
id: e
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
function xe(e, t) {
|
|
122
|
+
let n = !0;
|
|
123
|
+
for (; t.parent; ) {
|
|
124
|
+
if (t.parent === e) {
|
|
125
|
+
n = !1;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
t = t.parent;
|
|
129
|
+
}
|
|
130
|
+
return n;
|
|
131
|
+
}
|
|
132
|
+
const T = (e) => {
|
|
133
|
+
var i;
|
|
134
|
+
const t = (i = e.parent) == null ? void 0 : i.children, n = t.indexOf(e);
|
|
135
|
+
return { siblings: t, index: n };
|
|
136
|
+
};
|
|
137
|
+
function we(e) {
|
|
138
|
+
const { siblings: t, index: n } = T(e), i = t[n];
|
|
139
|
+
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = i) : (t[n] = t[n - 1], t[n - 1] = i);
|
|
140
|
+
}
|
|
141
|
+
function Me(e) {
|
|
142
|
+
const { siblings: t, index: n } = T(e), i = t[n];
|
|
143
|
+
n === t.length - 1 ? (t[n] = t[0], t[0] = i) : (t[n] = t[n + 1], t[n + 1] = i);
|
|
144
|
+
}
|
|
145
|
+
function Y(e) {
|
|
146
|
+
const { siblings: t, index: n } = T(e);
|
|
147
|
+
return t.splice(n, 1), t.length;
|
|
148
|
+
}
|
|
149
|
+
function Le(e, t) {
|
|
150
|
+
const { siblings: n, index: i } = T(e);
|
|
151
|
+
n.splice(i + 1, 0, t);
|
|
152
|
+
}
|
|
153
|
+
function $e(e, t) {
|
|
154
|
+
const { siblings: n, index: i } = T(e);
|
|
155
|
+
n.splice(i, 0, t);
|
|
156
|
+
}
|
|
157
|
+
function Se(e, t) {
|
|
158
|
+
const { siblings: n, index: i } = T(e);
|
|
159
|
+
n[i] = t, t.children = [e];
|
|
160
|
+
}
|
|
161
|
+
function Te(e, t) {
|
|
162
|
+
Y(e), t.children ? t.children.push(e) : t.children = [e];
|
|
163
|
+
}
|
|
164
|
+
function Pe(e, t) {
|
|
165
|
+
Y(e);
|
|
166
|
+
const { siblings: n, index: i } = T(t);
|
|
167
|
+
n.splice(i, 0, e);
|
|
168
|
+
}
|
|
169
|
+
function Oe(e, t) {
|
|
170
|
+
Y(e);
|
|
171
|
+
const { siblings: n, index: i } = T(t);
|
|
172
|
+
n.splice(i + 1, 0, e);
|
|
173
|
+
}
|
|
174
|
+
function ue(e) {
|
|
175
|
+
return JSON.parse(
|
|
176
|
+
JSON.stringify(e, (n, i) => {
|
|
177
|
+
if (n !== "parent")
|
|
178
|
+
return i;
|
|
179
|
+
})
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
const j = {
|
|
183
|
+
afterMoving: !1,
|
|
184
|
+
// 区别click事件
|
|
185
|
+
mousedown: !1,
|
|
186
|
+
lastX: 0,
|
|
187
|
+
lastY: 0,
|
|
188
|
+
onMove(e, t) {
|
|
189
|
+
if (this.mousedown) {
|
|
190
|
+
if (this.afterMoving = !0, !this.lastX) {
|
|
191
|
+
this.lastX = e.pageX, this.lastY = e.pageY;
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const n = this.lastX - e.pageX, i = this.lastY - e.pageY;
|
|
195
|
+
t.scrollTo(t.scrollLeft + n, t.scrollTop + i), this.lastX = e.pageX, this.lastY = e.pageY;
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
clear() {
|
|
199
|
+
this.afterMoving = !1, this.mousedown = !1, this.lastX = 0, this.lastY = 0;
|
|
200
|
+
}
|
|
201
|
+
}, Z = (e) => e.tagName === "ME-TPC";
|
|
202
|
+
function Ae(e) {
|
|
203
|
+
e.map.addEventListener("click", (t) => {
|
|
204
|
+
var i;
|
|
205
|
+
const n = t.target;
|
|
206
|
+
if (n.tagName === "ME-EPD")
|
|
207
|
+
e.expandNode(n.previousSibling);
|
|
208
|
+
else if (e.editable)
|
|
209
|
+
Z(n) ? e.selectNode(n, !1, t) : n.tagName === "path" ? ((i = n == null ? void 0 : n.parentElement) == null ? void 0 : i.tagName) === "g" && e.selectLink(n.parentElement) : n.className === "circle" || (e.unselectNode(), e.hideLinkController && e.hideLinkController());
|
|
210
|
+
else
|
|
211
|
+
return;
|
|
212
|
+
}), e.map.addEventListener("dblclick", (t) => {
|
|
213
|
+
if (t.preventDefault(), !e.editable)
|
|
214
|
+
return;
|
|
215
|
+
const n = t.target;
|
|
216
|
+
Z(n) && e.beginEdit(n);
|
|
217
|
+
}), e.map.addEventListener("mousemove", (t) => {
|
|
218
|
+
t.target.contentEditable !== "true" && j.onMove(t, e.container);
|
|
219
|
+
}), e.map.addEventListener("mousedown", (t) => {
|
|
220
|
+
t.target.contentEditable !== "true" && (j.afterMoving = !1, j.mousedown = !0);
|
|
221
|
+
}), e.map.addEventListener("mouseleave", () => {
|
|
222
|
+
j.clear();
|
|
223
|
+
}), e.map.addEventListener("mouseup", () => {
|
|
224
|
+
j.clear();
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
const De = {
|
|
228
|
+
create() {
|
|
229
|
+
return {
|
|
230
|
+
handlers: {},
|
|
231
|
+
showHandler: function() {
|
|
232
|
+
console.log(this.handlers);
|
|
233
|
+
},
|
|
234
|
+
addListener: function(e, t) {
|
|
235
|
+
this.handlers[e] === void 0 && (this.handlers[e] = []), this.handlers[e].push(t);
|
|
236
|
+
},
|
|
237
|
+
fire: function(e, ...t) {
|
|
238
|
+
if (this.handlers[e] instanceof Array) {
|
|
239
|
+
const n = this.handlers[e];
|
|
240
|
+
for (let i = 0; i < n.length; i++)
|
|
241
|
+
n[i](...t);
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
removeListener: function(e, t) {
|
|
245
|
+
if (!this.handlers[e])
|
|
246
|
+
return;
|
|
247
|
+
const n = this.handlers[e];
|
|
248
|
+
if (!t)
|
|
249
|
+
n.length = 0;
|
|
250
|
+
else if (n.length)
|
|
251
|
+
for (let i = 0; i < n.length; i++)
|
|
252
|
+
n[i] === t && this.handlers[e].splice(i, 1);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}, R = document, je = function() {
|
|
257
|
+
console.time("layout"), this.nodes.innerHTML = "";
|
|
258
|
+
const e = this.createTopic(this.nodeData);
|
|
259
|
+
Q(e, this.nodeData), e.draggable = !1;
|
|
260
|
+
const t = R.createElement("me-root");
|
|
261
|
+
t.appendChild(e);
|
|
262
|
+
const n = this.nodeData.children || [];
|
|
263
|
+
if (this.direction === _) {
|
|
264
|
+
let i = 0, o = 0;
|
|
265
|
+
n.map((s) => {
|
|
266
|
+
s.direction === x ? i += 1 : s.direction === P ? o += 1 : i <= o ? (s.direction = x, i += 1) : (s.direction = P, o += 1);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
He(this, n, t), console.timeEnd("layout");
|
|
270
|
+
}, He = function(e, t, n) {
|
|
271
|
+
const i = R.createElement("me-main");
|
|
272
|
+
i.className = "lhs";
|
|
273
|
+
const o = R.createElement("me-main");
|
|
274
|
+
o.className = "rhs";
|
|
275
|
+
for (let s = 0; s < t.length; s++) {
|
|
276
|
+
const r = t[s], { grp: a } = e.createWrapper(r);
|
|
277
|
+
e.direction === _ ? r.direction === x ? i.appendChild(a) : o.appendChild(a) : e.direction === x ? i.appendChild(a) : o.appendChild(a);
|
|
278
|
+
}
|
|
279
|
+
e.nodes.appendChild(i), e.nodes.appendChild(n), e.nodes.appendChild(o), e.nodes.appendChild(e.lines);
|
|
280
|
+
}, Be = function(e, t) {
|
|
281
|
+
const n = R.createElement("me-children");
|
|
282
|
+
for (let i = 0; i < t.length; i++) {
|
|
283
|
+
const o = t[i], { grp: s } = e.createWrapper(o);
|
|
284
|
+
n.appendChild(s);
|
|
285
|
+
}
|
|
286
|
+
return n;
|
|
287
|
+
}, k = document, E = (e, t) => (t ? t.mindElixirBox : k).querySelector(`[data-nodeid=me${e}]`), Q = function(e, t) {
|
|
288
|
+
if (e.textContent = t.topic, t.style && (e.style.color = t.style.color || "", e.style.background = t.style.background || "", e.style.fontSize = t.style.fontSize + "px", e.style.fontWeight = t.style.fontWeight || "normal"), t.image) {
|
|
289
|
+
const n = t.image;
|
|
290
|
+
if (n.url && n.width && n.height) {
|
|
291
|
+
const i = k.createElement("img");
|
|
292
|
+
i.src = n.url, i.style.width = n.width + "px", i.style.height = n.height + "px", e.appendChild(i), e.image = i;
|
|
293
|
+
} else
|
|
294
|
+
console.warn("image url/width/height are required");
|
|
295
|
+
}
|
|
296
|
+
if (t.hyperLink) {
|
|
297
|
+
const n = k.createElement("a");
|
|
298
|
+
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.linkContainer = n, console.log(n);
|
|
299
|
+
} else
|
|
300
|
+
e.linkContainer && (e.linkContainer.remove(), e.linkContainer = null);
|
|
301
|
+
if (t.icons && t.icons.length) {
|
|
302
|
+
const n = k.createElement("span");
|
|
303
|
+
n.className = "icons", n.innerHTML = t.icons.map((i) => `<span>${q(i)}</span>`).join(""), e.appendChild(n), e.icons = n;
|
|
304
|
+
}
|
|
305
|
+
if (t.tags && t.tags.length) {
|
|
306
|
+
const n = k.createElement("div");
|
|
307
|
+
n.className = "tags", n.innerHTML = t.tags.map((i) => `<span>${q(i)}</span>`).join(""), e.appendChild(n), e.tags = n;
|
|
308
|
+
}
|
|
309
|
+
t.branchColor && (e.style.borderColor = t.branchColor);
|
|
310
|
+
}, _e = function(e, t) {
|
|
311
|
+
const n = k.createElement("me-wrapper"), { p: i, tpc: o } = this.createParent(e);
|
|
312
|
+
if (n.appendChild(i), !t && e.children && e.children.length > 0) {
|
|
313
|
+
const s = X(e.expanded);
|
|
314
|
+
if (i.appendChild(s), e.expanded !== !1) {
|
|
315
|
+
const r = Be(this, e.children);
|
|
316
|
+
n.appendChild(r);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return { grp: n, top: i, tpc: o };
|
|
320
|
+
}, ze = function(e) {
|
|
321
|
+
const t = k.createElement("me-parent"), n = this.createTopic(e);
|
|
322
|
+
return Q(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
323
|
+
}, Ve = function(e) {
|
|
324
|
+
const t = k.createElement("me-children");
|
|
325
|
+
return t.append(...e), t;
|
|
326
|
+
}, Fe = function(e) {
|
|
327
|
+
const t = k.createElement("me-tpc");
|
|
328
|
+
return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
|
|
329
|
+
};
|
|
330
|
+
function qe(e) {
|
|
331
|
+
const t = k.createRange();
|
|
332
|
+
t.selectNodeContents(e);
|
|
333
|
+
const n = window.getSelection();
|
|
334
|
+
n && (n.removeAllRanges(), n.addRange(t));
|
|
335
|
+
}
|
|
336
|
+
const Re = function(e) {
|
|
337
|
+
if (console.time("createInputDiv"), !e)
|
|
338
|
+
return;
|
|
339
|
+
const t = k.createElement("div"), n = e.childNodes[0].textContent;
|
|
340
|
+
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "true", t.spellcheck = !1, t.style.cssText = `min-width:${e.offsetWidth - 8}px;`, this.direction === x && (t.style.right = "0"), t.focus(), qe(t), this.inputDiv = t, this.bus.fire("operation", {
|
|
341
|
+
name: "beginEdit",
|
|
342
|
+
obj: e.nodeObj
|
|
343
|
+
}), t.addEventListener("keydown", (i) => {
|
|
344
|
+
var s;
|
|
345
|
+
i.stopPropagation();
|
|
346
|
+
const o = i.key;
|
|
347
|
+
if (o === "Enter" || o === "Tab") {
|
|
348
|
+
if (i.shiftKey)
|
|
349
|
+
return;
|
|
350
|
+
i.preventDefault(), (s = this.inputDiv) == null || s.blur(), this.map.focus();
|
|
351
|
+
}
|
|
352
|
+
}), t.addEventListener("blur", () => {
|
|
353
|
+
var s;
|
|
354
|
+
if (!t)
|
|
355
|
+
return;
|
|
356
|
+
const i = e.nodeObj, o = ((s = t.textContent) == null ? void 0 : s.trim()) || "";
|
|
357
|
+
console.log(o), o === "" ? i.topic = n : i.topic = o, t.remove(), this.inputDiv = null, o !== n && (e.childNodes[0].textContent = i.topic, this.linkDiv(), this.bus.fire("operation", {
|
|
358
|
+
name: "finishEdit",
|
|
359
|
+
obj: i,
|
|
360
|
+
origin: n
|
|
361
|
+
}));
|
|
362
|
+
}), console.timeEnd("createInputDiv");
|
|
363
|
+
}, X = function(e) {
|
|
364
|
+
const t = k.createElement("me-epd");
|
|
365
|
+
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
366
|
+
}, A = document, D = "http://www.w3.org/2000/svg", Ie = function(e, t) {
|
|
367
|
+
const n = A.createElementNS(D, "path");
|
|
368
|
+
return n.setAttribute("d", e), n.setAttribute("stroke", t || "#666"), n.setAttribute("fill", "none"), n.setAttribute("stroke-width", "3"), n;
|
|
369
|
+
}, F = function(e) {
|
|
370
|
+
const t = A.createElementNS(D, "svg");
|
|
371
|
+
return t.setAttribute("class", e), t;
|
|
372
|
+
}, ee = function(e, t, n, i) {
|
|
373
|
+
const o = A.createElementNS(D, "line");
|
|
374
|
+
return o.setAttribute("x1", String(e)), o.setAttribute("y1", String(t)), o.setAttribute("x2", String(n)), o.setAttribute("y2", String(i)), o.setAttribute("stroke", "#bbb"), o.setAttribute("fill", "none"), o.setAttribute("stroke-width", "2"), o;
|
|
375
|
+
}, Ye = function(e, t) {
|
|
376
|
+
const n = A.createElementNS(D, "path");
|
|
377
|
+
return n.setAttribute("d", e), n.setAttribute("stroke", t || "#555"), n.setAttribute("fill", "none"), n.setAttribute("stroke-linecap", "square"), n.setAttribute("stroke-width", "2"), n;
|
|
378
|
+
}, Xe = function(e, t) {
|
|
379
|
+
const n = A.createElementNS(D, "g"), i = A.createElementNS(D, "path"), o = A.createElementNS(D, "path");
|
|
380
|
+
return o.setAttribute("d", t), o.setAttribute("stroke", "rgb(235, 95, 82)"), o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "cap"), o.setAttribute("stroke-width", "2"), i.setAttribute("d", e), i.setAttribute("stroke", "rgb(235, 95, 82)"), i.setAttribute("fill", "none"), i.setAttribute("stroke-linecap", "cap"), i.setAttribute("stroke-width", "2"), n.appendChild(i), n.appendChild(o), n;
|
|
381
|
+
}, We = (e, t) => {
|
|
382
|
+
let n = 0, i = 0;
|
|
383
|
+
for (; t && t !== e; )
|
|
384
|
+
n += t.offsetLeft, i += t.offsetTop, t = t.offsetParent;
|
|
385
|
+
return { offsetLeft: n, offsetTop: i };
|
|
386
|
+
};
|
|
387
|
+
let fe = me;
|
|
388
|
+
const Ue = function(e) {
|
|
389
|
+
console.time("linkDiv");
|
|
390
|
+
const t = this.map.querySelector("me-root");
|
|
391
|
+
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 - t.offsetLeft - t.offsetWidth / 2}px`;
|
|
392
|
+
const n = this.map.querySelectorAll("me-main > me-wrapper");
|
|
393
|
+
this.lines.innerHTML = "", fe = this.subLinkStyle === 2 ? Je : me;
|
|
394
|
+
for (let i = 0; i < n.length; i++) {
|
|
395
|
+
const o = n[i], s = o.querySelector("me-tpc"), r = o.firstChild, a = o.parentNode.className;
|
|
396
|
+
let l = t.offsetLeft + t.offsetWidth / 2;
|
|
397
|
+
const u = t.offsetTop + t.offsetHeight / 2;
|
|
398
|
+
let c;
|
|
399
|
+
const h = this.theme.palette, d = s.nodeObj.branchColor || h[i % h.length], { offsetLeft: p, offsetTop: g } = We(this.nodes, r);
|
|
400
|
+
a === "lhs" ? c = p + r.offsetWidth : c = p;
|
|
401
|
+
const f = g + r.offsetHeight / 2;
|
|
402
|
+
let m = "";
|
|
403
|
+
if (this.mainLinkStyle === 2)
|
|
404
|
+
this.direction === _ && (a === "lhs" ? l = l - t.offsetWidth / 6 : l = l + t.offsetWidth / 6), m = Ge({ x1: l, y1: u, x2: c, y2: f });
|
|
405
|
+
else {
|
|
406
|
+
const y = (1 - Math.abs(f - o.parentElement.offsetTop - o.parentElement.offsetHeight / 2) / o.parentElement.offsetHeight) * 0.25 * (t.offsetWidth / 2);
|
|
407
|
+
a === "lhs" ? l = l - t.offsetWidth / 10 - y : l = l + t.offsetWidth / 10 + y, m = Ke({ x1: l, y1: u, x2: c, y2: f });
|
|
408
|
+
}
|
|
409
|
+
this.lines.appendChild(Ie(m, d));
|
|
410
|
+
const b = o.children[0].children[1];
|
|
411
|
+
if (b && (b.style.top = (b.parentNode.offsetHeight - b.offsetHeight) / 2 + "px", a === "lhs" ? b.style.left = "-10px" : b.style.right = "-10px"), !(e && e !== o) && o.childElementCount) {
|
|
412
|
+
const v = F("subLines"), y = o.lastChild;
|
|
413
|
+
y.tagName === "svg" && y.remove(), o.appendChild(v);
|
|
414
|
+
const N = o.firstChild, C = o.children[1].children, H = pe(C, N, a, !0);
|
|
415
|
+
v.appendChild(Ye(H, d));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
this.linkSvgGroup.innerHTML = "";
|
|
419
|
+
for (const i in this.linkData) {
|
|
420
|
+
const o = this.linkData[i];
|
|
421
|
+
this.createLink(E(o.from), E(o.to), !0, o);
|
|
422
|
+
}
|
|
423
|
+
console.timeEnd("linkDiv");
|
|
424
|
+
}, pe = function(e, t, n, i) {
|
|
425
|
+
let o = "";
|
|
426
|
+
const s = t.offsetTop, r = t.offsetLeft, a = t.offsetWidth, l = t.offsetHeight;
|
|
427
|
+
for (let u = 0; u < e.length; u++) {
|
|
428
|
+
const c = e[u], h = c.firstChild, d = h.offsetTop, p = h.offsetLeft, g = h.offsetWidth, f = h.offsetHeight;
|
|
429
|
+
o += fe({ pT: s, pL: r, pW: a, pH: l, cT: d, cL: p, cW: g, cH: f, direction: n, isFirst: i });
|
|
430
|
+
const m = h.children[1];
|
|
431
|
+
if (m) {
|
|
432
|
+
if (m.style.bottom = -(m.offsetHeight / 2) + "px", n === "lhs" ? m.style.left = "10px" : n === "rhs" && (m.style.right = "10px"), !m.expanded)
|
|
433
|
+
continue;
|
|
434
|
+
} else
|
|
435
|
+
continue;
|
|
436
|
+
const b = c.children[1].children;
|
|
437
|
+
b.length > 0 && (o += pe(b, h, n));
|
|
438
|
+
}
|
|
439
|
+
return o;
|
|
440
|
+
};
|
|
441
|
+
function Ge({ x1: e, y1: t, x2: n, y2: i }) {
|
|
442
|
+
return `M ${e} ${t} V ${i > t ? i - 20 : i + 20} C ${e} ${i} ${e} ${i} ${n > e ? e + 20 : e - 20} ${i} H ${n}`;
|
|
443
|
+
}
|
|
444
|
+
function Ke({ x1: e, y1: t, x2: n, y2: i }) {
|
|
445
|
+
return `M ${e} ${t} Q ${e} ${i} ${n} ${i}`;
|
|
446
|
+
}
|
|
447
|
+
function Je({ pT: e, pL: t, pW: n, pH: i, cT: o, cL: s, cW: r, cH: a, direction: l, isFirst: u }) {
|
|
448
|
+
let c;
|
|
449
|
+
u ? c = e + i / 2 : c = e + i;
|
|
450
|
+
const h = o + a;
|
|
451
|
+
let d = 0, p = 0, g = 0;
|
|
452
|
+
return l === "lhs" ? (d = t + M, p = s, g = s + r) : l === "rhs" && (d = t + n - M, p = s + r, g = s), h < c + 50 && h > c - 50 ? `M ${d} ${c} H ${g} V ${h} H ${p}` : h >= c ? `M ${d} ${c} H ${g} V ${h - w} A ${w} ${w} 0 0 ${d > p ? 1 : 0} ${d > p ? g - w : g + w} ${h} H ${p}` : `M ${d} ${c} H ${g} V ${h + w} A ${w} ${w} 0 0 ${d > p ? 0 : 1} ${d > p ? g - w : g + w} ${h} H ${p}`;
|
|
453
|
+
}
|
|
454
|
+
function me({ pT: e, pL: t, pW: n, pH: i, cT: o, cL: s, cW: r, cH: a, direction: l, isFirst: u }) {
|
|
455
|
+
let c = 0, h = 0;
|
|
456
|
+
u ? c = e + i / 2 : c = e + i;
|
|
457
|
+
const d = o + a;
|
|
458
|
+
let p = 0, g = 0, f = 0;
|
|
459
|
+
const m = Math.min(Math.abs(c - d) / 800, 1.2) * M;
|
|
460
|
+
return l === "lhs" ? (f = t, p = f + M, g = f - M, h = s + M, `M ${p} ${c} C ${f} ${c} ${f + m} ${d} ${g} ${d} H ${h}`) : (f = t + n, p = f - M, g = f + M, h = s + r - M, `M ${p} ${c} C ${f} ${c} ${f - m} ${d} ${g} ${d} H ${h}`);
|
|
461
|
+
}
|
|
462
|
+
const te = {
|
|
463
|
+
addChild: "插入子节点",
|
|
464
|
+
addParent: "插入父节点",
|
|
465
|
+
addSibling: "插入同级节点",
|
|
466
|
+
removeNode: "删除节点",
|
|
467
|
+
focus: "专注",
|
|
468
|
+
cancelFocus: "取消专注",
|
|
469
|
+
moveUp: "上移",
|
|
470
|
+
moveDown: "下移",
|
|
471
|
+
link: "连接",
|
|
472
|
+
clickTips: "请点击目标节点"
|
|
473
|
+
}, ne = {
|
|
474
|
+
cn: te,
|
|
475
|
+
zh_CN: te,
|
|
476
|
+
zh_TW: {
|
|
477
|
+
addChild: "插入子節點",
|
|
478
|
+
addParent: "插入父節點",
|
|
479
|
+
addSibling: "插入同級節點",
|
|
480
|
+
removeNode: "刪除節點",
|
|
481
|
+
focus: "專注",
|
|
482
|
+
cancelFocus: "取消專注",
|
|
483
|
+
moveUp: "上移",
|
|
484
|
+
moveDown: "下移",
|
|
485
|
+
link: "連接",
|
|
486
|
+
clickTips: "請點擊目標節點"
|
|
487
|
+
},
|
|
488
|
+
en: {
|
|
489
|
+
addChild: "Add child",
|
|
490
|
+
addParent: "Add parent",
|
|
491
|
+
addSibling: "Add sibling",
|
|
492
|
+
removeNode: "Remove node",
|
|
493
|
+
focus: "Focus Mode",
|
|
494
|
+
cancelFocus: "Cancel Focus Mode",
|
|
495
|
+
moveUp: "Move up",
|
|
496
|
+
moveDown: "Move down",
|
|
497
|
+
link: "Link",
|
|
498
|
+
clickTips: "Please click the target node"
|
|
499
|
+
},
|
|
500
|
+
ru: {
|
|
501
|
+
addChild: "Добавить дочерний элемент",
|
|
502
|
+
addParent: "Добавить родительский элемент",
|
|
503
|
+
addSibling: "Добавить на этом уровне",
|
|
504
|
+
removeNode: "Удалить узел",
|
|
505
|
+
focus: "Режим фокусировки",
|
|
506
|
+
cancelFocus: "Отменить режим фокусировки",
|
|
507
|
+
moveUp: "Поднять выше",
|
|
508
|
+
moveDown: "Опустить ниже",
|
|
509
|
+
link: "Ссылка",
|
|
510
|
+
clickTips: "Пожалуйста, нажмите на целевой узел"
|
|
511
|
+
},
|
|
512
|
+
ja: {
|
|
513
|
+
addChild: "子ノードを追加する",
|
|
514
|
+
addParent: "親ノードを追加します",
|
|
515
|
+
addSibling: "兄弟ノードを追加する",
|
|
516
|
+
removeNode: "ノードを削除",
|
|
517
|
+
focus: "集中",
|
|
518
|
+
cancelFocus: "集中解除",
|
|
519
|
+
moveUp: "上へ移動",
|
|
520
|
+
moveDown: "下へ移動",
|
|
521
|
+
link: "コネクト",
|
|
522
|
+
clickTips: "ターゲットノードをクリックしてください"
|
|
523
|
+
},
|
|
524
|
+
pt: {
|
|
525
|
+
addChild: "Adicionar item filho",
|
|
526
|
+
addParent: "Adicionar item pai",
|
|
527
|
+
addSibling: "Adicionar item irmao",
|
|
528
|
+
removeNode: "Remover item",
|
|
529
|
+
focus: "Modo Foco",
|
|
530
|
+
cancelFocus: "Cancelar Modo Foco",
|
|
531
|
+
moveUp: "Mover para cima",
|
|
532
|
+
moveDown: "Mover para baixo",
|
|
533
|
+
link: "Link",
|
|
534
|
+
clickTips: "Favor clicar no item alvo"
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
function Qe(e, t) {
|
|
538
|
+
const n = (v) => {
|
|
539
|
+
const y = document.createElement("div");
|
|
540
|
+
return y.innerText = v, y.style.cssText = "position:absolute;bottom:20px;left:50%;transform:translateX(-50%);", y;
|
|
541
|
+
}, i = (v, y, N) => {
|
|
542
|
+
const C = document.createElement("li");
|
|
543
|
+
return C.id = v, C.innerHTML = `<span>${q(y)}</span><span>${q(N)}</span>`, C;
|
|
544
|
+
}, o = ne[e.locale] ? e.locale : "en", s = ne[o], r = i("cm-add_child", s.addChild, "tab"), a = i("cm-add_parent", s.addParent, ""), l = i("cm-add_sibling", s.addSibling, "enter"), u = i("cm-remove_child", s.removeNode, "delete"), c = i("cm-fucus", s.focus, ""), h = i("cm-unfucus", s.cancelFocus, ""), d = i("cm-up", s.moveUp, "PgUp"), p = i("cm-down", s.moveDown, "Pgdn"), g = i("cm-down", s.link, ""), f = document.createElement("ul");
|
|
545
|
+
if (f.className = "menu-list", f.appendChild(r), f.appendChild(a), f.appendChild(l), f.appendChild(u), (!t || t.focus) && (f.appendChild(c), f.appendChild(h)), f.appendChild(d), f.appendChild(p), (!t || t.link) && f.appendChild(g), t && t.extend)
|
|
546
|
+
for (let v = 0; v < t.extend.length; v++) {
|
|
547
|
+
const y = t.extend[v], N = i(y.name, y.name, y.key || "");
|
|
548
|
+
f.appendChild(N), N.onclick = (C) => {
|
|
549
|
+
y.onclick(C);
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
const m = document.createElement("div");
|
|
553
|
+
m.className = "context-menu", m.appendChild(f), m.hidden = !0, e.container.append(m);
|
|
554
|
+
let b = !0;
|
|
555
|
+
e.container.oncontextmenu = function(v) {
|
|
556
|
+
if (v.preventDefault(), !e.editable)
|
|
557
|
+
return;
|
|
558
|
+
const y = v.target;
|
|
559
|
+
if (y.tagName === "ME-TPC") {
|
|
560
|
+
y.parentElement.tagName === "ME-ROOT" ? b = !0 : b = !1, b ? (c.className = "disabled", d.className = "disabled", p.className = "disabled", l.className = "disabled", u.className = "disabled") : (c.className = "", d.className = "", p.className = "", l.className = "", u.className = ""), e.selectNode(y), m.hidden = !1;
|
|
561
|
+
const N = f.offsetHeight, C = f.offsetWidth;
|
|
562
|
+
N + v.clientY > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = v.clientY + 15 + "px"), C + v.clientX > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = v.clientX + 10 + "px");
|
|
563
|
+
}
|
|
564
|
+
}, m.onclick = (v) => {
|
|
565
|
+
v.target === m && (m.hidden = !0);
|
|
566
|
+
}, r.onclick = () => {
|
|
567
|
+
e.addChild(), m.hidden = !0;
|
|
568
|
+
}, a.onclick = () => {
|
|
569
|
+
e.insertParent(), m.hidden = !0;
|
|
570
|
+
}, l.onclick = () => {
|
|
571
|
+
b || (e.insertSibling(), m.hidden = !0);
|
|
572
|
+
}, u.onclick = () => {
|
|
573
|
+
b || (e.removeNode(), m.hidden = !0);
|
|
574
|
+
}, c.onclick = () => {
|
|
575
|
+
b || (e.focusNode(e.currentNode), m.hidden = !0);
|
|
576
|
+
}, h.onclick = () => {
|
|
577
|
+
e.cancelFocus(), m.hidden = !0;
|
|
578
|
+
}, d.onclick = () => {
|
|
579
|
+
b || (e.moveUpNode(), m.hidden = !0);
|
|
580
|
+
}, p.onclick = () => {
|
|
581
|
+
b || (e.moveDownNode(), m.hidden = !0);
|
|
582
|
+
}, g.onclick = () => {
|
|
583
|
+
m.hidden = !0;
|
|
584
|
+
const v = e.currentNode, y = n(s.clickTips);
|
|
585
|
+
e.container.appendChild(y), e.map.addEventListener(
|
|
586
|
+
"click",
|
|
587
|
+
(N) => {
|
|
588
|
+
N.preventDefault(), y.remove();
|
|
589
|
+
const C = N.target;
|
|
590
|
+
C.parentElement.tagName === "ME-PARENT" || C.parentElement.tagName === "ME-ROOT" ? e.createLink(v, e.currentNode) : console.log("link cancel");
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
once: !0
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
const Ze = (e) => {
|
|
599
|
+
const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
|
|
600
|
+
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
601
|
+
}, et = (e) => {
|
|
602
|
+
const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
|
|
603
|
+
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
604
|
+
}, ie = (e) => {
|
|
605
|
+
e.selectNode(e.map.querySelector("me-root>me-tpc"));
|
|
606
|
+
};
|
|
607
|
+
function tt(e) {
|
|
608
|
+
const t = {
|
|
609
|
+
13: () => {
|
|
610
|
+
e.insertSibling();
|
|
611
|
+
},
|
|
612
|
+
9: () => {
|
|
613
|
+
e.addChild();
|
|
614
|
+
},
|
|
615
|
+
113: () => {
|
|
616
|
+
e.beginEdit();
|
|
617
|
+
},
|
|
618
|
+
38: () => {
|
|
619
|
+
e.selectPrevSibling();
|
|
620
|
+
},
|
|
621
|
+
40: () => {
|
|
622
|
+
e.selectNextSibling();
|
|
623
|
+
},
|
|
624
|
+
37: () => {
|
|
625
|
+
var o;
|
|
626
|
+
if (!e.currentNode)
|
|
627
|
+
return;
|
|
628
|
+
const n = e.currentNode.nodeObj, i = e.currentNode.offsetParent.offsetParent.parentElement;
|
|
629
|
+
e.currentNode.nodeObj.root ? Ze(e) : i.className === "rhs" ? (o = n.parent) != null && o.root ? ie(e) : e.selectParent() : i.className === "lhs" && e.selectFirstChild();
|
|
630
|
+
},
|
|
631
|
+
39: () => {
|
|
632
|
+
var o;
|
|
633
|
+
if (!e.currentNode)
|
|
634
|
+
return;
|
|
635
|
+
const n = e.currentNode.nodeObj, i = e.currentNode.offsetParent.offsetParent.parentElement;
|
|
636
|
+
n.root ? et(e) : i.className === "lhs" ? (o = n.parent) != null && o.root ? ie(e) : e.selectParent() : i.className === "rhs" && e.selectFirstChild();
|
|
637
|
+
},
|
|
638
|
+
33() {
|
|
639
|
+
e.moveUpNode();
|
|
640
|
+
},
|
|
641
|
+
34() {
|
|
642
|
+
e.moveDownNode();
|
|
643
|
+
},
|
|
644
|
+
67: (n) => {
|
|
645
|
+
(n.metaKey || n.ctrlKey) && (e.waitCopy = e.currentNode);
|
|
646
|
+
},
|
|
647
|
+
86: (n) => {
|
|
648
|
+
!e.waitCopy || !e.currentNode || (n.metaKey || n.ctrlKey) && (e.copyNode(e.waitCopy, e.currentNode), e.waitCopy = null);
|
|
649
|
+
},
|
|
650
|
+
// ctrl +
|
|
651
|
+
187: (n) => {
|
|
652
|
+
if (n.metaKey || n.ctrlKey) {
|
|
653
|
+
if (e.scaleVal > 1.6)
|
|
654
|
+
return;
|
|
655
|
+
e.scale(e.scaleVal += 0.2);
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
// ctrl -
|
|
659
|
+
189: (n) => {
|
|
660
|
+
if (n.metaKey || n.ctrlKey) {
|
|
661
|
+
if (e.scaleVal < 0.6)
|
|
662
|
+
return;
|
|
663
|
+
e.scale(e.scaleVal -= 0.2);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
e.map.onkeydown = (n) => {
|
|
668
|
+
if (n.preventDefault(), !!e.editable && n.target === n.currentTarget)
|
|
669
|
+
if (n.keyCode === 8 || n.keyCode === 46)
|
|
670
|
+
e.currentLink ? e.removeLink() : e.removeNode();
|
|
671
|
+
else {
|
|
672
|
+
const i = t[n.keyCode];
|
|
673
|
+
i && i(n);
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function nt(e, t) {
|
|
678
|
+
const n = (d, p) => {
|
|
679
|
+
const g = document.createElement("div");
|
|
680
|
+
return g.id = d, g.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
681
|
+
<use xlink:href="#icon-${p}"></use>
|
|
682
|
+
</svg>`, g;
|
|
683
|
+
}, i = n("cm-add_child", "zijiedian"), o = n("cm-add_sibling", "tongjijiedian-"), s = n("cm-remove_child", "shanchu2"), r = n("cm-up", "rising"), a = n("cm-down", "falling"), l = n("cm-edit", "edit"), u = document.createElement("ul");
|
|
684
|
+
if (u.className = "menu-list", t && t.extend)
|
|
685
|
+
for (let d = 0; d < t.extend.length; d++) {
|
|
686
|
+
const p = t.extend[d], g = n(p.name, p.name);
|
|
687
|
+
u.appendChild(g), g.onclick = (f) => {
|
|
688
|
+
p.onclick(f);
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
const c = document.createElement("mmenu");
|
|
692
|
+
c.className = "mobile-menu", c.appendChild(i), c.appendChild(o), c.appendChild(s), c.appendChild(r), c.appendChild(a), c.appendChild(l), c.hidden = !0, e.container.append(c);
|
|
693
|
+
let h = !0;
|
|
694
|
+
e.bus.addListener("unselectNode", function() {
|
|
695
|
+
c.hidden = !0;
|
|
696
|
+
}), e.bus.addListener("selectNode", function(d) {
|
|
697
|
+
c.hidden = !1, d.root ? h = !0 : h = !1;
|
|
698
|
+
}), c.onclick = (d) => {
|
|
699
|
+
d.target === c && (c.hidden = !0);
|
|
700
|
+
}, i.onclick = () => {
|
|
701
|
+
e.addChild();
|
|
702
|
+
}, o.onclick = () => {
|
|
703
|
+
h || e.insertSibling();
|
|
704
|
+
}, s.onclick = () => {
|
|
705
|
+
h || e.removeNode();
|
|
706
|
+
}, r.onclick = (d) => {
|
|
707
|
+
h || e.moveUpNode();
|
|
708
|
+
}, a.onclick = (d) => {
|
|
709
|
+
h || e.moveDownNode();
|
|
710
|
+
}, l.onclick = (d) => {
|
|
711
|
+
e.beginEdit();
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
const K = document, it = function(e, t) {
|
|
715
|
+
if (!t)
|
|
716
|
+
return J(e), e;
|
|
717
|
+
const n = e.getElementsByClassName("insert-preview"), i = `insert-preview ${t} show`;
|
|
718
|
+
if (n.length > 0)
|
|
719
|
+
n[0].className = i;
|
|
720
|
+
else {
|
|
721
|
+
const o = K.createElement("div");
|
|
722
|
+
o.className = i, e.appendChild(o);
|
|
723
|
+
}
|
|
724
|
+
return e;
|
|
725
|
+
}, J = function(e) {
|
|
726
|
+
if (!e)
|
|
727
|
+
return;
|
|
728
|
+
const t = e.getElementsByClassName("insert-preview");
|
|
729
|
+
for (const n of t || [])
|
|
730
|
+
n.remove();
|
|
731
|
+
}, oe = function(e, t) {
|
|
732
|
+
const n = t.parentElement.parentElement.contains(e);
|
|
733
|
+
return e && e.tagName === "ME-TPC" && e !== t && !n && e.nodeObj.root !== !0;
|
|
734
|
+
}, ot = function(e) {
|
|
735
|
+
const t = document.createElement("div");
|
|
736
|
+
return t.className = "mind-elixir-ghost", e.map.appendChild(t), t;
|
|
737
|
+
};
|
|
738
|
+
function st(e) {
|
|
739
|
+
let t = null, n = null, i = null;
|
|
740
|
+
const o = ot(e), s = 12;
|
|
741
|
+
e.map.addEventListener("dragstart", (r) => {
|
|
742
|
+
var a;
|
|
743
|
+
t = r.target, t.parentElement.parentElement.style.opacity = "0.5", o.innerHTML = t.innerHTML, (a = r.dataTransfer) == null || a.setDragImage(o, 0, 0), j.clear();
|
|
744
|
+
}), e.map.addEventListener("dragend", async (r) => {
|
|
745
|
+
if (!t)
|
|
746
|
+
return;
|
|
747
|
+
t.parentElement.parentElement.style.opacity = "1";
|
|
748
|
+
const a = r.target;
|
|
749
|
+
if (a.style.opacity = "", !i)
|
|
750
|
+
return;
|
|
751
|
+
J(i);
|
|
752
|
+
const l = t.nodeObj;
|
|
753
|
+
switch (n) {
|
|
754
|
+
case "before":
|
|
755
|
+
e.moveNodeBefore(t, i), e.selectNode(E(l.id));
|
|
756
|
+
break;
|
|
757
|
+
case "after":
|
|
758
|
+
e.moveNodeAfter(t, i), e.selectNode(E(l.id));
|
|
759
|
+
break;
|
|
760
|
+
case "in":
|
|
761
|
+
e.moveNode(t, i);
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
t = null;
|
|
765
|
+
}), e.map.addEventListener(
|
|
766
|
+
"dragover",
|
|
767
|
+
Ee(function(r) {
|
|
768
|
+
if (!t)
|
|
769
|
+
return;
|
|
770
|
+
J(i);
|
|
771
|
+
const a = K.elementFromPoint(r.clientX, r.clientY - s);
|
|
772
|
+
if (oe(a, t)) {
|
|
773
|
+
i = a;
|
|
774
|
+
const l = a.getBoundingClientRect().y;
|
|
775
|
+
r.clientY > l + a.clientHeight ? n = "after" : r.clientY > l + a.clientHeight / 2 && (n = "in");
|
|
776
|
+
} else {
|
|
777
|
+
const l = K.elementFromPoint(r.clientX, r.clientY + s);
|
|
778
|
+
if (oe(l, t)) {
|
|
779
|
+
i = l;
|
|
780
|
+
const u = l.getBoundingClientRect().y;
|
|
781
|
+
r.clientY < u ? n = "before" : r.clientY < u + l.clientHeight / 2 && (n = "in");
|
|
782
|
+
} else
|
|
783
|
+
n = i = null;
|
|
784
|
+
}
|
|
785
|
+
i && it(i, n);
|
|
786
|
+
}, 200)
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
function rt(e) {
|
|
790
|
+
let t = [], n = -1, i = e.getData();
|
|
791
|
+
e.bus.addListener("operation", (o) => {
|
|
792
|
+
if (o.name === "beginEdit")
|
|
793
|
+
return;
|
|
794
|
+
t = t.slice(0, n + 1);
|
|
795
|
+
const s = e.getData();
|
|
796
|
+
t.push({ prev: i, currentNodeId: o.obj.id, next: s }), i = s, n = t.length - 1, console.log("operation", o.obj.id, t);
|
|
797
|
+
}), e.undo = function() {
|
|
798
|
+
if (n > -1) {
|
|
799
|
+
const o = t[n];
|
|
800
|
+
i = o.prev, e.refresh(o.prev), e.selectNode(E(o.currentNodeId)), n--, console.log("current", i);
|
|
801
|
+
}
|
|
802
|
+
}, e.redo = function() {
|
|
803
|
+
if (n < t.length - 1) {
|
|
804
|
+
n++;
|
|
805
|
+
const o = t[n];
|
|
806
|
+
i = o.next, e.refresh(o.next), e.selectNode(E(o.currentNodeId));
|
|
807
|
+
}
|
|
808
|
+
}, e.map.addEventListener("keydown", (o) => {
|
|
809
|
+
(o.metaKey || o.ctrlKey) && o.shiftKey && o.key === "Z" ? e.redo() : (o.metaKey || o.ctrlKey) && o.key === "z" && e.undo();
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
const O = (e, t) => {
|
|
813
|
+
const n = document.createElement("span");
|
|
814
|
+
return n.id = e, n.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
815
|
+
<use xlink:href="#icon-${t}"></use>
|
|
816
|
+
</svg>`, n;
|
|
817
|
+
};
|
|
818
|
+
function lt(e) {
|
|
819
|
+
const t = document.createElement("div"), n = O("fullscreen", "full"), i = O("toCenter", "living"), o = O("zoomout", "move"), s = O("zoomin", "add"), r = document.createElement("span");
|
|
820
|
+
return r.innerText = "100%", t.appendChild(n), t.appendChild(i), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
821
|
+
e.container.requestFullscreen();
|
|
822
|
+
}, i.onclick = () => {
|
|
823
|
+
e.toCenter();
|
|
824
|
+
}, o.onclick = () => {
|
|
825
|
+
e.scaleVal < 0.6 || e.scale(e.scaleVal -= 0.2);
|
|
826
|
+
}, s.onclick = () => {
|
|
827
|
+
e.scaleVal > 1.6 || e.scale(e.scaleVal += 0.2);
|
|
828
|
+
}, t;
|
|
829
|
+
}
|
|
830
|
+
function ct(e) {
|
|
831
|
+
const t = document.createElement("div"), n = O("tbltl", "left"), i = O("tbltr", "right"), o = O("tblts", "side");
|
|
832
|
+
return t.appendChild(n), t.appendChild(i), t.appendChild(o), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
833
|
+
e.initLeft();
|
|
834
|
+
}, i.onclick = () => {
|
|
835
|
+
e.initRight();
|
|
836
|
+
}, o.onclick = () => {
|
|
837
|
+
e.initSide();
|
|
838
|
+
}, t;
|
|
839
|
+
}
|
|
840
|
+
function at(e) {
|
|
841
|
+
e.container.append(lt(e)), e.container.append(ct(e));
|
|
842
|
+
}
|
|
843
|
+
const dt = function(e, t = !0) {
|
|
844
|
+
this.theme = e;
|
|
845
|
+
const n = this.theme.cssVar, i = Object.keys(n);
|
|
846
|
+
for (let o = 0; o < i.length; o++) {
|
|
847
|
+
const s = i[o];
|
|
848
|
+
this.mindElixirBox.style.setProperty(s, n[s]);
|
|
849
|
+
}
|
|
850
|
+
t && this.refresh();
|
|
851
|
+
};
|
|
852
|
+
function ge(e) {
|
|
853
|
+
return {
|
|
854
|
+
nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
|
|
855
|
+
linkData: e.linkData,
|
|
856
|
+
direction: e.direction,
|
|
857
|
+
theme: e.theme
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
const ht = function(e, t, n) {
|
|
861
|
+
if (e) {
|
|
862
|
+
if (console.time("selectNode"), typeof e == "string") {
|
|
863
|
+
const i = E(e);
|
|
864
|
+
return i ? this.selectNode(i) : void 0;
|
|
865
|
+
}
|
|
866
|
+
this.currentNode && (this.currentNode.className = ""), e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n), console.timeEnd("selectNode");
|
|
867
|
+
}
|
|
868
|
+
}, ut = function() {
|
|
869
|
+
this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
|
|
870
|
+
}, ft = function() {
|
|
871
|
+
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
872
|
+
return !1;
|
|
873
|
+
const e = this.currentNode.parentElement.parentElement.nextSibling;
|
|
874
|
+
let t;
|
|
875
|
+
if (e)
|
|
876
|
+
t = e.firstChild.firstChild;
|
|
877
|
+
else
|
|
878
|
+
return !1;
|
|
879
|
+
return this.selectNode(t), !0;
|
|
880
|
+
}, pt = function() {
|
|
881
|
+
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
882
|
+
return !1;
|
|
883
|
+
const e = this.currentNode.parentElement.parentElement.previousSibling;
|
|
884
|
+
let t;
|
|
885
|
+
if (e)
|
|
886
|
+
t = e.firstChild.firstChild;
|
|
887
|
+
else
|
|
888
|
+
return !1;
|
|
889
|
+
return this.selectNode(t), !0;
|
|
890
|
+
}, mt = function() {
|
|
891
|
+
if (!this.currentNode)
|
|
892
|
+
return;
|
|
893
|
+
const e = this.currentNode.parentElement.nextSibling;
|
|
894
|
+
if (e && e.firstChild) {
|
|
895
|
+
const t = e.firstChild.firstChild.firstChild;
|
|
896
|
+
this.selectNode(t);
|
|
897
|
+
}
|
|
898
|
+
}, gt = function() {
|
|
899
|
+
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
900
|
+
return;
|
|
901
|
+
const e = this.currentNode.parentElement.parentElement.parentElement.previousSibling;
|
|
902
|
+
if (e) {
|
|
903
|
+
const t = e.firstChild;
|
|
904
|
+
this.selectNode(t);
|
|
905
|
+
}
|
|
906
|
+
}, bt = function() {
|
|
907
|
+
const e = ge(this);
|
|
908
|
+
return JSON.stringify(e, (t, n) => {
|
|
909
|
+
if (t !== "parent")
|
|
910
|
+
return t === "from" || t === "to" ? n.nodeObj.id : n;
|
|
911
|
+
});
|
|
912
|
+
}, vt = function() {
|
|
913
|
+
return JSON.parse(this.getDataString());
|
|
914
|
+
}, yt = function() {
|
|
915
|
+
const e = ge(this).nodeData;
|
|
916
|
+
let t = "# " + e.topic + `
|
|
917
|
+
|
|
918
|
+
`;
|
|
919
|
+
function n(i, o) {
|
|
920
|
+
for (let s = 0; s < i.length; s++)
|
|
921
|
+
o <= 6 ? t += "".padStart(o, "#") + " " + i[s].topic + `
|
|
922
|
+
|
|
923
|
+
` : t += "".padStart(o - 7, " ") + "- " + i[s].topic + `
|
|
924
|
+
`, i[s].children && n(i[s].children || [], o + 1);
|
|
925
|
+
}
|
|
926
|
+
return n(e.children || [], 2), t;
|
|
927
|
+
}, Nt = function() {
|
|
928
|
+
this.editable = !0;
|
|
929
|
+
}, Ct = function() {
|
|
930
|
+
this.editable = !1;
|
|
931
|
+
}, Et = function(e) {
|
|
932
|
+
this.scaleVal = e, this.map.style.transform = "scale(" + e + ")";
|
|
933
|
+
}, kt = function() {
|
|
934
|
+
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
935
|
+
}, xt = function(e) {
|
|
936
|
+
e(this);
|
|
937
|
+
}, wt = function(e) {
|
|
938
|
+
e.nodeObj.root || (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.nodeData.root = !0, this.initRight(), this.toCenter());
|
|
939
|
+
}, Mt = function() {
|
|
940
|
+
this.isFocusMode = !1, this.tempDirection !== null && (delete this.nodeData.root, this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
941
|
+
}, Lt = function() {
|
|
942
|
+
this.direction = 0, this.refresh();
|
|
943
|
+
}, $t = function() {
|
|
944
|
+
this.direction = 1, this.refresh();
|
|
945
|
+
}, St = function() {
|
|
946
|
+
this.direction = 2, this.refresh();
|
|
947
|
+
}, Tt = function(e) {
|
|
948
|
+
this.locale = e, this.refresh();
|
|
949
|
+
}, Pt = function(e, t) {
|
|
950
|
+
const n = e.nodeObj;
|
|
951
|
+
typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0, this.layout(), this.linkDiv(), this.bus.fire("expandNode", n);
|
|
952
|
+
}, Ot = function(e) {
|
|
953
|
+
e = JSON.parse(JSON.stringify(e)), e && (this.nodeData = e.nodeData, this.linkData = e.linkData || {}), L(this.nodeData), this.layout(), this.linkDiv();
|
|
954
|
+
}, At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
955
|
+
__proto__: null,
|
|
956
|
+
cancelFocus: Mt,
|
|
957
|
+
disableEdit: Ct,
|
|
958
|
+
enableEdit: Nt,
|
|
959
|
+
expandNode: Pt,
|
|
960
|
+
focusNode: wt,
|
|
961
|
+
getData: vt,
|
|
962
|
+
getDataMd: yt,
|
|
963
|
+
getDataString: bt,
|
|
964
|
+
initLeft: Lt,
|
|
965
|
+
initRight: $t,
|
|
966
|
+
initSide: St,
|
|
967
|
+
install: xt,
|
|
968
|
+
refresh: Ot,
|
|
969
|
+
scale: Et,
|
|
970
|
+
selectFirstChild: mt,
|
|
971
|
+
selectNextSibling: ft,
|
|
972
|
+
selectNode: ht,
|
|
973
|
+
selectParent: gt,
|
|
974
|
+
selectPrevSibling: pt,
|
|
975
|
+
setLocale: Tt,
|
|
976
|
+
toCenter: kt,
|
|
977
|
+
unselectNode: ut
|
|
978
|
+
}, Symbol.toStringTag, { value: "Module" })), W = function(e) {
|
|
979
|
+
const n = e.parentElement.parentElement.lastElementChild;
|
|
980
|
+
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
981
|
+
}, be = function(e, t) {
|
|
982
|
+
var n, i;
|
|
983
|
+
if (e === x)
|
|
984
|
+
return x;
|
|
985
|
+
if (e === P)
|
|
986
|
+
return P;
|
|
987
|
+
if (e === _) {
|
|
988
|
+
const o = ((n = document.querySelector(".lhs")) == null ? void 0 : n.childElementCount) || 0, s = ((i = document.querySelector(".rhs")) == null ? void 0 : i.childElementCount) || 0;
|
|
989
|
+
return o <= s ? (t.direction = x, x) : (t.direction = P, P);
|
|
990
|
+
}
|
|
991
|
+
}, Dt = function(e, t) {
|
|
992
|
+
console.log(t);
|
|
993
|
+
const n = e.nodeObj, i = ue(n);
|
|
994
|
+
i.style && t.style && (t.style = Object.assign(i.style, t.style));
|
|
995
|
+
const o = Object.assign(n, t);
|
|
996
|
+
Q(e, o), this.linkDiv(), this.bus.fire("operation", {
|
|
997
|
+
name: "reshapeNode",
|
|
998
|
+
obj: o,
|
|
999
|
+
origin: i
|
|
1000
|
+
});
|
|
1001
|
+
}, jt = function(e, t) {
|
|
1002
|
+
const n = e || this.currentNode;
|
|
1003
|
+
if (!n)
|
|
1004
|
+
return;
|
|
1005
|
+
const i = n.nodeObj;
|
|
1006
|
+
if (i.root === !0) {
|
|
1007
|
+
this.addChild();
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
const o = t || this.generateNewObj();
|
|
1011
|
+
Le(i, o), L(this.nodeData);
|
|
1012
|
+
const s = n.parentElement;
|
|
1013
|
+
console.time("insertSibling_DOM");
|
|
1014
|
+
const { grp: r, top: a } = this.createWrapper(o);
|
|
1015
|
+
s.parentNode.parentNode.insertBefore(r, s.parentNode.nextSibling), this.linkDiv(r.offsetParent), t || this.createInputDiv(a.firstChild), this.selectNode(a.firstChild, !0), console.timeEnd("insertSibling_DOM"), this.bus.fire("operation", {
|
|
1016
|
+
name: "insertSibling",
|
|
1017
|
+
obj: o
|
|
1018
|
+
});
|
|
1019
|
+
}, Ht = function(e, t) {
|
|
1020
|
+
const n = e || this.currentNode;
|
|
1021
|
+
if (!n)
|
|
1022
|
+
return;
|
|
1023
|
+
const i = n.nodeObj;
|
|
1024
|
+
if (i.root === !0) {
|
|
1025
|
+
this.addChild();
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
const o = t || this.generateNewObj();
|
|
1029
|
+
$e(i, o), L(this.nodeData);
|
|
1030
|
+
const s = n.parentElement;
|
|
1031
|
+
console.time("insertSibling_DOM");
|
|
1032
|
+
const { grp: r, top: a } = this.createWrapper(o);
|
|
1033
|
+
s.parentNode.parentNode.insertBefore(r, s.parentNode), this.linkDiv(r.offsetParent), t || this.createInputDiv(a.firstChild), this.selectNode(a.firstChild, !0), console.timeEnd("insertSibling_DOM"), this.bus.fire("operation", {
|
|
1034
|
+
name: "insertBefore",
|
|
1035
|
+
obj: o
|
|
1036
|
+
});
|
|
1037
|
+
}, Bt = function(e, t) {
|
|
1038
|
+
const n = e || this.currentNode;
|
|
1039
|
+
if (!n)
|
|
1040
|
+
return;
|
|
1041
|
+
W(n);
|
|
1042
|
+
const i = n.nodeObj;
|
|
1043
|
+
if (i.root === !0)
|
|
1044
|
+
return;
|
|
1045
|
+
const o = t || this.generateNewObj();
|
|
1046
|
+
Se(i, o), L(this.nodeData);
|
|
1047
|
+
const s = n.parentElement.parentElement;
|
|
1048
|
+
console.time("insertParent_DOM");
|
|
1049
|
+
const { grp: r, top: a } = this.createWrapper(o, !0);
|
|
1050
|
+
a.appendChild(X(!0)), s.insertAdjacentElement("afterend", r);
|
|
1051
|
+
const l = this.createChildren([s]);
|
|
1052
|
+
a.insertAdjacentElement("afterend", l), this.linkDiv(), t || this.createInputDiv(a.firstChild), this.selectNode(a.firstChild, !0), console.timeEnd("insertParent_DOM"), this.bus.fire("operation", {
|
|
1053
|
+
name: "insertParent",
|
|
1054
|
+
obj: o
|
|
1055
|
+
});
|
|
1056
|
+
}, ve = function(e, t) {
|
|
1057
|
+
var a, l;
|
|
1058
|
+
if (!e)
|
|
1059
|
+
return null;
|
|
1060
|
+
const n = e.nodeObj;
|
|
1061
|
+
n.expanded === !1 && (this.expandNode(e, !0), e = E(n.id));
|
|
1062
|
+
const i = t || this.generateNewObj();
|
|
1063
|
+
n.children ? n.children.push(i) : n.children = [i], L(this.nodeData);
|
|
1064
|
+
const o = e.parentElement, { grp: s, top: r } = this.createWrapper(i);
|
|
1065
|
+
if (o.tagName === "ME-PARENT") {
|
|
1066
|
+
if (o.children[1])
|
|
1067
|
+
o.nextSibling.appendChild(s);
|
|
1068
|
+
else {
|
|
1069
|
+
const u = this.createChildren([s]);
|
|
1070
|
+
o.appendChild(X(!0)), o.insertAdjacentElement("afterend", u);
|
|
1071
|
+
}
|
|
1072
|
+
this.linkDiv(s.offsetParent);
|
|
1073
|
+
} else
|
|
1074
|
+
o.tagName === "ME-ROOT" && (be(this.direction, i) === x ? (a = document.querySelector(".lhs")) == null || a.appendChild(s) : (l = document.querySelector(".rhs")) == null || l.appendChild(s), this.linkDiv());
|
|
1075
|
+
return { newTop: r, newNodeObj: i };
|
|
1076
|
+
}, _t = function(e, t) {
|
|
1077
|
+
console.time("addChild");
|
|
1078
|
+
const n = e || this.currentNode;
|
|
1079
|
+
if (!n)
|
|
1080
|
+
return;
|
|
1081
|
+
const i = ve.call(this, n, t);
|
|
1082
|
+
if (!i)
|
|
1083
|
+
return;
|
|
1084
|
+
const { newTop: o, newNodeObj: s } = i;
|
|
1085
|
+
this.bus.fire("operation", {
|
|
1086
|
+
name: "addChild",
|
|
1087
|
+
obj: s
|
|
1088
|
+
}), console.timeEnd("addChild"), t || this.createInputDiv(o.firstChild), this.selectNode(o.firstChild, !0);
|
|
1089
|
+
}, zt = function(e, t) {
|
|
1090
|
+
console.time("copyNode");
|
|
1091
|
+
const n = ue(e.nodeObj);
|
|
1092
|
+
de(n);
|
|
1093
|
+
const i = ve.call(this, t, n);
|
|
1094
|
+
if (!i)
|
|
1095
|
+
return;
|
|
1096
|
+
const { newNodeObj: o } = i;
|
|
1097
|
+
console.timeEnd("copyNode"), this.bus.fire("operation", {
|
|
1098
|
+
name: "copyNode",
|
|
1099
|
+
obj: o
|
|
1100
|
+
});
|
|
1101
|
+
}, Vt = function(e) {
|
|
1102
|
+
const t = e || this.currentNode;
|
|
1103
|
+
if (!t)
|
|
1104
|
+
return;
|
|
1105
|
+
const n = t.parentNode.parentNode, i = t.nodeObj;
|
|
1106
|
+
we(i), n.parentNode.insertBefore(n, n.previousSibling), this.linkDiv(), this.bus.fire("operation", {
|
|
1107
|
+
name: "moveUpNode",
|
|
1108
|
+
obj: i
|
|
1109
|
+
});
|
|
1110
|
+
}, Ft = function(e) {
|
|
1111
|
+
const t = e || this.currentNode;
|
|
1112
|
+
if (!t)
|
|
1113
|
+
return;
|
|
1114
|
+
const n = t.parentNode.parentNode, i = t.nodeObj;
|
|
1115
|
+
Me(i), n.nextSibling ? n.nextSibling.insertAdjacentElement("afterend", n) : n.parentNode.prepend(n), this.linkDiv(), this.bus.fire("operation", {
|
|
1116
|
+
name: "moveDownNode",
|
|
1117
|
+
obj: i
|
|
1118
|
+
});
|
|
1119
|
+
}, qt = function(e) {
|
|
1120
|
+
var u;
|
|
1121
|
+
const t = e || this.currentNode;
|
|
1122
|
+
if (!t)
|
|
1123
|
+
return;
|
|
1124
|
+
console.log("removeNode", t);
|
|
1125
|
+
const n = t.nodeObj;
|
|
1126
|
+
if (n.root === !0)
|
|
1127
|
+
throw new Error("Can not remove root node");
|
|
1128
|
+
const i = n.parent.children, o = i.findIndex((c) => c === n), s = i[o + 1], r = s && s.id, a = Y(n), l = t.parentNode;
|
|
1129
|
+
if (a === 0) {
|
|
1130
|
+
const c = l.parentNode.parentNode;
|
|
1131
|
+
c.tagName !== "ME-MAIN" && c.previousSibling.children[1].remove(), this.selectParent();
|
|
1132
|
+
} else
|
|
1133
|
+
this.selectPrevSibling() || this.selectNextSibling();
|
|
1134
|
+
for (const c in this.linkData) {
|
|
1135
|
+
const h = this.linkData[c];
|
|
1136
|
+
if (h.from === n.id || h.to === n.id) {
|
|
1137
|
+
const d = this.mindElixirBox.querySelector(`[data-linkid=${this.linkData[c].id}]`);
|
|
1138
|
+
this.removeLink(d);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
l.parentNode.remove(), this.linkDiv(), this.bus.fire("operation", {
|
|
1142
|
+
name: "removeNode",
|
|
1143
|
+
obj: n,
|
|
1144
|
+
originSiblingId: r,
|
|
1145
|
+
originParentId: (u = n == null ? void 0 : n.parent) == null ? void 0 : u.id
|
|
1146
|
+
});
|
|
1147
|
+
}, Rt = function(e, t) {
|
|
1148
|
+
var a;
|
|
1149
|
+
const n = e.nodeObj, i = t.nodeObj, o = (a = n == null ? void 0 : n.parent) == null ? void 0 : a.id;
|
|
1150
|
+
if (i.expanded === !1 && (this.expandNode(t, !0), e = E(n.id), t = E(i.id)), !xe(n, i)) {
|
|
1151
|
+
console.warn("Invalid move");
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
console.time("moveNode"), Te(n, i), L(this.nodeData);
|
|
1155
|
+
const s = e.parentElement, r = t.parentElement;
|
|
1156
|
+
if (r.tagName === "ME-PARENT")
|
|
1157
|
+
if (W(e), r.children[1])
|
|
1158
|
+
r.nextSibling.appendChild(s.parentElement);
|
|
1159
|
+
else {
|
|
1160
|
+
const l = this.createChildren([s.parentElement]);
|
|
1161
|
+
r.appendChild(X(!0)), r.parentElement.insertBefore(l, r.nextSibling);
|
|
1162
|
+
}
|
|
1163
|
+
else
|
|
1164
|
+
r.tagName === "ME-ROOT" && (be(this.direction, n), r.nextSibling.appendChild(s.parentElement));
|
|
1165
|
+
this.linkDiv(), this.bus.fire("operation", {
|
|
1166
|
+
name: "moveNode",
|
|
1167
|
+
obj: n,
|
|
1168
|
+
toObj: i,
|
|
1169
|
+
originParentId: o
|
|
1170
|
+
}), console.timeEnd("moveNode");
|
|
1171
|
+
}, It = function(e, t) {
|
|
1172
|
+
var u;
|
|
1173
|
+
const n = e.nodeObj, i = t.nodeObj, o = (u = n.parent) == null ? void 0 : u.id;
|
|
1174
|
+
Pe(n, i), L(this.nodeData), W(e);
|
|
1175
|
+
const r = e.parentElement.parentNode;
|
|
1176
|
+
t.parentElement.parentNode.insertAdjacentElement("beforebegin", r), this.linkDiv(), this.bus.fire("operation", {
|
|
1177
|
+
name: "moveNodeBefore",
|
|
1178
|
+
obj: n,
|
|
1179
|
+
toObj: i,
|
|
1180
|
+
originParentId: o
|
|
1181
|
+
});
|
|
1182
|
+
}, Yt = function(e, t) {
|
|
1183
|
+
var u;
|
|
1184
|
+
const n = e.nodeObj, i = t.nodeObj, o = (u = n.parent) == null ? void 0 : u.id;
|
|
1185
|
+
Oe(n, i), L(this.nodeData), W(e);
|
|
1186
|
+
const r = e.parentElement.parentElement;
|
|
1187
|
+
t.parentElement.parentElement.insertAdjacentElement("afterend", r), this.linkDiv(), this.bus.fire("operation", {
|
|
1188
|
+
name: "moveNodeAfter",
|
|
1189
|
+
obj: n,
|
|
1190
|
+
toObj: i,
|
|
1191
|
+
originParentId: o
|
|
1192
|
+
});
|
|
1193
|
+
}, Xt = function(e) {
|
|
1194
|
+
const t = e || this.currentNode;
|
|
1195
|
+
t && this.createInputDiv(t);
|
|
1196
|
+
}, Wt = function(e, t) {
|
|
1197
|
+
e.childNodes[0].textContent = t, e.nodeObj.topic = t, this.linkDiv();
|
|
1198
|
+
}, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1199
|
+
__proto__: null,
|
|
1200
|
+
addChild: _t,
|
|
1201
|
+
beginEdit: Xt,
|
|
1202
|
+
copyNode: zt,
|
|
1203
|
+
insertBefore: Ht,
|
|
1204
|
+
insertParent: Bt,
|
|
1205
|
+
insertSibling: jt,
|
|
1206
|
+
moveDownNode: Ft,
|
|
1207
|
+
moveNode: Rt,
|
|
1208
|
+
moveNodeAfter: Yt,
|
|
1209
|
+
moveNodeBefore: It,
|
|
1210
|
+
moveUpNode: Vt,
|
|
1211
|
+
removeNode: qt,
|
|
1212
|
+
reshapeNode: Dt,
|
|
1213
|
+
setNodeTopic: Wt
|
|
1214
|
+
}, Symbol.toStringTag, { value: "Module" })), Ut = function(e) {
|
|
1215
|
+
return {
|
|
1216
|
+
dom: e,
|
|
1217
|
+
mousedown: !1,
|
|
1218
|
+
lastX: 0,
|
|
1219
|
+
lastY: 0,
|
|
1220
|
+
handleMouseMove(t) {
|
|
1221
|
+
if (t.stopPropagation(), this.mousedown) {
|
|
1222
|
+
if (!this.lastX) {
|
|
1223
|
+
this.lastX = t.pageX, this.lastY = t.pageY;
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
const n = this.lastX - t.pageX, i = this.lastY - t.pageY;
|
|
1227
|
+
this.cb && this.cb(n, i), this.lastX = t.pageX, this.lastY = t.pageY;
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
handleMouseDown(t) {
|
|
1231
|
+
t.stopPropagation(), this.mousedown = !0;
|
|
1232
|
+
},
|
|
1233
|
+
handleClear(t) {
|
|
1234
|
+
t.stopPropagation(), this.clear();
|
|
1235
|
+
},
|
|
1236
|
+
cb: null,
|
|
1237
|
+
init(t, n) {
|
|
1238
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), t.addEventListener("mousemove", this.handleMouseMove), t.addEventListener("mouseleave", this.handleClear), t.addEventListener("mouseup", this.handleClear), this.dom.addEventListener("mousedown", this.handleMouseDown);
|
|
1239
|
+
},
|
|
1240
|
+
destory(t) {
|
|
1241
|
+
t.removeEventListener("mousemove", this.handleMouseMove), t.removeEventListener("mouseleave", this.handleClear), t.removeEventListener("mouseup", this.handleClear), this.dom.removeEventListener("mousedown", this.handleMouseDown);
|
|
1242
|
+
},
|
|
1243
|
+
clear() {
|
|
1244
|
+
this.mousedown = !1, this.lastX = 0, this.lastY = 0;
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
}, se = {
|
|
1248
|
+
create: Ut
|
|
1249
|
+
}, Gt = function(e, t, n, i) {
|
|
1250
|
+
const o = this.map.getBoundingClientRect();
|
|
1251
|
+
if (!e || !t)
|
|
1252
|
+
return;
|
|
1253
|
+
const s = e.getBoundingClientRect(), r = t.getBoundingClientRect(), a = (s.x + s.width / 2 - o.x) / this.scaleVal, l = (s.y + s.height / 2 - o.y) / this.scaleVal, u = (r.x + r.width / 2 - o.x) / this.scaleVal, c = (r.y + r.height / 2 - o.y) / this.scaleVal;
|
|
1254
|
+
let h, d, p, g;
|
|
1255
|
+
n && i ? (h = a + i.delta1.x, d = l + i.delta1.y, p = u + i.delta2.x, g = c + i.delta2.y) : (l + c) / 2 - l <= s.height / 2 ? (h = (s.x + s.width - o.x) / this.scaleVal + 100, d = l, p = (r.x + r.width - o.x) / this.scaleVal + 100, g = c) : (h = (a + u) / 2, d = (l + c) / 2, p = (a + u) / 2, g = (l + c) / 2);
|
|
1256
|
+
const f = {
|
|
1257
|
+
cx: a,
|
|
1258
|
+
cy: l,
|
|
1259
|
+
w: s.width,
|
|
1260
|
+
h: s.height
|
|
1261
|
+
}, m = {
|
|
1262
|
+
cx: u,
|
|
1263
|
+
cy: c,
|
|
1264
|
+
w: r.width,
|
|
1265
|
+
h: r.height
|
|
1266
|
+
}, b = U(f, h, d), v = b.x, y = b.y, N = G(m, p, g), C = N.x, H = N.y, z = he(p, g, C, H), S = {
|
|
1267
|
+
id: "",
|
|
1268
|
+
label: "",
|
|
1269
|
+
from: e.nodeObj.id,
|
|
1270
|
+
to: t.nodeObj.id,
|
|
1271
|
+
delta1: {
|
|
1272
|
+
x: h - a,
|
|
1273
|
+
y: d - l
|
|
1274
|
+
},
|
|
1275
|
+
delta2: {
|
|
1276
|
+
x: p - u,
|
|
1277
|
+
y: g - c
|
|
1278
|
+
}
|
|
1279
|
+
}, V = Xe(
|
|
1280
|
+
`M ${v} ${y} C ${h} ${d} ${p} ${g} ${C} ${H}`,
|
|
1281
|
+
`M ${z.x1} ${z.y1} L ${C} ${H} L ${z.x2} ${z.y2}`
|
|
1282
|
+
);
|
|
1283
|
+
n && i ? (S.id = i.id, this.linkData[i.id] = S) : (S.id = I(), this.linkData[S.id] = S, this.currentLink = V), V.linkObj = S, V.dataset.linkid = S.id, this.linkSvgGroup.appendChild(V), n || this.showLinkController(h, d, p, g, S, f, m);
|
|
1284
|
+
}, Kt = function(e) {
|
|
1285
|
+
let t;
|
|
1286
|
+
if (e ? t = e : t = this.currentLink, !t)
|
|
1287
|
+
return;
|
|
1288
|
+
console.log(t), this.hideLinkController();
|
|
1289
|
+
const n = t.linkObj.id;
|
|
1290
|
+
console.log(n), delete this.linkData[n], t.remove(), t = null;
|
|
1291
|
+
}, Jt = function(e) {
|
|
1292
|
+
this.currentLink = e;
|
|
1293
|
+
const t = e.linkObj;
|
|
1294
|
+
if (!t)
|
|
1295
|
+
return;
|
|
1296
|
+
const n = t.from, i = t.to, o = this.map.getBoundingClientRect(), s = E(n).getBoundingClientRect(), r = E(i).getBoundingClientRect(), a = (s.x + s.width / 2 - o.x) / this.scaleVal, l = (s.y + s.height / 2 - o.y) / this.scaleVal, u = (r.x + r.width / 2 - o.x) / this.scaleVal, c = (r.y + r.height / 2 - o.y) / this.scaleVal, h = {
|
|
1297
|
+
cx: a,
|
|
1298
|
+
cy: l,
|
|
1299
|
+
w: s.width,
|
|
1300
|
+
h: s.height
|
|
1301
|
+
}, d = {
|
|
1302
|
+
cx: u,
|
|
1303
|
+
cy: c,
|
|
1304
|
+
w: r.width,
|
|
1305
|
+
h: r.height
|
|
1306
|
+
}, p = a + t.delta1.x, g = l + t.delta1.y, f = u + t.delta2.x, m = c + t.delta2.y;
|
|
1307
|
+
this.showLinkController(p, g, f, m, t, h, d);
|
|
1308
|
+
}, Qt = function() {
|
|
1309
|
+
this.linkController.style.display = "none", this.P2.style.display = "none", this.P3.style.display = "none";
|
|
1310
|
+
}, Zt = function(e, t, n, i, o, s, r) {
|
|
1311
|
+
this.linkController.style.display = "initial", this.P2.style.display = "initial", this.P3.style.display = "initial";
|
|
1312
|
+
const a = U(s, e, t);
|
|
1313
|
+
let l = a.x, u = a.y;
|
|
1314
|
+
const c = G(r, n, i);
|
|
1315
|
+
let h = c.x, d = c.y;
|
|
1316
|
+
this.P2.style.cssText = `top:${t}px;left:${e}px;`, this.P3.style.cssText = `top:${i}px;left:${n}px;`, this.line1.setAttribute("x1", l), this.line1.setAttribute("y1", u), this.line1.setAttribute("x2", e), this.line1.setAttribute("y2", t), this.line2.setAttribute("x1", n), this.line2.setAttribute("y1", i), this.line2.setAttribute("x2", h), this.line2.setAttribute("y2", d), this.helper1 && (this.helper1.destory(this.map), this.helper2.destory(this.map)), this.helper1 = se.create(this.P2), this.helper2 = se.create(this.P3), this.helper1.init(this.map, (p, g) => {
|
|
1317
|
+
var m;
|
|
1318
|
+
e = e - p / this.scaleVal, t = t - g / this.scaleVal;
|
|
1319
|
+
const f = U(s, e, t);
|
|
1320
|
+
l = f.x, u = f.y, this.P2.style.top = t + "px", this.P2.style.left = e + "px", (m = this.currentLink) == null || m.children[0].setAttribute("d", `M ${l} ${u} C ${e} ${t} ${n} ${i} ${h} ${d}`), this.line1.setAttribute("x1", l), this.line1.setAttribute("y1", u), this.line1.setAttribute("x2", e), this.line1.setAttribute("y2", t), o.delta1.x = e - s.cx, o.delta1.y = t - s.cy;
|
|
1321
|
+
}), this.helper2.init(this.map, (p, g) => {
|
|
1322
|
+
var b, v;
|
|
1323
|
+
n = n - p / this.scaleVal, i = i - g / this.scaleVal;
|
|
1324
|
+
const f = G(r, n, i);
|
|
1325
|
+
h = f.x, d = f.y;
|
|
1326
|
+
const m = he(n, i, h, d);
|
|
1327
|
+
this.P3.style.top = i + "px", this.P3.style.left = n + "px", (b = this.currentLink) == null || b.children[0].setAttribute("d", `M ${l} ${u} C ${e} ${t} ${n} ${i} ${h} ${d}`), (v = this.currentLink) == null || v.children[1].setAttribute("d", `M ${m.x1} ${m.y1} L ${h} ${d} L ${m.x2} ${m.y2}`), this.line2.setAttribute("x1", n), this.line2.setAttribute("y1", i), this.line2.setAttribute("x2", h), this.line2.setAttribute("y2", d), o.delta2.x = n - r.cx, o.delta2.y = i - r.cy;
|
|
1328
|
+
});
|
|
1329
|
+
}, en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1330
|
+
__proto__: null,
|
|
1331
|
+
createLink: Gt,
|
|
1332
|
+
hideLinkController: Qt,
|
|
1333
|
+
removeLink: Kt,
|
|
1334
|
+
selectLink: Jt,
|
|
1335
|
+
showLinkController: Zt
|
|
1336
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1337
|
+
function tn(e, t) {
|
|
1338
|
+
return async function(...n) {
|
|
1339
|
+
const i = this.before[t];
|
|
1340
|
+
i && !await i.apply(this, n) || e.apply(this, n);
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
const re = Object.keys(ye), Ne = {};
|
|
1344
|
+
for (let e = 0; e < re.length; e++) {
|
|
1345
|
+
const t = re[e];
|
|
1346
|
+
Ne[t] = tn(ye[t], t);
|
|
1347
|
+
}
|
|
1348
|
+
const nn = {
|
|
1349
|
+
getObjById: ae,
|
|
1350
|
+
generateNewObj: ke,
|
|
1351
|
+
layout: je,
|
|
1352
|
+
linkDiv: Ue,
|
|
1353
|
+
createInputDiv: Re,
|
|
1354
|
+
createWrapper: _e,
|
|
1355
|
+
createParent: ze,
|
|
1356
|
+
createChildren: Ve,
|
|
1357
|
+
createTopic: Fe,
|
|
1358
|
+
findEle: E,
|
|
1359
|
+
changeTheme: dt,
|
|
1360
|
+
...At,
|
|
1361
|
+
...Ne,
|
|
1362
|
+
...en,
|
|
1363
|
+
init(e) {
|
|
1364
|
+
if (!e || !e.nodeData)
|
|
1365
|
+
return new Error("MindElixir: `data` is required");
|
|
1366
|
+
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, L(this.nodeData), this.linkData = e.linkData || {}, this.toolBar && at(this), this.keypress && tt(this), Ce() && this.mobileMenu ? nt(this) : this.contextMenu && Qe(this, this.contextMenuOption), this.draggable && st(this), this.allowUndo && rt(this), this.toCenter(), this.layout(), this.linkDiv();
|
|
1367
|
+
}
|
|
1368
|
+
}, B = document;
|
|
1369
|
+
function $({
|
|
1370
|
+
el: e,
|
|
1371
|
+
direction: t,
|
|
1372
|
+
locale: n,
|
|
1373
|
+
draggable: i,
|
|
1374
|
+
editable: o,
|
|
1375
|
+
contextMenu: s,
|
|
1376
|
+
contextMenuOption: r,
|
|
1377
|
+
toolBar: a,
|
|
1378
|
+
keypress: l,
|
|
1379
|
+
before: u,
|
|
1380
|
+
newTopicName: c,
|
|
1381
|
+
allowUndo: h,
|
|
1382
|
+
mainLinkStyle: d,
|
|
1383
|
+
subLinkStyle: p,
|
|
1384
|
+
overflowHidden: g,
|
|
1385
|
+
mobileMenu: f,
|
|
1386
|
+
theme: m
|
|
1387
|
+
}) {
|
|
1388
|
+
console.log("ME_version " + $.version, this);
|
|
1389
|
+
let b = null;
|
|
1390
|
+
const v = Object.prototype.toString.call(e);
|
|
1391
|
+
if (v === "[object HTMLDivElement]" ? b = e : v === "[object String]" && (b = document.querySelector(e)), !b)
|
|
1392
|
+
throw new Error("MindElixir: el is not a valid element");
|
|
1393
|
+
b.className += " mind-elixir", b.innerHTML = "", b.style.setProperty("--gap", M + "px"), this.mindElixirBox = b, this.before = u || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = s === void 0 ? !0 : s, this.toolBar = a === void 0 ? !0 : a, this.keypress = l === void 0 ? !0 : l, this.mobileMenu = f || !1, this.direction = typeof t == "number" ? t : 1, this.draggable = i === void 0 ? !0 : i, this.newTopicName = c || "new node", this.editable = o === void 0 ? !0 : o, this.allowUndo = h === void 0 ? !1 : h, this.currentNode = null, this.currentLink = null, this.inputDiv = null, this.scaleVal = 1, this.tempDirection = null, this.mainLinkStyle = d || 0, this.subLinkStyle = p || 0, this.overflowHidden = g || !1, this.bus = De.create(), this.container = B.createElement("div"), this.container.className = "map-container";
|
|
1394
|
+
const y = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1395
|
+
this.theme = m || (y.matches ? ce : le);
|
|
1396
|
+
const N = B.createElement("div");
|
|
1397
|
+
N.className = "map-canvas", this.map = N, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = B.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = F("lines"), this.linkController = F("linkcontroller"), this.P2 = B.createElement("div"), this.P3 = B.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = ee(0, 0, 0, 0), this.line2 = ee(0, 0, 0, 0), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = F("topiclinks"), this.map.appendChild(this.nodes), this.map.appendChild(this.linkController), this.map.appendChild(this.linkSvgGroup), this.map.appendChild(this.P2), this.map.appendChild(this.P3), this.overflowHidden ? this.container.style.overflow = "hidden" : Ae(this);
|
|
1398
|
+
}
|
|
1399
|
+
$.prototype = nn;
|
|
1400
|
+
$.LEFT = x;
|
|
1401
|
+
$.RIGHT = P;
|
|
1402
|
+
$.SIDE = _;
|
|
1403
|
+
$.THEME = le;
|
|
1404
|
+
$.DARK_THEME = ce;
|
|
1405
|
+
$.version = "3.0.0";
|
|
1406
|
+
$.E = E;
|
|
1407
|
+
$.new = (e) => ({
|
|
1408
|
+
nodeData: {
|
|
1409
|
+
id: I(),
|
|
1410
|
+
topic: e || "new topic",
|
|
1411
|
+
root: !0,
|
|
1412
|
+
children: []
|
|
1413
|
+
},
|
|
1414
|
+
linkData: {}
|
|
1415
|
+
});
|
|
1416
|
+
export {
|
|
1417
|
+
$ as default,
|
|
1418
|
+
nn as methods
|
|
1419
|
+
};
|