UNPKG

mind.svg.js

Version:

Display and operate MindMap using SVG in browser

20 lines 63.2 kB
/**
 * mind.svg.js
 * @summary     Display and operate MindMap using SVG in browser
 * @version     0.6.8
 * @copyright   season studio
 * @license     MIT
 * @time        Tue Jul 07 2020 17:07:29 GMT+0800 (GMT+08:00)
 */

/**
 * mind.svg.js
 * @summary     Display and operate MindMap using SVG in browser
 * @version     0.6.8
 * @copyright   season studio
 * @license     MIT
 * @time        Tue Jul 07 2020 17:07:29 GMT+0800 (GMT+08:00)
 */
var t=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n,r){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),a=new b(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return w()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=k(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var f=s(t,e,n);if("normal"===f.type){if(r=n.done?"completed":"suspendedYield",f.arg===l)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(r="completed",n.method="throw",n.arg=f.arg)}}}(t,n,a),o}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function u(){}function h(){}var d={};d[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&n.call(y,i)&&(d=y);var p=h.prototype=f.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,c){var l=s(t[i],t,o);if("throw"!==l.type){var f=l.arg,u=f.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(u).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function k(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function b(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:w}}function w(){return{value:void 0,done:!0}}return u.prototype=p.constructor=h,h.constructor=u,h[a]=u.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===u||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(p),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[o]=function(){return this},t.AsyncIterator=m,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new m(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(p),p[a]="Generator",p[i]=function(){return this},p.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return c=t.done,t},e:function(t){s=!0,a=t},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var a={SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};function c(t){return"data-".concat(t)}function s(t){return t instanceof window.Node||t instanceof window.HTMLElement}function l(t){return Number(("string"==typeof t?t:String(t)).replace(/\D+/,""))}var f=function(){function n(t,r){e(this,n);var i=this.node=s(t)?t:r?document.createElementNS(r,t):document.createElement(t);this.matches=(i.matches||i.matchesSelector||i.msMatchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector).bind(i),this.dispatchEvent=i.dispatchEvent.bind(i)}return r(n,[{key:"getRelativeRect",value:function(t){var e=this.globalRect,r=n.attach(t);if(r)if(r.isSVG){var i=r.node.getScreenCTM().inverse().translate(e.x,e.y);if(e.x=i.e,e.y=i.f,this.isSVG){var o=this.rect;e.width=o.width,e.height=o.height}}else{var a=r.globalRect;e.x-=a.x-r.node.clientLeft,e.y-=a.y-r.node.clientTop}return e}},{key:"setSizeInStyle",value:function(t,e){var n=window.getComputedStyle?window.getComputedStyle(this.node):void 0;n&&(t-=l(n.paddingLeft)+l(n.paddingRight)+l(n.borderLeftWidth)+l(n.borderRightWidth),e-=l(n.paddingTop)+l(n.paddingBottom)+l(n.borderTopWidth)+l(n.borderBottomWidth)),this.node.style.width="".concat(t,"px"),this.node.style.height="".concat(e,"px")}},{key:"translatePoint",value:function(t,e){if(this.isSVG){var n=this.node.getScreenCTM().inverse().translate(t,e);return{x:n.e,y:n.f}}var r=this.globalRect;return{x:t-r.x,y:e-r.y}}},{key:"attr",value:function(t,e){var n=this.node;if("string"==typeof t){if(void 0===e)return n.getAttribute(t);null===e?n.removeAttribute(t):n.setAttribute(t,e)}else{if(t instanceof Array){var r,o={},a=i(t);try{for(a.s();!(r=a.n()).done;){var c=r.value;o[c]=n.getAttribute(c)}}catch(t){a.e(t)}finally{a.f()}return o}for(var s in t){var l=t[s];null===l?n.removeAttribute(s):n.setAttribute(s,l)}}return this}},{key:"style",value:function(t,e){var n=this.node.style;if("string"==typeof t){if(void 0===e)return n[t];n[t]=e}else{if(t instanceof Array){var r,o={},a=i(t);try{for(a.s();!(r=a.n()).done;){var c=r.value;o[c]=n[c]}}catch(t){a.e(t)}finally{a.f()}return o}for(var s in t){var l=t[s];n[s]=l}}return this}},{key:"data",value:function(t,e){var n=this.node;if("string"==typeof t){if(void 0===e)return JSON.parse(n.getAttribute(c(t)));null===e?n.removeAttribute(c(t)):n.setAttribute(c(t),JSON.stringify(e))}else{if(t instanceof Array){var r,o={},a=i(t);try{for(a.s();!(r=a.n()).done;){var s=r.value;o[s]=JSON.parse(n.getAttribute(c(s)))}}catch(t){a.e(t)}finally{a.f()}return o}for(var l in t){var f=t[l];null===f?n.removeAttribute(c(l)):n.setAttribute(c(l),JSON.stringify(f))}}return this}},{key:"hasClass",value:function(t){return this.matches(".".concat(t))}},{key:"addClass",value:function(t){var e=this.node.classList;if(e)e.add(t);else{var n=this.attr("class");(e=n?n.split(/\s+/):[]).indexOf(t)<0&&this.attr("class","".concat(n," ").concat(t))}return this}},{key:"removeClass",value:function(t){var e=this.node.classList;if(e)e.remove(t);else{var n=this.attr("class"),r=(e=n?n.split(/\s+/):[]).indexOf(t);r>=0&&(e[r]="",this.attr("class",e.join(" ")))}return this}},{key:"parent",value:function(t){for(var e,r=this.node;(r=r.parentElement)&&(e=n.attach(r),t)&&!e.matches(t););return e}},{key:"firstDescendant",value:function(t){t=t||"*";var e=this.node.querySelector(t);return e?n.attach(e):void 0}},{key:"descendant",value:function(t){t=t||"*";var e,r=[],o=i(this.node.querySelectorAll(t));try{for(o.s();!(e=o.n()).done;){var a=e.value,c=n.attach(a);c.matches(t)&&r.push(c)}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"getDescandant",value:t.mark((function e(r){var o,a,c,s,l;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=r||"*",o=this.node.querySelectorAll(r),a=i(o),t.prev=3,a.s();case 5:if((c=a.n()).done){t.next=13;break}if(s=c.value,!(l=n.attach(s)).matches(r)){t.next=11;break}return t.next=11,l;case 11:t.next=5;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(3),a.e(t.t0);case 18:return t.prev=18,a.f(),t.finish(18);case 21:case"end":return t.stop()}}),e,this,[[3,15,18,21]])}))},{key:"firstChild",value:function(t){if(t){var e,r,o=i(this.node.children);try{for(o.s();!(r=o.n()).done;){var a=r.value,c=n.attach(a);if(c.matches(t)){e=c;break}}}catch(t){o.e(t)}finally{o.f()}return e}return n.attach(this.node.firstElementChild)}},{key:"children",value:function(t){var e,r=[],o=i(this.node.children);try{for(o.s();!(e=o.n()).done;){var a=e.value,c=n.attach(a);t&&!c.matches(t)||r.push(c)}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"getChildren",value:t.mark((function e(r){var o,a,c,s,l;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=this.node.children,a=i(o),t.prev=2,a.s();case 4:if((c=a.n()).done){t.next=12;break}if(s=c.value,l=n.attach(s),r&&!l.matches(r)){t.next=10;break}return t.next=10,l;case 10:t.next=4;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(2),a.e(t.t0);case 17:return t.prev=17,a.f(),t.finish(17);case 20:case"end":return t.stop()}}),e,this,[[2,14,17,20]])}))},{key:"appendTo",value:function(t){var e=s(t)?t:d(t)?t.node:null;return e&&(this.node.remove(),e.appendChild(this.node)),this}},{key:"insertToTop",value:function(t){var e=s(t)?t:d(t)?t.node:null;return e&&(this.node.remove(),e.insertBefore(this.node,e.firstElementChild)),this}},{key:"insertAfter",value:function(t){var e=n.attach(t);if(e){var r=e.parent();if(r){this.node.remove();var i=e.node.nextSibling;i?r.node.insertBefore(this.node,i):r.node.appendChild(this.node)}}return this}},{key:"insertBefore",value:function(t){var e=n.attach(t);if(e){var r=e.parent();r&&(this.node.remove(),r.node.insertBefore(this.node,e.node))}return this}},{key:"remove",value:function(){return this.node.remove(),this}},{key:"convertPoint",value:function(t,e){var n=t&&t.x||0,r=t&&t.y||0;return e?(n+=this.node.offsetLeft,r+=this.node.offsetTop):(n-=this.node.offsetLeft,r-=this.node.offsetTop),{x:n,y:r}}},{key:"on",value:function(t,e,n){return this.node.addEventListener(t,e,n),this}},{key:"off",value:function(t,e,n){return this.node.removeEventListener(t,e,n),this}},{key:"isSame",value:function(t){return this.node.isSameNode(d(t)?t.node:t)}},{key:"createChild",value:function(t,e){var r=new n(t,e);return r&&r.appendTo(this),r}},{key:"createSVGChild",value:function(t){return this.isSVG?this.createChild(t,a.SVG):h().appendTo(this)}},{key:"clearChildren",value:function(){return this.node.innerHTML="",this}},{key:"id",get:function(){return this.node.getAttribute("id")||""},set:function(t){this.node.setAttribute("id",t)}},{key:"tagName",get:function(){return this.node.tagName.toLowerCase()}},{key:"class",get:function(){return this.node.getAttribute("class")||""},set:function(t){this.node.setAttribute("class",t)}},{key:"isSVG",get:function(){return this.node instanceof SVGElement}},{key:"text",get:function(){return this.node.textContent||""},set:function(t){this.isSVG?(this.node.innerHTML="",this.node.appendChild(document.createTextNode(t))):this.node.innerText=t}},{key:"top",get:function(){return this.isSVG?this.node.getBBox().y:this.node.offsetTop}},{key:"left",get:function(){return this.isSVG?this.node.getBBox().x:this.node.offsetLeft}},{key:"width",get:function(){return this.isSVG?this.node.getBBox().width:this.node.offsetWidth}},{key:"height",get:function(){return this.isSVG?this.node.getBBox().height:this.node.offsetHeight}},{key:"rect",get:function(){var t=this.node;return this.isSVG?t.getBBox():{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}},{key:"clientRect",get:function(){var t=this.node;return this.isSVG?t.getBBox():{x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}},{key:"globalRect",get:function(){return this.node.getBoundingClientRect()}},{key:"offsetRect",get:function(){var t=this.node;return this.isSVG?t.getBoundingClientRect():{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}},{key:"classList",get:function(){var t=this.attr("class");return t?t.split(/\s+/):[]}},{key:"root",get:function(){return this.isSVG?n.attach(this.node.ownerSVGElement||this.parent("body")):this.parent("body")}}],[{key:"attach",value:function(t){return s(t)?new n(t):d(t)?t:t?n.attach(document.querySelector(t)):void 0}}]),n}();function u(t,e){return arguments.length<=0?f:new f(t,e)}function h(){return new f("svg",a.SVG).attr({xmlns:a.SVG,"xmlns:xlink":a.XLINK,version:"1.1"})}function d(t){return t instanceof f}var v={};function y(t,e){if(e&&t in v){var n=v[t];"function"==typeof e&&(e=e(n));var r={};for(var i in e){var o=e[i];r[i]=n[i],n[i]=o}return r}}function p(t,e,n){if(e&&t in v){var r=v[t],i=r.prototype;"function"==typeof e&&(e=e(r,i));var o={};for(var a in e){var c=e[a],s=o[a]=i[a];s&&!n?s instanceof Array?s.unshift(c):i[a]=[c,s]:i[a]=c}return o}}function g(t,e){if("string"==typeof t)v[t]=e;else if(t)for(var n in t){var r=t[n];v[n]=r}}var m=Object.freeze({__proto__:null,extend:y,extendPrototype:function(t,e){if(t in v){var n=v[t],r=n.prototype;"function"==typeof e&&(e=e(n,r));var i={};for(var o in e){var a=e[o];i[o]=r[o],r[o]=a}return i}},extendEventHandler:p,registryClass:g});function k(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return T(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var b=Symbol("MindSVG.Event.Dispatcher"),S=Symbol("MindSVG.Event.BlockSibling.Private");function w(t,e){return e?"".concat("_$!").concat(t,"|").concat(e):"".concat("_$!").concat(t,"|")}function x(t,e,n){var r=Object.getOwnPropertyNames(t.prototype);if(n)return r.indexOf(w(e,n));var i,o=E(r);try{for(o.s();!(i=o.n()).done;){if(i.value.startsWith("".concat("_$!").concat(e,"|")))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function A(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&t.preventDefault(),t.stopPropagation()}function _(t){Object.isExtensible(t)&&(t[S]=void 0)}function N(t,e,n){var r=n[0];if(!t.length){var i=void 0;for(var o in t)if(t[o]&&(n[3]=i,i=t[o].apply(this,n),r[S]))break;return i}_(r)}function I(t){var e=t.target;if(e){var n=void 0,r=e.getAttribute("mind-event-stamp");if(r){var i=this[w(t.type,r)];i&&(Object.isExtensible(t)&&(t[S]=!0),n=i instanceof Array?N(i,0,[t,r,e,n]):i.call(this,t,r,e))}if(!t[S]){var o=this[w(t.type)];o&&(Object.isExtensible(t)&&(t[S]=!0),o instanceof Array?N(o,0,[t,r,e,n]):o.call(this,t,r,e,n))}}}function C(t,e,n){if(t&&e){var r,i=n||function(t){var e,n=[],r=E(Object.getOwnPropertyNames(t.prototype));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.startsWith("_$!")){var o=i.substr("_$!".length).split("|")[0];o.length>0&&n.indexOf(o)<0&&n.push(o)}}}catch(t){r.e(t)}finally{r.f()}return n}(e.constructor),o=e[b]||(e[b]=I.bind(e)),a=(t.on||t.addEventListener).bind(t),c=E(i);try{for(c.s();!(r=c.n()).done;){a(r.value,o)}}catch(t){c.e(t)}finally{c.f()}}}function L(t,e,n){if(d(this)){var r=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:e,result:n}});return this.node.dispatchEvent(r),r.detail.result}}var M={ATTR_EVENT_STAMP:"mind-event-stamp",EVENT_FOCUS_CHANGE:"mindevent.focus.change",EVENT_REQUIRE_LAYOUT:"mindevent.require.layout",EVENT_QUERY_ATTACHMENT:"mindevent.query.attachment",EVENT_CONFIRM_DRAG:"mindevent.confirm.drag",EVENT_END_DRAG:"mindevent.end.drag",EVENT_INVOKE_IMAGE:"mindevent.invoke.image",EVENT_INVOKE_LABELS:"mindevent.invoke.labels",EVENT_INVOKE_LINK:"mindevent.invoke.link",EVENT_INVOKE_NOTES:"mindevent.invoke.notes",EVENT_INVOKE_MARKERS:"mindevent.invoke.markers"},V=Object.freeze({__proto__:null,namedHandler:w,hasEventHandler:x,handledEvent:A,fromMindSVG:function(t,e){var n=u().attach(t.target);return n&&(n.isSVG||n.isSame(e.container))},continueSiblingHandler:_,mapEventHandler:C,fireEvent:L,eventStamp:function(t){return t&&t.target?t.target.getAttribute("mind-event-stamp"):void 0},Constants:M});function O(){}var D,R,G,P,j,U,Y,H,B,F,X,W,K,Q,$,Z,z,q,J,tt,et,nt,rt={INVALID_PARAM:function(t){return new Error('The parameter "'.concat(t,'" is invalid!'))},ILLEGAL_INSTANCE:function(t,e){return new Error(e?'"'.concat(t,'" is a illegal instance'):'"'.concat(t,'" is a illegal instance of (').concat(e,")"))}};function it(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ot(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ot(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var at=Symbol("MindSVG.Private"),ct="mind-main-basic",st="mind-main-container",lt="mind-svg",ft="mind-topic-group-basic",ut="mind-topic-item-group-basic",ht="mind-topic-focus",dt="mind-text-basic",vt="mind-text",yt="mind-topic",pt="mind-topic-level",gt="mind-topic-children-group-basic",mt="mind-line",kt="mind-topic-fold-icon",Et="mind-topic-labels",Tt="mind-topic-label-background",bt="mind-topic-link",St="mind-topic-notes",wt="mind-topic-markers",xt={paddingX:10,paddingY:10,topicMarginX:46,topicMarginY:17,contentMarginX:6,contentMarginY:6,rectRadius:6,lineBezierCtrlSize:17,subPaddingX:6,subPaddingY:6,maxLabelsPreview:3};function At(t){return"".concat("_data$").concat(t)}function _t(t){return t.startsWith("_data$")?t.substr("_data$".length):void 0}function Nt(t,e){return void 0===e?t[at]:t[at][e]}var It=function(){function t(n){if(e(this,t),!d(n))throw rt.INVALID_PARAM("_svg");if(this.defs=n.createSVGChild("defs")){var r=Object.getOwnPropertyNames(t);for(var i in r){var o=r[i],a=t[o];if("function"==typeof a){var c=a(this);d(c)&&c.attr("id",o)}}}}return r(t,[{key:"createChild",value:function(t){return this.defs.createSVGChild(t)}}]),t}();D=At("customData"),R=At("customData"),G=At("title"),P=At("title"),j=At("image"),U=At("image"),Y=At("labels"),H=At("labels"),B=At("href"),F=At("href"),X=At("notes"),W=At("notes"),K=At("markers"),Q=At("markers");var Ct=function(){function n(t,r,i){if(e(this,n),d(t)){if("g"!==t.tagName||!t.hasClass(ut))throw rt.ILLEGAL_INSTANCE("_data","<g> with item group class");var o=this.content=t;this.fireEvent=L.bind(o),this.titleRect=o.firstDescendant(n.titleSelector),this.titleText=o.firstDescendant("text.".concat(vt)),this.foldIcon=o.firstDescendant("use.".concat(kt))}else{if(!d(i))throw rt.INVALID_PARAM(i);var a=i.attr("id");t=t||{};var c=this.content=i.createSVGChild("g");c.attr({id:a,class:"".concat(ut," ").concat(pt).concat(r)}),this.fireEvent=L.bind(c);var s=this.titleRect=c.createSVGChild("rect"),l=this.titleText=c.createSVGChild("text");l.text=t.title,l.attr(k({id:a,class:"".concat(dt," ").concat(vt)},M.ATTR_EVENT_STAMP,"topic-item-title")),s.attr(k({id:a,class:yt},M.ATTR_EVENT_STAMP,"topic-item-title"));var f,u=it(n.propertyNames());try{for(u.s();!(f=u.n()).done;){var h=f.value;"title"!==h.name&&h.name in t&&(this[h.fullName]=t[h.name])}}catch(t){u.e(t)}finally{u.f()}r>0&&(this.foldIcon=c.createSVGChild("use")).attr(k({id:a,href:"#".concat("icon-minus"),style:"display: none;",class:kt},M.ATTR_EVENT_STAMP,"topic-item-fold-icon"))}}return r(n,[{key:"propertys",value:t.mark((function e(){var r,i,o,a,c;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=Object.getOwnPropertyNames(n.prototype),i=it(r),t.prev=2,i.s();case 4:if((o=i.n()).done){t.next=12;break}if(a=o.value,!(c=_t(a))){t.next=10;break}return t.next=10,{name:c,fullName:a,value:this[a]};case 10:t.next=4;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(2),i.e(t.t0);case 17:return t.prev=17,i.f(),t.finish(17);case 20:case"end":return t.stop()}}),e,this,[[2,14,17,20]])}))},{key:"level",value:function(t){var e=this.content;if(e){var n=e.classList,r=-1;for(var i in n)if(n[i].startsWith(pt)){r=i;break}if(void 0===t)return r>=0?parseInt(n[r].substr(pt.length)):0;r>=0&&(n[r]=""),n.push("".concat(pt).concat(t)),e.attr("class",n.join(" "))}}},{key:"globalZone",value:function(t){var e=n["".concat(t,"Selector")];if(e){var r=this.content.firstDescendant(e);return r?r.globalRect:void 0}}},{key:"relativeZone",value:function(t,e){var r;if(t){var i=n["".concat(t,"Selector")];i&&(r=this.content.firstDescendant(i))}else r=this.content;if(r){var o=u().attach(e)||r.parent("div.".concat(st));return o?r.getRelativeRect(o):void 0}}},{key:"connectPointer",value:function(t){var e,n;if(this.titleRect){var r=this.titleRect.rect;n=r.height>>1,e=1==t?0:r.width}else e=0,n=0;return{x:e,y:n}}},{key:"fold",value:function(t){var e=this.foldIcon;e&&(null==t?(e.style("display","none"),e.attr({href:"#".concat("icon-minus")})):(e.attr({href:"#".concat(t?"icon-plus":"icon-minus")}),e.style("display","unset")))}},{key:"focus",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=void 0,r=this.content;if(r)if(t){if(!r.hasClass(ht)){var i=r.root;if(i){var o=i.firstDescendant(n.focusItemSelector);o&&o.removeClass(ht)}r.addClass(ht)}e=!0}else r.hasClass(ht)&&(r.removeClass(ht),e=!1);return e}},{key:"layout",value:function(t,e){if(!(t instanceof Mt))throw rt.INVALID_PARAM("_mindSVG");var r=this.titleText,i=this.titleRect;if(r&&i){var o=t.config(),a=o.paddingX,c=o.paddingY,s=o.rectRadius,l=o.maxLabelsPreview,f=o.subPaddingX,u=o.subPaddingY,h=r.rect,d=h.width,v=d+(a<<1),y=h.height+(c<<1),p=y+u,g=0,m=[],E=this.content.firstDescendant(n.labelsSelector),T=f;if(E){var b,S=0,w=0,x=it(E.getDescandant("text"));try{for(x.s();!(b=x.n()).done;){var A=b.value;A.attr({transform:"translate(".concat(T,", ").concat(u,")"),x:null,y:null,style:"display: ".concat(S>=l?"none":"unset")});var _=A.rect;0===S&&(w=_.height+u+u),++S<=l&&(T+=_.width+f)}}catch(t){x.e(t)}finally{x.f()}if(S>l){var N,I=E.firstDescendant("use")||E.createSVGChild("use");I.attr((k(N={href:"#".concat("icon-more")},M.ATTR_EVENT_STAMP,"topic-labels-more"),k(N,"transform","translate(".concat(T,", ").concat(u,")")),N)),T+=I.width+f}var C=E.firstDescendant("rect.".concat(Tt));C&&C.attr({x:null,y:null,width:T,height:w,rx:s,ry:s}),E.attr("transform","translate(0, ".concat(p,")")),g+=T}for(var L=0;L<2;L++){var V=this.content.firstDescendant(n.underLineSelectors[L]);if(V){var O=V.width;g+=O+f,m.push({obj:V,width:O})}}var D=this.content.firstDescendant(n.markersSelector);if(T=0,D){var R,G=it(D.getDescandant("use"));try{for(G.s();!(R=G.n()).done;){var P=R.value;0!==T&&(T+=f),P.attr("transform","translate(".concat(T,", 0)")),T+=P.width}}catch(t){G.e(t)}finally{G.f()}g+=T+f,m.push({obj:D,width:T})}m.length>0&&(g+=f),g>v&&(v=g);var j=this.content.firstDescendant(n.imageSelector);if(j){var U=j.rect,Y=U.width,H=U.height,B=0;Y>v?v=Y:B=(v-Y)/2,j.attr({transform:"translate(".concat(B,", -").concat(H+u,")"),x:null,y:null})}for(var F in T=v-f,m){var X=m[F],W=X.obj,K=X.width;W&&(T-=K,W.attr({transform:"translate(".concat(T,", ").concat(p,")"),x:null,y:null}),T-=f)}var Q=(v-d)/2;r.attr({transform:"translate(".concat(Q,", ").concat(c,")"),x:null,y:null}),i.attr({width:v,height:y,rx:s,ry:s,x:null,y:null});var $=this.foldIcon;$&&$.attr("transform","translate(".concat(1===e?0:v,", ").concat(y/2,")"))}}},{key:"size",get:function(){var t=this.content.rect;return{width:t.width,height:t.height}}},{key:"titleZone",get:function(){var t=this.titleRect;return t?t.getRelativeRect(t.root):{x:0,y:0,width:0,height:0}}},{key:D,get:function(){return this.content.data("customData")}},{key:R,set:function(t){this.content.data("customData",t)}},{key:G,get:function(){return this.titleText?this.titleText.text:""}},{key:P,set:function(t){this.titleText&&(this.titleText.text=t)}},{key:j,get:function(){var t=this.content.firstDescendant(n.imageSelector);if(t){var e={},r=t.data("extend");e.src=r||t.attr("href");var i=t.attr("width");i&&(e.width=JSON.parse(i));var o=t.attr("height");return o&&(e.height=JSON.parse(o)),e}}},{key:U,set:function(t){if(t&&t.src){var e=this.content.firstDescendant(n.imageSelector)||this.content.createSVGChild(n.imageSelector);if(e){var r=k({},M.ATTR_EVENT_STAMP,"topic-item-image");void 0!==t.width&&(r.width=t.width),void 0!==t.height&&(r.height=t.height);var i=String(t.src);i.startsWith("xap:")?(e.data("extend",i),i=this.fireEvent(M.EVENT_QUERY_ATTACHMENT,i.substr("xap:".length),"")):e.data("extend",null),(i=i.trim())?(r.href=i,e.attr(r)):e.remove()}}else{var o=this.content.firstDescendant(n.imageSelector);o&&o.remove()}}},{key:Y,get:function(){var t=this.content.firstDescendant(n.labelsSelector);if(t){var e,r=[],i=it(t.getDescandant("text"));try{for(i.s();!(e=i.n()).done;){var o=e.value;r.push(o.text)}}catch(t){i.e(t)}finally{i.f()}return r}}},{key:H,set:function(t){if(t instanceof Array&&t.length>0){var e=this.content.firstDescendant(n.labelsSelector)||this.content.createSVGChild("g");if(e){var r=k({class:Et},M.ATTR_EVENT_STAMP,"topic-labels");e.clearChildren(),e.attr(r);var i=e.createSVGChild("rect");r.class=Tt,i.attr(r),r.class="".concat(vt," ").concat(dt);var o,a=it(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,s=e.createSVGChild("text");s.attr(r),s.text=c}}catch(t){a.e(t)}finally{a.f()}}}else{var l=this.content.firstDescendant(n.labelsSelector);l&&l.remove()}}},{key:B,get:function(){var t=this.content.firstDescendant(n.linkSelector);if(t)return t.data("extend")}},{key:F,set:function(t){if(t&&(t=String(t).trim())){var e=this.content.firstDescendant(n.linkSelector)||this.content.createSVGChild("use");e.data("extend",t),e.attr(k({class:bt,href:"#".concat("icon-link")},M.ATTR_EVENT_STAMP,"topic-link"))}else{var r=this.content.firstDescendant(n.linkSelector);r&&r.remove()}}},{key:X,get:function(){var t=this.content.firstDescendant(n.notesSelector);if(t)return t.data("extend")}},{key:W,set:function(t){if(t){var e=this.content.firstDescendant(n.notesSelector)||this.content.createSVGChild("use");e.data("extend",t),e.attr(k({class:St,href:"#".concat("icon-notes")},M.ATTR_EVENT_STAMP,"topic-notes"))}else{var r=this.content.firstDescendant(n.notesSelector);r&&r.remove()}}},{key:K,get:function(){var t=this.content.firstDescendant(n.markersSelector);if(t){var e,r={},i=it(t.getDescandant("use"));try{for(i.s();!(e=i.n()).done;){var o=e.value.attr("href");if(o){var a=o.split(/[#-]/),c=a[1],s=a[2],l=It["".concat(c,"$translate")];"function"==typeof l&&(s=l(s)),r[c]=s}}}catch(t){i.e(t)}finally{i.f()}return r}}},{key:Q,set:function(t){if(t){var e=this.content.firstDescendant(n.markersSelector)||this.content.createSVGChild("g");if(e){e.attr(k({class:wt},M.ATTR_EVENT_STAMP,"topic-markers")),e.clearChildren();var r=0;for(var i in t){var o=t[i],a=It["".concat(i,"$translate")];"function"==typeof a&&(o=a(o,!0)),e.createSVGChild("use").attr(k({href:"#".concat(i,"-").concat(o)},M.ATTR_EVENT_STAMP,"topic-markers")),r++}r<=0&&e.remove()}}else{var c=this.content.firstDescendant(n.markersSelector);c&&c.remove()}}},{key:"isInFocus",get:function(){return this.content&&this.content.hasClass(ht)}}],[{key:"propertyName",value:function(t){var e=At(t),r=Object.getOwnPropertyNames(n.prototype);return r&&r.indexOf(e)>=0?e:void 0}},{key:"propertyNames",value:t.mark((function e(){var r,i,o,a,c;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=Object.getOwnPropertyNames(n.prototype),i=it(r),t.prev=2,i.s();case 4:if((o=i.n()).done){t.next=12;break}if(a=o.value,!(c=_t(a))){t.next=10;break}return t.next=10,{name:c,fullName:a};case 10:t.next=4;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(2),i.e(t.t0);case 17:return t.prev=17,i.f(),t.finish(17);case 20:case"end":return t.stop()}}),e,null,[[2,14,17,20]])}))}]),n}();k(Ct,"imageSelector","image"),k(Ct,"titleSelector","rect.".concat(yt)),k(Ct,"linkSelector","use.".concat(bt)),k(Ct,"notesSelector","use.".concat(St)),k(Ct,"markersSelector","g.".concat(wt)),k(Ct,"labelsSelector","g.".concat(Et)),k(Ct,"focusItemSelector",".".concat(ht)),k(Ct,"underLineSelectors",[Ct.linkSelector,Ct.notesSelector,Ct.markersSelector,Ct.labelsSelector]),$=w("click","topic-item-fold-icon"),Z=w("click","topic-link"),z=w("click","topic-notes"),q=w("click","topic-item-image"),J=w("click","topic-labels"),tt=w("click","topic-labels-more"),et=w("click","topic-markers"),nt=w("click");var Lt=function(){function n(t,r,i){e(this,n);var o,a,c=this[at]={};if(d(t)){if("g"!==t.tagName||!t.hasClass(ft))throw rt.ILLEGAL_INSTANCE("_data","<g> with group class");var s=c.content=t;this.fireEvent=L.bind(s),c.childrenGroup=s.firstDescendant(n.childrenGroupSelector),c.item=new Ct(s.firstDescendant("g.".concat(ut,"#").concat(s.attr("id"))))}else if(d(i)&&i.isSVG){var l=((o=t.id)?(a="string"==typeof o?o:String(o)).startsWith("MID-")||(a="MID-"+a):a="".concat("MID-").concat(Date.now()).concat(Math.random().toString(16).substr(2,3)),a),f=c.content=i.createSVGChild("g");f.attr({id:l,class:ft}),t&&void 0!==t.direction&&f.data("direction",t.direction),this.fireEvent=L.bind(f),(c.childrenGroup=f.createSVGChild("g")).attr({id:l,class:gt}),C((c.item=new Ct(t,r,f)).content,this);var u=t.children;if(u instanceof Array)for(var h in u)this.addNewChild(u[h])}}return r(n,[{key:$,value:function(t,e,n){this.fold(String(n.getAttribute("href")).indexOf("icon-minus")>=0),A(t)}},{key:Z,value:function(t){this.fireEvent(M.EVENT_INVOKE_LINK,{topic:this,data:this.topicData("href")}),_(t)}},{key:z,value:function(t){this.fireEvent(M.EVENT_INVOKE_NOTES,{topic:this,data:this.topicData("notes")}),_(t)}},{key:q,value:function(t){this.fireEvent(M.EVENT_INVOKE_IMAGE,{topic:this,data:this.topicData("image")}),_(t)}},{key:J,value:function(t){this.fireEvent(M.EVENT_INVOKE_LABELS,{topic:this,data:this.topicData("labels")}),_(t)}},{key:tt,value:function(t){this.fireEvent(M.EVENT_INVOKE_LABELS,{topic:this,data:this.topicData("labels"),more:!0}),_(t)}},{key:et,value:function(t){this.fireEvent(M.EVENT_INVOKE_MARKERS,{topic:this,data:this.topicData("markers")}),_(t)}},{key:nt,value:function(t){this.focus(),A(t)}},{key:"direction",value:function(t){var e=Nt(this).content;return void 0===t?e.data("direction")||0:(e.data("direction",t),this)}},{key:"globalZone",value:function(t){var e=Nt(this).item;return e?e.globalZone(t):void 0}},{key:"relativeZone",value:function(t){var e=Nt(this).item;return e?e.relativeZone(t):void 0}},{key:"childrenTopics",value:t.mark((function e(){var r,i,o,a,c;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=Nt(this).childrenGroup)){t.next=20;break}i=r.getChildren(n.contentSelector),o=it(i),t.prev=4,o.s();case 6:if((a=o.n()).done){t.next=12;break}return c=a.value,t.next=10,new n(c);case 10:t.next=6;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(4),o.e(t.t0);case 17:return t.prev=17,o.f(),t.finish(17);case 20:case"end":return t.stop()}}),e,this,[[4,14,17,20]])}))},{key:"topicData",value:function(t,e){var n=Nt(this).item;if(n){if(void 0===t){var r,i={},o=it(n.propertys());try{for(o.s();!(r=o.n()).done;){var a=r.value;void 0!==a.value&&null!==a.value&&(i[a.name]=a.value)}}catch(t){o.e(t)}finally{o.f()}return 1===this.level&&(i.direction=this.direction()),i}if("string"==typeof t){var c=Ct.propertyName(t);if(c){if(void 0===e)return n[c];n[c]=e,this.fireEvent(M.EVENT_REQUIRE_LAYOUT)}}else{var s=0;for(var l in t){var f=Ct.propertyName(l);if(f){var u=t[l];n[f]=u,s++}}0!==s&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT)}}return this}},{key:"isSame",value:function(t){return t instanceof n&&Nt(this).content.isSame(Nt(t).content)}},{key:"translate",value:function(t,e){var n=Nt(this).content;return n&&n.attr("transform","translate(".concat(t,", ").concat(e,")")),this}},{key:"fold",value:function(t){var e=Nt(this).childrenGroup;return this.focus(),void 0===t?e&&e.style("display","none"):(e&&e.style("display",t?"none":"unset"),this.fireEvent(M.EVENT_REQUIRE_LAYOUT),this)}},{key:"focus",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Nt(this).item;if(e){var n=e.focus(t);void 0!==n&&this.fireEvent(M.EVENT_FOCUS_CHANGE,n?this:null)}return this}},{key:"addNewChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t?t.title?t:Object.assign({title:n.DefaultTitle},t):{title:n.DefaultTitle},i=new n(r,this.level+1,Nt(this).childrenGroup);return e&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT),i}},{key:"remove",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.level>0){var e=Nt(this).content;if(e){var r=e.parent(n.childrenGroupSelector),i=r.firstDescendant("path#".concat(this.id));i&&i.remove(),e.remove(),t&&L.call(r,M.EVENT_REQUIRE_LAYOUT)}}return this}},{key:"clearChildren",value:function(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=it(this.childrenTopics());try{for(r.s();!(t=r.n()).done;){var i=t.value;i instanceof n&&i.remove()}}catch(t){r.e(t)}finally{r.f()}return e&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT),this}},{key:"insertTo",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t instanceof n){var i=Nt(t).childrenGroup,o=Nt(this),a=o.content,c=o.item;i&&a&&(this.remove(),e?a.insertToTop(i):a.appendTo(i),c.level(t.level+1),r&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT))}return this}},{key:"insertNextTo",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t instanceof n){var r=t.content,i=Nt(this),o=i.content,a=i.item;this.remove(),o.insertAfter(r),a.level(t.level),e&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT)}}},{key:"insertAsBrother",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t instanceof n){var i=Nt(t).content,o=Nt(this),a=o.content,c=o.item;i&&a&&(this.remove(),e?a.insertBefore(i):a.insertAfter(i),c.level(t.level),r&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT))}return this}},{key:"layout",value:function(t,e,n){if(!(t instanceof Mt))throw rt.INVALID_PARAM("_mindSVG");var r=Nt(this),i=r.content,o=r.item,a=r.childrenGroup;if(!(i&&o instanceof Ct&&a))throw rt.ILLEGAL_INSTANCE("Topic");o.layout(t,n);var c=o.level(),s=void 0===e?"none"===a.node.style.display:e>0&&e<=c;if(o.fold(this.hasChild&&c>0?s:null),s)a.node.style.display="none";else{a.node.style.display="unset";var l,f=o.connectPointer(0),u=t.config(),h=u.topicMarginX,d=0-f.x-h,v=u.topicMarginY,y={},p=0,g=0,m=n,k=it(this.childrenTopics());try{for(k.s();!(l=k.n()).done;){var E=l.value;if(E.visible){void 0===n&&(m=E.direction()),E.layout(t,e,m);var T=E.originCorner;if(1===m){var b=T.y<0?g-T.y:g,S=E.titleZone;g+=E.size.height+v,y[E.id]={obj:E,x:d-S.width,y:b,lineY:b+S.height/2,left:!0}}else{var w=T.y<0?p-T.y:p;p+=E.size.height+v,y[E.id]={obj:E,x:h,y:w,lineY:w+E.titleZone.height/2,left:!1}}}}}catch(t){k.e(t)}finally{k.f()}p>g?(g=(p-g)/2,p=0):(p=(g-p)/2,g=0);var x=u.lineBezierCtrlSize,A=a.height>>1,_="M0 ".concat(A,"C").concat(x," ").concat(A," ").concat(h-x," "),N="M".concat(0-f.x," ").concat(A,"C").concat(0-f.x-x," ").concat(A," ").concat(d+x," ");for(var I in y){var C=y[I],L=C.obj,M=C.x,V=C.y,O=C.lineY,D=C.left,R=D?g:p;L.translate(M,V+R),O+=R,(a.firstDescendant("path#".concat(I))||a.createSVGChild("path")).attr({id:I,d:D?"".concat(N).concat(O," ").concat(d," ").concat(O):"".concat(_).concat(O," ").concat(h," ").concat(O),class:mt})}a.attr("transform","translate(".concat(f.x,", ").concat(0-A+f.y,")"))}}},{key:"toString",value:function(){return JSON.stringify(this.topicData())}},{key:"content",get:function(){return Nt(this).content}},{key:"parent",get:function(){if(this.level>0){var t=Nt(this).content.parent(n.contentSelector);return t?new n(t):void 0}}},{key:"size",get:function(){var t=Nt(this).content,e=0,n=0;if(t){var r=t.rect;e=r.width,n=r.height}return{width:e,height:n}}},{key:"originCorner",get:function(){var t,e,n=Nt(this).content;if(n){var r=n.rect;t=r.x,e=r.y}else t=0,e=0;return{x:t,y:e}}},{key:"id",get:function(){var t=Nt(this).content;return t&&t.attr("id")||""}},{key:"titleZone",get:function(){var t=Nt(this).item;return t?t.titleZone:{x:0,y:0,width:0,height:0}}},{key:"itemZone",get:function(){var t=Nt(this).item;return t&&t.content?t.content.globalRect:{x:0,y:0,width:0,height:0}}},{key:"totalZone",get:function(){var t=Nt(this).content;return t?t.globalRect:{x:0,y:0,width:0,height:0}}},{key:"hasChild",get:function(){var t=Nt(this).childrenGroup;return t&&void 0!==t.firstDescendant(n.contentSelector)}},{key:"level",get:function(){return Nt(this).item.level()}},{key:"data",get:function(){var t=this.topicData();if(t){t.id=this.id;var e,n=t.children=[],r=it(this.childrenTopics());try{for(r.s();!(e=r.n()).done;){var i=e.value;n.push(i.data)}}catch(t){r.e(t)}finally{r.f()}}return t}},{key:"isInFocus",get:function(){var t=Nt(this);return t&&t.isInFocus}},{key:"visible",get:function(){return"none"!==Nt(this).content.style("display")},set:function(t){var e=Nt(this).content;if("none"!==e.style("display")!==(t=t||!1)){var n=t?"unset":"none";e.style("display",n);var r=e.root.firstDescendant("path#".concat(e.attr("id")));r&&(r.node.style.display=n),!t&&this.isInFocus&&this.focus(!1),t&&this.fireEvent(M.EVENT_REQUIRE_LAYOUT)}}},{key:"nextSibling",get:function(){for(var t=this.content;t=u().attach(t.node.nextSibling);)if(t.matches(n.contentSelector))return new n(t)}},{key:"previousSibling",get:function(){for(var t=this.content;t=u().attach(t.node.previousSibling);)if(t.matches(n.contentSelector))return new n(t)}},{key:"firstDescendant",get:function(){var t=this.content.firstDescendant(n.contentSelector);return t?new n(t):void 0}}]),n}();k(Lt,"DefaultTitle","默认主题"),k(Lt,"contentSelector","g.".concat(ft)),k(Lt,"childrenGroupSelector","g.".concat(gt));var Mt=function(){function n(t){e(this,n);var r=this[at]={configs:{},rootTopic:void 0,container:u("div")},i=u().attach(t)||u().attach("body"),o=r.container;o.attr({class:"".concat(ct," ").concat(st),tabindex:"1"}),o.appendTo(i),this.fireEvent=L.bind(o),r.timerID=setInterval(n.checkState,100,this);var a=o.firstDescendant("svg")||o.createSVGChild("svg");r.svg=a,r.containerWidth=o.width,r.containerHeight=o.height,r.offsetX=0,r.offsetY=0,r.scaleRate=1,a.attr({viewBox:"".concat(r.offsetX," ").concat(r.offsetY," ").concat(r.containerWidth," ").concat(r.containerHeight),class:lt,width:"100%",height:"100%"}),r.content=void 0,Object.assign(r.configs,xt),new It(a),C(o,this)}return r(n,[{key:w(M.EVENT_REQUIRE_LAYOUT),value:function(){this.fold()}},{key:w("click"),value:function(t){this.clearFocus(),A(t)}},{key:"release",value:function(){var t=Nt(this);t.timerID&&(clearInterval(t.timerID),t.timerID=void 0)}},{key:"on",value:function(t,e,n){var r=Nt(this).container;return r&&r.on(t,e,n),this}},{key:"off",value:function(t,e,r){var i=Nt(this).container;return i&&(i.off(t,e,r),x(n,t)&&!e&&C(i,this,[t])),this}},{key:"clear",value:function(){var t=Nt(this);return t.content&&(t.content.remove(),t.content=void 0,t.rootTopic=void 0),this}},{key:"show",value:function(t){var e=Nt(this);if(e.svg){this.clear();var n=e.content=e.svg.createSVGChild("g");if(n.attr("class",ct),t)(e.rootTopic=new Lt(t,0,n)).layout(this,0),this.toCenter()}return this}},{key:"setTheme",value:function(t){var e=Nt(this),n=e.content,r=e.container,i=t?"".concat(ct," ").concat(t):ct;return n&&n.attr("class",i),r&&r.attr("class","".concat(i," ").concat(st)),this}},{key:"config",value:function(t,e){if(void 0===t)return Object.assign({},Nt(this).configs);if("string"==typeof t){var n=Nt(this,"configs");if(void 0===e)return n[t];n[t]=null===e?xt[t]:e}else for(var r in t)this.config(String(r),t[r]);return this}},{key:"toCenter",value:function(t){var e=Nt(this);if(e.svg&&this.content){var n=e.containerWidth/e.scaleRate,r=e.containerHeight/e.scaleRate,i=this.content.rect;if(t instanceof Lt){var o=t.titleZone;e.offsetX=parseInt(o.x-(n-o.width)/2),e.offsetY=parseInt(o.y-(r-o.height)/2)}else{var a=e.svg.firstDescendant("g.".concat(pt,"0")),c=a?a.rect:{width:0,height:0};if(i.width<n)e.offsetX=i.x-(n-i.width)/2;else{var s=parseInt(0-(n-c.width)/2);i.x>s?e.offsetX=i.x:n+s>i.width+i.x?e.offsetX=i.width+i.x-n:e.offsetX=s}if(i.height<r)e.offsetY=i.y-(r-i.height)/2;else{var l=parseInt(0-(r-c.height)/2);i.y>l?e.offsetY=i.y:r+l>i.height+i.y?e.offsetY=i.height+i.y-r:e.offsetY=l}}e.svg.attr("viewBox","".concat(e.offsetX," ").concat(e.offsetY," ").concat(n," ").concat(r))}return this}},{key:"move",value:function(t,e){var n=Nt(this);if(n.svg){var r=n.containerWidth/n.scaleRate,i=n.containerHeight/n.scaleRate;n.offsetX=t,n.offsetY=e,n.svg.attr("viewBox","".concat(n.offsetX," ").concat(n.offsetY," ").concat(r," ").concat(i))}return this}},{key:"moveBy",value:function(t,e){var n=Nt(this);if(n.svg){var r=n.containerWidth/n.scaleRate,i=n.containerHeight/n.scaleRate;t=parseInt(t),e=parseInt(e),isNaN(t)||(n.offsetX+=t),isNaN(e)||(n.offsetY+=e),n.svg.attr("viewBox","".concat(n.offsetX," ").concat(n.offsetY," ").concat(r," ").concat(i))}return this}},{key:"scaleBy",value:function(t){var e=Nt(this);return e.svg&&(t=parseFloat(t),isNaN(t)||this.scale(e.scaleRate*t)),this}},{key:"scale",value:function(t){var e=Nt(this);if(e.svg&&(t=parseFloat(t),!isNaN(t))){var n=!isNaN(e.configs.maxScale)&&t>e.configs.maxScale;if(!(n=n||!isNaN(e.configs.minScale)&&t<e.configs.minScale)){e.scaleRate=t;var r=e.containerWidth/t,i=e.containerHeight/t;e.svg.attr("viewBox","".concat(e.offsetX," ").concat(e.offsetY," ").concat(r," ").concat(i))}}return this}},{key:"fold",value:function(t){var e=Nt(this).rootTopic;return e&&(t>0&&this.clearFocus(),e.layout(this,t)),this}},{key:"clearFocus",value:function(){var t=Nt(this).svg;if(t){var e=t.firstDescendant(Ct.focusItemSelector);e&&(e.removeClass(ht),L.call(e,M.EVENT_FOCUS_CHANGE,null))}return this}},{key:"getTopicByID",value:function(t){var e=Nt(this).svg;if(e&&t){var n=e.firstDescendant("".concat(Lt.contentSelector,"[id=").concat(t,"]"));return n?new Lt(n):void 0}}},{key:"getTopicIterator",value:t.mark((function e(){var n,r,i,o,a;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=Nt(this).svg)){t.next=21;break}r=n.getDescandant(Lt.contentSelector),i=it(r),t.prev=4,i.s();case 6:if((o=i.n()).done){t.next=13;break}if(!(a=o.value)){t.next=11;break}return t.next=11,new Lt(a);case 11:t.next=6;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(4),i.e(t.t0);case 18:return t.prev=18,i.f(),t.finish(18);case 21:case"end":return t.stop()}}),e,this,[[4,15,18,21]])}))},{key:"getDefs",value:t.mark((function e(){var n,r,i,o,a,c,s,l,f,u,h,d;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=Nt(this).svg)){t.next=39;break}r=it(n.getDescandant("defs")),t.prev=3,r.s();case 5:if((i=r.n()).done){t.next=31;break}o=i.value,a=it(o.getChildren()),t.prev=8,a.s();case 10:if((c=a.n()).done){t.next=21;break}if(s=c.value,!(l=s.attr("id"))){t.next=19;break}return f=l.split("-"),u=f[0],h=f[1],"function"==typeof(d=It["".concat(u,"$translate")])&&(h=d(h)),t.next=19,{type:u,value:h,node:s.node};case 19:t.next=10;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(8),a.e(t.t0);case 26:return t.prev=26,a.f(),t.finish(26);case 29:t.next=5;break;case 31:t.next=36;break;case 33:t.prev=33,t.t1=t.catch(3),r.e(t.t1);case 36:return t.prev=36,r.f(),t.finish(36);case 39:case"end":return t.stop()}}),e,this,[[3,33,36,39],[8,23,26,29]])}))},{key:"container",get:function(){return Nt(this).container}},{key:"svg",get:function(){return Nt(this).svg}},{key:"content",get:function(){return Nt(this).content}},{key:"rootTopic",get:function(){return Nt(this).rootTopic}},{key:"zone",get:function(){var t=Nt(this);return{x:t.offsetX,y:t.offsetY,width:t.containerWidth/t.scaleRate,height:t.containerHeight/t.scaleRate}}},{key:"data",get:function(){var t=Nt(this).rootTopic;return t instanceof Lt?t.data:{}}},{key:"totalSize",get:function(){var t=Nt(this).content,e=0,n=0;if(t){var r=t.rect;e=r.width,n=r.height}return{width:e,height:n}}},{key:"scaleRate",get:function(){var t=Nt(this);return t?t.scaleRate:1}},{key:"offset",get:function(){var t=Nt(this);return t?{x:t.offsetX,y:t.offsetY}:{x:0,y:0}}},{key:"focusTopic",get:function(){var t=Nt(this).svg;if(t){var e=t.firstDescendant(Ct.focusItemSelector);if(e)return(e=e.parent(Lt.contentSelector))?new Lt(e):void 0}}}],[{key:"checkState",value:function(t){var e=Nt(t);if(e.svg){var n=e.container.width,r=e.container.height;if(n!==e.containerWidth||r!==e.containerHeight){e.containerWidth=n,e.containerHeight=r,n/=e.scaleRate,r/=e.scaleRate,e.svg.attr("viewBox","".concat(e.offsetX," ").concat(e.offsetY," ").concat(n," ").concat(r));var i=document.createEvent("UIEvents");i.initUIEvent("resize",!1,!0,window||global,this),e.container.dispatchEvent(i)}}}}]),n}();g({MindSVG:Mt,Topic:Lt,TopicItem:Ct,Defs:It,DEFAULT_CONFIGS:xt});var Vt,Ot,Dt={ATTACHMENT_LINK_PREFIX:"xap:",STAMP_TOPIC_TITLE:"topic-item-title",STAMP_FOLD_ICON:"topic-item-fold-icon",STAMP_TOPIC_IMAGE:"topic-item-image",STAMP_TOPIC_LABEL_MORE:"topic-labels-more",STAMP_TOPIC_LABELS:"topic-labels",STAMP_TOPIC_LINK:"topic-link",STAMP_TOPIC_MARKERS:"topic-markers",STAMP_TOPIC_NOTES:"topic-notes",CONNECT_DIRECTION_LEFT:1,CONNECT_DIRECTION_RIGHT:0,ID_ICON_MINUS:"icon-minus",ID_ICON_PLUS:"icon-plus",ID_ICON_MORE:"icon-more",ID_ICON_LINK:"icon-link",ID_ICON_NOTES:"icon-notes"};function Rt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Gt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Pt=M,jt=Symbol("mind.svg.drag.event.log");function Ut(t){return t[jt]||(t[jt]={})}function Yt(t,e,n,r){var i=t.container,o=i.firstDescendant("div.".concat("mind-topic-drag-box"));o||(o=i.createChild("div").attr("class","mind-topic-drag-box"));var a=e.dragingTopic;if(a&&(o.text=a.topicData("title")),void 0!==n&&void 0!==r){var c=i.translatePoint(n,r),s=c.x,l=c.y;o.attr("style","".concat("position: absolute;"," left:").concat(s+3,"px; top:").concat(l-o.height/2-i.top,"px;"))}return o}function Ht(t,e,n){var r,i=t.svg,o=i.firstDescendant("path.".concat("mind-topic-drag-line"))||i.createSVGChild("path").attr("class","mind-topic-drag-line");if(n&&(r=n.hoverTopic)){var a=r.titleZone,c=e.globalRect,s=i.translatePoint(c.x+c.width/2,c.y+c.height/2),l=s.x,f=s.y;o.attr({d:"M".concat(a.x+a.width/2," ").concat(a.y+a.height/2,"L").concat(l," ").concat(f),style:"display: unset;"})}return o}function Bt(t){Ut(t).hoverTimer=void 0,t.fireEvent("mindevent.drag.potential.hover",{topic:t})}p("Topic",(k(Vt={},w("mousedown",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&this.level>0&&(e.waitDrag=this.fireEvent("mindevent.query.draggable",this,!0),A(t))})),k(Vt,w("mousemove",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&e.waitDrag&&(e.waitDrag=void 0,e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=void 0,this.fireEvent("mindevent.drag.start",{topic:this,x:t.clientX,y:t.clientY})),_(t)})),k(Vt,w("mouseover",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&(e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=setTimeout(Bt,900,this)),_(t)})),k(Vt,w("mouseout",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);e.waitDrag=void 0,e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=void 0,_(t)})),k(Vt,w("mouseup",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);e.waitDrag=void 0,e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=void 0,_(t)})),Vt)),p("MindSVG",(k(Ot={},w("mindevent.query.draggable"),(function(t){t.detail.result=this.config("draggable")})),k(Ot,w("mindevent.drag.start"),(function(t){var e=Ut(this),n=t.detail.value,r=n.topic;if(e.dragingTopic=r,r){var i=Yt(this,e,n.x,n.y);e.hoverTopic=r.parent,Ht(this,i,e),r.visible=!1}A(t)})),k(Ot,w("mindevent.drag.potential.hover"),(function(t){var e=Ut(this),n=t.detail.value.topic;e.dragingTopic&&(e.hoverTopic=n,Ht(this,Yt(this,e),e));A(t)})),k(Ot,w("mousemove"),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&e.dragingTopic&&(Ht(this,Yt(this,e,t.clientX,t.clientY),e),A(t))})),k(Ot,w("mouseup"),(function(t){var e=Ut(this);if(1===(t.which||t.button+1)&&e.dragingTopic){var n=Yt(this,e);n.attr("style","display: none;"),Ht(this,n).attr("style","display:none;");var r=e.dragingTopic,i=e.hoverTopic,o=r.parent,a=r.previousSibling,c=0===o.level?r.direction():null,s=this.fireEvent(Pt.EVENT_CONFIRM_DRAG,{dragingTopic:r,originParent:o,newParent:i},!0),l=void 0;if(i&&s){var f,u=t.clientY,h=!1;0===i.level?t.clientX<i.itemZone.x?(f=Dt.CONNECT_DIRECTION_LEFT,h=!0):f=Dt.CONNECT_DIRECTION_RIGHT:f=null,r.direction(f);var d,v=void 0,y=Rt(i.childrenTopics());try{for(y.s();!(d=y.n()).done;){var p=d.value;if(!(r.isSame(p)||h&&p.direction()!==Dt.CONNECT_DIRECTION_LEFT)){if(u<p.itemZone.y)break;v=p}}}catch(t){y.e(t)}finally{y.f()}v?e.dragingTopic.insertNextTo(v,!1):e.dragingTopic.insertTo(i,!0,!1),l={dragingTopic:r,originParent:o,originSibling:a,originDirection:c,newParent:i,newSibling:v,newDirection:f}}r.focus(!0),e.dragingTopic.visible=!0,e.dragingTopic=void 0,A(t),this.fireEvent(Pt.EVENT_END_DRAG,l)}})),Ot)),y("DEFAULT_CONFIGS",{draggable:!1});var Ft=["start","oct","quarter","3oct","half","5oct","3quar","7oct","done","unknown"];y("Defs",{$std$defs$declare:function(t){t.defs&&t.defs.node.insertAdjacentHTML("beforeend",'\n                <path id="'.concat(Dt.ID_ICON_PLUS,'" fill="#fff" fill-opacity="0.8" stroke="#000" stroke-width="1" \n                    transform="translate(-6, -4), scale(1.25, 1.25)" \n                    d="M1 4A3 3 0 1 0 8 4A3 3 0 1 0 1 4M2.5 4L6.5 4M4.5 2L4.5 6" />\n                <path id="').concat(Dt.ID_ICON_MINUS,'" fill="#fff" fill-opacity="0.8" stroke="#000" stroke-width="1" \n                    transform="translate(-6, -4), scale(1.25, 1.25)" \n                    d="M1 4A3 3 0 1 0 8 4A3 3 0 1 0 1 4M2.5 4L6.5 4" />\n                <path id="').concat(Dt.ID_ICON_MORE,'" fill="#fff" fill-opacity="0.8" stroke="#000" stroke-width="1" stroke-opacity="0.6"\n                    d="M4 1H7Q10 1 10 4V7Q10 10 7 10H4Q1 10 1 7V4 Q1 1 4 1M4 3L7 5.5L4 8" />\n                <path id="').concat(Dt.ID_ICON_NOTES,'" fill="#ffd" fill-opacity="0.8" stroke="#000" stroke-width="1" stroke-opacity="0.6"\n                    d="M3 1H13L18 6V20H3V1M13 1V6H18M6 4H10M6 7H10M6 10H15M6 13H15M6 16H13" />\n                <g id="').concat(Dt.ID_ICON_LINK,'">\n                    <rect width="20" height="20" rx="3" ry="3" fill="#eee" fill-opacity="0.3" stroke-width="0" />\n                    <path fill="none" fill-opacity="0.8" stroke="#000" stroke-width="1.5" stroke-opacity="0.6"\n                          d="M9 7L11 5A2 2 0 0 1 15 9L13 11M7 9L5 11A2 2 0 0 0 9 15L11 13M7 13L13 7" />\n                </g>\n                <path id="priority-1" fill="#f00" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M8 7L10.5 6V16" />\n                <path id="priority-2" fill="#f00" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 8C10.5 1 20 8 7 14M6 14H16" />\n                <path id="priority-3" fill="#f0f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 7C10.5 1 20 8 10 10C21 10 10.5 21 6 12" />\n                <path id="priority-4" fill="#f0f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M12 4Q10 10 6 13M5 13H15M13 8L11 16" />\n                <path id="priority-5" fill="#06f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M9 4Q9 7 8 9M7 9C18 5 16 20 6 14M9 5H14" />\n                <path id="priority-6" fill="#06f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 9C13 7 16 13 10 15C4 15 4 9 13 4" />\n                <path id="priority-7" fill="#093" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 8V6Q11 7 13 6.5Q10 12 9 16" />\n                <path id="priority-8" fill="#093" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M10 9C6 8 7 3 12 4C15 5 15 10 10 9C16 10 16 16.5 10 16C4 15 4 9 10 9" />\n                <path id="priority-9" fill="#993" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M15 10C6 16 5 3.5 12 4.5C18 6 16 17 7 16" />\n                <path id="task-0" fill="#fff" fill-opacity="0.8" stroke="#093" stroke-width="1" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M8 14V5L15 10L8 15V6" />\n                <g id="task-1">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 1 0 16.5 4.5L10.5 10.5" />\n                </g>\n                <g id="task-2">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 1 0 19 10.5L10.5 10.5" />\n                </g>\n                <g id="task-3">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 1 0 16.5 16.5L10.5 10.5" />\n                </g>\n                <g id="task-4">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 10.5 19L10.5 10.5" />\n                </g>\n                <g id="task-5">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 4.5 16.5L10.5 10.5" />\n                </g>\n                <g id="task-6">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 2 10.5L10.5 10.5" />\n                </g>\n                <g id="task-7">\n                    <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n                    <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 4.5 4.5L10.5 10.5" />\n                </g>\n                <path id="task-8" fill="#093" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M15 6L10 13L6 9" />\n                <path id="task-9" fill="#fff" fill-opacity="0.8" stroke="#093" stroke-width="1" stroke-opacity="0.8"\n                    d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 8A3.5 3.5 0 1 1 10.5 10.5V13M10.5 14V16M9.5 15H11.5" />\n                '))},priority$translate:function(t){return t=parseInt(t),t=isNaN(t)||t<1?1:t>9?9:t},task$translate:function(t,e){if(e){var n=Ft.indexOf(t);return n>=0?n:9}var r=parseInt(t);return r>=0&&r<=9?Ft[r]:Ft[9]}});var Xt=Symbol("mind.attachment.url"),Wt=Symbol("mind.attachment.data"),Kt=Symbol("mind.attachment.list"),Qt=function(){function t(n){e(this,t),this[Wt]=n,this[Xt]=n instanceof Blob?URL.createObjectURL(n):void 0}return r(t,[{key:"release",value:function(){this[Xt]&&(URL.revokeObjectURL(this[Xt]),this[Xt]=void 0)}},{key:"toString",value:function(){return this[Wt]instanceof Blob?this[Xt]:String(this[Wt])}},{key:"data",get:function(){return this[Wt]}}]),t}(),$t=function(){function n(){e(this,n),this[Kt]={}}return r(n,[{key:"item",value:function(t,e){if(void 0===e)return this[Kt][t];if(null===e){var n=this[Kt][t];return n&&n.release(),delete this[Kt][t],this}t||(t="".concat(Date.now().toString(16),"-").concat(Math.random().toString(16).substr(2,3)));var r=this[Kt][t];return r&&r.release(),this[Kt][t]=new Qt(e),{name:t,value:this[Kt][t]}}},{key:"items",value:t.mark((function e(){var n,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this[Kt],e.t0=t.keys(n);case 2:if((e.t1=e.t0()).done){e.next=8;break}return r=e.t1.value,e.next=6,{name:r,value:n[r]};case 6:e.next=2;break;case 8:case"end":return e.stop()}}),e,this)}))},{key:"clear",value:function(){var t=this[Kt];for(var e in t)t[e].release();this[Kt]={}}}]),n}(),Zt=M,zt=V,qt=m;export{$t as AttachmentCollection,Dt as Constants,u as ENode,f as ENodeClass,rt as ERROR,Zt as EVENT,zt as Event,qt as Extend,Mt as MindSVG,a as NS,h as SVG,d as isENode,s as isNode,O as unused};
//# sourceMappingURL=mind.svg.min.js.map