2023-05-30 19:27:03 +08:00

50 lines
836 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).X6={})}(this,(function(t){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function o(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function s(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l={exports:{}};
/*!
* jQuery JavaScript Library v3.6.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2021-03-02T17:08Z
*/
!function(t){!function(e,n){t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}}("undefined"!=typeof window?window:a,(function(t,e){var n=[],r=Object.getPrototypeOf,i=n.slice,o=function(t){return n.concat.apply([],t)},s=n.push,a=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,h=c.toString,p=h.call(Object),d={},f=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},g=function(t){return null!=t&&t===t.window},v=t.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function m(t,e,n){var r,i,o=(n=n||v).createElement("script");if(o.text=t,e)for(r in y)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?l[u.call(t)]||"object":typeof t}var C="3.6.0",x=function(t,e){return new x.fn.init(t,e)};function w(t){var e=!!t&&"length"in t&&t.length,n=b(t);return!f(t)&&!g(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}x.fn=x.prototype={jquery:C,constructor:x,length:0,toArray:function(){return i.call(this)},get:function(t){return null==t?i.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=x.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return x.each(this,t)},map:function(t){return this.pushStack(x.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},x.extend=x.fn.extend=function(){var t,e,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||f(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)r=t[e],"__proto__"!==e&&s!==r&&(u&&r&&(x.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[e],o=i&&!Array.isArray(n)?[]:i||x.isPlainObject(n)?n:{},i=!1,s[e]=x.extend(u,o,r)):void 0!==r&&(s[e]=r));return s},x.extend({expando:"jQuery"+(C+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==u.call(t))&&(!(e=r(t))||"function"==typeof(n=c.call(e,"constructor")&&e.constructor)&&h.call(n)===p)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){m(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(w(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(w(Object(t))?x.merge(n,"string"==typeof t?[t]:t):s.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:a.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r=[],i=0,o=t.length,s=!n;i<o;i++)!e(t[i],i)!==s&&r.push(t[i]);return r},map:function(t,e,n){var r,i,s=0,a=[];if(w(t))for(r=t.length;s<r;s++)null!=(i=e(t[s],s,n))&&a.push(i);else for(s in t)null!=(i=e(t[s],s,n))&&a.push(i);return o(a)},guid:1,support:d}),"function"==typeof Symbol&&(x.fn[Symbol.iterator]=n[Symbol.iterator]),x.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){l["[object "+e+"]"]=e.toLowerCase()}));var P=
/*!
* Sizzle CSS Selector Engine v2.3.6
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
*/
function(t){var e,n,r,i,o,s,a,l,u,c,h,p,d,f,g,v,y,m,b,C="sizzle"+1*new Date,x=t.document,w=0,P=0,A=lt(),E=lt(),M=lt(),S=lt(),k=function(t,e){return t===e&&(h=!0),0},T={}.hasOwnProperty,D=[],N=D.pop,O=D.push,L=D.push,F=D.slice,z=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",V="[\\x20\\t\\r\\n\\f]",j="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",R="\\[[\\x20\\t\\r\\n\\f]*("+j+")(?:"+V+"*([*^$|!~]?=)"+V+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+j+"))|)"+V+"*\\]",I=":("+j+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",_=new RegExp(V+"+","g"),G=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),H=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),U=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),q=new RegExp(V+"|>"),$=new RegExp(I),W=new RegExp("^"+j+"$"),X={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,J=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){p()},st=Ct((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(D=F.call(x.childNodes),x.childNodes),D[x.childNodes.length].nodeType}catch(t){L={apply:D.length?function(t,e){O.apply(t,F.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function at(t,e,r,i){var o,a,u,c,h,f,y,m=e&&e.ownerDocument,x=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return r;if(!i&&(p(e),e=e||d,g)){if(11!==x&&(h=Q.exec(t)))if(o=h[1]){if(9===x){if(!(u=e.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(m&&(u=m.getElementById(o))&&b(e,u)&&u.id===o)return r.push(u),r}else{if(h[2])return L.apply(r,e.getElementsByTagName(t)),r;if((o=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return L.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!S[t+" "]&&(!v||!v.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(y=t,m=e,1===x&&(q.test(t)||U.test(t))){for((m=tt.test(t)&&yt(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(rt,it):e.setAttribute("id",c=C)),a=(f=s(t)).length;a--;)f[a]=(c?"#"+c:":scope")+" "+bt(f[a]);y=f.join(",")}try{return L.apply(r,m.querySelectorAll(y)),r}catch(e){S(t,!0)}finally{c===C&&e.removeAttribute("id")}}}return l(t.replace(G,"$1"),e,r,i)}function lt(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[C]=!0,t}function ct(t){var e=d.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function pt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function gt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function vt(t){return ut((function(e){return e=+e,ut((function(n,r){for(var i,o=t([],n.length,e),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function yt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},o=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},p=at.setDocument=function(t){var e,i,s=t?t.ownerDocument||t:x;return s!=d&&9===s.nodeType&&s.documentElement?(f=(d=s).documentElement,g=!o(d),x!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ct((function(t){return f.appendChild(t).appendChild(d.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(d.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ct((function(t){return f.appendChild(t).id=C,!d.getElementsByName||!d.getElementsByName(C).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&g)return e.getElementsByClassName(t)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ct((function(t){var e;f.appendChild(t).innerHTML="<a id='"+C+"'></a><select id='"+C+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+B+")"),t.querySelectorAll("[id~="+C+"-]").length||v.push("~="),(e=d.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||v.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+C+"+*").length||v.push(".#.+[+~]"),t.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=d.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=K.test(m=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=m.call(t,"*"),m.call(t,"[s!='']:x"),y.push("!=",I)})),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),e=K.test(f.compareDocumentPosition),b=e||K.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},k=e?function(t,e){if(t===e)return h=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==d||t.ownerDocument==x&&b(x,t)?-1:e==d||e.ownerDocument==x&&b(x,e)?1:c?z(c,t)-z(c,e):0:4&r?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!i||!o)return t==d?-1:e==d?1:i?-1:o?1:c?z(c,t)-z(c,e):0;if(i===o)return pt(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[r]===a[r];)r++;return r?pt(s[r],a[r]):s[r]==x?-1:a[r]==x?1:0},d):d},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(p(t),n.matchesSelector&&g&&!S[e+" "]&&(!y||!y.test(e))&&(!v||!v.test(e)))try{var r=m.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){S(e,!0)}return at(e,d,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=d&&p(t),b(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=d&&p(t);var i=r.attrHandle[e.toLowerCase()],o=i&&T.call(r.attrHandle,e.toLowerCase())?i(t,e,!g):void 0;return void 0!==o?o:n.attributes||!g?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},at.escape=function(t){return(t+"").replace(rt,it)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,r=[],i=0,o=0;if(h=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(k),h){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return c=null,t},i=at.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=at.selectors={cacheLength:50,createPseudo:ut,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&$.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=A[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+V+"|$)"))&&A(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=at.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(_," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,p,d,f,g=o!==s?"nextSibling":"previousSibling",v=e.parentNode,y=a&&e.nodeName.toLowerCase(),m=!l&&!a,b=!1;if(v){if(o){for(;g;){for(p=e;p=p[g];)if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?v.firstChild:v.lastChild],s&&m){for(b=(d=(u=(c=(h=(p=v)[C]||(p[C]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],p=d&&v.childNodes[d];p=++d&&p&&p[g]||(b=d=0)||f.pop();)if(1===p.nodeType&&++b&&p===e){c[t]=[w,d,b];break}}else if(m&&(b=d=(u=(c=(h=(p=e)[C]||(p[C]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===b)for(;(p=++d&&p&&p[g]||(b=d=0)||f.pop())&&((a?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++b||(m&&((c=(h=p[C]||(p[C]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]=[w,b]),p!==e)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return i[C]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,n){for(var r,o=i(t,e),s=o.length;s--;)t[r=z(t,o[s])]=!(n[r]=o[s])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ut((function(t){var e=[],n=[],r=a(t.replace(G,"$1"));return r[C]?ut((function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ut((function(t){return function(e){return at(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ut((function(t){return W.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:gt(!1),disabled:gt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return Z.test(t.nodeName)},input:function(t){return J.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:vt((function(){return[0]})),last:vt((function(t,e){return[e-1]})),eq:vt((function(t,e,n){return[n<0?n+e:n]})),even:vt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:vt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:vt((function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:vt((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=dt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ft(e);function mt(){}function bt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Ct(t,e,n){var r=e.dir,i=e.next,o=i||r,s=n&&"parentNode"===o,a=P++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||s)return t(e,n,i);return!1}:function(e,n,l){var u,c,h,p=[w,a];if(l){for(;e=e[r];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||s)if(c=(h=e[C]||(e[C]={}))[e.uniqueID]||(h[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[r]||e;else{if((u=c[o])&&u[0]===w&&u[1]===a)return p[2]=u[2];if(c[o]=p,p[2]=t(e,n,l))return!0}return!1}}function xt(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function wt(t,e,n,r,i){for(var o,s=[],a=0,l=t.length,u=null!=e;a<l;a++)(o=t[a])&&(n&&!n(o,r,i)||(s.push(o),u&&e.push(a)));return s}function Pt(t,e,n,r,i,o){return r&&!r[C]&&(r=Pt(r)),i&&!i[C]&&(i=Pt(i,o)),ut((function(o,s,a,l){var u,c,h,p=[],d=[],f=s.length,g=o||function(t,e,n){for(var r=0,i=e.length;r<i;r++)at(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),v=!t||!o&&e?g:wt(g,p,t,a,l),y=n?i||(o?t:f||r)?[]:s:v;if(n&&n(v,y,a,l),r)for(u=wt(y,d),r(u,[],a,l),c=u.length;c--;)(h=u[c])&&(y[d[c]]=!(v[d[c]]=h));if(o){if(i||t){if(i){for(u=[],c=y.length;c--;)(h=y[c])&&u.push(v[c]=h);i(null,y=[],u,l)}for(c=y.length;c--;)(h=y[c])&&(u=i?z(o,h):p[c])>-1&&(o[u]=!(s[u]=h))}}else y=wt(y===s?y.splice(f,y.length):y),i?i(null,s,y,l):L.apply(s,y)}))}function At(t){for(var e,n,i,o=t.length,s=r.relative[t[0].type],a=s||r.relative[" "],l=s?1:0,c=Ct((function(t){return t===e}),a,!0),h=Ct((function(t){return z(e,t)>-1}),a,!0),p=[function(t,n,r){var i=!s&&(r||n!==u)||((e=n).nodeType?c(t,n,r):h(t,n,r));return e=null,i}];l<o;l++)if(n=r.relative[t[l].type])p=[Ct(xt(p),n)];else{if((n=r.filter[t[l].type].apply(null,t[l].matches))[C]){for(i=++l;i<o&&!r.relative[t[i].type];i++);return Pt(l>1&&xt(p),l>1&&bt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(G,"$1"),n,l<i&&At(t.slice(l,i)),i<o&&At(t=t.slice(i)),i<o&&bt(t))}p.push(n)}return xt(p)}return mt.prototype=r.filters=r.pseudos,r.setFilters=new mt,s=at.tokenize=function(t,e){var n,i,o,s,a,l,u,c=E[t+" "];if(c)return e?0:c.slice(0);for(a=t,l=[],u=r.preFilter;a;){for(s in n&&!(i=H.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=U.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(G," ")}),a=a.slice(n.length)),r.filter)!(i=X[s].exec(a))||u[s]&&!(i=u[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):E(t,l).slice(0)},a=at.compile=function(t,e){var n,i=[],o=[],a=M[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=At(e[n]))[C]?i.push(a):o.push(a);(a=M(t,function(t,e){var n=e.length>0,i=t.length>0,o=function(o,s,a,l,c){var h,f,v,y=0,m="0",b=o&&[],C=[],x=u,P=o||i&&r.find.TAG("*",c),A=w+=null==x?1:Math.random()||.1,E=P.length;for(c&&(u=s==d||s||c);m!==E&&null!=(h=P[m]);m++){if(i&&h){for(f=0,s||h.ownerDocument==d||(p(h),a=!g);v=t[f++];)if(v(h,s||d,a)){l.push(h);break}c&&(w=A)}n&&((h=!v&&h)&&y--,o&&b.push(h))}if(y+=m,n&&m!==y){for(f=0;v=e[f++];)v(b,C,s,a);if(o){if(y>0)for(;m--;)b[m]||C[m]||(C[m]=N.call(l));C=wt(C)}L.apply(l,C),c&&!o&&C.length>0&&y+e.length>1&&at.uniqueSort(l)}return c&&(w=A,u=x),b};return n?ut(o):o}(o,i))).selector=t}return a},l=at.select=function(t,e,n,i){var o,l,u,c,h,p="function"==typeof t&&t,d=!i&&s(t=p.selector||t);if(n=n||[],1===d.length){if((l=d[0]=d[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&g&&r.relative[l[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;p&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=X.needsContext.test(t)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((h=r.find[c])&&(i=h(u.matches[0].replace(et,nt),tt.test(l[0].type)&&yt(e.parentNode)||e))){if(l.splice(o,1),!(t=i.length&&bt(l)))return L.apply(n,i),n;break}}return(p||a(t,d))(i,e,!g,n,!e||tt.test(t)&&yt(e.parentNode)||e),n},n.sortStable=C.split("").sort(k).join("")===C,n.detectDuplicates=!!h,p(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(d.createElement("fieldset"))})),ct((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ct((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||ht(B,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),at}(t);x.find=P,x.expr=P.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=P.uniqueSort,x.text=P.getText,x.isXMLDoc=P.isXML,x.contains=P.contains,x.escapeSelector=P.escape;var A=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&x(t).is(n))break;r.push(t)}return r},E=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},M=x.expr.match.needsContext;function S(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(t,e,n){return f(e)?x.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?x.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?x.grep(t,(function(t){return a.call(e,t)>-1!==n})):x.filter(e,t,n)}x.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?x.find.matchesSelector(r,t)?[r]:[]:x.find.matches(t,x.grep(e,(function(t){return 1===t.nodeType})))},x.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(x(t).filter((function(){for(e=0;e<r;e++)if(x.contains(i[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)x.find(t,i[e],n);return r>1?x.uniqueSort(n):n},filter:function(t){return this.pushStack(T(this,t||[],!1))},not:function(t){return this.pushStack(T(this,t||[],!0))},is:function(t){return!!T(this,"string"==typeof t&&M.test(t)?x(t):t||[],!1).length}});var D,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||D,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:N.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof x?e[0]:e,x.merge(this,x.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:v,!0)),k.test(r[1])&&x.isPlainObject(e))for(r in e)f(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):f(t)?void 0!==n.ready?n.ready(t):t(x):x.makeArray(t,this)}).prototype=x.fn,D=x(v);var O=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function F(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}x.fn.extend({has:function(t){var e=x(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(x.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,i=this.length,o=[],s="string"!=typeof t&&x(t);if(!M.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?a.call(x(t),this[0]):a.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),x.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return A(t,"parentNode")},parentsUntil:function(t,e,n){return A(t,"parentNode",n)},next:function(t){return F(t,"nextSibling")},prev:function(t){return F(t,"previousSibling")},nextAll:function(t){return A(t,"nextSibling")},prevAll:function(t){return A(t,"previousSibling")},nextUntil:function(t,e,n){return A(t,"nextSibling",n)},prevUntil:function(t,e,n){return A(t,"previousSibling",n)},siblings:function(t){return E((t.parentNode||{}).firstChild,t)},children:function(t){return E(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(S(t,"template")&&(t=t.content||t),x.merge([],t.childNodes))}},(function(t,e){x.fn[t]=function(n,r){var i=x.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(L[t]||x.uniqueSort(i),O.test(t)&&i.reverse()),this.pushStack(i)}}));var z=/[^\x20\t\r\n\f]+/g;function B(t){return t}function V(t){throw t}function j(t,e,n,r){var i;try{t&&f(i=t.promise)?i.call(t).done(e).fail(n):t&&f(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}x.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return x.each(t.match(z)||[],(function(t,n){e[n]=!0})),e}(t):x.extend({},t);var e,n,r,i,o=[],s=[],a=-1,l=function(){for(i=i||t.once,r=e=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1);t.memory||(n=!1),e=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!e&&(a=o.length-1,s.push(n)),function e(n){x.each(n,(function(n,r){f(r)?t.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&e(r)}))}(arguments),n&&!e&&l()),this},remove:function(){return x.each(arguments,(function(t,e){for(var n;(n=x.inArray(e,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(t){return t?x.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},x.extend({Deferred:function(e){var n=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return x.Deferred((function(e){x.each(n,(function(n,r){var i=f(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&f(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(e,r,i){var o=0;function s(e,n,r,i){return function(){var a=this,l=arguments,u=function(){var t,u;if(!(e<o)){if((t=r.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");u=t&&("object"==typeof t||"function"==typeof t)&&t.then,f(u)?i?u.call(t,s(o,n,B,i),s(o,n,V,i)):(o++,u.call(t,s(o,n,B,i),s(o,n,V,i),s(o,n,B,n.notifyWith))):(r!==B&&(a=void 0,l=[t]),(i||n.resolveWith)(a,l))}},c=i?u:function(){try{u()}catch(t){x.Deferred.exceptionHook&&x.Deferred.exceptionHook(t,c.stackTrace),e+1>=o&&(r!==V&&(a=void 0,l=[t]),n.rejectWith(a,l))}};e?c():(x.Deferred.getStackHook&&(c.stackTrace=x.Deferred.getStackHook()),t.setTimeout(c))}}return x.Deferred((function(t){n[0][3].add(s(0,t,f(i)?i:B,t.notifyWith)),n[1][3].add(s(0,t,f(e)?e:B)),n[2][3].add(s(0,t,f(r)?r:V))})).promise()},promise:function(t){return null!=t?x.extend(t,i):i}},o={};return x.each(n,(function(t,e){var s=e[2],a=e[5];i[e[1]]=s.add,a&&s.add((function(){r=a}),n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),s.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=s.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),o=i.call(arguments),s=x.Deferred(),a=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?i.call(arguments):n,--e||s.resolveWith(r,o)}};if(e<=1&&(j(t,s.done(a(n)).resolve,s.reject,!e),"pending"===s.state()||f(o[n]&&o[n].then)))return s.then();for(;n--;)j(o[n],a(n),s.reject);return s.promise()}});var R=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&R.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},x.readyException=function(e){t.setTimeout((function(){throw e}))};var I=x.Deferred();function _(){v.removeEventListener("DOMContentLoaded",_),t.removeEventListener("load",_),x.ready()}x.fn.ready=function(t){return I.then(t).catch((function(t){x.readyException(t)})),this},x.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==t&&--x.readyWait>0||I.resolveWith(v,[x]))}}),x.ready.then=I.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?t.setTimeout(x.ready):(v.addEventListener("DOMContentLoaded",_),t.addEventListener("load",_));var G=function(t,e,n,r,i,o,s){var a=0,l=t.length,u=null==n;if("object"===b(n))for(a in i=!0,n)G(t,e,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,f(r)||(s=!0),u&&(s?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(x(t),n)})),e))for(;a<l;a++)e(t[a],n,s?r:r.call(t[a],a,e(t[a],n)));return i?t:u?e.call(t):l?e(t[0],n):o},H=/^-ms-/,U=/-([a-z])/g;function q(t,e){return e.toUpperCase()}function $(t){return t.replace(H,"ms-").replace(U,q)}var W=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=x.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e={},W(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"==typeof e)i[$(e)]=n;else for(r in e)i[$(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][$(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map($):(e=$(e))in r?[e]:e.match(z)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||x.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!x.isEmptyObject(e)}};var Y=new X,J=new X,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Q(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(K,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Z.test(t)?JSON.parse(t):t)}(n)}catch(t){}J.set(t,e,n)}else n=void 0;return n}x.extend({hasData:function(t){return J.hasData(t)||Y.hasData(t)},data:function(t,e,n){return J.access(t,e,n)},removeData:function(t,e){J.remove(t,e)},_data:function(t,e,n){return Y.access(t,e,n)},_removeData:function(t,e){Y.remove(t,e)}}),x.fn.extend({data:function(t,e){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(i=J.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=$(r.slice(5)),Q(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each((function(){J.set(this,t)})):G(this,(function(e){var n;if(o&&void 0===e)return void 0!==(n=J.get(o,t))||void 0!==(n=Q(o,t))?n:void 0;this.each((function(){J.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){J.remove(this,t)}))}}),x.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Y.get(t,e),n&&(!r||Array.isArray(n)?r=Y.access(t,e,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=x.queue(t,e),r=n.length,i=n.shift(),o=x._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){x.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Y.get(t,n)||Y.access(t,n,{empty:x.Callbacks("once memory").add((function(){Y.remove(t,[e+"queue",n])}))})}}),x.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?x.queue(this[0],t):void 0===e?this:this.each((function(){var n=x.queue(this,t,e);x._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&x.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){x.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=Y.get(o[s],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(e)}});var tt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,et=new RegExp("^(?:([+-])=|)("+tt+")([a-z%]*)$","i"),nt=["Top","Right","Bottom","Left"],rt=v.documentElement,it=function(t){return x.contains(t.ownerDocument,t)},ot={composed:!0};rt.getRootNode&&(it=function(t){return x.contains(t.ownerDocument,t)||t.getRootNode(ot)===t.ownerDocument});var st=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&it(t)&&"none"===x.css(t,"display")};function at(t,e,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return x.css(t,e,"")},l=a(),u=n&&n[3]||(x.cssNumber[e]?"":"px"),c=t.nodeType&&(x.cssNumber[e]||"px"!==u&&+l)&&et.exec(x.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;s--;)x.style(t,e,c+u),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),c/=o;c*=2,x.style(t,e,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var lt={};function ut(t){var e,n=t.ownerDocument,r=t.nodeName,i=lt[r];return i||(e=n.body.appendChild(n.createElement(r)),i=x.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),lt[r]=i,i)}function ct(t,e){for(var n,r,i=[],o=0,s=t.length;o<s;o++)(r=t[o]).style&&(n=r.style.display,e?("none"===n&&(i[o]=Y.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&st(r)&&(i[o]=ut(r))):"none"!==n&&(i[o]="none",Y.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(t[o].style.display=i[o]);return t}x.fn.extend({show:function(){return ct(this,!0)},hide:function(){return ct(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){st(this)?x(this).show():x(this).hide()}))}});var ht,pt,dt=/^(?:checkbox|radio)$/i,ft=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i;ht=v.createDocumentFragment().appendChild(v.createElement("div")),(pt=v.createElement("input")).setAttribute("type","radio"),pt.setAttribute("checked","checked"),pt.setAttribute("name","t"),ht.appendChild(pt),d.checkClone=ht.cloneNode(!0).cloneNode(!0).lastChild.checked,ht.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!ht.cloneNode(!0).lastChild.defaultValue,ht.innerHTML="<option></option>",d.option=!!ht.lastChild;var vt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&S(t,e)?x.merge([t],n):n}function mt(t,e){for(var n=0,r=t.length;n<r;n++)Y.set(t[n],"globalEval",!e||Y.get(e[n],"globalEval"))}vt.tbody=vt.tfoot=vt.colgroup=vt.caption=vt.thead,vt.th=vt.td,d.option||(vt.optgroup=vt.option=[1,"<select multiple='multiple'>","</select>"]);var bt=/<|&#?\w+;/;function Ct(t,e,n,r,i){for(var o,s,a,l,u,c,h=e.createDocumentFragment(),p=[],d=0,f=t.length;d<f;d++)if((o=t[d])||0===o)if("object"===b(o))x.merge(p,o.nodeType?[o]:o);else if(bt.test(o)){for(s=s||h.appendChild(e.createElement("div")),a=(ft.exec(o)||["",""])[1].toLowerCase(),l=vt[a]||vt._default,s.innerHTML=l[1]+x.htmlPrefilter(o)+l[2],c=l[0];c--;)s=s.lastChild;x.merge(p,s.childNodes),(s=h.firstChild).textContent=""}else p.push(e.createTextNode(o));for(h.textContent="",d=0;o=p[d++];)if(r&&x.inArray(o,r)>-1)i&&i.push(o);else if(u=it(o),s=yt(h.appendChild(o),"script"),u&&mt(s),n)for(c=0;o=s[c++];)gt.test(o.type||"")&&n.push(o);return h}var xt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function Pt(){return!1}function At(t,e){return t===function(){try{return v.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,r,i,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(r=r||n,n=void 0),e)Et(t,a,n,r,e[a],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Pt;else if(!i)return t;return 1===o&&(s=i,(i=function(t){return x().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=x.guid++)),t.each((function(){x.event.add(this,e,i,r,n)}))}function Mt(t,e,n){n?(Y.set(t,e,!1),x.event.add(t,e,{namespace:!1,handler:function(t){var r,o,s=Y.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(x.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=i.call(arguments),Y.set(this,e,s),r=n(this,e),this[e](),s!==(o=Y.get(this,e))||r?Y.set(this,e,!1):o={},s!==o)return t.stopImmediatePropagation(),t.preventDefault(),o&&o.value}else s.length&&(Y.set(this,e,{value:x.event.trigger(x.extend(s[0],x.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Y.get(t,e)&&x.event.add(t,e,wt)}x.event={global:{},add:function(t,e,n,r,i){var o,s,a,l,u,c,h,p,d,f,g,v=Y.get(t);if(W(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&x.find.matchesSelector(rt,i),n.guid||(n.guid=x.guid++),(l=v.events)||(l=v.events=Object.create(null)),(s=v.handle)||(s=v.handle=function(e){return void 0!==x&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(z)||[""]).length;u--;)d=g=(a=xt.exec(e[u])||[])[1],f=(a[2]||"").split(".").sort(),d&&(h=x.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,h=x.event.special[d]||{},c=x.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&x.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=l[d])||((p=l[d]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,r,f,s)||t.addEventListener&&t.addEventListener(d,s)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),x.event.global[d]=!0)},remove:function(t,e,n,r,i){var o,s,a,l,u,c,h,p,d,f,g,v=Y.hasData(t)&&Y.get(t);if(v&&(l=v.events)){for(u=(e=(e||"").match(z)||[""]).length;u--;)if(d=g=(a=xt.exec(e[u])||[])[1],f=(a[2]||"").split(".").sort(),d){for(h=x.event.special[d]||{},p=l[d=(r?h.delegateType:h.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,h.remove&&h.remove.call(t,c));s&&!p.length&&(h.teardown&&!1!==h.teardown.call(t,f,v.handle)||x.removeEvent(t,d,v.handle),delete l[d])}else for(d in l)x.event.remove(t,d+e[u],n,r,!0);x.isEmptyObject(l)&&Y.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,s,a=new Array(arguments.length),l=x.event.fix(t),u=(Y.get(this,"events")||Object.create(null))[l.type]||[],c=x.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(s=x.event.handlers.call(this,l,u),e=0;(i=s[e++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,i,o,s,a=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[i=(r=e[n]).selector+" "]&&(s[i]=r.needsContext?x(i,this).index(u)>-1:x.find(i,this,null,[u]).length),s[i]&&o.push(r);o.length&&a.push({elem:u,handlers:o})}return u=this,l<e.length&&a.push({elem:u,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(x.Event.prototype,t,{enumerable:!0,configurable:!0,get:f(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[x.expando]?t:new x.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return dt.test(e.type)&&e.click&&S(e,"input")&&Mt(e,"click",wt),!1},trigger:function(t){var e=this||t;return dt.test(e.type)&&e.click&&S(e,"input")&&Mt(e,"click"),!0},_default:function(t){var e=t.target;return dt.test(e.type)&&e.click&&S(e,"input")&&Y.get(e,"click")||S(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},x.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},x.Event=function(t,e){if(!(this instanceof x.Event))return new x.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?wt:Pt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&x.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[x.expando]=!0},x.Event.prototype={constructor:x.Event,isDefaultPrevented:Pt,isPropagationStopped:Pt,isImmediatePropagationStopped:Pt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=wt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=wt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=wt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},x.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},x.event.addProp),x.each({focus:"focusin",blur:"focusout"},(function(t,e){x.event.special[t]={setup:function(){return Mt(this,t,At),!1},trigger:function(){return Mt(this,t),!0},_default:function(){return!0},delegateType:e}})),x.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){x.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return i&&(i===r||x.contains(r,i))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),x.fn.extend({on:function(t,e,n,r){return Et(this,t,e,n,r)},one:function(t,e,n,r){return Et(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,x(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Pt),this.each((function(){x.event.remove(this,t,n,e)}))}});var St=/<script|<style|<link/i,kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Tt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Dt(t,e){return S(t,"table")&&S(11!==e.nodeType?e:e.firstChild,"tr")&&x(t).children("tbody")[0]||t}function Nt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ot(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Lt(t,e){var n,r,i,o,s,a;if(1===e.nodeType){if(Y.hasData(t)&&(a=Y.get(t).events))for(i in Y.remove(e,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)x.event.add(e,i,a[i][n]);J.hasData(t)&&(o=J.access(t),s=x.extend({},o),J.set(e,s))}}function Ft(t,e){var n=e.nodeName.toLowerCase();"input"===n&&dt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function zt(t,e,n,r){e=o(e);var i,s,a,l,u,c,h=0,p=t.length,g=p-1,v=e[0],y=f(v);if(y||p>1&&"string"==typeof v&&!d.checkClone&&kt.test(v))return t.each((function(i){var o=t.eq(i);y&&(e[0]=v.call(this,i,o.html())),zt(o,e,n,r)}));if(p&&(s=(i=Ct(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(l=(a=x.map(yt(i,"script"),Nt)).length;h<p;h++)u=i,h!==g&&(u=x.clone(u,!0,!0),l&&x.merge(a,yt(u,"script"))),n.call(t[h],u,h);if(l)for(c=a[a.length-1].ownerDocument,x.map(a,Ot),h=0;h<l;h++)u=a[h],gt.test(u.type||"")&&!Y.access(u,"globalEval")&&x.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?x._evalUrl&&!u.noModule&&x._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):m(u.textContent.replace(Tt,""),u,c))}return t}function Bt(t,e,n){for(var r,i=e?x.filter(e,t):t,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||x.cleanData(yt(r)),r.parentNode&&(n&&it(r)&&mt(yt(r,"script")),r.parentNode.removeChild(r));return t}x.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,o,s,a=t.cloneNode(!0),l=it(t);if(!(d.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||x.isXMLDoc(t)))for(s=yt(a),r=0,i=(o=yt(t)).length;r<i;r++)Ft(o[r],s[r]);if(e)if(n)for(o=o||yt(t),s=s||yt(a),r=0,i=o.length;r<i;r++)Lt(o[r],s[r]);else Lt(t,a);return(s=yt(a,"script")).length>0&&mt(s,!l&&yt(t,"script")),a},cleanData:function(t){for(var e,n,r,i=x.event.special,o=0;void 0!==(n=t[o]);o++)if(W(n)){if(e=n[Y.expando]){if(e.events)for(r in e.events)i[r]?x.event.remove(n,r):x.removeEvent(n,r,e.handle);n[Y.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),x.fn.extend({detach:function(t){return Bt(this,t,!0)},remove:function(t){return Bt(this,t)},text:function(t){return G(this,(function(t){return void 0===t?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return zt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Dt(this,t).appendChild(t)}))},prepend:function(){return zt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Dt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return zt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return zt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(x.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return x.clone(this,t,e)}))},html:function(t){return G(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!St.test(t)&&!vt[(ft.exec(t)||["",""])[1].toLowerCase()]){t=x.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(x.cleanData(yt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return zt(this,arguments,(function(e){var n=this.parentNode;x.inArray(this,t)<0&&(x.cleanData(yt(this)),n&&n.replaceChild(e,this))}),t)}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){x.fn[t]=function(t){for(var n,r=[],i=x(t),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),x(i[a])[e](n),s.apply(r,n.get());return this.pushStack(r)}}));var Vt=new RegExp("^("+tt+")(?!px)[a-z%]+$","i"),jt=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},Rt=function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=o[i];return r},It=new RegExp(nt.join("|"),"i");function _t(t,e,n){var r,i,o,s,a=t.style;return(n=n||jt(t))&&(""!==(s=n.getPropertyValue(e)||n[e])||it(t)||(s=x.style(t,e)),!d.pixelBoxStyles()&&Vt.test(s)&&It.test(e)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function Gt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",rt.appendChild(u).appendChild(c);var e=t.getComputedStyle(c);r="1%"!==e.top,l=12===n(e.marginLeft),c.style.right="60%",s=36===n(e.right),i=36===n(e.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),rt.removeChild(u),c=null}}function n(t){return Math.round(parseFloat(t))}var r,i,o,s,a,l,u=v.createElement("div"),c=v.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,x.extend(d,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,n,r,i;return null==a&&(e=v.createElement("table"),n=v.createElement("tr"),r=v.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",rt.appendChild(e).appendChild(n).appendChild(r),i=t.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,rt.removeChild(e)),a}}))}();var Ht=["Webkit","Moz","ms"],Ut=v.createElement("div").style,qt={};function $t(t){var e=x.cssProps[t]||qt[t];return e||(t in Ut?t:qt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Ht.length;n--;)if((t=Ht[n]+e)in Ut)return t}(t)||t)}var Wt=/^(none|table(?!-c[ea]).+)/,Xt=/^--/,Yt={position:"absolute",visibility:"hidden",display:"block"},Jt={letterSpacing:"0",fontWeight:"400"};function Zt(t,e,n){var r=et.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function Kt(t,e,n,r,i,o){var s="width"===e?1:0,a=0,l=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=x.css(t,n+nt[s],!0,i)),r?("content"===n&&(l-=x.css(t,"padding"+nt[s],!0,i)),"margin"!==n&&(l-=x.css(t,"border"+nt[s]+"Width",!0,i))):(l+=x.css(t,"padding"+nt[s],!0,i),"padding"!==n?l+=x.css(t,"border"+nt[s]+"Width",!0,i):a+=x.css(t,"border"+nt[s]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))||0),l}function Qt(t,e,n){var r=jt(t),i=(!d.boxSizingReliable()||n)&&"border-box"===x.css(t,"boxSizing",!1,r),o=i,s=_t(t,e,r),a="offset"+e[0].toUpperCase()+e.slice(1);if(Vt.test(s)){if(!n)return s;s="auto"}return(!d.boxSizingReliable()&&i||!d.reliableTrDimensions()&&S(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===x.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===x.css(t,"boxSizing",!1,r),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+Kt(t,e,n||(i?"border":"content"),o,r,s)+"px"}function te(t,e,n,r,i){return new te.prototype.init(t,e,n,r,i)}x.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=_t(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,s,a=$(e),l=Xt.test(e),u=t.style;if(l||(e=$t(a)),s=x.cssHooks[e]||x.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(t,!1,r))?i:u[e];"string"===(o=typeof n)&&(i=et.exec(n))&&i[1]&&(n=at(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(x.cssNumber[a]?"":"px")),d.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,r))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,r){var i,o,s,a=$(e);return Xt.test(e)||(e=$t(a)),(s=x.cssHooks[e]||x.cssHooks[a])&&"get"in s&&(i=s.get(t,!0,n)),void 0===i&&(i=_t(t,e,r)),"normal"===i&&e in Jt&&(i=Jt[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),x.each(["height","width"],(function(t,e){x.cssHooks[e]={get:function(t,n,r){if(n)return!Wt.test(x.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?Qt(t,e,r):Rt(t,Yt,(function(){return Qt(t,e,r)}))},set:function(t,n,r){var i,o=jt(t),s=!d.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===x.css(t,"boxSizing",!1,o),l=r?Kt(t,e,r,a,o):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-Kt(t,e,"border",!1,o)-.5)),l&&(i=et.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=x.css(t,e)),Zt(0,n,l)}}})),x.cssHooks.marginLeft=Gt(d.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(_t(t,"marginLeft"))||t.getBoundingClientRect().left-Rt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(t,e){x.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+nt[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(x.cssHooks[t+e].set=Zt)})),x.fn.extend({css:function(t,e){return G(this,(function(t,e,n){var r,i,o={},s=0;if(Array.isArray(e)){for(r=jt(t),i=e.length;s<i;s++)o[e[s]]=x.css(t,e[s],!1,r);return o}return void 0!==n?x.style(t,e,n):x.css(t,e)}),t,e,arguments.length>1)}}),x.Tween=te,te.prototype={constructor:te,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||x.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var t=te.propHooks[this.prop];return t&&t.get?t.get(this):te.propHooks._default.get(this)},run:function(t){var e,n=te.propHooks[this.prop];return this.options.duration?this.pos=e=x.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):te.propHooks._default.set(this),this}},te.prototype.init.prototype=te.prototype,te.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=x.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){x.fx.step[t.prop]?x.fx.step[t.prop](t):1!==t.elem.nodeType||!x.cssHooks[t.prop]&&null==t.elem.style[$t(t.prop)]?t.elem[t.prop]=t.now:x.style(t.elem,t.prop,t.now+t.unit)}}},te.propHooks.scrollTop=te.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},x.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},x.fx=te.prototype.init,x.fx.step={};var ee,ne,re=/^(?:toggle|show|hide)$/,ie=/queueHooks$/;function oe(){ne&&(!1===v.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(oe):t.setTimeout(oe,x.fx.interval),x.fx.tick())}function se(){return t.setTimeout((function(){ee=void 0})),ee=Date.now()}function ae(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=nt[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function le(t,e,n){for(var r,i=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,e,t))return r}function ue(t,e,n){var r,i,o=0,s=ue.prefilters.length,a=x.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var e=ee||se(),n=Math.max(0,u.startTime+u.duration-e),r=1-(n/u.duration||0),o=0,s=u.tweens.length;o<s;o++)u.tweens[o].run(r);return a.notifyWith(t,[u,r,n]),r<1&&s?n:(s||a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:x.extend({},e),opts:x.extend(!0,{specialEasing:{},easing:x.easing._default},n),originalProperties:e,originalOptions:n,startTime:ee||se(),duration:n.duration,tweens:[],createTween:function(e,n){var r=x.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(r),r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),c=u.props;for(!function(t,e){var n,r,i,o,s;for(n in t)if(i=e[r=$(n)],o=t[n],Array.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),(s=x.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete t[r],o)n in t||(t[n]=o[n],e[n]=i);else e[r]=i}(c,u.opts.specialEasing);o<s;o++)if(r=ue.prefilters[o].call(u,t,c,u.opts))return f(r.stop)&&(x._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return x.map(c,le,u),f(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),x.fx.timer(x.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}x.Animation=x.extend(ue,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return at(n.elem,t,et.exec(e),n),n}]},tweener:function(t,e){f(t)?(e=t,t=["*"]):t=t.match(z);for(var n,r=0,i=t.length;r<i;r++)n=t[r],ue.tweeners[n]=ue.tweeners[n]||[],ue.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,i,o,s,a,l,u,c,h="width"in e||"height"in e,p=this,d={},f=t.style,g=t.nodeType&&st(t),v=Y.get(t,"fxshow");for(r in n.queue||(null==(s=x._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,p.always((function(){p.always((function(){s.unqueued--,x.queue(t,"fx").length||s.empty.fire()}))}))),e)if(i=e[r],re.test(i)){if(delete e[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||x.style(t,r)}if((l=!x.isEmptyObject(e))||!x.isEmptyObject(d))for(r in h&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(u=v&&v.display)&&(u=Y.get(t,"display")),"none"===(c=x.css(t,"display"))&&(u?c=u:(ct([t],!0),u=t.style.display||u,c=x.css(t,"display"),ct([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===x.css(t,"float")&&(l||(p.done((function(){f.display=u})),null==u&&(c=f.display,u="none"===c?"":c)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),l=!1,d)l||(v?"hidden"in v&&(g=v.hidden):v=Y.access(t,"fxshow",{display:u}),o&&(v.hidden=!g),g&&ct([t],!0),p.done((function(){for(r in g||ct([t]),Y.remove(t,"fxshow"),d)x.style(t,r,d[r])}))),l=le(g?v[r]:0,r,p),r in v||(v[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?ue.prefilters.unshift(t):ue.prefilters.push(t)}}),x.speed=function(t,e,n){var r=t&&"object"==typeof t?x.extend({},t):{complete:n||!n&&e||f(t)&&t,duration:t,easing:n&&e||e&&!f(e)&&e};return x.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in x.fx.speeds?r.duration=x.fx.speeds[r.duration]:r.duration=x.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){f(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.fn.extend({fadeTo:function(t,e,n,r){return this.filter(st).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=x.isEmptyObject(t),o=x.speed(e,n,r),s=function(){var e=ue(this,x.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,i=null!=t&&t+"queueHooks",o=x.timers,s=Y.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&ie.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));!e&&n||x.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=Y.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),x.each(["toggle","show","hide"],(function(t,e){var n=x.fn[e];x.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ae(e,!0),t,r,i)}})),x.each({slideDown:ae("show"),slideUp:ae("hide"),slideToggle:ae("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){x.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),x.timers=[],x.fx.tick=function(){var t,e=0,n=x.timers;for(ee=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||x.fx.stop(),ee=void 0},x.fx.timer=function(t){x.timers.push(t),x.fx.start()},x.fx.interval=13,x.fx.start=function(){ne||(ne=!0,oe())},x.fx.stop=function(){ne=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fn.delay=function(e,n){return e=x.fx&&x.fx.speeds[e]||e,n=n||"fx",this.queue(n,(function(n,r){var i=t.setTimeout(n,e);r.stop=function(){t.clearTimeout(i)}}))},function(){var t=v.createElement("input"),e=v.createElement("select").appendChild(v.createElement("option"));t.type="checkbox",d.checkOn=""!==t.value,d.optSelected=e.selected,(t=v.createElement("input")).value="t",t.type="radio",d.radioValue="t"===t.value}();var ce,he=x.expr.attrHandle;x.fn.extend({attr:function(t,e){return G(this,x.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){x.removeAttr(this,t)}))}}),x.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?x.prop(t,e,n):(1===o&&x.isXMLDoc(t)||(i=x.attrHooks[e.toLowerCase()]||(x.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void x.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=x.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!d.radioValue&&"radio"===e&&S(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(z);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?x.removeAttr(t,n):t.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=he[e]||x.find.attr;he[e]=function(t,e,r){var i,o,s=e.toLowerCase();return r||(o=he[s],he[s]=i,i=null!=n(t,e,r)?s:null,he[s]=o),i}}));var pe=/^(?:input|select|textarea|button)$/i,de=/^(?:a|area)$/i;function fe(t){return(t.match(z)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function ve(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(z)||[]}x.fn.extend({prop:function(t,e){return G(this,x.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[x.propFix[t]||t]}))}}),x.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&x.isXMLDoc(t)||(e=x.propFix[e]||e,i=x.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=x.find.attr(t,"tabindex");return e?parseInt(e,10):pe.test(t.nodeName)||de.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(x.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(t){var e,n,r,i,o,s,a,l=0;if(f(t))return this.each((function(e){x(this).addClass(t.call(this,e,ge(this)))}));if((e=ve(t)).length)for(;n=this[l++];)if(i=ge(n),r=1===n.nodeType&&" "+fe(i)+" "){for(s=0;o=e[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=fe(r))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,r,i,o,s,a,l=0;if(f(t))return this.each((function(e){x(this).removeClass(t.call(this,e,ge(this)))}));if(!arguments.length)return this.attr("class","");if((e=ve(t)).length)for(;n=this[l++];)if(i=ge(n),r=1===n.nodeType&&" "+fe(i)+" "){for(s=0;o=e[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=fe(r))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):f(t)?this.each((function(n){x(this).toggleClass(t.call(this,n,ge(this),e),e)})):this.each((function(){var e,i,o,s;if(r)for(i=0,o=x(this),s=ve(t);e=s[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ge(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+fe(ge(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;x.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=f(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,x(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=x.map(i,(function(t){return null==t?"":t+""}))),(e=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ye,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(t){var e=x.find.attr(t,"value");return null!=e?e:fe(x.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!S(n.parentNode,"optgroup"))){if(e=x(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,r,i=t.options,o=x.makeArray(e),s=i.length;s--;)((r=i[s]).selected=x.inArray(x.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=x.inArray(x(t).val(),e)>-1}},d.checkOn||(x.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),d.focusin="onfocusin"in t;var me=/^(?:focusinfocus|focusoutblur)$/,be=function(t){t.stopPropagation()};x.extend(x.event,{trigger:function(e,n,r,i){var o,s,a,l,u,h,p,d,y=[r||v],m=c.call(e,"type")?e.type:e,b=c.call(e,"namespace")?e.namespace.split("."):[];if(s=d=a=r=r||v,3!==r.nodeType&&8!==r.nodeType&&!me.test(m+x.event.triggered)&&(m.indexOf(".")>-1&&(b=m.split("."),m=b.shift(),b.sort()),u=m.indexOf(":")<0&&"on"+m,(e=e[x.expando]?e:new x.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=b.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:x.makeArray(n,[e]),p=x.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(l=p.delegateType||m,me.test(l+m)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(r.ownerDocument||v)&&y.push(a.defaultView||a.parentWindow||t)}for(o=0;(s=y[o++])&&!e.isPropagationStopped();)d=s,e.type=o>1?l:p.bindType||m,(h=(Y.get(s,"events")||Object.create(null))[e.type]&&Y.get(s,"handle"))&&h.apply(s,n),(h=u&&s[u])&&h.apply&&W(s)&&(e.result=h.apply(s,n),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(y.pop(),n)||!W(r)||u&&f(r[m])&&!g(r)&&((a=r[u])&&(r[u]=null),x.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,be),r[m](),e.isPropagationStopped()&&d.removeEventListener(m,be),x.event.triggered=void 0,a&&(r[u]=a)),e.result}},simulate:function(t,e,n){var r=x.extend(new x.Event,n,{type:t,isSimulated:!0});x.event.trigger(r,null,e)}}),x.fn.extend({trigger:function(t,e){return this.each((function(){x.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return x.event.trigger(t,e,n,!0)}}),d.focusin||x.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){x.event.simulate(e,t.target,x.event.fix(t))};x.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,e);i||r.addEventListener(t,n,!0),Y.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,e)-1;i?Y.access(r,e,i):(r.removeEventListener(t,n,!0),Y.remove(r,e))}}}));var Ce=t.location,xe={guid:Date.now()},we=/\?/;x.parseXML=function(e){var n,r;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||x.error("Invalid XML: "+(r?x.map(r.childNodes,(function(t){return t.textContent})).join("\n"):e)),n};var Pe=/\[\]$/,Ae=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Me=/^(?:input|select|textarea|keygen)/i;function Se(t,e,n,r){var i;if(Array.isArray(e))x.each(e,(function(e,i){n||Pe.test(t)?r(t,i):Se(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==b(e))r(t,e);else for(i in e)Se(t+"["+i+"]",e[i],n,r)}x.param=function(t,e){var n,r=[],i=function(t,e){var n=f(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!x.isPlainObject(t))x.each(t,(function(){i(this.name,this.value)}));else for(n in t)Se(n,t[n],e,i);return r.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=x.prop(this,"elements");return t?x.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!x(this).is(":disabled")&&Me.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!dt.test(t))})).map((function(t,e){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(t){return{name:e.name,value:t.replace(Ae,"\r\n")}})):{name:e.name,value:n.replace(Ae,"\r\n")}})).get()}});var ke=/%20/g,Te=/#.*$/,De=/([?&])_=[^&]*/,Ne=/^(.*?):[ \t]*([^\r\n]*)$/gm,Oe=/^(?:GET|HEAD)$/,Le=/^\/\//,Fe={},ze={},Be="*/".concat("*"),Ve=v.createElement("a");function je(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(z)||[];if(f(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Re(t,e,n,r){var i={},o=t===ze;function s(a){var l;return i[a]=!0,x.each(t[a]||[],(function(t,a){var u=a(e,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),s(u),!1)})),l}return s(e.dataTypes[0])||!i["*"]&&s("*")}function Ie(t,e){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&x.extend(!0,t,r),t}Ve.href=Ce.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Be,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ie(Ie(t,x.ajaxSettings),e):Ie(x.ajaxSettings,t)},ajaxPrefilter:je(Fe),ajaxTransport:je(ze),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,i,o,s,a,l,u,c,h,p,d=x.ajaxSetup({},n),f=d.context||d,g=d.context&&(f.nodeType||f.jquery)?x(f):x.event,y=x.Deferred(),m=x.Callbacks("once memory"),b=d.statusCode||{},C={},w={},P="canceled",A={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=Ne.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,C[t]=e),this},overrideMimeType:function(t){return null==u&&(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)A.always(t[A.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||P;return r&&r.abort(e),E(0,e),this}};if(y.promise(A),d.url=((e||d.url||Ce.href)+"").replace(Le,Ce.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(z)||[""],null==d.crossDomain){l=v.createElement("a");try{l.href=d.url,l.href=l.href,d.crossDomain=Ve.protocol+"//"+Ve.host!=l.protocol+"//"+l.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=x.param(d.data,d.traditional)),Re(Fe,d,n,A),u)return A;for(h in(c=x.event&&d.global)&&0==x.active++&&x.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Oe.test(d.type),i=d.url.replace(Te,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(ke,"+")):(p=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(we.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(De,"$1"),p=(we.test(i)?"&":"?")+"_="+xe.guid+++p),d.url=i+p),d.ifModified&&(x.lastModified[i]&&A.setRequestHeader("If-Modified-Since",x.lastModified[i]),x.etag[i]&&A.setRequestHeader("If-None-Match",x.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&A.setRequestHeader("Content-Type",d.contentType),A.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Be+"; q=0.01":""):d.accepts["*"]),d.headers)A.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(f,A,d)||u))return A.abort();if(P="abort",m.add(d.complete),A.done(d.success),A.fail(d.error),r=Re(ze,d,n,A)){if(A.readyState=1,c&&g.trigger("ajaxSend",[A,d]),u)return A;d.async&&d.timeout>0&&(a=t.setTimeout((function(){A.abort("timeout")}),d.timeout));try{u=!1,r.send(C,E)}catch(t){if(u)throw t;E(-1,t)}}else E(-1,"No Transport");function E(e,n,s,l){var h,p,v,C,w,P=n;u||(u=!0,a&&t.clearTimeout(a),r=void 0,o=l||"",A.readyState=e>0?4:0,h=e>=200&&e<300||304===e,s&&(C=function(t,e,n){for(var r,i,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(d,A,s)),!h&&x.inArray("script",d.dataTypes)>-1&&x.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),C=function(t,e,n,r){var i,o,s,a,l,u={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=u[l+" "+o]||u["* "+o]))for(i in u)if((a=i.split(" "))[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[i]:!0!==u[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(d,C,A,h),h?(d.ifModified&&((w=A.getResponseHeader("Last-Modified"))&&(x.lastModified[i]=w),(w=A.getResponseHeader("etag"))&&(x.etag[i]=w)),204===e||"HEAD"===d.type?P="nocontent":304===e?P="notmodified":(P=C.state,p=C.data,h=!(v=C.error))):(v=P,!e&&P||(P="error",e<0&&(e=0))),A.status=e,A.statusText=(n||P)+"",h?y.resolveWith(f,[p,P,A]):y.rejectWith(f,[A,P,v]),A.statusCode(b),b=void 0,c&&g.trigger(h?"ajaxSuccess":"ajaxError",[A,d,h?p:v]),m.fireWith(f,[A,P]),c&&(g.trigger("ajaxComplete",[A,d]),--x.active||x.event.trigger("ajaxStop")))}return A},getJSON:function(t,e,n){return x.get(t,e,n,"json")},getScript:function(t,e){return x.get(t,void 0,e,"script")}}),x.each(["get","post"],(function(t,e){x[e]=function(t,n,r,i){return f(n)&&(i=i||r,r=n,n=void 0),x.ajax(x.extend({url:t,type:e,dataType:i,data:n,success:r},x.isPlainObject(t)&&t))}})),x.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),x._evalUrl=function(t,e,n){return x.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){x.globalEval(t,e,n)}})},x.fn.extend({wrapAll:function(t){var e;return this[0]&&(f(t)&&(t=t.call(this[0])),e=x(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return f(t)?this.each((function(e){x(this).wrapInner(t.call(this,e))})):this.each((function(){var e=x(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=f(t);return this.each((function(n){x(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(t){return!x.expr.pseudos.visible(t)},x.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var _e={0:200,1223:204},Ge=x.ajaxSettings.xhr();d.cors=!!Ge&&"withCredentials"in Ge,d.ajax=Ge=!!Ge,x.ajaxTransport((function(e){var n,r;if(d.cors||Ge&&!e.crossDomain)return{send:function(i,o){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];for(s in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(t){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(_e[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout((function(){n&&r()}))},n=n("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}})),x.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return x.globalEval(t),t}}}),x.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),x.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=x("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),v.head.appendChild(e[0])},abort:function(){n&&n()}}}));var He,Ue=[],qe=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ue.pop()||x.expando+"_"+xe.guid++;return this[t]=!0,t}}),x.ajaxPrefilter("json jsonp",(function(e,n,r){var i,o,s,a=!1!==e.jsonp&&(qe.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&qe.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=f(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(qe,"$1"+i):!1!==e.jsonp&&(e.url+=(we.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){s=arguments},r.always((function(){void 0===o?x(t).removeProp(i):t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,Ue.push(i)),s&&f(o)&&o(s[0]),s=o=void 0})),"script"})),d.createHTMLDocument=((He=v.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===He.childNodes.length),x.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(d.createHTMLDocument?((r=(e=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,e.head.appendChild(r)):e=v),o=!n&&[],(i=k.exec(t))?[e.createElement(i[1])]:(i=Ct([t],e,o),o&&o.length&&x(o).remove(),x.merge([],i.childNodes)));var r,i,o},x.fn.load=function(t,e,n){var r,i,o,s=this,a=t.indexOf(" ");return a>-1&&(r=fe(t.slice(a)),t=t.slice(0,a)),f(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),s.length>0&&x.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done((function(t){o=arguments,s.html(r?x("<div>").append(x.parseHTML(t)).find(r):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},x.expr.pseudos.animated=function(t){return x.grep(x.timers,(function(e){return t===e.elem})).length},x.offset={setOffset:function(t,e,n){var r,i,o,s,a,l,u=x.css(t,"position"),c=x(t),h={};"static"===u&&(t.style.position="relative"),a=c.offset(),o=x.css(t,"top"),l=x.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),f(e)&&(e=e.call(t,n,x.extend({},a))),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+i),"using"in e?e.using.call(t,h):c.css(h)}},x.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){x.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===x.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===x.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((i=x(t).offset()).top+=x.css(t,"borderTopWidth",!0),i.left+=x.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-x.css(r,"marginTop",!0),left:e.left-i.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===x.css(t,"position");)t=t.offsetParent;return t||rt}))}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;x.fn[t]=function(r){return G(this,(function(t,r,i){var o;if(g(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===i)return o?o[e]:t[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):t[r]=i}),t,r,arguments.length)}})),x.each(["top","left"],(function(t,e){x.cssHooks[e]=Gt(d.pixelPosition,(function(t,n){if(n)return n=_t(t,e),Vt.test(n)?x(t).position()[e]+"px":n}))})),x.each({Height:"height",Width:"width"},(function(t,e){x.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){x.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return G(this,(function(e,n,i){var o;return g(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?x.css(e,n,a):x.style(e,n,i,a)}),e,s?i:void 0,s)}}))})),x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){x.fn[e]=function(t){return this.on(e,t)}})),x.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),x.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){x.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var $e=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;x.proxy=function(t,e){var n,r,o;if("string"==typeof e&&(n=t[e],e=t,t=n),f(t))return r=i.call(arguments,2),(o=function(){return t.apply(e||this,r.concat(i.call(arguments)))}).guid=t.guid=t.guid||x.guid++,o},x.holdReady=function(t){t?x.readyWait++:x.ready(!0)},x.isArray=Array.isArray,x.parseJSON=JSON.parse,x.nodeName=S,x.isFunction=f,x.isWindow=g,x.camelCase=$,x.type=b,x.now=Date.now,x.isNumeric=function(t){var e=x.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},x.trim=function(t){return null==t?"":(t+"").replace($e,"")};var We=t.jQuery,Xe=t.$;return x.noConflict=function(e){return t.$===x&&(t.$=Xe),e&&t.jQuery===x&&(t.jQuery=We),x},void 0===e&&(t.jQuery=t.$=x),x}))}(l);var u=l.exports;
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
!function(t,e){t.exports=function(t){var e,n,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(t.event.fixHooks)for(var s=r.length;s;)t.event.fixHooks[r[--s]]=t.event.mouseHooks;var a=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=i.length;e;)this.addEventListener(i[--e],l,!1);else this.onmousewheel=l;t.data(this,"mousewheel-line-height",a.getLineHeight(this)),t.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=i.length;e;)this.removeEventListener(i[--e],l,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),r=n["offsetParent"in t.fn?"offsetParent":"parent"]();return r.length||(r=t("body")),parseInt(r.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(r){var i=r||window.event,s=o.call(arguments,1),l=0,h=0,p=0,d=0,f=0,g=0;if((r=t.event.fix(i)).type="mousewheel","detail"in i&&(p=-1*i.detail),"wheelDelta"in i&&(p=i.wheelDelta),"wheelDeltaY"in i&&(p=i.wheelDeltaY),"wheelDeltaX"in i&&(h=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(h=-1*p,p=0),l=0===p?h:p,"deltaY"in i&&(l=p=-1*i.deltaY),"deltaX"in i&&(h=i.deltaX,0===p&&(l=-1*h)),0!==p||0!==h){if(1===i.deltaMode){var v=t.data(this,"mousewheel-line-height");l*=v,p*=v,h*=v}else if(2===i.deltaMode){var y=t.data(this,"mousewheel-page-height");l*=y,p*=y,h*=y}if(d=Math.max(Math.abs(p),Math.abs(h)),(!n||d<n)&&(n=d,c(i,d)&&(n/=40)),c(i,d)&&(l/=40,h/=40,p/=40),l=Math[l>=1?"floor":"ceil"](l/n),h=Math[h>=1?"floor":"ceil"](h/n),p=Math[p>=1?"floor":"ceil"](p/n),a.settings.normalizeOffset&&this.getBoundingClientRect){var m=this.getBoundingClientRect();f=r.clientX-m.left,g=r.clientY-m.top}return r.deltaX=h,r.deltaY=p,r.deltaFactor=n,r.offsetX=f,r.offsetY=g,r.deltaMode=0,s.unshift(r,l,h,p),e&&clearTimeout(e),e=setTimeout(u,200),(t.event.dispatch||t.event.handle).apply(this,s)}}function u(){n=null}function c(t,e){return a.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120==0}t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}}({exports:{}});var c=navigator.userAgent;if(t.Platform=void 0,function(t){t.IS_MAC=navigator.appVersion.indexOf("Mac")>0,t.IS_IOS=!!c.match(/(iPad|iPhone|iPod)/g),t.IS_WINDOWS=navigator.appVersion.indexOf("Win")>0,t.IS_IE=c.indexOf("MSIE")>=0,t.IS_IE11=!!c.match(/Trident\/7\./),t.IS_EDGE=!!c.match(/Edge\//),t.IS_NETSCAPE=c.indexOf("Mozilla/")>=0&&c.indexOf("MSIE")<0&&c.indexOf("Edge/")<0,t.IS_CHROME_APP=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,t.IS_CHROME=c.indexOf("Chrome/")>=0&&c.indexOf("Edge/")<0,t.IS_OPERA=c.indexOf("Opera/")>=0||c.indexOf("OPR/")>=0,t.IS_FIREFOX=c.indexOf("Firefox/")>=0,t.IS_SAFARI=c.indexOf("AppleWebKit/")>=0&&c.indexOf("Chrome/")<0&&c.indexOf("Edge/")<0,t.SUPPORT_TOUCH="ontouchstart"in document.documentElement,t.SUPPORT_POINTER=null!=window.PointerEvent&&!t.IS_MAC,t.SUPPORT_PASSIVE=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t.SUPPORT_PASSIVE=!0}}),n=document.createElement("div");n.addEventListener&&n.addEventListener("click",(function(){}),e)}catch(t){}t.NO_FOREIGNOBJECT=!document.createElementNS||""+document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||c.indexOf("Opera/")>=0,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(t.Platform||(t.Platform={})),function(t){function e(){var t=window.module;return null!=t&&null!=t.hot&&null!=t.hot.status?t.hot.status():"unkonwn"}t.getHMRStatus=e,t.isApplyingHMR=function(){return"apply"===e()};var n={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};t.isEventSupported=function(t){var e=document.createElement(n[t]||"div"),r="on"+t,i=r in e;return i||(e.setAttribute(r,"return;"),i="function"==typeof e[r]),i}}(t.Platform||(t.Platform={})),t.Platform.SUPPORT_PASSIVE){u.event.special.touchstart={setup:function(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};var h=u.event.special.mousewheel;if(h){var p=h.setup;h.setup=function(){var t=this,e=this.addEventListener;if(!e)return!1;this.addEventListener=function(n,r){e.call(t,n,r,{passive:!0})},p.call(this),this.addEventListener=e}}}window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(t){Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=document.createDocumentFragment();t.forEach((function(t){var e=t instanceof Node;n.appendChild(e?t:document.createTextNode(String(t)))})),this.appendChild(n)}})}));var d="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,g=d||f||Function("return this")(),v=g.Symbol,y=Object.prototype,m=y.hasOwnProperty,b=y.toString,C=v?v.toStringTag:void 0;var x=Object.prototype.toString;var w=v?v.toStringTag:void 0;function P(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":w&&w in Object(t)?function(t){var e=m.call(t,C),n=t[C];try{t[C]=void 0;var r=!0}catch(t){}var i=b.call(t);return r&&(e?t[C]=n:delete t[C]),i}(t):function(t){return x.call(t)}(t)}function A(t){return null!=t&&"object"==typeof t}function E(t){return"symbol"==typeof t||A(t)&&"[object Symbol]"==P(t)}function M(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var S=Array.isArray,k=v?v.prototype:void 0,T=k?k.toString:void 0;function D(t){if("string"==typeof t)return t;if(S(t))return M(t,D)+"";if(E(t))return T?T.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}var N=/\s/;var O=/^\s+/;function L(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&N.test(t.charAt(e)););return e}(t)+1).replace(O,""):t}function F(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var z=/^[-+]0x[0-9a-f]+$/i,B=/^0b[01]+$/i,V=/^0o[0-7]+$/i,j=parseInt;function R(t){if("number"==typeof t)return t;if(E(t))return NaN;if(F(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=F(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=L(t);var n=B.test(t);return n||V.test(t)?j(t.slice(2),n?2:8):z.test(t)?NaN:+t}var I=1/0;function _(t){return t?(t=R(t))===I||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function G(t){var e=_(t),n=e%1;return e==e?n?e-n:e:0}function H(t){return t}function U(t){if(!F(t))return!1;var e=P(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var q,$=g["__core-js_shared__"],W=(q=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var X=Function.prototype.toString;function Y(t){if(null!=t){try{return X.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var J=/^\[object .+?Constructor\]$/,Z=Function.prototype,K=Object.prototype,Q=Z.toString,tt=K.hasOwnProperty,et=RegExp("^"+Q.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nt(t){return!(!F(t)||(e=t,W&&W in e))&&(U(t)?et:J).test(Y(t));var e}function rt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return nt(n)?n:void 0}var it=rt(g,"WeakMap"),ot=Object.create,st=function(){function t(){}return function(e){if(!F(e))return{};if(ot)return ot(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function at(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function lt(){}function ut(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var ct=Date.now;var ht,pt,dt,ft=function(){try{var t=rt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),gt=(ht=ft?function(t,e){return ft(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:H,pt=0,dt=0,function(){var t=ct(),e=16-(t-dt);if(dt=t,e>0){if(++pt>=800)return arguments[0]}else pt=0;return ht.apply(void 0,arguments)});function vt(t){return t!=t}function yt(t,e){return!!(null==t?0:t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,vt,n)}(t,e,0)>-1}var mt=/^(?:0|[1-9]\d*)$/;function bt(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function Ct(t,e,n){"__proto__"==e&&ft?ft(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function xt(t,e){return t===e||t!=t&&e!=e}var wt=Object.prototype.hasOwnProperty;function Pt(t,e,n){var r=t[e];wt.call(t,e)&&xt(r,n)&&(void 0!==n||e in t)||Ct(t,e,n)}function At(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=r?r(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?Ct(n,a,l):Pt(n,a,l)}return n}var Et=Math.max;function Mt(t,e,n){return e=Et(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Et(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(s),at(t,this,a)}}function St(t,e){return gt(Mt(t,e,H),t+"")}function kt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Tt(t){return null!=t&&kt(t.length)&&!U(t)}function Dt(t,e,n){if(!F(n))return!1;var r=typeof e;return!!("number"==r?Tt(n)&&bt(e,n.length):"string"==r&&e in n)&&xt(n[e],t)}function Nt(t){return St((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&Dt(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e}))}var Ot=Object.prototype;function Lt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ot)}function Ft(t){return A(t)&&"[object Arguments]"==P(t)}var zt=Object.prototype,Bt=zt.hasOwnProperty,Vt=zt.propertyIsEnumerable,jt=Ft(function(){return arguments}())?Ft:function(t){return A(t)&&Bt.call(t,"callee")&&!Vt.call(t,"callee")};var Rt="object"==typeof t&&t&&!t.nodeType&&t,It=Rt&&"object"==typeof module&&module&&!module.nodeType&&module,_t=It&&It.exports===Rt?g.Buffer:void 0,Gt=(_t?_t.isBuffer:void 0)||function(){return!1},Ht={};function Ut(t){return function(e){return t(e)}}Ht["[object Float32Array]"]=Ht["[object Float64Array]"]=Ht["[object Int8Array]"]=Ht["[object Int16Array]"]=Ht["[object Int32Array]"]=Ht["[object Uint8Array]"]=Ht["[object Uint8ClampedArray]"]=Ht["[object Uint16Array]"]=Ht["[object Uint32Array]"]=!0,Ht["[object Arguments]"]=Ht["[object Array]"]=Ht["[object ArrayBuffer]"]=Ht["[object Boolean]"]=Ht["[object DataView]"]=Ht["[object Date]"]=Ht["[object Error]"]=Ht["[object Function]"]=Ht["[object Map]"]=Ht["[object Number]"]=Ht["[object Object]"]=Ht["[object RegExp]"]=Ht["[object Set]"]=Ht["[object String]"]=Ht["[object WeakMap]"]=!1;var qt="object"==typeof t&&t&&!t.nodeType&&t,$t=qt&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=$t&&$t.exports===qt&&d.process,Xt=function(){try{var t=$t&&$t.require&&$t.require("util").types;return t||Wt&&Wt.binding&&Wt.binding("util")}catch(t){}}(),Yt=Xt&&Xt.isTypedArray,Jt=Yt?Ut(Yt):function(t){return A(t)&&kt(t.length)&&!!Ht[P(t)]},Zt=Object.prototype.hasOwnProperty;function Kt(t,e){var n=S(t),r=!n&&jt(t),i=!n&&!r&&Gt(t),o=!n&&!r&&!i&&Jt(t),s=n||r||i||o,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],l=a.length;for(var u in t)!e&&!Zt.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||bt(u,l))||a.push(u);return a}function Qt(t,e){return function(n){return t(e(n))}}var te=Qt(Object.keys,Object),ee=Object.prototype.hasOwnProperty;function ne(t){if(!Lt(t))return te(t);var e=[];for(var n in Object(t))ee.call(t,n)&&"constructor"!=n&&e.push(n);return e}function re(t){return Tt(t)?Kt(t):ne(t)}var ie=Object.prototype.hasOwnProperty;function oe(t){if(!F(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Lt(t),n=[];for(var r in t)("constructor"!=r||!e&&ie.call(t,r))&&n.push(r);return n}function se(t){return Tt(t)?Kt(t,!0):oe(t)}var ae=Nt((function(t,e){At(e,se(e),t)})),le=Nt((function(t,e,n,r){At(e,se(e),t,r)})),ue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ce=/^\w*$/;function he(t,e){if(S(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!E(t))||(ce.test(t)||!ue.test(t)||null!=e&&t in Object(e))}var pe=rt(Object,"create");var de=Object.prototype.hasOwnProperty;var fe=Object.prototype.hasOwnProperty;function ge(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ve(t,e){for(var n=t.length;n--;)if(xt(t[n][0],e))return n;return-1}ge.prototype.clear=function(){this.__data__=pe?pe(null):{},this.size=0},ge.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ge.prototype.get=function(t){var e=this.__data__;if(pe){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return de.call(e,t)?e[t]:void 0},ge.prototype.has=function(t){var e=this.__data__;return pe?void 0!==e[t]:fe.call(e,t)},ge.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=pe&&void 0===e?"__lodash_hash_undefined__":e,this};var ye=Array.prototype.splice;function me(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}me.prototype.clear=function(){this.__data__=[],this.size=0},me.prototype.delete=function(t){var e=this.__data__,n=ve(e,t);return!(n<0)&&(n==e.length-1?e.pop():ye.call(e,n,1),--this.size,!0)},me.prototype.get=function(t){var e=this.__data__,n=ve(e,t);return n<0?void 0:e[n][1]},me.prototype.has=function(t){return ve(this.__data__,t)>-1},me.prototype.set=function(t,e){var n=this.__data__,r=ve(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var be=rt(g,"Map");function Ce(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function xe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xe.prototype.clear=function(){this.size=0,this.__data__={hash:new ge,map:new(be||me),string:new ge}},xe.prototype.delete=function(t){var e=Ce(this,t).delete(t);return this.size-=e?1:0,e},xe.prototype.get=function(t){return Ce(this,t).get(t)},xe.prototype.has=function(t){return Ce(this,t).has(t)},xe.prototype.set=function(t,e){var n=Ce(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function we(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(we.Cache||xe),n}we.Cache=xe;var Pe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/\\(\\)?/g,Ee=function(t){var e=we(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Pe,(function(t,n,r,i){e.push(r?i.replace(Ae,"$1"):n||t)})),e}));function Me(t){return null==t?"":D(t)}function Se(t,e){return S(t)?t:he(t,e)?[t]:Ee(Me(t))}function ke(t){if("string"==typeof t||E(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Te(t,e){for(var n=0,r=(e=Se(e,t)).length;null!=t&&n<r;)t=t[ke(e[n++])];return n&&n==r?t:void 0}function De(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Ne=v?v.isConcatSpreadable:void 0;function Oe(t){return S(t)||jt(t)||!!(Ne&&t&&t[Ne])}function Le(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=Oe),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?Le(a,e-1,n,r,i):De(i,a):r||(i[i.length]=a)}return i}function Fe(t){return(null==t?0:t.length)?Le(t,1):[]}var ze=Qt(Object.getPrototypeOf,Object),Be=Function.prototype,Ve=Object.prototype,je=Be.toString,Re=Ve.hasOwnProperty,Ie=je.call(Object);function _e(t){if(!A(t)||"[object Object]"!=P(t))return!1;var e=ze(t);if(null===e)return!0;var n=Re.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&je.call(n)==Ie}function Ge(t){if(!A(t))return!1;var e=P(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!_e(t)}var He=St((function(t,e){try{return at(t,void 0,e)}catch(t){return Ge(t)?t:new Error(t)}}));function Ue(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(t,e,n)}var qe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function $e(t){return qe.test(t)}var We="[\\ud800-\\udfff]",Xe="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ye="\\ud83c[\\udffb-\\udfff]",Je="[^\\ud800-\\udfff]",Ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ke="[\\ud800-\\udbff][\\udc00-\\udfff]",Qe="(?:"+Xe+"|"+Ye+")"+"?",tn="[\\ufe0e\\ufe0f]?",en=tn+Qe+("(?:\\u200d(?:"+[Je,Ze,Ke].join("|")+")"+tn+Qe+")*"),nn="(?:"+[Je+Xe+"?",Xe,Ze,Ke,We].join("|")+")",rn=RegExp(Ye+"(?="+Ye+")|"+nn+en,"g");function on(t){return $e(t)?function(t){return t.match(rn)||[]}(t):function(t){return t.split("")}(t)}function sn(t){return function(e){var n=$e(e=Me(e))?on(e):void 0,r=n?n[0]:e.charAt(0),i=n?Ue(n,1).join(""):e.slice(1);return r[t]()+i}}var an=sn("toUpperCase");function ln(t){return function(e){return null==t?void 0:t[e]}}var un=ln({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),cn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var pn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var dn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var fn="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",vn="A-Z\\xc0-\\xd6\\xd8-\\xde",yn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mn="["+yn+"]",bn="\\d+",Cn="[\\u2700-\\u27bf]",xn="["+gn+"]",wn="[^\\ud800-\\udfff"+yn+bn+fn+gn+vn+"]",Pn="(?:\\ud83c[\\udde6-\\uddff]){2}",An="[\\ud800-\\udbff][\\udc00-\\udfff]",En="["+vn+"]",Mn="(?:"+xn+"|"+wn+")",Sn="(?:"+En+"|"+wn+")",kn="(?:['](?:d|ll|m|re|s|t|ve))?",Tn="(?:['](?:D|LL|M|RE|S|T|VE))?",Dn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Nn="[\\ufe0e\\ufe0f]?",On=Nn+Dn+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",Pn,An].join("|")+")"+Nn+Dn+")*"),Ln="(?:"+[Cn,Pn,An].join("|")+")"+On,Fn=RegExp([En+"?"+xn+"+"+kn+"(?="+[mn,En,"$"].join("|")+")",Sn+"+"+Tn+"(?="+[mn,En+Mn,"$"].join("|")+")",En+"?"+Mn+"+"+kn,En+"+"+Tn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bn,Ln].join("|"),"g");function zn(t,e,n){return t=Me(t),void 0===(e=n?void 0:e)?function(t){return dn.test(t)}(t)?function(t){return t.match(Fn)||[]}(t):function(t){return t.match(pn)||[]}(t):t.match(e)||[]}var Bn=RegExp("[']","g");function Vn(t){return function(e){return function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}(zn(function(t){return(t=Me(t))&&t.replace(cn,un).replace(hn,"")}(e).replace(Bn,"")),t,"")}}var jn=Vn((function(t,e,n){return e=e.toLowerCase(),t+(n?function(t){return an(Me(t).toLowerCase())}(e):e)}));function Rn(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function In(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=R(n))==n?n:0),void 0!==e&&(e=(e=R(e))==e?e:0),Rn(R(t),e,n)}function _n(t){var e=this.__data__=new me(t);this.size=e.size}_n.prototype.clear=function(){this.__data__=new me,this.size=0},_n.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},_n.prototype.get=function(t){return this.__data__.get(t)},_n.prototype.has=function(t){return this.__data__.has(t)},_n.prototype.set=function(t,e){var n=this.__data__;if(n instanceof me){var r=n.__data__;if(!be||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new xe(r)}return n.set(t,e),this.size=n.size,this};var Gn="object"==typeof t&&t&&!t.nodeType&&t,Hn=Gn&&"object"==typeof module&&module&&!module.nodeType&&module,Un=Hn&&Hn.exports===Gn?g.Buffer:void 0,qn=Un?Un.allocUnsafe:void 0;function $n(t,e){if(e)return t.slice();var n=t.length,r=qn?qn(n):new t.constructor(n);return t.copy(r),r}function Wn(){return[]}var Xn=Object.prototype.propertyIsEnumerable,Yn=Object.getOwnPropertySymbols,Jn=Yn?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(Yn(t),(function(e){return Xn.call(t,e)})))}:Wn;var Zn=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)De(e,Jn(t)),t=ze(t);return e}:Wn;function Kn(t,e,n){var r=e(t);return S(t)?r:De(r,n(t))}function Qn(t){return Kn(t,re,Jn)}function tr(t){return Kn(t,se,Zn)}var er=rt(g,"DataView"),nr=rt(g,"Promise"),rr=rt(g,"Set"),ir="[object Map]",or="[object Promise]",sr="[object Set]",ar="[object WeakMap]",lr="[object DataView]",ur=Y(er),cr=Y(be),hr=Y(nr),pr=Y(rr),dr=Y(it),fr=P;(er&&fr(new er(new ArrayBuffer(1)))!=lr||be&&fr(new be)!=ir||nr&&fr(nr.resolve())!=or||rr&&fr(new rr)!=sr||it&&fr(new it)!=ar)&&(fr=function(t){var e=P(t),n="[object Object]"==e?t.constructor:void 0,r=n?Y(n):"";if(r)switch(r){case ur:return lr;case cr:return ir;case hr:return or;case pr:return sr;case dr:return ar}return e});var gr=fr,vr=Object.prototype.hasOwnProperty;var yr=g.Uint8Array;function mr(t){var e=new t.constructor(t.byteLength);return new yr(e).set(new yr(t)),e}var br=/\w*$/;var Cr=v?v.prototype:void 0,xr=Cr?Cr.valueOf:void 0;function wr(t,e){var n=e?mr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Pr(t,e,n){var r,i,o,s=t.constructor;switch(e){case"[object ArrayBuffer]":return mr(t);case"[object Boolean]":case"[object Date]":return new s(+t);case"[object DataView]":return function(t,e){var n=e?mr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return wr(t,n);case"[object Map]":return new s;case"[object Number]":case"[object String]":return new s(t);case"[object RegExp]":return(o=new(i=t).constructor(i.source,br.exec(i))).lastIndex=i.lastIndex,o;case"[object Set]":return new s;case"[object Symbol]":return r=t,xr?Object(xr.call(r)):{}}}function Ar(t){return"function"!=typeof t.constructor||Lt(t)?{}:st(ze(t))}var Er=Xt&&Xt.isMap,Mr=Er?Ut(Er):function(t){return A(t)&&"[object Map]"==gr(t)};var Sr=Xt&&Xt.isSet,kr=Sr?Ut(Sr):function(t){return A(t)&&"[object Set]"==gr(t)},Tr="[object Arguments]",Dr="[object Function]",Nr="[object Object]",Or={};function Lr(t,e,n,r,i,o){var s,a=1&e,l=2&e,u=4&e;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!F(t))return t;var c=S(t);if(c){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&vr.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!a)return ut(t,s)}else{var h=gr(t),p=h==Dr||"[object GeneratorFunction]"==h;if(Gt(t))return $n(t,a);if(h==Nr||h==Tr||p&&!i){if(s=l||p?{}:Ar(t),!a)return l?function(t,e){return At(t,Zn(t),e)}(t,function(t,e){return t&&At(e,se(e),t)}(s,t)):function(t,e){return At(t,Jn(t),e)}(t,function(t,e){return t&&At(e,re(e),t)}(s,t))}else{if(!Or[h])return i?t:{};s=Pr(t,h,a)}}o||(o=new _n);var d=o.get(t);if(d)return d;o.set(t,s),kr(t)?t.forEach((function(r){s.add(Lr(r,e,n,r,t,o))})):Mr(t)&&t.forEach((function(r,i){s.set(i,Lr(r,e,n,i,t,o))}));var f=c?void 0:(u?l?tr:Qn:l?se:re)(t);return function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););}(f||t,(function(r,i){f&&(r=t[i=r]),Pt(s,i,Lr(r,e,n,i,t,o))})),s}Or[Tr]=Or["[object Array]"]=Or["[object ArrayBuffer]"]=Or["[object DataView]"]=Or["[object Boolean]"]=Or["[object Date]"]=Or["[object Float32Array]"]=Or["[object Float64Array]"]=Or["[object Int8Array]"]=Or["[object Int16Array]"]=Or["[object Int32Array]"]=Or["[object Map]"]=Or["[object Number]"]=Or[Nr]=Or["[object RegExp]"]=Or["[object Set]"]=Or["[object String]"]=Or["[object Symbol]"]=Or["[object Uint8Array]"]=Or["[object Uint8ClampedArray]"]=Or["[object Uint16Array]"]=Or["[object Uint32Array]"]=!0,Or["[object Error]"]=Or[Dr]=Or["[object WeakMap]"]=!1;function Fr(t){return Lr(t,4)}function zr(t){return Lr(t,5)}function Br(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new xe;++e<n;)this.add(t[e])}function Vr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function jr(t,e){return t.has(e)}Br.prototype.add=Br.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Br.prototype.has=function(t){return this.__data__.has(t)};function Rr(t,e,n,r,i,o){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var h=-1,p=!0,d=2&n?new Br:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var f=t[h],g=e[h];if(r)var v=s?r(g,f,h,e,t,o):r(f,g,h,t,e,o);if(void 0!==v){if(v)continue;p=!1;break}if(d){if(!Vr(e,(function(t,e){if(!jr(d,e)&&(f===t||i(f,t,n,r,o)))return d.push(e)}))){p=!1;break}}else if(f!==g&&!i(f,g,n,r,o)){p=!1;break}}return o.delete(t),o.delete(e),p}function Ir(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function _r(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Gr=v?v.prototype:void 0,Hr=Gr?Gr.valueOf:void 0;var Ur=Object.prototype.hasOwnProperty;var qr="[object Arguments]",$r="[object Array]",Wr="[object Object]",Xr=Object.prototype.hasOwnProperty;function Yr(t,e,n,r,i,o){var s=S(t),a=S(e),l=s?$r:gr(t),u=a?$r:gr(e),c=(l=l==qr?Wr:l)==Wr,h=(u=u==qr?Wr:u)==Wr,p=l==u;if(p&&Gt(t)){if(!Gt(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new _n),s||Jt(t)?Rr(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new yr(t),new yr(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Ir;case"[object Set]":var l=1&r;if(a||(a=_r),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var c=Rr(a(t),a(e),r,i,o,s);return s.delete(t),c;case"[object Symbol]":if(Hr)return Hr.call(t)==Hr.call(e)}return!1}(t,e,l,n,r,i,o);if(!(1&n)){var d=c&&Xr.call(t,"__wrapped__"),f=h&&Xr.call(e,"__wrapped__");if(d||f){var g=d?t.value():t,v=f?e.value():e;return o||(o=new _n),i(g,v,n,r,o)}}return!!p&&(o||(o=new _n),function(t,e,n,r,i,o){var s=1&n,a=Qn(t),l=a.length;if(l!=Qn(e).length&&!s)return!1;for(var u=l;u--;){var c=a[u];if(!(s?c in e:Ur.call(e,c)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var d=!0;o.set(t,e),o.set(e,t);for(var f=s;++u<l;){var g=t[c=a[u]],v=e[c];if(r)var y=s?r(v,g,c,e,t,o):r(g,v,c,t,e,o);if(!(void 0===y?g===v||i(g,v,n,r,o):y)){d=!1;break}f||(f="constructor"==c)}if(d&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o))}function Jr(t,e,n,r,i){return t===e||(null==t||null==e||!A(t)&&!A(e)?t!=t&&e!=e:Yr(t,e,n,r,Jr,i))}function Zr(t){return t==t&&!F(t)}function Kr(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function Qr(t){var e=function(t){for(var e=re(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Zr(i)]}return e}(t);return 1==e.length&&e[0][2]?Kr(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var l=(a=n[i])[0],u=t[l],c=a[1];if(s&&a[2]){if(void 0===u&&!(l in t))return!1}else{var h=new _n;if(r)var p=r(u,c,l,t,e,h);if(!(void 0===p?Jr(c,u,3,r,h):p))return!1}}return!0}(n,t,e)}}function ti(t,e){return null!=t&&e in Object(t)}function ei(t,e,n){for(var r=-1,i=(e=Se(e,t)).length,o=!1;++r<i;){var s=ke(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&kt(i)&&bt(s,i)&&(S(t)||jt(t))}function ni(t,e){return null!=t&&ei(t,e,ti)}function ri(t,e){return he(t)&&Zr(e)?Kr(ke(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:Te(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?ni(n,t):Jr(e,r,3)}}function ii(t){return function(e){return null==e?void 0:e[t]}}function oi(t){return he(t)?ii(ke(t)):function(t){return function(e){return Te(e,t)}}(t)}function si(t){return"function"==typeof t?t:null==t?H:"object"==typeof t?S(t)?ri(t[0],t[1]):Qr(t):oi(t)}function ai(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}var li,ui=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var a=o[li?s:++r];if(!1===e(i[a],a,i))break}return t};var ci=function(t,e){return function(n,r){if(null==n)return n;if(!Tt(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}((function(t,e){return t&&ui(t,e,re)}));function hi(t,e,n,r){return ci(t,(function(t,i,o){e(r,t,n(t),o)})),r}var pi=function(){return g.Date.now()},di=Math.max,fi=Math.min;function gi(t,e,n){var r,i,o,s,a,l,u=0,c=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=r,o=i;return r=i=void 0,u=e,s=t.apply(o,n)}function f(t){return u=t,a=setTimeout(v,e),c?d(t):s}function g(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-u>=o}function v(){var t=pi();if(g(t))return y(t);a=setTimeout(v,function(t){var n=e-(t-l);return h?fi(n,o-(t-u)):n}(t))}function y(t){return a=void 0,p&&r?d(t):(r=i=void 0,s)}function m(){var t=pi(),n=g(t);if(r=arguments,i=this,l=t,n){if(void 0===a)return f(l);if(h)return clearTimeout(a),a=setTimeout(v,e),d(l)}return void 0===a&&(a=setTimeout(v,e)),s}return e=R(e)||0,F(n)&&(c=!!n.leading,o=(h="maxWait"in n)?di(R(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p),m.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},m.flush=function(){return void 0===a?s:y(pi())},m}var vi=Object.prototype,yi=vi.hasOwnProperty,mi=St((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Dt(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=se(o),a=-1,l=s.length;++a<l;){var u=s[a],c=t[u];(void 0===c||xt(c,vi[u])&&!yi.call(t,u))&&(t[u]=o[u])}return t}));function bi(t,e,n){(void 0!==n&&!xt(t[e],n)||void 0===n&&!(e in t))&&Ct(t,e,n)}function Ci(t){return A(t)&&Tt(t)}function xi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function wi(t,e,n,r,i,o,s){var a=xi(t,n),l=xi(e,n),u=s.get(l);if(u)bi(t,n,u);else{var c,h=o?o(a,l,n+"",t,e,s):void 0,p=void 0===h;if(p){var d=S(l),f=!d&&Gt(l),g=!d&&!f&&Jt(l);h=l,d||f||g?S(a)?h=a:Ci(a)?h=ut(a):f?(p=!1,h=$n(l,!0)):g?(p=!1,h=wr(l,!0)):h=[]:_e(l)||jt(l)?(h=a,jt(a)?h=At(c=a,se(c)):F(a)&&!U(a)||(h=Ar(l))):p=!1}p&&(s.set(l,h),i(h,l,r,o,s),s.delete(l)),bi(t,n,h)}}function Pi(t,e,n,r,i){t!==e&&ui(e,(function(o,s){if(i||(i=new _n),F(o))wi(t,e,s,n,Pi,r,i);else{var a=r?r(xi(t,s),o,s+"",t,e,i):void 0;void 0===a&&(a=o),bi(t,s,a)}}),se)}function Ai(t,e,n,r,i,o){return F(t)&&F(e)&&(o.set(e,t),Pi(t,e,void 0,Ai,o),o.delete(e)),t}var Ei=Nt((function(t,e,n,r){Pi(t,e,n,r)})),Mi=St((function(t){return t.push(void 0,Ai),at(Ei,void 0,t)}));var Si=St((function(t,e){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,1,e)}));function ki(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var Ti=St((function(t,e){return Ci(t)?function(t,e,n,r){var i=-1,o=yt,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;n&&(e=M(e,Ut(n))),r?(o=ki,s=!1):e.length>=200&&(o=jr,s=!1,e=new Br(e));t:for(;++i<a;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var p=u;p--;)if(e[p]===h)continue t;l.push(c)}else o(e,h,r)||l.push(c)}return l}(t,Le(e,1,Ci,!0)):[]}));var Di=ln({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),Ni=/[&<>"']/g,Oi=RegExp(Ni.source);function Li(t){return(t=Me(t))&&Oi.test(t)?t.replace(Ni,Di):t}var Fi,zi,Bi=Object.prototype.hasOwnProperty,Vi=(Fi=function(t,e,n){Bi.call(t,n)?t[n].push(e):Ct(t,n,[e])},function(t,e){var n=S(t)?ai:hi,r=zi?zi():{};return n(t,Fi,si(e),r)});function ji(t,e){return t>e}var Ri=Object.prototype.hasOwnProperty;function Ii(t,e){return null!=t&&Ri.call(t,e)}function _i(t,e){return null!=t&&ei(t,e,Ii)}var Gi=Math.max,Hi=Math.min;function Ui(t){return"string"==typeof t||!S(t)&&A(t)&&"[object String]"==P(t)}var qi=Object.prototype.hasOwnProperty;function $i(t){if(null==t)return!0;if(Tt(t)&&(S(t)||"string"==typeof t||"function"==typeof t.splice||Gt(t)||Jt(t)||jt(t)))return!t.length;var e=gr(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Lt(t))return!ne(t).length;for(var n in t)if(qi.call(t,n))return!1;return!0}function Wi(t,e){return Jr(t,e)}var Xi=g.isFinite;function Yi(t){return"number"==typeof t&&t==G(t)}function Ji(t){return"number"==typeof t||A(t)&&"[object Number]"==P(t)}var Zi=Xt&&Xt.isRegExp,Ki=Zi?Ut(Zi):function(t){return A(t)&&"[object RegExp]"==P(t)},Qi=9007199254740991;var to=Vn((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),eo=sn("toLowerCase");function no(t){return t&&t.length?function(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],s=e(o);if(null!=s&&(void 0===a?s==s&&!E(s):n(s,a)))var a=s,l=o}return l}(t,H,ji):void 0}var ro=Nt((function(t,e,n){Pi(t,e,n)}));function io(t,e,n,r){if(!F(t))return t;for(var i=-1,o=(e=Se(e,t)).length,s=o-1,a=t;null!=a&&++i<o;){var l=ke(e[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var c=a[l];void 0===(u=r?r(c,l,a):void 0)&&(u=F(c)?c:bt(e[i+1])?[]:{})}Pt(a,l,u),a=a[l]}return t}function oo(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=E(t),s=void 0!==e,a=null===e,l=e==e,u=E(e);if(!a&&!u&&!o&&t>e||o&&s&&l&&!a&&!u||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!l)return-1}return 0}function so(t,e,n){e=e.length?M(e,(function(t){return S(t)?function(e){return Te(e,1===t.length?t[0]:t)}:t})):[H];var r=-1;return e=M(e,Ut(si)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(function(t,e){var n=-1,r=Tt(t)?Array(t.length):[];return ci(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}(t,(function(t,n,i){return{criteria:M(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;++r<s;){var l=oo(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}var ao=Math.floor;function lo(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=ao(e/2))&&(t+=t)}while(e);return n}var uo=ii("length"),co="[\\ud800-\\udfff]",ho="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",po="\\ud83c[\\udffb-\\udfff]",fo="[^\\ud800-\\udfff]",go="(?:\\ud83c[\\udde6-\\uddff]){2}",vo="[\\ud800-\\udbff][\\udc00-\\udfff]",yo="(?:"+ho+"|"+po+")"+"?",mo="[\\ufe0e\\ufe0f]?",bo=mo+yo+("(?:\\u200d(?:"+[fo,go,vo].join("|")+")"+mo+yo+")*"),Co="(?:"+[fo+ho+"?",ho,go,vo,co].join("|")+")",xo=RegExp(po+"(?="+po+")|"+Co+bo,"g");function wo(t){return $e(t)?function(t){for(var e=xo.lastIndex=0;xo.test(t);)++e;return e}(t):uo(t)}var Po=Math.ceil;function Ao(t,e){var n=(e=void 0===e?" ":D(e)).length;if(n<2)return n?lo(e,t):e;var r=lo(e,Po(t/wo(e)));return $e(e)?Ue(on(r),0,t).join(""):r.slice(0,t)}var Eo=Math.ceil,Mo=Math.floor;var So=/^\s+/,ko=g.parseInt;function To(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=Te(t,s);n(a,s)&&io(o,Se(s,t),a)}return o}(t,e,(function(e,n){return ni(t,n)}))}var Do=function(t){return gt(Mt(t,void 0,Fe),t+"")}((function(t,e){return null==t?{}:To(t,e)}));var No=St((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Dt(t,e[0],e[1])?e=[]:n>2&&Dt(e[0],e[1],e[2])&&(e=[e[0]]),so(t,Le(e,1),[])})),Oo=Math.floor,Lo=Math.min;function Fo(t,e,n,r){var i=0,o=null==t?0:t.length;if(0===o)return 0;for(var s=(e=n(e))!=e,a=null===e,l=E(e),u=void 0===e;i<o;){var c=Oo((i+o)/2),h=n(t[c]),p=void 0!==h,d=null===h,f=h==h,g=E(h);if(s)var v=r||f;else v=u?f&&(r||p):a?f&&p&&(r||!d):l?f&&p&&!d&&(r||!g):!d&&!g&&(r?h<=e:h<e);v?i=c+1:o=c}return Lo(o,4294967294)}function zo(t,e){return function(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!E(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return Fo(t,e,H,n)}(t,e)}function Bo(t,e,n){return Fo(t,e,si(n))}var Vo=Vn((function(t,e,n){return t+(n?" ":"")+an(e)}));var jo=Object.prototype,Ro=jo.hasOwnProperty;function Io(t,e,n,r){return void 0===t||xt(t,jo[n])&&!Ro.call(r,n)?e:t}var _o={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Go(t){return"\\"+_o[t]}var Ho=/<%=([\s\S]+?)%>/g,Uo={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Ho,variable:"",imports:{_:{escape:Li}}},qo=/\b__p \+= '';/g,$o=/\b(__p \+=) '' \+/g,Wo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xo=/[()=,{}\[\]\/\s]/,Yo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Jo=/($^)/,Zo=/['\n\r\u2028\u2029\\]/g,Ko=Object.prototype.hasOwnProperty;function Qo(t,e,n){var r=Uo.imports._.templateSettings||Uo;n&&Dt(t,e,n)&&(e=void 0),t=Me(t),e=le({},e,r,Io);var i,o,s=le({},e.imports,r.imports,Io),a=re(s),l=function(t,e){return M(e,(function(e){return t[e]}))}(s,a),u=0,c=e.interpolate||Jo,h="__p += '",p=RegExp((e.escape||Jo).source+"|"+c.source+"|"+(c===Ho?Yo:Jo).source+"|"+(e.evaluate||Jo).source+"|$","g"),d=Ko.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(p,(function(e,n,r,s,a,l){return r||(r=s),h+=t.slice(u,l).replace(Zo,Go),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),h+="';\n";var f=Ko.call(e,"variable")&&e.variable;if(f){if(Xo.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(qo,""):h).replace($o,"$1").replace(Wo,"$1;"),h="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=He((function(){return Function(a,d+"return "+h).apply(void 0,l)}));if(g.source=h,Ge(g))throw g;return g}var ts=9007199254740991;var es=/\w*$/;var ns=ln({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),rs=/&(?:amp|lt|gt|quot|#39);/g,is=RegExp(rs.source);var os=rr&&1/_r(new rr([,-0]))[1]==1/0?function(t){return new rr(t)}:lt;function ss(t,e,n){var r=-1,i=yt,o=t.length,s=!0,a=[],l=a;if(n)s=!1,i=ki;else if(o>=200){var u=e?null:os(t);if(u)return _r(u);s=!1,i=jr,l=new Br}else l=e?[]:a;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var p=l.length;p--;)if(l[p]===h)continue t;e&&l.push(h),a.push(c)}else i(l,h,n)||(l!==a&&l.push(h),a.push(c))}return a}var as=St((function(t){return ss(Le(t,1,Ci,!0))}));function ls(t){return t&&t.length?ss(t):[]}var us=0;function cs(t){var e=++us;return Me(t)+e}var hs=Vn((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),ps=function(t){return!Array.isArray(t)&&t-parseFloat(t)+1>=0},ds=Object.freeze({__proto__:null,isWindow:function(t){return t&&t===t.window},isNumeric:ps,isNull:function(t){return null===t},isNil:function(t){return null==t},isUndefined:function(t){return void 0===t},isString:Ui,isNumber:Ji,isBoolean:function(t){return!0===t||!1===t||A(t)&&"[object Boolean]"==P(t)},isObject:F,isArray:S,isArrayLike:Tt,isFunction:U});function fs(t,e){for(var n={},r=[],i=0,o=t.length;i<o;i+=1){var s=t[i],a=s[e];a?n[a]=i:r.push(s)}return{keyIndex:n,free:r}}var gs=Object.freeze({__proto__:null,isArray:S,isArrayLike:Tt,uniq:ls,union:as,sortedIndex:zo,sortedIndexBy:Bo,sortBy:No,groupBy:Vi,difference:Ti,max:no,diff:function(t,e,n){for(var r,i,o=fs(t,n),s=fs(e,n),a=s.free,l=o.keyIndex,u=s.keyIndex,c=[],h=[],p=0,d=0;p<t.length;){if(i=(r=t[p])[n])if(u.hasOwnProperty(i)){var f=u[i];h.push(e[f])}else h.push(null);else{var g=a[d+=1];h.push(g||null)}p+=1}var v=h.slice(0);for(p=0;p<v.length;)null===v[p]?(x(p),P(p)):p+=1;for(var y=p=0;p<e.length;){i=(r=e[p])[n];var m=v[y];if(m)if(i===m[n])y+=1;else if(l.hasOwnProperty(i)){var b=v[y+1];if(b)b[n]===i?(x(p),P(y),y+=1):w(p,r)}else w(p,r);else w(p,r);p+=1}for(var C=v.length-y;(y+=1)<v.length;)x((C-=1)+p);function x(t){var e={index:t,type:0,item:null};c.push(e)}function w(t,e){var n={index:t,item:e,type:1};c.push(n)}function P(t){v.splice(t,1)}return{moves:c}}});function vs(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];e.forEach((function(e){Object.getOwnPropertyNames(e.prototype).forEach((function(n){"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))}))}))}var ys=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};function ms(t,e){function n(){this.constructor=t}ys(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var bs=/^\s*class\s+/.test(""+function(){})||/^\s*class\s*\{/.test(""+function(){});function Cs(t,e){var r;return bs?r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(e):ms(r=function(){return e.apply(this,arguments)},e),Object.defineProperty(r,"name",{value:t}),r}function xs(t,e){return null!=t?t:e}function ws(t){return"__proto__"===t}function Ps(t,e,n){var r;void 0===n&&(n="/");var i=Array.isArray(e)?e:e.split(n);if(i.length)for(r=t;i.length;){var o=i.shift();if(Object(r)!==r||!o||!(o in r))return;r=r[o]}return r}function As(t,e,n,r){void 0===r&&(r="/");var i=Array.isArray(e)?e:e.split(r),o=i.pop();if(o&&!ws(o)){var s=t;i.forEach((function(t){ws(t)||(null==s[t]&&(s[t]={}),s=s[t])})),s[o]=n}return t}function Es(t,e,n){void 0===n&&(n="/");var r=Array.isArray(e)?e.slice():e.split(n),i=r.pop();if(i)if(r.length>0){var o=Ps(t,r);o&&delete o[i]}else delete t[i];return t}var Ms=Object.freeze({__proto__:null,ensure:xs,getValue:function(t,e,n){var r=null!=t?t[e]:null;return void 0!==n?xs(r,n):r},getNumber:function(t,e,n){var r=null!=t?t[e]:null;return null==r?n:(r=+r,Number.isNaN(r)||!Number.isFinite(r)?n:r)},getBoolean:function(t,e,n){var r=null!=t?t[e]:null;return null==r?n:!!r},isMaliciousProp:ws,getByPath:Ps,setByPath:As,unsetByPath:Es,flatten:function t(e,n,r){void 0===n&&(n="/");var i={};for(var o in Object.keys(e).forEach((function(o){var s=e[o],a="object"==typeof s||Array.isArray(s);if(a&&r&&r(s)&&(a=!1),a){var l=t(s,n,r);Object.keys(l).forEach((function(t){i[o+n+t]=l[t]}))}else i[o]=s})),e)Object.prototype.hasOwnProperty.call(e,o);return i},has:_i,pick:Do,forIn:function(t,e){return null==t?t:ui(t,"function"==typeof(n=e)?n:H,se);var n},merge:ro,extend:ae,isEqual:Wi,isEmpty:$i,isObject:F,isPlainObject:_e,clone:Fr,cloneDeep:zr,defaults:mi,defaultsDeep:Mi,applyMixins:vs,inherit:ms,createClass:Cs});var Ss=function(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}},ks=Ss((function(t){return t.replace(/\B([A-Z])/g,"-$1").toLowerCase()})),Ts=Ss((function(t){return Vo(jn(t)).replace(/ /g,"")})),Ds=Ss((function(t){return hs(t).replace(/ /g,"_")})),Ns=Ss((function(t){return to(t).replace(/ /g,".")})),Os=Ss((function(t){return to(t).replace(/ /g,"/")})),Ls=Ss((function(t){return an(to(t))})),Fs=Ss((function(t){return Vo(jn(t))}));function zs(t){for(var e=2166136261,n=!1,r=t,i=0,o=r.length;i<o;i+=1){var s=r.charCodeAt(i);s>127&&!n&&(s=(r=unescape(encodeURIComponent(r))).charCodeAt(i),n=!0),e^=s,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Bs(){for(var t="",e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n=0,r=e.length;n<r;n+=1){var i=e[n],o=16*Math.random()|0;t+=("x"===i?o:"y"===i?3&o|8:i).toString(16)}return t}function Vs(t,e){void 0===e&&(e={});var n=u.parseHTML(t,null,!1);return n.forEach((function(t){var e=t;if(e){var n=e.attributes;if(n)for(var r=0,i=n.length;r<i;r+=1){var o=n.item(r);if(o){var s=o.value.toLowerCase(),a=o.name.toLowerCase();(a.startsWith("on")||s.startsWith("javascript:")||s.startsWith("data:")||s.startsWith("vbscript:"))&&e.removeAttribute(a)}}}})),e.raw?n:u("<div/>").append(n).html()}function js(t,e,n){for(var r,i=Math.min(2,Math.floor(.34*t.length)),o=Math.floor(.4*t.length)+1,s=!1,a=t.toLowerCase(),l=0,u=e;l<u.length;l++){var c=u[l],h=n(c);if(void 0!==h&&Math.abs(h.length-a.length)<=i){var p=h.toLowerCase();if(p===a){if(h===t)continue;return c}if(s)continue;if(h.length<3)continue;var d=Rs(a,p,o-1);if(void 0===d)continue;d<3?(s=!0,r=c):(o=d,r=c)}}return r}function Rs(t,e,n){for(var r=new Array(e.length+1),i=new Array(e.length+1),o=n+1,s=0;s<=e.length;s+=1)r[s]=s;for(s=1;s<=t.length;s+=1){var a=t.charCodeAt(s-1),l=s>n?s-n:1,u=e.length>n+s?n+s:e.length;i[0]=s;for(var c=s,h=1;h<l;h+=1)i[h]=o;for(h=l;h<=u;h+=1){var p=a===e.charCodeAt(h-1)?r[h-1]:Math.min(r[h]+1,i[h-1]+1,r[h-1]+2);i[h]=p,c=Math.min(c,p)}for(h=u+1;h<=e.length;h+=1)i[h]=o;if(c>n)return;var d=r;r=i,i=d}var f=r[e.length];return f>n?void 0:f}var Is=Object.freeze({__proto__:null,isString:Ui,toString:Me,escape:Li,unescape:function(t){return(t=Me(t))&&is.test(t)?t.replace(rs,ns):t},startsWith:function(t,e,n){return t=Me(t),n=null==n?0:Rn(G(n),0,t.length),e=D(e),t.slice(n,n+e.length)==e},endsWith:function(t,e,n){t=Me(t),e=D(e);var r=t.length,i=n=void 0===n?r:Rn(G(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},split:function(t,e,n){return n&&"number"!=typeof n&&Dt(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=Me(t))&&("string"==typeof e||null!=e&&!Ki(e))&&!(e=D(e))&&$e(t)?Ue(on(t),0,n):t.split(e,n):[]},repeat:function(t,e,n){return e=(n?Dt(t,e,n):void 0===e)?1:G(e),lo(Me(t),e)},pad:function(t,e,n){t=Me(t);var r=(e=G(e))?wo(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Ao(Mo(i),n)+t+Ao(Eo(i),n)},padEnd:function(t,e,n){t=Me(t);var r=(e=G(e))?wo(t):0;return e&&r<e?t+Ao(e-r,n):t},padStart:function(t,e,n){t=Me(t);var r=(e=G(e))?wo(t):0;return e&&r<e?Ao(e-r,n)+t:t},truncate:function(t,e){var n=30,r="...";if(F(e)){var i="separator"in e?e.separator:i;n="length"in e?G(e.length):n,r="omission"in e?D(e.omission):r}var o=(t=Me(t)).length;if($e(t)){var s=on(t);o=s.length}if(n>=o)return t;var a=n-wo(r);if(a<1)return r;var l=s?Ue(s,0,a).join(""):t.slice(0,a);if(void 0===i)return l+r;if(s&&(a+=l.length-a),Ki(i)){if(t.slice(a).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Me(es.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var h=u.index;l=l.slice(0,void 0===h?a:h)}}else if(t.indexOf(D(i),a)!=a){var p=l.lastIndexOf(i);p>-1&&(l=l.slice(0,p))}return l+r},template:Qo,uniqueId:cs,eval:function(t){var e=null;try{e=window.eval(t)}catch(t){}return e},lowerFirst:eo,upperFirst:an,camelCase:jn,kebabCase:ks,pascalCase:Ts,constantCase:Ds,dotCase:Ns,pathCase:Os,sentenceCase:Ls,titleCase:Fs,hashcode:zs,uuid:Bs,sanitizeHTML:Vs,getSpellingSuggestion:js});function _s(t){return"string"==typeof t&&"%"===t.slice(-1)}function Gs(t,e){if(null==t)return 0;var n;if("string"==typeof t){if(n=parseFloat(t),_s(t)&&(n/=100,Number.isFinite(n)))return n*e}else n=t;return Number.isFinite(n)?n>0&&n<1?n*e:n:0}function Hs(t,e){var n,r=parseFloat(t);if(Number.isNaN(r))return null;if(null==e)n="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;n=e.join("|")}else"string"==typeof e&&(n=e);var i=function(e){var n=new RegExp("(?:\\d+(?:\\.\\d+)*)("+e+")$").exec(t);return n?n[1]:null}(n);return null===i?null:{unit:i,value:r}}function Us(t){if("object"==typeof t){var e=0,n=0,r=0,i=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=i=t.vertical),null!=t.horizontal&&Number.isFinite(t.horizontal)&&(r=e=t.horizontal),null!=t.left&&Number.isFinite(t.left)&&(e=t.left),null!=t.top&&Number.isFinite(t.top)&&(n=t.top),null!=t.right&&Number.isFinite(t.right)&&(r=t.right),null!=t.bottom&&Number.isFinite(t.bottom)&&(i=t.bottom),{top:n,right:r,bottom:i,left:e}}var o=0;return null!=t&&Number.isFinite(t)&&(o=t),{top:o,right:o,bottom:o,left:o}}var qs=Object.freeze({__proto__:null,mod:function(t,e){return(t%e+e)%e},random:function(t,e){if(null==e)e=null==t?1:t,t=0;else if(e<t){var n=t;t=e,e=n}return Math.floor(Math.random()*(e-t+1)+t)},isPercentage:_s,normalizePercentage:Gs,parseCssNumeric:Hs,normalizeSides:Us,isNaN:function(t){return Ji(t)&&t!=+t},isNumber:Ji,isFinite:function(t){return"number"==typeof t&&Xi(t)},isInteger:Yi,isSafeInteger:function(t){return Yi(t)&&t>=-9007199254740991&&t<=Qi},clamp:In,inRange:function(t,e,n){return e=_(e),void 0===n?(n=e,e=0):n=_(n),function(t,e,n){return t>=Hi(e,n)&&t<Gi(e,n)}(t=R(t),e,n)},toFinite:_,toNumber:R,toInteger:G,toSafeInteger:function(t){return t?Rn(G(t),-9007199254740991,ts):0===t?t:0},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),ko(Me(t).replace(So,""),e||0)},isNumeric:ps});function $s(t,e,n){if(n)switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2]);case 4:return t.call(e,n[0],n[1],n[2],n[3]);case 5:return t.call(e,n[0],n[1],n[2],n[3],n[4]);case 6:return t.call(e,n[0],n[1],n[2],n[3],n[4],n[5]);default:return t.apply(e,n)}return t.call(e)}function Ws(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return $s(t,e,n)}function Xs(t,e){for(var n=0,r=t.length;n<r;n+=1)if(t[n]===e)return t.push(t.splice(n,1)[0])}function Ys(t){return"object"==typeof t&&t.then&&"function"==typeof t.then}function Js(t){return null!=t&&(t instanceof Promise||Ys(t))}function Zs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=[];t.forEach((function(t){Array.isArray(t)?n.push.apply(n,t):n.push(t)}));var r=n.some((function(t){return Js(t)}));if(r){var i=n.map((function(t){return Js(t)?t:Promise.resolve(!1!==t)}));return Promise.all(i).then((function(t){return t.reduce((function(t,e){return!1!==e&&t}),!0)}))}return n.every((function(t){return!1!==t}))}function Ks(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Zs(t);return"boolean"==typeof n?Promise.resolve(n):n}var Qs=Object.freeze({__proto__:null,isFunction:U,once:function(t){return function(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=G(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}(2,t)},noop:lt,debounce:gi,defer:Si,apply:$s,call:Ws,cacher:function(t,e,n){var r=[],i={};return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=!1,l=o.join("␀");return l in i?(a=!0,Xs(r,l)):(r.length>=1e3&&delete i[r.shift()],r.push(l),i[l]=$s(t,e||null,o)),n?n(i[l],a):i[l]}},isAsyncLike:Ys,isAsync:Js,toAsyncBoolean:Zs,toDeferredBoolean:Ks}),ta=/[\t\r\n\f]/g,ea=/\S+/g,na=function(t){return" "+t+" "};function ra(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function ia(t,e){if(null==t||null==e)return!1;var n=na(ra(t)),r=na(e);return 1===t.nodeType&&n.replace(ta," ").includes(r)}function oa(t,e){if(null!=t&&null!=e){if("function"==typeof e)return oa(t,e(ra(t)));if("string"==typeof e&&1===t.nodeType){var n=e.match(ea)||[],r=na(ra(t)).replace(ta," "),i=n.reduce((function(t,e){return t.indexOf(na(e))<0?""+t+e+" ":t}),r);r!==(i=i.trim())&&t.setAttribute("class",i)}}}function sa(t,e){if(null!=t){if("function"==typeof e)return sa(t,e(ra(t)));if((!e||"string"==typeof e)&&1===t.nodeType){var n=(e||"").match(ea)||[],r=na(ra(t)).replace(ta," "),i=n.reduce((function(t,e){var n=na(e);return t.indexOf(n)>-1?t.replace(n," "):t}),r);r!==(i=e?i.trim():"")&&t.setAttribute("class",i)}}}function aa(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!=typeof e){if("function"==typeof e)return aa(t,e(ra(t),n),n);if("string"==typeof e)(e.match(ea)||[]).forEach((function(e){ia(t,e)?sa(t,e):oa(t,e)}))}else n?oa(t,e):sa(t,e)}var la=0;function ua(){return"v"+(la+=1)}function ca(t){return null!=t.id&&""!==t.id||(t.id=ua()),t.id}function ha(t){return null!=t&&("function"==typeof t.getScreenCTM&&t instanceof SVGElement)}var pa={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},da="1.1";function fa(t,e){return void 0===e&&(e=document),e.createElement(t)}function ga(t,e,n){return void 0===e&&(e=pa.xhtml),void 0===n&&(n=document),n.createElementNS(e,t)}function va(t,e){return void 0===e&&(e=document),ga(t,pa.svg,e)}function ya(t){if(t)return ma('<svg xmlns="'+pa.svg+'" xmlns:xlink="'+pa.xlink+'" version="'+'1.1">'+t+"</svg>",{async:!1}).documentElement;var e=document.createElementNS(pa.svg,"svg");return e.setAttributeNS(pa.xmlns,"xmlns:xlink",pa.xlink),e.setAttribute("version",da),e}function ma(t,e){var n;void 0===e&&(e={});try{var r=new DOMParser;if(null!=e.async)r.async=e.async;n=r.parseFromString(t,e.mimeType||"text/xml")}catch(t){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+t);return n}function ba(t,e){void 0===e&&(e=!0);var n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function Ca(t){for(var e=0,n=t.previousSibling;n;)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function xa(t,e){return t.querySelectorAll(e)}function wa(t,e){return t.querySelector(e)}function Pa(t,e,n){for(var r=t.ownerSVGElement,i=t.parentNode;i&&i!==n&&i!==r;){if(ia(i,e))return i;i=i.parentNode}return null}function Aa(t,e){var n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function Ea(t){t.parentNode&&t.parentNode.removeChild(t)}function Ma(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Sa(t,e){(Array.isArray(e)?e:[e]).forEach((function(e){null!=e&&t.appendChild(e)}))}function ka(t,e){var n=t.firstChild;return n?Ta(n,e):Sa(t,e)}function Ta(t,e){var n=t.parentNode;n&&(Array.isArray(e)?e:[e]).forEach((function(e){null!=e&&n.insertBefore(e,t)}))}function Da(t,e){null!=e&&e.appendChild(t)}function Na(t){try{return t instanceof HTMLElement}catch(e){return"object"==typeof t&&1===t.nodeType&&"object"==typeof t.style&&"object"==typeof t.ownerDocument}}var Oa=["viewBox","attributeName","attributeType","repeatCount"];function La(t,e){return t.getAttribute(e)}function Fa(t,e){var n=ja(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function za(t,e,n){if(null==n)return Fa(t,e);var r=ja(e);r.ns&&"string"==typeof n?t.setAttributeNS(r.ns,e,n):"id"===e?t.id=""+n:t.setAttribute(e,""+n)}function Ba(t,e){Object.keys(e).forEach((function(n){za(t,n,e[n])}))}function Va(t,e,n){if(null==e){for(var r=t.attributes,i={},o=0;o<r.length;o+=1)i[r[o].name]=r[o].value;return i}if("string"==typeof e&&void 0===n)return t.getAttribute(e);"object"==typeof e?Ba(t,e):za(t,e,n)}function ja(t){if(-1!==t.indexOf(":")){var e=t.split(":");return{ns:pa[e[0]],local:e[1]}}return{ns:null,local:t}}function Ra(t){var e={};return Object.keys(t).forEach((function(n){var r=Oa.includes(n)?n:ks(n);e[r]=t[n]})),e}function Ia(t){var e={};return t.split(";").forEach((function(t){var n=t.trim();if(n){var r=n.split("=");r.length&&(e[r[0].trim()]=r[1]?r[1].trim():"")}})),e}function _a(t,e){return Object.keys(e).forEach((function(n){if("class"===n)t[n]=t[n]?t[n]+" "+e[n]:e[n];else if("style"===n){var r="object"==typeof t[n],i="object"==typeof e[n],o=void 0,s=void 0;r&&i?(o=t[n],s=e[n]):r?(o=t[n],s=Ia(e[n])):i?(o=Ia(t[n]),s=e[n]):(o=Ia(t[n]),s=Ia(e[n])),t[n]=_a(o,s)}else t[n]=e[n]})),t}function Ga(t,e,n){void 0===n&&(n={});for(var r,i,o=n.offset||0,s=[],a=[],l=null,u=0;u<t.length;u+=1){r=a[u]=t[u];for(var c=0,h=e.length;c<h;c+=1){var p=e[c],d=p.start+o,f=p.end+o;u>=d&&u<f&&("string"==typeof r?r=a[u]={t:t[u],attrs:p.attrs}:r.attrs=_a(_a({},r.attrs),p.attrs),n.includeAnnotationIndices&&(null==r.annotations&&(r.annotations=[]),r.annotations.push(c)))}(i=a[u-1])?F(r)&&F(i)?(l=l,JSON.stringify(r.attrs)===JSON.stringify(i.attrs)?l.t+=r.t:(s.push(l),l=r)):F(r)||F(i)?(l=l,s.push(l),l=r):l=(l||"")+r:l=r}return null!=l&&s.push(l),s}function Ha(t){return t.replace(/ /g," ")}var Ua,qa=Object.freeze({__proto__:null,annotate:Ga,findAnnotationsAtIndex:function(t,e){return t?t.filter((function(t){return t.start<e&&e<=t.end})):[]},findAnnotationsBetweenIndexes:function(t,e,n){return t?t.filter((function(t){return e>=t.start&&e<t.end||n>t.start&&n<=t.end||t.start>=e&&t.end<n})):[]},shiftAnnotations:function(t,e,n){return t&&t.forEach((function(t){t.start<e&&t.end>=e?t.end+=n:t.start>=e&&(t.start+=n,t.end+=n)})),t},sanitize:Ha});t.JSONExt=void 0,function(t){function e(t){return null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function r(t,i){if(t===i)return!0;if(e(t)||e(i))return!1;var o=n(t),s=n(i);return o===s&&(o&&s?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n+=1)if(!r(t[n],e[n]))return!1;return!0}(t,i):function(t,e){if(t===e)return!0;for(var n in t)if(!(n in e))return!1;for(var n in e)if(!(n in t))return!1;for(var n in t)if(!r(t[n],e[n]))return!1;return!0}(t,i))}function i(t){return e(t)?t:n(t)?function(t){for(var e=new Array(t.length),n=0,r=t.length;n<r;n+=1)e[n]=i(t[n]);return e}(t):function(t){var e={};return Object.keys(t).forEach((function(n){e[n]=i(t[n])})),e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=r,t.deepCopy=i}(t.JSONExt||(t.JSONExt={})),t.DataUri=void 0,function(t){function e(t){var e="data:";return t.substr(0,e.length)===e}function n(t){var e,n=t.replace(/\s/g,""),r=(n=decodeURIComponent(n)).indexOf(","),i=n.slice(0,r),o=i.split(":")[1].split(";")[0],s=n.slice(r+1);e=i.indexOf("base64")>=0?atob(s):unescape(encodeURIComponent(s));for(var a=new Uint8Array(e.length),l=0;l<e.length;l+=1)a[l]=e.charCodeAt(l);return new Blob([a],{type:o})}function r(t,e){var n=window.navigator.msSaveBlob;if(n)n(t,e);else{var r=window.URL.createObjectURL(t),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)}}function i(t){var e=parseFloat(t);return Number.isNaN(e)?null:e}t.isDataUrl=e,t.imageToDataUri=function(t,n){if(t&&!e(t)){var r=function(){n(new Error("Failed to load image: "+t))},i=window.FileReader?function(t){if(200===t.status){var e=new FileReader;e.onload=function(t){var e=t.target.result;n(null,e)},e.onerror=r,e.readAsDataURL(t.response)}else r()}:function(e){if(200===e.status){var i=t.split(".").pop()||"png";"svg"===i&&(i="svg+xml");var o="data:image/"+i+";base64,",s=new Uint8Array(e.response),a=o+btoa(function(t){for(var e=[],n=0;n<t.length;n+=32768)e.push(String.fromCharCode.apply(null,t.subarray(n,n+32768)));return e.join("")}(s));n(null,a)}else r()},o=new XMLHttpRequest;o.responseType=window.FileReader?"blob":"arraybuffer",o.open("GET",t,!0),o.addEventListener("error",r),o.addEventListener("load",(function(){return i(o)})),o.send()}else setTimeout((function(){return n(null,t)}))},t.dataUriToBlob=n,t.downloadBlob=r,t.downloadDataUri=function(t,e){r(n(t),e)},t.svgToDataUrl=function(t,e){void 0===e&&(e={});var n=null,r=function(e){return null==n&&(n=function(t){var e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}(t)),null!=n?i(n[e]):null},o=function(e){var n=t.match(e);return n&&n[2]?i(n[2]):null},s=e.width;if(null==s&&(s=o(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==s&&(s=r(2)),null==s)throw new Error("Can not parse width from svg string");var a=e.height;if(null==a&&(a=o(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==a&&(a=r(3)),null==a)throw new Error("Can not parse height from svg string");return"data:image/svg+xml,"+encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22")}}(t.DataUri||(t.DataUri={}));var $a={px:function(t){return t},mm:function(t){return Ua*t},cm:function(t){return Ua*t*10},in:function(t){return Ua*t*25.4},pt:function(t){return Ua*(25.4*t/72)},pc:function(t){return Ua*(25.4*t/6)}};t.Unit=void 0,function(t){function e(t,e,n){var r=u("<div/>").css({display:"inline-block",position:"absolute",left:-15e3,top:-15e3,width:t+(n||""),height:e+(n||"")}).appendTo(document.body),i={width:r.width()||0,height:r.height()||0};return r.remove(),i}t.measure=e,t.toPx=function(t,n){null==Ua&&(Ua=e("1","1","mm").width);var r=n?$a[n]:null;return r?r(t):t}}(t.Unit||(t.Unit={}));var Wa,Xa,Ya=function(){var t,e=window;if(null!=e&&null!=(t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame)&&(t=t.bind(e)),null==t){var n=0;t=function(t){var e=(new Date).getTime(),r=Math.max(0,16-(e-n)),i=setTimeout((function(){t(e+r)}),r);return n=e+r,i}}return t}(),Ja=(null!=(Xa=window)&&(Wa=Xa.cancelAnimationFrame||Xa.webkitCancelAnimationFrame||Xa.webkitCancelRequestAnimationFrame||Xa.msCancelAnimationFrame||Xa.msCancelRequestAnimationFrame||Xa.oCancelAnimationFrame||Xa.oCancelRequestAnimationFrame||Xa.mozCancelAnimationFrame||Xa.mozCancelRequestAnimationFrame)&&(Wa=Wa.bind(Xa)),null==Wa&&(Wa=clearTimeout),Wa),Za=/-(.)/g;var Ka={},Qa=["Webkit","ms","Moz","O"],tl=document?document.createElement("div").style:{};function el(t){var e=t.replace(Za,(function(t,e){return e.toUpperCase()}));if(null==Ka[e]){var n=e.charAt(0).toUpperCase()+e.slice(1);Ka[e]=e in tl?e:function(t){for(var e=0;e<Qa.length;e+=1){var n=Qa[e]+t;if(n in tl)return n}return null}(n)}return Ka[e]}function nl(t,e){var n=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return n&&e?n.getPropertyValue(e)||n[e]:n}var rl,il,ol=(rl=document).selection?function(){rl.selection.empty()}:window.getSelection?function(){var t=window.getSelection();t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())}:function(){};function sl(t,e){return void 0===e&&(e=0),Number.isInteger(t)?t:+t.toFixed(e)}function al(t,e){var n,r;if(null==e?(r=null==t?1:t,n=0):(r=e,n=null==t?0:t),r<n){var i=n;n=r,r=i}return Math.floor(Math.random()*(r-n+1)+n)}function ll(t,e,n){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(n)?0:e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}function ul(t,e){return e*Math.round(t/e)}function cl(t,e){return null!=e&&null!=t&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function hl(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}t.Angle=void 0,(il=t.Angle||(t.Angle={})).toDeg=function(t){return 180*t/Math.PI%360},il.toRad=function(t,e){return void 0===e&&(e=!1),(e?t:t%360)*Math.PI/180},il.normalize=function(t){return t%360+(t<0?360:0)};var pl,dl,fl,gl,vl=function(){function t(){}return t.prototype.valueOf=function(){return this.toJSON()},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},t}();t.Point=function(e){function r(t,n){var r=e.call(this)||this;return r.x=null==t?0:t,r.y=null==n?0:n,r}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),r.prototype.round=function(t){return void 0===t&&(t=0),this.x=sl(this.x,t),this.y=sl(this.y,t),this},r.prototype.add=function(t,e){var n=r.create(t,e);return this.x+=n.x,this.y+=n.y,this},r.prototype.update=function(t,e){var n=r.create(t,e);return this.x=n.x,this.y=n.y,this},r.prototype.translate=function(t,e){var n=r.create(t,e);return this.x+=n.x,this.y+=n.y,this},r.prototype.rotate=function(t,e){var n=r.rotate(this,t,e);return this.x=n.x,this.y=n.y,this},r.prototype.scale=function(t,e,n){void 0===n&&(n=new r);var i=r.create(n);return this.x=i.x+t*(this.x-i.x),this.y=i.y+e*(this.y-i.y),this},r.prototype.closest=function(t){var e=this;if(1===t.length)return r.create(t[0]);var n=null,i=1/0;return t.forEach((function(t){var r=e.squaredDistance(t);r<i&&(n=t,i=r)})),n?r.create(n):null},r.prototype.distance=function(t){return Math.sqrt(this.squaredDistance(t))},r.prototype.squaredDistance=function(t){var e=r.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i},r.prototype.manhattanDistance=function(t){var e=r.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)},r.prototype.magnitude=function(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01},r.prototype.theta=function(t){void 0===t&&(t=new r);var e=r.create(t),n=-(e.y-this.y),i=e.x-this.x,o=Math.atan2(n,i);return o<0&&(o=2*Math.PI+o),180*o/Math.PI},r.prototype.angleBetween=function(t,e){if(this.equals(t)||this.equals(e))return NaN;var n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n},r.prototype.vectorAngle=function(t){return new r(0,0).angleBetween(this,t)},r.prototype.toPolar=function(t){return this.update(r.toPolar(this,t)),this},r.prototype.changeInAngle=function(t,e,n){return void 0===n&&(n=new r),this.clone().translate(-t,-e).theta(n)-this.theta(n)},r.prototype.adhereToRect=function(t){return cl(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this},r.prototype.bearing=function(e){var n=r.create(e),i=t.Angle.toRad(this.y),o=t.Angle.toRad(n.y),s=this.x,a=n.x,l=t.Angle.toRad(a-s),u=Math.sin(l)*Math.cos(o),c=Math.cos(i)*Math.sin(o)-Math.sin(i)*Math.cos(o)*Math.cos(l),h=t.Angle.toDeg(Math.atan2(u,c))-22.5;return h<0&&(h+=360),["NE","E","SE","S","SW","W","NW","N"][h=parseInt(h/45,10)]},r.prototype.cross=function(t,e){if(null!=t&&null!=e){var n=r.create(t),i=r.create(e);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN},r.prototype.dot=function(t){var e=r.create(t);return this.x*e.x+this.y*e.y},r.prototype.diff=function(t,e){if("number"==typeof t)return new r(this.x-t,this.y-e);var n=r.create(t);return new r(this.x-n.x,this.y-n.y)},r.prototype.lerp=function(t,e){var n=r.create(t);return new r((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)},r.prototype.normalize=function(t){void 0===t&&(t=1);var e=t/this.magnitude();return this.scale(e,e)},r.prototype.move=function(e,n){var i=r.create(e),o=t.Angle.toRad(i.theta(this));return this.translate(Math.cos(o)*n,-Math.sin(o)*n)},r.prototype.reflection=function(t){return r.create(t).move(this,this.distance(t))},r.prototype.snapToGrid=function(t,e){return this.x=ul(this.x,t),this.y=ul(this.y,null==e?t:e),this},r.prototype.equals=function(t){var e=r.create(t);return null!=e&&e.x===this.x&&e.y===this.y},r.prototype.clone=function(){return r.clone(this)},r.prototype.toJSON=function(){return r.toJSON(this)},r.prototype.serialize=function(){return this.x+" "+this.y},r}(vl),(pl=t.Point||(t.Point={})).toStringTag="X6.Geometry."+pl.name,pl.isPoint=function(t){if(null==t)return!1;if(t instanceof pl)return!0;var e=t[Symbol.toStringTag],n=t;return(null==e||e===pl.toStringTag)&&"number"==typeof n.x&&"number"==typeof n.y&&"function"==typeof n.toPolar},function(t){t.isPointLike=function(t){return null!=t&&"object"==typeof t&&"number"==typeof t.x&&"number"==typeof t.y},t.isPointData=function(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}}(t.Point||(t.Point={})),function(e){function n(t){return e.isPoint(t)?new e(t.x,t.y):Array.isArray(t)?new e(t[0],t[1]):new e(t.x,t.y)}function r(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function i(t,r,i,o){void 0===o&&(o=new e);var s=n(t),a=n(o),l=s.x-a.x,u=s.y-a.y,c=u*r+l*i;return new e(l*r-u*i+a.x,c+a.y)}e.create=function(t,r){return null==t||"number"==typeof t?new e(t,r):n(t)},e.clone=n,e.toJSON=function(t){return e.isPoint(t)?{x:t.x,y:t.y}:Array.isArray(t)?{x:t[0],y:t[1]}:{x:t.x,y:t.y}},e.fromPolar=function(r,i,o){void 0===o&&(o=new e);var s=Math.abs(r*Math.cos(i)),a=Math.abs(r*Math.sin(i)),l=n(o),u=t.Angle.normalize(t.Angle.toDeg(i));return u<90?a=-a:u<180?(s=-s,a=-a):u<270&&(s=-s),new e(l.x+s,l.y+a)},e.toPolar=function(r,i){void 0===i&&(i=new e);var o=n(r),s=n(i),a=o.x-s.x,l=o.y-s.y;return new e(Math.sqrt(a*a+l*l),t.Angle.toRad(s.theta(o)))},e.equals=r,e.equalPoints=function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!==e.length)return!1;if(null!=t&&null!=e)for(var n=0,i=t.length;n<i;n+=1)if(!r(t[n],e[n]))return!1;return!0},e.random=function(t,n,r,i){return new e(al(t,n),al(r,i))},e.rotate=function(e,n,r){var o=t.Angle.toRad(t.Angle.normalize(-n)),s=Math.sin(o);return i(e,Math.cos(o),s,r)},e.rotateEx=i}(t.Point||(t.Point={})),t.Rectangle=function(e){function r(t,n,r,i){var o=e.call(this)||this;return o.x=null==t?0:t,o.y=null==n?0:n,o.width=null==r?0:r,o.height=null==i?0:i,o}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"origin",{get:function(){return new t.Point(this.x,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"topLeft",{get:function(){return new t.Point(this.x,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"topCenter",{get:function(){return new t.Point(this.x+this.width/2,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"topRight",{get:function(){return new t.Point(this.x+this.width,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"center",{get:function(){return new t.Point(this.x+this.width/2,this.y+this.height/2)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottomLeft",{get:function(){return new t.Point(this.x,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottomCenter",{get:function(){return new t.Point(this.x+this.width/2,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottomRight",{get:function(){return new t.Point(this.x+this.width,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"corner",{get:function(){return new t.Point(this.x+this.width,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightMiddle",{get:function(){return new t.Point(this.x+this.width,this.y+this.height/2)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftMiddle",{get:function(){return new t.Point(this.x,this.y+this.height/2)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"topLine",{get:function(){return new t.Line(this.topLeft,this.topRight)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightLine",{get:function(){return new t.Line(this.topRight,this.bottomRight)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottomLine",{get:function(){return new t.Line(this.bottomLeft,this.bottomRight)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftLine",{get:function(){return new t.Line(this.topLeft,this.bottomLeft)},enumerable:!1,configurable:!0}),r.prototype.getOrigin=function(){return this.origin},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopCenter=function(){return this.topCenter},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getCenter=function(){return this.center},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomCenter=function(){return this.bottomCenter},r.prototype.getBottomRight=function(){return this.bottomRight},r.prototype.getCorner=function(){return this.corner},r.prototype.getRightMiddle=function(){return this.rightMiddle},r.prototype.getLeftMiddle=function(){return this.leftMiddle},r.prototype.getTopLine=function(){return this.topLine},r.prototype.getRightLine=function(){return this.rightLine},r.prototype.getBottomLine=function(){return this.bottomLine},r.prototype.getLeftLine=function(){return this.leftLine},r.prototype.bbox=function(e){if(!e)return this.clone();var n=t.Angle.toRad(e),i=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=this.width*o+this.height*i,a=this.width*i+this.height*o;return new r(this.x+(this.width-s)/2,this.y+(this.height-a)/2,s,a)},r.prototype.round=function(t){return void 0===t&&(t=0),this.x=sl(this.x,t),this.y=sl(this.y,t),this.width=sl(this.width,t),this.height=sl(this.height,t),this},r.prototype.add=function(t,e,n,i){var o=r.create(t,e,n,i),s=Math.min(this.x,o.x),a=Math.min(this.y,o.y),l=Math.max(this.x+this.width,o.x+o.width),u=Math.max(this.y+this.height,o.y+o.height);return this.x=s,this.y=a,this.width=l-s,this.height=u-a,this},r.prototype.update=function(t,e,n,i){var o=r.create(t,e,n,i);return this.x=o.x,this.y=o.y,this.width=o.width,this.height=o.height,this},r.prototype.inflate=function(t,e){var n=t,r=null!=e?e:t;return this.x-=n,this.y-=r,this.width+=2*n,this.height+=2*r,this},r.prototype.snapToGrid=function(t,e){var n=this.origin.snapToGrid(t,e),r=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=r.x-n.x,this.height=r.y-n.y,this},r.prototype.translate=function(e,n){var r=t.Point.create(e,n);return this.x+=r.x,this.y+=r.y,this},r.prototype.scale=function(e,n,r){void 0===r&&(r=new t.Point);var i=this.origin.scale(e,n,r);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=n,this},r.prototype.rotate=function(e,n){if(void 0===n&&(n=this.getCenter()),0!==e){var i=t.Angle.toRad(e),o=Math.cos(i),s=Math.sin(i),a=this.getOrigin(),l=this.getTopRight(),u=this.getBottomRight(),c=this.getBottomLeft();a=t.Point.rotateEx(a,o,s,n),l=t.Point.rotateEx(l,o,s,n),u=t.Point.rotateEx(u,o,s,n),c=t.Point.rotateEx(c,o,s,n);var h=new r(a.x,a.y,0,0);h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),h.add(c.x,c.y,0,0),this.update(h)}return this},r.prototype.rotate90=function(){var t=(this.width-this.height)/2;this.x+=t,this.y-=t;var e=this.width;return this.width=this.height,this.height=e,this},r.prototype.moveAndExpand=function(t){var e=r.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this},r.prototype.getMaxScaleToFit=function(t,e){void 0===e&&(e=this.center);var n=r.clone(t),i=e.x,o=e.y,s=1/0,a=1/0,l=1/0,u=1/0,c=1/0,h=1/0,p=1/0,d=1/0,f=n.topLeft;f.x<i&&(s=(this.x-i)/(f.x-i)),f.y<o&&(c=(this.y-o)/(f.y-o));var g=n.bottomRight;g.x>i&&(a=(this.x+this.width-i)/(g.x-i)),g.y>o&&(h=(this.y+this.height-o)/(g.y-o));var v=n.topRight;v.x>i&&(l=(this.x+this.width-i)/(v.x-i)),v.y<o&&(p=(this.y-o)/(v.y-o));var y=n.bottomLeft;return y.x<i&&(u=(this.x-i)/(y.x-i)),y.y>o&&(d=(this.y+this.height-o)/(y.y-o)),{sx:Math.min(s,a,l,u),sy:Math.min(c,h,p,d)}},r.prototype.getMaxUniformScaleToFit=function(t,e){void 0===e&&(e=this.center);var n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)},r.prototype.containsPoint=function(e,n){return cl(this,t.Point.create(e,n))},r.prototype.containsRect=function(t,e,n,i){var o=r.create(t,e,n,i),s=this.x,a=this.y,l=this.width,u=this.height,c=o.x,h=o.y,p=o.width,d=o.height;return 0!==l&&0!==u&&0!==p&&0!==d&&(c>=s&&h>=a&&c+p<=s+l&&h+d<=a+u)},r.prototype.intersectsWithLine=function(t){var e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],r=[];return e.forEach((function(e){var i=t.intersectsWithLine(e);null!==i&&r.indexOf(i.toString())<0&&(n.push(i),r.push(i.toString()))})),n.length>0?n:null},r.prototype.intersectsWithLineFromCenterToPoint=function(e,n){var r=t.Point.clone(e),i=this.center,o=null;null!=n&&0!==n&&r.rotate(n,i);for(var s=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new t.Line(i,r),l=s.length-1;l>=0;l-=1){var u=s[l].intersectsWithLine(a);if(null!==u){o=u;break}}return o&&null!=n&&0!==n&&o.rotate(-n,i),o},r.prototype.intersectsWithRect=function(t,e,n,i){var o=r.create(t,e,n,i);if(!this.isIntersectWithRect(o))return null;var s=this.origin,a=this.corner,l=o.origin,u=o.corner,c=Math.max(s.x,l.x),h=Math.max(s.y,l.y);return new r(c,h,Math.min(a.x,u.x)-c,Math.min(a.y,u.y)-h)},r.prototype.isIntersectWithRect=function(t,e,n,i){var o=r.create(t,e,n,i),s=this.origin,a=this.corner,l=o.origin,u=o.corner;return!(u.x<=s.x||u.y<=s.y||l.x>=a.x||l.y>=a.y)},r.prototype.normalize=function(){var t=this.x,e=this.y,n=this.width,r=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,r=-this.height),this.x=t,this.y=e,this.width=n,this.height=r,this},r.prototype.union=function(t){var e=r.clone(t),n=this.origin,i=this.corner,o=e.origin,s=e.corner,a=Math.min(n.x,o.x),l=Math.min(n.y,o.y);return new r(a,l,Math.max(i.x,s.x)-a,Math.max(i.y,s.y)-l)},r.prototype.getNearestSideToPoint=function(e){var n=t.Point.clone(e),r=n.x-this.x,i=this.x+this.width-n.x,o=n.y-this.y,s=r,a="left";return i<s&&(s=i,a="right"),o<s&&(s=o,a="top"),this.y+this.height-n.y<s&&(a="bottom"),a},r.prototype.getNearestPointToPoint=function(e){var n=t.Point.clone(e);if(this.containsPoint(n))switch(this.getNearestSideToPoint(n)){case"right":return new t.Point(this.x+this.width,n.y);case"left":return new t.Point(this.x,n.y);case"bottom":return new t.Point(n.x,this.y+this.height);case"top":return new t.Point(n.x,this.y)}return n.adhereToRect(this)},r.prototype.equals=function(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.serialize=function(){return this.x+" "+this.y+" "+this.width+" "+this.height},r}(vl),(dl=t.Rectangle||(t.Rectangle={})).toStringTag="X6.Geometry."+dl.name,dl.isRectangle=function(t){if(null==t)return!1;if(t instanceof dl)return!0;var e=t[Symbol.toStringTag],n=t;return(null==e||e===dl.toStringTag)&&"number"==typeof n.x&&"number"==typeof n.y&&"number"==typeof n.width&&"number"==typeof n.height&&"function"==typeof n.inflate&&"function"==typeof n.moveAndExpand},function(t){t.isRectangleLike=function(t){return null!=t&&"object"==typeof t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.width&&"number"==typeof t.height}}(t.Rectangle||(t.Rectangle={})),function(t){function e(e){return t.isRectangle(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.width,e.height)}t.create=function(n,r,i,o){return null==n||"number"==typeof n?new t(n,r,i,o):e(n)},t.clone=e,t.fromSize=function(e){return new t(0,0,e.width,e.height)},t.fromPositionAndSize=function(e,n){return new t(e.x,e.y,n.width,n.height)},t.fromEllipse=function(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}}(t.Rectangle||(t.Rectangle={})),t.Line=function(e){function r(n,r,i,o){var s=e.call(this)||this;return"number"==typeof n&&"number"==typeof r?(s.start=new t.Point(n,r),s.end=new t.Point(i,o)):(s.start=t.Point.create(n),s.end=t.Point.create(r)),s}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"center",{get:function(){return new t.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)},enumerable:!1,configurable:!0}),r.prototype.getCenter=function(){return this.center},r.prototype.round=function(t){return void 0===t&&(t=0),this.start.round(t),this.end.round(t),this},r.prototype.translate=function(t,e){return"number"==typeof t?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this},r.prototype.rotate=function(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this},r.prototype.scale=function(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this},r.prototype.length=function(){return Math.sqrt(this.squaredLength())},r.prototype.squaredLength=function(){var t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e},r.prototype.setLength=function(t){var e=this.length();if(!e)return this;var n=t/e;return this.scale(n,n,this.start)},r.prototype.parallel=function(t){var e=this.clone();if(!e.isDifferentiable())return e;var n=e.start,r=e.end,i=n.clone().rotate(270,r),o=r.clone().rotate(90,n);return n.move(o,t),r.move(i,t),e},r.prototype.vector=function(){return new t.Point(this.end.x-this.start.x,this.end.y-this.start.y)},r.prototype.angle=function(){var e=new t.Point(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)},r.prototype.bbox=function(){var e=Math.min(this.start.x,this.end.x),n=Math.min(this.start.y,this.end.y),r=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new t.Rectangle(e,n,r-e,i-n)},r.prototype.bearing=function(){return this.start.bearing(this.end)},r.prototype.closestPoint=function(t){return this.pointAt(this.closestPointNormalizedLength(t))},r.prototype.closestPointLength=function(t){return this.closestPointNormalizedLength(t)*this.length()},r.prototype.closestPointTangent=function(t){return this.tangentAt(this.closestPointNormalizedLength(t))},r.prototype.closestPointNormalizedLength=function(t){var e=this.vector().dot(new r(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n},r.prototype.pointAt=function(t){var e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)},r.prototype.pointAtLength=function(t){var e=this.start,n=this.end,r=!0;t<0&&(r=!1,t=-t);var i=this.length();if(t>=i)return r?n.clone():e.clone();var o=(r?t:i-t)/i;return this.pointAt(o)},r.prototype.divideAt=function(t){var e=this.pointAt(t);return[new r(this.start,e),new r(e,this.end)]},r.prototype.divideAtLength=function(t){var e=this.pointAtLength(t);return[new r(this.start,e),new r(e,this.end)]},r.prototype.containsPoint=function(t){var e=this.start,n=this.end;if(0!==e.cross(t,n))return!1;var i=this.length();return!(new r(e,t).length()>i)&&!(new r(t,n).length()>i)},r.prototype.intersect=function(t,e){var n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null},r.prototype.intersectsWithLine=function(e){var n=new t.Point(this.end.x-this.start.x,this.end.y-this.start.y),r=new t.Point(e.end.x-e.start.x,e.end.y-e.start.y),i=n.x*r.y-n.y*r.x,o=new t.Point(e.start.x-this.start.x,e.start.y-this.start.y),s=o.x*r.y-o.y*r.x,a=o.x*n.y-o.y*n.x;if(0===i||s*i<0||a*i<0)return null;if(i>0){if(s>i||a>i)return null}else if(s<i||a<i)return null;return new t.Point(this.start.x+s*n.x/i,this.start.y+s*n.y/i)},r.prototype.isDifferentiable=function(){return!this.start.equals(this.end)},r.prototype.pointOffset=function(e){var n=t.Point.clone(e),r=this.start,i=this.end;return((i.x-r.x)*(n.y-r.y)-(i.y-r.y)*(n.x-r.x))/this.length()},r.prototype.pointSquaredDistance=function(e,n){var r=t.Point.create(e,n);return this.closestPoint(r).squaredDistance(r)},r.prototype.pointDistance=function(e,n){var r=t.Point.create(e,n);return this.closestPoint(r).distance(r)},r.prototype.tangentAt=function(t){if(!this.isDifferentiable())return null;var e=this.start,n=this.end,i=this.pointAt(t),o=new r(e,n);return o.translate(i.x-e.x,i.y-e.y),o},r.prototype.tangentAtLength=function(t){if(!this.isDifferentiable())return null;var e=this.start,n=this.end,i=this.pointAtLength(t),o=new r(e,n);return o.translate(i.x-e.x,i.y-e.y),o},r.prototype.relativeCcw=function(e,n){var r=t.Point.create(e,n),i=r.x-this.start.x,o=r.y-this.start.y,s=this.end.x-this.start.x,a=this.end.y-this.start.y,l=i*a-o*s;return 0===l&&(l=i*s+o*a)>0&&(l=(i-=s)*s+(o-=a)*a)<0&&(l=0),l<0?-1:l>0?1:0},r.prototype.equals=function(t){return null!=t&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y},r.prototype.clone=function(){return new r(this.start,this.end)},r.prototype.toJSON=function(){return{start:this.start.toJSON(),end:this.end.toJSON()}},r.prototype.serialize=function(){return[this.start.serialize(),this.end.serialize()].join(" ")},r}(vl),(fl=t.Line||(t.Line={})).toStringTag="X6.Geometry."+fl.name,fl.isLine=function(e){if(null==e)return!1;if(e instanceof fl)return!0;var n=e[Symbol.toStringTag],r=e;try{if((null==n||n===fl.toStringTag)&&t.Point.isPoint(r.start)&&t.Point.isPoint(r.end)&&"function"==typeof r.vector&&"function"==typeof r.bearing&&"function"==typeof r.parallel&&"function"==typeof r.intersect)return!0}catch(t){return!1}return!1},t.Ellipse=function(e){function r(t,n,r,i){var o=e.call(this)||this;return o.x=null==t?0:t,o.y=null==n?0:n,o.a=null==r?0:r,o.b=null==i?0:i,o}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"center",{get:function(){return new t.Point(this.x,this.y)},enumerable:!1,configurable:!0}),r.prototype.bbox=function(){return t.Rectangle.fromEllipse(this)},r.prototype.getCenter=function(){return this.center},r.prototype.inflate=function(t,e){var n=t,r=null!=e?e:t;return this.a+=2*n,this.b+=2*r,this},r.prototype.normalizedDistance=function(e,n){var r=t.Point.create(e,n),i=r.x-this.x,o=r.y-this.y,s=this.a,a=this.b;return i*i/(s*s)+o*o/(a*a)},r.prototype.containsPoint=function(t,e){return this.normalizedDistance(t,e)<=1},r.prototype.intersectsWithLine=function(e){var n=[],r=this.a,i=this.b,o=e.start,s=e.end,a=e.vector(),l=o.diff(new t.Point(this.x,this.y)),u=new t.Point(a.x/(r*r),a.y/(i*i)),c=new t.Point(l.x/(r*r),l.y/(i*i)),h=a.dot(u),p=a.dot(c),d=p*p-h*(l.dot(c)-1);if(d<0)return null;if(d>0){var f=Math.sqrt(d),g=(-p-f)/h,v=(-p+f)/h;if((g<0||g>1)&&(v<0||v>1))return null;g>=0&&g<=1&&n.push(o.lerp(s,g)),v>=0&&v<=1&&n.push(o.lerp(s,v))}else{var y=-p/h;if(!(y>=0&&y<=1))return null;n.push(o.lerp(s,y))}return n},r.prototype.intersectsWithLineFromCenterToPoint=function(e,n){void 0===n&&(n=0);var r=t.Point.clone(e);n&&r.rotate(n,this.getCenter());var i,o=r.x-this.x,s=r.y-this.y;if(0===o)return i=this.bbox().getNearestPointToPoint(r),n?i.rotate(-n,this.getCenter()):i;var a=s/o,l=a*a,u=this.a*this.a,c=this.b*this.b,h=Math.sqrt(1/(1/u+l/c)),p=a*(h=o<0?-h:h);return i=new t.Point(this.x+h,this.y+p),n?i.rotate(-n,this.getCenter()):i},r.prototype.tangentTheta=function(e){var n,r,i=t.Point.clone(e),o=i.x,s=i.y,a=this.a,l=this.b,u=this.bbox().center,c=u.x,h=u.y,p=o>u.x+a/2,d=o<u.x-a/2;return p||d?n=a*a/(o-c)-a*a*(s-h)*((r=o>u.x?s-30:s+30)-h)/(l*l*(o-c))+c:r=l*l/(s-h)-l*l*(o-c)*((n=s>u.y?o+30:o-30)-c)/(a*a*(s-h))+h,new t.Point(n,r).theta(i)},r.prototype.scale=function(t,e){return this.a*=t,this.b*=e,this},r.prototype.rotate=function(e,n){var i=t.Rectangle.fromEllipse(this);i.rotate(e,n);var o=r.fromRect(i);return this.a=o.a,this.b=o.b,this.x=o.x,this.y=o.y,this},r.prototype.translate=function(e,n){var r=t.Point.create(e,n);return this.x+=r.x,this.y+=r.y,this},r.prototype.equals=function(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b},r.prototype.clone=function(){return new r(this.x,this.y,this.a,this.b)},r.prototype.toJSON=function(){return{x:this.x,y:this.y,a:this.a,b:this.b}},r.prototype.serialize=function(){return this.x+" "+this.y+" "+this.a+" "+this.b},r}(vl),function(t){t.toStringTag="X6.Geometry."+t.name,t.isEllipse=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"==typeof r.x&&"number"==typeof r.y&&"number"==typeof r.a&&"number"==typeof r.b&&"function"==typeof r.inflate&&"function"==typeof r.normalizedDistance}}(t.Ellipse||(t.Ellipse={})),function(t){function e(e){return t.isEllipse(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.a,e.b)}t.create=function(n,r,i,o){return null==n||"number"==typeof n?new t(n,r,i,o):e(n)},t.parse=e,t.fromRect=function(e){var n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}}(t.Ellipse||(t.Ellipse={})),t.Polyline=function(e){function r(n){var i=e.call(this)||this;if(null!=n){if("string"==typeof n)return r.parse(n);i.points=n.map((function(e){return t.Point.create(e)}))}else i.points=[];return i}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"start",{get:function(){return 0===this.points.length?null:this.points[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"end",{get:function(){return 0===this.points.length?null:this.points[this.points.length-1]},enumerable:!1,configurable:!0}),r.prototype.scale=function(e,n,r){return void 0===r&&(r=new t.Point),this.points.forEach((function(t){return t.scale(e,n,r)})),this},r.prototype.rotate=function(t,e){return this.points.forEach((function(n){return n.rotate(t,e)})),this},r.prototype.translate=function(e,n){var r=t.Point.create(e,n);return this.points.forEach((function(t){return t.translate(r.x,r.y)})),this},r.prototype.bbox=function(){if(0===this.points.length)return new t.Rectangle;for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=this.points,s=0,a=o.length;s<a;s+=1){var l=o[s],u=l.x,c=l.y;u<e&&(e=u),u>n&&(n=u),c<r&&(r=c),c>i&&(i=c)}return new t.Rectangle(e,r,n-e,i-r)},r.prototype.closestPoint=function(t){var e=this.closestPointLength(t);return this.pointAtLength(e)},r.prototype.closestPointLength=function(e){var n=this.points,r=n.length;if(0===r||1===r)return 0;for(var i=0,o=0,s=1/0,a=0,l=r-1;a<l;a+=1){var u=new t.Line(n[a],n[a+1]),c=u.length(),h=u.closestPointNormalizedLength(e),p=u.pointAt(h).squaredDistance(e);p<s&&(s=p,o=i+h*c),i+=c}return o},r.prototype.closestPointNormalizedLength=function(t){var e=this.closestPointLength(t);if(0===e)return 0;var n=this.length();return 0===n?0:e/n},r.prototype.closestPointTangent=function(t){var e=this.closestPointLength(t);return this.tangentAtLength(e)},r.prototype.containsPoint=function(e){if(0===this.points.length)return!1;for(var n=t.Point.clone(e),r=n.x,i=n.y,o=this.points,s=o.length,a=s-1,l=0,u=0;u<s;u+=1){var c=o[a],h=o[u];if(n.equals(c))return!0;var p=new t.Line(c,h);if(p.containsPoint(e))return!0;if(i<=c.y&&i>h.y||i>c.y&&i<=h.y){var d=c.x-r>h.x-r?c.x-r:h.x-r;if(d>=0){var f=new t.Point(r+d,i),g=new t.Line(e,f);p.intersectsWithLine(g)&&(l+=1)}}a=u}return l%2==1},r.prototype.intersectsWithLine=function(e){for(var n=[],r=0,i=this.points.length-1;r<i;r+=1){var o=this.points[r],s=this.points[r+1],a=e.intersectsWithLine(new t.Line(o,s));a&&n.push(a)}return n.length>0?n:null},r.prototype.isDifferentiable=function(){for(var e=0,n=this.points.length-1;e<n;e+=1){var r=this.points[e],i=this.points[e+1];if(new t.Line(r,i).isDifferentiable())return!0}return!1},r.prototype.length=function(){for(var t=0,e=0,n=this.points.length-1;e<n;e+=1){var r=this.points[e],i=this.points[e+1];t+=r.distance(i)}return t},r.prototype.pointAt=function(t){var e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();if(t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();var r=this.length()*t;return this.pointAtLength(r)},r.prototype.pointAtLength=function(e){var n=this.points,r=n.length;if(0===r)return null;if(1===r)return n[0].clone();var i=!0;e<0&&(i=!1,e=-e);for(var o=0,s=0,a=r-1;s<a;s+=1){var l=i?s:a-1-s,u=n[l],c=n[l+1],h=new t.Line(u,c),p=u.distance(c);if(e<=o+p)return h.pointAtLength((i?1:-1)*(e-o));o+=p}return(i?n[r-1]:n[0]).clone()},r.prototype.tangentAt=function(t){var e=this.points.length;if(0===e||1===e)return null;t<0&&(t=0),t>1&&(t=1);var n=this.length()*t;return this.tangentAtLength(n)},r.prototype.tangentAtLength=function(e){var n=this.points,r=n.length;if(0===r||1===r)return null;var i,o=!0;e<0&&(o=!1,e=-e);for(var s=0,a=0,l=r-1;a<l;a+=1){var u=o?a:l-1-a,c=n[u],h=n[u+1],p=new t.Line(c,h),d=c.distance(h);if(p.isDifferentiable()){if(e<=s+d)return p.tangentAtLength((o?1:-1)*(e-s));i=p}s+=d}if(i){var f=o?1:0;return i.tangentAt(f)}return null},r.prototype.simplify=function(e){void 0===e&&(e={});var n=this.points;if(n.length<3)return this;for(var r=e.threshold||0,i=0;n[i+2];){var o=i+1,s=i+2,a=n[i],l=n[o],u=n[s];new t.Line(a,u).closestPoint(l).distance(l)<=r?n.splice(o,1):i+=1}return this},r.prototype.toHull=function(){var t=this.points,e=t.length;if(0===e)return new r;for(var n=t[0],i=1;i<e;i+=1)(t[i].y<n.y||t[i].y===n.y&&t[i].x>n.x)&&(n=t[i]);var o=[];for(i=0;i<e;i+=1){var s=n.theta(t[i]);0===s&&(s=360),o.push([t[i],i,s])}if(o.sort((function(t,e){var n=t[2]-e[2];return 0===n&&(n=e[1]-t[1]),n})),o.length>2){var a=o[o.length-1];o.unshift(a)}for(var l,u={},c=[],h=function(t){return t[0].toString()+"@"+t[1]};0!==o.length;){var p=o.pop(),d=p[0];if(!u[h(p)])for(var f=!1;!f;)if(c.length<2)c.push(p),f=!0;else{var g=c.pop(),v=g[0],y=c.pop(),m=y[0],b=m.cross(v,d);if(b<0)c.push(y),c.push(g),c.push(p),f=!0;else if(0===b){var C=v.angleBetween(m,d);Math.abs(C-180)<1e-10||v.equals(d)||m.equals(v)?(u[h(g)]=v,c.push(y)):Math.abs((C+1)%360-1)<1e-10&&(c.push(y),o.push(g))}else u[h(g)]=v,c.push(y)}}c.length>2&&c.pop();for(var x=-1,w=(i=0,c.length);i<w;i+=1){var P=c[i][1];(void 0===l||P<l)&&(l=P,x=i)}var A=[];if(x>0){var E=c.slice(x),M=c.slice(0,x);A=E.concat(M)}else A=c;var S=[];for(i=0,w=A.length;i<w;i+=1)S.push(A[i][0]);return new r(S)},r.prototype.equals=function(t){var e=this;return null!=t&&(t.points.length===this.points.length&&t.points.every((function(t,n){return t.equals(e.points[n])})))},r.prototype.clone=function(){return new r(this.points.map((function(t){return t.clone()})))},r.prototype.toJSON=function(){return this.points.map((function(t){return t.toJSON()}))},r.prototype.serialize=function(){return this.points.map((function(t){return t.x+", "+t.y})).join(" ")},r}(vl),function(t){t.toStringTag="X6.Geometry."+t.name,t.isPolyline=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"==typeof r.toHull&&"function"==typeof r.simplify}}(t.Polyline||(t.Polyline={})),function(t){t.parse=function(e){var n=e.trim();if(""===n)return new t;for(var r=[],i=n.split(/\s*,\s*|\s+/),o=0,s=i.length;o<s;o+=2)r.push({x:+i[o],y:+i[o+1]});return new t(r)}}(t.Polyline||(t.Polyline={})),t.Curve=function(e){function r(n,r,i,o){var s=e.call(this)||this;return s.PRECISION=3,s.start=t.Point.create(n),s.controlPoint1=t.Point.create(r),s.controlPoint2=t.Point.create(i),s.end=t.Point.create(o),s}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),r.prototype.bbox=function(){for(var e,n,r,i,o,s,a,l,u,c,h,p=this.start,d=this.controlPoint1,f=this.controlPoint2,g=this.end,v=p.x,y=p.y,m=d.x,b=d.y,C=f.x,x=f.y,w=g.x,P=g.y,A=[],E=[],M=[[],[]],S=0;S<2;S+=1)if(0===S?(n=6*v-12*m+6*C,e=-3*v+9*m-9*C+3*w,r=3*m-3*v):(n=6*y-12*b+6*x,e=-3*y+9*b-9*x+3*P,r=3*b-3*y),Math.abs(e)<1e-12){if(Math.abs(n)<1e-12)continue;(i=-r/n)>0&&i<1&&E.push(i)}else a=n*n-4*r*e,l=Math.sqrt(a),a<0||((o=(-n+l)/(2*e))>0&&o<1&&E.push(o),(s=(-n-l)/(2*e))>0&&s<1&&E.push(s));for(var k=E.length,T=k;k;)u=(h=1-(i=E[k-=1]))*h*h*v+3*h*h*i*m+3*h*i*i*C+i*i*i*w,M[0][k]=u,c=h*h*h*y+3*h*h*i*b+3*h*i*i*x+i*i*i*P,M[1][k]=c,A[k]={X:u,Y:c};E[T]=0,E[T+1]=1,A[T]={X:v,Y:y},A[T+1]={X:w,Y:P},M[0][T]=v,M[1][T]=y,M[0][T+1]=w,M[1][T+1]=P,E.length=T+2,M[0].length=T+2,M[1].length=T+2,A.length=T+2;var D=Math.min.apply(null,M[0]),N=Math.min.apply(null,M[1]),O=Math.max.apply(null,M[0]),L=Math.max.apply(null,M[1]);return new t.Rectangle(D,N,O-D,L-N)},r.prototype.closestPoint=function(t,e){return void 0===e&&(e={}),this.pointAtT(this.closestPointT(t,e))},r.prototype.closestPointLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)},r.prototype.closestPointNormalizedLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e),r=this.closestPointLength(t,n);if(!r)return 0;var i=this.length(n);return 0===i?0:r/i},r.prototype.closestPointT=function(t,e){void 0===e&&(e={});var n=this.getPrecision(e),r=this.getDivisions(e),i=Math.pow(10,-n),o=null,s=0,a=0,l=0,u=0,c=0,h=null,p=r.length,d=p>0?1/p:0;for(r.forEach((function(e,n){var r=e.start.distance(t),i=e.end.distance(t),p=r+i;(null==h||p<h)&&(o=e,s=n*d,a=(n+1)*d,l=r,u=i,h=p,c=e.endpointDistance())}));;){var f=l?Math.abs(l-u)/l:0,g=null!=u?Math.abs(l-u)/u:0;if(f<i||g<i||(!l||l<c*i||(!u||u<c*i)))return l<=u?s:a;var v=o.divide(.5);d/=2;var y=v[0].start.distance(t),m=v[0].end.distance(t),b=y+m,C=v[1].start.distance(t),x=v[1].end.distance(t);b<=C+x?(o=v[0],a-=d,l=y,u=m):(o=v[1],s+=d,l=C,u=x)}},r.prototype.closestPointTangent=function(t,e){return void 0===e&&(e={}),this.tangentAtT(this.closestPointT(t,e))},r.prototype.containsPoint=function(t,e){return void 0===e&&(e={}),this.toPolyline(e).containsPoint(t)},r.prototype.divideAt=function(t,e){if(void 0===e&&(e={}),t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);var n=this.tAt(t,e);return this.divideAtT(n)},r.prototype.divideAtLength=function(t,e){void 0===e&&(e={});var n=this.tAtLength(t,e);return this.divideAtT(n)},r.prototype.divide=function(t){return this.divideAtT(t)},r.prototype.divideAtT=function(t){var e=this.start,n=this.controlPoint1,i=this.controlPoint2,o=this.end;if(t<=0)return[new r(e,e,e,e),new r(e,n,i,o)];if(t>=1)return[new r(e,n,i,o),new r(o,o,o,o)];var s=this.getSkeletonPoints(t),a=s.startControlPoint1,l=s.startControlPoint2,u=s.divider,c=s.dividerControlPoint1,h=s.dividerControlPoint2;return[new r(e,a,l,u),new r(u,c,h,o)]},r.prototype.endpointDistance=function(){return this.start.distance(this.end)},r.prototype.getSkeletonPoints=function(e){var n=this.start,r=this.controlPoint1,i=this.controlPoint2,o=this.end;if(e<=0)return{startControlPoint1:n.clone(),startControlPoint2:n.clone(),divider:n.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:r.clone(),startControlPoint2:i.clone(),divider:o.clone(),dividerControlPoint1:o.clone(),dividerControlPoint2:o.clone()};var s=new t.Line(n,r).pointAt(e),a=new t.Line(r,i).pointAt(e),l=new t.Line(i,o).pointAt(e),u=new t.Line(s,a).pointAt(e),c=new t.Line(a,l).pointAt(e);return{startControlPoint1:s,startControlPoint2:u,divider:new t.Line(u,c).pointAt(e),dividerControlPoint1:c,dividerControlPoint2:l}},r.prototype.getSubdivisions=function(t){void 0===t&&(t={});var e=this.getPrecision(t),n=[new r(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===e)return n;for(var i=this.endpointDistance(),o=Math.pow(10,-e),s=0,a=function(){s+=1;var t=[];n.forEach((function(e){var n=e.divide(.5);t.push(n[0],n[1])}));var e=t.reduce((function(t,e){return t+e.endpointDistance()}),0);if(s>1&&(0!==e?(e-i)/e:0)<o)return{value:t};n=t,i=e};;){var l=a();if("object"==typeof l)return l.value}},r.prototype.length=function(t){return void 0===t&&(t={}),this.getDivisions(t).reduce((function(t,e){return t+e.endpointDistance()}),0)},r.prototype.lengthAtT=function(t,e){if(void 0===e&&(e={}),t<=0)return 0;var n=void 0===e.precision?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:n})},r.prototype.pointAt=function(t,e){if(void 0===e&&(e={}),t<=0)return this.start.clone();if(t>=1)return this.end.clone();var n=this.tAt(t,e);return this.pointAtT(n)},r.prototype.pointAtLength=function(t,e){void 0===e&&(e={});var n=this.tAtLength(t,e);return this.pointAtT(n)},r.prototype.pointAtT=function(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider},r.prototype.isDifferentiable=function(){var t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(r))},r.prototype.tangentAt=function(t,e){if(void 0===e&&(e={}),!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);var n=this.tAt(t,e);return this.tangentAtT(n)},r.prototype.tangentAtLength=function(t,e){if(void 0===e&&(e={}),!this.isDifferentiable())return null;var n=this.tAtLength(t,e);return this.tangentAtT(n)},r.prototype.tangentAtT=function(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);var n=this.getSkeletonPoints(e),r=n.startControlPoint2,i=n.dividerControlPoint1,o=n.divider,s=new t.Line(r,i);return s.translate(o.x-r.x,o.y-r.y),s},r.prototype.getPrecision=function(t){return void 0===t&&(t={}),null==t.precision?this.PRECISION:t.precision},r.prototype.getDivisions=function(t){if(void 0===t&&(t={}),null!=t.subdivisions)return t.subdivisions;var e=this.getPrecision(t);return this.getSubdivisions({precision:e})},r.prototype.getOptions=function(t){return void 0===t&&(t={}),{precision:this.getPrecision(t),subdivisions:this.getDivisions(t)}},r.prototype.tAt=function(t,e){if(void 0===e&&(e={}),t<=0)return 0;if(t>=1)return 1;var n=this.getOptions(e),r=this.length(n)*t;return this.tAtLength(r,n)},r.prototype.tAtLength=function(t,e){void 0===e&&(e={});var n=!0;t<0&&(n=!1,t=-t);for(var r,i,o=this.getPrecision(e),s=this.getDivisions(e),a={precision:o,subdivisions:s},l=null,u=0,c=0,h=0,p=s.length,d=p>0?1/p:0,f=0;f<p;f+=1){var g=n?f:p-1-f,v=s[f],y=v.endpointDistance();if(t<=h+y){l=v,r=g*d,i=(g+1)*d,u=n?t-h:y+h-t,c=n?y+h-t:t-h;break}h+=y}if(null==l)return n?1:0;for(var m=this.length(a),b=Math.pow(10,-o);;){if((0!==m?u/m:0)<b)return r;if((0!==m?c/m:0)<b)return i;var C=void 0,x=void 0,w=l.divide(.5);d/=2;var P=w[0].endpointDistance(),A=w[1].endpointDistance();u<=P?(l=w[0],i-=d,x=P-(C=u)):(l=w[1],r+=d,x=A-(C=u-P)),u=C,c=x}},r.prototype.toPoints=function(t){void 0===t&&(t={});var e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach((function(t){return n.push(t.end.clone())})),n},r.prototype.toPolyline=function(e){return void 0===e&&(e={}),new t.Polyline(this.toPoints(e))},r.prototype.scale=function(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this},r.prototype.rotate=function(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this},r.prototype.translate=function(t,e){return"number"==typeof t?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this},r.prototype.equals=function(t){return null!=t&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)},r.prototype.clone=function(){return new r(this.start,this.controlPoint1,this.controlPoint2,this.end)},r.prototype.toJSON=function(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}},r.prototype.serialize=function(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")},r}(vl),(gl=t.Curve||(t.Curve={})).toStringTag="X6.Geometry."+gl.name,gl.isCurve=function(e){if(null==e)return!1;if(e instanceof gl)return!0;var n=e[Symbol.toStringTag],r=e;try{if((null==n||n===gl.toStringTag)&&t.Point.isPoint(r.start)&&t.Point.isPoint(r.controlPoint1)&&t.Point.isPoint(r.controlPoint2)&&t.Point.isPoint(r.end)&&"function"==typeof r.toPoints&&"function"==typeof r.toPolyline)return!0}catch(t){return!1}return!1},function(e){function n(t){var e=t.length,n=[],r=[],i=2;n[0]=t[0]/i;for(var o=1;o<e;o+=1)r[o]=1/i,i=(o<e-1?4:3.5)-r[o],n[o]=(t[o]-n[o-1])/i;for(o=1;o<e;o+=1)n[e-o-1]-=r[e-o]*n[e-o];return n}e.throughPoints=function(r){if(null==r||Array.isArray(r)&&r.length<2)throw new Error("At least 2 points are required");for(var i=function(e){var r=e.map((function(e){return t.Point.clone(e)})),i=[],o=[],s=r.length-1;if(1===s)return i[0]=new t.Point((2*r[0].x+r[1].x)/3,(2*r[0].y+r[1].y)/3),o[0]=new t.Point(2*i[0].x-r[0].x,2*i[0].y-r[0].y),[i,o];for(var a=[],l=1;l<s-1;l+=1)a[l]=4*r[l].x+2*r[l+1].x;a[0]=r[0].x+2*r[1].x,a[s-1]=(8*r[s-1].x+r[s].x)/2;var u=n(a);for(l=1;l<s-1;l+=1)a[l]=4*r[l].y+2*r[l+1].y;a[0]=r[0].y+2*r[1].y,a[s-1]=(8*r[s-1].y+r[s].y)/2;var c=n(a);for(l=0;l<s;l+=1)i.push(new t.Point(u[l],c[l])),l<s-1?o.push(new t.Point(2*r[l+1].x-u[l+1],2*r[l+1].y-c[l+1])):o.push(new t.Point((r[s].x+u[s-1])/2,(r[s].y+c[s-1])/2));return[i,o]}(r),o=[],s=0,a=i[0].length;s<a;s+=1){var l=new t.Point(i[0][s].x,i[0][s].y),u=new t.Point(i[1][s].x,i[1][s].y);o.push(new e(r[s],l,u,r[s+1]))}return o}}(t.Curve||(t.Curve={}));var yl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isVisible=!0,e.isSegment=!0,e.isSubpathStart=!1,e}return n(e,t),Object.defineProperty(e.prototype,"end",{get:function(){return this.endPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){if(null==this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end},enumerable:!1,configurable:!0}),e.prototype.closestPointT=function(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")},e.prototype.lengthAtT=function(t,e){if(t<=0)return 0;var n=this.length();return t>=1?n:n*t},e.prototype.divideAtT=function(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")},e.prototype.pointAtT=function(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")},e.prototype.tangentAtT=function(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")},e}(vl),ml=function(e){function r(n,r){var i=e.call(this)||this;return t.Line.isLine(n)?i.endPoint=n.end.clone().round(2):i.endPoint=t.Point.create(n,r).round(2),i}return n(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return"L"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"line",{get:function(){return new t.Line(this.start,this.end)},enumerable:!1,configurable:!0}),r.prototype.bbox=function(){return this.line.bbox()},r.prototype.closestPoint=function(t){return this.line.closestPoint(t)},r.prototype.closestPointLength=function(t){return this.line.closestPointLength(t)},r.prototype.closestPointNormalizedLength=function(t){return this.line.closestPointNormalizedLength(t)},r.prototype.closestPointTangent=function(t){return this.line.closestPointTangent(t)},r.prototype.length=function(){return this.line.length()},r.prototype.divideAt=function(t){var e=this.line.divideAt(t);return[new r(e[0]),new r(e[1])]},r.prototype.divideAtLength=function(t){var e=this.line.divideAtLength(t);return[new r(e[0]),new r(e[1])]},r.prototype.getSubdivisions=function(){return[]},r.prototype.pointAt=function(t){return this.line.pointAt(t)},r.prototype.pointAtLength=function(t){return this.line.pointAtLength(t)},r.prototype.tangentAt=function(t){return this.line.tangentAt(t)},r.prototype.tangentAtLength=function(t){return this.line.tangentAtLength(t)},r.prototype.isDifferentiable=function(){return null!=this.previousSegment&&!this.start.equals(this.end)},r.prototype.clone=function(){return new r(this.end)},r.prototype.scale=function(t,e,n){return this.end.scale(t,e,n),this},r.prototype.rotate=function(t,e){return this.end.rotate(t,e),this},r.prototype.translate=function(t,e){return"number"==typeof t?this.end.translate(t,e):this.end.translate(t),this},r.prototype.equals=function(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)},r.prototype.toJSON=function(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}},r.prototype.serialize=function(){var t=this.end;return this.type+" "+t.x+" "+t.y},r}(yl);!function(e){e.create=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length,o=n[0];if(t.Line.isLine(o))return new e(o);if(t.Point.isPointLike(o))return 1===i?new e(o):n.map((function(t){return new e(t)}));if(2===i)return new e(+n[0],+n[1]);for(var s=[],a=0;a<i;a+=2){var l=+n[a],u=+n[a+1];s.push(new e(l,u))}return s}}(ml||(ml={}));var bl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),Object.defineProperty(r.prototype,"end",{get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){return"Z"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"line",{get:function(){return new t.Line(this.start,this.end)},enumerable:!1,configurable:!0}),r.prototype.bbox=function(){return this.line.bbox()},r.prototype.closestPoint=function(t){return this.line.closestPoint(t)},r.prototype.closestPointLength=function(t){return this.line.closestPointLength(t)},r.prototype.closestPointNormalizedLength=function(t){return this.line.closestPointNormalizedLength(t)},r.prototype.closestPointTangent=function(t){return this.line.closestPointTangent(t)},r.prototype.length=function(){return this.line.length()},r.prototype.divideAt=function(t){var e=this.line.divideAt(t);return[e[1].isDifferentiable()?new ml(e[0]):this.clone(),new ml(e[1])]},r.prototype.divideAtLength=function(t){var e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new ml(e[0]):this.clone(),new ml(e[1])]},r.prototype.getSubdivisions=function(){return[]},r.prototype.pointAt=function(t){return this.line.pointAt(t)},r.prototype.pointAtLength=function(t){return this.line.pointAtLength(t)},r.prototype.tangentAt=function(t){return this.line.tangentAt(t)},r.prototype.tangentAtLength=function(t){return this.line.tangentAtLength(t)},r.prototype.isDifferentiable=function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},r.prototype.scale=function(){return this},r.prototype.rotate=function(){return this},r.prototype.translate=function(){return this},r.prototype.equals=function(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)},r.prototype.clone=function(){return new r},r.prototype.toJSON=function(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}},r.prototype.serialize=function(){return this.type},r}(yl);!function(t){t.create=function(){return new t}}(bl||(bl={}));var Cl=function(e){function r(n,r){var i=e.call(this)||this;return i.isVisible=!1,i.isSubpathStart=!0,t.Line.isLine(n)||t.Curve.isCurve(n)?i.endPoint=n.end.clone().round(2):i.endPoint=t.Point.create(n,r).round(2),i}return n(r,e),Object.defineProperty(r.prototype,"start",{get:function(){throw new Error("Illegal access. Moveto segments should not need a start property.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){return"M"},enumerable:!1,configurable:!0}),r.prototype.bbox=function(){return null},r.prototype.closestPoint=function(){return this.end.clone()},r.prototype.closestPointLength=function(){return 0},r.prototype.closestPointNormalizedLength=function(){return 0},r.prototype.closestPointT=function(){return 1},r.prototype.closestPointTangent=function(){return null},r.prototype.length=function(){return 0},r.prototype.lengthAtT=function(){return 0},r.prototype.divideAt=function(){return[this.clone(),this.clone()]},r.prototype.divideAtLength=function(){return[this.clone(),this.clone()]},r.prototype.getSubdivisions=function(){return[]},r.prototype.pointAt=function(){return this.end.clone()},r.prototype.pointAtLength=function(){return this.end.clone()},r.prototype.pointAtT=function(){return this.end.clone()},r.prototype.tangentAt=function(){return null},r.prototype.tangentAtLength=function(){return null},r.prototype.tangentAtT=function(){return null},r.prototype.isDifferentiable=function(){return!1},r.prototype.scale=function(t,e,n){return this.end.scale(t,e,n),this},r.prototype.rotate=function(t,e){return this.end.rotate(t,e),this},r.prototype.translate=function(t,e){return"number"==typeof t?this.end.translate(t,e):this.end.translate(t),this},r.prototype.clone=function(){return new r(this.end)},r.prototype.equals=function(t){return this.type===t.type&&this.end.equals(t.end)},r.prototype.toJSON=function(){return{type:this.type,end:this.end.toJSON()}},r.prototype.serialize=function(){var t=this.end;return this.type+" "+t.x+" "+t.y},r}(yl);!function(e){e.create=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length,o=n[0];if(t.Line.isLine(o))return new e(o);if(t.Curve.isCurve(o))return new e(o);if(t.Point.isPointLike(o)){if(1===i)return new e(o);for(var s=[],a=0;a<i;a+=1)0===a?s.push(new e(n[a])):s.push(new ml(n[a]));return s}if(2===i)return new e(+n[0],+n[1]);var l=[];for(a=0;a<i;a+=2){var u=+n[a],c=+n[a+1];0===a?l.push(new e(u,c)):l.push(new ml(u,c))}return l}}(Cl||(Cl={}));var xl=function(e){function r(n,r,i,o,s,a){var l=e.call(this)||this;return t.Curve.isCurve(n)?(l.controlPoint1=n.controlPoint1.clone().round(2),l.controlPoint2=n.controlPoint2.clone().round(2),l.endPoint=n.end.clone().round(2)):"number"==typeof n?(l.controlPoint1=new t.Point(n,r).round(2),l.controlPoint2=new t.Point(i,o).round(2),l.endPoint=new t.Point(s,a).round(2)):(l.controlPoint1=t.Point.create(n).round(2),l.controlPoint2=t.Point.create(r).round(2),l.endPoint=t.Point.create(i).round(2)),l}return n(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return"C"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"curve",{get:function(){return new t.Curve(this.start,this.controlPoint1,this.controlPoint2,this.end)},enumerable:!1,configurable:!0}),r.prototype.bbox=function(){return this.curve.bbox()},r.prototype.closestPoint=function(t){return this.curve.closestPoint(t)},r.prototype.closestPointLength=function(t){return this.curve.closestPointLength(t)},r.prototype.closestPointNormalizedLength=function(t){return this.curve.closestPointNormalizedLength(t)},r.prototype.closestPointTangent=function(t){return this.curve.closestPointTangent(t)},r.prototype.length=function(){return this.curve.length()},r.prototype.divideAt=function(t,e){void 0===e&&(e={});var n=this.curve.divideAt(t,e);return[new r(n[0]),new r(n[1])]},r.prototype.divideAtLength=function(t,e){void 0===e&&(e={});var n=this.curve.divideAtLength(t,e);return[new r(n[0]),new r(n[1])]},r.prototype.divideAtT=function(t){var e=this.curve.divideAtT(t);return[new r(e[0]),new r(e[1])]},r.prototype.getSubdivisions=function(){return[]},r.prototype.pointAt=function(t){return this.curve.pointAt(t)},r.prototype.pointAtLength=function(t){return this.curve.pointAtLength(t)},r.prototype.tangentAt=function(t){return this.curve.tangentAt(t)},r.prototype.tangentAtLength=function(t){return this.curve.tangentAtLength(t)},r.prototype.isDifferentiable=function(){if(!this.previousSegment)return!1;var t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(r))},r.prototype.scale=function(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this},r.prototype.rotate=function(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this},r.prototype.translate=function(t,e){return"number"==typeof t?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this},r.prototype.equals=function(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)},r.prototype.clone=function(){return new r(this.controlPoint1,this.controlPoint2,this.end)},r.prototype.toJSON=function(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}},r.prototype.serialize=function(){var t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")},r}(yl);function wl(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Pl(t,e,n,r,i,o){var s=1/3,a=2/3;return[s*t+a*n,s*e+a*r,s*i+a*n,s*o+a*r,i,o]}function Al(t,e,n,r,i,o,s,a,l,u){var c,h,p,d,f,g=120*Math.PI/180,v=Math.PI/180*(+i||0),y=[];if(u)h=u[0],p=u[1],d=u[2],f=u[3];else{t=(c=wl(t,e,-v)).x,e=c.y;var m=(t-(a=(c=wl(a,l,-v)).x))/2,b=(e-(l=c.y))/2,C=m*m/(n*n)+b*b/(r*r);C>1&&(n*=C=Math.sqrt(C),r*=C);var x=n*n,w=r*r,P=(o===s?-1:1)*Math.sqrt(Math.abs((x*w-x*b*b-w*m*m)/(x*b*b+w*m*m)));d=P*n*b/r+(t+a)/2,f=P*-r*m/n+(e+l)/2,h=Math.asin((e-f)/r),p=Math.asin((l-f)/r),h=t<d?Math.PI-h:h,p=a<d?Math.PI-p:p,h<0&&(h=2*Math.PI+h),p<0&&(p=2*Math.PI+p),s&&h>p&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>g){var E=p,M=a,S=l;p=h+g*(s&&p>h?1:-1),y=Al(a=d+n*Math.cos(p),l=f+r*Math.sin(p),n,r,i,0,s,M,S,[p,E,d,f])}A=p-h;var k=Math.cos(h),T=Math.sin(h),D=Math.cos(p),N=Math.sin(p),O=Math.tan(A/4),L=4/3*(n*O),F=4/3*(r*O),z=[t,e],B=[t+L*T,e-F*k],V=[a+L*N,l-F*D],j=[a,l];if(B[0]=2*z[0]-B[0],B[1]=2*z[1]-B[1],u)return[B,V,j].concat(y);for(var R=[],I=(y=[B,V,j].concat(y).join().split(",")).length,_=0;_<I;_+=1)R[_]=_%2?wl(+y[_-1],+y[_],v).y:wl(+y[_],+y[_+1],v).x;return R}function El(t){var e=function(t){if(!t)return null;var e="\t\n\v\f\r    \u2028\u2029",n=new RegExp("([a-z])["+e+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+e+"]*,?["+e+"]*)+)","ig"),r=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+e+"]*,?["+e+"]*","ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return t.replace(n,(function(t,e,n){var a=[],l=e.toLowerCase();n.replace(r,(function(t,e){return e&&a.push(+e),t})),"m"===l&&a.length>2&&(o.push(s([e],a.splice(0,2),!0)),l="l",e="m"===e?"l":"L");for(var u=i[l];a.length>=u&&(o.push(s([e],a.splice(0,u),!0)),u););return t})),o}(t);if(!e||!e.length)return[["M",0,0]];for(var n=0,r=0,i=0,o=0,a=[],l=0,u=e.length;l<u;l+=1){var c=[];a.push(c);var h=e[l],p=h[0];if(p!==p.toUpperCase())switch(c[0]=p.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+n,c[7]=+h[7]+r;break;case"V":c[1]=+h[1]+r;break;case"H":c[1]=+h[1]+n;break;case"M":i=+h[1]+n,o=+h[2]+r;for(var d=1,f=h.length;d<f;d+=1)c[d]=+h[d]+(d%2?n:r);break;default:for(d=1,f=h.length;d<f;d+=1)c[d]=+h[d]+(d%2?n:r)}else for(d=0,f=h.length;d<f;d+=1)c[d]=h[d];switch(c[0]){case"Z":n=+i,r=+o;break;case"H":n=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],o=c[c.length-1],n=c[c.length-2],r=c[c.length-1];break;default:n=c[c.length-2],r=c[c.length-1]}}return a}function Ml(t){var e=El(t),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=null,e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":return 0===parseFloat(t[1])||0===parseFloat(t[2])?["L",t[6],t[7]]:["C"].concat(Al.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),["C",r,i].concat(t.slice(1));case"T":return"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),["C"].concat(Pl(e.x,e.y,e.qx,e.qy,t[1],t[2]));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(Pl(e.x,e.y,t[1],t[2],t[3],t[4]));case"H":return["L"].concat(t[1],e.y);case"V":return["L"].concat(e.x,t[1])}return t}function i(t,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)o[n]="A",n+=1,t.splice(n,0,["C"].concat(r.splice(0,6)));t.splice(n,1),a=e.length}}for(var o=[],s="",a=e.length,l=0;l<a;l+=1){var u="";e[l]&&(u=e[l][0]),"C"!==u&&(o[l]=u,l>0&&(s=o[l-1])),e[l]=r(e[l],n,s),"A"!==o[l]&&"C"===u&&(o[l]="C"),i(e,l);var c=e[l],h=c.length;n.x=c[h-2],n.y=c[h-1],n.bx=parseFloat(c[h-4])||n.x,n.by=parseFloat(c[h-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function Sl(t){return Ml(t).map((function(t){return t.map((function(t){return"string"==typeof t?t:sl(t,2)}))})).join(",").split(",").join(" ")}!function(e){e.create=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length,o=n[0];if(t.Curve.isCurve(o))return new e(o);if(t.Point.isPointLike(o)){if(3===i)return new e(n[0],n[1],n[2]);for(var s=[],a=0;a<i;a+=3)s.push(new e(n[a],n[a+1],n[a+2]));return s}if(6===i)return new e(n[0],n[1],n[2],n[3],n[4],n[5]);var l=[];for(a=0;a<i;a+=6)l.push(new e(n[a],n[a+1],n[a+2],n[a+3],n[a+4],n[a+5]));return l}}(xl||(xl={}));var kl=new RegExp("^[\\s\\dLMCZz,.]*$");function Tl(t){return"string"==typeof t&&kl.test(t)}function Dl(t,e){return(t%e+e)%e}function Nl(e,n){void 0===n&&(n={});var r=[];return e&&e.length&&e.forEach((function(t){Array.isArray(t)?r.push({x:t[0],y:t[1]}):r.push({x:t.x,y:t.y})})),function(e,n,r,i,o){var s=[],a=e[e.length-1],l=null!=n&&n>0,u=n||0;if(i&&l){var c=(e=e.slice())[0],h=new t.Point(a.x+(c.x-a.x)/2,a.y+(c.y-a.y)/2);e.splice(0,0,h)}var p=e[0],d=1;for(r?s.push("M",p.x,p.y):s.push("L",p.x,p.y);d<(i?e.length:e.length-1);){var f=e[Dl(d,e.length)],g=p.x-f.x,v=p.y-f.y;if(l&&(0!==g||0!==v)&&(null==o||o.indexOf(d-1)<0)){var y=Math.sqrt(g*g+v*v),m=g*Math.min(u,y/2)/y,b=v*Math.min(u,y/2)/y,C=f.x+m,x=f.y+b;s.push("L",C,x);for(var w=e[Dl(d+1,e.length)];d<e.length-2&&0===Math.round(w.x-f.x)&&0===Math.round(w.y-f.y);)w=e[Dl(d+2,e.length)],d+=1;g=w.x-f.x,v=w.y-f.y,y=Math.max(1,Math.sqrt(g*g+v*v));var P=g*Math.min(u,y/2)/y,A=v*Math.min(u,y/2)/y,E=f.x+P,M=f.y+A;s.push("Q",f.x,f.y,E,M),f=new t.Point(E,M)}else s.push("L",f.x,f.y);p=f,d+=1}return i?s.push("Z"):s.push("L",a.x,a.y),s.map((function(t){return"string"==typeof t?t:+t.toFixed(3)})).join(" ")}(r,n.round,null==n.initialMove||n.initialMove,n.close,n.exclude)}function Ol(t,e,n,r,i,o,s,a,l){if(void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0),0===n||0===r)return[];a-=t,l-=e,n=Math.abs(n),r=Math.abs(r);var u,c=-a/2,h=-l/2,p=Math.cos(i*Math.PI/180),d=Math.sin(i*Math.PI/180),f=p*c+d*h,g=-1*d*c+p*h,v=f*f,y=g*g,m=n*n,b=r*r,C=v/m+y/b;if(C>1)n=Math.sqrt(C)*n,r=Math.sqrt(C)*r,u=0;else{var x=1;o===s&&(x=-1),u=x*Math.sqrt((m*b-m*y-b*v)/(m*y+b*v))}var w=u*n*g/r,P=-1*u*r*f/n,A=p*w-d*P+a/2,E=d*w+p*P+l/2,M=Math.atan2((g-P)/r,(f-w)/n)-Math.atan2(0,1),S=M>=0?M:2*Math.PI+M,k=(M=Math.atan2((-g-P)/r,(-f-w)/n)-Math.atan2((g-P)/r,(f-w)/n))>=0?M:2*Math.PI+M;0===s&&k>0?k-=2*Math.PI:0!==s&&k<0&&(k+=2*Math.PI);for(var T=2*k/Math.PI,D=Math.ceil(T<0?-1*T:T),N=k/D,O=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),L=p*n,F=p*r,z=d*n,B=d*r,V=Math.cos(S),j=Math.sin(S),R=-O*(L*j+B*V),I=-O*(z*j-F*V),_=0,G=0,H=[],U=0;U<D;U+=1){S+=N,_=L*(V=Math.cos(S))-B*(j=Math.sin(S))+A,G=z*V+F*j+E;var q=-O*(L*j+B*V),$=-O*(z*j-F*V),W=6*U;H[W]=Number(R+t),H[W+1]=Number(I+e),H[W+2]=Number(_-q+t),H[W+3]=Number(G-$+e),H[W+4]=Number(_+t),H[W+5]=Number(G+e),R=_+q,I=G+$}return H.map((function(t){return+t.toFixed(2)}))}function Ll(t,e,n,r,i,o,s,a,l){void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0);var u=[],c=Ol(t,e,n,r,i,o,s,a,l);if(null!=c)for(var h=0,p=c.length;h<p;h+=6)u.push("C",c[h],c[h+1],c[h+2],c[h+3],c[h+4],c[h+5]);return u.join(" ")}function Fl(e,n,r){for(var i,o=r.eol,s=r.baseSize,a=r.lineHeight,l=0,u={},c=n.length-1,h=0;h<=c;h+=1){var p=n[h],d=null;if("object"==typeof p){var f=p.attrs,g=t.Vector.create("tspan",f);i=g.node;var v=p.t;o&&h===c&&(v+=o),i.textContent=v;var y=f.class;y&&g.addClass(y),r.includeAnnotationIndices&&g.attr("annotations",p.annotations.join(",")),void 0===(d=parseFloat(f["font-size"]))&&(d=s),d&&d>l&&(l=d)}else o&&h===c&&(p+=o),i=document.createTextNode(p||" "),s&&s>l&&(l=s);e.appendChild(i)}return l&&(u.maxFontSize=l),a?u.lineHeight=a:l&&(u.lineHeight=1.2*l),u}t.Path=function(e){function r(n){var i=e.call(this)||this;if(i.PRECISION=3,i.segments=[],Array.isArray(n))if(t.Line.isLine(n[0])||t.Curve.isCurve(n[0])){var o=null;n.forEach((function(e,n){0===n&&i.appendSegment(r.createSegment("M",e.start)),null==o||o.end.equals(e.start)||i.appendSegment(r.createSegment("M",e.start)),t.Line.isLine(e)?i.appendSegment(r.createSegment("L",e.end)):t.Curve.isCurve(e)&&i.appendSegment(r.createSegment("C",e.controlPoint1,e.controlPoint2,e.end)),o=e}))}else{n.forEach((function(t){t.isSegment&&i.appendSegment(t)}))}else null!=n&&(t.Line.isLine(n)?(i.appendSegment(r.createSegment("M",n.start)),i.appendSegment(r.createSegment("L",n.end))):t.Curve.isCurve(n)?(i.appendSegment(r.createSegment("M",n.start)),i.appendSegment(r.createSegment("C",n.controlPoint1,n.controlPoint2,n.end))):t.Polyline.isPolyline(n)?n.points&&n.points.length&&n.points.forEach((function(t,e){var n=0===e?r.createSegment("M",t):r.createSegment("L",t);i.appendSegment(n)})):n.isSegment&&i.appendSegment(n));return i}return n(r,e),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"start",{get:function(){var t=this.segments,e=t.length;if(0===e)return null;for(var n=0;n<e;n+=1){var r=t[n];if(r.isVisible)return r.start}return t[e-1].end},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"end",{get:function(){var t=this.segments,e=t.length;if(0===e)return null;for(var n=e-1;n>=0;n-=1){var r=t[n];if(r.isVisible)return r.end}return t[e-1].end},enumerable:!1,configurable:!0}),r.prototype.moveTo=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.appendSegment((t=Cl.create).call.apply(t,s([null],e,!1)))},r.prototype.lineTo=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.appendSegment((t=ml.create).call.apply(t,s([null],e,!1)))},r.prototype.curveTo=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.appendSegment((t=xl.create).call.apply(t,s([null],e,!1)))},r.prototype.arcTo=function(e,n,r,i,o,s,a){var l=this.end||new t.Point,u="number"==typeof s?Ol(l.x,l.y,e,n,r,i,o,s,a):Ol(l.x,l.y,e,n,r,i,o,s.x,s.y);if(null!=u)for(var c=0,h=u.length;c<h;c+=6)this.curveTo(u[c],u[c+1],u[c+2],u[c+3],u[c+4],u[c+5]);return this},r.prototype.quadTo=function(e,n,i,o){var s=this.end||new t.Point,a=["M",s.x,s.y];if("number"==typeof e)a.push("Q",e,n,i,o);else{var l=n;a.push("Q",e.x,e.y,l.x,l.y)}var u=r.parse(a.join(" "));return this.appendSegment(u.segments.slice(1)),this},r.prototype.close=function(){return this.appendSegment(bl.create())},r.prototype.drawPoints=function(t,e){void 0===e&&(e={});var n=Nl(t,e),i=r.parse(n);i&&i.segments&&this.appendSegment(i.segments)},r.prototype.bbox=function(){var e,n=this.segments,r=n.length;if(0===r)return null;for(var i=0;i<r;i+=1){var o=n[i];if(o.isVisible){var s=o.bbox();null!=s&&(e=e?e.union(s):s)}}if(null!=e)return e;var a=n[r-1];return new t.Rectangle(a.end.x,a.end.y,0,0)},r.prototype.appendSegment=function(t){var e,n=this.segments.length,r=0!==n?this.segments[n-1]:null;if(Array.isArray(t))for(var i=0,o=t.length;i<o;i+=1){var s=t[i];e=this.prepareSegment(s,r,null),this.segments.push(e),r=e}else null!=t&&t.isSegment&&(e=this.prepareSegment(t,r,null),this.segments.push(e));return this},r.prototype.insertSegment=function(t,e){var n,r=this.segments.length;if(t<0&&(t=r+t+1),t>r||t<0)throw new Error("Index out of range.");var i=null,o=null;if(0!==r&&(t>=1?o=(i=this.segments[t-1]).nextSegment:(i=null,o=this.segments[0])),Array.isArray(e))for(var s=0,a=e.length;s<a;s+=1){var l=e[s];n=this.prepareSegment(l,i,o),this.segments.splice(t+s,0,n),i=n}else n=this.prepareSegment(e,i,o),this.segments.splice(t,0,n);return this},r.prototype.removeSegment=function(t){var e=this.fixIndex(t),n=this.segments.splice(e,1)[0],r=n.previousSegment,i=n.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),n.isSubpathStart&&i&&this.updateSubpathStartSegment(i),n},r.prototype.replaceSegment=function(t,e){var n,r=this.fixIndex(t),i=this.segments[r],o=i.previousSegment,s=i.nextSegment,a=i.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(var l=0,u=e.length;l<u;l+=1){var c=e[l];n=this.prepareSegment(c,o,s),this.segments.splice(t+l,0,n),o=n,a&&n.isSubpathStart&&(a=!1)}}else n=this.prepareSegment(e,o,s),this.segments.splice(r,1,n),a&&n.isSubpathStart&&(a=!1);a&&s&&this.updateSubpathStartSegment(s)},r.prototype.getSegment=function(t){var e=this.fixIndex(t);return this.segments[e]},r.prototype.fixIndex=function(t){var e=this.segments.length;if(0===e)throw new Error("Path has no segments.");for(var n=t;n<0;)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n},r.prototype.segmentAt=function(t,e){void 0===e&&(e={});var n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null},r.prototype.segmentAtLength=function(t,e){void 0===e&&(e={});var n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null},r.prototype.segmentIndexAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=ll(t,0,1),r=this.getOptions(e),i=this.length(r)*n;return this.segmentIndexAtLength(i,r)},r.prototype.segmentIndexAtLength=function(t,e){void 0===e&&(e={});var n=this.segments.length;if(0===n)return null;var r=!0;t<0&&(r=!1,t=-t);for(var i=this.getPrecision(e),o=this.getSubdivisions(e),s=0,a=null,l=0;l<n;l+=1){var u=r?l:n-1-l,c=this.segments[u],h=o[u],p=c.length({precision:i,subdivisions:h});if(c.isVisible){if(t<=s+p)return u;a=u}s+=p}return a},r.prototype.getSegmentSubdivisions=function(t){void 0===t&&(t={});for(var e=this.getPrecision(t),n=[],r=0,i=this.segments.length;r<i;r+=1){var o=this.segments[r].getSubdivisions({precision:e});n.push(o)}return n},r.prototype.updateSubpathStartSegment=function(t){for(var e=t.previousSegment,n=t;n&&!n.isSubpathStart;)n.subpathStartSegment=null!=e?e.subpathStartSegment:null,e=n,n=n.nextSegment},r.prototype.prepareSegment=function(t,e,n){t.previousSegment=e,t.nextSegment=n,null!=e&&(e.nextSegment=t),null!=n&&(n.previousSegment=t);var r=t;return t.isSubpathStart&&(t.subpathStartSegment=t,r=n),null!=r&&this.updateSubpathStartSegment(r),t},r.prototype.closestPoint=function(t,e){void 0===e&&(e={});var n=this.closestPointT(t,e);return n?this.pointAtT(n):null},r.prototype.closestPointLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e),r=this.closestPointT(t,n);return r?this.lengthAtT(r,n):0},r.prototype.closestPointNormalizedLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e),r=this.closestPointLength(t,n);if(0===r)return 0;var i=this.length(n);return 0===i?0:r/i},r.prototype.closestPointT=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;for(var n,r=this.getPrecision(e),i=this.getSubdivisions(e),o=1/0,s=0,a=this.segments.length;s<a;s+=1){var l=this.segments[s],u=i[s];if(l.isVisible){var c=l.closestPointT(t,{precision:r,subdivisions:u}),h=hl(l.pointAtT(c),t);h<o&&(n={segmentIndex:s,value:c},o=h)}}return n||{segmentIndex:this.segments.length-1,value:1}},r.prototype.closestPointTangent=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;for(var n,r=this.getPrecision(e),i=this.getSubdivisions(e),o=1/0,s=0,a=this.segments.length;s<a;s+=1){var l=this.segments[s],u=i[s];if(l.isDifferentiable()){var c=l.closestPointT(t,{precision:r,subdivisions:u}),h=hl(l.pointAtT(c),t);h<o&&(n=l.tangentAtT(c),o=h)}}return n||null},r.prototype.containsPoint=function(t,e){void 0===e&&(e={});var n=this.toPolylines(e);if(!n)return!1;for(var r=0,i=0,o=n.length;i<o;i+=1){n[i].containsPoint(t)&&(r+=1)}return r%2==1},r.prototype.pointAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();var n=this.getOptions(e),r=this.length(n)*t;return this.pointAtLength(r,n)},r.prototype.pointAtLength=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;if(0===t)return this.start.clone();var n=!0;t<0&&(n=!1,t=-t);for(var r,i=this.getPrecision(e),o=this.getSubdivisions(e),s=0,a=0,l=this.segments.length;a<l;a+=1){var u=n?a:l-1-a,c=this.segments[u],h=o[u],p=c.length({precision:i,subdivisions:h});if(c.isVisible){if(t<=s+p)return c.pointAtLength((n?1:-1)*(t-s),{precision:i,subdivisions:h});r=c}s+=p}return r?n?r.end:r.start:this.segments[this.segments.length-1].end.clone()},r.prototype.pointAtT=function(t){var e=this.segments,n=e.length;if(0===n)return null;var r=t.segmentIndex;if(r<0)return e[0].pointAtT(0);if(r>=n)return e[n-1].pointAtT(1);var i=ll(t.value,0,1);return e[r].pointAtT(i)},r.prototype.divideAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=ll(t,0,1),r=this.getOptions(e),i=this.length(r)*n;return this.divideAtLength(i,r)},r.prototype.divideAtLength=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=!0;t<0&&(n=!1,t=-t);for(var i,o,s,a,l,u=this.getPrecision(e),c=this.getSubdivisions(e),h=0,p=0,d=this.segments.length;p<d;p+=1){var f=n?p:d-1-p,g=this.getSegment(f),v={precision:u,subdivisions:c[f]},y=g.length(v);if(g.isDifferentiable()&&(s=g,a=f,t<=h+y)){o=f,i=g.divideAtLength((n?1:-1)*(t-h),v);break}h+=y}if(!s)return null;i||(o=a,l=n?1:0,i=s.divideAtT(l));var m=this.clone(),b=o;m.replaceSegment(b,i);var C=b,x=b+1,w=b+2;i[0].isDifferentiable()||(m.removeSegment(C),x-=1,w-=1);var P=m.getSegment(x).start;m.insertSegment(x,r.createSegment("M",P)),w+=1,i[1].isDifferentiable()||(m.removeSegment(w-1),w-=1);var A=w-C-1;for(p=w,d=m.segments.length;p<d;p+=1){var E=this.getSegment(p-A);if("Z"===(g=m.getSegment(p)).type&&!E.subpathStartSegment.end.equals(g.subpathStartSegment.end)){var M=r.createSegment("L",E.end);m.replaceSegment(p,M)}}return[new r(m.segments.slice(0,x)),new r(m.segments.slice(x))]},r.prototype.intersectsWithLine=function(t,e){void 0===e&&(e={});var n=this.toPolylines(e);if(null==n)return null;for(var r=null,i=0,o=n.length;i<o;i+=1){var s=n[i],a=t.intersect(s);a&&(null==r&&(r=[]),Array.isArray(a)?r.push.apply(r,a):r.push(a))}return r},r.prototype.isDifferentiable=function(){for(var t=0,e=this.segments.length;t<e;t+=1){if(this.segments[t].isDifferentiable())return!0}return!1},r.prototype.isValid=function(){var t=this.segments;return 0===t.length||"M"===t[0].type},r.prototype.length=function(t){if(void 0===t&&(t={}),0===this.segments.length)return 0;for(var e=this.getSubdivisions(t),n=0,r=0,i=this.segments.length;r<i;r+=1){var o=this.segments[r],s=e[r];n+=o.length({subdivisions:s})}return n},r.prototype.lengthAtT=function(t,e){void 0===e&&(e={});var n=this.segments.length;if(0===n)return 0;var r=t.segmentIndex;if(r<0)return 0;var i=ll(t.value,0,1);r>=n&&(r=n-1,i=1);for(var o=this.getPrecision(e),s=this.getSubdivisions(e),a=0,l=0;l<r;l+=1){var u=this.segments[l],c=s[l];a+=u.length({precision:o,subdivisions:c})}var h=this.segments[r],p=s[r];return a+=h.lengthAtT(i,{precision:o,subdivisions:p})},r.prototype.tangentAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=ll(t,0,1),r=this.getOptions(e),i=this.length(r)*n;return this.tangentAtLength(i,r)},r.prototype.tangentAtLength=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=!0;t<0&&(n=!1,t=-t);for(var r,i=this.getPrecision(e),o=this.getSubdivisions(e),s=0,a=0,l=this.segments.length;a<l;a+=1){var u=n?a:l-1-a,c=this.segments[u],h=o[u],p=c.length({precision:i,subdivisions:h});if(c.isDifferentiable()){if(t<=s+p)return c.tangentAtLength((n?1:-1)*(t-s),{precision:i,subdivisions:h});r=c}s+=p}if(r){var d=n?1:0;return r.tangentAtT(d)}return null},r.prototype.tangentAtT=function(t){var e=this.segments.length;if(0===e)return null;var n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);var r=ll(t.value,0,1);return this.segments[n].tangentAtT(r)},r.prototype.getPrecision=function(t){return void 0===t&&(t={}),null==t.precision?this.PRECISION:t.precision},r.prototype.getSubdivisions=function(t){if(void 0===t&&(t={}),null==t.segmentSubdivisions){var e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions},r.prototype.getOptions=function(t){return void 0===t&&(t={}),{precision:this.getPrecision(t),segmentSubdivisions:this.getSubdivisions(t)}},r.prototype.toPoints=function(t){void 0===t&&(t={});var e=this.segments,n=e.length;if(0===n)return null;for(var r=this.getSubdivisions(t),i=[],o=[],s=0;s<n;s+=1){var a=e[s];if(a.isVisible){var l=r[s];l.length>0?l.forEach((function(t){return o.push(t.start)})):o.push(a.start)}else o.length>0&&(o.push(e[s-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i},r.prototype.toPolylines=function(e){void 0===e&&(e={});var n=this.toPoints(e);return n?n.map((function(e){return new t.Polyline(e)})):null},r.prototype.scale=function(t,e,n){return this.segments.forEach((function(r){return r.scale(t,e,n)})),this},r.prototype.rotate=function(t,e){return this.segments.forEach((function(n){return n.rotate(t,e)})),this},r.prototype.translate=function(t,e){return"number"==typeof t?this.segments.forEach((function(n){return n.translate(t,e)})):this.segments.forEach((function(e){return e.translate(t)})),this},r.prototype.clone=function(){var t=new r;return this.segments.forEach((function(e){return t.appendSegment(e.clone())})),t},r.prototype.equals=function(t){if(null==t)return!1;var e=this.segments,n=t.segments,r=e.length;if(n.length!==r)return!1;for(var i=0;i<r;i+=1){var o=e[i],s=n[i];if(o.type!==s.type||!o.equals(s))return!1}return!0},r.prototype.toJSON=function(){return this.segments.map((function(t){return t.toJSON()}))},r.prototype.serialize=function(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map((function(t){return t.serialize()})).join(" ")},r.prototype.toString=function(){return this.serialize()},r}(vl),function(t){t.toStringTag="X6.Geometry."+t.name,t.isPath=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return!(null!=n&&n!==t.toStringTag||!Array.isArray(r.segments)||"function"!=typeof r.moveTo||"function"!=typeof r.lineTo||"function"!=typeof r.curveTo)}}(t.Path||(t.Path={})),function(t){function e(t){for(var e,n,r,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if("M"===t)return(e=Cl.create).call.apply(e,s([null],i,!1));if("L"===t)return(n=ml.create).call.apply(n,s([null],i,!1));if("C"===t)return(r=xl.create).call.apply(r,s([null],i,!1));if("z"===t||"Z"===t)return bl.create();throw new Error('Invalid path segment type "'+t+'"')}t.parse=function(n){if(!n)return new t;var r=new t,i=t.normalize(n).match(/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g);if(null!=i)for(var o=0,a=i.length;o<a;o+=1){var l=i[o].match(/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g);if(null!=l){var u=l[0],c=l.slice(1).map((function(t){return+t})),h=e.call.apply(e,s([null,u],c,!1));r.appendSegment(h)}}return r},t.createSegment=e}(t.Path||(t.Path={})),function(t){t.normalize=Sl,t.isValid=Tl,t.drawArc=Ll,t.drawPoints=Nl,t.arcToCurves=Ol}(t.Path||(t.Path={})),t.Vector=function(){function e(t,n,r){if(!t)throw new TypeError("Invalid element to create vector");var i;if(e.isVector(t))i=t.node;else if("string"==typeof t)if("svg"===t.toLowerCase())i=ya();else if("<"===t[0]){var o=ya(t);i=document.importNode(o.firstChild,!0)}else i=document.createElementNS(pa.svg,t);else i=t;this.node=i,n&&this.setAttributes(n),r&&this.append(r)}return Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.node.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.node.id},set:function(t){this.node.id=t},enumerable:!1,configurable:!0}),e.prototype.transform=function(t,e){return null==t?Tu(this.node):(Tu(this.node,t,e),this)},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n={}),null==t?Du(this.node):(Du(this.node,t,e,n),this)},e.prototype.rotate=function(t,e,n,r){return void 0===r&&(r={}),null==t?Nu(this.node):(Nu(this.node,t,e,n,r),this)},e.prototype.scale=function(t,e){return null==t?Ou(this.node):(Ou(this.node,t,e),this)},e.prototype.getTransformToElement=function(t){var n=e.toNode(t);return Cu(this.node,n)},e.prototype.removeAttribute=function(t){return Fa(this.node,t),this},e.prototype.getAttribute=function(t){return La(this.node,t)},e.prototype.setAttribute=function(t,e){return za(this.node,t,e),this},e.prototype.setAttributes=function(t){return Ba(this.node,t),this},e.prototype.attr=function(t,e){return null==t?Va(this.node):"string"==typeof t&&void 0===e?Va(this.node,t):("object"==typeof t?Va(this.node,t):Va(this.node,t,e),this)},e.prototype.svg=function(){return this.node instanceof SVGSVGElement?this:e.create(this.node.ownerSVGElement)},e.prototype.defs=function(){var t=this.svg()||this,n=t.node.getElementsByTagName("defs")[0];return n?e.create(n):e.create("defs").appendTo(t)},e.prototype.text=function(t,e){return void 0===e&&(e={}),Vl(this.node,t,e),this},e.prototype.tagName=function(){return ba(this.node)},e.prototype.clone=function(){return e.create(this.node.cloneNode(!0))},e.prototype.remove=function(){return Ea(this.node),this},e.prototype.empty=function(){return Ma(this.node),this},e.prototype.append=function(t){return Sa(this.node,e.toNodes(t)),this},e.prototype.appendTo=function(t){return Da(this.node,e.isVector(t)?t.node:t),this},e.prototype.prepend=function(t){return ka(this.node,e.toNodes(t)),this},e.prototype.before=function(t){return Ta(this.node,e.toNodes(t)),this},e.prototype.replace=function(t){return this.node.parentNode&&this.node.parentNode.replaceChild(e.toNode(t),this.node),e.create(t)},e.prototype.first=function(){return this.node.firstChild?e.create(this.node.firstChild):null},e.prototype.last=function(){return this.node.lastChild?e.create(this.node.lastChild):null},e.prototype.get=function(t){var n=this.node.childNodes[t];return n?e.create(n):null},e.prototype.indexOf=function(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(e.toNode(t))},e.prototype.find=function(t){var n=[],r=xa(this.node,t);if(r)for(var i=0,o=r.length;i<o;i+=1)n.push(e.create(r[i]));return n},e.prototype.findOne=function(t){var n=wa(this.node,t);return n?e.create(n):null},e.prototype.findParentByClass=function(t,n){var r=Pa(this.node,t,n);return r?e.create(r):null},e.prototype.matches=function(t){var e=this.node;this.node.matches;var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)},e.prototype.contains=function(t){return Aa(this.node,e.isVector(t)?t.node:t)},e.prototype.wrap=function(t){var n=e.create(t),r=this.node.parentNode;return null!=r&&r.insertBefore(n.node,this.node),n.append(this)},e.prototype.parent=function(t){var n=this;if(null==n.node.parentNode)return null;if(n=e.create(n.node.parentNode),null==t)return n;do{if("string"==typeof t?n.matches(t):n instanceof t)return n}while(n=e.create(n.node.parentNode));return n},e.prototype.children=function(){for(var t=this.node.childNodes,n=[],r=0;r<t.length;r+=1){1===t[r].nodeType&&n.push(e.create(t[r]))}return n},e.prototype.eachChild=function(t,e){for(var n=this.children(),r=0,i=n.length;r<i;r+=1)t.call(n[r],n[r],r,n),e&&n[r].eachChild(t,e);return this},e.prototype.index=function(){return Ca(this.node)},e.prototype.hasClass=function(t){return ia(this.node,t)},e.prototype.addClass=function(t){return oa(this.node,t),this},e.prototype.removeClass=function(t){return sa(this.node,t),this},e.prototype.toggleClass=function(t,e){return aa(this.node,t,e),this},e.prototype.toLocalPoint=function(t,e){return xu(this.node,t,e)},e.prototype.toGeometryShape=function(){return wu(this.node)},e.prototype.translateCenterToPoint=function(t){var e=this.getBBox({target:this.svg()}).getCenter();return this.translate(t.x-e.x,t.y-e.y),this},e.prototype.translateAndAutoOrient=function(t,e,n){return Lu(this.node,t,e,n),this},e.prototype.animate=function(t){return Pu(this.node,t)},e.prototype.animateTransform=function(t){return Au(this.node,t)},e.prototype.animateAlongPath=function(t,e){return Su(this.node,t,e)},e.prototype.normalizePath=function(){return"path"===this.tagName()&&this.attr("d",t.Path.normalize(this.attr("d"))),this},e.prototype.bbox=function(t,e){return mu(this.node,t,e)},e.prototype.getBBox=function(t){return void 0===t&&(t={}),bu(this.node,{recursive:t.recursive,target:t.target?e.toNode(t.target):null})},e.prototype.sample=function(t){return void 0===t&&(t=1),this.node instanceof SVGPathElement?_l(this.node,t):[]},e.prototype.toPath=function(){return e.create(Zl(this.node))},e.prototype.toPathData=function(){return Kl(this.node)},e}(),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&r.node instanceof SVGElement&&"function"==typeof r.animate&&"function"==typeof r.sample&&"function"==typeof r.normalizePath&&"function"==typeof r.toPath}function n(e,n,r){return new t(e,n,r)}function r(t){return e(t)?t.node:t}t.toStringTag="X6."+t.name,t.isVector=e,t.create=n,t.createVectors=function(t){if("<"===t[0]){for(var e=ya(t),r=[],i=0,o=e.childNodes.length;i<o;i+=1){var s=e.childNodes[i];r.push(n(document.importNode(s,!0)))}return r}return[n(t)]},t.toNode=r,t.toNodes=function(t){return Array.isArray(t)?t.map((function(t){return r(t)})):[r(t)]}}(t.Vector||(t.Vector={}));var zl=/em$/;function Bl(t,e){var n=parseFloat(t);return zl.test(t)?n*e:n}function Vl(e,n,r){void 0===r&&(r={}),n=Ha(n);var i=r.eol,o=r.textPath,s=r.textVerticalAnchor,a="middle"===s||"bottom"===s||"top"===s,l=r.x;void 0===l&&(l=e.getAttribute("x")||0);var u=r.includeAnnotationIndices,c=r.annotations;c&&!Array.isArray(c)&&(c=[c]);var h=r.lineHeight,p="auto"===h,d=p?"1.5em":h||"1em";Ma(e),Va(e,{"xml:space":"preserve",display:n||r.displayEmpty?null:"none"});var f,g,v=Va(e,"font-size"),y=parseFloat(v);y||(y=16,!a&&!c||v||Va(e,"font-size",""+y)),o?("string"==typeof o&&(o={d:o}),f=function(e,n){var r=t.Vector.create(n),i=t.Vector.create("textPath"),o=e.d;if(o&&void 0===e["xlink:href"]){var s=t.Vector.create("path").attr("d",o).appendTo(r.defs());i.attr("xlink:href","#"+s.id)}return"object"==typeof e&&i.attr(e),i.node}(o,e)):f=document.createDocumentFragment();for(var m,b=0,C=n.split("\n"),x=[],w=C.length-1,P=0;P<=w;P+=1){g=d;var A="v-line",E=va("tspan"),M=void 0,S=C[P];if(S)if(c){var k=(M=Fl(E,Ga(S,c,{offset:-b,includeAnnotationIndices:u}),{eol:P!==w&&i,baseSize:y,lineHeight:p?null:d,includeAnnotationIndices:u})).lineHeight;k&&p&&0!==P&&(g=k),0===P&&(m=.8*M.maxFontSize)}else i&&P!==w&&(S+=i),E.textContent=S;else{E.textContent="-",A+=" v-empty-line";var T=E.style;T.fillOpacity=0,T.strokeOpacity=0,c&&(M={})}M&&x.push(M),P>0&&E.setAttribute("dy",g),(P>0||o)&&E.setAttribute("x",l),E.className.baseVal=A,f.appendChild(E),b+=S.length+1}if(a)if(c)g=function(t,e,n,r){if(!Array.isArray(e))return 0;var i=e.length;if(!i)return 0;for(var o=e[0],s=Bl(o.maxFontSize,n)||n,a=0,l=Bl(r,n),u=1;u<i;u+=1)a+=Bl((o=e[u]).lineHeight,n)||l;var c,h=Bl(o.maxFontSize,n)||n;switch(t){case"middle":c=s/2-.15*h-a/2;break;case"bottom":c=-.25*h-a;break;default:case"top":c=.8*s}return c}(s,x,y,d);else if("top"===s)g="0.8em";else{var D=void 0;switch(w>0?(D=parseFloat(d)||1,D*=w,zl.test(d)||(D/=y)):D=0,s){case"middle":g=.3-D/2+"em";break;case"bottom":g=-D-.3+"em"}}else 0===s?g="0em":s?g=s:(g=0,null==e.getAttribute("y")&&e.setAttribute("y",""+(m||"0.8em")));f.firstChild.setAttribute("dy",g),e.appendChild(f)}function jl(e,n,r,i){void 0===r&&(r={}),void 0===i&&(i={});var o=n.width,a=n.height,l=i.svgDocument||va("svg"),u=va("text"),c=va("tspan"),h=document.createTextNode("");Va(u,r),u.appendChild(c),u.style.opacity="0",u.style.display="block",c.style.display="block",c.appendChild(h),l.appendChild(u);var p=null==l.parentNode;p&&document.body.appendChild(l);for(var d,f,g,v=i.eol||"\n",y=i.separator||" ",m=i.hyphen?new RegExp(i.hyphen):/[^\w\d]/,b=!1!==i.breakWord,C=[],x={},w=[],P=function(t,e,n,r){var i=[],o=[];if(null!=e){var a=t.split(e);if(i.push.apply(i,a),"string"==typeof e)for(var l=0,u=a.length-1;l<u;l+=1)o.push(e);else{var c=t.match(new RegExp(e,"g"));for(l=0,u=a.length-1;l<u;l+=1)o.push(c?c[l]:"")}}else{var h="";for(l=0,u=t.length;l<u;l+=1){var p=t[l];" "===p?(i.push(h),o.push(" "),h=""):p.match(/[^\x00-\xff]/)?(h.length&&(i.push(h),o.push("")),i.push(p),o.push(""),h=""):h+=p}h.length&&i.push(h)}for(l=0;l<i.length;l+=1)if((h=i[l]).indexOf(n)>=0&&h.length>1){for(var d=0,f=(a=h.split(n)).length-1;d<f;d+=1)a.splice(2*d+1,0,n);var g=a.filter((function(t){return""!==t}));i.splice.apply(i,s([l,1],g,!1)),(c=g.map((function(){return""}))).pop(),o.splice.apply(o,s([l,0],c,!1))}for(l=0;l<i.length;l+=1){var v=(h=i[l]).search(r);v>0&&v<h.length-1&&(i.splice(l,1,h.substring(0,v+1),h.substring(v+1)),o.splice(l,0,""))}return{words:i,separators:o}}(e,i.separator,v,m),A=P.words,E=P.separators,M=0,S=0,k=A.length;M<k;M+=1){var T=A[M];if(T)if(T!==v){if(null!=w[S]?(g=E[M-1]||"",h.data=""+w[S]+g+T):h.data=T,c.getComputedTextLength()<=o)w[S]=h.data,x[S]=E[M],d&&(C[S]=!0,S+=1,d=0);else{if(b){if(!w[S]||d){var D=!!d,N=1===T.length;if(d=T.length-1,D||N){if(N){if(!w[S]){w=[];break}A.splice(M,2,T+A[M+1]),E.splice(M+1,1),C[S]=!0,S+=1,k-=1,M-=1;continue}A[M]=T.substring(0,d),A[M+1]=T.substring(d)+A[M+1]}else A.splice(M,1,T.substring(0,d),T.substring(d)),E.splice(M,0,""),k+=1,S&&!C[S-1]&&(S-=1);M-=1;continue}}else if(!w[S]){w[S]=T,C[S]=!0,S+=1;continue}S+=1,M-=1}if(null!=a){if(null==f){var O=void 0;f=(O="auto"===r.lineHeight?{value:1.5,unit:"em"}:Hs(r.lineHeight,["em"])||{value:1,unit:"em"}).value,"em"===O.unit&&(t.Platform.IS_FIREFOX?f*=c.getBBox().height:f*=u.getBBox().height)}if(f*w.length>a){var L=Math.floor(a/f)-1,F=w[L],z=w[L+1];if(w.splice(L+1),null==F)break;var B=i.ellipsis;if(!B)break;"string"!=typeof B&&(B="…");var V=F;z&&b&&(V+=g+z);var j=V.length,R=void 0,I=void 0;do{if(I=V[j],R=V.substring(0,j),I?I.match(y)&&(R+=I):R+=x[L],R+=B,h.data=R,c.getComputedTextLength()<=o){w[L]=R;break}j-=1}while(j>=0);break}}}else C[S]=!0,w[S+=1]=""}return Ea(p?l:u),w.join(v)}var Rl=.551784;function Il(t,e,n){void 0===n&&(n=NaN);var r=t.getAttribute(e);if(null==r)return n;var i=parseFloat(r);return Number.isNaN(i)?n:i}function _l(t,e){void 0===e&&(e=1);for(var n,r=t.getTotalLength(),i=[],o=0;o<r;)n=t.getPointAtLength(o),i.push({distance:o,x:n.x,y:n.y}),o+=e;return i}function Gl(t){return["M",Il(t,"x1"),Il(t,"y1"),"L",Il(t,"x2"),Il(t,"y2")].join(" ")}function Hl(t){var e=$l(t);return 0===e.length?null:ql(e)+" Z"}function Ul(t){var e=$l(t);return 0===e.length?null:ql(e)}function ql(t){return"M "+t.map((function(t){return t.x+" "+t.y})).join(" L")}function $l(t){var e=[],n=t.points;if(n)for(var r=0,i=n.numberOfItems;r<i;r+=1)e.push(n.getItem(r));return e}function Wl(t){var e=Il(t,"cx",0),n=Il(t,"cy",0),r=Il(t,"r"),i=r*Rl;return["M",e,n-r,"C",e+i,n-r,e+r,n-i,e+r,n,"C",e+r,n+i,e+i,n+r,e,n+r,"C",e-i,n+r,e-r,n+i,e-r,n,"C",e-r,n-i,e-i,n-r,e,n-r,"Z"].join(" ")}function Xl(t){var e=Il(t,"cx",0),n=Il(t,"cy",0),r=Il(t,"rx"),i=Il(t,"ry")||r,o=r*Rl,s=i*Rl;return["M",e,n-i,"C",e+o,n-i,e+r,n-s,e+r,n,"C",e+r,n+s,e+o,n+i,e,n+i,"C",e-o,n+i,e-r,n+s,e-r,n,"C",e-r,n-s,e-o,n-i,e,n-i,"Z"].join(" ")}function Yl(t){return Jl({x:Il(t,"x",0),y:Il(t,"y",0),width:Il(t,"width",0),height:Il(t,"height",0),rx:Il(t,"rx",0),ry:Il(t,"ry",0)})}function Jl(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=Math.min(t.rx||t["top-rx"]||0,r/2),s=Math.min(t.rx||t["bottom-rx"]||0,r/2),a=Math.min(t.ry||t["top-ry"]||0,i/2),l=Math.min(t.ry||t["bottom-ry"]||0,i/2);return(o||s||a||l?["M",e,n+a,"v",i-a-l,"a",s,l,0,0,0,s,l,"h",r-2*s,"a",s,l,0,0,0,s,-l,"v",-(i-l-a),"a",o,a,0,0,0,-o,-a,"h",-(r-2*o),"a",o,a,0,0,0,-o,a,"Z"]:["M",e,n,"H",e+r,"V",n+i,"H",e,"V",n,"Z"]).join(" ")}function Zl(t){var e=va("path");Va(e,Va(t));var n=Kl(t);return n&&e.setAttribute("d",n),e}function Kl(t){var e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return Gl(t);case"polygon":return Hl(t);case"polyline":return Ul(t);case"ellipse":return Xl(t);case"circle":return Wl(t);case"rect":return Yl(t)}throw new Error('"'+e+'" cannot be converted to svg path element.')}function Ql(t,e,n,r){var i=2*Math.PI-1e-6,o=t,s=e,a=n,l=r;if(l<a){var u=a;a=l,l=u}var c=l-a,h=c<Math.PI?"0":"1",p=Math.cos(a),d=Math.sin(a),f=Math.cos(l),g=Math.sin(l);return c>=i?o?"M0,"+s+"A"+s+","+s+" 0 1,1 0,"+-s+"A"+s+","+s+" 0 1,1 0,"+s+"M0,"+o+"A"+o+","+o+" 0 1,0 0,"+-o+"A"+o+","+o+" 0 1,0 0,"+o+"Z":"M0,"+s+"A"+s+","+s+" 0 1,1 0,"+-s+"A"+s+","+s+" 0 1,1 0,"+s+"Z":o?"M"+s*p+","+s*d+"A"+s+","+s+" 0 "+h+",1 "+s*f+","+s*g+"L"+o*f+","+o*g+"A"+o+","+o+" 0 "+h+",0 "+o*p+","+o*d+"Z":"M"+s*p+","+s*d+"A"+s+","+s+" 0 "+h+",1 "+s*f+","+s*g+"L0,0Z"}var tu=va("svg"),eu=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,nu=/[ ,]+/,ru=/^(\w+)\((.*)\)/;function iu(t,e){var n=tu.createSVGPoint();return n.x=t,n.y=e,n}function ou(t){var e=tu.createSVGMatrix();if(null!=t){var n=t,r=e;for(var i in n)r[i]=n[i]}return e}function su(t){return null!=t?(t instanceof DOMMatrix||(t=ou(t)),tu.createSVGTransformFromMatrix(t)):tu.createSVGTransform()}function au(t){var e=ou(),n=null!=t&&t.match(eu);if(!n)return e;for(var r=0,i=n.length;r<i;r+=1){var o=n[r].match(ru);if(o){var s=void 0,a=void 0,l=void 0,u=void 0,c=void 0,h=ou(),p=o[2].split(nu);switch(o[1].toLowerCase()){case"scale":s=parseFloat(p[0]),a=void 0===p[1]?s:parseFloat(p[1]),h=h.scaleNonUniform(s,a);break;case"translate":l=parseFloat(p[0]),u=parseFloat(p[1]),h=h.translate(l,u);break;case"rotate":c=parseFloat(p[0]),l=parseFloat(p[1])||0,u=parseFloat(p[2])||0,h=0!==l||0!==u?h.translate(l,u).rotate(c).translate(-l,-u):h.rotate(c);break;case"skewx":c=parseFloat(p[0]),h=h.skewX(c);break;case"skewy":c=parseFloat(p[0]),h=h.skewY(c);break;case"matrix":h.a=parseFloat(p[0]),h.b=parseFloat(p[1]),h.c=parseFloat(p[2]),h.d=parseFloat(p[3]),h.e=parseFloat(p[4]),h.f=parseFloat(p[5]);break;default:continue}e=e.multiply(h)}}return e}function lu(t){var e=t||{};return"matrix("+(null!=e.a?e.a:1)+","+(null!=e.b?e.b:0)+","+(null!=e.c?e.c:0)+","+(null!=e.d?e.d:1)+","+(null!=e.e?e.e:0)+","+(null!=e.f?e.f:0)+")"}function uu(t){var e,n,r;if(t){var i=nu;if(t.trim().indexOf("matrix")>=0){var o=hu(au(t));e=[o.translateX,o.translateY],n=[o.rotation],r=[o.scaleX,o.scaleY];var s=[];0===e[0]&&0===e[1]||s.push("translate("+e.join(",")+")"),1===r[0]&&1===r[1]||s.push("scale("+r.join(",")+")"),0!==n[0]&&s.push("rotate("+n[0]+")"),t=s.join(" ")}else{var a=t.match(/translate\((.*?)\)/);a&&(e=a[1].split(i));var l=t.match(/rotate\((.*?)\)/);l&&(n=l[1].split(i));var u=t.match(/scale\((.*?)\)/);u&&(r=u[1].split(i))}}var c=r&&r[0]?parseFloat(r[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:n&&n[0]?parseInt(n[0],10):0,cx:n&&n[1]?parseInt(n[1],10):void 0,cy:n&&n[2]?parseInt(n[2],10):void 0},scale:{sx:c,sy:r&&r[1]?parseFloat(r[1]):c}}}function cu(t,e){return{x:e.x*t.a+e.y*t.c+0,y:e.x*t.b+e.y*t.d+0}}function hu(t){var e=cu(t,{x:0,y:1}),n=cu(t,{x:1,y:0}),r=180/Math.PI*Math.atan2(e.y,e.x)-90;return{skewX:r,skewY:180/Math.PI*Math.atan2(n.y,n.x),translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:r}}function pu(t){var e,n,r,i;return t?(e=null==t.a?1:t.a,i=null==t.d?1:t.d,n=t.b,r=t.c):e=i=1,{sx:n?Math.sqrt(e*e+n*n):e,sy:r?Math.sqrt(r*r+i*i):i}}function du(e){var n={x:0,y:1};return e&&(n=cu(e,n)),{angle:t.Angle.normalize(t.Angle.toDeg(Math.atan2(n.y,n.x))-90)}}function fu(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function gu(e,n){var r=iu(e.x,e.y).matrixTransform(n);return new t.Point(r.x,r.y)}function vu(e,n){return new t.Line(gu(e.start,n),gu(e.end,n))}function yu(e,n){var r=tu.createSVGPoint();r.x=e.x,r.y=e.y;var i=r.matrixTransform(n);r.x=e.x+e.width,r.y=e.y;var o=r.matrixTransform(n);r.x=e.x+e.width,r.y=e.y+e.height;var s=r.matrixTransform(n);r.x=e.x,r.y=e.y+e.height;var a=r.matrixTransform(n),l=Math.min(i.x,o.x,s.x,a.x),u=Math.max(i.x,o.x,s.x,a.x),c=Math.min(i.y,o.y,s.y,a.y),h=Math.max(i.y,o.y,s.y,a.y);return new t.Rectangle(l,c,u-l,h-c)}function mu(e,n,r){var i,o=e.ownerSVGElement;if(!o)return new t.Rectangle(0,0,0,0);try{i=e.getBBox()}catch(t){i={x:e.clientLeft,y:e.clientTop,width:e.clientWidth,height:e.clientHeight}}return n?t.Rectangle.create(i):yu(i,Cu(e,r||o))}function bu(e,n){var r;if(void 0===n&&(n={}),!e.ownerSVGElement||!ha(e)){if(Na(e)){var i=ku(e),o=i.left,s=i.top,a=i.width,l=i.height;return new t.Rectangle(o,s,a,l)}return new t.Rectangle(0,0,0,0)}var u=n.target;if(!n.recursive){try{r=e.getBBox()}catch(t){r={x:e.clientLeft,y:e.clientTop,width:e.clientWidth,height:e.clientHeight}}return u?yu(r,Cu(e,u)):t.Rectangle.create(r)}var c=e.childNodes,h=c.length;if(0===h)return bu(e,{target:u});u||(u=e);for(var p=0;p<h;p+=1){var d=c[p],f=void 0;f=0===d.childNodes.length?bu(d,{target:u}):bu(d,{target:u,recursive:!0}),r=r?r.union(f):f}return r}function Cu(t,e){if(ha(e)&&ha(t)){var n=e.getScreenCTM(),r=t.getScreenCTM();if(n&&r)return n.inverse().multiply(r)}return ou()}function xu(t,e,n){var r=t instanceof SVGSVGElement?t:t.ownerSVGElement,i=r.createSVGPoint();i.x=e,i.y=n;try{var o=r.getScreenCTM(),s=i.matrixTransform(o.inverse()),a=Cu(t,r).inverse();return s.matrixTransform(a)}catch(t){return i}}function wu(e){var n=function(t){var n=e.getAttribute(t),r=n?parseFloat(n):0;return Number.isNaN(r)?0:r};switch(e instanceof SVGElement&&e.nodeName.toLowerCase()){case"rect":return new t.Rectangle(n("x"),n("y"),n("width"),n("height"));case"circle":return new t.Ellipse(n("cx"),n("cy"),n("r"),n("r"));case"ellipse":return new t.Ellipse(n("cx"),n("cy"),n("rx"),n("ry"));case"polyline":var r=$l(e);return new t.Polyline(r);case"polygon":return(r=$l(e)).length>1&&r.push(r[0]),new t.Polyline(r);case"path":var i=e.getAttribute("d");return t.Path.isValid(i)||(i=t.Path.normalize(i)),t.Path.parse(i);case"line":return new t.Line(n("x1"),n("y1"),n("x2"),n("y2"))}return bu(e)}function Pu(t,e){return Eu(t,e,"animate")}function Au(t,e){return Eu(t,e,"animateTransform")}function Eu(t,e,n){var r=va(n);t.appendChild(r);try{return Mu(r,e)}catch(t){}return function(){}}function Mu(t,e){var n=e.start,r=e.complete,o=e.repeat;Va(t,i(e,["start","complete","repeat"])),n&&t.addEventListener("beginEvent",n),r&&t.addEventListener("endEvent",r),o&&t.addEventListener("repeatEvent",o);var s=t;return s.beginElement(),function(){return s.endElement()}}function Su(t,e,n){var r=ca(n),i=va("animateMotion"),o=va("mpath");Va(o,{"xlink:href":"#"+r}),i.appendChild(o),t.appendChild(i);try{return Mu(i,e)}catch(t){if("fake"===document.documentElement.getAttribute("smiling")){var s=i;s.animators=[];var a=window,l=s.getAttribute("id");l&&(a.id2anim[l]=s);for(var u=a.getTargets(s),c=0,h=u.length;c<h;c+=1){var p=u[c],d=new a.Animator(s,p,c);a.animators.push(d),s.animators[c]=d,d.register()}}}return function(){}}function ku(t){var e=0,n=0,r=0,i=0;if(t){for(var o=t;o;)e+=o.offsetLeft,n+=o.offsetTop,(o=o.offsetParent)&&(e+=parseInt(nl(o,"borderLeft"),10),n+=parseInt(nl(o,"borderTop"),10));r=t.offsetWidth,i=t.offsetHeight}return{left:e,top:n,width:r,height:i}}function Tu(t,e,n){if(void 0===n&&(n={}),null==e)return au(Va(t,"transform"));if(n.absolute)t.setAttribute("transform",lu(e));else{var r=t.transform,i=su(e);r.baseVal.appendItem(i)}}function Du(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r={});var i=Va(t,"transform"),o=uu(i);if(null==e)return o.translation;i=(i=o.raw).replace(/translate\([^)]*\)/g,"").trim();var s="translate("+(r.absolute?e:o.translation.tx+e)+","+(r.absolute?n:o.translation.ty+n)+")";t.setAttribute("transform",(s+" "+i).trim())}function Nu(t,e,n,r,i){void 0===i&&(i={});var o=Va(t,"transform"),s=uu(o);if(null==e)return s.rotation;o=(o=s.raw).replace(/rotate\([^)]*\)/g,"").trim(),e%=360;var a="rotate("+(i.absolute?e:s.rotation.angle+e)+(null!=n&&null!=r?","+n+","+r:"")+")";t.setAttribute("transform",(o+" "+a).trim())}function Ou(t,e,n){var r=Va(t,"transform"),i=uu(r);if(null==e)return i.scale;n=null==n?e:n,r=(r=i.raw).replace(/scale\([^)]*\)/g,"").trim();var o="scale("+e+","+n+")";t.setAttribute("transform",(r+" "+o).trim())}function Lu(e,n,r,i){var o=t.Point.create(n),s=t.Point.create(r);i||(i=e instanceof SVGSVGElement?e:e.ownerSVGElement);var a=Ou(e);e.setAttribute("transform","");var l=bu(e,{target:i}).scale(a.sx,a.sy),u=su();u.setTranslate(-l.x-l.width/2,-l.y-l.height/2);var c=su(),h=o.angleBetween(s,o.clone().translate(1,0));h&&c.setRotate(h,0,0);var p=su(),d=o.clone().move(s,l.width/2);p.setTranslate(2*o.x-d.x,2*o.y-d.y);var f=Cu(e,i),g=su();g.setMatrix(p.matrix.multiply(c.matrix.multiply(u.matrix.multiply(f.scale(a.sx,a.sy))))),e.setAttribute("transform",lu(g.matrix))}var Fu=function(){function e(e,n,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=t.Platform.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=n,this.onWheelGuard=r,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}return e.prototype.enable=function(){t.Platform.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):u(this.target).on("mousewheel",this.onWheel)},e.prototype.disable=function(){t.Platform.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):u(this.target).off("mousewheel")},e.prototype.onWheel=function(t){var e,n=this;(null==this.onWheelGuard||this.onWheelGuard(t))&&(this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault(),0===this.deltaX&&0===this.deltaY||(t.stopPropagation(),e=!0),!0===e&&0===this.animationFrameId&&(this.animationFrameId=requestAnimationFrame((function(){n.didWheel(t)}))))},e.prototype.didWheel=function(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0},e}(),zu=t.Vector.isVector,Bu=t.Vector.create,Vu=t.Vector.createVectors,ju=Object.freeze({__proto__:null,requestAnimationFrame:Ya,cancelAnimationFrame:Ja,getAttribute:La,removeAttribute:Fa,setAttribute:za,setAttributes:Ba,attr:Va,qualifyAttr:ja,kebablizeAttrs:Ra,styleToObject:Ia,mergeAttrs:_a,uniqueId:ua,ensureId:ca,isSVGGraphicsElement:ha,ns:pa,svgVersion:da,createElement:fa,createElementNS:ga,createSvgElement:va,createSvgDocument:ya,parseXML:ma,tagName:ba,index:Ca,find:xa,findOne:wa,findParentByClass:Pa,contains:Aa,remove:Ea,empty:Ma,append:Sa,prepend:ka,before:Ta,appendTo:Da,isHTMLElement:Na,getClass:ra,hasClass:ia,addClass:oa,removeClass:sa,toggleClass:aa,setPrefixedStyle:function(t,e,n){var r=el(e);null!=r&&(t[r]=n),t[e]=n},getComputedStyle:nl,hasScrollbars:function(t){var e=nl(t);return null!=e&&("scroll"===e.overflow||"auto"===e.overflow)},getVendorPrefixedName:el,clearSelection:ol,text:Vl,breakText:jl,KAPPA:Rl,sample:_l,lineToPathData:Gl,polygonToPathData:Hl,polylineToPathData:Ul,getPointsFromSvgElement:$l,circleToPathData:Wl,ellipseToPathData:Xl,rectangleToPathData:Yl,rectToPathData:Jl,toPath:Zl,toPathData:Kl,createSlicePathData:Ql,bbox:mu,getBBox:bu,getBBoxByElementAttr:function(e){for(var n=e,r=n?n.tagName.toLowerCase():"";"g"===r;)r=(n=n.firstElementChild)?n.tagName.toLowerCase():"";var i,o,s=function(t){var e=n.getAttribute(t),r=e?parseFloat(e):0;return Number.isNaN(r)?0:r};switch(r){case"rect":o=new t.Rectangle(s("x"),s("y"),s("width"),s("height"));break;case"circle":i=s("r"),o=new t.Rectangle(s("cx")-i,s("cy")-i,2*i,2*i)}return o},getMatrixByElementAttr:function(t,e){var n=ou();if(ha(e)&&ha(t)){for(var r=t,i=[];r&&r!==e;){var o=au(r.getAttribute("transform")||null);i.push(o),r=r.parentNode}i.reverse().forEach((function(t){n=n.multiply(t)}))}return n},getTransformToElement:Cu,toLocalPoint:xu,toGeometryShape:wu,getIntersection:function(e,n,r){var i=e instanceof SVGSVGElement?e:e.ownerSVGElement,o=bu(r=r||i),s=o.getCenter();if(!o.intersectsWithLineFromCenterToPoint(n))return null;var a=null,l=e.tagName.toLowerCase();if("rect"===l){var u=new t.Rectangle(parseFloat(e.getAttribute("x")||"0"),parseFloat(e.getAttribute("y")||"0"),parseFloat(e.getAttribute("width")||"0"),parseFloat(e.getAttribute("height")||"0")),c=Cu(e,r),h=hu(c),p=i.createSVGTransform();p.setRotate(-h.rotation,s.x,s.y);var d=yu(u,p.matrix.multiply(c));a=t.Rectangle.create(d).intersectsWithLineFromCenterToPoint(n,h.rotation)}else if("path"===l||"polygon"===l||"polyline"===l||"circle"===l||"ellipse"===l){for(var f=_l("path"===l?e:Zl(e)),g=1/0,v=[],y=0,m=f.length;y<m;y+=1){var b=f[y],C=iu(b.x,b.y);C=C.matrixTransform(Cu(e,r));var x=t.Point.create(C),w=x.distance(s),P=1.1*x.distance(n),A=w+P;A<g?(g=A,v=[{sample:b,refDistance:P}]):A<g+1&&v.push({sample:b,refDistance:P})}v.sort((function(t,e){return t.refDistance-e.refDistance})),v[0]&&(a=t.Point.create(v[0].sample))}return a},animate:Pu,animateTransform:Au,animateAlongPath:Su,getBoundingOffsetRect:ku,createSVGPoint:iu,createSVGMatrix:ou,createSVGTransform:su,transformStringToMatrix:au,matrixToTransformString:lu,parseTransformString:uu,decomposeMatrix:hu,matrixToScale:pu,matrixToRotation:du,matrixToTranslation:fu,transformPoint:gu,transformLine:vu,transformPolyline:function(e,n){var r=e instanceof t.Polyline?e.points:e;return Array.isArray(r)||(r=[]),new t.Polyline(r.map((function(t){return gu(t,n)})))},transformRectangle:yu,transform:Tu,translate:Du,rotate:Nu,scale:Ou,translateAndAutoOrient:Lu,MouseWheelHandle:Fu,isVector:zu,createVector:Bu,createVectors:Vu});function Ru(t,e){var n=this;void 0===e&&(e=60);var r=null;return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];r&&clearTimeout(r),r=window.setTimeout((function(){t.apply(n,i)}),e)}}var Iu,_u,Gu,Hu,Uu,qu,$u,Wu,Xu,Yu="undefined"!=typeof ResizeObserver?function(t){var e=null,n=[],r=Ru((function(){n.forEach((function(e){e(t)}))})),i=function(){e&&(e.disconnect(),n=[],e=null)};return{element:t,bind:function(i){var o;e||((o=new ResizeObserver(r)).observe(t),r(),e=o),-1===n.indexOf(i)&&n.push(i)},destroy:i,unbind:function(t){var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&e&&i()}}}:function(t){var e=null,n=[],r=Ru((function(){n.forEach((function(e){return e(t)}))})),i=function(){e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,n=[])};return{element:t,bind:function(i){e||(e=function(){"static"===getComputedStyle(t).position&&(t.style.position="relative");var e=document.createElement("object");return e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",r),r()},e.style.display="block",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="100%",e.style.width="100%",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.opacity="0",e.setAttribute("tabindex","-1"),e.type="text/html",t.appendChild(e),e.data="about:blank",e}()),-1===n.indexOf(i)&&n.push(i)},destroy:i,unbind:function(t){var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&e&&i()}}};t.SizeSensor=void 0,function(t){var e=new WeakMap;function n(t){var n=e.get(t);return n||(n=Yu(t),e.set(t,n),n)}t.bind=function(t,e){var r=n(t);return r.bind(e),function(){return r.unbind(e)}},t.clear=function(t){!function(t){t.destroy(),e.delete(t.element)}(n(t))}}(t.SizeSensor||(t.SizeSensor={})),t.Scheduler=void 0,Iu=t.Scheduler||(t.Scheduler={}),_u=[],Gu=[],Hu=0,Uu=function(){return performance.now()},qu=function(t){return t[0]},$u=function(t){return 1===Gu.push(t)&&Wu()},Wu=function(){var t=function(){return Gu.splice(0,Gu.length).forEach((function(t){return t()}))};if("undefined"!=typeof MessageChannel){var e=new MessageChannel,n=e.port1,r=e.port2;return n.onmessage=t,function(){return r.postMessage(null)}}return function(){return setTimeout(t)}}(),Xu=function(){Hu=Uu()+16.666666666666668;for(var t=qu(_u);t&&!Iu.shouldYield();){var e=t.callback,n=t.data;t.callback=null;var r=e&&e(n);r?t.callback=r:_u.shift(),t=qu(_u)}t&&$u(Xu)},Iu.scheduleTask=function(t,e){var n={callback:t,data:e};_u.push(n),$u(Xu)},Iu.shouldYield=function(){var t,e;return(null===(e=null===(t=navigator)||void 0===t?void 0:t.scheduling)||void 0===e?void 0:e.isInputPending())||Uu()>=Hu};var Ju=function(){function e(t){this.options=r({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}return Object.defineProperty(e.prototype,"names",{get:function(){return Object.keys(this.data)},enumerable:!1,configurable:!0}),e.prototype.register=function(e,n,r){var i=this;if(void 0===r&&(r=!1),"object"!=typeof e){!this.exist(e)||r||t.Platform.isApplyingHMR()||this.onDuplicated(e);var o=this.options.process,s=o?Ws(o,this,e,n):n;return this.data[e]=s,s}Object.keys(e).forEach((function(t){i.register(t,e[t],n)}))},e.prototype.unregister=function(t){var e=t?this.data[t]:null;return delete this.data[t],e},e.prototype.get=function(t){return t?this.data[t]:null},e.prototype.exist=function(t){return!!t&&null!=this.data[t]},e.prototype.onDuplicated=function(t){try{throw this.options.onConflict&&Ws(this.options.onConflict,this,t),new Error(an(this.options.type)+" with name '"+t+"' already registered.")}catch(t){throw t}},e.prototype.onNotFound=function(t,e){throw new Error(this.getSpellingSuggestion(t,e))},e.prototype.getSpellingSuggestion=function(t,e){var n=this.getSpellingSuggestionForName(t),r=e?e+" "+eo(this.options.type):this.options.type;return an(r)+" with name '"+t+"' does not exist."+(n?" Did you mean '"+n+"'?":"")},e.prototype.getSpellingSuggestionForName=function(t){return js(t,Object.keys(this.data),(function(t){return t}))},e}();!function(t){t.create=function(e){return new t(e)}}(Ju||(Ju={}));var Zu,Ku,Qu={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},tc={position:Pc("x","width","origin")},ec={position:Pc("y","height","origin")},nc={position:Pc("x","width","corner")},rc={position:Pc("y","height","corner")},ic={set:Ac("width","width")},oc={set:Ac("height","height")},sc={set:Ac("rx","width")},ac={set:Ac("ry","height")},lc={set:(Zu=Ac("r","width"),Ku=Ac("r","height"),function(t,e){var n=e.refBBox;return Ws(n.height>n.width?Zu:Ku,this,t,e)})},uc={set:function(t,e){var n=e.refBBox,r=parseFloat(t),i=_s(t);i&&(r/=100);var o,s=Math.sqrt(n.height*n.height+n.width*n.width);return Number.isFinite(r)&&(o=i||r>=0&&r<=1?r*s:Math.max(r+s,0)),{r:o}}},cc={set:Ac("cx","width")},hc={set:Ac("cy","height")},pc={set:Mc({resetOffset:!0})},dc={set:Mc({resetOffset:!1})},fc={set:Sc({resetOffset:!0})},gc={set:Sc({resetOffset:!1})},vc=lc,yc=pc,mc=fc,bc=tc,Cc=ec,xc=ic,wc=oc;function Pc(e,n,r){return function(i,o){var s=o.refBBox;if(null==i)return null;var a,l=parseFloat(i),u=_s(i);if(u&&(l/=100),Number.isFinite(l)){var c=s[r];a=u||l>0&&l<1?c[e]+s[n]*l:c[e]+l}var h=new t.Point;return h[e]=a||0,h}}function Ac(t,e){return function(n,r){var i=r.refBBox,o=parseFloat(n),s=_s(n);s&&(o/=100);var a={};if(Number.isFinite(o)){var l=s||o>=0&&o<=1?o*i[e]:Math.max(o+i[e],0);a[t]=l}return a}}function Ec(t,e){var n="x6-shape",r=e&&e.resetOffset;return function(e,i){var o=i.view,s=i.elem,a=i.refBBox,l=o.$(s),u=l.data(n);if(!u||u.value!==e){var c=t(e);u={value:e,shape:c,shapeBBox:c.bbox()},l.data(n,u)}var h=u.shape.clone(),p=u.shapeBBox.clone(),d=p.getOrigin(),f=a.getOrigin();p.x=f.x,p.y=f.y;var g=a.getMaxScaleToFit(p,f),v=0===p.width||0===a.width?1:g.sx,y=0===p.height||0===a.height?1:g.sy;return h.scale(v,y,d),r&&h.translate(-d.x,-d.y),h}}function Mc(e){var n=Ec((function(e){return t.Path.parse(e)}),e);return function(t,e){return{d:n(t,e).serialize()}}}function Sc(e){var n=Ec((function(e){return new t.Polyline(e)}),e);return function(t,e){return{points:n(t,e).serialize()}}}var kc={qualify:_e,set:function(t,e){return"url(#"+e.view.graph.defineGradient(t)+")"}},Tc={qualify:_e,set:function(t,e){var n=e.view,i=n.cell,o=r({},t);if(i.isEdge()&&"linearGradient"===o.type){var s=n,a=s.sourcePoint,l=s.targetPoint;o.id="gradient-"+o.type+"-"+i.id,o.attrs=r(r({},o.attrs),{x1:a.x,y1:a.y,x2:l.x,y2:l.y,gradientUnits:"userSpaceOnUse"}),n.graph.defs.remove(o.id)}return"url(#"+n.graph.defineGradient(o)+")"}},Dc={qualify:function(t,e){var n=e.attrs;return null==n.textWrap||!_e(n.textWrap)},set:function(t,e){var n=e.view,i=e.elem,o=e.attrs,s="x6-text",a=n.$(i),l=a.data(s),u=function(t){try{return JSON.parse(t)}catch(e){return t}},c={x:o.x,eol:o.eol,annotations:u(o.annotations),textPath:u(o["text-path"]||o.textPath),textVerticalAnchor:o["text-vertical-anchor"]||o.textVerticalAnchor,displayEmpty:"true"===(o["display-empty"]||o.displayEmpty),lineHeight:o["line-height"]||o.lineHeight},h=o["font-size"]||o.fontSize,p=JSON.stringify([t,c]);if(h&&i.setAttribute("font-size",h),null==l||l!==p){var d=c.textPath;if(null!=d&&"object"==typeof d){var f=d.selector;if("string"==typeof f){var g=n.find(f)[0];g instanceof SVGPathElement&&(ca(g),c.textPath=r({"xlink:href":"#"+g.id},d))}}Vl(i,""+t,c),a.data(s,p)}}},Nc={qualify:_e,set:function(t,e){var n=e.view,r=e.elem,i=e.attrs,o=e.refBBox,s=t,a=s.width||0;_s(a)?o.width*=parseFloat(a)/100:a<=0?o.width+=a:o.width=a;var l,u=s.height||0;_s(u)?o.height*=parseFloat(u)/100:u<=0?o.height+=u:o.height=u;var c=s.text;null==c&&(c=i.text),l=null!=c?jl(""+c,o,{"font-weight":i["font-weight"]||i.fontWeight,"font-size":i["font-size"]||i.fontSize,"font-family":i["font-family"]||i.fontFamily,lineHeight:i.lineHeight},{svgDocument:n.graph.view.svg,ellipsis:s.ellipsis,hyphen:s.hyphen,breakWord:s.breakWord}):"",Ws(Dc.set,this,l,{view:n,elem:r,attrs:i,refBBox:o,cell:n.cell})}},Oc=function(t,e){return void 0!==e.attrs.text},Lc={qualify:Oc},Fc={qualify:Oc},zc={qualify:Oc},Bc={qualify:Oc},Vc={qualify:Oc},jc={qualify:Oc},Rc={qualify:function(t,e){return e.elem instanceof SVGElement},set:function(t,e){var n=e.view,r=e.elem,i="x6-title",o=""+t,s=n.$(r),a=s.data(i);if(null==a||a!==o){s.data(i,o);var l=r.firstChild;if(l&&"TITLE"===l.tagName.toUpperCase()){l.textContent=o}else{var u=document.createElementNS(r.namespaceURI,"title");u.textContent=o,r.insertBefore(u,l)}}}},Ic={offset:Gc("x","width","right")},_c={offset:Gc("y","height","bottom")};function Gc(e,n,r){return function(i,o){var s,a=o.refBBox,l=new t.Point;return s="middle"===i?a[n]/2:i===r?a[n]:"number"==typeof i&&Number.isFinite(i)?i>-1&&i<1?-a[n]*i:-i:_s(i)?a[n]*parseFloat(i)/100:0,l[e]=-(a[e]+s),l}}var Hc={qualify:_e,set:function(t,e){var n=e.view,r=e.elem;n.$(r).css(t)}},Uc={qualify:_e,set:function(t,e){return"url(#"+e.view.graph.defineFilter(t)+")"}};function qc(e,n,r){var i,o;"object"==typeof n?(i=n.x,o=n.y):(i=n,o=r);var s=t.Path.parse(e),a=s.bbox();if(a){var l=-a.height/2-a.y,u=-a.width/2-a.x;"number"==typeof i&&(u-=i),"number"==typeof o&&(l-=o),s.translate(u,l)}return s.serialize()}function $c(e,n,i,o,s){void 0===o&&(o=3/4),void 0===s&&(s={});var a=e.size||10,l=e.width||a,u=e.height||a,c=new t.Path,h={};if(n)c.moveTo(l,0).lineTo(0,u/2).lineTo(l,u),h.fill="none";else{if(c.moveTo(0,u/2),c.lineTo(l,0),!i){var p=In(o,0,1);c.lineTo(l*p,u/2)}c.lineTo(l,u),c.close()}return r(r(r({},h),s),{tagName:"path",d:qc(c.serialize(),{x:null!=e.offset?e.offset:-l/2})})}var Wc,Xc=function(t){var e=t.r,n=i(t,["r"]),o=e||5;return r(r({cx:o},n),{tagName:"circle",r:o})},Yc=Object.freeze({__proto__:null,block:function(t){return $c({size:t.size,width:t.width,height:t.height,offset:t.offset},!0===t.open,!0,void 0,i(t,["size","width","height","offset","open"]))},classic:function(t){return $c({size:t.size,width:t.width,height:t.height,offset:t.offset},!1,!1,t.factor,i(t,["size","width","height","offset","factor"]))},diamond:function(e){var n=e.size,o=e.width,s=e.height,a=e.offset,l=i(e,["size","width","height","offset"]),u=n||10,c=o||u,h=s||u,p=new t.Path;return p.moveTo(0,h/2).lineTo(c/2,0).lineTo(c,h/2).lineTo(c/2,h).close(),r(r({},l),{tagName:"path",d:qc(p.serialize(),null==a?-c/2:a)})},path:function(t){var e=t.d,n=t.offsetX,o=t.offsetY,s=i(t,["d","offsetX","offsetY"]);return r(r({},s),{tagName:"path",d:qc(e,n,o)})},cross:function(e){var n=e.size,o=e.width,s=e.height,a=e.offset,l=i(e,["size","width","height","offset"]),u=n||10,c=o||u,h=s||u,p=new t.Path;return p.moveTo(0,0).lineTo(c,h).moveTo(0,h).lineTo(c,0),r(r({},l),{tagName:"path",fill:"none",d:qc(p.serialize(),a||-c/2)})},async:function(e){var n=e.width,o=e.height,s=e.offset,a=e.open,l=e.flip,u=i(e,["width","height","offset","open","flip"]),c=o||6,h=n||10,p=!0===a,d=!0===l,f=r(r({},u),{tagName:"path"});d&&(c=-c);var g=new t.Path;return g.moveTo(0,c).lineTo(h,0),p?f.fill="none":(g.lineTo(h,c),g.close()),f.d=qc(g.serialize(),{x:s||-h/2,y:c/2}),f},circle:Xc,circlePlus:function(e){var n=e.r,o=i(e,["r"]),s=n||5,a=new t.Path;return a.moveTo(s,0).lineTo(s,2*s),a.moveTo(0,s).lineTo(2*s,s),{children:[r(r({},Xc({r:s})),{fill:"none"}),r(r({},o),{tagName:"path",d:qc(a.serialize(),-s)})]}},ellipse:function(t){var e=t.rx,n=t.ry,o=i(t,["rx","ry"]),s=e||5,a=n||5;return r(r({cx:s},o),{tagName:"ellipse",rx:s,ry:a})}});function Jc(t){return"string"==typeof t||_e(t)}!function(t){t.presets=Yc,t.registry=Ju.create({type:"marker"}),t.registry.register(t.presets,!0)}(Wc||(Wc={})),function(t){t.normalize=qc}(Wc||(Wc={}));var Zc={qualify:Jc,set:function(t,e){return th("marker-start",t,e.view,e.attrs)}},Kc={qualify:Jc,set:function(t,e){return th("marker-end",t,e.view,e.attrs,{transform:"rotate(180)"})}},Qc={qualify:Jc,set:function(t,e){return th("marker-mid",t,e.view,e.attrs)}};function th(t,e,n,o,s){var a;void 0===s&&(s={});var l="string"==typeof e?{name:e}:e,u=l.name,c=l.args,h=i(l,["name","args"]),p=h;if(u&&"string"==typeof u){var d=Wc.registry.get(u);if(!d)return Wc.registry.onNotFound(u);p=d(r(r({},h),c))}var f=r(r(r({},function(t,e){var n={},r=t.stroke;"string"==typeof r&&(n.stroke=r,n.fill=r);var i=t.strokeOpacity;null==i&&(i=t["stroke-opacity"]);null==i&&(i=t.opacity);null!=i&&(n["stroke-opacity"]=i,n["fill-opacity"]=i);if("marker-mid"!==e){var o=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(o)&&o>1){var s=Math.ceil(o/2);n.refX="marker-start"===e?s:-s}}return n}(o,t)),s),p);return(a={})[t]="url(#"+n.graph.defineMarker(f)+")",a}var eh=function(t,e){return e.view.cell.isEdge()},nh={qualify:eh,set:function(t,e){var n,r,i,o,s,a=e.view,l=t.reverse||!1,u=t.stubs||0;if(Number.isFinite(u)&&0!==u)if(l){var c;d=void 0,h=a.getConnectionLength()||0;u<0?(d=(h+u)/2,c=-u):(d=u,c=h-2*u),s=null===(o=null===(i=null===(r=null===(n=null==(p=a.getConnection())?void 0:p.divideAtLength(d))||void 0===n?void 0:n[1])||void 0===r?void 0:r.divideAtLength(c))||void 0===i?void 0:i[0])||void 0===o?void 0:o.serialize()}else{var h,p,d=void 0;if(u<0)d=((h=a.getConnectionLength()||0)+u)/2;else d=u;if(p=a.getConnection()){var f=p.divideAtLength(d),g=p.divideAtLength(-d);f&&g&&(s=f[0].serialize()+" "+g[1].serialize())}}return{d:s||a.getConnectionPathData()}}},rh={qualify:eh,set:uh("getTangentAtLength",{rotate:!0})},ih={qualify:eh,set:uh("getTangentAtLength",{rotate:!1})},oh={qualify:eh,set:uh("getTangentAtRatio",{rotate:!0})},sh={qualify:eh,set:uh("getTangentAtRatio",{rotate:!1})},ah=rh,lh=oh;function uh(t,e){var n={x:1,y:0};return function(r,i){var o,s,a=i.view,l=a[t](Number(r));return l?(s=e.rotate?l.vector().vectorAngle(n):0,o=l.start):(o=a.path.start,s=0),0===s?{transform:"translate("+o.x+","+o.y+"')"}:{transform:"translate("+o.x+","+o.y+"') rotate("+s+")"}}}var ch,hh=Object.freeze({__proto__:null,ref:{},refX:tc,refY:ec,refDx:nc,refDy:rc,refWidth:ic,refHeight:oc,refRx:sc,refRy:ac,refRInscribed:lc,refRCircumscribed:uc,refCx:cc,refCy:hc,refDResetOffset:pc,refDKeepOffset:dc,refPointsResetOffset:fc,refPointsKeepOffset:gc,refR:vc,refD:yc,refPoints:mc,refX2:bc,refY2:Cc,refWidth2:xc,refHeight2:wc,fill:kc,stroke:Tc,text:Dc,textWrap:Nc,lineHeight:Lc,textVerticalAnchor:Fc,textPath:zc,annotations:Bc,eol:Vc,displayEmpty:jc,title:Rc,xAlign:Ic,yAlign:_c,resetOffset:{offset:function(t,e){var n=e.refBBox;return t?{x:-n.x,y:-n.y}:{x:0,y:0}}},style:Hc,html:{set:function(t,e){var n=e.view,r=e.elem;n.$(r).html(""+t)}},filter:Uc,port:{set:function(t){return null!=t&&"object"==typeof t&&t.id?t.id:t}},sourceMarker:Zc,targetMarker:Kc,vertexMarker:Qc,connection:nh,atConnectionLengthKeepGradient:rh,atConnectionLengthIgnoreGradient:ih,atConnectionRatioKeepGradient:oh,atConnectionRatioIgnoreGradient:sh,atConnectionLength:ah,atConnectionRatio:lh});!function(t){t.isValidDefinition=function(t,e,n){if(null!=t){if("string"==typeof t)return!0;if("function"!=typeof t.qualify||Ws(t.qualify,this,e,n))return!0}return!1}}(ch||(ch={})),function(t){t.presets=r(r({},Qu),hh),t.registry=Ju.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(ch||(ch={}));var ph={color:"#aaaaaa",thickness:1,markup:"rect",update:function(t,e){var n=e.thickness*e.sx,r=e.thickness*e.sy;Va(t,{width:n,height:r,rx:n,ry:r,fill:e.color})}},dh={color:"#aaaaaa",thickness:1,markup:"rect",update:function(t,e){var n=e.sx<=1?e.thickness*e.sx:e.thickness;Va(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},fh={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update:function(t,e){var n=e.width,r=e.height,i=e.thickness;Va(t,{d:n-i>=0&&r-i>=0?["M",n,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",stroke:e.color,"stroke-width":e.thickness})}},gh=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update:function(t,e){var n=e.width,r=e.height,i=e.thickness;Va(t,{d:n-i>=0&&r-i>=0?["M",n,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update:function(t,e){var n,r=e.factor||1,i=e.width*r,o=e.height*r,s=e.thickness;n=i-s>=0&&o-s>=0?["M",i,0,"H0 M0 0 V0",o].join(" "):"M 0 0 0 0",e.width=i,e.height=o,Va(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}],vh=Object.freeze({__proto__:null,dot:ph,fixedDot:dh,mesh:fh,doubleMesh:gh}),yh=function(){function e(){this.patterns={},this.root=t.Vector.create(ya(),{width:"100%",height:"100%"},[va("defs")]).node}return e.prototype.add=function(e,n){var r=this.root.childNodes[0];r&&r.appendChild(n),this.patterns[e]=n,t.Vector.create("rect",{width:"100%",height:"100%",fill:"url(#"+e+")"}).appendTo(this.root)},e.prototype.get=function(t){return this.patterns[t]},e.prototype.has=function(t){return null!=this.patterns[t]},e}();function mh(t,e){return null!=t?t:e}function bh(t,e){return null!=t&&Number.isFinite(t)?t:e}!function(t){t.presets=vh,t.registry=Ju.create({type:"grid"}),t.registry.register(t.presets,!0)}(yh||(yh={}));var Ch,xh=Object.freeze({__proto__:null,outline:function(t){void 0===t&&(t={});var e=mh(t.color,"blue"),n=bh(t.width,1),r=bh(t.margin,2);return('\n <filter>\n <feFlood flood-color="'+e+'" flood-opacity="'+bh(t.opacity,1)+'" result="colored"/>\n <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="'+(r+n)+'" />\n <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="'+r+'" />\n <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>\n <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n ').trim()},highlight:function(t){void 0===t&&(t={});var e=mh(t.color,"red"),n=bh(t.blur,0),r=bh(t.width,1);return('\n <filter>\n <feFlood flood-color="'+e+'" flood-opacity="'+bh(t.opacity,1)+'" result="colored"/>\n <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="'+r+'"/>\n <feComposite result="composed" in="colored" in2="morphed" operator="in"/>\n <feGaussianBlur result="blured" in="composed" stdDeviation="'+n+'"/>\n <feBlend in="SourceGraphic" in2="blured" mode="normal"/>\n </filter>\n ').trim()},blur:function(t){void 0===t&&(t={});var e=bh(t.x,2);return('\n <filter>\n <feGaussianBlur stdDeviation="'+(null!=t.y&&Number.isFinite(t.y)?[e,t.y]:e)+'"/>\n </filter>\n ').trim()},dropShadow:function(t){void 0===t&&(t={});var e=bh(t.dx,0),n=bh(t.dy,0),r=mh(t.color,"black"),i=bh(t.blur,4),o=bh(t.opacity,1);return"SVGFEDropShadowElement"in window?('<filter>\n <feDropShadow stdDeviation="'+i+'" dx="'+e+'" dy="'+n+'" flood-color="'+r+'" flood-opacity="'+o+'" />\n </filter>').trim():('<filter>\n <feGaussianBlur in="SourceAlpha" stdDeviation="'+i+'" />\n <feOffset dx="'+e+'" dy="'+n+'" result="offsetblur" />\n <feFlood flood-color="'+r+'" />\n <feComposite in2="offsetblur" operator="in" />\n <feComponentTransfer>\n <feFuncA type="linear" slope="'+o+'" />\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>').trim()},grayScale:function(t){void 0===t&&(t={});var e=bh(t.amount,1),n=.7152-.7152*(1-e);return('\n <filter>\n <feColorMatrix type="matrix" values="'+(.2126+.7874*(1-e))+" "+n+" "+(.0722-.0722*(1-e))+" 0 0 "+(.2126-.2126*(1-e))+" "+(.7152+.2848*(1-e))+" "+(.0722-.0722*(1-e))+" 0 0 "+(.2126-.2126*(1-e))+" "+n+" "+(.0722+.9278*(1-e))+' 0 0 0 0 0 1 0"/>\n </filter>\n ').trim()},sepia:function(t){void 0===t&&(t={});var e=bh(t.amount,1);return('\n <filter>\n <feColorMatrix type="matrix" values="'+(.393+.607*(1-e))+" "+(.769-.769*(1-e))+" "+(.189-.189*(1-e))+" 0 0 "+(.349-.349*(1-e))+" "+(.686+.314*(1-e))+" "+(.168-.168*(1-e))+" 0 0 "+(.272-.272*(1-e))+" "+(.534-.534*(1-e))+" "+(.131+.869*(1-e))+' 0 0 0 0 0 1 0"/>\n </filter>\n ').trim()},saturate:function(t){return void 0===t&&(t={}),('\n <filter>\n <feColorMatrix type="saturate" values="'+(1-bh(t.amount,1))+'"/>\n </filter>\n ').trim()},hueRotate:function(t){return void 0===t&&(t={}),('\n <filter>\n <feColorMatrix type="hueRotate" values="'+bh(t.angle,0)+'"/>\n </filter>\n ').trim()},invert:function(t){void 0===t&&(t={});var e=bh(t.amount,1),n=1-e;return('\n <filter>\n <feComponentTransfer>\n <feFuncR type="table" tableValues="'+e+" "+n+'"/>\n <feFuncG type="table" tableValues="'+e+" "+n+'"/>\n <feFuncB type="table" tableValues="'+e+" "+n+'"/>\n </feComponentTransfer>\n </filter>\n ').trim()},brightness:function(t){void 0===t&&(t={});var e=bh(t.amount,1);return('\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="'+e+'"/>\n <feFuncG type="linear" slope="'+e+'"/>\n <feFuncB type="linear" slope="'+e+'"/>\n </feComponentTransfer>\n </filter>\n ').trim()},contrast:function(t){void 0===t&&(t={});var e=bh(t.amount,1),n=.5-e/2;return('\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="'+e+'" intercept="'+n+'"/>\n <feFuncG type="linear" slope="'+e+'" intercept="'+n+'"/>\n <feFuncB type="linear" slope="'+e+'" intercept="'+n+'"/>\n </feComponentTransfer>\n </filter>\n ').trim()}});!function(t){t.presets=xh,t.registry=Ju.create({type:"filter"}),t.registry.register(t.presets,!0)}(Ch||(Ch={}));var wh,Ph=function(t){var e=document.createElement("canvas"),n=t.width,r=t.height;e.width=2*n,e.height=r;var i=e.getContext("2d");return i.drawImage(t,0,0,n,r),i.translate(2*n,0),i.scale(-1,1),i.drawImage(t,0,0,n,r),e},Ah=function(t){var e=document.createElement("canvas"),n=t.width,r=t.height;e.width=n,e.height=2*r;var i=e.getContext("2d");return i.drawImage(t,0,0,n,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(t,0,0,n,r),e},Eh=function(t){var e=document.createElement("canvas"),n=t.width,r=t.height;e.width=2*n,e.height=2*r;var i=e.getContext("2d");return i.drawImage(t,0,0,n,r),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(t,0,0,n,r),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(t,0,0,n,r),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(t,0,0,n,r),e},Mh=Object.freeze({__proto__:null,flipX:Ph,flipY:Ah,flipXY:Eh,watermark:function(e,n){var r=e.width,i=e.height,o=document.createElement("canvas");o.width=3*r,o.height=3*i;for(var s=o.getContext("2d"),a=null!=n.angle?-n.angle:-20,l=t.Angle.toRad(a),u=o.width/4,c=o.height/4,h=0;h<4;h+=1)for(var p=0;p<4;p+=1)(h+p)%2>0&&(s.setTransform(1,0,0,1,(2*h-1)*u,(2*p-1)*c),s.rotate(l),s.drawImage(e,-r/2,-i/2,r,i));return o}});!function(t){t.presets=r({},Mh),t.presets["flip-x"]=Ph,t.presets["flip-y"]=Ah,t.presets["flip-xy"]=Eh,t.registry=Ju.create({type:"background pattern"}),t.registry.register(t.presets,!0)}(wh||(wh={}));var Sh={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track:function(t){Sh.trackable=t}};t.Util=void 0,function(t){t.snapToGrid=ul,t.normalizeMarker=qc,t.prefix=function(t){return Sh.prefixCls+"-"+t}}(t.Util||(t.Util={})),function(t){t.makeTree=function(t,e,n,r){var i=this;void 0===r&&(r=[]);var o="function"==typeof e.children?e.children(t):t[e.children||"children"];return n||(n=e.createNode(t),r.push(n)),Array.isArray(o)&&o.forEach((function(t){var o=e.createNode(t),s=e.createEdge(n,o);r.push(o,s),i.makeTree(t,e,o,r)})),r}}(t.Util||(t.Util={}));var kh,Th="1.33.0",Dh=t.Util.prefix("highlighted"),Nh={highlight:function(t,e,n){oa(e,n&&n.className||Dh)},unhighlight:function(t,e,n){sa(e,n&&n.className||Dh)}},Oh=t.Util.prefix("highlight-opacity"),Lh={highlight:function(t,e){oa(e,Oh)},unhighlight:function(t,e){sa(e,Oh)}},Fh={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},zh={highlight:function(e,n,i){var o=kh.getHighlighterId(n,i);if(!kh.hasCache(o)){i=Mi({},i,Fh);var s,a,l=t.Vector.create(n);try{s=l.toPathData()}catch(t){a=l.bbox(!0),s=Jl(r(r({},i),a))}var u=va("path");if(Va(u,r({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},i.attrs?Ra(i.attrs):null)),e.isEdgeElement(n))Va(u,"d",e.getConnectionPathData());else{var c=l.getTransformToElement(e.container),h=i.padding;if(h){null==a&&(a=l.bbox(!0));var p=a.x+a.width/2,d=a.y+a.height/2;a=yu(a,c);var f=Math.max(a.width,1),g=Math.max(a.height,1),v=(f+h)/f,y=(g+h)/g,m=ou({a:v,b:0,c:0,d:y,e:p-v*p,f:d-y*d});c=c.multiply(m)}Tu(u,c)}oa(u,t.Util.prefix("highlight-stroke"));var b=e.cell,C=function(){return kh.removeHighlighter(o)};b.on("removed",C),b.model&&b.model.on("reseted",C),e.container.appendChild(u),kh.setCache(o,u)}},unhighlight:function(t,e,n){kh.removeHighlighter(kh.getHighlighterId(e,n))}};!function(t){t.getHighlighterId=function(t,e){return ca(t),t.id+JSON.stringify(e)};var e={};t.setCache=function(t,n){e[t]=n},t.hasCache=function(t){return null!=e[t]},t.removeHighlighter=function(t){var n=e[t];n&&(Ea(n),delete e[t])}}(kh||(kh={}));var Bh,Vh=Object.freeze({__proto__:null,className:Nh,opacity:Lh,stroke:zh});function jh(e,n){return void 0===n&&(n={}),new t.Point(Gs(n.x,e.width),Gs(n.y,e.height))}function Rh(t,e,n){return r({angle:e,position:t.toJSON()},n)}!function(t){t.check=function(t,e){if("function"!=typeof e.highlight)throw new Error("Highlighter '"+t+"' is missing required `highlight()` method");if("function"!=typeof e.unhighlight)throw new Error("Highlighter '"+t+"' is missing required `unhighlight()` method")}}(Bh||(Bh={})),function(t){t.presets=Vh,t.registry=Ju.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(Bh||(Bh={}));function Ih(e,n,r,i){var o=n.getCenter(),s=n.getTopCenter(),a=n.width/n.height,l=t.Ellipse.fromRect(n),u=e.length;return e.map((function(t,e){var n=r+i(e,u),c=s.clone().rotate(-n,o).scale(a,1,o),h=t.compensateRotate?-l.tangentTheta(c):0;return(t.dx||t.dy)&&c.translate(t.dx||0,t.dy||0),t.dr&&c.move(o,t.dr),Rh(c.round(),h,t)}))}function _h(e,n,r,o){var s=new t.Line(n,r),a=e.length;return e.map((function(t,e){var n=t.strict,r=i(t,["strict"]),l=n||o.strict?(e+1)/(a+1):(e+.5)/a,u=s.pointAt(l);return(r.dx||r.dy)&&u.translate(r.dx||0,r.dy||0),Rh(u.round(),0,r)}))}var Gh,Hh=Object.freeze({__proto__:null,absolute:function(t,e){return t.map((function(t){var n=t.x,r=t.y,i=t.angle;return Rh(jh(e,{x:n,y:r}),i||0)}))},ellipse:function(t,e,n){var r=n.start||0,i=n.step||20;return Ih(t,e,r,(function(t,e){return(t+.5-e/2)*i}))},ellipseSpread:function(t,e,n){var r=n.start||0,i=n.step||360/t.length;return Ih(t,e,r,(function(t){return t*i}))},line:function(t,e,n){return _h(t,jh(e,n.start||e.getOrigin()),jh(e,n.end||e.getCorner()),n)},left:function(t,e,n){return _h(t,e.getTopLeft(),e.getBottomLeft(),n)},right:function(t,e,n){return _h(t,e.getTopRight(),e.getBottomRight(),n)},top:function(t,e,n){return _h(t,e.getTopLeft(),e.getTopRight(),n)},bottom:function(t,e,n){return _h(t,e.getBottomLeft(),e.getBottomRight(),n)}});!function(t){t.presets=Hh,t.registry=Ju.create({type:"port layout"}),t.registry.register(t.presets,!0)}(Gh||(Gh={}));var Uh={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function qh(t,e){var n=e||{},r=n.x,i=n.y,o=n.angle,s=n.attrs;return Mi({},{angle:o,attrs:s,position:{x:r,y:i}},t,Uh)}function $h(t,e,n,r){var i,o,s,a,l=null!=r.offset?r.offset:15,u=e.getCenter().theta(t),c=Xh(e),h=0;return u<c[1]||u>c[2]?(i=".3em",o=l,s=0,a="start"):u<c[0]?(i="0",o=0,s=-l,n?(h=-90,a="start"):a="middle"):u<c[3]?(i=".3em",o=-l,s=0,a="end"):(i=".6em",o=0,s=l,n?(h=90,a="start"):a="middle"),qh({position:{x:Math.round(o),y:Math.round(s)},angle:h,attrs:{".":{y:i,"text-anchor":a}}},r)}function Wh(t,e,n,r){var i,o,s,a,l=null!=r.offset?r.offset:15,u=e.getCenter().theta(t),c=Xh(e),h=0;return u<c[1]||u>c[2]?(i=".3em",o=-l,s=0,a="end"):u<c[0]?(i=".6em",o=0,s=l,n?(h=90,a="start"):a="middle"):u<c[3]?(i=".3em",o=l,s=0,a="start"):(i="0em",o=0,s=-l,n?(h=-90,a="start"):a="middle"),qh({position:{x:Math.round(o),y:Math.round(s)},angle:h,attrs:{".":{y:i,"text-anchor":a}}},r)}function Xh(t){var e=t.getCenter(),n=e.theta(t.getTopLeft()),r=e.theta(t.getBottomLeft()),i=e.theta(t.getBottomRight());return[n,e.theta(t.getTopRight()),i,r]}function Yh(e,n,r){var i,o=null!=r.offset?r.offset:20,s=new t.Point(0,0),a=-e.theta(s),l=".3em",u=a;return(a+90)%180==0?(i=n?"end":"middle",n||-270!==a||(l="0em")):a>-270&&a<-90?(i="start",u=a-180):i="end",qh({position:e.clone().move(s,o).diff(e).round().round().toJSON(),angle:n?u:0,attrs:{".":{y:l,"text-anchor":i}}},r)}var Jh,Zh=Object.freeze({__proto__:null,manual:function(t,e,n){return qh({position:e.getTopLeft()},n)},left:function(t,e,n){return qh({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n)},right:function(t,e,n){return qh({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n)},top:function(t,e,n){return qh({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n)},bottom:function(t,e,n){return qh({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n)},outside:function(t,e,n){return $h(t,e,!1,n)},outsideOriented:function(t,e,n){return $h(t,e,!0,n)},inside:function(t,e,n){return Wh(t,e,!1,n)},insideOriented:function(t,e,n){return Wh(t,e,!0,n)},radial:function(t,e,n){return Yh(t.diff(e.getCenter()),!1,n)},radialOriented:function(t,e,n){return Yh(t.diff(e.getCenter()),!0,n)}});!function(t){t.presets=Zh,t.registry=Ju.create({type:"port label layout"}),t.registry.register(t.presets,!0)}(Jh||(Jh={})),t.Color=function(){function t(e,n,r,i){return null==e?this.set(255,255,255,1):"number"==typeof e?this.set(e,n,r,i):"string"==typeof e?t.fromString(e)||this:Array.isArray(e)?this.set(e):void this.set(e.r,e.g,e.b,null==e.a?1:e.a)}return t.prototype.blend=function(t,e,n){this.set(t.r+(e.r-t.r)*n,t.g+(e.g-t.g)*n,t.b+(e.b-t.b)*n,t.a+(e.a-t.a)*n)},t.prototype.lighten=function(e){var n=t.lighten(this.toArray(),e);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]},t.prototype.darken=function(t){this.lighten(-t)},t.prototype.set=function(t,e,n,r){var i=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,s=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:r;return this.r=Math.round(In(i,0,255)),this.g=Math.round(In(o,0,255)),this.b=Math.round(In(s,0,255)),this.a=null==a?1:In(a,0,1),this},t.prototype.toHex=function(){var t=this;return"#"+["r","g","b"].map((function(e){var n=t[e].toString(16);return n.length<2?"0"+n:n})).join("")},t.prototype.toRGBA=function(){return this.toArray()},t.prototype.toHSLA=function(){return t.rgba2hsla(this.r,this.g,this.b,this.a)},t.prototype.toCSS=function(t){var e=this.r+","+this.g+","+this.b+",";return t?"rgb("+e+")":"rgba("+e+","+this.a+")"},t.prototype.toGrey=function(){return t.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)},t.prototype.toArray=function(){return[this.r,this.g,this.b,this.a]},t.prototype.toString=function(){return this.toCSS()},t}(),function(t){function e(e){return new t(s(s([],l(e),!0),[1],!1))}function n(e){var n=e.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(n){var r=n[1].split(/\s*,\s*/).map((function(t){return parseInt(t,10)}));return new t(r)}return null}function r(t,e,n){n<0&&++n,n>1&&--n;var r=6*n;return r<1?t+(e-t)*r:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function i(e){var n=e.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(n){var r=n[2].split(/\s*,\s*/),i=(parseFloat(r[0])%360+360)%360/360,s=parseFloat(r[1])/100,a=parseFloat(r[2])/100,l=null==r[3]?1:parseInt(r[3],10);return new t(o(i,s,a,l))}return null}function o(t,e,n,i){var o=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:i,u=a<=.5?a*(s+1):a+s-a*s,c=2*a-u;return[256*r(c,u,o+1/3),256*r(c,u,o),256*r(c,u,o-1/3),null==l?1:l]}function a(e){return new t(Math.round(256*Math.random()),Math.round(256*Math.random()),Math.round(256*Math.random()),e?void 0:parseFloat(Math.random().toFixed(2)))}function l(t){var e=0===t.indexOf("#")?t:"#"+t,n=Number("0x"+e.substr(1));if(4!==e.length&&7!==e.length||Number.isNaN(n))throw new Error("Invalid hex color.");var r=4===e.length?4:8,i=(1<<r)-1,o=["b","g","r"].map((function(){var t=n&i;return n>>=r,4===r?17*t:t}));return[o[2],o[1],o[0]]}function u(t,e,n){var r=function(t){return t.length<2?"0"+t:t};return""+r(t.toString(16))+r(e.toString(16))+r(n.toString(16))}function c(t,e){if("string"==typeof t){var n="#"===t[0],r=parseInt(n?t.substr(1):t,16),i=In((r>>16)+e,0,255),o=In((r>>8&255)+e,0,255);return(n?"#":"")+(In((255&r)+e,0,255)|o<<8|i<<16).toString(16)}var s=l(c(u(t[0],t[1],t[2]),e));return[s[0],s[1],s[2],t[3]]}t.fromArray=function(e){return new t(e)},t.fromHex=e,t.fromRGBA=n,t.fromHSLA=i,t.fromString=function(r){if(r.startsWith("#"))return e(r);if(r.startsWith("rgb"))return n(r);var o=t.named[r];return o?e(o):i(r)},t.makeGrey=function(e,n){return t.fromArray([e,e,e,n])},t.rgba2hsla=function(t,e,n,r){var i=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,s=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:r,l=Math.max(i,o,s),u=Math.min(i,o,s),c=(l+u)/2,h=0,p=0;if(u!==l){var d=l-u;switch(p=c>.5?d/(2-l-u):d/(l+u),l){case i:h=(o-s)/d+(o<s?6:0);break;case o:h=(s-i)/d+2;break;case s:h=(i-o)/d+4}h/=6}return[h,p,c,null==a?1:a]},t.hsla2rgba=o,t.random=a,t.randomHex=function(){for(var t="#",e=0;e<6;e+=1)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t},t.randomRGBA=function(t){return a(t).toString()},t.invert=function(t,e){if("string"==typeof t){var n="#"===t[0],r=l(t),i=r[0],o=r[1],s=r[2];return e?.299*i+.587*o+.114*s>186?"#000000":"#ffffff":(n?"#":"")+u(255-i,255-o,255-s)}var a=t[0],c=t[1],h=t[2],p=t[3];return e?.299*a+.587*c+.114*h>186?[0,0,0,p]:[255,255,255,p]:[255-a,255-c,255-h,p]},t.lighten=function(t,e){return c(t,e)},t.darken=function(t,e){return c(t,-e)}}(t.Color||(t.Color={})),(t.Color||(t.Color={})).named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Kh,Qh=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e,n){return null==e||(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,n)),this},t.prototype.once=function(t,e,n){var r=this,i=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return r.off(t,i),Kh.call([e,n],o)};return this.on(t,i,this)},t.prototype.off=function(t,e,n){if(!(t||e||n))return this.listeners={},this;var r=this.listeners;return(t?[t]:Object.keys(r)).forEach((function(t){var i=r[t];if(i)if(e||n)for(var o=i.length-2;o>=0;o-=2)e&&i[o]!==e||n&&i[o+1]!==n||i.splice(o,2);else delete r[t]})),this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=!0;if("*"!==t){var i=this.listeners[t];null!=i&&(r=Kh.call(s([],i,!0),e))}var o=this.listeners["*"];return null!=o?Zs([r,Kh.call(s([],o,!0),s([t],e,!0))]):r},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.trigger.apply(this,s([t],e,!1))},t}();!function(t){t.call=function(t,e){for(var n=[],r=0;r<t.length;r+=2){var i=$s(t[r],t[r+1],Array.isArray(e)?e:[e]);n.push(i)}return Zs(n)}}(Kh||(Kh={})),t.Disposable=function(){function t(){}return Object.defineProperty(t.prototype,"disposed",{get:function(){return!0===this._disposed},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._disposed=!0},t}(),(t.Disposable||(t.Disposable={})).dispose=function(){return function(t,e,n){var r=n.value,i=t.__proto__;n.value=function(){this.disposed||(r.call(this),i.dispose.call(this))}}};var tp,ep=function(){function t(t){this.callback=t}return Object.defineProperty(t.prototype,"disposed",{get:function(){return!this.callback},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){if(this.callback){var t=this.callback;this.callback=null,t()}},t}();t.DisposableSet=function(){function t(){this.isDisposed=!1,this.items=new Set}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.isDisposed},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.items.forEach((function(t){t.dispose()})),this.items.clear())},t.prototype.contains=function(t){return this.items.has(t)},t.prototype.add=function(t){this.items.add(t)},t.prototype.remove=function(t){this.items.delete(t)},t.prototype.clear=function(){this.items.clear()},t}(),(tp=t.DisposableSet||(t.DisposableSet={})).from=function(t){var e=new tp;return t.forEach((function(t){e.add(t)})),e},t.Basecoat=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(Qh),(t.Basecoat||(t.Basecoat={})).dispose=t.Disposable.dispose,vs(t.Basecoat,t.Disposable);var np,rp,ip,op,sp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return!0===this._disabled},enumerable:!1,configurable:!0}),e.prototype.enable=function(){delete this._disabled},e.prototype.disable=function(){this._disabled=!0},e}(t.Basecoat),ap=function(e){function r(){var t=e.call(this)||this;return t.clear(),t}return n(r,e),r.prototype.clear=function(){this.map=new WeakMap,this.arr=[]},r.prototype.has=function(t){return this.map.has(t)},r.prototype.get=function(t){return this.map.get(t)},r.prototype.set=function(t,e){this.map.set(t,e),this.arr.push(t)},r.prototype.delete=function(t){var e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);var n=this.map.get(t);return this.map.delete(t),n},r.prototype.each=function(t){var e=this;this.arr.forEach((function(n){var r=e.map.get(n);t(r,n)}))},r.prototype.dispose=function(){this.clear()},o([t.Disposable.dispose()],r.prototype,"dispose",null),r}(t.Disposable);t.PriorityQueue=function(){function t(e){void 0===e&&(e={}),this.comparator=e.comparator||t.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}return t.prototype.isEmpty=function(){return 0===this.data.length},t.prototype.insert=function(t,e,n){var r={priority:t,value:e},i=this.data.length-1;return n&&(r.id=n,this.index[n]=i),this.data.push(r),this.bubbleUp(i),this},t.prototype.peek=function(){return this.data[0]?this.data[0].value:null},t.prototype.peekPriority=function(){return this.data[0]?this.data[0].priority:null},t.prototype.updatePriority=function(t,e){var n=this.index[t];if(void 0===n)throw new Error("Node with id '"+t+"' was not found in the heap.");var r=this.data,i=r[n].priority,o=this.comparator(e,i);o<0?(r[n].priority=e,this.bubbleUp(n)):o>0&&(r[n].priority=e,this.bubbleDown(n))},t.prototype.remove=function(){var t=this.data,e=t[0],n=t.pop();return delete this.index[t.length],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null},t.prototype.heapify=function(){for(var t=0;t<this.data.length;t+=1)this.bubbleUp(t)},t.prototype.bubbleUp=function(t){for(var e,n,r=this.data,i=t;i>0&&(n=i-1>>>1,this.comparator(r[i].priority,r[n].priority)<0);){e=r[n],r[n]=r[i];var o=r[i].id;null!=o&&(this.index[o]=n),r[i]=e,null!=(o=r[i].id)&&(this.index[o]=i),i=n}},t.prototype.bubbleDown=function(t){for(var e=this.data,n=e.length-1,r=t;;){var i=1+(r<<1),o=i+1,s=r;if(i<=n&&this.comparator(e[i].priority,e[s].priority)<0&&(s=i),o<=n&&this.comparator(e[o].priority,e[s].priority)<0&&(s=o),s===r)break;var a=e[s];e[s]=e[r];var l=e[r].id;null!=l&&(this.index[l]=s),e[r]=a,null!=(l=e[r].id)&&(this.index[l]=r),r=s}},t}(),(t.PriorityQueue||(t.PriorityQueue={})).defaultComparator=function(t,e){return t-e},t.Dijkstra=void 0,(t.Dijkstra||(t.Dijkstra={})).run=function(e,n,r){void 0===r&&(r=function(t,e){return 1});var i={},o={},s={},a=new t.PriorityQueue;for(i[n]=0,Object.keys(e).forEach((function(t){t!==n&&(i[t]=1/0),a.insert(i[t],t,t)}));!a.isEmpty();){var l=a.remove();s[l]=!0;for(var u=e[l]||[],c=0;c<u.length;c+=1){var h=u[c];if(!s[h]){var p=i[l]+r(l,h);p<i[h]&&(i[h]=p,o[h]=l,a.updatePriority(h,p))}}}return o},t.Timing=void 0,(np=t.Timing||(t.Timing={})).linear=function(t){return t},np.quad=function(t){return t*t},np.cubic=function(t){return t*t*t},np.inout=function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},np.exponential=function(t){return Math.pow(2,10*(t-1))},np.bounce=function(t){for(var e=0,n=1;;e+=n,n/=2)if(t>=(7-4*e)/11){var r=(11-6*e-11*t)/4;return-r*r+n*n}},function(t){t.decorators={reverse:function(t){return function(e){return 1-t(1-e)}},reflect:function(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}},clamp:function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=1),function(r){var i=t(r);return i<e?e:i>n?n:i}},back:function(t){return void 0===t&&(t=1.70158),function(e){return e*e*((t+1)*e-t)}},elastic:function(t){return void 0===t&&(t=1.5),function(e){return Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}}(t.Timing||(t.Timing={})),function(t){function e(t){var e,n=t/1;return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(e=n-1.5/2.75)*e+.75:n<2.5/2.75?7.5625*(e=n-2.25/2.75)*e+.9375:7.5625*(e=n-2.625/2.75)*e+.984375}function n(t){return 1-e(1-t)}t.easeInSine=function(t){return-1*Math.cos(t*(Math.PI/2))+1},t.easeOutSine=function(t){return Math.sin(t*(Math.PI/2))},t.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)},t.easeInQuad=function(t){return t*t},t.easeOutQuad=function(t){return t*(2-t)},t.easeInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t.easeInCubic=function(t){return t*t*t},t.easeOutCubic=function(t){var e=t-1;return e*e*e+1},t.easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},t.easeInQuart=function(t){return t*t*t*t},t.easeOutQuart=function(t){var e=t-1;return 1-e*e*e*e},t.easeInOutQuart=function(t){var e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e},t.easeInQuint=function(t){return t*t*t*t*t},t.easeOutQuint=function(t){var e=t-1;return 1+e*e*e*e*e},t.easeInOutQuint=function(t){var e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e},t.easeInExpo=function(t){return 0===t?0:Math.pow(2,10*(t-1))},t.easeOutExpo=function(t){return 1===t?1:1-Math.pow(2,-10*t)},t.easeInOutExpo=function(t){if(0===t||1===t)return t;var e=2*t,n=e-1;return e<1?.5*Math.pow(2,10*n):.5*(2-Math.pow(2,-10*n))},t.easeInCirc=function(t){var e=t/1;return-1*(Math.sqrt(1-e*t)-1)},t.easeOutCirc=function(t){var e=t-1;return Math.sqrt(1-e*e)},t.easeInOutCirc=function(t){var e=2*t,n=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-n*n)+1)},t.easeInBack=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)},t.easeOutBack=function(t,e){void 0===e&&(e=1.70158);var n=t/1-1;return n*n*((e+1)*n+e)+1},t.easeInOutBack=function(t,e){void 0===e&&(e=1.70158);var n=2*t,r=n-2,i=1.525*e;return n<1?.5*n*n*((i+1)*n-i):.5*(r*r*((i+1)*r+i)+2)},t.easeInElastic=function(t,e){if(void 0===e&&(e=.7),0===t||1===t)return t;var n=t/1-1,r=1-e,i=r/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*n)*Math.sin((n-i)*(2*Math.PI)/r)},t.easeOutElastic=function(t,e){void 0===e&&(e=.7);var n=1-e,r=2*t;if(0===t||1===t)return t;var i=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*r)*Math.sin((r-i)*(2*Math.PI)/n)+1},t.easeInOutElastic=function(t,e){void 0===e&&(e=.65);var n=1-e;if(0===t||1===t)return t;var r=2*t,i=r-1,o=n/(2*Math.PI)*Math.asin(1);return r<1?Math.pow(2,10*i)*Math.sin((i-o)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/n)*.5+1},t.easeOutBounce=e,t.easeInBounce=n,t.easeInOutBounce=function(t){return t<.5?.5*n(2*t):.5*e(2*t-1)+.5}}(t.Timing||(t.Timing={})),t.Interp=void 0,(rp=t.Interp||(t.Interp={})).number=function(t,e){var n=e-t;return function(e){return t+n*e}},rp.object=function(t,e){var n=Object.keys(t);return function(r){for(var i={},o=n.length-1;-1!==o;o-=1){var s=n[o];i[s]=t[s]+(e[s]-t[s])*r}return i}},rp.unit=function(t,e){var n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=n.exec(t),i=n.exec(e),o=i?i[1]:"",s=r?+r[1]:0,a=i?+i[1]:0,l=o.indexOf("."),u=l>0?o[1].length-l-1:0,c=a-s,h=r?r[2]:"";return function(t){return(s+c*t).toFixed(u)+h}},rp.color=function(t,e){var n=parseInt(t.slice(1),16),r=parseInt(e.slice(1),16),i=255&n,o=(255&r)-i,s=65280&n,a=(65280&r)-s,l=16711680&n,u=(16711680&r)-l;return function(t){return"#"+(1<<24|i+o*t&255|s+a*t&65280|l+u*t&16711680).toString(16).slice(1)}},t.LocalStorage=void 0,function(t){var e=Sh.prefixCls+".storage";function n(t,e,n){t&&Si((function(){t(e,n)}))}function i(t,e){localStorage.setItem(t,JSON.stringify(e))}function o(t){var e=localStorage.getItem(t);return e?JSON.parse(e):null}function s(t){var e=o(l(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function a(t,n){return e+"."+t+".docs."+n}function l(t){return e+"."+t+".index"}t.insert=function(t,e,o){var u=e.id||cs("doc-"),c=s(t);c.keys.push(u),i(a(t,u),e),i(l(t),c),n(o,null,r(r({},e),{id:u}))},t.find=function(t,e,r){var i=s(t),l=[];if(null==e)i.keys.forEach((function(e){var i=o(a(t,e));i?l.push(i):n(r,new Error("No document found for an ID '"+e+"' from index."))})),n(r,null,l);else if(e.id){var u=o(a(t,e.id));n(r,null,u?[u]:[])}else n(r,null,[])},t.remove=function(t,e,r){var o=s(t);if(null==e)o.keys.forEach((function(e){localStorage.removeItem(a(t,e))})),localStorage.removeItem(l(t)),n(r,null);else if(e.id){var u=o.keys.indexOf(e.id);u>=0&&o.keys.splice(u,1),localStorage.removeItem(a(t,e.id)),i(l(t),o),n(r,null)}}}(t.LocalStorage||(t.LocalStorage={})),t.View=function(e){function i(){var t=e.call(this)||this;return t.cid=op.uniqueId(),i.views[t.cid]=t,t}return n(i,e),Object.defineProperty(i.prototype,"priority",{get:function(){return 2},enumerable:!1,configurable:!0}),i.prototype.confirmUpdate=function(t,e){return 0},i.prototype.$=function(t){return i.$(t)},i.prototype.empty=function(t){return void 0===t&&(t=this.container),this.$(t).empty(),this},i.prototype.unmount=function(t){return void 0===t&&(t=this.container),this.$(t).remove(),this},i.prototype.remove=function(t){return void 0===t&&(t=this.container),t===this.container&&(this.removeEventListeners(document),this.onRemove(),delete i.views[this.cid]),this.unmount(t),this},i.prototype.onRemove=function(){},i.prototype.setClass=function(t,e){void 0===e&&(e=this.container),e.classList.value=Array.isArray(t)?t.join(" "):t},i.prototype.addClass=function(t,e){return void 0===e&&(e=this.container),this.$(e).addClass(Array.isArray(t)?t.join(" "):t),this},i.prototype.removeClass=function(t,e){return void 0===e&&(e=this.container),this.$(e).removeClass(Array.isArray(t)?t.join(" "):t),this},i.prototype.setStyle=function(t,e){return void 0===e&&(e=this.container),this.$(e).css(t),this},i.prototype.setAttrs=function(t,e){return void 0===e&&(e=this.container),null!=t&&null!=e&&(e instanceof SVGElement?Va(e,t):this.$(e).attr(t)),this},i.prototype.findAttr=function(t,e){void 0===e&&(e=this.container);for(var n=e;n&&1===n.nodeType;){var r=n.getAttribute(t);if(null!=r)return r;if(n===this.container)return null;n=n.parentNode}return null},i.prototype.find=function(t,e,n){return void 0===e&&(e=this.container),void 0===n&&(n=this.selectors),i.find(t,e,n).elems},i.prototype.findOne=function(t,e,n){void 0===e&&(e=this.container),void 0===n&&(n=this.selectors);var r=this.find(t,e,n);return r.length>0?r[0]:null},i.prototype.findByAttr=function(t,e){void 0===e&&(e=this.container);for(var n=e;n&&n.getAttribute;){var r=n.getAttribute(t);if((null!=r||n===this.container)&&"false"!==r)return n;n=n.parentNode}return null},i.prototype.getSelector=function(t,e){var n;if(t===this.container)return"string"==typeof e&&(n="> "+e),n;if(t){var r=Ca(t)+1;n=t.tagName.toLowerCase()+":nth-child("+r+")",e&&(n+=" > "+e),n=this.getSelector(t.parentNode,n)}return n},i.prototype.prefixClassName=function(e){return t.Util.prefix(e)},i.prototype.delegateEvents=function(t,e){var n=this;if(null==t)return this;e||this.undelegateEvents();var r=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach((function(e){var i=e.match(r);if(null!=i){var o=n.getEventHandler(t[e]);"function"==typeof o&&n.delegateEvent(i[1],i[2],o)}})),this},i.prototype.undelegateEvents=function(){return this.$(this.container).off(this.getEventNamespace()),this},i.prototype.delegateDocumentEvents=function(t,e){return this.addEventListeners(document,t,e),this},i.prototype.undelegateDocumentEvents=function(){return this.removeEventListeners(document),this},i.prototype.delegateEvent=function(t,e,n){return this.$(this.container).on(t+this.getEventNamespace(),e,n),this},i.prototype.undelegateEvent=function(t,e,n){var r=t+this.getEventNamespace();return null==e?this.$(this.container).off(r):"string"==typeof e?this.$(this.container).off(r,e,n):this.$(this.container).off(r,e),this},i.prototype.addEventListeners=function(t,e,n){var r=this;if(null==e)return this;var i=this.getEventNamespace(),o=this.$(t);return Object.keys(e).forEach((function(t){var s=r.getEventHandler(e[t]);"function"==typeof s&&o.on(t+i,n,s)})),this},i.prototype.removeEventListeners=function(t){return null!=t&&this.$(t).off(this.getEventNamespace()),this},i.prototype.getEventNamespace=function(){return"."+Sh.prefixCls+"-event-"+this.cid},i.prototype.getEventHandler=function(t){var e,n=this;if("string"==typeof t){var r=this[t];"function"==typeof r&&(e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.call.apply(r,s([n],t,!1))})}else e=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.call.apply(t,s([n],e,!1))};return e},i.prototype.getEventTarget=function(t,e){void 0===e&&(e={});var n=t.target,r=t.type,i=t.clientX,o=void 0===i?0:i,s=t.clientY,a=void 0===s?0:s;return e.fromPoint||"touchmove"===r||"touchend"===r?document.elementFromPoint(o,a):n},i.prototype.stopPropagation=function(t){return this.setEventData(t,{propagationStopped:!0}),this},i.prototype.isPropagationStopped=function(t){return!0===this.getEventData(t).propagationStopped},i.prototype.getEventData=function(t){return this.eventData(t)},i.prototype.setEventData=function(t,e){return this.eventData(t,e)},i.prototype.eventData=function(t,e){if(null==t)throw new TypeError("Event object required");var n=t.data,i="__"+this.cid+"__";return null==e?null==n?{}:n[i]||{}:(null==n&&(n=t.data={}),null==n[i]?n[i]=r({},e):n[i]=r(r({},n[i]),e),n[i])},i.prototype.normalizeEvent=function(t){return i.normalizeEvent(t)},i}(t.Basecoat),function(t){function e(t){return u(t)}t.$=e,t.createElement=function(t,e){return e?va(t||"g"):ga(t||"div")},t.find=function(t,n,r){if(!t||"."===t)return{elems:[n]};if(r){var i=r[t];if(i)return{elems:Array.isArray(i)?i:[i]}}return Sh.useCSSSelector?{isCSSSelector:!0,elems:e(n).find(t).toArray()}:{elems:[]}},t.normalizeEvent=function(t){var e=t,n=t.originalEvent,r=n&&n.changedTouches&&n.changedTouches[0];if(r){for(var i in t)void 0===r[i]&&(r[i]=t[i]);e=r}var o=e.target;if(o){var s=o.correspondingUseElement;s&&(e.target=s)}return e}}(t.View||(t.View={})),(ip=t.View||(t.View={})).views={},ip.getView=function(t){return ip.views[t]||null},function(t){var e=0;t.uniqueId=function(){var t="v"+e;return e+=1,t}}(op||(op={}));function lp(t,e){return 0===e?"0%":Math.round(t/e*100)+"%"}function up(e){return function(n,r,i,o){return r.isEdgeElement(i)?function(t,e,n,r,i){var o=n.getConnection();if(!o)return e;var s=o.closestPointLength(i);if(t){var a=o.length();e.anchor={name:"ratio",args:{ratio:s/a}}}else e.anchor={name:"length",args:{length:s}};return e}(e,n,r,0,o):function(e,n,r,i,o){var s=r.cell,a=s.getAngle(),l=r.getUnrotatedBBoxOfElement(i),u=s.getBBox().getCenter(),c=t.Point.create(o).rotate(a,u),h=c.x-l.x,p=c.y-l.y;e&&(h=lp(h,l.width),p=lp(p,l.height));return n.anchor={name:"topLeft",args:{dx:h,dy:p,rotate:!0}},n}(e,n,r,i,o)}}var cp,hp=up(!0),pp=up(!1),dp=Object.freeze({__proto__:null,noop:function(t){return t},pinRelative:hp,pinAbsolute:pp});!function(t){t.presets=dp,t.registry=Ju.create({type:"connection strategy"}),t.registry.register(t.presets,!0)}(cp||(cp={}));var fp,gp=function(){function t(t){this.view=t,this.clean()}return t.prototype.clean=function(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new ap,this.pathCache={}},t.prototype.get=function(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)},t.prototype.getData=function(t){var e=this.get(t);return e.data||(e.data={}),e.data},t.prototype.getMatrix=function(t){var e=this.get(t);if(null==e.matrix){var n=this.view.rotatableNode||this.view.container;e.matrix=Cu(t,n)}return ou(e.matrix)},t.prototype.getShape=function(t){var e=this.get(t);return null==e.shape&&(e.shape=wu(t)),e.shape.clone()},t.prototype.getBoundingRect=function(t){var e=this.get(t);return null==e.boundingRect&&(e.boundingRect=bu(t)),e.boundingRect.clone()},t}();t.Markup=void 0,function(e){function n(t){return null!=t&&"string"==typeof t}function r(t){return(""+t).trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function i(t,e){void 0===e&&(e={ns:pa.svg});for(var n=document.createDocumentFragment(),r={},i={},o=[{markup:Array.isArray(t)?t:[t],parent:n,ns:e.ns}],s=function(){var t=o.pop(),e=t.ns||pa.svg,n=t.markup,s=t.parent;n.forEach((function(t){var n=t.tagName;if(!n)throw new TypeError("Invalid tagName");t.ns&&(e=t.ns);var a=e===pa.svg,l=e?ga(n,e):fa(n),c=t.attrs;c&&(a?Va(l,Ra(c)):u(l).attr(c));var h=t.style;h&&u(l).css(h);var p=t.className;null!=p&&l.setAttribute("class",Array.isArray(p)?p.join(" "):p),t.textContent&&(l.textContent=t.textContent);var d=t.selector;if(null!=d){if(i[d])throw new TypeError("Selector must be unique");i[d]=l}if(t.groupSelector){var f=t.groupSelector;Array.isArray(f)||(f=[f]),f.forEach((function(t){r[t]||(r[t]=[]),r[t].push(l)}))}s.appendChild(l);var g=t.children;Array.isArray(g)&&o.push({ns:e,markup:g,parent:l})}))};o.length>0;)s();return Object.keys(r).forEach((function(t){if(i[t])throw new Error("Ambiguous group selector");i[t]=r[t]})),{fragment:n,selectors:i,groups:r}}function o(t){return t instanceof SVGElement?va("g"):fa("div")}e.isJSONMarkup=function(t){return null!=t&&!n(t)},e.isStringMarkup=n,e.clone=function(t){return null==t||n(t)?t:zr(t)},e.sanitize=r,e.parseStringMarkup=function(t){var e=document.createDocumentFragment();return Vs(r(t),{raw:!0}).forEach((function(t){e.appendChild(t)})),{fragment:e,selectors:{},groups:{}}},e.parseJSONMarkup=i,e.renderMarkup=function(e){if(n(e)){var r=t.Vector.createVectors(e),s=r.length;if(1===s)return{elem:r[0].node};if(s>1){var a=o(r[0].node);return r.forEach((function(t){a.appendChild(t.node)})),{elem:a}}return{}}var l=i(e),u=l.fragment,c=null;return u.childNodes.length>1?(c=o(u.firstChild)).appendChild(u):c=u.firstChild,{elem:c,selectors:l.selectors}},e.parseLabelStringMarkup=function(e){for(var n=t.Vector.createVectors(e),r=document.createDocumentFragment(),i=0,o=n.length;i<o;i+=1){var s=n[i].node;r.appendChild(s)}return{fragment:r,selectors:{}}}}(t.Markup||(t.Markup={})),function(t){function e(t,n,r){if(null!=t){var i=void 0,o=t.tagName.toLowerCase();if(t===n)return i="string"==typeof r?"> "+o+" > "+r:"> "+o;var s=t.parentNode;if(s&&s.childNodes.length>1)i=o+":nth-child("+(Ca(t)+1)+")";else i=o;return r&&(i+=" > "+r),e(t.parentNode,n,i)}return r}function n(t,n,r){if("#text"===t.nodeName)return null;var i=null,o=null,s=null,a=!1,l={tagName:t.tagName};if(t.attributes){s={};for(var u=0,c=t.attributes.length;u<c;u+=1){var h=t.attributes[u],p=h.nodeName,d=h.nodeValue;"selector"===p?i=d:"groupSelector"===p?o=d:"class"===p?l.attrs={class:d}:s[p]=d}}return null==i&&(a=!0,i=e(t,n)),t.namespaceURI&&(l.ns=t.namespaceURI),null==l.ns&&(["body","div","section","main","nav","footer","span","p","h1","h2","h3","h4","h5","h6","ul","ol","dl","center","strong","pre","form","select","textarea","fieldset","marquee","bgsound","iframe","frameset"].includes(t.tagName)?l.ns=pa.xhtml:r&&(l.ns=r)),i&&(l.selector=i),null!=o&&(l.groupSelector=o),{markup:l,attrs:s,isCSSSelector:a}}t.getSelector=e,t.xml2json=function(e){var r=ma(t.sanitize(e),{mimeType:"image/svg+xml"}),i=Array.prototype.slice.call(r.childNodes),o={},s=new WeakMap,a=function(t,e,r){var i=n(t,e,r);if(null!=i){var l=i.markup,u=i.attrs,c=i.isCSSSelector;if(s.set(t,l),l.selector&&null!=u&&(Object.keys(u).length&&(o[l.selector]=u),c&&delete l.selector),t.childNodes&&t.childNodes.length>0)for(var h=0,p=t.childNodes.length;h<p;h+=1){var d=t.childNodes[h],f=a(d,e,l.ns);f&&(null==l.children&&(l.children=[]),l.children.push(f))}return l}var g=s.get(t.parentNode);g&&t.textContent&&(g.textContent=t.textContent)};return{markup:i.map((function(t){return a(t,t)})).filter((function(t){return null!=t})),attrs:o}}}(t.Markup||(t.Markup={})),(fp=t.Markup||(t.Markup={})).getPortContainerMarkup=function(){return"g"},fp.getPortMarkup=function(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}},fp.getPortLabelMarkup=function(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}},function(t){t.getEdgeMarkup=function(){return t.sanitize('\n <path class="connection" stroke="black" d="M 0 0 0 0"/>\n <path class="source-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="target-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="connection-wrap" d="M 0 0 0 0"/>\n <g class="labels"/>\n <g class="vertices"/>\n <g class="arrowheads"/>\n <g class="tools"/>\n ')},t.getEdgeToolMarkup=function(){return t.sanitize('\n <g class="edge-tool">\n <g class="tool-remove" event="edge:remove">\n <circle r="11" />\n <path transform="scale(.8) translate(-16, -16)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z" />\n <title>Remove edge.</title>\n </g>\n <g class="tool-options" event="edge:options">\n <circle r="11" transform="translate(25)"/>\n <path fill="white" transform="scale(.55) translate(29, -16)" d="M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z"/>\n <title>Edge options.</title>\n </g>\n </g>\n ')},t.getEdgeVertexMarkup=function(){return t.sanitize('\n <g class="vertex-group" transform="translate(<%= x %>, <%= y %>)">\n <circle class="vertex" data-index="<%= index %>" r="10" />\n <path class="vertex-remove-area" data-index="<%= index %>" d="M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z" transform="translate(5, -33)"/>\n <path class="vertex-remove" data-index="<%= index %>" transform="scale(.8) translate(9.5, -37)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z">\n <title>Remove vertex.</title>\n </path>\n </g>\n ')},t.getEdgeArrowheadMarkup=function(){return t.sanitize('\n <g class="arrowhead-group arrowhead-group-<%= end %>">\n <path class="arrowhead" data-terminal="<%= end %>" d="M 26 0 L 0 13 L 26 26 z" />\n </g>\n ')}}(t.Markup||(t.Markup={})),function(t){t.getForeignObjectMarkup=function(t){return void 0===t&&(t=!1),{tagName:"foreignObject",selector:"fo",children:[{ns:pa.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:pa.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}}(t.Markup||(t.Markup={}));var vp=function(){function e(t){this.view=t}return Object.defineProperty(e.prototype,"cell",{get:function(){return this.view.cell},enumerable:!1,configurable:!0}),e.prototype.getDefinition=function(t){return this.cell.getAttrDefinition(t)},e.prototype.processAttrs=function(t,n){var r,i,o,s,a,l=this,u=[];return Object.keys(n).forEach((function(i){var o=n[i],s=l.getDefinition(i),a=Ws(ch.isValidDefinition,l.view,s,o,{elem:t,attrs:n,cell:l.cell,view:l.view});if(s&&a)"string"==typeof s?(null==r&&(r={}),r[s]=o):null!==o&&u.push({name:i,definition:s});else{null==r&&(r={});var c=e.CASE_SENSITIVE_ATTR.includes(i)?i:ks(i);r[c]=o}})),u.forEach((function(r){var l=r.name,u=r.definition,c=n[l];"function"==typeof u.set&&(!Na(t)&&e.DELAY_ATTRS.includes(l)?(null==a&&(a={}),a[l]=c):(null==i&&(i={}),i[l]=c)),"function"==typeof u.offset&&(null==o&&(o={}),o[l]=c),"function"==typeof u.position&&(null==s&&(s={}),s[l]=c)})),{raw:n,normal:r,set:i,offset:o,position:s,delay:a}},e.prototype.mergeProcessedAttrs=function(t,e){t.set=r(r({},t.set),e.set),t.position=r(r({},t.position),e.position),t.offset=r(r({},t.offset),e.offset);var n=t.normal&&t.normal.transform;null!=n&&e.normal&&(e.normal.transform=n),t.normal=e.normal},e.prototype.findAttrs=function(e,n,r,i){var o=[],s=new ap;return Object.keys(e).forEach((function(a){var l=e[a];if(_e(l)){var u=t.View.find(a,n,i),c=u.isCSSSelector,h=u.elems;r[a]=h;for(var p=0,d=h.length;p<d;p+=1){var f=h[p],g=i&&i[a]===f,v=s.get(f);if(v){v.array||(o.push(f),v.array=!0,v.attrs=[v.attrs],v.priority=[v.priority]);var y=v.attrs,m=v.priority;if(g)y.unshift(l),m.unshift(-1);else{var b=zo(m,c?-1:d);y.splice(b,0,l),m.splice(b,0,d)}}else s.set(f,{elem:f,attrs:l,priority:g?-1:d,array:!1})}}})),o.forEach((function(t){var e=s.get(t),n=e.attrs;e.attrs=n.reduceRight((function(t,e){return ro(t,e)}),{})})),s},e.prototype.updateRelativeAttrs=function(e,n,i,o){var s=this,a=n.raw||{},l=n.normal||{},u=n.set,c=n.position,h=n.offset,p=n.delay,d=function(){return{elem:e,cell:s.cell,view:s.view,attrs:a,refBBox:i.clone()}};if(null!=u&&Object.keys(u).forEach((function(t){var e=u[t],n=s.getDefinition(t);if(null!=n){var i=Ws(n.set,s.view,e,d());"object"==typeof i?l=r(r({},l),i):null!=i&&(l[t]=i)}})),Na(e))this.view.setAttrs(l,e);else{var f=l.transform,g=au(f?""+f:null),v=new t.Point(g.e,g.f);f&&(delete l.transform,g.e=0,g.f=0);var y=1,m=1;if(c||h){var b=this.view.getScaleOfElement(e,o.scalableNode);y=b.sx,m=b.sy}var C=!1;null!=c&&Object.keys(c).forEach((function(e){var n=c[e],r=s.getDefinition(e);if(null!=r){var i=Ws(r.position,s.view,n,d());null!=i&&(C=!0,v.translate(t.Point.create(i).scale(y,m)))}})),this.view.setAttrs(l,e);var x=!1;if(null!=h){var w=this.view.getBoundingRectOfElement(e);if(w.width>0&&w.height>0){var P=yu(w,g).scale(1/y,1/m);Object.keys(h).forEach((function(n){var r=h[n],i=s.getDefinition(n);if(null!=i){var o=Ws(i.offset,s.view,r,{elem:e,cell:s.cell,view:s.view,attrs:a,refBBox:P});null!=o&&(x=!0,v.translate(t.Point.create(o).scale(y,m)))}}))}}(null!=f||C||x)&&(v.round(1),g.e=v.x,g.f=v.y,e.setAttribute("transform",lu(g)));var A=function(){null!=p&&Object.keys(p).forEach((function(t){var n,r=p[t],i=s.getDefinition(t);if(null!=i){var o=Ws(i.set,s.view,r,d());"object"==typeof o?s.view.setAttrs(o,e):null!=o&&s.view.setAttrs(((n={})[t]=o,n),e)}}))};o.forceSync?A():t.Scheduler.scheduleTask(A)}},e.prototype.update=function(t,e,n){var r=this,i={},o=this.findAttrs(n.attrs||e,t,i,n.selectors),s=n.attrs?this.findAttrs(e,t,i,n.selectors):o,a=[];o.each((function(e){var o=e.elem,l=e.attrs,u=r.processAttrs(o,l);if(null==u.set&&null==u.position&&null==u.offset&&null==u.delay)r.view.setAttrs(u.normal,o);else{var c=s.get(o),h=c?c.attrs:null,p=h&&null==l.ref?h.ref:l.ref,d=void 0;if(p){if(!(d=(i[p]||r.view.find(p,t,n.selectors))[0]))throw new Error('"'+p+'" reference does not exist.')}else d=null;var f={node:o,refNode:d,attributes:h,processedAttributes:u},g=a.findIndex((function(t){return t.refNode===o}));g>-1?a.splice(g,0,f):a.push(f)}}));var l,u=new ap;a.forEach((function(e){var i,o,s=e.node,c=e.refNode,h=null!=c&&null!=n.rotatableNode&&Aa(n.rotatableNode,c);if(c&&(i=u.get(c)),!i){var p=h?n.rotatableNode:t;i=c?bu(c,{target:p}):n.rootBBox,c&&u.set(c,i)}n.attrs&&e.attributes?(o=r.processAttrs(s,e.attributes),r.mergeProcessedAttrs(o,e.processedAttributes)):o=e.processedAttributes;var d=i;h&&null!=n.rotatableNode&&!n.rotatableNode.contains(s)&&(l||(l=au(Va(n.rotatableNode,"transform"))),d=yu(i,l)),a.find((function(t){return t.refNode===s}))&&(n.forceSync=!0),r.updateRelativeAttrs(s,o,d,n)}))},e}();!function(t){t.CASE_SENSITIVE_ATTR=["viewBox"],t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]}(vp||(vp={}));var yp,mp,bp=function(){function t(t,e,n){void 0===n&&(n=[]),this.view=t;var r={},i={},o=0;Object.keys(e).forEach((function(t){var n=e[t];Array.isArray(n)||(n=[n]),n.forEach((function(e){var n=r[e];n||(o+=1,n=r[e]=1<<o),i[t]|=n}))}));var s=n;if(Array.isArray(s)||(s=[s]),s.forEach((function(t){r[t]||(o+=1,r[t]=1<<o)})),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=n}return Object.defineProperty(t.prototype,"cell",{get:function(){return this.view.cell},enumerable:!1,configurable:!0}),t.prototype.getFlag=function(t){var e=this.flags;return null==e?0:Array.isArray(t)?t.reduce((function(t,n){return t|e[n]}),0):0|e[t]},t.prototype.hasAction=function(t,e){return t&this.getFlag(e)},t.prototype.removeAction=function(t,e){return t^t&this.getFlag(e)},t.prototype.getBootstrapFlag=function(){return this.getFlag(this.bootstrap)},t.prototype.getChangedFlag=function(){var t=this,e=0;return this.attrs?(Object.keys(this.attrs).forEach((function(n){t.cell.hasChanged(n)&&(e|=t.attrs[n])})),e):e},t}();function Cp(t,e,n,r){return Ws(cp.presets.pinRelative,this.graph,{},e,n,t,this.cell,r,{}).anchor}function xp(t,e){return e?t.cell.getBBox():t.cell.isEdge()?t.getConnection().bbox():t.getUnrotatedBBoxOfElement(t.container)}t.CellView=function(e){function o(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.cell=t,r.options=r.ensureOptions(n),r.graph=r.options.graph,r.attr=new vp(r),r.flag=new bp(r,r.options.actions,r.options.bootstrap),r.cache=new gp(r),r.setContainer(r.ensureContainer()),r.setup(),r.$(r.container).data("view",r),r.init(),r}return n(o,e),o.getDefaults=function(){return this.defaults},o.config=function(t){this.defaults=this.getOptions(t)},o.getOptions=function(t){var e=function(t,e){return null!=e?ls(s(s([],Array.isArray(t)?t:[t],!0),Array.isArray(e)?e:[e],!0)):Array.isArray(t)?s([],t,!0):[t]},n=zr(this.getDefaults()),o=t.bootstrap,a=t.actions,l=t.events,u=t.documentEvents,c=i(t,["bootstrap","actions","events","documentEvents"]);return o&&(n.bootstrap=e(n.bootstrap,o)),a&&Object.keys(a).forEach((function(t){var r=a[t],i=n.actions[t];r&&i?n.actions[t]=e(i,r):r&&(n.actions[t]=e(r))})),l&&(n.events=r(r({},n.events),l)),t.documentEvents&&(n.documentEvents=r(r({},n.documentEvents),u)),ro(n,c)},Object.defineProperty(o.prototype,Symbol.toStringTag,{get:function(){return o.toStringTag},enumerable:!1,configurable:!0}),o.prototype.init=function(){},o.prototype.onRemove=function(){this.removeTools()},Object.defineProperty(o.prototype,"priority",{get:function(){return this.options.priority},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"rootSelector",{get:function(){return this.options.rootSelector},enumerable:!1,configurable:!0}),o.prototype.getConstructor=function(){return this.constructor},o.prototype.ensureOptions=function(t){return this.getConstructor().getOptions(t)},o.prototype.getContainerTagName=function(){return this.options.isSvgElement?"g":"div"},o.prototype.getContainerStyle=function(){},o.prototype.getContainerAttrs=function(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}},o.prototype.getContainerClassName=function(){return this.prefixClassName("cell")},o.prototype.ensureContainer=function(){return t.View.createElement(this.getContainerTagName(),this.options.isSvgElement)},o.prototype.setContainer=function(t){if(this.container!==t){this.undelegateEvents(),this.container=t,null!=this.options.events&&this.delegateEvents(this.options.events);var e=this.getContainerAttrs();null!=e&&this.setAttrs(e,t);var n=this.getContainerStyle();null!=n&&this.setStyle(n,t);var r=this.getContainerClassName();null!=r&&this.addClass(r,t)}return this},o.prototype.isNodeView=function(){return!1},o.prototype.isEdgeView=function(){return!1},o.prototype.render=function(){return this},o.prototype.confirmUpdate=function(t,e){return 0},o.prototype.getBootstrapFlag=function(){return this.flag.getBootstrapFlag()},o.prototype.getFlag=function(t){return this.flag.getFlag(t)},o.prototype.hasAction=function(t,e){return this.flag.hasAction(t,e)},o.prototype.removeAction=function(t,e){return this.flag.removeAction(t,e)},o.prototype.handleAction=function(t,e,n,r){if(this.hasAction(t,e)){n();var i=[e];return r&&("string"==typeof r?i.push(r):i.push.apply(i,r)),this.removeAction(t,i)}return t},o.prototype.setup=function(){var t=this;this.cell.on("changed",(function(e){var n=e.options;return t.onAttrsChange(n)}))},o.prototype.onAttrsChange=function(t){var e=this.flag.getChangedFlag();!t.updated&&e&&(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),null!=this.graph&&this.graph.renderer.requestViewUpdate(this,e,this.priority,t))},o.prototype.parseJSONMarkup=function(e,n){var r=t.Markup.parseJSONMarkup(e),i=r.selectors,o=this.rootSelector;if(n&&o){if(i[o])throw new Error("Invalid root selector");i[o]=n}return r},o.prototype.can=function(t){var e=this.graph.options.interacting;if("function"==typeof e&&(e=Ws(e,this.graph,this)),"object"==typeof e){var n=e[t];return"function"==typeof n&&(n=Ws(n,this.graph,this)),!1!==n}return"boolean"==typeof e&&e},o.prototype.cleanCache=function(){return this.cache.clean(),this},o.prototype.getCache=function(t){return this.cache.get(t)},o.prototype.getDataOfElement=function(t){return this.cache.getData(t)},o.prototype.getMatrixOfElement=function(t){return this.cache.getMatrix(t)},o.prototype.getShapeOfElement=function(t){return this.cache.getShape(t)},o.prototype.getScaleOfElement=function(t,e){var n,r;if(e&&e.contains(t)){var i=Ou(e);n=1/i.sx,r=1/i.sy}else n=1,r=1;return{sx:n,sy:r}},o.prototype.getBoundingRectOfElement=function(t){return this.cache.getBoundingRect(t)},o.prototype.getBBoxOfElement=function(t){var e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),r=this.getRootRotatedMatrix();return yu(e,this.getRootTranslatedMatrix().multiply(r).multiply(n))},o.prototype.getUnrotatedBBoxOfElement=function(t){var e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t);return yu(e,this.getRootTranslatedMatrix().multiply(n))},o.prototype.getBBox=function(t){var e;if(void 0===t&&(t={}),t.useCellGeometry){var n=this.cell,r=n.isNode()?n.getAngle():0;e=n.getBBox().bbox(r)}else e=this.getBBoxOfElement(this.container);return this.graph.localToGraph(e)},o.prototype.getRootTranslatedMatrix=function(){var t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return ou().translate(e.x,e.y)},o.prototype.getRootRotatedMatrix=function(){var t=ou(),e=this.cell,n=e.isNode()?e.getAngle():0;if(n){var r=e.getBBox(),i=r.width/2,o=r.height/2;t=t.translate(i,o).rotate(n).translate(-i,-o)}return t},o.prototype.findMagnet=function(t){return void 0===t&&(t=this.container),this.findByAttr("magnet",t)},o.prototype.updateAttrs=function(e,n,r){void 0===r&&(r={}),null==r.rootBBox&&(r.rootBBox=new t.Rectangle),null==r.selectors&&(r.selectors=this.selectors),this.attr.update(e,n,r)},o.prototype.isEdgeElement=function(t){return this.cell.isEdge()&&(null==t||t===this.container)},o.prototype.prepareHighlight=function(t,e){void 0===e&&(e={});var n=t&&this.$(t)[0]||this.container;return e.partial=n===this.container,n},o.prototype.highlight=function(t,e){void 0===e&&(e={});var n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this},o.prototype.unhighlight=function(t,e){void 0===e&&(e={});var n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this},o.prototype.notifyUnhighlight=function(t,e){},o.prototype.getEdgeTerminal=function(t,e,n,r,i){var o=this.cell,s=this.findAttr("port",t),a=t.getAttribute("data-selector"),l={cell:o.id};return null!=a&&(l.magnet=a),null!=s?(l.port=s,o.isNode()&&(o.hasPort(s)||null!=a||(l.selector=this.getSelector(t)))):null==a&&this.container!==t&&(l.selector=this.getSelector(t)),this.customizeEdgeTerminal(l,t,e,n,r,i)},o.prototype.customizeEdgeTerminal=function(e,n,r,i,o,s){var a=o.getStrategy()||this.graph.options.connecting.strategy;if(a){var l="string"==typeof a?a:a.name,u="string"==typeof a?{}:a.args||{},c=cp.registry;if(l){var h=c.get(l);if(null==h)return c.onNotFound(l);var p=Ws(h,this.graph,e,this,n,new t.Point(r,i),o,s,u);if(p)return p}}return e},o.prototype.getMagnetFromEdgeTerminal=function(t){var e,n=this.cell,r=this.container,i=t.port,o=t.magnet;return null!=i&&n.isNode()&&n.hasPort(i)?e=this.findPortElem(i,o)||r:(o||(o=t.selector),o||null==i||(o='[port="'+i+'"]'),e=this.findOne(o,r,this.selectors)),e},o.prototype.animate=function(e,n){var r="string"==typeof e?this.findOne(e):e;if(null==r)throw new Error("Invalid animation element.");var i=r.parentNode,o=t.Vector.create(r);i||o.appendTo(this.graph.view.stage);var s=n.complete;return n.complete=function(t){i||Ea(r),s&&s(t)},o.animate(n)},o.prototype.animateTransform=function(e,n){var r="string"==typeof e?this.findOne(e):e;if(null==r)throw new Error("Invalid animation element.");var i=r.parentNode,o=t.Vector.create(r);i||o.appendTo(this.graph.view.stage);var s=n.complete;return n.complete=function(t){i||Ea(r),s&&s(t)},o.animateTransform(n)},o.prototype.hasTools=function(t){var e=this.tools;return null!=e&&(null==t||e.name===t)},o.prototype.addTools=function(e){if(!this.can("toolsAddable"))return this;if(this.removeTools(),e){var n=t.ToolsView.isToolsView(e)?e:new t.ToolsView(e);this.tools=n,this.graph.on("tools:hide",this.hideTools,this),this.graph.on("tools:show",this.showTools,this),this.graph.on("tools:remove",this.removeTools,this),n.config({view:this}),n.mount()}return this},o.prototype.updateTools=function(t){return void 0===t&&(t={}),this.tools&&this.tools.update(t),this},o.prototype.removeTools=function(){return this.tools&&(this.tools.remove(),this.graph.off("tools:hide",this.hideTools,this),this.graph.off("tools:show",this.showTools,this),this.graph.off("tools:remove",this.removeTools,this),this.tools=null),this},o.prototype.hideTools=function(){return this.tools&&this.tools.hide(),this},o.prototype.showTools=function(){return this.tools&&this.tools.show(),this},o.prototype.renderTools=function(){var t=this.cell.getTools();return this.addTools(t),this},o.prototype.notify=function(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this},o.prototype.getEventArgs=function(t,e,n){var r=this,i=r.cell;return null==e||null==n?{e:t,view:r,cell:i}:{e:t,x:e,y:n,view:r,cell:i}},o.prototype.onClick=function(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))},o.prototype.onDblClick=function(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))},o.prototype.onContextMenu=function(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))},o.prototype.onMouseDown=function(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))},o.prototype.onMouseUp=function(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)},o.prototype.onMouseMove=function(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))},o.prototype.onMouseOver=function(t){this.notify("cell:mouseover",this.getEventArgs(t))},o.prototype.onMouseOut=function(t){this.notify("cell:mouseout",this.getEventArgs(t))},o.prototype.onMouseEnter=function(t){this.notify("cell:mouseenter",this.getEventArgs(t))},o.prototype.onMouseLeave=function(t){this.notify("cell:mouseleave",this.getEventArgs(t))},o.prototype.onMouseWheel=function(t,e,n,i){this.notify("cell:mousewheel",r({delta:i},this.getEventArgs(t,e,n)))},o.prototype.onCustomEvent=function(t,e,n,i){this.notify("cell:customevent",r({name:e},this.getEventArgs(t,n,i))),this.notify(e,r({},this.getEventArgs(t,n,i)))},o.prototype.onMagnetMouseDown=function(t,e,n,r){},o.prototype.onMagnetDblClick=function(t,e,n,r){},o.prototype.onMagnetContextMenu=function(t,e,n,r){},o.prototype.onLabelMouseDown=function(t,e,n){},o.prototype.checkMouseleave=function(t){var e=this.graph;e.renderer.isAsync()&&e.renderer.dumpView(this);var n=this.getEventTarget(t,{fromPoint:!0}),r=e.renderer.findViewByElem(n);r!==this&&(this.onMouseLeave(t),r&&r.onMouseEnter(t))},o.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},o}(t.View),(yp=t.CellView||(t.CellView={})).Flag=bp,yp.Attr=vp,function(t){t.toStringTag="X6."+t.name,t.isCellView=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"==typeof r.isNodeView&&"function"==typeof r.isEdgeView&&"function"==typeof r.confirmUpdate}}(t.CellView||(t.CellView={})),function(t){t.priority=function(t){return function(e){e.config({priority:t})}},t.bootstrap=function(t){return function(e){e.config({bootstrap:t})}}}(t.CellView||(t.CellView={})),function(t){t.registry=Ju.create({type:"view"})}(t.CellView||(t.CellView={})),t.ToolsView=function(e){function i(t){void 0===t&&(t={});var n=e.call(this)||this;return n.svgContainer=n.createContainer(!0,t),n.htmlContainer=n.createContainer(!1,t),n.config(t),n}return n(i,e),Object.defineProperty(i.prototype,"name",{get:function(){return this.options.name},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"graph",{get:function(){return this.cellView.graph},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cell",{get:function(){return this.cellView.cell},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return i.toStringTag},enumerable:!1,configurable:!0}),i.prototype.createContainer=function(e,n){var r=e?t.View.createElement("g",!0):t.View.createElement("div",!1);return oa(r,this.prefixClassName("cell-tools")),n.className&&oa(r,n.className),r},i.prototype.config=function(e){if(this.options=r(r({},this.options),e),!t.CellView.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(oa(this.svgContainer,this.prefixClassName("edge-tools")),oa(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(oa(this.svgContainer,this.prefixClassName("node-tools")),oa(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));var n=this.options.items;if(!Array.isArray(n))return this;this.tools=[];var o=[];n.forEach((function(t){i.ToolItem.isToolItem(t)?"vertices"===t.name?o.unshift(t):o.push(t):"vertices"===("object"==typeof t?t.name:t)?o.unshift(t):o.push(t)}));for(var s=0;s<o.length;s+=1){var a=o[s],l=void 0;if(i.ToolItem.isToolItem(a))l=a;else{var u="object"==typeof a?a.name:a,c="object"==typeof a&&a.args||{};if(u)if(this.cell.isNode()){if(!(h=Dp.registry.get(u)))return Dp.registry.onNotFound(u);l=new h(c)}else if(this.cell.isEdge()){var h;if(!(h=Np.registry.get(u)))return Np.registry.onNotFound(u);l=new h(c)}}if(l)l.config(this.cellView,this),l.render(),(!1!==l.options.isSVGElement?this.svgContainer:this.htmlContainer).appendChild(l.container),this.tools.push(l)}return this},i.prototype.update=function(t){void 0===t&&(t={});var e=this.tools;return e&&e.forEach((function(e){t.toolId!==e.cid&&e.isVisible()&&e.update()})),this},i.prototype.focus=function(t){var e=this.tools;return e&&e.forEach((function(e){t===e?e.show():e.hide()})),this},i.prototype.blur=function(t){var e=this.tools;return e&&e.forEach((function(e){e===t||e.isVisible()||(e.show(),e.update())})),this},i.prototype.hide=function(){return this.focus(null)},i.prototype.show=function(){return this.blur(null)},i.prototype.remove=function(){var t=this.tools;return t&&(t.forEach((function(t){return t.remove()})),this.tools=null),Ea(this.svgContainer),Ea(this.htmlContainer),e.prototype.remove.call(this)},i.prototype.mount=function(){var t=this.tools,e=this.cellView;if(e&&t){var n=t.some((function(t){return!1!==t.options.isSVGElement})),r=t.some((function(t){return!1===t.options.isSVGElement}));if(n)(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer);r&&this.graph.container.appendChild(this.htmlContainer)}return this},i}(t.View),(mp=t.ToolsView||(t.ToolsView={})).toStringTag="X6."+mp.name,mp.isToolsView=function(t){if(null==t)return!1;if(t instanceof mp)return!0;var e=t[Symbol.toStringTag],n=t;return(null==e||e===mp.toStringTag)&&null!=n.graph&&null!=n.cell&&"function"==typeof n.config&&"function"==typeof n.update&&"function"==typeof n.focus&&"function"==typeof n.blur&&"function"==typeof n.show&&"function"==typeof n.hide},function(e){var r=function(e){function r(n){void 0===n&&(n={});var r=e.call(this)||this;return r.visible=!0,r.options=r.getOptions(n),r.container=t.View.createElement(r.options.tagName||"g",!1!==r.options.isSVGElement),oa(r.container,r.prefixClassName("cell-tool")),"string"==typeof r.options.className&&oa(r.container,r.options.className),r.init(),r}return n(r,e),r.getDefaults=function(){return this.defaults},r.config=function(t){this.defaults=this.getOptions(t)},r.getOptions=function(t){return ro(zr(this.getDefaults()),t)},Object.defineProperty(r.prototype,"graph",{get:function(){return this.cellView.graph},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"cell",{get:function(){return this.cellView.cell},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this.options.name},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,Symbol.toStringTag,{get:function(){return r.toStringTag},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.getOptions=function(t){return this.constructor.getOptions(t)},r.prototype.delegateEvents=function(){return this.options.events&&e.prototype.delegateEvents.call(this,this.options.events),this},r.prototype.config=function(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?oa(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&oa(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this},r.prototype.render=function(){this.empty();var e=this.options.markup;if(e){var n=t.Markup.isStringMarkup(e)?t.Markup.parseStringMarkup(e):t.Markup.parseJSONMarkup(e);this.container.appendChild(n.fragment),this.childNodes=n.selectors}return this.onRender(),this},r.prototype.onRender=function(){},r.prototype.update=function(){return this},r.prototype.stamp=function(t){void 0===t&&(t=this.container),t&&t.setAttribute("data-cell-id",this.cellView.cell.id)},r.prototype.show=function(){return this.container.style.display="",this.visible=!0,this},r.prototype.hide=function(){return this.container.style.display="none",this.visible=!1,this},r.prototype.isVisible=function(){return!!this.visible},r.prototype.focus=function(){var t=this.options.focusOpacity;return null!=t&&Number.isFinite(t)&&(this.container.style.opacity=""+t),this.parent.focus(this),this},r.prototype.blur=function(){return this.container.style.opacity="",this.parent.blur(this),this},r.prototype.guard=function(t){return null==this.graph||null==this.cellView||this.graph.view.guard(t,this.cellView)},r.defaults={isSVGElement:!0,tagName:"g"},r}(t.View);e.ToolItem=r,function(t){var e=0;t.define=function(t){var n,r=Cs((n=t.name)?Ts(n):"CustomTool"+(e+=1),this);return r.config(t),r}}(r=e.ToolItem||(e.ToolItem={})),function(t){t.toStringTag="X6."+t.name,t.isToolItem=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&null!=r.graph&&null!=r.cell&&"function"==typeof r.config&&"function"==typeof r.update&&"function"==typeof r.focus&&"function"==typeof r.blur&&"function"==typeof r.show&&"function"==typeof r.hide&&"function"==typeof r.isVisible}}(r=e.ToolItem||(e.ToolItem={}))}(t.ToolsView||(t.ToolsView={}));var wp=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.onRender=function(){oa(this.container,this.prefixClassName("cell-tool-button")),this.update()},r.prototype.update=function(){return this.updatePosition(),this},r.prototype.updatePosition=function(){var t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Tu(this.container,t,{absolute:!0})},r.prototype.getNodeMatrix=function(){var t=this.cellView,e=this.options,n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,s=e.offset,a=e.useCellGeometry,l=e.rotate,u=xp(t,a),c=t.cell.getAngle();l||(u=u.bbox(c));var h=0,p=0;"number"==typeof s?(h=s,p=s):"object"==typeof s&&(h=s.x,p=s.y),r=Gs(r,u.width),o=Gs(o,u.height);var d=ou().translate(u.x+u.width/2,u.y+u.height/2);return l&&(d=d.rotate(c)),d=d.translate(r+h-u.width/2,o+p-u.height/2)},r.prototype.getEdgeMatrix=function(){var e,n,r,i=this.cellView,o=this.options,s=o.offset,a=void 0===s?0:s,l=o.distance,u=void 0===l?0:l,c=o.rotate;(e=_s(u)?i.getTangentAtRatio(parseFloat(u)/100):i.getTangentAtLength(u))?(n=e.start,r=e.vector().vectorAngle(new t.Point(1,0))||0):(n=i.getConnection().start,r=0);var h=ou().translate(n.x,n.y).rotate(r);return h="object"==typeof a?h.translate(a.x||0,a.y||0):h.translate(0,a),c||(h=h.rotate(-r)),h},r.prototype.onMouseDown=function(t){if(!this.guard(t)){t.stopPropagation(),t.preventDefault();var e=this.options.onClick;"function"==typeof e&&Ws(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}},r}(t.ToolsView.ToolItem);!function(t){t.config({name:"button",events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})}(wp||(wp={})),function(t){t.Remove=t.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,onClick:function(t){var e=t.view,n=t.btn;n.parent.remove(),e.cell.remove({ui:!0,toolId:n.cid})}})}(wp||(wp={}));var Pp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.onRender=function(){if(oa(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){var t=this.options.attrs,e=t.class,n=i(t,["class"]);Va(this.container,Ra(n)),e&&oa(this.container,e)}this.update()},e.prototype.update=function(){var t=this.cellView,e=this.options,n=e.useCellGeometry,r=e.rotate,i=Us(e.padding),o=xp(t,n).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom}),s=t.cell;if(s.isNode()){var a=s.getAngle();if(a)if(r){var l=s.getBBox().getCenter();Nu(this.container,a,l.x,l.y,{absolute:!0})}else o=o.bbox(a)}return Va(this.container,o.toJSON()),this},e}(t.ToolsView.ToolItem);!function(t){t.config({name:"boundary",tagName:"rect",padding:10,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})}(Pp||(Pp={}));var Ap=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.handles=[],t}return n(r,e),Object.defineProperty(r.prototype,"vertices",{get:function(){return this.cellView.cell.getVertices()},enumerable:!1,configurable:!0}),r.prototype.onRender=function(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this},r.prototype.update=function(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this},r.prototype.resetHandles=function(){var t=this,e=this.handles;this.handles=[],e&&e.forEach((function(e){t.stopHandleListening(e),e.remove()}))},r.prototype.renderHandles=function(){for(var t=this,e=this.vertices,n=0,r=e.length;n<r;n+=1){var i=e[n],o=this.options.createHandle,s=this.options.processHandle,a=o({index:n,graph:this.graph,guard:function(e){return t.guard(e)},attrs:this.options.attrs||{}});s&&s(a),this.graph.hook.onToolItemCreated({name:"vertices",cell:this.cell,view:this.cellView,tool:a}),a.updatePosition(i.x,i.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}},r.prototype.updateHandles=function(){for(var t=this.vertices,e=0,n=t.length;e<n;e+=1){var r=t[e],i=this.handles[e];i&&i.updatePosition(r.x,r.y)}},r.prototype.updatePath=function(){var t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())},r.prototype.startHandleListening=function(t){var e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)},r.prototype.stopHandleListening=function(t){var e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)},r.prototype.getNeighborPoints=function(e){var n=this.cellView,r=this.vertices,i=e>0?r[e-1]:n.sourceAnchor,o=e<r.length-1?r[e+1]:n.targetAnchor;return{prev:t.Point.create(i),next:t.Point.create(o)}},r.prototype.getMouseEventArgs=function(t){var e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);return{e:e,x:n.x,y:n.y}},r.prototype.onHandleChange=function(t){var e=t.e;this.focus();var n=this.cellView;if(n.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){var r=this.getMouseEventArgs(e),i=r.e,o=r.x,s=r.y;n.notifyMouseDown(i,o,s)}},r.prototype.onHandleChanging=function(t){var e=t.handle,n=t.e,r=this.cellView,i=e.options.index,o=this.getMouseEventArgs(n),s=o.e,a=o.x,l=o.y,u={x:a,y:l};this.snapVertex(u,i),r.cell.setVertexAt(i,u,{ui:!0,toolId:this.cid}),e.updatePosition(u.x,u.y),this.options.stopPropagation||r.notifyMouseMove(s,a,l)},r.prototype.onHandleChanged=function(t){var e=t.e,n=this.options,r=this.cellView;if(n.addable&&this.updatePath(),n.removeRedundancies){r.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),r.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),this.eventData(e).vertexAdded&&r.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid});var i=this.getMouseEventArgs(e),o=i.e,s=i.x,a=i.y;this.options.stopPropagation||r.notifyMouseUp(o,s,a),r.checkMouseleave(o),n.onChanged&&n.onChanged({edge:r.cell,edgeView:r})}},r.prototype.snapVertex=function(t,e){var n=this.options.snapRadius||0;if(n>0){var r=this.getNeighborPoints(e),i=r.prev,o=r.next;Math.abs(t.x-i.x)<n?t.x=i.x:Math.abs(t.x-o.x)<n&&(t.x=o.x),Math.abs(t.y-i.y)<n?t.y=r.prev.y:Math.abs(t.y-o.y)<n&&(t.y=o.y)}},r.prototype.onHandleRemove=function(t){var e=t.handle,n=t.e;if(this.options.removable){var r=e.options.index,i=this.cellView;i.cell.removeVertexAt(r,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(n))}},r.prototype.onPathMouseDown=function(t){var e=this.cellView;if(!this.guard(t)&&this.options.addable&&e.can("vertexAddable")){t.stopPropagation(),t.preventDefault();var n=this.normalizeEvent(t),r=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});var i=e.getVertexIndex(r.x,r.y);this.snapVertex(r,i),e.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();var o=this.handles[i];this.eventData(n,{vertexAdded:!0}),o.onMouseDown(n)}},r.prototype.onRemove=function(){this.resetHandles()},r}(t.ToolsView.ToolItem);!function(e){var i=function(i){function o(t){var e=i.call(this)||this;return e.options=t,e.render(),e.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"}),e}return n(o,i),Object.defineProperty(o.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),o.prototype.render=function(){this.container=t.View.createElement("circle",!0);var n=this.options.attrs;if("function"==typeof n){var i=e.getDefaults();this.setAttrs(r(r({},i.attrs),n(this)))}else this.setAttrs(n);this.addClass(this.prefixClassName("edge-tool-vertex"))},o.prototype.updatePosition=function(t,e){this.setAttrs({cx:t,cy:e})},o.prototype.onMouseDown=function(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))},o.prototype.onMouseMove=function(t){this.emit("changing",{e:t,handle:this})},o.prototype.onMouseUp=function(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()},o.prototype.onDoubleClick=function(t){this.emit("remove",{e:t,handle:this})},o}(t.View);e.Handle=i}(Ap||(Ap={})),function(e){var n,r=t.Util.prefix("edge-tool-vertex-path");e.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:function(t){return new e.Handle(t)},markup:[{tagName:"path",selector:"connection",className:r,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:(n={},n["mousedown ."+r]="onPathMouseDown",n["touchstart ."+r]="onPathMouseDown",n)})}(Ap||(Ap={}));var Ep=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.handles=[],t}return n(r,e),Object.defineProperty(r.prototype,"vertices",{get:function(){return this.cellView.cell.getVertices()},enumerable:!1,configurable:!0}),r.prototype.update=function(){return this.render(),this},r.prototype.onRender=function(){oa(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();var t=this.cellView,e=s([],this.vertices,!0);e.unshift(t.sourcePoint),e.push(t.targetPoint);for(var n=0,r=e.length;n<r-1;n+=1){var i=e[n],o=e[n+1],a=this.renderHandle(i,o,n);this.stamp(a.container),this.handles.push(a)}return this},r.prototype.renderHandle=function(t,e,n){var r=this,i=this.options.createHandle({index:n,graph:this.graph,guard:function(t){return r.guard(t)},attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.graph.hook.onToolItemCreated({name:"segments",cell:this.cell,view:this.cellView,tool:i}),this.updateHandle(i,t,e),this.container.appendChild(i.container),this.startHandleListening(i),i},r.prototype.startHandleListening=function(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)},r.prototype.stopHandleListening=function(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)},r.prototype.resetHandles=function(){var t=this,e=this.handles;this.handles=[],e&&e.forEach((function(e){t.stopHandleListening(e),e.remove()}))},r.prototype.shiftHandleIndexes=function(t){for(var e=this.handles,n=0,r=e.length;n<r;n+=1)e[n].options.index+=t},r.prototype.resetAnchor=function(t,e){var n=this.cellView.cell,r={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,r):n.removeProp([t,"anchor"],r)},r.prototype.snapHandle=function(t,e,n){var r=t.options.axis,i=t.options.index,o=this.cellView.cell.getVertices(),s=o[i-2]||n.sourceAnchor,a=o[i+1]||n.targetAnchor,l=this.options.snapRadius;return Math.abs(e[r]-s[r])<l?e[r]=s[r]:Math.abs(e[r]-a[r])<l&&(e[r]=a[r]),e},r.prototype.onHandleChanging=function(e){var n=e.handle,r=e.e,i=this.graph,o=this.options,s=this.cellView,a=o.anchor,l=n.options.axis,u=n.options.index-1,c=this.getEventData(r),h=this.normalizeEvent(r),p=i.snapToGrid(h.clientX,h.clientY),d=this.snapHandle(n,p.clone(),c),f=zr(this.vertices),g=f[u],v=f[u+1],y=s.sourceView,m=s.sourceBBox,b=!1,C=!1;if(g?0===u?m.containsPoint(g)?(f.shift(),this.shiftHandleIndexes(-1),b=!0):(g[l]=d[l],C=!0):g[l]=d[l]:((g=s.sourceAnchor.toJSON())[l]=d[l],m.containsPoint(g)?b=!0:(f.unshift(g),this.shiftHandleIndexes(1),C=!0)),"function"==typeof a&&y){if(b){var x=c.sourceAnchor.clone();x[l]=d[l];var w=Ws(a,s,x,y,s.sourceMagnet||y.container,"source",s,this);this.resetAnchor("source",w)}C&&this.resetAnchor("source",c.sourceAnchorDef)}var P=s.targetView,A=s.targetBBox,E=!1,M=!1;if(v?u===f.length-2?A.containsPoint(v)?(f.pop(),E=!0):(v[l]=d[l],M=!0):v[l]=d[l]:((v=s.targetAnchor.toJSON())[l]=d[l],A.containsPoint(v)?E=!0:(f.push(v),M=!0)),"function"==typeof a&&P){if(E){var S=c.targetAnchor.clone();S[l]=d[l];var k=Ws(a,s,S,P,s.targetMagnet||P.container,"target",s,this);this.resetAnchor("target",k)}M&&this.resetAnchor("target",c.targetAnchorDef)}t.Point.equalPoints(f,this.vertices)||this.cellView.cell.setVertices(f,{ui:!0,toolId:this.cid}),this.updateHandle(n,g,v,0),o.stopPropagation||s.notifyMouseMove(h,p.x,p.y)},r.prototype.onHandleChange=function(t){var e=t.handle,n=t.e,r=this.options,i=this.handles,o=this.cellView,s=e.options.index;if(Array.isArray(i)){for(var a=0,l=i.length;a<l;a+=1)a!==s&&i[a].hide();if(this.focus(),this.setEventData(n,{sourceAnchor:o.sourceAnchor.clone(),targetAnchor:o.targetAnchor.clone(),sourceAnchorDef:zr(this.cell.prop(["source","anchor"])),targetAnchorDef:zr(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!r.stopPropagation){var u=this.normalizeEvent(n),c=this.graph.snapToGrid(u.clientX,u.clientY);o.notifyMouseDown(u,c.x,c.y)}}},r.prototype.onHandleChanged=function(t){var e=t.e,n=this.options,r=this.cellView;n.removeRedundancies&&r.removeRedundantLinearVertices({ui:!0,toolId:this.cid});var i=this.normalizeEvent(e),o=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),n.stopPropagation||r.notifyMouseUp(i,o.x,o.y),r.checkMouseleave(i),n.onChanged&&n.onChanged({edge:r.cell,edgeView:r})},r.prototype.updateHandle=function(e,n,r,i){void 0===i&&(i=0);var o=this.options.precision||0,s=Math.abs(n.x-r.x)<o,a=Math.abs(n.y-r.y)<o;if(s||a){var l=new t.Line(n,r);if(l.length()<this.options.threshold)e.hide();else{var u=l.getCenter(),c=s?"x":"y";u[c]+=i||0;var h=l.vector().vectorAngle(new t.Point(1,0));e.updatePosition(u.x,u.y,h,this.cellView),e.show(),e.options.axis=c}}else e.hide()},r.prototype.onRemove=function(){this.resetHandles()},r}(t.ToolsView.ToolItem);!function(e){var i=function(i){function o(t){var e=i.call(this)||this;return e.options=t,e.render(),e.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"}),e}return n(o,i),o.prototype.render=function(){this.container=t.View.createElement("rect",!0);var n=this.options.attrs;if("function"==typeof n){var i=e.getDefaults();this.setAttrs(r(r({},i.attrs),n(this)))}else this.setAttrs(n);this.addClass(this.prefixClassName("edge-tool-segment"))},o.prototype.updatePosition=function(e,n,r,i){var o=i.getClosestPoint(new t.Point(e,n))||new t.Point(e,n),s=ou().translate(o.x,o.y);if(o.equals({x:e,y:n}))s=s.rotate(r);else{var a=new t.Line(e,n,o.x,o.y).vector().vectorAngle(new t.Point(1,0));0!==a&&(a+=90),s=s.rotate(a)}this.setAttrs({transform:lu(s),cursor:r%180==0?"row-resize":"col-resize"})},o.prototype.onMouseDown=function(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))},o.prototype.onMouseMove=function(t){this.emit("changing",{e:t,handle:this})},o.prototype.onMouseUp=function(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()},o.prototype.show=function(){this.container.style.display=""},o.prototype.hide=function(){this.container.style.display="none"},o}(t.View);e.Handle=i}(Ep||(Ep={})),function(t){t.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:function(e){return new t.Handle(e)},anchor:Cp})}(Ep||(Ep={}));var Mp=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return this.options.type},enumerable:!1,configurable:!0}),r.prototype.onRender=function(){oa(this.container,this.prefixClassName("edge-tool-"+this.type+"-anchor")),this.toggleArea(!1),this.update()},r.prototype.update=function(){var t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this},r.prototype.updateAnchor=function(){var t=this.childNodes;if(t){var e=t.anchor;if(e){var n=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(n),s=r.cell.prop([n,"anchor"]);e.setAttribute("transform","translate("+o.x+", "+o.y+")");var a=s?i.customAnchorAttrs:i.defaultAnchorAttrs;a&&Object.keys(a).forEach((function(t){e.setAttribute(t,a[t])}))}}},r.prototype.updateArea=function(){var t=this.childNodes;if(t){var e=t.area;if(e){var n=this.type,r=this.cellView,i=r.getTerminalView(n);if(i){var o=i.cell,s=r.getTerminalMagnet(n),a=this.options.areaPadding||0;Number.isFinite(a)||(a=0);var l=void 0,u=void 0,c=void 0;i.isEdgeElement(s)?(u=0,c=(l=i.getBBox()).getCenter()):(l=i.getUnrotatedBBoxOfElement(s),u=o.getAngle(),c=l.getCenter(),u&&c.rotate(-u,o.getBBox().getCenter())),l.inflate(a),Va(e,{x:-l.width/2,y:-l.height/2,width:l.width,height:l.height,transform:"translate("+c.x+", "+c.y+") rotate("+u+")"})}}}},r.prototype.toggleArea=function(t){if(this.childNodes){var e=this.childNodes.area;e&&(e.style.display=t?"":"none")}},r.prototype.onMouseDown=function(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))},r.prototype.resetAnchor=function(t){var e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})},r.prototype.onMouseMove=function(e){var n=this.type,r=this.cellView,i=r.getTerminalView(n);if(null!=i){var o,s=this.normalizeEvent(e),a=i.cell,l=r.getTerminalMagnet(n),u=this.graph.clientToLocal(s.clientX,s.clientY),c=this.options.snap;if("function"==typeof c){var h=Ws(c,r,u,i,l,n,r,this);u=t.Point.create(h)}if(this.options.restrictArea)if(i.isEdgeElement(l)){var p=i.getClosestPoint(u);p&&(u=p)}else{var d=i.getUnrotatedBBoxOfElement(l),f=a.getAngle(),g=a.getBBox().getCenter(),v=u.clone().rotate(f,g);d.containsPoint(v)||(u=d.getNearestPointToPoint(v).rotate(-f,g))}var y=this.options.anchor;"function"==typeof y&&(o=Ws(y,r,u,i,l,n,r,this)),this.resetAnchor(o),this.update()}},r.prototype.onMouseUp=function(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);var e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})},r.prototype.onDblClick=function(){var t=this.options.resetAnchor;t&&this.resetAnchor(!0===t?void 0:t),this.update()},r}(t.ToolsView.ToolItem);!function(t){t.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:Cp,snap:function(t,e,n,r,i,o){var s=o.options.snapRadius||0,a="source"===r,l=a?0:-1,u=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return u&&(Math.abs(u.x-t.x)<s&&(t.x=u.x),Math.abs(u.y-t.y)<s&&(t.y=u.y)),t}})}(Mp||(Mp={}));var Sp=Mp.define({name:"source-anchor",type:"source"}),kp=Mp.define({name:"target-anchor",type:"target"}),Tp=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return this.options.type},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ratio",{get:function(){return this.options.ratio},enumerable:!1,configurable:!0}),r.prototype.init=function(){if(this.options.attrs){var t=this.options.attrs,e=t.class,n=i(t,["class"]);this.setAttrs(n,this.container),e&&oa(this.container,e)}},r.prototype.onRender=function(){oa(this.container,this.prefixClassName("edge-tool-"+this.type+"-arrowhead")),this.update()},r.prototype.update=function(){var e=this.ratio,n=this.cellView,r=n.getTangentAtRatio(e),i=r?r.start:n.getPointAtRatio(e),o=r&&r.vector().vectorAngle(new t.Point(1,0))||0;if(!i)return this;var s=ou().translate(i.x,i.y).rotate(o);return Tu(this.container,s,{absolute:!0}),this},r.prototype.onMouseDown=function(t){if(!this.guard(t)){t.stopPropagation(),t.preventDefault();var e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});var n=this.graph.snapToGrid(t.clientX,t.clientY),r=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:{toolId:this.cid}});this.cellView.setEventData(t,r),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}},r.prototype.onMouseMove=function(t){var e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()},r.prototype.onMouseUp=function(t){this.undelegateDocumentEvents();var e=this.normalizeEvent(t),n=this.cellView,r=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})},r}(t.ToolsView.ToolItem);!function(t){t.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})}(Tp||(Tp={}));var Dp,Np,Op=Tp.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),Lp=Tp.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),Fp=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.labelIndex=-1,t.distance=.5,t}return n(r,e),r.prototype.render=function(){return this.createElement(),this.update(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents),this},r.prototype.createElement=function(){var e=this.cell,n=[this.prefixClassName((e.isEdge()?"edge":"node")+"-tool-editor"),this.prefixClassName("cell-tool-editor")];this.editor=t.ToolsView.createElement("div",!1),this.addClass(n,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)},r.prototype.update=function(){var e=this,n=e.graph,r=e.cell,i=e.editor,o=i.style,s=new t.Point,a=20;if(r.isNode())s=r.getBBox().center,a=r.size().width-4;else if(r.isEdge()){var l=this.options.event,u=l.target,c=u.parentElement;if(c&&ia(c,this.prefixClassName("edge-label"))){var h=c.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);var p=uu(c.getAttribute("transform")).translation;s=new t.Point(p.tx,p.ty),a=bu(u).width}else{if(!this.options.labelAddable)return this;s=n.clientToLocal(t.Point.create(l.clientX,l.clientY));var d=this.cellView.path.closestPointLength(s);this.distance=d}}s=n.localToGraph(s),o.left=s.x+"px",o.top=s.y+"px",o.minWidth=a+"px";var f=n.scale();o.transform="scale("+f.sx+", "+f.sy+") translate(-50%, -50%)";var g=this.options.attrs;o.fontSize=g.fontSize+"px",o.fontFamily=g.fontFamily,o.color=g.color,o.backgroundColor=g.backgroundColor;var v,y=this.options.getText;return"function"==typeof y&&(v=Ws(y,this.cellView,{cell:this.cell,index:this.labelIndex})),i.innerText=v||"",this},r.prototype.onDocumentMouseDown=function(t){if(t.target!==this.editor){var e=this.cell,n=this.editor.innerText.replace(/\n$/,"")||"",r=this.options.setText;"function"==typeof r&&Ws(r,this.cellView,{cell:this.cell,value:n,index:this.labelIndex,distance:this.distance}),e.removeTool(e.isEdge()?"edge-editor":"node-editor"),this.undelegateDocumentEvents()}},r.prototype.onDblClick=function(t){t.stopPropagation()},r.prototype.onMouseDown=function(t){t.stopPropagation()},r.prototype.autoFocus=function(){var t=this;setTimeout((function(){t.editor.focus(),t.selectText()}))},r.prototype.selectText=function(){if(window.getSelection){var t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}},r}(t.ToolsView.ToolItem);!function(t){t.config({tagName:"div",isSVGElement:!1,events:{dblclick:"onDblClick",mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})}(Fp||(Fp={})),function(t){t.NodeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:function(t){return t.cell.attr("text/text")},setText:function(t){var e=t.cell,n=t.value;e.attr("text/text",n)}}),t.EdgeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:function(t){var e=t.cell,n=t.index;return-1===n?"":e.prop("labels/"+n+"/attrs/label/text")},setText:function(t){var e=t.cell,n=t.value,r=t.index,i=t.distance,o=e;-1===r?o.appendLabel({position:{distance:i},attrs:{label:{text:n}}}):n?o.prop("labels/"+r+"/attrs/label/text",n):"number"==typeof r&&o.removeLabelAt(r)}})}(Fp||(Fp={})),function(e){e.presets={boundary:Pp,button:wp,"button-remove":wp.Remove,"node-editor":Fp.NodeEditor},e.registry=Ju.create({type:"node tool",process:function(e,n){if("function"==typeof n)return n;var r=t.ToolsView.ToolItem,o=n.inherit,s=i(n,["inherit"]);if(o){var a=this.get(o);null==a?this.onNotFound(o,"inherited"):r=a}return null==s.name&&(s.name=e),r.define.call(r,s)}}),e.registry.register(e.presets,!0)}(Dp||(Dp={})),function(e){e.presets={boundary:Pp,vertices:Ap,segments:Ep,button:wp,"button-remove":wp.Remove,"source-anchor":Sp,"target-anchor":kp,"source-arrowhead":Op,"target-arrowhead":Lp,"edge-editor":Fp.EdgeEditor},e.registry=Ju.create({type:"edge tool",process:function(e,n){if("function"==typeof n)return n;var r=t.ToolsView.ToolItem,o=n.inherit,s=i(n,["inherit"]);if(o){var a=this.get(o);null==a?this.onNotFound(o,"inherited"):r=a}return null==s.name&&(s.name=e),r.define.call(r,s)}}),e.registry.register(e.presets,!0)}(Np||(Np={}));var zp=Up("center"),Bp=Up("topCenter"),Vp=Up("bottomCenter"),jp=Up("leftMiddle"),Rp=Up("rightMiddle"),Ip=Up("topLeft"),_p=Up("topRight"),Gp=Up("bottomLeft"),Hp=Up("bottomRight");function Up(t){return function(e,n,r,i){void 0===i&&(i={});var o=i.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),s=o[t];s.x+=Gs(i.dx,o.width),s.y+=Gs(i.dy,o.height);var a=e.cell;return i.rotate?s.rotate(-a.getAngle(),a.getBBox().getCenter()):s}}function qp(e){return function(n,r,i,o){if(i instanceof Element){var s=this.graph.renderer.findViewByElem(i),a=void 0;if(s)if(s.isEdgeElement(i)){var l=null!=o.fixedAt?o.fixedAt:"50%";a=$p(s,l)}else a=s.getBBoxOfElement(i).getCenter();else a=new t.Point;return e.call(this,n,r,a,o)}return e.apply(this,arguments)}}function $p(t,e){var n=_s(e),r="string"==typeof e?parseFloat(e):e;return n?t.getPointAtRatio(r/100):t.getPointAtLength(r)}var Wp,Xp=qp((function(e,n,r,i){var o=e.cell.getAngle(),s=e.getBBoxOfElement(n),a=s.getCenter(),l=s.getTopLeft(),u=s.getBottomRight(),c=i.padding;if(Number.isFinite(c)||(c=0),l.y+c<=r.y&&r.y<=u.y-c){var h=r.y-a.y;a.x+=0===o||180===o?0:1*h/Math.tan(t.Angle.toRad(o)),a.y+=h}else if(l.x+c<=r.x&&r.x<=u.x-c){var p=r.x-a.x;a.y+=90===o||270===o?0:p*Math.tan(t.Angle.toRad(o)),a.x+=p}return a})),Yp=qp((function(t,e,n,r){var i,o,s=0,a=t.cell;r.rotate?(i=t.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),s=a.getAngle()):i=t.getBBoxOfElement(e);var l=r.padding;null!=l&&Number.isFinite(l)&&i.inflate(l),r.rotate&&n.rotate(s,o);var u,c=i.getNearestSideToPoint(n);switch(c){case"left":u=i.getLeftMiddle();break;case"right":u=i.getRightMiddle();break;case"top":u=i.getTopCenter();break;case"bottom":u=i.getBottomCenter()}var h=r.direction;return"H"===h?"top"!==c&&"bottom"!==c||(u=n.x<=i.x+i.width?i.getLeftMiddle():i.getRightMiddle()):"V"===h&&(u=n.y<=i.y+i.height?i.getTopCenter():i.getBottomCenter()),r.rotate?u.rotate(-s,o):u})),Jp=Object.freeze({__proto__:null,center:zp,top:Bp,bottom:Vp,left:jp,right:Rp,topLeft:Ip,topRight:_p,bottomLeft:Gp,bottomRight:Hp,orth:Xp,nodeCenter:function(t,e,n,r,i){var o=t.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&o.translate(r.dx||0,r.dy||0),o},midSide:Yp});!function(t){t.presets=Jp,t.registry=Ju.create({type:"node endpoint"}),t.registry.register(t.presets,!0)}(Wp||(Wp={}));var Zp,Kp=function(e,n,r,i){var o=e.getClosestPoint(r);return null!=o?o:new t.Point},Qp=qp(Kp),td=qp((function(e,n,r,i){var o=1e6,s=e.getConnection(),a=e.getConnectionSubdivisions(),l=new t.Line(r.clone().translate(0,o),r.clone().translate(0,-o)),u=new t.Line(r.clone().translate(o,0),r.clone().translate(-o,0)),c=l.intersect(s,{segmentSubdivisions:a}),h=u.intersect(s,{segmentSubdivisions:a}),p=[];return c&&p.push.apply(p,c),h&&p.push.apply(p,h),p.length>0?r.closest(p):null!=i.fallbackAt?$p(e,i.fallbackAt):Ws(Kp,this,e,n,r,i)})),ed=Object.freeze({__proto__:null,closest:Qp,ratio:function(t,e,n,r){var i=null!=r.ratio?r.ratio:.5;return i>1&&(i/=100),t.getPointAtRatio(i)},length:function(t,e,n,r){var i=null!=r.length?r.length:20;return t.getPointAtLength(i)},orth:td});function nd(e,n,r){var i;if("object"==typeof r){if(Number.isFinite(r.y)){var o=new t.Line(n,e).parallel(r.y);n=o.start,e=o.end}i=r.x}else i=r;if(null==i||!Number.isFinite(i))return e;var s=e.distance(n);return 0===i&&s>0?e:e.move(n,-Math.min(i,s-1))}function rd(t){var e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}!function(t){t.presets=ed,t.registry=Ju.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)}(Zp||(Zp={}));var id=function(t,e,n,r){var i=e.getBBoxOfElement(n);r.stroked&&i.inflate(rd(n)/2);var o=t.intersect(i);return nd(o&&o.length?t.start.closest(o):t.end,t.start,r.offset)};var od,sd=Object.freeze({__proto__:null,bbox:id,rect:function(t,e,n,r,i){var o=e.cell,s=o.isNode()?o.getAngle():0;if(0===s)return Ws(id,this,t,e,n,r,i);var a=e.getUnrotatedBBoxOfElement(n);r.stroked&&a.inflate(rd(n)/2);var l=a.getCenter(),u=t.clone().rotate(s,l),c=u.setLength(1e6).intersect(a);return nd(c&&c.length?u.start.closest(c).rotate(-s,l):t.end,t.start,r.offset)},boundary:function(e,n,i,o){var s,a,l=e.end,u=o.selector;if(!ha(s="string"==typeof u?n.findOne(u):Array.isArray(u)?Ps(i,u):function(t){if(null==t)return null;var e=t;do{var n=e.tagName;if("string"!=typeof n)return null;if("G"===(n=n.toUpperCase()))e=e.firstElementChild;else{if("TITLE"!==n)break;e=e.nextElementSibling}}while(e);return e}(i))){if(s===i||!ha(i))return l;s=i}var c,h=n.getShapeOfElement(s),p=n.getMatrixOfElement(s),d=n.getRootTranslatedMatrix(),f=n.getRootRotatedMatrix(),g=d.multiply(f).multiply(p),v=vu(e,g.inverse()),y=v.start.clone(),m=n.getDataOfElement(s);if(!1===o.insideout){null==m.shapeBBox&&(m.shapeBBox=h.bbox());var b=m.shapeBBox;if(null!=b&&b.containsPoint(y))return l}if(!0===o.extrapolate&&v.setLength(1e6),t.Path.isPath(h)){var C=o.precision||2;null==m.segmentSubdivisions&&(m.segmentSubdivisions=h.getSegmentSubdivisions({precision:C})),c={precision:C,segmentSubdivisions:m.segmentSubdivisions},a=v.intersect(h,c)}else a=v.intersect(h);a?Array.isArray(a)&&(a=y.closest(a)):!0===o.sticky&&(a=t.Rectangle.isRectangle(h)?h.getNearestPointToPoint(y):t.Ellipse.isEllipse(h)?h.intersectsWithLineFromCenterToPoint(y):h.closestPoint(y,c));var x=a?gu(a,g):l,w=o.offset||0;return!1!==o.stroked&&("object"==typeof w?(null==(w=r({},w)).x&&(w.x=0),w.x+=rd(s)/2):w+=rd(s)/2),nd(x,e.start,w)},anchor:function(t,e,n,r){var i=r.alignOffset,o=r.align;return o&&function(t,e,n){void 0===n&&(n=0);var r,i,o,s,a=t.start,l=t.end;switch(e){case"left":s="x",r=l,i=a,o=-1;break;case"right":s="x",r=a,i=l,o=1;break;case"top":s="y",r=l,i=a,o=-1;break;case"bottom":s="y",r=a,i=l,o=1;break;default:return}a[s]<l[s]?r[s]=i[s]:i[s]=r[s],Number.isFinite(n)&&(r[s]+=o*n,i[s]+=o*n)}(t,o,i),nd(t.end,t.start,r.offset)}});!function(t){t.presets=sd,t.registry=Ju.create({type:"connection point"}),t.registry.register(t.presets,!0)}(od||(od={}));function ad(e){return new t.Rectangle(e.x,e.y,0,0)}function ld(t){void 0===t&&(t={});var e=Us(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function ud(t,e){return void 0===e&&(e={}),t.sourceBBox.clone().moveAndExpand(ld(e))}function cd(t,e){return void 0===e&&(e={}),t.targetBBox.clone().moveAndExpand(ld(e))}var hd,pd=function(e,n,r){var i=ud(r,n),o=cd(r,n),s=function(t,e){return void 0===e&&(e={}),t.sourceAnchor?t.sourceAnchor:ud(t,e).getCenter()}(r,n),a=function(t,e){return void 0===e&&(e={}),t.targetAnchor?t.targetAnchor:cd(t,e).getCenter()}(r,n);i=i.union(ad(s)),o=o.union(ad(a));var l=e.map((function(e){return t.Point.create(e)}));l.unshift(s),l.push(a);for(var u=null,c=[],h=0,p=l.length-1;h<p;h+=1){var d=null,f=l[h],g=l[h+1],v=null!=hd.getBearing(f,g);if(0===h)h+1===p?i.intersectsWithRect(o.clone().inflate(1))?d=hd.insideNode(f,g,i,o):v||(d=hd.nodeToNode(f,g,i,o)):i.containsPoint(g)?d=hd.insideNode(f,g,i,ad(g).moveAndExpand(ld(n))):v||(d=hd.nodeToVertex(f,g,i));else if(h+1===p){var y=v&&hd.getBearing(g,f)===u;o.containsPoint(f)||y?d=hd.insideNode(f,g,ad(f).moveAndExpand(ld(n)),o,u):v||(d=hd.vertexToNode(f,g,o,u))}else v||(d=hd.vertexToVertex(f,g,u));d?(c.push.apply(c,d.points),u=d.direction):u=hd.getBearing(f,g),h+1<p&&c.push(g)}return c};!function(e){var n={N:"S",S:"N",E:"W",W:"E"},r={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function i(e,n,r){var i=new t.Point(e.x,n.y);return r.containsPoint(i)&&(i=new t.Point(n.x,e.y)),i}function o(t,e){return t["W"===e||"E"===e?"width":"height"]}function s(t,e){return t.x===e.x?t.y>e.y?"N":"S":t.y===e.y?t.x>e.x?"W":"E":null}function a(e,r,i){var o=new t.Point(e.x,r.y),a=new t.Point(r.x,e.y),l=s(e,o),u=s(e,a),c=i?n[i]:null,h=l===i||l!==c&&(u===c||u!==i)?o:a;return{points:[h],direction:s(h,r)}}function l(t,e,n){var r=i(t,e,n);return{points:[r],direction:s(r,e)}}e.getBBoxSize=o,e.getBearing=s,e.vertexToVertex=a,e.nodeToVertex=l,e.vertexToNode=function(e,n,r,a){var l,u=[new t.Point(e.x,n.y),new t.Point(n.x,e.y)],c=u.filter((function(t){return!r.containsPoint(t)})),h=c.filter((function(t){return s(t,e)!==a}));if(h.length>0)return{points:[l=(l=h.filter((function(t){return s(e,t)===a})).pop())||h[0]],direction:s(l,n)};l=Ti(u,c)[0];var p=t.Point.create(n).move(l,-o(r,a)/2);return{points:[i(p,e,r),p],direction:s(p,n)}},e.nodeToNode=function(e,n,r,i){var u=l(n,e,i),c=u.points[0];if(r.containsPoint(c)){var h=(u=l(e,n,r)).points[0];if(i.containsPoint(h)){var p=t.Point.create(e).move(h,-o(r,s(e,h))/2),d=t.Point.create(n).move(c,-o(i,s(n,c))/2),f=new t.Line(p,d).getCenter(),g=l(e,f,r),v=a(f,n,g.direction);u.points=[g.points[0],v.points[0]],u.direction=v.direction}}return u},e.insideNode=function(e,n,o,a,l){var u,c,h,p,d=o.union(a).inflate(1),f=d.getCenter(),g=f.distance(n)>f.distance(e),v=g?n:e,y=g?e:n;return l?(u=t.Point.fromPolar(d.width+d.height,r[l],v),u=d.getNearestPointToPoint(u).move(u,-1)):u=d.getNearestPointToPoint(v).move(v,1),c=i(u,y,d),u.round().equals(c.round())?(c=t.Point.fromPolar(d.width+d.height,t.Angle.toRad(u.theta(v))+Math.PI/2,y),h=i(u,c=d.getNearestPointToPoint(c).move(y,1).round(),d),p=g?[c,h,u]:[u,h,c]):p=g?[c,u]:[u,c],{points:p,direction:s(g?u:c,n)}}}(hd||(hd={}));var dd={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeShapes:[],excludeNodes:[],excludeHiddenNodes:!1,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost:function(){return fd(this.step,this)},directions:function(){var t=fd(this.step,this),e=fd(this.cost,this);return[{cost:e,offsetX:t,offsetY:0},{cost:e,offsetX:-t,offsetY:0},{cost:e,offsetX:0,offsetY:t},{cost:e,offsetX:0,offsetY:-t}]},penalties:function(){var t=fd(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox:function(){var t=fd(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:pd,draggingRouter:null};function fd(t,e){return"function"==typeof t?t.call(e):t}var gd=function(){function t(){this.items=[],this.hash={},this.values={}}return t.prototype.add=function(t,e){var n=this;this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=1,this.values[t]=e;var r=Bo(this.items,t,(function(t){return n.values[t]}));this.items.splice(r,0,t)},t.prototype.pop=function(){var t=this.items.shift();return t&&(this.hash[t]=2),t},t.prototype.isOpen=function(t){return 1===this.hash[t]},t.prototype.isClose=function(t){return 2===this.hash[t]},t.prototype.isEmpty=function(){return 0===this.items.length},t}(),vd=function(){function e(t){this.options=t,this.mapGridSize=100,this.map={}}return e.prototype.build=function(e,n){var r=this.options,i=r.excludeTerminals.reduce((function(t,r){var i=n[r];if(i){var o=e.getCell(i.cell);o&&t.push(o)}return t}),[]),o=[],s=e.getCell(n.getSourceCellId());s&&(o=as(o,s.getAncestors().map((function(t){return t.id}))));var a=e.getCell(n.getTargetCellId());a&&(o=as(o,a.getAncestors().map((function(t){return t.id}))));var l=this.mapGridSize;return e.getNodes().reduce((function(e,n){var s=n.shape,a=r.excludeShapes,u=!!s&&a.includes(s),c=i.some((function(t){return t.id===n.id})),h=r.excludeNodes.includes(n),p=o.includes(n.id),d=r.excludeHiddenNodes&&!n.isVisible();if(!(u||c||h||p||d))for(var f=n.getBBox().moveAndExpand(r.paddingBox),g=f.getOrigin().snapToGrid(l),v=f.getCorner().snapToGrid(l),y=g.x;y<=v.x;y+=l)for(var m=g.y;m<=v.y;m+=l){var b=new t.Point(y,m).toString();null==e[b]&&(e[b]=[]),e[b].push(f)}return e}),this.map),this},e.prototype.isAccessible=function(t){var e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return!n||n.every((function(e){return!e.containsPoint(t)}))},e}();function yd(t,e){var n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function md(t,e){var n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function bd(t,e){return t.sourceAnchor?t.sourceAnchor:yd(t,e).getCenter()}function Cd(e,n,r,i,o){var s=360/r,a=e.theta(function(e,n,r,i){var o=i.step,s=n.x-e.x,a=n.y-e.y,l=s/r.x,u=a/r.y,c=l*o,h=u*o;return new t.Point(e.x+c,e.y+h)}(e,n,i,o)),l=t.Angle.normalize(a+s/2);return s*Math.floor(l/s)}function xd(t,e){var n=Math.abs(t-e);return n>180?360-n:n}function wd(t,e){if(!t)return e;var n=Math.abs(t),r=Math.round(n/e);return r?e+(n-r*e)/r:n}function Pd(t,e){return t.round(e)}function Ad(e,n,r){return Pd(function(e,n){var r=n.source,i=t.Util.snapToGrid(e.x-r.x,n.x)+r.x,o=t.Util.snapToGrid(e.y-r.y,n.y)+r.y;return new t.Point(i,o)}(e.clone(),n),r)}function Ed(t){return t.toString()}function Md(e){return new t.Point(0===e.x?0:Math.abs(e.x)/e.x,0===e.y?0:Math.abs(e.y)/e.y)}function Sd(t,e){for(var n=1/0,r=0,i=e.length;r<i;r+=1){var o=t.manhattanDistance(e[r]);o<n&&(n=o)}return n}function kd(e,n,r,i,o){var s=o.precision,a=o.directionMap,l=e.diff(n.getCenter()),u=Object.keys(a).reduce((function(o,u){if(r.includes(u)){for(var c=a[u],h=new t.Point(e.x+c.x*(Math.abs(l.x)+n.width),e.y+c.y*(Math.abs(l.y)+n.height)),p=new t.Line(e,h).intersect(n)||[],d=void 0,f=null,g=0;g<p.length;g+=1){var v=p[g],y=e.squaredDistance(v);(null==d||y>d)&&(d=y,f=v)}if(f){var m=Ad(f,i,s);n.containsPoint(m)&&(m=Ad(m.translate(c.x*i.x,c.y*i.y),i,s)),o.push(m)}}return o}),[]);return n.containsPoint(e)||u.push(Ad(e,i,s)),u}function Td(t,e,n,r,i){for(var o,s=[],a=Md(i.diff(n)),l=Ed(n),u=t[l];u;){var c=Md((o=e[l]).diff(u));c.equals(a)||(s.unshift(o),a=c),u=t[l=Ed(u)]}var h=e[l];return Md(h.diff(r)).equals(a)||s.unshift(h),s}function Dd(e,n,r,i,o){var s,a,l=o.precision;s=t.Rectangle.isRectangle(n)?Pd(bd(e,o).clone(),l):Pd(n.clone(),l),a=t.Rectangle.isRectangle(r)?Pd(function(t,e){return t.targetAnchor?t.targetAnchor:md(t,e).getCenter()}(e,o).clone(),l):Pd(r.clone(),l);var u,c,h,p,d,f=(u=o.step,h=a,{source:(c=s).clone(),x:wd(h.x-c.x,u),y:wd(h.y-c.y,u)}),g=s,v=a;if(p=t.Rectangle.isRectangle(n)?kd(g,n,o.startDirections,f,o):[g],d=t.Rectangle.isRectangle(r)?kd(a,r,o.endDirections,f,o):[v],p=p.filter((function(t){return i.isAccessible(t)})),d=d.filter((function(t){return i.isAccessible(t)})),p.length>0&&d.length>0){for(var y=new gd,m={},b={},C={},x=0,w=p.length;x<w;x+=1){var P=p[x],A=Ed(P);y.add(A,Sd(P,d)),m[A]=P,C[A]=0}for(var E=o.previousDirectionAngle,M=void 0===E,S=void 0,k=void 0,T=function(t,e){var n=e.step;return e.directions.forEach((function(e){e.gridOffsetX=e.offsetX/n*t.x,e.gridOffsetY=e.offsetY/n*t.y})),e.directions}(f,o),D=T.length,N=d.reduce((function(t,e){var n=Ed(e);return t.push(n),t}),[]),O=t.Point.equalPoints(p,d),L=o.maxLoopCount;!y.isEmpty()&&L>0;){var F=y.pop(),z=m[F],B=b[F],V=C[F],j=z.equals(g),R=null==B,I=void 0;if(I=R?M?j?null:Cd(g,z,D,f,o):E:Cd(B,z,D,f,o),!(R&&O)&&N.indexOf(F)>=0)return o.previousDirectionAngle=I,Td(b,m,z,g,v);for(x=0;x<D;x+=1){var _=(S=T[x]).angle;if(k=xd(I,_),M&&j||!(k>o.maxDirectionChange)){var G=Ad(z.clone().translate(S.gridOffsetX||0,S.gridOffsetY||0),f,l),H=Ed(G);if(!y.isClose(H)&&i.isAccessible(G)){if(N.indexOf(H)>=0)if(!G.equals(v))if(xd(_,Cd(G,v,D,f,o))>o.maxDirectionChange)continue;var U=V+S.cost+(j?0:o.penalties[k]);(!y.isOpen(H)||U<C[H])&&(m[H]=G,b[H]=z,C[H]=U,y.add(H,U+Sd(G,d)))}}}L-=1}}return o.fallbackRoute?Ws(o.fallbackRoute,this,g,v,o):null}var Nd=function(e,n,r){for(var i,o,s=function(e){var n=Object.keys(e).reduce((function(t,n){return t[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?e[n]:fd(e[n],e),t}),{});if(n.padding){var r=Us(n.padding);n.paddingBox={x:-r.left,y:-r.top,width:r.left+r.right,height:r.top+r.bottom}}return n.directions.forEach((function(e){var n=new t.Point(0,0),r=new t.Point(e.offsetX,e.offsetY);e.angle=t.Angle.normalize(n.theta(r))})),n}(n),a=yd(r,s),l=md(r,s),u=bd(r,s),c=new vd(s).build(r.graph.model,r.cell),h=e.map((function(e){return t.Point.create(e)})),p=[],d=u,f=0,g=h.length;f<=g;f+=1){var v=null;if(i=o||a,null==(o=h[f])){o=l;var y=r.cell;if((null==y.getSourceCellId()||null==y.getTargetCellId())&&"function"==typeof s.draggingRouter){var m=i===a?u:i,b=o.getOrigin();v=Ws(s.draggingRouter,r,m,b,s)}}if(null==v&&(v=Dd(r,i,o,c,s)),null===v)return Ws(s.fallbackRouter,this,e,s,r);var C=v[0];C&&C.equals(d)&&v.shift(),d=v[v.length-1]||d,p.push.apply(p,v)}return p},Od=function(t,e,n){return Ws(Nd,this,t,r(r({},dd),e),n)},Ld={maxDirectionChange:45,directions:function(){var t=fd(this.step,this),e=fd(this.cost,this),n=Math.ceil(Math.sqrt(t*t<<1));return[{cost:e,offsetX:t,offsetY:0},{cost:n,offsetX:t,offsetY:t},{cost:e,offsetX:0,offsetY:t},{cost:n,offsetX:-t,offsetY:t},{cost:e,offsetX:-t,offsetY:0},{cost:n,offsetX:-t,offsetY:-t},{cost:e,offsetX:0,offsetY:-t},{cost:n,offsetX:t,offsetY:-t}]},fallbackRoute:function(e,n,r){var i=e.theta(n),o=[],s={x:n.x,y:e.y},a={x:e.x,y:n.y};if(i%180>90){var l=s;s=a,a=l}var u=i%90<45?s:a,c=new t.Line(e,u),h=90*Math.ceil(i/90),p=t.Point.fromPolar(c.squaredLength(),t.Angle.toRad(h+135),u),d=new t.Line(n,p),f=c.intersectsWithLine(d),g=f||n,v=f?g:e,y=360/r.directions.length,m=v.theta(n),b=t.Angle.normalize(m+y/2),C=y*Math.floor(b/y);return r.previousDirectionAngle=C,g&&o.push(g.round()),o.push(n),o}};function Fd(e,n){if(null!=n&&!1!==n){var i="boolean"==typeof n?0:n;if(i>0){var o=t.Point.create(e[1]).move(e[2],i),a=t.Point.create(e[1]).move(e[0],i);return s(s([o.toJSON()],e,!0),[a.toJSON()],!1)}var l=e[1];return s(s([r({},l)],e,!0),[r({},l)],!1)}return e}var zd,Bd=Object.freeze({__proto__:null,normal:function(t){return s([],t,!0)},oneSide:function(t,e,n){var r,i,o,a=e.side||"bottom",l=Us(e.padding||40),u=n.sourceBBox,c=n.targetBBox,h=u.getCenter(),p=c.getCenter();switch(a){case"top":o=-1,r="y",i="height";break;case"left":o=-1,r="x",i="width";break;case"right":o=1,r="x",i="width";break;case"bottom":default:o=1,r="y",i="height"}return h[r]+=o*(u[i]/2+l[a]),p[r]+=o*(c[i]/2+l[a]),o*(h[r]-p[r])>0?p[r]=h[r]:h[r]=p[r],s(s([h.toJSON()],t,!0),[p.toJSON()],!1)},orth:pd,metro:function(t,e,n){return Ws(Od,this,t,r(r({},Ld),e),n)},manhattan:Od,er:function(t,e,n){var r,i,o,a=e.offset||32,l=null==e.min?16:e.min,u=0,c=e.direction,h=n.sourceBBox,p=n.targetBBox,d=h.getCenter(),f=p.getCenter();if("number"==typeof a&&(u=a),null==c){var g=p.left-h.right,v=p.top-h.bottom;g>=0&&v>=0?c=g>=v?"L":"T":g<=0&&v>=0?c=(g=h.left-p.right)>=0&&g>=v?"R":"T":g>=0&&v<=0?c=(v=h.top-p.bottom)>=0?g>=v?"L":"B":"L":(g=h.left-p.right,v=h.top-p.bottom,c=g>=0&&v>=0?g>=v?"R":"B":g<=0&&v>=0?"B":g>=0&&v<=0||Math.abs(g)>Math.abs(v)?"R":"B")}"H"===c?c=f.x-d.x>=0?"L":"R":"V"===c&&(c=f.y-d.y>=0?"T":"B"),"center"===a&&("L"===c?u=(p.left-h.right)/2:"R"===c?u=(h.left-p.right)/2:"T"===c?u=(p.top-h.bottom)/2:"B"===c&&(u=(h.top-p.bottom)/2));var y="L"===c||"R"===c;if(y){if(f.y===d.y)return s([],t,!0);o="L"===c?1:-1,r="x",i="width"}else{if(f.x===d.x)return s([],t,!0);o="T"===c?1:-1,r="y",i="height"}var m=d.clone(),b=f.clone();if(m[r]+=o*(h[i]/2+u),b[r]-=o*(p[i]/2+u),y){var C=m.x,x=b.x,w=h.width/2+l,P=p.width/2+l;f.x>d.x?x<=C&&(m.x=Math.max(x,d.x+w),b.x=Math.min(C,f.x-P)):x>=C&&(m.x=Math.min(x,d.x-w),b.x=Math.max(C,f.x+P))}else{var A=m.y,E=b.y;w=h.height/2+l,P=p.height/2+l;f.y>d.y?E<=A&&(m.y=Math.max(E,d.y+w),b.y=Math.min(A,f.y-P)):E>=A&&(m.y=Math.min(E,d.y-w),b.y=Math.max(A,f.y+P))}return s(s([m.toJSON()],t,!0),[b.toJSON()],!1)},loop:function(e,n,r){var i=n.width||50,o=(n.height||80)/2,s=n.angle||"auto",a=r.sourceAnchor,l=r.targetAnchor,u=r.sourceBBox,c=r.targetBBox;if(a.equals(l)){var h=function(e){var n=t.Angle.toRad(e),r=Math.sin(n),s=Math.cos(n),l=new t.Point(a.x+s*i,a.y+r*i),u=new t.Point(l.x-s*o,l.y-r*o),c=u.clone().rotate(-90,l),h=u.clone().rotate(90,l);return[c.toJSON(),l.toJSON(),h.toJSON()]},p=function(e){var n=a.clone().move(e,-1),r=new t.Line(n,e);return!u.containsPoint(e)&&!u.intersectsWithLine(r)},d=[0,90,180,270,45,135,225,315];if("number"==typeof s)return Fd(h(s),n.merge);if((C=u.getCenter()).equals(a))return Fd(h(0),n.merge);var f=C.angleBetween(a,C.clone().translate(1,0)),g=h(f);if(p(g[1]))return Fd(g,n.merge);for(var v=1,y=d.length;v<y;v+=1)if(p((g=h(f+d[v]))[1]))return Fd(g,n.merge);return Fd(g,n.merge)}var m=new t.Line(a,l),b=m.parallel(-i),C=b.getCenter(),x=b.start.clone().move(b.end,o),w=b.end.clone().move(b.start,o),P=m.parallel(-1),A=new t.Line(P.start,C),E=new t.Line(P.end,C);if((u.containsPoint(C)||c.containsPoint(C)||u.intersectsWithLine(A)||u.intersectsWithLine(E)||c.intersectsWithLine(A)||c.intersectsWithLine(E))&&(C=(b=m.parallel(i)).getCenter(),x=b.start.clone().move(b.end,o),w=b.end.clone().move(b.start,o)),n.merge){var M=new t.Line(a,l),S=new t.Line(C,M.center).setLength(Number.MAX_SAFE_INTEGER),k=u.intersectsWithLine(S),T=c.intersectsWithLine(S),D=k?Array.isArray(k)?k:[k]:[];T&&(Array.isArray(T)?D.push.apply(D,T):D.push(T));var N=M.center.closest(D);N?(r.sourceAnchor=N.clone(),r.targetAnchor=N.clone()):(r.sourceAnchor=M.center.clone(),r.targetAnchor=M.center.clone())}return Fd([x.toJSON(),C.toJSON(),w.toJSON()],n.merge)}});!function(t){t.presets=Bd,t.registry=Ju.create({type:"router"}),t.registry.register(t.presets,!0)}(zd||(zd={}));var Vd,jd,Rd=1/3,Id=2/3;function _d(e,n,r){void 0===r&&(r=[]);var i=s(s([e],r,!0),[n],!1),o=[];return i.forEach((function(e,n){var r=i[n+1];null!=r&&o.push(new t.Line(e,r))})),o}function Gd(e,n){return new t.Line(e,n).squaredLength()}function Hd(e,n,r,i){var o,s=new t.Path;return o=t.Path.createSegment("M",e[0].start),s.appendSegment(o),e.forEach((function(a,l){if(Vd.includes(a)){var u=void 0,c=void 0,h=void 0,p=void 0;if("arc"===r){u=-90,((c=a.start.diff(a.end)).x<0||0===c.x&&c.y<0)&&(u+=180);var d=a.getCenter(),f=new t.Line(d,a.end).rotate(u,d),g=void 0;h=(g=new t.Line(a.start,d)).pointAt(2/3).rotate(u,a.start),p=f.pointAt(1/3).rotate(-u,f.end),o=t.Path.createSegment("C",h,p,f.end),s.appendSegment(o),g=new t.Line(d,a.end),h=f.pointAt(1/3).rotate(u,f.end),p=g.pointAt(1/3).rotate(-u,a.end),o=t.Path.createSegment("C",h,p,a.end),s.appendSegment(o)}else if("gap"===r)o=t.Path.createSegment("M",a.end),s.appendSegment(o);else if("cubic"===r){u=a.start.theta(a.end);var v=.6*n,y=1.35*n;((c=a.start.diff(a.end)).x<0||0===c.x&&c.y<0)&&(y*=-1),h=new t.Point(a.start.x+v,a.start.y+y).rotate(u,a.start),p=new t.Point(a.end.x-v,a.end.y+y).rotate(u,a.end),o=t.Path.createSegment("C",h,p,a.end),s.appendSegment(o)}}else{var m=e[l+1];0===i||!m||Vd.includes(m)?(o=t.Path.createSegment("L",a.end),s.appendSegment(o)):function(e,n,r,i,o){var s,a=r.distance(i)/2,l=r.distance(o)/2,u=-Math.min(e,a),c=-Math.min(e,l),h=r.clone().move(i,u).round(),p=r.clone().move(o,c).round(),d=new t.Point(Rd*h.x+Id*r.x,Id*r.y+Rd*h.y),f=new t.Point(Rd*p.x+Id*r.x,Id*r.y+Rd*p.y);s=t.Path.createSegment("L",h),n.appendSegment(s),s=t.Path.createSegment("C",d,f,p),n.appendSegment(s)}(i,s,a.end,a.start,m.end)}})),s}var Ud,qd=Object.freeze({__proto__:null,normal:function(e,n,r,i){void 0===i&&(i={});var o=s(s([e],r,!0),[n],!1),a=new t.Polyline(o),l=new t.Path(a);return i.raw?l:l.serialize()},loop:function(e,n,r,i){void 0===i&&(i={});var o=3===r.length?0:1,s=t.Point.create(r[0+o]),a=t.Point.create(r[2+o]),l=t.Point.create(r[1+o]);if(!t.Point.equals(e,n)){var u=new t.Point((e.x+n.x)/2,(e.y+n.y)/2),c=u.angleBetween(t.Point.create(e).rotate(90,u),l);c>1&&(s.rotate(180-c,u),a.rotate(180-c,u),l.rotate(180-c,u))}var h="\n M "+e.x+" "+e.y+"\n Q "+s.x+" "+s.y+" "+l.x+" "+l.y+"\n Q "+a.x+" "+a.y+" "+n.x+" "+n.y+"\n ";return i.raw?t.Path.parse(h):h},rounded:function(e,n,r,i){void 0===i&&(i={});var o=new t.Path;o.appendSegment(t.Path.createSegment("M",e));for(var s,a,l=1/3,u=2/3,c=i.radius||10,h=0,p=r.length;h<p;h+=1){var d=t.Point.create(r[h]),f=r[h-1]||e,g=r[h+1]||n;s=a||d.distance(f)/2,a=d.distance(g)/2;var v=-Math.min(c,s),y=-Math.min(c,a),m=d.clone().move(f,v).round(),b=d.clone().move(g,y).round(),C=new t.Point(l*m.x+u*d.x,u*d.y+l*m.y),x=new t.Point(l*b.x+u*d.x,u*d.y+l*b.y);o.appendSegment(t.Path.createSegment("L",m)),o.appendSegment(t.Path.createSegment("C",C,x,b))}return o.appendSegment(t.Path.createSegment("L",n)),i.raw?o:o.serialize()},smooth:function(e,n,r,i){var o;void 0===i&&(i={});var a=i.direction;if(r&&0!==r.length){var l=s(s([e],r,!0),[n],!1),u=t.Curve.throughPoints(l);o=new t.Path(u)}else if((o=new t.Path).appendSegment(t.Path.createSegment("M",e)),a||(a=Math.abs(e.x-n.x)>=Math.abs(e.y-n.y)?"H":"V"),"H"===a){var c=(e.x+n.x)/2;o.appendSegment(t.Path.createSegment("C",c,e.y,c,n.y,n.x,n.y))}else{var h=(e.y+n.y)/2;o.appendSegment(t.Path.createSegment("C",e.x,h,n.x,h,n.x,n.y))}return i.raw?o:o.serialize()},jumpover:function(e,n,r,i){var o=this;void 0===i&&(i={}),Vd=[],jd=[],function(t){var e=t.graph._jumpOverUpdateList;if(null==e&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",(function(){for(var e=t.graph._jumpOverUpdateList,n=0;n<e.length;n+=1)e[n].update()})),t.graph.on("model:reseted",(function(){e=t.graph._jumpOverUpdateList=[]}))),e.indexOf(t)<0){e.push(t);var n=function(){return e.splice(e.indexOf(t),1)};t.cell.once("change:connector",n),t.cell.once("removed",n)}}(this);var s=i.size||5,a=i.type||"arc",l=i.radius||0,u=i.ignoreConnectors||["smooth"],c=this.graph,h=c.model.getEdges();if(1===h.length)return Hd(_d(e,n,r),s,a,l);var p=this.cell,d=h.indexOf(p),f=c.options.connecting.connector||{},g=h.filter((function(t,e){var n=t.getConnector()||f;return!u.includes(n.name)&&(!(e>d)||"jumpover"!==n.name)})),v=g.map((function(t){return c.renderer.findViewByCell(t)})),y=_d(e,n,r),m=v.map((function(t){return null==t?[]:t===o?y:_d(t.sourcePoint,t.targetPoint,t.routePoints)})),b=[];y.forEach((function(e){var n=g.reduce((function(t,n,r){if(n!==p){var i=function(t,e){var n=[];return e.forEach((function(e){var r=t.intersectsWithLine(e);r&&n.push(r)})),n}(e,m[r]);t.push.apply(t,i)}return t}),[]).sort((function(t,n){return Gd(e.start,t)-Gd(e.start,n)}));n.length>0?b.push.apply(b,function(e,n,r){return n.reduce((function(i,o,s){if(jd.includes(o))return i;var a=i.pop()||e,l=t.Point.create(o).move(a.start,-r),u=t.Point.create(o).move(a.start,+r),c=n[s+1];if(null!=c){var h=u.distance(c);h<=r&&(u=c.move(a.start,h),jd.push(c))}else if(l.distance(a.end)<2*r+1)return i.push(a),i;if(u.distance(a.start)<2*r+1)return i.push(a),i;var p=new t.Line(l,u);return Vd.push(p),i.push(new t.Line(a.start,l),p,new t.Line(u,a.end)),i}),[])}(e,n,s)):b.push(e)}));var C=Hd(b,s,a,l);return Vd=[],jd=[],i.raw?C:C.serialize()}});!function(t){t.presets=qd,t.registry=Ju.create({type:"connector"}),t.registry.register(t.presets,!0)}(Ud||(Ud={}));var $d=Ju.create,Wd=Object.freeze({__proto__:null,create:$d,get Attr(){return ch},get Grid(){return yh},get Filter(){return Ch},get Background(){return wh},get Highlighter(){return Bh},get PortLayout(){return Gh},get PortLabelLayout(){return Jh},get NodeTool(){return Dp},get EdgeTool(){return Np},get Marker(){return Wc},get NodeAnchor(){return Wp},get EdgeAnchor(){return Zp},get ConnectionPoint(){return od},get Router(){return zd},get Connector(){return Ud},get ConnectionStrategy(){return cp},get Registry(){return Ju}}),Xd=function(){function e(t){this.cell=t,this.ids={},this.cache={}}return e.prototype.get=function(){return Object.keys(this.ids)},e.prototype.start=function(t,n,i,o){var s=this;void 0===i&&(i={}),void 0===o&&(o="/");var a=this.cell.getPropByPath(t),l=mi(i,e.defaultOptions),u=this.getTiming(l.timing),c=this.getInterp(l.interp,a,n),h=0,p=Array.isArray(t)?t.join(o):t,d=Array.isArray(t)?t:t.split(o),f=function(){var t=(new Date).getTime();0===h&&(h=t);var e=(t-h)/l.duration;e<1?s.ids[p]=Ya(f):e=1;var n=c(u(e));s.cell.setPropByPath(d,n),i.progress&&i.progress(r({progress:e,currentValue:n},s.getArgs(p))),1===e&&(s.cell.notify("transition:end",s.getArgs(p)),s.cell.notify("transition:complete",s.getArgs(p)),i.complete&&i.complete(s.getArgs(p)),s.cell.notify("transition:finish",s.getArgs(p)),i.finish&&i.finish(s.getArgs(p)),s.clean(p))};return setTimeout((function(){s.stop(t,void 0,o),s.cache[p]={startValue:a,targetValue:n,options:l},s.ids[p]=Ya(f),s.cell.notify("transition:begin",s.getArgs(p)),s.cell.notify("transition:start",s.getArgs(p)),i.start&&i.start(s.getArgs(p))}),i.delay),this.stop.bind(this,t,o,i)},e.prototype.stop=function(t,e,n){var i=this;void 0===e&&(e={}),void 0===n&&(n="/");var o=Array.isArray(t)?t:t.split(n);return Object.keys(this.ids).filter((function(t){return Wi(o,t.split(n).slice(0,o.length))})).forEach((function(t){Ja(i.ids[t]);var n=i.cache[t],o=i.getArgs(t),s=r(r({},n.options),e),a=s.jumpedToEnd;a&&null!=n.targetValue&&(i.cell.setPropByPath(t,n.targetValue),i.cell.notify("transition:end",r({},o)),i.cell.notify("transition:complete",r({},o)),s.complete&&s.complete(r({},o)));var l=r({jumpedToEnd:a},o);i.cell.notify("transition:stop",r({},l)),s.stop&&s.stop(r({},l)),i.cell.notify("transition:finish",r({},o)),s.finish&&s.finish(r({},o)),i.clean(t)})),this},e.prototype.clean=function(t){delete this.ids[t],delete this.cache[t]},e.prototype.getTiming=function(e){return"string"==typeof e?t.Timing[e]:e},e.prototype.getInterp=function(e,n,r){return e?e(n,r):"number"==typeof r?t.Interp.number(n,r):"string"==typeof r?"#"===r[0]?t.Interp.color(n,r):t.Interp.unit(n,r):t.Interp.object(n,r)},e.prototype.getArgs=function(t){var e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}},e}();!function(t){t.defaultOptions={delay:10,duration:100,timing:"linear"}}(Xd||(Xd={}));var Yd,Jd=function(e){function i(t){void 0===t&&(t={});var n=e.call(this)||this;return n.pending=!1,n.changing=!1,n.data={},n.mutate(zr(t)),n.changed={},n}return n(i,e),i.prototype.mutate=function(t,e){var n=this;void 0===e&&(e={});var r=!0===e.unset,i=!0===e.silent,o=[],s=this.changing;this.changing=!0,s||(this.previous=zr(this.data),this.changed={});var a=this.data,l=this.previous,u=this.changed;if(Object.keys(t).forEach((function(e){var n=e,i=t[n];Wi(a[n],i)||o.push(n),Wi(l[n],i)?delete u[n]:u[n]=i,r?delete a[n]:a[n]=i})),!i&&o.length>0&&(this.pending=!0,this.pendingOptions=e,o.forEach((function(t){n.emit("change:*",{key:t,options:e,store:n,current:a[t],previous:l[t]})}))),s)return this;if(!i)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this},i.prototype.get=function(t,e){if(null==t)return this.data;var n=this.data[t];return null==n?e:n},i.prototype.getPrevious=function(t){if(this.previous){var e=this.previous[t];return null==e?void 0:e}},i.prototype.set=function(t,e,n){var r;return null!=t&&("object"==typeof t?this.mutate(t,e):this.mutate(((r={})[t]=e,r),n)),this},i.prototype.remove=function(t,e){var n,i=void 0,o={};if("string"==typeof t)o[t]=i,n=e;else if(Array.isArray(t))t.forEach((function(t){return o[t]=i})),n=e;else{for(var s in this.data)o[s]=i;n=t}return this.mutate(o,r(r({},n),{unset:!0})),this},i.prototype.getByPath=function(t){return Ps(this.data,t,"/")},i.prototype.setByPath=function(t,e,n){void 0===n&&(n={});var r="/",i=Array.isArray(t)?s([],t,!0):t.split(r),o=Array.isArray(t)?t.join(r):t,a=i[0],l=i.length;if(n.propertyPath=o,n.propertyValue=e,n.propertyPathArray=i,1===l)this.set(a,e,n);else{for(var u={},c=u,h=a,p=1;p<l;p+=1){var d=i[p],f=Number.isFinite(Number(d));c=c[h]=f?[]:{},h=d}As(u,i,e,r);var g=zr(this.data);n.rewrite&&Es(g,t,r);var v=ro(g,u);this.set(a,v[a],n)}return this},i.prototype.removeByPath=function(t,e){var n=Array.isArray(t)?t:t.split("/"),r=n[0];if(1===n.length)this.remove(r,e);else{var i=n.slice(1),o=zr(this.get(r));o&&Es(o,i),this.set(r,o,e)}return this},i.prototype.hasChanged=function(t){return null==t?Object.keys(this.changed).length>0:t in this.changed},i.prototype.getChanges=function(t){if(null==t)return this.hasChanged()?zr(this.changed):null;var e,n=this.changing?this.previous:this.data,r={};for(var i in t){var o=t[i];Wi(n[i],o)||(r[i]=o,e=!0)}return e?zr(r):null},i.prototype.toJSON=function(){return zr(this.data)},i.prototype.clone=function(){return new(0,this.constructor)(this.data)},i.prototype.dispose=function(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})},o([t.Basecoat.dispose()],i.prototype,"dispose",null),i}(t.Basecoat);t.Cell=function(e){function a(t){void 0===t&&(t={});var n=e.call(this)||this,r=n.constructor.getDefaults(!0),i=ro({},n.preprocess(r),n.preprocess(t));return n.id=i.id||Bs(),n.store=new Jd(i),n.animation=new Xd(n),n.setup(),n.init(),n.postprocess(t),n}return n(a,e),a.config=function(t){var e,n=this,o=t.markup,s=t.propHooks,a=t.attrHooks,l=i(t,["markup","propHooks","attrHooks"]);null!=o&&(this.markup=o),s&&(this.propHooks=this.propHooks.slice(),Array.isArray(s)?(e=this.propHooks).push.apply(e,s):"function"==typeof s?this.propHooks.push(s):Object.keys(s).forEach((function(t){var e=s[t];"function"==typeof e&&n.propHooks.push(e)}))),a&&(this.attrHooks=r(r({},this.attrHooks),a)),this.defaults=ro({},this.defaults,l)},a.getMarkup=function(){return this.markup},a.getDefaults=function(t){return t?this.defaults:zr(this.defaults)},a.getAttrHooks=function(){return this.attrHooks},a.applyPropHooks=function(t,e){return this.propHooks.reduce((function(e,n){return n?Ws(n,t,e):e}),e)},Object.defineProperty(a.prototype,Symbol.toStringTag,{get:function(){return a.toStringTag},enumerable:!1,configurable:!0}),a.prototype.init=function(){},Object.defineProperty(a.prototype,"model",{get:function(){return this._model},set:function(t){this._model!==t&&(this._model=t)},enumerable:!1,configurable:!0}),a.prototype.preprocess=function(t,e){var n=t.id,r=this.constructor.applyPropHooks(this,t);return null==n&&!0!==e&&(r.id=Bs()),r},a.prototype.postprocess=function(t){},a.prototype.setup=function(){var t=this;this.store.on("change:*",(function(e){var n=e.key,r=e.current,i=e.previous,o=e.options;t.notify("change:*",{key:n,options:o,current:r,previous:i,cell:t}),t.notify("change:"+n,{options:o,current:r,previous:i,cell:t});var s=n;"source"!==s&&"target"!==s||t.notify("change:terminal",{type:s,current:r,previous:i,options:o,cell:t})})),this.store.on("changed",(function(e){var n=e.options;return t.notify("changed",{options:n,cell:t})}))},a.prototype.notify=function(t,e){this.trigger(t,e);var n=this.model;return n&&(n.notify("cell:"+t,e),this.isNode()?n.notify("node:"+t,r(r({},e),{node:this})):this.isEdge()&&n.notify("edge:"+t,r(r({},e),{edge:this}))),this},a.prototype.isNode=function(){return!1},a.prototype.isEdge=function(){return!1},a.prototype.isSameStore=function(t){return this.store===t.store},Object.defineProperty(a.prototype,"view",{get:function(){return this.store.get("view")},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"shape",{get:function(){return this.store.get("shape","")},enumerable:!1,configurable:!0}),a.prototype.getProp=function(t,e){return null==t?this.store.get():this.store.get(t,e)},a.prototype.setProp=function(t,e,n){if("string"==typeof t)this.store.set(t,e,n);else{var r=this.preprocess(t,!0);this.store.set(ro({},this.getProp(),r),e),this.postprocess(t)}return this},a.prototype.removeProp=function(t,e){return"string"==typeof t||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this},a.prototype.hasChanged=function(t){return null==t?this.store.hasChanged():this.store.hasChanged(t)},a.prototype.getPropByPath=function(t){return this.store.getByPath(t)},a.prototype.setPropByPath=function(t,e,n){var r=this;return void 0===n&&(n={}),this.model&&("children"===t?this._children=e?e.map((function(t){return r.model.getCell(t)})).filter((function(t){return null!=t})):null:"parent"===t&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this},a.prototype.removePropByPath=function(t,e){void 0===e&&(e={});var n=Array.isArray(t)?t:t.split("/");return"attrs"===n[0]&&(e.dirty=!0),this.store.removeByPath(n,e),this},a.prototype.prop=function(t,e,n){return null==t?this.getProp():"string"==typeof t||Array.isArray(t)?1===arguments.length?this.getPropByPath(t):null==e?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})},a.prototype.previous=function(t){return this.store.getPrevious(t)},Object.defineProperty(a.prototype,"zIndex",{get:function(){return this.getZIndex()},set:function(t){null==t?this.removeZIndex():this.setZIndex(t)},enumerable:!1,configurable:!0}),a.prototype.getZIndex=function(){return this.store.get("zIndex")},a.prototype.setZIndex=function(t,e){return void 0===e&&(e={}),this.store.set("zIndex",t,e),this},a.prototype.removeZIndex=function(t){return void 0===t&&(t={}),this.store.remove("zIndex",t),this},a.prototype.toFront=function(t){void 0===t&&(t={});var e=this.model;if(e){var n,r=e.getMaxZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0})).unshift(this):n=[this],r=r-n.length+1;var i=e.total(),o=e.indexOf(this)!==i-n.length;o||(o=n.some((function(t,e){return t.getZIndex()!==r+e}))),o&&this.batchUpdate("to-front",(function(){r+=n.length,n.forEach((function(e,n){e.setZIndex(r+n,t)}))}))}return this},a.prototype.toBack=function(t){void 0===t&&(t={});var e=this.model;if(e){var n,r=e.getMinZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0})).unshift(this):n=[this];var i=0!==e.indexOf(this);i||(i=n.some((function(t,e){return t.getZIndex()!==r+e}))),i&&this.batchUpdate("to-back",(function(){r-=n.length,n.forEach((function(e,n){e.setZIndex(r+n,t)}))}))}return this},Object.defineProperty(a.prototype,"markup",{get:function(){return this.getMarkup()},set:function(t){null==t?this.removeMarkup():this.setMarkup(t)},enumerable:!1,configurable:!0}),a.prototype.getMarkup=function(){var t=this.store.get("markup");null==t&&(t=this.constructor.getMarkup());return t},a.prototype.setMarkup=function(t,e){return void 0===e&&(e={}),this.store.set("markup",t,e),this},a.prototype.removeMarkup=function(t){return void 0===t&&(t={}),this.store.remove("markup",t),this},Object.defineProperty(a.prototype,"attrs",{get:function(){return this.getAttrs()},set:function(t){null==t?this.removeAttrs():this.setAttrs(t)},enumerable:!1,configurable:!0}),a.prototype.getAttrs=function(){var t=this.store.get("attrs");return t?r({},t):{}},a.prototype.setAttrs=function(t,e){var n=this;if(void 0===e&&(e={}),null==t)this.removeAttrs(e);else{var i=function(t){return n.store.set("attrs",t,e)};if(!0===e.overwrite)i(t);else{var o=this.getAttrs();!1===e.deep?i(r(r({},o),t)):i(ro({},o,t))}}return this},a.prototype.replaceAttrs=function(t,e){return void 0===e&&(e={}),this.setAttrs(t,r(r({},e),{overwrite:!0}))},a.prototype.updateAttrs=function(t,e){return void 0===e&&(e={}),this.setAttrs(t,r(r({},e),{deep:!1}))},a.prototype.removeAttrs=function(t){return void 0===t&&(t={}),this.store.remove("attrs",t),this},a.prototype.getAttrDefinition=function(t){if(!t)return null;var e=this.constructor.getAttrHooks()||{},n=e[t]||ch.registry.get(t);if(!n){var r=jn(t);n=e[r]||ch.registry.get(r)}return n||null},a.prototype.getAttrByPath=function(t){return null==t||""===t?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))},a.prototype.setAttrByPath=function(t,e,n){return void 0===n&&(n={}),this.setPropByPath(this.prefixAttrPath(t),e,n),this},a.prototype.removeAttrByPath=function(t,e){return void 0===e&&(e={}),this.removePropByPath(this.prefixAttrPath(t),e),this},a.prototype.prefixAttrPath=function(t){return Array.isArray(t)?["attrs"].concat(t):"attrs/"+t},a.prototype.attr=function(t,e,n){return null==t?this.getAttrByPath():"string"==typeof t||Array.isArray(t)?1===arguments.length?this.getAttrByPath(t):null==e?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})},Object.defineProperty(a.prototype,"visible",{get:function(){return this.isVisible()},set:function(t){this.setVisible(t)},enumerable:!1,configurable:!0}),a.prototype.setVisible=function(t,e){return void 0===e&&(e={}),this.store.set("visible",t,e),this},a.prototype.isVisible=function(){return!1!==this.store.get("visible")},a.prototype.show=function(t){return void 0===t&&(t={}),this.isVisible()||this.setVisible(!0,t),this},a.prototype.hide=function(t){return void 0===t&&(t={}),this.isVisible()&&this.setVisible(!1,t),this},a.prototype.toggleVisible=function(t,e){void 0===e&&(e={});var n="boolean"==typeof t?e:t;return("boolean"==typeof t?t:!this.isVisible())?this.show(n):this.hide(n),this},Object.defineProperty(a.prototype,"data",{get:function(){return this.getData()},set:function(t){this.setData(t)},enumerable:!1,configurable:!0}),a.prototype.getData=function(){return this.store.get("data")},a.prototype.setData=function(t,e){var n=this;if(void 0===e&&(e={}),null==t)this.removeData(e);else{var i=function(t){return n.store.set("data",t,e)};if(!0===e.overwrite)i(t);else{var o=this.getData();!1===e.deep?i("object"==typeof t?r(r({},o),t):t):i(ro({},o,t))}}return this},a.prototype.replaceData=function(t,e){return void 0===e&&(e={}),this.setData(t,r(r({},e),{overwrite:!0}))},a.prototype.updateData=function(t,e){return void 0===e&&(e={}),this.setData(t,r(r({},e),{deep:!1}))},a.prototype.removeData=function(t){return void 0===t&&(t={}),this.store.remove("data",t),this},Object.defineProperty(a.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.getChildren()},enumerable:!1,configurable:!0}),a.prototype.getParentId=function(){return this.store.get("parent")},a.prototype.getParent=function(){var t=this.getParentId();if(t&&this.model){var e=this.model.getCell(t);return this._parent=e,e}return null},a.prototype.getChildren=function(){var t=this,e=this.store.get("children");if(e&&e.length&&this.model){var n=e.map((function(e){var n;return null===(n=t.model)||void 0===n?void 0:n.getCell(e)})).filter((function(t){return null!=t}));return this._children=n,s([],n,!0)}return null},a.prototype.hasParent=function(){return null!=this.parent},a.prototype.isParentOf=function(t){return null!=t&&t.getParent()===this},a.prototype.isChildOf=function(t){return null!=t&&this.getParent()===t},a.prototype.eachChild=function(t,e){return this.children&&this.children.forEach(t,e),this},a.prototype.filterChild=function(t,e){return this.children?this.children.filter(t,e):[]},a.prototype.getChildCount=function(){return null==this.children?0:this.children.length},a.prototype.getChildIndex=function(t){return null==this.children?-1:this.children.indexOf(t)},a.prototype.getChildAt=function(t){return null!=this.children&&t>=0?this.children[t]:null},a.prototype.getAncestors=function(t){void 0===t&&(t={});for(var e=[],n=this.getParent();n;)e.push(n),n=!1!==t.deep?n.getParent():null;return e},a.prototype.getDescendants=function(t){if(void 0===t&&(t={}),!1!==t.deep){if(t.breadthFirst){for(var e=[],n=this.getChildren()||[];n.length>0;){var r=n.shift(),i=r.getChildren();e.push(r),i&&n.push.apply(n,i)}return e}var o=this.getChildren()||[];return o.forEach((function(e){o.push.apply(o,e.getDescendants(t))})),o}return this.getChildren()||[]},a.prototype.isDescendantOf=function(t,e){if(void 0===e&&(e={}),null==t)return!1;if(!1!==e.deep){for(var n=this.getParent();n;){if(n===t)return!0;n=n.getParent()}return!1}return this.isChildOf(t)},a.prototype.isAncestorOf=function(t,e){return void 0===e&&(e={}),null!=t&&t.isDescendantOf(this,e)},a.prototype.contains=function(t){return this.isAncestorOf(t)},a.prototype.getCommonAncestor=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a.getCommonAncestor.apply(a,s([this],t,!1))},a.prototype.setParent=function(t,e){return void 0===e&&(e={}),this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this},a.prototype.setChildren=function(t,e){return void 0===e&&(e={}),this._children=t,null!=t?this.store.set("children",t.map((function(t){return t.id})),e):this.store.remove("children",e),this},a.prototype.unembed=function(t,e){void 0===e&&(e={});var n=this.children;if(null!=n&&null!=t){var r=this.getChildIndex(t);-1!==r&&(n.splice(r,1),t.setParent(null,e),this.setChildren(n,e))}return this},a.prototype.embed=function(t,e){return void 0===e&&(e={}),t.addTo(this,e),this},a.prototype.addTo=function(t,e){return void 0===e&&(e={}),a.isCell(t)?t.addChild(this,e):t.addCell(this,e),this},a.prototype.insertTo=function(t,e,n){return void 0===n&&(n={}),t.insertChild(this,e,n),this},a.prototype.addChild=function(t,e){return void 0===e&&(e={}),this.insertChild(t,void 0,e)},a.prototype.insertChild=function(t,e,n){if(void 0===n&&(n={}),null!=t&&t!==this){var r=t.getParent(),i=this!==r,o=e;if(null==o&&(o=this.getChildCount(),i||(o-=1)),r){var s=r.getChildren();if(s){var a=s.indexOf(t);a>=0&&(t.setParent(null,n),s.splice(a,1),r.setChildren(s,n))}}var l=this.children;if(null==l?(l=[]).push(t):l.splice(o,0,t),t.setParent(this,n),this.setChildren(l,n),i&&this.model){var u=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);u&&u.forEach((function(t){return t.updateParent(n)})),c&&c.forEach((function(t){return t.updateParent(n)}))}this.model&&this.model.addCell(t,n)}return this},a.prototype.removeFromParent=function(t){void 0===t&&(t={});var e=this.getParent();if(null!=e){var n=e.getChildIndex(this);e.removeChildAt(n,t)}return this},a.prototype.removeChild=function(t,e){void 0===e&&(e={});var n=this.getChildIndex(t);return this.removeChildAt(n,e)},a.prototype.removeChildAt=function(t,e){void 0===e&&(e={});var n=this.getChildAt(t);return null!=this.children&&null!=n&&(this.unembed(n,e),n.remove(e)),n},a.prototype.remove=function(t){var e=this;return void 0===t&&(t={}),this.batchUpdate("remove",(function(){var n=e.getParent();n&&n.removeChild(e,t),!1!==t.deep&&e.eachChild((function(e){return e.remove(t)})),e.model&&e.model.removeCell(e,t)})),this},a.prototype.transition=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r="/"),this.animation.start(t,e,n,r)},a.prototype.stopTransition=function(t,e,n){return void 0===n&&(n="/"),this.animation.stop(t,e,n),this},a.prototype.getTransitions=function(){return this.animation.get()},a.prototype.translate=function(t,e,n){return this},a.prototype.scale=function(t,e,n,r){return this},a.prototype.addTools=function(t,e,n){var i=Array.isArray(t)?t:[t],o="string"==typeof e?e:null,a="object"==typeof e?e:"object"==typeof n?n:{};if(a.reset)return this.setTools({name:o,items:i,local:a.local},a);var l=zr(this.getTools());return null==l||null==o||l.name===o?(null==l&&(l={}),l.items||(l.items=[]),l.name=o,l.items=s(s([],l.items,!0),i,!0),this.setTools(r({},l),a)):void 0},a.prototype.setTools=function(t,e){return void 0===e&&(e={}),null==t?this.removeTools():this.store.set("tools",a.normalizeTools(t),e),this},a.prototype.getTools=function(){return this.store.get("tools")},a.prototype.removeTools=function(t){return void 0===t&&(t={}),this.store.remove("tools",t),this},a.prototype.hasTools=function(t){var e=this.getTools();return null!=e&&(null==t||e.name===t)},a.prototype.hasTool=function(t){var e=this.getTools();return null!=e&&e.items.some((function(e){return"string"==typeof e?e===t:e.name===t}))},a.prototype.removeTool=function(t,e){void 0===e&&(e={});var n=zr(this.getTools());if(n){var r=!1,i=n.items.slice(),o=function(t){i.splice(t,1),r=!0};if("number"==typeof t)o(t);else for(var s=i.length-1;s>=0;s-=1){var a=i[s];("string"==typeof a?a===t:a.name===t)&&o(s)}r&&(n.items=i,this.setTools(n,e))}return this},a.prototype.getBBox=function(e){return new t.Rectangle},a.prototype.getConnectionPoint=function(e,n){return new t.Point},a.prototype.toJSON=function(t){var e=this;void 0===t&&(t={});var n=r({},this.store.get()),i=Object.prototype.toString,o=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!n.shape){var s=this.constructor;throw new Error("Unable to serialize "+o+' missing "shape" prop, check the '+o+' "'+(s.name||i.call(s))+'"')}var a=this.constructor,l=!0===t.diff,u=n.attrs||{},c=a.getDefaults(!0),h=l?this.preprocess(c,!0):c,p=h.attrs||{},d={};Object.keys(n).forEach((function(t){var r=n[t];if(null!=r&&!Array.isArray(r)&&"object"==typeof r&&!_e(r))throw new Error("Can only serialize "+o+' with plain-object props, but got a "'+i.call(r)+'" type of key "'+t+'" on '+o+' "'+e.id+'"');"attrs"!==t&&"shape"!==t&&l&&(Wi(r,h[t])&&delete n[t])})),Object.keys(u).forEach((function(t){var e=u[t],n=p[t];Object.keys(e).forEach((function(r){var i=e[r],o=n?n[r]:null;null==i||"object"!=typeof i||Array.isArray(i)?null!=n&&Wi(o,i)||(null==d[t]&&(d[t]={}),d[t][r]=i):Object.keys(i).forEach((function(e){var s=i[e];null!=n&&null!=o&&F(o)&&Wi(o[e],s)||(null==d[t]&&(d[t]={}),null==d[t][r]&&(d[t][r]={}),d[t][r][e]=s)}))}))}));var f=r(r({},n),{attrs:$i(d)?void 0:d});null==f.attrs&&delete f.attrs;var g=f;return 0===g.angle&&delete g.angle,zr(g)},a.prototype.clone=function(t){if(void 0===t&&(t={}),!t.deep){var e=r({},this.store.get());return t.keepId||delete e.id,delete e.parent,delete e.children,new(0,this.constructor)(e)}return a.deepClone(this)[this.id]},a.prototype.findView=function(t){return t.renderer.findViewByCell(this)},a.prototype.startBatch=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n=this.model),this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,r(r({},e),{cell:this})),this},a.prototype.stopBatch=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n=this.model),n&&n.stopBatch(t,r(r({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this},a.prototype.batchUpdate=function(t,e,n){var r=this.model;this.startBatch(t,n,r);var i=e();return this.stopBatch(t,n,r),i},a.prototype.dispose=function(){this.removeFromParent(),this.store.dispose()},a.defaults={},a.attrHooks={},a.propHooks=[],o([t.Basecoat.dispose()],a.prototype,"dispose",null),a}(t.Basecoat),(t.Cell||(t.Cell={})).normalizeTools=function(t){return"string"==typeof t?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}},function(t){t.toStringTag="X6."+t.name,t.isCell=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"==typeof r.isNode&&"function"==typeof r.isEdge&&"function"==typeof r.prop&&"function"==typeof r.attr}}(t.Cell||(t.Cell={})),function(t){t.getCommonAncestor=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter((function(t){return null!=t})).map((function(t){return t.getAncestors()})).sort((function(t,e){return t.length-e.length})),r=n.shift();return r.find((function(t){return n.every((function(e){return e.includes(t)}))}))||null},t.getCellsBBox=function(t,e){void 0===e&&(e={});for(var n=null,r=0,i=t.length;r<i;r+=1){var o=t[r],s=o.getBBox(e);if(s){if(o.isNode()){var a=o.getAngle();null!=a&&0!==a&&(s=s.bbox(a))}n=null==n?s:n.union(s)}}return n},t.deepClone=function(e){var n=s([e],e.getDescendants({deep:!0}),!0);return t.cloneCells(n)},t.cloneCells=function(t){var e=ls(t),n=e.reduce((function(t,e){return t[e.id]=e.clone(),t}),{});return e.forEach((function(t){var e=n[t.id];if(e.isEdge()){var i=e.getSourceCellId(),o=e.getTargetCellId();i&&n[i]&&e.setSource(r(r({},e.getSource()),{cell:n[i].id})),o&&n[o]&&e.setTarget(r(r({},e.getTarget()),{cell:n[o].id}))}var s=t.getParent();s&&n[s.id]&&e.setParent(n[s.id]);var a=t.getChildren();if(a&&a.length){var l=a.reduce((function(t,e){return n[e.id]&&t.push(n[e.id]),t}),[]);l.length>0&&e.setChildren(l)}})),n}}(t.Cell||(t.Cell={})),function(t){t.config({propHooks:function(e){var n=e.tools,r=i(e,["tools"]);return n&&(r.tools=t.normalizeTools(n)),r}})}(t.Cell||(t.Cell={})),function(t){var e,n;t.exist=function(t,r){return r?null!=e&&e.exist(t):null!=n&&n.exist(t)},t.setEdgeRegistry=function(t){e=t},t.setNodeRegistry=function(t){n=t}}(Yd||(Yd={}));var Zd=function(){function e(t){this.ports=[],this.groups={},this.init(zr(t))}return e.prototype.getPorts=function(){return this.ports},e.prototype.getGroup=function(t){return null!=t?this.groups[t]:null},e.prototype.getPortsByGroup=function(t){return this.ports.filter((function(e){return e.group===t||null==e.group&&null==t}))},e.prototype.getPortsLayoutByGroup=function(e,n){var r,i=this,o=this.getPortsByGroup(e),s=e?this.getGroup(e):null,a=s?s.position:null,l=a?a.name:null;if(null!=l){var u=Gh.registry.get(l);if(null==u)return Gh.registry.onNotFound(l);r=u}else r=Gh.presets.left;var c=o.map((function(t){return t&&t.position&&t.position.args||{}})),h=a&&a.args||{};return r(c,n,h).map((function(e,r){var s=o[r];return{portLayout:e,portId:s.id,portSize:s.size,portAttrs:s.attrs,labelSize:s.label.size,labelLayout:i.getPortLabelLayout(s,t.Point.create(e.position),n)}}))},e.prototype.init=function(t){var e=this,n=t.groups,r=t.items;null!=n&&Object.keys(n).forEach((function(t){e.groups[t]=e.parseGroup(n[t])})),Array.isArray(r)&&r.forEach((function(t){e.ports.push(e.parsePort(t))}))},e.prototype.parseGroup=function(t){return r(r({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})},e.prototype.parsePort=function(t){var e=r({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=ro({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=ro({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=r(r({},n.size),e.size),e},e.prototype.getZIndex=function(t,e){return"number"==typeof e.zIndex?e.zIndex:"number"==typeof t.zIndex||"auto"===t.zIndex?t.zIndex:"auto"},e.prototype.createPosition=function(t,e){return ro({name:"left",args:{}},t.position,{args:e.args})},e.prototype.getPortPosition=function(t,e){if(void 0===e&&(e=!1),null==t){if(e)return{name:"left",args:{}}}else{if("string"==typeof t)return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if("object"==typeof t)return t}return{args:{}}},e.prototype.getPortLabelPosition=function(t,e){if(void 0===e&&(e=!1),null==t){if(e)return{name:"left",args:{}}}else{if("string"==typeof t)return{name:t,args:{}};if("object"==typeof t)return t}return{args:{}}},e.prototype.getLabel=function(t,e){void 0===e&&(e=!1);var n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n},e.prototype.getPortLabelLayout=function(t,e,n){var r=t.label.position.name||"left",i=t.label.position.args||{},o=Jh.registry.get(r)||Jh.presets.left;return o?o(e,n,i):null},e}();t.Node=function(e){function o(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.initPorts(),n}return n(o,e),Object.defineProperty(o.prototype,Symbol.toStringTag,{get:function(){return o.toStringTag},enumerable:!1,configurable:!0}),o.prototype.preprocess=function(t,n){var o=t.x,s=t.y,a=t.width,l=t.height,u=i(t,["x","y","width","height"]);if(null!=o||null!=s){var c=u.position;u.position=r(r({},c),{x:null!=o?o:c?c.x:0,y:null!=s?s:c?c.y:0})}if(null!=a||null!=l){var h=u.size;u.size=r(r({},h),{width:null!=a?a:h?h.width:0,height:null!=l?l:h?h.height:0})}return e.prototype.preprocess.call(this,u,n)},o.prototype.isNode=function(){return!0},o.prototype.size=function(t,e,n){return void 0===t?this.getSize():"number"==typeof t?this.setSize(t,e,n):this.setSize(t,e)},o.prototype.getSize=function(){var t=this.store.get("size");return t?r({},t):{width:1,height:1}},o.prototype.setSize=function(t,e,n){return"object"==typeof t?this.resize(t.width,t.height,e):this.resize(t,e,n),this},o.prototype.resize=function(e,n,r){void 0===r&&(r={}),this.startBatch("resize",r);var i=r.direction;if(i){var o=this.getSize();switch(i){case"left":case"right":n=o.height;break;case"top":case"bottom":e=o.width}var s={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i],a=t.Angle.normalize(this.getAngle()||0);r.absolute&&(s+=Math.floor((a+45)/90),s%=4);var l=this.getBBox(),u=(0===s?l.getBottomLeft():1===s?l.getCorner():2===s?l.getTopRight():l.getOrigin()).clone().rotate(-a,l.getCenter()),c=Math.sqrt(e*e+n*n)/2,h=s*Math.PI/2;h+=Math.atan(s%2==0?n/e:e/n),h-=t.Angle.toRad(a);var p=t.Point.fromPolar(c,h,u).clone().translate(e/-2,n/-2);this.store.set("size",{width:e,height:n},r),this.setPosition(p.x,p.y,r)}else this.store.set("size",{width:e,height:n},r);return this.stopBatch("resize",r),this},o.prototype.scale=function(t,e,n,r){void 0===r&&(r={});var i=this.getBBox().scale(t,e,null==n?void 0:n);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this},o.prototype.position=function(t,e,n){return"number"==typeof t?this.setPosition(t,e,n):this.getPosition(t)},o.prototype.getPosition=function(t){if(void 0===t&&(t={}),t.relative){var e=this.getParent();if(null!=e&&e.isNode()){var n=this.getPosition(),i=e.getPosition();return{x:n.x-i.x,y:n.y-i.y}}}var o=this.store.get("position");return o?r({},o):{x:0,y:0}},o.prototype.setPosition=function(t,e,n){var r,i,o;if(void 0===n&&(n={}),"object"==typeof t?(r=t.x,i=t.y,o=e||{}):(r=t,i=e,o=n||{}),o.relative){var s=this.getParent();if(null!=s&&s.isNode()){var a=s.getPosition();r+=a.x,i+=a.y}}if(o.deep){var l=this.getPosition();this.translate(r-l.x,i-l.y,o)}else this.store.set("position",{x:r,y:i},o);return this},o.prototype.translate=function(e,n,i){if(void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i={}),0===e&&0===n)return this;i.translateBy=i.translateBy||this.id;var o=this.getPosition();if(null!=i.restrict&&i.translateBy===this.id){var s=this.getBBox({deep:!0}),a=i.restrict,l=o.x-s.x,u=o.y-s.y,c=Math.max(a.x+l,Math.min(a.x+a.width+l-s.width,o.x+e)),h=Math.max(a.y+u,Math.min(a.y+a.height+u-s.height,o.y+n));e=c-o.x,n=h-o.y}var p={x:o.x+e,y:o.y+n};return i.tx=e,i.ty=n,i.transition?("object"!=typeof i.transition&&(i.transition={}),this.transition("position",p,r(r({},i.transition),{interp:t.Interp.object})),this.eachChild((function(t){var r;(null===(r=i.exclude)||void 0===r?void 0:r.includes(t))||t.translate(e,n,i)}))):(this.startBatch("translate",i),this.store.set("position",p,i),this.eachChild((function(t){var r;(null===(r=i.exclude)||void 0===r?void 0:r.includes(t))||t.translate(e,n,i)})),this.stopBatch("translate",i)),this},o.prototype.angle=function(t,e){return null==t?this.getAngle():this.rotate(t,e)},o.prototype.getAngle=function(){return this.store.get("angle",0)},o.prototype.rotate=function(t,e){void 0===e&&(e={});var n=this.getAngle();if(e.center){var i=this.getSize(),o=this.getPosition(),s=this.getBBox().getCenter();s.rotate(n-t,e.center);var a=s.x-i.width/2-o.x,l=s.y-i.height/2-o.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(o.x+a,o.y+l,e),this.rotate(t,r(r({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this},o.prototype.getBBox=function(e){if(void 0===e&&(e={}),e.deep){var n=this.getDescendants({deep:!0,breadthFirst:!0});return n.push(this),t.Cell.getCellsBBox(n)}return t.Rectangle.fromPositionAndSize(this.getPosition(),this.getSize())},o.prototype.getConnectionPoint=function(e,n){var r=this.getBBox(),i=r.getCenter(),o=e.getTerminal(n);if(null==o)return i;var s=o.port;if(!s||!this.hasPort(s))return i;var a=this.getPort(s);if(!a||!a.group)return i;var l=this.getPortsPosition(a.group)[s].position,u=t.Point.create(l).translate(r.getOrigin()),c=this.getAngle();return c&&u.rotate(-c,i),u},o.prototype.fit=function(e){void 0===e&&(e={});var n=(this.getChildren()||[]).filter((function(t){return t.isNode()}));if(0===n.length)return this;this.startBatch("fit-embeds",e),e.deep&&n.forEach((function(t){return t.fit(e)}));var r=t.Cell.getCellsBBox(n),i=r.x,o=r.y,s=r.width,a=r.height,l=Us(e.padding);return i-=l.left,o-=l.top,s+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:o},size:{width:s,height:a}},e),this.stopBatch("fit-embeds"),this},Object.defineProperty(o.prototype,"portContainerMarkup",{get:function(){return this.getPortContainerMarkup()},set:function(t){this.setPortContainerMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultPortContainerMarkup=function(){return this.store.get("defaultPortContainerMarkup")||t.Markup.getPortContainerMarkup()},o.prototype.getPortContainerMarkup=function(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()},o.prototype.setPortContainerMarkup=function(e,n){return void 0===n&&(n={}),this.store.set("portContainerMarkup",t.Markup.clone(e),n),this},Object.defineProperty(o.prototype,"portMarkup",{get:function(){return this.getPortMarkup()},set:function(t){this.setPortMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultPortMarkup=function(){return this.store.get("defaultPortMarkup")||t.Markup.getPortMarkup()},o.prototype.getPortMarkup=function(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()},o.prototype.setPortMarkup=function(e,n){return void 0===n&&(n={}),this.store.set("portMarkup",t.Markup.clone(e),n),this},Object.defineProperty(o.prototype,"portLabelMarkup",{get:function(){return this.getPortLabelMarkup()},set:function(t){this.setPortLabelMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultPortLabelMarkup=function(){return this.store.get("defaultPortLabelMarkup")||t.Markup.getPortLabelMarkup()},o.prototype.getPortLabelMarkup=function(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()},o.prototype.setPortLabelMarkup=function(e,n){return void 0===n&&(n={}),this.store.set("portLabelMarkup",t.Markup.clone(e),n),this},Object.defineProperty(o.prototype,"ports",{get:function(){var t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t},enumerable:!1,configurable:!0}),o.prototype.getPorts=function(){return zr(this.ports.items)},o.prototype.getPortsByGroup=function(t){return this.getPorts().filter((function(e){return e.group===t}))},o.prototype.getPort=function(t){return zr(this.ports.items.find((function(e){return e.id&&e.id===t})))},o.prototype.getPortAt=function(t){return this.ports.items[t]||null},o.prototype.hasPorts=function(){return this.ports.items.length>0},o.prototype.hasPort=function(t){return-1!==this.getPortIndex(t)},o.prototype.getPortIndex=function(t){var e="string"==typeof t?t:t.id;return null!=e?this.ports.items.findIndex((function(t){return t.id===e})):-1},o.prototype.getPortsPosition=function(e){var n=this.getSize();return this.port.getPortsLayoutByGroup(e,new t.Rectangle(0,0,n.width,n.height)).reduce((function(t,e){var n=e.portLayout;return t[e.portId]={position:r({},n.position),angle:n.angle||0},t}),{})},o.prototype.getPortProp=function(t,e){return this.getPropByPath(this.prefixPortPath(t,e))},o.prototype.setPortProp=function(t,e,n,r){if("string"==typeof e||Array.isArray(e)){var i=this.prefixPortPath(t,e),o=n;return this.setPropByPath(i,o,r)}var s=this.prefixPortPath(t),a=e;return this.setPropByPath(s,a,n)},o.prototype.removePortProp=function(t,e,n){return"string"==typeof e||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)},o.prototype.portProp=function(t,e,n,r){return null==e?this.getPortProp(t):"string"==typeof e||Array.isArray(e)?2===arguments.length?this.getPortProp(t,e):null==n?this.removePortProp(t,e,r):this.setPortProp(t,e,n,r):this.setPortProp(t,e,n)},o.prototype.prefixPortPath=function(t,e){var n=this.getPortIndex(t);if(-1===n)throw new Error('Unable to find port with id: "'+t+'"');return null==e||""===e?["ports","items",""+n]:Array.isArray(e)?s(["ports","items",""+n],e,!0):"ports/items/"+n+"/"+e},o.prototype.addPort=function(t,e){var n=s([],this.ports.items,!0);return n.push(t),this.setPropByPath("ports/items",n,e),this},o.prototype.addPorts=function(t,e){return this.setPropByPath("ports/items",s(s([],this.ports.items,!0),t,!0),e),this},o.prototype.insertPort=function(t,e,n){var r=s([],this.ports.items,!0);return r.splice(t,0,e),this.setPropByPath("ports/items",r,n),this},o.prototype.removePort=function(t,e){return void 0===e&&(e={}),this.removePortAt(this.getPortIndex(t),e)},o.prototype.removePortAt=function(t,e){if(void 0===e&&(e={}),t>=0){var n=s([],this.ports.items,!0);n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this},o.prototype.removePorts=function(t,e){var n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;var r=s([],this.ports.items,!0).filter((function(e){return!t.some((function(t){var n="string"==typeof t?t:t.id;return e.id===n}))}));this.setPropByPath("ports/items",r,n)}}else(n=t||{}).rewrite=!0,this.setPropByPath("ports/items",[],n);return this},o.prototype.getParsedPorts=function(){return this.port.getPorts()},o.prototype.getParsedGroups=function(){return this.port.groups},o.prototype.getPortsLayoutByGroup=function(t,e){return this.port.getPortsLayoutByGroup(t,e)},o.prototype.initPorts=function(){var t=this;this.updatePortData(),this.on("change:ports",(function(){t.processRemovedPort(),t.updatePortData()}))},o.prototype.processRemovedPort=function(){var t=this.ports,e={};t.items.forEach((function(t){t.id&&(e[t.id]=!0)}));var n={};(this.store.getPrevious("ports")||{items:[]}).items.forEach((function(t){t.id&&!e[t.id]&&(n[t.id]=!0)}));var r=this.model;r&&!$i(n)&&(r.getConnectedEdges(this,{incoming:!0}).forEach((function(t){var e=t.getTargetPortId();e&&n[e]&&t.remove()})),r.getConnectedEdges(this,{outgoing:!0}).forEach((function(t){var e=t.getSourcePortId();e&&n[e]&&t.remove()})))},o.prototype.validatePorts=function(){var t=this,e={},n=[];return this.ports.items.forEach((function(r){"object"!=typeof r&&n.push("Invalid port "+r+"."),null==r.id&&(r.id=t.generatePortId()),e[r.id]&&n.push("Duplicitied port id."),e[r.id]=!0})),n},o.prototype.generatePortId=function(){return Bs()},o.prototype.updatePortData=function(){var t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));var e=this.port?this.port.getPorts():null;this.port=new Zd(this.ports);var n=this.port.getPorts(),r=e?n.filter((function(t){return e.find((function(e){return e.id===t.id}))?null:t})):s([],n,!0),i=e?e.filter((function(t){return n.find((function(e){return e.id===t.id}))?null:t})):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})},o.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},o}(t.Cell),function(t){t.toStringTag="X6."+t.name,t.isNode=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"==typeof r.isNode&&"function"==typeof r.isEdge&&"function"==typeof r.prop&&"function"==typeof r.attr&&"function"==typeof r.size&&"function"==typeof r.position}}(t.Node||(t.Node={})),function(t){t.config({propHooks:function(t){var e=t.ports,n=i(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}(t.Node||(t.Node={})),function(t){t.registry=Ju.create({type:"node",process:function(e,n){if(Yd.exist(e,!0))throw new Error("Node with name '"+e+"' was registered by anthor Edge");if("function"==typeof n)return n.config({shape:e}),n;var r=t,o=n.inherit,s=i(n,["inherit"]);if(o)if("string"==typeof o){var a=this.get(o);null==a?this.onNotFound(o,"inherited"):r=a}else r=o;null==s.constructorName&&(s.constructorName=e);var l=r.define.call(r,s);return l.config({shape:e}),l}}),Yd.setNodeRegistry(t.registry)}(t.Node||(t.Node={})),function(t){var e=0;t.define=function(n){var r,o=n.constructorName,s=n.overwrite,a=i(n,["constructorName","overwrite"]),l=Cs((r=o||a.shape)?Ts(r):"CustomNode"+(e+=1),this);return l.config(a),a.shape&&t.registry.register(a.shape,l,s),l},t.create=function(e){var n=e.shape||"rect",r=t.registry.get(n);return r?new r(e):t.registry.onNotFound(n)}}(t.Node||(t.Node={}));var Kd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return this.getLabel()},set:function(t){this.setLabel(t)},enumerable:!1,configurable:!0}),e.prototype.getLabel=function(){return this.getAttrByPath("text/text")},e.prototype.setLabel=function(t,e){return null==t?this.removeLabel():this.setAttrByPath("text/text",t,e),this},e.prototype.removeLabel=function(){return this.removeAttrByPath("text/text"),this},e}(t.Node);function Qd(t){return"basic."+t}function tf(t){void 0===t&&(t="xlink:href");return function(e){var n=e.imageUrl,r=e.imageWidth,o=e.imageHeight,s=i(e,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=r||null!=o){var a=function(){if(s.attrs){var e=s.attrs.image;null!=n&&(e[t]=n),null!=r&&(e.width=r),null!=o&&(e.height=o),s.attrs.image=e}};s.attrs?(null==s.attrs.image&&(s.attrs.image={}),a()):(s.attrs={image:{}},a())}return s}}function ef(t,e,n){var r;void 0===n&&(n={});var i=Qd(t),o={constructorName:i,attrs:(r={".":{fill:"#ffffff",stroke:"none"}},r[t]={fill:"#ffffff",stroke:"#000000"},r)};return n.ignoreMarkup||(o.markup=function(t,e){return void 0===e&&(e=!1),'<g class="rotatable"><g class="scalable"><'+t+"/></g>"+(e?"":"<text/>")+"</g>"}(t,!0===n.noText)),(n.parent||Kd).define(ro(o,e,{shape:i}))}!function(t){t.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},t.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},t.config({attrs:{text:r({},t.labelAttr)},propHooks:function(t){var e=t.label,n=i(t,["label"]);return e&&As(n,"attrs/text/text",e),n},visible:!0})}(Kd||(Kd={})),ef("rect",{attrs:{rect:{width:100,height:60}}}),ef("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),ef("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),ef("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),ef("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),ef("image",{attrs:{text:{refY:null,refDy:16}},propHooks:tf()});var nf,rf,of=ef("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks:function(t){var e=t.d,n=i(t,["d"]);return null!=e&&As(n,"attrs/path/d",e),n}});ef("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:of,ignoreMarkup:!0}),ef("cylinder",{width:40,height:40,attrs:{path:{fill:"#FFFFFF",stroke:"#cbd2d7",strokeWidth:3,d:["M 0 10 C 10 5, 30 5, 40 10 C 30 15, 10 15, 0 10","L 0 20","C 10 25, 30 25, 40 20","L 40 10"].join(" ")},text:{refY:.7,refDy:null,fill:"#435460"}}},{parent:of,ignoreMarkup:!0}),t.Edge=function(e){function o(t){return void 0===t&&(t={}),e.call(this,t)||this}return n(o,e),Object.defineProperty(o.prototype,Symbol.toStringTag,{get:function(){return o.toStringTag},enumerable:!1,configurable:!0}),o.prototype.preprocess=function(n,o){var s=n.source,a=n.sourceCell,l=n.sourcePort,u=n.sourcePoint,c=n.target,h=n.targetCell,p=n.targetPort,d=n.targetPoint,f=i(n,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),g=function(t){return"string"==typeof t||"number"==typeof t};if(null!=s)if(t.Cell.isCell(s))f.source={cell:s.id};else if(g(s))f.source={cell:s};else if(t.Point.isPoint(s))f.source=s.toJSON();else if(Array.isArray(s))f.source={x:s[0],y:s[1]};else{var v=s.cell;t.Cell.isCell(v)?f.source=r(r({},s),{cell:v.id}):f.source=s}if(null!=a||null!=l){var y=f.source;if(null!=a){var m=g(a)?a:a.id;y?y.cell=m:y=f.source={cell:m}}null!=l&&y&&(y.port=l)}else null!=u&&(f.source=t.Point.create(u).toJSON());if(null!=c)if(t.Cell.isCell(c))f.target={cell:c.id};else if(g(c))f.target={cell:c};else if(t.Point.isPoint(c))f.target=c.toJSON();else if(Array.isArray(c))f.target={x:c[0],y:c[1]};else{v=c.cell;t.Cell.isCell(v)?f.target=r(r({},c),{cell:v.id}):f.target=c}if(null!=h||null!=p){y=f.target;if(null!=h){m=g(h)?h:h.id;y?y.cell=m:y=f.target={cell:m}}null!=p&&y&&(y.port=p)}else null!=d&&(f.target=t.Point.create(d).toJSON());return e.prototype.preprocess.call(this,f,o)},o.prototype.setup=function(){var t=this;e.prototype.setup.call(this),this.on("change:labels",(function(e){return t.onLabelsChanged(e)})),this.on("change:vertices",(function(e){return t.onVertexsChanged(e)}))},o.prototype.isEdge=function(){return!0},o.prototype.disconnect=function(t){return void 0===t&&(t={}),this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this},Object.defineProperty(o.prototype,"source",{get:function(){return this.getSource()},set:function(t){this.setSource(t)},enumerable:!1,configurable:!0}),o.prototype.getSource=function(){return this.getTerminal("source")},o.prototype.getSourceCellId=function(){return this.source.cell},o.prototype.getSourcePortId=function(){return this.source.port},o.prototype.setSource=function(t,e,n){return void 0===n&&(n={}),this.setTerminal("source",t,e,n)},Object.defineProperty(o.prototype,"target",{get:function(){return this.getTarget()},set:function(t){this.setTarget(t)},enumerable:!1,configurable:!0}),o.prototype.getTarget=function(){return this.getTerminal("target")},o.prototype.getTargetCellId=function(){return this.target.cell},o.prototype.getTargetPortId=function(){return this.target.port},o.prototype.setTarget=function(t,e,n){return void 0===n&&(n={}),this.setTerminal("target",t,e,n)},o.prototype.getTerminal=function(t){return r({},this.store.get(t))},o.prototype.setTerminal=function(e,n,r,i){if(void 0===i&&(i={}),t.Cell.isCell(n))return this.store.set(e,ro({},r,{cell:n.id}),i),this;var o=n;return t.Point.isPoint(n)||null!=o.x&&null!=o.y?(this.store.set(e,ro({},r,{x:o.x,y:o.y}),i),this):(this.store.set(e,zr(n),i),this)},o.prototype.getSourcePoint=function(){return this.getTerminalPoint("source")},o.prototype.getTargetPoint=function(){return this.getTerminalPoint("target")},o.prototype.getTerminalPoint=function(e){var n=this[e];if(t.Point.isPointLike(n))return t.Point.create(n);var r=this.getTerminalCell(e);return r?r.getConnectionPoint(this,e):new t.Point},o.prototype.getSourceCell=function(){return this.getTerminalCell("source")},o.prototype.getTargetCell=function(){return this.getTerminalCell("target")},o.prototype.getTerminalCell=function(t){if(this.model){var e="source"===t?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null},o.prototype.getSourceNode=function(){return this.getTerminalNode("source")},o.prototype.getTargetNode=function(){return this.getTerminalNode("target")},o.prototype.getTerminalNode=function(t){for(var e=this,n={};e&&e.isEdge();){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null},Object.defineProperty(o.prototype,"router",{get:function(){return this.getRouter()},set:function(t){null==t?this.removeRouter():this.setRouter(t)},enumerable:!1,configurable:!0}),o.prototype.getRouter=function(){return this.store.get("router")},o.prototype.setRouter=function(t,e,n){return"object"==typeof t?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this},o.prototype.removeRouter=function(t){return void 0===t&&(t={}),this.store.remove("router",t),this},Object.defineProperty(o.prototype,"connector",{get:function(){return this.getConnector()},set:function(t){null==t?this.removeConnector():this.setConnector(t)},enumerable:!1,configurable:!0}),o.prototype.getConnector=function(){return this.store.get("connector")},o.prototype.setConnector=function(t,e,n){return"object"==typeof t?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this},o.prototype.removeConnector=function(t){return void 0===t&&(t={}),this.store.remove("connector",t)},Object.defineProperty(o.prototype,"strategy",{get:function(){return this.getStrategy()},set:function(t){null==t?this.removeStrategy():this.setStrategy(t)},enumerable:!1,configurable:!0}),o.prototype.getStrategy=function(){return this.store.get("strategy")},o.prototype.setStrategy=function(t,e,n){return"object"==typeof t?this.store.set("strategy",t,e):this.store.set("strategy",{name:t,args:e},n),this},o.prototype.removeStrategy=function(t){return void 0===t&&(t={}),this.store.remove("strategy",t)},o.prototype.getDefaultLabel=function(){var t=this.constructor;return zr(this.store.get("defaultLabel")||t.defaultLabel||{})},Object.defineProperty(o.prototype,"labels",{get:function(){return this.getLabels()},set:function(t){this.setLabels(t)},enumerable:!1,configurable:!0}),o.prototype.getLabels=function(){var t=this;return s([],this.store.get("labels",[]),!0).map((function(e){return t.parseLabel(e)}))},o.prototype.setLabels=function(t,e){return void 0===e&&(e={}),this.store.set("labels",Array.isArray(t)?t:[t],e),this},o.prototype.insertLabel=function(t,e,n){void 0===n&&(n={});var r=this.getLabels(),i=r.length,o=null!=e&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(t)),this.setLabels(r,n)},o.prototype.appendLabel=function(t,e){return void 0===e&&(e={}),this.insertLabel(t,-1,e)},o.prototype.getLabelAt=function(t){var e=this.getLabels();return null!=t&&Number.isFinite(t)?this.parseLabel(e[t]):null},o.prototype.setLabelAt=function(t,e,n){if(void 0===n&&(n={}),null!=t&&Number.isFinite(t)){var r=this.getLabels();r[t]=this.parseLabel(e),this.setLabels(r,n)}return this},o.prototype.removeLabelAt=function(t,e){void 0===e&&(e={});var n=this.getLabels(),r=null!=t&&Number.isFinite(t)?t:-1,i=n.splice(r,1);return this.setLabels(n,e),i.length?i[0]:null},o.prototype.parseLabel=function(t){return"string"==typeof t?this.constructor.parseStringLabel(t):t},o.prototype.onLabelsChanged=function(t){var e=t.previous,n=t.current,r=e&&n?n.filter((function(t){return e.find((function(e){return t===e||Wi(t,e)}))?null:t})):n?s([],n,!0):[],i=e&&n?e.filter((function(t){return n.find((function(e){return t===e||Wi(t,e)}))?null:t})):e?s([],e,!0):[];r.length>0&&this.notify("labels:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})},Object.defineProperty(o.prototype,"vertexMarkup",{get:function(){return this.getVertexMarkup()},set:function(t){this.setVertexMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultVertexMarkup=function(){return this.store.get("defaultVertexMarkup")||t.Markup.getEdgeVertexMarkup()},o.prototype.getVertexMarkup=function(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()},o.prototype.setVertexMarkup=function(e,n){return void 0===n&&(n={}),this.store.set("vertexMarkup",t.Markup.clone(e),n),this},Object.defineProperty(o.prototype,"vertices",{get:function(){return this.getVertices()},set:function(t){this.setVertices(t)},enumerable:!1,configurable:!0}),o.prototype.getVertices=function(){return s([],this.store.get("vertices",[]),!0)},o.prototype.setVertices=function(e,n){void 0===n&&(n={});var r=Array.isArray(e)?e:[e];return this.store.set("vertices",r.map((function(e){return t.Point.toJSON(e)})),n),this},o.prototype.insertVertex=function(e,n,r){void 0===r&&(r={});var i=this.getVertices(),o=i.length,s=null!=n&&Number.isFinite(n)?n:o;return s<0&&(s=o+s+1),i.splice(s,0,t.Point.toJSON(e)),this.setVertices(i,r)},o.prototype.appendVertex=function(t,e){return void 0===e&&(e={}),this.insertVertex(t,-1,e)},o.prototype.getVertexAt=function(t){return null!=t&&Number.isFinite(t)?this.getVertices()[t]:null},o.prototype.setVertexAt=function(t,e,n){if(void 0===n&&(n={}),null!=t&&Number.isFinite(t)){var r=this.getVertices();r[t]=e,this.setVertices(r,n)}return this},o.prototype.removeVertexAt=function(t,e){void 0===e&&(e={});var n=this.getVertices(),r=null!=t&&Number.isFinite(t)?t:-1;return n.splice(r,1),this.setVertices(n,e)},o.prototype.onVertexsChanged=function(e){var n=e.previous,r=e.current,i=n&&r?r.filter((function(e){return n.find((function(n){return t.Point.equals(e,n)}))?null:e})):r?s([],r,!0):[],o=n&&r?n.filter((function(e){return r.find((function(n){return t.Point.equals(e,n)}))?null:e})):n?s([],n,!0):[];i.length>0&&this.notify("vertexs:added",{added:i,cell:this,edge:this}),o.length>0&&this.notify("vertexs:removed",{removed:o,cell:this,edge:this})},o.prototype.getDefaultMarkup=function(){return this.store.get("defaultMarkup")||t.Markup.getEdgeMarkup()},o.prototype.getMarkup=function(){return e.prototype.getMarkup.call(this)||this.getDefaultMarkup()},Object.defineProperty(o.prototype,"toolMarkup",{get:function(){return this.getToolMarkup()},set:function(t){this.setToolMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultToolMarkup=function(){return this.store.get("defaultToolMarkup")||t.Markup.getEdgeToolMarkup()},o.prototype.getToolMarkup=function(){return this.store.get("toolMarkup")||this.getDefaultToolMarkup()},o.prototype.setToolMarkup=function(t,e){return void 0===e&&(e={}),this.store.set("toolMarkup",t,e),this},Object.defineProperty(o.prototype,"doubleToolMarkup",{get:function(){return this.getDoubleToolMarkup()},set:function(t){this.setDoubleToolMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultDoubleToolMarkup=function(){return this.store.get("defaultDoubleToolMarkup")},o.prototype.getDoubleToolMarkup=function(){return this.store.get("doubleToolMarkup")||this.getDefaultDoubleToolMarkup()},o.prototype.setDoubleToolMarkup=function(t,e){return void 0===e&&(e={}),this.store.set("doubleToolMarkup",t,e),this},Object.defineProperty(o.prototype,"arrowheadMarkup",{get:function(){return this.getArrowheadMarkup()},set:function(t){this.setArrowheadMarkup(t)},enumerable:!1,configurable:!0}),o.prototype.getDefaultArrowheadMarkup=function(){return this.store.get("defaultArrowheadMarkup")||t.Markup.getEdgeArrowheadMarkup()},o.prototype.getArrowheadMarkup=function(){return this.store.get("arrowheadMarkup")||this.getDefaultArrowheadMarkup()},o.prototype.setArrowheadMarkup=function(t,e){return void 0===e&&(e={}),this.store.set("arrowheadMarkup",t,e),this},o.prototype.translate=function(t,e,n){return void 0===n&&(n={}),n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints((function(n){return{x:(n.x||0)+t,y:(n.y||0)+e}}),n)},o.prototype.scale=function(e,n,r,i){return void 0===i&&(i={}),this.applyToPoints((function(i){return t.Point.create(i).scale(e,n,r).toJSON()}),i)},o.prototype.applyToPoints=function(e,n){void 0===n&&(n={});var r={},i=this.getSource(),o=this.getTarget();t.Point.isPointLike(i)&&(r.source=e(i)),t.Point.isPointLike(o)&&(r.target=e(o));var s=this.getVertices();return s.length>0&&(r.vertices=s.map(e)),this.store.set(r,n),this},o.prototype.getBBox=function(){return this.getPolyline().bbox()},o.prototype.getConnectionPoint=function(){return this.getPolyline().pointAt(.5)},o.prototype.getPolyline=function(){var e=s(s([this.getSourcePoint()],this.getVertices().map((function(e){return t.Point.create(e)})),!0),[this.getTargetPoint()],!1);return new t.Polyline(e)},o.prototype.updateParent=function(e){var n=null,r=this.getSourceCell(),i=this.getTargetCell(),o=this.getParent();return r&&i&&(n=r===i||r.isDescendantOf(i)?i:i.isDescendantOf(r)?r:t.Cell.getCommonAncestor(r,i)),!o||n&&n.id===o.id||o.unembed(this,e),n&&n.embed(this,e),n},o.prototype.hasLoop=function(t){void 0===t&&(t={});var e=this.getSource(),n=this.getTarget(),r=e.cell,i=n.cell;if(!r||!i)return!1;var o=r===i;if(!o&&t.deep&&this._model){var s=this.getSourceCell(),a=this.getTargetCell();s&&a&&(o=s.isAncestorOf(a,t)||a.isAncestorOf(s,t))}return o},o.prototype.getFragmentAncestor=function(){var t=[this,this.getSourceNode(),this.getTargetNode()].filter((function(t){return null!=t}));return this.getCommonAncestor.apply(this,t)},o.prototype.isFragmentDescendantOf=function(t){var e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))},o.defaults={},o}(t.Cell),function(t){t.equalTerminals=function(t,e){var n=t,r=e;return n.cell===r.cell&&(n.port===r.port||null==n.port&&null==r.port)}}(t.Edge||(t.Edge={})),function(t){t.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},t.parseStringLabel=function(t){return{attrs:{label:{text:t}}}}}(t.Edge||(t.Edge={})),function(t){t.toStringTag="X6."+t.name,t.isEdge=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"==typeof r.isNode&&"function"==typeof r.isEdge&&"function"==typeof r.prop&&"function"==typeof r.attr&&"function"==typeof r.disconnect&&"function"==typeof r.getSource&&"function"==typeof r.getTarget}}(t.Edge||(t.Edge={})),function(t){t.registry=Ju.create({type:"edge",process:function(e,n){if(Yd.exist(e,!1))throw new Error("Edge with name '"+e+"' was registered by anthor Node");if("function"==typeof n)return n.config({shape:e}),n;var r=t,o=n.inherit,s=void 0===o?"edge":o,a=i(n,["inherit"]);if("string"==typeof s){var l=this.get(s||"edge");null==l&&s?this.onNotFound(s,"inherited"):r=l}else r=s;null==a.constructorName&&(a.constructorName=e);var u=r.define.call(r,a);return u.config({shape:e}),u}}),Yd.setEdgeRegistry(t.registry)}(t.Edge||(t.Edge={})),function(t){var e=0;t.define=function(n){var r,o=n.constructorName,s=n.overwrite,a=i(n,["constructorName","overwrite"]),l=Cs((r=o||a.shape)?Ts(r):"CustomEdge"+(e+=1),this);return l.config(a),a.shape&&t.registry.register(a.shape,l,s),l},t.create=function(e){var n=e.shape||"edge",r=t.registry.get(n);return r?new r(e):t.registry.onNotFound(n)}}(t.Edge||(t.Edge={})),function(e){var n="basic.edge";e.config({shape:n,propHooks:function(n){var r=n.label,o=n.vertices,s=i(n,["label","vertices"]);if(r){null==s.labels&&(s.labels=[]);var a="string"==typeof r?e.parseStringLabel(r):r;s.labels.push(a)}return o&&Array.isArray(o)&&(s.vertices=o.map((function(e){return t.Point.create(e).toJSON()}))),s}}),e.registry.register(n,e)}(t.Edge||(t.Edge={})),t.EdgeView=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.POINT_ROUNDING=2,t.markerCache={},t}return n(o,e),Object.defineProperty(o.prototype,Symbol.toStringTag,{get:function(){return o.toStringTag},enumerable:!1,configurable:!0}),o.prototype.getContainerClassName=function(){return[e.prototype.getContainerClassName.call(this),this.prefixClassName("edge")].join(" ")},Object.defineProperty(o.prototype,"sourceBBox",{get:function(){var e=this.sourceView;if(!e){var n=this.cell.getSource();return new t.Rectangle(n.x,n.y)}var r=this.sourceMagnet;return e.isEdgeElement(r)?new t.Rectangle(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(r||e.container)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"targetBBox",{get:function(){var e=this.targetView;if(!e){var n=this.cell.getTarget();return new t.Rectangle(n.x,n.y)}var r=this.targetMagnet;return e.isEdgeElement(r)?new t.Rectangle(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(r||e.container)},enumerable:!1,configurable:!0}),o.prototype.isEdgeView=function(){return!0},o.prototype.confirmUpdate=function(t,e){var n=this;void 0===e&&(e={});var r=t;if(this.hasAction(r,"source")){if(!this.updateTerminalProperties("source"))return r;r=this.removeAction(r,"source")}if(this.hasAction(r,"target")){if(!this.updateTerminalProperties("target"))return r;r=this.removeAction(r,"target")}var i=this.graph,o=this.sourceView,s=this.targetView;return i&&(o&&!i.renderer.isViewMounted(o)||s&&!i.renderer.isViewMounted(s))?r:this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","vertices","labels","tools","widget"])):(r=this.handleAction(r,"vertices",(function(){return n.renderVertexMarkers()})),r=this.handleAction(r,"update",(function(){return n.update(null,e)})),r=this.handleAction(r,"labels",(function(){return n.onLabelsChange(e)})),r=this.handleAction(r,"tools",(function(){n.renderTools(),n.updateToolsPosition()})),r=this.handleAction(r,"widget",(function(){return n.renderExternalTools()})))},o.prototype.onLabelsChange=function(t){void 0===t&&(t={}),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()},o.prototype.shouldRerenderLabels=function(t){void 0===t&&(t={});var e=this.cell.previous("labels");if(null==e)return!0;if("propertyPathArray"in t&&"propertyValue"in t){var n=t.propertyPathArray||[],r=n.length;if(r>1)if(e[n[1]]){if(2===r)return"object"==typeof t.propertyValue&&_i(t.propertyValue,"markup");if("markup"!==n[2])return!1}}return!0},o.prototype.render=function(){return this.empty(),this.containers={},this.renderMarkup(),this.renderLabels(),this.update(),this.renderExternalTools(),this},o.prototype.renderMarkup=function(){var t=this.cell.markup;if(t)return"string"==typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid edge markup.")},o.prototype.renderJSONMarkup=function(t){var e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)},o.prototype.renderStringMarkup=function(e){var n=this.containers,r=t.Vector.createVectors(e);r.forEach((function(t){var e=t.attr("class");e&&(n[jn(e)]=t.node)})),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),Sa(this.container,r.map((function(t){return t.node})))},o.prototype.renderLabels=function(){var t=this.cell,e=t.getLabels(),n=e.length,r=this.containers.labels;if(this.labelCache={},this.labelSelectors={},n<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=va("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.containers.labels=r);for(var i=0,o=e.length;i<o;i+=1){var s=e[i],a=this.normalizeLabelMarkup(this.parseLabelMarkup(s.markup)),l=void 0,u=void 0;if(a)l=a.node,u=a.selectors;else{var c=t.getDefaultLabel(),h=this.normalizeLabelMarkup(this.parseLabelMarkup(c.markup));l=h.node,u=h.selectors}l.setAttribute("data-index",""+i),r.appendChild(l);var p=this.rootSelector;if(u[p])throw new Error("Ambiguous label root selector.");u[p]=l,this.labelCache[i]=l,this.labelSelectors[i]=u}return null==r.parentNode&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this},o.prototype.parseLabelMarkup=function(t){return t?"string"==typeof t?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null},o.prototype.parseLabelStringMarkup=function(e){for(var n=t.Vector.createVectors(e),r=document.createDocumentFragment(),i=0,o=n.length;i<o;i+=1){var s=n[i].node;r.appendChild(s)}return{fragment:r,selectors:{}}},o.prototype.normalizeLabelMarkup=function(e){if(null!=e){var n,r=e.fragment;if(!(r instanceof DocumentFragment&&r.hasChildNodes()))throw new Error("Invalid label markup.");var i=r.childNodes;return(n=i.length>1||"G"!==i[0].nodeName.toUpperCase()?t.Vector.create("g").append(r):t.Vector.create(i[0])).addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:e.selectors}}},o.prototype.updateLabels=function(){if(this.containers.labels)for(var e=this.cell,n=e.labels,r=this.can("edgeLabelMovable"),i=e.getDefaultLabel(),o=0,s=n.length;o<s;o+=1){var a=this.labelCache[o],l=this.labelSelectors[o];a.setAttribute("cursor",r?"move":"default");var u=n[o],c=ro({},i.attrs,u.attrs);this.updateAttrs(a,c,{selectors:l,rootBBox:u.size?t.Rectangle.fromSize(u.size):void 0})}},o.prototype.mergeLabelAttrs=function(t,e,n){if(null===e)return null;if(void 0===e){if(null===n)return null;if(void 0===n)return;return t?n:ro({},n)}return t?ro({},n,e):void 0},o.prototype.customizeLabels=function(){if(this.containers.labels)for(var t=this.cell,e=t.labels,n=0,r=e.length;n<r;n+=1){var i=e[n],o=this.labelCache[n],s=this.labelSelectors[n];this.graph.hook.onEdgeLabelRendered({edge:t,label:i,container:o,selectors:s})}},o.prototype.renderTools=function(){var e=this.containers.tools;if(null==e)return this;var n=this.cell.toolMarkup,r=this.$(e).empty();if(t.Markup.isStringMarkup(n)){var i=Qo(n),o=t.Vector.create(i());if(r.append(o.node),this.toolCache=o.node,this.options.doubleTools){var s=void 0,a=this.cell.doubleToolMarkup;t.Markup.isStringMarkup(a)?(i=Qo(a),s=t.Vector.create(i())):s=o.clone(),r.append(s.node),this.tool2Cache=s.node}}return this},o.prototype.renderExternalTools=function(){var t=this.cell.getTools();return this.addTools(t),this},o.prototype.renderVertexMarkers=function(){var e=this.containers.vertices;if(null==e)return this;var n=this.cell.vertexMarkup,i=this.$(e).empty();if(t.Markup.isStringMarkup(n)){var o=Qo(n);this.cell.getVertices().forEach((function(e,n){i.append(t.Vector.create(o(r({index:n},e))).node)}))}return this},o.prototype.renderArrowheadMarkers=function(){var e=this.containers.arrowheads;if(null==e)return this;var n=this.cell.arrowheadMarkup,r=this.$(e).empty();if(t.Markup.isStringMarkup(n)){var i=Qo(n),o=t.Vector.create(i({end:"source"})).node,s=t.Vector.create(i({end:"target"})).node;this.containers.sourceArrowhead=o,this.containers.targetArrowhead=s,r.append(o,s)}return this},o.prototype.update=function(t,e){void 0===e&&(e={}),this.cleanCache(),this.updateConnection(e);var n=this.cell.getAttrs();return null!=n&&this.updateAttrs(this.container,n,{attrs:t===n?null:t,selectors:this.selectors}),this.updateConnectionPath(),this.updateLabelPositions(),this.updateToolsPosition(),this.updateArrowheadMarkers(),this.updateTools(e),this},o.prototype.removeRedundantLinearVertices=function(e){void 0===e&&(e={});var n=this.cell,r=n.getVertices(),i=s(s([this.sourceAnchor],r,!0),[this.targetAnchor],!1),o=i.length,a=new t.Polyline(i);a.simplify({threshold:.01});var l=a.points.map((function(t){return t.toJSON()})),u=l.length;return o===u?0:(n.setVertices(l.slice(1,u-1),e),o-u)},o.prototype.updateConnectionPath=function(){var t=this.containers;if(t.connection){var e=this.getConnectionPathData();t.connection.setAttribute("d",e)}if(t.connectionWrap){e=this.getConnectionPathData();t.connectionWrap.setAttribute("d",e)}t.sourceMarker&&t.targetMarker&&this.translateAndAutoOrientArrows(t.sourceMarker,t.targetMarker)},o.prototype.getTerminalView=function(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error("Unknown terminal type '"+t+"'")}},o.prototype.getTerminalAnchor=function(e){switch(e){case"source":return t.Point.create(this.sourceAnchor);case"target":return t.Point.create(this.targetAnchor);default:throw new Error("Unknown terminal type '"+e+"'")}},o.prototype.getTerminalConnectionPoint=function(e){switch(e){case"source":return t.Point.create(this.sourcePoint);case"target":return t.Point.create(this.targetPoint);default:throw new Error("Unknown terminal type '"+e+"'")}},o.prototype.getTerminalMagnet=function(t,e){switch(void 0===e&&(e={}),t){case"source":if(e.raw)return this.sourceMagnet;var n=this.sourceView;return n?this.sourceMagnet||n.container:null;case"target":if(e.raw)return this.targetMagnet;var r=this.targetView;return r?this.targetMagnet||r.container:null;default:throw new Error("Unknown terminal type '"+t+"'")}},o.prototype.updateConnection=function(e){void 0===e&&(e={});var n=this.cell;if(e.translateBy&&n.isFragmentDescendantOf(e.translateBy)){var r=e.tx||0,i=e.ty||0;this.routePoints=new t.Polyline(this.routePoints).translate(r,i).points,this.translateConnectionPoints(r,i),this.path.translate(r,i)}else{var o=n.getVertices(),s=this.findAnchors(o);this.sourceAnchor=s.source,this.targetAnchor=s.target,this.routePoints=this.findRoutePoints(o);var a=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=a.source,this.targetPoint=a.target;var l=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,l.source||this.sourcePoint,l.target||this.targetPoint)}this.cleanCache()},o.prototype.findAnchors=function(t){var e=this.cell,n=e.source,r=e.target,i=t[0],o=t[t.length-1];return r.priority&&!n.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)},o.prototype.findAnchorsOrdered=function(e,n,r,i){var o,s,a,l=this.cell,u=l[e],c=l[r],h=this.getTerminalView(e),p=this.getTerminalView(r),d=this.getTerminalMagnet(e),f=this.getTerminalMagnet(r);if(h){var g=void 0;g=n?t.Point.create(n):p?f:t.Point.create(c),s=this.getAnchor(u.anchor,h,d,g,e)}else s=t.Point.create(u);if(p){var v=t.Point.create(i||s);a=this.getAnchor(c.anchor,p,f,v,r)}else a=t.Point.isPointLike(c)?t.Point.create(c):new t.Point;return(o={})[e]=s,o[r]=a,o},o.prototype.getAnchor=function(e,n,r,i,o){var s,a=n.isEdgeElement(r),l=this.graph.options.connecting,u="string"==typeof e?{name:e}:e;if(!u){var c=a?("source"===o?l.sourceEdgeAnchor:l.targetEdgeAnchor)||l.edgeAnchor:("source"===o?l.sourceAnchor:l.targetAnchor)||l.anchor;u="string"==typeof c?{name:c}:c}if(!u)throw new Error("Anchor should be specified.");var h=u.name;if(a){if("function"!=typeof(p=Zp.registry.get(h)))return Zp.registry.onNotFound(h);s=Ws(p,this,n,r,i,u.args||{},o)}else{var p;if("function"!=typeof(p=Wp.registry.get(h)))return Wp.registry.onNotFound(h);s=Ws(p,this,n,r,i,u.args||{},o)}return s?s.round(this.POINT_ROUNDING):new t.Point},o.prototype.findRoutePoints=function(e){void 0===e&&(e=[]);var n,r=this.graph.options.connecting.router||zd.presets.normal,i=this.cell.getRouter()||r;if("function"==typeof i)n=Ws(i,this,e,{},this);else{var o="string"==typeof i?i:i.name,s="string"==typeof i?{}:i.args||{},a=o?zd.registry.get(o):zd.presets.normal;if("function"!=typeof a)return zd.registry.onNotFound(o);n=Ws(a,this,e,s,this)}return null==n?e.map((function(e){return t.Point.create(e)})):n.map((function(e){return t.Point.create(e)}))},o.prototype.findConnectionPoints=function(e,n,r){var i,o,s=this.cell,a=this.graph.options.connecting,l=s.getSource(),u=s.getTarget(),c=this.sourceView,h=this.targetView,p=e[0],d=e[e.length-1];if(c&&!c.isEdgeElement(this.sourceMagnet)){var f=this.sourceMagnet||c.container,g=p||r,v=new t.Line(g,n),y=l.connectionPoint||a.sourceConnectionPoint||a.connectionPoint;i=this.getConnectionPoint(y,c,f,v,"source")}else i=n;if(h&&!h.isEdgeElement(this.targetMagnet)){var m=this.targetMagnet||h.container,b=u.connectionPoint||a.targetConnectionPoint||a.connectionPoint,C=d||n,x=new t.Line(C,r);o=this.getConnectionPoint(b,h,m,x,"target")}else o=r;return{source:i,target:o}},o.prototype.getConnectionPoint=function(t,e,n,r,i){var o=r.end;if(null==t)return o;var s="string"==typeof t?t:t.name,a="string"==typeof t?{}:t.args,l=od.registry.get(s);if("function"!=typeof l)return od.registry.onNotFound(s);var u=Ws(l,this,r,e,n,a||{},i);return u?u.round(this.POINT_ROUNDING):o},o.prototype.updateMarkerAttr=function(t){var e,n=this.cell.getAttrs(),r="."+t+"-marker",i=n&&n[r];i&&this.updateAttrs(this.container,{},{attrs:(e={},e[r]=i,e),selectors:this.selectors})},o.prototype.findMarkerPoints=function(t,e,n){var r,i,o,s=this,a=function(t){for(var e=s.cell.getAttrs(),n=Object.keys(e),r=0,i=n.length;r<i;r+=1){var o=e[n[r]];if(o[t+"Marker"]||o[t+"-marker"]){var a=o.strokeWidth||o["stroke-width"];if(a)return parseFloat(a);break}}return null},l=t[0],u=t[t.length-1],c=this.containers.sourceMarker,h=this.containers.targetMarker,p=this.markerCache;if(c){if(this.updateMarkerAttr("source"),p.sourceBBox=p.sourceBBox||bu(c),p.sourceBBox.width>0){var d=Ou(c);r=e.clone().move(l||n,p.sourceBBox.width*d.sx*-1)}}else(o=a("source"))&&(r=e.clone().move(l||n,-o));if(h){if(this.updateMarkerAttr("target"),p.targetBBox=p.targetBBox||bu(h),p.targetBBox.width>0){d=Ou(h);i=n.clone().move(u||e,p.targetBBox.width*d.sx*-1)}}else(o=a("target"))&&(i=n.clone().move(u||e,-o));return p.sourcePoint=r||e.clone(),p.targetPoint=i||n.clone(),{source:r,target:i}},o.prototype.findPath=function(e,n,i){var o,s,a,l=this.cell.getConnector()||this.graph.options.connecting.connector;if("string"==typeof l?o=l:(o=l.name,s=l.args),o){var u=Ud.registry.get(o);if("function"!=typeof u)return Ud.registry.onNotFound(o);a=u}else a=Ud.presets.normal;var c=Ws(a,this,n,i,e,r(r({},s),{raw:!0}),this);return"string"==typeof c?t.Path.parse(c):c},o.prototype.translateConnectionPoints=function(t,e){var n=this.markerCache;n.sourcePoint&&n.sourcePoint.translate(t,e),n.targetPoint&&n.targetPoint.translate(t,e),this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e)},o.prototype.updateLabelPositions=function(){if(null==this.containers.labels)return this;if(!this.path)return this;var t=this.cell,e=t.getLabels();if(0===e.length)return this;for(var n=t.getDefaultLabel(),r=this.normalizeLabelPosition(n.position),i=0,o=e.length;i<o;i+=1){var s=e[i],a=this.normalizeLabelPosition(s.position),l=ro({},r,a),u=this.getLabelTransformationMatrix(l);this.labelCache[i].setAttribute("transform",lu(u))}return this},o.prototype.updateToolsPosition=function(){if(null==this.containers.tools)return this;var t="",e=this.options.toolsOffset,n=this.getConnectionLength();if(null!=n){n<this.options.shortLength&&(t="scale(.5)",e/=2);var r=this.getPointAtLength(e);if(null!=r&&Va(this.toolCache,"transform","translate("+r.x+","+r.y+") "+t),this.options.doubleTools&&n>=this.options.longLength){var i=this.options.doubleToolsOffset||e;null!=(r=this.getPointAtLength(n-i))&&Va(this.tool2Cache,"transform","translate("+r.x+","+r.y+") "+t),Va(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&Va(this.tool2Cache,"visibility","hidden")}return this},o.prototype.updateArrowheadMarkers=function(){var t=this.containers.arrowheads;if(null==t)return this;if("none"===t.style.display)return this;var e=this.containers.sourceArrowhead,n=this.containers.targetArrowhead;if(e&&n){var r=(this.getConnectionLength()||0)<this.options.shortLength?.5:1;Ou(e,r),Ou(n,r),this.translateAndAutoOrientArrows(e,n)}return this},o.prototype.updateTerminalProperties=function(t){var e=this.cell,n=this.graph,r=e[t],i=r&&r.cell,o=t+"View";if(!i)return this[o]=null,this.updateTerminalMagnet(t),!0;var s=n.getCellById(i);if(!s)throw new Error("Edge's "+t+' node with id "'+i+'" not exists');var a=s.findView(n);return!!a&&(this[o]=a,this.updateTerminalMagnet(t),!0)},o.prototype.updateTerminalMagnet=function(t){var e=t+"Magnet",n=this.getTerminalView(t);if(n){var r=n.getMagnetFromEdgeTerminal(this.cell[t]);r===n.container&&(r=null),this[e]=r}else this[e]=null},o.prototype.translateAndAutoOrientArrows=function(t,e){var n=this.routePoints;t&&Lu(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&Lu(e,this.targetPoint,n[n.length-1]||this.sourcePoint,this.graph.view.stage)},o.prototype.getLabelPositionAngle=function(t){var e=this.cell.getLabelAt(t);return e&&e.position&&"object"==typeof e.position&&e.position.angle||0},o.prototype.getLabelPositionArgs=function(t){var e=this.cell.getLabelAt(t);if(e&&e.position&&"object"==typeof e.position)return e.position.options},o.prototype.getDefaultLabelPositionArgs=function(){var t=this.cell.getDefaultLabel();if(t&&t.position&&"object"==typeof t.position)return t.position.options},o.prototype.mergeLabelPositionArgs=function(t,e){return null===t?null:void 0===t?null===e?null:e:ro({},e,t)},o.prototype.addLabel=function(t,e,n,r){var i,o,s,a=0;"number"!=typeof t?(i=t.x,o=t.y,"number"==typeof e?(a=e,s=n):s=e):(i=t,o=e,"number"==typeof n?(a=n,s=r):s=n);var l=this.getDefaultLabelPositionArgs(),u=s,c=this.mergeLabelPositionArgs(u,l),h={position:this.getLabelPosition(i,o,a,c)};return this.cell.insertLabel(h,-1,s),-1},o.prototype.addVertex=function(t,e,n){var r="number"!=typeof t,i=r?t.x:t,o=r?t.y:e,s=r?e:n,a={x:i,y:o},l=this.getVertexIndex(i,o);return this.cell.insertVertex(a,l,s),l},o.prototype.sendToken=function(e,n,r){var o,s,a,l,u="linear";"object"==typeof n?(o=n.duration,s=!0===n.reversed,a=n.selector,!1===n.rotate?l="":!0===n.rotate?l="auto":null!=n.rotate&&(l=""+n.rotate),n.timing&&(u=n.timing)):(o=n,s=!1,a=null);var c,h={dur:(o=o||1e3)+"ms",repeatCount:"1",calcMode:u,fill:"freeze"};if(l&&(h.rotate=l),s&&(h.keyPoints="1;0",h.keyTimes="0;1"),"object"==typeof n){n.duration,n.reversed,n.selector,n.rotate,n.timing;var p=i(n,["duration","reversed","selector","rotate","timing"]);Object.keys(p).forEach((function(t){h[t]=p[t]}))}if(!((c="string"==typeof a?this.findOne(a,this.container,this.selectors):this.containers.connection?this.containers.connection:this.container.querySelector("path"))instanceof SVGPathElement))throw new Error("Token animation requires a valid connection path.");var d="string"==typeof e?this.findOne(e):e;if(null==d)throw new Error("Token animation requires a valid token element.");var f=d.parentNode,g=function(){f||Ea(d)},v=t.Vector.create(d);f||v.appendTo(this.graph.view.stage);var y=h.complete;h.complete=function(t){g(),r&&r(),y&&y(t)};var m=v.animateAlongPath(h,c);return function(){g(),m()}},o.prototype.getConnection=function(){return null!=this.path?this.path.clone():null},o.prototype.getConnectionPathData=function(){if(null==this.path)return"";var t=this.cache.pathCache;return _i(t,"data")||(t.data=this.path.serialize()),t.data||""},o.prototype.getConnectionSubdivisions=function(){if(null==this.path)return null;var t=this.cache.pathCache;return _i(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions},o.prototype.getConnectionLength=function(){if(null==this.path)return 0;var t=this.cache.pathCache;return _i(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length},o.prototype.getPointAtLength=function(t){return null==this.path?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})},o.prototype.getPointAtRatio=function(t){return null==this.path?null:(_s(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))},o.prototype.getTangentAtLength=function(t){return null==this.path?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})},o.prototype.getTangentAtRatio=function(t){return null==this.path?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})},o.prototype.getClosestPoint=function(t){return null==this.path?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})},o.prototype.getClosestPointLength=function(t){return null==this.path?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})},o.prototype.getClosestPointRatio=function(t){return null==this.path?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})},o.prototype.getLabelPosition=function(e,n,r,i){var o,s={distance:0},a=0;"number"==typeof r?(a=r,o=i):o=r,null!=o&&(s.options=o);var l,u,c=o&&o.absoluteOffset,h=!(o&&o.absoluteDistance),p=o&&o.absoluteDistance&&o.reverseDistance,d=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},g=new t.Point(e,n),v=d.closestPointT(g,f),y=this.getConnectionLength()||0,m=d.lengthAtT(v,f);if(h&&(m=y>0?m/y:0),p&&(m=-1*(y-m)||1),s.distance=m,c||(l=d.tangentAtT(v)),l)u=l.pointOffset(g);else{var b=d.pointAtT(v),C=g.diff(b);u={x:C.x,y:C.y}}return s.offset=u,s.angle=a,s},o.prototype.normalizeLabelPosition=function(t){return"number"==typeof t?{distance:t}:t},o.prototype.getLabelTransformationMatrix=function(e){var n=this.normalizeLabelPosition(e),r=n.options||{},i=n.angle||0,o=n.distance,s=o>0&&o<=1,a=0,l={x:0,y:0},u=n.offset;u&&("number"==typeof u?a=u:(null!=u.x&&(l.x=u.x),null!=u.y&&(l.y=u.y)));var c,h=0!==l.x||0!==l.y||0===a,p=r.keepGradient,d=r.ensureLegibility,f=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},v=s?o*this.getConnectionLength():o,y=f.tangentAtLength(v,g),m=i;if(y){if(h)(c=y.start).translate(l);else{var b=y.clone();b.rotate(-90,y.start),b.setLength(a),c=b.end}p&&(m=y.angle()+i,d&&(m=t.Angle.normalize((m+90)%180-90)))}else c=f.start,h&&c.translate(l);return ou().translate(c.x,c.y).rotate(m)},o.prototype.getLabelCoordinates=function(e){var n=this.getLabelTransformationMatrix(e);return new t.Point(n.e,n.f)},o.prototype.getVertexIndex=function(e,n){var r=this.cell.getVertices(),i=this.getClosestPointLength(new t.Point(e,n)),o=0;if(null!=i)for(var s=r.length;o<s;o+=1){var a=r[o],l=this.getClosestPointLength(a);if(null!=l&&i<l)break}return o},o.prototype.getEventArgs=function(t,e,n){var r=this,i=r.cell;return null==e||null==n?{e:t,view:r,edge:i,cell:i}:{e:t,x:e,y:n,view:r,edge:i,cell:i}},o.prototype.notifyUnhandledMouseDown=function(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})},o.prototype.notifyMouseDown=function(t,n,r){e.prototype.onMouseDown.call(this,t,n,r),this.notify("edge:mousedown",this.getEventArgs(t,n,r))},o.prototype.notifyMouseMove=function(t,n,r){e.prototype.onMouseMove.call(this,t,n,r),this.notify("edge:mousemove",this.getEventArgs(t,n,r))},o.prototype.notifyMouseUp=function(t,n,r){e.prototype.onMouseUp.call(this,t,n,r),this.notify("edge:mouseup",this.getEventArgs(t,n,r))},o.prototype.onClick=function(t,n,r){e.prototype.onClick.call(this,t,n,r),this.notify("edge:click",this.getEventArgs(t,n,r))},o.prototype.onDblClick=function(t,n,r){e.prototype.onDblClick.call(this,t,n,r),this.notify("edge:dblclick",this.getEventArgs(t,n,r))},o.prototype.onContextMenu=function(t,n,r){e.prototype.onContextMenu.call(this,t,n,r),this.notify("edge:contextmenu",this.getEventArgs(t,n,r))},o.prototype.onMouseDown=function(t,e,n){switch(this.notifyMouseDown(t,e,n),t.target.getAttribute("class")){case"vertex":return void this.startVertexDragging(t,e,n);case"vertex-remove":case"vertex-remove-area":return void this.handleVertexRemoving(t,e,n);case"connection":case"connection-wrap":return void this.handleVertexAdding(t,e,n);case"arrowhead":return void this.startArrowheadDragging(t,e,n);case"source-marker":case"target-marker":return void this.notifyUnhandledMouseDown(t,e,n)}this.startEdgeDragging(t,e,n)},o.prototype.onMouseMove=function(t,e,n){var r=this.getEventData(t);switch(r.action){case"drag-vertex":this.dragVertex(t,e,n);break;case"drag-label":this.dragLabel(t,e,n);break;case"drag-arrowhead":this.dragArrowhead(t,e,n);break;case"drag-edge":this.dragEdge(t,e,n)}return this.notifyMouseMove(t,e,n),r},o.prototype.onMouseUp=function(t,e,n){var r=this.getEventData(t);switch(r.action){case"drag-vertex":this.stopVertexDragging(t,e,n);break;case"drag-label":this.stopLabelDragging(t,e,n);break;case"drag-arrowhead":this.stopArrowheadDragging(t,e,n);break;case"drag-edge":this.stopEdgeDragging(t,e,n)}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),r},o.prototype.onMouseOver=function(t){e.prototype.onMouseOver.call(this,t),this.notify("edge:mouseover",this.getEventArgs(t))},o.prototype.onMouseOut=function(t){e.prototype.onMouseOut.call(this,t),this.notify("edge:mouseout",this.getEventArgs(t))},o.prototype.onMouseEnter=function(t){e.prototype.onMouseEnter.call(this,t),this.notify("edge:mouseenter",this.getEventArgs(t))},o.prototype.onMouseLeave=function(t){e.prototype.onMouseLeave.call(this,t),this.notify("edge:mouseleave",this.getEventArgs(t))},o.prototype.onMouseWheel=function(t,n,i,o){e.prototype.onMouseWheel.call(this,t,n,i,o),this.notify("edge:mousewheel",r({delta:o},this.getEventArgs(t,n,i)))},o.prototype.onCustomEvent=function(t,n,i,o){if(Pa(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===n)return void this.cell.remove({ui:!0});this.notify("edge:customevent",r({name:n},this.getEventArgs(t,i,o)))}this.notifyMouseDown(t,i,o)}else this.notify("edge:customevent",r({name:n},this.getEventArgs(t,i,o))),e.prototype.onCustomEvent.call(this,t,n,i,o)},o.prototype.onLabelMouseDown=function(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n),this.getEventData(t).stopPropagation&&t.stopPropagation()},o.prototype.startEdgeDragging=function(t,e,n){this.can("edgeMovable")?this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"}):this.notifyUnhandledMouseDown(t,e,n)},o.prototype.dragEdge=function(t,e,n){var r=this.getEventData(t);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-r.x,n-r.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})},o.prototype.stopEdgeDragging=function(t,e,n){var r=this.getEventData(t);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),r.moving=!1},o.prototype.prepareArrowheadDragging=function(t,e){var n=this.getTerminalMagnet(t),r={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:!0===e.isNewEdge,terminalType:t,initialMagnet:n,initialTerminal:Fr(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(r),r},o.prototype.createValidateConnectionArgs=function(t){var e,n=[];n[4]=t,n[5]=this;var r=0,i=0;"source"===t?(r=2,e="target"):(i=2,e="source");var o=this.cell[e],s=o.cell;if(s){var a=void 0,l=n[r]=this.graph.renderer.findViewByCell(s);l&&(a=l.getMagnetFromEdgeTerminal(o))===l.container&&(a=void 0),n[r+1]=a}return function(t,e){return n[i]=t,n[i+1]=t.container===e?void 0:e,n}},o.prototype.beforeArrowheadDragging=function(t){t.zIndex=this.cell.zIndex,this.cell.toFront();var e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)},o.prototype.afterArrowheadDragging=function(t){null!=t.zIndex&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null),this.container.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)},o.prototype.arrowheadDragging=function(t,e,n,i){var o;i.x=e,i.y=n,i.currentTarget!==t&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.renderer.findViewByElem(t),i.currentView?(i.currentMagnet=i.currentView.findMagnet(t),i.currentMagnet&&(o=this.graph.hook).validateConnection.apply(o,s(s([],i.getValidateConnectionArgs(i.currentView,i.currentMagnet),!1),[i.currentView.getEdgeTerminal(i.currentMagnet,e,n,this.cell,i.terminalType)],!1))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=t,this.cell.prop(i.terminalType,{x:e,y:n},r(r({},i.options),{ui:!0}))},o.prototype.arrowheadDragged=function(t,e,n){var r=t.currentView,i=t.currentMagnet;if(i&&r){r.unhighlight(i,{type:"magnetAdsorbed"});var o=t.terminalType,s=r.getEdgeTerminal(i,e,n,this.cell,o);this.cell.setTerminal(o,s,{ui:!0})}},o.prototype.snapArrowhead=function(e,n,i){var o=this,a=this.graph,l=a.options.connecting,u=l.snap,c=l.allowEdge,h="object"==typeof u&&u.radius||50,p={x:e-h,y:n-h,width:2*h,height:2*h},d=a.renderer.findViewsInArea(p);if(c){var f=a.renderer.findEdgeViewsInArea(p).filter((function(t){return t!==o}));d.push.apply(d,f)}var g,v=i.closestView||null,y=i.closestMagnet||null;i.closestView=null,i.closestMagnet=null;var m,b=Number.MAX_SAFE_INTEGER,C=new t.Point(e,n);d.forEach((function(t){var r;"false"!==t.container.getAttribute("magnet")&&(g=t.cell.getBBox().getCenter().distance(C))<h&&g<b&&(y===t.container||(r=a.hook).validateConnection.apply(r,s(s([],i.getValidateConnectionArgs(t,null),!1),[t.getEdgeTerminal(t.container,e,n,o.cell,i.terminalType)],!1)))&&(b=g,i.closestView=t,i.closestMagnet=t.container),t.container.querySelectorAll("[magnet]").forEach((function(r){var l;if("false"!==r.getAttribute("magnet")){var u=t.getBBoxOfElement(r);(g=C.distance(u.getCenter()))<h&&g<b&&(y===r||(l=a.hook).validateConnection.apply(l,s(s([],i.getValidateConnectionArgs(t,r),!1),[t.getEdgeTerminal(r,e,n,o.cell,i.terminalType)],!1)))&&(b=g,i.closestView=t,i.closestMagnet=r)}}))}));var x=i.terminalType,w=i.closestView,P=i.closestMagnet,A=y!==P;if(v&&A&&v.unhighlight(y,{type:"magnetAdsorbed"}),w){if(!A)return;w.highlight(P,{type:"magnetAdsorbed"}),m=w.getEdgeTerminal(P,e,n,this.cell,x)}else m={x:e,y:n};this.cell.setTerminal(x,m,{},r(r({},i.options),{ui:!0}))},o.prototype.snapArrowheadEnd=function(t){var e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null},o.prototype.finishEmbedding=function(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)},o.prototype.fallbackConnection=function(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0})}},o.prototype.notifyConnectionEvent=function(e,n){var r=e.terminalType,i=e.initialTerminal,o=this.cell[r];if(o&&!t.Edge.equalTerminals(i,o)){var s=this.graph,a=i,l=a.cell?s.getCellById(a.cell):null,u=a.port,c=l?s.findViewByCell(l):null,h=l||e.isNewEdge?null:t.Point.create(i).toJSON(),p=o,d=p.cell?s.getCellById(p.cell):null,f=p.port,g=d?s.findViewByCell(d):null,v=d?null:t.Point.create(o).toJSON();this.notify("edge:connected",{e:n,previousCell:l,previousPort:u,previousView:c,previousPoint:h,currentCell:d,currentView:g,currentPort:f,currentPoint:v,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:r,isNew:e.isNewEdge})}},o.prototype.highlightAvailableMagnets=function(t){var e=this,n=this.graph,r=n.model.getCells();t.marked={};for(var i=function(i,o){var a=n.renderer.findViewByCell(r[i]);if(!a)return"continue";var l=Array.prototype.slice.call(a.container.querySelectorAll("[magnet]"));"false"!==a.container.getAttribute("magnet")&&l.push(a.container);var u=l.filter((function(r){var i;return(i=n.hook).validateConnection.apply(i,s(s([],t.getValidateConnectionArgs(a,r),!1),[a.getEdgeTerminal(r,t.x,t.y,e.cell,t.terminalType)],!1))}));if(u.length>0){for(var c=0,h=u.length;c<h;c+=1)a.highlight(u[c],{type:"magnetAvailable"});a.highlight(null,{type:"nodeAvailable"}),t.marked[a.cell.id]=u}},o=0,a=r.length;o<a;o+=1)i(o)},o.prototype.unhighlightAvailableMagnets=function(t){var e=this,n=t.marked||{};Object.keys(n).forEach((function(t){var r=e.graph.renderer.findViewByCell(t);r&&(n[t].forEach((function(t){r.unhighlight(t,{type:"magnetAvailable"})})),r.unhighlight(null,{type:"nodeAvailable"}))})),t.marked=null},o.prototype.startArrowheadDragging=function(t,e,n){if(this.can("arrowheadMovable")){var r=t.target.getAttribute("data-terminal"),i=this.prepareArrowheadDragging(r,{x:e,y:n});this.setEventData(t,i)}else this.notifyUnhandledMouseDown(t,e,n)},o.prototype.dragArrowhead=function(t,e,n){var r=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,r):this.arrowheadDragging(this.getEventTarget(t),e,n,r)},o.prototype.stopArrowheadDragging=function(t,e,n){var r=this.graph,i=this.getEventData(t);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,e,n),r.hook.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,t)):this.fallbackConnection(i),this.afterArrowheadDragging(i)},o.prototype.startLabelDragging=function(t,e,n){if(this.can("edgeLabelMovable")){var r=t.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),s=this.getLabelPositionArgs(i),a=this.getDefaultLabelPositionArgs(),l=this.mergeLabelPositionArgs(s,a);this.setEventData(t,{index:i,positionAngle:o,positionArgs:l,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)},o.prototype.dragLabel=function(t,e,n){var r=this.getEventData(t),i=this.cell.getLabelAt(r.index),o=ro({},i,{position:this.getLabelPosition(e,n,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)},o.prototype.stopLabelDragging=function(t,e,n){},o.prototype.handleVertexAdding=function(t,e,n){if(this.can("vertexAddable")){var r=this.addVertex({x:e,y:n},{ui:!0});this.setEventData(t,{index:r,action:"drag-vertex"})}else this.notifyUnhandledMouseDown(t,e,n)},o.prototype.handleVertexRemoving=function(t,e,n){if(this.can("vertexDeletable")){var r=t.target,i=parseInt(r.getAttribute("idx"),10);this.cell.removeVertexAt(i)}else this.notifyUnhandledMouseDown(t,e,n)},o.prototype.startVertexDragging=function(t,e,n){if(this.can("vertexMovable")){var r=t.target,i=parseInt(r.getAttribute("idx"),10);this.setEventData(t,{index:i,action:"drag-vertex"})}else this.notifyUnhandledMouseDown(t,e,n)},o.prototype.dragVertex=function(t,e,n){var r=this.getEventData(t);this.cell.setVertexAt(r.index,{x:e,y:n},{ui:!0})},o.prototype.stopVertexDragging=function(t,e,n){},o}(t.CellView),(nf=t.EdgeView||(t.EdgeView={})).toStringTag="X6."+nf.name,nf.isEdgeView=function(t){if(null==t)return!1;if(t instanceof nf)return!0;var e=t[Symbol.toStringTag],n=t;return(null==e||e===nf.toStringTag)&&"function"==typeof n.isNodeView&&"function"==typeof n.isEdgeView&&"function"==typeof n.confirmUpdate&&"function"==typeof n.update&&"function"==typeof n.getConnection},t.EdgeView.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],vertices:["vertices","update"],vertexMarkup:["vertices"],toolMarkup:["tools"],tools:["widget"]},shortLength:105,longLength:155,toolsOffset:40,doubleTools:!1,doubleToolsOffset:65,sampleInterval:50}),t.EdgeView.registry.register("edge",t.EdgeView,!0),t.NodeView=function(e){function i(){var n=null!==e&&e.apply(this,arguments)||this;return n.scalableNode=null,n.rotatableNode=null,n.scalableSelector="scalable",n.rotatableSelector="rotatable",n.defaultPortMarkup=t.Markup.getPortMarkup(),n.defaultPortLabelMarkup=t.Markup.getPortLabelMarkup(),n.defaultPortContainerMarkup=t.Markup.getPortContainerMarkup(),n.portsCache={},n}return n(i,e),Object.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return i.toStringTag},enumerable:!1,configurable:!0}),i.prototype.getContainerClassName=function(){var t=[e.prototype.getContainerClassName.call(this),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")},i.prototype.updateClassName=function(t){var e=t.target;if(e.hasAttribute("magnet")){var n=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?sa(e,n):oa(e,n)}else{n=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(n):this.addClass(n)}},i.prototype.isNodeView=function(){return!0},i.prototype.confirmUpdate=function(t,e){var n=this;void 0===e&&(e={});var r=t;return this.hasAction(r,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","resize","translate","rotate","ports","tools"])):(r=this.handleAction(r,"resize",(function(){return n.resize(e)}),"update"),r=this.handleAction(r,"update",(function(){return n.update()}),Sh.useCSSSelector?"ports":null),r=this.handleAction(r,"translate",(function(){return n.translate()})),r=this.handleAction(r,"rotate",(function(){return n.rotate()})),r=this.handleAction(r,"ports",(function(){return n.renderPorts()})),r=this.handleAction(r,"tools",(function(){return n.renderTools()}))),r},i.prototype.update=function(e){this.cleanCache(),Sh.useCSSSelector&&this.removePorts();var n=this.cell,r=n.getSize(),i=n.getAttrs();this.updateAttrs(this.container,i,{attrs:e===i?null:e,rootBBox:new t.Rectangle(0,0,r.width,r.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),Sh.useCSSSelector&&this.renderPorts()},i.prototype.renderMarkup=function(){var t=this.cell.markup;if(t)return"string"==typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid node markup.")},i.prototype.renderJSONMarkup=function(t){var e=this.parseJSONMarkup(t,this.container),n=function(t){return Array.isArray(t)?t[0]:t};this.selectors=e.selectors,this.rotatableNode=n(this.selectors[this.rotatableSelector]),this.scalableNode=n(this.selectors[this.scalableSelector]),this.container.appendChild(e.fragment)},i.prototype.renderStringMarkup=function(e){Sa(this.container,t.Vector.toNodes(t.Vector.createVectors(e))),this.rotatableNode=wa(this.container,"."+this.rotatableSelector),this.scalableNode=wa(this.container,"."+this.scalableSelector),this.selectors={},this.rootSelector&&(this.selectors[this.rootSelector]=this.container)},i.prototype.render=function(){return this.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate()):this.updateTransform(),Sh.useCSSSelector||this.renderPorts(),this.renderTools(),this},i.prototype.resize=function(t){if(void 0===t&&(t={}),this.scalableNode)return this.updateSize(t);this.cell.getAngle()&&this.rotate(),this.update()},i.prototype.translate=function(){if(this.rotatableNode)return this.updateTranslation();this.updateTransform()},i.prototype.rotate=function(){if(this.rotatableNode)return this.updateRotation(),void this.update();this.updateTransform()},i.prototype.getTranslationString=function(){var t=this.cell.getPosition();return"translate("+t.x+","+t.y+")"},i.prototype.getRotationString=function(){var t=this.cell.getAngle();if(t){var e=this.cell.getSize();return"rotate("+t+","+e.width/2+","+e.height/2+")"}},i.prototype.updateTransform=function(){var t=this.getTranslationString(),e=this.getRotationString();e&&(t+=" "+e),this.container.setAttribute("transform",t)},i.prototype.updateRotation=function(){if(null!=this.rotatableNode){var t=this.getRotationString();null!=t?this.rotatableNode.setAttribute("transform",t):this.rotatableNode.removeAttribute("transform")}},i.prototype.updateTranslation=function(){this.container.setAttribute("transform",this.getTranslationString())},i.prototype.updateSize=function(t){void 0===t&&(t={});var e=this.cell,n=e.getSize(),i=e.getAngle(),o=this.scalableNode,s=!1;o.getElementsByTagName("path").length>0&&(s=!0);var a=bu(o,{recursive:s}),l=n.width/(a.width||1),u=n.height/(a.height||1);o.setAttribute("transform","scale("+l+","+u+")");var c=this.rotatableNode;if(null!=c){var h=c.getAttribute("transform");if(h){c.setAttribute("transform",h+" rotate("+-i+","+n.width/2+","+n.height/2+")");var p=bu(o,{target:this.graph.view.stage});e.prop("position",{x:p.x,y:p.y},r({updated:!0},t)),this.translate(),this.rotate()}}this.update()},i.prototype.findPortElem=function(t,e){var n=t?this.portsCache[t]:null;if(!n)return null;var r=n.portContentElement,i=n.portContentSelectors||{};return this.findOne(e,r,i)},i.prototype.initializePorts=function(){this.cleanPortsCache()},i.prototype.refreshPorts=function(){this.removePorts(),this.cleanPortsCache(),this.renderPorts()},i.prototype.cleanPortsCache=function(){this.portsCache={}},i.prototype.removePorts=function(){var t=this;Object.keys(this.portsCache).forEach((function(e){Ea(t.portsCache[e].portElement)}))},i.prototype.renderPorts=function(){var t=this,e=this.getPortsContainer(),n=[];e.childNodes.forEach((function(t){n.push(t)}));var r=Vi(this.cell.getParsedPorts(),"zIndex"),i="auto";r.auto&&r.auto.forEach((function(r){var i=t.getPortElement(r);e.append(i),n.push(i)})),Object.keys(r).forEach((function(e){if(e!==i){var o=parseInt(e,10);t.appendPorts(r[e],o,n)}})),this.updatePorts()},i.prototype.getPortsContainer=function(){return this.rotatableNode||this.container},i.prototype.appendPorts=function(t,e,n){var r=this,i=t.map((function(t){return r.getPortElement(t)}));n[e]||e<0?Ta(n[Math.max(e,0)],i):Sa(this.getPortsContainer(),i)},i.prototype.getPortElement=function(t){var e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)},i.prototype.createPortElement=function(e){var n=t.Markup.renderMarkup(this.getPortContainerMarkup()),i=n.elem;if(null==i)throw new Error("Invalid port container markup.");var o=(n=t.Markup.renderMarkup(this.getPortMarkup(e))).elem,s=n.selectors;if(null==o)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},o);var a,l=(n=t.Markup.renderMarkup(this.getPortLabelMarkup(e.label))).elem,u=n.selectors;if(null==l)throw new Error("Invalid port label markup.");if(s&&u){for(var c in u)if(s[c]&&c!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=r(r({},s),u)}else a=s||u;var h="x6-port";return e.group&&(h+=" x6-port-"+e.group),oa(i,h),oa(o,"x6-port-body"),oa(l,"x6-port-label"),i.appendChild(o),i.appendChild(l),this.portsCache[e.id]={portElement:i,portSelectors:a,portLabelElement:l,portLabelSelectors:u,portContentElement:o,portContentSelectors:s},this.graph.hook.onPortRendered({port:e,node:this.cell,container:i,selectors:a,labelContainer:l,labelSelectors:u,contentContainer:o,contentSelectors:s}),i},i.prototype.updatePorts=function(){var t=this;this.updatePortGroup();var e=this.cell.getParsedGroups();Object.keys(e).forEach((function(e){return t.updatePortGroup(e)}))},i.prototype.updatePortGroup=function(e){for(var n=t.Rectangle.fromSize(this.cell.getSize()),r=this.cell.getPortsLayoutByGroup(e,n),i=0,o=r.length;i<o;i+=1){var s=r[i],a=s.portId,l=this.portsCache[a]||{},u=s.portLayout;if(this.applyPortTransform(l.portElement,u),null!=s.portAttrs){var c={selectors:l.portSelectors||{}};s.portSize&&(c.rootBBox=t.Rectangle.fromSize(s.portSize)),this.updateAttrs(l.portElement,s.portAttrs,c)}var h=s.labelLayout;if(h&&(this.applyPortTransform(l.portLabelElement,h,-(u.angle||0)),h.attrs)){c={selectors:l.portLabelSelectors||{}};s.labelSize&&(c.rootBBox=t.Rectangle.fromSize(s.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,c)}}},i.prototype.applyPortTransform=function(t,e,n){void 0===n&&(n=0);var r=e.angle,i=e.position;Tu(t,ou().rotate(n).translate(i.x||0,i.y||0).rotate(r||0),{absolute:!0})},i.prototype.getPortContainerMarkup=function(){return this.cell.getPortContainerMarkup()||this.defaultPortContainerMarkup},i.prototype.getPortMarkup=function(t){return t.markup||this.cell.portMarkup||this.defaultPortMarkup},i.prototype.getPortLabelMarkup=function(t){return t.markup||this.cell.portLabelMarkup||this.defaultPortLabelMarkup},i.prototype.getEventArgs=function(t,e,n){var r=this,i=r.cell;return null==e||null==n?{e:t,view:r,node:i,cell:i}:{e:t,x:e,y:n,view:r,node:i,cell:i}},i.prototype.notifyMouseDown=function(t,n,r){e.prototype.onMouseDown.call(this,t,n,r),this.notify("node:mousedown",this.getEventArgs(t,n,r))},i.prototype.notifyMouseMove=function(t,n,r){e.prototype.onMouseMove.call(this,t,n,r),this.notify("node:mousemove",this.getEventArgs(t,n,r))},i.prototype.notifyMouseUp=function(t,n,r){e.prototype.onMouseUp.call(this,t,n,r),this.notify("node:mouseup",this.getEventArgs(t,n,r))},i.prototype.onClick=function(t,n,r){e.prototype.onClick.call(this,t,n,r),this.notify("node:click",this.getEventArgs(t,n,r))},i.prototype.onDblClick=function(t,n,r){e.prototype.onDblClick.call(this,t,n,r),this.notify("node:dblclick",this.getEventArgs(t,n,r))},i.prototype.onContextMenu=function(t,n,r){e.prototype.onContextMenu.call(this,t,n,r),this.notify("node:contextmenu",this.getEventArgs(t,n,r))},i.prototype.onMouseDown=function(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.startNodeDragging(t,e,n))},i.prototype.onMouseMove=function(t,e,n){var r=this.getEventData(t),i=r.action;if("magnet"===i)this.dragMagnet(t,e,n);else{if("move"===i){var o=r.targetView||this;o.dragNode(t,e,n),o.notify("node:moving",{e:t,x:e,y:n,view:o,cell:o.cell,node:o.cell})}this.notifyMouseMove(t,e,n)}this.setEventData(t,r)},i.prototype.onMouseUp=function(t,e,n){var r=this.getEventData(t),i=r.action;"magnet"===i?this.stopMagnetDragging(t,e,n):(this.notifyMouseUp(t,e,n),"move"===i&&(r.targetView||this).stopNodeDragging(t,e,n));var o=r.targetMagnet;o&&this.onMagnetClick(t,o,e,n),this.checkMouseleave(t)},i.prototype.onMouseOver=function(t){e.prototype.onMouseOver.call(this,t),this.notify("node:mouseover",this.getEventArgs(t))},i.prototype.onMouseOut=function(t){e.prototype.onMouseOut.call(this,t),this.notify("node:mouseout",this.getEventArgs(t))},i.prototype.onMouseEnter=function(t){this.updateClassName(t),e.prototype.onMouseEnter.call(this,t),this.notify("node:mouseenter",this.getEventArgs(t))},i.prototype.onMouseLeave=function(t){e.prototype.onMouseLeave.call(this,t),this.notify("node:mouseleave",this.getEventArgs(t))},i.prototype.onMouseWheel=function(t,n,i,o){e.prototype.onMouseWheel.call(this,t,n,i,o),this.notify("node:mousewheel",r({delta:o},this.getEventArgs(t,n,i)))},i.prototype.onMagnetClick=function(t,e,n,i){this.graph.view.getMouseMovedCount(t)>this.graph.options.clickThreshold||this.notify("node:magnet:click",r({magnet:e},this.getEventArgs(t,n,i)))},i.prototype.onMagnetDblClick=function(t,e,n,i){this.notify("node:magnet:dblclick",r({magnet:e},this.getEventArgs(t,n,i)))},i.prototype.onMagnetContextMenu=function(t,e,n,i){this.notify("node:magnet:contextmenu",r({magnet:e},this.getEventArgs(t,n,i)))},i.prototype.onMagnetMouseDown=function(t,e,n,r){this.startMagnetDragging(t,n,r)},i.prototype.onCustomEvent=function(t,n,i,o){this.notify("node:customevent",r({name:n},this.getEventArgs(t,i,o))),e.prototype.onCustomEvent.call(this,t,n,i,o)},i.prototype.prepareEmbedding=function(t){var e=this.getEventData(t).cell||this.cell,n=this.graph.findViewByCell(e),r=this.graph.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:e,view:n,cell:e,x:r.x,y:r.y,currentParent:e.getParent()})},i.prototype.processEmbedding=function(e,n){var r=this,i=n.cell||this.cell,o=n.graph||this.graph,s=o.options.embedding,a=s.findParent,l="function"==typeof a?Ws(a,o,{view:this,node:this.cell}).filter((function(e){return t.Cell.isCell(e)&&r.cell.id!==e.id&&!e.isDescendantOf(r.cell)})):o.model.getNodesUnderNode(i,{by:a});if(s.frontOnly&&l.length>0){var u=Vi(l,"zIndex"),c=no(Object.keys(u));c&&(l=u[c])}l=l.filter((function(t){return t.visible}));for(var h=null,p=n.candidateEmbedView,d=s.validate,f=l.length-1;f>=0;f-=1){var g=l[f];if(p&&p.cell.id===g.id){h=p;break}var v=g.findView(o);if(Ws(d,o,{child:this.cell,parent:v.cell,childView:this,parentView:v})){h=v;break}}this.clearEmbedding(n),h&&h.highlight(null,{type:"embedding"}),n.candidateEmbedView=h;var y=o.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e:e,cell:i,node:i,view:o.findViewByCell(i),x:y.x,y:y.y,currentParent:i.getParent(),candidateParent:h?h.cell:null})},i.prototype.clearEmbedding=function(t){var e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)},i.prototype.finalizeEmbedding=function(t,e){var n=e.cell||this.cell,r=e.graph||this.graph,i=r.findViewByCell(n),o=n.getParent(),s=e.candidateEmbedView;if(s?(s.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,null!=o&&o.id===s.cell.id||s.cell.insertChild(n,void 0,{ui:!0})):o&&o.unembed(n,{ui:!0}),r.model.getConnectedEdges(n,{deep:!0}).forEach((function(t){t.updateParent({ui:!0})})),i&&s){var a=r.snapToGrid(t.clientX,t.clientY);i.notify("node:embedded",{e:t,cell:n,x:a.x,y:a.y,node:n,view:r.findViewByCell(n),previousParent:o,currentParent:n.getParent()})}},i.prototype.getDelegatedView=function(){for(var t=this.cell,e=this;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.renderer.findViewByCell(t)}return null},i.prototype.startMagnetDragging=function(t,e,n){if(this.can("magnetConnectable")){t.stopPropagation();var r=t.currentTarget,i=this.graph;this.setEventData(t,{targetMagnet:r}),i.hook.validateMagnet(this,r,t)?(i.options.magnetThreshold<=0&&this.startConnectting(t,r,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):((ia(r,"x6-port-body")||u(r).closest(".x6-port-body").length>0)&&this.stopPropagation(t),this.onMouseDown(t,e,n)),i.view.delegateDragEvents(t,this)}},i.prototype.startConnectting=function(t,e,n,r){this.graph.model.startBatch("add-edge");var i=this.createEdgeFromMagnet(e,n,r);i.notifyMouseDown(t,n,r),i.setEventData(t,i.prepareArrowheadDragging("target",{x:n,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:i})},i.prototype.createEdgeFromMagnet=function(t,e,n){var i=this.graph,o=i.model,s=i.hook.getDefaultEdge(this,t);return s.setSource(r(r({},s.getSource()),this.getEdgeTerminal(t,e,n,s,"source"))),s.setTarget(r(r({},s.getTarget()),{x:e,y:n})),s.addTo(o,{async:!1,ui:!0}),s.findView(i)},i.prototype.dragMagnet=function(t,e,n){var r=this.getEventData(t),i=r.edgeView;if(i)i.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{var o=this.graph,s=o.options.magnetThreshold,a=this.getEventTarget(t),l=r.targetMagnet;if("onleave"===s){if(l===a||l.contains(a))return}else if(o.view.getMouseMovedCount(t)<=s)return;this.startConnectting(t,l,e,n)}},i.prototype.stopMagnetDragging=function(t,e,n){var r=this.eventData(t).edgeView;r&&(r.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))},i.prototype.notifyUnhandledMouseDown=function(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})},i.prototype.notifyNodeMove=function(t,e,n,r,i){var o=this,s=[i],a=this.graph.selection.widget;if(a&&a.options.movable){var l=this.graph.getSelectedCells();l.includes(i)&&(s=l.filter((function(t){return t.isNode()})))}s.forEach((function(i){o.notify(t,{e:e,x:n,y:r,cell:i,node:i,view:i.findView(o.graph)})}))},i.prototype.startNodeDragging=function(e,n,r){var i=this.getDelegatedView();if(null==i||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,n,r);this.setEventData(e,{targetView:i,action:"move"});var o=t.Point.create(i.cell.getPosition());i.setEventData(e,{moving:!1,offset:o.diff(n,r),restrict:this.graph.hook.getRestrictArea(i)})},i.prototype.dragNode=function(e,n,r){var i=this.cell,o=this.graph,s=o.getGridSize(),a=this.getEventData(e),l=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,n,r,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);var c=t.Util.snapToGrid(n+l.x,s),h=t.Util.snapToGrid(r+l.y,s);i.setPosition(c,h,{restrict:u,deep:!0,ui:!0}),o.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))},i.prototype.stopNodeDragging=function(t,e,n){var r=this.getEventData(t);r.embedding&&this.finalizeEmbedding(t,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),r.moving=!1,r.embedding=!1},i.prototype.autoScrollGraph=function(t,e){var n=this.graph.scroller.widget;n&&n.autoScroll(t,e)},i}(t.CellView),(rf=t.NodeView||(t.NodeView={})).toStringTag="X6."+rf.name,rf.isNodeView=function(t){if(null==t)return!1;if(t instanceof rf)return!0;var e=t[Symbol.toStringTag],n=t;return(null==e||e===rf.toStringTag)&&"function"==typeof n.isNodeView&&"function"==typeof n.isEdgeView&&"function"==typeof n.confirmUpdate&&"function"==typeof n.update&&"function"==typeof n.findPortElem&&"function"==typeof n.resize&&"function"==typeof n.rotate&&"function"==typeof n.translate},t.NodeView.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),t.NodeView.registry.register("node",t.NodeView,!0);var sf=Qd("text"),af=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(ef("text",{view:sf,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0}));!function(e){var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.confirmUpdate=function(e,n){void 0===n&&(n={});var r=t.prototype.confirmUpdate.call(this,e,n);return this.hasAction(r,"scale")&&(this.resize(),r=this.removeAction(r,"scale")),r},e}(t.NodeView);e.View=r,r.config({actions:{attrs:["scale"]}}),t.NodeView.registry.register(sf,r)}(af||(af={}));var lf,uf=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this)||this;return r.length=0,r.comparator=n.comparator||"zIndex",r.clean(),e&&r.reset(e,{silent:!0}),r}return n(e,t),e.prototype.toJSON=function(){return this.cells.map((function(t){return t.toJSON()}))},e.prototype.add=function(t,e,n){var i,o,a,l=this;"number"==typeof e?(o=e,a=r({merge:!1},n)):(o=this.length,a=r({merge:!1},e)),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var u=Array.isArray(t)?t:[t],c=this.comparator&&"number"!=typeof e&&!1!==a.sort,h=this.comparator||null,p=!1,d=[],f=[];return u.forEach((function(t){var e=l.get(t);e?a.merge&&!t.isSameStore(e)&&(e.setProp(t.getProp(),n),f.push(e),c&&!p&&(p=null==h||"function"==typeof h?e.hasChanged():"string"==typeof h?e.hasChanged(h):h.some((function(t){return e.hasChanged(t)})))):(d.push(t),l.reference(t))})),d.length&&(c&&(p=!0),(i=this.cells).splice.apply(i,s([o,0],d,!1)),this.length=this.cells.length),p&&this.sort({silent:!0}),a.silent||(d.forEach((function(t,e){var n={cell:t,index:o+e,options:a};l.trigger("added",n),a.dryrun||t.notify("added",r({},n))})),p&&this.trigger("sorted"),(d.length||f.length)&&this.trigger("updated",{added:d,merged:f,removed:[],options:a})),this},e.prototype.remove=function(t,e){void 0===e&&(e={});var n=Array.isArray(t)?t:[t],r=this.removeCells(n,e);return!e.silent&&r.length>0&&this.trigger("updated",{options:e,removed:r,added:[],merged:[]}),Array.isArray(t)?r:r[0]},e.prototype.removeCells=function(t,e){for(var n=[],r=0;r<t.length;r+=1){var i=this.get(t[r]);if(null!=i){var o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],n.push(i),this.unreference(i),e.dryrun||i.remove(),e.silent||(this.trigger("removed",{cell:i,index:o,options:e}),e.dryrun||i.notify("removed",{cell:i,index:o,options:e}))}}return n},e.prototype.reset=function(t,e){var n=this;void 0===e&&(e={});var i=this.cells.slice();if(i.forEach((function(t){return n.unreference(t)})),this.clean(),this.add(t,r({silent:!0},e)),!e.silent){var o=this.cells.slice();this.trigger("reseted",{options:e,previous:i,current:o});var s=[],a=[];o.forEach((function(t){i.some((function(e){return e.id===t.id}))||s.push(t)})),i.forEach((function(t){o.some((function(e){return e.id===t.id}))||a.push(t)})),this.trigger("updated",{options:e,added:s,removed:a,merged:[]})}return this},e.prototype.push=function(t,e){return this.add(t,this.length,e)},e.prototype.pop=function(t){var e=this.at(this.length-1);return this.remove(e,t)},e.prototype.unshift=function(t,e){return this.add(t,0,e)},e.prototype.shift=function(t){var e=this.at(0);return this.remove(e,t)},e.prototype.get=function(t){if(null==t)return null;var e="string"==typeof t||"number"==typeof t?t:t.id;return this.map[e]||null},e.prototype.has=function(t){return null!=this.get(t)},e.prototype.at=function(t){return t<0&&(t+=this.length),this.cells[t]||null},e.prototype.first=function(){return this.at(0)},e.prototype.last=function(){return this.at(-1)},e.prototype.indexOf=function(t){return this.cells.indexOf(t)},e.prototype.toArray=function(){return this.cells.slice()},e.prototype.sort=function(t){return void 0===t&&(t={}),null!=this.comparator&&(this.cells=No(this.cells,this.comparator),t.silent||this.trigger("sorted")),this},e.prototype.clone=function(){return new(0,this.constructor)(this.cells.slice(),{comparator:this.comparator})},e.prototype.reference=function(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)},e.prototype.unreference=function(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]},e.prototype.notifyCellEvent=function(t,e){var n=e.cell;this.trigger("cell:"+t,e),n&&(n.isNode()?this.trigger("node:"+t,r(r({},e),{node:n})):n.isEdge()&&this.trigger("edge:"+t,r(r({},e),{edge:n})))},e.prototype.clean=function(){this.length=0,this.cells=[],this.map={}},e}(t.Basecoat);t.Model=function(e){function i(t){void 0===t&&(t=[]);var n=e.call(this)||this;return n.batches={},n.addings=new WeakMap,n.nodes={},n.edges={},n.outgoings={},n.incomings={},n.collection=new uf(t),n.setup(),n}return n(i,e),Object.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return i.toStringTag},enumerable:!1,configurable:!0}),i.prototype.notify=function(t,e){this.trigger(t,e);var n=this.graph;return n&&("sorted"===t||"reseted"===t||"updated"===t?n.trigger("model:"+t,e):n.trigger(t,e)),this},i.prototype.setup=function(){var t=this,e=this.collection;e.on("sorted",(function(){return t.notify("sorted",null)})),e.on("updated",(function(e){return t.notify("updated",e)})),e.on("cell:change:zIndex",(function(){return t.sortOnChangeZ()})),e.on("added",(function(e){var n=e.cell;t.onCellAdded(n)})),e.on("removed",(function(e){var n=e.cell;t.onCellRemoved(n,e.options),t.notify("cell:removed",e),n.isNode()?t.notify("node:removed",r(r({},e),{node:n})):n.isEdge()&&t.notify("edge:removed",r(r({},e),{edge:n}))})),e.on("reseted",(function(e){t.onReset(e.current),t.notify("reseted",e)})),e.on("edge:change:source",(function(e){var n=e.edge;return t.onEdgeTerminalChanged(n,"source")})),e.on("edge:change:target",(function(e){var n=e.edge;t.onEdgeTerminalChanged(n,"target")}))},i.prototype.sortOnChangeZ=function(){this.collection.sort()},i.prototype.onCellAdded=function(t){var e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0},i.prototype.onCellRemoved=function(t,e){var n=t.id;if(t.isEdge()){delete this.edges[n];var r,i,o=t.getSource(),s=t.getTarget();if(o&&o.cell)(i=(r=this.outgoings[o.cell])?r.indexOf(n):-1)>=0&&(r.splice(i,1),0===r.length&&delete this.outgoings[o.cell]);if(s&&s.cell)(i=(r=this.incomings[s.cell])?r.indexOf(n):-1)>=0&&(r.splice(i,1),0===r.length&&delete this.incomings[s.cell])}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)},i.prototype.onReset=function(t){var e=this;this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach((function(t){return e.onCellAdded(t)}))},i.prototype.onEdgeTerminalChanged=function(e,n){var r="source"===n?this.outgoings:this.incomings,i=e.previous(n);if(i&&i.cell){var o=t.Cell.isCell(i.cell)?i.cell.id:i.cell;(l=(a=r[o])?a.indexOf(e.id):-1)>=0&&(a.splice(l,1),0===a.length&&delete r[o])}var s=e.getTerminal(n);if(s&&s.cell){var a,l,u=t.Cell.isCell(s.cell)?s.cell.id:s.cell;-1===(l=(a=r[u]||[]).indexOf(e.id))&&a.push(e.id),r[u]=a}},i.prototype.prepareCell=function(t,e){return t.model||e&&e.dryrun||(t.model=this),null==t.zIndex&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t},i.prototype.resetCells=function(t,e){var n=this;return void 0===e&&(e={}),t.map((function(t){return n.prepareCell(t,r(r({},e),{dryrun:!0}))})),this.collection.reset(t,e),t.map((function(t){return n.prepareCell(t,{options:e})})),this},i.prototype.clear=function(t){void 0===t&&(t={});var e=this.getCells();if(0===e.length)return this;var n=r(r({},t),{clear:!0});return this.batchUpdate("clear",(function(){for(var t=e.sort((function(t,e){return(t.isEdge()?1:2)-(e.isEdge()?1:2)}));t.length>0;){var r=t.shift();r&&r.remove(n)}}),n),this},i.prototype.addNode=function(e,n){void 0===n&&(n={});var r=t.Node.isNode(e)?e:this.createNode(e);return this.addCell(r,n),r},i.prototype.createNode=function(e){return t.Node.create(e)},i.prototype.addEdge=function(e,n){void 0===n&&(n={});var r=t.Edge.isEdge(e)?e:this.createEdge(e);return this.addCell(r,n),r},i.prototype.createEdge=function(e){return t.Edge.create(e)},i.prototype.addCell=function(t,e){var n=this;return void 0===e&&(e={}),Array.isArray(t)?this.addCells(t,e):(this.collection.has(t)||this.addings.has(t)||(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild((function(t){return n.addCell(t,e)})),this.addings.delete(t)),this)},i.prototype.addCells=function(t,e){var n=this;void 0===e&&(e={});var i=t.length;if(0===i)return this;var o=r(r({},e),{position:i-1,maxPosition:i-1});return this.startBatch("add",r(r({},o),{cells:t})),t.forEach((function(t){n.addCell(t,o),o.position-=1})),this.stopBatch("add",r(r({},o),{cells:t})),this},i.prototype.removeCell=function(t,e){void 0===e&&(e={});var n="string"==typeof t?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null},i.prototype.updateCellId=function(t,e){this.startBatch("update",{id:e}),t.prop("id",e);var n=t.clone({keepId:!0});return this.addCell(n),this.getConnectedEdges(t).forEach((function(n){var i=n.getSourceCell(),o=n.getTargetCell();i===t&&n.setSource(r(r({},n.getSource()),{cell:e})),o===t&&n.setTarget(r(r({},n.getTarget()),{cell:e}))})),this.removeCell(t),this.stopBatch("update",{id:e}),n},i.prototype.removeCells=function(t,e){var n=this;return void 0===e&&(e={}),t.length?this.batchUpdate("remove",(function(){return t.map((function(t){return n.removeCell(t,e)}))})):[]},i.prototype.removeConnectedEdges=function(t,e){void 0===e&&(e={});var n=this.getConnectedEdges(t);return n.forEach((function(t){t.remove(e)})),n},i.prototype.disconnectConnectedEdges=function(t,e){void 0===e&&(e={});var n="string"==typeof t?t:t.id;this.getConnectedEdges(t).forEach((function(t){var r=t.getSourceCell(),i=t.getTargetCell();r&&r.id===n&&t.setSource({x:0,y:0},e),i&&i.id===n&&t.setTarget({x:0,y:0},e)}))},i.prototype.has=function(t){return this.collection.has(t)},i.prototype.total=function(){return this.collection.length},i.prototype.indexOf=function(t){return this.collection.indexOf(t)},i.prototype.getCell=function(t){return this.collection.get(t)},i.prototype.getCells=function(){return this.collection.toArray()},i.prototype.getFirstCell=function(){return this.collection.first()},i.prototype.getLastCell=function(){return this.collection.last()},i.prototype.getMinZIndex=function(){var t=this.collection.first();return t&&t.getZIndex()||0},i.prototype.getMaxZIndex=function(){var t=this.collection.last();return t&&t.getZIndex()||0},i.prototype.getCellsFromCache=function(t){var e=this;return t?Object.keys(t).map((function(t){return e.getCell(t)})).filter((function(t){return null!=t})):[]},i.prototype.getNodes=function(){return this.getCellsFromCache(this.nodes)},i.prototype.getEdges=function(){return this.getCellsFromCache(this.edges)},i.prototype.getOutgoingEdges=function(t){var e=this,n="string"==typeof t?t:t.id,r=this.outgoings[n];return r?r.map((function(t){return e.getCell(t)})).filter((function(t){return t&&t.isEdge()})):null},i.prototype.getIncomingEdges=function(t){var e=this,n="string"==typeof t?t:t.id,r=this.incomings[n];return r?r.map((function(t){return e.getCell(t)})).filter((function(t){return t&&t.isEdge()})):null},i.prototype.getConnectedEdges=function(t,e){var n=this;void 0===e&&(e={});var r=[],i="string"==typeof t?this.getCell(t):t;if(null==i)return r;var o={},s=e.indirect,a=e.incoming,l=e.outgoing;null==a&&null==l&&(a=l=!0);var u=function(t,e){var i=e?n.getOutgoingEdges(t):n.getIncomingEdges(t);if(null!=i&&i.forEach((function(t){o[t.id]||(r.push(t),o[t.id]=!0,s&&(a&&u(t,!1),l&&u(t,!0)))})),s&&t.isEdge()){var c=e?t.getTargetCell():t.getSourceCell();c&&c.isEdge()&&(o[c.id]||(r.push(c),u(c,e)))}};if(l&&u(i,!0),a&&u(i,!1),e.deep){var c=i.getDescendants({deep:!0}),h={};c.forEach((function(t){t.isNode()&&(h[t.id]=!0)}));var p=function(t,i){var s=i?n.getOutgoingEdges(t.id):n.getIncomingEdges(t.id);null!=s&&s.forEach((function(t){if(!o[t.id]){var n=t.getSourceCell(),i=t.getTargetCell();if(!e.enclosed&&n&&h[n.id]&&i&&h[i.id])return;r.push(t),o[t.id]=!0}}))};c.forEach((function(t){t.isEdge()||(l&&p(t,!0),a&&p(t,!1))}))}return r},i.prototype.isBoundary=function(t,e){var n="string"==typeof t?this.getCell(t):t,r=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return null==r||0===r.length},i.prototype.getBoundaryNodes=function(t){var e=this,n=[];return Object.keys(this.nodes).forEach((function(r){if(e.isBoundary(r,t)){var i=e.getCell(r);i&&n.push(i)}})),n},i.prototype.getRoots=function(){return this.getBoundaryNodes(!0)},i.prototype.getLeafs=function(){return this.getBoundaryNodes(!1)},i.prototype.isRoot=function(t){return this.isBoundary(t,!0)},i.prototype.isLeaf=function(t){return this.isBoundary(t,!1)},i.prototype.getNeighbors=function(t,e){void 0===e&&(e={});var n=e.incoming,r=e.outgoing;null==n&&null==r&&(n=r=!0);var i=this.getConnectedEdges(t,e).reduce((function(i,o){var s=o.hasLoop(e),a=o.getSourceCell(),l=o.getTargetCell();return n&&a&&a.isNode()&&!i[a.id]&&(!s&&(a===t||e.deep&&a.isDescendantOf(t))||(i[a.id]=a)),r&&l&&l.isNode()&&!i[l.id]&&(!s&&(l===t||e.deep&&l.isDescendantOf(t))||(i[l.id]=l)),i}),{});if(t.isEdge()){if(n){var o=t.getSourceCell();o&&o.isNode()&&!i[o.id]&&(i[o.id]=o)}if(r){var s=t.getTargetCell();s&&s.isNode()&&!i[s.id]&&(i[s.id]=s)}}return Object.keys(i).map((function(t){return i[t]}))},i.prototype.isNeighbor=function(t,e,n){void 0===n&&(n={});var r=n.incoming,i=n.outgoing;return null==r&&null==i&&(r=i=!0),this.getConnectedEdges(t,n).some((function(t){var n=t.getSourceCell(),o=t.getTargetCell();return!(!r||!n||n.id!==e.id)||!(!i||!o||o.id!==e.id)}))},i.prototype.getSuccessors=function(t,e){var n=this;void 0===e&&(e={});var i=[];return this.search(t,(function(r,o){r!==t&&n.matchDistance(o,e.distance)&&i.push(r)}),r(r({},e),{outgoing:!0})),i},i.prototype.isSuccessor=function(t,e,n){var i=this;void 0===n&&(n={});var o=!1;return this.search(t,(function(r,s){if(r===e&&r!==t&&i.matchDistance(s,n.distance))return o=!0,!1}),r(r({},n),{outgoing:!0})),o},i.prototype.getPredecessors=function(t,e){var n=this;void 0===e&&(e={});var i=[];return this.search(t,(function(r,o){r!==t&&n.matchDistance(o,e.distance)&&i.push(r)}),r(r({},e),{incoming:!0})),i},i.prototype.isPredecessor=function(t,e,n){var i=this;void 0===n&&(n={});var o=!1;return this.search(t,(function(r,s){if(r===e&&r!==t&&i.matchDistance(s,n.distance))return o=!0,!1}),r(r({},n),{incoming:!0})),o},i.prototype.matchDistance=function(t,e){return null==e||("function"==typeof e?e(t):!(!Array.isArray(e)||!e.includes(t))||t===e)},i.prototype.getCommonAncestor=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=[];return e.forEach((function(t){t&&(Array.isArray(t)?r.push.apply(r,t):r.push(t))})),t.Cell.getCommonAncestor.apply(t.Cell,r)},i.prototype.getSubGraph=function(t,e){var n=this;void 0===e&&(e={});var r=[],i={},o=[],s=[],a=function(t){i[t.id]||(r.push(t),i[t.id]=t,t.isEdge()&&s.push(t),t.isNode()&&o.push(t))};return t.forEach((function(t){(a(t),e.deep)&&t.getDescendants({deep:!0}).forEach((function(t){return a(t)}))})),s.forEach((function(t){var e=t.getSourceCell(),n=t.getTargetCell();e&&!i[e.id]&&(r.push(e),i[e.id]=e,e.isNode()&&o.push(e)),n&&!i[n.id]&&(r.push(n),i[n.id]=n,n.isNode()&&o.push(n))})),o.forEach((function(t){n.getConnectedEdges(t,e).forEach((function(t){var e=t.getSourceCell(),n=t.getTargetCell();!i[t.id]&&e&&i[e.id]&&n&&i[n.id]&&(r.push(t),i[t.id]=t)}))})),r},i.prototype.cloneSubGraph=function(t,e){void 0===e&&(e={});var n=this.getSubGraph(t,e);return this.cloneCells(n)},i.prototype.cloneCells=function(e){return t.Cell.cloneCells(e)},i.prototype.getNodesFromPoint=function(t,e){var n="number"==typeof t?{x:t,y:e||0}:t;return this.getNodes().filter((function(t){return t.getBBox().containsPoint(n)}))},i.prototype.getNodesInArea=function(e,n,r,i,o){var s="number"==typeof e?new t.Rectangle(e,n,r,i):t.Rectangle.create(e),a="number"==typeof e?o:n,l=a&&a.strict;return this.getNodes().filter((function(t){var e=t.getBBox();return l?s.containsRect(e):s.isIntersectWithRect(e)}))},i.prototype.getEdgesInArea=function(e,n,r,i,o){var s="number"==typeof e?new t.Rectangle(e,n,r,i):t.Rectangle.create(e),a="number"==typeof e?o:n,l=a&&a.strict;return this.getEdges().filter((function(t){var e=t.getBBox();return 0===e.width?e.inflate(1,0):0===e.height&&e.inflate(0,1),l?s.containsRect(e):s.isIntersectWithRect(e)}))},i.prototype.getNodesUnderNode=function(t,e){void 0===e&&(e={});var n=t.getBBox();return(null==e.by||"bbox"===e.by?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by])).filter((function(e){return t.id!==e.id&&!e.isDescendantOf(t)}))},i.prototype.getAllCellsBBox=function(){return this.getCellsBBox(this.getCells())},i.prototype.getCellsBBox=function(e,n){return void 0===n&&(n={}),t.Cell.getCellsBBox(e,n)},i.prototype.search=function(t,e,n){void 0===n&&(n={}),n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)},i.prototype.breadthFirstSearch=function(t,e,n){void 0===n&&(n={});var r=[],i={},o={};r.push(t),o[t.id]=0;for(var s=function(){var t=r.shift();return null==t||i[t.id]?"continue":(i[t.id]=!0,!1===Ws(e,a,t,o[t.id])?"continue":void a.getNeighbors(t,n).forEach((function(e){o[e.id]=o[t.id]+1,r.push(e)})))},a=this;r.length>0;)s()},i.prototype.depthFirstSearch=function(t,e,n){void 0===n&&(n={});var r=[],i={},o={};r.push(t),o[t.id]=0;for(var s=function(){var t=r.pop();if(null==t||i[t.id])return"continue";if(i[t.id]=!0,!1===Ws(e,a,t,o[t.id]))return"continue";var s=a.getNeighbors(t,n),l=r.length;s.forEach((function(e){o[e.id]=o[t.id]+1,r.splice(l,0,e)}))},a=this;r.length>0;)s()},i.prototype.getShortestPath=function(e,n,r){void 0===r&&(r={});var i={};this.getEdges().forEach((function(t){var e=t.getSourceCellId(),n=t.getTargetCellId();e&&n&&(i[e]||(i[e]=[]),i[n]||(i[n]=[]),i[e].push(n),r.directed||i[n].push(e))}));var o="string"==typeof e?e:e.id,s=t.Dijkstra.run(i,o,r.weight),a=[],l="string"==typeof n?n:n.id;for(s[l]&&a.push(l);l=s[l];)a.unshift(l);return a},i.prototype.translate=function(t,e,n){return this.getCells().filter((function(t){return!t.hasParent()})).forEach((function(r){return r.translate(t,e,n)})),this},i.prototype.resize=function(t,e,n){return this.resizeCells(t,e,this.getCells(),n)},i.prototype.resizeCells=function(t,e,n,r){void 0===r&&(r={});var i=this.getCellsBBox(n);if(i){var o=Math.max(t/i.width,0),s=Math.max(e/i.height,0),a=i.getOrigin();n.forEach((function(t){return t.scale(o,s,a,r)}))}return this},i.prototype.toJSON=function(t){return void 0===t&&(t={}),i.toJSON(this.getCells(),t)},i.prototype.parseJSON=function(t){return i.fromJSON(t)},i.prototype.fromJSON=function(t,e){void 0===e&&(e={});var n=this.parseJSON(t);return this.resetCells(n,e),this},i.prototype.startBatch=function(t,e){return void 0===e&&(e={}),this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this},i.prototype.stopBatch=function(t,e){return void 0===e&&(e={}),this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this},i.prototype.batchUpdate=function(t,e,n){void 0===n&&(n={}),this.startBatch(t,n);var r=e();return this.stopBatch(t,n),r},i.prototype.hasActiveBatch=function(t){var e=this;return void 0===t&&(t=Object.keys(this.batches)),(Array.isArray(t)?t:[t]).some((function(t){return e.batches[t]>0}))},i}(t.Basecoat),(lf=t.Model||(t.Model={})).toStringTag="X6."+lf.name,lf.isModel=function(t){if(null==t)return!1;if(t instanceof lf)return!0;var e=t[Symbol.toStringTag],n=t;return(null==e||e===lf.toStringTag)&&"function"==typeof n.addNode&&"function"==typeof n.addEdge&&null!=n.collection},function(e){e.toJSON=function(t,e){return void 0===e&&(e={}),{cells:t.map((function(t){return t.toJSON(e)}))}},e.fromJSON=function(e){var n=[];return Array.isArray(e)?n.push.apply(n,e):(e.cells&&n.push.apply(n,e.cells),e.nodes&&e.nodes.forEach((function(t){null==t.shape&&(t.shape="rect"),n.push(t)})),e.edges&&e.edges.forEach((function(t){null==t.shape&&(t.shape="edge"),n.push(t)}))),n.map((function(e){var n=e.shape;if(n){if(t.Node.registry.exist(n))return t.Node.create(e);if(t.Edge.registry.exist(n))return t.Edge.create(e)}throw new Error("The `shape` should be specified when creating a node/edge instance")}))}}(t.Model||(t.Model={}));var cf=".text-block-content",hf=Qd("text-block"),pf=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),Object.defineProperty(i.prototype,"content",{get:function(){return this.getContent()},set:function(t){this.setContent(t)},enumerable:!1,configurable:!0}),i.prototype.getContent=function(){return this.store.get("content","")},i.prototype.setContent=function(t,e){void 0===e&&(e={}),this.store.set("content",t,e)},i.prototype.setup=function(){var t=this;e.prototype.setup.call(this),this.store.on("change:*",(function(e){var n=e.key;"content"===n?t.updateContent(t.getContent()):"size"===n&&t.updateSize(t.getSize())})),this.updateSize(this.getSize()),this.updateContent(this.getContent())},i.prototype.updateSize=function(e){var n;t.Platform.SUPPORT_FOREIGNOBJECT&&this.setAttrs(((n={foreignObject:r({},e)})[cf]={style:r({},e)},n))},i.prototype.updateContent=function(e){var n,r;t.Platform.SUPPORT_FOREIGNOBJECT?this.setAttrs(((n={})[cf]={html:e?Vs(e):""},n)):this.setAttrs(((r={})[cf]={text:e},r))},i}(t.Node);!function(e){var n;e.config({type:hf,view:hf,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',t.Platform.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">','<div class="'+cf.substr(1)+'" />',"</body>","</foreignObject>"].join(""):'<text class="'+cf.substr(1)+'"/>',"</g>"].join(""),attrs:(n={".":{fill:"#ffffff",stroke:"none"},rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000",fontSize:14,fontFamily:"Arial, helvetica, sans-serif"},body:{style:{background:"transparent",position:"static",margin:0,padding:0}},foreignObject:{style:{overflow:"hidden"}}},n[cf]={refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}},n)}),t.Node.registry.register(hf,e)}(pf||(pf={})),function(e){var i="content",o=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return n(o,e),o.prototype.confirmUpdate=function(t,n){void 0===n&&(n={});var r=e.prototype.confirmUpdate.call(this,t,n);return this.hasAction(r,i)&&(this.updateContent(),r=this.removeAction(r,i)),r},o.prototype.update=function(n){if(t.Platform.SUPPORT_FOREIGNOBJECT)e.prototype.update.call(this,n);else{var i=this.cell,o=r({},n||i.getAttrs());delete o[cf],e.prototype.update.call(this,o),n&&!_i(n,cf)||this.updateContent(n)}},o.prototype.updateContent=function(n){var r;if(t.Platform.SUPPORT_FOREIGNOBJECT)e.prototype.update.call(this,n);else{var i=this.cell,o=(n||i.getAttrs())[cf],s=jl(i.getContent(),i.getSize(),o,{svgDocument:this.graph.view.svg}),a=((r={})[cf]=ro({},o,{text:s}),r);e.prototype.update.call(this,a)}},o}(t.NodeView);e.View=o,function(e){e.config({bootstrap:["render",i],actions:t.Platform.SUPPORT_FOREIGNOBJECT?{}:{size:i,content:i}}),t.NodeView.registry.register(hf,e)}(o=e.View||(e.View={}))}(pf||(pf={}));var df=Kd.define({shape:"empty"});function ff(t,e){return void 0===e&&(e="body"),[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function gf(t,e,n){var i;void 0===n&&(n={});var o={constructorName:t,markup:ff(t,n.selector),attrs:(i={},i[t]=r({},Kd.bodyAttr),i)};return(n.parent||Kd).define(ro(o,e,{shape:t}))}var vf=gf("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),yf=t.Node.define({shape:"rect-headered",markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}],attrs:{body:r(r({},Kd.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:r(r({},Kd.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:r(r({},Kd.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:r(r({},Kd.labelAttr),{refY2:15})}}),mf=gf("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}}),bf=Kd.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:r(r({},Kd.bodyAttr),{lateral:10}),top:r(r({},Kd.bodyAttr),{refCx:"50%",refRx:"50%",cy:10,ry:10})},attrHooks:{lateral:{set:function(t,e){var n=e.refBBox,r=_s(t);r&&(t=parseFloat(t)/100);var i=n.x,o=n.y,s=n.width,a=n.height,l=r?a*t:t,u=.551784,c=u*(s/2),h=u*l,p=i+s/2,d=i+s,f=o+l,g=f-l,v=o+a-l,y=o+a;return{d:["M",i,f,"L",i,v,"C",i,v+h,p-c,y,p,y,"C",p+c,y,d,v+h,d,v,"L",d,f,"C",d,f-h,p+c,g,p,g,"C",p-c,g,i,f-h,i,f,"Z"].join(" ")}}}},knob:{enabled:!0,position:function(t){return{x:0,y:t.node.attr("body/lateral")}},onMouseMove:function(t){var e=t.node,n=t.data,r=t.deltaY;if(0!==r){var i=e.getBBox(),o=e.attr("body/lateral");null==n.round&&(n.round=o);var s=i.height/2,a=In(n.round+r,0,s);a!==o&&e.attr({body:{lateral:a},top:{cy:a,ry:a}})}}}}),Cf=gf("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}}),xf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"points",{get:function(){return this.getPoints()},set:function(t){this.setPoints(t)},enumerable:!1,configurable:!0}),e.prototype.getPoints=function(){return this.getAttrByPath("body/refPoints")},e.prototype.setPoints=function(t,n){return null==t?this.removePoints():this.setAttrByPath("body/refPoints",e.pointsToString(t),n),this},e.prototype.removePoints=function(){return this.removeAttrByPath("body/refPoints"),this},e}(Kd);!function(e){function n(e){return"string"==typeof e?e:e.map((function(e){return Array.isArray(e)?e.join(","):t.Point.isPointLike(e)?e.x+", "+e.y:""})).join(" ")}e.pointsToString=n,e.config({propHooks:function(t){var e=t.points,r=i(t,["points"]);if(e){var o=n(e);o&&As(r,"attrs/body/refPoints",o)}return r}})}(xf||(xf={}));var wf=gf("polygon",{},{parent:xf}),Pf=gf("polyline",{},{parent:xf}),Af=Kd.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks:function(t){var e=t.path,n=i(t,["path"]);return e&&As(n,"attrs/body/refD",e),n}}),Ef=Kd.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},t.Platform.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:pa.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:r(r({},Kd.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks:function(t){var e=t.text,n=i(t,["text"]);return e&&As(n,"attrs/label/text",e),n},attrHooks:{text:{set:function(t,e){var n=e.cell,i=e.view,o=e.refBBox,s=e.elem,a=e.attrs;if(!(s instanceof HTMLElement)){var l=a.style||{},u={text:t,width:-5,height:"100%"},c=r({textVerticalAnchor:"middle"},l);return Ws(ch.presets.textWrap.set,this,u,{cell:n,view:i,elem:s,refBBox:o,attrs:c}),{fill:l.color||null}}s.textContent=t},position:function(t,e){var n=e.refBBox;if(e.elem instanceof SVGElement)return n.getCenter()}}}}),Mf=gf("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:tf()},{selector:"image"}),Sf=gf("image-bordered",{markup:[{tagName:"rect",selector:"background",attrs:{stroke:"none"}},{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{background:{refWidth:-1,refHeight:-1,x:.5,y:.5,fill:"#ffffff"},border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5}},propHooks:tf()}),kf=gf("image-embedded",{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}],attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"}},propHooks:tf()}),Tf=gf("image-inscribed",{propHooks:tf(),markup:[{tagName:"ellipse",selector:"background"},{tagName:"image",selector:"image"},{tagName:"ellipse",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{border:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",stroke:"#333333",strokeWidth:2},background:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",fill:"#ffffff"},image:{refWidth:"68%",refHeight:"68%",refX:"16%",refY:"16%",preserveAspectRatio:"xMidYMid"}}}),Df=t.Edge.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}}),Nf=t.Edge.define({shape:"shadow-edge",markup:[{tagName:"path",selector:"shadow",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}}}}),Of=t.Edge.define({shape:"double-edge",markup:[{tagName:"path",selector:"outline",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#dddddd",strokeWidth:4,strokeLinejoin:"round",targetMarker:{tagName:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}}),Lf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"html",{get:function(){return this.getHTML()},set:function(t){this.setHTML(t)},enumerable:!1,configurable:!0}),e.prototype.getHTML=function(){return this.store.get("html")},e.prototype.setHTML=function(t,e){return void 0===e&&(e={}),null==t?this.removeHTML(e):this.store.set("html",t,e),this},e.prototype.removeHTML=function(t){return void 0===t&&(t={}),this.store.remove("html",t)},e}(Kd);!function(e){var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(){var e=this;t.prototype.init.call(this),this.cell.on("change:*",(function(){e.graph.hook.shouldUpdateHTMLComponent(e.cell)&&e.renderHTMLComponent()}))},e.prototype.confirmUpdate=function(n){var r=this,i=t.prototype.confirmUpdate.call(this,n);return this.handleAction(i,e.action,(function(){return r.renderHTMLComponent()}))},e.prototype.renderHTMLComponent=function(){var t=this.selectors.foContent;if(t){var e=this.$(t).empty(),n=this.graph.hook.getHTMLComponent(this.cell);n&&("string"==typeof n?e.html(n):e.append(n))}},e}(t.NodeView);e.View=r,function(e){e.action="html",e.config({bootstrap:[e.action],actions:{html:e.action}}),t.NodeView.registry.register("html-view",e)}(r=e.View||(e.View={}))}(Lf||(Lf={})),function(e){e.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},r({},t.Markup.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),t.Node.registry.register("html",e)}(Lf||(Lf={})),function(t){t.componentRegistry=Ju.create({type:"html componnet"})}(Lf||(Lf={}));var Ff=Object.freeze({__proto__:null,Empty:df,Rect:vf,HeaderedRect:yf,Circle:mf,Cylinder:bf,Ellipse:Cf,Polygon:wf,Polyline:Pf,Path:Af,TextBlock:Ef,Image:Mf,BorderedImage:Sf,EmbeddedImage:kf,InscribedImage:Tf,Edge:Df,ShadowEdge:Nf,DoubleEdge:Of,get HTML(){return Lf}}),zf=function(t){function e(n){var i=t.call(this)||this;return i.delay=10,i.throttle=2,i.threshold=5,i.changeCount=0,i.timestamp=0,i.options=r(r({},e.defaultOptions),n),i.graph.model.on("cell:change:*",i.onModelChanged,i),i}return n(e,t),Object.defineProperty(e.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),e.prototype.onModelChanged=function(){if(!this.disabled){var t=((new Date).getTime()-this.timestamp)/1e3;t>this.delay||this.changeCount>=this.threshold&&t>this.throttle?(this.save(),this.reset()):this.changeCount+=1}},e.prototype.save=function(){this.trigger("save")},e.prototype.reset=function(){this.changeCount=0,this.timestamp=(new Date).getTime()},e.prototype.dispose=function(){this.graph.model.off("cell:change:*",this.onModelChanged,this)},o([sp.dispose()],e.prototype,"dispose",null),e}(sp);!function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(zf||(zf={}));var Bf,Vf=function(t){function e(e){var n=t.call(this)||this;return n.graph=e,n.init(),n}return n(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return this.graph.options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this.graph.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.graph.view},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e}(t.Disposable),jf=function(e){function r(n){var i=e.call(this)||this;i.graph=n;var o=t.Markup.parseJSONMarkup(r.markup),s=o.selectors,a=o.fragment;return i.background=s.background,i.grid=s.grid,i.svg=s.svg,i.defs=s.defs,i.viewport=s.viewport,i.primer=s.primer,i.stage=s.stage,i.decorator=s.decorator,i.overlay=s.overlay,i.container=i.options.container,i.restore=r.snapshoot(i.container),i.$(i.container).addClass(i.prefixClassName("graph")).append(a),i.delegateEvents(),i}return n(r,e),Object.defineProperty(r.prototype,"model",{get:function(){return this.graph.model},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"options",{get:function(){return this.graph.options},enumerable:!1,configurable:!0}),r.prototype.delegateEvents=function(){var t=this.constructor;return e.prototype.delegateEvents.call(this,t.events),this},r.prototype.guard=function(e,n){return"mousedown"===e.type&&2===e.button||(!(!this.options.guard||!this.options.guard(e,n))||(e.data&&void 0!==e.data.guarded?e.data.guarded:!(n&&n.cell&&t.Cell.isCell(n.cell))&&(this.svg!==e.target&&this.container!==e.target&&!u.contains(this.svg,e.target))))},r.prototype.findView=function(t){return this.graph.renderer.findViewByElem(t)},r.prototype.onDblClick=function(t){this.options.preventDefaultDblClick&&t.preventDefault();var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n)){var r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,r.x,r.y):this.graph.trigger("blank:dblclick",{e:e,x:r.x,y:r.y})}},r.prototype.onClick=function(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){var e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;var r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,r.x,r.y):this.graph.trigger("blank:click",{e:e,x:r.x,y:r.y})}},r.prototype.isPreventDefaultContextMenu=function(t,e){var n=this.options.preventDefaultContextMenu;return"function"==typeof n&&(n=Ws(n,this.graph,{view:e})),n},r.prototype.onContextMenu=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(e,n)&&t.preventDefault(),!this.guard(e,n)){var r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:e,x:r.x,y:r.y})}},r.prototype.delegateDragEvents=function(t,e){null==t.data&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});var n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()},r.prototype.getMouseMovedCount=function(t){return this.getEventData(t).mouseMovedCount||0},r.prototype.onMouseDown=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n)){this.options.preventDefaultMouseDown&&e.preventDefault();var r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,r.x,r.y):(this.options.preventDefaultBlankAction&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:e,x:r.x,y:r.y})),this.delegateDragEvents(e,n)}},r.prototype.onMouseMove=function(t){var e=this.getEventData(t),n=e.startPosition;if((!n||n.x!==t.clientX||n.y!==t.clientY)&&(null==e.mouseMovedCount&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,!(e.mouseMovedCount<=this.options.moveThreshold))){var r=this.normalizeEvent(t),i=this.graph.snapToGrid(r.clientX,r.clientY),o=e.currentView;o?o.onMouseMove(r,i.x,i.y):this.graph.trigger("blank:mousemove",{e:r,x:i.x,y:i.y}),this.setEventData(r,e)}},r.prototype.onMouseUp=function(t){this.undelegateDocumentEvents();var e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),r=this.getEventData(t).currentView;r?r.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e:e,x:n.x,y:n.y}),t.isPropagationStopped()||this.onClick(u.Event(t,{type:"click",data:t.data})),t.stopImmediatePropagation(),this.delegateEvents()},r.prototype.onMouseOver=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e:e})}},r.prototype.onMouseOut=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e:e})}},r.prototype.onMouseEnter=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n)){var r=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(r===n)return;n.onMouseEnter(e)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:e})}}},r.prototype.onMouseLeave=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n)){var r=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(r===n)return;n.onMouseLeave(e)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:e})}}},r.prototype.onMouseWheel=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n)){var r=e.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));n?n.onMouseWheel(e,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:e,delta:o,x:i.x,y:i.y})}},r.prototype.onCustomEvent=function(t){var e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){var r=this.findView(e);if(r){var i=this.normalizeEvent(t);if(this.guard(i,r))return;var o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,n,o.x,o.y)}}},r.prototype.handleMagnetEvent=function(t,e){var n=t.currentTarget,r=n.getAttribute("magnet");if(r&&"false"!==r.toLowerCase()){var i=this.findView(n);if(i){var o=this.normalizeEvent(t);if(this.guard(o,i))return;var s=this.graph.snapToGrid(o.clientX,o.clientY);Ws(e,this.graph,i,o,n,s.x,s.y)}}},r.prototype.onMagnetMouseDown=function(t){this.handleMagnetEvent(t,(function(t,e,n,r,i){t.onMagnetMouseDown(e,n,r,i)}))},r.prototype.onMagnetDblClick=function(t){this.handleMagnetEvent(t,(function(t,e,n,r,i){t.onMagnetDblClick(e,n,r,i)}))},r.prototype.onMagnetContextMenu=function(t){var e=this.normalizeEvent(t),n=this.findView(e.target);this.isPreventDefaultContextMenu(e,n)&&e.preventDefault(),this.handleMagnetEvent(e,(function(t,e,n,r,i){t.onMagnetContextMenu(e,n,r,i)}))},r.prototype.onLabelMouseDown=function(t){var e=t.currentTarget,n=this.findView(e);if(n){var r=this.normalizeEvent(t);if(this.guard(r,n))return;var i=this.graph.snapToGrid(r.clientX,r.clientY);n.onLabelMouseDown(r,i.x,i.y)}},r.prototype.onImageDragStart=function(){return!1},r.prototype.dispose=function(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=function(){}},o([t.View.dispose()],r.prototype,"dispose",null),r}(t.View);!function(t){var e=Sh.prefixCls+"-graph";t.markup=[{ns:pa.xhtml,tagName:"div",selector:"background",className:e+"-background"},{ns:pa.xhtml,tagName:"div",selector:"grid",className:e+"-grid"},{ns:pa.svg,tagName:"svg",selector:"svg",className:e+"-svg",attrs:{width:"100%",height:"100%","xmlns:xlink":pa.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:e+"-svg-viewport",children:[{tagName:"g",selector:"primer",className:e+"-svg-primer"},{tagName:"g",selector:"stage",className:e+"-svg-stage"},{tagName:"g",selector:"decorator",className:e+"-svg-decorator"},{tagName:"g",selector:"overlay",className:e+"-svg-overlay"}]}]}],t.snapshoot=function(t){var e=t.cloneNode();return t.childNodes.forEach((function(t){return e.appendChild(t)})),function(){for(Ma(t);t.attributes.length>0;)t.removeAttribute(t.attributes[0].name);for(var n=0,r=e.attributes.length;n<r;n+=1){var i=e.attributes[n];t.setAttribute(i.name,i.value)}e.childNodes.forEach((function(e){return t.appendChild(e)}))}}}(jf||(jf={})),function(t){var e,n=Sh.prefixCls;t.events=((e={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel"})["mouseenter ."+n+"-cell"]="onMouseEnter",e["mouseleave ."+n+"-cell"]="onMouseLeave",e["mouseenter ."+n+"-cell-tools"]="onMouseEnter",e["mouseleave ."+n+"-cell-tools"]="onMouseLeave",e["mousedown ."+n+"-cell [event]"]="onCustomEvent",e["touchstart ."+n+"-cell [event]"]="onCustomEvent",e["mousedown ."+n+"-cell [data-event]"]="onCustomEvent",e["touchstart ."+n+"-cell [data-event]"]="onCustomEvent",e["dblclick ."+n+"-cell [magnet]"]="onMagnetDblClick",e["contextmenu ."+n+"-cell [magnet]"]="onMagnetContextMenu",e["mousedown ."+n+"-cell [magnet]"]="onMagnetMouseDown",e["touchstart ."+n+"-cell [magnet]"]="onMagnetMouseDown",e["dblclick ."+n+"-cell [data-magnet]"]="onMagnetDblClick",e["contextmenu ."+n+"-cell [data-magnet]"]="onMagnetContextMenu",e["mousedown ."+n+"-cell [data-magnet]"]="onMagnetMouseDown",e["touchstart ."+n+"-cell [data-magnet]"]="onMagnetMouseDown",e["dragstart ."+n+"-cell image"]="onImageDragStart",e["mousedown ."+n+"-edge ."+n+"-edge-label"]="onLabelMouseDown",e["touchstart ."+n+"-edge ."+n+"-edge-label"]="onLabelMouseDown",e),t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(jf||(jf={})),function(t){t.checkScroller=function(t,e){return function(n,r,i){var o=i.value;i.value=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=this.scroller.widget;if(null==a){var l="Shoule enable scroller to use method '"+r+"'";if(!1!==t)throw console.error(l),new Error(l);return!1!==e&&console.warn(l),this}return o.call.apply(o,s([this],n,!1))}}}}(Bf||(Bf={}));var Rf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(){Sh.autoInsertCSS&&e.ensure()},e.prototype.dispose=function(){e.clean()},o([e.dispose()],e.prototype,"dispose",null),e}(Vf);!function(e){var n,r=0;e.ensure=function(){if(!((r+=1)>1||t.Platform.isApplyingHMR())){(n=document.createElement("style")).setAttribute("type","text/css"),n.textContent=".x6-graph {\n position: relative;\n outline: none;\n}\n.x6-graph-background,\n.x6-graph-grid,\n.x6-graph-svg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-background-stage,\n.x6-graph-grid-stage,\n.x6-graph-svg-stage {\n user-select: none;\n}\n.x6-graph.x6-graph-pannable {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph.x6-graph-panning {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-node {\n cursor: move;\n /* stylelint-disable-next-line */\n}\n.x6-node.x6-node-immovable {\n cursor: default;\n}\n.x6-node * {\n -webkit-user-drag: none;\n}\n.x6-node .scalable * {\n vector-effect: non-scaling-stroke;\n}\n.x6-node [magnet='true'] {\n cursor: crosshair;\n transition: opacity 0.3s;\n}\n.x6-node [magnet='true']:hover {\n opacity: 0.7;\n}\n.x6-node foreignObject {\n display: block;\n overflow: visible;\n background-color: transparent;\n}\n.x6-node foreignObject > body {\n position: static;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: visible;\n background-color: transparent;\n}\n.x6-edge .source-marker,\n.x6-edge .target-marker {\n vector-effect: non-scaling-stroke;\n}\n.x6-edge .connection {\n stroke-linejoin: round;\n fill: none;\n}\n.x6-edge .connection-wrap {\n cursor: move;\n opacity: 0;\n fill: none;\n stroke: #000;\n stroke-width: 15;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.x6-edge .connection-wrap:hover {\n opacity: 0.4;\n stroke-opacity: 0.4;\n}\n.x6-edge .vertices {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .vertices .vertex {\n fill: #1abc9c;\n}\n.x6-edge .vertices .vertex :hover {\n fill: #34495e;\n stroke: none;\n}\n.x6-edge .vertices .vertex-remove {\n cursor: pointer;\n fill: #fff;\n}\n.x6-edge .vertices .vertex-remove-area {\n cursor: pointer;\n opacity: 0.1;\n}\n.x6-edge .vertices .vertex-group:hover .vertex-remove-area {\n opacity: 1;\n}\n.x6-edge .arrowheads {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .arrowheads .arrowhead {\n fill: #1abc9c;\n}\n.x6-edge .arrowheads .arrowhead :hover {\n fill: #f39c12;\n stroke: none;\n}\n.x6-edge .tools {\n cursor: pointer;\n opacity: 0;\n}\n.x6-edge .tools .tool-options {\n display: none;\n}\n.x6-edge .tools .tool-remove circle {\n fill: #f00;\n}\n.x6-edge .tools .tool-remove path {\n fill: #fff;\n}\n.x6-edge:hover .vertices,\n.x6-edge:hover .arrowheads,\n.x6-edge:hover .tools {\n opacity: 1;\n}\n.x6-highlight-opacity {\n opacity: 0.3;\n}\n@keyframes halo-pie-visibility {\n 0% {\n visibility: hidden;\n }\n 100% {\n visibility: visible;\n }\n}\n@keyframes halo-pie-opening {\n 0% {\n transform: scale(0.4) rotate(-20deg);\n }\n 100% {\n transform: scale(1) rotate(0);\n }\n}\n.x6-widget-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n background-size: 20px 20px;\n cursor: pointer;\n user-select: none;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle.hidden {\n display: none;\n}\n.x6-widget-handle-selected {\n background-color: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n}\n.x6-widget-handle-remove {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%20M4.152%2C14.598C1.273%2C11.719%2C1.273%2C7.035%2C4.153%2C4.154%20c2.88-2.88%2C7.563-2.88%2C10.443%2C0c2.881%2C2.88%2C2.881%2C7.562%2C0%2C10.443C11.716%2C17.477%2C7.032%2C17.477%2C4.152%2C14.598L4.152%2C14.598z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: pointer;\n}\n.x6-widget-handle-remove:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-rotate {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-rotate:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-resize {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%236A6C8A%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n cursor: se-resize;\n}\n.x6-widget-handle-resize:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%23FD6EB6%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-clone {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.85%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-clone:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.849%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%20M15.172%2C16.328%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-link {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}\n.x6-widget-handle-link:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-fork {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%236A6C8A%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20C7.552%2C9.82%2C7.602%2C9.589%2C7.602%2C9.344c0-0.25-0.051-0.487-0.129-0.71l4.097-2.364c0.393%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.014%2C0.149%2C0.021%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.982%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.014%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-fork:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23FD6EB6%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20c0.075-0.22%2C0.125-0.452%2C0.125-0.697c0-0.25-0.051-0.487-0.129-0.71l4.097-2.365c0.394%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.015%2C0.148%2C0.022%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.981%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.013%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-direction {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%236A6C8A%3Bstroke%3A%236A6C8A%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%236A6C8A%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-direction:hover {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%23FD6EB6%3Bstroke%3A%23FD6EB6%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%23FD6EB6%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-surround .x6-widget-handle-animate .x6-widget-handle {\n transition: background-size 80ms, width 80ms, height 80ms, top 150ms, left 150ms, bottom 150ms, right 150ms;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-se {\n right: -25px;\n bottom: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-nw {\n top: -21px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-n {\n top: -22px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-e {\n top: -webkit-calc(40%);\n top: calc(50% - 10px);\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-ne {\n top: -21px;\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-w {\n top: 50%;\n left: -25px;\n margin-top: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-sw {\n bottom: -25px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-s {\n bottom: -24px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle {\n width: 15px;\n height: 15px;\n font-size: 15px;\n background-size: 15px 15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-se {\n right: -19px;\n bottom: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-nw {\n top: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-n {\n top: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-e {\n top: -webkit-calc(42%);\n top: calc(50% - 8px);\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-ne {\n top: -19px;\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-w {\n left: -19px;\n margin-top: -8px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-sw {\n bottom: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-s {\n bottom: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle {\n width: 10px;\n height: 10px;\n font-size: 10px;\n background-size: 10px 10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-se {\n right: -15px;\n bottom: -13px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-nw {\n top: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-n {\n top: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-e {\n top: -webkit-calc(45%);\n top: calc(50% - 5px);\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-ne {\n top: -13px;\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-w {\n left: -15px;\n margin-top: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-sw {\n bottom: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-s {\n bottom: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-toolbar {\n position: absolute;\n top: -50px;\n display: table-row;\n padding: 7px 5px;\n}\n.x6-widget-handle-toolbar::after {\n position: absolute;\n top: 100%;\n left: 10px;\n width: 0;\n height: 0;\n margin-top: 4px;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n content: '';\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n position: relative;\n display: table-cell;\n min-width: 20px;\n margin: 0 2px;\n background-position: 3px 3px;\n background-size: 16px 16px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle::after {\n position: absolute;\n bottom: -11px;\n width: 100%;\n content: '';\n}\n.x6-widget-handle-pie {\n position: absolute;\n top: -webkit-calc(0%);\n top: calc(50% - 50px);\n right: -50px;\n z-index: 1;\n display: none;\n width: 100px;\n height: 100px;\n margin: -2px -2px 0 0;\n border-radius: 50%;\n cursor: default;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie .x6-widget-handle {\n width: 1px;\n height: auto;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie-slice-svg {\n width: 100%;\n height: 100%;\n overflow: visible !important;\n}\n.x6-widget-handle-pie-slice-img,\n.x6-widget-handle-pie-slice-txt {\n display: none;\n pointer-events: none;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='e'] {\n top: calc(50% - 50px);\n right: -50px;\n left: auto;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='w'] {\n top: calc(50% - 50px);\n right: auto;\n left: -52px;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='n'] {\n top: -50px;\n right: auto;\n bottom: auto;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie[data-pie-toggle-position='s'] {\n top: auto;\n right: auto;\n bottom: -52px;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie-opened {\n display: block;\n animation: halo-pie-visibility 0.1s, halo-pie-opening 0.1s;\n animation-timing-function: step-end, ease;\n animation-delay: 0s, 0.1s;\n}\n.x6-widget-handle-pie-toggle {\n position: absolute;\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n z-index: 2;\n display: block;\n box-sizing: border-box;\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 20px 20px;\n border-radius: 50%;\n cursor: pointer;\n user-select: none;\n pointer-events: visiblePainted;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle-pie-toggle-pos-e {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n bottom: auto;\n left: auto;\n}\n.x6-widget-handle-pie-toggle-pos-w {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: auto;\n bottom: auto;\n left: -15px;\n}\n.x6-widget-handle-pie-toggle-pos-n {\n top: -15px;\n right: auto;\n bottom: auto;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-pos-s {\n top: auto;\n right: auto;\n bottom: -15px;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-opened {\n transition: 0.1s background-image;\n}\n.x6-widget-handle-toolbar {\n position: static;\n display: inline-block;\n margin-top: -50px;\n margin-left: 45px;\n white-space: nowrap;\n vertical-align: top;\n background-color: #f5f5f5;\n border-bottom: 3px solid #333;\n border-radius: 5px;\n box-shadow: 0 1px 2px #222;\n}\n.x6-widget-handle-toolbar::after {\n top: -12px;\n left: 55px;\n margin-top: 0;\n border-top: 6px solid #333;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n display: inline-block;\n vertical-align: top;\n}\n.x6-widget-handle-toolbar .x6-widget-handle:hover::after {\n border-bottom: 4px solid #fc6cb8;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-rotate {\n position: absolute;\n top: 100%;\n right: 100%;\n margin-top: 3px;\n margin-right: 6px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-remove:hover::after,\n.x6-widget-handle-toolbar .x6-widget-handle-rotate:hover::after {\n border-bottom: none;\n}\n.x6-widget-handle-toolbar .x6-widget-handle + .x6-widget-handle {\n margin-left: 4px;\n}\n.x6-widget-handle-pie {\n box-sizing: content-box;\n background-color: #f5f5f5;\n border: 2px solid #404040;\n}\n.x6-widget-handle-pie-slice {\n fill: transparent;\n stroke: #e9e9e9;\n stroke-width: 1;\n}\n.x6-widget-handle-pie-slice:hover {\n fill: #fff;\n}\n.x6-widget-handle-pie-slice-img {\n display: block;\n}\n.x6-widget-handle-selected .x6-widget-handle-pie-slice {\n fill: #fff;\n}\n.x6-widget-handle-pie-toggle {\n background-color: #f6f6f6;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n background-size: 16px 16px;\n border: 2px solid #3b425f;\n}\n.x6-widget-handle-pie-toggle:hover {\n background-color: #fff;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n border-color: #fd6eb6;\n}\n.x6-widget-handle-pie-toggle-opened {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%236a6c8a%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-pie-toggle-opened:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%23FD6EB6%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-halo {\n position: absolute;\n pointer-events: none;\n}\n.x6-widget-halo-content {\n position: absolute;\n top: 100%;\n padding: 6px;\n font-size: 10px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-halo-handles + .x6-widget-halo-content {\n right: -20px;\n left: -20px;\n margin-top: 30px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 25px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 20px;\n}\n.x6-widget-halo-handles.x6-widget-handle-pie + .x6-widget-halo-content {\n right: 0;\n left: 0;\n margin-top: 10px;\n}\n.x6-widget-halo-content {\n color: #fff;\n background-color: #6a6b8a;\n}\n.x6-widget-halo.type-node .x6-widget-handle-toolbar .x6-widget-handle-remove {\n position: absolute;\n right: 100%;\n bottom: 100%;\n margin-right: 6px;\n margin-bottom: 3px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-surround .x6-widget-handle-remove {\n background-color: #fff;\n border-radius: 50%;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar {\n margin-top: -60px;\n margin-left: -18px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar::after {\n top: -22px;\n left: -9px;\n}\n.x6-widget-minimap {\n position: relative;\n display: table-cell;\n box-sizing: border-box;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n background-color: #fff;\n user-select: none;\n}\n.x6-widget-minimap .x6-graph {\n display: inline-block;\n box-shadow: 0 0 4px 0 #eee;\n cursor: pointer;\n}\n.x6-widget-minimap .x6-graph > svg {\n pointer-events: none;\n shape-rendering: optimizeSpeed;\n}\n.x6-widget-minimap .x6-graph .x6-node * {\n /* stylelint-disable-next-line */\n vector-effect: initial;\n}\n.x6-widget-minimap-viewport {\n position: absolute;\n box-sizing: content-box !important;\n margin: -2px 0 0 -2px;\n border: 2px solid #31d0c6;\n cursor: move;\n}\n.x6-widget-minimap-viewport-zoom {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n margin: 0 -6px -6px 0;\n background-color: #fff;\n border: 2px solid #31d0c6;\n border-radius: 50%;\n cursor: nwse-resize;\n}\n.x6-graph-scroller {\n position: relative;\n box-sizing: border-box;\n overflow: scroll;\n outline: none;\n}\n.x6-graph-scroller-content {\n position: relative;\n}\n.x6-graph-scroller-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-scroller .x6-graph {\n position: absolute;\n display: inline-block;\n margin: 0;\n box-shadow: none;\n}\n.x6-graph-scroller .x6-graph > svg {\n display: block;\n}\n.x6-graph-scroller.x6-graph-scroller-paged .x6-graph {\n box-shadow: 0 0 4px 0 #eee;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='false'] {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='true'] {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-graph-pagebreak {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-pagebreak-vertical {\n position: absolute;\n top: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 1px;\n border-left: 1px dashed #bdbdbd;\n}\n.x6-graph-pagebreak-horizontal {\n position: absolute;\n right: 0;\n left: 0;\n box-sizing: border-box;\n height: 1px;\n border-top: 1px dashed #bdbdbd;\n}\n.x6-widget-selection {\n position: absolute;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n.x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n.x6-widget-stencil {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-widget-stencil::after {\n position: absolute;\n top: 0;\n display: block;\n width: 100%;\n height: 20px;\n padding: 8px 0;\n line-height: 20px;\n text-align: center;\n opacity: 0;\n transition: top 0.1s linear, opacity 0.1s linear;\n content: ' ';\n pointer-events: none;\n}\n.x6-widget-stencil-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.x6-widget-stencil .x6-node [magnet]:not([magnet='passive']) {\n pointer-events: none;\n}\n.x6-widget-stencil-group {\n padding: 0;\n padding-bottom: 8px;\n overflow: hidden;\n user-select: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n padding-bottom: 0;\n}\n.x6-widget-stencil-group-title {\n position: relative;\n margin-top: 0;\n margin-bottom: 0;\n padding: 4px;\n cursor: pointer;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n}\n.x6-widget-stencil .unmatched {\n opacity: 0.3;\n}\n.x6-widget-stencil .x6-node.unmatched {\n display: none;\n}\n.x6-widget-stencil-group.unmatched {\n display: none;\n}\n.x6-widget-stencil-search-text {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n max-height: 30px;\n line-height: 30px;\n outline: 0;\n}\n.x6-widget-stencil.not-found::after {\n opacity: 1;\n content: attr(data-not-found-text);\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 30px;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 50px;\n}\n.x6-widget-stencil {\n color: #333;\n background: #f5f5f5;\n}\n.x6-widget-stencil-content {\n position: absolute;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-content {\n top: 32px;\n}\n.x6-widget-stencil.searchable > .x6-widget-stencil-content {\n top: 80px;\n}\n.x6-widget-stencil.not-found::after {\n position: absolute;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 80px;\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 60px;\n}\n.x6-widget-stencil-group {\n height: auto;\n margin-bottom: 1px;\n padding: 0;\n transition: none;\n}\n.x6-widget-stencil-group .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n max-height: 31px;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n position: relative;\n left: 0;\n box-sizing: border-box;\n width: 100%;\n height: 32px;\n padding: 0 5px 0 8px;\n color: #666;\n font-weight: 700;\n font-size: 12px;\n line-height: 32px;\n cursor: default;\n transition: all 0.3;\n}\n.x6-widget-stencil-title:hover,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title:hover {\n color: #444;\n}\n.x6-widget-stencil-title {\n background: #e9e9e9;\n}\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n background: #ededed;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title {\n padding-left: 32px;\n cursor: pointer;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n position: absolute;\n top: 6px;\n left: 8px;\n display: block;\n width: 18px;\n height: 18px;\n margin: 0;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n border: none;\n content: ' ';\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48L2c+PC9zdmc+');\n opacity: 0.4;\n transition: all 0.3s;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48cGF0aCBkPSJNOC44MTcgNS42MjN2Ni43NTZhLjU1OC41NTggMCAwMDEuMTE2IDBWNS42MjNhLjU1OC41NTggMCAxMC0xLjExNiAweiIvPjwvZz48L3N2Zz4=');\n opacity: 0.4;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil input[type='search'] {\n -webkit-appearance: textfield;\n}\n.x6-widget-stencil input[type='search']::-webkit-search-cancel-button,\n.x6-widget-stencil input[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n.x6-widget-stencil-search-text {\n display: block;\n width: 90%;\n margin: 8px 5%;\n padding-left: 8px;\n color: #333;\n background: #fff;\n border: 1px solid #e9e9e9;\n border-radius: 12px;\n outline: 0;\n}\n.x6-widget-stencil-search-text:focus {\n outline: 0;\n}\n.x6-widget-stencil::after {\n color: #808080;\n font-weight: 600;\n font-size: 12px;\n background: 0 0;\n}\n.x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n.x6-widget-knob {\n position: absolute;\n box-sizing: border-box;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n margin-left: -8px;\n cursor: pointer;\n user-select: none;\n}\n.x6-widget-knob::before,\n.x6-widget-knob::after {\n position: absolute;\n transform: rotate(45deg);\n content: '';\n}\n.x6-widget-knob::before {\n top: 4px;\n left: 4px;\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n background-color: #fff;\n}\n.x6-widget-knob::after {\n top: 5px;\n left: 5px;\n box-sizing: border-box;\n width: 6px;\n height: 6px;\n background-color: #fca000;\n}\n.x6-graph-print {\n position: relative;\n}\n.x6-graph-print .x6-graph-print-ready {\n display: none;\n}\n.x6-graph-print .x6-graph-print-preview {\n overflow: hidden !important;\n background: #fff !important;\n}\n@media print {\n html,\n html > body.x6-graph-printing {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n html > body.x6-graph-printing > * {\n display: none !important;\n }\n html > body.x6-graph-printing > .x6-graph-print {\n display: block !important;\n }\n .x6-graph-print {\n top: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden !important;\n page-break-after: always;\n background: #fff !important;\n }\n .x6-graph-print .x6-graph-print-ready {\n display: none;\n }\n}\n.x6-cell-tool-editor {\n position: relative;\n display: inline-block;\n min-height: 1em;\n margin: 0;\n padding: 0;\n line-height: 1;\n white-space: normal;\n text-align: center;\n vertical-align: top;\n overflow-wrap: normal;\n outline: none;\n transform-origin: 0 0;\n -webkit-user-drag: none;\n}\n.x6-edge-tool-editor {\n border: 1px solid #275fc5;\n border-radius: 2px;\n}\n";var e=document.querySelector("head");e&&e.insertBefore(n,e.firstChild)}},e.clean=function(){(r-=1)>0||(n&&n.parentNode&&n.parentNode.removeChild(n),n=null)}}(Rf||(Rf={}));var If,_f=function(){function e(){}return Object.defineProperty(e.prototype,"handleClassName",{get:function(){return If.handle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pie",{get:function(){return r(r({},e.defaultPieOptions),this.handleOptions.pie)},enumerable:!1,configurable:!0}),e.prototype.initHandles=function(){var t,e=this;if(this.handles=[],this.handleOptions.handles&&this.handleOptions.handles.forEach((function(t){return e.addHandle(t)})),"pie"===this.handleOptions.type){if(this.pie.toggles){var n=If.pieToggle;this.$pieToggles={},this.pie.toggles.forEach((function(t){var r=e.$("<div/>");e.applyAttrs(r,t.attrs),r.addClass(n).addClass(n+"-pos-"+(t.position||"e")).attr("data-name",t.name).appendTo(e.container),e.$pieToggles[t.name]=r}))}this.setPieIcons()}if(this.$handleContainer){var r=this.handleOptions.type||"surround";this.$handleContainer.addClass(If.wrap).addClass(If.animate).addClass(If.handle+"-"+r)}this.delegateEvents(((t={})["mousedown ."+If.handle]="onHandleMouseDown",t["touchstart ."+If.handle]="onHandleMouseDown",t["mousedown ."+If.pieToggle]="onPieToggleMouseDown",t["touchstart ."+If.pieToggle]="onPieToggleMouseDown",t))},e.prototype.onHandleMouseDown=function(t){var e=this.$(t.currentTarget).closest("."+If.handle).attr("data-action");e&&(t.preventDefault(),t.stopPropagation(),this.setEventData(t,{action:e,clientX:t.clientX,clientY:t.clientY,startX:t.clientX,startY:t.clientY}),"mousedown"===t.type&&2===t.button?this.triggerHandleAction(e,"contextmenu",t):(this.triggerHandleAction(e,"mousedown",t),this.delegateDocumentEvents({mousemove:"onHandleMouseMove",touchmove:"onHandleMouseMove",mouseup:"onHandleMouseUp",touchend:"onHandleMouseUp",touchcancel:"onHandleMouseUp"},t.data)))},e.prototype.onHandleMouseMove=function(t){var e=this.getEventData(t).action;e&&this.triggerHandleAction(e,"mousemove",t)},e.prototype.onHandleMouseUp=function(t){var e=this.getEventData(t).action;e&&(this.triggerHandleAction(e,"mouseup",t),this.undelegateDocumentEvents())},e.prototype.triggerHandleAction=function(t,e,n,i){n.preventDefault(),n.stopPropagation();var o=this.normalizeEvent(n),s=this.getEventData(o),a=this.graph.snapToGrid(o.clientX,o.clientY),l=this.graph.snapToGrid(s.clientX,s.clientY),u=a.x-l.x,c=a.y-l.y;this.trigger("action:"+t+":"+e,r({e:o,dx:u,dy:c,x:a.x,y:a.y,offsetX:n.clientX-s.startX,offsetY:n.clientY-s.startY},i)),s.clientX=n.clientX,s.clientY=n.clientY},e.prototype.onPieToggleMouseDown=function(t){t.stopPropagation();var e=this.$(t.target).closest("."+If.pieToggle).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)},e.prototype.setPieIcons=function(){var e=this;"pie"===this.handleOptions.type&&this.$handleContainer.find("."+If.handle).each((function(n,r){var i=e.$(r),o=i.attr("data-action"),s=If.pieSlice,a=e.getHandle(o);if(!a||!a.icon){var l=window.getComputedStyle(r,":before").getPropertyValue("content");if(l&&"none"!==l){var u=i.find("."+s+"-txt");u.length&&t.Vector.create(u[0]).text(l.replace(/['"]/g,""))}var c=i.css("background-image");if(c){var h=c.match(/url\(['"]?([^'"]+)['"]?\)/);if(h){var p=h[1],d=i.find("."+s+"-img");d.length>0&&t.Vector.create(d[0]).attr("xlink:href",p)}}}}))},e.prototype.getHandleIdx=function(t){return this.handles.findIndex((function(e){return e.name===t}))},e.prototype.hasHandle=function(t){return this.getHandleIdx(t)>=0},e.prototype.getHandle=function(t){return this.handles.find((function(e){return e.name===t}))},e.prototype.renderHandle=function(e){var n=this.$("<div/>").addClass(If.handle+" "+If.handle+"-"+e.name).attr("data-action",e.name).prop("draggable",!1);if("pie"===this.handleOptions.type){var r=this.getHandleIdx(e.name),i=this.pie,o=i.outerRadius,s=i.innerRadius,a=(o+s)/2,l=new t.Point(o,o),u=t.Angle.toRad(i.sliceAngle),c=r*u+t.Angle.toRad(i.startAngle),h=Ql(s,o,c,c+u),p=t.Vector.create("svg").addClass(If.pieSlice+"-svg"),d=t.Vector.create("path").addClass(If.pieSlice).attr("d",h).translate(o,o),f=t.Point.fromPolar(a,-c-u/2,l).toJSON(),g=i.iconSize,v=t.Vector.create("image").attr(f).addClass(If.pieSlice+"-img");f.y=f.y+g-2;var y=t.Vector.create("text",{"font-size":g}).attr(f).addClass(If.pieSlice+"-txt");v.attr({width:g,height:g}),v.translate(-g/2,-g/2),y.translate(-g/2,-g/2),p.append([d,v,y]),n.append(p.node)}else n.addClass(If.handle+"-pos-"+e.position),e.content&&("string"==typeof e.content?n.html(e.content):n.append(e.content));return this.updateHandleIcon(n,e.icon),this.applyAttrs(n,e.attrs),n},e.prototype.addHandle=function(t){var e=this;if(!this.hasHandle(t.name)){this.handles.push(t);var n=t.events;n&&Object.keys(n).forEach((function(r){var i=n[r],o="action:"+t.name+":"+r;"string"==typeof i?e.on(o,e[i],e):e.on(o,i)})),this.$handleContainer&&this.$handleContainer.append(this.renderHandle(t))}return this},e.prototype.addHandles=function(t){var e=this;return t.forEach((function(t){return e.addHandle(t)})),this},e.prototype.removeHandles=function(){for(;this.handles.length;)this.removeHandle(this.handles[0].name);return this},e.prototype.removeHandle=function(t){var e=this,n=this.getHandleIdx(t),r=this.handles[n];return r&&(r.events&&Object.keys(r.events).forEach((function(n){e.off("action:"+t+":"+n)})),this.getHandleElem(t).remove(),this.handles.splice(n,1)),this},e.prototype.changeHandle=function(t,e){var n=this.getHandle(t);return n&&(this.removeHandle(t),this.addHandle(r(r({},n),e))),this},e.prototype.toggleHandle=function(t,e){var n=this.getHandle(t);if(n){var r=this.getHandleElem(t),i=If.handle+"-selected";void 0===e&&(e=!r.hasClass(i)),r.toggleClass(i,e);var o=e?n.iconSelected:n.icon;o&&this.updateHandleIcon(r,o)}return this},e.prototype.selectHandle=function(t){return this.toggleHandle(t,!0)},e.prototype.deselectHandle=function(t){return this.toggleHandle(t,!1)},e.prototype.deselectAllHandles=function(){var t=this;return this.handles.forEach((function(e){return t.deselectHandle(e.name)})),this},e.prototype.getHandleElem=function(t){return this.$handleContainer.find("."+If.handle+"-"+t)},e.prototype.updateHandleIcon=function(t,e){if("pie"===this.handleOptions.type){var n=t.find("."+If.pieSliceImg);this.$(n[0]).attr("xlink:href",e||"")}else t.css("background-image",e?"url("+e+")":"")},e.prototype.isRendered=function(){return null!=this.$handleContainer},e.prototype.isOpen=function(t){return!!this.isRendered()&&(t?this.$pieToggles[t].hasClass(If.pieToggleOpened):this.$handleContainer.hasClass(""+If.pieOpended))},e.prototype.toggleState=function(t){var e=this;if(this.isRendered()){var n=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach((function(t){e.$pieToggles[t].removeClass(If.pieToggleOpened)})),this.isOpen())this.trigger("pie:close",{name:t}),n.removeClass(If.pieOpended);else{if(this.trigger("pie:open",{name:t}),t){var r=this.pie.toggles,i=r&&r.find((function(e){return e.name===t}));i&&n.attr({"data-pie-toggle-name":i.name,"data-pie-toggle-position":i.position}),this.$pieToggles[t].addClass(If.pieToggleOpened)}n.addClass(If.pieOpended)}}},e.prototype.applyAttrs=function(e,n){if(n){var r=t.View.$(e);Object.keys(n).forEach((function(t){var e=r.find(t).addBack().filter(t),o=n[t],s=o.class,a=i(o,["class"]);s&&e.addClass(s),e.attr(a)}))}},e}();!function(t){t.defaultPieOptions={innerRadius:20,outerRadius:50,sliceAngle:45,startAngle:0,iconSize:14,toggles:[{name:"default",position:"e"}]}}(_f||(_f={})),function(e){e.handle=t.View.prototype.prefixClassName("widget-handle"),e.wrap=e.handle+"-wrap",e.animate=e.handle+"-animate",e.pieOpended=e.handle+"-pie-opened",e.pieToggle=e.handle+"-pie-toggle",e.pieToggleOpened=e.handle+"-pie-toggle-opened",e.pieSlice=e.handle+"-pie-slice",e.pieSliceImg=e.handle+"-pie-slice-img"}(If||(If={}));var Gf,Hf,Uf=function(e){function r(t){var n=e.call(this)||this,r=t,o=r.view,s=r.cell,a=r.node,l=r.edge,u=r.graph,c=i(r,["view","cell","node","edge","graph"]);o?(n.view=o,n.cell=o.cell,n.graph=o.graph,n.model=n.graph.model):(s||l||a)&&u&&(n.cell=a||l||s,n.view=u.renderer.findViewByCell(n.cell),n.graph=u,n.model=n.graph.model);var h=n.constructor;return!1!==t.clearAll&&h.removeInstances(n.graph),h.register(n),n.init(c),n}return n(r,e),r.ensureCache=function(){return this.instanceCache.has(this)||this.instanceCache.set(this,{}),this.instanceCache.get(this)},r.register=function(t,e){null==e&&(e=t.graph);var n=this.ensureCache(),r=n[e.view.cid];null==r&&(r=n[e.view.cid]={}),r[t.cid]=t},r.unregister=function(t,e){null==e&&(e=t.graph);var n=this.ensureCache();n[e.view.cid]&&delete n[e.view.cid][t.cid]},r.removeInstances=function(t){var e=this.ensureCache()[t.view.cid];e&&Object.keys(e).forEach((function(t){var n=e[t];n&&n.remove()}))},r.getInstances=function(t){return this.ensureCache()[t.view.cid]||{}},r.prototype.init=function(t){},r.prototype.render=function(){return this},r.prototype.startListening=function(){!1!==this.options.clearOnBlankMouseDown&&this.graph.on("blank:mousedown",this.remove,this)},r.prototype.stopListening=function(){!1!==this.options.clearOnBlankMouseDown&&this.graph.off("blank:mousedown",this.remove,this)},r.prototype.remove=function(){return this.stopListening(),this.constructor.unregister(this),e.prototype.remove.call(this)},r.prototype.dispose=function(){this.remove()},r.instanceCache=new WeakMap,o([t.View.dispose()],r.prototype,"dispose",null),r}(t.View),qf=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),Object.defineProperty(i.prototype,"node",{get:function(){return this.cell},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"metadata",{get:function(){var t=this.cell.prop("knob");return Array.isArray(t)?null!=this.options.index?t[this.options.index]:null:t},enumerable:!1,configurable:!0}),i.prototype.init=function(t){this.options=r({},t),this.render(),this.startListening()},i.prototype.startListening=function(){this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.model.on("reseted",this.remove,this),this.node.on("removed",this.remove,this),this.view.on("node:resize:mousedown",this.onTransform,this),this.view.on("node:rotate:mousedown",this.onTransform,this),this.view.on("node:resize:mouseup",this.onTransformed,this),this.view.on("node:rotate:mouseup",this.onTransformed,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),e.prototype.startListening.call(this)},i.prototype.stopListening=function(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.model.off("reseted",this.remove,this),this.node.off("removed",this.remove,this),this.view.off("node:resize:mousedown",this.onTransform,this),this.view.off("node:rotate:mousedown",this.onTransform,this),this.view.off("node:resize:mouseup",this.onTransformed,this),this.view.off("node:rotate:mouseup",this.onTransformed,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),e.prototype.stopListening.call(this)},i.prototype.render=function(){return this.container=document.createElement("div"),oa(this.container,this.prefixClassName("widget-knob")),this.options.className&&oa(this.container,this.options.className),this.view.addClass(Gf.KNOB),this.graph.container.appendChild(this.container),this.update(),this},i.prototype.remove=function(){return this.view.removeClass(Gf.KNOB),e.prototype.remove.call(this)},i.prototype.update=function(){if(this.metadata){var e=this.metadata,n=e.update,i=e.position,o={knob:this,cell:this.cell,node:this.node};if(i){var s=i.call(this.graph,r({},o));if(s){var a=this.graph.matrix(),l=this.node.getBBox(),u=t.Angle.normalize(this.node.getAngle()),c=t.Point.create(s);0!==u&&c.rotate(-u,{x:l.width/2,y:l.height/2}),c.translate(l).scale(a.a,a.d).translate(a.e,a.f),this.container.style.left=c.x+"px",this.container.style.top=c.y+"px"}}n&&n.call(this.graph,r({},o))}},i.prototype.hide=function(){this.container.style.display="none"},i.prototype.show=function(){this.container.style.display=""},i.prototype.onTransform=function(){this.hide()},i.prototype.onTransformed=function(){this.show()},i.prototype.onKnobMouseDown=function(t){var e=t.knob;this.cid!==e.cid&&this.hide()},i.prototype.onKnobMouseUp=function(){this.show()},i.prototype.notify=function(t,e){if(this.view){var n=this.view.normalizeEvent(e),r=this.graph.snapToGrid(n.clientX,n.clientY);this.view.notify("cell:"+t,{e:n,view:this.view,node:this.node,cell:this.cell,x:r.x,y:r.y,knob:this}),this.cell.isNode()?this.view.notify("node:"+t,{e:n,view:this.view,node:this.node,cell:this.cell,x:r.x,y:r.y,knob:this}):this.cell.isEdge()&&this.view.notify("edge:"+t,{e:n,view:this.view,edge:this.cell,cell:this.cell,x:r.x,y:r.y,knob:this})}},i.prototype.onMouseDown=function(t){t.stopPropagation(),this.setEventData(t,{knobbing:!1,originX:t.clientX,originY:t.clientY,clientX:t.clientX,clientY:t.clientY}),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(Gf.documentEvents,t.data),this.metadata&&this.metadata.onMouseDown&&this.metadata.onMouseDown.call(this.graph,{e:t,data:this.getEventData(t),knob:this,cell:this.cell,node:this.node}),this.notify("knob:mousedown",t)},i.prototype.onMouseMove=function(e){var n=this.getEventData(e),r=this.graph.findViewByCell(this.node);if(n.knobbing||(n.knobbing=!0,r&&(r.addClass(Gf.KNOBBING),this.notify("knob",e)),this.model.startBatch("knob",{cid:this.cid})),n.clientX=e.clientX,n.clientY=e.clientY,this.metadata&&this.metadata.onMouseMove){var i=this.graph.matrix(),o=(e.clientX-n.originX)/i.a,s=(e.clientY-n.originY)/i.d,a=this.node.getAngle(),l=new t.Point(o,s).rotate(a);this.metadata.onMouseMove.call(this.graph,{e:e,data:n,deltaX:l.x,deltaY:l.y,knob:this,cell:this.cell,node:this.node})}this.notify("knobbing",e),this.notify("knob:mousemove",e)},i.prototype.onMouseUp=function(t){this.undelegateDocumentEvents(),this.graph.view.delegateEvents();var e=this.getEventData(t),n=this.graph.findViewByCell(this.node);e.knobbing&&(n&&n.removeClass(Gf.KNOBBING),this.metadata&&this.metadata.onMouseUp&&this.metadata.onMouseUp.call(this.graph,{e:t,data:e,knob:this,cell:this.cell,node:this.node}),this.model.stopBatch("knob",{cid:this.cid}),this.notify("knobbed",t)),this.notify("knob:mouseup",t)},i}(Uf);!function(t){t.KNOB="has-widget-knob",t.KNOBBING="node-knobbing",t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"}}(Gf||(Gf={})),function(t){t.root="widget-minimap",t.viewport=t.root+"-viewport",t.zoom=t.viewport+"-zoom"}(Hf||(Hf={}));var $f,Wf=function(e){function i(n){var i=e.call(this)||this;i.options=r(r({},$f.defaultOptions),n),i.updateViewport=gi(i.updateViewport.bind(i),0),i.container=document.createElement("div"),i.$container=i.$(i.container).addClass(i.prefixClassName(Hf.root));var o=document.createElement("div");i.container.appendChild(o),i.$viewport=i.$("<div>").addClass(i.prefixClassName(Hf.viewport)),i.options.scalable&&(i.zoomHandle=i.$("<div>").addClass(i.prefixClassName(Hf.zoom)).appendTo(i.$viewport).get(0)),i.$container.append(i.$viewport).css({width:i.options.width,height:i.options.height,padding:i.options.padding}),i.options.container&&i.options.container.appendChild(i.container),i.sourceGraph=i.graph;var s=r(r({},i.options.graphOptions),{container:o,model:i.sourceGraph.model,frozen:!0,async:i.sourceGraph.isAsync(),interacting:!1,grid:!1,background:!1,rotating:!1,resizing:!1,embedding:!1,selecting:!1,snapline:!1,clipboard:!1,history:!1,scroller:!1});return i.targetGraph=i.options.createGraph?i.options.createGraph(s):new t.Graph(s),i.targetGraph.renderer.unfreeze(),i.updatePaper(i.sourceGraph.options.width,i.sourceGraph.options.height),i.startListening(),i}return n(i,e),Object.defineProperty(i.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scroller",{get:function(){return this.graph.scroller.widget},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"graphContainer",{get:function(){return this.scroller?this.scroller.container:this.graph.container},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"$graphContainer",{get:function(){return this.scroller?this.scroller.$container:this.$(this.graph.container)},enumerable:!1,configurable:!0}),i.prototype.startListening=function(){var t;this.scroller?this.$graphContainer.on("scroll"+this.getEventNamespace(),this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents(((t={mousedown:"startAction",touchstart:"startAction"})["mousedown ."+this.prefixClassName("graph")]="scrollTo",t["touchstart ."+this.prefixClassName("graph")]="scrollTo",t))},i.prototype.stopListening=function(){this.scroller?this.$graphContainer.off(this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()},i.prototype.onRemove=function(){this.targetGraph.view.remove(),this.stopListening(),this.targetGraph.dispose()},i.prototype.onTransform=function(t){(t.ui||this.targetGraphTransforming)&&this.updateViewport()},i.prototype.onModelUpdated=function(){this.targetGraph.zoomToFit()},i.prototype.updatePaper=function(t,e){var n,r;"object"==typeof t?(n=t.width,r=t.height):(n=t,r=e);var i=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),s=this.options.width-2*this.options.padding,a=this.options.height-2*this.options.padding;n/=o.sx,r/=o.sy,this.ratio=Math.min(s/n,a/r);var l=this.ratio,u=i.x*l/o.sx,c=i.y*l/o.sy;return n*=l,r*=l,this.targetGraph.resizeGraph(n,r),this.targetGraph.translate(u,c),this.scroller?this.targetGraph.scale(l,l):this.targetGraph.zoomToFit(),this.updateViewport(),this},i.prototype.updateViewport=function(){var t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale(),n=null;n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0);var r=this.$(this.targetGraph.container).position(),i=this.targetGraph.translate();i.ty=i.ty||0,this.geometry={top:r.top+n.y*e.sy+i.ty,left:r.left+n.x*e.sx+i.tx,width:this.$graphContainer.innerWidth()*e.sx/t.sx,height:this.$graphContainer.innerHeight()*e.sy/t.sy},this.$viewport.css(this.geometry)},i.prototype.startAction=function(t){var e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",r=this.sourceGraph.translate(),i=r.tx,o=r.ty,s={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:o};this.targetGraphTransforming=!0,this.delegateDocumentEvents($f.documentEvents,s)},i.prototype.doAction=function(t){var e=this,n=this.normalizeEvent(t),r=n.clientX,i=n.clientY,o=n.data;switch(o.action){case"panning":var s=this.sourceGraph.transform.getScale(),a=(r-o.clientX)*s.sx,l=(i-o.clientY)*s.sy;this.scroller?(this.graphContainer.scrollLeft=o.scrollLeft+a/this.ratio,this.graphContainer.scrollTop=o.scrollTop+l/this.ratio):this.sourceGraph.translate(o.translateX-a/this.ratio,o.translateY-l/this.ratio);break;case"zooming":var u=o.scale,c=o.geometry,h=1+(o.clientX-r)/c.width/u.sx;o.frameId&&cancelAnimationFrame(o.frameId),o.frameId=requestAnimationFrame((function(){e.sourceGraph.zoom(h*o.zoom,{absolute:!0,minScale:e.options.minScale,maxScale:e.options.maxScale})}))}},i.prototype.stopAction=function(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1},i.prototype.scrollTo=function(t){var e,n,r=this.normalizeEvent(t),i=this.targetGraph.translate();if(i.ty=i.ty||0,null==r.offsetX){var o=this.$(this.targetGraph.container).offset();e=r.pageX-o.left,n=r.pageY-o.top}else e=r.offsetX,n=r.offsetY;var s=(e-i.tx)/this.ratio,a=(n-i.ty)/this.ratio;this.sourceGraph.centerPoint(s,a)},i.prototype.dispose=function(){this.remove()},o([t.View.dispose()],i.prototype,"dispose",null),i}(t.View);!function(e){e.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:function(e){return new t.Graph(e)}},e.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}($f||($f={}));var Xf=function(e){function s(t){var n=e.call(this)||this,o=t.graph,s=i(t,["graph"]);return n.graph=o,n.options=r({tolerance:10},s),n.offset={x:0,y:0},n.render(),n.parseFilter(),n.disabled||n.startListening(),n}return n(s,e),Object.defineProperty(s.prototype,"model",{get:function(){return this.graph.model},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"containerClassName",{get:function(){return this.prefixClassName("widget-snapline")},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"verticalClassName",{get:function(){return this.containerClassName+"-vertical"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"horizontalClassName",{get:function(){return this.containerClassName+"-horizontal"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"disabled",{get:function(){return!0!==this.options.enabled||!0!==this.graph.options.snapline.enabled},enumerable:!1,configurable:!0}),s.prototype.enable=function(){this.disabled&&(this.options.enabled=!0,this.graph.options.snapline.enabled=!0,this.startListening())},s.prototype.disable=function(){this.disabled||(this.options.enabled=!1,this.graph.options.snapline.enabled=!1,this.stopListening())},s.prototype.setFilter=function(t){this.options.filter=t,this.parseFilter()},s.prototype.render=function(){var e=this.containerWrapper=new t.Vector("svg"),n=this.horizontal=new t.Vector("path"),r=this.vertical=new t.Vector("path");e.addClass(this.containerClassName),n.addClass(this.horizontalClassName),r.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),n.setAttribute("display","none"),r.setAttribute("display","none"),e.append([n,r]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node},s.prototype.startListening=function(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})},s.prototype.stopListening=function(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()},s.prototype.parseFilter=function(){var t=this;this.filterShapes={},this.filterCells={},this.filterFunction=null;var e=this.options.filter;Array.isArray(e)?e.forEach((function(e){"string"==typeof e?t.filterShapes[e]=!0:t.filterCells[e.id]=!0})):"function"==typeof e&&(this.filterFunction=e)},s.prototype.onBatchStop=function(t){var e=t.name,n=t.data;"resize"===e&&this.snapOnResizing(n.cell,n)},s.prototype.captureCursorOffset=function(t){var e=t.view,n=t.x,r=t.y,i=e.getDelegatedView();if(i&&this.isNodeMovable(i)){var o=e.cell.getPosition();this.offset={x:n-o.x,y:r-o.y}}},s.prototype.isNodeMovable=function(t){return t&&t.cell.isNode()&&t.can("nodeMovable")},s.prototype.snapOnResizing=function(e,n){var r=this;if(this.options.resizing&&!n.snapped&&n.ui&&n.direction&&n.trueDirection){var i=this.graph.renderer.findViewByCell(e);if(i&&i.cell.isNode()){var o,s,a,l,u,c,h=e.getBBox(),p=h.bbox(e.getAngle()),d=p.getTopLeft(),f=p.getBottomRight(),g=t.Angle.normalize(e.getAngle()),v=this.options.tolerance||0,y={vertical:0,horizontal:0},m=n.direction,b=n.trueDirection,C=n.relativeDirection;-1!==b.indexOf("right")?y.vertical=f.x:y.vertical=d.x,-1!==b.indexOf("bottom")?y.horizontal=f.y:y.horizontal=d.y,this.model.getNodes().some((function(t){if(r.isIgnored(e,t))return!1;var n=t.getBBox().bbox(t.getAngle()),i=n.getTopLeft(),h=n.getBottomRight(),d={vertical:[i.x,h.x],horizontal:[i.y,h.y]},g={};return Object.keys(d).forEach((function(t){var e=t,n=d[e].map((function(t){return{position:t,distance:Math.abs(t-y[e])}})).filter((function(t){return t.distance<=v}));g[e]=No(n,(function(t){return t.distance}))})),null==o&&g.vertical.length>0&&(o=g.vertical[0].position,s=Math.min(p.y,n.y),a=Math.max(f.y,h.y)-s),null==l&&g.horizontal.length>0&&(l=g.horizontal[0].position,u=Math.min(p.x,n.x),c=Math.max(f.x,h.x)-u),null!=o&&null!=l})),this.hide();var x=0,w=0;null==l&&null==o||(null!=o&&(x=-1!==b.indexOf("right")?o-f.x:d.x-o),null!=l&&(w=-1!==b.indexOf("bottom")?l-f.y:d.y-l));var P=0,A=0;if(g%90==0)90===g||270===g?(P=w,A=x):(P=x,A=w);else{var E=g>=0&&g<90?1:g>=90&&g<180?4:g>=180&&g<270?3:2;null!=l&&null!=o&&(x<w?(w=0,l=void 0):(x=0,o=void 0));var M=t.Angle.toRad(g%90);x&&(P=3===E?x/Math.cos(M):x/Math.sin(M)),w&&(A=3===E?w/Math.cos(M):w/Math.sin(M));var S=1===E||3===E;switch(C){case"top":case"bottom":A=w?w/(S?Math.cos(M):Math.sin(M)):x/(S?Math.sin(M):Math.cos(M));break;case"left":case"right":P=x?x/(S?Math.cos(M):Math.sin(M)):w/(S?Math.sin(M):Math.cos(M))}}switch(C){case"top":case"bottom":P=0;break;case"left":case"right":A=0}var k=this.graph.getGridSize(),T=Math.max(h.width+P,k),D=Math.max(h.height+A,k);n.minWidth&&n.minWidth>k&&(T=Math.max(T,n.minWidth)),n.minHeight&&n.minHeight>k&&(D=Math.max(D,n.minHeight)),n.maxWidth&&(T=Math.min(T,n.maxWidth)),n.maxHeight&&(D=Math.min(D,n.maxHeight)),n.preserveAspectRatio&&(A<P?D=T*(h.height/h.width):T=D*(h.width/h.height)),T===h.width&&D===h.height||(e.resize(T,D,{direction:m,relativeDirection:C,trueDirection:b,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(i)}),a&&(a+=D-h.height),c&&(c+=T-h.width));var N=e.getBBox().bbox(g);o&&Math.abs(N.x-o)>1&&Math.abs(N.width+N.x-o)>1&&(o=void 0),l&&Math.abs(N.y-l)>1&&Math.abs(N.height+N.y-l)>1&&(l=void 0),this.update({verticalLeft:o,verticalTop:s,verticalHeight:a,horizontalTop:l,horizontalLeft:u,horizontalWidth:c})}}},s.prototype.snapOnMoving=function(e){var n=this,r=e.view,i=e.e,o=e.x,s=e.y,a=r.getEventData(i).delegatedView||r;if(this.isNodeMovable(a)){var l,u,c,h,p,d,f=a.cell,g=f.getSize(),v=f.getPosition(),y=new t.Rectangle(o-this.offset.x,s-this.offset.y,g.width,g.height),m=f.getAngle(),b=y.getCenter(),C=y.bbox(m),x=C.getTopLeft(),w=C.getBottomRight(),P=this.options.tolerance||0,A=0,E=0;if(this.model.getNodes().some((function(t){if(n.isIgnored(f,t))return!1;var e=t.getBBox().bbox(t.getAngle()),r=e.getCenter(),i=e.getTopLeft(),o=e.getBottomRight();return null==l&&(Math.abs(r.x-b.x)<P?(l=r.x,A=.5):Math.abs(i.x-x.x)<P?(l=i.x,A=0):Math.abs(i.x-w.x)<P?(l=i.x,A=1):Math.abs(o.x-w.x)<P?(l=o.x,A=1):Math.abs(o.x-x.x)<P&&(l=o.x),null!=l&&(u=Math.min(C.y,e.y),c=Math.max(w.y,o.y)-u)),null==h&&(Math.abs(r.y-b.y)<P?(h=r.y,E=.5):Math.abs(i.y-x.y)<P?h=i.y:Math.abs(i.y-w.y)<P?(h=i.y,E=1):Math.abs(o.y-w.y)<P?(h=o.y,E=1):Math.abs(o.y-x.y)<P&&(h=o.y),null!=h&&(p=Math.min(C.x,e.x),d=Math.max(w.x,o.x)-p)),null!=l&&null!=h})),this.hide(),null!=h||null!=l){null!=h&&(C.y=h-E*C.height),null!=l&&(C.x=l-A*C.width);var M=C.getCenter(),S=M.x-y.width/2,k=M.y-y.height/2,T=S-v.x,D=k-v.y;0===T&&0===D||(f.translate(T,D,{snapped:!0,restrict:this.graph.hook.getRestrictArea(a)}),d&&(d+=T),c&&(c+=D)),this.update({verticalLeft:l,verticalTop:u,verticalHeight:c,horizontalTop:h,horizontalLeft:p,horizontalWidth:d})}}},s.prototype.isIgnored=function(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&Ws(this.filterFunction,this.graph,e)},s.prototype.update=function(e){if(e.horizontalTop){var n=this.graph.localToGraph(new t.Point(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new t.Point(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({d:"M "+n.x+","+n.y+" L "+r.x+","+r.y,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){n=this.graph.localToGraph(new t.Point(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new t.Point(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({d:"M "+n.x+","+n.y+" L "+r.x+","+r.y,display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()},s.prototype.resetTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},s.prototype.show=function(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this},s.prototype.hide=function(){var t=this;this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");var e=this.options.clean,n="number"==typeof e?e:!1!==e?3e3:0;return n>0&&(this.timer=window.setTimeout((function(){null!==t.container.parentNode&&t.unmount()}),n)),this},s.prototype.onRemove=function(){this.stopListening(),this.hide()},s.prototype.dispose=function(){this.remove()},o([t.View.dispose()],s.prototype,"dispose",null),s}(t.View),Yf=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.init=function(){this.resetUpdates(),this.startListening(),this.resetViews(this.model.getCells()),!this.isFrozen()&&this.isAsync()&&this.updateViewsAsync()},i.prototype.startListening=function(){this.model.on("sorted",this.onSortModel,this),this.model.on("reseted",this.onModelReseted,this),this.model.on("batch:stop",this.onBatchStop,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)},i.prototype.stopListening=function(){this.model.off("sorted",this.onSortModel,this),this.model.off("reseted",this.onModelReseted,this),this.model.off("batch:stop",this.onBatchStop,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)},i.prototype.resetUpdates=function(){this.updates={priorities:[{},{},{}],mounted:{},mountedCids:[],unmounted:{},unmountedCids:[],count:0,sort:!1,frozen:!1,freezeKey:null,animationId:null}},i.prototype.onSortModel=function(){this.model.hasActiveBatch(i.SORT_DELAYING_BATCHES)||this.sortViews()},i.prototype.onModelReseted=function(t){var e=t.options;this.removeZPivots(),this.resetViews(this.model.getCells(),e)},i.prototype.onBatchStop=function(t){var e=t.name,n=t.data;if(!this.isFrozen()){var r=this.model;if(!this.isAsync()){var o=i.UPDATE_DELAYING_BATCHES;o.includes(e)&&!r.hasActiveBatch(o)&&this.updateViews(n)}var s=i.SORT_DELAYING_BATCHES;s.includes(e)&&!r.hasActiveBatch(s)&&this.sortViews()}},i.prototype.onCellAdded=function(t){var e=t.cell,n=t.options,r=n.position;this.isAsync()||"number"!=typeof r?this.renderView(e,n):(n.maxPosition===r&&this.freeze({key:"addCells"}),this.renderView(e,n),0===r&&this.unfreeze({key:"addCells"}))},i.prototype.onCellRemoved=function(t){var e=t.cell,n=t.options,r=this.findViewByCell(e);r&&this.requestViewUpdate(r,i.FLAG_REMOVE,r.priority,n)},i.prototype.onCellZIndexChanged=function(t){var e=t.cell,n=t.options;if("approx"===this.options.sorting){var r=this.findViewByCell(e);r&&this.requestViewUpdate(r,i.FLAG_INSERT,r.priority,n)}},i.prototype.onCellVisibleChanged=function(t){var e=t.cell,n=t.current,r=t.options;n||this.processEdgeOnTerminalVisibleChanged(e,!1);var i=this.findViewByCell(e);!n&&i?this.removeView(e):n&&null==i&&this.renderView(e,r),n&&this.processEdgeOnTerminalVisibleChanged(e,!0),this.sortViews()},i.prototype.processEdgeOnTerminalVisibleChanged=function(t,e){this.model.getConnectedEdges(t).forEach((function(n){var r=function(t,e){return t.getSourceCellId()!==e.id?t.getSourceCell():t.getTargetCellId()!==e.id?t.getTargetCell():null}(n,t);(null==r||r.isVisible())&&(e?n.show():n.hide())}))},i.prototype.isEdgeTerminalVisible=function(t,e){var n="source"===e?t.getSourceCellId():t.getTargetCellId(),r=n?this.model.getCell(n):null;return!(r&&!r.isVisible())},i.prototype.requestConnectedEdgesUpdate=function(e,n){if(void 0===n&&(n={}),t.CellView.isCellView(e))for(var r=e.cell,i=this.model.getConnectedEdges(r),o=0,s=i.length;o<s;o+=1){var a=i[o],l=this.findViewByCell(a);if(l){var u=["update"];a.getTargetCell()===r&&u.push("target"),a.getSourceCell()===r&&u.push("source"),this.scheduleViewUpdate(l,l.getFlag(u),l.priority,n)}}},i.prototype.forcePostponedViewUpdate=function(e,n){if(!e||!t.CellView.isCellView(e))return!1;var r=e.cell;if(r.isNode())return!1;var i=e;if(r.isEdge()&&0==(n&e.getFlag(["source","target"]))){var o=0,s=this.findViewByCell(r.getSourceCell());s&&!this.isViewMounted(s)&&(o=this.dumpView(s),i.updateTerminalMagnet("source"));var a=0,l=this.findViewByCell(r.getTargetCell());if(l&&!this.isViewMounted(l)&&(a=this.dumpView(l),i.updateTerminalMagnet("target")),0===o&&0===a)return!this.dumpView(i)}return!1},i.prototype.scheduleViewUpdate=function(t,e,n,r){void 0===r&&(r={});var o=t.cid,s=this.updates,a=s.priorities[n];a||(a=s.priorities[n]={});var l=a[o]||0;(l&e)!==e&&(l||(s.count+=1),e&i.FLAG_REMOVE&&l&i.FLAG_INSERT?a[o]^=i.FLAG_INSERT:e&i.FLAG_INSERT&&l&i.FLAG_REMOVE&&(a[o]^=i.FLAG_REMOVE),a[o]|=e,this.graph.hook.onViewUpdated(t,e,r))},i.prototype.requestViewUpdate=function(t,e,n,r){void 0===r&&(r={}),this.scheduleViewUpdate(t,e,n,r);var o=this.isAsync();if(!(this.isFrozen()||o&&!1!==r.async||this.model.hasActiveBatch(i.UPDATE_DELAYING_BATCHES))){var s=this.updateViews(r);o&&this.graph.trigger("render:done",{stats:s,options:r})}},i.prototype.dumpView=function(t,e){if(void 0===e&&(e={}),null==t)return 0;var n=t.cid,r=this.updates.priorities[t.priority],i=this.registerMountedView(t)|r[n];return delete r[n],i?this.updateView(t,i,e):0},i.prototype.dumpViews=function(t){void 0===t&&(t={}),this.checkView(t),this.updateViews(t)},i.prototype.requireView=function(t,e){void 0===e&&(e={});var n=this.findViewByCell(t);return null==n?null:(this.dumpView(n,e),n)},i.prototype.updateView=function(e,n,r){if(void 0===r&&(r={}),null==e)return 0;if(t.CellView.isCellView(e)){if(n&i.FLAG_REMOVE)return this.removeView(e.cell),0;n&i.FLAG_INSERT&&(this.insertView(e),n^=i.FLAG_INSERT)}return n?e.confirmUpdate(n,r):0},i.prototype.updateViews=function(t){var e;void 0===t&&(t={});var n=0,r=0,o=i.MIN_PRIORITY;do{n+=1,r+=(e=this.updateViewsBatch(t)).updatedCount,o=Math.min(e.priority,o)}while(!e.empty);return{priority:o,batchCount:n,updatedCount:r}},i.prototype.updateViewsBatch=function(e){void 0===e&&(e={});var n=this.updates,r=n.priorities,o=e.batchSize||i.UPDATE_BATCH_SIZE,s=!0,a=i.MIN_PRIORITY,l=0,u=0,c=0,h=0,p=e.checkView||this.options.checkView;"function"!=typeof p&&(p=null);t:for(var d=0,f=r.length;d<f;d+=1){var g=r[d];for(var v in g){if(c>=o){s=!1;break t}var y=t.View.views[v];if(y){var m=g[v];if(0==(m&i.FLAG_REMOVE)){var b=v in n.unmounted;if(p&&!Ws(p,this.graph,{view:y,unmounted:b})){b||(this.registerUnmountedView(y),y.unmount()),n.unmounted[v]|=m,delete g[v],u+=1;continue}b&&(m|=i.FLAG_INSERT,l+=1),m|=this.registerMountedView(y)}var C=y,x=this.updateView(y,m,e);if(x>0){var w=C.cell;w&&w.isEdge()&&(C.hasAction(x,"source")&&!this.isEdgeTerminalVisible(w,"source")&&(x=C.removeAction(x,"source"),x|=i.FLAG_REMOVE),C.hasAction(x,"target")&&!this.isEdgeTerminalVisible(w,"target")&&(x=C.removeAction(x,"target"),x|=i.FLAG_REMOVE))}x>0&&(g[v]=x,!this.graph.hook.onViewPostponed(C,x,e)||g[v])?(h+=1,s=!1):(a>d&&(a=d),c+=1,delete g[v])}else delete g[v]}}return{empty:s,priority:a,mountedCount:l,unmountedCount:u,updatedCount:c,postponedCount:h}},i.prototype.updateViewsAsync=function(t,e){var n=this;void 0===t&&(t={}),void 0===e&&(e={processed:0,priority:i.MIN_PRIORITY});var r=this.updates,o=r.animationId;if(o){if(Ja(o),0===e.processed){var s=t.before;"function"==typeof s&&Ws(s,this.graph,this.graph)}var a=this.updateViewsBatch(t),l=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:i.MOUNT_BATCH_SIZE-a.mountedCount,unmountedBatchSize:i.MOUNT_BATCH_SIZE-a.unmountedCount}),u=e.processed,c=r.count,h=l.mountedCount,p=l.unmountedCount;a.updatedCount>0&&(u+=a.updatedCount+a.unmountedCount,e.priority=Math.min(a.priority,e.priority),a.empty&&0===h?(a.priority=e.priority,a.mountedCount+=h,a.unmountedCount+=p,this.graph.trigger("render:done",{stats:a,options:t}),e.processed=0,r.count=0):e.processed=u);var d=t.progress;if(c&&"function"==typeof d&&Ws(d,this.graph,{total:c,done:a.empty,current:u}),r.animationId!==o)return}r.animationId=Ya((function(){n.updateViewsAsync(t,e)}))},i.prototype.registerMountedView=function(t){var e=t.cid,n=this.updates;if(e in n.mounted)return 0;n.mounted[e]=!0,n.mountedCids.push(e);var r=n.unmounted[e]||0;return delete n.unmounted[e],r},i.prototype.registerUnmountedView=function(t){var e=t.cid,n=this.updates;if(e in n.unmounted)return 0;n.unmounted[e]|=i.FLAG_INSERT;var r=n.unmounted[e];return n.unmountedCids.push(e),delete n.mounted[e],r},i.prototype.isViewMounted=function(t){return null!=t&&t.cid in this.updates.mounted},i.prototype.getMountedViews=function(){return Object.keys(this.updates.mounted).map((function(e){return t.CellView.views[e]}))},i.prototype.getUnmountedViews=function(){return Object.keys(this.updates.unmounted).map((function(e){return t.CellView.views[e]}))},i.prototype.checkMountedViews=function(e,n){var r=0;if("function"!=typeof e)return r;for(var i=this.updates,o=i.mounted,s=i.mountedCids,a=null==n?s.length:Math.min(s.length,n),l=0;l<a;l+=1){var u=s[l];if(u in o){var c=t.CellView.views[u];if(null!=c)if(Ws(e,this.graph,{view:c,unmounted:!0}))s.push(u);else r+=1,this.registerUnmountedView(c)&&c.unmount()}}return s.splice(0,a),r},i.prototype.checkUnmountedViews=function(e,n){var r=0;"function"!=typeof e&&(e=null);for(var i=this.updates,o=i.unmounted,s=i.unmountedCids,a=null==n?s.length:Math.min(s.length,n),l=0;l<a;l+=1){var u=s[l];if(u in o){var c=t.CellView.views[u];if(null!=c)if(!e||Ws(e,this.graph,{view:c,unmounted:!1})){r+=1;var h=this.registerMountedView(c);h&&this.scheduleViewUpdate(c,h,c.priority,{mounting:!0})}else s.push(u)}}return s.splice(0,a),r},i.prototype.checkViewImpl=function(t){void 0===t&&(t={mountedBatchSize:Number.MAX_SAFE_INTEGER,unmountedBatchSize:Number.MAX_SAFE_INTEGER});var e=t.checkView||this.options.checkView,n=this.checkMountedViews(e,t.unmountedBatchSize);return{mountedCount:this.checkUnmountedViews(e,n>0?Math.min(this.updates.unmountedCids.length-n,t.mountedBatchSize):t.mountedBatchSize),unmountedCount:n}},i.prototype.checkView=function(t){return void 0===t&&(t={}),this.checkViewImpl(t)},i.prototype.isFrozen=function(){return!!this.options.frozen},i.prototype.freeze=function(t){void 0===t&&(t={});var e=t.key,n=this.updates,r=this.options.frozen,i=n.freezeKey;if(e&&e!==i){if(r&&i)return;n.frozen=r,n.freezeKey=e}this.options.frozen=!0;var o=n.animationId;n.animationId=null,this.isAsync()&&null!=o&&Ja(o),this.graph.trigger("freeze",{key:e})},i.prototype.unfreeze=function(t){var e=this;void 0===t&&(t={});var n=t.key,i=this.updates,o=i.freezeKey;if(!(n&&o&&n!==o||(i.freezeKey=null,n&&n===o&&i.frozen))){var s=function(){e.options.frozen=i.frozen=!1,i.sort&&(e.sortViews(),i.sort=!1);var r=t.after;r&&Ws(r,e.graph,e.graph),e.graph.trigger("unfreeze",{key:n})};if(this.isAsync()){this.freeze();var a=t.progress;this.updateViewsAsync(r(r({},t),{progress:function(t){var n=t.done,r=t.current,i=t.total;a&&Ws(a,e.graph,{done:n,current:r,total:i}),n&&s()}}))}else this.updateViews(t),s()}},i.prototype.isAsync=function(){return!!this.options.async},i.prototype.setAsync=function(t){this.options.async=t},i.prototype.onRemove=function(){this.freeze(),this.removeViews()},i.prototype.resetViews=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.resetUpdates(),this.removeViews(),this.freeze({key:"reset"});for(var n=0,r=t.length;n<r;n+=1)this.renderView(t[n],e);this.unfreeze({key:"reset"}),this.sortViews()},i.prototype.removeView=function(t){var e=this.views[t.id];if(e){var n=e.cid,r=this.updates,i=r.mounted,o=r.unmounted;e.remove(),delete this.views[t.id],delete i[n],delete o[n]}return e},i.prototype.removeViews=function(){var t=this;this.views&&Object.keys(this.views).forEach((function(e){var n=t.views[e];n&&t.removeView(n.cell)})),this.views={}},i.prototype.renderView=function(t,e){void 0===e&&(e={});var n=t.id,r=this.views,o=0,s=r[n];if(t.isVisible()&&(!t.isEdge()||this.isEdgeTerminalVisible(t,"source")&&this.isEdgeTerminalVisible(t,"target"))){if(s)o=i.FLAG_INSERT;else{var a=this.graph.hook.createCellView(t);a&&((s=r[t.id]=a).graph=this.graph,o=this.registerUnmountedView(s)|s.getBootstrapFlag())}s&&this.requestViewUpdate(s,o,s.priority,e)}},i.prototype.isExactSorting=function(){return"exact"===this.options.sorting},i.prototype.sortViews=function(){this.isExactSorting()&&(this.isFrozen()?this.updates.sort=!0:this.sortViewsExact())},i.prototype.sortElements=function(t,e){var n=t.map((function(t){var e=t.parentNode,n=e.insertBefore(document.createTextNode(""),t.nextSibling);return function(t){if(e===t)throw new Error("You can't sort elements if any one is a descendant of another.");e.insertBefore(t,n),e.removeChild(n)}}));t.sort(e).forEach((function(t,e){return n[e](t)}))},i.prototype.sortViewsExact=function(){var t=this.view.$(this.view.stage).children("[data-cell-id]").toArray(),e=this.model;this.sortElements(t,(function(t,n){var r=e.getCell(t.getAttribute("data-cell-id")||""),i=e.getCell(n.getAttribute("data-cell-id")||""),o=r.getZIndex()||0,s=i.getZIndex()||0;return o===s?0:o<s?-1:1}))},i.prototype.addZPivot=function(t){void 0===t&&(t=0),null==this.zPivots&&(this.zPivots={});var e=this.zPivots,n=e[t];if(n)return n;n=e[t]=document.createComment("z-index:"+(t+1));var r=-1/0;for(var i in e){var o=+i;o<t&&o>r&&(r=o)}var s=this.view.stage;if(r!==-1/0){var a=e[r];s.insertBefore(n,a.nextSibling)}else s.insertBefore(n,s.firstChild);return n},i.prototype.removeZPivots=function(){var t=this;this.zPivots&&Object.keys(this.zPivots).forEach((function(e){var n=t.zPivots[e];n&&n.parentNode&&n.parentNode.removeChild(n)})),this.zPivots={}},i.prototype.insertView=function(t){var e=this.view.stage;switch(this.options.sorting){case"approx":var n=t.cell.getZIndex(),r=this.addZPivot(n);e.insertBefore(t.container,r);break;case"exact":default:e.appendChild(t.container)}},i.prototype.findViewByCell=function(e){if(null==e)return null;var n=t.Cell.isCell(e)?e.id:e;return this.views[n]},i.prototype.findViewByElem=function(t){if(null==t)return null;var e="string"==typeof t?this.view.stage.querySelector(t):t instanceof Element?t:t[0];if(e){var n=this.view.findAttr("data-cell-id",e);if(n)return this.views[n]}return null},i.prototype.findViewsFromPoint=function(t){var e=this,n={x:t.x,y:t.y};return this.model.getCells().map((function(t){return e.findViewByCell(t)})).filter((function(t){return null!=t&&bu(t.container,{target:e.view.stage}).containsPoint(n)}))},i.prototype.findEdgeViewsInArea=function(e,n){var r=this;void 0===n&&(n={});var i=t.Rectangle.create(e);return this.model.getEdges().map((function(t){return r.findViewByCell(t)})).filter((function(t){if(t){var e=bu(t.container,{target:r.view.stage});return 0===e.width?e.inflate(1,0):0===e.height&&e.inflate(0,1),n.strict?i.containsRect(e):i.isIntersectWithRect(e)}return!1}))},i.prototype.findViewsInArea=function(e,n){var r=this;void 0===n&&(n={});var i=t.Rectangle.create(e);return this.model.getNodes().map((function(t){return r.findViewByCell(t)})).filter((function(t){if(t){var e=bu(t.container,{target:r.view.stage});return n.strict?i.containsRect(e):i.isIntersectWithRect(e)}return!1}))},i.prototype.dispose=function(){this.resetUpdates(),this.stopListening()},o([Vf.dispose()],i.prototype,"dispose",null),i}(Vf);!function(t){t.FLAG_INSERT=1<<30,t.FLAG_REMOVE=1<<29,t.MOUNT_BATCH_SIZE=1e3,t.UPDATE_BATCH_SIZE=1e3,t.MIN_PRIORITY=2,t.SORT_DELAYING_BATCHES=["add","to-front","to-back"],t.UPDATE_DELAYING_BATCHES=["translate"]}(Yf||(Yf={}));var Jf,Zf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),Object.defineProperty(r.prototype,"elem",{get:function(){return this.view.background},enumerable:!1,configurable:!0}),r.prototype.init=function(){this.startListening(),this.options.background&&this.draw(this.options.background)},r.prototype.startListening=function(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)},r.prototype.stopListening=function(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)},r.prototype.updateBackgroundImage=function(e){void 0===e&&(e={});var n=e.size||"auto auto",r=e.position||"center",i=this.graph.transform.getScale(),o=this.graph.translate();"object"==typeof r&&(r=o.tx+i.sx*(r.x||0)+"px "+(o.ty+i.sy*(r.y||0))+"px");"object"==typeof n&&(n=(n=t.Rectangle.fromSize(n).scale(i.sx,i.sy)).width+"px "+n.height+"px"),this.elem.style.backgroundSize=n,this.elem.style.backgroundPosition=r},r.prototype.drawBackgroundImage=function(t,e){if(void 0===e&&(e={}),t instanceof HTMLImageElement){var n=this.optionsCache;if(!n||n.image===e.image){var r,i=e.opacity,o=e.size,s=e.repeat||"no-repeat",a=wh.registry.get(s);if("function"==typeof a){var l=e.quality||1;t.width*=l,t.height*=l;var u=a(t,e);if(!(u instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=u.toDataURL("image/png"),s=e.repeat&&s!==e.repeat?e.repeat:"repeat","object"==typeof o?(o.width*=u.width/t.width,o.height*=u.height/t.height):void 0===o&&(e.size={width:u.width/l,height:u.height/l})}else r=t.src,void 0===o&&(e.size={width:t.width,height:t.height});null!=n&&"object"==typeof e.size&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=Fr(e.size));var c=this.elem.style;c.backgroundImage="url("+r+")",c.backgroundRepeat=s,c.opacity=null==i||i>=1?"":""+i,this.updateBackgroundImage(e)}}else this.elem.style.backgroundImage=""},r.prototype.updateBackgroundColor=function(t){this.elem.style.backgroundColor=t||""},r.prototype.updateBackgroundOptions=function(t){this.graph.options.background=t},r.prototype.update=function(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)},r.prototype.draw=function(t){var e=this,n=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(n.color),n.image){this.optionsCache=Fr(n);var r=document.createElement("img");r.onload=function(){return e.drawBackgroundImage(r,t)},r.setAttribute("crossorigin","anonymous"),r.src=n.image}else this.drawBackgroundImage(null),this.optionsCache=null},r.prototype.clear=function(){this.draw()},r.prototype.dispose=function(){this.clear(),this.stopListening()},o([Vf.dispose()],r.prototype,"dispose",null),r}(Vf),Kf=function(e){function s(t){var n=e.call(this)||this;n.padding={left:0,top:0,right:0,bottom:0},n.options=Jf.getOptions(t);var r=n.graph.transform.getScale();n.sx=r.sx,n.sy=r.sy;var i=n.options.width||n.graph.options.width,o=n.options.height||n.graph.options.height;n.container=document.createElement("div"),n.$container=n.$(n.container).addClass(n.prefixClassName(Jf.containerClass)).css({width:i,height:o}),n.options.pageVisible&&n.$container.addClass(n.prefixClassName(Jf.pagedClass)),n.options.className&&n.$container.addClass(n.options.className);var a=n.graph.container;a.parentNode&&n.$container.insertBefore(a);var l=a.getAttribute("style");if(l){var u={};l.split(";").forEach((function(t){var e=t.trim();if(e){var n=e.split(":");n.length&&(u[n[0].trim()]=n[1]?n[1].trim():"")}})),Object.keys(u).forEach((function(t){"width"!==t&&"height"!==t&&(a.style[t]="",n.container.style[t]=u[t])}))}return n.content=document.createElement("div"),n.$content=n.$(n.content).addClass(n.prefixClassName(Jf.contentClass)).css({width:n.graph.options.width,height:n.graph.options.height}),n.background=document.createElement("div"),n.$background=n.$(n.background).addClass(n.prefixClassName(Jf.backgroundClass)),n.$content.append(n.background),n.options.pageVisible||n.$content.append(n.graph.view.grid),n.$content.append(a),n.$content.appendTo(n.container),n.startListening(),n.options.pageVisible||n.graph.grid.update(),n.backgroundManager=new s.Background(n),n.options.autoResize||n.update(),n}return n(s,e),Object.defineProperty(s.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"model",{get:function(){return this.graph.model},enumerable:!1,configurable:!0}),s.prototype.startListening=function(){var t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),t.on("render:done",this.onRenderDone,this),t.on("unfreeze",this.onUpdate,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),e.on("batch:stop",this.onBatchStop,this),this.delegateBackgroundEvents()},s.prototype.stopListening=function(){var t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),t.off("render:done",this.onRenderDone,this),t.off("unfreeze",this.onUpdate,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),e.off("batch:stop",this.onBatchStop,this),this.undelegateBackgroundEvents()},s.prototype.enableAutoResize=function(){this.options.autoResize=!0},s.prototype.disableAutoResize=function(){this.options.autoResize=!1},s.prototype.onUpdate=function(){!this.graph.isAsync()&&this.options.autoResize&&this.update()},s.prototype.onBatchStop=function(t){!this.graph.isAsync()&&this.options.autoResize&&Yf.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()},s.prototype.delegateBackgroundEvents=function(t){var e=this,n=t||jf.events;this.delegatedHandlers=Object.keys(n).reduce((function(t,r){var i=n[r];if(-1===r.indexOf(" "))if("function"==typeof i)t[r]=i;else{var o=e.graph.view[i];"function"==typeof o&&(o=o.bind(e.graph.view),t[r]=o)}return t}),{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach((function(t){e.delegateEvent(t,{guarded:!1},e.onBackgroundEvent)}))},s.prototype.undelegateBackgroundEvents=function(){var t=this;Object.keys(this.delegatedHandlers).forEach((function(e){t.undelegateEvent(e,t.onBackgroundEvent)}))},s.prototype.onBackgroundEvent=function(t){var e=!1,n=t.target;if(this.options.pageVisible)e=this.options.background?this.background===n:this.content===n;else{var r=this.graph.view;e=r.background===n||r.grid===n}if(e){var i=this.delegatedHandlers[t.type];"function"==typeof i&&i.apply(this.graph,arguments)}},s.prototype.onRenderDone=function(t){var e=t.stats;this.options.autoResize&&e.priority<2&&this.update()},s.prototype.onResize=function(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())},s.prototype.onScale=function(t){var e=t.sx,n=t.sy,r=t.ox,i=t.oy;this.updateScale(e,n),(r||i)&&(this.centerPoint(r,i),this.updatePageBreak()),"function"==typeof(this.options.autoResizeOptions||this.options.fitTocontentOptions)&&this.update()},s.prototype.storeScrollPosition=function(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop},s.prototype.restoreScrollPosition=function(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null},s.prototype.storeClientSize=function(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}},s.prototype.restoreClientSize=function(){this.cachedClientSize=null},s.prototype.beforeManipulation=function(){(t.Platform.IS_IE||t.Platform.IS_EDGE)&&this.$container.css("visibility","hidden")},s.prototype.afterManipulation=function(){(t.Platform.IS_IE||t.Platform.IS_EDGE)&&this.$container.css("visibility","visible")},s.prototype.updatePageSize=function(t,e){null!=t&&(this.options.pageWidth=t),null!=e&&(this.options.pageHeight=e),this.updatePageBreak()},s.prototype.updatePageBreak=function(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){var t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,r=this.options.pageHeight*this.sy;if(t>n||e>r){for(var i=!1,o=document.createElement("div"),s=1,a=Math.floor(t/n);s<a;s+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-vertical")).css({left:s*n}).appendTo(o),i=!0;for(s=1,a=Math.floor(e/r);s<a;s+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-horizontal")).css({top:s*r}).appendTo(o),i=!0;i&&(oa(o,this.prefixClassName("graph-pagebreak")),this.$(this.graph.view.grid).after(o),this.pageBreak=o)}}},s.prototype.update=function(){var t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);var e=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"==typeof e&&(e=Ws(e,this,this));var n=r({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))},s.prototype.getFitToContentOptions=function(e){var n=this.sx,r=this.sy;return e.gridWidth&&(e.gridWidth*=n),e.gridHeight&&(e.gridHeight*=r),e.minWidth&&(e.minWidth*=n),e.minHeight&&(e.minHeight*=r),"object"==typeof e.padding?e.padding={left:(e.padding.left||0)*n,right:(e.padding.right||0)*n,top:(e.padding.top||0)*r,bottom:(e.padding.bottom||0)*r}:"number"==typeof e.padding&&(e.padding*=n),this.options.autoResize||(e.contentArea=t.Rectangle.create()),e},s.prototype.updateScale=function(t,e){var n=this.graph.options,r=t/this.sx,i=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*r,n.y*i),this.graph.resizeGraph(n.width*r,n.height*i)},s.prototype.scrollbarPosition=function(t,e,n){if(null==t&&null==e)return{left:this.container.scrollLeft,top:this.container.scrollTop};var r={};return"number"==typeof t&&(r.scrollLeft=t),"number"==typeof e&&(r.scrollTop=e),n&&n.animation?this.$container.animate(r,n.animation):this.$container.prop(r),this},s.prototype.scrollToPoint=function(t,e,n){var r=this.getClientSize(),i=this.graph.matrix(),o={};return"number"==typeof t&&(o.scrollLeft=t-r.width/2+i.e+(this.padding.left||0)),"number"==typeof e&&(o.scrollTop=e-r.height/2+i.f+(this.padding.top||0)),n&&n.animation?this.$container.animate(o,n.animation):this.$container.prop(o),this},s.prototype.scrollToContent=function(t){var e=this.sx,n=this.sy,r=this.graph.getContentArea().getCenter();return this.scrollToPoint(r.x*e,r.y*n,t)},s.prototype.scrollToCell=function(t,e){var n=this.sx,r=this.sy,i=t.getBBox().getCenter();return this.scrollToPoint(i.x*n,i.y*r,e)},s.prototype.center=function(t){return this.centerPoint(t)},s.prototype.centerPoint=function(t,e,n){var r,i=this.graph.matrix(),o=i.a,s=i.d,a=-i.e,l=-i.f,u=a+this.graph.options.width,c=l+this.graph.options.height;if(this.storeClientSize(),"number"==typeof t||"number"==typeof e){r=n;var h=this.getVisibleArea().getCenter();"number"==typeof t?t*=o:t=h.x,"number"==typeof e?e*=s:e=h.y}else r=t,t=(a+u)/2,e=(l+c)/2;if(r&&r.padding)return this.positionPoint({x:t,y:e},"50%","50%",r);var p=this.getPadding(),d=this.getClientSize(),f=d.width/2,g=d.height/2,v=f-p.left-t+a,y=f-p.right+t-u,m=g-p.top-e+l,b=g-p.bottom+e-c;this.addPadding(Math.max(v,0),Math.max(y,0),Math.max(m,0),Math.max(b,0));var C=this.scrollToPoint(t,e,r||void 0);return this.restoreClientSize(),C},s.prototype.centerContent=function(t){return this.positionContent("center",t)},s.prototype.centerCell=function(t,e){return this.positionCell(t,"center",e)},s.prototype.positionContent=function(t,e){var n=this.graph.getContentArea(e);return this.positionRect(n,t,e)},s.prototype.positionCell=function(t,e,n){var r=t.getBBox();return this.positionRect(r,e,n)},s.prototype.positionRect=function(e,n,r){var i=t.Rectangle.create(e);switch(n){case"center":return this.positionPoint(i.getCenter(),"50%","50%",r);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,r);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,r);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",r);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",r);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",r);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",r);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",r);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,r);default:return this}},s.prototype.positionPoint=function(e,n,r,o){void 0===o&&(o={});var s=o.padding,a=i(o,["padding"]),l=Us(s),u=t.Rectangle.fromSize(this.getClientSize()),c=u.clone().moveAndExpand({x:l.left,y:l.top,width:-l.right-l.left,height:-l.top-l.bottom});(n=Gs(n,Math.max(0,c.width)))<0&&(n=c.width+n),(r=Gs(r,Math.max(0,c.height)))<0&&(r=c.height+r);var h=c.getTopLeft().translate(n,r),p=u.getCenter().diff(h),d=this.zoom(),f=p.scale(1/d,1/d),g=t.Point.create(e).translate(f);return this.centerPoint(g.x,g.y,a)},s.prototype.zoom=function(t,e){if(null==t)return this.sx;var n,r;e=e||{};var i=this.getClientSize(),o=this.clientToLocalPoint(i.width/2,i.height/2),s=t,a=t;if(e.absolute||(s+=this.sx,a+=this.sy),e.scaleGrid&&(s=Math.round(s/e.scaleGrid)*e.scaleGrid,a=Math.round(a/e.scaleGrid)*e.scaleGrid),e.maxScale&&(s=Math.min(e.maxScale,s),a=Math.min(e.maxScale,a)),e.minScale&&(s=Math.max(e.minScale,s),a=Math.max(e.minScale,a)),s=this.graph.transform.clampScale(s),a=this.graph.transform.clampScale(a),e.center){var l=s/this.sx,u=a/this.sy;n=e.center.x-(e.center.x-o.x)/l,r=e.center.y-(e.center.y-o.y)/u}else n=o.x,r=o.y;return this.beforeManipulation(),this.graph.transform.scale(s,a),this.centerPoint(n,r),this.afterManipulation(),this},s.prototype.zoomToRect=function(e,n){void 0===n&&(n={});var r=t.Rectangle.create(e),i=this.graph;n.contentArea=r,null==n.viewportArea&&(n.viewportArea={x:i.options.x,y:i.options.y,width:this.$container.width(),height:this.$container.height()}),this.beforeManipulation(),i.transform.scaleContentToFitImpl(n,!1);var o=r.getCenter();return this.centerPoint(o.x,o.y),this.afterManipulation(),this},s.prototype.zoomToFit=function(t){return void 0===t&&(t={}),this.zoomToRect(this.graph.getContentArea(t),t)},s.prototype.transitionToPoint=function(e,n,r){var i,o,s=this;"object"==typeof e?(r=n,n=e.y,e=e.x):n=n,null==r&&(r={});var a=this.sx,l=Math.max(r.scale||a,1e-6),u=this.getClientSize(),c=new t.Point(e,n),h=this.clientToLocalPoint(u.width/2,u.height/2);if(a===l){var p=h.diff(c).scale(a,a).round();i="translate("+p.x+"px,"+p.y+"px)"}else{var d=l/(a-l)*c.distance(h),f=h.clone().move(c,d),g=this.localToBackgroundPoint(f).round();i="scale("+l/a+")",o=g.x+"px "+g.y+"px"}var v=r.onTransitionEnd;return this.$container.addClass(Jf.transitionClassName),this.$content.off(Jf.transitionEventName).on(Jf.transitionEventName,(function(t){s.syncTransition(l,{x:e,y:n}),"function"==typeof v&&Ws(v,s,t.originalEvent)})).css({transform:i,transformOrigin:o,transition:"transform",transitionDuration:r.duration||"1s",transitionDelay:r.delay,transitionTimingFunction:r.timing}),this},s.prototype.syncTransition=function(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this},s.prototype.removeTransition=function(){return this.$container.removeClass(Jf.transitionClassName),this.$content.off(Jf.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this},s.prototype.transitionToRect=function(e,n){void 0===n&&(n={});var i=t.Rectangle.create(e),o=n.maxScale||1/0,s=n.minScale||Number.MIN_VALUE,a=n.scaleGrid||null,l=n.visibility||1,u=n.center?t.Point.create(n.center):i.getCenter(),c=this.getClientSize(),h=c.width*l,p=c.height*l,d=new t.Rectangle(u.x-h/2,u.y-p/2,h,p).getMaxUniformScaleToFit(i,u);return d=Math.min(d,o),a&&(d=Math.floor(d/a)*a),d=Math.max(s,d),this.transitionToPoint(u,r({scale:d},n))},s.prototype.startPanning=function(t){var e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e:e}),this.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.$(window).on("mouseup.panning",this.stopPanning.bind(this))},s.prototype.pan=function(t){var e=this.normalizeEvent(t),n=e.clientX-this.clientX,r=e.clientY-this.clientY;this.container.scrollTop-=r,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e:e})},s.prototype.stopPanning=function(t){this.$(document.body).off(".panning"),this.$(window).off(".panning"),this.trigger("pan:stop",{e:t})},s.prototype.clientToLocalPoint=function(e,n){var r="object"==typeof e?e.x:e,i="object"==typeof e?e.y:n,o=this.graph.matrix();return r+=this.container.scrollLeft-this.padding.left-o.e,i+=this.container.scrollTop-this.padding.top-o.f,new t.Point(r/o.a,i/o.d)},s.prototype.localToBackgroundPoint=function(e,n){var r="object"==typeof e?t.Point.create(e):new t.Point(e,n),i=this.graph.matrix(),o=this.padding;return gu(r,i).translate(o.left,o.top)},s.prototype.resize=function(t,e){var n=null!=t?t:this.container.offsetWidth,r=null!=e?e:this.container.offsetHeight;"number"==typeof n&&(n=Math.round(n)),"number"==typeof r&&(r=Math.round(r)),this.options.width=n,this.options.height=r,this.$container.css({width:n,height:r}),this.update()},s.prototype.getClientSize=function(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}},s.prototype.autoScroll=function(t,e){var n=10,r=this.container,i=r.getBoundingClientRect(),o=0,s=0;return t<=i.left+n&&(o=-10),e<=i.top+n&&(s=-10),t>=i.right-n&&(o=n),e>=i.bottom-n&&(s=n),0!==o&&(r.scrollLeft+=o),0!==s&&(r.scrollTop+=s),{scrollerX:o,scrollerY:s}},s.prototype.addPadding=function(t,e,n,r){var i=this.getPadding();this.padding={left:Math.round(i.left+(t||0)),top:Math.round(i.top+(n||0)),bottom:Math.round(i.bottom+(r||0)),right:Math.round(i.right+(e||0))},i=this.padding,this.$content.css({width:i.left+this.graph.options.width+i.right,height:i.top+this.graph.options.height+i.bottom});var o=this.graph.container;return o.style.left=this.padding.left+"px",o.style.top=this.padding.top+"px",this},s.prototype.getPadding=function(){var t=this.options.padding;return Us("function"==typeof t?Ws(t,this,this):t)},s.prototype.getVisibleArea=function(){var t=this.graph.matrix(),e=this.getClientSize(),n=yu({x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},t.inverse());return n.x-=(this.padding.left||0)/this.sx,n.y-=(this.padding.top||0)/this.sy,n},s.prototype.isCellVisible=function(t,e){void 0===e&&(e={});var n=t.getBBox(),r=this.getVisibleArea();return e.strict?r.containsRect(n):r.isIntersectWithRect(n)},s.prototype.isPointVisible=function(t){return this.getVisibleArea().containsPoint(t)},s.prototype.lock=function(){return this.$container.css("overflow","hidden"),this},s.prototype.unlock=function(){return this.$container.css("overflow","scroll"),this},s.prototype.onRemove=function(){this.stopListening()},s.prototype.dispose=function(){this.$(this.graph.container).insertBefore(this.$container),this.remove()},o([t.View.dispose()],s.prototype,"dispose",null),s}(t.View);function Qf(t,e,n,i){if(void 0===i&&(i={}),n){var o=n.graph,s=o.view.normalizeEvent(e),a=o.snapToGrid(s.clientX,s.clientY);n.notify(t,r({e:s,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},i))}}!function(t){var e=function(t){function e(e){var n=t.call(this,e.graph)||this;return n.scroller=e,e.options.background&&n.draw(e.options.background),n}return n(e,t),Object.defineProperty(e.prototype,"elem",{get:function(){return this.scroller.background},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)},e.prototype.updateBackgroundOptions=function(t){this.scroller.options.background=t},e}(Zf);t.Background=e}(Kf||(Kf={})),function(t){t.containerClass="graph-scroller",t.panningClass=t.containerClass+"-panning",t.pannableClass=t.containerClass+"-pannable",t.pagedClass=t.containerClass+"-paged",t.contentClass=t.containerClass+"-content",t.backgroundClass=t.containerClass+"-background",t.transitionClassName="transition-in-progress",t.transitionEventName="transitionend.graph-scroller-transition",t.defaultOptions={padding:function(){var t=this.getClientSize(),e=Math.max(this.options.minVisibleWidth||0,1)||1,n=Math.max(this.options.minVisibleHeight||0,1)||1,r=Math.max(t.width-e,0),i=Math.max(t.height-n,0);return{left:r,top:i,right:r,bottom:i}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},t.getOptions=function(e){var n=ro({},t.defaultOptions,e);return null==n.pageWidth&&(n.pageWidth=e.graph.options.width),null==n.pageHeight&&(n.pageHeight=e.graph.options.height),n}}(Jf||(Jf={}));var tg,eg=function(e){function i(t){var n=e.call(this)||this;return n.options=ro({},tg.defaultOptions,t),n.options.model&&(n.options.collection=n.options.model.collection),n.options.collection?n.collection=n.options.collection:(n.collection=new uf([],{comparator:tg.depthComparator}),n.options.collection=n.collection),n.boxCount=0,n.createContainer(),n.initHandles(),n.startListening(),n}return n(i,e),Object.defineProperty(i.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"boxClassName",{get:function(){return this.prefixClassName(tg.classNames.box)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"$boxes",{get:function(){return this.$container.children("."+this.boxClassName)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"handleOptions",{get:function(){return this.options},enumerable:!1,configurable:!0}),i.prototype.startListening=function(){var t,e=this.graph,n=this.collection;this.delegateEvents(((t={})["mousedown ."+this.boxClassName]="onSelectionBoxMouseDown",t["touchstart ."+this.boxClassName]="onSelectionBoxMouseDown",t),!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),n.on("added",this.onCellAdded,this),n.on("removed",this.onCellRemoved,this),n.on("reseted",this.onReseted,this),n.on("updated",this.onCollectionUpdated,this),n.on("node:change:position",this.onNodePositionChanged,this),n.on("cell:changed",this.onCellChanged,this)},i.prototype.stopListening=function(){var t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)},i.prototype.onRemove=function(){this.stopListening()},i.prototype.onGraphTransformed=function(){this.updateSelectionBoxes({async:!1})},i.prototype.onCellChanged=function(){this.updateSelectionBoxes()},i.prototype.onNodePositionChanged=function(t){var e=t.node,n=t.options,r=this.options,i=r.showNodeSelectionBox,o=r.pointerEvents,s=n.ui,a=n.selection,l=n.translateBy,u=!this.translating;if(u=(u=(u=u&&(!0!==i||"none"===o))&&s&&!a)&&l&&e.id===l){this.translating=!0;var c=e.position(),h=e.previous("position"),p=c.x-h.x,d=c.y-h.y;0===p&&0===d||this.translateSelectedNodes(p,d,e,n),this.translating=!1}},i.prototype.onModelUpdated=function(t){var e=t.removed;e&&e.length&&this.unselect(e)},i.prototype.isEmpty=function(){return this.length<=0},i.prototype.isSelected=function(t){return this.collection.has(t)},Object.defineProperty(i.prototype,"length",{get:function(){return this.collection.length},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cells",{get:function(){return this.collection.toArray()},enumerable:!1,configurable:!0}),i.prototype.select=function(t,e){void 0===e&&(e={}),e.dryrun=!0;var n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this},i.prototype.unselect=function(t,e){return void 0===e&&(e={}),e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this},i.prototype.reset=function(t,e){if(void 0===e&&(e={}),t){if(e.batch){var n=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(n,r(r({},e),{ui:!0})),this}var i=this.cells,o=this.filter(Array.isArray(t)?t:[t]),s={},a={};i.forEach((function(t){return s[t.id]=t})),o.forEach((function(t){return a[t.id]=t}));var l=[],u=[];return o.forEach((function(t){s[t.id]||l.push(t)})),i.forEach((function(t){a[t.id]||u.push(t)})),u.length&&this.unselect(u,r(r({},e),{ui:!0})),l.length&&this.select(l,r(r({},e),{ui:!0})),0===u.length&&0===l.length&&this.updateContainer(),this}return this.clean(e)},i.prototype.clean=function(t){return void 0===t&&(t={}),this.length&&(!1===t.batch?this.unselect(this.cells,t):this.collection.reset([],r(r({},t),{ui:!0}))),this},i.prototype.setFilter=function(t){this.options.filter=t},i.prototype.setContent=function(t){this.options.content=t},i.prototype.startSelecting=function(t){var e,n;t=this.normalizeEvent(t),this.clean();var r=this.graph.container;if(null!=t.offsetX&&null!=t.offsetY&&r.contains(t.target))e=t.offsetX,n=t.offsetY;else{var i=this.$(r).offset(),o=r.scrollLeft,s=r.scrollTop;e=t.clientX-i.left+window.pageXOffset+o,n=t.clientY-i.top+window.pageYOffset+s}this.$container.css({top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0}),this.delegateDocumentEvents(tg.documentEvents,t.data)},i.prototype.filter=function(t){var e=this,n=this.options.filter;return Array.isArray(n)?t.filter((function(t){return!n.includes(t)&&!n.includes(t.shape)})):"function"==typeof n?t.filter((function(t){return Ws(n,e.graph,t)})):t},i.prototype.stopSelecting=function(e){var n=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":var i=this.$container.width(),o=this.$container.height(),s=this.$container.offset(),a=n.pageToLocal(s.left,s.top),l=n.transform.getScale();i/=l.sx,o/=l.sy;var u=new t.Rectangle(a.x,a.y,i,o),c=this.getCellViewsInArea(u).map((function(t){return t.cell}));this.reset(c,{batch:!0}),this.hideRubberband();break;case"translating":var h=n.snapToGrid(e.clientX,e.clientY);if(!this.options.following){var p=r;this.updateSelectedNodesPosition({dx:p.clientX-p.originX,dy:p.clientY-p.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,h.x,h.y);break;default:this.clean()}},i.prototype.onMouseUp=function(t){this.getEventData(t).action&&(this.stopSelecting(t),this.undelegateDocumentEvents())},i.prototype.onSelectionBoxMouseDown=function(t){this.options.following||t.stopPropagation();var e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);var n=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:n});var r=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,r.x,r.y),this.delegateDocumentEvents(tg.documentEvents,e.data)},i.prototype.startTranslating=function(t){this.graph.model.startBatch("move-selection");var e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})},i.prototype.getSelectionOffset=function(e,n){var r=e.x-n.clientX,i=e.y-n.clientY,o=this.graph.hook.getRestrictArea();if(o){var s=this.collection.toArray(),a=t.Cell.getCellsBBox(s,{deep:!0})||t.Rectangle.create(),l=o.x-a.x,u=o.y-a.y,c=o.x+o.width-(a.x+a.width),h=o.y+o.height-(a.y+a.height);if(r<l&&(r=l),i<u&&(i=u),c<r&&(r=c),h<i&&(i=h),!this.options.following){var p=e.x-n.originX,d=e.y-n.originY;r=p<=l||p>=c?0:r,i=d<=u||d>=h?0:i}}return{dx:r,dy:i}},i.prototype.updateSelectedNodesPosition=function(t){var e=t.dx,n=t.dy;if(e||n)if(this.translateSelectedNodes(e,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{var r=this.graph.transform.getScale();this.$boxes.add(this.$selectionContainer).css({left:"+="+e*r.sx,top:"+="+n*r.sy})}},i.prototype.autoScrollGraph=function(t,e){var n=this.graph.scroller.widget;return n?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}},i.prototype.adjustSelection=function(t){var e=this.normalizeEvent(t),n=this.getEventData(e);switch(n.action){case"selecting":!0!==(h=n).moving&&(this.$container.appendTo(this.graph.container),this.showRubberband(),h.moving=!0);var r=this.autoScrollGraph(e.clientX,e.clientY),i=r.scrollerX,o=r.scrollerY;h.scrollerX+=i,h.scrollerY+=o;var s=e.clientX-h.clientX+h.scrollerX,a=e.clientY-h.clientY+h.scrollerY,l=parseInt(this.$container.css("left"),10),u=parseInt(this.$container.css("top"),10);this.$container.css({left:s<0?h.offsetX+s:l,top:a<0?h.offsetY+a:u,width:Math.abs(s),height:Math.abs(a)});break;case"translating":var c=this.graph.snapToGrid(e.clientX,e.clientY),h=n,p=this.getSelectionOffset(c,h);this.options.following?this.updateSelectedNodesPosition(p):this.updateContainerPosition(p),p.dx&&(h.clientX=c.x),p.dy&&(h.clientY=c.y),this.notifyBoxEvent("box:mousemove",t,c.x,c.y)}this.boxesUpdated=!1},i.prototype.translateSelectedNodes=function(t,e,n,i){var o=this,s={},a=[];if(n&&(s[n.id]=!0),this.collection.toArray().forEach((function(t){t.getDescendants({deep:!0}).forEach((function(t){s[t.id]=!0}))})),i&&i.translateBy){var l=this.graph.getCellById(i.translateBy);l&&(s[l.id]=!0,l.getDescendants({deep:!0}).forEach((function(t){s[t.id]=!0})),a.push(l))}this.collection.toArray().forEach((function(n){if(!s[n.id]){var l=r(r({},i),{selection:o.cid,exclude:a});n.translate(t,e,l),o.graph.model.getConnectedEdges(n).forEach((function(n){s[n.id]||(n.translate(t,e,l),s[n.id]=!0)}))}}))},i.prototype.getCellViewsInArea=function(t){var e=this.graph,n={strict:this.options.strict},r=[];return this.options.rubberNode&&(r=this.options.useCellGeometry?r.concat(e.model.getNodesInArea(t,n).map((function(t){return e.renderer.findViewByCell(t)})).filter((function(t){return null!=t}))):r.concat(e.renderer.findViewsInArea(t,n))),this.options.rubberEdge&&(r=this.options.useCellGeometry?r.concat(e.model.getEdgesInArea(t,n).map((function(t){return e.renderer.findViewByCell(t)})).filter((function(t){return null!=t}))):r.concat(e.renderer.findEdgeViewsInArea(t,n))),r},i.prototype.notifyBoxEvent=function(t,e,n,r){var i=this.getEventData(e).activeView;this.trigger(t,{e:e,view:i,x:n,y:r,cell:i.cell})},i.prototype.getSelectedClassName=function(t){return this.prefixClassName((t.isNode()?"node":"edge")+"-selected")},i.prototype.addCellSelectedClassName=function(t){var e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))},i.prototype.removeCellUnSelectedClassName=function(t){var e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))},i.prototype.destroySelectionBox=function(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(this.$container.find('[data-cell-id="'+t.id+'"]').remove(),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))},i.prototype.destroyAllSelectionBoxes=function(t){var e=this;t.forEach((function(t){return e.removeCellUnSelectedClassName(t)})),this.hide(),this.$boxes.remove(),this.boxCount=0},i.prototype.hide=function(){this.$container.removeClass(this.prefixClassName(tg.classNames.rubberband)).removeClass(this.prefixClassName(tg.classNames.selected))},i.prototype.showRubberband=function(){this.$container.addClass(this.prefixClassName(tg.classNames.rubberband))},i.prototype.hideRubberband=function(){this.$container.removeClass(this.prefixClassName(tg.classNames.rubberband))},i.prototype.showSelected=function(){this.$container.removeAttr("style").addClass(this.prefixClassName(tg.classNames.selected))},i.prototype.createContainer=function(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(tg.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(tg.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(tg.classNames.content)),this.$selectionContainer.append(this.$selectionContent),this.$selectionContainer.attr("data-selection-length",this.collection.length),this.$container.prepend(this.$selectionContainer),this.$handleContainer=this.$selectionContainer},i.prototype.updateContainerPosition=function(t){(t.dx||t.dy)&&this.$selectionContainer.css({left:"+="+t.dx,top:"+="+t.dy})},i.prototype.updateContainer=function(){var t=this,e={x:1/0,y:1/0},n={x:0,y:0};this.collection.toArray().filter((function(e){return t.canShowSelectionBox(e)})).forEach((function(r){var i=t.graph.renderer.findViewByCell(r);if(i){var o=i.getBBox({useCellGeometry:t.options.useCellGeometry});e.x=Math.min(e.x,o.x),e.y=Math.min(e.y,o.y),n.x=Math.max(n.x,o.x+o.width),n.y=Math.max(n.y,o.y+o.height)}})),this.$selectionContainer.css({position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:n.x-e.x,height:n.y-e.y}).attr("data-selection-length",this.collection.length);var r=this.options.content;if(r)if("function"==typeof r){var i=Ws(r,this.graph,this,this.$selectionContent[0]);i&&this.$selectionContent.html(i)}else this.$selectionContent.html(r);this.collection.length>0&&!this.container.parentNode?this.$container.appendTo(this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)},i.prototype.canShowSelectionBox=function(t){return t.isNode()&&!0===this.options.showNodeSelectionBox||t.isEdge()&&!0===this.options.showEdgeSelectionBox},i.prototype.createSelectionBox=function(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){var e=this.graph.renderer.findViewByCell(t);if(e){var n=e.getBBox({useCellGeometry:this.options.useCellGeometry}),r=this.boxClassName;this.$("<div/>").addClass(r).addClass(r+"-"+(t.isNode()?"node":"edge")).attr("data-cell-id",t.id).css({position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}).appendTo(this.container),this.showSelected(),this.boxCount+=1}}},i.prototype.updateSelectionBoxes=function(t){void 0===t&&(t={}),this.collection.length>0&&(this.boxesUpdated=!0,this.graph.renderer.requestViewUpdate(this,1,2,t))},i.prototype.confirmUpdate=function(){var t=this;return this.boxCount&&(this.hide(),this.$boxes.each((function(e,n){var r=t.$(n).remove().attr("data-cell-id"),i=t.collection.get(r);i&&t.createSelectionBox(i)})),this.updateContainer()),0},i.prototype.getCellViewFromElem=function(t){var e=t.getAttribute("data-cell-id");if(e){var n=this.collection.get(e);if(n)return this.graph.renderer.findViewByCell(n)}return null},i.prototype.onCellRemoved=function(t){var e=t.cell;this.destroySelectionBox(e),this.updateContainer()},i.prototype.onReseted=function(t){var e=this,n=t.previous,r=t.current;this.destroyAllSelectionBoxes(n),r.forEach((function(t){e.listenCellRemoveEvent(t),e.createSelectionBox(t)})),this.updateContainer()},i.prototype.onCellAdded=function(t){var e=t.cell;this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()},i.prototype.listenCellRemoveEvent=function(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)},i.prototype.onCollectionUpdated=function(t){var e=this,n=t.added,r=t.removed,i=t.options;n.forEach((function(t){e.trigger("cell:selected",{cell:t,options:i}),e.graph.trigger("cell:selected",{cell:t,options:i}),t.isNode()?(e.trigger("node:selected",{cell:t,options:i,node:t}),e.graph.trigger("node:selected",{cell:t,options:i,node:t})):t.isEdge()&&(e.trigger("edge:selected",{cell:t,options:i,edge:t}),e.graph.trigger("edge:selected",{cell:t,options:i,edge:t}))})),r.forEach((function(t){e.trigger("cell:unselected",{cell:t,options:i}),e.graph.trigger("cell:unselected",{cell:t,options:i}),t.isNode()?(e.trigger("node:unselected",{cell:t,options:i,node:t}),e.graph.trigger("node:unselected",{cell:t,options:i,node:t})):t.isEdge()&&(e.trigger("edge:unselected",{cell:t,options:i,edge:t}),e.graph.trigger("edge:unselected",{cell:t,options:i,edge:t}))}));var o={added:n,removed:r,options:i,selected:this.cells.filter((function(t){return!!e.graph.getCellById(t.id)}))};this.trigger("selection:changed",o),this.graph.trigger("selection:changed",o)},i.prototype.deleteSelectedCells=function(){var t=this.collection.toArray();this.clean(),this.graph.model.removeCells(t,{selection:this.cid})},i.prototype.startRotate=function(e){var n=e.e,r=this.collection.toArray(),i=t.Cell.getCellsBBox(r).getCenter(),o=this.graph.snapToGrid(n.clientX,n.clientY),s=r.reduce((function(e,n){return e[n.id]=t.Angle.normalize(n.getAngle()),e}),{});this.setEventData(n,{center:i,angles:s,start:o.theta(i)})},i.prototype.doRotate=function(e){var n=this,r=e.e,i=this.getEventData(r),o=this.graph.options.rotating.grid,s="function"==typeof o?Ws(o,this.graph,null):o,a=this.graph.snapToGrid(r.clientX,r.clientY),l=i.start-a.theta(i.center);i.rotated||(i.rotated=!0),Math.abs(l)>.001&&(this.collection.toArray().forEach((function(e){var r=t.Util.snapToGrid(i.angles[e.id]+l,s||15);e.rotate(r,{absolute:!0,center:i.center,selection:n.cid})})),this.updateSelectionBoxes())},i.prototype.stopRotate=function(t){var e=this,n=t.e,r=this.getEventData(n);r.rotated&&(r.rotated=!1,this.collection.toArray().forEach((function(t){Qf("node:rotated",n,e.graph.findViewByCell(t))})))},i.prototype.startResize=function(e){var n=e.e,r=this.graph.getGridSize(),i=this.collection.toArray(),o=t.Cell.getCellsBBox(i),s=i.map((function(t){return t.getBBox()})),a=s.reduce((function(t,e){return e.width<t?e.width:t}),1/0),l=s.reduce((function(t,e){return e.height<t?e.height:t}),1/0);this.setEventData(n,{bbox:o,cells:this.graph.model.getSubGraph(i),minWidth:r*o.width/a,minHeight:r*o.height/l})},i.prototype.doResize=function(t){var e=t.e,n=t.dx,r=t.dy,i=this.eventData(e),o=i.bbox,s=o.width,a=o.height,l=Math.max(s+n,i.minWidth),u=Math.max(a+r,i.minHeight);i.resized||(i.resized=!0),(Math.abs(s-l)>.001||Math.abs(a-u)>.001)&&(this.graph.model.resizeCells(l,u,i.cells,{selection:this.cid}),o.width=l,o.height=u,this.updateSelectionBoxes())},i.prototype.stopResize=function(t){var e=this,n=t.e,r=this.eventData(n);r.resized&&(r.resized=!1,this.collection.toArray().forEach((function(t){Qf("node:resized",n,e.graph.findViewByCell(t))})))},i.prototype.dispose=function(){this.clean(),this.remove()},o([t.View.dispose()],i.prototype,"dispose",null),i}(t.View);vs(eg,_f),function(t){var e="widget-selection";t.classNames={root:e,inner:e+"-inner",box:e+"-box",content:e+"-content",rubberband:e+"-rubberband",selected:e+"-selected"},t.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.defaultOptions={movable:!0,following:!0,strict:!1,useCellGeometry:!1,content:function(t){return Qo('<%= length %> node<%= length > 1 ? "s":"" %> selected.')({length:t.length})},handles:[{name:"remove",position:"nw",events:{mousedown:"deleteSelectedCells"}},{name:"rotate",position:"sw",events:{mousedown:"startRotate",mousemove:"doRotate",mouseup:"stopRotate"}},{name:"resize",position:"se",events:{mousedown:"startResize",mousemove:"doResize",mouseup:"stopResize"}}]},t.depthComparator=function(t){return t.getAncestors().length}}(tg||(tg={}));var ng,rg,ig=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),Object.defineProperty(i.prototype,"node",{get:function(){return this.cell},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"containerClassName",{get:function(){return this.prefixClassName("widget-transform")},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"resizeClassName",{get:function(){return this.containerClassName+"-resize"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rotateClassName",{get:function(){return this.containerClassName+"-rotate"},enumerable:!1,configurable:!0}),i.prototype.init=function(t){this.options=r(r({},ng.defaultOptions),t),this.render(),this.startListening()},i.prototype.startListening=function(){var t;this.delegateEvents(((t={})["mousedown ."+this.resizeClassName]="startResizing",t["touchstart ."+this.resizeClassName]="startResizing",t["mousedown ."+this.rotateClassName]="startRotating",t["touchstart ."+this.rotateClassName]="startRotating",t)),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),e.prototype.startListening.call(this)},i.prototype.stopListening=function(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),e.prototype.stopListening.call(this)},i.prototype.renderHandles=function(){var t=this;this.container=document.createElement("div"),this.$container=this.$(this.container);var e=this.$("<div/>").prop("draggable",!1),n=e.clone().addClass(this.rotateClassName),r=ng.POSITIONS.map((function(n){return e.clone().addClass(t.resizeClassName).attr("data-position",n)}));this.empty(),this.$container.append(r,n)},i.prototype.render=function(){return this.renderHandles(),this.view.addClass(ng.NODE_CLS),this.$container.addClass(this.containerClassName).toggleClass("no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing).toggleClass("no-resize",!this.options.resizable).toggleClass("no-rotate",!this.options.rotatable),this.options.className&&this.$container.addClass(this.options.className),this.graph.container.appendChild(this.container),this.update()},i.prototype.update=function(){var e=this.graph.matrix(),n=this.node.getBBox();n.x*=e.a,n.x+=e.e,n.y*=e.d,n.y+=e.f,n.width*=e.a,n.height*=e.d;var r=t.Angle.normalize(this.node.getAngle()),i=0!==r?"rotate("+r+"deg)":"";return this.$container.css({transform:i,width:n.width,height:n.height,left:n.x,top:n.y}),this.updateResizerDirections(),this},i.prototype.remove=function(){return this.view.removeClass(ng.NODE_CLS),e.prototype.remove.call(this)},i.prototype.onKnobMouseDown=function(){this.startHandle()},i.prototype.onKnobMouseUp=function(){this.stopHandle()},i.prototype.updateResizerDirections=function(){var e=this,n=t.Angle.normalize(this.node.getAngle()),r=Math.floor(n*(ng.DIRECTIONS.length/360));if(r!==this.prevShift){var i=ng.DIRECTIONS.slice(r).concat(ng.DIRECTIONS.slice(0,r)),o=function(t){return e.containerClassName+"-cursor-"+t};this.$container.find("."+this.resizeClassName).removeClass(ng.DIRECTIONS.map((function(t){return o(t)})).join(" ")).each((function(t,n){e.$(n).addClass(o(i[t]))})),this.prevShift=r}},i.prototype.getTrueDirection=function(e){var n=t.Angle.normalize(this.node.getAngle()),r=ng.POSITIONS.indexOf(e);return r+=Math.floor(n*(ng.POSITIONS.length/360)),r%=ng.POSITIONS.length,ng.POSITIONS[r]},i.prototype.toValidResizeDirection=function(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t},i.prototype.startResizing=function(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});var e=this.$(t.target).attr("data-position"),n=this.graph.findViewByCell(this.node);this.prepareResizing(t,e),this.startAction(t),Qf("node:resize:mousedown",t,n)},i.prototype.prepareResizing=function(e,n){var r=this.getTrueDirection(n),i=0,o=0;n.split("-").forEach((function(t){i={left:-1,right:1}[t]||i,o={top:-1,bottom:1}[t]||o}));var s=this.toValidResizeDirection(n),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[s],l=t.Angle.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:s,trueDirection:r,relativeDirection:n,angle:l,resizeX:i,resizeY:o,action:"resizing"})},i.prototype.startRotating=function(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});var n=this.graph.findViewByCell(this.node),r=this.node.getBBox().getCenter(),i=this.normalizeEvent(e),o=this.graph.snapToGrid(i.clientX,i.clientY);this.setEventData(e,{center:r,action:"rotating",angle:t.Angle.normalize(this.node.getAngle()),start:t.Point.create(o).theta(r)}),this.startAction(e),Qf("node:rotate:mousedown",e,n)},i.prototype.onMouseMove=function(e){var n=this.graph.findViewByCell(this.node),r=this.getEventData(e);if(r.action){var i=this.normalizeEvent(e),o=i.clientX,s=i.clientY,a=this.graph.scroller.widget,l=this.options.restrictedResizing;if(!0===l||"number"==typeof l){var u=!0===l?0:l,c=a?Math.max(u,8):u,h=this.graph.container.getBoundingClientRect();o=In(o,h.left+c,h.right-c),s=In(s,h.top+c,h.bottom-c)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,s);var p=this.graph.snapToGrid(o,s),d=this.graph.getGridSize(),f=this.node,g=this.options;if("resizing"===r.action){(r=r).resized||(n&&(n.addClass("node-resizing"),Qf("node:resize",e,n)),r.resized=!0);var v=f.getBBox(),y=t.Point.create(p).rotate(r.angle,v.getCenter()).diff(v[r.selector]),m=r.resizeX?y.x*r.resizeX:v.width,b=r.resizeY?y.y*r.resizeY:v.height,C=m,x=b;if(m=t.Util.snapToGrid(m,d),b=t.Util.snapToGrid(b,d),m=Math.max(m,g.minWidth||d),b=Math.max(b,g.minHeight||d),m=Math.min(m,g.maxWidth||1/0),b=Math.min(b,g.maxHeight||1/0),g.preserveAspectRatio){var w=v.width*b/v.height,P=v.height*m/v.width;m<w?b=P:m=w}var A=r.relativeDirection;if(g.allowReverse&&(C<=-m||x<=-b)){var E=void 0;"left"===A?C<=-m&&(E="right"):"right"===A?C<=-m&&(E="left"):"top"===A?x<=-b&&(E="bottom"):"bottom"===A?x<=-b&&(E="top"):"top-left"===A?C<=-m&&x<=-b?E="bottom-right":C<=-m?E="top-right":x<=-b&&(E="bottom-left"):"top-right"===A?C<=-m&&x<=-b?E="bottom-left":C<=-m?E="top-left":x<=-b&&(E="bottom-right"):"bottom-left"===A?C<=-m&&x<=-b?E="top-right":C<=-m?E="bottom-right":x<=-b&&(E="top-left"):"bottom-right"===A&&(C<=-m&&x<=-b?E="top-left":C<=-m?E="bottom-left":x<=-b&&(E="top-right"));var M=E;this.stopHandle();var S=this.$container.find("."+this.resizeClassName+'[data-position="'+M+'"]');this.startHandle(S[0]),this.prepareResizing(e,M),this.onMouseMove(e)}if(v.width!==m||v.height!==b){var k={ui:!0,direction:r.direction,relativeDirection:r.relativeDirection,trueDirection:r.trueDirection,minWidth:g.minWidth,minHeight:g.minHeight,maxWidth:g.maxWidth,maxHeight:g.maxHeight,preserveAspectRatio:!0===g.preserveAspectRatio};f.resize(m,b,k),Qf("node:resizing",e,n)}Qf("node:resize:mousemove",e,n)}else if("rotating"===r.action){(r=r).rotated||(n&&(n.addClass("node-rotating"),Qf("node:rotate",e,n)),r.rotated=!0);var T=f.getAngle(),D=r.start-t.Point.create(p).theta(r.center),N=r.angle+D;g.rotateGrid&&(N=t.Util.snapToGrid(N,g.rotateGrid)),T!==(N=t.Angle.normalize(N))&&(f.rotate(N,{absolute:!0}),Qf("node:rotating",e,n)),Qf("node:rotate:mousemove",e,n)}}},i.prototype.onMouseUp=function(t){var e=this.graph.findViewByCell(this.node),n=this.getEventData(t);n.action&&(this.stopAction(t),this.model.stopBatch("resizing"===n.action?"resize":"rotate",{cid:this.cid}),"resizing"===n.action?Qf("node:resize:mouseup",t,e):"rotating"===n.action&&Qf("node:rotate:mouseup",t,e))},i.prototype.startHandle=function(t){if(this.handle=t||null,this.$container.addClass(this.containerClassName+"-active"),t){this.$(t).addClass(this.containerClassName+"-active-handle");var e=t.getAttribute("data-position");if(e){var n=ng.DIRECTIONS[ng.POSITIONS.indexOf(e)];this.$container.addClass(this.containerClassName+"-cursor-"+n)}}},i.prototype.stopHandle=function(){if(this.$container.removeClass(this.containerClassName+"-active"),this.handle){this.$(this.handle).removeClass(this.containerClassName+"-active-handle");var t=this.handle.getAttribute("data-position");if(t){var e=ng.DIRECTIONS[ng.POSITIONS.indexOf(t)];this.$container.removeClass(this.containerClassName+"-cursor-"+e)}this.handle=null}},i.prototype.startAction=function(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(ng.documentEvents,t.data)},i.prototype.stopAction=function(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();var e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass("node-"+n.action),"resizing"===n.action&&n.resized?Qf("node:resized",t,e):"rotating"===n.action&&n.rotated&&Qf("node:rotated",t,e))},i}(Uf);!function(t){t.NODE_CLS="has-widget-transform",t.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],t.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},t.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}}(ng||(ng={})),function(t){t.parseOptionGroup=function(t,e,n){var r={};return Object.keys(n||{}).forEach((function(i){var o=n[i];r[i]="function"==typeof o?o.call(t,e):o})),r}}(rg||(rg={})),function(t){t.get=function(e){var n=e.grid;e.panning,e.selecting,e.embedding,e.snapline,e.resizing,e.rotating,e.knob,e.clipboard,e.history,e.scroller,e.minimap,e.keyboard,e.mousewheel;var o=i(e,["grid","panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"]),s=e.container;if(null==s)throw new Error("Ensure the container of the graph is specified and valid");null==o.width&&(o.width=s.clientWidth),null==o.height&&(o.height=s.clientHeight);var a=ro({},t.defaults,o),l={size:10,visible:!1};return a.grid="number"==typeof n?{size:n,visible:!1}:r(r({},l),"boolean"==typeof n?{visible:n}:n),["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"].forEach((function(t){var n=e[t];"boolean"==typeof n?a[t].enabled=n:a[t]=r(r({},a[t]),n)})),a.background&&a.scroller.enabled&&null==a.scroller.background&&(a.scroller.background=a.background,delete a.background),a}}(rg||(rg={})),function(e){e.defaults={x:0,y:0,grid:{size:10,visible:!1},scaling:{min:.01,max:16},background:!1,highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:t.Util.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:t.Util.prefix("available-magnet")}}},connecting:{snap:!1,multi:!0,dangling:!0,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",strategy:null,router:"normal",connector:"normal",validateConnection:function(t){var e=t.type,n=t.sourceView,r=t.targetView;return null!=("target"===e?r:n)},createEdge:function(){return new Df}},transforming:{clearAll:!0,clearOnBlankMouseDown:!0},resizing:{enabled:!1,minWidth:0,minHeight:0,maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,orthogonal:!0,restricted:!1,autoScroll:!0,preserveAspectRatio:!1,allowReverse:!0},rotating:{enabled:!1,grid:15},translating:{restrict:!1},knob:{enabled:!1,clearAll:!0,clearOnBlankMouseDown:!0},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:function(){return!0}},selecting:{enabled:!1,rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,useCellGeometry:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,content:null,handles:null},panning:{enabled:!1,eventTypes:["leftMouseDown"]},snapline:{enabled:!1},clipboard:{enabled:!1},history:{enabled:!1},scroller:{enabled:!1},keyboard:{enabled:!1},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},async:!1,frozen:!1,sorting:"exact",moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},guard:function(){return!1}}}(rg||(rg={}));var og,sg=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return n(o,e),Object.defineProperty(o.prototype,"cid",{get:function(){return this.graph.view.cid},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"svg",{get:function(){return this.view.svg},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"defs",{get:function(){return this.view.defs},enumerable:!1,configurable:!0}),o.prototype.isDefined=function(t){return null!=this.svg.getElementById(t)},o.prototype.filter=function(e){var n=e.id,i=e.name;if(n||(n="filter-"+i+"-"+this.cid+"-"+zs(JSON.stringify(e))),!this.isDefined(n)){var o=Ch.registry.get(i);if(null==o)return Ch.registry.onNotFound(i);var s=o(e.args||{}),a=r(r({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:n});t.Vector.create(t.Markup.sanitize(s),a).appendTo(this.defs)}return n},o.prototype.gradient=function(e){var n=e.id,i=e.type;if(n||(n="gradient-"+i+"-"+this.cid+"-"+zs(JSON.stringify(e))),!this.isDefined(n)){var o="<"+i+">"+e.stops.map((function(t){var e=null!=t.opacity&&Number.isFinite(t.opacity)?t.opacity:1;return'<stop offset="'+t.offset+'" stop-color="'+t.color+'" stop-opacity="'+e+'"/>'})).join("")+"</"+i+">",s=r({id:n},e.attrs);t.Vector.create(o,s).appendTo(this.defs)}return n},o.prototype.marker=function(e){var n=e.id,o=e.refX,s=e.refY,a=e.markerUnits,l=e.markerOrient,u=e.tagName,c=e.children,h=i(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]),p=n;if(p||(p="marker-"+this.cid+"-"+zs(JSON.stringify(e))),!this.isDefined(p)){"path"!==u&&delete h.d;var d=t.Vector.create("marker",{refX:o,refY:s,id:p,overflow:"visible",orient:null!=l?l:"auto",markerUnits:a||"userSpaceOnUse"},c?c.map((function(e){var n=e.tagName,o=i(e,["tagName"]);return t.Vector.create(""+n||"path",Ra(r(r({},h),o)))})):[t.Vector.create(u||"path",Ra(h))]);this.defs.appendChild(d.node)}return p},o.prototype.remove=function(t){var e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)},o}(Vf),ag=function(e){function s(){return null!==e&&e.apply(this,arguments)||this}return n(s,e),Object.defineProperty(s.prototype,"elem",{get:function(){return this.view.grid},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"grid",{get:function(){return this.options.grid},enumerable:!1,configurable:!0}),s.prototype.init=function(){this.startListening(),this.draw(this.grid)},s.prototype.startListening=function(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)},s.prototype.stopListening=function(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)},s.prototype.setVisible=function(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())},s.prototype.getGridSize=function(){return this.grid.size},s.prototype.setGridSize=function(t){this.grid.size=Math.max(t,1),this.update()},s.prototype.show=function(){this.setVisible(!0),this.update()},s.prototype.hide=function(){this.setVisible(!1),this.update()},s.prototype.clear=function(){this.elem.style.backgroundImage=""},s.prototype.draw=function(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()},s.prototype.update=function(e){void 0===e&&(e={});var n=this.grid.size;if(n<=1||!this.grid.visible)return this.clear();var o=this.graph.matrix(),s=this.getInstance(),a=Array.isArray(e)?e:[e];this.patterns.forEach((function(e,l){var u="pattern_"+l,c=o.a||1,h=o.d||1,p=e.update,d=e.markup,f=i(e,["update","markup"]),g=r(r(r({},f),a[l]),{sx:c,sy:h,ox:o.e||0,oy:o.f||0,width:n*c,height:n*h});s.has(u)||s.add(u,t.Vector.create("pattern",{id:u,patternUnits:"userSpaceOnUse"},t.Vector.createVectors(d)).node);var v=s.get(u);"function"==typeof p&&p(v.childNodes[0],g);var y=g.ox%g.width;y<0&&(y+=g.width);var m=g.oy%g.height;m<0&&(m+=g.height),Va(v,{x:y,y:m,width:g.width,height:g.height})}));var l=(new XMLSerializer).serializeToString(s.root),u="url(data:image/svg+xml;base64,"+btoa(l)+")";this.elem.style.backgroundImage=u},s.prototype.getInstance=function(){return this.instance||(this.instance=new yh),this.instance},s.prototype.resolveGrid=function(t){if(!t)return[];var e=t.type;if(null==e)return[r(r({},yh.presets.dot),t.args)];var n=yh.registry.get(e);if(n){var i=t.args||[];return Array.isArray(i)||(i=[i]),Array.isArray(n)?n.map((function(t,e){return r(r({},t),i[e])})):[r(r({},n),i[0])]}return yh.registry.onNotFound(e)},s.prototype.dispose=function(){this.stopListening(),this.clear()},o([Vf.dispose()],s.prototype,"dispose",null),s}(Vf),lg=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.getClientMatrix=function(){return ou(this.view.stage.getScreenCTM())},r.prototype.getClientOffset=function(){var e=this.view.svg.getBoundingClientRect();return new t.Point(e.left,e.top)},r.prototype.getPageOffset=function(){return this.getClientOffset().translate(window.scrollX,window.scrollY)},r.prototype.snapToGrid=function(t,e){return("number"==typeof t?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())},r.prototype.localToGraphPoint=function(e,n){return gu(t.Point.create(e,n),this.graph.matrix())},r.prototype.localToClientPoint=function(e,n){return gu(t.Point.create(e,n),this.getClientMatrix())},r.prototype.localToPagePoint=function(t,e){return("number"==typeof t?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())},r.prototype.localToGraphRect=function(e,n,r,i){return yu(t.Rectangle.create(e,n,r,i),this.graph.matrix())},r.prototype.localToClientRect=function(e,n,r,i){return yu(t.Rectangle.create(e,n,r,i),this.getClientMatrix())},r.prototype.localToPageRect=function(t,e,n,r){return("number"==typeof t?this.localToGraphRect(t,e,n,r):this.localToGraphRect(t)).translate(this.getPageOffset())},r.prototype.graphToLocalPoint=function(e,n){return gu(t.Point.create(e,n),this.graph.matrix().inverse())},r.prototype.clientToLocalPoint=function(e,n){return gu(t.Point.create(e,n),this.getClientMatrix().inverse())},r.prototype.clientToGraphPoint=function(e,n){return gu(t.Point.create(e,n),this.graph.matrix().multiply(this.getClientMatrix().inverse()))},r.prototype.pageToLocalPoint=function(e,n){var r=t.Point.create(e,n).diff(this.getPageOffset());return this.graphToLocalPoint(r)},r.prototype.graphToLocalRect=function(e,n,r,i){return yu(t.Rectangle.create(e,n,r,i),this.graph.matrix().inverse())},r.prototype.clientToLocalRect=function(e,n,r,i){return yu(t.Rectangle.create(e,n,r,i),this.getClientMatrix().inverse())},r.prototype.clientToGraphRect=function(e,n,r,i){return yu(t.Rectangle.create(e,n,r,i),this.graph.matrix().multiply(this.getClientMatrix().inverse()))},r.prototype.pageToLocalRect=function(e,n,r,i){var o=t.Rectangle.create(e,n,r,i),s=this.getPageOffset();return o.x-=s.x,o.y-=s.y,this.graphToLocalRect(o)},r}(Vf),ug=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.widget=e.graph.hook.createSnapline(),e}return n(e,t),e.prototype.dispose=function(){this.widget.dispose()},o([Vf.dispose()],e.prototype,"dispose",null),e}(Vf);!function(t){function e(t){var e=[],n=[];return Array.isArray(t)?e.push.apply(e,t):t.split("|").forEach((function(t){-1===t.indexOf("&")?e.push(t):n.push.apply(n,t.split("&"))})),{or:e,and:n}}t.parse=e,t.equals=function(t,n){if(null!=t&&null!=n){var r=e(t),i=e(n),o=r.or.sort(),s=i.or.sort(),a=r.and.sort(),l=i.and.sort(),u=function(t,e){return t.length===e.length&&(0===t.length||t.every((function(t,n){return t===e[n]})))};return u(o,s)&&u(a,l)}return null==t&&null==n},t.isMatch=function(t,n,r){if(null==n||Array.isArray(n)&&0===n.length)return!r||!0!==t.altKey&&!0!==t.ctrlKey&&!0!==t.metaKey&&!0!==t.shiftKey;var i=e(n),o=i.or,s=i.and,a=function(e){var n=e.toLowerCase()+"Key";return!0===t[n]};return o.some((function(t){return a(t)}))&&s.every((function(t){return a(t)}))}}(og||(og={}));var cg,hg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"widgetOptions",{get:function(){return this.options.scroller},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pannable",{get:function(){return!!this.widgetOptions&&("object"==typeof this.widgetOptions.pannable?this.widgetOptions.pannable.enabled:!!this.widgetOptions.pannable)},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.widget=this.graph.hook.createScroller(),this.startListening(),this.updateClassName(),this.widget&&this.widget.center()},e.prototype.startListening=function(){var t=[],e=this.widgetOptions.pannable;(t="object"==typeof e?e.eventTypes||[]:["leftMouseDown"]).includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.widget.container).on("mousedown",this.onRightMouseDown))},e.prototype.stopListening=function(){var t=[],e=this.widgetOptions.pannable;(t="object"==typeof e?e.eventTypes||[]:["leftMouseDown"]).includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.widget.container).off("mousedown",this.onRightMouseDown)},e.prototype.onRightMouseDown=function(t){var e=this;2===t.button&&this.allowPanning(t,!0)&&this.widget&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",(function(){return e.updateClassName(!1)})))},e.prototype.preparePanning=function(t){var e=this,n=t.e;this.widget&&(this.allowPanning(n,!0)||this.allowPanning(n)&&!this.graph.selection.allowRubberband(n,!0))&&(this.updateClassName(!0),this.widget.startPanning(n),this.widget.once("pan:stop",(function(){return e.updateClassName(!1)})))},e.prototype.allowPanning=function(t,e){return this.widget&&this.pannable&&og.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)},e.prototype.updateClassName=function(t){if(null!=this.widget){var e=this.widget.container,n=this.view.prefixClassName("graph-scroller-pannable");this.pannable?(oa(e,n),e.dataset.panning=(!!t).toString()):sa(e,n)}},e.prototype.enablePanning=function(){this.pannable||(this.widgetOptions.pannable=!0,this.updateClassName())},e.prototype.disablePanning=function(){this.pannable&&(this.widgetOptions.pannable=!1,this.updateClassName())},e.prototype.lock=function(){this.widget&&this.widget.lock()},e.prototype.unlock=function(){this.widget&&this.widget.unlock()},e.prototype.update=function(){this.widget&&this.widget.update()},e.prototype.enableAutoResize=function(){this.widget&&this.widget.enableAutoResize()},e.prototype.disableAutoResize=function(){this.widget&&this.widget.disableAutoResize()},e.prototype.resize=function(t,e){this.widget&&this.widget.resize(t,e)},e.prototype.dispose=function(){this.widget&&this.widget.dispose(),this.stopListening()},o([Vf.dispose()],e.prototype,"dispose",null),e}(Vf),pg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"commonOptions",{get:function(){var t=this.instanceOptions;return t.enabled,i(t,["enabled"])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instanceOptions",{get:function(){return this.options.clipboard},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cells",{get:function(){return this.widget.cells},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!0!==this.instanceOptions.enabled},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.widget=this.graph.hook.createClipboard(),this.widget.deserialize(this.instanceOptions)},e.prototype.enable=function(){this.disabled&&(this.instanceOptions.enabled=!0)},e.prototype.disable=function(){this.disabled||(this.instanceOptions.enabled=!1)},e.prototype.copy=function(t,e){void 0===e&&(e={}),this.disabled||(this.widget.copy(t,this.graph,r(r({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))},e.prototype.cut=function(t,e){void 0===e&&(e={}),this.disabled||(this.widget.cut(t,this.graph,r(r({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))},e.prototype.paste=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=this.graph),this.disabled?[]:this.widget.paste(e,r(r({},this.commonOptions),t))},e.prototype.clean=function(t){this.disabled&&!t||(this.widget.clean(),this.graph.trigger("clipboard:changed",{cells:[]}))},e.prototype.isEmpty=function(){return this.widget.isEmpty()},e.prototype.dispose=function(){this.clean(!0)},o([Vf.dispose()],e.prototype,"dispose",null),e}(Vf),dg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.highlights={},e}return n(e,t),e.prototype.init=function(){this.startListening()},e.prototype.startListening=function(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)},e.prototype.stopListening=function(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)},e.prototype.onCellHighlight=function(t){var e=t.view,n=t.magnet,i=t.options,o=void 0===i?{}:i,s=this.resolveHighlighter(o);if(s){var a=this.getHighlighterId(n,s);if(!this.highlights[a]){var l=s.highlighter;l.highlight(e,n,r({},s.args)),this.highlights[a]={cellView:e,magnet:n,highlighter:l,args:s.args}}}},e.prototype.onCellUnhighlight=function(t){var e=t.magnet,n=t.options,r=void 0===n?{}:n,i=this.resolveHighlighter(r);if(i){var o=this.getHighlighterId(e,i);this.unhighlight(o)}},e.prototype.resolveHighlighter=function(t){var e=this.options,n=t.highlighter;if(null==n){var r=t.type;n=r&&e.highlighting[r]||e.highlighting.default}if(null==n)return null;var i="string"==typeof n?{name:n}:n,o=i.name,s=Bh.registry.get(o);return null==s?Bh.registry.onNotFound(o):(Bh.check(o,s),{name:o,highlighter:s,args:i.args||{}})},e.prototype.getHighlighterId=function(t,e){return ca(t),e.name+t.id+JSON.stringify(e.args)},e.prototype.unhighlight=function(t){var e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])},e.prototype.dispose=function(){var t=this;Object.keys(this.highlights).forEach((function(e){return t.unhighlight(e)})),this.stopListening()},o([e.dispose()],e.prototype,"dispose",null),e}(Vf),fg=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.widgets=new Map,t}return n(i,e),Object.defineProperty(i.prototype,"container",{get:function(){return this.graph.view.container},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewport",{get:function(){return this.graph.view.viewport},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isSelectionEnabled",{get:function(){return!0===this.options.selecting.enabled},enumerable:!1,configurable:!0}),i.prototype.init=function(){this.startListening(),this.resize()},i.prototype.startListening=function(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)},i.prototype.stopListening=function(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)},i.prototype.onNodeMouseUp=function(t){var e=t.node;if(!this.isSelectionEnabled){var n=this.graph.hook.createTransform(e,{clearAll:!0});n&&this.widgets.set(e,n)}},i.prototype.onNodeSelected=function(t){var e=t.node;if(this.isSelectionEnabled){var n=this.graph.hook.createTransform(e,{clearAll:!1});n&&this.widgets.set(e,n)}},i.prototype.onNodeUnSelected=function(t){var e=t.node;if(this.isSelectionEnabled){var n=this.widgets.get(e);n&&n.dispose(),this.widgets.delete(e)}},i.prototype.getMatrix=function(){var t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),ou(this.viewportMatrix)},i.prototype.setMatrix=function(t){var e=ou(t),n=lu(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n},i.prototype.resize=function(t,e){var n=void 0===t?this.options.width:t,i=void 0===e?this.options.height:e;this.options.width=n,this.options.height=i,"number"==typeof n&&(n=Math.round(n)),"number"==typeof i&&(i=Math.round(i)),this.container.style.width=null==n?"":n+"px",this.container.style.height=null==i?"":i+"px";var o=this.getComputedSize();return this.graph.trigger("resize",r({},o)),this},i.prototype.getComputedSize=function(){var t=this.options.width,e=this.options.height;return Ji(t)||(t=this.container.clientWidth),Ji(e)||(e=this.container.clientHeight),{width:t,height:e}},i.prototype.getScale=function(){return pu(this.getMatrix())},i.prototype.scale=function(t,e,n,i,o){if(void 0===e&&(e=t),void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o={}),t=this.clampScale(t),e=this.clampScale(e),n||i){var s=this.getTranslation(),a=s.tx-n*(t-1),l=s.ty-i*(e-1);a===s.tx&&l===s.ty||this.translate(a,l)}var u=this.getMatrix();return u.a=t,u.d=e,this.setMatrix(u),this.graph.trigger("scale",r({sx:t,sy:e,ox:n,oy:i},o)),this},i.prototype.clampScale=function(t){var e=this.graph.options.scaling;return In(t,e.min||.01,e.max||16)},i.prototype.getZoom=function(){return this.getScale().sx},i.prototype.zoom=function(t,e){e=e||{};var n=t,r=t,i=this.getScale(),o=this.getComputedSize(),s=o.width/2,a=o.height/2;if(e.absolute||(n+=i.sx,r+=i.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,r=Math.round(r/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),r=Math.min(e.maxScale,r)),e.minScale&&(n=Math.max(e.minScale,n),r=Math.max(e.minScale,r)),e.center&&(s=e.center.x,a=e.center.y),n=this.clampScale(n),r=this.clampScale(r),s||a){var l=this.getTranslation(),u=s-(s-l.tx)*(n/i.sx),c=a-(a-l.ty)*(r/i.sy);u===l.tx&&c===l.ty||this.translate(u,c,{ui:e.ui})}return this.scale(n,r,0,0,{ui:e.ui}),this},i.prototype.getRotation=function(){return du(this.getMatrix())},i.prototype.rotate=function(t,e,n){if(null==e||null==n){var r=bu(this.graph.view.stage);e=r.width/2,n=r.height/2}var i=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(i),this},i.prototype.getTranslation=function(){return fu(this.getMatrix())},i.prototype.translate=function(t,e,n){void 0===n&&(n={});var i=this.getMatrix();i.e=t||0,i.f=e||0,this.setMatrix(i);var o=this.getTranslation();return this.options.x=o.tx,this.options.y=o.ty,this.graph.trigger("translate",r(r({},o),n)),this},i.prototype.setOrigin=function(t,e){return this.translate(t||0,e||0)},i.prototype.fitToContent=function(e,n,r,i){if("object"==typeof e){var o=e;e=o.gridWidth||1,n=o.gridHeight||1,r=o.padding||0,i=o}else e=e||1,n=n||1,r=r||0,null==i&&(i={});var s=Us(r),a=i.border||0,l=i.contentArea?t.Rectangle.create(i.contentArea):this.getContentArea(i);a>0&&l.inflate(a);var u=this.getScale(),c=this.getTranslation(),h=u.sx,p=u.sy;l.x*=h,l.y*=p,l.width*=h,l.height*=p;var d=Math.max(Math.ceil((l.width+l.x)/e),1)*e,f=Math.max(Math.ceil((l.height+l.y)/n),1)*n,g=0,v=0;("negative"===i.allowNewOrigin&&l.x<0||"positive"===i.allowNewOrigin&&l.x>=0||"any"===i.allowNewOrigin)&&(g=Math.ceil(-l.x/e)*e,d+=g+=s.left),("negative"===i.allowNewOrigin&&l.y<0||"positive"===i.allowNewOrigin&&l.y>=0||"any"===i.allowNewOrigin)&&(v=Math.ceil(-l.y/n)*n,f+=v+=s.top),d+=s.right,f+=s.bottom,d=Math.max(d,i.minWidth||0),f=Math.max(f,i.minHeight||0),d=Math.min(d,i.maxWidth||Number.MAX_SAFE_INTEGER),f=Math.min(f,i.maxHeight||Number.MAX_SAFE_INTEGER);var y=this.getComputedSize(),m=d!==y.width||f!==y.height;return(g!==c.tx||v!==c.ty)&&this.translate(g,v),m&&this.resize(d,f),new t.Rectangle(-g/h,-v/p,d/h,f/p)},i.prototype.scaleContentToFit=function(t){void 0===t&&(t={}),this.scaleContentToFitImpl(t)},i.prototype.scaleContentToFitImpl=function(e,n){var r,i;if(void 0===e&&(e={}),void 0===n&&(n=!0),e.contentArea){var o=e.contentArea;r=this.graph.localToGraph(o),i=t.Point.create(o)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(r.width&&r.height){var s,a=Us(e.padding),l=e.minScale||0,u=e.maxScale||Number.MAX_SAFE_INTEGER,c=e.minScaleX||l,h=e.maxScaleX||u,p=e.minScaleY||l,d=e.maxScaleY||u;if(e.viewportArea)s=e.viewportArea;else{var f=this.getComputedSize(),g=this.getTranslation();s={x:g.tx,y:g.ty,width:f.width,height:f.height}}s=t.Rectangle.create(s).moveAndExpand({x:a.left,y:a.top,width:-a.left-a.right,height:-a.top-a.bottom});var v=this.getScale(),y=s.width/r.width*v.sx,m=s.height/r.height*v.sy;!1!==e.preserveAspectRatio&&(y=m=Math.min(y,m));var b=e.scaleGrid;if(b&&(y=b*Math.floor(y/b),m=b*Math.floor(m/b)),y=In(y,c,h),m=In(m,p,d),this.scale(y,m),n){var C=this.options,x=s.x-i.x*y-C.x,w=s.y-i.y*m-C.y;this.translate(x,w)}}},i.prototype.getContentArea=function(e){return void 0===e&&(e={}),e.useCellGeometry?this.model.getAllCellsBBox()||new t.Rectangle:bu(this.graph.view.stage)},i.prototype.getContentBBox=function(t){return void 0===t&&(t={}),this.graph.localToGraph(this.getContentArea(t))},i.prototype.getGraphArea=function(){var e=t.Rectangle.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)},i.prototype.zoomToRect=function(e,n){void 0===n&&(n={});var r=t.Rectangle.create(e),i=this.graph;n.contentArea=r,null==n.viewportArea&&(n.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(n,!1);var o=r.getCenter();return this.centerPoint(o.x,o.y),this},i.prototype.zoomToFit=function(t){return void 0===t&&(t={}),this.zoomToRect(this.getContentArea(t),t)},i.prototype.centerPoint=function(t,e){var n=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=n.width/2,s=n.height/2;e="number"==typeof e?e:s,t=o-(t="number"==typeof t?t:o)*r.sx,e=s-e*r.sy,i.tx===t&&i.ty===e||this.translate(t,e)},i.prototype.centerContent=function(t){var e=this.graph.getContentArea(t).getCenter();this.centerPoint(e.x,e.y)},i.prototype.centerCell=function(t){return this.positionCell(t,"center")},i.prototype.positionPoint=function(t,e,n){var r=this.getComputedSize();(e=Gs(e,Math.max(0,r.width)))<0&&(e=r.width+e),(n=Gs(n,Math.max(0,r.height)))<0&&(n=r.height+n);var i=this.getTranslation(),o=this.getScale(),s=e-t.x*o.sx,a=n-t.y*o.sy;i.tx===s&&i.ty===a||this.translate(s,a)},i.prototype.positionRect=function(e,n){var r=t.Rectangle.create(e);switch(n){case"center":return this.positionPoint(r.getCenter(),"50%","50%");case"top":return this.positionPoint(r.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%");case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(r.getTopLeft(),0,0);default:return this}},i.prototype.positionCell=function(t,e){var n=t.getBBox();return this.positionRect(n,e)},i.prototype.positionContent=function(t,e){var n=this.graph.getContentArea(e);return this.positionRect(n,t)},i.prototype.dispose=function(){this.widgets.forEach((function(t){return t.dispose()})),this.widgets.clear(),this.stopListening()},o([i.dispose()],i.prototype,"dispose",null),i}(Vf),gg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.movedMap=new WeakMap,e.unselectMap=new WeakMap,e}return n(e,t),Object.defineProperty(e.prototype,"widgetOptions",{get:function(){return this.options.selecting},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rubberbandDisabled",{get:function(){return!0!==this.widgetOptions.enabled||!0!==this.widgetOptions.rubberband},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!0!==this.widgetOptions.enabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.widget.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cells",{get:function(){return this.widget.cells},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.widget=this.graph.hook.createSelection(),this.startListening()},e.prototype.startListening=function(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.widget.on("box:mousedown",this.onBoxMouseDown,this)},e.prototype.stopListening=function(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.widget.off("box:mousedown",this.onBoxMouseDown,this)},e.prototype.onBlankMouseDown=function(t){var e=t.e;(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!this.graph.scroller.allowPanning(e,!0)&&!this.graph.panning.allowPanning(e,!0))&&this.startRubberband(e)},e.prototype.onBlankClick=function(){this.clean()},e.prototype.allowRubberband=function(t,e){return!this.rubberbandDisabled&&og.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowRubberband(t)},e.prototype.allowMultipleSelection=function(t){return this.isMultiple()&&og.isMatch(t,this.widgetOptions.multipleSelectionModifiers)},e.prototype.onCellMouseMove=function(t){var e=t.cell;this.movedMap.set(e,!0)},e.prototype.onCellMouseUp=function(t){var e=t.e,n=t.cell,r=this.widgetOptions,i=this.disabled;!i&&this.movedMap.has(n)&&((i=!1===r.selectCellOnMoved)||(i=!1===r.selectNodeOnMoved&&n.isNode()),i||(i=!1===r.selectEdgeOnMoved&&n.isEdge())),i||(this.allowMultipleSelection(e)?this.unselectMap.has(n)?this.unselectMap.delete(n):this.isSelected(n)?this.unselect(n):this.select(n):this.reset(n)),this.movedMap.delete(n)},e.prototype.onBoxMouseDown=function(t){var e=t.e,n=t.cell;this.disabled||this.allowMultipleSelection(e)&&(this.unselect(n),this.unselectMap.set(n,!0))},e.prototype.isEmpty=function(){return this.length<=0},e.prototype.isSelected=function(t){return this.widget.isSelected(t)},e.prototype.getCells=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return"string"==typeof t?e.graph.getCellById(t):t})).filter((function(t){return null!=t}))},e.prototype.select=function(t,e){void 0===e&&(e={});var n=this.getCells(t);return n.length&&(this.isMultiple()?this.widget.select(n,e):this.reset(n.slice(0,1),e)),this},e.prototype.unselect=function(t,e){return void 0===e&&(e={}),this.widget.unselect(this.getCells(t),e),this},e.prototype.reset=function(t,e){return void 0===e&&(e={}),this.widget.reset(t?this.getCells(t):[],e),this},e.prototype.clean=function(t){return void 0===t&&(t={}),this.widget.clean(t),this},e.prototype.enable=function(){return this.disabled&&(this.widgetOptions.enabled=!0),this},e.prototype.disable=function(){return this.disabled||(this.widgetOptions.enabled=!1),this},e.prototype.startRubberband=function(t){return this.rubberbandDisabled||this.widget.startSelecting(t),this},e.prototype.enableRubberband=function(){return this.rubberbandDisabled&&(this.widgetOptions.rubberband=!0),this},e.prototype.disableRubberband=function(){return this.rubberbandDisabled||(this.widgetOptions.rubberband=!1),this},e.prototype.isMultiple=function(){return!1!==this.widgetOptions.multiple},e.prototype.enableMultiple=function(){return this.widgetOptions.multiple=!0,this},e.prototype.disableMultiple=function(){return this.widgetOptions.multiple=!1,this},e.prototype.setModifiers=function(t){return this.widgetOptions.modifiers=t,this},e.prototype.setContent=function(t){return this.widget.setContent(t),this},e.prototype.setFilter=function(t){return this.widget.setFilter(t),this},e.prototype.dispose=function(){this.stopListening(),this.widget.dispose()},o([Vf.dispose()],e.prototype,"dispose",null),e}(Vf),vg=function(e){function i(t){var n=e.call(this)||this;return n.batchCommands=null,n.batchLevel=0,n.lastBatchIndex=-1,n.freezed=!1,n.handlers=[],n.graph=t.graph,n.model=t.graph.model,n.options=cg.getOptions(t),n.validator=new i.Validator({history:n,cancelInvalid:n.options.cancelInvalid}),n.clean(),n.startListening(),n}return n(i,e),Object.defineProperty(i.prototype,"disabled",{get:function(){return!0!==this.options.enabled},enumerable:!1,configurable:!0}),i.prototype.enable=function(){this.disabled&&(this.options.enabled=!0)},i.prototype.disable=function(){this.disabled||(this.options.enabled=!1)},i.prototype.undo=function(t){if(void 0===t&&(t={}),!this.disabled){var e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this},i.prototype.redo=function(t){if(void 0===t&&(t={}),!this.disabled){var e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStack.push(e),this.notify("redo",e,t))}return this},i.prototype.cancel=function(t){if(void 0===t&&(t={}),!this.disabled){var e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this},i.prototype.clean=function(t){return void 0===t&&(t={}),this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this},i.prototype.canUndo=function(){return!this.disabled&&this.undoStack.length>0},i.prototype.canRedo=function(){return!this.disabled&&this.redoStack.length>0},i.prototype.validate=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(e=this.validator).validate.apply(e,s([t],n,!1)),this},i.prototype.dispose=function(){this.validator.dispose(),this.clean(),this.stopListening()},i.prototype.startListening=function(){var t=this;this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((function(e,n){t.handlers[n]=t.addCommand.bind(t,e),t.model.on(e,t.handlers[n])})),this.validator.on("invalid",(function(e){return t.trigger("invalid",e)}))},i.prototype.stopListening=function(){var t=this;this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((function(e,n){t.model.off(e,t.handlers[n])})),this.handlers.length=0),this.validator.off("invalid")},i.prototype.createCommand=function(t){return{batch:!!t&&t.batch,data:{}}},i.prototype.revertCommand=function(t,e){this.freezed=!0;for(var n=Array.isArray(t)?cg.sortBatchCommands(t):[t],i=n.length-1;i>=0;i-=1){var o=n[i],s=r(r({},e),Do(o.options,this.options.revertOptionsList||[]));this.executeCommand(o,!0,s)}this.freezed=!1},i.prototype.applyCommand=function(t,e){this.freezed=!0;for(var n=Array.isArray(t)?cg.sortBatchCommands(t):[t],i=0;i<n.length;i+=1){var o=n[i],s=r(r({},e),Do(o.options,this.options.applyOptionsList||[]));this.executeCommand(o,!1,s)}this.freezed=!1},i.prototype.executeCommand=function(t,e,n){var r=this.model,i=r.getCell(t.data.id),o=t.event;if(cg.isAddEvent(o)&&e||cg.isRemoveEvent(o)&&!e)i.remove(n);else if(cg.isAddEvent(o)&&!e||cg.isRemoveEvent(o)&&e){(s=t.data).node?r.addNode(s.props,n):s.edge&&r.addEdge(s.props,n)}else if(cg.isChangeEvent(o)){var s,a=(s=t.data).key;if(a){var l=e?s.prev[a]:s.next[a];i.prop(a,l,n)}}else{var u=this.options.executeCommand;u&&Ws(u,this,t,e,n)}},i.prototype.addCommand=function(e,n){if(!this.freezed&&!this.disabled){var r=n,i=r.options||{};if(!i.dryrun&&!(cg.isAddEvent(e)&&this.options.ignoreAdd||cg.isRemoveEvent(e)&&this.options.ignoreRemove||cg.isChangeEvent(e)&&this.options.ignoreChange)){var o=this.options.beforeAddCommand;if(null==o||!1!==Ws(o,this,e,n)){"cell:change:*"===e&&(e="cell:change:"+r.key);var s,a=r.cell,l=t.Model.isModel(a);if(this.batchCommands){s=this.batchCommands[Math.max(this.lastBatchIndex,0)];var u=l&&!s.modelChange||s.data.id!==a.id,c=s.event!==e;if(this.lastBatchIndex>=0&&(u||c)){var h=this.batchCommands.findIndex((function(t){return(l&&t.modelChange||t.data.id===a.id)&&t.event===e}));h<0||cg.isAddEvent(e)||cg.isRemoveEvent(e)?s=this.createCommand({batch:!0}):(s=this.batchCommands[h],this.batchCommands.splice(h,1)),this.batchCommands.push(s),this.lastBatchIndex=this.batchCommands.length-1}}else s=this.createCommand({batch:!1});if(cg.isAddEvent(e)||cg.isRemoveEvent(e)){var p=s.data;return s.event=e,s.options=i,p.id=a.id,p.props=zr(a.toJSON()),a.isEdge()?p.edge=!0:a.isNode()&&(p.node=!0),this.push(s,i)}if(cg.isChangeEvent(e)){var d=n.key;p=s.data;return s.batch&&s.event||(s.event=e,s.options=i,p.key=d,null==p.prev&&(p.prev={}),p.prev[d]=Fr(a.previous(d)),l?s.modelChange=!0:p.id=a.id),null==p.next&&(p.next={}),p.next[d]=Fr(a.prop(d)),this.push(s,i)}var f=this.options.afterAddCommand;f&&Ws(f,this,e,n,s),this.push(s,i)}}}},i.prototype.initBatchCommand=function(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))},i.prototype.storeBatchCommand=function(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){var e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStack.push(e),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)},i.prototype.filterBatchCommand=function(t){for(var e=t.slice(),n=[],r=function(){var t=e.shift(),r=t.event,i=t.data.id;if(null!=r&&(null!=i||t.modelChange)){if(cg.isAddEvent(r)){var o=e.findIndex((function(t){return cg.isRemoveEvent(t.event)&&t.data.id===i}));if(o>=0)return e=e.filter((function(t,e){return o<e||t.data.id!==i})),"continue"}else if(cg.isRemoveEvent(r)){var s=e.findIndex((function(t){return cg.isAddEvent(t.event)&&t.data.id===i}));if(s>=0)return e.splice(s,1),"continue"}else if(cg.isChangeEvent(r)){var a=t.data;if(Wi(a.prev,a.next))return"continue"}n.push(t)}};e.length>0;)r();return n},i.prototype.notify=function(t,e,n){var r=null==e?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:r,options:n}),this.emit("change",{cmds:r,options:n})},i.prototype.push=function(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStack.push(t),this.notify("add",t,e))},o([t.Basecoat.dispose()],i.prototype,"dispose",null),i}(t.Basecoat);!function(e){var r=function(e){function r(t){var n=e.call(this)||this;return n.map={},n.command=t.history,n.cancelInvalid=!1!==t.cancelInvalid,n.command.on("add",n.onCommandAdded,n),n}return n(r,e),r.prototype.onCommandAdded=function(t){var e=this,n=t.cmds;return Array.isArray(n)?n.every((function(t){return e.isValidCommand(t)})):this.isValidCommand(n)},r.prototype.isValidCommand=function(t){if(t.options&&!1===t.options.validation)return!0;var e=t.event&&this.map[t.event]||[],n=null;return e.forEach((function(e){var r=0,i=function(o){var s=e[r];r+=1;try{if(!s)return void(n=o);s(o,t,i)}catch(o){i(o)}};i(n)})),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)},r.prototype.validate=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=Array.isArray(t)?t:t.split(/\s+/);return n.forEach((function(t){if("function"!=typeof t)throw new Error(i.join(" ")+" requires callback functions.")})),i.forEach((function(t){null==e.map[t]&&(e.map[t]=[]),e.map[t].push(n)})),this},r.prototype.dispose=function(){this.command.off("add",this.onCommandAdded,this)},o([t.Basecoat.dispose()],r.prototype,"dispose",null),r}(t.Basecoat);e.Validator=r}(vg||(vg={})),function(t){t.isAddEvent=function(t){return"cell:added"===t},t.isRemoveEvent=function(t){return"cell:removed"===t},t.isChangeEvent=function(t){return null!=t&&t.startsWith("cell:change:")},t.getOptions=function(e){e.graph;var n=i(e,["graph"]),o=["cell:added","cell:removed","cell:change:*"],s=["batch:start","batch:stop"],a=e.eventNames?e.eventNames.filter((function(e){return!(t.isChangeEvent(e)||o.includes(e)||s.includes(e))})):o;return r(r({},n),{eventNames:a,applyOptionsList:e.applyOptionsList||["propertyPath"],revertOptionsList:e.revertOptionsList||["propertyPath"]})},t.sortBatchCommands=function(e){for(var n=[],r=0,i=e.length;r<i;r+=1){var o=e[r],s=null;if(t.isAddEvent(o.event))for(var a=o.data.id,l=0;l<r;l+=1)if(e[l].data.id===a){s=l;break}null!==s?n.splice(s,0,o):n.push(o)}return n}}(cg||(cg={}));var yg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"widgetOptions",{get:function(){return this.options.minimap},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.widget=this.graph.hook.createMiniMap()},e.prototype.dispose=function(){this.widget&&this.widget.dispose()},o([Vf.dispose()],e.prototype,"dispose",null),e}(Vf),mg={exports:{}};!function(t){!function(e,n,r){if(e){for(var i,o={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},s={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},u=1;u<20;++u)o[111+u]="f"+u;for(u=0;u<=9;++u)o[u+96]=u.toString();v.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},v.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},v.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},v.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},v.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},v.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},v.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);i=null},v.init=function(){var t=v(n);for(var e in t)"_"!==e.charAt(0)&&(v[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},v.init(),e.Mousetrap=v,t.exports&&(t.exports=v)}function c(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function h(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return o[t.which]?o[t.which]:s[t.which]?s[t.which]:String.fromCharCode(t.which).toLowerCase()}function p(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function d(t,e,n){return n||(n=function(){if(!i)for(var t in i={},o)t>95&&t<112||o.hasOwnProperty(t)&&(i[o[t]]=t);return i}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function f(t,e){var n,r,i,o=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),i=0;i<n.length;++i)r=n[i],l[r]&&(r=l[r]),e&&"keypress"!=e&&a[r]&&(r=a[r],o.push("shift")),p(r)&&o.push(r);return{key:r,modifiers:o,action:e=d(r,o,e)}}function g(t,e){return null!==t&&t!==n&&(t===e||g(t.parentNode,e))}function v(t){var e=this;if(t=t||n,!(e instanceof v))return new v(t);e.target=t,e._callbacks={},e._directMap={};var r,i={},o=!1,s=!1,a=!1;function l(t){t=t||{};var e,n=!1;for(e in i)t[e]?n=!0:i[e]=0;n||(a=!1)}function u(t,n,r,o,s,a){var l,u,c,h,d=[],f=r.type;if(!e._callbacks[t])return[];for("keyup"==f&&p(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(u=e._callbacks[t][l],(o||!u.seq||i[u.seq]==u.level)&&f==u.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||(c=n,h=u.modifiers,c.sort().join(",")===h.sort().join(",")))){var g=!o&&u.combo==s,v=o&&u.seq==o&&u.level==a;(g||v)&&e._callbacks[t].splice(l,1),d.push(u)}return d}function d(t,n,r,i){e.stopCallback(n,n.target||n.srcElement,r,i)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function g(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=h(t);n&&("keyup"!=t.type||o!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):o=!1)}function y(t,e,n,s){function u(e){return function(){a=e,++i[t],clearTimeout(r),r=setTimeout(l,1e3)}}function c(e){d(n,e,t),"keyup"!==s&&(o=h(e)),setTimeout(l,10)}i[t]=0;for(var p=0;p<e.length;++p){var g=p+1===e.length?c:u(s||f(e[p+1]).action);m(e[p],g,s,t,p)}}function m(t,n,r,i,o){e._directMap[t+":"+r]=n;var s,a=(t=t.replace(/\s+/g," ")).split(" ");a.length>1?y(t,a,n,r):(s=f(t,r),e._callbacks[s.key]=e._callbacks[s.key]||[],u(s.key,s.modifiers,{type:s.action},i,t,o),e._callbacks[s.key][i?"unshift":"push"]({callback:n,modifiers:s.modifiers,action:s.action,seq:i,level:o,combo:t}))}e._handleKey=function(t,e,n){var r,i=u(t,e,n),o={},c=0,h=!1;for(r=0;r<i.length;++r)i[r].seq&&(c=Math.max(c,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=c)continue;h=!0,o[i[r].seq]=1,d(i[r].callback,n,i[r].combo,i[r].seq)}else h||d(i[r].callback,n,i[r].combo);var f="keypress"==n.type&&s;n.type!=a||p(t)||f||l(o),s=h&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)m(t[r],e,n)},c(t,"keypress",g),c(t,"keydown",g),c(t,"keyup",g)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(mg);var bg=mg.exports,Cg=function(e){function r(t){var n=e.call(this)||this;n.options=t;var i=n.graph.scroller.widget;return n.container=i?i.container:n.graph.container,t.global?n.target=document:(n.target=n.container,n.disabled||n.target.setAttribute("tabindex","-1"),n.graph.on("cell:mouseup",n.focus,n),n.graph.on("blank:mouseup",n.focus,n)),n.mousetrap=r.createMousetrap(n),n}return n(r,e),Object.defineProperty(r.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"disabled",{get:function(){return!0!==this.options.enabled},enumerable:!1,configurable:!0}),r.prototype.enable=function(){this.disabled&&(this.options.enabled=!0,this.graph.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))},r.prototype.disable=function(){this.disabled||(this.options.enabled=!1,this.graph.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},r.prototype.on=function(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)},r.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},r.prototype.focus=function(t){this.isInputEvent(t.e)||this.target.focus({preventScroll:!0})},r.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return e.formatkey(t)}))},r.prototype.formatkey=function(t){var e=t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command"),n=this.options.format;return n?Ws(n,this.graph,e):e},r.prototype.isGraphEvent=function(t){var e=t.srcElement||t.target,n=t.currentTarget;return!!e&&(e===this.target||n===this.target||e===document.body||Aa(this.container,e))},r.prototype.isInputEvent=function(t){var e=t.target,n=e&&e.tagName.toLowerCase();return["input","textarea"].includes(n)},r.prototype.isEnabledForEvent=function(t){var e=!this.disabled&&this.isGraphEvent(t),n=this.isInputEvent(t);if(e){var r=t.keyCode||t.which;if(n&&(8===r||46===r))return!1;if(this.options.guard)return Ws(this.options.guard,this.graph,t)}return e},r.prototype.dispose=function(){this.mousetrap.reset()},o([t.Disposable.dispose()],r.prototype,"dispose",null),r}(t.Disposable);!function(t){t.createMousetrap=function(t){var e=new bg(t.target),n=e.stopCallback;return e.stopCallback=function(r,i,o){return!t.isEnabledForEvent(r)||!!n&&n.call(e,r,i,o)},e}}(Cg||(Cg={}));var xg=function(e){function r(t){var n=e.call(this)||this;n.options=t,n.cumulatedFactor=1;var r=n.graph.scroller.widget;return n.container=r?r.container:n.graph.container,n.target=n.options.global?document:n.container,n.mousewheelHandle=new Fu(n.target,n.onMouseWheel.bind(n),n.allowMouseWheel.bind(n)),n.options.enabled&&n.enable(!0),n}return n(r,e),Object.defineProperty(r.prototype,"graph",{get:function(){return this.options.graph},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"disabled",{get:function(){return!0!==this.options.enabled},enumerable:!1,configurable:!0}),r.prototype.enable=function(t){(this.disabled||t)&&(this.options.enabled=!0,this.graph.options.mousewheel.enabled=!0,this.mousewheelHandle.enable())},r.prototype.disable=function(){this.disabled||(this.options.enabled=!1,this.graph.options.mousewheel.enabled=!1,this.mousewheelHandle.disable())},r.prototype.allowMouseWheel=function(t){var e=t.originalEvent||t,n=this.options.guard;return(null==n||n.call(this.graph,e))&&og.isMatch(e,this.options.modifiers)},r.prototype.onMouseWheel=function(t){var e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&og.isMatch(e,this.options.modifiers)){var r=this.options.factor||1.2;null==this.currentScale&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.scroller.widget?this.graph.scroller.widget.zoom():this.graph.transform.getScale().sx),t.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*r*20)/20/this.currentScale:this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/r)*20)/20/this.currentScale,this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);var i=this.graph.scroller.widget,o=this.currentScale,s=this.graph.transform.clampScale(o*this.cumulatedFactor);if((s=In(s,this.options.minScale||Number.MIN_SAFE_INTEGER,this.options.maxScale||Number.MAX_SAFE_INTEGER))!==o)if(i)if(this.options.zoomAtMousePosition){var a=this.graph.coord.clientToLocalPoint(this.startPos);i.zoom(s,{absolute:!0,center:a.clone()})}else i.zoom(s,{absolute:!0});else if(this.options.zoomAtMousePosition){var l=this.graph.coord.clientToGraphPoint(this.startPos);this.graph.transform.zoom(s,{absolute:!0,center:l.clone(),ui:!0})}else this.graph.transform.zoom(s,{absolute:!0,ui:!0});this.currentScale=null,this.cumulatedFactor=1}},r.prototype.dispose=function(){this.disable()},o([t.Disposable.dispose()],r.prototype,"dispose",null),r}(t.Disposable),wg=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.show=function(t){var e=this;void 0===t&&(t={});var n=r(r({},i.defaultOptions),t),o=this.createPrintPages(n);n.ready(o,(function(t){return e.showPrintWindow(t,n)}),{sheetSize:this.getSheetSize(n)})},Object.defineProperty(i.prototype,"className",{get:function(){return this.view.prefixClassName("graph-print")},enumerable:!1,configurable:!0}),i.prototype.showPrintWindow=function(t,e){var n=this;if(t){var r=u(document.body),i=u(this.view.container),o=this.view.prefixClassName("graph-printing");r.addClass(o);var s=i.children().detach();t.forEach((function(t){t.removeClass(n.className+"-preview").addClass(n.className+"-ready").appendTo(r)}));var a=!1,l=function(){a||(a=!0,r.removeClass(o),t.forEach((function(t){return t.remove()})),i.append(s),u("#"+n.styleSheetId).remove(),n.graph.trigger("after:print",e),u(window).off("afterprint",l))};u(window).one("afterprint",l),setTimeout(l,200),window.print()}},i.prototype.createPrintPage=function(e,n){this.graph.trigger("before:print",n);var r=u("<div/>").addClass(this.className),i=u("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");n.size&&r.addClass(this.className+"-size-"+n.size);var o=t.Vector.create(this.view.svg).clone(),s=o.findOne("."+this.view.prefixClassName("graph-svg-stage"));i.append(o.node);var a=this.getSheetSize(n),l=this.graph.transform.getGraphArea(),c=this.graph.transform.getScale(),h=this.graph.translate(),p=ou().translate(h.tx/c.sx,h.ty/c.sy),d=this.getPageInfo(l,e,a),f=d.scale,g=d.bbox;return i.css({left:0,top:0}),o.attr({width:g.width*f,height:g.height*f,style:"position:relative",viewBox:[g.x,g.y,g.width,g.height].join(" ")}),s.attr("transform",lu(p)),r.append(i),r.addClass(this.className+"-preview"),{$page:r,sheetSize:a}},i.prototype.createPrintPages=function(t){var e,n=this,r=this.getPrintArea(t),i=[];if(t.page){var o=this.getPageSize(r,t.page);this.getPageAreas(r,o).forEach((function(r){e=n.createPrintPage(r,t),i.push(e.$page)}))}else e=this.createPrintPage(r,t),i.push(e.$page);if(e){var s={width:e.sheetSize.cssWidth,height:e.sheetSize.cssHeight};this.updatePrintStyle(s,t)}return i},Object.defineProperty(i.prototype,"styleSheetId",{get:function(){return this.view.prefixClassName("graph-print-style")},enumerable:!1,configurable:!0}),i.prototype.updatePrintStyle=function(t,e){var n=Object.keys(t).reduce((function(e,n){return e+" "+n+":"+t[n]+";"}),""),r=Us(e.margin),i=e.marginUnit||"",o=e.sheetUnit||"",s="\n @media print {\n ."+this.className+"."+this.className+"-ready {\n "+n+"\n }\n\n @page {\n margin:\n "+[r.top+i,r.right+i,r.bottom+i,r.left+i].join(" ")+";\n size: "+(e.sheet.width+o)+" "+(e.sheet.height+o)+";\n\n ."+this.className+"."+this.className+"-preview {\n "+n+"\n }\n }",a=this.styleSheetId,l=u("#"+a);l.length?l.html(s):u("head").append('\'<style type="text/css" id="'+a+'">'+s+"</style>'")},i.prototype.getPrintArea=function(t){var e=t.area;if(!e){var n=Us(t.padding);e=this.graph.getContentArea().moveAndExpand({x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom})}return e},i.prototype.getPageSize=function(t,e){if("object"==typeof e){var n=e,r={width:n.width,height:n.height};return null==r.width&&(r.width=Math.ceil(t.width/(n.columns||1))),null==r.height&&(r.height=Math.ceil(t.height/(n.rows||1))),r}return{width:t.width,height:t.height}},i.prototype.getPageAreas=function(e,n){for(var r=[],i=n.width,o=n.height,s=0,a=0;s<e.height&&a<200;s+=o,a+=1)for(var l=0,u=0;l<e.width&&u<200;l+=i,u+=1)r.push(new t.Rectangle(e.x+l,e.y+s,i,o));return r},i.prototype.getSheetSize=function(e){var n=e.sheet,r=Us(e.margin),i=e.marginUnit||"",o=e.sheetUnit||"",s="calc("+n.width+o+" - "+(r.left+r.right)+i+")",a="calc("+n.height+o+" - "+(r.top+r.bottom)+i+")",l=t.Unit.measure(s,a);return{cssWidth:s,cssHeight:a,width:l.width,height:l.height}},i.prototype.getPageInfo=function(e,n,r){var i=new t.Rectangle(n.x-e.x,n.y-e.y,n.width,n.height),o=i.width/i.height,s=r.width/r.height;return{bbox:i,scale:s<o?r.width/i.width:r.height/i.height,fitHorizontal:s<o}},i.prototype.dispose=function(){},o([Vf.dispose()],i.prototype,"dispose",null),i}(Vf);!function(t){t.defaultOptions={page:!1,sheet:{width:210,height:297},sheetUnit:"mm",margin:.4,marginUnit:"in",padding:5,ready:function(t,e){return e(t)}}}(wg||(wg={}));var Pg,Ag=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.toSVG=function(e,n){var r=this;void 0===n&&(n={}),this.graph.trigger("before:export",n);var i=this.view.svg,o=t.Vector.create(i).clone(),s=o.node,a=o.findOne("."+this.view.prefixClassName("graph-svg-stage")),l=n.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=n.preserveDimensions;if(c){var h="boolean"==typeof c?l:c;o.attr({width:h.width,height:h.height})}if(o.removeAttribute("style").attr("viewBox",[l.x,l.y,l.width,l.height].join(" ")),a.removeAttribute("transform"),!1!==n.copyStyles){for(var p=i.ownerDocument,d=Array.from(i.querySelectorAll("*")),f=Array.from(s.querySelectorAll("*")),g=p.styleSheets.length,v=[],y=g-1;y>=0;y-=1)v[y]=p.styleSheets[y],p.styleSheets[y].disabled=!0;var m={};d.forEach((function(t,e){var n=window.getComputedStyle(t,null),r={};Object.keys(n).forEach((function(t){r[t]=n.getPropertyValue(t)})),m[e]=r})),g!==p.styleSheets.length&&v.forEach((function(t,e){p.styleSheets[e]=t}));for(var b=0;b<g;b+=1)p.styleSheets[b].disabled=!1;var C={};d.forEach((function(t,e){var n=window.getComputedStyle(t,null),r=m[e],i={};Object.keys(n).forEach((function(t){ps(t)||n.getPropertyValue(t)===r[t]||(i[t]=n.getPropertyValue(t))})),C[e]=i})),f.forEach((function(t,e){u(t).css(C[e])}))}var x=n.stylesheet;if("string"==typeof x){var w=i.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(x);o.prepend(t.Vector.create("style",{type:"text/css"},[w]))}var P=function(){var t=n.beforeSerialize;if("function"==typeof t){var i=Ws(t,r.graph,s);i instanceof SVGSVGElement&&(s=i)}var o=(new XMLSerializer).serializeToString(s).replace(/&nbsp;/g," ");r.graph.trigger("after:export",n),e(o)};if(n.serializeImages){var A=o.find("image").map((function(e){return new Promise((function(n){var r=e.attr("xlink:href")||e.attr("href");t.DataUri.imageToDataUri(r,(function(t,r){!t&&r&&e.attr("xlink:href",r),n()}))}))}));Promise.all(A).then(P)}else P()},i.prototype.toDataURL=function(e,n){var i=n.viewBox||this.graph.getContentBBox(),o=Us(n.padding);n.width&&n.height&&(o.left+o.right>=n.width&&(o.left=o.right=0),o.top+o.bottom>=n.height&&(o.top=o.bottom=0));var s=new t.Rectangle(-o.left,-o.top,o.left+o.right,o.top+o.bottom);if(n.width&&n.height){var a=i.width+o.left+o.right,l=i.height+o.top+o.bottom;s.scale(a/n.width,l/n.height)}i=t.Rectangle.create(i).moveAndExpand(s);var u="number"==typeof n.width&&"number"==typeof n.height?{width:n.width,height:n.height}:i,c=n.ratio?parseFloat(n.ratio):1;Number.isFinite(c)&&0!==c||(c=1);var h={width:Math.max(Math.round(u.width*c),1),height:Math.max(Math.round(u.height*c),1)},p=document.createElement("canvas"),d=p.getContext("2d");p.width=h.width,p.height=h.height;var f=h.width-1,g=h.height-1;d.fillStyle="rgb(1,1,1)",d.fillRect(f,g,1,1);var v=d.getImageData(f,g,1,1).data;if(1!==v[0]||1!==v[1]||1!==v[2])throw new Error("size exceeded");var y=new Image;y.onload=function(){var t=document.createElement("canvas");t.width=h.width,t.height=h.height;var r=t.getContext("2d");r.fillStyle=n.backgroundColor||"white",r.fillRect(0,0,h.width,h.height);try{r.drawImage(y,0,0,h.width,h.height);var i=t.toDataURL(n.type,n.quality);e(i)}catch(t){}},this.toSVG((function(t){y.src="data:image/svg+xml,"+encodeURIComponent(t)}),r(r({},n),{viewBox:i,serializeImages:!0,preserveDimensions:r({},h)}))},i.prototype.toPNG=function(t,e){void 0===e&&(e={}),this.toDataURL(t,r(r({},e),{type:"image/png"}))},i.prototype.toJPEG=function(t,e){void 0===e&&(e={}),this.toDataURL(t,r(r({},e),{type:"image/jpeg"}))},i}(Vf),Eg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.widgets=new Map,e}return n(e,t),Object.defineProperty(e.prototype,"isSelectionEnabled",{get:function(){return!0===this.options.selecting.enabled},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.startListening()},e.prototype.startListening=function(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)},e.prototype.stopListening=function(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)},e.prototype.onNodeMouseUp=function(t){var e=t.node;if(!this.isSelectionEnabled){var n=this.graph.hook.createKnob(e,{clearAll:!0});n&&this.widgets.set(e,n)}},e.prototype.onNodeSelected=function(t){var e=t.node;if(this.isSelectionEnabled){var n=this.graph.hook.createKnob(e,{clearAll:!1});n&&this.widgets.set(e,n)}},e.prototype.onNodeUnSelected=function(t){var e=t.node;if(this.isSelectionEnabled){var n=this.widgets.get(e);n&&n.forEach((function(t){return t.dispose()})),this.widgets.delete(e)}},e}(Vf),Mg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"widgetOptions",{get:function(){return this.options.panning},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pannable",{get:function(){return this.widgetOptions&&!0===this.widgetOptions.enabled},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.startListening(),this.updateClassName()},e.prototype.startListening=function(){var t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.graph.container).on("mousedown",this.onRightMouseDown)),t.includes("mouseWheel")&&(this.mousewheelHandle=new Fu(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))},e.prototype.stopListening=function(){var t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.graph.container).off("mousedown",this.onRightMouseDown),t.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())},e.prototype.preparePanning=function(t){var e=t.e;(this.allowPanning(e,!0)||this.allowPanning(e)&&!this.graph.selection.allowRubberband(e,!0))&&this.startPanning(e)},e.prototype.allowPanning=function(t,e){return this.pannable&&og.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)},e.prototype.startPanning=function(t){var e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),this.view.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.view.$(window).on("mouseup.panning",this.stopPanning.bind(this))},e.prototype.pan=function(t){var e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,r=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY;var i=this.graph.transform.getTranslation(),o=i.tx+n,s=i.ty+r;this.graph.transform.translate(o,s,{ui:!0})},e.prototype.stopPanning=function(t){this.panning=!1,this.updateClassName(),this.view.$(document.body).off(".panning"),this.view.$(window).off(".panning")},e.prototype.updateClassName=function(){var t=this.view.container,e=this.view.prefixClassName("graph-panning"),n=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(oa(t,e),sa(t,n)):(sa(t,e),oa(t,n)):(sa(t,e),sa(t,n))},e.prototype.onRightMouseDown=function(t){2===t.button&&this.allowPanning(t,!0)&&this.startPanning(t)},e.prototype.allowMouseWheel=function(t){return this.pannable&&!t.ctrlKey},e.prototype.onMouseWheel=function(t,e,n){t.ctrlKey||this.graph.translateBy(-e,-n)},e.prototype.autoPanning=function(t,e){var n=10,r=this.graph.getGraphArea(),i=0,o=0;t<=r.left+n&&(i=-10),e<=r.top+n&&(o=-10),t>=r.right-n&&(i=n),e>=r.bottom-n&&(o=n),0===i&&0===o||this.graph.translateBy(-i,-o)},e.prototype.enablePanning=function(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())},e.prototype.disablePanning=function(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())},e.prototype.dispose=function(){this.stopListening()},o([Vf.dispose()],e.prototype,"dispose",null),e}(Vf),Sg=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.hasScroller=function(){return null!=this.graph.scroller.widget},r.prototype.getContainer=function(){return this.hasScroller()?this.graph.scroller.widget.container:this.graph.container},r.prototype.init=function(){var e=this,n=this.options.autoResize;if(n){var r="boolean"==typeof n?this.getContainer():n;t.SizeSensor.bind(r,(function(){var t=e.getContainer(),n=t.offsetWidth,r=t.offsetHeight;e.resize(n,r)}))}},r.prototype.resize=function(t,e){this.hasScroller()?this.resizeScroller(t,e):this.resizeGraph(t,e)},r.prototype.resizeGraph=function(t,e){this.graph.transform.resize(t,e)},r.prototype.resizeScroller=function(t,e){this.graph.scroller.resize(t,e)},r.prototype.resizePage=function(t,e){var n=this.graph.scroller.widget;n&&n.updatePageSize(t,e)},r.prototype.dispose=function(){t.SizeSensor.clear(this.getContainer())},o([Vf.dispose()],r.prototype,"dispose",null),r}(Vf);!function(t){t.hook=function(t,e){return function(n,r,i){var o=i.value,a=e||r;i.value=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.options[a];if(null!=r){this.getNativeValue=o.bind.apply(o,s([this],e,!1));var i=Ws.apply(Qs,s([r,this.graph],e,!1));if(this.getNativeValue=null,null!=i||!0===t&&null===i)return i}return o.call.apply(o,s([this],e,!1))}}},t.after=function(t){return function(e,n,r){var i=r.value,o=t||n;r.value=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=i.call.apply(i,s([this],t,!1)),r=this.options[o];return null!=r&&(n=Ws.apply(Qs,s([r,this.graph],t,!1))&&n),n}}}}(Pg||(Pg={}));var kg,Tg=function(e){function s(){return null!==e&&e.apply(this,arguments)||this}return n(s,e),s.prototype.createModel=function(){if(this.options.model)return this.options.model;var e=new t.Model;return e.graph=this.graph,e},s.prototype.createView=function(){return new jf(this.graph)},s.prototype.createRenderer=function(){return new Yf(this.graph)},s.prototype.createDefsManager=function(){return new sg(this.graph)},s.prototype.createGridManager=function(){return new ag(this.graph)},s.prototype.createCoordManager=function(){return new lg(this.graph)},s.prototype.createKnobManager=function(){return new Eg(this.graph)},s.prototype.createTransform=function(t,e){var n=this.getTransformOptions(t);return n.resizable||n.rotatable?new ig(r(r({node:t,graph:this.graph},n),e)):(n.clearAll&&ig.removeInstances(this.graph),null)},s.prototype.createKnob=function(t,e){var n=this,i=rg.parseOptionGroup(this.graph,t,this.options.knob),o=r(r({},i),e);o.clearAll&&qf.removeInstances(this.graph),o.clearAll=!1;var s=t.prop("knob"),a=[];return(Array.isArray(s)?s:[s]).forEach((function(e,s){e&&!1!==e.enabled&&("function"==typeof e.enabled&&!1===e.enabled.call(n.graph,t)||i.enabled&&a.push(new qf(r({node:t,index:s,graph:n.graph},o))))})),a},s.prototype.getTransformOptions=function(t){var e=rg.parseOptionGroup(this.graph,t,this.options.resizing),n=rg.parseOptionGroup(this.graph,t,this.options.rotating),i=rg.parseOptionGroup(this.graph,t,this.options.transforming);return r(r({},i),{resizable:e.enabled,minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,maxHeight:e.maxHeight,orthogonalResizing:e.orthogonal,restrictedResizing:null!=e.restrict?e.restrict:e.restricted,autoScrollOnResizing:e.autoScroll,preserveAspectRatio:e.preserveAspectRatio,allowReverse:e.allowReverse,rotatable:n.enabled,rotateGrid:n.grid})},s.prototype.createTransformManager=function(){return new fg(this.graph)},s.prototype.createHighlightManager=function(){return new dg(this.graph)},s.prototype.createBackgroundManager=function(){return new Zf(this.graph)},s.prototype.createClipboard=function(){return new Ng},s.prototype.createClipboardManager=function(){return new pg(this.graph)},s.prototype.createSnapline=function(){return new Xf(r({graph:this.graph},this.options.snapline))},s.prototype.createSnaplineManager=function(){return new ug(this.graph)},s.prototype.createSelection=function(){return new eg(r({graph:this.graph},this.options.selecting))},s.prototype.createSelectionManager=function(){return new gg(this.graph)},s.prototype.allowRubberband=function(t){return!0},s.prototype.createHistoryManager=function(){return new vg(r({graph:this.graph},this.options.history))},s.prototype.createScroller=function(){return this.options.scroller.enabled?new Kf(r({graph:this.graph},this.options.scroller)):null},s.prototype.createScrollerManager=function(){return new hg(this.graph)},s.prototype.allowPanning=function(t){return!0},s.prototype.createMiniMap=function(){var t=this.options.minimap,e=t.enabled,n=i(t,["enabled"]);return e?new Wf(r({graph:this.graph},n)):null},s.prototype.createMiniMapManager=function(){return new yg(this.graph)},s.prototype.createKeyboard=function(){return new Cg(r({graph:this.graph},this.options.keyboard))},s.prototype.createMouseWheel=function(){return new xg(r({graph:this.graph},this.options.mousewheel))},s.prototype.createPrintManager=function(){return new wg(this.graph)},s.prototype.createFormatManager=function(){return new Ag(this.graph)},s.prototype.createPanningManager=function(){return new Mg(this.graph)},s.prototype.createSizeManager=function(){return new Sg(this.graph)},s.prototype.allowConnectToBlank=function(t){var e=this.options.connecting,n=null!=e.allowBlank?e.allowBlank:e.dangling;if("function"!=typeof n)return!!n;var r=this.graph.findViewByCell(t),i=t.getSourceCell(),o=t.getTargetCell(),s=this.graph.findViewByCell(i),a=this.graph.findViewByCell(o);return Ws(n,this.graph,{edge:t,edgeView:r,sourceCell:i,targetCell:o,sourceView:s,targetView:a,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:r.sourceMagnet,targetMagnet:r.targetMagnet})},s.prototype.validateEdge=function(t,e,n){if(!this.allowConnectToBlank(t)){var r=t.getSourceCellId(),i=t.getTargetCellId();if(!r||!i)return!1}var o=this.options.connecting.validateEdge;return!o||Ws(o,this.graph,{edge:t,type:e,previous:n})},s.prototype.validateMagnet=function(t,e,n){if("passive"!==e.getAttribute("magnet")){var r=this.options.connecting.validateMagnet;return!r||Ws(r,this.graph,{e:n,magnet:e,view:t,cell:t.cell})}return!1},s.prototype.getDefaultEdge=function(t,e){var n,r=this.options.connecting.createEdge;return r&&(n=Ws(r,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new Df),n},s.prototype.validateConnection=function(e,n,r,i,o,s,a){var l=this,u=this.options.connecting,c=u.allowLoop,h=u.allowNode,p=u.allowEdge,d=u.allowPort,f=null!=u.allowMulti?u.allowMulti:u.multi,g=u.validateConnection,v=s?s.cell:null,y="target"===o?r:e,m="target"===o?i:n,b=!0,C=function(t){var u="source"===o?a?a.port:null:v?v.getSourcePortId():null,c="target"===o?a?a.port:null:v?v.getTargetPortId():null;return Ws(t,l.graph,{edge:v,edgeView:s,sourceView:e,targetView:r,sourcePort:u,targetPort:c,sourceMagnet:n,targetMagnet:i,sourceCell:e?e.cell:null,targetCell:r?r.cell:null,type:o})};if(null!=c&&("boolean"==typeof c?c||e!==r||(b=!1):b=C(c)),b&&null!=d&&("boolean"==typeof d?!d&&m&&(b=!1):b=C(d)),b&&null!=p&&("boolean"==typeof p?!p&&t.EdgeView.isEdgeView(y)&&(b=!1):b=C(p)),b&&null!=h&&null==m&&("boolean"==typeof h?!h&&t.NodeView.isNodeView(y)&&(b=!1):b=C(h)),b&&null!=f&&s){var x=s.cell,w="source"===o?a:x.getSource(),P="target"===o?a:x.getTarget(),A=a?this.graph.getCellById(a.cell):null;if(w&&P&&w.cell&&P.cell&&A)if("function"==typeof f)b=C(f);else{var E=this.model.getConnectedEdges(A,{outgoing:"source"===o,incoming:"target"===o});if(E.length)if("withPort"===f)E.some((function(t){var e=t.getSource(),n=t.getTarget();return e&&n&&e.cell===w.cell&&n.cell===P.cell&&null!=e.port&&e.port===w.port&&null!=n.port&&n.port===P.port}))&&(b=!1);else if(!f){E.some((function(t){var e=t.getSource(),n=t.getTarget();return e&&n&&e.cell===w.cell&&n.cell===P.cell}))&&(b=!1)}}}return b&&null!=g&&(b=C(g)),b},s.prototype.getRestrictArea=function(t){var e=this.options.translating.restrict,n="function"==typeof e?Ws(e,this.graph,t):e;return"number"==typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null},s.prototype.onViewUpdated=function(t,e,n){e&Yf.FLAG_INSERT||n.mounting||this.graph.renderer.requestConnectedEdgesUpdate(t,n)},s.prototype.onViewPostponed=function(t,e,n){return this.graph.renderer.forcePostponedViewUpdate(t,e)},s.prototype.getCellView=function(t){return null},s.prototype.createCellView=function(e){var n={graph:this.graph},r=this.getCellView(e);if(r)return new r(e,n);var i=e.view;if(null!=i&&"string"==typeof i){var o=t.CellView.registry.get(i);return o?new o(e,n):t.CellView.registry.onNotFound(i)}return e.isNode()?new t.NodeView(e,n):e.isEdge()?new t.EdgeView(e,n):null},s.prototype.getHTMLComponent=function(t){var e=t.getHTML();return"string"==typeof e&&(e=Lf.componentRegistry.get(e)||e),_e(e)&&(e=e.render),"function"==typeof e?Ws(e,this.graph,t):e},s.prototype.shouldUpdateHTMLComponent=function(t){var e=t.getHTML();if("string"==typeof e&&(e=Lf.componentRegistry.get(e)||e),_e(e)){var n=e.shouldComponentUpdate;return"function"==typeof n?Ws(n,this.graph,t):!!n}return!1},s.prototype.onEdgeLabelRendered=function(t){},s.prototype.onPortRendered=function(t){},s.prototype.onToolItemCreated=function(t){},o([Pg.hook()],s.prototype,"createModel",null),o([Pg.hook()],s.prototype,"createView",null),o([Pg.hook()],s.prototype,"createRenderer",null),o([Pg.hook()],s.prototype,"createDefsManager",null),o([Pg.hook()],s.prototype,"createGridManager",null),o([Pg.hook()],s.prototype,"createCoordManager",null),o([Pg.hook()],s.prototype,"createKnobManager",null),o([Pg.hook()],s.prototype,"createTransform",null),o([Pg.hook()],s.prototype,"createKnob",null),o([Pg.hook()],s.prototype,"createTransformManager",null),o([Pg.hook()],s.prototype,"createHighlightManager",null),o([Pg.hook()],s.prototype,"createBackgroundManager",null),o([Pg.hook()],s.prototype,"createClipboard",null),o([Pg.hook()],s.prototype,"createClipboardManager",null),o([Pg.hook()],s.prototype,"createSnapline",null),o([Pg.hook()],s.prototype,"createSnaplineManager",null),o([Pg.hook()],s.prototype,"createSelection",null),o([Pg.hook()],s.prototype,"createSelectionManager",null),o([Pg.hook()],s.prototype,"allowRubberband",null),o([Pg.hook()],s.prototype,"createHistoryManager",null),o([Pg.hook()],s.prototype,"createScroller",null),o([Pg.hook()],s.prototype,"createScrollerManager",null),o([Pg.hook()],s.prototype,"allowPanning",null),o([Pg.hook()],s.prototype,"createMiniMap",null),o([Pg.hook()],s.prototype,"createMiniMapManager",null),o([Pg.hook()],s.prototype,"createKeyboard",null),o([Pg.hook()],s.prototype,"createMouseWheel",null),o([Pg.hook()],s.prototype,"createPrintManager",null),o([Pg.hook()],s.prototype,"createFormatManager",null),o([Pg.hook()],s.prototype,"createPanningManager",null),o([Pg.hook()],s.prototype,"createSizeManager",null),o([Pg.after()],s.prototype,"onViewUpdated",null),o([Pg.after()],s.prototype,"onViewPostponed",null),o([Pg.hook()],s.prototype,"getCellView",null),o([Pg.hook(!0)],s.prototype,"createCellView",null),o([Pg.hook()],s.prototype,"getHTMLComponent",null),o([Pg.hook()],s.prototype,"shouldUpdateHTMLComponent",null),o([Pg.hook()],s.prototype,"onEdgeLabelRendered",null),o([Pg.hook()],s.prototype,"onPortRendered",null),o([Pg.hook()],s.prototype,"onToolItemCreated",null),s}(Vf);t.Graph=function(e){function i(t){var n=e.call(this)||this;return n.options=rg.get(t),n.css=new Rf(n),n.hook=new Tg(n),n.view=n.hook.createView(),n.defs=n.hook.createDefsManager(),n.coord=n.hook.createCoordManager(),n.transform=n.hook.createTransformManager(),n.knob=n.hook.createKnobManager(),n.highlight=n.hook.createHighlightManager(),n.grid=n.hook.createGridManager(),n.background=n.hook.createBackgroundManager(),n.model=n.hook.createModel(),n.renderer=n.hook.createRenderer(),n.clipboard=n.hook.createClipboardManager(),n.snapline=n.hook.createSnaplineManager(),n.selection=n.hook.createSelectionManager(),n.history=n.hook.createHistoryManager(),n.scroller=n.hook.createScrollerManager(),n.minimap=n.hook.createMiniMapManager(),n.keyboard=n.hook.createKeyboard(),n.mousewheel=n.hook.createMouseWheel(),n.print=n.hook.createPrintManager(),n.format=n.hook.createFormatManager(),n.panning=n.hook.createPanningManager(),n.size=n.hook.createSizeManager(),n}return n(i,e),Object.defineProperty(i.prototype,"container",{get:function(){return this.view.container},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return i.toStringTag},enumerable:!1,configurable:!0}),i.prototype.isNode=function(t){return t.isNode()},i.prototype.isEdge=function(t){return t.isEdge()},i.prototype.resetCells=function(t,e){return void 0===e&&(e={}),this.model.resetCells(t,e),this},i.prototype.clearCells=function(t){return void 0===t&&(t={}),this.model.clear(t),this},i.prototype.toJSON=function(t){return void 0===t&&(t={}),this.model.toJSON(t)},i.prototype.parseJSON=function(t){return this.model.parseJSON(t)},i.prototype.fromJSON=function(t,e){return void 0===e&&(e={}),this.model.fromJSON(t,e),this},i.prototype.getCellById=function(t){return this.model.getCell(t)},i.prototype.addNode=function(t,e){return void 0===e&&(e={}),this.model.addNode(t,e)},i.prototype.addNodes=function(e,n){var r=this;return void 0===n&&(n={}),this.addCell(e.map((function(e){return t.Node.isNode(e)?e:r.createNode(e)})),n)},i.prototype.createNode=function(t){return this.model.createNode(t)},i.prototype.removeNode=function(t,e){return void 0===e&&(e={}),this.model.removeCell(t,e)},i.prototype.addEdge=function(t,e){return void 0===e&&(e={}),this.model.addEdge(t,e)},i.prototype.addEdges=function(e,n){var r=this;return void 0===n&&(n={}),this.addCell(e.map((function(e){return t.Edge.isEdge(e)?e:r.createEdge(e)})),n)},i.prototype.removeEdge=function(t,e){return void 0===e&&(e={}),this.model.removeCell(t,e)},i.prototype.createEdge=function(t){return this.model.createEdge(t)},i.prototype.addCell=function(t,e){return void 0===e&&(e={}),this.model.addCell(t,e),this},i.prototype.removeCell=function(t,e){return void 0===e&&(e={}),this.model.removeCell(t,e)},i.prototype.removeCells=function(t,e){return void 0===e&&(e={}),this.model.removeCells(t,e)},i.prototype.removeConnectedEdges=function(t,e){return void 0===e&&(e={}),this.model.removeConnectedEdges(t,e)},i.prototype.disconnectConnectedEdges=function(t,e){return void 0===e&&(e={}),this.model.disconnectConnectedEdges(t,e),this},i.prototype.hasCell=function(t){return this.model.has(t)},i.prototype.getCell=function(t){return this.model.getCell(t)},i.prototype.getCells=function(){return this.model.getCells()},i.prototype.getCellCount=function(){return this.model.total()},i.prototype.getNodes=function(){return this.model.getNodes()},i.prototype.getEdges=function(){return this.model.getEdges()},i.prototype.getOutgoingEdges=function(t){return this.model.getOutgoingEdges(t)},i.prototype.getIncomingEdges=function(t){return this.model.getIncomingEdges(t)},i.prototype.getConnectedEdges=function(t,e){return void 0===e&&(e={}),this.model.getConnectedEdges(t,e)},i.prototype.getRootNodes=function(){return this.model.getRoots()},i.prototype.getLeafNodes=function(){return this.model.getLeafs()},i.prototype.isRootNode=function(t){return this.model.isRoot(t)},i.prototype.isLeafNode=function(t){return this.model.isLeaf(t)},i.prototype.getNeighbors=function(t,e){return void 0===e&&(e={}),this.model.getNeighbors(t,e)},i.prototype.isNeighbor=function(t,e,n){return void 0===n&&(n={}),this.model.isNeighbor(t,e,n)},i.prototype.getSuccessors=function(t,e){return void 0===e&&(e={}),this.model.getSuccessors(t,e)},i.prototype.isSuccessor=function(t,e,n){return void 0===n&&(n={}),this.model.isSuccessor(t,e,n)},i.prototype.getPredecessors=function(t,e){return void 0===e&&(e={}),this.model.getPredecessors(t,e)},i.prototype.isPredecessor=function(t,e,n){return void 0===n&&(n={}),this.model.isPredecessor(t,e,n)},i.prototype.getCommonAncestor=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.model).getCommonAncestor.apply(t,e)},i.prototype.getSubGraph=function(t,e){return void 0===e&&(e={}),this.model.getSubGraph(t,e)},i.prototype.cloneSubGraph=function(t,e){return void 0===e&&(e={}),this.model.cloneSubGraph(t,e)},i.prototype.cloneCells=function(t){return this.model.cloneCells(t)},i.prototype.getNodesFromPoint=function(t,e){return this.model.getNodesFromPoint(t,e)},i.prototype.getNodesInArea=function(t,e,n,r,i){return this.model.getNodesInArea(t,e,n,r,i)},i.prototype.getNodesUnderNode=function(t,e){return void 0===e&&(e={}),this.model.getNodesUnderNode(t,e)},i.prototype.searchCell=function(t,e,n){return void 0===n&&(n={}),this.model.search(t,e,n),this},i.prototype.getShortestPath=function(t,e,n){return void 0===n&&(n={}),this.model.getShortestPath(t,e,n)},i.prototype.getAllCellsBBox=function(){return this.model.getAllCellsBBox()},i.prototype.getCellsBBox=function(t,e){return void 0===e&&(e={}),this.model.getCellsBBox(t,e)},i.prototype.startBatch=function(t,e){void 0===e&&(e={}),this.model.startBatch(t,e)},i.prototype.stopBatch=function(t,e){void 0===e&&(e={}),this.model.stopBatch(t,e)},i.prototype.batchUpdate=function(t,e,n){var r="string"==typeof t?t:"update",i="string"==typeof t?e:t,o="function"==typeof e?n:e;this.startBatch(r,o);var s=i();return this.stopBatch(r,o),s},i.prototype.updateCellId=function(t,e){return this.model.updateCellId(t,e)},i.prototype.isFrozen=function(){return this.renderer.isFrozen()},i.prototype.freeze=function(t){return void 0===t&&(t={}),this.renderer.freeze(t),this},i.prototype.unfreeze=function(t){return void 0===t&&(t={}),this.renderer.unfreeze(t),this},i.prototype.isAsync=function(){return this.renderer.isAsync()},i.prototype.setAsync=function(t){return this.renderer.setAsync(t),this},i.prototype.findView=function(e){return t.Cell.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)},i.prototype.findViews=function(e){return t.Rectangle.isRectangleLike(e)?this.findViewsInArea(e):t.Point.isPointLike(e)?this.findViewsFromPoint(e):[]},i.prototype.findViewByCell=function(t){return this.renderer.findViewByCell(t)},i.prototype.findViewByElem=function(t){return this.renderer.findViewByElem(t)},i.prototype.findViewsFromPoint=function(t,e){var n="number"==typeof t?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)},i.prototype.findViewsInArea=function(t,e,n,r,i){var o="number"==typeof t?{x:t,y:e,width:n,height:r}:t,s="number"==typeof t?i:e;return this.renderer.findViewsInArea(o,s)},i.prototype.isViewMounted=function(t){return this.renderer.isViewMounted(t)},i.prototype.getMountedViews=function(){return this.renderer.getMountedViews()},i.prototype.getUnmountedViews=function(){return this.renderer.getUnmountedViews()},i.prototype.matrix=function(t){return void 0===t?this.transform.getMatrix():(this.transform.setMatrix(t),this)},i.prototype.resize=function(t,e){return this.size.resize(t,e),this},i.prototype.resizeGraph=function(t,e){return this.size.resizeGraph(t,e),this},i.prototype.resizeScroller=function(t,e){return this.size.resizeScroller(t,e),this},i.prototype.resizePage=function(t,e){return this.size.resizePage(t,e),this},i.prototype.scale=function(t,e,n,r){return void 0===e&&(e=t),void 0===n&&(n=0),void 0===r&&(r=0),void 0===t?this.transform.getScale():(this.transform.scale(t,e,n,r),this)},i.prototype.zoom=function(t,e){var n=this.scroller.widget;if(n){if(void 0===t)return n.zoom();n.zoom(t,e)}else{if(void 0===t)return this.transform.getZoom();this.transform.zoom(t,e)}return this},i.prototype.zoomTo=function(t,e){void 0===e&&(e={});var n=this.scroller.widget;return n?n.zoom(t,r(r({},e),{absolute:!0})):this.transform.zoom(t,r(r({},e),{absolute:!0})),this},i.prototype.zoomToRect=function(t,e){void 0===e&&(e={});var n=this.scroller.widget;return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this},i.prototype.zoomToFit=function(t){void 0===t&&(t={});var e=this.scroller.widget;return e?e.zoomToFit(t):this.transform.zoomToFit(t),this},i.prototype.rotate=function(t,e,n){return void 0===t?this.transform.getRotation():(this.transform.rotate(t,e,n),this)},i.prototype.translate=function(t,e){return void 0===t?this.transform.getTranslation():(this.transform.translate(t,e),this)},i.prototype.translateBy=function(t,e){var n=this.translate(),r=n.tx+t,i=n.ty+e;return this.translate(r,i)},i.prototype.getArea=function(){return this.transform.getGraphArea()},i.prototype.getGraphArea=function(){return this.transform.getGraphArea()},i.prototype.getContentArea=function(t){return void 0===t&&(t={}),this.transform.getContentArea(t)},i.prototype.getContentBBox=function(t){return void 0===t&&(t={}),this.transform.getContentBBox(t)},i.prototype.fitToContent=function(t,e,n,r){return this.transform.fitToContent(t,e,n,r)},i.prototype.scaleContentToFit=function(t){return void 0===t&&(t={}),this.transform.scaleContentToFit(t),this},i.prototype.center=function(t){return this.centerPoint(t)},i.prototype.centerPoint=function(t,e,n){var r=this.scroller.widget;return r?r.centerPoint(t,e,n):this.transform.centerPoint(t,e),this},i.prototype.centerContent=function(t){var e=this.scroller.widget;return e?e.centerContent(t):this.transform.centerContent(t),this},i.prototype.centerCell=function(t,e){var n=this.scroller.widget;return n?n.centerCell(t,e):this.transform.centerCell(t),this},i.prototype.positionPoint=function(t,e,n,r){void 0===r&&(r={});var i=this.scroller.widget;return i?i.positionPoint(t,e,n,r):this.transform.positionPoint(t,e,n),this},i.prototype.positionRect=function(t,e,n){var r=this.scroller.widget;return r?r.positionRect(t,e,n):this.transform.positionRect(t,e),this},i.prototype.positionCell=function(t,e,n){var r=this.scroller.widget;return r?r.positionCell(t,e,n):this.transform.positionCell(t,e),this},i.prototype.positionContent=function(t,e){var n=this.scroller.widget;return n?n.positionContent(t,e):this.transform.positionContent(t,e),this},i.prototype.getClientMatrix=function(){return this.coord.getClientMatrix()},i.prototype.getClientOffset=function(){return this.coord.getClientOffset()},i.prototype.getPageOffset=function(){return this.coord.getPageOffset()},i.prototype.snapToGrid=function(t,e){return this.coord.snapToGrid(t,e)},i.prototype.pageToLocal=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.pageToLocalRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.pageToLocalRect(e,n,r,i):this.coord.pageToLocalPoint(e,n)},i.prototype.localToPage=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.localToPageRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.localToPageRect(e,n,r,i):this.coord.localToPagePoint(e,n)},i.prototype.clientToLocal=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.clientToLocalRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.clientToLocalRect(e,n,r,i):this.coord.clientToLocalPoint(e,n)},i.prototype.localToClient=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.localToClientRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.localToClientRect(e,n,r,i):this.coord.localToClientPoint(e,n)},i.prototype.localToGraph=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.localToGraphRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.localToGraphRect(e,n,r,i):this.coord.localToGraphPoint(e,n)},i.prototype.graphToLocal=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.graphToLocalRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.graphToLocalRect(e,n,r,i):this.coord.graphToLocalPoint(e,n)},i.prototype.clientToGraph=function(e,n,r,i){return t.Rectangle.isRectangleLike(e)?this.coord.clientToGraphRect(e):"number"==typeof e&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i?this.coord.clientToGraphRect(e,n,r,i):this.coord.clientToGraphPoint(e,n)},i.prototype.defineFilter=function(t){return this.defs.filter(t)},i.prototype.defineGradient=function(t){return this.defs.gradient(t)},i.prototype.defineMarker=function(t){return this.defs.marker(t)},i.prototype.getGridSize=function(){return this.grid.getGridSize()},i.prototype.setGridSize=function(t){return this.grid.setGridSize(t),this},i.prototype.showGrid=function(){return this.grid.show(),this},i.prototype.hideGrid=function(){return this.grid.hide(),this},i.prototype.clearGrid=function(){return this.grid.clear(),this},i.prototype.drawGrid=function(t){return this.grid.draw(t),this},i.prototype.updateBackground=function(){return this.background.update(),this},i.prototype.drawBackground=function(t,e){var n=this.scroller.widget;return null==n||null!=this.options.background&&e?this.background.draw(t):n.backgroundManager.draw(t),this},i.prototype.clearBackground=function(t){var e=this.scroller.widget;return null==e||null!=this.options.background&&t?this.background.clear():e.backgroundManager.clear(),this},i.prototype.isClipboardEnabled=function(){return!this.clipboard.disabled},i.prototype.enableClipboard=function(){return this.clipboard.enable(),this},i.prototype.disableClipboard=function(){return this.clipboard.disable(),this},i.prototype.toggleClipboard=function(t){return null!=t?t!==this.isClipboardEnabled()&&(t?this.enableClipboard():this.disableClipboard()):this.isClipboardEnabled()?this.disableClipboard():this.enableClipboard(),this},i.prototype.isClipboardEmpty=function(){return this.clipboard.isEmpty()},i.prototype.getCellsInClipboard=function(){return this.clipboard.cells},i.prototype.cleanClipboard=function(){return this.clipboard.clean(),this},i.prototype.copy=function(t,e){return void 0===e&&(e={}),this.clipboard.copy(t,e),this},i.prototype.cut=function(t,e){return void 0===e&&(e={}),this.clipboard.cut(t,e),this},i.prototype.paste=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=this),this.clipboard.paste(t,e)},i.prototype.isHistoryEnabled=function(){return!this.history.disabled},i.prototype.enableHistory=function(){return this.history.enable(),this},i.prototype.disableHistory=function(){return this.history.disable(),this},i.prototype.toggleHistory=function(t){return null!=t?t!==this.isHistoryEnabled()&&(t?this.enableHistory():this.disableHistory()):this.isHistoryEnabled()?this.disableHistory():this.enableHistory(),this},i.prototype.undo=function(t){return void 0===t&&(t={}),this.history.undo(t),this},i.prototype.undoAndCancel=function(t){return void 0===t&&(t={}),this.history.cancel(t),this},i.prototype.redo=function(t){return void 0===t&&(t={}),this.history.redo(t),this},i.prototype.canUndo=function(){return this.history.canUndo()},i.prototype.canRedo=function(){return this.history.canRedo()},i.prototype.cleanHistory=function(t){void 0===t&&(t={}),this.history.clean(t)},i.prototype.isKeyboardEnabled=function(){return!this.keyboard.disabled},i.prototype.enableKeyboard=function(){return this.keyboard.enable(),this},i.prototype.disableKeyboard=function(){return this.keyboard.disable(),this},i.prototype.toggleKeyboard=function(t){return null!=t?t!==this.isKeyboardEnabled()&&(t?this.enableKeyboard():this.disableKeyboard()):this.isKeyboardEnabled()?this.disableKeyboard():this.enableKeyboard(),this},i.prototype.bindKey=function(t,e,n){return this.keyboard.on(t,e,n),this},i.prototype.unbindKey=function(t,e){return this.keyboard.off(t,e),this},i.prototype.isMouseWheelEnabled=function(){return!this.mousewheel.disabled},i.prototype.enableMouseWheel=function(){return this.mousewheel.enable(),this},i.prototype.disableMouseWheel=function(){return this.mousewheel.disable(),this},i.prototype.toggleMouseWheel=function(t){return null==t?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this},i.prototype.isPannable=function(){return this.scroller.widget?this.scroller.pannable:this.panning.pannable},i.prototype.enablePanning=function(){return this.scroller.widget?this.scroller.enablePanning():this.panning.enablePanning(),this},i.prototype.disablePanning=function(){return this.scroller.widget?this.scroller.disablePanning():this.panning.disablePanning(),this},i.prototype.togglePanning=function(t){return null==t?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this},i.prototype.lockScroller=function(){var t;null===(t=this.scroller.widget)||void 0===t||t.lock()},i.prototype.unlockScroller=function(){var t;null===(t=this.scroller.widget)||void 0===t||t.unlock()},i.prototype.updateScroller=function(){var t;null===(t=this.scroller.widget)||void 0===t||t.update()},i.prototype.getScrollbarPosition=function(){return this.scroller.widget.scrollbarPosition()},i.prototype.setScrollbarPosition=function(t,e,n){return this.scroller.widget.scrollbarPosition(t,e,n),this},i.prototype.scrollToPoint=function(t,e,n){return this.scroller.widget.scrollToPoint(t,e,n),this},i.prototype.scrollToContent=function(t){return this.scroller.widget.scrollToContent(t),this},i.prototype.scrollToCell=function(t,e){return this.scroller.widget.scrollToCell(t,e),this},i.prototype.transitionToPoint=function(t,e,n){return this.scroller.widget.transitionToPoint(t,e,n),this},i.prototype.transitionToRect=function(t,e){return void 0===e&&(e={}),this.scroller.widget.transitionToRect(t,e),this},i.prototype.isSelectionEnabled=function(){return!this.selection.disabled},i.prototype.enableSelection=function(){return this.selection.enable(),this},i.prototype.disableSelection=function(){return this.selection.disable(),this},i.prototype.toggleSelection=function(t){return null!=t?t!==this.isSelectionEnabled()&&(t?this.enableSelection():this.disableSelection()):this.isSelectionEnabled()?this.disableSelection():this.enableSelection(),this},i.prototype.isMultipleSelection=function(){return this.selection.isMultiple()},i.prototype.enableMultipleSelection=function(){return this.selection.enableMultiple(),this},i.prototype.disableMultipleSelection=function(){return this.selection.disableMultiple(),this},i.prototype.toggleMultipleSelection=function(t){return null!=t?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this},i.prototype.isSelectionMovable=function(){return!1!==this.selection.widget.options.movable},i.prototype.enableSelectionMovable=function(){return this.selection.widget.options.movable=!0,this},i.prototype.disableSelectionMovable=function(){return this.selection.widget.options.movable=!1,this},i.prototype.toggleSelectionMovable=function(t){return null!=t?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this},i.prototype.isRubberbandEnabled=function(){return!this.selection.rubberbandDisabled},i.prototype.enableRubberband=function(){return this.selection.enableRubberband(),this},i.prototype.disableRubberband=function(){return this.selection.disableRubberband(),this},i.prototype.toggleRubberband=function(t){return null!=t?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this},i.prototype.isStrictRubberband=function(){return!0===this.selection.widget.options.strict},i.prototype.enableStrictRubberband=function(){return this.selection.widget.options.strict=!0,this},i.prototype.disableStrictRubberband=function(){return this.selection.widget.options.strict=!1,this},i.prototype.toggleStrictRubberband=function(t){return null!=t?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this},i.prototype.setRubberbandModifiers=function(t){this.selection.setModifiers(t)},i.prototype.setSelectionFilter=function(t){return this.selection.setFilter(t),this},i.prototype.setSelectionDisplayContent=function(t){return this.selection.setContent(t),this},i.prototype.isSelectionEmpty=function(){return this.selection.isEmpty()},i.prototype.cleanSelection=function(t){return this.selection.clean(t),this},i.prototype.resetSelection=function(t,e){return this.selection.reset(t,e),this},i.prototype.getSelectedCells=function(){return this.selection.cells},i.prototype.getSelectedCellCount=function(){return this.selection.length},i.prototype.isSelected=function(t){return this.selection.isSelected(t)},i.prototype.select=function(t,e){return this.selection.select(t,e),this},i.prototype.unselect=function(t,e){return this.selection.unselect(t,e),this},i.prototype.isSnaplineEnabled=function(){return!this.snapline.widget.disabled},i.prototype.enableSnapline=function(){return this.snapline.widget.enable(),this},i.prototype.disableSnapline=function(){return this.snapline.widget.disable(),this},i.prototype.toggleSnapline=function(t){if(null==t)return this.isSnaplineEnabled()?this.disableSnapline():this.enableSnapline(),this;t!==this.isSnaplineEnabled()&&(t?this.enableSnapline():this.disableSnapline())},i.prototype.hideSnapline=function(){return this.snapline.widget.hide(),this},i.prototype.setSnaplineFilter=function(t){return this.snapline.widget.setFilter(t),this},i.prototype.isSnaplineOnResizingEnabled=function(){return!0===this.snapline.widget.options.resizing},i.prototype.enableSnaplineOnResizing=function(){return this.snapline.widget.options.resizing=!0,this},i.prototype.disableSnaplineOnResizing=function(){return this.snapline.widget.options.resizing=!1,this},i.prototype.toggleSnaplineOnResizing=function(t){return null!=t?t!==this.isSnaplineOnResizingEnabled()&&(t?this.enableSnaplineOnResizing():this.disableSnaplineOnResizing()):this.isSnaplineOnResizingEnabled()?this.disableSnaplineOnResizing():this.enableSnaplineOnResizing(),this},i.prototype.isSharpSnapline=function(){return!0===this.snapline.widget.options.sharp},i.prototype.enableSharpSnapline=function(){return this.snapline.widget.options.sharp=!0,this},i.prototype.disableSharpSnapline=function(){return this.snapline.widget.options.sharp=!1,this},i.prototype.toggleSharpSnapline=function(t){return null!=t?t!==this.isSharpSnapline()&&(t?this.enableSharpSnapline():this.disableSharpSnapline()):this.isSharpSnapline()?this.disableSharpSnapline():this.enableSharpSnapline(),this},i.prototype.getSnaplineTolerance=function(){return this.snapline.widget.options.tolerance},i.prototype.setSnaplineTolerance=function(t){return this.snapline.widget.options.tolerance=t,this},i.prototype.removeTools=function(){return this.emit("tools:remove"),this},i.prototype.hideTools=function(){return this.emit("tools:hide"),this},i.prototype.showTools=function(){return this.emit("tools:show"),this},i.prototype.toSVG=function(t,e){void 0===e&&(e={}),this.format.toSVG(t,e)},i.prototype.toDataURL=function(t,e){this.format.toDataURL(t,e)},i.prototype.toPNG=function(t,e){void 0===e&&(e={}),this.format.toPNG(t,e)},i.prototype.toJPEG=function(t,e){void 0===e&&(e={}),this.format.toJPEG(t,e)},i.prototype.printPreview=function(t){this.print.show(t)},i.prototype.dispose=function(){this.clearCells(),this.off(),this.css.dispose(),this.hook.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.knob.dispose(),this.highlight.dispose(),this.background.dispose(),this.clipboard.dispose(),this.snapline.dispose(),this.selection.dispose(),this.history.dispose(),this.keyboard.dispose(),this.mousewheel.dispose(),this.print.dispose(),this.format.dispose(),this.minimap.dispose(),this.panning.dispose(),this.scroller.dispose(),this.view.dispose(),this.renderer.dispose(),this.size.dispose()},o([Bf.checkScroller()],i.prototype,"lockScroller",null),o([Bf.checkScroller()],i.prototype,"unlockScroller",null),o([Bf.checkScroller()],i.prototype,"updateScroller",null),o([Bf.checkScroller()],i.prototype,"getScrollbarPosition",null),o([Bf.checkScroller()],i.prototype,"setScrollbarPosition",null),o([Bf.checkScroller()],i.prototype,"scrollToPoint",null),o([Bf.checkScroller()],i.prototype,"scrollToContent",null),o([Bf.checkScroller()],i.prototype,"scrollToCell",null),o([Bf.checkScroller()],i.prototype,"transitionToPoint",null),o([Bf.checkScroller()],i.prototype,"transitionToRect",null),o([t.Basecoat.dispose()],i.prototype,"dispose",null),i}(t.Basecoat),(kg=t.Graph||(t.Graph={})).View=jf,kg.Hook=Tg,kg.Renderer=Yf,kg.Keyboard=Cg,kg.MouseWheel=xg,kg.BaseManager=Vf,kg.DefsManager=sg,kg.GridManager=ag,kg.CoordManager=lg,kg.PrintManager=wg,kg.FormatManager=Ag,kg.MiniMapManager=yg,kg.HistoryManager=vg,kg.SnaplineManager=ug,kg.ScrollerManager=hg,kg.ClipboardManager=pg,kg.TransformManager=fg,kg.HighlightManager=dg,kg.BackgroundManager=Zf,kg.SelectionManager=gg,function(t){t.toStringTag="X6."+t.name,t.isGraph=function(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&null!=r.hook&&null!=r.view&&null!=r.model}}(t.Graph||(t.Graph={})),function(t){t.render=function(e,n){var r=e instanceof HTMLElement?new t({container:e}):new t(e);return null!=n&&r.fromJSON(n),r}}(t.Graph||(t.Graph={})),function(e){e.registerNode=t.Node.registry.register,e.registerEdge=t.Edge.registry.register,e.registerView=t.CellView.registry.register,e.registerAttr=ch.registry.register,e.registerGrid=yh.registry.register,e.registerFilter=Ch.registry.register,e.registerNodeTool=Dp.registry.register,e.registerEdgeTool=Np.registry.register,e.registerBackground=wh.registry.register,e.registerHighlighter=Bh.registry.register,e.registerPortLayout=Gh.registry.register,e.registerPortLabelLayout=Jh.registry.register,e.registerMarker=Wc.registry.register,e.registerRouter=zd.registry.register,e.registerConnector=Ud.registry.register,e.registerAnchor=Wp.registry.register,e.registerEdgeAnchor=Zp.registry.register,e.registerConnectionPoint=od.registry.register,e.registerConnectionStrategy=cp.registry.register,e.registerHTMLComponent=Lf.componentRegistry.register}(t.Graph||(t.Graph={})),function(e){e.unregisterNode=t.Node.registry.unregister,e.unregisterEdge=t.Edge.registry.unregister,e.unregisterView=t.CellView.registry.unregister,e.unregisterAttr=ch.registry.unregister,e.unregisterGrid=yh.registry.unregister,e.unregisterFilter=Ch.registry.unregister,e.unregisterNodeTool=Dp.registry.unregister,e.unregisterEdgeTool=Np.registry.unregister,e.unregisterBackground=wh.registry.unregister,e.unregisterHighlighter=Bh.registry.unregister,e.unregisterPortLayout=Gh.registry.unregister,e.unregisterPortLabelLayout=Jh.registry.unregister,e.unregisterMarker=Wc.registry.unregister,e.unregisterRouter=zd.registry.unregister,e.unregisterConnector=Ud.registry.unregister,e.unregisterAnchor=Wp.registry.unregister,e.unregisterEdgeAnchor=Zp.registry.unregister,e.unregisterConnectionPoint=od.registry.unregister,e.unregisterConnectionStrategy=cp.registry.unregister,e.unregisterHTMLComponent=Lf.componentRegistry.unregister}(t.Graph||(t.Graph={}));var Dg,Ng=function(){function e(){this.cells=[]}return e.prototype.copy=function(e,n,i){void 0===i&&(i={}),this.options=r({},i);var o=(t.Model.isModel(n)?n:n.model).cloneSubGraph(e,i);this.cells=No(Object.keys(o).map((function(t){return o[t]})),(function(t){return t.isEdge()?2:1})),this.serialize(i)},e.prototype.cut=function(e,n,r){void 0===r&&(r={}),this.copy(e,n,r),(t.Graph.isGraph(n)?n.model:n).batchUpdate("cut",(function(){e.forEach((function(t){return t.remove()}))}))},e.prototype.paste=function(e,n){var i=this;void 0===n&&(n={});var o=r(r({},this.options),n),s=o.offset,a=o.edgeProps,l=o.nodeProps,u=20,c=20;s&&(u="number"==typeof s?s:s.dx,c="number"==typeof s?s:s.dy),this.deserialize(o);var h=this.cells;h.forEach((function(t){t.model=null,t.removeProp("zIndex"),(u||c)&&t.translate(u,c),l&&t.isNode()&&t.prop(l),a&&t.isEdge()&&t.prop(a)}));var p=t.Graph.isGraph(e)?e.model:e;return p.batchUpdate("paste",(function(){p.addCells(i.cells)})),this.copy(h,e,n),h},e.prototype.serialize=function(t){!1!==t.useLocalStorage&&Dg.save(this.cells)},e.prototype.deserialize=function(t){if(t.useLocalStorage){var e=Dg.fetch();e&&(this.cells=e)}},e.prototype.isEmpty=function(){return this.cells.length<=0},e.prototype.clean=function(){this.options={},this.cells=[],Dg.clean()},e}();!function(e){var n=Sh.prefixCls+".clipboard.cells";e.save=function(t){if(window.localStorage){var e=t.map((function(t){return t.toJSON()}));localStorage.setItem(n,JSON.stringify(e))}},e.fetch=function(){if(window.localStorage){var e=localStorage.getItem(n),r=e?JSON.parse(e):[];if(r)return t.Model.fromJSON(r)}},e.clean=function(){window.localStorage&&localStorage.removeItem(n)}}(Dg||(Dg={}));var Og,Lg=function(){function e(t){this.halo=t}return Object.defineProperty(e.prototype,"options",{get:function(){return this.halo.options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"graph",{get:function(){return this.halo.graph},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this.halo.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.halo.view},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cell",{get:function(){return this.halo.cell},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"node",{get:function(){return this.cell},enumerable:!1,configurable:!0}),e.prototype.getPresets=function(){return{className:"type-node",handles:[{name:"remove",position:"nw",events:{mousedown:this.removeCell.bind(this)},icon:null},{name:"resize",position:"se",events:{mousedown:this.startResize.bind(this),mousemove:this.doResize.bind(this),mouseup:this.stopResize.bind(this)},icon:null},{name:"clone",position:"n",events:{mousedown:this.startClone.bind(this),mousemove:this.doClone.bind(this),mouseup:this.stopClone.bind(this)},icon:null},{name:"link",position:"e",events:{mousedown:this.startLink.bind(this),mousemove:this.doLink.bind(this),mouseup:this.stopLink.bind(this)},icon:null},{name:"fork",position:"ne",events:{mousedown:this.startFork.bind(this),mousemove:this.doFork.bind(this),mouseup:this.stopFork.bind(this)},icon:null},{name:"unlink",position:"w",events:{mousedown:this.unlink.bind(this)},icon:null},{name:"rotate",position:"sw",events:{mousedown:this.startRotate.bind(this),mousemove:this.doRotate.bind(this),mouseup:this.stopRotate.bind(this)},icon:null}],bbox:function(t){return this.options.useCellGeometry?t.cell.getBBox():t.getBBox()},content:function(t){var e=Qo("x: <%= x %>, y: <%= y %>, width: <%= width %>, height: <%= height %>, angle: <%= angle %>"),n=t.cell,r=n.getBBox();return e({x:Math.floor(r.x),y:Math.floor(r.y),width:Math.floor(r.width),height:Math.floor(r.height),angle:Math.floor(n.getAngle())})},magnet:function(t){return t.container},tinyThreshold:40,smallThreshold:80,loopEdgePreferredSide:"top",loopEdgeWidth:40,rotateGrid:15,rotateEmbeds:!1}},e.prototype.removeCell=function(){this.model.removeConnectedEdges(this.cell),this.cell.remove()},e.prototype.startLink=function(t){var e=t.x,n=t.y;this.halo.startBatch();var r=this.graph,i=this.createEdgeConnectedToSource();i.setTarget({x:e,y:n}),this.model.addEdge(i,{validation:!1,halo:this.halo.cid,async:!1}),r.view.undelegateEvents(),this.edgeView=r.renderer.findViewByCell(i),this.edgeView.prepareArrowheadDragging("target",{x:e,y:n,fallbackAction:"remove"})},e.prototype.createEdgeConnectedToSource=function(){var t=this.getMagnet(this.view,"source"),e=this.getEdgeTerminal(this.view,t),n=this.graph.hook.getDefaultEdge(this.view,t);return n.setSource(e),n},e.prototype.getMagnet=function(t,e){var n=this.options.magnet;if("function"==typeof n){var r=Ws(n,this.halo,t,e);if(r instanceof SVGElement)return r}throw new Error("`magnet()` has to return an SVGElement")},e.prototype.getEdgeTerminal=function(t,e){var n={cell:t.cell.id};if(e!==t.container){var r=e.getAttribute("port");r?n.port=r:n.selector=t.getSelector(e)}return n},e.prototype.doLink=function(t){var e=t.e,n=t.x,r=t.y;this.edgeView&&this.edgeView.onMouseMove(e,n,r)},e.prototype.stopLink=function(t){var e=t.e,n=t.x,r=t.y,i=this.edgeView;if(i){i.onMouseUp(e,n,r);var o=i.cell;o.hasLoop()&&this.makeLoopEdge(o),this.halo.stopBatch(),this.halo.trigger("action:edge:addde",{edge:o}),this.edgeView=null}this.graph.view.delegateEvents()},e.prototype.makeLoopEdge=function(e){var n=null,r=null,i=this.options.loopEdgeWidth,o=this.graph.options,s=new t.Rectangle(0,0,o.width,o.height),a=this.graph.graphToLocal(this.view.getBBox());[this.options.loopEdgePreferredSide,"top","bottom","left","right"].some((function(e){var o=null,l=0,u=0;switch(e){case"top":o=new t.Point(a.x+a.width/2,a.y-i),l=i/2;break;case"bottom":o=new t.Point(a.x+a.width/2,a.y+a.height+i),l=i/2;break;case"left":o=new t.Point(a.x-i,a.y+a.height/2),u=i/2;break;case"right":o=new t.Point(a.x+a.width+i,a.y+a.height/2),u=i/2}return!!o&&(n=o.translate(-l,-u),r=o.translate(l,u),s.containsPoint(n)&&s.containsPoint(r))}))&&n&&r&&e.setVertices([n,r])},e.prototype.startResize=function(e){var n=e.e;this.halo.startBatch(),this.flip=[1,0,0,1,1,0,0,1][Math.floor(t.Angle.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),Qf("node:resize",n,this.view)},e.prototype.doResize=function(t){var e=t.e,n=t.dx,r=t.dy,i=this.node.getSize(),o=Math.max(i.width+(this.flip?n:r),1),s=Math.max(i.height+(this.flip?r:n),1);this.node.resize(o,s,{absolute:!0}),Qf("node:resizing",e,this.view)},e.prototype.stopResize=function(t){var e=t.e;this.view.removeClass("node-resizing"),Qf("node:resized",e,this.view),this.halo.stopBatch()},e.prototype.startClone=function(e){var n=e.e,r=e.x,i=e.y;this.halo.startBatch();var o=this.options.clone(this.cell,{clone:!0});if(!t.Cell.isCell(o))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(o,r,i),this.model.addCell(o,{halo:this.halo.cid,async:!1});var s=this.graph.renderer.findViewByCell(o);s.onMouseDown(n,r,i),this.halo.setEventData(n,{cloneView:s})},e.prototype.centerNodeAtCursor=function(t,e,n){var r=t.getBBox().getCenter(),i=e-r.x,o=n-r.y;t.translate(i,o)},e.prototype.doClone=function(t){var e=t.e,n=t.x,r=t.y,i=this.halo.getEventData(e).cloneView;i&&i.onMouseMove(e,n,r)},e.prototype.stopClone=function(t){var e=t.e,n=t.x,r=t.y,i=this.halo.getEventData(e).cloneView;i&&i.onMouseUp(e,n,r),this.halo.stopBatch()},e.prototype.startFork=function(e){var n=e.e,r=e.x,i=e.y;this.halo.startBatch();var o=this.options.clone(this.cell,{fork:!0});if(!t.Cell.isCell(o))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(o,r,i),this.model.addCell(o,{halo:this.halo.cid,async:!1});var s=this.createEdgeConnectedToSource(),a=this.graph.renderer.findViewByCell(o),l=this.getMagnet(a,"target"),u=this.getEdgeTerminal(a,l);s.setTarget(u),this.model.addEdge(s,{halo:this.halo.cid,async:!1}),a.onMouseDown(n,r,i),this.halo.setEventData(n,{cloneView:a})},e.prototype.doFork=function(t){var e=t.e,n=t.x,r=t.y,i=this.halo.getEventData(e).cloneView;i&&i.onMouseMove(e,n,r)},e.prototype.stopFork=function(t){var e=t.e,n=t.x,r=t.y,i=this.halo.getEventData(e).cloneView;i&&i.onMouseUp(e,n,r),this.halo.stopBatch()},e.prototype.startRotate=function(e){var n=this,r=e.e,i=e.x,o=e.y;this.halo.startBatch();var s=this.node.getBBox().getCenter(),a=[this.node];this.options.rotateEmbeds&&this.node.getDescendants({deep:!0}).reduce((function(t,e){return e.isNode()&&t.push(e),t}),a),this.halo.setEventData(r,{center:s,nodes:a,rotateStartAngles:a.map((function(t){return t.getAngle()})),clientStartAngle:new t.Point(i,o).theta(s)}),a.forEach((function(t){var e=n.graph.findViewByCell(t);e&&(e.addClass("node-rotating"),Qf("node:rotate",r,e))}))},e.prototype.doRotate=function(e){var n=this,r=e.e,i=e.x,o=e.y,s=this.halo.getEventData(r),a=s.clientStartAngle-new t.Point(i,o).theta(s.center);s.nodes.forEach((function(e,i){var o=s.rotateStartAngles[i],l=t.Util.snapToGrid(o+a,n.options.rotateGrid);e.rotate(l,{absolute:!0,center:s.center,halo:n.halo.cid}),Qf("node:rotating",r,n.graph.findViewByCell(e))}))},e.prototype.stopRotate=function(t){var e=this,n=t.e;this.halo.getEventData(n).nodes.forEach((function(t){var r=e.graph.findViewByCell(t);r.removeClass("node-rotating"),Qf("node:rotated",n,r)})),this.halo.stopBatch()},e.prototype.unlink=function(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()},e}(),Fg=function(){function t(t){this.halo=t}return Object.defineProperty(t.prototype,"options",{get:function(){return this.halo.options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"graph",{get:function(){return this.halo.graph},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.halo.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this.halo.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cell",{get:function(){return this.halo.cell},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.cell},enumerable:!1,configurable:!0}),t.prototype.getPresets=function(){return{className:"type-edge",handles:[{name:"remove",position:"nw",icon:null,events:{mousedown:this.removeEdge.bind(this)}},{name:"direction",position:"se",icon:null,events:{mousedown:this.directionSwap.bind(this)}}],content:!1,bbox:function(t){return t.graph.localToGraph(t.getPointAtRatio(.5))},tinyThreshold:-1,smallThreshold:-1}},t.prototype.removeEdge=function(){this.cell.remove()},t.prototype.directionSwap=function(){var t=this.edge.getSource(),e=this.edge.getTarget();this.edge.prop({source:e,target:t})},t}(),zg=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),Object.defineProperty(i.prototype,"type",{get:function(){return this.options.type||"surround"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"handleOptions",{get:function(){return this.options},enumerable:!1,configurable:!0}),i.prototype.init=function(t){this.options=ro(i.defaultOptions,this.cell.isNode()?new Lg(this).getPresets():this.cell.isEdge()?new Fg(this).getPresets():null,t),this.render(),this.initHandles(),this.update(),this.startListening()},i.prototype.startListening=function(){var t=this.model,n=this.graph;this.view.cell.on("removed",this.remove,this),t.on("reseted",this.remove,this),n.on("halo:destroy",this.remove,this),t.on("*",this.update,this),n.on("scale",this.update,this),n.on("translate",this.update,this),e.prototype.startListening.call(this)},i.prototype.stopListening=function(){var t=this.model,n=this.graph,r=this.view.cell;this.undelegateEvents(),r.off("removed",this.remove,this),t.off("reseted",this.remove,this),n.off("halo:destroy",this.remove,this),t.off("*",this.update,this),n.off("scale",this.update,this),n.off("translate",this.update,this),e.prototype.stopListening.call(this)},i.prototype.render=function(){var t=this.options,e=this.prefixClassName("widget-halo");return this.view.addClass(Og.NODE_CLS),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(e).attr("data-shape",this.view.cell.shape),t.className&&this.$container.addClass(t.className),this.$handleContainer=this.$("<div/>").addClass(e+"-handles").appendTo(this.container),this.$content=this.$("<div/>").addClass(e+"-content").appendTo(this.container),this.$container.appendTo(this.graph.container),this},i.prototype.remove=function(){return this.stopBatch(),this.view.removeClass(Og.NODE_CLS),e.prototype.remove.call(this)},i.prototype.update=function(){if(this.isRendered()){this.updateContent();var t=this.getBBox(),e=this.options.tinyThreshold||0,n=this.options.smallThreshold||0;this.$handleContainer.toggleClass(this.handleClassName+"-tiny",t.width<e&&t.height<e);var r=this.handleClassName+"-small";this.$handleContainer.toggleClass(r,!this.$handleContainer.hasClass(r)&&t.width<n&&t.height<n),this.$container.css({width:t.width,height:t.height,left:t.x,top:t.y}),this.hasHandle("unlink")&&this.toggleUnlink(),"surround"!==this.type&&"toolbar"!==this.type||this.hasHandle("fork")&&this.toggleFork()}},i.prototype.updateContent=function(){var t=this.options.content;if("function"==typeof t){var e=Ws(t,this,this.view,this.$content[0]);e&&this.$content.html(e)}else t?this.$content.html(t):this.$content.remove()},i.prototype.getBBox=function(){var e=this.view,n=this.options.bbox,i="function"==typeof n?Ws(n,this,e):n;return t.Rectangle.create(r({x:0,y:0,width:1,height:1},i))},i.prototype.removeCell=function(){this.cell.remove()},i.prototype.toggleFork=function(){var t=this.view.cell.clone(),e=this.graph.hook.createCellView(t),n=this.graph.hook.validateConnection(this.view,null,e,null,"target");this.$handleContainer.children(".fork").toggleClass("hidden",!n),e.remove()},i.prototype.toggleUnlink=function(){var t=this.model.getConnectedEdges(this.view.cell).length>0;this.$handleContainer.children(".unlink").toggleClass("hidden",!t)},i.prototype.startBatch=function(){this.model.startBatch("halo",{halo:this.cid})},i.prototype.stopBatch=function(){this.model.hasActiveBatch("halo")&&this.model.stopBatch("halo",{halo:this.cid})},i}(Uf);!function(t){t.defaultOptions={type:"surround",clearAll:!0,clearOnBlankMouseDown:!0,useCellGeometry:!1,clone:function(t){return t.clone().removeZIndex()}}}(zg||(zg={})),Object.getOwnPropertyNames(_f.prototype).forEach((function(t){"constructor"!==t&&Object.defineProperty(zg.prototype,t,Object.getOwnPropertyDescriptor(_f.prototype,t))})),function(t){t.NODE_CLS="has-widget-halo"}(Og||(Og={}));var Bg,Vg=function(e){function i(n){var o=e.call(this)||this;return o.options=r(r({},i.defaults),n),o.container=document.createElement("div"),o.$container=o.$(o.container).addClass(o.prefixClassName("widget-dnd")),o.draggingGraph=new t.Graph(r(r({},o.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1})),o.$container.append(o.draggingGraph.container),o}return n(i,e),Object.defineProperty(i.prototype,"targetScroller",{get:function(){var e=this.options.target;return t.Graph.isGraph(e)?e.scroller.widget:e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"targetGraph",{get:function(){var e=this.options.target;return t.Graph.isGraph(e)?e:e.graph},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"targetModel",{get:function(){return this.targetGraph.model},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"snapline",{get:function(){return this.targetGraph.snapline.widget},enumerable:!1,configurable:!0}),i.prototype.start=function(t,e){var n=e;n.preventDefault(),this.targetModel.startBatch("dnd"),this.$container.addClass("dragging").appendTo(this.options.containerParent||document.body),this.sourceNode=t,this.prepareDragging(t,n.clientX,n.clientY);var r=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:t,cell:t,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(i.documentEvents,n.data)},i.prototype.isSnaplineEnabled=function(){return this.snapline&&!this.snapline.disabled},i.prototype.prepareDragging=function(t,e,n){var r=this.draggingGraph,i=r.model,o=this.options.getDragNode(t,{sourceNode:t,draggingGraph:r,targetGraph:this.targetGraph});o.position(0,0);var s=5;if(this.isSnaplineEnabled()&&(s+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){var a=this.targetGraph.transform.getScale();r.scale(a.sx,a.sy),s*=Math.max(a.sx,a.sy)}else r.scale(1,1);this.clearDragging(),this.options.animation&&this.$container.stop(!0,!0),i.resetCells([o]);var l=r.findViewByCell(o);l.undelegateEvents(),l.cell.off("changed"),r.fitToContent({padding:s,allowNewOrigin:"any"});var u=l.getBBox();this.geometryBBox=l.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(u.getTopLeft()),this.draggingNode=o,this.draggingView=l,this.draggingBBox=o.getBBox(),this.padding=s,this.originOffset=this.updateGraphPosition(e,n)},i.prototype.updateGraphPosition=function(t,e){var n=document.body.scrollTop||document.documentElement.scrollTop,r=this.delta,i=this.geometryBBox,o=this.padding||5,s={left:t-r.x-i.width/2-o,top:e-r.y-i.height/2-o+n};return this.draggingGraph&&this.$container.offset(s),s},i.prototype.updateNodePosition=function(t,e){var n=this.targetGraph.clientToLocal(t,e),r=this.draggingBBox;return n.x-=r.width/2,n.y-=r.height/2,this.draggingNode.position(n.x,n.y),n},i.prototype.snap=function(t){var e=t.cell,n=t.current,r=t.options,i=e;if(r.snapped){var o=this.draggingBBox;i.position(o.x+r.tx,o.y+r.ty,{silent:!0}),this.draggingView.translate(),i.position(n.x,n.y,{silent:!0}),this.snapOffset={x:r.tx,y:r.ty}}else this.snapOffset=null},i.prototype.onDragging=function(t){var e=this.draggingView;if(e){t.preventDefault();var n=this.normalizeEvent(t),r=n.clientX,i=n.clientY;this.updateGraphPosition(r,i);var o=this.updateNodePosition(r,i),s=this.targetGraph.options.embedding.enabled,a=(s||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(s){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});var l=e.getEventData(n);a?e.processEmbedding(n,l):e.clearEmbedding(l),this.candidateEmbedView=l.candidateEmbedView}this.isSnaplineEnabled()&&(a?this.snapline.snapOnMoving({e:n,view:e,x:o.x,y:o.y}):this.snapline.hide())}},i.prototype.onDragEnd=function(t){var e=this,n=this.draggingNode;if(n){var r=this.normalizeEvent(t),i=this.draggingView,o=this.draggingBBox,s=this.snapOffset,a=o.x,l=o.y;s&&(a+=s.x,l+=s.y),n.position(a,l,{silent:!0});var u=this.drop(n,{x:r.clientX,y:r.clientY}),c=function(t){t?(e.onDropped(n),e.targetGraph.options.embedding.enabled&&i&&(i.setEventData(r,{cell:t,graph:e.targetGraph,candidateEmbedView:e.candidateEmbedView}),i.finalizeEmbedding(r,i.getEventData(r)))):e.onDropInvalid(),e.candidateEmbedView=null,e.targetModel.stopBatch("dnd")};Js(u)?(this.undelegateDocumentEvents(),u.then(c)):c(u)}},i.prototype.clearDragging=function(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())},i.prototype.onDropped=function(t){this.draggingNode===t&&(this.clearDragging(),this.$container.removeClass("dragging").remove())},i.prototype.onDropInvalid=function(){var t=this,e=this.draggingNode;if(e){var n=this.options.animation;if(n){var r="object"==typeof n&&n.duration||150,i="object"==typeof n&&n.easing||"swing";this.draggingView=null,this.$container.animate(this.originOffset,r,i,(function(){return t.onDropped(e)}))}else this.onDropped(e)}},i.prototype.isInsideValidArea=function(t){var e,n=this.targetGraph,r=this.targetScroller;if(r)if(r.options.autoResize)e=this.getDropArea(r.container);else{var i=this.getDropArea(r.container);e=this.getDropArea(n.container).intersectsWithRect(i)}else e=this.getDropArea(n.container);return e&&e.containsPoint(t)},i.prototype.getDropArea=function(e){var n=this.$(e),r=n.offset(),i=document.body.scrollTop||document.documentElement.scrollTop,o=document.body.scrollLeft||document.documentElement.scrollLeft;return t.Rectangle.create({x:r.left+parseInt(n.css("border-left-width"),10)-o,y:r.top+parseInt(n.css("border-top-width"),10)-i,width:n.innerWidth(),height:n.innerHeight()})},i.prototype.drop=function(e,n){var r=this;if(this.isInsideValidArea(n)){var i=this.targetGraph,o=i.model,s=i.clientToLocal(n),a=this.sourceNode,l=this.options.getDropNode(e,{sourceNode:a,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),u=l.getBBox();s.x+=u.x-u.width/2,s.y+=u.y-u.height/2;var c=this.snapOffset?1:i.getGridSize();l.position(t.Util.snapToGrid(s.x,c),t.Util.snapToGrid(s.y,c)),l.removeZIndex();var h=this.options.validateNode,p=!h||h(l,{sourceNode:a,draggingNode:e,droppingNode:l,targetGraph:i,draggingGraph:this.draggingGraph});return"boolean"==typeof p?p?(o.addCell(l,{stencil:this.cid}),l):null:Ks(p).then((function(t){return t?(o.addCell(l,{stencil:r.cid}),l):null}))}return null},i.prototype.onRemove=function(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())},i.prototype.dispose=function(){this.remove()},o([t.View.dispose()],i.prototype,"dispose",null),i}(t.View);!function(t){t.defaults={animation:!1,getDragNode:function(t){return t.clone()},getDropNode:function(t){return t.clone()}},t.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(Vg||(Vg={})),function(t){t.getMaxDim=function(t,e){return t.reduce((function(t,n){return Math.max(n.getSize()[e],t)}),0)},t.getNodesInRow=function(t,e,n){for(var r=[],i=n*e,o=i+n;i<o;i+=1)r.push(t[i]);return r},t.getNodesInColumn=function(t,e,n){for(var r=[],i=e,o=t.length;i<o;i+=n)r.push(t[i]);return r},t.accumulate=function(t,e){return t.reduce((function(t,e,n){return t.push(t[n]+e),t}),[e||0])}}(Bg||(Bg={}));var jg,Rg,Ig=function(e){function i(n){var o=e.call(this)||this;(o.graphs={},o.$groups={},o.options=r(r({},i.defaultOptions),n),o.dnd=new Vg(o.options),o.onSearch=gi(o.onSearch,200),o.container=document.createElement("div"),o.$container=o.$(o.container).addClass(o.prefixClassName(jg.base)).attr("data-not-found-text",o.options.notFoundText||"No matches found"),o.options.collapsable=n.collapsable&&n.groups&&n.groups.some((function(t){return!1!==t.collapsable})),o.options.collapsable)&&(o.$container.addClass("collapsable"),n.groups&&n.groups.every((function(t){return t.collapsed||!1===t.collapsable}))&&o.$container.addClass("collapsed"));o.$("<div/>").addClass(o.prefixClassName(jg.title)).html(o.options.title).appendTo(o.$container),n.search&&o.$container.addClass("searchable").append(o.renderSearch()),o.$content=o.$("<div/>").addClass(o.prefixClassName(jg.content)).appendTo(o.$container);var s=n.stencilGraphOptions||{};if(n.groups&&n.groups.length)n.groups.forEach((function(e){var i=o.$("<div/>").addClass(o.prefixClassName(jg.group)).attr("data-name",e.name);(null==e.collapsable&&n.collapsable||!1!==e.collapsable)&&i.addClass("collapsable"),i.toggleClass("collapsed",!0===e.collapsed);var a=o.$("<h3/>").addClass(o.prefixClassName(jg.groupTitle)).html(e.title||e.name),l=o.$("<div/>").addClass(o.prefixClassName(jg.groupContent)),u=e.graphOptions,c=new t.Graph(r(r(r({},s),u),{container:document.createElement("div"),model:s.model||new t.Model,width:e.graphWidth||n.stencilGraphWidth,height:e.graphHeight||n.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));l.append(c.container),i.append(a,l).appendTo(o.$content),o.$groups[e.name]=i,o.graphs[e.name]=c}));else{var a=new t.Graph(r(r({},s),{container:document.createElement("div"),model:s.model||new t.Model,width:n.stencilGraphWidth,height:n.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));o.$content.append(a.container),o.graphs[Rg.defaultGroupName]=a}return o.startListening(),o}return n(i,e),Object.defineProperty(i.prototype,"targetScroller",{get:function(){var e=this.options.target;return t.Graph.isGraph(e)?e.scroller.widget:e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"targetGraph",{get:function(){var e=this.options.target;return t.Graph.isGraph(e)?e:e.graph},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"targetModel",{get:function(){return this.targetGraph.model},enumerable:!1,configurable:!0}),i.prototype.renderSearch=function(){return this.$("<div/>").addClass(this.prefixClassName(jg.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(jg.searchText)))},i.prototype.startListening=function(){var t,e=this,n=this.prefixClassName(jg.title),r=this.prefixClassName(jg.searchText),i=this.prefixClassName(jg.groupTitle);this.delegateEvents(((t={})["click ."+n]="onTitleClick",t["touchstart ."+n]="onTitleClick",t["click ."+i]="onGroupTitleClick",t["touchstart ."+i]="onGroupTitleClick",t["input ."+r]="onSearch",t["focusin ."+r]="onSearchFocusIn",t["focusout ."+r]="onSearchFocusOut",t)),Object.keys(this.graphs).forEach((function(t){e.graphs[t].on("cell:mousedown",e.onDragStart,e)}))},i.prototype.stopListening=function(){var t=this;this.undelegateEvents(),Object.keys(this.graphs).forEach((function(e){t.graphs[e].off("cell:mousedown",t.onDragStart,t)}))},i.prototype.load=function(t,e){var n=this;return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach((function(e){t[e]&&n.loadGroup(t[e],e)})),this},i.prototype.loadGroup=function(e,n){var r=this.getModel(n);if(r){var i=e.map((function(e){return t.Node.isNode(e)?e:t.Node.create(e)}));r.resetCells(i)}var o=this.getGroup(n),s=this.options.stencilGraphHeight;o&&null!=o.graphHeight&&(s=o.graphHeight);var a=o&&o.layout||this.options.layout;if(a&&r&&Ws(a,this,r,o),!s){var l=this.getGraph(n);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:o&&o.graphPadding||this.options.stencilGraphPadding||10})}return this},i.prototype.onDragStart=function(t){var e=t.e,n=t.node;this.dnd.start(n,e)},i.prototype.filter=function(e,n){var r=this,i=Object.keys(this.graphs).reduce((function(i,o){var s=r.graphs[o],a=o===Rg.defaultGroupName?null:o,l=s.model.getNodes().filter((function(t){var i=!1;i="function"==typeof n?Ws(n,r,t,e,a,r):"boolean"==typeof n?n:r.isCellMatched(t,e,n,e.toLowerCase()!==e);var o=s.renderer.findViewByCell(t);return o&&o.$(o.container).toggleClass("unmatched",!i),i})),u=l.length>0,c=r.options,h=new t.Model;return h.resetCells(l),c.layout&&Ws(c.layout,r,h,r.getGroup(o)),r.$groups[o]&&r.$groups[o].toggleClass("unmatched",!u),s.fitToContent({gridWidth:1,gridHeight:1,padding:c.stencilGraphPadding||10}),i||u}),!1);this.$container.toggleClass("not-found",!i)},i.prototype.isCellMatched=function(t,e,n,r){return!e||!n||Object.keys(n).some((function(i){if("*"===i||t.shape===i){var o=n[i];return"boolean"==typeof o?o:(Array.isArray(o)?o:[o]).some((function(n){var i=t.getPropByPath(n);return null!=i&&(i=""+i,r||(i=i.toLowerCase()),i.indexOf(e)>=0)}))}return!1}))},i.prototype.onSearch=function(t){this.filter(t.target.value,this.options.search)},i.prototype.onSearchFocusIn=function(){this.$container.addClass("is-focused")},i.prototype.onSearchFocusOut=function(){this.$container.removeClass("is-focused")},i.prototype.onTitleClick=function(){this.options.collapsable&&(this.$container.toggleClass("collapsed"),this.$container.hasClass("collapsed")?this.collapseGroups():this.expandGroups())},i.prototype.onGroupTitleClick=function(t){var e=this,n=this.$(t.target).closest("."+this.prefixClassName(jg.group));this.toggleGroup(n.attr("data-name")||"");var r=Object.keys(this.$groups).every((function(t){var n=e.getGroup(t),r=e.$groups[t];return n&&!1===n.collapsable||r.hasClass("collapsed")}));this.$container.toggleClass("collapsed",r)},i.prototype.getModel=function(t){var e=this.getGraph(t);return e?e.model:null},i.prototype.getGraph=function(t){return this.graphs[t||Rg.defaultGroupName]},i.prototype.getGroup=function(t){var e=this.options.groups;return null!=t&&e&&e.length?e.find((function(e){return e.name===t})):null},i.prototype.toggleGroup=function(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this},i.prototype.collapseGroup=function(t){if(this.isGroupCollapsable(t)){var e=this.$groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),e.addClass("collapsed"))}return this},i.prototype.expandGroup=function(t){if(this.isGroupCollapsable(t)){var e=this.$groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),e.removeClass("collapsed"))}return this},i.prototype.isGroupCollapsable=function(t){return this.$groups[t].hasClass("collapsable")},i.prototype.isGroupCollapsed=function(t){var e=this.$groups[t];return e&&e.hasClass("collapsed")},i.prototype.collapseGroups=function(){var t=this;return Object.keys(this.$groups).forEach((function(e){return t.collapseGroup(e)})),this},i.prototype.expandGroups=function(){var t=this;return Object.keys(this.$groups).forEach((function(e){return t.expandGroup(e)})),this},i.prototype.resizeGroup=function(t,e){var n=this.graphs[t];return n&&n.resize(e.width,e.height),this},i.prototype.onRemove=function(){var t=this;Object.keys(this.graphs).forEach((function(e){t.graphs[e].view.remove(),delete t.graphs[e]})),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()},i}(t.View);!function(e){e.defaultOptions=r({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout:function(e,n){var i={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};!function(e,n){void 0===n&&(n={});var r=t.Model.isModel(e)?e:(new t.Model).resetCells(e,{sort:!1,dryrun:!0}),i=r.getNodes(),o=n.columns||1,s=Math.ceil(i.length/o),a=n.dx||0,l=n.dy||0,u=!1!==n.center,c=!0===n.resizeToFit,h=n.marginX||0,p=n.marginY||0,d=[],f=n.columnWidth;if("compact"===f)for(var g=0;g<o;g+=1){var v=Bg.getNodesInColumn(i,g,o);d.push(Bg.getMaxDim(v,"width")+a)}else{null!=f&&"auto"!==f||(f=Bg.getMaxDim(i,"width")+a);for(var y=0;y<o;y+=1)d.push(f)}var m=Bg.accumulate(d,h),b=[],C=n.rowHeight;if("compact"===C)for(y=0;y<s;y+=1)v=Bg.getNodesInRow(i,y,o),b.push(Bg.getMaxDim(v,"height")+l);else for(null!=C&&"auto"!==C||(C=Bg.getMaxDim(i,"height")+l),y=0;y<s;y+=1)b.push(C);var x=Bg.accumulate(b,p);r.startBatch("layout"),i.forEach((function(t,e){var r=e%o,i=Math.floor(e/o),s=d[r],h=b[i],p=0,f=0,g=t.getSize();if(c){var v=s-2*a,y=h-2*l,C=g.height*(g.width?v/g.width:1),w=g.width*(g.height?y/g.height:1);h<C?v=w:y=C,g={width:v,height:y},t.setSize(g,n)}u&&(p=(s-g.width)/2,f=(h-g.height)/2),t.position(m[r]+a+p,x[i]+l+f,n)})),r.stopBatch("layout")}(e,r(r(r({},i),this.options.layoutOptions),n?n.layoutOptions:{}))}},Vg.defaults)}(Ig||(Ig={})),function(t){t.base="widget-stencil",t.title=t.base+"-title",t.search=t.base+"-search",t.searchText=t.search+"-text",t.content=t.base+"-content",t.group=t.base+"-group",t.groupTitle=t.group+"-title",t.groupContent=t.group+"-content"}(jg||(jg={})),function(t){t.defaultGroupName="__default__"}(Rg||(Rg={}));var _g=Object.freeze({__proto__:null,get AutoSave(){return zf},Clipboard:Ng,get Halo(){return zg},MiniMap:Wf,get Scroller(){return Kf},Selection:eg,Snapline:Xf,Transform:ig,Knob:qf,get Dnd(){return Vg},get Stencil(){return Ig}});Sh.trackable&&setTimeout((function(){if(Sh.trackable){var t=new Image,e=r(r({},Sh.trackInfo),{version:Th,pg:document.URL,r:(new Date).getTime(),x6:!0,page_type:"syslog"}),n=encodeURIComponent(JSON.stringify([e]));t.src="https://kcart.alipay.com/web/bi.do?BIProfile=merge&d="+n}}),3e3),t.Addon=_g,t.ArrayExt=gs,t.Collection=uf,t.Config=Sh,t.Dictionary=ap,t.Disablable=sp,t.DisposableDelegate=ep,t.Dom=ju,t.Events=Qh,t.FunctionExt=Qs,t.JQuery=u,t.Lang=ds,t.NumberExt=qs,t.ObjectExt=Ms,t.Registry=Wd,t.Segment=yl,t.Shape=Ff,t.StringExt=Is,t.Text=qa,t.version=Th,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=x6.js.map