diff --git a/src/core/buffer/buffer.pri b/src/core/buffer/buffer.pri index 9d965a3e..a1d16fd7 100644 --- a/src/core/buffer/buffer.pri +++ b/src/core/buffer/buffer.pri @@ -5,12 +5,13 @@ SOURCES += \ $$PWD/markdownbuffer.cpp \ $$PWD/markdownbufferfactory.cpp \ $$PWD/filetypehelper.cpp \ + $$PWD/mindmapbuffer.cpp \ + $$PWD/mindmapbufferfactory.cpp \ $$PWD/nodebufferprovider.cpp \ $$PWD/pdfbuffer.cpp \ $$PWD/pdfbufferfactory.cpp \ $$PWD/textbuffer.cpp \ - $$PWD/textbufferfactory.cpp \ - $$PWD/urlbasedbufferprovider.cpp + $$PWD/textbufferfactory.cpp HEADERS += \ $$PWD/bufferprovider.h \ @@ -20,6 +21,8 @@ HEADERS += \ $$PWD/markdownbuffer.h \ $$PWD/markdownbufferfactory.h \ $$PWD/filetypehelper.h \ + $$PWD/mindmapbuffer.h \ + $$PWD/mindmapbufferfactory.h \ $$PWD/nodebufferprovider.h \ $$PWD/pdfbuffer.h \ $$PWD/pdfbufferfactory.h \ diff --git a/src/core/buffer/filetypehelper.cpp b/src/core/buffer/filetypehelper.cpp index fd0023d9..4a2f397c 100644 --- a/src/core/buffer/filetypehelper.cpp +++ b/src/core/buffer/filetypehelper.cpp @@ -91,6 +91,22 @@ void FileTypeHelper::setupBuiltInTypes() m_fileTypes.push_back(type); } + { + FileType type; + type.m_type = FileType::MindMap; + type.m_typeName = QStringLiteral("MindMap"); + type.m_displayName = Buffer::tr("Mind Map"); + + auto suffixes = coreConfig.findFileTypeSuffix(type.m_typeName); + if (suffixes && !suffixes->isEmpty()) { + type.m_suffixes = *suffixes; + } else { + type.m_suffixes << QStringLiteral("emind"); + } + + m_fileTypes.push_back(type); + } + { FileType type; type.m_type = FileType::Others; diff --git a/src/core/buffer/filetypehelper.h b/src/core/buffer/filetypehelper.h index 59655692..911af7cb 100644 --- a/src/core/buffer/filetypehelper.h +++ b/src/core/buffer/filetypehelper.h @@ -16,6 +16,7 @@ namespace vnotex Markdown = 0, Text, Pdf, + MindMap, Others }; diff --git a/src/core/buffer/mindmapbuffer.cpp b/src/core/buffer/mindmapbuffer.cpp new file mode 100644 index 00000000..06fa9f24 --- /dev/null +++ b/src/core/buffer/mindmapbuffer.cpp @@ -0,0 +1,17 @@ +#include "mindmapbuffer.h" + +#include + +using namespace vnotex; + +MindMapBuffer::MindMapBuffer(const BufferParameters &p_parameters, + QObject *p_parent) + : Buffer(p_parameters, p_parent) +{ +} + +ViewWindow *MindMapBuffer::createViewWindowInternal(const QSharedPointer &p_paras, QWidget *p_parent) +{ + Q_UNUSED(p_paras); + return new MindMapViewWindow(p_parent); +} diff --git a/src/core/buffer/mindmapbuffer.h b/src/core/buffer/mindmapbuffer.h new file mode 100644 index 00000000..41101d9b --- /dev/null +++ b/src/core/buffer/mindmapbuffer.h @@ -0,0 +1,21 @@ +#ifndef MINDMAPBUFFER_H +#define MINDMAPBUFFER_H + +#include "buffer.h" + +namespace vnotex +{ + class MindMapBuffer : public Buffer + { + Q_OBJECT + public: + MindMapBuffer(const BufferParameters &p_parameters, + QObject *p_parent = nullptr); + + protected: + ViewWindow *createViewWindowInternal(const QSharedPointer &p_paras, + QWidget *p_parent) Q_DECL_OVERRIDE; + }; +} + +#endif // MINDMAPBUFFER_H diff --git a/src/core/buffer/mindmapbufferfactory.cpp b/src/core/buffer/mindmapbufferfactory.cpp new file mode 100644 index 00000000..f2f699bc --- /dev/null +++ b/src/core/buffer/mindmapbufferfactory.cpp @@ -0,0 +1,16 @@ +#include "mindmapbufferfactory.h" + +#include "mindmapbuffer.h" + +using namespace vnotex; + +Buffer *MindMapBufferFactory::createBuffer(const BufferParameters &p_parameters, + QObject *p_parent) +{ + return new MindMapBuffer(p_parameters, p_parent); +} + +bool MindMapBufferFactory::isBufferCreatedByFactory(const Buffer *p_buffer) const +{ + return dynamic_cast(p_buffer) != nullptr; +} diff --git a/src/core/buffer/mindmapbufferfactory.h b/src/core/buffer/mindmapbufferfactory.h new file mode 100644 index 00000000..68522e6a --- /dev/null +++ b/src/core/buffer/mindmapbufferfactory.h @@ -0,0 +1,19 @@ +#ifndef MINDMAPBUFFERFACTORY_H +#define MINDMAPBUFFERFACTORY_H + +#include "ibufferfactory.h" + +namespace vnotex +{ + // Buffer factory for MindMap file. + class MindMapBufferFactory : public IBufferFactory + { + public: + Buffer *createBuffer(const BufferParameters &p_parameters, + QObject *p_parent) Q_DECL_OVERRIDE; + + bool isBufferCreatedByFactory(const Buffer *p_buffer) const Q_DECL_OVERRIDE; + }; +} + +#endif // MINDMAPBUFFERFACTORY_H diff --git a/src/core/buffer/pdfbuffer.h b/src/core/buffer/pdfbuffer.h index 573629ae..d66e37b1 100644 --- a/src/core/buffer/pdfbuffer.h +++ b/src/core/buffer/pdfbuffer.h @@ -15,7 +15,6 @@ namespace vnotex protected: ViewWindow *createViewWindowInternal(const QSharedPointer &p_paras, QWidget *p_parent) Q_DECL_OVERRIDE; - }; } // ns vnotex diff --git a/src/core/buffer/urlbasedbufferprovider.cpp b/src/core/buffer/urlbasedbufferprovider.cpp deleted file mode 100644 index 0aa6ef89..00000000 --- a/src/core/buffer/urlbasedbufferprovider.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "urlbasedbufferprovider.h" - -using namespace vnotex; diff --git a/src/core/buffermgr.cpp b/src/core/buffermgr.cpp index eac6defe..94b644eb 100644 --- a/src/core/buffermgr.cpp +++ b/src/core/buffermgr.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,10 @@ void BufferMgr::initBufferServer() // Pdf. auto pdfFactory = QSharedPointer::create(); m_bufferServer->registerItem(helper.getFileType(FileType::Pdf).m_typeName, pdfFactory); + + // MindMap. + auto mindMapFactory = QSharedPointer::create(); + m_bufferServer->registerItem(helper.getFileType(FileType::MindMap).m_typeName, mindMapFactory); } void BufferMgr::open(Node *p_node, const QSharedPointer &p_paras) diff --git a/src/core/core.pri b/src/core/core.pri index 3da141de..fc649821 100644 --- a/src/core/core.pri +++ b/src/core/core.pri @@ -24,6 +24,7 @@ SOURCES += \ $$PWD/logger.cpp \ $$PWD/mainconfig.cpp \ $$PWD/markdowneditorconfig.cpp \ + $$PWD/mindmapeditorconfig.cpp \ $$PWD/pdfviewerconfig.cpp \ $$PWD/quickaccesshelper.cpp \ $$PWD/singleinstanceguard.cpp \ @@ -54,6 +55,7 @@ HEADERS += \ $$PWD/logger.h \ $$PWD/mainconfig.h \ $$PWD/markdowneditorconfig.h \ + $$PWD/mindmapeditorconfig.h \ $$PWD/noncopyable.h \ $$PWD/pdfviewerconfig.h \ $$PWD/quickaccesshelper.h \ diff --git a/src/core/editorconfig.cpp b/src/core/editorconfig.cpp index a7d187fd..a0a4439a 100644 --- a/src/core/editorconfig.cpp +++ b/src/core/editorconfig.cpp @@ -6,6 +6,7 @@ #include "texteditorconfig.h" #include "markdowneditorconfig.h" #include "pdfviewerconfig.h" +#include "mindmapeditorconfig.h" #include @@ -43,7 +44,8 @@ EditorConfig::EditorConfig(ConfigMgr *p_mgr, IConfig *p_topConfig) : IConfig(p_mgr, p_topConfig), m_textEditorConfig(new TextEditorConfig(p_mgr, p_topConfig)), m_markdownEditorConfig(new MarkdownEditorConfig(p_mgr, p_topConfig, m_textEditorConfig)), - m_pdfViewerConfig(new PdfViewerConfig(p_mgr, p_topConfig)) + m_pdfViewerConfig(new PdfViewerConfig(p_mgr, p_topConfig)), + m_mindMapEditorConfig(new MindMapEditorConfig(p_mgr, p_topConfig)) { m_sessionName = QStringLiteral("editor"); } @@ -68,6 +70,7 @@ void EditorConfig::init(const QJsonObject &p_app, m_textEditorConfig->init(appObj, userObj); m_markdownEditorConfig->init(appObj, userObj); m_pdfViewerConfig->init(appObj, userObj); + m_mindMapEditorConfig->init(appObj, userObj); } void EditorConfig::loadCore(const QJsonObject &p_app, const QJsonObject &p_user) @@ -152,6 +155,7 @@ QJsonObject EditorConfig::toJson() const obj[m_textEditorConfig->getSessionName()] = m_textEditorConfig->toJson(); obj[m_markdownEditorConfig->getSessionName()] = m_markdownEditorConfig->toJson(); obj[m_pdfViewerConfig->getSessionName()] = m_pdfViewerConfig->toJson(); + obj[m_mindMapEditorConfig->getSessionName()] = m_mindMapEditorConfig->toJson(); obj[QStringLiteral("core")] = saveCore(); obj[QStringLiteral("image_host")] = saveImageHost(); @@ -192,6 +196,16 @@ const PdfViewerConfig &EditorConfig::getPdfViewerConfig() const return *m_pdfViewerConfig; } +MindMapEditorConfig &EditorConfig::getMindMapEditorConfig() +{ + return *m_mindMapEditorConfig; +} + +const MindMapEditorConfig &EditorConfig::getMindMapEditorConfig() const +{ + return *m_mindMapEditorConfig; +} + int EditorConfig::getToolBarIconSize() const { return m_toolBarIconSize; diff --git a/src/core/editorconfig.h b/src/core/editorconfig.h index 4819b44e..31f29ede 100644 --- a/src/core/editorconfig.h +++ b/src/core/editorconfig.h @@ -20,6 +20,7 @@ namespace vnotex class TextEditorConfig; class MarkdownEditorConfig; class PdfViewerConfig; + class MindMapEditorConfig; class EditorConfig : public IConfig { @@ -109,6 +110,9 @@ namespace vnotex PdfViewerConfig &getPdfViewerConfig(); const PdfViewerConfig &getPdfViewerConfig() const; + MindMapEditorConfig &getMindMapEditorConfig(); + const MindMapEditorConfig &getMindMapEditorConfig() const; + void init(const QJsonObject &p_app, const QJsonObject &p_user) Q_DECL_OVERRIDE; QJsonObject toJson() const Q_DECL_OVERRIDE; @@ -182,6 +186,8 @@ namespace vnotex QScopedPointer m_pdfViewerConfig; + QScopedPointer m_mindMapEditorConfig; + bool m_spellCheckAutoDetectLanguageEnabled = false; QString m_spellCheckDefaultDictionary; diff --git a/src/core/htmltemplatehelper.cpp b/src/core/htmltemplatehelper.cpp index 5272010a..f435d192 100644 --- a/src/core/htmltemplatehelper.cpp +++ b/src/core/htmltemplatehelper.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -19,6 +20,8 @@ HtmlTemplateHelper::Template HtmlTemplateHelper::s_markdownViewerTemplate; HtmlTemplateHelper::Template HtmlTemplateHelper::s_pdfViewerTemplate; +HtmlTemplateHelper::Template HtmlTemplateHelper::s_mindMapEditorTemplate; + QString MarkdownWebGlobalOptions::toJavascriptObject() const { return QStringLiteral("window.vxOptions = {\n") @@ -339,7 +342,7 @@ const QString &HtmlTemplateHelper::getPdfViewerTemplatePath() void HtmlTemplateHelper::updatePdfViewerTemplate(const PdfViewerConfig &p_config, bool p_force) { - if (!p_force && p_config.revision() == s_markdownViewerTemplate.m_revision) { + if (!p_force && p_config.revision() == s_pdfViewerTemplate.m_revision) { return; } @@ -361,3 +364,41 @@ void HtmlTemplateHelper::generatePdfViewerTemplate(const PdfViewerConfig &p_conf fillResources(p_template.m_template, viewerResource); } + +const QString &HtmlTemplateHelper::getMindMapEditorTemplate() +{ + return s_mindMapEditorTemplate.m_template; +} + +void HtmlTemplateHelper::updateMindMapEditorTemplate(const MindMapEditorConfig &p_config, bool p_force) +{ + if (!p_force && p_config.revision() == s_mindMapEditorTemplate.m_revision) { + return; + } + + s_mindMapEditorTemplate.m_revision = p_config.revision(); + + const auto &themeMgr = VNoteX::getInst().getThemeMgr(); + generateMindMapEditorTemplate(p_config, + themeMgr.getFile(Theme::File::WebStyleSheet), + s_mindMapEditorTemplate); +} + +void HtmlTemplateHelper::generateMindMapEditorTemplate(const MindMapEditorConfig &p_config, + const QString &p_webStyleSheetFile, + Template& p_template) +{ + const auto &editorResource = p_config.getEditorResource(); + p_template.m_templatePath = ConfigMgr::getInst().getUserOrAppFile(editorResource.m_template); + try { + p_template.m_template = FileUtils::readTextFile(p_template.m_templatePath); + } catch (Exception &p_e) { + qWarning() << "failed to read HTML template" << p_template.m_templatePath << p_e.what(); + p_template.m_template = errorPage(); + return; + } + + fillThemeStyles(p_template.m_template, p_webStyleSheetFile, QString()); + + fillResources(p_template.m_template, editorResource); +} diff --git a/src/core/htmltemplatehelper.h b/src/core/htmltemplatehelper.h index 1078ce63..2bc1b121 100644 --- a/src/core/htmltemplatehelper.h +++ b/src/core/htmltemplatehelper.h @@ -7,6 +7,7 @@ namespace vnotex { class MarkdownEditorConfig; class PdfViewerConfig; + class MindMapEditorConfig; struct WebResource; // Global options to be passed to Web side at the very beginning for Markdown. @@ -91,7 +92,7 @@ namespace vnotex HtmlTemplateHelper() = delete; - // For Markdown. + // For MarkdownViewer. static const QString &getMarkdownViewerTemplate(); static void updateMarkdownViewerTemplate(const MarkdownEditorConfig &p_config, bool p_force = false); @@ -119,6 +120,10 @@ namespace vnotex static const QString &getPdfViewerTemplatePath(); + // For MindMapEditor. + static const QString &getMindMapEditorTemplate(); + static void updateMindMapEditorTemplate(const MindMapEditorConfig &p_config, bool p_force = false); + private: struct Template { @@ -131,9 +136,15 @@ namespace vnotex static void generatePdfViewerTemplate(const PdfViewerConfig &p_config, Template& p_template); + static void generateMindMapEditorTemplate(const MindMapEditorConfig &p_config, + const QString &p_webStyleSheetFile, + Template& p_template); + static Template s_markdownViewerTemplate; static Template s_pdfViewerTemplate; + + static Template s_mindMapEditorTemplate; }; } diff --git a/src/core/mindmapeditorconfig.cpp b/src/core/mindmapeditorconfig.cpp new file mode 100644 index 00000000..e463a637 --- /dev/null +++ b/src/core/mindmapeditorconfig.cpp @@ -0,0 +1,61 @@ +#include "mindmapeditorconfig.h" + +#include "mainconfig.h" + +#define READSTR(key) readString(appObj, userObj, (key)) +#define READBOOL(key) readBool(appObj, userObj, (key)) +#define READINT(key) readInt(appObj, userObj, (key)) + +using namespace vnotex; + +MindMapEditorConfig::MindMapEditorConfig(ConfigMgr *p_mgr, IConfig *p_topConfig) + : IConfig(p_mgr, p_topConfig) +{ + m_sessionName = QStringLiteral("mindmap_editor"); +} + +void MindMapEditorConfig::init(const QJsonObject &p_app, + const QJsonObject &p_user) +{ + const auto appObj = p_app.value(m_sessionName).toObject(); + const auto userObj = p_user.value(m_sessionName).toObject(); + + loadEditorResource(appObj, userObj); +} + +QJsonObject MindMapEditorConfig::toJson() const +{ + QJsonObject obj; + obj[QStringLiteral("editor_resource")] = saveEditorResource(); + return obj; +} + +void MindMapEditorConfig::loadEditorResource(const QJsonObject &p_app, const QJsonObject &p_user) +{ + const QString name(QStringLiteral("editor_resource")); + + if (MainConfig::isVersionChanged()) { + bool needOverride = p_app[QStringLiteral("override_editor_resource")].toBool(); + if (needOverride) { + qInfo() << "override \"editor_resource\" in user configuration due to version change"; + m_editorResource.init(p_app[name].toObject()); + return; + } + } + + if (p_user.contains(name)) { + m_editorResource.init(p_user[name].toObject()); + } else { + m_editorResource.init(p_app[name].toObject()); + } +} + +QJsonObject MindMapEditorConfig::saveEditorResource() const +{ + return m_editorResource.toJson(); +} + +const WebResource &MindMapEditorConfig::getEditorResource() const +{ + return m_editorResource; +} diff --git a/src/core/mindmapeditorconfig.h b/src/core/mindmapeditorconfig.h new file mode 100644 index 00000000..0c04ea1b --- /dev/null +++ b/src/core/mindmapeditorconfig.h @@ -0,0 +1,31 @@ +#ifndef MINDMAPEDITORCONFIG_H +#define MINDMAPEDITORCONFIG_H + +#include "iconfig.h" + +#include "webresource.h" + +namespace vnotex +{ + class MindMapEditorConfig : public IConfig + { + public: + MindMapEditorConfig(ConfigMgr *p_mgr, IConfig *p_topConfig); + + void init(const QJsonObject &p_app, const QJsonObject &p_user) Q_DECL_OVERRIDE; + + QJsonObject toJson() const Q_DECL_OVERRIDE; + + const WebResource &getEditorResource() const; + + private: + friend class MainConfig; + + void loadEditorResource(const QJsonObject &p_app, const QJsonObject &p_user); + QJsonObject saveEditorResource() const; + + WebResource m_editorResource; + }; +} + +#endif // MINDMAPEDITORCONFIG_H diff --git a/src/data/core/vnotex.json b/src/data/core/vnotex.json index ee79e348..c99806ee 100644 --- a/src/data/core/vnotex.json +++ b/src/data/core/vnotex.json @@ -94,6 +94,12 @@ "suffixes" : [ "pdf" ] + }, + { + "name" : "MindMap", + "suffixes" : [ + "emind" + ] } ], "shortcut_leader_key" : "Ctrl+G", @@ -519,6 +525,39 @@ ] } }, + "mindmap_editor" : { + "override_editor_resource" : true, + "editor_resource" : { + "template" : "web/mindmap-editor-template.html", + "resources" : [ + { + "name" : "built_in", + "enabled" : true, + "scripts" : [ + "web/js/qwebchannel.js", + "web/js/eventemitter.js", + "web/js/utils.js", + "web/js/vxcore.js", + "web/js/mindmapeditorcore.js" + ] + }, + { + "name" : "mind_elixir", + "enabled" : true, + "scripts" : [ + "web/js/mind-elixir/MindElixir.js" + ] + }, + { + "name" : "mindmap_editor", + "enabled" : true, + "scripts" : [ + "web/js/mindmapeditor.js" + ] + } + ] + } + }, "image_host" : { "hosts" : [ ], diff --git a/src/data/extra/extra.qrc b/src/data/extra/extra.qrc index 78f8059d..0afe6cbf 100644 --- a/src/data/extra/extra.qrc +++ b/src/data/extra/extra.qrc @@ -79,8 +79,6 @@ web/js/turndown.js web/js/mark.js/mark.min.js web/js/markjs.js - web/js/mind-elixir/MindElixir.min.js - web/js/mind-elixir/painter.js web/pdf.js/pdfviewer.js web/pdf.js/pdfviewer.css @@ -327,6 +325,11 @@ web/pdf.js/web/cmaps/V.bcmap web/pdf.js/web/cmaps/WP-Symbol.bcmap + web/js/mind-elixir/MindElixir.js + web/mindmap-editor-template.html + web/js/mindmapeditorcore.js + web/js/mindmapeditor.js + dicts/en_US.aff dicts/en_US.dic themes/native/text-editor.theme diff --git a/src/data/extra/web/js/markjs.js b/src/data/extra/web/js/markjs.js index d55e5ea7..90b8cb7f 100644 --- a/src/data/extra/web/js/markjs.js +++ b/src/data/extra/web/js/markjs.js @@ -12,6 +12,10 @@ class MarkJs { this.adapter.on('basicMarkdownRendered', () => { this.clearCache(); }); + + this.adapter.on('rendered', () => { + this.clearCache(); + }); } // @p_options: { diff --git a/src/data/extra/web/js/mind-elixir/MindElixir.js b/src/data/extra/web/js/mind-elixir/MindElixir.js new file mode 100644 index 00000000..4c114da6 --- /dev/null +++ b/src/data/extra/web/js/mind-elixir/MindElixir.js @@ -0,0 +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,(function(){return(()=>{var e={74:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var i=n(81),o=n.n(i),a=n(645),s=n.n(a),r=n(667),l=n.n(r),c=new URL(n(848),n.b),d=new URL(n(295),n.b),h=s()(o()),p=l()(c),u=l()(d);h.push([e.id,".mind-elixir {\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 .focus-mode {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background: #fff;\n}\n.map-container .map-canvas {\n height: 20000px;\n width: 20000px;\n position: relative;\n user-select: none;\n transition: all 0.3s;\n transform: scale(1);\n background: #f6f6f6;\n}\n.map-container .map-canvas .selected {\n outline: 2px solid #4dc4ff;\n}\n.map-container .map-canvas root {\n position: absolute;\n}\n.map-container .map-canvas root tpc {\n display: block;\n color: #ffffff;\n padding: 10px 15px;\n background-color: #00aaff;\n border-radius: 5px;\n font-size: 25px;\n white-space: pre-wrap;\n}\n.map-container .map-canvas root tpc #input-box {\n padding: 10px 15px;\n}\n.map-container .box > grp {\n position: absolute;\n}\n.map-container .box > grp > t > tpc {\n background-color: #ffffff;\n border: 1px solid #444444;\n border-radius: 5px;\n color: #735c45;\n padding: 8px 10px;\n margin: 0;\n}\n.map-container .box > grp > t > tpc #input-box {\n padding: 8px 10px;\n}\n.map-container .box .lhs {\n direction: rtl;\n}\n.map-container .box .lhs tpc {\n direction: ltr;\n}\n.map-container .box grp {\n display: block;\n pointer-events: none;\n}\n.map-container .box children,\n.map-container .box t {\n display: inline-block;\n vertical-align: middle;\n}\n.map-container .box t {\n position: relative;\n cursor: pointer;\n padding: 0 15px;\n margin-top: 10px;\n}\n.map-container .box t tpc {\n position: relative;\n display: block;\n padding: 5px;\n border-radius: 3px;\n color: #666666;\n pointer-events: all;\n max-width: 800px;\n white-space: pre-wrap;\n line-height: 1.2;\n}\n.map-container .box t tpc #input-box {\n padding: 5px;\n}\n.map-container .box t tpc .tags {\n direction: ltr;\n}\n.map-container .box t tpc .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 height: 16px;\n line-height: 16px;\n margin-right: 3px;\n margin-top: 2px;\n}\n.map-container .box t tpc .icons {\n display: inline-block;\n direction: ltr;\n margin-right: 10px;\n}\n.map-container .box t tpc .insert-preview {\n position: absolute;\n width: 100%;\n left: 0px;\n z-index: 9;\n}\n.map-container .box t tpc .before {\n height: 14px;\n top: -14px;\n}\n.map-container .box t tpc .show {\n background: #7ad5ff;\n pointer-events: none;\n opacity: 0.7;\n}\n.map-container .box t tpc .in {\n height: 100%;\n top: 0px;\n}\n.map-container .box t tpc .after {\n height: 14px;\n bottom: -14px;\n}\n.map-container .box t epd {\n position: absolute;\n height: 18px;\n width: 18px;\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 .box t epd.minus {\n background-image: url("+u+") !important;\n transition: all 0.3s;\n opacity: 0;\n}\n.map-container .box t epd.minus:hover {\n opacity: 1;\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.down t,\n.down children {\n display: block !important;\n}\n.down grp {\n display: inline-block !important;\n}\n.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#input-box {\n position: absolute;\n top: 0;\n left: 0;\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",""]);const m=h},165:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(81),o=n.n(i),a=n(645),s=n.n(a)()(o());s.push([e.id,"cmenu {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99;\n}\ncmenu .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}\ncmenu .menu-list * {\n transition: color 0.4s, background-color 0.4s;\n}\ncmenu .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}\ncmenu .menu-list li a {\n color: #333;\n text-decoration: none;\n}\ncmenu .menu-list li.disabled {\n color: #5e5e5e;\n background-color: #f7f7f7;\n}\ncmenu .menu-list li.disabled:hover {\n cursor: default;\n background-color: #f7f7f7;\n}\ncmenu .menu-list li:hover {\n cursor: pointer;\n background-color: #ecf0f1;\n}\ncmenu .menu-list li:first-child {\n border-radius: 5px 5px 0 0;\n}\ncmenu .menu-list li:last-child {\n border-bottom: 0;\n border-radius: 0 0 5px 5px;\n}\ncmenu .menu-list li span:last-child {\n float: right;\n}\n",""]);const r=s},787:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(81),o=n.n(i),a=n(645),s=n.n(a)()(o());s.push([e.id,"mmenu {\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}\nmmenu * {\n transition: color 0.4s, background-color 0.4s;\n}\nmmenu 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}\nmmenu div a {\n color: #333;\n text-decoration: none;\n}\nmmenu div.disabled {\n color: #5e5e5e;\n background-color: #f7f7f7;\n}\nmmenu div.disabled:hover {\n cursor: default;\n background-color: #f7f7f7;\n}\nmmenu div:hover {\n cursor: pointer;\n background-color: #ecf0f1;\n}\n",""]);const r=s},519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(81),o=n.n(i),a=n(645),s=n.n(a)()(o());s.push([e.id,"nmenu {\n position: absolute;\n right: 20px;\n top: 20px;\n background: #fff;\n padding: 10px;\n border-radius: 5px;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n width: 240px;\n box-sizing: border-box;\n padding: 0 15px 15px;\n transition: 0.3s all;\n}\nnmenu.close {\n height: 30px;\n width: 46px;\n overflow: hidden;\n}\nnmenu .button-container {\n padding: 3px 0;\n direction: rtl;\n}\nnmenu #nm-tag {\n margin-top: 20px;\n}\nnmenu .nm-fontsize-container {\n display: flex;\n justify-content: space-around;\n margin-bottom: 20px;\n}\nnmenu .nm-fontsize-container div {\n height: 36px;\n width: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n background-color: white;\n color: tomato;\n border-radius: 100%;\n}\nnmenu .nm-fontcolor-container {\n margin-bottom: 10px;\n}\nnmenu input,\nnmenu textarea {\n background: #f7f9fa;\n border: 1px solid #dce2e6;\n border-radius: 3px;\n padding: 5px;\n margin: 10px 0;\n width: 100%;\n box-sizing: border-box;\n}\nnmenu textarea {\n resize: none;\n}\nnmenu .split6 {\n display: inline-block;\n width: 16.66%;\n margin-bottom: 5px;\n}\nnmenu .palette {\n border-radius: 100%;\n width: 21px;\n height: 21px;\n border: 1px solid #edf1f2;\n margin: auto;\n}\nnmenu .nmenu-selected,\nnmenu .palette:hover {\n box-shadow: tomato 0 0 0 2px;\n background-color: #c7e9fa;\n}\nnmenu .size-selected {\n background-color: tomato !important;\n border-color: tomato;\n fill: white;\n color: white;\n}\nnmenu .size-selected svg {\n color: #fff;\n}\nnmenu .bof {\n text-align: center;\n}\nnmenu .bof span {\n display: inline-block;\n font-size: 14px;\n border-radius: 4px;\n padding: 2px 5px;\n}\nnmenu .bof .selected {\n background-color: tomato;\n color: white;\n}\n",""]);const r=s},301:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(81),o=n.n(i),a=n(645),s=n.n(a)()(o());s.push([e.id,"toolbar {\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}\ntoolbar span:active {\n opacity: 0.5;\n}\n.rb {\n right: 20px;\n bottom: 20px;\n font-family: iconfont;\n}\n.rb span + span {\n margin-left: 10px;\n}\n.lt {\n font-size: 20px;\n left: 20px;\n top: 20px;\n width: 20px;\n}\n.lt span {\n display: block;\n}\n.lt span + span {\n margin-top: 10px;\n}\n",""]);const r=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,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(i)for(var r=0;r0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),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{"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 a=n.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),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,a,s,r='',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("")}catch(e){console}}function c(){a||(a=!0,i())}t=function(){var e,t,n,i;(i=document.createElement("div")).innerHTML=r,r=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,a=!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 a=t[i]={id:i,exports:{}};return e[i](a,a.exports,n),a.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;var i={};return(()=>{"use strict";n.d(i,{default:()=>be});function e(e){return e.replace(/&/g,"&").replace(/e.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,(function(e,t,n,i){return"#"+("0"+Number(t).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)})),o=function(e,t){if((t=t||this.nodeData).id===e)return t;if(!t.children||!t.children.length)return null;for(let n=0;n{if(e.parent=t,e.children)for(let t=0;t{var n=Date.now();return function(){var i=this,o=arguments,a=Date.now();a-n>=t&&(e.apply(i,o),n=Date.now())}};function l(e,t,n,i){const o=i-t,a=e-n;let s=Math.atan(Math.abs(o)/Math.abs(a))/3.14*180;a<0&&o>0&&(s=180-s),a<0&&o<0&&(s=180+s),a>0&&o<0&&(s=360-s);var r=s+30;const l=s-30;return{x1:n+20*Math.cos(Math.PI*r/180),y1:i-20*Math.sin(Math.PI*r/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 a=(e.cy-n)/(t-e.cx);return a>e.h/e.w||a<-e.h/e.w?e.cy-n<0?(i=e.cx-e.h/2/a,o=e.cy+e.h/2):(i=e.cx+e.h/2/a,o=e.cy-e.h/2):e.cx-t<0?(i=e.cx+e.w/2,o=e.cy-e.w*a/2):(i=e.cx-e.w/2,o=e.cy+e.w*a/2),{x:i,y:o}}function d(e,t,n){let i,o;const a=(e.cy-n)/(t-e.cx);return a>e.h/e.w||a<-e.h/e.w?e.cy-n<0?(i=e.cx-e.h/2/a,o=e.cy+e.h/2):(i=e.cx+e.h/2/a,o=e.cy-e.h/2):e.cx-t<0?(i=e.cx+e.w/2,o=e.cy-e.w*a/2):(i=e.cx-e.w/2,o=e.cy+e.w*a/2),{x:i,y:o}}function h(){return((new Date).getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}function p(e){const t=e.parent.children,n=t.indexOf(e);return t.splice(n,1),t.length}const u={afterMoving:!1,mousedown:!1,lastX:null,lastY:null,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=null,this.lastY=null}};function m(e){this.dom=e,this.mousedown=!1,this.lastX=null,this.lastY=null}m.prototype.init=function(e,t){this.handleMouseMove=e=>{if(e.stopPropagation(),this.mousedown){if(!this.lastX)return this.lastX=e.pageX,void(this.lastY=e.pageY);const n=this.lastX-e.pageX,i=this.lastY-e.pageY;t(n,i),this.lastX=e.pageX,this.lastY=e.pageY}},this.handleMouseDown=e=>{e.stopPropagation(),this.mousedown=!0},this.handleClear=e=>{e.stopPropagation(),this.clear()},e.addEventListener("mousemove",this.handleMouseMove),e.addEventListener("mouseleave",this.handleClear),e.addEventListener("mouseup",this.handleClear),this.dom.addEventListener("mousedown",this.handleMouseDown)},m.prototype.destory=function(e){e.removeEventListener("mousemove",this.handleMouseMove),e.removeEventListener("mouseleave",this.handleClear),e.removeEventListener("mouseup",this.handleClear),this.dom.removeEventListener("mousedown",this.handleMouseDown)},m.prototype.clear=function(){this.mousedown=!1,this.lastX=null,this.lastY=null};const f=document,g=(e,t)=>(t?t.mindElixirBox:f).querySelector(`[data-nodeid=me${e}]`),b=function(t,n){if(t.textContent=n.topic,n.style&&(t.style.color=n.style.color||"inherit",t.style.background=n.style.background||"inherit",t.style.fontSize=n.style.fontSize+"px",t.style.fontWeight=n.style.fontWeight||"normal"),n.hyperLink){const e=f.createElement("a");e.className="hyper-link",e.target="_blank",e.innerText="🔗",e.href=n.hyperLink,t.appendChild(e),t.linkContainer=e}else t.linkContainer&&(t.linkContainer.remove(),t.linkContainer=null);if(n.icons&&n.icons.length){const i=f.createElement("span");i.className="icons",i.innerHTML=n.icons.map((t=>`${e(t)}`)).join(""),t.appendChild(i)}if(n.tags&&n.tags.length){const i=f.createElement("div");i.className="tags",i.innerHTML=n.tags.map((t=>`${e(t)}`)).join(""),t.appendChild(i)}};const y=function(e){const t=f.createElement("epd");return t.expanded=!1!==e,t.className=!1!==e?"minus":"",t};const x=document,N="http://www.w3.org/2000/svg",v=function(e){const t=x.createElementNS(N,"svg");return t.setAttribute("class",e),t},M=function(e,t,n,i){const o=x.createElementNS(N,"line");return o.setAttribute("x1",e),o.setAttribute("y1",t),o.setAttribute("x2",n),o.setAttribute("y2",i),o.setAttribute("stroke","#bbb"),o.setAttribute("fill","none"),o.setAttribute("stroke-width","2"),o},k=function(e){const t=x.createElementNS(N,"path");return t.setAttribute("d",e),t.setAttribute("stroke","#555"),t.setAttribute("fill","none"),t.setAttribute("stroke-linecap","square"),t.setAttribute("stroke-width","1"),t};function C(e){return e.isFocusMode?e.nodeDataBackup:e.nodeData}const z=document,w=function(e,t){if(!e)return;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],a(this.nodeData);const o=e.parentElement,{grp:s,top:r}=this.createGroup(i);if("T"===o.tagName){if(o.children[1])o.nextSibling.appendChild(s);else{const e=z.createElement("children");e.appendChild(s),o.appendChild(y(!0)),o.insertAdjacentElement("afterend",e)}this.linkDiv(s.offsetParent)}else"ROOT"===o.tagName&&(this.judgeDirection(s,i),o.nextSibling.appendChild(s),this.linkDiv());return{newTop:r,newNodeObj:i}};function j(e,t,n){let i="";const o=t.offsetTop,a=t.offsetLeft,s=t.offsetWidth,r=t.offsetHeight;for(let t=0;t0&&(i+=j(x,c))}return i}function L({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 E({x1:e,y1:t,x2:n,y2:i}){return`M ${e} ${t} Q ${e} ${i} ${n} ${i}`}function S({x1:e,y1:t,x2:n,y2:i,xMiddle:o}){return it-50?`M ${e} ${t} H ${o} V ${i} H ${n}`:i>=t?`M ${e} ${t} H ${o} V ${i-8} A 8 8 0 0 ${e>n?1:0} ${e>n?o-8:o+8} ${i} H ${n}`:`M ${e} ${t} H ${o} V ${i+8} A 8 8 0 0 ${e>n?0:1} ${e>n?o-8:o+8} ${i} H ${n}`}const D={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",clickTips:"请点击目标节点",font:"文字",background:"背景",tag:"标签",icon:"图标",tagsSeparate:"多个标签半角逗号分隔",iconsSeparate:"多个图标半角逗号分隔",url:"URL"},T={cn:D,zh_CN:D,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",clickTips:"請點擊目標節點",font:"文字",background:"背景",tag:"標簽",icon:"圖標",tagsSeparate:"多個標簽半角逗號分隔",iconsSeparate:"多個圖標半角逗號分隔",url:"URL"},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",font:"Font",background:"Background",tag:"Tag",icon:"Icon",tagsSeparate:"Separate tags by comma",iconsSeparate:"Separate icons by comma",url:"URL"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",clickTips:"Пожалуйста, нажмите на целевой узел",font:"Цвет шрифта",background:"Цвет фона",tag:"Тег",icon:"Иконка",tagsSeparate:"Разделяйте теги запятой",iconsSeparate:"Разделяйте иконки запятой"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",clickTips:"ターゲットノードをクリックしてください",font:"フォント",background:"バックグラウンド",tag:"タグ",icon:"アイコン",tagsSeparate:"複数タグはカンマ区切り",iconsSeparate:"複数アイコンはカンマ区切り",url:"URL"},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",font:"Fonte",background:"Cor de fundo",tag:"Tag",icon:"Icone",tagsSeparate:"Separe tags por virgula",iconsSeparate:"Separe icones por virgula",url:"URL"}};var A=n(379),I=n.n(A),O=n(795),P=n.n(O),$=n(569),H=n.n($),Y=n(565),B=n.n(Y),R=n(216),Z=n.n(R),V=n(589),F=n.n(V),W=n(165),q={};q.styleTagTransform=F(),q.setAttributes=B(),q.insert=H().bind(null,"head"),q.domAPI=P(),q.insertStyleElement=Z();I()(W.Z,q);W.Z&&W.Z.locals&&W.Z.locals;function U(t,n){const i=(t,n,i)=>{const o=document.createElement("li");return o.id=t,o.innerHTML=`${e(n)}${e(i)}`,o},o=T[t.locale]?t.locale:"en",a=i("cm-add_child",T[o].addChild,"tab"),s=i("cm-add_parent",T[o].addParent,""),r=i("cm-add_sibling",T[o].addSibling,"enter"),l=i("cm-remove_child",T[o].removeNode,"delete"),c=i("cm-fucus",T[o].focus,""),d=i("cm-unfucus",T[o].cancelFocus,""),h=i("cm-up",T[o].moveUp,"PgUp"),p=i("cm-down",T[o].moveDown,"Pgdn"),u=i("cm-down",T[o].link,""),m=document.createElement("ul");if(m.className="menu-list",m.appendChild(a),m.appendChild(s),m.appendChild(r),m.appendChild(l),n&&!n.focus||(m.appendChild(c),m.appendChild(d)),m.appendChild(h),m.appendChild(p),n&&!n.link||m.appendChild(u),n&&n.extend)for(let e=0;e{t.onclick(e)}}const f=document.createElement("cmenu");f.appendChild(m),f.hidden=!0,t.container.append(f);let g=!0;t.container.oncontextmenu=function(e){if(e.preventDefault(),!t.editable)return;const n=e.target;if("TPC"===n.tagName){g="ROOT"===n.parentElement.tagName,g?(c.className="disabled",h.className="disabled",p.className="disabled",r.className="disabled",l.className="disabled"):(c.className="",h.className="",p.className="",r.className="",l.className=""),t.selectNode(n),f.hidden=!1;const i=m.offsetHeight,o=m.offsetWidth;i+e.clientY>window.innerHeight?(m.style.top="",m.style.bottom="0px"):(m.style.bottom="",m.style.top=e.clientY+15+"px"),o+e.clientX>window.innerWidth?(m.style.left="",m.style.right="0px"):(m.style.right="",m.style.left=e.clientX+10+"px")}},f.onclick=e=>{e.target===f&&(f.hidden=!0)},a.onclick=e=>{t.addChild(),f.hidden=!0},s.onclick=e=>{t.insertParent(),f.hidden=!0},r.onclick=e=>{g||(t.insertSibling(),f.hidden=!0)},l.onclick=e=>{g||(t.removeNode(),f.hidden=!0)},c.onclick=e=>{g||(t.focusNode(t.currentNode),f.hidden=!0)},d.onclick=e=>{t.cancelFocus(),f.hidden=!0},h.onclick=e=>{g||(t.moveUpNode(),f.hidden=!0)},p.onclick=e=>{g||(t.moveDownNode(),f.hidden=!0)},u.onclick=e=>{f.hidden=!0;const n=t.currentNode,i=(e=>{const t=document.createElement("div");return t.innerText=e,t.style.cssText="position:absolute;bottom:20px;left:50%;transform:translateX(-50%);",t})(T[o].clickTips);t.container.appendChild(i),t.map.addEventListener("click",(e=>{e.preventDefault(),i.remove(),"T"!==e.target.parentElement.nodeName&&"ROOT"!==e.target.parentElement.nodeName||t.createLink(n,t.currentNode)}),{once:!0})}}var G=n(301),X={};X.styleTagTransform=F(),X.setAttributes=B(),X.insert=H().bind(null,"head"),X.domAPI=P(),X.insertStyleElement=Z();I()(G.Z,X);G.Z&&G.Z.locals&&G.Z.locals;const _=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=``,n};function J(e){e.container.append(function(e){const t=document.createElement("toolbar"),n=_("fullscreen","full"),i=_("toCenter","living"),o=_("zoomout","move"),a=_("zoomin","add");return document.createElement("span").innerText="100%",t.appendChild(n),t.appendChild(i),t.appendChild(o),t.appendChild(a),t.className="rb",n.onclick=()=>{e.container.requestFullscreen()},i.onclick=()=>{e.toCenter()},o.onclick=()=>{e.scaleVal<.6||e.scale(e.scaleVal-=.2)},a.onclick=()=>{e.scaleVal>1.6||e.scale(e.scaleVal+=.2)},t}(e)),e.container.append(function(e){const t=document.createElement("toolbar"),n=_("tbltl","left"),i=_("tbltr","right"),o=_("tblts","side");return t.appendChild(n),t.appendChild(i),t.appendChild(o),t.className="lt",n.onclick=()=>{e.initLeft()},i.onclick=()=>{e.initRight()},o.onclick=()=>{e.initSide()},t}(e))}var Q=n(519),K={};K.styleTagTransform=F(),K.setAttributes=B(),K.insert=H().bind(null,"head"),K.domAPI=P(),K.insertStyleElement=Z();I()(Q.Z,K);Q.Z&&Q.Z.locals&&Q.Z.locals;const ee=(e,t)=>{const n=document.createElement("div");return n.id=e,n.innerHTML=t,n},te=["#2c3e50","#34495e","#7f8c8d","#94a5a6","#bdc3c7","#ecf0f1","#8e44ad","#9b59b6","#2980b9","#3298db","#c0392c","#e74c3c","#d35400","#f39c11","#f1c40e","#17a085","#27ae61","#2ecc71"];var ne=function(e,t,n,i){return new(n||(n=Promise))((function(o,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function r(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,r)}l((i=i.apply(e,t||[])).next())}))};const ie=document,oe=function(e){if(!e)return;const t=e.getElementsByClassName("insert-preview");for(const e of t||[])e.remove()},ae=function(e,t){const n=t.parentNode.parentNode.contains(e);return e&&"TPC"===e.tagName&&e!==t&&!n&&!0!==e.nodeObj.root};function se(e){let t,n,i;e.map.addEventListener("dragstart",(function(e){t=e.target,t.parentNode.parentNode.style.opacity="0.5",u.clear()})),e.map.addEventListener("dragend",(function(o){return ne(this,void 0,void 0,(function*(){o.target.style.opacity="",oe(i);const a=t.nodeObj;switch(n){case"before":e.moveNodeBefore(t,i),e.selectNode(g(a.id));break;case"after":e.moveNodeAfter(t,i),e.selectNode(g(a.id));break;case"in":e.moveNode(t,i)}t.parentNode.parentNode.style.opacity="1",t=null}))})),e.map.addEventListener("dragover",r((function(e){oe(i);const o=ie.elementFromPoint(e.clientX,e.clientY-12);if(ae(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=ie.elementFromPoint(e.clientX,e.clientY+12);if(ae(o,t)){i=o;const t=o.getBoundingClientRect().y;e.clientY0)n[0].className=i;else{const t=ie.createElement("div");t.className=i,e.appendChild(t)}}(i,n)}),200))}var re=n(787),le={};le.styleTagTransform=F(),le.setAttributes=B(),le.insert=H().bind(null,"head"),le.domAPI=P(),le.insertStyleElement=Z();I()(re.Z,le);re.Z&&re.Z.locals&&re.Z.locals;function ce(){this.handlers={}}ce.prototype={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)for(var n=this.handlers[e],i=0;i{this.isUndo?this.isUndo=!1:["moveNode","removeNode","addChild","finishEdit","editStyle","editTags","editIcons"].includes(e.name)&&this.history.push(e)})),this.history=[],this.isUndo=!1,this.undo=function(){const e=this.history.pop();e&&(this.isUndo=!0,"moveNode"===e.name?this.moveNode(ue(e.obj.fromObj.id),ue(e.obj.originParentId)):"removeNode"===e.name?e.originSiblingId?this.insertBefore(ue(e.originSiblingId),e.obj):this.addChild(ue(e.originParentId),e.obj):"addChild"===e.name||"copyNode"===e.name?this.removeNode(ue(e.obj.id)):"finishEdit"===e.name?this.setNodeTopic(ue(e.obj.id),e.origin):this.isUndo=!1)},this.mindElixirBox.className+=" mind-elixir",this.mindElixirBox.innerHTML="",this.container=me.createElement("div"),this.container.className="map-container",this.map=me.createElement("div"),this.map.className="map-canvas",this.map.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.mindElixirBox.appendChild(this.container),this.root=me.createElement("root"),this.box=me.createElement("children"),this.box.className="box",this.lines=v("lines"),this.linkController=v("linkcontroller"),this.P2=me.createElement("div"),this.P3=me.createElement("div"),this.P2.className=this.P3.className="circle",this.line1=M(0,0,0,0),this.line2=M(0,0,0,0),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=v("topiclinks"),this.map.appendChild(this.root),this.map.appendChild(this.box),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=>{"EPD"===e.target.nodeName?k.expandNode(e.target.previousSibling):"T"===e.target.parentElement.nodeName||"ROOT"===e.target.parentElement.nodeName?k.selectNode(e.target,!1,e):"path"===e.target.nodeName?"g"===e.target.parentElement.nodeName&&k.selectLink(e.target.parentElement):"circle"===e.target.className||(k.unselectNode(),k.hideLinkController&&k.hideLinkController())})),k.map.addEventListener("dblclick",(e=>{e.preventDefault(),k.editable&&("T"!==e.target.parentElement.nodeName&&"ROOT"!==e.target.parentElement.nodeName||k.beginEdit(e.target))})),k.map.addEventListener("mousemove",(e=>{"true"!==e.target.contentEditable&&u.onMove(e,k.container)})),k.map.addEventListener("mousedown",(e=>{"true"!==e.target.contentEditable&&(u.afterMoving=!1,u.mousedown=!0)})),k.map.addEventListener("mouseleave",(e=>{u.clear()})),k.map.addEventListener("mouseup",(e=>{u.clear()})))}function ge(e,t){return function(...n){return pe(this,void 0,void 0,(function*(){this.before[t]&&!(yield this.before[t].apply(this,n))||e.apply(this,n)}))}}fe.prototype={addParentLink:a,getObjById:o,generateNewObj:function(){const e=h();return{topic:this.newTopicName||"new node",id:e}},insertSibling:ge((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 n=e.parent.children,i=n.indexOf(e);n.splice(i+1,0,t)}(i,o),a(this.nodeData);const s=n.parentElement,{grp:r,top:l}=this.createGroup(o),c=s.parentNode.parentNode;c.insertBefore(r,s.parentNode.nextSibling),"box"===c.className?(this.judgeDirection(r,o),this.linkDiv()):this.linkDiv(r.offsetParent),t||this.createInputDiv(l.children[0]),this.selectNode(l.children[0],!0),this.bus.fire("operation",{name:"insertSibling",obj:o})}),"insertSibling"),insertBefore:ge((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 n=e.parent.children,i=n.indexOf(e);n.splice(i,0,t)}(i,o),a(this.nodeData);const s=n.parentElement,{grp:r,top:l}=this.createGroup(o),c=s.parentNode.parentNode;c.insertBefore(r,s.parentNode),"box"===c.className?(this.judgeDirection(r,o),this.linkDiv()):this.linkDiv(r.offsetParent),t||this.createInputDiv(l.children[0]),this.selectNode(l.children[0],!0),this.bus.fire("operation",{name:"insertSibling",obj:o})}),"insertBefore"),insertParent:ge((function(e,t){const n=e||this.currentNode;if(!n)return;const i=n.nodeObj;if(!0===i.root)return;const o=t||this.generateNewObj();!function(e,t){const n=e.parent.children,i=n.indexOf(e);n[i]=t,t.children=[e]}(i,o),a(this.nodeData);const s=n.parentElement.parentElement,{grp:r,top:l}=this.createGroup(o,!0);l.appendChild(y(!0));const c=s.parentNode;s.insertAdjacentElement("afterend",r);const d=z.createElement("children");d.appendChild(s),l.insertAdjacentElement("afterend",d),"box"===c.className?(r.className=s.className,s.className="",s.querySelector(".subLines").remove(),this.linkDiv()):this.linkDiv(r.offsetParent),t||this.createInputDiv(l.children[0]),this.selectNode(l.children[0],!0),this.bus.fire("operation",{name:"insertParent",obj:o})}),"insertParent"),addChild:ge((function(e,t){const n=e||this.currentNode;if(!n)return;const{newTop:i,newNodeObj:o}=w.call(this,n,t);this.bus.fire("operation",{name:"addChild",obj:o}),t||this.createInputDiv(i.children[0]),this.selectNode(i.children[0],!0)}),"addChild"),copyNode:ge((function(e,t){const n=JSON.parse(JSON.stringify(e.nodeObj,((e,t)=>{if("parent"!==e)return t})));s(n);const{newNodeObj:i}=w.call(this,t,n);this.bus.fire("operation",{name:"copyNode",obj:i})}),"copyNode"),moveNode:ge((function(e,t){const n=e.nodeObj,i=t.nodeObj,o=n.parent.id;if(!1===i.expanded&&(this.expandNode(t,!0),e=g(n.id),t=g(i.id)),!function(e,t){let n=!0;for(;t.parent;){if(t.parent===e){n=!1;break}t=t.parent}return n}(n,i))return;!function(e,t){p(e),t.children?t.children.push(e):t.children=[e]}(n,i),a(this.nodeData);const s=e.parentElement,r=s.parentNode.parentNode,l=t.parentElement;if("box"===r.className?s.parentNode.lastChild.remove():"box"===s.parentNode.className&&(s.style.cssText=""),"T"===l.tagName)if("box"===r.className&&(s.parentNode.className=""),l.children[1])l.nextSibling.appendChild(s.parentNode);else{const e=z.createElement("children");e.appendChild(s.parentNode),l.appendChild(y(!0)),l.parentElement.insertBefore(e,l.nextSibling)}else"ROOT"===l.tagName&&(this.judgeDirection(s.parentNode,n),l.nextSibling.appendChild(s.parentNode));this.linkDiv(),this.bus.fire("operation",{name:"moveNode",obj:{fromObj:n,toObj:i,originParentId:o}})}),"moveNode"),removeNode:ge((function(e){const t=e||this.currentNode;if(!t)return;const n=t.nodeObj;if(!0===n.root)throw new Error("Can not remove root node");const i=n.parent.children.findIndex((e=>e===n)),o=n.parent.children[i+1],a=o&&o.id,s=p(n),r=t.parentNode;if("ROOT"!==r.tagName){if(0===s){const e=r.parentNode.parentNode.previousSibling;"ROOT"!==e.tagName&&e.children[1].remove(),this.selectParent()}else{this.selectPrevSibling()||this.selectNextSibling()}for(const e in this.linkData){const t=this.linkData[e];t.from!==r.firstChild&&t.to!==r.firstChild||this.removeLink(this.mindElixirBox.querySelector(`[data-linkid=${this.linkData[e].id}]`))}r.parentNode.remove(),this.linkDiv(),this.bus.fire("operation",{name:"removeNode",obj:n,originSiblingId:a,originParentId:n.parent.id})}}),"removeNode"),moveUpNode:ge((function(e){const t=e||this.currentNode;if(!t)return;const n=t.parentNode.parentNode,i=t.nodeObj;!function(e){const t=e.parent.children,n=t.indexOf(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:ge((function(e){const t=e||this.currentNode;if(!t)return;const n=t.parentNode.parentNode,i=t.nodeObj;!function(e){const t=e.parent.children,n=t.indexOf(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.insertAdjacentElement("afterend",n.nextSibling):n.parentNode.prepend(n),this.linkDiv(),this.bus.fire("operation",{name:"moveDownNode",obj:i})}),"moveDownNode"),beginEdit:ge((function(e){const t=e||this.currentNode;t&&this.createInputDiv(t)}),"beginEdit"),moveNodeBefore:ge((function(e,t){const n=e.nodeObj,i=t.nodeObj,o=n.parent.id;!function(e,t){p(e);const n=t.parent.children;let i=0;for(let e=0;e{e-=s/this.scaleVal,t-=r/this.scaleVal;const l=c(a,e,t);h=l.x,p=l.y,this.P2.style.top=t+"px",this.P2.style.left=e+"px",this.currentLink.children[0].setAttribute("d",`M ${h} ${p} C ${e} ${t} ${n} ${i} ${f} ${g}`),this.line1.setAttribute("x1",h),this.line1.setAttribute("y1",p),this.line1.setAttribute("x2",e),this.line1.setAttribute("y2",t),o.delta1.x=e-a.cx,o.delta1.y=t-a.cy})),this.helper2.init(this.map,((a,r)=>{n-=a/this.scaleVal,i-=r/this.scaleVal;const c=d(s,n,i);f=c.x,g=c.y;const u=l(n,i,f,g);this.P3.style.top=i+"px",this.P3.style.left=n+"px",this.currentLink.children[0].setAttribute("d",`M ${h} ${p} C ${e} ${t} ${n} ${i} ${f} ${g}`),this.currentLink.children[1].setAttribute("d",`M ${u.x1} ${u.y1} L ${f} ${g} L ${u.x2} ${u.y2}`),this.line2.setAttribute("x1",n),this.line2.setAttribute("y1",i),this.line2.setAttribute("x2",f),this.line2.setAttribute("y2",g),o.delta2.x=n-s.cx,o.delta2.y=i-s.cy}))},layout:function(){this.root.innerHTML="",this.box.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=>{void 0===t.direction?e<=n?(t.direction=0,e+=1):(t.direction=1,n+=1):0===t.direction?e+=1:n+=1}))}this.createChildren(this.nodeData.children,this.box,this.direction)}},linkDiv:function(e){var t=this.primaryNodeHorizontalGap||65,n=this.primaryNodeVerticalGap||25;const i=this.root;i.style.cssText=`top:${1e4-i.offsetHeight/2}px;left:${1e4-i.offsetWidth/2}px;`;const o=this.box.children;this.lines.innerHTML="";let a,s,r=0,l=0,c=0,d=0,h=0,p=0;if(2===this.direction){let e=0,t=0,i=0,r=0;for(let a=0;ap?(s=1e4-Math.max(h)/2,a="r",l=(h-r)/(t-1)):(s=1e4-Math.max(p)/2,a="l",l=(p-i)/(e-1))}else{for(let e=0;e{e.stopPropagation();const t=e.key;if("Enter"===t||"Tab"===t){if(e.shiftKey)return;e.preventDefault(),this.inputDiv.blur(),this.map.focus()}})),t.addEventListener("blur",(()=>{if(!t)return;const i=e.nodeObj,o=t.textContent.trim();i.topic=""===o?n:o,t.remove(),this.inputDiv=t=null,o!==n&&(e.childNodes[0].textContent=i.topic,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:i,origin:n}))}))},createChildren:function(e,t,n){let i;i=t||f.createElement("children");for(let t=0;t0){if(s.appendChild(y(o.expanded)),a.appendChild(s),!1!==o.expanded){const e=this.createChildren(o.children);a.appendChild(e)}}else a.appendChild(s);i.appendChild(a)}return i},createGroup:function(e,t){const n=f.createElement("GRP"),i=this.createTop(e);if(n.appendChild(i),!t&&e.children&&e.children.length>0&&(i.appendChild(y(e.expanded)),!1!==e.expanded)){const t=this.createChildren(e.children);n.appendChild(t)}return{grp:n,top:i}},createTop:function(e){const t=f.createElement("t"),n=this.createTopic(e);return b(n,e),t.appendChild(n),t},createTopic:function(e){const t=f.createElement("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)return this.selectNode(g(e));this.currentNode&&(this.currentNode.className=""),e.className="selected",this.currentNode=e,t?this.bus.fire("selectNewNode",e.nodeObj,n):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;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=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)}},getAllDataString:function(){const e={nodeData:C(this),linkData:this.linkData,direction:this.direction};return JSON.stringify(e,((e,t)=>{if("parent"!==e)return"from"===e||"to"===e?t.nodeObj.id:t}))},getAllData:function(){const e={nodeData:C(this),linkData:this.linkData,direction:this.direction};return JSON.parse(JSON.stringify(e,((e,t)=>{if("parent"!==e)return"from"===e||"to"===e?t.nodeObj.id:t})))},getAllDataMd:function(){const e=C(this);let t="# "+e.topic+"\n\n";return function e(n,i){for(let o=0;o\n ${["15","24","32"].map((e=>`
\n
`)).join("")}
\n \n
\n ${te.map((e=>`
`)).join("")}\n
\n
\n ${T[n].font}\n ${T[n].background}\n
`),o=ee("nm-tag",`${T[n].tag}`),a=ee("nm-icon",`${T[n].icon}`),s=ee("nm-url",`${T[n].url}`),r=ee("nm-memo",`${T[n].memo||"Memo"}