@wyltils/ems-editor 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1102 -1104
- package/dist/index.umd.js +33 -32
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(ht,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("element-plus"),require("pinia"),require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","pinia","monaco-editor"],d):(ht=typeof globalThis<"u"?globalThis:ht||self,d(ht.EmsEditor={},ht.Vue,ht.ElementPlus,ht.Pinia,ht.monaco))})(this,function(ht,d,Et,be,zd){"use strict";function Fd(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const Qt=Fd(zd);/*! Element Plus Icons Vue v2.3.2 */var Ud=d.defineComponent({name:"Document",__name:"document",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),Jr=Ud,Kd=d.defineComponent({name:"FolderOpened",__name:"folder-opened",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"})]))}}),Jd=Kd,jd=d.defineComponent({name:"Folder",__name:"folder",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32"})]))}}),Gd=jd,Yd=d.defineComponent({name:"Menu",__name:"menu",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),Hd=Yd,_d=d.defineComponent({name:"Plus",__name:"plus",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Wd=_d,qd=d.defineComponent({name:"Search",__name:"search",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),jr=qd;function Y(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(e[n[s]]=i[n[s]]);return e}function $(i,t,e,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(o=(s<3?r(o):s>3?r(t,e,o):r(t,e))||o);return s>3&&o&&Object.defineProperty(t,e,o),o}function Gs(i,t,e,n){function s(o){return o instanceof e?o:new e(function(r){r(o)})}return new(e||(e=Promise))(function(o,r){function a(h){try{c(n.next(h))}catch(u){r(u)}}function l(h){try{c(n.throw(h))}catch(u){r(u)}}function c(h){h.done?o(h.value):s(h.value).then(a,l)}c((n=n.apply(i,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function Xd(i){i.forEach(t=>{Object.hasOwn(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){const n=document.createDocumentFragment();e.forEach(s=>{const o=s instanceof Node;n.appendChild(o?s:document.createTextNode(String(s)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&(i=>{Xd(i)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var Gr=typeof global=="object"&&global&&global.Object===Object&&global,$d=typeof self=="object"&&self&&self.Object===Object&&self,ne=Gr||$d||Function("return this")(),_t=ne.Symbol,Yr=Object.prototype,Zd=Yr.hasOwnProperty,tg=Yr.toString,Qn=_t?_t.toStringTag:void 0;function eg(i){var t=Zd.call(i,Qn),e=i[Qn];try{i[Qn]=void 0;var n=!0}catch{}var s=tg.call(i);return n&&(t?i[Qn]=e:delete i[Qn]),s}var ng=Object.prototype,ig=ng.toString;function sg(i){return ig.call(i)}var og="[object Null]",rg="[object Undefined]",Hr=_t?_t.toStringTag:void 0;function ke(i){return i==null?i===void 0?rg:og:Hr&&Hr in Object(i)?eg(i):sg(i)}function ie(i){return i!=null&&typeof i=="object"}var ag="[object Symbol]";function ue(i){return typeof i=="symbol"||ie(i)&&ke(i)==ag}function Ri(i,t){for(var e=-1,n=i==null?0:i.length,s=Array(n);++e<n;)s[e]=t(i[e],e,i);return s}var Pt=Array.isArray,_r=_t?_t.prototype:void 0,Wr=_r?_r.toString:void 0;function qr(i){if(typeof i=="string")return i;if(Pt(i))return Ri(i,qr)+"";if(ue(i))return Wr?Wr.call(i):"";var t=i+"";return t=="0"&&1/i==-1/0?"-0":t}var lg=/\s/;function cg(i){for(var t=i.length;t--&&lg.test(i.charAt(t)););return t}var hg=/^\s+/;function ug(i){return i&&i.slice(0,cg(i)+1).replace(hg,"")}function bt(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}var Xr=NaN,dg=/^[-+]0x[0-9a-f]+$/i,gg=/^0b[01]+$/i,fg=/^0o[0-7]+$/i,pg=parseInt;function Vn(i){if(typeof i=="number")return i;if(ue(i))return Xr;if(bt(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=bt(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=ug(i);var e=gg.test(i);return e||fg.test(i)?pg(i.slice(2),e?2:8):dg.test(i)?Xr:+i}function en(i){return i}var mg="[object AsyncFunction]",bg="[object Function]",yg="[object GeneratorFunction]",wg="[object Proxy]";function Ys(i){if(!bt(i))return!1;var t=ke(i);return t==bg||t==yg||t==mg||t==wg}var Hs=ne["__core-js_shared__"],$r=function(){var i=/[^.]+$/.exec(Hs&&Hs.keys&&Hs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function Cg(i){return!!$r&&$r in i}var Ag=Function.prototype,xg=Ag.toString;function Ke(i){if(i!=null){try{return xg.call(i)}catch{}try{return i+""}catch{}}return""}var vg=/[\\^$.*+?()[\]{}|]/g,Eg=/^\[object .+?Constructor\]$/,Sg=Function.prototype,Mg=Object.prototype,Bg=Sg.toString,kg=Mg.hasOwnProperty,Tg=RegExp("^"+Bg.call(kg).replace(vg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ig(i){if(!bt(i)||Cg(i))return!1;var t=Ys(i)?Tg:Eg;return t.test(Ke(i))}function Pg(i,t){return i==null?void 0:i[t]}function Je(i,t){var e=Pg(i,t);return Ig(e)?e:void 0}var _s=Je(ne,"WeakMap"),Zr=Object.create,Og=function(){function i(){}return function(t){if(!bt(t))return{};if(Zr)return Zr(t);i.prototype=t;var e=new i;return i.prototype=void 0,e}}();function ta(i,t,e){switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2])}return i.apply(t,e)}function Ng(){}function ea(i,t){var e=-1,n=i.length;for(t||(t=Array(n));++e<n;)t[e]=i[e];return t}var Rg=800,Dg=16,Lg=Date.now;function Qg(i){var t=0,e=0;return function(){var n=Lg(),s=Dg-(n-e);if(e=n,s>0){if(++t>=Rg)return arguments[0]}else t=0;return i.apply(void 0,arguments)}}function Vg(i){return function(){return i}}var Di=function(){try{var i=Je(Object,"defineProperty");return i({},"",{}),i}catch{}}(),zg=Di?function(i,t){return Di(i,"toString",{configurable:!0,enumerable:!1,value:Vg(t),writable:!0})}:en,na=Qg(zg);function Fg(i,t){for(var e=-1,n=i==null?0:i.length;++e<n&&t(i[e],e,i)!==!1;);return i}function Ug(i,t,e,n){for(var s=i.length,o=e+-1;++o<s;)if(t(i[o],o,i))return o;return-1}function Kg(i){return i!==i}function Jg(i,t,e){for(var n=e-1,s=i.length;++n<s;)if(i[n]===t)return n;return-1}function jg(i,t,e){return t===t?Jg(i,t,e):Ug(i,Kg,e)}function ia(i,t){var e=i==null?0:i.length;return!!e&&jg(i,t,0)>-1}var Gg=9007199254740991,Yg=/^(?:0|[1-9]\d*)$/;function Li(i,t){var e=typeof i;return t=t??Gg,!!t&&(e=="number"||e!="symbol"&&Yg.test(i))&&i>-1&&i%1==0&&i<t}function Qi(i,t,e){t=="__proto__"&&Di?Di(i,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):i[t]=e}function nn(i,t){return i===t||i!==i&&t!==t}var Hg=Object.prototype,_g=Hg.hasOwnProperty;function Ws(i,t,e){var n=i[t];(!(_g.call(i,t)&&nn(n,e))||e===void 0&&!(t in i))&&Qi(i,t,e)}function zn(i,t,e,n){var s=!e;e||(e={});for(var o=-1,r=t.length;++o<r;){var a=t[o],l=void 0;l===void 0&&(l=i[a]),s?Qi(e,a,l):Ws(e,a,l)}return e}var sa=Math.max;function oa(i,t,e){return t=sa(t===void 0?i.length-1:t,0),function(){for(var n=arguments,s=-1,o=sa(n.length-t,0),r=Array(o);++s<o;)r[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=e(r),ta(i,this,a)}}function sn(i,t){return na(oa(i,t,en),i+"")}var Wg=9007199254740991;function qs(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Wg}function je(i){return i!=null&&qs(i.length)&&!Ys(i)}function Vi(i,t,e){if(!bt(e))return!1;var n=typeof t;return(n=="number"?je(e)&&Li(t,e.length):n=="string"&&t in e)?nn(e[t],i):!1}function ra(i){return sn(function(t,e){var n=-1,s=e.length,o=s>1?e[s-1]:void 0,r=s>2?e[2]:void 0;for(o=i.length>3&&typeof o=="function"?(s--,o):void 0,r&&Vi(e[0],e[1],r)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var a=e[n];a&&i(t,a,n,o)}return t})}var qg=Object.prototype;function zi(i){var t=i&&i.constructor,e=typeof t=="function"&&t.prototype||qg;return i===e}function Xg(i,t){for(var e=-1,n=Array(i);++e<i;)n[e]=t(e);return n}var $g="[object Arguments]";function aa(i){return ie(i)&&ke(i)==$g}var la=Object.prototype,Zg=la.hasOwnProperty,tf=la.propertyIsEnumerable,on=aa(function(){return arguments}())?aa:function(i){return ie(i)&&Zg.call(i,"callee")&&!tf.call(i,"callee")};function ef(){return!1}var ca=typeof ht=="object"&&ht&&!ht.nodeType&&ht,ha=ca&&typeof module=="object"&&module&&!module.nodeType&&module,nf=ha&&ha.exports===ca,ua=nf?ne.Buffer:void 0,sf=ua?ua.isBuffer:void 0,rn=sf||ef,of="[object Arguments]",rf="[object Array]",af="[object Boolean]",lf="[object Date]",cf="[object Error]",hf="[object Function]",uf="[object Map]",df="[object Number]",gf="[object Object]",ff="[object RegExp]",pf="[object Set]",mf="[object String]",bf="[object WeakMap]",yf="[object ArrayBuffer]",wf="[object DataView]",Cf="[object Float32Array]",Af="[object Float64Array]",xf="[object Int8Array]",vf="[object Int16Array]",Ef="[object Int32Array]",Sf="[object Uint8Array]",Mf="[object Uint8ClampedArray]",Bf="[object Uint16Array]",kf="[object Uint32Array]",ut={};ut[Cf]=ut[Af]=ut[xf]=ut[vf]=ut[Ef]=ut[Sf]=ut[Mf]=ut[Bf]=ut[kf]=!0,ut[of]=ut[rf]=ut[yf]=ut[af]=ut[wf]=ut[lf]=ut[cf]=ut[hf]=ut[uf]=ut[df]=ut[gf]=ut[ff]=ut[pf]=ut[mf]=ut[bf]=!1;function Tf(i){return ie(i)&&qs(i.length)&&!!ut[ke(i)]}function Fi(i){return function(t){return i(t)}}var da=typeof ht=="object"&&ht&&!ht.nodeType&&ht,Fn=da&&typeof module=="object"&&module&&!module.nodeType&&module,If=Fn&&Fn.exports===da,Xs=If&&Gr.process,an=function(){try{var i=Fn&&Fn.require&&Fn.require("util").types;return i||Xs&&Xs.binding&&Xs.binding("util")}catch{}}(),ga=an&&an.isTypedArray,Ui=ga?Fi(ga):Tf,Pf=Object.prototype,Of=Pf.hasOwnProperty;function fa(i,t){var e=Pt(i),n=!e&&on(i),s=!e&&!n&&rn(i),o=!e&&!n&&!s&&Ui(i),r=e||n||s||o,a=r?Xg(i.length,String):[],l=a.length;for(var c in i)(t||Of.call(i,c))&&!(r&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Li(c,l)))&&a.push(c);return a}function pa(i,t){return function(e){return i(t(e))}}var Nf=pa(Object.keys,Object),Rf=Object.prototype,Df=Rf.hasOwnProperty;function ma(i){if(!zi(i))return Nf(i);var t=[];for(var e in Object(i))Df.call(i,e)&&e!="constructor"&&t.push(e);return t}function Un(i){return je(i)?fa(i):ma(i)}function Lf(i){var t=[];if(i!=null)for(var e in Object(i))t.push(e);return t}var Qf=Object.prototype,Vf=Qf.hasOwnProperty;function zf(i){if(!bt(i))return Lf(i);var t=zi(i),e=[];for(var n in i)n=="constructor"&&(t||!Vf.call(i,n))||e.push(n);return e}function ln(i){return je(i)?fa(i,!0):zf(i)}var Ff=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uf=/^\w*$/;function $s(i,t){if(Pt(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||ue(i)?!0:Uf.test(i)||!Ff.test(i)||t!=null&&i in Object(t)}var Kn=Je(Object,"create");function Kf(){this.__data__=Kn?Kn(null):{},this.size=0}function Jf(i){var t=this.has(i)&&delete this.__data__[i];return this.size-=t?1:0,t}var jf="__lodash_hash_undefined__",Gf=Object.prototype,Yf=Gf.hasOwnProperty;function Hf(i){var t=this.__data__;if(Kn){var e=t[i];return e===jf?void 0:e}return Yf.call(t,i)?t[i]:void 0}var _f=Object.prototype,Wf=_f.hasOwnProperty;function qf(i){var t=this.__data__;return Kn?t[i]!==void 0:Wf.call(t,i)}var Xf="__lodash_hash_undefined__";function $f(i,t){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=Kn&&t===void 0?Xf:t,this}function Ge(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Ge.prototype.clear=Kf,Ge.prototype.delete=Jf,Ge.prototype.get=Hf,Ge.prototype.has=qf,Ge.prototype.set=$f;function Zf(){this.__data__=[],this.size=0}function Ki(i,t){for(var e=i.length;e--;)if(nn(i[e][0],t))return e;return-1}var tp=Array.prototype,ep=tp.splice;function np(i){var t=this.__data__,e=Ki(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():ep.call(t,e,1),--this.size,!0}function ip(i){var t=this.__data__,e=Ki(t,i);return e<0?void 0:t[e][1]}function sp(i){return Ki(this.__data__,i)>-1}function op(i,t){var e=this.__data__,n=Ki(e,i);return n<0?(++this.size,e.push([i,t])):e[n][1]=t,this}function ye(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}ye.prototype.clear=Zf,ye.prototype.delete=np,ye.prototype.get=ip,ye.prototype.has=sp,ye.prototype.set=op;var Jn=Je(ne,"Map");function rp(){this.size=0,this.__data__={hash:new Ge,map:new(Jn||ye),string:new Ge}}function ap(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function Ji(i,t){var e=i.__data__;return ap(t)?e[typeof t=="string"?"string":"hash"]:e.map}function lp(i){var t=Ji(this,i).delete(i);return this.size-=t?1:0,t}function cp(i){return Ji(this,i).get(i)}function hp(i){return Ji(this,i).has(i)}function up(i,t){var e=Ji(this,i),n=e.size;return e.set(i,t),this.size+=e.size==n?0:1,this}function we(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}we.prototype.clear=rp,we.prototype.delete=lp,we.prototype.get=cp,we.prototype.has=hp,we.prototype.set=up;var dp="Expected a function";function Zs(i,t){if(typeof i!="function"||t!=null&&typeof t!="function")throw new TypeError(dp);var e=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=e.cache;if(o.has(s))return o.get(s);var r=i.apply(this,n);return e.cache=o.set(s,r)||o,r};return e.cache=new(Zs.Cache||we),e}Zs.Cache=we;var gp=500;function fp(i){var t=Zs(i,function(n){return e.size===gp&&e.clear(),n}),e=t.cache;return t}var pp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mp=/\\(\\)?/g,bp=fp(function(i){var t=[];return i.charCodeAt(0)===46&&t.push(""),i.replace(pp,function(e,n,s,o){t.push(s?o.replace(mp,"$1"):n||e)}),t});function cn(i){return i==null?"":qr(i)}function ji(i,t){return Pt(i)?i:$s(i,t)?[i]:bp(cn(i))}function jn(i){if(typeof i=="string"||ue(i))return i;var t=i+"";return t=="0"&&1/i==-1/0?"-0":t}function Gi(i,t){t=ji(t,i);for(var e=0,n=t.length;i!=null&&e<n;)i=i[jn(t[e++])];return e&&e==n?i:void 0}function yp(i,t,e){var n=i==null?void 0:Gi(i,t);return n===void 0?e:n}function to(i,t){for(var e=-1,n=t.length,s=i.length;++e<n;)i[s+e]=t[e];return i}var ba=_t?_t.isConcatSpreadable:void 0;function wp(i){return Pt(i)||on(i)||!!(ba&&i&&i[ba])}function Yi(i,t,e,n,s){var o=-1,r=i.length;for(e||(e=wp),s||(s=[]);++o<r;){var a=i[o];e(a)?to(s,a):n||(s[s.length]=a)}return s}function Cp(i){var t=i==null?0:i.length;return t?Yi(i):[]}function Ap(i){return na(oa(i,void 0,Cp),i+"")}var eo=pa(Object.getPrototypeOf,Object),xp="[object Object]",vp=Function.prototype,Ep=Object.prototype,ya=vp.toString,Sp=Ep.hasOwnProperty,Mp=ya.call(Object);function se(i){if(!ie(i)||ke(i)!=xp)return!1;var t=eo(i);if(t===null)return!0;var e=Sp.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&ya.call(e)==Mp}function Bp(i,t,e){var n=-1,s=i.length;t<0&&(t=-t>s?0:s+t),e=e>s?s:e,e<0&&(e+=s),s=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=i[n+t];return o}function kp(i,t,e){var n=i.length;return e=e===void 0?n:e,!t&&e>=n?i:Bp(i,t,e)}var Tp="\\ud800-\\udfff",Ip="\\u0300-\\u036f",Pp="\\ufe20-\\ufe2f",Op="\\u20d0-\\u20ff",Np=Ip+Pp+Op,Rp="\\ufe0e\\ufe0f",Dp="\\u200d",Lp=RegExp("["+Dp+Tp+Np+Rp+"]");function wa(i){return Lp.test(i)}function Qp(i){return i.split("")}var Ca="\\ud800-\\udfff",Vp="\\u0300-\\u036f",zp="\\ufe20-\\ufe2f",Fp="\\u20d0-\\u20ff",Up=Vp+zp+Fp,Kp="\\ufe0e\\ufe0f",Jp="["+Ca+"]",no="["+Up+"]",io="\\ud83c[\\udffb-\\udfff]",jp="(?:"+no+"|"+io+")",Aa="[^"+Ca+"]",xa="(?:\\ud83c[\\udde6-\\uddff]){2}",va="[\\ud800-\\udbff][\\udc00-\\udfff]",Gp="\\u200d",Ea=jp+"?",Sa="["+Kp+"]?",Yp="(?:"+Gp+"(?:"+[Aa,xa,va].join("|")+")"+Sa+Ea+")*",Hp=Sa+Ea+Yp,_p="(?:"+[Aa+no+"?",no,xa,va,Jp].join("|")+")",Wp=RegExp(io+"(?="+io+")|"+_p+Hp,"g");function qp(i){return i.match(Wp)||[]}function Xp(i){return wa(i)?qp(i):Qp(i)}function Ma(i){return function(t){t=cn(t);var e=wa(t)?Xp(t):void 0,n=e?e[0]:t.charAt(0),s=e?kp(e,1).join(""):t.slice(1);return n[i]()+s}}var Hi=Ma("toUpperCase");function $p(i){return Hi(cn(i).toLowerCase())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ő:"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"},nm=tm(em),im=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sm="\\u0300-\\u036f",om="\\ufe20-\\ufe2f",rm="\\u20d0-\\u20ff",am=sm+om+rm,lm="["+am+"]",cm=RegExp(lm,"g");function hm(i){return i=cn(i),i&&i.replace(im,nm).replace(cm,"")}var um=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function dm(i){return i.match(um)||[]}var gm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function fm(i){return gm.test(i)}var Ba="\\ud800-\\udfff",pm="\\u0300-\\u036f",mm="\\ufe20-\\ufe2f",bm="\\u20d0-\\u20ff",ym=pm+mm+bm,ka="\\u2700-\\u27bf",Ta="a-z\\xdf-\\xf6\\xf8-\\xff",wm="\\xac\\xb1\\xd7\\xf7",Cm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Am="\\u2000-\\u206f",xm=" \\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",Ia="A-Z\\xc0-\\xd6\\xd8-\\xde",vm="\\ufe0e\\ufe0f",Pa=wm+Cm+Am+xm,Oa="['’]",Na="["+Pa+"]",Em="["+ym+"]",Ra="\\d+",Sm="["+ka+"]",Da="["+Ta+"]",La="[^"+Ba+Pa+Ra+ka+Ta+Ia+"]",Mm="\\ud83c[\\udffb-\\udfff]",Bm="(?:"+Em+"|"+Mm+")",km="[^"+Ba+"]",Qa="(?:\\ud83c[\\udde6-\\uddff]){2}",Va="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="["+Ia+"]",Tm="\\u200d",za="(?:"+Da+"|"+La+")",Im="(?:"+hn+"|"+La+")",Fa="(?:"+Oa+"(?:d|ll|m|re|s|t|ve))?",Ua="(?:"+Oa+"(?:D|LL|M|RE|S|T|VE))?",Ka=Bm+"?",Ja="["+vm+"]?",Pm="(?:"+Tm+"(?:"+[km,Qa,Va].join("|")+")"+Ja+Ka+")*",Om="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rm=Ja+Ka+Pm,Dm="(?:"+[Sm,Qa,Va].join("|")+")"+Rm,Lm=RegExp([hn+"?"+Da+"+"+Fa+"(?="+[Na,hn,"$"].join("|")+")",Im+"+"+Ua+"(?="+[Na,hn+za,"$"].join("|")+")",hn+"?"+za+"+"+Fa,hn+"+"+Ua,Nm,Om,Ra,Dm].join("|"),"g");function Qm(i){return i.match(Lm)||[]}function Vm(i,t,e){return i=cn(i),t=t,t===void 0?fm(i)?Qm(i):dm(i):i.match(t)||[]}var zm="['’]",Fm=RegExp(zm,"g");function ja(i){return function(t){return Zp(Vm(hm(t).replace(Fm,"")),i,"")}}var Gn=ja(function(i,t,e){return t=t.toLowerCase(),i+(e?$p(t):t)});function Ga(){if(!arguments.length)return[];var i=arguments[0];return Pt(i)?i:[i]}function Um(i,t,e){return i===i&&(e!==void 0&&(i=i<=e?i:e),t!==void 0&&(i=i>=t?i:t)),i}function Ye(i,t,e){return e===void 0&&(e=t,t=void 0),e!==void 0&&(e=Vn(e),e=e===e?e:0),t!==void 0&&(t=Vn(t),t=t===t?t:0),Um(Vn(i),t,e)}function Km(){this.__data__=new ye,this.size=0}function Jm(i){var t=this.__data__,e=t.delete(i);return this.size=t.size,e}function jm(i){return this.__data__.get(i)}function Gm(i){return this.__data__.has(i)}var Ym=200;function Hm(i,t){var e=this.__data__;if(e instanceof ye){var n=e.__data__;if(!Jn||n.length<Ym-1)return n.push([i,t]),this.size=++e.size,this;e=this.__data__=new we(n)}return e.set(i,t),this.size=e.size,this}function oe(i){var t=this.__data__=new ye(i);this.size=t.size}oe.prototype.clear=Km,oe.prototype.delete=Jm,oe.prototype.get=jm,oe.prototype.has=Gm,oe.prototype.set=Hm;function _m(i,t){return i&&zn(t,Un(t),i)}function Wm(i,t){return i&&zn(t,ln(t),i)}var Ya=typeof ht=="object"&&ht&&!ht.nodeType&&ht,Ha=Ya&&typeof module=="object"&&module&&!module.nodeType&&module,qm=Ha&&Ha.exports===Ya,_a=qm?ne.Buffer:void 0,Wa=_a?_a.allocUnsafe:void 0;function qa(i,t){if(t)return i.slice();var e=i.length,n=Wa?Wa(e):new i.constructor(e);return i.copy(n),n}function Xm(i,t){for(var e=-1,n=i==null?0:i.length,s=0,o=[];++e<n;){var r=i[e];t(r,e,i)&&(o[s++]=r)}return o}function Xa(){return[]}var $m=Object.prototype,Zm=$m.propertyIsEnumerable,$a=Object.getOwnPropertySymbols,so=$a?function(i){return i==null?[]:(i=Object(i),Xm($a(i),function(t){return Zm.call(i,t)}))}:Xa;function t0(i,t){return zn(i,so(i),t)}var e0=Object.getOwnPropertySymbols,Za=e0?function(i){for(var t=[];i;)to(t,so(i)),i=eo(i);return t}:Xa;function n0(i,t){return zn(i,Za(i),t)}function tl(i,t,e){var n=t(i);return Pt(i)?n:to(n,e(i))}function oo(i){return tl(i,Un,so)}function i0(i){return tl(i,ln,Za)}var ro=Je(ne,"DataView"),ao=Je(ne,"Promise"),un=Je(ne,"Set"),el="[object Map]",s0="[object Object]",nl="[object Promise]",il="[object Set]",sl="[object WeakMap]",ol="[object DataView]",o0=Ke(ro),r0=Ke(Jn),a0=Ke(ao),l0=Ke(un),c0=Ke(_s),Wt=ke;(ro&&Wt(new ro(new ArrayBuffer(1)))!=ol||Jn&&Wt(new Jn)!=el||ao&&Wt(ao.resolve())!=nl||un&&Wt(new un)!=il||_s&&Wt(new _s)!=sl)&&(Wt=function(i){var t=ke(i),e=t==s0?i.constructor:void 0,n=e?Ke(e):"";if(n)switch(n){case o0:return ol;case r0:return el;case a0:return nl;case l0:return il;case c0:return sl}return t});var h0=Object.prototype,u0=h0.hasOwnProperty;function d0(i){var t=i.length,e=new i.constructor(t);return t&&typeof i[0]=="string"&&u0.call(i,"index")&&(e.index=i.index,e.input=i.input),e}var _i=ne.Uint8Array;function lo(i){var t=new i.constructor(i.byteLength);return new _i(t).set(new _i(i)),t}function g0(i,t){var e=t?lo(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.byteLength)}var f0=/\w*$/;function p0(i){var t=new i.constructor(i.source,f0.exec(i));return t.lastIndex=i.lastIndex,t}var rl=_t?_t.prototype:void 0,al=rl?rl.valueOf:void 0;function m0(i){return al?Object(al.call(i)):{}}function ll(i,t){var e=t?lo(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.length)}var b0="[object Boolean]",y0="[object Date]",w0="[object Map]",C0="[object Number]",A0="[object RegExp]",x0="[object Set]",v0="[object String]",E0="[object Symbol]",S0="[object ArrayBuffer]",M0="[object DataView]",B0="[object Float32Array]",k0="[object Float64Array]",T0="[object Int8Array]",I0="[object Int16Array]",P0="[object Int32Array]",O0="[object Uint8Array]",N0="[object Uint8ClampedArray]",R0="[object Uint16Array]",D0="[object Uint32Array]";function L0(i,t,e){var n=i.constructor;switch(t){case S0:return lo(i);case b0:case y0:return new n(+i);case M0:return g0(i,e);case B0:case k0:case T0:case I0:case P0:case O0:case N0:case R0:case D0:return ll(i,e);case w0:return new n;case C0:case v0:return new n(i);case A0:return p0(i);case x0:return new n;case E0:return m0(i)}}function cl(i){return typeof i.constructor=="function"&&!zi(i)?Og(eo(i)):{}}var Q0="[object Map]";function V0(i){return ie(i)&&Wt(i)==Q0}var hl=an&&an.isMap,z0=hl?Fi(hl):V0,F0="[object Set]";function U0(i){return ie(i)&&Wt(i)==F0}var ul=an&&an.isSet,K0=ul?Fi(ul):U0,J0=1,j0=2,G0=4,dl="[object Arguments]",Y0="[object Array]",H0="[object Boolean]",_0="[object Date]",W0="[object Error]",gl="[object Function]",q0="[object GeneratorFunction]",X0="[object Map]",$0="[object Number]",fl="[object Object]",Z0="[object RegExp]",t1="[object Set]",e1="[object String]",n1="[object Symbol]",i1="[object WeakMap]",s1="[object ArrayBuffer]",o1="[object DataView]",r1="[object Float32Array]",a1="[object Float64Array]",l1="[object Int8Array]",c1="[object Int16Array]",h1="[object Int32Array]",u1="[object Uint8Array]",d1="[object Uint8ClampedArray]",g1="[object Uint16Array]",f1="[object Uint32Array]",at={};at[dl]=at[Y0]=at[s1]=at[o1]=at[H0]=at[_0]=at[r1]=at[a1]=at[l1]=at[c1]=at[h1]=at[X0]=at[$0]=at[fl]=at[Z0]=at[t1]=at[e1]=at[n1]=at[u1]=at[d1]=at[g1]=at[f1]=!0,at[W0]=at[gl]=at[i1]=!1;function Yn(i,t,e,n,s,o){var r,a=t&J0,l=t&j0,c=t&G0;if(r!==void 0)return r;if(!bt(i))return i;var h=Pt(i);if(h){if(r=d0(i),!a)return ea(i,r)}else{var u=Wt(i),g=u==gl||u==q0;if(rn(i))return qa(i,a);if(u==fl||u==dl||g&&!s){if(r=l||g?{}:cl(i),!a)return l?n0(i,Wm(r,i)):t0(i,_m(r,i))}else{if(!at[u])return s?i:{};r=L0(i,u,a)}}o||(o=new oe);var f=o.get(i);if(f)return f;o.set(i,r),K0(i)?i.forEach(function(b){r.add(Yn(b,t,e,b,i,o))}):z0(i)&&i.forEach(function(b,y){r.set(y,Yn(b,t,e,y,i,o))});var p=c?l?i0:oo:l?ln:Un,m=h?void 0:p(i);return Fg(m||i,function(b,y){m&&(y=b,b=i[y]),Ws(r,y,Yn(b,t,e,y,i,o))}),r}var p1=4;function co(i){return Yn(i,p1)}var m1=1,b1=4;function dt(i){return Yn(i,m1|b1)}var y1="__lodash_hash_undefined__";function w1(i){return this.__data__.set(i,y1),this}function C1(i){return this.__data__.has(i)}function dn(i){var t=-1,e=i==null?0:i.length;for(this.__data__=new we;++t<e;)this.add(i[t])}dn.prototype.add=dn.prototype.push=w1,dn.prototype.has=C1;function A1(i,t){for(var e=-1,n=i==null?0:i.length;++e<n;)if(t(i[e],e,i))return!0;return!1}function ho(i,t){return i.has(t)}var x1=1,v1=2;function pl(i,t,e,n,s,o){var r=e&x1,a=i.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=o.get(i),h=o.get(t);if(c&&h)return c==t&&h==i;var u=-1,g=!0,f=e&v1?new dn:void 0;for(o.set(i,t),o.set(t,i);++u<a;){var p=i[u],m=t[u];if(n)var b=r?n(m,p,u,t,i,o):n(p,m,u,i,t,o);if(b!==void 0){if(b)continue;g=!1;break}if(f){if(!A1(t,function(y,C){if(!ho(f,C)&&(p===y||s(p,y,e,n,o)))return f.push(C)})){g=!1;break}}else if(!(p===m||s(p,m,e,n,o))){g=!1;break}}return o.delete(i),o.delete(t),g}function E1(i){var t=-1,e=Array(i.size);return i.forEach(function(n,s){e[++t]=[s,n]}),e}function uo(i){var t=-1,e=Array(i.size);return i.forEach(function(n){e[++t]=n}),e}var S1=1,M1=2,B1="[object Boolean]",k1="[object Date]",T1="[object Error]",I1="[object Map]",P1="[object Number]",O1="[object RegExp]",N1="[object Set]",R1="[object String]",D1="[object Symbol]",L1="[object ArrayBuffer]",Q1="[object DataView]",ml=_t?_t.prototype:void 0,go=ml?ml.valueOf:void 0;function V1(i,t,e,n,s,o,r){switch(e){case Q1:if(i.byteLength!=t.byteLength||i.byteOffset!=t.byteOffset)return!1;i=i.buffer,t=t.buffer;case L1:return!(i.byteLength!=t.byteLength||!o(new _i(i),new _i(t)));case B1:case k1:case P1:return nn(+i,+t);case T1:return i.name==t.name&&i.message==t.message;case O1:case R1:return i==t+"";case I1:var a=E1;case N1:var l=n&S1;if(a||(a=uo),i.size!=t.size&&!l)return!1;var c=r.get(i);if(c)return c==t;n|=M1,r.set(i,t);var h=pl(a(i),a(t),n,s,o,r);return r.delete(i),h;case D1:if(go)return go.call(i)==go.call(t)}return!1}var z1=1,F1=Object.prototype,U1=F1.hasOwnProperty;function K1(i,t,e,n,s,o){var r=e&z1,a=oo(i),l=a.length,c=oo(t),h=c.length;if(l!=h&&!r)return!1;for(var u=l;u--;){var g=a[u];if(!(r?g in t:U1.call(t,g)))return!1}var f=o.get(i),p=o.get(t);if(f&&p)return f==t&&p==i;var m=!0;o.set(i,t),o.set(t,i);for(var b=r;++u<l;){g=a[u];var y=i[g],C=t[g];if(n)var w=r?n(C,y,g,t,i,o):n(y,C,g,i,t,o);if(!(w===void 0?y===C||s(y,C,e,n,o):w)){m=!1;break}b||(b=g=="constructor")}if(m&&!b){var x=i.constructor,E=t.constructor;x!=E&&"constructor"in i&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof E=="function"&&E instanceof E)&&(m=!1)}return o.delete(i),o.delete(t),m}var J1=1,bl="[object Arguments]",yl="[object Array]",Wi="[object Object]",j1=Object.prototype,wl=j1.hasOwnProperty;function G1(i,t,e,n,s,o){var r=Pt(i),a=Pt(t),l=r?yl:Wt(i),c=a?yl:Wt(t);l=l==bl?Wi:l,c=c==bl?Wi:c;var h=l==Wi,u=c==Wi,g=l==c;if(g&&rn(i)){if(!rn(t))return!1;r=!0,h=!1}if(g&&!h)return o||(o=new oe),r||Ui(i)?pl(i,t,e,n,s,o):V1(i,t,l,e,n,s,o);if(!(e&J1)){var f=h&&wl.call(i,"__wrapped__"),p=u&&wl.call(t,"__wrapped__");if(f||p){var m=f?i.value():i,b=p?t.value():t;return o||(o=new oe),s(m,b,e,n,o)}}return g?(o||(o=new oe),K1(i,t,e,n,s,o)):!1}function qi(i,t,e,n,s){return i===t?!0:i==null||t==null||!ie(i)&&!ie(t)?i!==i&&t!==t:G1(i,t,e,n,qi,s)}var Y1=1,H1=2;function _1(i,t,e,n){var s=e.length,o=s;if(i==null)return!o;for(i=Object(i);s--;){var r=e[s];if(r[2]?r[1]!==i[r[0]]:!(r[0]in i))return!1}for(;++s<o;){r=e[s];var a=r[0],l=i[a],c=r[1];if(r[2]){if(l===void 0&&!(a in i))return!1}else{var h=new oe,u;if(!(u===void 0?qi(c,l,Y1|H1,n,h):u))return!1}}return!0}function Cl(i){return i===i&&!bt(i)}function W1(i){for(var t=Un(i),e=t.length;e--;){var n=t[e],s=i[n];t[e]=[n,s,Cl(s)]}return t}function Al(i,t){return function(e){return e==null?!1:e[i]===t&&(t!==void 0||i in Object(e))}}function q1(i){var t=W1(i);return t.length==1&&t[0][2]?Al(t[0][0],t[0][1]):function(e){return e===i||_1(e,i,t)}}function X1(i,t){return i!=null&&t in Object(i)}function xl(i,t,e){t=ji(t,i);for(var n=-1,s=t.length,o=!1;++n<s;){var r=jn(t[n]);if(!(o=i!=null&&e(i,r)))break;i=i[r]}return o||++n!=s?o:(s=i==null?0:i.length,!!s&&qs(s)&&Li(r,s)&&(Pt(i)||on(i)))}function vl(i,t){return i!=null&&xl(i,t,X1)}var $1=1,Z1=2;function tb(i,t){return $s(i)&&Cl(t)?Al(jn(i),t):function(e){var n=yp(e,i);return n===void 0&&n===t?vl(e,i):qi(t,n,$1|Z1)}}function eb(i){return function(t){return t==null?void 0:t[i]}}function nb(i){return function(t){return Gi(t,i)}}function ib(i){return $s(i)?eb(jn(i)):nb(i)}function fo(i){return typeof i=="function"?i:i==null?en:typeof i=="object"?Pt(i)?tb(i[0],i[1]):q1(i):ib(i)}function sb(i,t,e,n){for(var s=-1,o=i==null?0:i.length;++s<o;){var r=i[s];t(n,r,e(r),i)}return n}function ob(i){return function(t,e,n){for(var s=-1,o=Object(t),r=n(t),a=r.length;a--;){var l=r[++s];if(e(o[l],l,o)===!1)break}return t}}var El=ob();function rb(i,t){return i&&El(i,t,Un)}function ab(i,t){return function(e,n){if(e==null)return e;if(!je(e))return i(e,n);for(var s=e.length,o=-1,r=Object(e);++o<s&&n(r[o],o,r)!==!1;);return e}}var Sl=ab(rb);function lb(i,t,e,n){return Sl(i,function(s,o,r){t(n,s,e(s),r)}),n}function cb(i,t){return function(e,n){var s=Pt(e)?sb:lb,o=t?t():{};return s(e,i,fo(n),o)}}var po=function(){return ne.Date.now()},hb="Expected a function",ub=Math.max,db=Math.min;function Xi(i,t,e){var n,s,o,r,a,l,c=0,h=!1,u=!1,g=!0;if(typeof i!="function")throw new TypeError(hb);t=Vn(t)||0,bt(e)&&(h=!!e.leading,u="maxWait"in e,o=u?ub(Vn(e.maxWait)||0,t):o,g="trailing"in e?!!e.trailing:g);function f(S){var v=n,M=s;return n=s=void 0,c=S,r=i.apply(M,v),r}function p(S){return c=S,a=setTimeout(y,t),h?f(S):r}function m(S){var v=S-l,M=S-c,k=t-v;return u?db(k,o-M):k}function b(S){var v=S-l,M=S-c;return l===void 0||v>=t||v<0||u&&M>=o}function y(){var S=po();if(b(S))return C(S);a=setTimeout(y,m(S))}function C(S){return a=void 0,g&&n?f(S):(n=s=void 0,r)}function w(){a!==void 0&&clearTimeout(a),c=0,n=l=s=a=void 0}function x(){return a===void 0?r:C(po())}function E(){var S=po(),v=b(S);if(n=arguments,s=this,l=S,v){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(y,t),f(l)}return a===void 0&&(a=setTimeout(y,t)),r}return E.cancel=w,E.flush=x,E}var Ml=Object.prototype,gb=Ml.hasOwnProperty,fb=sn(function(i,t){i=Object(i);var e=-1,n=t.length,s=n>2?t[2]:void 0;for(s&&Vi(t[0],t[1],s)&&(n=1);++e<n;)for(var o=t[e],r=ln(o),a=-1,l=r.length;++a<l;){var c=r[a],h=i[c];(h===void 0||nn(h,Ml[c])&&!gb.call(i,c))&&(i[c]=o[c])}return i});function mo(i,t,e){(e!==void 0&&!nn(i[t],e)||e===void 0&&!(t in i))&&Qi(i,t,e)}function $i(i){return ie(i)&&je(i)}function bo(i,t){if(!(t==="constructor"&&typeof i[t]=="function")&&t!="__proto__")return i[t]}function pb(i){return zn(i,ln(i))}function mb(i,t,e,n,s,o,r){var a=bo(i,e),l=bo(t,e),c=r.get(l);if(c){mo(i,e,c);return}var h=o?o(a,l,e+"",i,t,r):void 0,u=h===void 0;if(u){var g=Pt(l),f=!g&&rn(l),p=!g&&!f&&Ui(l);h=l,g||f||p?Pt(a)?h=a:$i(a)?h=ea(a):f?(u=!1,h=qa(l,!0)):p?(u=!1,h=ll(l,!0)):h=[]:se(l)||on(l)?(h=a,on(a)?h=pb(a):(!bt(a)||Ys(a))&&(h=cl(l))):u=!1}u&&(r.set(l,h),s(h,l,n,o,r),r.delete(l)),mo(i,e,h)}function Zi(i,t,e,n,s){i!==t&&El(t,function(o,r){if(s||(s=new oe),bt(o))mb(i,t,r,e,Zi,n,s);else{var a=n?n(bo(i,r),o,r+"",i,t,s):void 0;a===void 0&&(a=o),mo(i,r,a)}},ln)}function Bl(i,t,e,n,s,o){return bt(i)&&bt(t)&&(o.set(t,i),Zi(i,t,void 0,Bl,o),o.delete(t)),i}var bb=ra(function(i,t,e,n){Zi(i,t,e,n)}),kl=sn(function(i){return i.push(void 0,Bl),ta(bb,void 0,i)}),yb=200;function wb(i,t,e,n){var s=-1,o=ia,r=!0,a=i.length,l=[],c=t.length;if(!a)return l;t.length>=yb&&(o=ho,r=!1,t=new dn(t));t:for(;++s<a;){var h=i[s],u=h;if(h=h!==0?h:0,r&&u===u){for(var g=c;g--;)if(t[g]===u)continue t;l.push(h)}else o(t,u,n)||l.push(h)}return l}var Cb=sn(function(i,t){return $i(i)?wb(i,Yi(t,1,$i,!0)):[]});function Ab(i,t){var e=-1,n=je(i)?Array(i.length):[];return Sl(i,function(s,o,r){n[++e]=t(s,o,r)}),n}var xb=Object.prototype,vb=xb.hasOwnProperty,Tl=cb(function(i,t,e){vb.call(i,e)?i[e].push(t):Qi(i,e,[t])});function Eb(i,t){return i>t}var Sb=Object.prototype,Mb=Sb.hasOwnProperty;function Bb(i,t){return i!=null&&Mb.call(i,t)}function ts(i,t){return i!=null&&xl(i,t,Bb)}var kb="[object Map]",Tb="[object Set]",Ib=Object.prototype,Pb=Ib.hasOwnProperty;function yo(i){if(i==null)return!0;if(je(i)&&(Pt(i)||typeof i=="string"||typeof i.splice=="function"||rn(i)||Ui(i)||on(i)))return!i.length;var t=Wt(i);if(t==kb||t==Tb)return!i.size;if(zi(i))return!ma(i).length;for(var e in i)if(Pb.call(i,e))return!1;return!0}function Ce(i,t){return qi(i,t)}var Ob="[object Number]";function Ae(i){return typeof i=="number"||ie(i)&&ke(i)==Ob}var Nb=Ma("toLowerCase");function Rb(i,t,e){for(var n=-1,s=i.length;++n<s;){var o=i[n],r=t(o);if(r!=null&&(a===void 0?r===r&&!ue(r):e(r,a)))var a=r,l=o}return l}function Db(i){return i&&i.length?Rb(i,en,Eb):void 0}var ft=ra(function(i,t,e){Zi(i,t,e)});function Lb(i,t,e,n){if(!bt(i))return i;t=ji(t,i);for(var s=-1,o=t.length,r=o-1,a=i;a!=null&&++s<o;){var l=jn(t[s]),c=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return i;if(s!=r){var h=a[l];c=void 0,c===void 0&&(c=bt(h)?h:Li(t[s+1])?[]:{})}Ws(a,l,c),a=a[l]}return i}function Qb(i,t,e){for(var n=-1,s=t.length,o={};++n<s;){var r=t[n],a=Gi(i,r);e(a,r)&&Lb(o,ji(r,i),a)}return o}function Vb(i,t){var e=i.length;for(i.sort(t);e--;)i[e]=i[e].value;return i}function zb(i,t){if(i!==t){var e=i!==void 0,n=i===null,s=i===i,o=ue(i),r=t!==void 0,a=t===null,l=t===t,c=ue(t);if(!a&&!c&&!o&&i>t||o&&r&&l&&!a&&!c||n&&r&&l||!e&&l||!s)return 1;if(!n&&!o&&!c&&i<t||c&&e&&s&&!n&&!o||a&&e&&s||!r&&s||!l)return-1}return 0}function Fb(i,t,e){for(var n=-1,s=i.criteria,o=t.criteria,r=s.length,a=e.length;++n<r;){var l=zb(s[n],o[n]);if(l){if(n>=a)return l;var c=e[n];return l*(c=="desc"?-1:1)}}return i.index-t.index}function Ub(i,t,e){t.length?t=Ri(t,function(o){return Pt(o)?function(r){return Gi(r,o.length===1?o[0]:o)}:o}):t=[en];var n=-1;t=Ri(t,Fi(fo));var s=Ab(i,function(o,r,a){var l=Ri(t,function(c){return c(o)});return{criteria:l,index:++n,value:o}});return Vb(s,function(o,r){return Fb(o,r,e)})}function Kb(i,t){return Qb(i,t,function(e,n){return vl(i,n)})}var Il=Ap(function(i,t){return i==null?{}:Kb(i,t)}),wo=sn(function(i,t){if(i==null)return[];var e=t.length;return e>1&&Vi(i,t[0],t[1])?t=[]:e>2&&Vi(t[0],t[1],t[2])&&(t=[t[0]]),Ub(i,Yi(t),[])}),Jb=4294967295,jb=Jb-1,Gb=Math.floor,Yb=Math.min;function Pl(i,t,e,n){var s=0,o=i==null?0:i.length;if(o===0)return 0;t=e(t);for(var r=t!==t,a=t===null,l=ue(t),c=t===void 0;s<o;){var h=Gb((s+o)/2),u=e(i[h]),g=u!==void 0,f=u===null,p=u===u,m=ue(u);if(r)var b=p;else c?b=p&&g:a?b=p&&g&&!f:l?b=p&&g&&!f&&!m:f||m?b=!1:b=u<t;b?s=h+1:o=h}return Yb(o,jb)}var Hb=4294967295,_b=Hb>>>1;function Wb(i,t,e){var n=0,s=i==null?n:i.length;if(typeof t=="number"&&t===t&&s<=_b){for(;n<s;){var o=n+s>>>1,r=i[o];r!==null&&!ue(r)&&r<t?n=o+1:s=o}return s}return Pl(i,t,en)}function qb(i,t){return Wb(i,t)}function Xb(i,t,e){return Pl(i,t,fo(e))}var $b=ja(function(i,t,e){return i+(e?" ":"")+Hi(t)}),Zb="Expected a function";function ty(i,t,e){var n=!0,s=!0;if(typeof i!="function")throw new TypeError(Zb);return bt(e)&&(n="leading"in e?!0:n,s="trailing"in e?!!e.trailing:s),Xi(i,t,{leading:n,maxWait:t,trailing:s})}var ey=1/0,ny=un&&1/uo(new un([,-0]))[1]==ey?function(i){return new un(i)}:Ng,iy=200;function Ol(i,t,e){var n=-1,s=ia,o=i.length,r=!0,a=[],l=a;if(o>=iy){var c=ny(i);if(c)return uo(c);r=!1,s=ho,l=new dn}else l=a;t:for(;++n<o;){var h=i[n],u=h;if(h=h!==0?h:0,r&&u===u){for(var g=l.length;g--;)if(l[g]===u)continue t;a.push(h)}else s(l,u,e)||(l!==a&&l.push(u),a.push(h))}return a}var Nl=sn(function(i){return Ol(Yi(i,1,$i,!0))});function Rl(i){return i&&i.length?Ol(i):[]}var sy=0;function oy(i){var t=++sy;return cn(i)+t}function xe(i){return typeof i=="string"&&i.slice(-1)==="%"}function Yt(i,t){if(i==null)return 0;let e;if(typeof i=="string"){if(e=parseFloat(i),xe(i)&&(e/=100,Number.isFinite(e)))return e*t}else e=i;return Number.isFinite(e)?e>0&&e<1?e*t:e:0}function re(i){if(typeof i=="object"){let e=0,n=0,s=0,o=0;return i.vertical!=null&&Number.isFinite(i.vertical)&&(n=o=i.vertical),i.horizontal!=null&&Number.isFinite(i.horizontal)&&(s=e=i.horizontal),i.left!=null&&Number.isFinite(i.left)&&(e=i.left),i.top!=null&&Number.isFinite(i.top)&&(n=i.top),i.right!=null&&Number.isFinite(i.right)&&(s=i.right),i.bottom!=null&&Number.isFinite(i.bottom)&&(o=i.bottom),{top:n,right:s,bottom:o,left:e}}let t=0;return i!=null&&Number.isFinite(i)&&(t=i),{top:t,right:t,bottom:t,left:t}}let Dl=!1,Ll=!1,Ql=!1,ry=!1,Vl=!1;if(typeof navigator=="object"){const i=navigator.userAgent;i.indexOf("Macintosh")>=0,i.match(/(iPad|iPhone|iPod)/g),i.indexOf("Windows")>=0,Dl=i.indexOf("MSIE")>=0,i.match(/Trident\/7\./),Ll=!!i.match(/Edge\//),i.indexOf("Mozilla/")>=0&&i.indexOf("MSIE")<0&&i.indexOf("Edge/")<0,i.indexOf("Chrome/")>=0&&i.indexOf("Edge/")<0,i.indexOf("Opera/")>=0||i.indexOf("OPR/")>=0,i.indexOf("Firefox/")>=0,Ql=i.indexOf("AppleWebKit/")>=0&&i.indexOf("Chrome/")<0&&i.indexOf("Edge/")<0,typeof document=="object"&&(Vl=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||i.indexOf("Opera/")>=0)}if(typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,typeof document=="object")try{const i=Object.defineProperty({},"passive",{get(){ry=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},i)}catch{}const zl=Dl,Fl=Ll,ay=Ql,ly=!Vl;function cy(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}function Ul(){return cy()==="apply"}const hy={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function uy(i){const t=document.createElement(hy[i]||"div"),e=`on${i}`;let n=e in t;return n||(t.setAttribute(e,"return;"),n=typeof t[e]=="function"),n}const Hn=[];function Te(i,t){const e=Hn.find(n=>n.name===i);if(!(e&&(e.loadTimes+=1,e.loadTimes>1))&&!Ul()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=t;const s=document.querySelector("head");s&&s.insertBefore(n,s.firstChild),Hn.push({name:i,loadTimes:1,styleElement:n})}}function Ie(i){const t=Hn.findIndex(e=>e.name===i);if(t>-1){const e=Hn[t];if(e.loadTimes-=1,e.loadTimes>0)return;let n=e.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Hn.splice(t,1)}}function dy(i){const t=i.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return t&&t[2]?t[2].replace(/\s+/," ").split(" "):null}function Kl(i){const t=parseFloat(i);return Number.isNaN(t)?null:t}function gy(i){const t="data:";return i.substr(0,t.length)===t}function fy(i,t){if(!i||gy(i)){setTimeout(()=>t(null,i));return}const e=()=>{t(new Error(`Failed to load image: ${i}`))},n=window.FileReader?o=>{if(o.status===200){const r=new FileReader;r.onload=a=>{const l=a.target.result;t(null,l)},r.onerror=e,r.readAsDataURL(o.response)}else e()}:o=>{const r=a=>{const c=[];for(let h=0;h<a.length;h+=32768)c.push(String.fromCharCode.apply(null,a.subarray(h,h+32768)));return c.join("")};if(o.status===200){let a=i.split(".").pop()||"png";a==="svg"&&(a="svg+xml");const l=`data:image/${a};base64,`,c=new Uint8Array(o.response),h=l+btoa(r(c));t(null,h)}else e()},s=new XMLHttpRequest;s.responseType=window.FileReader?"blob":"arraybuffer",s.open("GET",i,!0),s.addEventListener("error",e),s.addEventListener("load",()=>n(s)),s.send()}function py(i){let t=i.replace(/\s/g,"");t=decodeURIComponent(t);const e=t.indexOf(","),n=t.slice(0,e),s=n.split(":")[1].split(";")[0],o=t.slice(e+1);let r;n.indexOf("base64")>=0?r=atob(o):r=unescape(encodeURIComponent(o));const a=new Uint8Array(r.length);for(let l=0;l<r.length;l+=1)a[l]=r.charCodeAt(l);return new Blob([a],{type:s})}function my(i,t){const e=window.navigator.msSaveBlob;if(e)e(i,t);else{const n=window.URL.createObjectURL(i),s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(n)}}function Co(i,t){const e=py(i);my(e,t)}function by(i,t={}){let e=null;const n=h=>(e==null&&(e=dy(i)),e!=null?Kl(e[h]):null),s=h=>{const u=i.match(h);return u&&u[2]?Kl(u[2]):null};let o=t.width;if(o==null&&(o=s(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),o==null&&(o=n(2)),o==null)throw new Error("Can not parse width from svg string");let r=t.height;if(r==null&&(r=s(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),r==null&&(r=n(3)),r==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(i).replace(/'/g,"%27").replace(/"/g,"%22")}`}function yy(i){return typeof i=="object"&&i.then&&typeof i.then=="function"}function Ao(i){return i!=null&&(i instanceof Promise||yy(i))}function xo(...i){const t=[];if(i.forEach(n=>{Array.isArray(n)?t.push(...n):t.push(n)}),t.some(n=>Ao(n))){const n=t.map(s=>Ao(s)?s:Promise.resolve(s!==!1));return Promise.all(n).then(s=>s.reduce((o,r)=>r!==!1&&o,!0))}return t.every(n=>n!==!1)}function wy(...i){const t=xo(i);return typeof t=="boolean"?Promise.resolve(t):t}function Jl(i,t,e){if(e)switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2]);case 4:return i.call(t,e[0],e[1],e[2],e[3]);case 5:return i.call(t,e[0],e[1],e[2],e[3],e[4]);case 6:return i.call(t,e[0],e[1],e[2],e[3],e[4],e[5]);default:return i.apply(t,e)}return i.call(t)}function F(i,t,...e){return Jl(i,t,e)}function jl(i){return 180*i/Math.PI%360}const Dt=function(i,t=!1){return(t?i:i%360)*Math.PI/180};function Vt(i){return i%360+(i<0?360:0)}function He(i,t=0){return Number.isInteger(i)?i:+i.toFixed(t)}function Gl(i,t){let e,n;if(t==null?(n=i??1,e=0):(n=t,e=i??0),n<e){const s=e;e=n,n=s}return Math.floor(Math.random()*(n-e+1)+e)}function gn(i,t,e){return Number.isNaN(i)?NaN:Number.isNaN(t)||Number.isNaN(e)?0:i<t?t:i>e?e:i}function ae(i,t){return t*Math.round(i/t)}function Yl(i,t){return t!=null&&i!=null&&t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height}function Hl(i,t){const e=i.x-t.x,n=i.y-t.y;return e*e+n*n}class Pe{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class A extends Pe{static create(t,e){return t==null||typeof t=="number"?new A(t,e):A.clone(t)}static clone(t){return A.isPoint(t)?new A(t.x,t.y):Array.isArray(t)?new A(t[0],t[1]):new A(t.x,t.y)}static equals(t,e){return t===e?!0:t!=null&&e!=null?t.x===e.x&&t.y===e.y:!1}static rotateEx(t,e,n,s=new A){const o=A.clone(t),r=A.clone(s),a=o.x-r.x,l=o.y-r.y,c=a*e-l*n,h=l*e+a*n;return new A(c+r.x,h+r.y)}static toJSON(t){return A.isPoint(t)?{x:t.x,y:t.y}:Array.isArray(t)?{x:t[0],y:t[1]}:{x:t.x,y:t.y}}static fromPolar(t,e,n=new A){let s=Math.abs(t*Math.cos(e)),o=Math.abs(t*Math.sin(e));const r=A.clone(n),a=Vt(jl(e));return a<90?o=-o:a<180?(s=-s,o=-o):a<270&&(s=-s),new A(r.x+s,r.y+o)}static toPolar(t,e=new A){const n=A.clone(t),s=A.clone(e),o=n.x-s.x,r=n.y-s.y;return new A(Math.sqrt(o*o+r*r),Dt(s.theta(n)))}static equalPoints(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!==e.length)return!1;if(t!=null&&e!=null){for(let n=0,s=t.length;n<s;n+=1)if(!A.equals(t[n],e[n]))return!1}return!0}static random(t,e,n,s){return new A(Gl(t,e),Gl(n,s))}static rotate(t,e,n){const s=Dt(Vt(-e)),o=Math.sin(s),r=Math.cos(s);return A.rotateEx(t,r,o,n)}static isPoint(t){return t!=null&&t instanceof A}static isPointLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"}static isPointData(t){return t!=null&&Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}constructor(t,e){super(),this.x=t??0,this.y=e??0}round(t=0){return this.x=He(this.x,t),this.y=He(this.y,t),this}add(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=A.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=A.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new A){const s=A.create(n);return this.x=s.x+t*(this.x-s.x),this.y=s.y+e*(this.y-s.y),this}closest(t){if(t.length===1)return A.create(t[0]);let e=null,n=1/0;return t.forEach(s=>{const o=this.squaredDistance(s);o<n&&(e=s,n=o)}),e?A.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=A.create(t),n=this.x-e.x,s=this.y-e.y;return n*n+s*s}manhattanDistance(t){const e=A.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new A){const e=A.create(t),n=-(e.y-this.y),s=e.x-this.x;let o=Math.atan2(n,s);return o<0&&(o=2*Math.PI+o),180*o/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){return new A(0,0).angleBetween(this,t)}toPolar(t){return this.update(A.toPolar(this,t)),this}changeInAngle(t,e,n=new A){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return Yl(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}bearing(t){const e=A.create(t),n=Dt(this.y),s=Dt(e.y),o=this.x,r=e.x,a=Dt(r-o),l=Math.sin(a)*Math.cos(s),c=Math.cos(n)*Math.sin(s)-Math.sin(n)*Math.cos(s)*Math.cos(a),h=jl(Math.atan2(l,c)),u=["NE","E","SE","S","SW","W","NW","N"];let g=h-22.5;return g<0&&(g+=360),g=parseInt(g/45,10),u[g]}cross(t,e){if(t!=null&&e!=null){const n=A.create(t),s=A.create(e);return(s.x-this.x)*(n.y-this.y)-(s.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=A.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if(typeof t=="number")return new A(this.x-t,this.y-e);const n=A.create(t);return new A(this.x-n.x,this.y-n.y)}lerp(t,e){const n=A.create(t);return new A((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=A.create(t),s=Dt(n.theta(this));return this.translate(Math.cos(s)*e,-Math.sin(s)*e)}reflection(t){return A.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=ae(this.x,t),this.y=ae(this.y,e??t),this}equals(t){const e=A.create(t);return e!=null&&e.x===this.x&&e.y===this.y}clone(){return A.clone(this)}toJSON(){return A.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}class P extends Pe{static isRectangle(t){return t!=null&&t instanceof P}static isRectangleLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}static create(t,e,n,s){return t==null||typeof t=="number"?new P(t,e,n,s):P.clone(t)}static clone(t){return P.isRectangle(t)?t.clone():Array.isArray(t)?new P(t[0],t[1],t[2],t[3]):new P(t.x,t.y,t.width,t.height)}static fromEllipse(t){return new P(t.x-t.a,t.y-t.b,2*t.a,2*t.b)}static fromSize(t){return new P(0,0,t.width,t.height)}static fromPositionAndSize(t,e){return new P(t.x,t.y,e.width,e.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new A(this.x,this.y)}get topLeft(){return new A(this.x,this.y)}get topCenter(){return new A(this.x+this.width/2,this.y)}get topRight(){return new A(this.x+this.width,this.y)}get center(){return new A(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new A(this.x,this.y+this.height)}get bottomCenter(){return new A(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new A(this.x+this.width,this.y+this.height)}get corner(){return new A(this.x+this.width,this.y+this.height)}get rightMiddle(){return new A(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new A(this.x,this.y+this.height/2)}get topLine(){return new z(this.topLeft,this.topRight)}get rightLine(){return new z(this.topRight,this.bottomRight)}get bottomLine(){return new z(this.bottomLeft,this.bottomRight)}get leftLine(){return new z(this.topLeft,this.bottomLeft)}constructor(t,e,n,s){super(),this.x=t??0,this.y=e??0,this.width=n??0,this.height=s??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=Dt(t),n=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e)),o=this.width*s+this.height*n,r=this.width*n+this.height*s;return new P(this.x+(this.width-o)/2,this.y+(this.height-r)/2,o,r)}round(t=0){return this.x=He(this.x,t),this.y=He(this.y,t),this.width=He(this.width,t),this.height=He(this.height,t),this}add(t,e,n,s){const o=P.create(t,e,n,s),r=Math.min(this.x,o.x),a=Math.min(this.y,o.y),l=Math.max(this.x+this.width,o.x+o.width),c=Math.max(this.y+this.height,o.y+o.height);return this.x=r,this.y=a,this.width=l-r,this.height=c-a,this}update(t,e,n,s){const o=P.create(t,e,n,s);return this.x=o.x,this.y=o.y,this.width=o.width,this.height=o.height,this}inflate(t,e){const n=t,s=e??t;return this.x-=n,this.y-=s,this.width+=2*n,this.height+=2*s,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),s=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=s.x-n.x,this.height=s.y-n.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new A){const s=this.origin.scale(t,e,n);return this.x=s.x,this.y=s.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(t!==0){const n=Dt(t),s=Math.cos(n),o=Math.sin(n);let r=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();r=A.rotateEx(r,s,o,e),a=A.rotateEx(a,s,o,e),l=A.rotateEx(l,s,o,e),c=A.rotateEx(c,s,o,e);const h=new P(r.x,r.y,0,0);h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),h.add(c.x,c.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=P.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=P.clone(t),s=e.x,o=e.y;let r=1/0,a=1/0,l=1/0,c=1/0,h=1/0,u=1/0,g=1/0,f=1/0;const p=n.topLeft;p.x<s&&(r=(this.x-s)/(p.x-s)),p.y<o&&(h=(this.y-o)/(p.y-o));const m=n.bottomRight;m.x>s&&(a=(this.x+this.width-s)/(m.x-s)),m.y>o&&(u=(this.y+this.height-o)/(m.y-o));const b=n.topRight;b.x>s&&(l=(this.x+this.width-s)/(b.x-s)),b.y<o&&(g=(this.y-o)/(b.y-o));const y=n.bottomLeft;return y.x<s&&(c=(this.x-s)/(y.x-s)),y.y>o&&(f=(this.y+this.height-o)/(y.y-o)),{sx:Math.min(r,a,l,c),sy:Math.min(h,u,g,f)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return Yl(this,A.create(t,e))}containsRect(t,e,n,s){const o=P.create(t,e,n,s),r=this.x,a=this.y,l=this.width,c=this.height,h=o.x,u=o.y,g=o.width,f=o.height;return l===0||c===0||g===0||f===0?!1:h>=r&&u>=a&&h+g<=r+l&&u+f<=a+c}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],s=[];return e.forEach(o=>{const r=t.intersectsWithLine(o);r!==null&&s.indexOf(r.toString())<0&&(n.push(r),s.push(r.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=A.clone(t),s=this.center;let o=null;e!=null&&e!==0&&n.rotate(e,s);const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new z(s,n);for(let l=r.length-1;l>=0;l-=1){const c=r[l].intersectsWithLine(a);if(c!==null){o=c;break}}return o&&e!=null&&e!==0&&o.rotate(-e,s),o}intersectsWithRect(t,e,n,s){const o=P.create(t,e,n,s);if(!this.isIntersectWithRect(o))return null;const r=this.origin,a=this.corner,l=o.origin,c=o.corner,h=Math.max(r.x,l.x),u=Math.max(r.y,l.y);return new P(h,u,Math.min(a.x,c.x)-h,Math.min(a.y,c.y)-u)}isIntersectWithRect(t,e,n,s){const o=P.create(t,e,n,s),r=this.origin,a=this.corner,l=o.origin,c=o.corner;return!(c.x<=r.x||c.y<=r.y||l.x>=a.x||l.y>=a.y)}normalize(){let t=this.x,e=this.y,n=this.width,s=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,s=-this.height),this.x=t,this.y=e,this.width=n,this.height=s,this}union(t){const e=P.clone(t),n=this.origin,s=this.corner,o=e.origin,r=e.corner,a=Math.min(n.x,o.x),l=Math.min(n.y,o.y),c=Math.max(s.x,r.x),h=Math.max(s.y,r.y);return new P(a,l,c-a,h-l)}getNearestSideToPoint(t){const e=A.clone(t),n=e.x-this.x,s=this.x+this.width-e.x,o=e.y-this.y,r=this.y+this.height-e.y;let a=n,l="left";return s<a&&(a=s,l="right"),o<a&&(a=o,l="top"),r<a&&(l="bottom"),l}getNearestPointToPoint(t){const e=A.clone(t);if(this.containsPoint(e)){const n=this.getNearestSideToPoint(e);if(n==="left")return new A(this.x,e.y);if(n==="top")return new A(e.x,this.y);if(n==="right")return new A(this.x+this.width,e.y);if(n==="bottom")return new A(e.x,this.y+this.height)}return e.adhereToRect(this)}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new P(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class z extends Pe{static isLine(t){return t!=null&&t instanceof z}get center(){return new A((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(t,e,n,s){super(),typeof t=="number"&&typeof e=="number"?(this.start=new A(t,e),this.end=new A(n,s)):(this.start=A.create(t),this.end=A.create(e))}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:s}=e,o=n.clone().rotate(270,s),r=s.clone().rotate(90,n);return n.move(r,t),s.move(o,t),e}vector(){return new A(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new A(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),s=Math.max(this.start.y,this.end.y);return new P(t,e,n-t,s-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new z(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let s=!0;t<0&&(s=!1,t=-t);const o=this.length();if(t>=o)return s?n.clone():e.clone();const r=(s?t:o-t)/o;return this.pointAt(r)}divideAt(t){const e=this.pointAt(t);return[new z(this.start,e),new z(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new z(this.start,e),new z(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(e.cross(t,n)!==0)return!1;const s=this.length();return!(new z(e,t).length()>s||new z(t,n).length()>s)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new A(this.end.x-this.start.x,this.end.y-this.start.y),n=new A(t.end.x-t.start.x,t.end.y-t.start.y),s=e.x*n.y-e.y*n.x,o=new A(t.start.x-this.start.x,t.start.y-this.start.y),r=o.x*n.y-o.y*n.x,a=o.x*e.y-o.y*e.x;if(s===0||r*s<0||a*s<0)return null;if(s>0){if(r>s||a>s)return null}else if(r<s||a<s)return null;return new A(this.start.x+r*e.x/s,this.start.y+r*e.y/s)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=A.clone(t),n=this.start,s=this.end;return((s.x-n.x)*(e.y-n.y)-(s.y-n.y)*(e.x-n.x))/this.length()}pointSquaredDistance(t,e){const n=A.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=A.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,s=this.pointAt(t),o=new z(e,n);return o.translate(s.x-e.x,s.y-e.y),o}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,s=this.pointAtLength(t),o=new z(e,n);return o.translate(s.x-e.x,s.y-e.y),o}relativeCcw(t,e){const n=A.create(t,e);let s=n.x-this.start.x,o=n.y-this.start.y;const r=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=s*a-o*r;return l===0&&(l=s*r+o*a,l>0&&(s-=r,o-=a,l=s*r+o*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(t){return t!=null&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new z(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class jt extends Pe{static isEllipse(t){return t!=null&&t instanceof jt}static create(t,e,n,s){return t==null||typeof t=="number"?new jt(t,e,n,s):jt.parse(t)}static parse(t){return jt.isEllipse(t)?t.clone():Array.isArray(t)?new jt(t[0],t[1],t[2],t[3]):new jt(t.x,t.y,t.a,t.b)}static fromRect(t){const e=t.center;return new jt(e.x,e.y,t.width/2,t.height/2)}get center(){return new A(this.x,this.y)}constructor(t,e,n,s){super(),this.x=t??0,this.y=e??0,this.a=n??0,this.b=s??0}bbox(){return P.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,s=e??t;return this.a+=2*n,this.b+=2*s,this}normalizedDistance(t,e){const n=A.create(t,e),s=n.x-this.x,o=n.y-this.y,r=this.a,a=this.b;return s*s/(r*r)+o*o/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,s=this.b,o=t.start,r=t.end,a=t.vector(),l=o.diff(new A(this.x,this.y)),c=new A(a.x/(n*n),a.y/(s*s)),h=new A(l.x/(n*n),l.y/(s*s)),u=a.dot(c),g=a.dot(h),f=l.dot(h)-1,p=g*g-u*f;if(p<0)return null;if(p>0){const m=Math.sqrt(p),b=(-g-m)/u,y=(-g+m)/u;if((b<0||b>1)&&(y<0||y>1))return null;b>=0&&b<=1&&e.push(o.lerp(r,b)),y>=0&&y<=1&&e.push(o.lerp(r,y))}else{const m=-g/u;if(m>=0&&m<=1)e.push(o.lerp(r,m));else return null}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=A.clone(t);e&&n.rotate(e,this.getCenter());const s=n.x-this.x,o=n.y-this.y;let r;if(s===0)return r=this.bbox().getNearestPointToPoint(n),e?r.rotate(-e,this.getCenter()):r;const a=o/s,l=a*a,c=this.a*this.a,h=this.b*this.b;let u=Math.sqrt(1/(1/c+l/h));u=s<0?-u:u;const g=a*u;return r=new A(this.x+u,this.y+g),e?r.rotate(-e,this.getCenter()):r}tangentTheta(t){const e=A.clone(t),n=e.x,s=e.y,o=this.a,r=this.b,a=this.bbox().center,l=a.x,c=a.y,h=30,u=n>a.x+o/2,g=n<a.x-o/2;let f,p;return u||g?(p=n>a.x?s-h:s+h,f=o*o/(n-l)-o*o*(s-c)*(p-c)/(r*r*(n-l))+l):(f=s>a.y?n+h:n-h,p=r*r/(s-c)-r*r*(n-l)*(f-l)/(o*o*(s-c))+c),new A(f,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=P.fromEllipse(this);n.rotate(t,e);const s=jt.fromRect(n);return this.a=s.a,this.b=s.b,this.x=s.x,this.y=s.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new jt(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const Cy=new RegExp("^[\\s\\dLMCZz,.]*$");function Ay(i){return typeof i!="string"?!1:Cy.test(i)}function vo(i,t){return(i%t+t)%t}function xy(i,t,e,n,s){if(!i||i.length===0)return"";const o=[],r=i[i.length-1],a=t!=null&&t>0,l=t||0;if(n&&a){i=i.slice();const u=i[0],g=new A(r.x+(u.x-r.x)/2,r.y+(u.y-r.y)/2);i.splice(0,0,g)}let c=i[0],h=1;for(e?o.push("M",c.x,c.y):o.push("L",c.x,c.y);h<(n?i.length:i.length-1);){let u=i[vo(h,i.length)],g=c.x-u.x,f=c.y-u.y;if(a&&(g!==0||f!==0)&&(s==null||s.indexOf(h-1)<0)){let p=Math.sqrt(g*g+f*f);const m=g*Math.min(l,p/2)/p,b=f*Math.min(l,p/2)/p,y=u.x+m,C=u.y+b;o.push("L",y,C);let w=i[vo(h+1,i.length)];for(;h<i.length-2&&Math.round(w.x-u.x)===0&&Math.round(w.y-u.y)===0;)w=i[vo(h+2,i.length)],h+=1;g=w.x-u.x,f=w.y-u.y,p=Math.max(1,Math.sqrt(g*g+f*f));const x=g*Math.min(l,p/2)/p,E=f*Math.min(l,p/2)/p,S=u.x+x,v=u.y+E;o.push("Q",u.x,u.y,S,v),u=new A(S,v)}else o.push("L",u.x,u.y);c=u,h+=1}return n?o.push("Z"):o.push("L",r.x,r.y),o.map(u=>typeof u=="string"?u:+u.toFixed(3)).join(" ")}function vy(i,t={}){const e=[];return i&&i.length&&i.forEach(n=>{Array.isArray(n)?e.push({x:n[0],y:n[1]}):e.push({x:n.x,y:n.y})}),xy(e,t.round,t.initialMove==null||t.initialMove,t.close,t.exclude)}function _l(i,t,e,n,s=0,o=0,r=0,a,l){if(e===0||n===0)return[];a-=i,l-=t,e=Math.abs(e),n=Math.abs(n);const c=-a/2,h=-l/2,u=Math.cos(s*Math.PI/180),g=Math.sin(s*Math.PI/180),f=u*c+g*h,p=-1*g*c+u*h,m=f*f,b=p*p,y=e*e,C=n*n,w=m/y+b/C;let x;if(w>1)e=Math.sqrt(w)*e,n=Math.sqrt(w)*n,x=0;else{let T=1;o===r&&(T=-1),x=T*Math.sqrt((y*C-y*b-C*m)/(y*b+C*m))}const E=x*e*p/n,S=-1*x*n*f/e,v=u*E-g*S+a/2,M=g*E+u*S+l/2;let k=Math.atan2((p-S)/n,(f-E)/e)-Math.atan2(0,1),I=k>=0?k:2*Math.PI+k;k=Math.atan2((-p-S)/n,(-f-E)/e)-Math.atan2((p-S)/n,(f-E)/e);let O=k>=0?k:2*Math.PI+k;r===0&&O>0?O-=2*Math.PI:r!==0&&O<0&&(O+=2*Math.PI);const D=O*2/Math.PI,K=Math.ceil(D<0?-1*D:D),L=O/K,N=8/3*Math.sin(L/4)*Math.sin(L/4)/Math.sin(L/2),j=u*e,rt=u*n,Ct=g*e,pt=g*n;let ct=Math.cos(I),V=Math.sin(I),tt=-N*(j*V+pt*ct),it=-N*(Ct*V-rt*ct),H=0,st=0;const mt=[];for(let T=0;T<K;T+=1){I+=L,ct=Math.cos(I),V=Math.sin(I),H=j*ct-pt*V+v,st=Ct*ct+rt*V+M;const R=-N*(j*V+pt*ct),X=-N*(Ct*V-rt*ct),_=T*6;mt[_]=Number(tt+i),mt[_+1]=Number(it+t),mt[_+2]=Number(H-R+i),mt[_+3]=Number(st-X+t),mt[_+4]=Number(H+i),mt[_+5]=Number(st+t),tt=H+R,it=st+X}return mt.map(T=>+T.toFixed(2))}class St extends Pe{static isPolyline(t){return t!=null&&t instanceof St}static parse(t){const e=t.trim();if(e==="")return new St;const n=[],s=e.split(/\s*,\s*|\s+/);for(let o=0,r=s.length;o<r;o+=2)n.push({x:+s[o],y:+s[o+1]});return new St(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(t){if(super(),t!=null){if(typeof t=="string")return St.parse(t);this.points=t.map(e=>A.create(e))}else this.points=[]}scale(t,e,n=new A){return this.points.forEach(s=>s.scale(t,e,n)),this}rotate(t,e){return this.points.forEach(n=>n.rotate(t,e)),this}translate(t,e){const n=A.create(t,e);return this.points.forEach(s=>s.translate(n.x,n.y)),this}round(t=0){return this.points.forEach(e=>e.round(t)),this}bbox(){if(this.points.length===0)return new P;let t=1/0,e=-1/0,n=1/0,s=-1/0;const o=this.points;for(let r=0,a=o.length;r<a;r+=1){const l=o[r],c=l.x,h=l.y;c<t&&(t=c),c>e&&(e=c),h<n&&(n=h),h>s&&(s=h)}return new P(t,n,e-t,s-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(n===0||n===1)return 0;let s=0,o=0,r=1/0;for(let a=0,l=n-1;a<l;a+=1){const c=new z(e[a],e[a+1]),h=c.length(),u=c.closestPointNormalizedLength(t),f=c.pointAt(u).squaredDistance(t);f<r&&(r=f,o=s+u*h),s+=h}return o}closestPointNormalizedLength(t){const e=this.length();return e===0?0:this.closestPointLength(t)/e}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(this.points.length===0)return!1;const e=A.clone(t),n=e.x,s=e.y,o=this.points,r=o.length;let a=r-1,l=0;for(let c=0;c<r;c+=1){const h=o[a],u=o[c];if(e.equals(h))return!0;const g=new z(h,u);if(g.containsPoint(t))return!0;if(s<=h.y&&s>u.y||s>h.y&&s<=u.y){const f=h.x-n>u.x-n?h.x-n:u.x-n;if(f>=0){const p=new A(n+f,s),m=new z(t,p);g.intersectsWithLine(m)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(t){const e=[];for(let n=0,s=this.points.length-1;n<s;n+=1){const o=this.points[n],r=this.points[n+1],a=t.intersectsWithLine(new z(o,r));a&&e.push(a)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const n=this.points[t],s=this.points[t+1];if(new z(n,s).isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const s=this.points[e],o=this.points[e+1];t+=s.distance(o)}return t}pointAt(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1||t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const o=this.length()*t;return this.pointAtLength(o)}pointAtLength(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1)return e[0].clone();let s=!0;t<0&&(s=!1,t=-t);let o=0;for(let a=0,l=n-1;a<l;a+=1){const c=s?a:l-1-a,h=e[c],u=e[c+1],g=new z(h,u),f=h.distance(u);if(t<=o+f)return g.pointAtLength((s?1:-1)*(t-o));o+=f}return(s?e[n-1]:e[0]).clone()}tangentAt(t){const n=this.points.length;if(n===0||n===1)return null;t<0&&(t=0),t>1&&(t=1);const o=this.length()*t;return this.tangentAtLength(o)}tangentAtLength(t){const e=this.points,n=e.length;if(n===0||n===1)return null;let s=!0;t<0&&(s=!1,t=-t);let o,r=0;for(let a=0,l=n-1;a<l;a+=1){const c=s?a:l-1-a,h=e[c],u=e[c+1],g=new z(h,u),f=h.distance(u);if(g.isDifferentiable()){if(t<=r+f)return g.tangentAtLength((s?1:-1)*(t-r));o=g}r+=f}if(o){const a=s?1:0;return o.tangentAt(a)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let s=0;for(;e[s+2];){const o=s,r=s+1,a=s+2,l=e[o],c=e[r],h=e[a];new z(l,h).closestPoint(c).distance(c)<=n?e.splice(r,1):s+=1}return this}toHull(){const t=this.points,e=t.length;if(e===0)return new St;let n=t[0];for(let g=1;g<e;g+=1)(t[g].y<n.y||t[g].y===n.y&&t[g].x>n.x)&&(n=t[g]);const s=[];for(let g=0;g<e;g+=1){let f=n.theta(t[g]);f===0&&(f=360),s.push([t[g],g,f])}if(s.sort((g,f)=>{let p=g[2]-f[2];return p===0&&(p=f[1]-g[1]),p}),s.length>2){const g=s[s.length-1];s.unshift(g)}const o={},r=[],a=g=>`${g[0].toString()}@${g[1]}`;for(;s.length!==0;){const g=s.pop(),f=g[0];if(o[a(g)])continue;let p=!1;for(;!p;)if(r.length<2)r.push(g),p=!0;else{const m=r.pop(),b=m[0],y=r.pop(),C=y[0],w=C.cross(b,f);if(w<0)r.push(y),r.push(m),r.push(g),p=!0;else if(w===0){const E=b.angleBetween(C,f);Math.abs(E-180)<1e-10||b.equals(f)||C.equals(b)?(o[a(m)]=b,r.push(y)):Math.abs((E+1)%360-1)<1e-10&&(r.push(y),s.push(m))}else o[a(m)]=b,r.push(y)}}r.length>2&&r.pop();let l,c=-1;for(let g=0,f=r.length;g<f;g+=1){const p=r[g][1];(l===void 0||p<l)&&(l=p,c=g)}let h=[];if(c>0){const g=r.slice(c),f=r.slice(0,c);h=g.concat(f)}else h=r;const u=[];for(let g=0,f=h.length;g<f;g+=1)u.push(h[g][0]);return new St(u)}equals(t){return t==null||t.points.length!==this.points.length?!1:t.points.every((e,n)=>e.equals(this.points[n]))}clone(){return new St(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.serialize()}`).join(" ")}}class wt extends Pe{static isCurve(t){return t!=null&&t instanceof wt}static throughPoints(t){if(t==null||Array.isArray(t)&&t.length<2)throw new Error("At least 2 points are required");const e=Ey(t),n=[];for(let s=0,o=e[0].length;s<o;s+=1){const r=new A(e[0][s].x,e[0][s].y),a=new A(e[1][s].x,e[1][s].y);n.push(new wt(t[s],r,a,t[s+1]))}return n}constructor(t,e,n,s){super(),this.PRECISION=3,this.start=A.create(t),this.controlPoint1=A.create(e),this.controlPoint2=A.create(n),this.end=A.create(s)}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end,o=t.x,r=t.y,a=e.x,l=e.y,c=n.x,h=n.y,u=s.x,g=s.y,f=[],p=[[],[]];let m,b,y,C,w,x,E,S;for(let j=0;j<2;j+=1){if(j===0?(b=6*o-12*a+6*c,m=-3*o+9*a-9*c+3*u,y=3*a-3*o):(b=6*r-12*l+6*h,m=-3*r+9*l-9*h+3*g,y=3*l-3*r),Math.abs(m)<1e-12){if(Math.abs(b)<1e-12)continue;C=-y/b,C>0&&C<1&&f.push(C);continue}E=b*b-4*y*m,S=Math.sqrt(E),!(E<0)&&(w=(-b+S)/(2*m),w>0&&w<1&&f.push(w),x=(-b-S)/(2*m),x>0&&x<1&&f.push(x))}let v,M,k,I=f.length;const O=I;for(;I;)I-=1,C=f[I],k=1-C,v=k*k*k*o+3*k*k*C*a+3*k*C*C*c+C*C*C*u,p[0][I]=v,M=k*k*k*r+3*k*k*C*l+3*k*C*C*h+C*C*C*g,p[1][I]=M;f[O]=0,f[O+1]=1,p[0][O]=o,p[1][O]=r,p[0][O+1]=u,p[1][O+1]=g,f.length=O+2,p[0].length=O+2,p[1].length=O+2;const D=Math.min.apply(null,p[0]),K=Math.min.apply(null,p[1]),L=Math.max.apply(null,p[0]),N=Math.max.apply(null,p[1]);return new P(D,K,L-D,N-K)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),s=this.closestPointLength(t,n);if(!s)return 0;const o=this.length(n);return o===0?0:s/o}closestPointT(t,e={}){const n=this.getPrecision(e),s=this.getDivisions(e),o=Math.pow(10,-n);let r=null,a=0,l=0,c=0,h=0,u=0,g=null;const f=s.length;let p=f>0?1/f:0;for(s.forEach((m,b)=>{const y=m.start.distance(t),C=m.end.distance(t),w=y+C;(g==null||w<g)&&(r=m,a=b*p,l=(b+1)*p,c=y,h=C,g=w,u=m.endpointDistance())});;){const m=c?Math.abs(c-h)/c:0,b=h!=null?Math.abs(c-h)/h:0,y=m<o||b<o,C=c?c<u*o:!0,w=h?h<u*o:!0;if(y||(C||w))return c<=h?a:l;const E=r.divide(.5);p/=2;const S=E[0].start.distance(t),v=E[0].end.distance(t),M=S+v,k=E[1].start.distance(t),I=E[1].end.distance(t),O=k+I;M<=O?(r=E[0],l-=p,c=S,h=v):(r=E[1],a+=p,c=k,h=I)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,s=this.controlPoint2,o=this.end;if(t<=0)return[new wt(e,e,e,e),new wt(e,n,s,o)];if(t>=1)return[new wt(e,n,s,o),new wt(o,o,o,o)];const r=this.getSkeletonPoints(t),a=r.startControlPoint1,l=r.startControlPoint2,c=r.divider,h=r.dividerControlPoint1,u=r.dividerControlPoint2;return[new wt(e,a,l,c),new wt(c,h,u,o)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,s=this.controlPoint2,o=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:s.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:s.clone(),divider:o.clone(),dividerControlPoint1:o.clone(),dividerControlPoint2:o.clone()};const r=new z(e,n).pointAt(t),a=new z(n,s).pointAt(t),l=new z(s,o).pointAt(t),c=new z(r,a).pointAt(t),h=new z(a,l).pointAt(t),u=new z(c,h).pointAt(t);return{startControlPoint1:r,startControlPoint2:c,divider:u,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(e===0)return n;let s=this.endpointDistance();const o=Math.pow(10,-e);let r=0;for(;;){r+=1;const a=[];n.forEach(h=>{const u=h.divide(.5);a.push(u[0],u[1])});const l=a.reduce((h,u)=>h+u.endpointDistance(),0),c=l!==0?(l-s)/l:0;if(r>1&&c<o)return a;n=a,s=l}}length(t={}){return this.getDivisions(t).reduce((n,s)=>n+s.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=e.precision===void 0?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(s))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,s=e.dividerControlPoint1,o=e.divider,r=new z(n,s);return r.translate(o.x-n.x,o.y-n.y),r}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getDivisions(t={}){if(t.subdivisions!=null)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),o=this.length(n)*t;return this.tAtLength(o,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getDivisions(e),r={precision:s,subdivisions:o};let a=null,l,c,h=0,u=0,g=0;const f=o.length;let p=f>0?1/f:0;for(let y=0;y<f;y+=1){const C=n?y:f-1-y,w=o[y],x=w.endpointDistance();if(t<=g+x){a=w,l=C*p,c=(C+1)*p,h=n?t-g:x+g-t,u=n?x+g-t:t-g;break}g+=x}if(a==null)return n?1:0;const m=this.length(r),b=Math.pow(10,-s);for(;;){let y;if(y=m!==0?h/m:0,y<b)return l;if(y=m!==0?u/m:0,y<b)return c;let C,w;const x=a.divide(.5);p/=2;const E=x[0].endpointDistance(),S=x[1].endpointDistance();h<=E?(a=x[0],c-=p,C=h,w=E-C):(a=x[1],l+=p,C=h-E,w=S-C),h=C,u=w}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach(s=>n.push(s.end.clone())),n}toPolyline(t={}){return new St(this.toPoints(t))}scale(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}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(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}equals(t){return t!=null&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}function Wl(i){const t=i.length,e=[],n=[];let s=2;e[0]=i[0]/s;for(let o=1;o<t;o+=1)n[o]=1/s,s=(o<t-1?4:3.5)-n[o],e[o]=(i[o]-e[o-1])/s;for(let o=1;o<t;o+=1)e[t-o-1]-=n[t-o]*e[t-o];return e}function Ey(i){const t=i.map(l=>A.clone(l)),e=[],n=[],s=t.length-1;if(s===1)return e[0]=new A((2*t[0].x+t[1].x)/3,(2*t[0].y+t[1].y)/3),n[0]=new A(2*e[0].x-t[0].x,2*e[0].y-t[0].y),[e,n];const o=[];for(let l=1;l<s-1;l+=1)o[l]=4*t[l].x+2*t[l+1].x;o[0]=t[0].x+2*t[1].x,o[s-1]=(8*t[s-1].x+t[s].x)/2;const r=Wl(o);for(let l=1;l<s-1;l+=1)o[l]=4*t[l].y+2*t[l+1].y;o[0]=t[0].y+2*t[1].y,o[s-1]=(8*t[s-1].y+t[s].y)/2;const a=Wl(o);for(let l=0;l<s;l+=1)e.push(new A(r[l],a[l])),l<s-1?n.push(new A(2*t[l+1].x-r[l+1],2*t[l+1].y-a[l+1])):n.push(new A((t[s].x+r[s-1])/2,(t[s].y+a[s-1])/2));return[e,n]}class es extends Pe{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)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}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class At extends es{static create(...t){const e=t.length,n=t[0];if(z.isLine(n))return new At(n);if(A.isPointLike(n))return e===1?new At(n):t.map(o=>new At(o));if(e===2)return new At(+t[0],+t[1]);const s=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];s.push(new At(r,a))}return s}constructor(t,e){super(),z.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=A.create(t,e).round(2)}get type(){return"L"}get line(){return new z(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new At(e[0]),new At(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new At(e[0]),new At(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new At(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class _n extends es{static create(){return new _n}get end(){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}get type(){return"Z"}get line(){return new z(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new At(e[0]):this.clone(),new At(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new At(e[0]):this.clone(),new At(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new _n}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class de extends es{static create(...t){const e=t.length,n=t[0];if(z.isLine(n))return new de(n);if(wt.isCurve(n))return new de(n);if(A.isPointLike(n)){if(e===1)return new de(n);const o=[];for(let r=0;r<e;r+=1)r===0?o.push(new de(t[r])):o.push(new At(t[r]));return o}if(e===2)return new de(+t[0],+t[1]);const s=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];o===0?s.push(new de(r,a)):s.push(new At(r,a))}return s}constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,z.isLine(t)||wt.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=A.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}clone(){return new de(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class zt extends es{static create(...t){const e=t.length,n=t[0];if(wt.isCurve(n))return new zt(n);if(A.isPointLike(n)){if(e===3)return new zt(t[0],t[1],t[2]);const o=[];for(let r=0;r<e;r+=3)o.push(new zt(t[r],t[r+1],t[r+2]));return o}if(e===6)return new zt(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<e;o+=6)s.push(new zt(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}constructor(t,e,n,s,o,r){super(),wt.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):typeof t=="number"?(this.controlPoint1=new A(t,e).round(2),this.controlPoint2=new A(n,s).round(2),this.endPoint=new A(o,r).round(2)):(this.controlPoint1=A.create(t).round(2),this.controlPoint2=A.create(e).round(2),this.endPoint=A.create(n).round(2))}get type(){return"C"}get curve(){return new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new zt(n[0]),new zt(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new zt(n[0]),new zt(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new zt(e[0]),new zt(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(s))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(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}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new zt(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const 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(" ")}}function ns(i,t,e){return{x:i*Math.cos(e)-t*Math.sin(e),y:i*Math.sin(e)+t*Math.cos(e)}}function ql(i,t,e,n,s,o){const r=.3333333333333333,a=2/3;return[r*i+a*e,r*t+a*n,r*s+a*e,r*o+a*n,s,o]}function Xl(i,t,e,n,s,o,r,a,l,c){const h=Math.PI*120/180,u=Math.PI/180*(+s||0);let g=[],f,p,m,b,y;if(c)p=c[0],m=c[1],b=c[2],y=c[3];else{f=ns(i,t,-u),i=f.x,t=f.y,f=ns(a,l,-u),a=f.x,l=f.y;const L=(i-a)/2,N=(t-l)/2;let j=L*L/(e*e)+N*N/(n*n);j>1&&(j=Math.sqrt(j),e=j*e,n=j*n);const rt=e*e,Ct=n*n,pt=(o===r?-1:1)*Math.sqrt(Math.abs((rt*Ct-rt*N*N-Ct*L*L)/(rt*N*N+Ct*L*L)));b=pt*e*N/n+(i+a)/2,y=pt*-n*L/e+(t+l)/2,p=Math.asin((t-y)/n),m=Math.asin((l-y)/n),p=i<b?Math.PI-p:p,m=a<b?Math.PI-m:m,p<0&&(p=Math.PI*2+p),m<0&&(m=Math.PI*2+m),r&&p>m&&(p-=Math.PI*2),!r&&m>p&&(m-=Math.PI*2)}let C=m-p;if(Math.abs(C)>h){const L=m,N=a,j=l;m=p+h*(r&&m>p?1:-1),a=b+e*Math.cos(m),l=y+n*Math.sin(m),g=Xl(a,l,e,n,s,0,r,N,j,[m,L,b,y])}C=m-p;const w=Math.cos(p),x=Math.sin(p),E=Math.cos(m),S=Math.sin(m),v=Math.tan(C/4),M=4/3*(e*v),k=4/3*(n*v),I=[i,t],O=[i+M*x,t-k*w],D=[a+M*S,l-k*E],K=[a,l];if(O[0]=2*I[0]-O[0],O[1]=2*I[1]-O[1],c)return[O,D,K].concat(g);{g=[O,D,K].concat(g).join().split(",");const L=[],N=g.length;for(let j=0;j<N;j+=1)L[j]=j%2?ns(+g[j-1],+g[j],u).y:ns(+g[j],+g[j+1],u).x;return L}}function Sy(i){if(!i)return null;const t=`
|
|
2
|
-
\v\f\r \u2028\u2029`,e=new RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),n=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return i.replace(e,(r,a,l)=>{const c=[];let h=a.toLowerCase();l.replace(n,(g,f)=>(f&&c.push(+f),g)),h==="m"&&c.length>2&&(o.push([a,...c.splice(0,2)]),h="l",a=a==="m"?"l":"L");const u=s[h];for(;c.length>=u&&(o.push([a,...c.splice(0,u)]),!!u););return r}),o}function My(i){const t=Sy(i);if(!t||!t.length)return[["M",0,0]];let e=0,n=0,s=0,o=0;const r=[];for(let a=0,l=t.length;a<l;a+=1){const c=[];r.push(c);const h=t[a],u=h[0];if(u!==u.toUpperCase())switch(c[0]=u.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]+e,c[7]=+h[7]+n;break;case"V":c[1]=+h[1]+n;break;case"H":c[1]=+h[1]+e;break;case"M":s=+h[1]+e,o=+h[2]+n;for(let g=1,f=h.length;g<f;g+=1)c[g]=+h[g]+(g%2?e:n);break;default:for(let g=1,f=h.length;g<f;g+=1)c[g]=+h[g]+(g%2?e:n);break}else for(let g=0,f=h.length;g<f;g+=1)c[g]=h[g];switch(c[0]){case"Z":e=+s,n=+o;break;case"H":e=c[1];break;case"V":n=c[1];break;case"M":s=c[c.length-2],o=c[c.length-1],e=c[c.length-2],n=c[c.length-1];break;default:e=c[c.length-2],n=c[c.length-1];break}}return r}function By(i){const t=My(i),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function n(l,c,h){let u,g;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(Xl.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(u=c.x*2-c.bx,g=c.y*2-c.by):(u=c.x,g=c.y),["C",u,g].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(ql(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(ql(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function s(l,c){if(l[c].length>7){l[c].shift();const h=l[c];for(;h.length;)o[c]="A",c+=1,l.splice(c,0,["C"].concat(h.splice(0,6)));l.splice(c,1),a=t.length}}const o=[];let r="",a=t.length;for(let l=0;l<a;l+=1){let c="";t[l]&&(c=t[l][0]),c!=="C"&&(o[l]=c,l>0&&(r=o[l-1])),t[l]=n(t[l],e,r),o[l]!=="A"&&c==="C"&&(o[l]="C"),s(t,l);const h=t[l],u=h.length;e.x=h[u-2],e.y=h[u-1],e.bx=parseFloat(h[u-4])||e.x,e.by=parseFloat(h[u-3])||e.y}return(!t[0][0]||t[0][0]!=="M")&&t.unshift(["M",0,0]),t}function $l(i){return By(i).map(t=>t.map(e=>typeof e=="string"?e:He(e,2))).join(",").split(",").join(" ")}class J extends Pe{static isPath(t){return t!=null&&t instanceof J}static parse(t){if(!t)return new J;const e=new J,n=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,s=$l(t).match(n);if(s!=null)for(let o=0,r=s.length;o<r;o+=1){const a=s[o],l=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,c=a.match(l);if(c!=null){const h=c[0],u=c.slice(1).map(f=>+f),g=J.createSegment.call(null,h,...u);e.appendSegment(g)}}return e}static createSegment(t,...e){if(t==="M")return de.create.call(null,...e);if(t==="L")return At.create.call(null,...e);if(t==="C")return zt.create.call(null,...e);if(t==="z"||t==="Z")return _n.create();throw new Error(`Invalid path segment type "${t}"`)}constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(z.isLine(t[0])||wt.isCurve(t[0])){let e=null;t.forEach((s,o)=>{o===0&&this.appendSegment(J.createSegment("M",s.start)),e!=null&&!e.end.equals(s.start)&&this.appendSegment(J.createSegment("M",s.start)),z.isLine(s)?this.appendSegment(J.createSegment("L",s.end)):wt.isCurve(s)&&this.appendSegment(J.createSegment("C",s.controlPoint1,s.controlPoint2,s.end)),e=s})}else t.forEach(n=>{n.isSegment&&this.appendSegment(n)});else t!=null&&(z.isLine(t)?(this.appendSegment(J.createSegment("M",t.start)),this.appendSegment(J.createSegment("L",t.end))):wt.isCurve(t)?(this.appendSegment(J.createSegment("M",t.start)),this.appendSegment(J.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):St.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((e,n)=>{const s=n===0?J.createSegment("M",e):J.createSegment("L",e);this.appendSegment(s)}):t.isSegment&&this.appendSegment(t))}get start(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=0;n<e;n+=1){const s=t[n];if(s.isVisible)return s.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=e-1;n>=0;n-=1){const s=t[n];if(s.isVisible)return s.end}return t[e-1].end}moveTo(...t){return this.appendSegment(de.create.call(null,...t))}lineTo(...t){return this.appendSegment(At.create.call(null,...t))}curveTo(...t){return this.appendSegment(zt.create.call(null,...t))}arcTo(t,e,n,s,o,r,a){const l=this.end||new A,c=typeof r=="number"?_l(l.x,l.y,t,e,n,s,o,r,a):_l(l.x,l.y,t,e,n,s,o,r.x,r.y);if(c!=null)for(let h=0,u=c.length;h<u;h+=6)this.curveTo(c[h],c[h+1],c[h+2],c[h+3],c[h+4],c[h+5]);return this}quadTo(t,e,n,s){const o=this.end||new A,r=["M",o.x,o.y];if(typeof t=="number")r.push("Q",t,e,n,s);else{const l=e;r.push("Q",t.x,t.y,l.x,l.y)}const a=J.parse(r.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(_n.create())}drawPoints(t,e={}){const n=vy(t,e),s=J.parse(n);s&&s.segments&&this.appendSegment(s.segments)}bbox(){const t=this.segments,e=t.length;if(e===0)return null;let n;for(let o=0;o<e;o+=1){const r=t[o];if(r.isVisible){const a=r.bbox();a!=null&&(n=n?n.union(a):a)}}if(n!=null)return n;const s=t[e-1];return new P(s.end.x,s.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n=e!==0?this.segments[e-1]:null,s;const o=null;if(Array.isArray(t))for(let r=0,a=t.length;r<a;r+=1){const l=t[r];s=this.prepareSegment(l,n,o),this.segments.push(s),n=s}else t!=null&&t.isSegment&&(s=this.prepareSegment(t,n,o),this.segments.push(s));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let s,o=null,r=null;if(n!==0&&(t>=1?(o=this.segments[t-1],r=o.nextSegment):(o=null,r=this.segments[0])),!Array.isArray(e))s=this.prepareSegment(e,o,r),this.segments.splice(t,0,s);else for(let a=0,l=e.length;a<l;a+=1){const c=e[a];s=this.prepareSegment(c,o,r),this.segments.splice(t+a,0,s),o=s}return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],s=n.previousSegment,o=n.nextSegment;return s&&(s.nextSegment=o),o&&(o.previousSegment=s),n.isSubpathStart&&o&&this.updateSubpathStartSegment(o),n}replaceSegment(t,e){const n=this.fixIndex(t);let s;const o=this.segments[n];let r=o.previousSegment;const a=o.nextSegment;let l=o.isSubpathStart;if(!Array.isArray(e))s=this.prepareSegment(e,r,a),this.segments.splice(n,1,s),l&&s.isSubpathStart&&(l=!1);else{this.segments.splice(t,1);for(let c=0,h=e.length;c<h;c+=1){const u=e[c];s=this.prepareSegment(u,r,a),this.segments.splice(t+c,0,s),r=s,l&&s.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(e===0)throw new Error("Path has no segments.");let n=t;for(;n<0;)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(this.segments.length===0)return null;const n=gn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.segmentIndexAtLength(r,s)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(n===0)return null;let s=!0;t<0&&(s=!1,t=-t);const o=this.getPrecision(e),r=this.getSubdivisions(e);let a=0,l=null;for(let c=0;c<n;c+=1){const h=s?c:n-1-c,u=this.segments[h],g=r[h],f=u.length({precision:o,subdivisions:g});if(u.isVisible){if(t<=a+f)return h;l=h}a+=f}return l}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let s=0,o=this.segments.length;s<o;s+=1){const a=this.segments[s].getSubdivisions({precision:e});n.push(a)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;for(;n&&!n.isSubpathStart;)e!=null?n.subpathStartSegment=e.subpathStartSegment:n.subpathStartSegment=null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,e!=null&&(e.nextSegment=t),n!=null&&(n.previousSegment=t);let s=t;return t.isSubpathStart&&(t.subpathStartSegment=t,s=n),s!=null&&this.updateSubpathStartSegment(s),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),s=this.closestPointT(t,n);return s?this.lengthAtT(s,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),s=this.closestPointLength(t,n);if(s===0)return 0;const o=this.length(n);return o===0?0:s/o}closestPointT(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=s[a];if(c.isVisible){const u=c.closestPointT(t,{precision:n,subdivisions:h}),g=c.pointAtT(u),f=Hl(g,t);f<r&&(o={segmentIndex:a,value:u},r=f)}}return o||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=s[a];if(c.isDifferentiable()){const u=c.closestPointT(t,{precision:n,subdivisions:h}),g=c.pointAtT(u),f=Hl(g,t);f<r&&(o=c.tangentAtT(u),r=f)}}return o||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let s=0;for(let o=0,r=n.length;o<r;o+=1)n[o].containsPoint(t)&&(s+=1);return s%2===1}pointAt(t,e={}){if(this.segments.length===0)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),o=this.length(n)*t;return this.pointAtLength(o,n)}pointAtLength(t,e={}){if(this.segments.length===0)return null;if(t===0)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let c=0,h=this.segments.length;c<h;c+=1){const u=n?c:h-1-c,g=this.segments[u],f=o[u],p=g.length({precision:s,subdivisions:f});if(g.isVisible){if(t<=a+p)return g.pointAtLength((n?1:-1)*(t-a),{precision:s,subdivisions:f});r=g}a+=p}return r?n?r.end:r.start:this.segments[this.segments.length-1].end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(n===0)return null;const s=t.segmentIndex;if(s<0)return e[0].pointAtT(0);if(s>=n)return e[n-1].pointAtT(1);const o=gn(t.value,0,1);return e[s].pointAtT(o)}divideAt(t,e={}){if(this.segments.length===0)return null;const n=gn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.divideAtLength(r,s)}divideAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r=0,a,l,c,h,u;for(let E=0,S=this.segments.length;E<S;E+=1){const v=n?E:S-1-E,M=this.getSegment(v),k=o[v],I={precision:s,subdivisions:k},O=M.length(I);if(M.isDifferentiable()&&(c=M,h=v,t<=r+O)){l=v,a=M.divideAtLength((n?1:-1)*(t-r),I);break}r+=O}if(!c)return null;a||(l=h,u=n?1:0,a=c.divideAtT(u));const g=this.clone(),f=l;g.replaceSegment(f,a);const p=f;let m=f+1,b=f+2;a[0].isDifferentiable()||(g.removeSegment(p),m-=1,b-=1);const y=g.getSegment(m).start;g.insertSegment(m,J.createSegment("M",y)),b+=1,a[1].isDifferentiable()||(g.removeSegment(b-1),b-=1);const C=b-p-1;for(let E=b,S=g.segments.length;E<S;E+=1){const v=this.getSegment(E-C),M=g.getSegment(E);if(M.type==="Z"&&!v.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const k=J.createSegment("L",v.end);g.replaceSegment(E,k)}}const w=new J(g.segments.slice(0,m)),x=new J(g.segments.slice(m));return[w,x]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(n==null)return null;let s=null;for(let o=0,r=n.length;o<r;o+=1){const a=n[o],l=t.intersect(a);l&&(s==null&&(s=[]),Array.isArray(l)?s.push(...l):s.push(l))}return s}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1)if(this.segments[t].isDifferentiable())return!0;return!1}isValid(){const t=this.segments;return t.length===0||t[0].type==="M"}length(t={}){if(this.segments.length===0)return 0;const e=this.getSubdivisions(t);let n=0;for(let s=0,o=this.segments.length;s<o;s+=1){const r=this.segments[s],a=e[s];n+=r.length({subdivisions:a})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(n===0)return 0;let s=t.segmentIndex;if(s<0)return 0;let o=gn(t.value,0,1);s>=n&&(s=n-1,o=1);const r=this.getPrecision(e),a=this.getSubdivisions(e);let l=0;for(let u=0;u<s;u+=1){const g=this.segments[u],f=a[u];l+=g.length({precision:r,subdivisions:f})}const c=this.segments[s],h=a[s];return l+=c.lengthAtT(o,{precision:r,subdivisions:h}),l}tangentAt(t,e={}){if(this.segments.length===0)return null;const n=gn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.tangentAtLength(r,s)}tangentAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const h=n?l:c-1-l,u=this.segments[h],g=o[h],f=u.length({precision:s,subdivisions:g});if(u.isDifferentiable()){if(t<=a+f)return u.tangentAtLength((n?1:-1)*(t-a),{precision:s,subdivisions:g});r=u}a+=f}if(r){const l=n?1:0;return r.tangentAtT(l)}return null}tangentAtT(t){const e=this.segments.length;if(e===0)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const s=gn(t.value,0,1);return this.segments[n].tangentAtT(s)}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getSubdivisions(t={}){if(t.segmentSubdivisions==null){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(n===0)return null;const s=this.getSubdivisions(t),o=[];let r=[];for(let a=0;a<n;a+=1){const l=e[a];if(l.isVisible){const c=s[a];c.length>0?c.forEach(h=>r.push(h.start)):r.push(l.start)}else r.length>0&&(r.push(e[a-1].end),o.push(r),r=[])}return r.length>0&&(r.push(this.end),o.push(r)),o}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(n=>new St(n)):null}scale(t,e,n){return this.segments.forEach(s=>s.scale(t,e,n)),this}rotate(t,e){return this.segments.forEach(n=>n.rotate(t,e)),this}translate(t,e){return typeof t=="number"?this.segments.forEach(n=>n.translate(t,e)):this.segments.forEach(n=>n.translate(t)),this}clone(){const t=new J;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(t==null)return!1;const e=this.segments,n=t.segments,s=e.length;if(n.length!==s)return!1;for(let o=0;o<s;o+=1){const r=e[o],a=n[o];if(r.type!==a.type||!r.equals(a))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}function fn(i,t,e){let n,s;typeof t=="object"?(n=t.x,s=t.y):(n=t,s=e);const o=J.parse(i),r=o.bbox();if(r){let a=-r.height/2-r.y,l=-r.width/2-r.x;typeof n=="number"&&(l-=n),typeof s=="number"&&(a-=s),o.translate(l,a)}return o.serialize()}const Eo=/[\t\r\n\f]/g,So=/\S+/g,pn=i=>` ${i} `;function mn(i){return i&&i.getAttribute&&i.getAttribute("class")||""}function ge(i,t){if(i==null||t==null)return!1;const e=pn(mn(i)),n=pn(t);return i.nodeType===1?e.replace(Eo," ").includes(n):!1}function Q(i,t){if(!(i==null||t==null)){if(typeof t=="function")return Q(i,t(mn(i)));if(typeof t=="string"&&i.nodeType===1){const e=t.match(So)||[],n=pn(mn(i)).replace(Eo," ");let s=e.reduce((o,r)=>o.indexOf(pn(r))<0?`${o}${r} `:o,n);s=s.trim(),n!==s&&i.setAttribute("class",s)}}}function lt(i,t){if(i!=null){if(typeof t=="function")return lt(i,t(mn(i)));if((!t||typeof t=="string")&&i.nodeType===1){const e=(t||"").match(So)||[],n=pn(mn(i)).replace(Eo," ");let s=e.reduce((o,r)=>{const a=pn(r);return o.indexOf(a)>-1?o.replace(a," "):o},n);s=t?s.trim():"",n!==s&&i.setAttribute("class",s)}}}function le(i,t,e){if(!(i==null||t==null)){if(e!=null&&typeof t=="string"){e?Q(i,t):lt(i,t);return}if(typeof t=="function")return le(i,t(mn(i),e),e);typeof t=="string"&&(t.match(So)||[]).forEach(s=>{ge(i,s)?lt(i,s):Q(i,s)})}}let Zl=0;function ky(){return Zl+=1,`v${Zl}`}function Mo(i){return(i.id==null||i.id==="")&&(i.id=ky()),i.id}function Oe(i){return i==null?!1:typeof i.getScreenCTM=="function"&&i instanceof SVGElement}const Mt={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"},tc="1.1";function ec(i,t=document){return t.createElement(i)}function Bo(i,t=Mt.xhtml,e=document){return e.createElementNS(t,i)}function ce(i,t=document){return Bo(i,Mt.svg,t)}function is(i){if(i){const e=`<svg xmlns="${Mt.svg}" xmlns:xlink="${Mt.xlink}" version="${tc}">${i}</svg>`,{documentElement:n}=Ty(e,{async:!1});return n}const t=document.createElementNS(Mt.svg,"svg");return t.setAttributeNS(Mt.xmlns,"xmlns:xlink",Mt.xlink),t.setAttribute("version",tc),t}function Ty(i,t={}){let e;try{const n=new DOMParser;if(t.async!=null){const s=n;s.async=t.async}e=n.parseFromString(i,t.mimeType||"text/xml")}catch{e=void 0}if(!e||e.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${i}`);return e}function Iy(i,t=!0){const e=i.nodeName;return t?e.toLowerCase():e.toUpperCase()}function ko(i){let t=0,e=i.previousSibling;for(;e;)e.nodeType===1&&(t+=1),e=e.previousSibling;return t}function Py(i,t){return i.querySelectorAll(t)}function Oy(i,t){return i.querySelector(t)}function nc(i,t,e){const n=i.ownerSVGElement;let s=i.parentNode;for(;s&&s!==e&&s!==n;){if(ge(s,t))return s;s=s.parentNode}return null}function To(i,t){const e=t&&t.parentNode;return i===e||!!(e&&e.nodeType===1&&i.compareDocumentPosition(e)&16)}function qt(i){i&&(Array.isArray(i)?i:[i]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function Wn(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Ot(i,t){(Array.isArray(t)?t:[t]).forEach(n=>{n!=null&&i.appendChild(n)})}function ic(i,t){const e=i.firstChild;return e?qn(e,t):Ot(i,t)}function qn(i,t){const e=i.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&e.insertBefore(s,i)})}function Ny(i,t){const e=i.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&e.insertBefore(s,i.nextSibling)})}function Xt(i,t){t!=null&&t.appendChild(i)}function Ry(i){return!!i&&i.nodeType===1}function sc(i){try{return i instanceof HTMLElement}catch{return typeof i=="object"&&i.nodeType===1&&typeof i.style=="object"&&typeof i.ownerDocument=="object"}}function Dy(i,t){const e=[];let n=i.firstChild;for(;n;n=n.nextSibling)n.nodeType===1&&(!t||ge(n,t))&&e.push(n);return e}const oc=i=>{const t=Object.create(null);return e=>t[e]||(t[e]=i(e))},rc=oc(i=>i.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Io=oc(i=>$b(Gn(i)).replace(/ /g,"")),ac=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits","preserveAspectRatio"];function Ly(i,t){return i.getAttribute(t)}function Po(i,t){const e=cc(t);e.ns?i.hasAttributeNS(e.ns,e.local)&&i.removeAttributeNS(e.ns,e.local):i.hasAttribute(t)&&i.removeAttribute(t)}function Oo(i,t,e){if(e==null)return Po(i,t);const n=cc(t);n.ns&&typeof e=="string"?i.setAttributeNS(n.ns,t,e):t==="id"?i.id=`${e}`:i.setAttribute(t,`${e}`)}function lc(i,t){Object.keys(t).forEach(e=>{Oo(i,e,t[e])})}function W(i,t,e){if(t==null){const n=i.attributes,s={};for(let o=0;o<n.length;o+=1)s[n[o].name]=n[o].value;return s}if(typeof t=="string"&&e===void 0)return i.getAttribute(t);typeof t=="object"?lc(i,t):Oo(i,t,e)}function cc(i){if(i.indexOf(":")!==-1){const t=i.split(":");return{ns:Mt[t[0]],local:t[1]}}return{ns:null,local:i}}function Xn(i){const t={};return Object.keys(i).forEach(e=>{const n=ac.includes(e)?e:rc(e);t[n]=i[e]}),t}function ss(i){const t={};return i.split(";").forEach(n=>{const s=n.trim();if(s){const o=s.split("=");o.length&&(t[o[0].trim()]=o[1]?o[1].trim():"")}}),t}function No(i,t){return Object.keys(t).forEach(e=>{if(e==="class")i[e]=i[e]?`${i[e]} ${t[e]}`:t[e];else if(e==="style"){const n=typeof i[e]=="object",s=typeof t[e]=="object";let o,r;n&&s?(o=i[e],r=t[e]):n?(o=i[e],r=ss(t[e])):s?(o=ss(i[e]),r=t[e]):(o=ss(i[e]),r=ss(t[e])),i[e]=No(o,r)}else i[e]=t[e]}),i}const Qy=/-(.)/g;function Vy(i){return i.replace(Qy,(t,e)=>e.toUpperCase())}const Ro={},hc=["webkit","ms","moz","o"],uc=typeof document<"u"?document.createElement("div").style:{};function zy(i){for(let t=0;t<hc.length;t+=1){const e=hc[t]+i;if(e in uc)return e}return null}function Fy(i){const t=Vy(i);if(Ro[t]==null){const e=t.charAt(0).toUpperCase()+t.slice(1);Ro[t]=t in uc?t:zy(e)}return Ro[t]}function dc(i,t){const e=i.ownerDocument&&i.ownerDocument.defaultView&&i.ownerDocument.defaultView.opener?i.ownerDocument.defaultView.getComputedStyle(i,null):window.getComputedStyle(i,null);return e&&t?e.getPropertyValue(t)||e[t]:e}const Uy={animationIterationCount:!0,columnCount:!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};function Ky(i){return/^--/.test(i)}function os(i,t,e){const n=window.getComputedStyle(i,null);return e?n.getPropertyValue(t)||void 0:n[t]||i.style[t]}function rs(i,t){return parseInt(os(i,t),10)||0}function Jy(i,t){return!Uy[i]&&typeof t=="number"?`${t}px`:t}function nt(i,t,e){if(typeof t=="string"){const n=Ky(t);if(n||(t=Fy(t)),e===void 0)return os(i,t,n);n||(e=Jy(t,e));const s=i.style;n?s.setProperty(t,e):s[t]=e;return}for(const n in t)nt(i,n,t[n])}function Do(i){let t=2166136261,e=!1,n=i;for(let s=0,o=n.length;s<o;s+=1){let r=n.charCodeAt(s);r>127&&!e&&(n=unescape(encodeURIComponent(n)),r=n.charCodeAt(s),e=!0),t^=r,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function Lo(){let i="";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=Math.random()*16|0,r=s==="x"?o:s==="y"?o&3|8:s;i+=r.toString(16)}return i}function jy(i,t,e){const n=Math.min(2,Math.floor(i.length*.34));let s=Math.floor(i.length*.4)+1,o,r=!1;const a=i.toLowerCase();for(const l of t){const c=e(l);if(c!==void 0&&Math.abs(c.length-a.length)<=n){const h=c.toLowerCase();if(h===a){if(c===i)continue;return l}if(r||c.length<3)continue;const u=Gy(a,h,s-1);if(u===void 0)continue;u<3?(r=!0,o=l):(s=u,o=l)}}return o}function Gy(i,t,e){let n=new Array(t.length+1),s=new Array(t.length+1);const o=e+1;for(let a=0;a<=t.length;a+=1)n[a]=a;for(let a=1;a<=i.length;a+=1){const l=i.charCodeAt(a-1),c=a>e?a-e:1,h=t.length>e+a?e+a:t.length;s[0]=a;let u=a;for(let f=1;f<c;f+=1)s[f]=o;for(let f=c;f<=h;f+=1){const p=l===t.charCodeAt(f-1)?n[f-1]:Math.min(n[f]+1,s[f-1]+1,n[f-1]+2);s[f]=p,u=Math.min(u,p)}for(let f=h+1;f<=t.length;f+=1)s[f]=o;if(u>e)return;const g=n;n=s,s=g}const r=n[t.length];return r>e?void 0:r}const as=new WeakMap;function Yy(i,t){const e=Gn(t),n=as.get(i);if(n)return n[e]}function Hy(i,t,e){const n=Gn(t),s=as.get(i);s?s[n]=e:as.set(i,{[n]:e})}function _e(i,t,e){if(!t)return as.get(i);if(typeof t=="string"){if(e===void 0)return Yy(i,t);Hy(i,t,e);return}for(const n in t)_e(i,n,t[n])}const _y={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function Qo(i,t,e){if(t){if(typeof t=="string"){if(t=_y[t]||t,arguments.length<3)return i[t];i[t]=e;return}for(const n in t)Qo(i,n,t[n])}}function Wy(i,...t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(i.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})}const qy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e])};function Xy(i,t){qy(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}class $y{}const Zy=/^\s*class\s+/.test(`${$y}`)||/^\s*class\s*\{/.test(`${class{}}`);function Vo(i,t){let e;return Zy?e=class extends t{}:(e=function(){return t.apply(this,arguments)},Xy(e,t)),Object.defineProperty(e,"name",{value:i}),e}function gc(i){return i==="__proto__"}function zo(i,t,e="/"){let n;const s=Array.isArray(t)?t:t.split(e);if(s.length)for(n=i;s.length;){const o=s.shift();if(Object(n)===n&&o&&o in n)n=n[o];else return}return n}function bn(i,t,e,n="/"){const s=Array.isArray(t)?t:t.split(n),o=s.pop();if(o&&!gc(o)){let r=i;s.forEach(a=>{gc(a)||(r[a]==null&&(r[a]={}),r=r[a])}),r[o]=e}return i}function fc(i,t,e="/"){const n=Array.isArray(t)?t.slice():t.split(e),s=n.pop();if(s)if(n.length>0){const o=zo(i,n);o&&delete o[s]}else delete i[s];return i}function t6(i,t,e={}){const n=e.offset||0,s=[],o=[];let r,a,l=null;for(let c=0;c<i.length;c+=1){r=o[c]=i[c];for(let h=0,u=t.length;h<u;h+=1){const g=t[h],f=g.start+n,p=g.end+n;c>=f&&c<p&&(typeof r=="string"?r=o[c]={t:i[c],attrs:g.attrs}:r.attrs=No(No({},r.attrs),g.attrs),e.includeAnnotationIndices&&(r.annotations==null&&(r.annotations=[]),r.annotations.push(h)))}a=o[c-1],a?bt(r)&&bt(a)?(l=l,JSON.stringify(r.attrs)===JSON.stringify(a.attrs)?l.t+=r.t:(s.push(l),l=r)):bt(r)||bt(a)?(l=l,s.push(l),l=r):l=String(l||"")+String(r):l=r}return l!=null&&s.push(l),s}function e6(i){return i.replace(/ /g," ")}class U{get[Symbol.toStringTag](){return pc}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}static isVector(t){if(t==null)return!1;if(t instanceof U)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===pc)&&n.node instanceof SVGElement&&typeof n.sample=="function"&&typeof n.toPath=="function"}static create(t,e,n){return new U(t,e,n)}static createVectors(t){if(t[0]==="<"){const e=is(t),n=[];for(let s=0,o=e.childNodes.length;s<o;s+=1){const r=e.childNodes[s];n.push(U.create(document.importNode(r,!0)))}return n}return[U.create(t)]}static toNode(t){return U.isVector(t)?t.node:t}static toNodes(t){return Array.isArray(t)?t.map(e=>U.toNode(e)):[U.toNode(t)]}constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let s;if(U.isVector(t))s=t.node;else if(typeof t=="string")if(t.toLowerCase()==="svg")s=is();else if(t[0]==="<"){const o=is(t);s=document.importNode(o.firstChild,!0)}else s=document.createElementNS(Mt.svg,t);else s=t;this.node=s,e&&this.setAttributes(e),n&&this.append(n)}transform(t,e){return t==null?yn(this.node):(yn(this.node,t,e),this)}translate(t,e=0,n={}){return t==null?Ec(this.node):(Ec(this.node,t,e,n),this)}rotate(t,e,n,s={}){return t==null?Ko(this.node):(Ko(this.node,t,e,n,s),this)}scale(t,e){return t==null?Sc(this.node):(Sc(this.node,t,e),this)}getTransformToElement(t){const e=U.toNode(t);return Jo(this.node,e)}removeAttribute(t){return Po(this.node,t),this}getAttribute(t){return Ly(this.node,t)}setAttribute(t,e){return Oo(this.node,t,e),this}setAttributes(t){return lc(this.node,t),this}attr(t,e){return t==null?W(this.node):typeof t=="string"&&e===void 0?W(this.node,t):(typeof t=="object"?W(this.node,t):W(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:U.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?U.create(e):U.create("defs").appendTo(t)}text(t,e={}){return bc(this.node,t,e),this}tagName(){return Iy(this.node)}clone(){return U.create(this.node.cloneNode(!0))}remove(){return qt(this.node),this}empty(){return Wn(this.node),this}append(t){return Ot(this.node,U.toNodes(t)),this}appendTo(t){return Xt(this.node,U.isVector(t)?t.node:t),this}prepend(t){return ic(this.node,U.toNodes(t)),this}before(t){return qn(this.node,U.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(U.toNode(t),this.node),U.create(t)}first(){return this.node.firstChild?U.create(this.node.firstChild):null}last(){return this.node.lastChild?U.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?U.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(U.toNode(t))}find(t){const e=[],n=Py(this.node,t);if(n)for(let s=0,o=n.length;s<o;s+=1)e.push(U.create(n[s]));return e}findOne(t){const e=Oy(this.node,t);return e?U.create(e):null}findParentByClass(t,e){const n=nc(this.node,t,e);return n?U.create(n):null}matches(t){const e=this.node;this.node.matches;const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}contains(t){return To(this.node,U.isVector(t)?t.node:t)}wrap(t){const e=U.create(t),n=this.node.parentNode;return n!=null&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(e.node.parentNode==null)return null;if(e=U.create(e.node.parentNode),t==null)return e;do if(typeof t=="string"?e.matches(t):e instanceof t)return e;while(e=U.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1)t[n].nodeType===1&&e.push(U.create(t[n]));return e}eachChild(t,e){const n=this.children();for(let s=0,o=n.length;s<o;s+=1)t.call(n[s],n[s],s,n),e&&n[s].eachChild(t,e);return this}index(){return ko(this.node)}hasClass(t){return ge(this.node,t)}addClass(t){return Q(this.node,t),this}removeClass(t){return lt(this.node,t),this}toggleClass(t,e){return le(this.node,t,e),this}toLocalPoint(t,e){return x6(this.node,t,e)}sample(t=1){return this.node instanceof SVGPathElement?o6(this.node,t):[]}toPath(){return U.create(d6(this.node))}toPathData(){return xc(this.node)}}const pc=`X6.${U.name}`;function n6(i,t){const e=U.create(t),n=U.create("textPath"),s=i.d;if(s&&i["xlink:href"]===void 0){const o=U.create("path").attr("d",s).appendTo(e.defs());n.attr("xlink:href",`#${o.id}`)}return typeof i=="object"&&n.attr(i),n.node}function i6(i,t,e){const n=e.eol,s=e.baseSize,o=e.lineHeight;let r=0,a;const l={},c=t.length-1;for(let h=0;h<=c;h+=1){let u=t[h],g=null;if(typeof u=="object"){const f=u.attrs,p=U.create("tspan",f);a=p.node;let m=u.t;n&&h===c&&(m+=n),a.textContent=m;const b=f.class;b&&p.addClass(b),e.includeAnnotationIndices&&p.attr("annotations",u.annotations.join(",")),g=parseFloat(f["font-size"]),g===void 0&&(g=s),g&&g>r&&(r=g)}else n&&h===c&&(u+=n),a=document.createTextNode(u||" "),s&&s>r&&(r=s);i.appendChild(a)}return r&&(l.maxFontSize=r),o?l.lineHeight=o:r&&(l.lineHeight=r*1.2),l}const mc=/em$/;function ls(i,t){const e=parseFloat(i);return mc.test(i)?e*t:e}function s6(i,t,e,n){if(!Array.isArray(t))return 0;const s=t.length;if(!s)return 0;let o=t[0];const r=ls(o.maxFontSize,e)||e;let a=0;const l=ls(n,e);for(let u=1;u<s;u+=1){o=t[u];const g=ls(o.lineHeight,e)||l;a+=g}const c=ls(o.maxFontSize,e)||e;let h;switch(i){case"middle":h=r/2-.15*c-a/2;break;case"bottom":h=-(.25*c)-a;break;case"top":default:h=.8*r;break}return h}function bc(i,t,e={}){t=e6(t);const n=e.eol;let s=e.textPath;const o=e.textVerticalAnchor,r=o==="middle"||o==="bottom"||o==="top";let a=e.x;a===void 0&&(a=i.getAttribute("x")||0);const l=e.includeAnnotationIndices;let c=e.annotations;c&&!Array.isArray(c)&&(c=[c]);const h=e.lineHeight,u=h==="auto",g=u?"1.5em":h||"1em";let f=!0;const p=i.childNodes;if(p.length===1){const k=p[0];k&&k.tagName.toUpperCase()==="TITLE"&&(f=!1)}f&&Wn(i),W(i,{"xml:space":"preserve",display:t||e.displayEmpty?null:"none"});const m=W(i,"font-size");let b=parseFloat(m);b||(b=16,(r||c)&&!m&&W(i,"font-size",`${b}`));let y;s?(typeof s=="string"&&(s={d:s}),y=n6(s,i)):y=document.createDocumentFragment();let C,w=0,x;const E=t.split(`
|
|
3
|
-
`),S=[],v=E.length-1;for(let k=0;k<=v;k+=1){
|
|
4
|
-
`,a=e.fontSize||14,l=e.lineHeight?parseFloat(e.lineHeight):Math.ceil(a*1.4),c=Math.floor(o/l);if(i.indexOf(r)>-1){const b=Lo(),y=[];return i.split(r).forEach(C=>{const w=wc(C,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),e,Object.assign(Object.assign({},n),{eol:b}));w&&y.push(...w.split(b))}),y.slice(0,c).join(r)}const{width:h}=$n(i,e);if(h<s)return i;const u=[];let g=i,f=h,p=n.ellipsis,m=0;p&&(typeof p!="string"&&(p="…"),m=$n(p,e).width);for(let b=0;b<c;b+=1)if(f>s)if(b===c-1){const[C]=yc(g,s-m,f,e);u.push(p?`${C}${p}`:C)}else{const[C,w]=yc(g,s,f,e);u.push(C),g=w,f=$n(g,e).width}else{u.push(g);break}return u.join(r)}const Fo=.551784;function Nt(i,t,e=NaN){const n=i.getAttribute(t);if(n==null)return e;const s=parseFloat(n);return Number.isNaN(s)?e:s}function o6(i,t=1){const e=i.getTotalLength(),n=[];let s=0,o;for(;s<e;)o=i.getPointAtLength(s),n.push({distance:s,x:o.x,y:o.y}),s+=t;return n}function r6(i){return["M",Nt(i,"x1"),Nt(i,"y1"),"L",Nt(i,"x2"),Nt(i,"y2")].join(" ")}function a6(i){const t=cs(i);return t.length===0?null:`${Cc(t)} Z`}function l6(i){const t=cs(i);return t.length===0?null:Cc(t)}function Cc(i){return`M ${i.map(e=>`${e.x} ${e.y}`).join(" L")}`}function cs(i){const t=[],e=i.points;if(e)for(let n=0,s=e.numberOfItems;n<s;n+=1)t.push(e.getItem(n));return t}function c6(i){const t=Nt(i,"cx",0),e=Nt(i,"cy",0),n=Nt(i,"r"),s=n*Fo;return["M",t,e-n,"C",t+s,e-n,t+n,e-s,t+n,e,"C",t+n,e+s,t+s,e+n,t,e+n,"C",t-s,e+n,t-n,e+s,t-n,e,"C",t-n,e-s,t-s,e-n,t,e-n,"Z"].join(" ")}function h6(i){const t=Nt(i,"cx",0),e=Nt(i,"cy",0),n=Nt(i,"rx"),s=Nt(i,"ry")||n,o=n*Fo,r=s*Fo;return["M",t,e-s,"C",t+o,e-s,t+n,e-r,t+n,e,"C",t+n,e+r,t+o,e+s,t,e+s,"C",t-o,e+s,t-n,e+r,t-n,e,"C",t-n,e-r,t-o,e-s,t,e-s,"Z"].join(" ")}function u6(i){return Ac({x:Nt(i,"x",0),y:Nt(i,"y",0),width:Nt(i,"width",0),height:Nt(i,"height",0),rx:Nt(i,"rx",0),ry:Nt(i,"ry",0)})}function Ac(i){let t;const e=i.x,n=i.y,s=i.width,o=i.height,r=Math.min(i.rx||i["top-rx"]||0,s/2),a=Math.min(i.rx||i["bottom-rx"]||0,s/2),l=Math.min(i.ry||i["top-ry"]||0,o/2),c=Math.min(i.ry||i["bottom-ry"]||0,o/2);return r||a||l||c?t=["M",e,n+l,"v",o-l-c,"a",a,c,0,0,0,a,c,"h",s-2*a,"a",a,c,0,0,0,a,-c,"v",-(o-c-l),"a",r,l,0,0,0,-r,-l,"h",-(s-2*r),"a",r,l,0,0,0,-r,l,"Z"]:t=["M",e,n,"H",e+s,"V",n+o,"H",e,"V",n,"Z"],t.join(" ")}function d6(i){const t=ce("path");W(t,W(i));const e=xc(i);return e&&t.setAttribute("d",e),t}function xc(i){const t=i.tagName.toLowerCase();switch(t){case"path":return i.getAttribute("d");case"line":return r6(i);case"polygon":return a6(i);case"polyline":return l6(i);case"ellipse":return h6(i);case"circle":return c6(i);case"rect":return u6(i)}throw new Error(`"${t}" cannot be converted to svg path element.`)}const g6=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,vc=/[ ,]+/,f6=/^(\w+)\((.*)\)/;function p6(i,t){const n=ce("svg").createSVGPoint();return n.x=i,n.y=t,n}function Bt(i){const e=ce("svg").createSVGMatrix();if(i!=null){const n=i,s=["a","b","c","d","e","f"];for(const o of s)n[o]!==void 0&&(e[o]=n[o])}return e}function m6(i){const t=ce("svg");return i!=null?(i instanceof DOMMatrix||(i=Bt(i)),t.createSVGTransformFromMatrix(i)):t.createSVGTransform()}function Zn(i){let t=Bt();const e=i!=null&&i.match(g6);if(!e)return t;for(let n=0,s=e.length;n<s;n+=1){const r=e[n].match(f6);if(r){let a,l,c,h,u,g=Bt();const f=r[2].split(vc);switch(r[1].toLowerCase()){case"scale":a=parseFloat(f[0]),l=f[1]===void 0?a:parseFloat(f[1]),g=g.scaleNonUniform(a,l);break;case"translate":c=parseFloat(f[0]),h=parseFloat(f[1]),g=g.translate(c,h);break;case"rotate":u=parseFloat(f[0]),c=parseFloat(f[1])||0,h=parseFloat(f[2])||0,c!==0||h!==0?g=g.translate(c,h).rotate(u).translate(-c,-h):g=g.rotate(u);break;case"skewx":u=parseFloat(f[0]),g=g.skewX(u);break;case"skewy":u=parseFloat(f[0]),g=g.skewY(u);break;case"matrix":g.a=parseFloat(f[0]),g.b=parseFloat(f[1]),g.c=parseFloat(f[2]),g.d=parseFloat(f[3]),g.e=parseFloat(f[4]),g.f=parseFloat(f[5]);break;default:continue}t=t.multiply(g)}}return t}function ti(i){const t=i||{},e=t.a!=null?t.a:1,n=t.b!=null?t.b:0,s=t.c!=null?t.c:0,o=t.d!=null?t.d:1,r=t.e!=null?t.e:0,a=t.f!=null?t.f:0;return`matrix(${e},${n},${s},${o},${r},${a})`}function hs(i){let t,e,n;if(i){const o=vc;if(i.trim().indexOf("matrix")>=0){const r=Zn(i),a=b6(r);t=[a.translateX,a.translateY],e=[a.rotation],n=[a.scaleX,a.scaleY];const l=[];(t[0]!==0||t[1]!==0)&&l.push(`translate(${t.join(",")})`),(n[0]!==1||n[1]!==1)&&l.push(`scale(${n.join(",")})`),e[0]!==0&&l.push(`rotate(${e[0]})`),i=l.join(" ")}else{const r=i.match(/translate\((.*?)\)/);r&&(t=r[1].split(o));const a=i.match(/rotate\((.*?)\)/);a&&(e=a[1].split(o));const l=i.match(/scale\((.*?)\)/);l&&(n=l[1].split(o))}}const s=n&&n[0]?parseFloat(n[0]):1;return{raw:i||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:e&&e[0]?parseInt(e[0],10):0,cx:e&&e[1]?parseInt(e[1],10):void 0,cy:e&&e[2]?parseInt(e[2],10):void 0},scale:{sx:s,sy:n&&n[1]?parseFloat(n[1]):s}}}function Uo(i,t){const e=t.x*i.a+t.y*i.c+0,n=t.x*i.b+t.y*i.d+0;return{x:e,y:n}}function b6(i){const t=Uo(i,{x:0,y:1}),e=Uo(i,{x:1,y:0}),n=180/Math.PI*Math.atan2(t.y,t.x)-90,s=180/Math.PI*Math.atan2(e.y,e.x);return{skewX:n,skewY:s,translateX:i.e,translateY:i.f,scaleX:Math.sqrt(i.a*i.a+i.b*i.b),scaleY:Math.sqrt(i.c*i.c+i.d*i.d),rotation:n}}function y6(i){let t,e,n,s;return i?(t=i.a==null?1:i.a,s=i.d==null?1:i.d,e=i.b,n=i.c):t=s=1,{sx:e?Math.sqrt(t*t+e*e):t,sy:n?Math.sqrt(n*n+s*s):s}}function w6(i){let t={x:0,y:1};i&&(t=Uo(i,t));const e=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:e%360+(e<0?360:0)}}function C6(i){return{tx:i&&i.e||0,ty:i&&i.f||0}}function yn(i,t,e={}){if(t==null)return Zn(W(i,"transform"));if(e.absolute){i.setAttribute("transform",ti(t));return}const n=i.transform,s=m6(t);n.baseVal.appendItem(s)}function Ec(i,t,e=0,n={}){let s=W(i,"transform");const o=hs(s);if(t==null)return o.translation;s=o.raw,s=s.replace(/translate\([^)]*\)/g,"").trim();const r=n.absolute?t:o.translation.tx+t,a=n.absolute?e:o.translation.ty+e,l=`translate(${r},${a})`;i.setAttribute("transform",`${l} ${s}`.trim())}function Ko(i,t,e,n,s={}){let o=W(i,"transform");const r=hs(o);if(t==null)return r.rotation;o=r.raw,o=o.replace(/rotate\([^)]*\)/g,"").trim(),t%=360;const a=s.absolute?t:r.rotation.angle+t,l=e!=null&&n!=null?`,${e},${n}`:"",c=`rotate(${a}${l})`;i.setAttribute("transform",`${o} ${c}`.trim())}function Sc(i,t,e){let n=W(i,"transform");const s=hs(n);if(t==null)return s.scale;e=e??t,n=s.raw,n=n.replace(/scale\([^)]*\)/g,"").trim();const o=`scale(${t},${e})`;i.setAttribute("transform",`${n} ${o}`.trim())}function Jo(i,t){if(Oe(t)&&Oe(i)){const e=t.getScreenCTM(),n=i.getScreenCTM();if(e&&n)return e.inverse().multiply(n)}return Bt()}function A6(i,t){let e=Bt();if(Oe(t)&&Oe(i)){let n=i;const s=[];for(;n&&n!==t;){const o=n.getAttribute("transform")||null,r=Zn(o);s.push(r),n=n.parentNode}s.reverse().forEach(o=>{e=e.multiply(o)})}return e}function x6(i,t,e){const n=i instanceof SVGSVGElement?i:i.ownerSVGElement,s=n.createSVGPoint();s.x=t,s.y=e;try{const o=n.getScreenCTM(),r=s.matrixTransform(o.inverse()),a=Jo(i,n).inverse();return r.matrixTransform(a)}catch{return s}}const Mc={};function wn(i){return Mc[i]||{}}function us(i,t){Mc[i]=t}const ei=new WeakMap;function v6(i){return ei.has(i)||ei.set(i,{events:Object.create(null)}),ei.get(i)}function jo(i){return ei.get(i)}function E6(i){return ei.delete(i)}const ds=()=>!0,Cn=()=>!1;function Bc(i){i.stopPropagation()}function S6(i,t,e){i.addEventListener!=null&&i.addEventListener(t,e)}function M6(i,t,e){i.removeEventListener!=null&&i.removeEventListener(t,e)}const B6=/[^\x20\t\r\n\f]+/g,k6=/^([^.]*)(?:\.(.+)|)/;function kc(i){return(i||"").match(B6)||[""]}function Tc(i){const t=k6.exec(i)||[];return{originType:t[1]?t[1].trim():t[1],namespaces:t[2]?t[2].split(".").map(e=>e.trim()).sort():[]}}function Go(i){return i.nodeType===1||i.nodeType===9||!+i.nodeType}let Ic=0;const An=new WeakMap;function Pc(i){return An.has(i)||(An.set(i,Ic),Ic+=1),An.get(i)}function T6(i){return An.get(i)}function I6(i){return An.delete(i)}function Oc(i,t){return An.set(i,t)}function P6(i,t){const e=[],n=jo(i),s=n&&n.events&&n.events[t.type],o=s&&s.handlers||[],r=s?s.delegateCount:0;if(r>0&&!(t.type==="click"&&typeof t.button=="number"&&t.button>=1)){for(let a=t.target;a!==i;a=a.parentNode||i)if(a.nodeType===1&&!(t.type==="click"&&a.disabled===!0)){const l=[],c={};for(let h=0;h<r;h+=1){const u=o[h],g=u.selector;if(g!=null&&c[g]==null){const f=i,p=[];f.querySelectorAll(g).forEach(m=>{p.push(m)}),c[g]=p.includes(a)}c[g]&&l.push(u)}l.length&&e.push({elem:a,handlers:l})}}return r<o.length&&e.push({elem:i,handlers:o.slice(r)}),e}function Nc(i){return i!=null&&i===i.window}function Rc(i,t){const e=i.nodeType===9?i.documentElement:i,n=t&&t.parentNode;return i===n||!!(n&&n.nodeType===1&&(e.contains?e.contains(n):i.compareDocumentPosition&&i.compareDocumentPosition(n)&16))}class ve{static create(t){return t instanceof ve?t:new ve(t)}static addProperty(t,e){Object.defineProperty(ve.prototype,t,{enumerable:!0,configurable:!0,get:typeof e=="function"?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(n){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}})}constructor(t,e){this.isDefaultPrevented=Cn,this.isPropagationStopped=Cn,this.isImmediatePropagationStopped=Cn,this.isSimulated=!1,this.preventDefault=()=>{const n=this.originalEvent;this.isDefaultPrevented=ds,n&&!this.isSimulated&&n.preventDefault()},this.stopPropagation=()=>{const n=this.originalEvent;this.isPropagationStopped=ds,n&&!this.isSimulated&&n.stopPropagation()},this.stopImmediatePropagation=()=>{const n=this.originalEvent;this.isImmediatePropagationStopped=ds,n&&!this.isSimulated&&n.stopImmediatePropagation(),this.stopPropagation()},typeof t=="string"?this.type=t:t.type&&(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?ds:Cn,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.timeStamp=t.timeStamp),e&&Object.assign(this,e),this.timeStamp||(this.timeStamp=Date.now())}}const Dc={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(Dc).forEach(i=>ve.addProperty(i,Dc[i])),us("load",{noBubble:!0}),us("beforeunload",{postDispatch(i,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}),us("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(i,t){let e;const n=t.relatedTarget,s=t.handleObj;return(!n||n!==i&&!Rc(i,n))&&(t.type=s.originType,e=s.handler.call(i,t),t.type="mouseover"),e}}),us("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(i,t){let e;const n=t.relatedTarget,s=t.handleObj;return(!n||n!==i&&!Rc(i,n))&&(t.type=s.originType,e=s.handler.call(i,t),t.type="mouseout"),e}});let Yo;function O6(i,t,e,n,s){if(!Go(i))return;let o;if(typeof e!="function"){const{handler:c,selector:h}=e,u=Y(e,["handler","selector"]);e=c,s=h,o=u}const r=v6(i);let a=r.handler;a==null&&(a=r.handler=function(c,...h){return Yo!==c.type?N6(i,c,...h):void 0});const l=Pc(e);kc(t).forEach(c=>{const{originType:h,namespaces:u}=Tc(c);if(!h)return;let g=h,f=wn(g);g=(s?f.delegateType:f.bindType)||g,f=wn(g);const p=Object.assign({type:g,originType:h,data:n,selector:s,guid:l,handler:e,namespace:u.join(".")},o),m=r.events;let b=m[g];b||(b=m[g]={handlers:[],delegateCount:0},(!f.setup||f.setup(i,n,u,a)===!1)&&S6(i,g,a)),f.add&&(I6(p.handler),f.add(i,p),Oc(p.handler,l)),s?(b.handlers.splice(b.delegateCount,0,p),b.delegateCount+=1):b.handlers.push(p)})}function Lc(i,t,e,n,s){const o=jo(i);if(!o)return;const r=o.events;r&&(kc(t).forEach(a=>{const{originType:l,namespaces:c}=Tc(a);if(!l){Object.keys(r).forEach(m=>{Lc(i,m+a,e,n,!0)});return}let h=l;const u=wn(h);h=(n?u.delegateType:u.bindType)||h;const g=r[h];if(!g)return;const f=c.length>0?new RegExp(`(^|\\.)${c.join("\\.(?:.*\\.|)")}(\\.|$)`):null,p=g.handlers.length;for(let m=g.handlers.length-1;m>=0;m-=1){const b=g.handlers[m];(s||l===b.originType)&&(!e||T6(e)===b.guid)&&(f==null||b.namespace&&f.test(b.namespace))&&(n==null||n===b.selector||n==="**"&&b.selector)&&(g.handlers.splice(m,1),b.selector&&(g.delegateCount-=1),u.remove&&u.remove(i,b))}p&&g.handlers.length===0&&((!u.teardown||u.teardown(i,c,o.handler)===!1)&&M6(i,h,o.handler),delete r[h])}),Object.keys(r).length===0&&E6(i))}function N6(i,t,...e){const n=ve.create(t);n.delegateTarget=i;const s=wn(n.type);if(s.preDispatch&&s.preDispatch(i,n)===!1)return;const o=P6(i,n);for(let r=0,a=o.length;r<a&&!n.isPropagationStopped();r+=1){const l=o[r];n.currentTarget=l.elem;for(let c=0,h=l.handlers.length;c<h&&!n.isImmediatePropagationStopped();c+=1){const u=l.handlers[c];if(n.rnamespace==null||u.namespace&&n.rnamespace.test(u.namespace)){n.handleObj=u,n.data=u.data;const g=wn(u.originType).handle,f=g?g(l.elem,n,...e):u.handler.call(l.elem,n,...e);f!==void 0&&(n.result=f,f===!1&&(n.preventDefault(),n.stopPropagation()))}}}return s.postDispatch&&s.postDispatch(i,n),n.result}function R6(i,t,e,n){let s=i,o=typeof i=="string"?i:i.type,r=typeof i=="string"||s.namespace==null?[]:s.namespace.split(".");const a=e;if(a.nodeType===3||a.nodeType===8)return;o.indexOf(".")>-1&&(r=o.split("."),o=r.shift(),r.sort());const l=o.indexOf(":")<0&&`on${o}`;s=i instanceof ve?i:new ve(o,typeof i=="object"?i:null),s.namespace=r.join("."),s.rnamespace=s.namespace?new RegExp(`(^|\\.)${r.join("\\.(?:.*\\.|)")}(\\.|$)`):null,s.result=void 0,s.target||(s.target=a);const c=[s];Array.isArray(t)?c.push(...t):c.push(t);const h=wn(o);if(!n&&h.trigger&&h.trigger(a,s,t)===!1)return;let u;const g=[a];if(!n&&!h.noBubble&&!Nc(a)){u=h.delegateType||o;let p=a,m=a.parentNode;for(;m!=null;)g.push(m),p=m,m=m.parentNode;const b=a.ownerDocument||document;if(p===b){const y=p.defaultView||p.parentWindow||window;g.push(y)}}let f=a;for(let p=0,m=g.length;p<m&&!s.isPropagationStopped();p+=1){const b=g[p];f=b,s.type=p>1?u:h.bindType||o;const y=jo(b);y&&y.events[s.type]&&y.handler&&y.handler.call(b,...c);const C=l&&b[l]||null;C&&Go(b)&&(s.result=C.call(b,...c),s.result===!1&&s.preventDefault())}if(s.type=o,!n&&!s.isDefaultPrevented()){const p=h.preventDefault;if((p==null||p(g.pop(),s,t)===!1)&&Go(a)&&l&&typeof a[o]=="function"&&!Nc(a)){const m=a[l];m&&(a[l]=null),Yo=o,s.isPropagationStopped()&&f.addEventListener(o,Bc),a[o](),s.isPropagationStopped()&&f.removeEventListener(o,Bc),Yo=void 0,m&&(a[l]=m)}}return s.result}class ot{static on(t,e,n,s,o){return ni.on(t,e,n,s,o),t}static once(t,e,n,s,o){return ni.on(t,e,n,s,o,!0),t}static off(t,e,n,s){return ni.off(t,e,n,s),t}static trigger(t,e,n,s){return R6(e,n,t,s),t}}var ni;(function(i){function t(n,s,o,r,a,l){if(typeof s=="object"){typeof o!="string"&&(r=r||o,o=void 0),Object.keys(s).forEach(c=>t(n,c,o,r,s[c],l));return}if(r==null&&a==null?(a=o,r=o=void 0):a==null&&(typeof o=="string"?(a=r,r=void 0):(a=r,r=o,o=void 0)),a===!1)a=Cn;else if(!a)return;if(l){const c=a;a=function(h,...u){return i.off(n,h),c.call(this,h,...u)},Oc(a,Pc(c))}O6(n,s,a,r,o)}i.on=t;function e(n,s,o,r){const a=s;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;e(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof s=="object"){const l=s;Object.keys(l).forEach(c=>e(n,c,o,l[c]));return}(o===!1||typeof o=="function")&&(r=o,o=void 0),r===!1&&(r=Cn),Lc(n,s,r,o)}i.off=e})(ni||(ni={}));class Qc{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=uy("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(t){if(this.onWheelGuard!=null&&!this.onWheelGuard(t))return;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault();let e;(this.deltaX!==0||this.deltaY!==0)&&(t.stopPropagation(),e=!0),e===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function xn(i){const t=i.getBoundingClientRect(),e=i.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}}function D6(i){return i.getBoundingClientRect().width}function L6(i){return i.getBoundingClientRect().height}function Q6(i){const t=os(i,"position")==="fixed";let e;if(t){const n=i.getBoundingClientRect();e={left:n.left,top:n.top}}else e=xn(i);if(!t){const n=i.ownerDocument;let s=i.offsetParent||n.documentElement;for(;(s===n.body||s===n.documentElement)&&os(s,"position")==="static";)s=s.parentNode;if(s!==i&&Ry(s)){const o=xn(s);e.top-=o.top+rs(s,"borderTopWidth"),e.left-=o.left+rs(s,"borderLeftWidth")}}return{top:e.top-rs(i,"marginTop"),left:e.left-rs(i,"marginLeft")}}function Ee(i,t){const e=p6(i.x,i.y).matrixTransform(t);return new A(e.x,e.y)}function V6(i,t){return new z(Ee(i.start,t),Ee(i.end,t))}function $t(i,t){const n=ce("svg").createSVGPoint();n.x=i.x,n.y=i.y;const s=n.matrixTransform(t);n.x=i.x+i.width,n.y=i.y;const o=n.matrixTransform(t);n.x=i.x+i.width,n.y=i.y+i.height;const r=n.matrixTransform(t);n.x=i.x,n.y=i.y+i.height;const a=n.matrixTransform(t),l=Math.min(s.x,o.x,r.x,a.x),c=Math.max(s.x,o.x,r.x,a.x),h=Math.min(s.y,o.y,r.y,a.y),u=Math.max(s.y,o.y,r.y,a.y);return new P(l,h,c-l,u-h)}function Vc(i,t,e){let n=null;if(!i.ownerSVGElement)return new P(0,0,0,0);try{n=i.getBBox()}catch{n={x:i.clientLeft,y:i.clientTop,width:i.clientWidth,height:i.clientHeight}}return P.create(n)}function fe(i,t={}){let e=null;if(!i.ownerSVGElement||!Oe(i)){if(sc(i)){const{left:r,top:a,width:l,height:c}=zc(i);return new P(r,a,l,c)}return new P(0,0,0,0)}let s=t.target;if(!t.recursive){try{e=i.getBBox()}catch{e={x:i.clientLeft,y:i.clientTop,width:i.clientWidth,height:i.clientHeight}}if(!s)return P.create(e);const r=Jo(i,s);return $t(e,r)}{const r=i.childNodes,a=r.length;if(a===0)return fe(i,{target:s});s||(s=i);let l=null;for(let c=0;c<a;c+=1){const h=r[c];let u=null;h.childNodes.length===0?u=fe(h,{target:s}):u=fe(h,{target:s,recursive:!0}),l?l=l.union(u):l=P.create(u)}return l||new P(0,0,0,0)}}function zc(i){let t=0,e=0,n=0,s=0;if(i){let o=i;for(;o;)t+=o.offsetLeft,e+=o.offsetTop,o=o.offsetParent,o&&(t+=parseInt(dc(o,"borderLeft"),10),e+=parseInt(dc(o,"borderTop"),10));n=i.offsetWidth,s=i.offsetHeight}return{left:t,top:e,width:n,height:s}}function Fc(i){const t=e=>{const n=i.getAttribute(e),s=n?parseFloat(n):0;return Number.isNaN(s)?0:s};switch(i instanceof SVGElement&&i.nodeName.toLowerCase()){case"rect":return new P(t("x"),t("y"),t("width"),t("height"));case"circle":return new jt(t("cx"),t("cy"),t("r"),t("r"));case"ellipse":return new jt(t("cx"),t("cy"),t("rx"),t("ry"));case"polyline":{const e=cs(i);return new St(e)}case"polygon":{const e=cs(i);return e.length>1&&e.push(e[0]),new St(e)}case"path":{let e=i.getAttribute("d");return Ay(e)||(e=$l(e)),J.parse(e)}case"line":return new z(t("x1"),t("y1"),t("x2"),t("y2"))}return fe(i)}function z6(i){if(i==null)return null;let t=i;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),ge(t,"x6-port"))t=t.nextElementSibling;else if(e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}function F6(i){const t=z6(i);if(!Oe(t)){if(sc(i)){const{left:s,top:o,width:r,height:a}=zc(i);return new P(s,o,r,a)}return new P(0,0,0,0)}return Fc(t).bbox()||P.create()}const U6=(i,t)=>i-t;class K6{constructor(t={}){this.comparator=t.comparator||U6,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(t,e,n){const s={priority:t,value:e},o=this.data.length;return n&&(s.id=n,this.index[n]=o),this.data.push(s),this.bubbleUp(o),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if(typeof n>"u")throw new Error(`Node with id '${t}' was not found in the heap.`);const s=this.data,o=s[n].priority,r=this.comparator(e,o);r<0?(s[n].priority=e,this.bubbleUp(n)):r>0&&(s[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return e!=null&&e.id&&delete this.index[e.id],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,s,o=t;for(;o>0&&(s=o-1>>>1,this.comparator(e[o].priority,e[s].priority)<0);){n=e[s],e[s]=e[o];let r=e[o].id;r!=null&&(this.index[r]=s),e[o]=n,r=e[o].id,r!=null&&(this.index[r]=o),o=s}}bubbleDown(t){const e=this.data,n=e.length-1;let s=t;for(;;){const o=(s<<1)+1,r=o+1;let a=s;if(o<=n&&this.comparator(e[o].priority,e[a].priority)<0&&(a=o),r<=n&&this.comparator(e[r].priority,e[a].priority)<0&&(a=r),a!==s){const l=e[a];e[a]=e[s];let c=e[s].id;c!=null&&(this.index[c]=a),e[s]=l,c=e[s].id,c!=null&&(this.index[c]=s),s=a}else break}}}function J6(i,t,e=(n,s)=>1){const n={},s={},o={},r=new K6;for(n[t]=0,Object.keys(i).forEach(a=>{a!==t&&(n[a]=1/0),r.insert(n[a],a,a)});!r.isEmpty();){const a=r.remove();o[a]=!0;const l=i[a];for(let c=0;c<l.length;c+=1){const h=l[c];if(!o[h]){const u=n[a]+e(a,h);u<n[h]&&(n[h]=u,s[h]=a,r.updatePriority(h,u))}}}return s}const ii=/(-?(?:\d*\.\d+|\d+))\s*(px|em|rem|ch|vh|vw|vmin|vmax|%|cm|mm|in|pt|pc|ex|fr|deg|rad|turn)$/,Uc=(i,t)=>{const e=t-i;return n=>i+e*n},Kc=(i,t)=>{const e=ii,n=e.exec(i),s=e.exec(t),o=s?s[1]:"",r=n?+n[1]:0,a=s?+s[1]:0,l=o.indexOf("."),c=l>0?o[1].length-l-1:0,h=a-r,u=n?n[2]:"";return g=>(r+h*g).toFixed(c)+u},j6=(i,t)=>{const e=parseInt(i.slice(1),16),n=parseInt(t.slice(1),16),s=e&255,o=(n&255)-s,r=e&65280,a=(n&65280)-r,l=e&16711680,c=(n&16711680)-l;return h=>{const u=s+o*h&255,g=r+a*h&65280,f=l+c*h&16711680;return`#${(1<<24|u|g|f).toString(16).slice(1)}`}},G6=(i,t)=>{const e=o=>{const r=[];if(!o)return r;const a=/(\w+)\(([^)]+)\)/g;let l=a.exec(o);for(;l!==null;)l[1]&&l[2]&&r.push({name:l[1],values:l[2].split(/\s*,\s*/).filter(Boolean)}),l=a.exec(o);return r},n=e(i),s=e(t);return n.length===0||s.length===0?()=>i:o=>{const r=[];for(let a=0;a<Math.min(n.length,s.length);a++){const l=n[a],c=s[a];if(!(!l||!c)&&l.name===c.name&&l.values.length>0&&l.values.length===c.values.length){const h=[];for(let u=0;u<l.values.length;u++){const g=l.values[u],f=c.values[u];if(!(g===void 0||f===void 0))if(ii.test(g)||ii.test(f)){const p=Kc(g,f);h.push(p(o))}else if(!Number.isNaN(parseFloat(g))&&!Number.isNaN(parseFloat(f))){const p=Uc(parseFloat(g),parseFloat(f));h.push(p(o).toString())}else h.push(g)}h.length>0&&r.push(`${l.name}(${h.join(", ")})`)}}return r.length>0?r.join(" "):i}},Jc=i=>i,Y6=i=>i*i,H6=i=>i*i*i,_6=i=>{if(i<=0)return 0;if(i>=1)return 1;const t=i*i,e=t*i;return 4*(i<.5?e:3*(i-t)+e-.75)},W6=i=>Math.pow(2,10*(i-1)),q6=i=>{for(let t=0,e=1;;t+=e,e/=2)if(i>=(7-4*t)/11){const n=(11-6*t-11*i)/4;return-n*n+e*e}},X6={reverse(i){return t=>1-i(1-t)},reflect(i){return t=>.5*(t<.5?i(2*t):2-i(2-2*t))},clamp(i,t=0,e=1){return n=>{const s=i(n);return s<t?t:s>e?e:s}},back(i=1.70158){return t=>t*t*((i+1)*t-i)},elastic(i=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*i/3*t)}};function $6(i){return-1*Math.cos(i*(Math.PI/2))+1}function Z6(i){return Math.sin(i*(Math.PI/2))}function t2(i){return-.5*(Math.cos(Math.PI*i)-1)}function e2(i){return i*i}function n2(i){return i*(2-i)}function i2(i){return i<.5?2*i*i:-1+(4-2*i)*i}function s2(i){return i*i*i}function o2(i){const t=i-1;return t*t*t+1}function r2(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1}function a2(i){return i*i*i*i}function l2(i){const t=i-1;return 1-t*t*t*t}function c2(i){const t=i-1;return i<.5?8*i*i*i*i:1-8*t*t*t*t}function h2(i){return i*i*i*i*i}function u2(i){const t=i-1;return 1+t*t*t*t*t}function d2(i){const t=i-1;return i<.5?16*i*i*i*i*i:1+16*t*t*t*t*t}function g2(i){return i===0?0:Math.pow(2,10*(i-1))}function f2(i){return i===1?1:-Math.pow(2,-10*i)+1}function p2(i){if(i===0||i===1)return i;const t=i*2,e=t-1;return t<1?.5*Math.pow(2,10*e):.5*(-Math.pow(2,-10*e)+2)}function m2(i){const t=i/1;return-1*(Math.sqrt(1-t*i)-1)}function b2(i){const t=i-1;return Math.sqrt(1-t*t)}function y2(i){const t=i*2,e=t-2;return t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-e*e)+1)}function w2(i,t=1.70158){return i*i*((t+1)*i-t)}function C2(i,t=1.70158){const e=i/1-1;return e*e*((t+1)*e+t)+1}function A2(i,t=1.70158){const e=i*2,n=e-2,s=t*1.525;return e<1?.5*e*e*((s+1)*e-s):.5*(n*n*((s+1)*n+s)+2)}function x2(i,t=.7){if(i===0||i===1)return i;const n=i/1-1,s=1-t,o=s/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-o)*(2*Math.PI)/s))}function v2(i,t=.7){const e=1-t,n=i*2;if(i===0||i===1)return i;const s=e/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/e)+1}function E2(i,t=.65){const e=1-t;if(i===0||i===1)return i;const n=i*2,s=n-1,o=e/(2*Math.PI)*Math.asin(1);return n<1?-.5*(Math.pow(2,10*s)*Math.sin((s-o)*(2*Math.PI)/e)):Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/e)*.5+1}function Ho(i){const t=i/1;if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const e=t-.5454545454545454;return 7.5625*e*e+.75}if(t<2.5/2.75){const e=t-.8181818181818182;return 7.5625*e*e+.9375}{const e=t-.9545454545454546;return 7.5625*e*e+.984375}}function jc(i){return 1-Ho(1-i)}function S2(i){return i<.5?jc(i*2)*.5:Ho(i*2-1)*.5+.5}const M2=Object.freeze(Object.defineProperty({__proto__:null,bounce:q6,cubic:H6,decorators:X6,easeInBack:w2,easeInBounce:jc,easeInCirc:m2,easeInCubic:s2,easeInElastic:x2,easeInExpo:g2,easeInOutBack:A2,easeInOutBounce:S2,easeInOutCirc:y2,easeInOutCubic:r2,easeInOutElastic:E2,easeInOutExpo:p2,easeInOutQuad:i2,easeInOutQuart:c2,easeInOutQuint:d2,easeInOutSine:t2,easeInQuad:e2,easeInQuart:a2,easeInQuint:h2,easeInSine:$6,easeOutBack:C2,easeOutBounce:Ho,easeOutCirc:b2,easeOutCubic:o2,easeOutElastic:v2,easeOutExpo:f2,easeOutQuad:n2,easeOutQuart:l2,easeOutQuint:u2,easeOutSine:Z6,exponential:W6,inout:_6,linear:Jc,quad:Y6},Symbol.toStringTag,{value:"Module"}));function _o(i,t){const e=[];for(let n=0;n<i.length;n+=2){const s=i[n],o=i[n+1],r=Array.isArray(t)?t:[t],a=Jl(s,o,r);e.push(a)}return xo(e)}class B2{constructor(){this.listeners={}}on(t,e,n){return e==null?this:(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,n),this)}once(t,e,n){const s=(...o)=>(this.off(t,s),_o([e,n],o));return this.on(t,s,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const s=this.listeners;return(t?[t]:Object.keys(s)).forEach(r=>{const a=s[r];if(a){if(!(e||n)){delete s[r];return}for(let l=a.length-2;l>=0;l-=2)e&&a[l]!==e||n&&a[l+1]!==n||a.splice(l,2)}}),this}trigger(t,...e){let n=!0;if(t!=="*"){const o=this.listeners[t];o!=null&&(n=_o([...o],e))}const s=this.listeners["*"];return s!=null?xo([n,_o([...s],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}class vn{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}function Z(){return(i,t,e)=>{const n=e.value,s=i.__proto__;e.value=function(...o){this.disposed||(n.call(this,...o),s.dispose.call(this))}}}class Ft extends B2{dispose(){this.off()}}$([Z()],Ft.prototype,"dispose",null),Wy(Ft,vn);class Wo{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach(e=>{const n=this.map.get(e);t(n,e)})}dispose(){this.clear()}}function qo(i){const t=[],e=[];return Array.isArray(i)?t.push(...i):i.split("|").forEach(n=>{n.indexOf("&")===-1?t.push(n):e.push(...n.split("&"))}),{or:t,and:e}}function k2(i,t){if(i!=null&&t!=null){const e=qo(i),n=qo(t),s=e.or.sort(),o=n.or.sort(),r=e.and.sort(),a=n.and.sort(),l=(c,h)=>c.length===h.length&&(c.length===0||c.every((u,g)=>u===h[g]));return l(s,o)&&l(r,a)}return i==null&&t==null}function Ne(i,t,e){if(t==null||Array.isArray(t)&&t.length===0)return e?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:n,and:s}=qo(t),o=r=>{const a=`${r.toLowerCase()}Key`;return i[a]===!0};return n.some(r=>o(r))&&s.every(r=>o(r))}class yt{static create(t){return new yt(t)}constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if(typeof t=="object"){Object.entries(t).forEach(([r,a])=>{this.register(r,a,e)});return}this.exist(t)&&!n&&!Ul()&&this.onDuplicated(t);const s=this.options.process,o=s?F(s,this,t,e):e;return this.data[t]=o,o}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return t?this.data[t]!=null:!1}onDuplicated(t){try{throw this.options.onConflict&&F(this.options.onConflict,this,t),new Error(`${Hi(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),s=e?`${e} ${Nb(this.options.type)}`:this.options.type;return`${Hi(s)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return jy(t,Object.keys(this.data),e=>e)}}const T2={},Gc={position:gs("x","width","origin")},Yc={position:gs("y","height","origin")},I2={position:gs("x","width","corner")},P2={position:gs("y","height","corner")},Hc={set:Re("width","width")},_c={set:Re("height","height")},O2={set:Re("rx","width")},N2={set:Re("ry","height")},Wc={set:(i=>{const t=Re(i,"width"),e=Re(i,"height");return function(n,s){const o=s.refBBox,r=o.height>o.width?t:e;return F(r,this,n,s)}})("r")},R2={set(i,{refBBox:t}){let e=parseFloat(i);const n=xe(i);n&&(e/=100);const s=Math.sqrt(t.height*t.height+t.width*t.width);let o;return Number.isFinite(e)&&(n||e>=0&&e<=1?o=e*s:o=Math.max(e+s,0)),{r:o}}},D2={set:Re("cx","width")},L2={set:Re("cy","height")},qc={set:Zc({resetOffset:!0})},Q2={set:Zc({resetOffset:!1})},Xc={set:th({resetOffset:!0})},V2={set:th({resetOffset:!1})},z2=Wc,F2=qc,U2=Xc,K2=Gc,J2=Yc,j2=Hc,G2=_c;function gs(i,t,e){return(n,{refBBox:s})=>{if(n==null)return null;let o=parseFloat(n);const r=xe(n);r&&(o/=100);let a;if(Number.isFinite(o)){const c=s[e];r||o>0&&o<1?a=c[i]+s[t]*o:a=c[i]+o}const l=new A;return l[i]=a||0,l}}function Re(i,t){return(e,{refBBox:n})=>{let s=parseFloat(e);const o=xe(e);o&&(s/=100);const r={};if(Number.isFinite(s)){const a=o||s>=0&&s<=1?s*n[t]:Math.max(s+n[t],0);r[i]=a}return r}}function $c(i,t){const e="x6-shape",n=t&&t.resetOffset;return(s,{elem:o,refBBox:r})=>{let a=_e(o,e);if(!a||a.value!==s){const m=i(s);a={value:s,shape:m,shapeBBox:m.bbox()},_e(o,e,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),h=c.getOrigin(),u=r.getOrigin();c.x=u.x,c.y=u.y;const g=r.getMaxScaleToFit(c,u),f=c.width===0||r.width===0?1:g.sx,p=c.height===0||r.height===0?1:g.sy;return l.scale(f,p,h),n&&l.translate(-h.x,-h.y),l}}function Zc(i){function t(n){return J.parse(n)}const e=$c(t,i);return(n,s)=>({d:e(n,s).serialize()})}function th(i){const t=$c(e=>new St(e),i);return(e,n)=>({points:t(e,n).serialize()})}const Y2={qualify:se,set(i,{view:t}){return`url(#${t.graph.defineGradient(i)})`}},H2={qualify:se,set(i,{view:t}){const e=t.cell,n=Object.assign({},i);if(e.isEdge()&&n.type==="linearGradient"){const s=t,o=s.sourcePoint,r=s.targetPoint;n.id=`gradient-${n.type}-${e.id}`,n.attrs=Object.assign(Object.assign({},n.attrs),{x1:o.x,y1:o.y,x2:r.x,y2:r.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(n.id)}return`url(#${t.graph.defineGradient(n)})`}},eh={qualify(i,{attrs:t}){return t.textWrap==null||!se(t.textWrap)},set(i,{view:t,elem:e,attrs:n}){const s="x6-text",o=_e(e,s),r=h=>{try{return JSON.parse(h)}catch{return h}},a={x:n.x,eol:n.eol,annotations:r(n.annotations),textPath:r(n["text-path"]||n.textPath),textVerticalAnchor:n["text-vertical-anchor"]||n.textVerticalAnchor,displayEmpty:(n["display-empty"]||n.displayEmpty)==="true",lineHeight:n["line-height"]||n.lineHeight},l=n["font-size"]||n.fontSize,c=JSON.stringify([i,a]);if(l&&e.setAttribute("font-size",l),o==null||o!==c){const h=a.textPath;if(h!=null&&typeof h=="object"){const u=h.selector;if(typeof u=="string"){const g=t.find(u)[0];g instanceof SVGPathElement&&(Mo(g),a.textPath=Object.assign({"xlink:href":`#${g.id}`},h))}}bc(e,`${i}`,a),_e(e,s,c)}}},_2={qualify:se,set(i,{view:t,elem:e,attrs:n,refBBox:s}){const o=i,r=o.width||0;xe(r)?s.width*=parseFloat(r)/100:r<=0?s.width+=r:s.width=r;const a=o.height||0;xe(a)?s.height*=parseFloat(a)/100:a<=0?s.height+=a:s.height=a;let l,c=o.text;c==null&&(c=n.text||(e==null?void 0:e.textContent)),c!=null?l=wc(`${c}`,s,{"font-weight":n["font-weight"]||n.fontWeight,"font-size":n["font-size"]||n.fontSize,"font-family":n["font-family"]||n.fontFamily,lineHeight:n.lineHeight},{ellipsis:o.ellipsis}):l="",F(eh.set,this,l,{view:t,elem:e,attrs:n,refBBox:s,cell:t.cell})}},En=(i,{attrs:t})=>t.text!==void 0,W2={qualify:En},q2={qualify:En},X2={qualify:En},$2={qualify:En},Z2={qualify:En},t3={qualify:En},e3={qualify(i,{elem:t}){return t instanceof SVGElement},set(i,{elem:t}){const e="x6-title",n=`${i}`,s=_e(t,e);if(s==null||s!==n){_e(t,e,n);const o=t.firstChild;if(o&&o.tagName.toUpperCase()==="TITLE"){const r=o;r.textContent=n}else{const r=document.createElementNS(t.namespaceURI,"title");r.textContent=n,t.insertBefore(r,o)}}}},n3={offset:nh("x","width","right")},i3={offset:nh("y","height","bottom")},s3={offset(i,{refBBox:t}){return i?{x:-t.x,y:-t.y}:{x:0,y:0}}};function nh(i,t,e){return(n,{refBBox:s})=>{const o=new A;let r;return n==="middle"?r=s[t]/2:n===e?r=s[t]:typeof n=="number"&&Number.isFinite(n)?r=n>-1&&n<1?-s[t]*n:-n:xe(n)?r=s[t]*parseFloat(n)/100:r=0,o[i]=-(s[i]+r),o}}const o3={qualify:se,set(i,{elem:t}){nt(t,i)}},r3={set(i,{elem:t}){t.innerHTML=`${i}`}},a3={qualify:se,set(i,{view:t}){return`url(#${t.graph.defineFilter(i)})`}},l3={set(i){return i!=null&&typeof i=="object"&&i.id?i.id:i}},c3=i=>{var{size:t,width:e,height:n,offset:s,open:o}=i,r=Y(i,["size","width","height","offset","open"]);return ih({size:t,width:e,height:n,offset:s},o===!0,!0,void 0,r)},h3=i=>{var{size:t,width:e,height:n,offset:s,factor:o}=i,r=Y(i,["size","width","height","offset","factor"]);return ih({size:t,width:e,height:n,offset:s},!1,!1,o,r)};function ih(i,t,e,n=3/4,s={}){const o=i.size||10,r=i.width||o,a=i.height||o,l=new J,c={};if(t)l.moveTo(r,0).lineTo(0,a/2).lineTo(r,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(r,0),!e){const h=Ye(n,0,1);l.lineTo(r*h,a/2)}l.lineTo(r,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),s),{tagName:"path",d:fn(l.serialize(),{x:i.offset!=null?i.offset:-r/2})})}const u3=i=>{var{size:t,width:e,height:n,offset:s}=i,o=Y(i,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new J;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},o),{tagName:"path",d:fn(c.serialize(),s??-a/2)})},d3=i=>{var{d:t,offsetX:e,offsetY:n}=i,s=Y(i,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},s),{tagName:"path",d:fn(t,e,n)})},g3=i=>{var{size:t,width:e,height:n,offset:s}=i,o=Y(i,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new J;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:fn(c.serialize(),s||-a/2)})},f3=i=>{var{width:t,height:e,offset:n,open:s,flip:o}=i,r=Y(i,["width","height","offset","open","flip"]);let a=e||6;const l=t||10,c=s===!0,h=o===!0,u=Object.assign(Object.assign({},r),{tagName:"path"});h&&(a=-a);const g=new J;return g.moveTo(0,a).lineTo(l,0),c?u.fill="none":(g.lineTo(l,a),g.close()),u.d=fn(g.serialize(),{x:n||-l/2,y:a/2}),u},sh=i=>{var{r:t}=i,e=Y(i,["r"]);const n=t||5;return Object.assign(Object.assign({cx:n},e),{tagName:"circle",r:n})},p3=Object.freeze(Object.defineProperty({__proto__:null,async:f3,block:c3,circle:sh,circlePlus:i=>{var{r:t}=i,e=Y(i,["r"]);const n=t||5,s=new J;return s.moveTo(n,0).lineTo(n,n*2),s.moveTo(0,n).lineTo(n*2,n),{children:[Object.assign(Object.assign({},sh({r:n})),{fill:"none"}),Object.assign(Object.assign({},e),{tagName:"path",d:fn(s.serialize(),-n)})]}},classic:h3,cross:g3,diamond:u3,ellipse:i=>{var{rx:t,ry:e}=i,n=Y(i,["rx","ry"]);const s=t||5,o=e||5;return Object.assign(Object.assign({cx:s},n),{tagName:"ellipse",rx:s,ry:o})},path:d3},Symbol.toStringTag,{value:"Module"})),si=yt.create({type:"marker"});si.register(p3,!0);function Xo(i){return typeof i=="string"||se(i)}const m3={qualify:Xo,set(i,{view:t,attrs:e}){return $o("marker-start",i,t,e)}},b3={qualify:Xo,set(i,{view:t,attrs:e}){return $o("marker-end",i,t,e,{transform:"rotate(180)"})}},y3={qualify:Xo,set(i,{view:t,attrs:e}){return $o("marker-mid",i,t,e)}};function $o(i,t,e,n,s={}){const o=typeof t=="string"?{name:t}:t,{name:r,args:a}=o,l=Y(o,["name","args"]);let c=l;if(r&&typeof r=="string"){const u=si.get(r);if(u)c=u(Object.assign(Object.assign({},l),a));else return si.onNotFound(r)}const h=Object.assign(Object.assign(Object.assign({},w3(n,i)),s),c);return{[i]:`url(#${e.graph.defineMarker(h)})`}}function w3(i,t){const e={},n=i.stroke;if(typeof n=="string"&&(e.stroke=n,e.fill=n),t!=="marker-mid"){const s=parseFloat(i.strokeWidth||i["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);e.refX=t==="marker-start"?o:-o}}return e}const oi=(i,{view:t})=>t.cell.isEdge(),C3={qualify:oi,set(i,t){var e,n,s,o;const r=t.view,a=i.reverse||!1,l=i.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let h,u;const g=r.getConnectionLength()||0;l<0?(h=(g+l)/2,u=-l):(h=l,u=g-l*2);const f=r.getConnection();c=(o=(s=(n=(e=f==null?void 0:f.divideAtLength(h))===null||e===void 0?void 0:e[1])===null||n===void 0?void 0:n.divideAtLength(u))===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.serialize()}else{let h;l<0?h=((r.getConnectionLength()||0)+l)/2:h=l;const u=r.getConnection();if(u){const g=u.divideAtLength(h),f=u.divideAtLength(-h);g&&f&&(c=`${g[0].serialize()} ${f[1].serialize()}`)}}return{d:c||r.getConnectionPathData()}}},oh={qualify:oi,set:fs("getTangentAtLength",{rotate:!0})},A3={qualify:oi,set:fs("getTangentAtLength",{rotate:!1})},rh={qualify:oi,set:fs("getTangentAtRatio",{rotate:!0})},x3={qualify:oi,set:fs("getTangentAtRatio",{rotate:!1})},v3=oh,E3=rh;function fs(i,t){const e={x:1,y:0};return(n,s)=>{let o,r;const a=s.view,l=a[i](Number(n));return l?(r=t.rotate?l.vector().vectorAngle(e):0,o=l.start):(o=a.path.start,r=0),r===0||Number.isNaN(r)?{transform:`translate(${o.x},${o.y})`}:{transform:`translate(${o.x},${o.y}) rotate(${r})`}}}const S3=Object.freeze(Object.defineProperty({__proto__:null,annotations:$2,atConnectionLength:v3,atConnectionLengthIgnoreGradient:A3,atConnectionLengthKeepGradient:oh,atConnectionRatio:E3,atConnectionRatioIgnoreGradient:x3,atConnectionRatioKeepGradient:rh,connection:C3,displayEmpty:t3,eol:Z2,fill:Y2,filter:a3,html:r3,lineHeight:W2,port:l3,ref:T2,refCx:D2,refCy:L2,refD:F2,refDKeepOffset:Q2,refDResetOffset:qc,refDx:I2,refDy:P2,refHeight:_c,refHeight2:G2,refPoints:U2,refPointsKeepOffset:V2,refPointsResetOffset:Xc,refR:z2,refRCircumscribed:R2,refRInscribed:Wc,refRx:O2,refRy:N2,refWidth:Hc,refWidth2:j2,refX:Gc,refX2:K2,refY:Yc,refY2:J2,resetOffset:s3,sourceMarker:m3,stroke:H2,style:o3,targetMarker:b3,text:eh,textPath:X2,textVerticalAnchor:q2,textWrap:_2,title:e3,vertexMarker:y3,xAlign:n3,yAlign:i3},Symbol.toStringTag,{value:"Module"})),M3={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"};function B3(i,t,e){return!!(i!=null&&(typeof i=="string"||typeof i.qualify!="function"||F(i.qualify,this,t,e)))}const ah=Object.assign(Object.assign({},M3),S3),ri=yt.create({type:"attribute definition"});ri.register(ah,!0);const lh=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=e*2,t.height=n;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.translate(2*e,0),s.scale(-1,1),s.drawImage(i,0,0,e,n),t},ch=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=e,t.height=n*2;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.translate(0,2*n),s.scale(1,-1),s.drawImage(i,0,0,e,n),t},hh=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=2*e,t.height=2*n;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.setTransform(-1,0,0,-1,t.width,t.height),s.drawImage(i,0,0,e,n),s.setTransform(-1,0,0,1,t.width,0),s.drawImage(i,0,0,e,n),s.setTransform(1,0,0,-1,0,t.height),s.drawImage(i,0,0,e,n),t},ps=Object.assign({},Object.freeze(Object.defineProperty({__proto__:null,flipX:lh,flipXY:hh,flipY:ch,watermark:(i,t)=>{const e=i.width,n=i.height,s=document.createElement("canvas");s.width=e*3,s.height=n*3;const o=s.getContext("2d"),r=t.angle!=null?-t.angle:-20,a=Dt(r),l=s.width/4,c=s.height/4;for(let h=0;h<4;h+=1)for(let u=0;u<4;u+=1)(h+u)%2>0&&(o.setTransform(1,0,0,1,(2*h-1)*l,(2*u-1)*c),o.rotate(a),o.drawImage(i,-e/2,-n/2,e,n));return s}},Symbol.toStringTag,{value:"Module"})));ps["flip-x"]=lh,ps["flip-y"]=ch,ps["flip-xy"]=hh;const ms=yt.create({type:"background pattern"});ms.register(ps,!0);function bs(i,t,e){let n;if(typeof e=="object"){if(Number.isFinite(e.y)){const o=new z(t,i),{start:r,end:a}=o.parallel(e.y);t=r,i=a}n=e.x}else n=e;if(n==null||!Number.isFinite(n))return i;const s=i.distance(t);return n===0&&s>0?i:i.move(t,-Math.min(n,s-1))}function ys(i){const t=i.getAttribute("stroke-width");return t===null?0:parseFloat(t)||0}function k3(i){if(i==null)return null;let t=i;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}const uh=(i,t,e,n)=>{const s=t.getBBoxOfElement(e);n.stroked&&s.inflate(ys(e)/2);const o=i.intersect(s),r=o&&o.length?i.start.closest(o):i.end;return bs(r,i.start,n.offset)},T3=function(i,t,e,n,s){const o=t.cell,r=o.isNode()?o.getAngle():0;if(r===0)return F(uh,this,i,t,e,n,s);const a=t.getUnrotatedBBoxOfElement(e);n.stroked&&a.inflate(ys(e)/2);const l=a.getCenter(),c=i.clone().rotate(r,l),h=c.setLength(1e6).intersect(a),u=h&&h.length?c.start.closest(h).rotate(-r,l):i.end;return bs(u,i.start,n.offset)},I3=(i,t,e,n)=>{let s,o;const r=i.end,a=n.selector;if(typeof a=="string"?s=t.findOne(a):Array.isArray(a)?s=zo(e,a):s=k3(e),!Oe(s)){if(s===e||!Oe(e))return r;s=e}const l=t.getShapeOfElement(s),c=t.getMatrixOfElement(s),h=t.getRootTranslatedMatrix(),u=t.getRootRotatedMatrix(),g=h.multiply(u).multiply(c),f=g.inverse(),p=V6(i,f),m=p.start.clone(),b=t.getDataOfElement(s);if(n.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const x=b.shapeBBox;if(x!=null&&x.containsPoint(m))return r}n.extrapolate===!0&&p.setLength(1e6);let y;if(J.isPath(l)){const x=n.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:x})),y={precision:x,segmentSubdivisions:b.segmentSubdivisions},o=p.intersect(l,y)}else o=p.intersect(l);o?Array.isArray(o)&&(o=m.closest(o)):n.sticky===!0&&(P.isRectangle(l)?o=l.getNearestPointToPoint(m):jt.isEllipse(l)?o=l.intersectsWithLineFromCenterToPoint(m):o=l.closestPoint(m,y));const C=o?Ee(o,g):r;let w=n.offset||0;return n.stroked!==!1&&(typeof w=="object"?(w=Object.assign({},w),w.x==null&&(w.x=0),w.x+=ys(s)/2):w+=ys(s)/2),bs(C,i.start,w)};function P3(i,t,e=0){const{start:n,end:s}=i;let o,r,a,l;switch(t){case"left":l="x",o=s,r=n,a=-1;break;case"right":l="x",o=n,r=s,a=1;break;case"top":l="y",o=s,r=n,a=-1;break;case"bottom":l="y",o=n,r=s,a=1;break;default:return}n[l]<s[l]?o[l]=r[l]:r[l]=o[l],Number.isFinite(e)&&(o[l]+=a*e,r[l]+=a*e)}const O3=Object.freeze(Object.defineProperty({__proto__:null,anchor:(i,t,e,n)=>{const{alignOffset:s,align:o}=n;return o&&P3(i,o,s),bs(i.end,i.start,n.offset)},bbox:uh,boundary:I3,rect:T3},Symbol.toStringTag,{value:"Module"})),ai=yt.create({type:"connection point"});ai.register(O3,!0);const dh=1,ws=1/3,Cs=2/3;let li=[],As=[];function N3(i){let t=i.graph._jumpOverUpdateList;if(t==null&&(t=i.graph._jumpOverUpdateList=[],i.graph.on("cell:mouseup",()=>{const e=i.graph._jumpOverUpdateList;setTimeout(()=>{for(let n=0;n<e.length;n+=1)e[n].update()})}),i.graph.on("model:reseted",()=>{t=i.graph._jumpOverUpdateList=[]})),t.indexOf(i)<0){t.push(i);const e=()=>t.splice(t.indexOf(i),1);i.cell.once("change:connector",e),i.cell.once("removed",e)}}function Zo(i,t,e=[]){const n=[i,...e,t],s=[];return n.forEach((o,r)=>{const a=n[r+1];a!=null&&s.push(new z(o,a))}),s}function R3(i,t){const e=[];return t.forEach(n=>{const s=i.intersectsWithLine(n);if(s){const{x:o,y:r}=s,{start:a,end:l}=n,c=Math.round(a.x)===Math.round(o)&&Math.round(a.y)===Math.round(r),h=Math.round(l.x)===Math.round(o)&&Math.round(l.y)===Math.round(r);if(c||h)return;e.push(s)}}),e}function gh(i,t){return new z(i,t).squaredLength()}function D3(i,t,e){return t.reduce((n,s,o)=>{if(As.includes(s))return n;const r=n.pop()||i,a=A.create(s).move(r.start,-e);let l=A.create(s).move(r.start,+e);const c=t[o+1];if(c!=null){const g=l.distance(c);g<=e&&(l=c.move(r.start,g),As.push(c))}else if(a.distance(r.end)<e*2+dh)return n.push(r),n;if(l.distance(r.start)<e*2+dh)return n.push(r),n;const u=new z(a,l);return li.push(u),n.push(new z(r.start,a),u,new z(l,r.end)),n},[])}function fh(i,t,e,n){const s=new J;let o;return o=J.createSegment("M",i[0].start),s.appendSegment(o),i.forEach((r,a)=>{if(li.includes(r)){let l,c,h,u;if(e==="arc"){l=-90,c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const f=r.getCenter(),p=new z(f,r.end).rotate(l,f);let m;m=new z(r.start,f),h=m.pointAt(2/3).rotate(l,r.start),u=p.pointAt(1/3).rotate(-l,p.end),o=J.createSegment("C",h,u,p.end),s.appendSegment(o),m=new z(f,r.end),h=p.pointAt(1/3).rotate(l,p.end),u=m.pointAt(1/3).rotate(-l,r.end),o=J.createSegment("C",h,u,r.end),s.appendSegment(o)}else if(e==="gap")o=J.createSegment("M",r.end),s.appendSegment(o);else if(e==="cubic"){l=r.start.theta(r.end);const g=t*.6;let f=t*1.35;c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(f*=-1),h=new A(r.start.x+g,r.start.y+f).rotate(l,r.start),u=new A(r.end.x-g,r.end.y+f).rotate(l,r.end),o=J.createSegment("C",h,u,r.end),s.appendSegment(o)}}else{const l=i[a+1];n===0||!l||li.includes(l)?(o=J.createSegment("L",r.end),s.appendSegment(o)):L3(n,s,r.end,r.start,l.end)}}),s}function L3(i,t,e,n,s){const o=e.distance(n)/2,r=e.distance(s)/2,a=-Math.min(i,o),l=-Math.min(i,r),c=e.clone().move(n,a).round(),h=e.clone().move(s,l).round(),u=new A(ws*c.x+Cs*e.x,Cs*e.y+ws*c.y),g=new A(ws*h.x+Cs*e.x,Cs*e.y+ws*h.y);let f;f=J.createSegment("L",c),t.appendSegment(f),f=J.createSegment("C",u,g,h),t.appendSegment(f)}const ph=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(i,t,e,n={}){li=[],As=[],N3(this);const s=n.size||5,o=n.type||"arc",r=n.radius||0,a=n.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return fh(Zo(i,t,e),s,o,r);const u=this.cell,g=h.indexOf(u),f=l.options.connecting.connector||{},p=h.filter((x,E)=>{const S=x.getConnector()||f;return a.includes(S.name)?!1:E>g?S.name!=="jumpover":!0}),m=p.map(x=>l.findViewByCell(x)),b=Zo(i,t,e),y=m.map(x=>x==null?[]:x===this?b:Zo(x.sourcePoint,x.targetPoint,x.routePoints)),C=[];b.forEach(x=>{const E=p.reduce((S,v,M)=>{if(v!==u){const k=R3(x,y[M]);S.push(...k)}return S},[]).sort((S,v)=>gh(x.start,S)-gh(x.start,v));E.length>0?C.push(...D3(x,E,s)):C.push(x)});const w=fh(C,s,o,r);return li=[],As=[],n.raw?w:w.serialize()},loop:(i,t,e,n={})=>{const s=e.length===3?0:1,o=A.create(e[0+s]),r=A.create(e[2+s]),a=A.create(e[1+s]);if(!A.equals(i,t)){const c=new A((i.x+t.x)/2,(i.y+t.y)/2),h=c.angleBetween(A.create(i).rotate(90,c),a);h>1&&(o.rotate(180-h,c),r.rotate(180-h,c),a.rotate(180-h,c))}const l=`
|
|
1
|
+
(function(ht,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("element-plus"),require("pinia"),require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","pinia","monaco-editor"],d):(ht=typeof globalThis<"u"?globalThis:ht||self,d(ht.EmsEditor={},ht.Vue,ht.ElementPlus,ht.Pinia,ht.monaco))})(this,function(ht,d,St,be,zd){"use strict";function Fd(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const Qt=Fd(zd);/*! Element Plus Icons Vue v2.3.2 */var Ud=d.defineComponent({name:"Document",__name:"document",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),Jr=Ud,Kd=d.defineComponent({name:"FolderOpened",__name:"folder-opened",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"})]))}}),Jd=Kd,jd=d.defineComponent({name:"Folder",__name:"folder",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32"})]))}}),Gd=jd,Yd=d.defineComponent({name:"Menu",__name:"menu",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),Hd=Yd,_d=d.defineComponent({name:"Plus",__name:"plus",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Wd=_d,qd=d.defineComponent({name:"Search",__name:"search",setup(i){return(t,e)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),jr=qd;function Y(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(e[n[s]]=i[n[s]]);return e}function X(i,t,e,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(o=(s<3?r(o):s>3?r(t,e,o):r(t,e))||o);return s>3&&o&&Object.defineProperty(t,e,o),o}function Gs(i,t,e,n){function s(o){return o instanceof e?o:new e(function(r){r(o)})}return new(e||(e=Promise))(function(o,r){function a(h){try{c(n.next(h))}catch(u){r(u)}}function l(h){try{c(n.throw(h))}catch(u){r(u)}}function c(h){h.done?o(h.value):s(h.value).then(a,l)}c((n=n.apply(i,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function Xd(i){i.forEach(t=>{Object.hasOwn(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){const n=document.createDocumentFragment();e.forEach(s=>{const o=s instanceof Node;n.appendChild(o?s:document.createTextNode(String(s)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&(i=>{Xd(i)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var Gr=typeof global=="object"&&global&&global.Object===Object&&global,$d=typeof self=="object"&&self&&self.Object===Object&&self,ee=Gr||$d||Function("return this")(),Ht=ee.Symbol,Yr=Object.prototype,Zd=Yr.hasOwnProperty,tg=Yr.toString,Qn=Ht?Ht.toStringTag:void 0;function eg(i){var t=Zd.call(i,Qn),e=i[Qn];try{i[Qn]=void 0;var n=!0}catch{}var s=tg.call(i);return n&&(t?i[Qn]=e:delete i[Qn]),s}var ng=Object.prototype,ig=ng.toString;function sg(i){return ig.call(i)}var og="[object Null]",rg="[object Undefined]",Hr=Ht?Ht.toStringTag:void 0;function ke(i){return i==null?i===void 0?rg:og:Hr&&Hr in Object(i)?eg(i):sg(i)}function ne(i){return i!=null&&typeof i=="object"}var ag="[object Symbol]";function ue(i){return typeof i=="symbol"||ne(i)&&ke(i)==ag}function Ri(i,t){for(var e=-1,n=i==null?0:i.length,s=Array(n);++e<n;)s[e]=t(i[e],e,i);return s}var Ot=Array.isArray,_r=Ht?Ht.prototype:void 0,Wr=_r?_r.toString:void 0;function qr(i){if(typeof i=="string")return i;if(Ot(i))return Ri(i,qr)+"";if(ue(i))return Wr?Wr.call(i):"";var t=i+"";return t=="0"&&1/i==-1/0?"-0":t}var lg=/\s/;function cg(i){for(var t=i.length;t--&&lg.test(i.charAt(t)););return t}var hg=/^\s+/;function ug(i){return i&&i.slice(0,cg(i)+1).replace(hg,"")}function bt(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}var Xr=NaN,dg=/^[-+]0x[0-9a-f]+$/i,gg=/^0b[01]+$/i,fg=/^0o[0-7]+$/i,pg=parseInt;function Vn(i){if(typeof i=="number")return i;if(ue(i))return Xr;if(bt(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=bt(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=ug(i);var e=gg.test(i);return e||fg.test(i)?pg(i.slice(2),e?2:8):dg.test(i)?Xr:+i}function en(i){return i}var mg="[object AsyncFunction]",bg="[object Function]",yg="[object GeneratorFunction]",wg="[object Proxy]";function Ys(i){if(!bt(i))return!1;var t=ke(i);return t==bg||t==yg||t==mg||t==wg}var Hs=ee["__core-js_shared__"],$r=function(){var i=/[^.]+$/.exec(Hs&&Hs.keys&&Hs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function Cg(i){return!!$r&&$r in i}var Ag=Function.prototype,xg=Ag.toString;function Ke(i){if(i!=null){try{return xg.call(i)}catch{}try{return i+""}catch{}}return""}var vg=/[\\^$.*+?()[\]{}|]/g,Eg=/^\[object .+?Constructor\]$/,Sg=Function.prototype,Mg=Object.prototype,Bg=Sg.toString,kg=Mg.hasOwnProperty,Tg=RegExp("^"+Bg.call(kg).replace(vg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ig(i){if(!bt(i)||Cg(i))return!1;var t=Ys(i)?Tg:Eg;return t.test(Ke(i))}function Pg(i,t){return i==null?void 0:i[t]}function Je(i,t){var e=Pg(i,t);return Ig(e)?e:void 0}var _s=Je(ee,"WeakMap"),Zr=Object.create,Og=function(){function i(){}return function(t){if(!bt(t))return{};if(Zr)return Zr(t);i.prototype=t;var e=new i;return i.prototype=void 0,e}}();function ta(i,t,e){switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2])}return i.apply(t,e)}function Ng(){}function ea(i,t){var e=-1,n=i.length;for(t||(t=Array(n));++e<n;)t[e]=i[e];return t}var Rg=800,Dg=16,Lg=Date.now;function Qg(i){var t=0,e=0;return function(){var n=Lg(),s=Dg-(n-e);if(e=n,s>0){if(++t>=Rg)return arguments[0]}else t=0;return i.apply(void 0,arguments)}}function Vg(i){return function(){return i}}var Di=function(){try{var i=Je(Object,"defineProperty");return i({},"",{}),i}catch{}}(),zg=Di?function(i,t){return Di(i,"toString",{configurable:!0,enumerable:!1,value:Vg(t),writable:!0})}:en,na=Qg(zg);function Fg(i,t){for(var e=-1,n=i==null?0:i.length;++e<n&&t(i[e],e,i)!==!1;);return i}function Ug(i,t,e,n){for(var s=i.length,o=e+-1;++o<s;)if(t(i[o],o,i))return o;return-1}function Kg(i){return i!==i}function Jg(i,t,e){for(var n=e-1,s=i.length;++n<s;)if(i[n]===t)return n;return-1}function jg(i,t,e){return t===t?Jg(i,t,e):Ug(i,Kg,e)}function ia(i,t){var e=i==null?0:i.length;return!!e&&jg(i,t,0)>-1}var Gg=9007199254740991,Yg=/^(?:0|[1-9]\d*)$/;function Li(i,t){var e=typeof i;return t=t??Gg,!!t&&(e=="number"||e!="symbol"&&Yg.test(i))&&i>-1&&i%1==0&&i<t}function Qi(i,t,e){t=="__proto__"&&Di?Di(i,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):i[t]=e}function nn(i,t){return i===t||i!==i&&t!==t}var Hg=Object.prototype,_g=Hg.hasOwnProperty;function Ws(i,t,e){var n=i[t];(!(_g.call(i,t)&&nn(n,e))||e===void 0&&!(t in i))&&Qi(i,t,e)}function zn(i,t,e,n){var s=!e;e||(e={});for(var o=-1,r=t.length;++o<r;){var a=t[o],l=void 0;l===void 0&&(l=i[a]),s?Qi(e,a,l):Ws(e,a,l)}return e}var sa=Math.max;function oa(i,t,e){return t=sa(t===void 0?i.length-1:t,0),function(){for(var n=arguments,s=-1,o=sa(n.length-t,0),r=Array(o);++s<o;)r[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=e(r),ta(i,this,a)}}function sn(i,t){return na(oa(i,t,en),i+"")}var Wg=9007199254740991;function qs(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Wg}function je(i){return i!=null&&qs(i.length)&&!Ys(i)}function Vi(i,t,e){if(!bt(e))return!1;var n=typeof t;return(n=="number"?je(e)&&Li(t,e.length):n=="string"&&t in e)?nn(e[t],i):!1}function ra(i){return sn(function(t,e){var n=-1,s=e.length,o=s>1?e[s-1]:void 0,r=s>2?e[2]:void 0;for(o=i.length>3&&typeof o=="function"?(s--,o):void 0,r&&Vi(e[0],e[1],r)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var a=e[n];a&&i(t,a,n,o)}return t})}var qg=Object.prototype;function zi(i){var t=i&&i.constructor,e=typeof t=="function"&&t.prototype||qg;return i===e}function Xg(i,t){for(var e=-1,n=Array(i);++e<i;)n[e]=t(e);return n}var $g="[object Arguments]";function aa(i){return ne(i)&&ke(i)==$g}var la=Object.prototype,Zg=la.hasOwnProperty,tf=la.propertyIsEnumerable,on=aa(function(){return arguments}())?aa:function(i){return ne(i)&&Zg.call(i,"callee")&&!tf.call(i,"callee")};function ef(){return!1}var ca=typeof ht=="object"&&ht&&!ht.nodeType&&ht,ha=ca&&typeof module=="object"&&module&&!module.nodeType&&module,nf=ha&&ha.exports===ca,ua=nf?ee.Buffer:void 0,sf=ua?ua.isBuffer:void 0,rn=sf||ef,of="[object Arguments]",rf="[object Array]",af="[object Boolean]",lf="[object Date]",cf="[object Error]",hf="[object Function]",uf="[object Map]",df="[object Number]",gf="[object Object]",ff="[object RegExp]",pf="[object Set]",mf="[object String]",bf="[object WeakMap]",yf="[object ArrayBuffer]",wf="[object DataView]",Cf="[object Float32Array]",Af="[object Float64Array]",xf="[object Int8Array]",vf="[object Int16Array]",Ef="[object Int32Array]",Sf="[object Uint8Array]",Mf="[object Uint8ClampedArray]",Bf="[object Uint16Array]",kf="[object Uint32Array]",ut={};ut[Cf]=ut[Af]=ut[xf]=ut[vf]=ut[Ef]=ut[Sf]=ut[Mf]=ut[Bf]=ut[kf]=!0,ut[of]=ut[rf]=ut[yf]=ut[af]=ut[wf]=ut[lf]=ut[cf]=ut[hf]=ut[uf]=ut[df]=ut[gf]=ut[ff]=ut[pf]=ut[mf]=ut[bf]=!1;function Tf(i){return ne(i)&&qs(i.length)&&!!ut[ke(i)]}function Fi(i){return function(t){return i(t)}}var da=typeof ht=="object"&&ht&&!ht.nodeType&&ht,Fn=da&&typeof module=="object"&&module&&!module.nodeType&&module,If=Fn&&Fn.exports===da,Xs=If&&Gr.process,an=function(){try{var i=Fn&&Fn.require&&Fn.require("util").types;return i||Xs&&Xs.binding&&Xs.binding("util")}catch{}}(),ga=an&&an.isTypedArray,Ui=ga?Fi(ga):Tf,Pf=Object.prototype,Of=Pf.hasOwnProperty;function fa(i,t){var e=Ot(i),n=!e&&on(i),s=!e&&!n&&rn(i),o=!e&&!n&&!s&&Ui(i),r=e||n||s||o,a=r?Xg(i.length,String):[],l=a.length;for(var c in i)(t||Of.call(i,c))&&!(r&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Li(c,l)))&&a.push(c);return a}function pa(i,t){return function(e){return i(t(e))}}var Nf=pa(Object.keys,Object),Rf=Object.prototype,Df=Rf.hasOwnProperty;function ma(i){if(!zi(i))return Nf(i);var t=[];for(var e in Object(i))Df.call(i,e)&&e!="constructor"&&t.push(e);return t}function Un(i){return je(i)?fa(i):ma(i)}function Lf(i){var t=[];if(i!=null)for(var e in Object(i))t.push(e);return t}var Qf=Object.prototype,Vf=Qf.hasOwnProperty;function zf(i){if(!bt(i))return Lf(i);var t=zi(i),e=[];for(var n in i)n=="constructor"&&(t||!Vf.call(i,n))||e.push(n);return e}function ln(i){return je(i)?fa(i,!0):zf(i)}var Ff=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uf=/^\w*$/;function $s(i,t){if(Ot(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||ue(i)?!0:Uf.test(i)||!Ff.test(i)||t!=null&&i in Object(t)}var Kn=Je(Object,"create");function Kf(){this.__data__=Kn?Kn(null):{},this.size=0}function Jf(i){var t=this.has(i)&&delete this.__data__[i];return this.size-=t?1:0,t}var jf="__lodash_hash_undefined__",Gf=Object.prototype,Yf=Gf.hasOwnProperty;function Hf(i){var t=this.__data__;if(Kn){var e=t[i];return e===jf?void 0:e}return Yf.call(t,i)?t[i]:void 0}var _f=Object.prototype,Wf=_f.hasOwnProperty;function qf(i){var t=this.__data__;return Kn?t[i]!==void 0:Wf.call(t,i)}var Xf="__lodash_hash_undefined__";function $f(i,t){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=Kn&&t===void 0?Xf:t,this}function Ge(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Ge.prototype.clear=Kf,Ge.prototype.delete=Jf,Ge.prototype.get=Hf,Ge.prototype.has=qf,Ge.prototype.set=$f;function Zf(){this.__data__=[],this.size=0}function Ki(i,t){for(var e=i.length;e--;)if(nn(i[e][0],t))return e;return-1}var tp=Array.prototype,ep=tp.splice;function np(i){var t=this.__data__,e=Ki(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():ep.call(t,e,1),--this.size,!0}function ip(i){var t=this.__data__,e=Ki(t,i);return e<0?void 0:t[e][1]}function sp(i){return Ki(this.__data__,i)>-1}function op(i,t){var e=this.__data__,n=Ki(e,i);return n<0?(++this.size,e.push([i,t])):e[n][1]=t,this}function ye(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}ye.prototype.clear=Zf,ye.prototype.delete=np,ye.prototype.get=ip,ye.prototype.has=sp,ye.prototype.set=op;var Jn=Je(ee,"Map");function rp(){this.size=0,this.__data__={hash:new Ge,map:new(Jn||ye),string:new Ge}}function ap(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function Ji(i,t){var e=i.__data__;return ap(t)?e[typeof t=="string"?"string":"hash"]:e.map}function lp(i){var t=Ji(this,i).delete(i);return this.size-=t?1:0,t}function cp(i){return Ji(this,i).get(i)}function hp(i){return Ji(this,i).has(i)}function up(i,t){var e=Ji(this,i),n=e.size;return e.set(i,t),this.size+=e.size==n?0:1,this}function we(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}we.prototype.clear=rp,we.prototype.delete=lp,we.prototype.get=cp,we.prototype.has=hp,we.prototype.set=up;var dp="Expected a function";function Zs(i,t){if(typeof i!="function"||t!=null&&typeof t!="function")throw new TypeError(dp);var e=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=e.cache;if(o.has(s))return o.get(s);var r=i.apply(this,n);return e.cache=o.set(s,r)||o,r};return e.cache=new(Zs.Cache||we),e}Zs.Cache=we;var gp=500;function fp(i){var t=Zs(i,function(n){return e.size===gp&&e.clear(),n}),e=t.cache;return t}var pp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mp=/\\(\\)?/g,bp=fp(function(i){var t=[];return i.charCodeAt(0)===46&&t.push(""),i.replace(pp,function(e,n,s,o){t.push(s?o.replace(mp,"$1"):n||e)}),t});function cn(i){return i==null?"":qr(i)}function ji(i,t){return Ot(i)?i:$s(i,t)?[i]:bp(cn(i))}function jn(i){if(typeof i=="string"||ue(i))return i;var t=i+"";return t=="0"&&1/i==-1/0?"-0":t}function Gi(i,t){t=ji(t,i);for(var e=0,n=t.length;i!=null&&e<n;)i=i[jn(t[e++])];return e&&e==n?i:void 0}function yp(i,t,e){var n=i==null?void 0:Gi(i,t);return n===void 0?e:n}function to(i,t){for(var e=-1,n=t.length,s=i.length;++e<n;)i[s+e]=t[e];return i}var ba=Ht?Ht.isConcatSpreadable:void 0;function wp(i){return Ot(i)||on(i)||!!(ba&&i&&i[ba])}function Yi(i,t,e,n,s){var o=-1,r=i.length;for(e||(e=wp),s||(s=[]);++o<r;){var a=i[o];e(a)?to(s,a):n||(s[s.length]=a)}return s}function Cp(i){var t=i==null?0:i.length;return t?Yi(i):[]}function Ap(i){return na(oa(i,void 0,Cp),i+"")}var eo=pa(Object.getPrototypeOf,Object),xp="[object Object]",vp=Function.prototype,Ep=Object.prototype,ya=vp.toString,Sp=Ep.hasOwnProperty,Mp=ya.call(Object);function ie(i){if(!ne(i)||ke(i)!=xp)return!1;var t=eo(i);if(t===null)return!0;var e=Sp.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&ya.call(e)==Mp}function Bp(i,t,e){var n=-1,s=i.length;t<0&&(t=-t>s?0:s+t),e=e>s?s:e,e<0&&(e+=s),s=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=i[n+t];return o}function kp(i,t,e){var n=i.length;return e=e===void 0?n:e,!t&&e>=n?i:Bp(i,t,e)}var Tp="\\ud800-\\udfff",Ip="\\u0300-\\u036f",Pp="\\ufe20-\\ufe2f",Op="\\u20d0-\\u20ff",Np=Ip+Pp+Op,Rp="\\ufe0e\\ufe0f",Dp="\\u200d",Lp=RegExp("["+Dp+Tp+Np+Rp+"]");function wa(i){return Lp.test(i)}function Qp(i){return i.split("")}var Ca="\\ud800-\\udfff",Vp="\\u0300-\\u036f",zp="\\ufe20-\\ufe2f",Fp="\\u20d0-\\u20ff",Up=Vp+zp+Fp,Kp="\\ufe0e\\ufe0f",Jp="["+Ca+"]",no="["+Up+"]",io="\\ud83c[\\udffb-\\udfff]",jp="(?:"+no+"|"+io+")",Aa="[^"+Ca+"]",xa="(?:\\ud83c[\\udde6-\\uddff]){2}",va="[\\ud800-\\udbff][\\udc00-\\udfff]",Gp="\\u200d",Ea=jp+"?",Sa="["+Kp+"]?",Yp="(?:"+Gp+"(?:"+[Aa,xa,va].join("|")+")"+Sa+Ea+")*",Hp=Sa+Ea+Yp,_p="(?:"+[Aa+no+"?",no,xa,va,Jp].join("|")+")",Wp=RegExp(io+"(?="+io+")|"+_p+Hp,"g");function qp(i){return i.match(Wp)||[]}function Xp(i){return wa(i)?qp(i):Qp(i)}function Ma(i){return function(t){t=cn(t);var e=wa(t)?Xp(t):void 0,n=e?e[0]:t.charAt(0),s=e?kp(e,1).join(""):t.slice(1);return n[i]()+s}}var Hi=Ma("toUpperCase");function $p(i){return Hi(cn(i).toLowerCase())}function Zp(i,t,e,n){for(var s=-1,o=i==null?0:i.length;++s<o;)e=t(e,i[s],s,i);return e}function tm(i){return function(t){return i==null?void 0:i[t]}}var em={À:"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",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,sm="\\u0300-\\u036f",om="\\ufe20-\\ufe2f",rm="\\u20d0-\\u20ff",am=sm+om+rm,lm="["+am+"]",cm=RegExp(lm,"g");function hm(i){return i=cn(i),i&&i.replace(im,nm).replace(cm,"")}var um=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function dm(i){return i.match(um)||[]}var gm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function fm(i){return gm.test(i)}var Ba="\\ud800-\\udfff",pm="\\u0300-\\u036f",mm="\\ufe20-\\ufe2f",bm="\\u20d0-\\u20ff",ym=pm+mm+bm,ka="\\u2700-\\u27bf",Ta="a-z\\xdf-\\xf6\\xf8-\\xff",wm="\\xac\\xb1\\xd7\\xf7",Cm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Am="\\u2000-\\u206f",xm=" \\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",Ia="A-Z\\xc0-\\xd6\\xd8-\\xde",vm="\\ufe0e\\ufe0f",Pa=wm+Cm+Am+xm,Oa="['’]",Na="["+Pa+"]",Em="["+ym+"]",Ra="\\d+",Sm="["+ka+"]",Da="["+Ta+"]",La="[^"+Ba+Pa+Ra+ka+Ta+Ia+"]",Mm="\\ud83c[\\udffb-\\udfff]",Bm="(?:"+Em+"|"+Mm+")",km="[^"+Ba+"]",Qa="(?:\\ud83c[\\udde6-\\uddff]){2}",Va="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="["+Ia+"]",Tm="\\u200d",za="(?:"+Da+"|"+La+")",Im="(?:"+hn+"|"+La+")",Fa="(?:"+Oa+"(?:d|ll|m|re|s|t|ve))?",Ua="(?:"+Oa+"(?:D|LL|M|RE|S|T|VE))?",Ka=Bm+"?",Ja="["+vm+"]?",Pm="(?:"+Tm+"(?:"+[km,Qa,Va].join("|")+")"+Ja+Ka+")*",Om="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rm=Ja+Ka+Pm,Dm="(?:"+[Sm,Qa,Va].join("|")+")"+Rm,Lm=RegExp([hn+"?"+Da+"+"+Fa+"(?="+[Na,hn,"$"].join("|")+")",Im+"+"+Ua+"(?="+[Na,hn+za,"$"].join("|")+")",hn+"?"+za+"+"+Fa,hn+"+"+Ua,Nm,Om,Ra,Dm].join("|"),"g");function Qm(i){return i.match(Lm)||[]}function Vm(i,t,e){return i=cn(i),t=t,t===void 0?fm(i)?Qm(i):dm(i):i.match(t)||[]}var zm="['’]",Fm=RegExp(zm,"g");function ja(i){return function(t){return Zp(Vm(hm(t).replace(Fm,"")),i,"")}}var Gn=ja(function(i,t,e){return t=t.toLowerCase(),i+(e?$p(t):t)});function Ga(){if(!arguments.length)return[];var i=arguments[0];return Ot(i)?i:[i]}function Um(i,t,e){return i===i&&(e!==void 0&&(i=i<=e?i:e),t!==void 0&&(i=i>=t?i:t)),i}function Ye(i,t,e){return e===void 0&&(e=t,t=void 0),e!==void 0&&(e=Vn(e),e=e===e?e:0),t!==void 0&&(t=Vn(t),t=t===t?t:0),Um(Vn(i),t,e)}function Km(){this.__data__=new ye,this.size=0}function Jm(i){var t=this.__data__,e=t.delete(i);return this.size=t.size,e}function jm(i){return this.__data__.get(i)}function Gm(i){return this.__data__.has(i)}var Ym=200;function Hm(i,t){var e=this.__data__;if(e instanceof ye){var n=e.__data__;if(!Jn||n.length<Ym-1)return n.push([i,t]),this.size=++e.size,this;e=this.__data__=new we(n)}return e.set(i,t),this.size=e.size,this}function se(i){var t=this.__data__=new ye(i);this.size=t.size}se.prototype.clear=Km,se.prototype.delete=Jm,se.prototype.get=jm,se.prototype.has=Gm,se.prototype.set=Hm;function _m(i,t){return i&&zn(t,Un(t),i)}function Wm(i,t){return i&&zn(t,ln(t),i)}var Ya=typeof ht=="object"&&ht&&!ht.nodeType&&ht,Ha=Ya&&typeof module=="object"&&module&&!module.nodeType&&module,qm=Ha&&Ha.exports===Ya,_a=qm?ee.Buffer:void 0,Wa=_a?_a.allocUnsafe:void 0;function qa(i,t){if(t)return i.slice();var e=i.length,n=Wa?Wa(e):new i.constructor(e);return i.copy(n),n}function Xm(i,t){for(var e=-1,n=i==null?0:i.length,s=0,o=[];++e<n;){var r=i[e];t(r,e,i)&&(o[s++]=r)}return o}function Xa(){return[]}var $m=Object.prototype,Zm=$m.propertyIsEnumerable,$a=Object.getOwnPropertySymbols,so=$a?function(i){return i==null?[]:(i=Object(i),Xm($a(i),function(t){return Zm.call(i,t)}))}:Xa;function t0(i,t){return zn(i,so(i),t)}var e0=Object.getOwnPropertySymbols,Za=e0?function(i){for(var t=[];i;)to(t,so(i)),i=eo(i);return t}:Xa;function n0(i,t){return zn(i,Za(i),t)}function tl(i,t,e){var n=t(i);return Ot(i)?n:to(n,e(i))}function oo(i){return tl(i,Un,so)}function i0(i){return tl(i,ln,Za)}var ro=Je(ee,"DataView"),ao=Je(ee,"Promise"),un=Je(ee,"Set"),el="[object Map]",s0="[object Object]",nl="[object Promise]",il="[object Set]",sl="[object WeakMap]",ol="[object DataView]",o0=Ke(ro),r0=Ke(Jn),a0=Ke(ao),l0=Ke(un),c0=Ke(_s),_t=ke;(ro&&_t(new ro(new ArrayBuffer(1)))!=ol||Jn&&_t(new Jn)!=el||ao&&_t(ao.resolve())!=nl||un&&_t(new un)!=il||_s&&_t(new _s)!=sl)&&(_t=function(i){var t=ke(i),e=t==s0?i.constructor:void 0,n=e?Ke(e):"";if(n)switch(n){case o0:return ol;case r0:return el;case a0:return nl;case l0:return il;case c0:return sl}return t});var h0=Object.prototype,u0=h0.hasOwnProperty;function d0(i){var t=i.length,e=new i.constructor(t);return t&&typeof i[0]=="string"&&u0.call(i,"index")&&(e.index=i.index,e.input=i.input),e}var _i=ee.Uint8Array;function lo(i){var t=new i.constructor(i.byteLength);return new _i(t).set(new _i(i)),t}function g0(i,t){var e=t?lo(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.byteLength)}var f0=/\w*$/;function p0(i){var t=new i.constructor(i.source,f0.exec(i));return t.lastIndex=i.lastIndex,t}var rl=Ht?Ht.prototype:void 0,al=rl?rl.valueOf:void 0;function m0(i){return al?Object(al.call(i)):{}}function ll(i,t){var e=t?lo(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.length)}var b0="[object Boolean]",y0="[object Date]",w0="[object Map]",C0="[object Number]",A0="[object RegExp]",x0="[object Set]",v0="[object String]",E0="[object Symbol]",S0="[object ArrayBuffer]",M0="[object DataView]",B0="[object Float32Array]",k0="[object Float64Array]",T0="[object Int8Array]",I0="[object Int16Array]",P0="[object Int32Array]",O0="[object Uint8Array]",N0="[object Uint8ClampedArray]",R0="[object Uint16Array]",D0="[object Uint32Array]";function L0(i,t,e){var n=i.constructor;switch(t){case S0:return lo(i);case b0:case y0:return new n(+i);case M0:return g0(i,e);case B0:case k0:case T0:case I0:case P0:case O0:case N0:case R0:case D0:return ll(i,e);case w0:return new n;case C0:case v0:return new n(i);case A0:return p0(i);case x0:return new n;case E0:return m0(i)}}function cl(i){return typeof i.constructor=="function"&&!zi(i)?Og(eo(i)):{}}var Q0="[object Map]";function V0(i){return ne(i)&&_t(i)==Q0}var hl=an&&an.isMap,z0=hl?Fi(hl):V0,F0="[object Set]";function U0(i){return ne(i)&&_t(i)==F0}var ul=an&&an.isSet,K0=ul?Fi(ul):U0,J0=1,j0=2,G0=4,dl="[object Arguments]",Y0="[object Array]",H0="[object Boolean]",_0="[object Date]",W0="[object Error]",gl="[object Function]",q0="[object GeneratorFunction]",X0="[object Map]",$0="[object Number]",fl="[object Object]",Z0="[object RegExp]",t1="[object Set]",e1="[object String]",n1="[object Symbol]",i1="[object WeakMap]",s1="[object ArrayBuffer]",o1="[object DataView]",r1="[object Float32Array]",a1="[object Float64Array]",l1="[object Int8Array]",c1="[object Int16Array]",h1="[object Int32Array]",u1="[object Uint8Array]",d1="[object Uint8ClampedArray]",g1="[object Uint16Array]",f1="[object Uint32Array]",at={};at[dl]=at[Y0]=at[s1]=at[o1]=at[H0]=at[_0]=at[r1]=at[a1]=at[l1]=at[c1]=at[h1]=at[X0]=at[$0]=at[fl]=at[Z0]=at[t1]=at[e1]=at[n1]=at[u1]=at[d1]=at[g1]=at[f1]=!0,at[W0]=at[gl]=at[i1]=!1;function Yn(i,t,e,n,s,o){var r,a=t&J0,l=t&j0,c=t&G0;if(r!==void 0)return r;if(!bt(i))return i;var h=Ot(i);if(h){if(r=d0(i),!a)return ea(i,r)}else{var u=_t(i),g=u==gl||u==q0;if(rn(i))return qa(i,a);if(u==fl||u==dl||g&&!s){if(r=l||g?{}:cl(i),!a)return l?n0(i,Wm(r,i)):t0(i,_m(r,i))}else{if(!at[u])return s?i:{};r=L0(i,u,a)}}o||(o=new se);var f=o.get(i);if(f)return f;o.set(i,r),K0(i)?i.forEach(function(b){r.add(Yn(b,t,e,b,i,o))}):z0(i)&&i.forEach(function(b,y){r.set(y,Yn(b,t,e,y,i,o))});var p=c?l?i0:oo:l?ln:Un,m=h?void 0:p(i);return Fg(m||i,function(b,y){m&&(y=b,b=i[y]),Ws(r,y,Yn(b,t,e,y,i,o))}),r}var p1=4;function co(i){return Yn(i,p1)}var m1=1,b1=4;function dt(i){return Yn(i,m1|b1)}var y1="__lodash_hash_undefined__";function w1(i){return this.__data__.set(i,y1),this}function C1(i){return this.__data__.has(i)}function dn(i){var t=-1,e=i==null?0:i.length;for(this.__data__=new we;++t<e;)this.add(i[t])}dn.prototype.add=dn.prototype.push=w1,dn.prototype.has=C1;function A1(i,t){for(var e=-1,n=i==null?0:i.length;++e<n;)if(t(i[e],e,i))return!0;return!1}function ho(i,t){return i.has(t)}var x1=1,v1=2;function pl(i,t,e,n,s,o){var r=e&x1,a=i.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=o.get(i),h=o.get(t);if(c&&h)return c==t&&h==i;var u=-1,g=!0,f=e&v1?new dn:void 0;for(o.set(i,t),o.set(t,i);++u<a;){var p=i[u],m=t[u];if(n)var b=r?n(m,p,u,t,i,o):n(p,m,u,i,t,o);if(b!==void 0){if(b)continue;g=!1;break}if(f){if(!A1(t,function(y,w){if(!ho(f,w)&&(p===y||s(p,y,e,n,o)))return f.push(w)})){g=!1;break}}else if(!(p===m||s(p,m,e,n,o))){g=!1;break}}return o.delete(i),o.delete(t),g}function E1(i){var t=-1,e=Array(i.size);return i.forEach(function(n,s){e[++t]=[s,n]}),e}function uo(i){var t=-1,e=Array(i.size);return i.forEach(function(n){e[++t]=n}),e}var S1=1,M1=2,B1="[object Boolean]",k1="[object Date]",T1="[object Error]",I1="[object Map]",P1="[object Number]",O1="[object RegExp]",N1="[object Set]",R1="[object String]",D1="[object Symbol]",L1="[object ArrayBuffer]",Q1="[object DataView]",ml=Ht?Ht.prototype:void 0,go=ml?ml.valueOf:void 0;function V1(i,t,e,n,s,o,r){switch(e){case Q1:if(i.byteLength!=t.byteLength||i.byteOffset!=t.byteOffset)return!1;i=i.buffer,t=t.buffer;case L1:return!(i.byteLength!=t.byteLength||!o(new _i(i),new _i(t)));case B1:case k1:case P1:return nn(+i,+t);case T1:return i.name==t.name&&i.message==t.message;case O1:case R1:return i==t+"";case I1:var a=E1;case N1:var l=n&S1;if(a||(a=uo),i.size!=t.size&&!l)return!1;var c=r.get(i);if(c)return c==t;n|=M1,r.set(i,t);var h=pl(a(i),a(t),n,s,o,r);return r.delete(i),h;case D1:if(go)return go.call(i)==go.call(t)}return!1}var z1=1,F1=Object.prototype,U1=F1.hasOwnProperty;function K1(i,t,e,n,s,o){var r=e&z1,a=oo(i),l=a.length,c=oo(t),h=c.length;if(l!=h&&!r)return!1;for(var u=l;u--;){var g=a[u];if(!(r?g in t:U1.call(t,g)))return!1}var f=o.get(i),p=o.get(t);if(f&&p)return f==t&&p==i;var m=!0;o.set(i,t),o.set(t,i);for(var b=r;++u<l;){g=a[u];var y=i[g],w=t[g];if(n)var C=r?n(w,y,g,t,i,o):n(y,w,g,i,t,o);if(!(C===void 0?y===w||s(y,w,e,n,o):C)){m=!1;break}b||(b=g=="constructor")}if(m&&!b){var x=i.constructor,E=t.constructor;x!=E&&"constructor"in i&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof E=="function"&&E instanceof E)&&(m=!1)}return o.delete(i),o.delete(t),m}var J1=1,bl="[object Arguments]",yl="[object Array]",Wi="[object Object]",j1=Object.prototype,wl=j1.hasOwnProperty;function G1(i,t,e,n,s,o){var r=Ot(i),a=Ot(t),l=r?yl:_t(i),c=a?yl:_t(t);l=l==bl?Wi:l,c=c==bl?Wi:c;var h=l==Wi,u=c==Wi,g=l==c;if(g&&rn(i)){if(!rn(t))return!1;r=!0,h=!1}if(g&&!h)return o||(o=new se),r||Ui(i)?pl(i,t,e,n,s,o):V1(i,t,l,e,n,s,o);if(!(e&J1)){var f=h&&wl.call(i,"__wrapped__"),p=u&&wl.call(t,"__wrapped__");if(f||p){var m=f?i.value():i,b=p?t.value():t;return o||(o=new se),s(m,b,e,n,o)}}return g?(o||(o=new se),K1(i,t,e,n,s,o)):!1}function qi(i,t,e,n,s){return i===t?!0:i==null||t==null||!ne(i)&&!ne(t)?i!==i&&t!==t:G1(i,t,e,n,qi,s)}var Y1=1,H1=2;function _1(i,t,e,n){var s=e.length,o=s;if(i==null)return!o;for(i=Object(i);s--;){var r=e[s];if(r[2]?r[1]!==i[r[0]]:!(r[0]in i))return!1}for(;++s<o;){r=e[s];var a=r[0],l=i[a],c=r[1];if(r[2]){if(l===void 0&&!(a in i))return!1}else{var h=new se,u;if(!(u===void 0?qi(c,l,Y1|H1,n,h):u))return!1}}return!0}function Cl(i){return i===i&&!bt(i)}function W1(i){for(var t=Un(i),e=t.length;e--;){var n=t[e],s=i[n];t[e]=[n,s,Cl(s)]}return t}function Al(i,t){return function(e){return e==null?!1:e[i]===t&&(t!==void 0||i in Object(e))}}function q1(i){var t=W1(i);return t.length==1&&t[0][2]?Al(t[0][0],t[0][1]):function(e){return e===i||_1(e,i,t)}}function X1(i,t){return i!=null&&t in Object(i)}function xl(i,t,e){t=ji(t,i);for(var n=-1,s=t.length,o=!1;++n<s;){var r=jn(t[n]);if(!(o=i!=null&&e(i,r)))break;i=i[r]}return o||++n!=s?o:(s=i==null?0:i.length,!!s&&qs(s)&&Li(r,s)&&(Ot(i)||on(i)))}function vl(i,t){return i!=null&&xl(i,t,X1)}var $1=1,Z1=2;function tb(i,t){return $s(i)&&Cl(t)?Al(jn(i),t):function(e){var n=yp(e,i);return n===void 0&&n===t?vl(e,i):qi(t,n,$1|Z1)}}function eb(i){return function(t){return t==null?void 0:t[i]}}function nb(i){return function(t){return Gi(t,i)}}function ib(i){return $s(i)?eb(jn(i)):nb(i)}function fo(i){return typeof i=="function"?i:i==null?en:typeof i=="object"?Ot(i)?tb(i[0],i[1]):q1(i):ib(i)}function sb(i,t,e,n){for(var s=-1,o=i==null?0:i.length;++s<o;){var r=i[s];t(n,r,e(r),i)}return n}function ob(i){return function(t,e,n){for(var s=-1,o=Object(t),r=n(t),a=r.length;a--;){var l=r[++s];if(e(o[l],l,o)===!1)break}return t}}var El=ob();function rb(i,t){return i&&El(i,t,Un)}function ab(i,t){return function(e,n){if(e==null)return e;if(!je(e))return i(e,n);for(var s=e.length,o=-1,r=Object(e);++o<s&&n(r[o],o,r)!==!1;);return e}}var Sl=ab(rb);function lb(i,t,e,n){return Sl(i,function(s,o,r){t(n,s,e(s),r)}),n}function cb(i,t){return function(e,n){var s=Ot(e)?sb:lb,o=t?t():{};return s(e,i,fo(n),o)}}var po=function(){return ee.Date.now()},hb="Expected a function",ub=Math.max,db=Math.min;function Xi(i,t,e){var n,s,o,r,a,l,c=0,h=!1,u=!1,g=!0;if(typeof i!="function")throw new TypeError(hb);t=Vn(t)||0,bt(e)&&(h=!!e.leading,u="maxWait"in e,o=u?ub(Vn(e.maxWait)||0,t):o,g="trailing"in e?!!e.trailing:g);function f(S){var v=n,M=s;return n=s=void 0,c=S,r=i.apply(M,v),r}function p(S){return c=S,a=setTimeout(y,t),h?f(S):r}function m(S){var v=S-l,M=S-c,k=t-v;return u?db(k,o-M):k}function b(S){var v=S-l,M=S-c;return l===void 0||v>=t||v<0||u&&M>=o}function y(){var S=po();if(b(S))return w(S);a=setTimeout(y,m(S))}function w(S){return a=void 0,g&&n?f(S):(n=s=void 0,r)}function C(){a!==void 0&&clearTimeout(a),c=0,n=l=s=a=void 0}function x(){return a===void 0?r:w(po())}function E(){var S=po(),v=b(S);if(n=arguments,s=this,l=S,v){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(y,t),f(l)}return a===void 0&&(a=setTimeout(y,t)),r}return E.cancel=C,E.flush=x,E}var Ml=Object.prototype,gb=Ml.hasOwnProperty,fb=sn(function(i,t){i=Object(i);var e=-1,n=t.length,s=n>2?t[2]:void 0;for(s&&Vi(t[0],t[1],s)&&(n=1);++e<n;)for(var o=t[e],r=ln(o),a=-1,l=r.length;++a<l;){var c=r[a],h=i[c];(h===void 0||nn(h,Ml[c])&&!gb.call(i,c))&&(i[c]=o[c])}return i});function mo(i,t,e){(e!==void 0&&!nn(i[t],e)||e===void 0&&!(t in i))&&Qi(i,t,e)}function $i(i){return ne(i)&&je(i)}function bo(i,t){if(!(t==="constructor"&&typeof i[t]=="function")&&t!="__proto__")return i[t]}function pb(i){return zn(i,ln(i))}function mb(i,t,e,n,s,o,r){var a=bo(i,e),l=bo(t,e),c=r.get(l);if(c){mo(i,e,c);return}var h=o?o(a,l,e+"",i,t,r):void 0,u=h===void 0;if(u){var g=Ot(l),f=!g&&rn(l),p=!g&&!f&&Ui(l);h=l,g||f||p?Ot(a)?h=a:$i(a)?h=ea(a):f?(u=!1,h=qa(l,!0)):p?(u=!1,h=ll(l,!0)):h=[]:ie(l)||on(l)?(h=a,on(a)?h=pb(a):(!bt(a)||Ys(a))&&(h=cl(l))):u=!1}u&&(r.set(l,h),s(h,l,n,o,r),r.delete(l)),mo(i,e,h)}function Zi(i,t,e,n,s){i!==t&&El(t,function(o,r){if(s||(s=new se),bt(o))mb(i,t,r,e,Zi,n,s);else{var a=n?n(bo(i,r),o,r+"",i,t,s):void 0;a===void 0&&(a=o),mo(i,r,a)}},ln)}function Bl(i,t,e,n,s,o){return bt(i)&&bt(t)&&(o.set(t,i),Zi(i,t,void 0,Bl,o),o.delete(t)),i}var bb=ra(function(i,t,e,n){Zi(i,t,e,n)}),kl=sn(function(i){return i.push(void 0,Bl),ta(bb,void 0,i)}),yb=200;function wb(i,t,e,n){var s=-1,o=ia,r=!0,a=i.length,l=[],c=t.length;if(!a)return l;t.length>=yb&&(o=ho,r=!1,t=new dn(t));t:for(;++s<a;){var h=i[s],u=h;if(h=h!==0?h:0,r&&u===u){for(var g=c;g--;)if(t[g]===u)continue t;l.push(h)}else o(t,u,n)||l.push(h)}return l}var Cb=sn(function(i,t){return $i(i)?wb(i,Yi(t,1,$i,!0)):[]});function Ab(i,t){var e=-1,n=je(i)?Array(i.length):[];return Sl(i,function(s,o,r){n[++e]=t(s,o,r)}),n}var xb=Object.prototype,vb=xb.hasOwnProperty,Tl=cb(function(i,t,e){vb.call(i,e)?i[e].push(t):Qi(i,e,[t])});function Eb(i,t){return i>t}var Sb=Object.prototype,Mb=Sb.hasOwnProperty;function Bb(i,t){return i!=null&&Mb.call(i,t)}function ts(i,t){return i!=null&&xl(i,t,Bb)}var kb="[object Map]",Tb="[object Set]",Ib=Object.prototype,Pb=Ib.hasOwnProperty;function yo(i){if(i==null)return!0;if(je(i)&&(Ot(i)||typeof i=="string"||typeof i.splice=="function"||rn(i)||Ui(i)||on(i)))return!i.length;var t=_t(i);if(t==kb||t==Tb)return!i.size;if(zi(i))return!ma(i).length;for(var e in i)if(Pb.call(i,e))return!1;return!0}function Ce(i,t){return qi(i,t)}var Ob="[object Number]";function Ae(i){return typeof i=="number"||ne(i)&&ke(i)==Ob}var Nb=Ma("toLowerCase");function Rb(i,t,e){for(var n=-1,s=i.length;++n<s;){var o=i[n],r=t(o);if(r!=null&&(a===void 0?r===r&&!ue(r):e(r,a)))var a=r,l=o}return l}function Db(i){return i&&i.length?Rb(i,en,Eb):void 0}var ft=ra(function(i,t,e){Zi(i,t,e)});function Lb(i,t,e,n){if(!bt(i))return i;t=ji(t,i);for(var s=-1,o=t.length,r=o-1,a=i;a!=null&&++s<o;){var l=jn(t[s]),c=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return i;if(s!=r){var h=a[l];c=void 0,c===void 0&&(c=bt(h)?h:Li(t[s+1])?[]:{})}Ws(a,l,c),a=a[l]}return i}function Qb(i,t,e){for(var n=-1,s=t.length,o={};++n<s;){var r=t[n],a=Gi(i,r);e(a,r)&&Lb(o,ji(r,i),a)}return o}function Vb(i,t){var e=i.length;for(i.sort(t);e--;)i[e]=i[e].value;return i}function zb(i,t){if(i!==t){var e=i!==void 0,n=i===null,s=i===i,o=ue(i),r=t!==void 0,a=t===null,l=t===t,c=ue(t);if(!a&&!c&&!o&&i>t||o&&r&&l&&!a&&!c||n&&r&&l||!e&&l||!s)return 1;if(!n&&!o&&!c&&i<t||c&&e&&s&&!n&&!o||a&&e&&s||!r&&s||!l)return-1}return 0}function Fb(i,t,e){for(var n=-1,s=i.criteria,o=t.criteria,r=s.length,a=e.length;++n<r;){var l=zb(s[n],o[n]);if(l){if(n>=a)return l;var c=e[n];return l*(c=="desc"?-1:1)}}return i.index-t.index}function Ub(i,t,e){t.length?t=Ri(t,function(o){return Ot(o)?function(r){return Gi(r,o.length===1?o[0]:o)}:o}):t=[en];var n=-1;t=Ri(t,Fi(fo));var s=Ab(i,function(o,r,a){var l=Ri(t,function(c){return c(o)});return{criteria:l,index:++n,value:o}});return Vb(s,function(o,r){return Fb(o,r,e)})}function Kb(i,t){return Qb(i,t,function(e,n){return vl(i,n)})}var Il=Ap(function(i,t){return i==null?{}:Kb(i,t)}),wo=sn(function(i,t){if(i==null)return[];var e=t.length;return e>1&&Vi(i,t[0],t[1])?t=[]:e>2&&Vi(t[0],t[1],t[2])&&(t=[t[0]]),Ub(i,Yi(t),[])}),Jb=4294967295,jb=Jb-1,Gb=Math.floor,Yb=Math.min;function Pl(i,t,e,n){var s=0,o=i==null?0:i.length;if(o===0)return 0;t=e(t);for(var r=t!==t,a=t===null,l=ue(t),c=t===void 0;s<o;){var h=Gb((s+o)/2),u=e(i[h]),g=u!==void 0,f=u===null,p=u===u,m=ue(u);if(r)var b=p;else c?b=p&&g:a?b=p&&g&&!f:l?b=p&&g&&!f&&!m:f||m?b=!1:b=u<t;b?s=h+1:o=h}return Yb(o,jb)}var Hb=4294967295,_b=Hb>>>1;function Wb(i,t,e){var n=0,s=i==null?n:i.length;if(typeof t=="number"&&t===t&&s<=_b){for(;n<s;){var o=n+s>>>1,r=i[o];r!==null&&!ue(r)&&r<t?n=o+1:s=o}return s}return Pl(i,t,en)}function qb(i,t){return Wb(i,t)}function Xb(i,t,e){return Pl(i,t,fo(e))}var $b=ja(function(i,t,e){return i+(e?" ":"")+Hi(t)}),Zb="Expected a function";function ty(i,t,e){var n=!0,s=!0;if(typeof i!="function")throw new TypeError(Zb);return bt(e)&&(n="leading"in e?!0:n,s="trailing"in e?!!e.trailing:s),Xi(i,t,{leading:n,maxWait:t,trailing:s})}var ey=1/0,ny=un&&1/uo(new un([,-0]))[1]==ey?function(i){return new un(i)}:Ng,iy=200;function Ol(i,t,e){var n=-1,s=ia,o=i.length,r=!0,a=[],l=a;if(o>=iy){var c=ny(i);if(c)return uo(c);r=!1,s=ho,l=new dn}else l=a;t:for(;++n<o;){var h=i[n],u=h;if(h=h!==0?h:0,r&&u===u){for(var g=l.length;g--;)if(l[g]===u)continue t;a.push(h)}else s(l,u,e)||(l!==a&&l.push(u),a.push(h))}return a}var Nl=sn(function(i){return Ol(Yi(i,1,$i,!0))});function Rl(i){return i&&i.length?Ol(i):[]}var sy=0;function oy(i){var t=++sy;return cn(i)+t}function xe(i){return typeof i=="string"&&i.slice(-1)==="%"}function Gt(i,t){if(i==null)return 0;let e;if(typeof i=="string"){if(e=parseFloat(i),xe(i)&&(e/=100,Number.isFinite(e)))return e*t}else e=i;return Number.isFinite(e)?e>0&&e<1?e*t:e:0}function oe(i){if(typeof i=="object"){let e=0,n=0,s=0,o=0;return i.vertical!=null&&Number.isFinite(i.vertical)&&(n=o=i.vertical),i.horizontal!=null&&Number.isFinite(i.horizontal)&&(s=e=i.horizontal),i.left!=null&&Number.isFinite(i.left)&&(e=i.left),i.top!=null&&Number.isFinite(i.top)&&(n=i.top),i.right!=null&&Number.isFinite(i.right)&&(s=i.right),i.bottom!=null&&Number.isFinite(i.bottom)&&(o=i.bottom),{top:n,right:s,bottom:o,left:e}}let t=0;return i!=null&&Number.isFinite(i)&&(t=i),{top:t,right:t,bottom:t,left:t}}let Dl=!1,Ll=!1,Ql=!1,ry=!1,Vl=!1;if(typeof navigator=="object"){const i=navigator.userAgent;i.indexOf("Macintosh")>=0,i.match(/(iPad|iPhone|iPod)/g),i.indexOf("Windows")>=0,Dl=i.indexOf("MSIE")>=0,i.match(/Trident\/7\./),Ll=!!i.match(/Edge\//),i.indexOf("Mozilla/")>=0&&i.indexOf("MSIE")<0&&i.indexOf("Edge/")<0,i.indexOf("Chrome/")>=0&&i.indexOf("Edge/")<0,i.indexOf("Opera/")>=0||i.indexOf("OPR/")>=0,i.indexOf("Firefox/")>=0,Ql=i.indexOf("AppleWebKit/")>=0&&i.indexOf("Chrome/")<0&&i.indexOf("Edge/")<0,typeof document=="object"&&(Vl=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||i.indexOf("Opera/")>=0)}if(typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,typeof document=="object")try{const i=Object.defineProperty({},"passive",{get(){ry=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},i)}catch{}const zl=Dl,Fl=Ll,ay=Ql,ly=!Vl;function cy(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}function Ul(){return cy()==="apply"}const hy={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function uy(i){const t=document.createElement(hy[i]||"div"),e=`on${i}`;let n=e in t;return n||(t.setAttribute(e,"return;"),n=typeof t[e]=="function"),n}const Hn=[];function Te(i,t){const e=Hn.find(n=>n.name===i);if(!(e&&(e.loadTimes+=1,e.loadTimes>1))&&!Ul()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=t;const s=document.querySelector("head");s&&s.insertBefore(n,s.firstChild),Hn.push({name:i,loadTimes:1,styleElement:n})}}function Ie(i){const t=Hn.findIndex(e=>e.name===i);if(t>-1){const e=Hn[t];if(e.loadTimes-=1,e.loadTimes>0)return;let n=e.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Hn.splice(t,1)}}function dy(i){const t=i.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return t&&t[2]?t[2].replace(/\s+/," ").split(" "):null}function Kl(i){const t=parseFloat(i);return Number.isNaN(t)?null:t}function gy(i){const t="data:";return i.substr(0,t.length)===t}function fy(i,t){if(!i||gy(i)){setTimeout(()=>t(null,i));return}const e=()=>{t(new Error(`Failed to load image: ${i}`))},n=window.FileReader?o=>{if(o.status===200){const r=new FileReader;r.onload=a=>{const l=a.target.result;t(null,l)},r.onerror=e,r.readAsDataURL(o.response)}else e()}:o=>{const r=a=>{const c=[];for(let h=0;h<a.length;h+=32768)c.push(String.fromCharCode.apply(null,a.subarray(h,h+32768)));return c.join("")};if(o.status===200){let a=i.split(".").pop()||"png";a==="svg"&&(a="svg+xml");const l=`data:image/${a};base64,`,c=new Uint8Array(o.response),h=l+btoa(r(c));t(null,h)}else e()},s=new XMLHttpRequest;s.responseType=window.FileReader?"blob":"arraybuffer",s.open("GET",i,!0),s.addEventListener("error",e),s.addEventListener("load",()=>n(s)),s.send()}function py(i){let t=i.replace(/\s/g,"");t=decodeURIComponent(t);const e=t.indexOf(","),n=t.slice(0,e),s=n.split(":")[1].split(";")[0],o=t.slice(e+1);let r;n.indexOf("base64")>=0?r=atob(o):r=unescape(encodeURIComponent(o));const a=new Uint8Array(r.length);for(let l=0;l<r.length;l+=1)a[l]=r.charCodeAt(l);return new Blob([a],{type:s})}function my(i,t){const e=window.navigator.msSaveBlob;if(e)e(i,t);else{const n=window.URL.createObjectURL(i),s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(n)}}function Co(i,t){const e=py(i);my(e,t)}function by(i,t={}){let e=null;const n=h=>(e==null&&(e=dy(i)),e!=null?Kl(e[h]):null),s=h=>{const u=i.match(h);return u&&u[2]?Kl(u[2]):null};let o=t.width;if(o==null&&(o=s(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),o==null&&(o=n(2)),o==null)throw new Error("Can not parse width from svg string");let r=t.height;if(r==null&&(r=s(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),r==null&&(r=n(3)),r==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(i).replace(/'/g,"%27").replace(/"/g,"%22")}`}function yy(i){return typeof i=="object"&&i.then&&typeof i.then=="function"}function Ao(i){return i!=null&&(i instanceof Promise||yy(i))}function xo(...i){const t=[];if(i.forEach(n=>{Array.isArray(n)?t.push(...n):t.push(n)}),t.some(n=>Ao(n))){const n=t.map(s=>Ao(s)?s:Promise.resolve(s!==!1));return Promise.all(n).then(s=>s.reduce((o,r)=>r!==!1&&o,!0))}return t.every(n=>n!==!1)}function wy(...i){const t=xo(i);return typeof t=="boolean"?Promise.resolve(t):t}function Jl(i,t,e){if(e)switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2]);case 4:return i.call(t,e[0],e[1],e[2],e[3]);case 5:return i.call(t,e[0],e[1],e[2],e[3],e[4]);case 6:return i.call(t,e[0],e[1],e[2],e[3],e[4],e[5]);default:return i.apply(t,e)}return i.call(t)}function F(i,t,...e){return Jl(i,t,e)}function jl(i){return 180*i/Math.PI%360}const Dt=function(i,t=!1){return(t?i:i%360)*Math.PI/180};function Vt(i){return i%360+(i<0?360:0)}function He(i,t=0){return Number.isInteger(i)?i:+i.toFixed(t)}function Gl(i,t){let e,n;if(t==null?(n=i??1,e=0):(n=t,e=i??0),n<e){const s=e;e=n,n=s}return Math.floor(Math.random()*(n-e+1)+e)}function gn(i,t,e){return Number.isNaN(i)?NaN:Number.isNaN(t)||Number.isNaN(e)?0:i<t?t:i>e?e:i}function re(i,t){return t*Math.round(i/t)}function Yl(i,t){return t!=null&&i!=null&&t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height}function Hl(i,t){const e=i.x-t.x,n=i.y-t.y;return e*e+n*n}class Pe{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class A extends Pe{static create(t,e){return t==null||typeof t=="number"?new A(t,e):A.clone(t)}static clone(t){return A.isPoint(t)?new A(t.x,t.y):Array.isArray(t)?new A(t[0],t[1]):new A(t.x,t.y)}static equals(t,e){return t===e?!0:t!=null&&e!=null?t.x===e.x&&t.y===e.y:!1}static rotateEx(t,e,n,s=new A){const o=A.clone(t),r=A.clone(s),a=o.x-r.x,l=o.y-r.y,c=a*e-l*n,h=l*e+a*n;return new A(c+r.x,h+r.y)}static toJSON(t){return A.isPoint(t)?{x:t.x,y:t.y}:Array.isArray(t)?{x:t[0],y:t[1]}:{x:t.x,y:t.y}}static fromPolar(t,e,n=new A){let s=Math.abs(t*Math.cos(e)),o=Math.abs(t*Math.sin(e));const r=A.clone(n),a=Vt(jl(e));return a<90?o=-o:a<180?(s=-s,o=-o):a<270&&(s=-s),new A(r.x+s,r.y+o)}static toPolar(t,e=new A){const n=A.clone(t),s=A.clone(e),o=n.x-s.x,r=n.y-s.y;return new A(Math.sqrt(o*o+r*r),Dt(s.theta(n)))}static equalPoints(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!==e.length)return!1;if(t!=null&&e!=null){for(let n=0,s=t.length;n<s;n+=1)if(!A.equals(t[n],e[n]))return!1}return!0}static random(t,e,n,s){return new A(Gl(t,e),Gl(n,s))}static rotate(t,e,n){const s=Dt(Vt(-e)),o=Math.sin(s),r=Math.cos(s);return A.rotateEx(t,r,o,n)}static isPoint(t){return t!=null&&t instanceof A}static isPointLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"}static isPointData(t){return t!=null&&Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}constructor(t,e){super(),this.x=t??0,this.y=e??0}round(t=0){return this.x=He(this.x,t),this.y=He(this.y,t),this}add(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=A.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=A.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new A){const s=A.create(n);return this.x=s.x+t*(this.x-s.x),this.y=s.y+e*(this.y-s.y),this}closest(t){if(t.length===1)return A.create(t[0]);let e=null,n=1/0;return t.forEach(s=>{const o=this.squaredDistance(s);o<n&&(e=s,n=o)}),e?A.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=A.create(t),n=this.x-e.x,s=this.y-e.y;return n*n+s*s}manhattanDistance(t){const e=A.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new A){const e=A.create(t),n=-(e.y-this.y),s=e.x-this.x;let o=Math.atan2(n,s);return o<0&&(o=2*Math.PI+o),180*o/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){return new A(0,0).angleBetween(this,t)}toPolar(t){return this.update(A.toPolar(this,t)),this}changeInAngle(t,e,n=new A){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return Yl(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}bearing(t){const e=A.create(t),n=Dt(this.y),s=Dt(e.y),o=this.x,r=e.x,a=Dt(r-o),l=Math.sin(a)*Math.cos(s),c=Math.cos(n)*Math.sin(s)-Math.sin(n)*Math.cos(s)*Math.cos(a),h=jl(Math.atan2(l,c)),u=["NE","E","SE","S","SW","W","NW","N"];let g=h-22.5;return g<0&&(g+=360),g=parseInt(g/45,10),u[g]}cross(t,e){if(t!=null&&e!=null){const n=A.create(t),s=A.create(e);return(s.x-this.x)*(n.y-this.y)-(s.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=A.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if(typeof t=="number")return new A(this.x-t,this.y-e);const n=A.create(t);return new A(this.x-n.x,this.y-n.y)}lerp(t,e){const n=A.create(t);return new A((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=A.create(t),s=Dt(n.theta(this));return this.translate(Math.cos(s)*e,-Math.sin(s)*e)}reflection(t){return A.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=re(this.x,t),this.y=re(this.y,e??t),this}equals(t){const e=A.create(t);return e!=null&&e.x===this.x&&e.y===this.y}clone(){return A.clone(this)}toJSON(){return A.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}class P extends Pe{static isRectangle(t){return t!=null&&t instanceof P}static isRectangleLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}static create(t,e,n,s){return t==null||typeof t=="number"?new P(t,e,n,s):P.clone(t)}static clone(t){return P.isRectangle(t)?t.clone():Array.isArray(t)?new P(t[0],t[1],t[2],t[3]):new P(t.x,t.y,t.width,t.height)}static fromEllipse(t){return new P(t.x-t.a,t.y-t.b,2*t.a,2*t.b)}static fromSize(t){return new P(0,0,t.width,t.height)}static fromPositionAndSize(t,e){return new P(t.x,t.y,e.width,e.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new A(this.x,this.y)}get topLeft(){return new A(this.x,this.y)}get topCenter(){return new A(this.x+this.width/2,this.y)}get topRight(){return new A(this.x+this.width,this.y)}get center(){return new A(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new A(this.x,this.y+this.height)}get bottomCenter(){return new A(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new A(this.x+this.width,this.y+this.height)}get corner(){return new A(this.x+this.width,this.y+this.height)}get rightMiddle(){return new A(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new A(this.x,this.y+this.height/2)}get topLine(){return new z(this.topLeft,this.topRight)}get rightLine(){return new z(this.topRight,this.bottomRight)}get bottomLine(){return new z(this.bottomLeft,this.bottomRight)}get leftLine(){return new z(this.topLeft,this.bottomLeft)}constructor(t,e,n,s){super(),this.x=t??0,this.y=e??0,this.width=n??0,this.height=s??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=Dt(t),n=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e)),o=this.width*s+this.height*n,r=this.width*n+this.height*s;return new P(this.x+(this.width-o)/2,this.y+(this.height-r)/2,o,r)}round(t=0){return this.x=He(this.x,t),this.y=He(this.y,t),this.width=He(this.width,t),this.height=He(this.height,t),this}add(t,e,n,s){const o=P.create(t,e,n,s),r=Math.min(this.x,o.x),a=Math.min(this.y,o.y),l=Math.max(this.x+this.width,o.x+o.width),c=Math.max(this.y+this.height,o.y+o.height);return this.x=r,this.y=a,this.width=l-r,this.height=c-a,this}update(t,e,n,s){const o=P.create(t,e,n,s);return this.x=o.x,this.y=o.y,this.width=o.width,this.height=o.height,this}inflate(t,e){const n=t,s=e??t;return this.x-=n,this.y-=s,this.width+=2*n,this.height+=2*s,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),s=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=s.x-n.x,this.height=s.y-n.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new A){const s=this.origin.scale(t,e,n);return this.x=s.x,this.y=s.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(t!==0){const n=Dt(t),s=Math.cos(n),o=Math.sin(n);let r=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();r=A.rotateEx(r,s,o,e),a=A.rotateEx(a,s,o,e),l=A.rotateEx(l,s,o,e),c=A.rotateEx(c,s,o,e);const h=new P(r.x,r.y,0,0);h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),h.add(c.x,c.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=P.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=P.clone(t),s=e.x,o=e.y;let r=1/0,a=1/0,l=1/0,c=1/0,h=1/0,u=1/0,g=1/0,f=1/0;const p=n.topLeft;p.x<s&&(r=(this.x-s)/(p.x-s)),p.y<o&&(h=(this.y-o)/(p.y-o));const m=n.bottomRight;m.x>s&&(a=(this.x+this.width-s)/(m.x-s)),m.y>o&&(u=(this.y+this.height-o)/(m.y-o));const b=n.topRight;b.x>s&&(l=(this.x+this.width-s)/(b.x-s)),b.y<o&&(g=(this.y-o)/(b.y-o));const y=n.bottomLeft;return y.x<s&&(c=(this.x-s)/(y.x-s)),y.y>o&&(f=(this.y+this.height-o)/(y.y-o)),{sx:Math.min(r,a,l,c),sy:Math.min(h,u,g,f)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return Yl(this,A.create(t,e))}containsRect(t,e,n,s){const o=P.create(t,e,n,s),r=this.x,a=this.y,l=this.width,c=this.height,h=o.x,u=o.y,g=o.width,f=o.height;return l===0||c===0||g===0||f===0?!1:h>=r&&u>=a&&h+g<=r+l&&u+f<=a+c}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],s=[];return e.forEach(o=>{const r=t.intersectsWithLine(o);r!==null&&s.indexOf(r.toString())<0&&(n.push(r),s.push(r.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=A.clone(t),s=this.center;let o=null;e!=null&&e!==0&&n.rotate(e,s);const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new z(s,n);for(let l=r.length-1;l>=0;l-=1){const c=r[l].intersectsWithLine(a);if(c!==null){o=c;break}}return o&&e!=null&&e!==0&&o.rotate(-e,s),o}intersectsWithRect(t,e,n,s){const o=P.create(t,e,n,s);if(!this.isIntersectWithRect(o))return null;const r=this.origin,a=this.corner,l=o.origin,c=o.corner,h=Math.max(r.x,l.x),u=Math.max(r.y,l.y);return new P(h,u,Math.min(a.x,c.x)-h,Math.min(a.y,c.y)-u)}isIntersectWithRect(t,e,n,s){const o=P.create(t,e,n,s),r=this.origin,a=this.corner,l=o.origin,c=o.corner;return!(c.x<=r.x||c.y<=r.y||l.x>=a.x||l.y>=a.y)}normalize(){let t=this.x,e=this.y,n=this.width,s=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,s=-this.height),this.x=t,this.y=e,this.width=n,this.height=s,this}union(t){const e=P.clone(t),n=this.origin,s=this.corner,o=e.origin,r=e.corner,a=Math.min(n.x,o.x),l=Math.min(n.y,o.y),c=Math.max(s.x,r.x),h=Math.max(s.y,r.y);return new P(a,l,c-a,h-l)}getNearestSideToPoint(t){const e=A.clone(t),n=e.x-this.x,s=this.x+this.width-e.x,o=e.y-this.y,r=this.y+this.height-e.y;let a=n,l="left";return s<a&&(a=s,l="right"),o<a&&(a=o,l="top"),r<a&&(l="bottom"),l}getNearestPointToPoint(t){const e=A.clone(t);if(this.containsPoint(e)){const n=this.getNearestSideToPoint(e);if(n==="left")return new A(this.x,e.y);if(n==="top")return new A(e.x,this.y);if(n==="right")return new A(this.x+this.width,e.y);if(n==="bottom")return new A(e.x,this.y+this.height)}return e.adhereToRect(this)}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new P(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class z extends Pe{static isLine(t){return t!=null&&t instanceof z}get center(){return new A((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(t,e,n,s){super(),typeof t=="number"&&typeof e=="number"?(this.start=new A(t,e),this.end=new A(n,s)):(this.start=A.create(t),this.end=A.create(e))}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:s}=e,o=n.clone().rotate(270,s),r=s.clone().rotate(90,n);return n.move(r,t),s.move(o,t),e}vector(){return new A(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new A(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),s=Math.max(this.start.y,this.end.y);return new P(t,e,n-t,s-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new z(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let s=!0;t<0&&(s=!1,t=-t);const o=this.length();if(t>=o)return s?n.clone():e.clone();const r=(s?t:o-t)/o;return this.pointAt(r)}divideAt(t){const e=this.pointAt(t);return[new z(this.start,e),new z(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new z(this.start,e),new z(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(e.cross(t,n)!==0)return!1;const s=this.length();return!(new z(e,t).length()>s||new z(t,n).length()>s)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new A(this.end.x-this.start.x,this.end.y-this.start.y),n=new A(t.end.x-t.start.x,t.end.y-t.start.y),s=e.x*n.y-e.y*n.x,o=new A(t.start.x-this.start.x,t.start.y-this.start.y),r=o.x*n.y-o.y*n.x,a=o.x*e.y-o.y*e.x;if(s===0||r*s<0||a*s<0)return null;if(s>0){if(r>s||a>s)return null}else if(r<s||a<s)return null;return new A(this.start.x+r*e.x/s,this.start.y+r*e.y/s)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=A.clone(t),n=this.start,s=this.end;return((s.x-n.x)*(e.y-n.y)-(s.y-n.y)*(e.x-n.x))/this.length()}pointSquaredDistance(t,e){const n=A.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=A.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,s=this.pointAt(t),o=new z(e,n);return o.translate(s.x-e.x,s.y-e.y),o}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,s=this.pointAtLength(t),o=new z(e,n);return o.translate(s.x-e.x,s.y-e.y),o}relativeCcw(t,e){const n=A.create(t,e);let s=n.x-this.start.x,o=n.y-this.start.y;const r=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=s*a-o*r;return l===0&&(l=s*r+o*a,l>0&&(s-=r,o-=a,l=s*r+o*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(t){return t!=null&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new z(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class Jt extends Pe{static isEllipse(t){return t!=null&&t instanceof Jt}static create(t,e,n,s){return t==null||typeof t=="number"?new Jt(t,e,n,s):Jt.parse(t)}static parse(t){return Jt.isEllipse(t)?t.clone():Array.isArray(t)?new Jt(t[0],t[1],t[2],t[3]):new Jt(t.x,t.y,t.a,t.b)}static fromRect(t){const e=t.center;return new Jt(e.x,e.y,t.width/2,t.height/2)}get center(){return new A(this.x,this.y)}constructor(t,e,n,s){super(),this.x=t??0,this.y=e??0,this.a=n??0,this.b=s??0}bbox(){return P.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,s=e??t;return this.a+=2*n,this.b+=2*s,this}normalizedDistance(t,e){const n=A.create(t,e),s=n.x-this.x,o=n.y-this.y,r=this.a,a=this.b;return s*s/(r*r)+o*o/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,s=this.b,o=t.start,r=t.end,a=t.vector(),l=o.diff(new A(this.x,this.y)),c=new A(a.x/(n*n),a.y/(s*s)),h=new A(l.x/(n*n),l.y/(s*s)),u=a.dot(c),g=a.dot(h),f=l.dot(h)-1,p=g*g-u*f;if(p<0)return null;if(p>0){const m=Math.sqrt(p),b=(-g-m)/u,y=(-g+m)/u;if((b<0||b>1)&&(y<0||y>1))return null;b>=0&&b<=1&&e.push(o.lerp(r,b)),y>=0&&y<=1&&e.push(o.lerp(r,y))}else{const m=-g/u;if(m>=0&&m<=1)e.push(o.lerp(r,m));else return null}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=A.clone(t);e&&n.rotate(e,this.getCenter());const s=n.x-this.x,o=n.y-this.y;let r;if(s===0)return r=this.bbox().getNearestPointToPoint(n),e?r.rotate(-e,this.getCenter()):r;const a=o/s,l=a*a,c=this.a*this.a,h=this.b*this.b;let u=Math.sqrt(1/(1/c+l/h));u=s<0?-u:u;const g=a*u;return r=new A(this.x+u,this.y+g),e?r.rotate(-e,this.getCenter()):r}tangentTheta(t){const e=A.clone(t),n=e.x,s=e.y,o=this.a,r=this.b,a=this.bbox().center,l=a.x,c=a.y,h=30,u=n>a.x+o/2,g=n<a.x-o/2;let f,p;return u||g?(p=n>a.x?s-h:s+h,f=o*o/(n-l)-o*o*(s-c)*(p-c)/(r*r*(n-l))+l):(f=s>a.y?n+h:n-h,p=r*r/(s-c)-r*r*(n-l)*(f-l)/(o*o*(s-c))+c),new A(f,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=P.fromEllipse(this);n.rotate(t,e);const s=Jt.fromRect(n);return this.a=s.a,this.b=s.b,this.x=s.x,this.y=s.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new Jt(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const Cy=new RegExp("^[\\s\\dLMCZz,.]*$");function Ay(i){return typeof i!="string"?!1:Cy.test(i)}function vo(i,t){return(i%t+t)%t}function xy(i,t,e,n,s){if(!i||i.length===0)return"";const o=[],r=i[i.length-1],a=t!=null&&t>0,l=t||0;if(n&&a){i=i.slice();const u=i[0],g=new A(r.x+(u.x-r.x)/2,r.y+(u.y-r.y)/2);i.splice(0,0,g)}let c=i[0],h=1;for(e?o.push("M",c.x,c.y):o.push("L",c.x,c.y);h<(n?i.length:i.length-1);){let u=i[vo(h,i.length)],g=c.x-u.x,f=c.y-u.y;if(a&&(g!==0||f!==0)&&(s==null||s.indexOf(h-1)<0)){let p=Math.sqrt(g*g+f*f);const m=g*Math.min(l,p/2)/p,b=f*Math.min(l,p/2)/p,y=u.x+m,w=u.y+b;o.push("L",y,w);let C=i[vo(h+1,i.length)];for(;h<i.length-2&&Math.round(C.x-u.x)===0&&Math.round(C.y-u.y)===0;)C=i[vo(h+2,i.length)],h+=1;g=C.x-u.x,f=C.y-u.y,p=Math.max(1,Math.sqrt(g*g+f*f));const x=g*Math.min(l,p/2)/p,E=f*Math.min(l,p/2)/p,S=u.x+x,v=u.y+E;o.push("Q",u.x,u.y,S,v),u=new A(S,v)}else o.push("L",u.x,u.y);c=u,h+=1}return n?o.push("Z"):o.push("L",r.x,r.y),o.map(u=>typeof u=="string"?u:+u.toFixed(3)).join(" ")}function vy(i,t={}){const e=[];return i&&i.length&&i.forEach(n=>{Array.isArray(n)?e.push({x:n[0],y:n[1]}):e.push({x:n.x,y:n.y})}),xy(e,t.round,t.initialMove==null||t.initialMove,t.close,t.exclude)}function _l(i,t,e,n,s=0,o=0,r=0,a,l){if(e===0||n===0)return[];a-=i,l-=t,e=Math.abs(e),n=Math.abs(n);const c=-a/2,h=-l/2,u=Math.cos(s*Math.PI/180),g=Math.sin(s*Math.PI/180),f=u*c+g*h,p=-1*g*c+u*h,m=f*f,b=p*p,y=e*e,w=n*n,C=m/y+b/w;let x;if(C>1)e=Math.sqrt(C)*e,n=Math.sqrt(C)*n,x=0;else{let T=1;o===r&&(T=-1),x=T*Math.sqrt((y*w-y*b-w*m)/(y*b+w*m))}const E=x*e*p/n,S=-1*x*n*f/e,v=u*E-g*S+a/2,M=g*E+u*S+l/2;let k=Math.atan2((p-S)/n,(f-E)/e)-Math.atan2(0,1),I=k>=0?k:2*Math.PI+k;k=Math.atan2((-p-S)/n,(-f-E)/e)-Math.atan2((p-S)/n,(f-E)/e);let O=k>=0?k:2*Math.PI+k;r===0&&O>0?O-=2*Math.PI:r!==0&&O<0&&(O+=2*Math.PI);const R=O*2/Math.PI,K=Math.ceil(R<0?-1*R:R),D=O/K,N=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),j=u*e,rt=u*n,Ct=g*e,pt=g*n;let ct=Math.cos(I),V=Math.sin(I),tt=-N*(j*V+pt*ct),it=-N*(Ct*V-rt*ct),H=0,st=0;const mt=[];for(let T=0;T<K;T+=1){I+=D,ct=Math.cos(I),V=Math.sin(I),H=j*ct-pt*V+v,st=Ct*ct+rt*V+M;const L=-N*(j*V+pt*ct),_=-N*(Ct*V-rt*ct),Z=T*6;mt[Z]=Number(tt+i),mt[Z+1]=Number(it+t),mt[Z+2]=Number(H-L+i),mt[Z+3]=Number(st-_+t),mt[Z+4]=Number(H+i),mt[Z+5]=Number(st+t),tt=H+L,it=st+_}return mt.map(T=>+T.toFixed(2))}class Mt extends Pe{static isPolyline(t){return t!=null&&t instanceof Mt}static parse(t){const e=t.trim();if(e==="")return new Mt;const n=[],s=e.split(/\s*,\s*|\s+/);for(let o=0,r=s.length;o<r;o+=2)n.push({x:+s[o],y:+s[o+1]});return new Mt(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(t){if(super(),t!=null){if(typeof t=="string")return Mt.parse(t);this.points=t.map(e=>A.create(e))}else this.points=[]}scale(t,e,n=new A){return this.points.forEach(s=>s.scale(t,e,n)),this}rotate(t,e){return this.points.forEach(n=>n.rotate(t,e)),this}translate(t,e){const n=A.create(t,e);return this.points.forEach(s=>s.translate(n.x,n.y)),this}round(t=0){return this.points.forEach(e=>e.round(t)),this}bbox(){if(this.points.length===0)return new P;let t=1/0,e=-1/0,n=1/0,s=-1/0;const o=this.points;for(let r=0,a=o.length;r<a;r+=1){const l=o[r],c=l.x,h=l.y;c<t&&(t=c),c>e&&(e=c),h<n&&(n=h),h>s&&(s=h)}return new P(t,n,e-t,s-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(n===0||n===1)return 0;let s=0,o=0,r=1/0;for(let a=0,l=n-1;a<l;a+=1){const c=new z(e[a],e[a+1]),h=c.length(),u=c.closestPointNormalizedLength(t),f=c.pointAt(u).squaredDistance(t);f<r&&(r=f,o=s+u*h),s+=h}return o}closestPointNormalizedLength(t){const e=this.length();return e===0?0:this.closestPointLength(t)/e}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(this.points.length===0)return!1;const e=A.clone(t),n=e.x,s=e.y,o=this.points,r=o.length;let a=r-1,l=0;for(let c=0;c<r;c+=1){const h=o[a],u=o[c];if(e.equals(h))return!0;const g=new z(h,u);if(g.containsPoint(t))return!0;if(s<=h.y&&s>u.y||s>h.y&&s<=u.y){const f=h.x-n>u.x-n?h.x-n:u.x-n;if(f>=0){const p=new A(n+f,s),m=new z(t,p);g.intersectsWithLine(m)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(t){const e=[];for(let n=0,s=this.points.length-1;n<s;n+=1){const o=this.points[n],r=this.points[n+1],a=t.intersectsWithLine(new z(o,r));a&&e.push(a)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const n=this.points[t],s=this.points[t+1];if(new z(n,s).isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const s=this.points[e],o=this.points[e+1];t+=s.distance(o)}return t}pointAt(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1||t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const o=this.length()*t;return this.pointAtLength(o)}pointAtLength(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1)return e[0].clone();let s=!0;t<0&&(s=!1,t=-t);let o=0;for(let a=0,l=n-1;a<l;a+=1){const c=s?a:l-1-a,h=e[c],u=e[c+1],g=new z(h,u),f=h.distance(u);if(t<=o+f)return g.pointAtLength((s?1:-1)*(t-o));o+=f}return(s?e[n-1]:e[0]).clone()}tangentAt(t){const n=this.points.length;if(n===0||n===1)return null;t<0&&(t=0),t>1&&(t=1);const o=this.length()*t;return this.tangentAtLength(o)}tangentAtLength(t){const e=this.points,n=e.length;if(n===0||n===1)return null;let s=!0;t<0&&(s=!1,t=-t);let o,r=0;for(let a=0,l=n-1;a<l;a+=1){const c=s?a:l-1-a,h=e[c],u=e[c+1],g=new z(h,u),f=h.distance(u);if(g.isDifferentiable()){if(t<=r+f)return g.tangentAtLength((s?1:-1)*(t-r));o=g}r+=f}if(o){const a=s?1:0;return o.tangentAt(a)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let s=0;for(;e[s+2];){const o=s,r=s+1,a=s+2,l=e[o],c=e[r],h=e[a];new z(l,h).closestPoint(c).distance(c)<=n?e.splice(r,1):s+=1}return this}toHull(){const t=this.points,e=t.length;if(e===0)return new Mt;let n=t[0];for(let g=1;g<e;g+=1)(t[g].y<n.y||t[g].y===n.y&&t[g].x>n.x)&&(n=t[g]);const s=[];for(let g=0;g<e;g+=1){let f=n.theta(t[g]);f===0&&(f=360),s.push([t[g],g,f])}if(s.sort((g,f)=>{let p=g[2]-f[2];return p===0&&(p=f[1]-g[1]),p}),s.length>2){const g=s[s.length-1];s.unshift(g)}const o={},r=[],a=g=>`${g[0].toString()}@${g[1]}`;for(;s.length!==0;){const g=s.pop(),f=g[0];if(o[a(g)])continue;let p=!1;for(;!p;)if(r.length<2)r.push(g),p=!0;else{const m=r.pop(),b=m[0],y=r.pop(),w=y[0],C=w.cross(b,f);if(C<0)r.push(y),r.push(m),r.push(g),p=!0;else if(C===0){const E=b.angleBetween(w,f);Math.abs(E-180)<1e-10||b.equals(f)||w.equals(b)?(o[a(m)]=b,r.push(y)):Math.abs((E+1)%360-1)<1e-10&&(r.push(y),s.push(m))}else o[a(m)]=b,r.push(y)}}r.length>2&&r.pop();let l,c=-1;for(let g=0,f=r.length;g<f;g+=1){const p=r[g][1];(l===void 0||p<l)&&(l=p,c=g)}let h=[];if(c>0){const g=r.slice(c),f=r.slice(0,c);h=g.concat(f)}else h=r;const u=[];for(let g=0,f=h.length;g<f;g+=1)u.push(h[g][0]);return new Mt(u)}equals(t){return t==null||t.points.length!==this.points.length?!1:t.points.every((e,n)=>e.equals(this.points[n]))}clone(){return new Mt(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.serialize()}`).join(" ")}}class wt extends Pe{static isCurve(t){return t!=null&&t instanceof wt}static throughPoints(t){if(t==null||Array.isArray(t)&&t.length<2)throw new Error("At least 2 points are required");const e=Ey(t),n=[];for(let s=0,o=e[0].length;s<o;s+=1){const r=new A(e[0][s].x,e[0][s].y),a=new A(e[1][s].x,e[1][s].y);n.push(new wt(t[s],r,a,t[s+1]))}return n}constructor(t,e,n,s){super(),this.PRECISION=3,this.start=A.create(t),this.controlPoint1=A.create(e),this.controlPoint2=A.create(n),this.end=A.create(s)}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end,o=t.x,r=t.y,a=e.x,l=e.y,c=n.x,h=n.y,u=s.x,g=s.y,f=[],p=[[],[]];let m,b,y,w,C,x,E,S;for(let j=0;j<2;j+=1){if(j===0?(b=6*o-12*a+6*c,m=-3*o+9*a-9*c+3*u,y=3*a-3*o):(b=6*r-12*l+6*h,m=-3*r+9*l-9*h+3*g,y=3*l-3*r),Math.abs(m)<1e-12){if(Math.abs(b)<1e-12)continue;w=-y/b,w>0&&w<1&&f.push(w);continue}E=b*b-4*y*m,S=Math.sqrt(E),!(E<0)&&(C=(-b+S)/(2*m),C>0&&C<1&&f.push(C),x=(-b-S)/(2*m),x>0&&x<1&&f.push(x))}let v,M,k,I=f.length;const O=I;for(;I;)I-=1,w=f[I],k=1-w,v=k*k*k*o+3*k*k*w*a+3*k*w*w*c+w*w*w*u,p[0][I]=v,M=k*k*k*r+3*k*k*w*l+3*k*w*w*h+w*w*w*g,p[1][I]=M;f[O]=0,f[O+1]=1,p[0][O]=o,p[1][O]=r,p[0][O+1]=u,p[1][O+1]=g,f.length=O+2,p[0].length=O+2,p[1].length=O+2;const R=Math.min.apply(null,p[0]),K=Math.min.apply(null,p[1]),D=Math.max.apply(null,p[0]),N=Math.max.apply(null,p[1]);return new P(R,K,D-R,N-K)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),s=this.closestPointLength(t,n);if(!s)return 0;const o=this.length(n);return o===0?0:s/o}closestPointT(t,e={}){const n=this.getPrecision(e),s=this.getDivisions(e),o=Math.pow(10,-n);let r=null,a=0,l=0,c=0,h=0,u=0,g=null;const f=s.length;let p=f>0?1/f:0;for(s.forEach((m,b)=>{const y=m.start.distance(t),w=m.end.distance(t),C=y+w;(g==null||C<g)&&(r=m,a=b*p,l=(b+1)*p,c=y,h=w,g=C,u=m.endpointDistance())});;){const m=c?Math.abs(c-h)/c:0,b=h!=null?Math.abs(c-h)/h:0,y=m<o||b<o,w=c?c<u*o:!0,C=h?h<u*o:!0;if(y||(w||C))return c<=h?a:l;const E=r.divide(.5);p/=2;const S=E[0].start.distance(t),v=E[0].end.distance(t),M=S+v,k=E[1].start.distance(t),I=E[1].end.distance(t),O=k+I;M<=O?(r=E[0],l-=p,c=S,h=v):(r=E[1],a+=p,c=k,h=I)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,s=this.controlPoint2,o=this.end;if(t<=0)return[new wt(e,e,e,e),new wt(e,n,s,o)];if(t>=1)return[new wt(e,n,s,o),new wt(o,o,o,o)];const r=this.getSkeletonPoints(t),a=r.startControlPoint1,l=r.startControlPoint2,c=r.divider,h=r.dividerControlPoint1,u=r.dividerControlPoint2;return[new wt(e,a,l,c),new wt(c,h,u,o)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,s=this.controlPoint2,o=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:s.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:s.clone(),divider:o.clone(),dividerControlPoint1:o.clone(),dividerControlPoint2:o.clone()};const r=new z(e,n).pointAt(t),a=new z(n,s).pointAt(t),l=new z(s,o).pointAt(t),c=new z(r,a).pointAt(t),h=new z(a,l).pointAt(t),u=new z(c,h).pointAt(t);return{startControlPoint1:r,startControlPoint2:c,divider:u,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(e===0)return n;let s=this.endpointDistance();const o=Math.pow(10,-e);let r=0;for(;;){r+=1;const a=[];n.forEach(h=>{const u=h.divide(.5);a.push(u[0],u[1])});const l=a.reduce((h,u)=>h+u.endpointDistance(),0),c=l!==0?(l-s)/l:0;if(r>1&&c<o)return a;n=a,s=l}}length(t={}){return this.getDivisions(t).reduce((n,s)=>n+s.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=e.precision===void 0?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(s))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,s=e.dividerControlPoint1,o=e.divider,r=new z(n,s);return r.translate(o.x-n.x,o.y-n.y),r}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getDivisions(t={}){if(t.subdivisions!=null)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),o=this.length(n)*t;return this.tAtLength(o,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getDivisions(e),r={precision:s,subdivisions:o};let a=null,l,c,h=0,u=0,g=0;const f=o.length;let p=f>0?1/f:0;for(let y=0;y<f;y+=1){const w=n?y:f-1-y,C=o[y],x=C.endpointDistance();if(t<=g+x){a=C,l=w*p,c=(w+1)*p,h=n?t-g:x+g-t,u=n?x+g-t:t-g;break}g+=x}if(a==null)return n?1:0;const m=this.length(r),b=Math.pow(10,-s);for(;;){let y;if(y=m!==0?h/m:0,y<b)return l;if(y=m!==0?u/m:0,y<b)return c;let w,C;const x=a.divide(.5);p/=2;const E=x[0].endpointDistance(),S=x[1].endpointDistance();h<=E?(a=x[0],c-=p,w=h,C=E-w):(a=x[1],l+=p,w=h-E,C=S-w),h=w,u=C}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach(s=>n.push(s.end.clone())),n}toPolyline(t={}){return new Mt(this.toPoints(t))}scale(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}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(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}equals(t){return t!=null&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}function Wl(i){const t=i.length,e=[],n=[];let s=2;e[0]=i[0]/s;for(let o=1;o<t;o+=1)n[o]=1/s,s=(o<t-1?4:3.5)-n[o],e[o]=(i[o]-e[o-1])/s;for(let o=1;o<t;o+=1)e[t-o-1]-=n[t-o]*e[t-o];return e}function Ey(i){const t=i.map(l=>A.clone(l)),e=[],n=[],s=t.length-1;if(s===1)return e[0]=new A((2*t[0].x+t[1].x)/3,(2*t[0].y+t[1].y)/3),n[0]=new A(2*e[0].x-t[0].x,2*e[0].y-t[0].y),[e,n];const o=[];for(let l=1;l<s-1;l+=1)o[l]=4*t[l].x+2*t[l+1].x;o[0]=t[0].x+2*t[1].x,o[s-1]=(8*t[s-1].x+t[s].x)/2;const r=Wl(o);for(let l=1;l<s-1;l+=1)o[l]=4*t[l].y+2*t[l+1].y;o[0]=t[0].y+2*t[1].y,o[s-1]=(8*t[s-1].y+t[s].y)/2;const a=Wl(o);for(let l=0;l<s;l+=1)e.push(new A(r[l],a[l])),l<s-1?n.push(new A(2*t[l+1].x-r[l+1],2*t[l+1].y-a[l+1])):n.push(new A((t[s].x+r[s-1])/2,(t[s].y+a[s-1])/2));return[e,n]}class es extends Pe{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)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}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class At extends es{static create(...t){const e=t.length,n=t[0];if(z.isLine(n))return new At(n);if(A.isPointLike(n))return e===1?new At(n):t.map(o=>new At(o));if(e===2)return new At(+t[0],+t[1]);const s=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];s.push(new At(r,a))}return s}constructor(t,e){super(),z.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=A.create(t,e).round(2)}get type(){return"L"}get line(){return new z(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new At(e[0]),new At(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new At(e[0]),new At(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new At(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class _n extends es{static create(){return new _n}get end(){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}get type(){return"Z"}get line(){return new z(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new At(e[0]):this.clone(),new At(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new At(e[0]):this.clone(),new At(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new _n}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class de extends es{static create(...t){const e=t.length,n=t[0];if(z.isLine(n))return new de(n);if(wt.isCurve(n))return new de(n);if(A.isPointLike(n)){if(e===1)return new de(n);const o=[];for(let r=0;r<e;r+=1)r===0?o.push(new de(t[r])):o.push(new At(t[r]));return o}if(e===2)return new de(+t[0],+t[1]);const s=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];o===0?s.push(new de(r,a)):s.push(new At(r,a))}return s}constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,z.isLine(t)||wt.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=A.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}clone(){return new de(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class zt extends es{static create(...t){const e=t.length,n=t[0];if(wt.isCurve(n))return new zt(n);if(A.isPointLike(n)){if(e===3)return new zt(t[0],t[1],t[2]);const o=[];for(let r=0;r<e;r+=3)o.push(new zt(t[r],t[r+1],t[r+2]));return o}if(e===6)return new zt(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<e;o+=6)s.push(new zt(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}constructor(t,e,n,s,o,r){super(),wt.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):typeof t=="number"?(this.controlPoint1=new A(t,e).round(2),this.controlPoint2=new A(n,s).round(2),this.endPoint=new A(o,r).round(2)):(this.controlPoint1=A.create(t).round(2),this.controlPoint2=A.create(e).round(2),this.endPoint=A.create(n).round(2))}get type(){return"C"}get curve(){return new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new zt(n[0]),new zt(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new zt(n[0]),new zt(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new zt(e[0]),new zt(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(s))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(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}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new zt(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const 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(" ")}}function ns(i,t,e){return{x:i*Math.cos(e)-t*Math.sin(e),y:i*Math.sin(e)+t*Math.cos(e)}}function ql(i,t,e,n,s,o){const r=.3333333333333333,a=2/3;return[r*i+a*e,r*t+a*n,r*s+a*e,r*o+a*n,s,o]}function Xl(i,t,e,n,s,o,r,a,l,c){const h=Math.PI*120/180,u=Math.PI/180*(+s||0);let g=[],f,p,m,b,y;if(c)p=c[0],m=c[1],b=c[2],y=c[3];else{f=ns(i,t,-u),i=f.x,t=f.y,f=ns(a,l,-u),a=f.x,l=f.y;const D=(i-a)/2,N=(t-l)/2;let j=D*D/(e*e)+N*N/(n*n);j>1&&(j=Math.sqrt(j),e=j*e,n=j*n);const rt=e*e,Ct=n*n,pt=(o===r?-1:1)*Math.sqrt(Math.abs((rt*Ct-rt*N*N-Ct*D*D)/(rt*N*N+Ct*D*D)));b=pt*e*N/n+(i+a)/2,y=pt*-n*D/e+(t+l)/2,p=Math.asin((t-y)/n),m=Math.asin((l-y)/n),p=i<b?Math.PI-p:p,m=a<b?Math.PI-m:m,p<0&&(p=Math.PI*2+p),m<0&&(m=Math.PI*2+m),r&&p>m&&(p-=Math.PI*2),!r&&m>p&&(m-=Math.PI*2)}let w=m-p;if(Math.abs(w)>h){const D=m,N=a,j=l;m=p+h*(r&&m>p?1:-1),a=b+e*Math.cos(m),l=y+n*Math.sin(m),g=Xl(a,l,e,n,s,0,r,N,j,[m,D,b,y])}w=m-p;const C=Math.cos(p),x=Math.sin(p),E=Math.cos(m),S=Math.sin(m),v=Math.tan(w/4),M=4/3*(e*v),k=4/3*(n*v),I=[i,t],O=[i+M*x,t-k*C],R=[a+M*S,l-k*E],K=[a,l];if(O[0]=2*I[0]-O[0],O[1]=2*I[1]-O[1],c)return[O,R,K].concat(g);{g=[O,R,K].concat(g).join().split(",");const D=[],N=g.length;for(let j=0;j<N;j+=1)D[j]=j%2?ns(+g[j-1],+g[j],u).y:ns(+g[j],+g[j+1],u).x;return D}}function Sy(i){if(!i)return null;const t=`
|
|
2
|
+
\v\f\r \u2028\u2029`,e=new RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),n=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return i.replace(e,(r,a,l)=>{const c=[];let h=a.toLowerCase();l.replace(n,(g,f)=>(f&&c.push(+f),g)),h==="m"&&c.length>2&&(o.push([a,...c.splice(0,2)]),h="l",a=a==="m"?"l":"L");const u=s[h];for(;c.length>=u&&(o.push([a,...c.splice(0,u)]),!!u););return r}),o}function My(i){const t=Sy(i);if(!t||!t.length)return[["M",0,0]];let e=0,n=0,s=0,o=0;const r=[];for(let a=0,l=t.length;a<l;a+=1){const c=[];r.push(c);const h=t[a],u=h[0];if(u!==u.toUpperCase())switch(c[0]=u.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]+e,c[7]=+h[7]+n;break;case"V":c[1]=+h[1]+n;break;case"H":c[1]=+h[1]+e;break;case"M":s=+h[1]+e,o=+h[2]+n;for(let g=1,f=h.length;g<f;g+=1)c[g]=+h[g]+(g%2?e:n);break;default:for(let g=1,f=h.length;g<f;g+=1)c[g]=+h[g]+(g%2?e:n);break}else for(let g=0,f=h.length;g<f;g+=1)c[g]=h[g];switch(c[0]){case"Z":e=+s,n=+o;break;case"H":e=c[1];break;case"V":n=c[1];break;case"M":s=c[c.length-2],o=c[c.length-1],e=c[c.length-2],n=c[c.length-1];break;default:e=c[c.length-2],n=c[c.length-1];break}}return r}function By(i){const t=My(i),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function n(l,c,h){let u,g;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(Xl.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(u=c.x*2-c.bx,g=c.y*2-c.by):(u=c.x,g=c.y),["C",u,g].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(ql(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(ql(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function s(l,c){if(l[c].length>7){l[c].shift();const h=l[c];for(;h.length;)o[c]="A",c+=1,l.splice(c,0,["C"].concat(h.splice(0,6)));l.splice(c,1),a=t.length}}const o=[];let r="",a=t.length;for(let l=0;l<a;l+=1){let c="";t[l]&&(c=t[l][0]),c!=="C"&&(o[l]=c,l>0&&(r=o[l-1])),t[l]=n(t[l],e,r),o[l]!=="A"&&c==="C"&&(o[l]="C"),s(t,l);const h=t[l],u=h.length;e.x=h[u-2],e.y=h[u-1],e.bx=parseFloat(h[u-4])||e.x,e.by=parseFloat(h[u-3])||e.y}return(!t[0][0]||t[0][0]!=="M")&&t.unshift(["M",0,0]),t}function $l(i){return By(i).map(t=>t.map(e=>typeof e=="string"?e:He(e,2))).join(",").split(",").join(" ")}class J extends Pe{static isPath(t){return t!=null&&t instanceof J}static parse(t){if(!t)return new J;const e=new J,n=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,s=$l(t).match(n);if(s!=null)for(let o=0,r=s.length;o<r;o+=1){const a=s[o],l=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,c=a.match(l);if(c!=null){const h=c[0],u=c.slice(1).map(f=>+f),g=J.createSegment.call(null,h,...u);e.appendSegment(g)}}return e}static createSegment(t,...e){if(t==="M")return de.create.call(null,...e);if(t==="L")return At.create.call(null,...e);if(t==="C")return zt.create.call(null,...e);if(t==="z"||t==="Z")return _n.create();throw new Error(`Invalid path segment type "${t}"`)}constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(z.isLine(t[0])||wt.isCurve(t[0])){let e=null;t.forEach((s,o)=>{o===0&&this.appendSegment(J.createSegment("M",s.start)),e!=null&&!e.end.equals(s.start)&&this.appendSegment(J.createSegment("M",s.start)),z.isLine(s)?this.appendSegment(J.createSegment("L",s.end)):wt.isCurve(s)&&this.appendSegment(J.createSegment("C",s.controlPoint1,s.controlPoint2,s.end)),e=s})}else t.forEach(n=>{n.isSegment&&this.appendSegment(n)});else t!=null&&(z.isLine(t)?(this.appendSegment(J.createSegment("M",t.start)),this.appendSegment(J.createSegment("L",t.end))):wt.isCurve(t)?(this.appendSegment(J.createSegment("M",t.start)),this.appendSegment(J.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):Mt.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((e,n)=>{const s=n===0?J.createSegment("M",e):J.createSegment("L",e);this.appendSegment(s)}):t.isSegment&&this.appendSegment(t))}get start(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=0;n<e;n+=1){const s=t[n];if(s.isVisible)return s.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=e-1;n>=0;n-=1){const s=t[n];if(s.isVisible)return s.end}return t[e-1].end}moveTo(...t){return this.appendSegment(de.create.call(null,...t))}lineTo(...t){return this.appendSegment(At.create.call(null,...t))}curveTo(...t){return this.appendSegment(zt.create.call(null,...t))}arcTo(t,e,n,s,o,r,a){const l=this.end||new A,c=typeof r=="number"?_l(l.x,l.y,t,e,n,s,o,r,a):_l(l.x,l.y,t,e,n,s,o,r.x,r.y);if(c!=null)for(let h=0,u=c.length;h<u;h+=6)this.curveTo(c[h],c[h+1],c[h+2],c[h+3],c[h+4],c[h+5]);return this}quadTo(t,e,n,s){const o=this.end||new A,r=["M",o.x,o.y];if(typeof t=="number")r.push("Q",t,e,n,s);else{const l=e;r.push("Q",t.x,t.y,l.x,l.y)}const a=J.parse(r.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(_n.create())}drawPoints(t,e={}){const n=vy(t,e),s=J.parse(n);s&&s.segments&&this.appendSegment(s.segments)}bbox(){const t=this.segments,e=t.length;if(e===0)return null;let n;for(let o=0;o<e;o+=1){const r=t[o];if(r.isVisible){const a=r.bbox();a!=null&&(n=n?n.union(a):a)}}if(n!=null)return n;const s=t[e-1];return new P(s.end.x,s.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n=e!==0?this.segments[e-1]:null,s;const o=null;if(Array.isArray(t))for(let r=0,a=t.length;r<a;r+=1){const l=t[r];s=this.prepareSegment(l,n,o),this.segments.push(s),n=s}else t!=null&&t.isSegment&&(s=this.prepareSegment(t,n,o),this.segments.push(s));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let s,o=null,r=null;if(n!==0&&(t>=1?(o=this.segments[t-1],r=o.nextSegment):(o=null,r=this.segments[0])),!Array.isArray(e))s=this.prepareSegment(e,o,r),this.segments.splice(t,0,s);else for(let a=0,l=e.length;a<l;a+=1){const c=e[a];s=this.prepareSegment(c,o,r),this.segments.splice(t+a,0,s),o=s}return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],s=n.previousSegment,o=n.nextSegment;return s&&(s.nextSegment=o),o&&(o.previousSegment=s),n.isSubpathStart&&o&&this.updateSubpathStartSegment(o),n}replaceSegment(t,e){const n=this.fixIndex(t);let s;const o=this.segments[n];let r=o.previousSegment;const a=o.nextSegment;let l=o.isSubpathStart;if(!Array.isArray(e))s=this.prepareSegment(e,r,a),this.segments.splice(n,1,s),l&&s.isSubpathStart&&(l=!1);else{this.segments.splice(t,1);for(let c=0,h=e.length;c<h;c+=1){const u=e[c];s=this.prepareSegment(u,r,a),this.segments.splice(t+c,0,s),r=s,l&&s.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(e===0)throw new Error("Path has no segments.");let n=t;for(;n<0;)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(this.segments.length===0)return null;const n=gn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.segmentIndexAtLength(r,s)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(n===0)return null;let s=!0;t<0&&(s=!1,t=-t);const o=this.getPrecision(e),r=this.getSubdivisions(e);let a=0,l=null;for(let c=0;c<n;c+=1){const h=s?c:n-1-c,u=this.segments[h],g=r[h],f=u.length({precision:o,subdivisions:g});if(u.isVisible){if(t<=a+f)return h;l=h}a+=f}return l}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let s=0,o=this.segments.length;s<o;s+=1){const a=this.segments[s].getSubdivisions({precision:e});n.push(a)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;for(;n&&!n.isSubpathStart;)e!=null?n.subpathStartSegment=e.subpathStartSegment:n.subpathStartSegment=null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,e!=null&&(e.nextSegment=t),n!=null&&(n.previousSegment=t);let s=t;return t.isSubpathStart&&(t.subpathStartSegment=t,s=n),s!=null&&this.updateSubpathStartSegment(s),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),s=this.closestPointT(t,n);return s?this.lengthAtT(s,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),s=this.closestPointLength(t,n);if(s===0)return 0;const o=this.length(n);return o===0?0:s/o}closestPointT(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=s[a];if(c.isVisible){const u=c.closestPointT(t,{precision:n,subdivisions:h}),g=c.pointAtT(u),f=Hl(g,t);f<r&&(o={segmentIndex:a,value:u},r=f)}}return o||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=s[a];if(c.isDifferentiable()){const u=c.closestPointT(t,{precision:n,subdivisions:h}),g=c.pointAtT(u),f=Hl(g,t);f<r&&(o=c.tangentAtT(u),r=f)}}return o||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let s=0;for(let o=0,r=n.length;o<r;o+=1)n[o].containsPoint(t)&&(s+=1);return s%2===1}pointAt(t,e={}){if(this.segments.length===0)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),o=this.length(n)*t;return this.pointAtLength(o,n)}pointAtLength(t,e={}){if(this.segments.length===0)return null;if(t===0)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let c=0,h=this.segments.length;c<h;c+=1){const u=n?c:h-1-c,g=this.segments[u],f=o[u],p=g.length({precision:s,subdivisions:f});if(g.isVisible){if(t<=a+p)return g.pointAtLength((n?1:-1)*(t-a),{precision:s,subdivisions:f});r=g}a+=p}return r?n?r.end:r.start:this.segments[this.segments.length-1].end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(n===0)return null;const s=t.segmentIndex;if(s<0)return e[0].pointAtT(0);if(s>=n)return e[n-1].pointAtT(1);const o=gn(t.value,0,1);return e[s].pointAtT(o)}divideAt(t,e={}){if(this.segments.length===0)return null;const n=gn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.divideAtLength(r,s)}divideAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r=0,a,l,c,h,u;for(let E=0,S=this.segments.length;E<S;E+=1){const v=n?E:S-1-E,M=this.getSegment(v),k=o[v],I={precision:s,subdivisions:k},O=M.length(I);if(M.isDifferentiable()&&(c=M,h=v,t<=r+O)){l=v,a=M.divideAtLength((n?1:-1)*(t-r),I);break}r+=O}if(!c)return null;a||(l=h,u=n?1:0,a=c.divideAtT(u));const g=this.clone(),f=l;g.replaceSegment(f,a);const p=f;let m=f+1,b=f+2;a[0].isDifferentiable()||(g.removeSegment(p),m-=1,b-=1);const y=g.getSegment(m).start;g.insertSegment(m,J.createSegment("M",y)),b+=1,a[1].isDifferentiable()||(g.removeSegment(b-1),b-=1);const w=b-p-1;for(let E=b,S=g.segments.length;E<S;E+=1){const v=this.getSegment(E-w),M=g.getSegment(E);if(M.type==="Z"&&!v.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const k=J.createSegment("L",v.end);g.replaceSegment(E,k)}}const C=new J(g.segments.slice(0,m)),x=new J(g.segments.slice(m));return[C,x]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(n==null)return null;let s=null;for(let o=0,r=n.length;o<r;o+=1){const a=n[o],l=t.intersect(a);l&&(s==null&&(s=[]),Array.isArray(l)?s.push(...l):s.push(l))}return s}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1)if(this.segments[t].isDifferentiable())return!0;return!1}isValid(){const t=this.segments;return t.length===0||t[0].type==="M"}length(t={}){if(this.segments.length===0)return 0;const e=this.getSubdivisions(t);let n=0;for(let s=0,o=this.segments.length;s<o;s+=1){const r=this.segments[s],a=e[s];n+=r.length({subdivisions:a})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(n===0)return 0;let s=t.segmentIndex;if(s<0)return 0;let o=gn(t.value,0,1);s>=n&&(s=n-1,o=1);const r=this.getPrecision(e),a=this.getSubdivisions(e);let l=0;for(let u=0;u<s;u+=1){const g=this.segments[u],f=a[u];l+=g.length({precision:r,subdivisions:f})}const c=this.segments[s],h=a[s];return l+=c.lengthAtT(o,{precision:r,subdivisions:h}),l}tangentAt(t,e={}){if(this.segments.length===0)return null;const n=gn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.tangentAtLength(r,s)}tangentAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const h=n?l:c-1-l,u=this.segments[h],g=o[h],f=u.length({precision:s,subdivisions:g});if(u.isDifferentiable()){if(t<=a+f)return u.tangentAtLength((n?1:-1)*(t-a),{precision:s,subdivisions:g});r=u}a+=f}if(r){const l=n?1:0;return r.tangentAtT(l)}return null}tangentAtT(t){const e=this.segments.length;if(e===0)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const s=gn(t.value,0,1);return this.segments[n].tangentAtT(s)}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getSubdivisions(t={}){if(t.segmentSubdivisions==null){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(n===0)return null;const s=this.getSubdivisions(t),o=[];let r=[];for(let a=0;a<n;a+=1){const l=e[a];if(l.isVisible){const c=s[a];c.length>0?c.forEach(h=>r.push(h.start)):r.push(l.start)}else r.length>0&&(r.push(e[a-1].end),o.push(r),r=[])}return r.length>0&&(r.push(this.end),o.push(r)),o}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(n=>new Mt(n)):null}scale(t,e,n){return this.segments.forEach(s=>s.scale(t,e,n)),this}rotate(t,e){return this.segments.forEach(n=>n.rotate(t,e)),this}translate(t,e){return typeof t=="number"?this.segments.forEach(n=>n.translate(t,e)):this.segments.forEach(n=>n.translate(t)),this}clone(){const t=new J;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(t==null)return!1;const e=this.segments,n=t.segments,s=e.length;if(n.length!==s)return!1;for(let o=0;o<s;o+=1){const r=e[o],a=n[o];if(r.type!==a.type||!r.equals(a))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}function fn(i,t,e){let n,s;typeof t=="object"?(n=t.x,s=t.y):(n=t,s=e);const o=J.parse(i),r=o.bbox();if(r){let a=-r.height/2-r.y,l=-r.width/2-r.x;typeof n=="number"&&(l-=n),typeof s=="number"&&(a-=s),o.translate(l,a)}return o.serialize()}const Eo=/[\t\r\n\f]/g,So=/\S+/g,pn=i=>` ${i} `;function mn(i){return i&&i.getAttribute&&i.getAttribute("class")||""}function ge(i,t){if(i==null||t==null)return!1;const e=pn(mn(i)),n=pn(t);return i.nodeType===1?e.replace(Eo," ").includes(n):!1}function Q(i,t){if(!(i==null||t==null)){if(typeof t=="function")return Q(i,t(mn(i)));if(typeof t=="string"&&i.nodeType===1){const e=t.match(So)||[],n=pn(mn(i)).replace(Eo," ");let s=e.reduce((o,r)=>o.indexOf(pn(r))<0?`${o}${r} `:o,n);s=s.trim(),n!==s&&i.setAttribute("class",s)}}}function lt(i,t){if(i!=null){if(typeof t=="function")return lt(i,t(mn(i)));if((!t||typeof t=="string")&&i.nodeType===1){const e=(t||"").match(So)||[],n=pn(mn(i)).replace(Eo," ");let s=e.reduce((o,r)=>{const a=pn(r);return o.indexOf(a)>-1?o.replace(a," "):o},n);s=t?s.trim():"",n!==s&&i.setAttribute("class",s)}}}function ae(i,t,e){if(!(i==null||t==null)){if(e!=null&&typeof t=="string"){e?Q(i,t):lt(i,t);return}if(typeof t=="function")return ae(i,t(mn(i),e),e);typeof t=="string"&&(t.match(So)||[]).forEach(s=>{ge(i,s)?lt(i,s):Q(i,s)})}}let Zl=0;function ky(){return Zl+=1,`v${Zl}`}function Mo(i){return(i.id==null||i.id==="")&&(i.id=ky()),i.id}function Oe(i){return i==null?!1:typeof i.getScreenCTM=="function"&&i instanceof SVGElement}const Bt={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"},tc="1.1";function ec(i,t=document){return t.createElement(i)}function Bo(i,t=Bt.xhtml,e=document){return e.createElementNS(t,i)}function le(i,t=document){return Bo(i,Bt.svg,t)}function is(i){if(i){const e=`<svg xmlns="${Bt.svg}" xmlns:xlink="${Bt.xlink}" version="${tc}">${i}</svg>`,{documentElement:n}=Ty(e,{async:!1});return n}const t=document.createElementNS(Bt.svg,"svg");return t.setAttributeNS(Bt.xmlns,"xmlns:xlink",Bt.xlink),t.setAttribute("version",tc),t}function Ty(i,t={}){let e;try{const n=new DOMParser;if(t.async!=null){const s=n;s.async=t.async}e=n.parseFromString(i,t.mimeType||"text/xml")}catch{e=void 0}if(!e||e.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${i}`);return e}function Iy(i,t=!0){const e=i.nodeName;return t?e.toLowerCase():e.toUpperCase()}function ko(i){let t=0,e=i.previousSibling;for(;e;)e.nodeType===1&&(t+=1),e=e.previousSibling;return t}function Py(i,t){return i.querySelectorAll(t)}function Oy(i,t){return i.querySelector(t)}function nc(i,t,e){const n=i.ownerSVGElement;let s=i.parentNode;for(;s&&s!==e&&s!==n;){if(ge(s,t))return s;s=s.parentNode}return null}function To(i,t){const e=t&&t.parentNode;return i===e||!!(e&&e.nodeType===1&&i.compareDocumentPosition(e)&16)}function Wt(i){i&&(Array.isArray(i)?i:[i]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function Wn(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Nt(i,t){(Array.isArray(t)?t:[t]).forEach(n=>{n!=null&&i.appendChild(n)})}function ic(i,t){const e=i.firstChild;return e?qn(e,t):Nt(i,t)}function qn(i,t){const e=i.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&e.insertBefore(s,i)})}function Ny(i,t){const e=i.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&e.insertBefore(s,i.nextSibling)})}function qt(i,t){t!=null&&t.appendChild(i)}function Ry(i){return!!i&&i.nodeType===1}function sc(i){try{return i instanceof HTMLElement}catch{return typeof i=="object"&&i.nodeType===1&&typeof i.style=="object"&&typeof i.ownerDocument=="object"}}function Dy(i,t){const e=[];let n=i.firstChild;for(;n;n=n.nextSibling)n.nodeType===1&&(!t||ge(n,t))&&e.push(n);return e}const oc=i=>{const t=Object.create(null);return e=>t[e]||(t[e]=i(e))},rc=oc(i=>i.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Io=oc(i=>$b(Gn(i)).replace(/ /g,"")),ac=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits","preserveAspectRatio"];function Ly(i,t){return i.getAttribute(t)}function Po(i,t){const e=cc(t);e.ns?i.hasAttributeNS(e.ns,e.local)&&i.removeAttributeNS(e.ns,e.local):i.hasAttribute(t)&&i.removeAttribute(t)}function Oo(i,t,e){if(e==null)return Po(i,t);const n=cc(t);n.ns&&typeof e=="string"?i.setAttributeNS(n.ns,t,e):t==="id"?i.id=`${e}`:i.setAttribute(t,`${e}`)}function lc(i,t){Object.keys(t).forEach(e=>{Oo(i,e,t[e])})}function W(i,t,e){if(t==null){const n=i.attributes,s={};for(let o=0;o<n.length;o+=1)s[n[o].name]=n[o].value;return s}if(typeof t=="string"&&e===void 0)return i.getAttribute(t);typeof t=="object"?lc(i,t):Oo(i,t,e)}function cc(i){if(i.indexOf(":")!==-1){const t=i.split(":");return{ns:Bt[t[0]],local:t[1]}}return{ns:null,local:i}}function Xn(i){const t={};return Object.keys(i).forEach(e=>{const n=ac.includes(e)?e:rc(e);t[n]=i[e]}),t}function ss(i){const t={};return i.split(";").forEach(n=>{const s=n.trim();if(s){const o=s.split("=");o.length&&(t[o[0].trim()]=o[1]?o[1].trim():"")}}),t}function No(i,t){return Object.keys(t).forEach(e=>{if(e==="class")i[e]=i[e]?`${i[e]} ${t[e]}`:t[e];else if(e==="style"){const n=typeof i[e]=="object",s=typeof t[e]=="object";let o,r;n&&s?(o=i[e],r=t[e]):n?(o=i[e],r=ss(t[e])):s?(o=ss(i[e]),r=t[e]):(o=ss(i[e]),r=ss(t[e])),i[e]=No(o,r)}else i[e]=t[e]}),i}const Qy=/-(.)/g;function Vy(i){return i.replace(Qy,(t,e)=>e.toUpperCase())}const Ro={},hc=["webkit","ms","moz","o"],uc=typeof document<"u"?document.createElement("div").style:{};function zy(i){for(let t=0;t<hc.length;t+=1){const e=hc[t]+i;if(e in uc)return e}return null}function Fy(i){const t=Vy(i);if(Ro[t]==null){const e=t.charAt(0).toUpperCase()+t.slice(1);Ro[t]=t in uc?t:zy(e)}return Ro[t]}function dc(i,t){const e=i.ownerDocument&&i.ownerDocument.defaultView&&i.ownerDocument.defaultView.opener?i.ownerDocument.defaultView.getComputedStyle(i,null):window.getComputedStyle(i,null);return e&&t?e.getPropertyValue(t)||e[t]:e}const Uy={animationIterationCount:!0,columnCount:!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};function Ky(i){return/^--/.test(i)}function os(i,t,e){const n=window.getComputedStyle(i,null);return e?n.getPropertyValue(t)||void 0:n[t]||i.style[t]}function rs(i,t){return parseInt(os(i,t),10)||0}function Jy(i,t){return!Uy[i]&&typeof t=="number"?`${t}px`:t}function nt(i,t,e){if(typeof t=="string"){const n=Ky(t);if(n||(t=Fy(t)),e===void 0)return os(i,t,n);n||(e=Jy(t,e));const s=i.style;n?s.setProperty(t,e):s[t]=e;return}for(const n in t)nt(i,n,t[n])}function Do(i){let t=2166136261,e=!1,n=i;for(let s=0,o=n.length;s<o;s+=1){let r=n.charCodeAt(s);r>127&&!e&&(n=unescape(encodeURIComponent(n)),r=n.charCodeAt(s),e=!0),t^=r,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function Lo(){let i="";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=Math.random()*16|0,r=s==="x"?o:s==="y"?o&3|8:s;i+=r.toString(16)}return i}function jy(i,t,e){const n=Math.min(2,Math.floor(i.length*.34));let s=Math.floor(i.length*.4)+1,o,r=!1;const a=i.toLowerCase();for(const l of t){const c=e(l);if(c!==void 0&&Math.abs(c.length-a.length)<=n){const h=c.toLowerCase();if(h===a){if(c===i)continue;return l}if(r||c.length<3)continue;const u=Gy(a,h,s-1);if(u===void 0)continue;u<3?(r=!0,o=l):(s=u,o=l)}}return o}function Gy(i,t,e){let n=new Array(t.length+1),s=new Array(t.length+1);const o=e+1;for(let a=0;a<=t.length;a+=1)n[a]=a;for(let a=1;a<=i.length;a+=1){const l=i.charCodeAt(a-1),c=a>e?a-e:1,h=t.length>e+a?e+a:t.length;s[0]=a;let u=a;for(let f=1;f<c;f+=1)s[f]=o;for(let f=c;f<=h;f+=1){const p=l===t.charCodeAt(f-1)?n[f-1]:Math.min(n[f]+1,s[f-1]+1,n[f-1]+2);s[f]=p,u=Math.min(u,p)}for(let f=h+1;f<=t.length;f+=1)s[f]=o;if(u>e)return;const g=n;n=s,s=g}const r=n[t.length];return r>e?void 0:r}const as=new WeakMap;function Yy(i,t){const e=Gn(t),n=as.get(i);if(n)return n[e]}function Hy(i,t,e){const n=Gn(t),s=as.get(i);s?s[n]=e:as.set(i,{[n]:e})}function _e(i,t,e){if(!t)return as.get(i);if(typeof t=="string"){if(e===void 0)return Yy(i,t);Hy(i,t,e);return}for(const n in t)_e(i,n,t[n])}const _y={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function Qo(i,t,e){if(t){if(typeof t=="string"){if(t=_y[t]||t,arguments.length<3)return i[t];i[t]=e;return}for(const n in t)Qo(i,n,t[n])}}function Wy(i,...t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(i.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})}const qy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e])};function Xy(i,t){qy(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}class $y{}const Zy=/^\s*class\s+/.test(`${$y}`)||/^\s*class\s*\{/.test(`${class{}}`);function Vo(i,t){let e;return Zy?e=class extends t{}:(e=function(){return t.apply(this,arguments)},Xy(e,t)),Object.defineProperty(e,"name",{value:i}),e}function gc(i){return i==="__proto__"}function zo(i,t,e="/"){let n;const s=Array.isArray(t)?t:t.split(e);if(s.length)for(n=i;s.length;){const o=s.shift();if(Object(n)===n&&o&&o in n)n=n[o];else return}return n}function bn(i,t,e,n="/"){const s=Array.isArray(t)?t:t.split(n),o=s.pop();if(o&&!gc(o)){let r=i;s.forEach(a=>{gc(a)||(r[a]==null&&(r[a]={}),r=r[a])}),r[o]=e}return i}function fc(i,t,e="/"){const n=Array.isArray(t)?t.slice():t.split(e),s=n.pop();if(s)if(n.length>0){const o=zo(i,n);o&&delete o[s]}else delete i[s];return i}function t6(i,t,e={}){const n=e.offset||0,s=[],o=[];let r,a,l=null;for(let c=0;c<i.length;c+=1){r=o[c]=i[c];for(let h=0,u=t.length;h<u;h+=1){const g=t[h],f=g.start+n,p=g.end+n;c>=f&&c<p&&(typeof r=="string"?r=o[c]={t:i[c],attrs:g.attrs}:r.attrs=No(No({},r.attrs),g.attrs),e.includeAnnotationIndices&&(r.annotations==null&&(r.annotations=[]),r.annotations.push(h)))}a=o[c-1],a?bt(r)&&bt(a)?(l=l,JSON.stringify(r.attrs)===JSON.stringify(a.attrs)?l.t+=r.t:(s.push(l),l=r)):bt(r)||bt(a)?(l=l,s.push(l),l=r):l=String(l||"")+String(r):l=r}return l!=null&&s.push(l),s}function e6(i){return i.replace(/ /g," ")}class U{get[Symbol.toStringTag](){return pc}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}static isVector(t){if(t==null)return!1;if(t instanceof U)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===pc)&&n.node instanceof SVGElement&&typeof n.sample=="function"&&typeof n.toPath=="function"}static create(t,e,n){return new U(t,e,n)}static createVectors(t){if(t[0]==="<"){const e=is(t),n=[];for(let s=0,o=e.childNodes.length;s<o;s+=1){const r=e.childNodes[s];n.push(U.create(document.importNode(r,!0)))}return n}return[U.create(t)]}static toNode(t){return U.isVector(t)?t.node:t}static toNodes(t){return Array.isArray(t)?t.map(e=>U.toNode(e)):[U.toNode(t)]}constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let s;if(U.isVector(t))s=t.node;else if(typeof t=="string")if(t.toLowerCase()==="svg")s=is();else if(t[0]==="<"){const o=is(t);s=document.importNode(o.firstChild,!0)}else s=document.createElementNS(Bt.svg,t);else s=t;this.node=s,e&&this.setAttributes(e),n&&this.append(n)}transform(t,e){return t==null?yn(this.node):(yn(this.node,t,e),this)}translate(t,e=0,n={}){return t==null?Ec(this.node):(Ec(this.node,t,e,n),this)}rotate(t,e,n,s={}){return t==null?Ko(this.node):(Ko(this.node,t,e,n,s),this)}scale(t,e){return t==null?Sc(this.node):(Sc(this.node,t,e),this)}getTransformToElement(t){const e=U.toNode(t);return Jo(this.node,e)}removeAttribute(t){return Po(this.node,t),this}getAttribute(t){return Ly(this.node,t)}setAttribute(t,e){return Oo(this.node,t,e),this}setAttributes(t){return lc(this.node,t),this}attr(t,e){return t==null?W(this.node):typeof t=="string"&&e===void 0?W(this.node,t):(typeof t=="object"?W(this.node,t):W(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:U.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?U.create(e):U.create("defs").appendTo(t)}text(t,e={}){return bc(this.node,t,e),this}tagName(){return Iy(this.node)}clone(){return U.create(this.node.cloneNode(!0))}remove(){return Wt(this.node),this}empty(){return Wn(this.node),this}append(t){return Nt(this.node,U.toNodes(t)),this}appendTo(t){return qt(this.node,U.isVector(t)?t.node:t),this}prepend(t){return ic(this.node,U.toNodes(t)),this}before(t){return qn(this.node,U.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(U.toNode(t),this.node),U.create(t)}first(){return this.node.firstChild?U.create(this.node.firstChild):null}last(){return this.node.lastChild?U.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?U.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(U.toNode(t))}find(t){const e=[],n=Py(this.node,t);if(n)for(let s=0,o=n.length;s<o;s+=1)e.push(U.create(n[s]));return e}findOne(t){const e=Oy(this.node,t);return e?U.create(e):null}findParentByClass(t,e){const n=nc(this.node,t,e);return n?U.create(n):null}matches(t){const e=this.node;this.node.matches;const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}contains(t){return To(this.node,U.isVector(t)?t.node:t)}wrap(t){const e=U.create(t),n=this.node.parentNode;return n!=null&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(e.node.parentNode==null)return null;if(e=U.create(e.node.parentNode),t==null)return e;do if(typeof t=="string"?e.matches(t):e instanceof t)return e;while(e=U.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1)t[n].nodeType===1&&e.push(U.create(t[n]));return e}eachChild(t,e){const n=this.children();for(let s=0,o=n.length;s<o;s+=1)t.call(n[s],n[s],s,n),e&&n[s].eachChild(t,e);return this}index(){return ko(this.node)}hasClass(t){return ge(this.node,t)}addClass(t){return Q(this.node,t),this}removeClass(t){return lt(this.node,t),this}toggleClass(t,e){return ae(this.node,t,e),this}toLocalPoint(t,e){return x6(this.node,t,e)}sample(t=1){return this.node instanceof SVGPathElement?o6(this.node,t):[]}toPath(){return U.create(d6(this.node))}toPathData(){return xc(this.node)}}const pc=`X6.${U.name}`;function n6(i,t){const e=U.create(t),n=U.create("textPath"),s=i.d;if(s&&i["xlink:href"]===void 0){const o=U.create("path").attr("d",s).appendTo(e.defs());n.attr("xlink:href",`#${o.id}`)}return typeof i=="object"&&n.attr(i),n.node}function i6(i,t,e){const n=e.eol,s=e.baseSize,o=e.lineHeight;let r=0,a;const l={},c=t.length-1;for(let h=0;h<=c;h+=1){let u=t[h],g=null;if(typeof u=="object"){const f=u.attrs,p=U.create("tspan",f);a=p.node;let m=u.t;n&&h===c&&(m+=n),a.textContent=m;const b=f.class;b&&p.addClass(b),e.includeAnnotationIndices&&p.attr("annotations",u.annotations.join(",")),g=parseFloat(f["font-size"]),g===void 0&&(g=s),g&&g>r&&(r=g)}else n&&h===c&&(u+=n),a=document.createTextNode(u||" "),s&&s>r&&(r=s);i.appendChild(a)}return r&&(l.maxFontSize=r),o?l.lineHeight=o:r&&(l.lineHeight=r*1.2),l}const mc=/em$/;function ls(i,t){const e=parseFloat(i);return mc.test(i)?e*t:e}function s6(i,t,e,n){if(!Array.isArray(t))return 0;const s=t.length;if(!s)return 0;let o=t[0];const r=ls(o.maxFontSize,e)||e;let a=0;const l=ls(n,e);for(let u=1;u<s;u+=1){o=t[u];const g=ls(o.lineHeight,e)||l;a+=g}const c=ls(o.maxFontSize,e)||e;let h;switch(i){case"middle":h=r/2-.15*c-a/2;break;case"bottom":h=-(.25*c)-a;break;case"top":default:h=.8*r;break}return h}function bc(i,t,e={}){t=e6(t);const n=e.eol;let s=e.textPath;const o=e.textVerticalAnchor,r=o==="middle"||o==="bottom"||o==="top";let a=e.x;a===void 0&&(a=i.getAttribute("x")||0);const l=e.includeAnnotationIndices;let c=e.annotations;c&&!Array.isArray(c)&&(c=[c]);const h=e.lineHeight,u=h==="auto",g=u?"1.5em":h||"1em";let f=!0;const p=i.childNodes;if(p.length===1){const k=p[0];k&&k.tagName.toUpperCase()==="TITLE"&&(f=!1)}f&&Wn(i),W(i,{"xml:space":"preserve",display:t||e.displayEmpty?null:"none"});const m=W(i,"font-size");let b=parseFloat(m);b||(b=16,(r||c)&&!m&&W(i,"font-size",`${b}`));let y;s?(typeof s=="string"&&(s={d:s}),y=n6(s,i)):y=document.createDocumentFragment();let w,C=0,x;const E=t.split(`
|
|
3
|
+
`),S=[],v=E.length-1;for(let k=0;k<=v;k+=1){w=g;let I="v-line";const O=le("tspan");let R,K=E[k];if(K)if(c){const D=t6(K,c,{offset:-C,includeAnnotationIndices:l});R=i6(O,D,{eol:k!==v&&n,baseSize:b,lineHeight:u?null:g,includeAnnotationIndices:l});const N=R.lineHeight;N&&u&&k!==0&&(w=N),k===0&&(x=R.maxFontSize*.8)}else n&&k!==v&&(K+=n),O.textContent=K;else{O.textContent="-",I+=" v-empty-line";const D=O.style;D.fillOpacity=0,D.strokeOpacity=0,c&&(R={})}R&&S.push(R),k>0&&O.setAttribute("dy",w),(k>0||s)&&O.setAttribute("x",a),O.className.baseVal=I,y.appendChild(O),C+=K.length+1}if(r)if(c)w=s6(o,S,b,g);else if(o==="top")w="0.8em";else{let k;switch(v>0?(k=parseFloat(g)||1,k*=v,mc.test(g)||(k/=b)):k=0,o){case"middle":w=`${.3-k/2}em`;break;case"bottom":w=`${-k-.3}em`;break}}else o===0?w="0em":o?w=o:(w=0,i.getAttribute("y")==null&&i.setAttribute("y",`${x||"0.8em"}`));y.firstChild.setAttribute("dy",w),i.appendChild(y)}function $n(i,t={}){const e=document.createElement("canvas").getContext("2d");if(!i)return{width:0};const n=[],s=t["font-size"]?`${parseFloat(t["font-size"])}px`:"14px";return n.push(t["font-style"]||"normal"),n.push(t["font-variant"]||"normal"),n.push(t["font-weight"]||400),n.push(s),n.push(t["font-family"]||"sans-serif"),e.font=n.join(" "),e.measureText(i)}function yc(i,t,e,n={}){if(t>=e)return[i,""];const s=i.length,o={};let r=Math.round(t/e*s-1);for(r<0&&(r=0);r>=0&&r<s;){const a=i.slice(0,r),l=o[a]||$n(a,n).width,c=i.slice(0,r+1),h=o[c]||$n(c,n).width;if(o[a]=l,o[c]=h,l>t)r-=1;else if(h<=t)r+=1;else break}return[i.slice(0,r),i.slice(r)]}function wc(i,t,e={},n={}){const s=t.width,o=t.height,r=n.eol||`
|
|
4
|
+
`,a=e.fontSize||14,l=e.lineHeight?parseFloat(e.lineHeight):Math.ceil(a*1.4),c=Math.floor(o/l);if(i.indexOf(r)>-1){const b=Lo(),y=[];return i.split(r).forEach(w=>{const C=wc(w,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),e,Object.assign(Object.assign({},n),{eol:b}));C&&y.push(...C.split(b))}),y.slice(0,c).join(r)}const{width:h}=$n(i,e);if(h<s)return i;const u=[];let g=i,f=h,p=n.ellipsis,m=0;p&&(typeof p!="string"&&(p="…"),m=$n(p,e).width);for(let b=0;b<c;b+=1)if(f>s)if(b===c-1){const[w]=yc(g,s-m,f,e);u.push(p?`${w}${p}`:w)}else{const[w,C]=yc(g,s,f,e);u.push(w),g=C,f=$n(g,e).width}else{u.push(g);break}return u.join(r)}const Fo=.551784;function Rt(i,t,e=NaN){const n=i.getAttribute(t);if(n==null)return e;const s=parseFloat(n);return Number.isNaN(s)?e:s}function o6(i,t=1){const e=i.getTotalLength(),n=[];let s=0,o;for(;s<e;)o=i.getPointAtLength(s),n.push({distance:s,x:o.x,y:o.y}),s+=t;return n}function r6(i){return["M",Rt(i,"x1"),Rt(i,"y1"),"L",Rt(i,"x2"),Rt(i,"y2")].join(" ")}function a6(i){const t=cs(i);return t.length===0?null:`${Cc(t)} Z`}function l6(i){const t=cs(i);return t.length===0?null:Cc(t)}function Cc(i){return`M ${i.map(e=>`${e.x} ${e.y}`).join(" L")}`}function cs(i){const t=[],e=i.points;if(e)for(let n=0,s=e.numberOfItems;n<s;n+=1)t.push(e.getItem(n));return t}function c6(i){const t=Rt(i,"cx",0),e=Rt(i,"cy",0),n=Rt(i,"r"),s=n*Fo;return["M",t,e-n,"C",t+s,e-n,t+n,e-s,t+n,e,"C",t+n,e+s,t+s,e+n,t,e+n,"C",t-s,e+n,t-n,e+s,t-n,e,"C",t-n,e-s,t-s,e-n,t,e-n,"Z"].join(" ")}function h6(i){const t=Rt(i,"cx",0),e=Rt(i,"cy",0),n=Rt(i,"rx"),s=Rt(i,"ry")||n,o=n*Fo,r=s*Fo;return["M",t,e-s,"C",t+o,e-s,t+n,e-r,t+n,e,"C",t+n,e+r,t+o,e+s,t,e+s,"C",t-o,e+s,t-n,e+r,t-n,e,"C",t-n,e-r,t-o,e-s,t,e-s,"Z"].join(" ")}function u6(i){return Ac({x:Rt(i,"x",0),y:Rt(i,"y",0),width:Rt(i,"width",0),height:Rt(i,"height",0),rx:Rt(i,"rx",0),ry:Rt(i,"ry",0)})}function Ac(i){let t;const e=i.x,n=i.y,s=i.width,o=i.height,r=Math.min(i.rx||i["top-rx"]||0,s/2),a=Math.min(i.rx||i["bottom-rx"]||0,s/2),l=Math.min(i.ry||i["top-ry"]||0,o/2),c=Math.min(i.ry||i["bottom-ry"]||0,o/2);return r||a||l||c?t=["M",e,n+l,"v",o-l-c,"a",a,c,0,0,0,a,c,"h",s-2*a,"a",a,c,0,0,0,a,-c,"v",-(o-c-l),"a",r,l,0,0,0,-r,-l,"h",-(s-2*r),"a",r,l,0,0,0,-r,l,"Z"]:t=["M",e,n,"H",e+s,"V",n+o,"H",e,"V",n,"Z"],t.join(" ")}function d6(i){const t=le("path");W(t,W(i));const e=xc(i);return e&&t.setAttribute("d",e),t}function xc(i){const t=i.tagName.toLowerCase();switch(t){case"path":return i.getAttribute("d");case"line":return r6(i);case"polygon":return a6(i);case"polyline":return l6(i);case"ellipse":return h6(i);case"circle":return c6(i);case"rect":return u6(i)}throw new Error(`"${t}" cannot be converted to svg path element.`)}const g6=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,vc=/[ ,]+/,f6=/^(\w+)\((.*)\)/;function p6(i,t){const n=le("svg").createSVGPoint();return n.x=i,n.y=t,n}function kt(i){const e=le("svg").createSVGMatrix();if(i!=null){const n=i,s=["a","b","c","d","e","f"];for(const o of s)n[o]!==void 0&&(e[o]=n[o])}return e}function m6(i){const t=le("svg");return i!=null?(i instanceof DOMMatrix||(i=kt(i)),t.createSVGTransformFromMatrix(i)):t.createSVGTransform()}function Zn(i){let t=kt();const e=i!=null&&i.match(g6);if(!e)return t;for(let n=0,s=e.length;n<s;n+=1){const r=e[n].match(f6);if(r){let a,l,c,h,u,g=kt();const f=r[2].split(vc);switch(r[1].toLowerCase()){case"scale":a=parseFloat(f[0]),l=f[1]===void 0?a:parseFloat(f[1]),g=g.scaleNonUniform(a,l);break;case"translate":c=parseFloat(f[0]),h=parseFloat(f[1]),g=g.translate(c,h);break;case"rotate":u=parseFloat(f[0]),c=parseFloat(f[1])||0,h=parseFloat(f[2])||0,c!==0||h!==0?g=g.translate(c,h).rotate(u).translate(-c,-h):g=g.rotate(u);break;case"skewx":u=parseFloat(f[0]),g=g.skewX(u);break;case"skewy":u=parseFloat(f[0]),g=g.skewY(u);break;case"matrix":g.a=parseFloat(f[0]),g.b=parseFloat(f[1]),g.c=parseFloat(f[2]),g.d=parseFloat(f[3]),g.e=parseFloat(f[4]),g.f=parseFloat(f[5]);break;default:continue}t=t.multiply(g)}}return t}function ti(i){const t=i||{},e=t.a!=null?t.a:1,n=t.b!=null?t.b:0,s=t.c!=null?t.c:0,o=t.d!=null?t.d:1,r=t.e!=null?t.e:0,a=t.f!=null?t.f:0;return`matrix(${e},${n},${s},${o},${r},${a})`}function hs(i){let t,e,n;if(i){const o=vc;if(i.trim().indexOf("matrix")>=0){const r=Zn(i),a=b6(r);t=[a.translateX,a.translateY],e=[a.rotation],n=[a.scaleX,a.scaleY];const l=[];(t[0]!==0||t[1]!==0)&&l.push(`translate(${t.join(",")})`),(n[0]!==1||n[1]!==1)&&l.push(`scale(${n.join(",")})`),e[0]!==0&&l.push(`rotate(${e[0]})`),i=l.join(" ")}else{const r=i.match(/translate\((.*?)\)/);r&&(t=r[1].split(o));const a=i.match(/rotate\((.*?)\)/);a&&(e=a[1].split(o));const l=i.match(/scale\((.*?)\)/);l&&(n=l[1].split(o))}}const s=n&&n[0]?parseFloat(n[0]):1;return{raw:i||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:e&&e[0]?parseInt(e[0],10):0,cx:e&&e[1]?parseInt(e[1],10):void 0,cy:e&&e[2]?parseInt(e[2],10):void 0},scale:{sx:s,sy:n&&n[1]?parseFloat(n[1]):s}}}function Uo(i,t){const e=t.x*i.a+t.y*i.c+0,n=t.x*i.b+t.y*i.d+0;return{x:e,y:n}}function b6(i){const t=Uo(i,{x:0,y:1}),e=Uo(i,{x:1,y:0}),n=180/Math.PI*Math.atan2(t.y,t.x)-90,s=180/Math.PI*Math.atan2(e.y,e.x);return{skewX:n,skewY:s,translateX:i.e,translateY:i.f,scaleX:Math.sqrt(i.a*i.a+i.b*i.b),scaleY:Math.sqrt(i.c*i.c+i.d*i.d),rotation:n}}function y6(i){let t,e,n,s;return i?(t=i.a==null?1:i.a,s=i.d==null?1:i.d,e=i.b,n=i.c):t=s=1,{sx:e?Math.sqrt(t*t+e*e):t,sy:n?Math.sqrt(n*n+s*s):s}}function w6(i){let t={x:0,y:1};i&&(t=Uo(i,t));const e=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:e%360+(e<0?360:0)}}function C6(i){return{tx:i&&i.e||0,ty:i&&i.f||0}}function yn(i,t,e={}){if(t==null)return Zn(W(i,"transform"));if(e.absolute){i.setAttribute("transform",ti(t));return}const n=i.transform,s=m6(t);n.baseVal.appendItem(s)}function Ec(i,t,e=0,n={}){let s=W(i,"transform");const o=hs(s);if(t==null)return o.translation;s=o.raw,s=s.replace(/translate\([^)]*\)/g,"").trim();const r=n.absolute?t:o.translation.tx+t,a=n.absolute?e:o.translation.ty+e,l=`translate(${r},${a})`;i.setAttribute("transform",`${l} ${s}`.trim())}function Ko(i,t,e,n,s={}){let o=W(i,"transform");const r=hs(o);if(t==null)return r.rotation;o=r.raw,o=o.replace(/rotate\([^)]*\)/g,"").trim(),t%=360;const a=s.absolute?t:r.rotation.angle+t,l=e!=null&&n!=null?`,${e},${n}`:"",c=`rotate(${a}${l})`;i.setAttribute("transform",`${o} ${c}`.trim())}function Sc(i,t,e){let n=W(i,"transform");const s=hs(n);if(t==null)return s.scale;e=e??t,n=s.raw,n=n.replace(/scale\([^)]*\)/g,"").trim();const o=`scale(${t},${e})`;i.setAttribute("transform",`${n} ${o}`.trim())}function Jo(i,t){if(Oe(t)&&Oe(i)){const e=t.getScreenCTM(),n=i.getScreenCTM();if(e&&n)return e.inverse().multiply(n)}return kt()}function A6(i,t){let e=kt();if(Oe(t)&&Oe(i)){let n=i;const s=[];for(;n&&n!==t;){const o=n.getAttribute("transform")||null,r=Zn(o);s.push(r),n=n.parentNode}s.reverse().forEach(o=>{e=e.multiply(o)})}return e}function x6(i,t,e){const n=i instanceof SVGSVGElement?i:i.ownerSVGElement,s=n.createSVGPoint();s.x=t,s.y=e;try{const o=n.getScreenCTM(),r=s.matrixTransform(o.inverse()),a=Jo(i,n).inverse();return r.matrixTransform(a)}catch{return s}}const Mc={};function wn(i){return Mc[i]||{}}function us(i,t){Mc[i]=t}const ei=new WeakMap;function v6(i){return ei.has(i)||ei.set(i,{events:Object.create(null)}),ei.get(i)}function jo(i){return ei.get(i)}function E6(i){return ei.delete(i)}const ds=()=>!0,Cn=()=>!1;function Bc(i){i.stopPropagation()}function S6(i,t,e){i.addEventListener!=null&&i.addEventListener(t,e)}function M6(i,t,e){i.removeEventListener!=null&&i.removeEventListener(t,e)}const B6=/[^\x20\t\r\n\f]+/g,k6=/^([^.]*)(?:\.(.+)|)/;function kc(i){return(i||"").match(B6)||[""]}function Tc(i){const t=k6.exec(i)||[];return{originType:t[1]?t[1].trim():t[1],namespaces:t[2]?t[2].split(".").map(e=>e.trim()).sort():[]}}function Go(i){return i.nodeType===1||i.nodeType===9||!+i.nodeType}let Ic=0;const An=new WeakMap;function Pc(i){return An.has(i)||(An.set(i,Ic),Ic+=1),An.get(i)}function T6(i){return An.get(i)}function I6(i){return An.delete(i)}function Oc(i,t){return An.set(i,t)}function P6(i,t){const e=[],n=jo(i),s=n&&n.events&&n.events[t.type],o=s&&s.handlers||[],r=s?s.delegateCount:0;if(r>0&&!(t.type==="click"&&typeof t.button=="number"&&t.button>=1)){for(let a=t.target;a!==i;a=a.parentNode||i)if(a.nodeType===1&&!(t.type==="click"&&a.disabled===!0)){const l=[],c={};for(let h=0;h<r;h+=1){const u=o[h],g=u.selector;if(g!=null&&c[g]==null){const f=i,p=[];f.querySelectorAll(g).forEach(m=>{p.push(m)}),c[g]=p.includes(a)}c[g]&&l.push(u)}l.length&&e.push({elem:a,handlers:l})}}return r<o.length&&e.push({elem:i,handlers:o.slice(r)}),e}function Nc(i){return i!=null&&i===i.window}function Rc(i,t){const e=i.nodeType===9?i.documentElement:i,n=t&&t.parentNode;return i===n||!!(n&&n.nodeType===1&&(e.contains?e.contains(n):i.compareDocumentPosition&&i.compareDocumentPosition(n)&16))}class ve{static create(t){return t instanceof ve?t:new ve(t)}static addProperty(t,e){Object.defineProperty(ve.prototype,t,{enumerable:!0,configurable:!0,get:typeof e=="function"?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(n){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}})}constructor(t,e){this.isDefaultPrevented=Cn,this.isPropagationStopped=Cn,this.isImmediatePropagationStopped=Cn,this.isSimulated=!1,this.preventDefault=()=>{const n=this.originalEvent;this.isDefaultPrevented=ds,n&&!this.isSimulated&&n.preventDefault()},this.stopPropagation=()=>{const n=this.originalEvent;this.isPropagationStopped=ds,n&&!this.isSimulated&&n.stopPropagation()},this.stopImmediatePropagation=()=>{const n=this.originalEvent;this.isImmediatePropagationStopped=ds,n&&!this.isSimulated&&n.stopImmediatePropagation(),this.stopPropagation()},typeof t=="string"?this.type=t:t.type&&(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?ds:Cn,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.timeStamp=t.timeStamp),e&&Object.assign(this,e),this.timeStamp||(this.timeStamp=Date.now())}}const Dc={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(Dc).forEach(i=>ve.addProperty(i,Dc[i])),us("load",{noBubble:!0}),us("beforeunload",{postDispatch(i,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}),us("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(i,t){let e;const n=t.relatedTarget,s=t.handleObj;return(!n||n!==i&&!Rc(i,n))&&(t.type=s.originType,e=s.handler.call(i,t),t.type="mouseover"),e}}),us("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(i,t){let e;const n=t.relatedTarget,s=t.handleObj;return(!n||n!==i&&!Rc(i,n))&&(t.type=s.originType,e=s.handler.call(i,t),t.type="mouseout"),e}});let Yo;function O6(i,t,e,n,s){if(!Go(i))return;let o;if(typeof e!="function"){const{handler:c,selector:h}=e,u=Y(e,["handler","selector"]);e=c,s=h,o=u}const r=v6(i);let a=r.handler;a==null&&(a=r.handler=function(c,...h){return Yo!==c.type?N6(i,c,...h):void 0});const l=Pc(e);kc(t).forEach(c=>{const{originType:h,namespaces:u}=Tc(c);if(!h)return;let g=h,f=wn(g);g=(s?f.delegateType:f.bindType)||g,f=wn(g);const p=Object.assign({type:g,originType:h,data:n,selector:s,guid:l,handler:e,namespace:u.join(".")},o),m=r.events;let b=m[g];b||(b=m[g]={handlers:[],delegateCount:0},(!f.setup||f.setup(i,n,u,a)===!1)&&S6(i,g,a)),f.add&&(I6(p.handler),f.add(i,p),Oc(p.handler,l)),s?(b.handlers.splice(b.delegateCount,0,p),b.delegateCount+=1):b.handlers.push(p)})}function Lc(i,t,e,n,s){const o=jo(i);if(!o)return;const r=o.events;r&&(kc(t).forEach(a=>{const{originType:l,namespaces:c}=Tc(a);if(!l){Object.keys(r).forEach(m=>{Lc(i,m+a,e,n,!0)});return}let h=l;const u=wn(h);h=(n?u.delegateType:u.bindType)||h;const g=r[h];if(!g)return;const f=c.length>0?new RegExp(`(^|\\.)${c.join("\\.(?:.*\\.|)")}(\\.|$)`):null,p=g.handlers.length;for(let m=g.handlers.length-1;m>=0;m-=1){const b=g.handlers[m];(s||l===b.originType)&&(!e||T6(e)===b.guid)&&(f==null||b.namespace&&f.test(b.namespace))&&(n==null||n===b.selector||n==="**"&&b.selector)&&(g.handlers.splice(m,1),b.selector&&(g.delegateCount-=1),u.remove&&u.remove(i,b))}p&&g.handlers.length===0&&((!u.teardown||u.teardown(i,c,o.handler)===!1)&&M6(i,h,o.handler),delete r[h])}),Object.keys(r).length===0&&E6(i))}function N6(i,t,...e){const n=ve.create(t);n.delegateTarget=i;const s=wn(n.type);if(s.preDispatch&&s.preDispatch(i,n)===!1)return;const o=P6(i,n);for(let r=0,a=o.length;r<a&&!n.isPropagationStopped();r+=1){const l=o[r];n.currentTarget=l.elem;for(let c=0,h=l.handlers.length;c<h&&!n.isImmediatePropagationStopped();c+=1){const u=l.handlers[c];if(n.rnamespace==null||u.namespace&&n.rnamespace.test(u.namespace)){n.handleObj=u,n.data=u.data;const g=wn(u.originType).handle,f=g?g(l.elem,n,...e):u.handler.call(l.elem,n,...e);f!==void 0&&(n.result=f,f===!1&&(n.preventDefault(),n.stopPropagation()))}}}return s.postDispatch&&s.postDispatch(i,n),n.result}function R6(i,t,e,n){let s=i,o=typeof i=="string"?i:i.type,r=typeof i=="string"||s.namespace==null?[]:s.namespace.split(".");const a=e;if(a.nodeType===3||a.nodeType===8)return;o.indexOf(".")>-1&&(r=o.split("."),o=r.shift(),r.sort());const l=o.indexOf(":")<0&&`on${o}`;s=i instanceof ve?i:new ve(o,typeof i=="object"?i:null),s.namespace=r.join("."),s.rnamespace=s.namespace?new RegExp(`(^|\\.)${r.join("\\.(?:.*\\.|)")}(\\.|$)`):null,s.result=void 0,s.target||(s.target=a);const c=[s];Array.isArray(t)?c.push(...t):c.push(t);const h=wn(o);if(!n&&h.trigger&&h.trigger(a,s,t)===!1)return;let u;const g=[a];if(!n&&!h.noBubble&&!Nc(a)){u=h.delegateType||o;let p=a,m=a.parentNode;for(;m!=null;)g.push(m),p=m,m=m.parentNode;const b=a.ownerDocument||document;if(p===b){const y=p.defaultView||p.parentWindow||window;g.push(y)}}let f=a;for(let p=0,m=g.length;p<m&&!s.isPropagationStopped();p+=1){const b=g[p];f=b,s.type=p>1?u:h.bindType||o;const y=jo(b);y&&y.events[s.type]&&y.handler&&y.handler.call(b,...c);const w=l&&b[l]||null;w&&Go(b)&&(s.result=w.call(b,...c),s.result===!1&&s.preventDefault())}if(s.type=o,!n&&!s.isDefaultPrevented()){const p=h.preventDefault;if((p==null||p(g.pop(),s,t)===!1)&&Go(a)&&l&&typeof a[o]=="function"&&!Nc(a)){const m=a[l];m&&(a[l]=null),Yo=o,s.isPropagationStopped()&&f.addEventListener(o,Bc),a[o](),s.isPropagationStopped()&&f.removeEventListener(o,Bc),Yo=void 0,m&&(a[l]=m)}}return s.result}class ot{static on(t,e,n,s,o){return ni.on(t,e,n,s,o),t}static once(t,e,n,s,o){return ni.on(t,e,n,s,o,!0),t}static off(t,e,n,s){return ni.off(t,e,n,s),t}static trigger(t,e,n,s){return R6(e,n,t,s),t}}var ni;(function(i){function t(n,s,o,r,a,l){if(typeof s=="object"){typeof o!="string"&&(r=r||o,o=void 0),Object.keys(s).forEach(c=>t(n,c,o,r,s[c],l));return}if(r==null&&a==null?(a=o,r=o=void 0):a==null&&(typeof o=="string"?(a=r,r=void 0):(a=r,r=o,o=void 0)),a===!1)a=Cn;else if(!a)return;if(l){const c=a;a=function(h,...u){return i.off(n,h),c.call(this,h,...u)},Oc(a,Pc(c))}O6(n,s,a,r,o)}i.on=t;function e(n,s,o,r){const a=s;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;e(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof s=="object"){const l=s;Object.keys(l).forEach(c=>e(n,c,o,l[c]));return}(o===!1||typeof o=="function")&&(r=o,o=void 0),r===!1&&(r=Cn),Lc(n,s,r,o)}i.off=e})(ni||(ni={}));class Qc{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=uy("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(t){if(this.onWheelGuard!=null&&!this.onWheelGuard(t))return;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault();let e;(this.deltaX!==0||this.deltaY!==0)&&(t.stopPropagation(),e=!0),e===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function xn(i){const t=i.getBoundingClientRect(),e=i.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}}function D6(i){return i.getBoundingClientRect().width}function L6(i){return i.getBoundingClientRect().height}function Q6(i){const t=os(i,"position")==="fixed";let e;if(t){const n=i.getBoundingClientRect();e={left:n.left,top:n.top}}else e=xn(i);if(!t){const n=i.ownerDocument;let s=i.offsetParent||n.documentElement;for(;(s===n.body||s===n.documentElement)&&os(s,"position")==="static";)s=s.parentNode;if(s!==i&&Ry(s)){const o=xn(s);e.top-=o.top+rs(s,"borderTopWidth"),e.left-=o.left+rs(s,"borderLeftWidth")}}return{top:e.top-rs(i,"marginTop"),left:e.left-rs(i,"marginLeft")}}function Ee(i,t){const e=p6(i.x,i.y).matrixTransform(t);return new A(e.x,e.y)}function V6(i,t){return new z(Ee(i.start,t),Ee(i.end,t))}function Xt(i,t){const n=le("svg").createSVGPoint();n.x=i.x,n.y=i.y;const s=n.matrixTransform(t);n.x=i.x+i.width,n.y=i.y;const o=n.matrixTransform(t);n.x=i.x+i.width,n.y=i.y+i.height;const r=n.matrixTransform(t);n.x=i.x,n.y=i.y+i.height;const a=n.matrixTransform(t),l=Math.min(s.x,o.x,r.x,a.x),c=Math.max(s.x,o.x,r.x,a.x),h=Math.min(s.y,o.y,r.y,a.y),u=Math.max(s.y,o.y,r.y,a.y);return new P(l,h,c-l,u-h)}function Vc(i,t,e){let n=null;if(!i.ownerSVGElement)return new P(0,0,0,0);try{n=i.getBBox()}catch{n={x:i.clientLeft,y:i.clientTop,width:i.clientWidth,height:i.clientHeight}}return P.create(n)}function fe(i,t={}){let e=null;if(!i.ownerSVGElement||!Oe(i)){if(sc(i)){const{left:r,top:a,width:l,height:c}=zc(i);return new P(r,a,l,c)}return new P(0,0,0,0)}let s=t.target;if(!t.recursive){try{e=i.getBBox()}catch{e={x:i.clientLeft,y:i.clientTop,width:i.clientWidth,height:i.clientHeight}}if(!s)return P.create(e);const r=Jo(i,s);return Xt(e,r)}{const r=i.childNodes,a=r.length;if(a===0)return fe(i,{target:s});s||(s=i);let l=null;for(let c=0;c<a;c+=1){const h=r[c];let u=null;h.childNodes.length===0?u=fe(h,{target:s}):u=fe(h,{target:s,recursive:!0}),l?l=l.union(u):l=P.create(u)}return l||new P(0,0,0,0)}}function zc(i){let t=0,e=0,n=0,s=0;if(i){let o=i;for(;o;)t+=o.offsetLeft,e+=o.offsetTop,o=o.offsetParent,o&&(t+=parseInt(dc(o,"borderLeft"),10),e+=parseInt(dc(o,"borderTop"),10));n=i.offsetWidth,s=i.offsetHeight}return{left:t,top:e,width:n,height:s}}function Fc(i){const t=e=>{const n=i.getAttribute(e),s=n?parseFloat(n):0;return Number.isNaN(s)?0:s};switch(i instanceof SVGElement&&i.nodeName.toLowerCase()){case"rect":return new P(t("x"),t("y"),t("width"),t("height"));case"circle":return new Jt(t("cx"),t("cy"),t("r"),t("r"));case"ellipse":return new Jt(t("cx"),t("cy"),t("rx"),t("ry"));case"polyline":{const e=cs(i);return new Mt(e)}case"polygon":{const e=cs(i);return e.length>1&&e.push(e[0]),new Mt(e)}case"path":{let e=i.getAttribute("d");return Ay(e)||(e=$l(e)),J.parse(e)}case"line":return new z(t("x1"),t("y1"),t("x2"),t("y2"))}return fe(i)}function z6(i){if(i==null)return null;let t=i;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),ge(t,"x6-port"))t=t.nextElementSibling;else if(e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}function F6(i){const t=z6(i);if(!Oe(t)){if(sc(i)){const{left:s,top:o,width:r,height:a}=zc(i);return new P(s,o,r,a)}return new P(0,0,0,0)}return Fc(t).bbox()||P.create()}const U6=(i,t)=>i-t;class K6{constructor(t={}){this.comparator=t.comparator||U6,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(t,e,n){const s={priority:t,value:e},o=this.data.length;return n&&(s.id=n,this.index[n]=o),this.data.push(s),this.bubbleUp(o),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if(typeof n>"u")throw new Error(`Node with id '${t}' was not found in the heap.`);const s=this.data,o=s[n].priority,r=this.comparator(e,o);r<0?(s[n].priority=e,this.bubbleUp(n)):r>0&&(s[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return e!=null&&e.id&&delete this.index[e.id],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,s,o=t;for(;o>0&&(s=o-1>>>1,this.comparator(e[o].priority,e[s].priority)<0);){n=e[s],e[s]=e[o];let r=e[o].id;r!=null&&(this.index[r]=s),e[o]=n,r=e[o].id,r!=null&&(this.index[r]=o),o=s}}bubbleDown(t){const e=this.data,n=e.length-1;let s=t;for(;;){const o=(s<<1)+1,r=o+1;let a=s;if(o<=n&&this.comparator(e[o].priority,e[a].priority)<0&&(a=o),r<=n&&this.comparator(e[r].priority,e[a].priority)<0&&(a=r),a!==s){const l=e[a];e[a]=e[s];let c=e[s].id;c!=null&&(this.index[c]=a),e[s]=l,c=e[s].id,c!=null&&(this.index[c]=s),s=a}else break}}}function J6(i,t,e=(n,s)=>1){const n={},s={},o={},r=new K6;for(n[t]=0,Object.keys(i).forEach(a=>{a!==t&&(n[a]=1/0),r.insert(n[a],a,a)});!r.isEmpty();){const a=r.remove();o[a]=!0;const l=i[a];for(let c=0;c<l.length;c+=1){const h=l[c];if(!o[h]){const u=n[a]+e(a,h);u<n[h]&&(n[h]=u,s[h]=a,r.updatePriority(h,u))}}}return s}const ii=/(-?(?:\d*\.\d+|\d+))\s*(px|em|rem|ch|vh|vw|vmin|vmax|%|cm|mm|in|pt|pc|ex|fr|deg|rad|turn)$/,Uc=(i,t)=>{const e=t-i;return n=>i+e*n},Kc=(i,t)=>{const e=ii,n=e.exec(i),s=e.exec(t),o=s?s[1]:"",r=n?+n[1]:0,a=s?+s[1]:0,l=o.indexOf("."),c=l>0?o[1].length-l-1:0,h=a-r,u=n?n[2]:"";return g=>(r+h*g).toFixed(c)+u},j6=(i,t)=>{const e=parseInt(i.slice(1),16),n=parseInt(t.slice(1),16),s=e&255,o=(n&255)-s,r=e&65280,a=(n&65280)-r,l=e&16711680,c=(n&16711680)-l;return h=>{const u=s+o*h&255,g=r+a*h&65280,f=l+c*h&16711680;return`#${(1<<24|u|g|f).toString(16).slice(1)}`}},G6=(i,t)=>{const e=o=>{const r=[];if(!o)return r;const a=/(\w+)\(([^)]+)\)/g;let l=a.exec(o);for(;l!==null;)l[1]&&l[2]&&r.push({name:l[1],values:l[2].split(/\s*,\s*/).filter(Boolean)}),l=a.exec(o);return r},n=e(i),s=e(t);return n.length===0||s.length===0?()=>i:o=>{const r=[];for(let a=0;a<Math.min(n.length,s.length);a++){const l=n[a],c=s[a];if(!(!l||!c)&&l.name===c.name&&l.values.length>0&&l.values.length===c.values.length){const h=[];for(let u=0;u<l.values.length;u++){const g=l.values[u],f=c.values[u];if(!(g===void 0||f===void 0))if(ii.test(g)||ii.test(f)){const p=Kc(g,f);h.push(p(o))}else if(!Number.isNaN(parseFloat(g))&&!Number.isNaN(parseFloat(f))){const p=Uc(parseFloat(g),parseFloat(f));h.push(p(o).toString())}else h.push(g)}h.length>0&&r.push(`${l.name}(${h.join(", ")})`)}}return r.length>0?r.join(" "):i}},Jc=i=>i,Y6=i=>i*i,H6=i=>i*i*i,_6=i=>{if(i<=0)return 0;if(i>=1)return 1;const t=i*i,e=t*i;return 4*(i<.5?e:3*(i-t)+e-.75)},W6=i=>Math.pow(2,10*(i-1)),q6=i=>{for(let t=0,e=1;;t+=e,e/=2)if(i>=(7-4*t)/11){const n=(11-6*t-11*i)/4;return-n*n+e*e}},X6={reverse(i){return t=>1-i(1-t)},reflect(i){return t=>.5*(t<.5?i(2*t):2-i(2-2*t))},clamp(i,t=0,e=1){return n=>{const s=i(n);return s<t?t:s>e?e:s}},back(i=1.70158){return t=>t*t*((i+1)*t-i)},elastic(i=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*i/3*t)}};function $6(i){return-1*Math.cos(i*(Math.PI/2))+1}function Z6(i){return Math.sin(i*(Math.PI/2))}function t2(i){return-.5*(Math.cos(Math.PI*i)-1)}function e2(i){return i*i}function n2(i){return i*(2-i)}function i2(i){return i<.5?2*i*i:-1+(4-2*i)*i}function s2(i){return i*i*i}function o2(i){const t=i-1;return t*t*t+1}function r2(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1}function a2(i){return i*i*i*i}function l2(i){const t=i-1;return 1-t*t*t*t}function c2(i){const t=i-1;return i<.5?8*i*i*i*i:1-8*t*t*t*t}function h2(i){return i*i*i*i*i}function u2(i){const t=i-1;return 1+t*t*t*t*t}function d2(i){const t=i-1;return i<.5?16*i*i*i*i*i:1+16*t*t*t*t*t}function g2(i){return i===0?0:Math.pow(2,10*(i-1))}function f2(i){return i===1?1:-Math.pow(2,-10*i)+1}function p2(i){if(i===0||i===1)return i;const t=i*2,e=t-1;return t<1?.5*Math.pow(2,10*e):.5*(-Math.pow(2,-10*e)+2)}function m2(i){const t=i/1;return-1*(Math.sqrt(1-t*i)-1)}function b2(i){const t=i-1;return Math.sqrt(1-t*t)}function y2(i){const t=i*2,e=t-2;return t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-e*e)+1)}function w2(i,t=1.70158){return i*i*((t+1)*i-t)}function C2(i,t=1.70158){const e=i/1-1;return e*e*((t+1)*e+t)+1}function A2(i,t=1.70158){const e=i*2,n=e-2,s=t*1.525;return e<1?.5*e*e*((s+1)*e-s):.5*(n*n*((s+1)*n+s)+2)}function x2(i,t=.7){if(i===0||i===1)return i;const n=i/1-1,s=1-t,o=s/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-o)*(2*Math.PI)/s))}function v2(i,t=.7){const e=1-t,n=i*2;if(i===0||i===1)return i;const s=e/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/e)+1}function E2(i,t=.65){const e=1-t;if(i===0||i===1)return i;const n=i*2,s=n-1,o=e/(2*Math.PI)*Math.asin(1);return n<1?-.5*(Math.pow(2,10*s)*Math.sin((s-o)*(2*Math.PI)/e)):Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/e)*.5+1}function Ho(i){const t=i/1;if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const e=t-.5454545454545454;return 7.5625*e*e+.75}if(t<2.5/2.75){const e=t-.8181818181818182;return 7.5625*e*e+.9375}{const e=t-.9545454545454546;return 7.5625*e*e+.984375}}function jc(i){return 1-Ho(1-i)}function S2(i){return i<.5?jc(i*2)*.5:Ho(i*2-1)*.5+.5}const M2=Object.freeze(Object.defineProperty({__proto__:null,bounce:q6,cubic:H6,decorators:X6,easeInBack:w2,easeInBounce:jc,easeInCirc:m2,easeInCubic:s2,easeInElastic:x2,easeInExpo:g2,easeInOutBack:A2,easeInOutBounce:S2,easeInOutCirc:y2,easeInOutCubic:r2,easeInOutElastic:E2,easeInOutExpo:p2,easeInOutQuad:i2,easeInOutQuart:c2,easeInOutQuint:d2,easeInOutSine:t2,easeInQuad:e2,easeInQuart:a2,easeInQuint:h2,easeInSine:$6,easeOutBack:C2,easeOutBounce:Ho,easeOutCirc:b2,easeOutCubic:o2,easeOutElastic:v2,easeOutExpo:f2,easeOutQuad:n2,easeOutQuart:l2,easeOutQuint:u2,easeOutSine:Z6,exponential:W6,inout:_6,linear:Jc,quad:Y6},Symbol.toStringTag,{value:"Module"}));function _o(i,t){const e=[];for(let n=0;n<i.length;n+=2){const s=i[n],o=i[n+1],r=Array.isArray(t)?t:[t],a=Jl(s,o,r);e.push(a)}return xo(e)}class B2{constructor(){this.listeners={}}on(t,e,n){return e==null?this:(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,n),this)}once(t,e,n){const s=(...o)=>(this.off(t,s),_o([e,n],o));return this.on(t,s,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const s=this.listeners;return(t?[t]:Object.keys(s)).forEach(r=>{const a=s[r];if(a){if(!(e||n)){delete s[r];return}for(let l=a.length-2;l>=0;l-=2)e&&a[l]!==e||n&&a[l+1]!==n||a.splice(l,2)}}),this}trigger(t,...e){let n=!0;if(t!=="*"){const o=this.listeners[t];o!=null&&(n=_o([...o],e))}const s=this.listeners["*"];return s!=null?xo([n,_o([...s],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}class vn{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}function $(){return(i,t,e)=>{const n=e.value,s=i.__proto__;e.value=function(...o){this.disposed||(n.call(this,...o),s.dispose.call(this))}}}class Ft extends B2{dispose(){this.off()}}X([$()],Ft.prototype,"dispose",null),Wy(Ft,vn);class Wo{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach(e=>{const n=this.map.get(e);t(n,e)})}dispose(){this.clear()}}function qo(i){const t=[],e=[];return Array.isArray(i)?t.push(...i):i.split("|").forEach(n=>{n.indexOf("&")===-1?t.push(n):e.push(...n.split("&"))}),{or:t,and:e}}function k2(i,t){if(i!=null&&t!=null){const e=qo(i),n=qo(t),s=e.or.sort(),o=n.or.sort(),r=e.and.sort(),a=n.and.sort(),l=(c,h)=>c.length===h.length&&(c.length===0||c.every((u,g)=>u===h[g]));return l(s,o)&&l(r,a)}return i==null&&t==null}function Ne(i,t,e){if(t==null||Array.isArray(t)&&t.length===0)return e?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:n,and:s}=qo(t),o=r=>{const a=`${r.toLowerCase()}Key`;return i[a]===!0};return n.some(r=>o(r))&&s.every(r=>o(r))}class yt{static create(t){return new yt(t)}constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if(typeof t=="object"){Object.entries(t).forEach(([r,a])=>{this.register(r,a,e)});return}this.exist(t)&&!n&&!Ul()&&this.onDuplicated(t);const s=this.options.process,o=s?F(s,this,t,e):e;return this.data[t]=o,o}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return t?this.data[t]!=null:!1}onDuplicated(t){try{throw this.options.onConflict&&F(this.options.onConflict,this,t),new Error(`${Hi(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),s=e?`${e} ${Nb(this.options.type)}`:this.options.type;return`${Hi(s)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return jy(t,Object.keys(this.data),e=>e)}}const T2={},Gc={position:gs("x","width","origin")},Yc={position:gs("y","height","origin")},I2={position:gs("x","width","corner")},P2={position:gs("y","height","corner")},Hc={set:Re("width","width")},_c={set:Re("height","height")},O2={set:Re("rx","width")},N2={set:Re("ry","height")},Wc={set:(i=>{const t=Re(i,"width"),e=Re(i,"height");return function(n,s){const o=s.refBBox,r=o.height>o.width?t:e;return F(r,this,n,s)}})("r")},R2={set(i,{refBBox:t}){let e=parseFloat(i);const n=xe(i);n&&(e/=100);const s=Math.sqrt(t.height*t.height+t.width*t.width);let o;return Number.isFinite(e)&&(n||e>=0&&e<=1?o=e*s:o=Math.max(e+s,0)),{r:o}}},D2={set:Re("cx","width")},L2={set:Re("cy","height")},qc={set:Zc({resetOffset:!0})},Q2={set:Zc({resetOffset:!1})},Xc={set:th({resetOffset:!0})},V2={set:th({resetOffset:!1})},z2=Wc,F2=qc,U2=Xc,K2=Gc,J2=Yc,j2=Hc,G2=_c;function gs(i,t,e){return(n,{refBBox:s})=>{if(n==null)return null;let o=parseFloat(n);const r=xe(n);r&&(o/=100);let a;if(Number.isFinite(o)){const c=s[e];r||o>0&&o<1?a=c[i]+s[t]*o:a=c[i]+o}const l=new A;return l[i]=a||0,l}}function Re(i,t){return(e,{refBBox:n})=>{let s=parseFloat(e);const o=xe(e);o&&(s/=100);const r={};if(Number.isFinite(s)){const a=o||s>=0&&s<=1?s*n[t]:Math.max(s+n[t],0);r[i]=a}return r}}function $c(i,t){const e="x6-shape",n=t&&t.resetOffset;return(s,{elem:o,refBBox:r})=>{let a=_e(o,e);if(!a||a.value!==s){const m=i(s);a={value:s,shape:m,shapeBBox:m.bbox()},_e(o,e,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),h=c.getOrigin(),u=r.getOrigin();c.x=u.x,c.y=u.y;const g=r.getMaxScaleToFit(c,u),f=c.width===0||r.width===0?1:g.sx,p=c.height===0||r.height===0?1:g.sy;return l.scale(f,p,h),n&&l.translate(-h.x,-h.y),l}}function Zc(i){function t(n){return J.parse(n)}const e=$c(t,i);return(n,s)=>({d:e(n,s).serialize()})}function th(i){const t=$c(e=>new Mt(e),i);return(e,n)=>({points:t(e,n).serialize()})}const Y2={qualify:ie,set(i,{view:t}){return`url(#${t.graph.defineGradient(i)})`}},H2={qualify:ie,set(i,{view:t}){const e=t.cell,n=Object.assign({},i);if(e.isEdge()&&n.type==="linearGradient"){const s=t,o=s.sourcePoint,r=s.targetPoint;n.id=`gradient-${n.type}-${e.id}`,n.attrs=Object.assign(Object.assign({},n.attrs),{x1:o.x,y1:o.y,x2:r.x,y2:r.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(n.id)}return`url(#${t.graph.defineGradient(n)})`}},eh={qualify(i,{attrs:t}){return t.textWrap==null||!ie(t.textWrap)},set(i,{view:t,elem:e,attrs:n}){const s="x6-text",o=_e(e,s),r=h=>{try{return JSON.parse(h)}catch{return h}},a={x:n.x,eol:n.eol,annotations:r(n.annotations),textPath:r(n["text-path"]||n.textPath),textVerticalAnchor:n["text-vertical-anchor"]||n.textVerticalAnchor,displayEmpty:(n["display-empty"]||n.displayEmpty)==="true",lineHeight:n["line-height"]||n.lineHeight},l=n["font-size"]||n.fontSize,c=JSON.stringify([i,a]);if(l&&e.setAttribute("font-size",l),o==null||o!==c){const h=a.textPath;if(h!=null&&typeof h=="object"){const u=h.selector;if(typeof u=="string"){const g=t.find(u)[0];g instanceof SVGPathElement&&(Mo(g),a.textPath=Object.assign({"xlink:href":`#${g.id}`},h))}}bc(e,`${i}`,a),_e(e,s,c)}}},_2={qualify:ie,set(i,{view:t,elem:e,attrs:n,refBBox:s}){const o=i,r=o.width||0;xe(r)?s.width*=parseFloat(r)/100:r<=0?s.width+=r:s.width=r;const a=o.height||0;xe(a)?s.height*=parseFloat(a)/100:a<=0?s.height+=a:s.height=a;let l,c=o.text;c==null&&(c=n.text||(e==null?void 0:e.textContent)),c!=null?l=wc(`${c}`,s,{"font-weight":n["font-weight"]||n.fontWeight,"font-size":n["font-size"]||n.fontSize,"font-family":n["font-family"]||n.fontFamily,lineHeight:n.lineHeight},{ellipsis:o.ellipsis}):l="",F(eh.set,this,l,{view:t,elem:e,attrs:n,refBBox:s,cell:t.cell})}},En=(i,{attrs:t})=>t.text!==void 0,W2={qualify:En},q2={qualify:En},X2={qualify:En},$2={qualify:En},Z2={qualify:En},t3={qualify:En},e3={qualify(i,{elem:t}){return t instanceof SVGElement},set(i,{elem:t}){const e="x6-title",n=`${i}`,s=_e(t,e);if(s==null||s!==n){_e(t,e,n);const o=t.firstChild;if(o&&o.tagName.toUpperCase()==="TITLE"){const r=o;r.textContent=n}else{const r=document.createElementNS(t.namespaceURI,"title");r.textContent=n,t.insertBefore(r,o)}}}},n3={offset:nh("x","width","right")},i3={offset:nh("y","height","bottom")},s3={offset(i,{refBBox:t}){return i?{x:-t.x,y:-t.y}:{x:0,y:0}}};function nh(i,t,e){return(n,{refBBox:s})=>{const o=new A;let r;return n==="middle"?r=s[t]/2:n===e?r=s[t]:typeof n=="number"&&Number.isFinite(n)?r=n>-1&&n<1?-s[t]*n:-n:xe(n)?r=s[t]*parseFloat(n)/100:r=0,o[i]=-(s[i]+r),o}}const o3={qualify:ie,set(i,{elem:t}){nt(t,i)}},r3={set(i,{elem:t}){t.innerHTML=`${i}`}},a3={qualify:ie,set(i,{view:t}){return`url(#${t.graph.defineFilter(i)})`}},l3={set(i){return i!=null&&typeof i=="object"&&i.id?i.id:i}},c3=i=>{var{size:t,width:e,height:n,offset:s,open:o}=i,r=Y(i,["size","width","height","offset","open"]);return ih({size:t,width:e,height:n,offset:s},o===!0,!0,void 0,r)},h3=i=>{var{size:t,width:e,height:n,offset:s,factor:o}=i,r=Y(i,["size","width","height","offset","factor"]);return ih({size:t,width:e,height:n,offset:s},!1,!1,o,r)};function ih(i,t,e,n=3/4,s={}){const o=i.size||10,r=i.width||o,a=i.height||o,l=new J,c={};if(t)l.moveTo(r,0).lineTo(0,a/2).lineTo(r,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(r,0),!e){const h=Ye(n,0,1);l.lineTo(r*h,a/2)}l.lineTo(r,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),s),{tagName:"path",d:fn(l.serialize(),{x:i.offset!=null?i.offset:-r/2})})}const u3=i=>{var{size:t,width:e,height:n,offset:s}=i,o=Y(i,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new J;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},o),{tagName:"path",d:fn(c.serialize(),s??-a/2)})},d3=i=>{var{d:t,offsetX:e,offsetY:n}=i,s=Y(i,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},s),{tagName:"path",d:fn(t,e,n)})},g3=i=>{var{size:t,width:e,height:n,offset:s}=i,o=Y(i,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new J;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:fn(c.serialize(),s||-a/2)})},f3=i=>{var{width:t,height:e,offset:n,open:s,flip:o}=i,r=Y(i,["width","height","offset","open","flip"]);let a=e||6;const l=t||10,c=s===!0,h=o===!0,u=Object.assign(Object.assign({},r),{tagName:"path"});h&&(a=-a);const g=new J;return g.moveTo(0,a).lineTo(l,0),c?u.fill="none":(g.lineTo(l,a),g.close()),u.d=fn(g.serialize(),{x:n||-l/2,y:a/2}),u},sh=i=>{var{r:t}=i,e=Y(i,["r"]);const n=t||5;return Object.assign(Object.assign({cx:n},e),{tagName:"circle",r:n})},p3=Object.freeze(Object.defineProperty({__proto__:null,async:f3,block:c3,circle:sh,circlePlus:i=>{var{r:t}=i,e=Y(i,["r"]);const n=t||5,s=new J;return s.moveTo(n,0).lineTo(n,n*2),s.moveTo(0,n).lineTo(n*2,n),{children:[Object.assign(Object.assign({},sh({r:n})),{fill:"none"}),Object.assign(Object.assign({},e),{tagName:"path",d:fn(s.serialize(),-n)})]}},classic:h3,cross:g3,diamond:u3,ellipse:i=>{var{rx:t,ry:e}=i,n=Y(i,["rx","ry"]);const s=t||5,o=e||5;return Object.assign(Object.assign({cx:s},n),{tagName:"ellipse",rx:s,ry:o})},path:d3},Symbol.toStringTag,{value:"Module"})),si=yt.create({type:"marker"});si.register(p3,!0);function Xo(i){return typeof i=="string"||ie(i)}const m3={qualify:Xo,set(i,{view:t,attrs:e}){return $o("marker-start",i,t,e)}},b3={qualify:Xo,set(i,{view:t,attrs:e}){return $o("marker-end",i,t,e,{transform:"rotate(180)"})}},y3={qualify:Xo,set(i,{view:t,attrs:e}){return $o("marker-mid",i,t,e)}};function $o(i,t,e,n,s={}){const o=typeof t=="string"?{name:t}:t,{name:r,args:a}=o,l=Y(o,["name","args"]);let c=l;if(r&&typeof r=="string"){const u=si.get(r);if(u)c=u(Object.assign(Object.assign({},l),a));else return si.onNotFound(r)}const h=Object.assign(Object.assign(Object.assign({},w3(n,i)),s),c);return{[i]:`url(#${e.graph.defineMarker(h)})`}}function w3(i,t){const e={},n=i.stroke;if(typeof n=="string"&&(e.stroke=n,e.fill=n),t!=="marker-mid"){const s=parseFloat(i.strokeWidth||i["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);e.refX=t==="marker-start"?o:-o}}return e}const oi=(i,{view:t})=>t.cell.isEdge(),C3={qualify:oi,set(i,t){var e,n,s,o;const r=t.view,a=i.reverse||!1,l=i.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let h,u;const g=r.getConnectionLength()||0;l<0?(h=(g+l)/2,u=-l):(h=l,u=g-l*2);const f=r.getConnection();c=(o=(s=(n=(e=f==null?void 0:f.divideAtLength(h))===null||e===void 0?void 0:e[1])===null||n===void 0?void 0:n.divideAtLength(u))===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.serialize()}else{let h;l<0?h=((r.getConnectionLength()||0)+l)/2:h=l;const u=r.getConnection();if(u){const g=u.divideAtLength(h),f=u.divideAtLength(-h);g&&f&&(c=`${g[0].serialize()} ${f[1].serialize()}`)}}return{d:c||r.getConnectionPathData()}}},oh={qualify:oi,set:fs("getTangentAtLength",{rotate:!0})},A3={qualify:oi,set:fs("getTangentAtLength",{rotate:!1})},rh={qualify:oi,set:fs("getTangentAtRatio",{rotate:!0})},x3={qualify:oi,set:fs("getTangentAtRatio",{rotate:!1})},v3=oh,E3=rh;function fs(i,t){const e={x:1,y:0};return(n,s)=>{let o,r;const a=s.view,l=a[i](Number(n));return l?(r=t.rotate?l.vector().vectorAngle(e):0,o=l.start):(o=a.path.start,r=0),r===0||Number.isNaN(r)?{transform:`translate(${o.x},${o.y})`}:{transform:`translate(${o.x},${o.y}) rotate(${r})`}}}const S3=Object.freeze(Object.defineProperty({__proto__:null,annotations:$2,atConnectionLength:v3,atConnectionLengthIgnoreGradient:A3,atConnectionLengthKeepGradient:oh,atConnectionRatio:E3,atConnectionRatioIgnoreGradient:x3,atConnectionRatioKeepGradient:rh,connection:C3,displayEmpty:t3,eol:Z2,fill:Y2,filter:a3,html:r3,lineHeight:W2,port:l3,ref:T2,refCx:D2,refCy:L2,refD:F2,refDKeepOffset:Q2,refDResetOffset:qc,refDx:I2,refDy:P2,refHeight:_c,refHeight2:G2,refPoints:U2,refPointsKeepOffset:V2,refPointsResetOffset:Xc,refR:z2,refRCircumscribed:R2,refRInscribed:Wc,refRx:O2,refRy:N2,refWidth:Hc,refWidth2:j2,refX:Gc,refX2:K2,refY:Yc,refY2:J2,resetOffset:s3,sourceMarker:m3,stroke:H2,style:o3,targetMarker:b3,text:eh,textPath:X2,textVerticalAnchor:q2,textWrap:_2,title:e3,vertexMarker:y3,xAlign:n3,yAlign:i3},Symbol.toStringTag,{value:"Module"})),M3={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"};function B3(i,t,e){return!!(i!=null&&(typeof i=="string"||typeof i.qualify!="function"||F(i.qualify,this,t,e)))}const ah=Object.assign(Object.assign({},M3),S3),ri=yt.create({type:"attribute definition"});ri.register(ah,!0);const lh=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=e*2,t.height=n;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.translate(2*e,0),s.scale(-1,1),s.drawImage(i,0,0,e,n),t},ch=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=e,t.height=n*2;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.translate(0,2*n),s.scale(1,-1),s.drawImage(i,0,0,e,n),t},hh=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=2*e,t.height=2*n;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.setTransform(-1,0,0,-1,t.width,t.height),s.drawImage(i,0,0,e,n),s.setTransform(-1,0,0,1,t.width,0),s.drawImage(i,0,0,e,n),s.setTransform(1,0,0,-1,0,t.height),s.drawImage(i,0,0,e,n),t},ps=Object.assign({},Object.freeze(Object.defineProperty({__proto__:null,flipX:lh,flipXY:hh,flipY:ch,watermark:(i,t)=>{const e=i.width,n=i.height,s=document.createElement("canvas");s.width=e*3,s.height=n*3;const o=s.getContext("2d"),r=t.angle!=null?-t.angle:-20,a=Dt(r),l=s.width/4,c=s.height/4;for(let h=0;h<4;h+=1)for(let u=0;u<4;u+=1)(h+u)%2>0&&(o.setTransform(1,0,0,1,(2*h-1)*l,(2*u-1)*c),o.rotate(a),o.drawImage(i,-e/2,-n/2,e,n));return s}},Symbol.toStringTag,{value:"Module"})));ps["flip-x"]=lh,ps["flip-y"]=ch,ps["flip-xy"]=hh;const ms=yt.create({type:"background pattern"});ms.register(ps,!0);function bs(i,t,e){let n;if(typeof e=="object"){if(Number.isFinite(e.y)){const o=new z(t,i),{start:r,end:a}=o.parallel(e.y);t=r,i=a}n=e.x}else n=e;if(n==null||!Number.isFinite(n))return i;const s=i.distance(t);return n===0&&s>0?i:i.move(t,-Math.min(n,s-1))}function ys(i){const t=i.getAttribute("stroke-width");return t===null?0:parseFloat(t)||0}function k3(i){if(i==null)return null;let t=i;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}const uh=(i,t,e,n)=>{const s=t.getBBoxOfElement(e);n.stroked&&s.inflate(ys(e)/2);const o=i.intersect(s),r=o&&o.length?i.start.closest(o):i.end;return bs(r,i.start,n.offset)},T3=function(i,t,e,n,s){const o=t.cell,r=o.isNode()?o.getAngle():0;if(r===0)return F(uh,this,i,t,e,n,s);const a=t.getUnrotatedBBoxOfElement(e);n.stroked&&a.inflate(ys(e)/2);const l=a.getCenter(),c=i.clone().rotate(r,l),h=c.setLength(1e6).intersect(a),u=h&&h.length?c.start.closest(h).rotate(-r,l):i.end;return bs(u,i.start,n.offset)},I3=(i,t,e,n)=>{let s,o;const r=i.end,a=n.selector;if(typeof a=="string"?s=t.findOne(a):Array.isArray(a)?s=zo(e,a):s=k3(e),!Oe(s)){if(s===e||!Oe(e))return r;s=e}const l=t.getShapeOfElement(s),c=t.getMatrixOfElement(s),h=t.getRootTranslatedMatrix(),u=t.getRootRotatedMatrix(),g=h.multiply(u).multiply(c),f=g.inverse(),p=V6(i,f),m=p.start.clone(),b=t.getDataOfElement(s);if(n.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const x=b.shapeBBox;if(x!=null&&x.containsPoint(m))return r}n.extrapolate===!0&&p.setLength(1e6);let y;if(J.isPath(l)){const x=n.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:x})),y={precision:x,segmentSubdivisions:b.segmentSubdivisions},o=p.intersect(l,y)}else o=p.intersect(l);o?Array.isArray(o)&&(o=m.closest(o)):n.sticky===!0&&(P.isRectangle(l)?o=l.getNearestPointToPoint(m):Jt.isEllipse(l)?o=l.intersectsWithLineFromCenterToPoint(m):o=l.closestPoint(m,y));const w=o?Ee(o,g):r;let C=n.offset||0;return n.stroked!==!1&&(typeof C=="object"?(C=Object.assign({},C),C.x==null&&(C.x=0),C.x+=ys(s)/2):C+=ys(s)/2),bs(w,i.start,C)};function P3(i,t,e=0){const{start:n,end:s}=i;let o,r,a,l;switch(t){case"left":l="x",o=s,r=n,a=-1;break;case"right":l="x",o=n,r=s,a=1;break;case"top":l="y",o=s,r=n,a=-1;break;case"bottom":l="y",o=n,r=s,a=1;break;default:return}n[l]<s[l]?o[l]=r[l]:r[l]=o[l],Number.isFinite(e)&&(o[l]+=a*e,r[l]+=a*e)}const O3=Object.freeze(Object.defineProperty({__proto__:null,anchor:(i,t,e,n)=>{const{alignOffset:s,align:o}=n;return o&&P3(i,o,s),bs(i.end,i.start,n.offset)},bbox:uh,boundary:I3,rect:T3},Symbol.toStringTag,{value:"Module"})),ai=yt.create({type:"connection point"});ai.register(O3,!0);const dh=1,ws=1/3,Cs=2/3;let li=[],As=[];function N3(i){let t=i.graph._jumpOverUpdateList;if(t==null&&(t=i.graph._jumpOverUpdateList=[],i.graph.on("cell:mouseup",()=>{const e=i.graph._jumpOverUpdateList;setTimeout(()=>{for(let n=0;n<e.length;n+=1)e[n].update()})}),i.graph.on("model:reseted",()=>{t=i.graph._jumpOverUpdateList=[]})),t.indexOf(i)<0){t.push(i);const e=()=>t.splice(t.indexOf(i),1);i.cell.once("change:connector",e),i.cell.once("removed",e)}}function Zo(i,t,e=[]){const n=[i,...e,t],s=[];return n.forEach((o,r)=>{const a=n[r+1];a!=null&&s.push(new z(o,a))}),s}function R3(i,t){const e=[];return t.forEach(n=>{const s=i.intersectsWithLine(n);if(s){const{x:o,y:r}=s,{start:a,end:l}=n,c=Math.round(a.x)===Math.round(o)&&Math.round(a.y)===Math.round(r),h=Math.round(l.x)===Math.round(o)&&Math.round(l.y)===Math.round(r);if(c||h)return;e.push(s)}}),e}function gh(i,t){return new z(i,t).squaredLength()}function D3(i,t,e){return t.reduce((n,s,o)=>{if(As.includes(s))return n;const r=n.pop()||i,a=A.create(s).move(r.start,-e);let l=A.create(s).move(r.start,+e);const c=t[o+1];if(c!=null){const g=l.distance(c);g<=e&&(l=c.move(r.start,g),As.push(c))}else if(a.distance(r.end)<e*2+dh)return n.push(r),n;if(l.distance(r.start)<e*2+dh)return n.push(r),n;const u=new z(a,l);return li.push(u),n.push(new z(r.start,a),u,new z(l,r.end)),n},[])}function fh(i,t,e,n){const s=new J;let o;return o=J.createSegment("M",i[0].start),s.appendSegment(o),i.forEach((r,a)=>{if(li.includes(r)){let l,c,h,u;if(e==="arc"){l=-90,c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const f=r.getCenter(),p=new z(f,r.end).rotate(l,f);let m;m=new z(r.start,f),h=m.pointAt(2/3).rotate(l,r.start),u=p.pointAt(1/3).rotate(-l,p.end),o=J.createSegment("C",h,u,p.end),s.appendSegment(o),m=new z(f,r.end),h=p.pointAt(1/3).rotate(l,p.end),u=m.pointAt(1/3).rotate(-l,r.end),o=J.createSegment("C",h,u,r.end),s.appendSegment(o)}else if(e==="gap")o=J.createSegment("M",r.end),s.appendSegment(o);else if(e==="cubic"){l=r.start.theta(r.end);const g=t*.6;let f=t*1.35;c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(f*=-1),h=new A(r.start.x+g,r.start.y+f).rotate(l,r.start),u=new A(r.end.x-g,r.end.y+f).rotate(l,r.end),o=J.createSegment("C",h,u,r.end),s.appendSegment(o)}}else{const l=i[a+1];n===0||!l||li.includes(l)?(o=J.createSegment("L",r.end),s.appendSegment(o)):L3(n,s,r.end,r.start,l.end)}}),s}function L3(i,t,e,n,s){const o=e.distance(n)/2,r=e.distance(s)/2,a=-Math.min(i,o),l=-Math.min(i,r),c=e.clone().move(n,a).round(),h=e.clone().move(s,l).round(),u=new A(ws*c.x+Cs*e.x,Cs*e.y+ws*c.y),g=new A(ws*h.x+Cs*e.x,Cs*e.y+ws*h.y);let f;f=J.createSegment("L",c),t.appendSegment(f),f=J.createSegment("C",u,g,h),t.appendSegment(f)}const ph=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(i,t,e,n={}){li=[],As=[],N3(this);const s=n.size||5,o=n.type||"arc",r=n.radius||0,a=n.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return fh(Zo(i,t,e),s,o,r);const u=this.cell,g=h.indexOf(u),f=l.options.connecting.connector||{},p=h.filter((x,E)=>{const S=x.getConnector()||f;return a.includes(S.name)?!1:E>g?S.name!=="jumpover":!0}),m=p.map(x=>l.findViewByCell(x)),b=Zo(i,t,e),y=m.map(x=>x==null?[]:x===this?b:Zo(x.sourcePoint,x.targetPoint,x.routePoints)),w=[];b.forEach(x=>{const E=p.reduce((S,v,M)=>{if(v!==u){const k=R3(x,y[M]);S.push(...k)}return S},[]).sort((S,v)=>gh(x.start,S)-gh(x.start,v));E.length>0?w.push(...D3(x,E,s)):w.push(x)});const C=fh(w,s,o,r);return li=[],As=[],n.raw?C:C.serialize()},loop:(i,t,e,n={})=>{const s=e.length===3?0:1,o=A.create(e[0+s]),r=A.create(e[2+s]),a=A.create(e[1+s]);if(!A.equals(i,t)){const c=new A((i.x+t.x)/2,(i.y+t.y)/2),h=c.angleBetween(A.create(i).rotate(90,c),a);h>1&&(o.rotate(180-h,c),r.rotate(180-h,c),a.rotate(180-h,c))}const l=`
|
|
5
5
|
M ${i.x} ${i.y}
|
|
6
6
|
Q ${o.x} ${o.y} ${a.x} ${a.y}
|
|
7
7
|
Q ${r.x} ${r.y} ${t.x} ${t.y}
|
|
8
|
-
`;return n.raw?J.parse(l):l},normal:(i,t,e,n={})=>{const s=[i,...e,t],o=new
|
|
8
|
+
`;return n.raw?J.parse(l):l},normal:(i,t,e,n={})=>{const s=[i,...e,t],o=new Mt(s),r=new J(o);return n.raw?r:r.serialize()},rounded:(i,t,e,n={})=>{const s=new J;s.appendSegment(J.createSegment("M",i));const o=1/3,r=2/3,a=n.radius||10;let l,c;for(let h=0,u=e.length;h<u;h+=1){const g=A.create(e[h]),f=e[h-1]||i,p=e[h+1]||t;l=c||g.distance(f)/2,c=g.distance(p)/2;const m=-Math.min(a,l),b=-Math.min(a,c),y=g.clone().move(f,m).round(),w=g.clone().move(p,b).round(),C=new A(o*y.x+r*g.x,r*g.y+o*y.y),x=new A(o*w.x+r*g.x,r*g.y+o*w.y);s.appendSegment(J.createSegment("L",y)),s.appendSegment(J.createSegment("C",C,x,w))}return s.appendSegment(J.createSegment("L",t)),n.raw?s:s.serialize()},smooth:(i,t,e,n={})=>{let s,o=n.direction;if(e&&e.length!==0){const r=[i,...e,t],a=wt.throughPoints(r);s=new J(a)}else if(s=new J,s.appendSegment(J.createSegment("M",i)),o||(o=Math.abs(i.x-t.x)>=Math.abs(i.y-t.y)?"H":"V"),o==="H"){const r=(i.x+t.x)/2;s.appendSegment(J.createSegment("C",r,i.y,r,t.y,t.x,t.y))}else{const r=(i.y+t.y)/2;s.appendSegment(J.createSegment("C",i.x,r,t.x,r,t.x,t.y))}return n.raw?s:s.serialize()}},Symbol.toStringTag,{value:"Module"})),ci=yt.create({type:"connector"});ci.register(ph,!0);function xs(i){return function(t,e,n,s){if(n instanceof Element){const o=this.graph.findViewByElem(n);let r;if(o)if(o.isEdgeElement(n)){const a=s.fixedAt!=null?s.fixedAt:"50%";r=mh(o,a)}else r=o.getBBoxOfElement(n).getCenter();else r=new A;return i.call(this,t,e,r,s)}return i.apply(this,arguments)}}function mh(i,t){const e=xe(t),n=typeof t=="string"?parseFloat(t):t;return e?i.getPointAtRatio(n/100):i.getPointAtLength(n)}const bh=(i,t,e,n)=>{const s=i.getClosestPoint(e);return s??new A},Q3=xs(bh),V3=(i,t,e,n)=>{const s=n.length!=null?n.length:20;return i.getPointAtLength(s)},z3=xs(function(i,t,e,n){const o=i.getConnection(),r=i.getConnectionSubdivisions(),a=new z(e.clone().translate(0,1e6),e.clone().translate(0,-1e6)),l=new z(e.clone().translate(1e6,0),e.clone().translate(-1e6,0)),c=a.intersect(o,{segmentSubdivisions:r}),h=l.intersect(o,{segmentSubdivisions:r}),u=[];return c&&u.push(...c),h&&u.push(...h),u.length>0?e.closest(u):n.fallbackAt!=null?mh(i,n.fallbackAt):F(bh,this,i,t,e,n)}),F3=Object.freeze(Object.defineProperty({__proto__:null,closest:Q3,length:V3,orth:z3,ratio:(i,t,e,n)=>{let s=n.ratio!=null?n.ratio:.5;return s>1&&(s/=100),i.getPointAtRatio(s)}},Symbol.toStringTag,{value:"Module"})),hi=yt.create({type:"edge endpoint"});hi.register(F3,!0);function tr(i,t){return i??t}function Tt(i,t){return i!=null&&Number.isFinite(i)?i:t}function U3(i={}){const t=tr(i.color,"blue"),e=Tt(i.width,1),n=Tt(i.margin,2),s=Tt(i.opacity,1),o=n,r=n+e;return`
|
|
9
9
|
<filter>
|
|
10
10
|
<feFlood flood-color="${t}" flood-opacity="${s}" result="colored"/>
|
|
11
11
|
<feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${r}" />
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<feMergeNode in="SourceGraphic"/>
|
|
18
18
|
</feMerge>
|
|
19
19
|
</filter>
|
|
20
|
-
`.trim()}function K3(i={}){const t=tr(i.color,"red"),e=
|
|
20
|
+
`.trim()}function K3(i={}){const t=tr(i.color,"red"),e=Tt(i.blur,0),n=Tt(i.width,1),s=Tt(i.opacity,1);return`
|
|
21
21
|
<filter>
|
|
22
22
|
<feFlood flood-color="${t}" flood-opacity="${s}" result="colored"/>
|
|
23
23
|
<feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${n}"/>
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
<feGaussianBlur result="blured" in="composed" stdDeviation="${e}"/>
|
|
26
26
|
<feBlend in="SourceGraphic" in2="blured" mode="normal"/>
|
|
27
27
|
</filter>
|
|
28
|
-
`.trim()}function J3(i={}){const t=
|
|
28
|
+
`.trim()}function J3(i={}){const t=Tt(i.x,2);return`
|
|
29
29
|
<filter>
|
|
30
30
|
<feGaussianBlur stdDeviation="${i.y!=null&&Number.isFinite(i.y)?[t,i.y]:t}"/>
|
|
31
31
|
</filter>
|
|
32
|
-
`.trim()}function j3(i={}){const t=
|
|
32
|
+
`.trim()}function j3(i={}){const t=Tt(i.dx,0),e=Tt(i.dy,0),n=tr(i.color,"black"),s=Tt(i.blur,4),o=Tt(i.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
|
|
33
33
|
<feDropShadow stdDeviation="${s}" dx="${t}" dy="${e}" flood-color="${n}" flood-opacity="${o}" />
|
|
34
34
|
</filter>`.trim():`<filter>
|
|
35
35
|
<feGaussianBlur in="SourceAlpha" stdDeviation="${s}" />
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
<feMergeNode/>
|
|
44
44
|
<feMergeNode in="SourceGraphic"/>
|
|
45
45
|
</feMerge>
|
|
46
|
-
</filter>`.trim()}function G3(i={}){const t=
|
|
46
|
+
</filter>`.trim()}function G3(i={}){const t=Tt(i.amount,1),e=.2126+.7874*(1-t),n=.7152-.7152*(1-t),s=.0722-.0722*(1-t),o=.2126-.2126*(1-t),r=.7152+.2848*(1-t),a=.0722-.0722*(1-t),l=.2126-.2126*(1-t),c=.0722+.9278*(1-t);return`
|
|
47
47
|
<filter>
|
|
48
48
|
<feColorMatrix type="matrix" values="${e} ${n} ${s} 0 0 ${o} ${r} ${a} 0 0 ${l} ${n} ${c} 0 0 0 0 0 1 0"/>
|
|
49
49
|
</filter>
|
|
50
|
-
`.trim()}function Y3(i={}){const t=
|
|
50
|
+
`.trim()}function Y3(i={}){const t=Tt(i.amount,1),e=.393+.607*(1-t),n=.769-.769*(1-t),s=.189-.189*(1-t),o=.349-.349*(1-t),r=.686+.314*(1-t),a=.168-.168*(1-t),l=.272-.272*(1-t),c=.534-.534*(1-t),h=.131+.869*(1-t);return`
|
|
51
51
|
<filter>
|
|
52
52
|
<feColorMatrix type="matrix" values="${e} ${n} ${s} 0 0 ${o} ${r} ${a} 0 0 ${l} ${c} ${h} 0 0 0 0 0 1 0"/>
|
|
53
53
|
</filter>
|
|
54
54
|
`.trim()}function H3(i={}){return`
|
|
55
55
|
<filter>
|
|
56
|
-
<feColorMatrix type="saturate" values="${1-
|
|
56
|
+
<feColorMatrix type="saturate" values="${1-Tt(i.amount,1)}"/>
|
|
57
57
|
</filter>
|
|
58
58
|
`.trim()}function _3(i={}){return`
|
|
59
59
|
<filter>
|
|
60
|
-
<feColorMatrix type="hueRotate" values="${
|
|
60
|
+
<feColorMatrix type="hueRotate" values="${Tt(i.angle,0)}"/>
|
|
61
61
|
</filter>
|
|
62
|
-
`.trim()}function W3(i={}){const t=
|
|
62
|
+
`.trim()}function W3(i={}){const t=Tt(i.amount,1),e=1-t;return`
|
|
63
63
|
<filter>
|
|
64
64
|
<feComponentTransfer>
|
|
65
65
|
<feFuncR type="table" tableValues="${t} ${e}"/>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
<feFuncB type="table" tableValues="${t} ${e}"/>
|
|
68
68
|
</feComponentTransfer>
|
|
69
69
|
</filter>
|
|
70
|
-
`.trim()}function q3(i={}){const t=
|
|
70
|
+
`.trim()}function q3(i={}){const t=Tt(i.amount,1);return`
|
|
71
71
|
<filter>
|
|
72
72
|
<feComponentTransfer>
|
|
73
73
|
<feFuncR type="linear" slope="${t}"/>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<feFuncB type="linear" slope="${t}"/>
|
|
76
76
|
</feComponentTransfer>
|
|
77
77
|
</filter>
|
|
78
|
-
`.trim()}function X3(i={}){const t=
|
|
78
|
+
`.trim()}function X3(i={}){const t=Tt(i.amount,1),e=.5-t/2;return`
|
|
79
79
|
<filter>
|
|
80
80
|
<feComponentTransfer>
|
|
81
81
|
<feFuncR type="linear" slope="${t}" intercept="${e}"/>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<feFuncB type="linear" slope="${t}" intercept="${e}"/>
|
|
84
84
|
</feComponentTransfer>
|
|
85
85
|
</filter>
|
|
86
|
-
`.trim()}const $3=Object.freeze(Object.defineProperty({__proto__:null,blur:J3,brightness:q3,contrast:X3,dropShadow:j3,grayScale:G3,highlight:K3,hueRotate:_3,invert:W3,outline:U3,saturate:H3,sepia:Y3},Symbol.toStringTag,{value:"Module"})),ui=yt.create({type:"filter"});ui.register($3,!0);const Z3=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(i,t){const e=t.thickness*t.sx,n=t.thickness*t.sy;W(i,{width:e,height:n,rx:e,ry:n,fill:t.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(i,t){let e;const n=t.width,s=t.height,o=t.thickness;n-o>=0&&s-o>=0?e=["M",n,0,"H0 M0 0 V0",s].join(" "):e="M 0 0 0 0",W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(i,t){let e;const n=t.factor||1,s=t.width*n,o=t.height*n,r=t.thickness;s-r>=0&&o-r>=0?e=["M",s,0,"H0 M0 0 V0",o].join(" "):e="M 0 0 0 0",t.width=s,t.height=o,W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(i,t){const e=t.sx<=1?t.thickness*t.sx:t.thickness;W(i,{width:e,height:e,rx:e,ry:e,fill:t.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(i,t){let e;const n=t.width,s=t.height,o=t.thickness;n-o>=0&&s-o>=0?e=["M",n,0,"H0 M0 0 V0",s].join(" "):e="M 0 0 0 0",W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}}},Symbol.toStringTag,{value:"Module"}));class tw{constructor(){this.patterns={},this.root=U.create(is(),{width:"100%",height:"100%"},[ce("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,U.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return this.patterns[t]!=null}}const yh=Z3,di=yt.create({type:"grid"});di.register(yh,!0);const et={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(i){return`${et.prefixCls}-${i}`}},wh=et.prefix("highlighted"),ew={highlight(i,t,e){const n=e&&e.className||wh;Q(t,n)},unhighlight(i,t,e){const n=e&&e.className||wh;lt(t,n)}},Ch=et.prefix("highlight-opacity"),nw={highlight(i,t){Q(t,Ch)},unhighlight(i,t){lt(t,Ch)}},iw={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},sw={highlight(i,t,e){const n=Ah(t,e);if(rw(n))return;e=kl({},e,iw);const s=U.create(t);let o,r;try{o=s.toPathData()}catch{r=Vc(s.node),o=Ac(Object.assign(Object.assign({},e),r))}const a=ce("path");if(W(a,Object.assign({d:o,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},e.attrs?Xn(e.attrs):null)),i.isEdgeElement(t))W(a,"d",i.getConnectionPathData());else{let h=s.getTransformToElement(i.container);const u=e.padding;if(u){r==null&&(r=Vc(s.node));const g=r.x+r.width/2,f=r.y+r.height/2;r=$t(r,h);const p=Math.max(r.width,1),m=Math.max(r.height,1),b=(p+u)/p,y=(m+u)/m,C=Bt({a:b,b:0,c:0,d:y,e:g-b*g,f:f-y*f});h=h.multiply(C)}yn(a,h)}Q(a,et.prefix("highlight-stroke"));const l=i.cell,c=()=>xh(n);l.on("removed",c),l.model&&l.model.on("reseted",c),i.container.appendChild(a),ow(n,a)},unhighlight(i,t,e){xh(Ah(t,e))}};function Ah(i,t){return Mo(i),i.id+JSON.stringify(t)}const vs={};function ow(i,t){vs[i]=t}function rw(i){return vs[i]!=null}function xh(i){const t=vs[i];t&&(qt(t),delete vs[i])}const aw=Object.freeze(Object.defineProperty({__proto__:null,className:ew,opacity:nw,stroke:sw},Symbol.toStringTag,{value:"Module"}));function lw(i,t){if(typeof t.highlight!="function")throw new Error(`Highlighter '${i}' is missing required \`highlight()\` method`);if(typeof t.unhighlight!="function")throw new Error(`Highlighter '${i}' is missing required \`unhighlight()\` method`)}const cw=aw,gi=yt.create({type:"highlighter"});gi.register(cw,!0);const hw=Se("center"),uw=Se("topCenter"),dw=Se("bottomCenter"),gw=Se("leftMiddle"),fw=Se("rightMiddle"),pw=Se("topLeft"),mw=Se("topRight"),bw=Se("bottomLeft"),yw=Se("bottomRight");function Se(i){return(t,e,n,s={})=>{let o;t.cell.visible?o=s.rotate?t.getUnrotatedBBoxOfElement(e):t.getBBoxOfElement(e):o=t.cell.getBBox();const r=o[i];r.x+=Yt(s.dx,o.width),r.y+=Yt(s.dy,o.height);const a=t.cell;return s.rotate?r.rotate(-a.getAngle(),a.getBBox().getCenter()):r}}const ww=xs((i,t,e,n)=>{const s=Vt(i.cell.getAngle()),o=i.cell.visible?i.getBBoxOfElement(t):i.cell.getBBox(),r=o.getCenter(),a=o.getTopLeft(),l=o.getBottomRight();let c=n.padding;if(Number.isFinite(c)||(c=0),a.y+c<=e.y&&e.y<=l.y-c){const h=e.y-r.y;r.x+=s===0||s===180?0:h*1/Math.tan(Dt(s)),r.y+=h}else if(a.x+c<=e.x&&e.x<=l.x-c){const h=e.x-r.x;r.y+=s===90||s===270?0:h*Math.tan(Dt(s)),r.x+=h}return r}),Cw=function(i,t,e,n,s){const o=i.cell.getConnectionPoint(this.cell,s);return(n.dx||n.dy)&&o.translate(n.dx||0,n.dy||0),o},Aw=xs((i,t,e,n)=>{let s,o=0,r;const a=i.cell;n.rotate?(s=i.getUnrotatedBBoxOfElement(t),r=a.getBBox().getCenter(),o=a.getAngle()):a.visible?s=i.getBBoxOfElement(t):s=i.cell.getBBox();const l=n.padding;l!=null&&Number.isFinite(l)&&s.inflate(l),n.rotate&&e.rotate(o,r);const c=s.getNearestSideToPoint(e);let h;switch(c){case"left":h=s.getLeftMiddle();break;case"right":h=s.getRightMiddle();break;case"top":h=s.getTopCenter();break;case"bottom":h=s.getBottomCenter();break}const u=n.direction;return u==="H"?(c==="top"||c==="bottom")&&(e.x<=s.x+s.width?h=s.getLeftMiddle():h=s.getRightMiddle()):u==="V"&&(e.y<=s.y+s.height?h=s.getTopCenter():h=s.getBottomCenter()),n.rotate?h.rotate(-o,r):h}),xw=Object.freeze(Object.defineProperty({__proto__:null,bottom:dw,bottomLeft:bw,bottomRight:yw,center:hw,left:gw,midSide:Aw,nodeCenter:Cw,orth:ww,right:fw,top:uw,topLeft:pw,topRight:mw},Symbol.toStringTag,{value:"Module"})),fi=yt.create({type:"node endpoint"});fi.register(xw,!0);const vw={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function De(i,t){const{x:e,y:n,angle:s,attrs:o}=t||{};return kl({},{angle:s,attrs:o,position:{x:e,y:n}},i,vw)}const Ew=(i,t,e)=>De({position:t.getTopLeft()},e),Sw=(i,t,e)=>De({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},e),Mw=(i,t,e)=>De({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},e),Bw=(i,t,e)=>De({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},e),kw=(i,t,e)=>De({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},e),Tw=(i,t,e)=>vh(i,t,!1,e),Iw=(i,t,e)=>vh(i,t,!0,e),Pw=(i,t,e)=>Eh(i,t,!1,e),Ow=(i,t,e)=>Eh(i,t,!0,e);function vh(i,t,e,n){const s=n.offset!=null?n.offset:15,o=t.getCenter().theta(i),r=Sh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=s,c=0,h="start"):o<r[0]?(a="0",l=0,c=-s,e?(u=-90,h="start"):h="middle"):o<r[3]?(a=".3em",l=-s,c=0,h="end"):(a=".6em",l=0,c=s,e?(u=90,h="start"):h="middle"),De({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function Eh(i,t,e,n){const s=n.offset!=null?n.offset:15,o=t.getCenter().theta(i),r=Sh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=-s,c=0,h="end"):o<r[0]?(a=".6em",l=0,c=s,e?(u=90,h="start"):h="middle"):o<r[3]?(a=".3em",l=s,c=0,h="start"):(a="0em",l=0,c=-s,e?(u=-90,h="start"):h="middle"),De({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function Sh(i){const t=i.getCenter(),e=t.theta(i.getTopLeft()),n=t.theta(i.getBottomLeft()),s=t.theta(i.getBottomRight()),o=t.theta(i.getTopRight());return[e,o,s,n]}const Nw=(i,t,e)=>Mh(i.diff(t.getCenter()),!1,e),Rw=(i,t,e)=>Mh(i.diff(t.getCenter()),!0,e);function Mh(i,t,e){const n=e.offset!=null?e.offset:20,s=new A(0,0),o=-i.theta(s),r=i.clone().move(s,n).diff(i).round();let a=".3em",l,c=o;return(o+90)%180===0?(l=t?"end":"middle",!t&&o===-270&&(a="0em")):o>-270&&o<-90?(l="start",c=o-180):l="end",De({position:r.round().toJSON(),angle:t?c:0,attrs:{".":{y:a,"text-anchor":l}}},e)}const Bh=Object.freeze(Object.defineProperty({__proto__:null,bottom:kw,inside:Pw,insideOriented:Ow,left:Sw,manual:Ew,outside:Tw,outsideOriented:Iw,radial:Nw,radialOriented:Rw,right:Mw,top:Bw},Symbol.toStringTag,{value:"Module"})),Es=yt.create({type:"port label layout"});Es.register(Bh,!0);function er(i,t={}){return new A(Yt(t.x,i.width),Yt(t.y,i.height))}function nr(i,t,e){return Object.assign({angle:t,position:i.toJSON()},e)}const Dw=(i,t)=>i.map(({x:e,y:n,angle:s})=>nr(er(t,{x:e,y:n}),s||0)),Lw=(i,t,e)=>{const n=e.start||0,s=e.step||20;return kh(i,t,n,(o,r)=>(o+.5-r/2)*s)},Qw=(i,t,e)=>{const n=e.start||0,s=e.step||360/i.length;return kh(i,t,n,o=>o*s)};function kh(i,t,e,n){const s=t.getCenter(),o=t.getTopCenter(),r=t.width/t.height,a=jt.fromRect(t),l=i.length;return i.map((c,h)=>{const u=e+n(h,l),g=o.clone().rotate(-u,s).scale(r,1,s),f=c.compensateRotate?-a.tangentTheta(g):0;return(c.dx||c.dy)&&g.translate(c.dx||0,c.dy||0),c.dr&&g.move(s,c.dr),nr(g.round(),f,c)})}const Vw=(i,t,e)=>{const n=er(t,e.start||t.getOrigin()),s=er(t,e.end||t.getCorner());return pi(i,n,s,e)},zw=(i,t,e)=>pi(i,t.getTopLeft(),t.getBottomLeft(),e),Fw=(i,t,e)=>pi(i,t.getTopRight(),t.getBottomRight(),e),Uw=(i,t,e)=>pi(i,t.getTopLeft(),t.getTopRight(),e),Kw=(i,t,e)=>pi(i,t.getBottomLeft(),t.getBottomRight(),e);function pi(i,t,e,n){const s=new z(t,e),o=i.length;return i.map((r,a)=>{var{strict:l}=r,c=Y(r,["strict"]);const h=l||n.strict?(a+1)/(o+1):(a+.5)/o,u=s.pointAt(h);return(c.dx||c.dy)&&u.translate(c.dx||0,c.dy||0),nr(u.round(),0,c)})}const Th=Object.freeze(Object.defineProperty({__proto__:null,absolute:Dw,bottom:Kw,ellipse:Lw,ellipseSpread:Qw,left:zw,line:Vw,right:Fw,top:Uw},Symbol.toStringTag,{value:"Module"})),mi=yt.create({type:"port layout"});mi.register(Th,!0);const Jw=i=>[...i],jw=(i,t,e)=>{const n=t.side||"bottom",s=re(t.padding||40),o=e.sourceBBox,r=e.targetBBox,a=o.getCenter(),l=r.getCenter();let c,h,u;switch(n){case"top":u=-1,c="y",h="height";break;case"left":u=-1,c="x",h="width";break;case"right":u=1,c="x",h="width";break;case"bottom":default:u=1,c="y",h="height";break}return a[c]+=u*(o[h]/2+s[n]),l[c]+=u*(r[h]/2+s[n]),u*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...i,l.toJSON()]};function Ss(i){return new P(i.x,i.y,0,0)}function Ms(i={}){const t=re(i.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function Ih(i,t={}){return i.sourceBBox.clone().moveAndExpand(Ms(t))}function Ph(i,t={}){return i.targetBBox.clone().moveAndExpand(Ms(t))}function Gw(i,t={}){return i.sourceAnchor?i.sourceAnchor:Ih(i,t).getCenter()}function Yw(i,t={}){return i.targetAnchor?i.targetAnchor:Ph(i,t).getCenter()}const Oh=(i,t,e)=>{let n=Ih(e,t),s=Ph(e,t);const o=Gw(e,t),r=Yw(e,t);n=n.union(Ss(o)),s=s.union(Ss(r));const a=i.map(h=>A.create(h));a.unshift(o),a.push(r);let l=null;const c=[];for(let h=0,u=a.length-1;h<u;h+=1){let g=null;const f=a[h],p=a[h+1],m=Ut(f,p)!=null;if(h===0)h+1===u?n.intersectsWithRect(s.clone().inflate(1))?g=sr(f,p,n,s):m||(g=qw(f,p,n,s)):n.containsPoint(p)?g=sr(f,p,n,Ss(p).moveAndExpand(Ms(t))):m||(g=ks(f,p,n));else if(h+1===u){const b=m&&Ut(p,f)===l;s.containsPoint(f)||b?g=sr(f,p,Ss(f).moveAndExpand(Ms(t)),s,l):m||(g=Ww(f,p,s,l))}else m||(g=Nh(f,p,l));g?(c.push(...g.points),l=g.direction):l=Ut(f,p),h+1<u&&c.push(p)}return c},Hw={N:"S",S:"N",E:"W",W:"E"},_w={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function Bs(i,t,e){let n=new A(i.x,t.y);return e.containsPoint(n)&&(n=new A(t.x,i.y)),n}function ir(i,t){return i[t==="W"||t==="E"?"width":"height"]}function Ut(i,t){return i.x===t.x?i.y>t.y?"N":"S":i.y===t.y?i.x>t.x?"W":"E":null}function Nh(i,t,e){const n=new A(i.x,t.y),s=new A(t.x,i.y),o=Ut(i,n),r=Ut(i,s),a=e?Hw[e]:null,l=o===e||o!==a&&(r===a||r!==e)?n:s;return{points:[l],direction:Ut(l,t)}}function ks(i,t,e){const n=Bs(i,t,e);return{points:[n],direction:Ut(n,t)}}function Ww(i,t,e,n){const s=[new A(i.x,t.y),new A(t.x,i.y)],o=s.filter(l=>!e.containsPoint(l)),r=o.filter(l=>Ut(l,i)!==n);let a;if(r.length>0)return a=r.filter(l=>Ut(i,l)===n).pop(),a=a||r[0],{points:[a],direction:Ut(a,t)};{a=Cb(s,o)[0];const l=A.create(t).move(a,-ir(e,n)/2);return{points:[Bs(l,i,e),l],direction:Ut(l,t)}}}function qw(i,t,e,n){let s=ks(t,i,n);const o=s.points[0];if(e.containsPoint(o)){s=ks(i,t,e);const r=s.points[0];if(n.containsPoint(r)){const a=A.create(i).move(r,-ir(e,Ut(i,r))/2),l=A.create(t).move(o,-ir(n,Ut(t,o))/2),c=new z(a,l).getCenter(),h=ks(i,c,e),u=Nh(c,t,h.direction);s.points=[h.points[0],u.points[0]],s.direction=u.direction}}return s}function sr(i,t,e,n,s){const o=e.union(n).inflate(1),r=o.getCenter(),a=r.distance(t)>r.distance(i),l=a?t:i,c=a?i:t;let h,u,g;s?(h=A.fromPolar(o.width+o.height,_w[s],l),h=o.getNearestPointToPoint(h).move(h,-1)):h=o.getNearestPointToPoint(l).move(l,1),u=Bs(h,c,o);let f;h.round().equals(u.round())?(u=A.fromPolar(o.width+o.height,Dt(h.theta(l))+Math.PI/2,c),u=o.getNearestPointToPoint(u).move(c,1).round(),g=Bs(h,u,o),f=a?[u,g,h]:[h,g,u]):f=a?[u,h]:[h,u];const p=Ut(a?h:u,t);return{points:f,direction:p}}const Xw={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],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(){return Le(this.step,this)},directions(){const i=Le(this.step,this),t=Le(this.cost,this);return[{cost:t,offsetX:i,offsetY:0},{cost:t,offsetX:-i,offsetY:0},{cost:t,offsetX:0,offsetY:i},{cost:t,offsetX:0,offsetY:-i}]},penalties(){const i=Le(this.step,this);return{0:0,45:i/2,90:i/2}},paddingBox(){const i=Le(this.step,this);return{x:-i,y:-i,width:2*i,height:2*i}},fallbackRouter:Oh,draggingRouter:null,snapToGrid:!0};function Le(i,t){return typeof i=="function"?i.call(t):i}function $w(i){const t=Object.keys(i).reduce((e,n)=>{const s=e;return n==="fallbackRouter"||n==="draggingRouter"||n==="fallbackRoute"?s[n]=i[n]:s[n]=Le(i[n],i),e},{});if(t.padding){const e=re(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{const n=new A(0,0),s=new A(e.offsetX,e.offsetY);e.angle=Vt(n.theta(s))}),t}class Zw{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,s=n.excludeTerminals.reduce((c,h)=>{const u=e[h];if(u){const g=t.getCell(u.cell);g&&c.push(g)}return c},[]);let o=[];const r=t.getCell(e.getSourceCellId());r&&(o=Nl(o,r.getAncestors().map(c=>c.id)));const a=t.getCell(e.getTargetCellId());a&&(o=Nl(o,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return t.getNodes().reduce((c,h)=>{const u=s.some(b=>b.id===h.id),g=h.shape?n.excludeShapes.includes(h.shape):!1,f=n.excludeNodes.some(b=>typeof b=="string"?h.id===b:b===h),p=o.includes(h.id),m=g||u||f||p;if(h.isVisible()&&!m){const b=h.getBBox().moveAndExpand(n.paddingBox),y=b.getOrigin().snapToGrid(l),C=b.getCorner().snapToGrid(l);for(let w=y.x;w<=C.x;w+=l)for(let x=y.y;x<=C.y;x+=l){const E=new A(w,x).toString();c[E]==null&&(c[E]=[]),c[E].push(b)}}return c},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return n?n.every(s=>!s.containsPoint(t)):!0}}const Rh=1,Dh=2;class tC{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=Rh,this.values[t]=e;const n=Xb(this.items,t,s=>this.values[s]);this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=Dh),t}isOpen(t){return this.hash[t]===Rh}isClose(t){return this.hash[t]===Dh}isEmpty(){return this.items.length===0}}function Lh(i,t){const e=i.sourceBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Qh(i,t){const e=i.targetBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Vh(i,t){return i.sourceAnchor?i.sourceAnchor:Lh(i,t).getCenter()}function eC(i,t){return i.targetAnchor?i.targetAnchor:Qh(i,t).getCenter()}function or(i,t,e,n,s){const o=360/e,r=i.theta(nC(i,t,n,s)),a=Vt(r+o/2);return o*Math.floor(a/o)}function nC(i,t,e,n){const s=n.step,o=t.x-i.x,r=t.y-i.y,a=o/e.x,l=r/e.y,c=a*s,h=l*s;return new A(i.x+c,i.y+h)}function zh(i,t){const e=Math.abs(i-t);return e>180?360-e:e}function iC(i,t){const e=t.step;return t.directions.forEach(n=>{n.gridOffsetX=n.offsetX/e*i.x,n.gridOffsetY=n.offsetY/e*i.y}),t.directions}function sC(i,t,e){return{source:t.clone(),x:Fh(e.x-t.x,i),y:Fh(e.y-t.y,i)}}function Fh(i,t){if(!i)return t;const e=Math.abs(i),n=Math.round(e/t);if(!n)return e;const s=n*t,r=(e-s)/n;return t+r}function oC(i,t){const e=t.source,n=ae(i.x-e.x,t.x)+e.x,s=ae(i.y-e.y,t.y)+e.y;return new A(n,s)}function bi(i,t){return i.round(t)}function Ts(i,t,e){return bi(oC(i.clone(),t),e)}function yi(i){return i.toString()}function rr(i){return new A(i.x===0?0:Math.abs(i.x)/i.x,i.y===0?0:Math.abs(i.y)/i.y)}function Uh(i,t){let e=1/0;for(let n=0,s=t.length;n<s;n+=1){const o=i.manhattanDistance(t[n]);o<e&&(e=o)}return e}function Kh(i,t,e,n,s){const o=s.precision,r=s.directionMap,a=i.diff(t.getCenter()),l=Object.keys(r).reduce((c,h)=>{if(e.includes(h)){const u=r[h],g=new A(i.x+u.x*(Math.abs(a.x)+t.width),i.y+u.y*(Math.abs(a.y)+t.height)),p=new z(i,g).intersect(t)||[];let m,b=null;for(let y=0;y<p.length;y+=1){const C=p[y],w=i.squaredDistance(C);(m==null||w>m)&&(m=w,b=C)}if(b){let y=Ts(b,n,o);t.containsPoint(y)&&(y=Ts(y.translate(u.x*n.x,u.y*n.y),n,o)),c.push(y)}}return c},[]);return t.containsPoint(i)||l.push(Ts(i,n,o)),l}function rC(i,t,e,n,s){const o=[];let r=rr(s.diff(e)),a=yi(e),l=i[a],c;for(;l;){c=t[a];const g=rr(c.diff(l));g.equals(r)||(o.unshift(c),r=g),a=yi(l),l=i[a]}const h=t[a];return rr(h.diff(n)).equals(r)||o.unshift(h),o}function aC(i,t,e,n,s){const o=s.precision;let r,a;P.isRectangle(t)?r=bi(Vh(i,s).clone(),o):r=bi(t.clone(),o),P.isRectangle(e)?a=bi(eC(i,s).clone(),o):a=bi(e.clone(),o);const l=sC(s.step,r,a),c=r,h=a;let u,g;if(P.isRectangle(t)?u=Kh(c,t,s.startDirections,l,s):u=[c],P.isRectangle(e)?g=Kh(a,e,s.endDirections,l,s):g=[h],u=u.filter(f=>n.isAccessible(f)),g=g.filter(f=>n.isAccessible(f)),u.length>0&&g.length>0){const f=new tC,p={},m={},b={};for(let I=0,O=u.length;I<O;I+=1){const D=u[I],K=yi(D);f.add(K,Uh(D,g)),p[K]=D,b[K]=0}const y=s.previousDirectionAngle,C=y===void 0;let w,x;const E=iC(l,s),S=E.length,v=g.reduce((I,O)=>{const D=yi(O);return I.push(D),I},[]),M=A.equalPoints(u,g);let k=s.maxLoopCount;for(;!f.isEmpty()&&k>0;){const I=f.pop(),O=p[I],D=m[I],K=b[I],L=O.equals(c),N=D==null;let j;if(N?C?L?j=null:j=or(c,O,S,l,s):j=y:j=or(D,O,S,l,s),!(N&&M)&&v.indexOf(I)>=0)return s.previousDirectionAngle=j,rC(m,p,O,c,h);for(let Ct=0;Ct<S;Ct+=1){w=E[Ct];const pt=w.angle;if(x=zh(j,pt),!(C&&L)&&x>s.maxDirectionChange)continue;const ct=Ts(O.clone().translate(w.gridOffsetX||0,w.gridOffsetY||0),l,o),V=yi(ct);if(f.isClose(V)||!n.isAccessible(ct))continue;if(v.indexOf(V)>=0&&!ct.equals(h)){const mt=or(ct,h,S,l,s);if(zh(pt,mt)>s.maxDirectionChange)continue}const tt=w.cost,it=L?0:s.penalties[x],H=K+tt+it;(!f.isOpen(V)||H<b[V])&&(p[V]=ct,m[V]=O,b[V]=H,f.add(V,H+Uh(ct,g)))}k-=1}}return s.fallbackRoute?F(s.fallbackRoute,this,c,h,s):null}function lC(i,t=10){if(i.length<=1)return i;for(let e=0,n=i.length;e<n-1;e+=1){const s=i[e],o=i[e+1];if(s.x===o.x){const r=t*Math.round(s.x/t);s.x!==r&&(s.x=r,o.x=r)}else if(s.y===o.y){const r=t*Math.round(s.y/t);s.y!==r&&(s.y=r,o.y=r)}}return i}const cC=function(i,t,e){const n=$w(t),s=Lh(e,n),o=Qh(e,n),r=Vh(e,n),a=new Zw(n).build(e.graph.model,e.cell),l=i.map(f=>A.create(f)),c=[];let h=r,u,g;for(let f=0,p=l.length;f<=p;f+=1){let m=null;if(u=g||s,g=l[f],g==null){g=o;const y=e.cell;if((y.getSourceCellId()==null||y.getTargetCellId()==null)&&typeof n.draggingRouter=="function"){const w=u===s?r:u,x=g.getOrigin();m=F(n.draggingRouter,e,w,x,n)}}if(m==null&&(m=aC(e,u,g,a,n)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),F(n.fallbackRouter,this,i,n,e);const b=m[0];b&&b.equals(h)&&m.shift(),h=m[m.length-1]||h,c.push(...m)}return n.snapToGrid?lC(c,e.graph.grid.getGridSize()):c},Jh=function(i,t,e){return F(cC,this,i,Object.assign(Object.assign({},Xw),t),e)},hC={maxDirectionChange:45,directions(){const i=Le(this.step,this),t=Le(this.cost,this),e=Math.ceil(Math.sqrt(i*i<<1));return[{cost:t,offsetX:i,offsetY:0},{cost:e,offsetX:i,offsetY:i},{cost:t,offsetX:0,offsetY:i},{cost:e,offsetX:-i,offsetY:i},{cost:t,offsetX:-i,offsetY:0},{cost:e,offsetX:-i,offsetY:-i},{cost:t,offsetX:0,offsetY:-i},{cost:e,offsetX:i,offsetY:-i}]},fallbackRoute(i,t,e){const n=i.theta(t),s=[];let o={x:t.x,y:i.y},r={x:i.x,y:t.y};if(n%180>90){const w=o;o=r,r=w}const a=n%90<45?o:r,l=new z(i,a),c=90*Math.ceil(n/90),h=A.fromPolar(l.squaredLength(),Dt(c+135),a),u=new z(t,h),g=l.intersectsWithLine(u),f=g||t,p=g?f:i,m=360/e.directions.length,b=p.theta(t),y=Vt(b+m/2),C=m*Math.floor(y/m);return e.previousDirectionAngle=C,f&&s.push(f.round()),s.push(t),s}},uC=function(i,t,e){return F(Jh,this,i,Object.assign(Object.assign({},hC),t),e)},dC=(i,t,e)=>{const n=t.offset||32,s=t.min==null?16:t.min;let o=0,r=t.direction;const a=e.sourceBBox,l=e.targetBBox,c=a.getCenter(),h=l.getCenter();if(typeof n=="number"&&(o=n),r==null){let y=l.left-a.right,C=l.top-a.bottom;y>=0&&C>=0?r=y>=C?"L":"T":y<=0&&C>=0?(y=a.left-l.right,y>=0?r=y>=C?"R":"T":r="T"):y>=0&&C<=0?(C=a.top-l.bottom,C>=0?r=y>=C?"L":"B":r="L"):(y=a.left-l.right,C=a.top-l.bottom,y>=0&&C>=0?r=y>=C?"R":"B":y<=0&&C>=0?r="B":y>=0&&C<=0?r="R":r=Math.abs(y)>Math.abs(C)?"R":"B")}r==="H"?r=h.x-c.x>=0?"L":"R":r==="V"&&(r=h.y-c.y>=0?"T":"B"),n==="center"&&(r==="L"?o=(l.left-a.right)/2:r==="R"?o=(a.left-l.right)/2:r==="T"?o=(l.top-a.bottom)/2:r==="B"&&(o=(a.top-l.bottom)/2));let u,g,f;const p=r==="L"||r==="R";if(p){if(h.y===c.y)return[...i];f=r==="L"?1:-1,u="x",g="width"}else{if(h.x===c.x)return[...i];f=r==="T"?1:-1,u="y",g="height"}const m=c.clone(),b=h.clone();if(m[u]+=f*(a[g]/2+o),b[u]-=f*(l[g]/2+o),p){const y=m.x,C=b.x,w=a.width/2+s,x=l.width/2+s;h.x>c.x?C<=y&&(m.x=Math.max(C,c.x+w),b.x=Math.min(y,h.x-x)):C>=y&&(m.x=Math.min(C,c.x-w),b.x=Math.max(y,h.x+x))}else{const y=m.y,C=b.y,w=a.height/2+s,x=l.height/2+s;h.y>c.y?C<=y&&(m.y=Math.max(C,c.y+w),b.y=Math.min(y,h.y-x)):C>=y&&(m.y=Math.min(C,c.y-w),b.y=Math.max(y,h.y+x))}return[m.toJSON(),...i,b.toJSON()]};function Sn(i,t){if(t!=null&&t!==!1){const e=typeof t=="boolean"?0:t;if(e>0){const n=A.create(i[1]).move(i[2],e),s=A.create(i[1]).move(i[0],e);return[n.toJSON(),...i,s.toJSON()]}{const n=i[1];return[Object.assign({},n),...i,Object.assign({},n)]}}return i}const ar=Object.freeze(Object.defineProperty({__proto__:null,er:dC,loop:(i,t,e)=>{const n=t.width||50,o=(t.height||80)/2,r=t.angle||"auto",a=e.sourceAnchor,l=e.targetAnchor,c=e.sourceBBox,h=e.targetBBox;if(a.equals(l)){const u=y=>{const C=Dt(y),w=Math.sin(C),x=Math.cos(C),E=new A(a.x+x*n,a.y+w*n),S=new A(E.x-x*o,E.y-w*o),v=S.clone().rotate(-90,E),M=S.clone().rotate(90,E);return[v.toJSON(),E.toJSON(),M.toJSON()]},g=y=>{const C=a.clone().move(y,-1),w=new z(C,y);return!c.containsPoint(y)&&!c.intersectsWithLine(w)},f=[0,90,180,270,45,135,225,315];if(typeof r=="number")return Sn(u(r),t.merge);const p=c.getCenter();if(p.equals(a))return Sn(u(0),t.merge);const m=p.angleBetween(a,p.clone().translate(1,0));let b=u(m);if(g(b[1]))return Sn(b,t.merge);for(let y=1,C=f.length;y<C;y+=1)if(b=u(m+f[y]),g(b[1]))return Sn(b,t.merge);return Sn(b,t.merge)}{const u=new z(a,l);let g=u.parallel(-n),f=g.getCenter(),p=g.start.clone().move(g.end,o),m=g.end.clone().move(g.start,o);const b=u.parallel(-1),y=new z(b.start,f),C=new z(b.end,f);if((c.containsPoint(f)||h.containsPoint(f)||c.intersectsWithLine(y)||c.intersectsWithLine(C)||h.intersectsWithLine(y)||h.intersectsWithLine(C))&&(g=u.parallel(n),f=g.getCenter(),p=g.start.clone().move(g.end,o),m=g.end.clone().move(g.start,o)),t.merge){const w=new z(a,l),x=new z(f,w.center).setLength(Number.MAX_SAFE_INTEGER),E=c.intersectsWithLine(x),S=h.intersectsWithLine(x),v=E?Array.isArray(E)?E:[E]:[];S&&(Array.isArray(S)?v.push(...S):v.push(S));const M=w.center.closest(v);M?(e.sourceAnchor=M.clone(),e.targetAnchor=M.clone()):(e.sourceAnchor=w.center.clone(),e.targetAnchor=w.center.clone())}return Sn([p.toJSON(),f.toJSON(),m.toJSON()],t.merge)}},manhattan:Jh,metro:uC,normal:Jw,oneSide:jw,orth:Oh},Symbol.toStringTag,{value:"Module"})),wi=yt.create({type:"router"});wi.register(ar,!0);function gC(i){return i!=null&&!Is(i)}function Is(i){return i!=null&&typeof i=="string"}function fC(i){return i==null||Is(i)?i:dt(i)}function pC(i){return`${i}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function jh(i,t={ns:Mt.svg}){const e=document.createDocumentFragment(),n={},s={},o=[{markup:Array.isArray(i)?i:[i],parent:e,ns:t.ns}];for(;o.length>0;){const r=o.pop();let a=r.ns||Mt.svg;const l=r.markup,c=r.parent;l.forEach(h=>{const u=h.tagName;if(!u)throw new TypeError("Invalid tagName");h.ns&&(a=h.ns);const g=a?Bo(u,a):ec(u),f=h.attrs;f&&W(g,Xn(f));const p=h.style;p&&nt(g,p);const m=h.className;m!=null&&g.setAttribute("class",Array.isArray(m)?m.join(" "):m),h.textContent&&(g.textContent=h.textContent);const b=h.selector;if(b!=null){if(s[b])throw new TypeError("Selector must be unique");s[b]=g}if(h.groupSelector){let C=h.groupSelector;Array.isArray(C)||(C=[C]),C.forEach(w=>{n[w]||(n[w]=[]),n[w].push(g)})}c.appendChild(g);const y=h.children;Array.isArray(y)&&o.push({ns:a,markup:y,parent:g})})}return Object.keys(n).forEach(r=>{if(s[r])throw new Error("Ambiguous group selector");s[r]=n[r]}),{fragment:e,selectors:s,groups:n}}function lr(i){return i instanceof SVGElement?ce("g"):ec("div")}function mC(i){if(Is(i)){const s=U.createVectors(i),o=s.length;if(o===1)return{elem:s[0].node};if(o>1){const r=lr(s[0].node);return s.forEach(a=>{r.appendChild(a.node)}),{elem:r}}return{}}const t=jh(i),e=t.fragment;let n=null;return e.childNodes.length>1?(n=lr(e.firstChild),n.appendChild(e)):n=e.firstChild,{elem:n,selectors:t.selectors}}function bC(i){const t=U.createVectors(i),e=document.createDocumentFragment();for(let n=0,s=t.length;n<s;n+=1){const o=t[n].node;e.appendChild(o)}return{fragment:e,selectors:{}}}function Gh(i,t,e){if(i!=null){let n;const s=i.tagName.toLowerCase();if(i===t)return typeof e=="string"?n=`> ${s} > ${e}`:n=`> ${s}`,n;const o=i.parentNode;if(o&&o.childNodes.length>1){const r=ko(i)+1;n=`${s}:nth-child(${r})`}else n=s;return e&&(n+=` > ${e}`),Gh(i.parentNode,t,n)}return e}function yC(){return"g"}function wC(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function CC(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}function AC(){return[{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"}}]}function xC(i=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:Mt.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:Mt.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:i?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}const Lt={isJSONMarkup:gC,isStringMarkup:Is,clone:fC,sanitize:pC,parseJSONMarkup:jh,createContainer:lr,renderMarkup:mC,parseLabelStringMarkup:bC,getSelector:Gh,getPortContainerMarkup:yC,getPortMarkup:wC,getPortLabelMarkup:CC,getEdgeMarkup:AC,getForeignObjectMarkup:xC};function UE(i,t){}function KE(i){}function We(i,t){return t?ce(i||"g"):Bo(i||"div")}function Yh(i,t,e){if(!i||i===".")return{elems:[t]};if(e){const n=e[i];if(n)return{elems:Array.isArray(n)?n:[n]}}{const n=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(t.querySelectorAll(n))}}}function vC(i){var t;let e=i;const n=i.originalEvent,s=(t=n==null?void 0:n.changedTouches)===null||t===void 0?void 0:t[0];if(s){for(const o in i)s[o]===void 0&&(s[o]=i[o]);e=s}return e}let Gt=class extends Ft{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=oy("v"),this.cid}confirmUpdate(t,e){return 0}empty(t=this.container){return Wn(t),this}unmount(t=this.container){return qt(t),this}remove(t=this.container){return t===this.container?(this.removeEventListeners(document),this.onRemove(),this.cid,this.disposeContainer&&this.unmount(t)):this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return Q(e,Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return lt(e,Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return nt(e,t),this}setAttrs(t,e=this.container){return t!=null&&e!=null&&W(e,t),this}findAttr(t,e=this.container){let n=e;for(;n&&n.nodeType===1;){const s=n.getAttribute(t);if(s!=null)return s;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return Yh(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const s=this.find(t,e,n);return s.length>0?s[0]:null}findByAttr(t,e=this.container){let n=e;for(;n!=null&&n.getAttribute;){const s=n.getAttribute(t);if((s!=null||n===this.container)&&s!=="false")return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return typeof e=="string"&&(n=`> ${e}`),n;if(t){const s=ko(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${s})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return et.prefix(t)}delegateEvents(t,e){if(t==null)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(s=>{const o=s.match(n);if(o==null)return;const r=this.getEventHandler(t[s]);typeof r=="function"&&this.delegateEvent(o[1],o[2],r)}),this}undelegateEvents(){return ot.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return ot.on(this.container,t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const s=t+this.getEventNamespace();return e==null?ot.off(this.container,s):typeof e=="string"?ot.off(this.container,s,e,n):ot.off(this.container,s,e),this}addEventListeners(t,e,n){if(e==null)return this;const s=this.getEventNamespace();return Object.keys(e).forEach(o=>{const r=this.getEventHandler(e[o]);typeof r=="function"&&ot.on(t,o+s,n,r)}),this}removeEventListeners(t){return t!=null&&ot.off(t,this.getEventNamespace()),this}getEventNamespace(){return`.${et.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if(typeof t=="string"){const n=this[t];typeof n=="function"&&(e=(...s)=>n.call(this,...s))}else e=(...n)=>t.call(this,...n);return e}getEventTarget(t,e={}){const{target:n,type:s,clientX:o=0,clientY:r=0}=t;return e.fromPoint||s==="touchmove"||s==="touchend"?document.elementFromPoint(o,r):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return this.getEventData(t).propagationStopped===!0}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(t==null)throw new TypeError("Event object required");let n=t.data;const s=`__${this.cid}__`;return e==null?n==null?{}:n[s]||{}:(n==null&&(n=t.data={}),n[s]==null?n[s]=Object.assign({},e):n[s]=Object.assign(Object.assign({},n[s]),e),n[s])}normalizeEvent(t){return vC(t)}dispose(){this.remove()}};$([Z()],Gt.prototype,"dispose",null);let Hh=0;function EC(i){return i?Io(i):(Hh+=1,`CustomTool${Hh}`)}class gt extends Gt{static isToolItem(t){if(t==null)return!1;if(t instanceof gt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===_h)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"&&typeof n.isVisible=="function"}static define(t){const e=Vo(EC(t.name),gt);return e.config(t),e}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return ft(dt(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return _h}constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=We(this.options.tagName||"g",this.options.isSVGElement!==!1),Q(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&Q(this.container,this.options.className),this.init()}init(){}getOptions(t){return this.constructor.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?Q(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&Q(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=Lt.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const t=this.options.focusOpacity;return t!=null&&Number.isFinite(t)&&(this.container.style.opacity=`${t}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(t,this.cellView)}}gt.toStringTag=`X6.${gt.name}`,gt.defaults={isSVGElement:!0,tagName:"g"};const _h=`X6.${gt.name}`;class SC{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,s,o,r;const a=[];return Object.keys(e).forEach(l=>{const c=e[l],h=this.getDefinition(l),u=F(B3,this.view,h,c,{elem:t,attrs:e,cell:this.cell,view:this.view});if(h&&u)typeof h=="string"?(n==null&&(n={}),n[h]=c):c!==null&&a.push({name:l,definition:h});else{n==null&&(n={});const g=ac.includes(l)?l:rc(l);n[g]=c}}),a.forEach(({name:l,definition:c})=>{const h=e[l];typeof c.set=="function"&&(s==null&&(s={}),s[l]=h),typeof c.offset=="function"&&(o==null&&(o={}),o[l]=h),typeof c.position=="function"&&(r==null&&(r={}),r[l]=h)}),{raw:e,normal:n,set:s,offset:o,position:r}}mergeProcessedAttrs(t,e){var n;t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const s=(n=t.normal)===null||n===void 0?void 0:n.transform;s!=null&&e.normal&&(e.normal.transform=s),t.normal=e.normal}findAttrs(t,e,n,s){const o=[],r=new Wo;return Object.keys(t).forEach(a=>{const l=t[a];if(!se(l))return;const{isCSSSelector:c,elems:h}=Yh(a,e,s);n[a]=h;for(let u=0,g=h.length;u<g;u+=1){const f=h[u],p=s&&s[a]===f,m=r.get(f);if(m){m.array||(o.push(f),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const b=m.attrs,y=m.priority;if(p)b.unshift(l),y.unshift(-1);else{const C=qb(y,c?-1:g);b.splice(C,0,l),y.splice(C,0,g)}}else r.set(f,{elem:f,attrs:l,priority:p?-1:g,array:!1})}}),o.forEach(a=>{const l=r.get(a),c=l.attrs;l.attrs=c.reduceRight((h,u)=>ft(h,u),{})}),r}updateRelativeAttrs(t,e,n){const s=e.raw||{};let o=e.normal||{};const r=e.set,a=e.position,l=e.offset,c=()=>({elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:n.clone()});if(r!=null&&Object.keys(r).forEach(b=>{const y=r[b],C=this.getDefinition(b);if(C!=null){const w=F(C.set,this.view,y,c());typeof w=="object"?o=Object.assign(Object.assign({},o),w):w!=null&&(o[b]=w)}}),t instanceof HTMLElement){this.view.setAttrs(o,t);return}const h=o.transform,u=h?`${h}`:null,g=Zn(u),f=new A(g.e,g.f);h&&(delete o.transform,g.e=0,g.f=0);let p=!1;a!=null&&Object.keys(a).forEach(b=>{const y=a[b],C=this.getDefinition(b);if(C!=null){const w=F(C.position,this.view,y,c());w!=null&&(p=!0,f.translate(A.create(w)))}}),this.view.setAttrs(o,t);let m=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(t);if(b.width>0&&b.height>0){const y=$t(b,g);Object.keys(l).forEach(C=>{const w=l[C],x=this.getDefinition(C);if(x!=null){const E=F(x.offset,this.view,w,{elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:y});E!=null&&(m=!0,f.translate(A.create(E)))}})}}(h!=null||p||m)&&(f.round(1),g.e=f.x,g.f=f.y,t.setAttribute("transform",ti(g)))}update(t,e,n){const s={},o=this.findAttrs(n.attrs||e,t,s,n.selectors),r=n.attrs?this.findAttrs(e,t,s,n.selectors):o,a=[];o.each(h=>{const u=h.elem,g=h.attrs,f=this.processAttrs(u,g);if(f.set==null&&f.position==null&&f.offset==null)this.view.setAttrs(f.normal,u);else{const p=r.get(u),m=p?p.attrs:null,b=m&&g.ref==null?m.ref:g.ref;let y;if(b){if(y=(s[b]||this.view.find(b,t,n.selectors))[0],!y)throw new Error(`"${b}" reference does not exist.`)}else y=null;const C={node:u,refNode:y,attributes:m,processedAttributes:f},w=a.findIndex(x=>x.refNode===u);w>-1?a.splice(w,0,C):a.push(C)}});const l=new Wo;let c;a.forEach(h=>{const u=h.node,g=h.refNode;let f;const p=g!=null&&n.rotatableNode!=null&&To(n.rotatableNode,g);if(g&&(f=l.get(g)),!f){const y=p?n.rotatableNode:t;f=g?fe(g,{target:y}):n.rootBBox,g&&l.set(g,f)}let m;n.attrs&&h.attributes?(m=this.processAttrs(u,h.attributes),this.mergeProcessedAttrs(m,h.processedAttributes)):m=h.processedAttributes;let b=f;p&&n.rotatableNode!=null&&!n.rotatableNode.contains(u)&&(c||(c=Zn(W(n.rotatableNode,"transform"))),b=$t(f,c)),this.updateRelativeAttrs(u,m,b)})}}class MC{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Wo,this.pathCache={}}get(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(e.matrix==null){const n=this.view.container;e.matrix=A6(t,n)}return Bt(e.matrix)}getShape(t){const e=this.get(t);return e.shape==null&&(e.shape=Fc(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return e.boundingRect==null&&(e.boundingRect=F6(t)),e.boundingRect.clone()}}class BC{get cell(){return this.view.cell}constructor(t,e,n=[]){this.view=t;const s={},o={};let r=0;Object.keys(e).forEach(l=>{let c=e[l];Array.isArray(c)||(c=[c]),c.forEach(h=>{let u=s[h];u||(r+=1,u=s[h]=1<<r),o[l]|=u})});let a=n;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{s[l]||(r+=1,s[l]=1<<r)}),r>25)throw new Error("Maximum number of flags exceeded.");this.flags=s,this.attrs=o,this.bootstrap=n}getFlag(t){const e=this.flags;return e==null?0:Array.isArray(t)?t.reduce((n,s)=>n|e[s],0):e[t]|0}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs&&Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t}}class Tt extends Gt{static getDefaults(){return Tt.defaults}static isCellView(t){if(t==null)return!1;if(t instanceof Tt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Wh)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"}static config(t){Tt.defaults=Tt.getOptions(t)}static getOptions(t){const e=(c,h)=>h!=null?Rl([...Array.isArray(c)?c:[c],...Array.isArray(h)?h:[h]]):Array.isArray(c)?[...c]:[c],n=dt(Tt.getDefaults()),{bootstrap:s,actions:o,events:r,documentEvents:a}=t,l=Y(t,["bootstrap","actions","events","documentEvents"]);return s&&(n.bootstrap=e(n.bootstrap,s)),o&&Object.entries(o).forEach(([c,h])=>{const u=n.actions[c];h&&u?n.actions[c]=e(u,h):h&&(n.actions[c]=e(h))}),r&&(n.events=Object.assign(Object.assign({},n.events),r)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),a)),ft(n,l)}get[Symbol.toStringTag](){return Wh}constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new SC(this),this.flag=new BC(this,this.options.actions,this.options.bootstrap),this.cache=new MC(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return We(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,this.options.events!=null&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();e!=null&&this.setAttrs(e,t);const n=this.getContainerStyle();n!=null&&this.setStyle(n,t);const s=this.getContainerClassName();s!=null&&this.addClass(s,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,s){if(this.hasAction(t,e)){n();const o=[e];return s&&(typeof s=="string"?o.push(s):o.push(...s)),this.removeAction(t,o)}return t}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:t}){this.onAttrsChange(t)}onAttrsChange(t){let e=this.flag.getChangedFlag();t.updated||!e||(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,e,t))}parseJSONMarkup(t,e){const n=Lt.parseJSONMarkup(t),s=n.selectors,o=this.rootSelector;if(e&&o){if(s[o])throw new Error("Invalid root selector");s[o]=e}return n}can(t){let e=this.graph.options.interacting;if(typeof e=="function"&&(e=F(e,this.graph,this)),typeof e=="object"){let n=e[t];return typeof n=="function"&&(n=F(n,this.graph,this)),n!==!1}return typeof e=="boolean"?e:!1}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),s=this.getRootRotatedMatrix(),o=this.getRootTranslatedMatrix();return $t(e,o.multiply(s).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),s=this.getRootTranslatedMatrix();return $t(e,s.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const n=this.cell,s=n.isNode()?n.getAngle():0;e=n.getBBox().bbox(s)}else e=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return Bt().translate(e.x,e.y)}getRootRotatedMatrix(){let t=Bt();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const s=e.getBBox(),o=s.width/2,r=s.height/2;t=t.translate(o,r).rotate(n).translate(-o,-r)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){n.rootBBox==null&&(n.rootBBox=new P),n.selectors==null&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(t==null||t===this.container)}prepareHighlight(t,e={}){const n=t||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const 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}unhighlight(t,e={}){const 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}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,s,o){const r=this.cell,a=this.findAttr("port",t),l=t.getAttribute("data-selector"),c={cell:r.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,r.isNode()&&!r.hasPort(a)&&l==null&&(c.selector=this.getSelector(t))):l==null&&this.container!==t&&(c.selector=this.getSelector(t)),c}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,s=t.port;let o=t.magnet,r;return s!=null&&e.isNode()&&e.hasPort(s)?r=this.findPortElem(s,o)||n:(o||(o=t.selector),!o&&s!=null&&(o=`[port="${s}"]`),r=this.findOne(o,n,this.selectors)),r}hasTools(t){const e=this.tools;return e==null?!1:t==null?!0:e.name===t}addTools(t){if(this.removeTools(),t){if(!this.can("toolsAddable"))return this;const e=qe.isToolsView(t)?t:new qe(t);this.tools=e,e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const s=this,o=s.cell;return e==null||n==null?{e:t,view:s,cell:o}:{e:t,x:e,y:n,view:s,cell:o}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){this.notify("cell:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,s){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),this.notify(e,Object.assign({},this.getEventArgs(t,n,s)))}onMagnetMouseDown(t,e,n,s){}onMagnetDblClick(t,e,n,s){}onMagnetContextMenu(t,e,n,s){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.getEventTarget(t,{fromPoint:!0}),n=this.graph.findViewByElem(e);n!==this&&(this.onMouseLeave(t),n&&n.onMouseEnter(t))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}Tt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},Tt.registry=yt.create({type:"view"}),$([Z()],Tt.prototype,"dispose",null);const Wh=`X6.${Tt.name}`;class qe extends Gt{static isToolsView(t){if(t==null)return!1;if(t instanceof qe)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===qh)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return qh}constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}createContainer(t,e){const n=t?We("g",!0):We("div",!1);return Q(n,this.prefixClassName("cell-tools")),e.className&&Q(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!Tt.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(Q(this.svgContainer,this.prefixClassName("edge-tools")),Q(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(Q(this.svgContainer,this.prefixClassName("node-tools")),Q(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));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach(s=>{gt.isToolItem(s)?s.name==="vertices"?n.unshift(s):n.push(s):(typeof s=="object"?s.name:s)==="vertices"?n.unshift(s):n.push(s)});for(let s=0;s<n.length;s+=1){const o=n[s];let r;if(gt.isToolItem(o))r=o;else{const a=typeof o=="object"?o.name:o,l=typeof o=="object"?o.args||{}:{};if(a){if(this.cell.isNode()){const c=Ei.get(a);if(c)r=new c(l);else return Ei.onNotFound(a)}else if(this.cell.isEdge()){const c=Si.get(a);if(c)r=new c(l);else return Si.onNotFound(a)}}}r&&(r.config(this.cellView,this),r.render(),(r.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(r.container),this.tools.push(r))}return this}update(t={}){const e=this.tools;return e&&e.forEach(n=>{t.toolId!==n.cid&&n.isVisible()&&n.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(n=>{t===n?n.show():n.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(n=>{n!==t&&!n.isVisible()&&(n.show(),n.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(e=>e.remove()),this.tools=null),qt(this.svgContainer),qt(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some(o=>o.options.isSVGElement!==!1),s=t.some(o=>o.options.isSVGElement===!1);n&&(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer),s&&this.graph.container.appendChild(this.htmlContainer)}return this}}qe.toStringTag=`X6.${qe.name}`;const qh=`X6.${qe.name}`,kC=i=>i;function Xh(i,t){return t===0?"0%":`${Math.round(i/t*100)}%`}function $h(i){return(e,n,s,o)=>n.isEdgeElement(s)?IC(i,e,n,s,o):TC(i,e,n,s,o)}function TC(i,t,e,n,s){const o=e.cell,r=o.getAngle(),a=e.getUnrotatedBBoxOfElement(n),l=o.getBBox().getCenter(),c=A.create(s).rotate(r,l);let h=c.x-a.x,u=c.y-a.y;return i&&(h=Xh(h,a.width),u=Xh(u,a.height)),t.anchor={name:"topLeft",args:{dx:h,dy:u,rotate:!0}},t}function IC(i,t,e,n,s){const o=e.getConnection();if(!o)return t;const r=o.closestPointLength(s);if(i){const a=o.length();t.anchor={name:"ratio",args:{ratio:r/a}}}else t.anchor={name:"length",args:{length:r}};return t}const PC=$h(!0),OC=$h(!1),Zh=Object.freeze(Object.defineProperty({__proto__:null,noop:kC,pinAbsolute:OC,pinRelative:PC},Symbol.toStringTag,{value:"Module"}));yt.create({type:"connection strategy"}).register(Zh,!0);function tu(i,t,e,n){return F(Zh.pinRelative,this.graph,{},t,e,i,this.cell,n,{}).anchor}function eu(i,t){return t?i.cell.getBBox():i.cell.isEdge()?i.getConnection().bbox():i.getUnrotatedBBoxOfElement(i.container)}class Ci extends gt{get type(){return this.options.type}onRender(){Q(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,s=this.cellView,o=this.options,r=s.getTerminalAnchor(n),a=s.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${r.x}, ${r.y})`);const l=a?o.customAnchorAttrs:o.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{e.setAttribute(c,l[c])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,s=this.cellView,o=s.getTerminalView(n);if(o){const r=o.cell,a=s.getTerminalMagnet(n);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,h,u;o.isEdgeElement(a)?(c=o.getBBox(),h=0,u=c.getCenter()):(c=o.getUnrotatedBBoxOfElement(a),h=r.getAngle(),u=c.getCenter(),h&&u.rotate(-h,r.getBBox().getCenter())),c.inflate(l),W(e,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${u.x}, ${u.y}) rotate(${h})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(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}))}resetAnchor(t){const 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})}onMouseMove(t){const e=this.type,n=this.cellView,s=n.getTerminalView(e);if(s==null)return;const o=this.normalizeEvent(t),r=s.cell,a=n.getTerminalMagnet(e);let l=this.graph.coord.clientToLocalPoint(o.clientX,o.clientY);const c=this.options.snap;if(typeof c=="function"){const g=F(c,n,l,s,a,e,n,this);l=A.create(g)}if(this.options.restrictArea)if(s.isEdgeElement(a)){const g=s.getClosestPoint(l);g&&(l=g)}else{const g=s.getUnrotatedBBoxOfElement(a),f=r.getAngle(),p=r.getBBox().getCenter(),m=l.clone().rotate(f,p);g.containsPoint(m)||(l=g.getNearestPointToPoint(m).rotate(-f,p))}let h;const u=this.options.anchor;typeof u=="function"&&(h=F(u,n,l,s,a,e,n,this)),this.resetAnchor(h),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(t===!0?void 0:t),this.update()}}Ci.defaults=Object.assign(Object.assign({},gt.getDefaults()),{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:tu,snap(i,t,e,n,s,o){const r=o.options.snapRadius||0,a=n==="source",l=a?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return c&&(Math.abs(c.x-i.x)<r&&(i.x=c.x),Math.abs(c.y-i.y)<r&&(i.y=c.y)),i}});class nu extends Ci{}nu.defaults=Object.assign(Object.assign({},Ci.getDefaults()),{name:"source-anchor",type:"source"});class iu extends Ci{}iu.defaults=Object.assign(Object.assign({},Ci.getDefaults()),{name:"target-anchor",type:"target"});class Ai extends gt{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=Y(t,["class"]);this.setAttrs(n,this.container),e&&Q(this.container,e)}}onRender(){Q(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),s=n?n.start:e.getPointAtRatio(t),o=n&&n.vector().vectorAngle(new A(1,0))||0;if(!s)return this;const r=Bt().translate(s.x,s.y).rotate(o);return yn(this.container,r,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),s=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(t,s),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,s=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,s.x,s.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}Ai.defaults=Object.assign(Object.assign({},gt.getDefaults()),{tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}});class su extends Ai{}su.defaults=Object.assign(Object.assign({},Ai.getDefaults()),{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"}});class ou extends Ai{}ou.defaults=Object.assign(Object.assign({},Ai.getDefaults()),{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"}});class cr extends gt{onRender(){if(Q(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=Y(t,["class"]);W(this.container,Xn(n)),e&&Q(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:s}=e,o=re(e.padding);let r=eu(t,n);this.parent.options.local&&(r=r.translate({x:-r.x,y:-r.y})),r=r.moveAndExpand({x:-o.left,y:-o.top,width:o.left+o.right,height:o.top+o.bottom});const a=t.cell;if(a.isNode()){const l=a.getAngle();if(l!=null)if(s&&!this.parent.options.local){const c=a.getBBox().getCenter();Ko(this.container,l,c.x,c.y,{absolute:!0})}else s||(r=r.bbox(l))}return W(this.container,r.toJSON()),this}}cr.defaults=Object.assign(Object.assign({},gt.getDefaults()),{name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}});class xi extends gt{onRender(){Q(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();yn(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:s=0}=e;const{offset:o,useCellGeometry:r,rotate:a}=e;let l=eu(t,r);const c=t.cell.getAngle();a||(l=l.bbox(c));let h=0,u=0;typeof o=="number"?(h=o,u=o):typeof o=="object"&&(h=o.x,u=o.y),n=Yt(n,l.width),s=Yt(s,l.height);let g=Bt();return this.parent.options.local?g=g.translate(l.width/2,l.height/2):g=g.translate(l.x+l.width/2,l.y+l.height/2),a&&(g=g.rotate(c)),g=g.translate(n+h-l.width/2,s+u-l.height/2),g}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:s=0,rotate:o}=e,r=Yt(s,1),a=r>=0&&r<=1?t.getTangentAtRatio(r):t.getTangentAtLength(r),l=a?a.start:t.getConnection().start,c=a&&a.vector().vectorAngle(new A(1,0))||0;let h=Bt().translate(l.x,l.y).rotate(c);return typeof n=="object"?h=h.translate(n.x||0,n.y||0):h=h.translate(0,n),o||(h=h.rotate(-c)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;typeof e=="function"&&F(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}xi.defaults=Object.assign(Object.assign({},gt.getDefaults()),{name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}});class hr extends xi{}hr.defaults=Object.assign(Object.assign({},xi.getDefaults()),{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,useCellGeometry:!0,onClick({view:i,btn:t}){t.parent.remove(),i.cell.remove({ui:!0,toolId:t.cid})}});class vi extends gt{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const t=this.cellView;t&&t.on("cell:dblclick",this.dblClick)}createElement(){const t=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=We("div",!1),this.addClass(t,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:t,editor:e}=this;if(!e)return;const{style:n}=e;t.isNode()?this.updateNodeEditorTransform():t.isEdge()&&this.updateEdgeEditorTransform();const{attrs:s}=this.options;n.fontSize=`${s.fontSize}px`,n.fontFamily=s.fontFamily,n.color=s.color,n.backgroundColor=s.backgroundColor;const o=this.getCellText()||"";return e.innerText=o,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:t,cell:e,editor:n}=this;if(!n)return;let s=A.create(),o=20,r="",{x:a,y:l}=this.options;const{width:c,height:h}=this.options;if(typeof a<"u"&&typeof l<"u"){const f=e.getBBox();a=Yt(a,f.width),l=Yt(l,f.height),s=f.topLeft.translate(a,l),o=f.width-a*2}else{const f=e.getBBox();s=f.center,o=f.width-4,r="translate(-50%, -50%)"}const u=t.scale(),{style:g}=n;s=t.localToGraph(s),g.left=`${s.x}px`,g.top=`${s.y}px`,g.transform=`scale(${u.sx}, ${u.sy}) ${r}`,g.minWidth=`${o}px`,typeof c=="number"&&(g.width=`${c}px`),typeof h=="number"&&(g.height=`${h}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:t,editor:e}=this;if(!e)return;let n=A.create(),s=20;const{style:o}=e,r=this.event.target,a=r.parentElement;if(a&&ge(a,this.prefixClassName("edge-label"))){const h=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);const u=a.getAttribute("transform"),{translation:g}=hs(u);n=new A(g.tx,g.ty),s=fe(r).width}else{if(!this.options.labelAddable)return this;n=t.clientToLocal(A.create(this.event.clientX,this.event.clientY));const u=this.cellView.path.closestPointLength(n);this.distance=u,this.labelIndex=-1}n=t.localToGraph(n);const c=t.scale();o.left=`${n.x}px`,o.top=`${n.y}px`,o.minWidth=`${s}px`,o.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}updateCell(){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}onDocumentMouseUp(t){this.editor&&t.target!==this.editor&&this.updateCell()}onCellDblClick({e:t}){this.editor||(t.stopPropagation(),this.removeElement(),this.event=t,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}getCellText(){const{getText:t}=this.options;if(typeof t=="function")return F(t,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof t=="string"){if(this.cell.isNode())return this.cell.attr(t);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${t}`)}}setCellText(t){const e=this.options.setText;if(typeof e=="function"){F(e,this.cellView,{cell:this.cell,value:t,index:this.labelIndex,distance:this.distance});return}if(typeof e=="string"){if(this.cell.isNode()){t!==null&&this.cell.attr(e,t);return}if(this.cell.isEdge()){const n=this.cell;if(this.labelIndex===-1){if(t){const s={position:{distance:this.distance},attrs:{}};bn(s,`attrs/${e}`,t),n.appendLabel(s)}}else t!==null?n.prop(`labels/${this.labelIndex}/attrs/${e}`,t):typeof this.labelIndex=="number"&&n.removeLabelAt(this.labelIndex)}}}onRemove(){const t=this.cellView;t&&t.off("cell:dblclick",this.dblClick),this.removeElement()}}vi.defaults=Object.assign(Object.assign({},gt.getDefaults()),{tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}});class ru extends vi{}ru.defaults=ft({},vi.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"});class au extends vi{}au.defaults=ft({},vi.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"});class ur extends gt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}getPoints(){const e=this.cellView.routePoints;if(e.length<=2)return e;const n=[e[0]];for(let s=1;s<e.length-1;s++){const o=n[n.length-1],r=e[s],a=e[s+1];(r.x-o.x)*(a.y-o.y)-(r.y-o.y)*(a.x-o.x)!==0&&n.push(r)}return n.push(e[e.length-1]),n}onRender(){Q(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.getPoints()];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,s=e.length;n<s-1;n+=1){const o=e[n],r=e[n+1],a=this.renderHandle(o,r,n);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(t,e,n){const s=this.options.createHandle({index:n,graph:this.graph,guard:o=>this.guard(o),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(s),this.updateHandle(s,t,e),this.container.appendChild(s.container),this.startHandleListening(s),s}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let n=0,s=e.length;n<s;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,s={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,s):n.removeProp([t,"anchor"],s)}snapHandle(t,e,n){const s=t.options.axis,o=t.options.index,l=this.cellView.cell.getVertices(),c=l[o-2]||n.sourceAnchor,h=l[o+1]||n.targetAnchor,u=this.options.snapRadius;return Math.abs(e[s]-c[s])<u?e[s]=c[s]:Math.abs(e[s]-h[s])<u&&(e[s]=h[s]),e}onHandleChanging({handle:t,e}){const n=this.graph,s=this.options,o=this.cellView,r=s.anchor,a=t.options.axis,l=t.options.index-1,c=this.getEventData(e),h=this.normalizeEvent(e),u=n.snapToGrid(h.clientX,h.clientY),g=this.snapHandle(t,u.clone(),c),f=dt(this.vertices);let p=f[l],m=f[l+1];const b=o.sourceView,y=o.sourceBBox;let C=!1,w=!1;if(p?l===0?y.containsPoint(p)?(f.shift(),this.shiftHandleIndexes(-1),C=!0):(p[a]=g[a],w=!0):p[a]=g[a]:(p=o.sourceAnchor.toJSON(),p[a]=g[a],y.containsPoint(p)?C=!0:(f.unshift(p),this.shiftHandleIndexes(1),w=!0)),typeof r=="function"&&b){if(C){const M=c.sourceAnchor.clone();M[a]=g[a];const k=F(r,o,M,b,o.sourceMagnet||b.container,"source",o,this);this.resetAnchor("source",k)}w&&this.resetAnchor("source",c.sourceAnchorDef)}const x=o.targetView,E=o.targetBBox;let S=!1,v=!1;if(m?l===f.length-2?E.containsPoint(m)?(f.pop(),S=!0):(m[a]=g[a],v=!0):m[a]=g[a]:(m=o.targetAnchor.toJSON(),m[a]=g[a],E.containsPoint(m)?S=!0:(f.push(m),v=!0)),typeof r=="function"&&x){if(S){const M=c.targetAnchor.clone();M[a]=g[a];const k=F(r,o,M,x,o.targetMagnet||x.container,"target",o,this);this.resetAnchor("target",k)}v&&this.resetAnchor("target",c.targetAnchorDef)}A.equalPoints(f,this.vertices)||this.cellView.cell.setVertices(f,{ui:!0,toolId:this.cid}),this.updateHandle(t,p,m,0),s.stopPropagation||o.notifyMouseMove(h,u.x,u.y)}onHandleChange({handle:t,e}){const n=this.options,s=this.handles,o=this.cellView,r=t.options.index;if(Array.isArray(s)){for(let a=0,l=s.length;a<l;a+=1)a!==r&&s[a].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:o.sourceAnchor.clone(),targetAnchor:o.targetAnchor.clone(),sourceAnchorDef:dt(this.cell.prop(["source","anchor"])),targetAnchorDef:dt(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const a=this.normalizeEvent(e),l=this.graph.snapToGrid(a.clientX,a.clientY);o.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(s,o.x,o.y),n.checkMouseleave(s),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,s=0){const o=this.options.precision||0,r=Math.abs(e.x-n.x)<o,a=Math.abs(e.y-n.y)<o;if(r||a){const l=new z(e,n);if(l.length()<this.options.threshold)t.hide();else{const h=l.getCenter(),u=r?"x":"y";h[u]+=s||0;const g=l.vector().vectorAngle(new A(1,0));t.updatePosition(h.x,h.y,g,this.cellView),t.show(),t.options.axis=u}}else t.hide()}onRemove(){this.resetHandles()}}ur.defaults=Object.assign(Object.assign({},gt.defaults),{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:i=>new NC(i),anchor:tu});let NC=class extends Gt{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=We("rect",!0);const t=this.options.attrs;if(typeof t=="function"){const e=ur.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,s){const o=s.getClosestPoint(new A(t,e))||new A(t,e);let r=Bt().translate(o.x,o.y);if(o.equals({x:t,y:e}))r=r.rotate(n);else{let l=new z(t,e,o.x,o.y).vector().vectorAngle(new A(1,0));l!==0&&(l+=90),r=r.rotate(l)}this.setAttrs({transform:ti(r),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(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))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}};const dr=et.prefix("edge-tool-vertex-path");class gr extends gt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=this.options.createHandle,r=this.options.processHandle,a=o({index:e,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});r&&r(a),a.updatePosition(s.x,s.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=this.handles[e];o&&o.updatePosition(s.x,s.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const 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)}stopHandleListening(t){const 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)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,s=t>0?n[t-1]:e.sourceAnchor,o=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:A.create(s),next:A.create(o)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:s}=this.graph.snapToGrid(e.clientX,e.clientY);return{e,x:n,y:s}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:s,y:o}=this.getMouseEventArgs(t);this.eventData(n,{start:{x:s,y:o}}),e.notifyMouseDown(n,s,o)}}onHandleChanging({handle:t,e}){const n=this.cellView,s=t.options.index,{e:o,x:r,y:a}=this.getMouseEventArgs(e),l={x:r,y:a};this.snapVertex(l,s),n.cell.setVertexAt(s,l,{ui:!0,toolId:this.cid}),t.updatePosition(l.x,l.y),this.options.stopPropagation||n.notifyMouseMove(o,r,a)}stopBatch(t){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),t&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies){this.stopBatch(this.eventData(t).vertexAdded);return}n.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(t).vertexAdded);const{e:o,x:r,y:a}=this.getMouseEventArgs(t);if(!this.options.stopPropagation){n.notifyMouseUp(o,r,a);const{start:l}=this.eventData(o);if(l){const{x:c,y:h}=l;c===r&&h===a&&n.onClick(o,r,a)}}n.checkMouseleave(o),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const s=this.getNeighborPoints(e),o=s.prev,r=s.next;Math.abs(t.x-o.x)<n?t.x=o.x:Math.abs(t.x-r.x)<n&&(t.x=r.x),Math.abs(t.y-o.y)<n?t.y=s.prev.y:Math.abs(t.y-r.y)<n&&(t.y=r.y)}}onHandleRemove({handle:t,e}){if(this.options.removable){const n=t.options.index,s=this.cellView;s.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),s.checkMouseleave(this.normalizeEvent(e))}}allowAddVertex(t){const e=this.guard(t),n=this.options.addable&&this.cellView.can("vertexAddable"),s=this.options.modifiers?Ne(t,this.options.modifiers):!0;return!e&&n&&s}onPathMouseDown(t){const e=this.cellView;if(!this.allowAddVertex(t))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),s=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const o=e.getVertexIndex(s.x,s.y);this.snapVertex(s,o),e.cell.insertVertex(s,o,{ui:!0,toolId:this.cid}),this.render();const r=this.handles[o];this.eventData(n,{vertexAdded:!0}),r.onMouseDown(n)}onRemove(){this.resetHandles()}}gr.defaults=Object.assign(Object.assign({},gt.getDefaults()),{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:i=>new RC(i),markup:[{tagName:"path",selector:"connection",className:dr,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${dr}`]:"onPathMouseDown",[`touchstart .${dr}`]:"onPathMouseDown"}});class RC extends Gt{get graph(){return this.options.graph}constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=We("circle",!0);const t=this.options.attrs;if(typeof t=="function"){const e=gr.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(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}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}const DC={boundary:cr,button:xi,"button-remove":hr,"node-editor":ru},Ei=yt.create({type:"node tool",process(i,t){if(typeof t=="function")return t;let e=gt;const{inherit:n}=t,s=Y(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return s.name==null&&(s.name=i),e.define.call(e,s)}});Ei.register(DC,!0);const LC={boundary:cr,vertices:gr,segments:ur,button:xi,"button-remove":hr,"source-anchor":nu,"target-anchor":iu,"source-arrowhead":su,"target-arrowhead":ou,"edge-editor":au},Si=yt.create({type:"edge tool",process(i,t){if(typeof t=="function")return t;let e=gt;const{inherit:n}=t,s=Y(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return s.name==null&&(s.name=i),e.define.call(e,s)}});Si.register(LC,!0);class lu{constructor(t,e,n,s){var o;this.target=t,this.cell=(o=this.target.effect)===null||o===void 0?void 0:o.target,this.type=e,this.bubbles=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=0,this.timeStamp=performance.now(),this.currentTime=n,this.timelineTime=s}}function Ps(i){return i!=="offset"&&i!=="easing"&&i!=="composite"&&i!=="computedOffset"}function cu(i,t){return i==="reverse"||i==="alternate"&&t%2===1||i==="alternate-reverse"&&t%2===0}class QC{constructor(t,e){this._effect=null,this._currentTime=null,this._playbackRate=1,this._playState="idle",this._rafId=null,this._startTime=null,this._pausedTime=null,this._timeline=null,this.id="",this.onfinish=null,this.oncancel=null,this._effect=t,this._timeline=e??document.timeline}get effect(){return this._effect}get currentTime(){return this._currentTime}set currentTime(t){const e=this._timeline.currentTime;Ae(e)&&(this._startTime=e-t,this._currentTime=t)}get playbackRate(){return this._playbackRate}set playbackRate(t){const e=this._playbackRate;this._playbackRate=t;const n=this._timeline.currentTime;if(this._playState==="running"&&this._startTime!=null&&Ae(n)){const s=(n-this._startTime)*e;this._startTime=n-s/t}}get playState(){return this._playState}get timeline(){return this._timeline}play(){if(this._playState==="running"||!this._effect)return;const t=this._timeline.currentTime;Ae(t)&&(this._playState==="paused"?(this._startTime=t-this._pausedTime/this._playbackRate,this._pausedTime=null):(this._currentTime=0,this._startTime=t),this._playState="running",this._tick())}pause(){this._playState==="running"&&(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._pausedTime=this._currentTime,this._playState="paused")}finish(){var t;if(!this._effect)return;const e=this._effect.getComputedTiming(),n=this._playbackRate<0,{duration:s,endTime:o,direction:r,fill:a,iterations:l}=e;if(a==="forwards"||a==="both"){const h=n?0:l-1,u=cu(r,h);this._effect.apply(u||n?0:s)}else(a==="none"||a==="backwards")&&this._effect.apply(null);this._currentTime=n?0:o,this._playState="finished",this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null);const c=new lu(this,"finish",this._currentTime,this._timeline.currentTime);(t=this.onfinish)===null||t===void 0||t.call(this,c),this._effect.target.notify("animation:finish",c)}cancel(){var t;if(!this._effect)return;this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._playState="idle",this._currentTime=null,this._startTime=null,this._pausedTime=null,this._effect.apply(null);const e=new lu(this,"cancel",this._currentTime,this._timeline.currentTime);(t=this.oncancel)===null||t===void 0||t.call(this,e),this._effect.target.notify("animation:cancel",e)}updatePlaybackRate(t){this.playbackRate=t}reverse(){this.playbackRate=this.playbackRate*-1}_tick(){const t=this._timeline.currentTime;if(this._playState!=="running"||!this._effect||!Ae(t))return;const e=this._effect.getComputedTiming(),{duration:n,delay:s,iterations:o,direction:r,endTime:a}=e,l=(t-this._startTime)*this._playbackRate,c=l-s;let h=Math.floor(c/n);if(l>=a||l<0||n<=0){this.finish();return}if(l>=s){let u=c%n;h=Math.min(h,o-1),cu(r,h)&&(u=n-u),this._effect.apply(u)}this._currentTime=l,this._rafId=requestAnimationFrame(()=>this._tick())}}class VC{constructor(){this.animations=[]}addAnimation(t){this.animations.push(t)}getAnimations(){return this.animations}cancelAnimations(){this.animations.forEach(t=>{t.cancel()})}}class zC{constructor(t,e,n){this._originProps={},this._target=t,this._options=Ae(n)?{duration:n}:Object.assign({},n),this.setKeyframes(e)}get target(){return this._target}getKeyframes(){if(!this._keyframes||this._keyframes.length===0)return[];let t=[];if(Array.isArray(this._keyframes)&&(t=[...this._keyframes]),se(this._keyframes)){const n=Object.values(this._keyframes).map(o=>Ga(o).length),s=Math.max(...n);for(let o=0;o<s;o++){const r={};Object.entries(this._keyframes).forEach(([a,l])=>{const c=Ga(l)[o];Ps(a)&&c!=null&&(r[a]=c)}),t.push(r)}}return t=t.map((e,n,s)=>{var o,r,a;const l=e??{},c={};return c.offset=l.offset,c.easing=(a=(o=l.easing)!==null&&o!==void 0?o:(r=s[n-1])===null||r===void 0?void 0:r.easing)!==null&&a!==void 0?a:this.getComputedTiming().easing,Object.keys(l).forEach(h=>{Ps(h)&&(c[h]=l[h])}),c}),t=t.map((e,n)=>(e.offset==null?n===t.length-1?e.computedOffset=1:n===0?e.computedOffset=0:e.computedOffset=n/(t.length-1):e.computedOffset=e.offset,e)),t}setKeyframes(t){this._keyframes=t,this._computedKeyframes=this.getKeyframes(),this._computedKeyframes.forEach(e=>{Object.keys(e).forEach(n=>{Ps(n)&&this._originProps[n]==null&&(this._originProps[n]=this.target.getPropByPath(n))})})}getTiming(){return fb(this._options,FC)}getComputedTiming(){const t=this.getTiming(),e=t.duration*t.iterations;return Object.assign(Object.assign({},t),{activeDuration:e,endTime:e+t.delay})}apply(t){var e,n,s,o;if(!this._target||!this._computedKeyframes.length)return;if(t==null){Object.entries(this._originProps).forEach(([C,w])=>{this.target.setPropByPath(C,w)});return}const a=this.getComputedTiming().duration;if(a<0)return;const l=Math.min(t/a,1),c=this._computedKeyframes;if(c.length===0)return;let h={computedOffset:0},u={computedOffset:1};for(const C of c)if(l===0&&C.computedOffset===0&&(h=C),l===1&&C.computedOffset===1&&(u=C),C.computedOffset<l&&(h=C),C.computedOffset>l){u=C;break}const g=h.computedOffset,f=u.computedOffset,p=(l-g)/(f-g),m=(e=h.easing)!==null&&e!==void 0?e:u.easing,b=Gn(m),y=(n=M2[b])!==null&&n!==void 0?n:Jc;for(const C in Object.assign(Object.assign({},h),u))if(Ps(C)&&(h[C]!=null||u[C]!=null)){const w=(s=h[C])!==null&&s!==void 0?s:this._originProps[C],x=(o=u[C])!==null&&o!==void 0?o:this._originProps[C];let E;String(w).startsWith("#")?E=j6:C.endsWith("transform")&&!Ae(w)?E=G6:ii.test(String(w))||ii.test(String(x))?E=Kc:E=Uc;const v=E(w,x)(y(p));this.target.setPropByPath(C,v)}}}const FC={delay:0,direction:"normal",duration:0,easing:"linear",fill:"none",iterations:1};class hu extends Ft{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(dt(t)),this.changed={}}mutate(t,e={}){const n=e.unset===!0,s=e.silent===!0,o=[],r=this.changing;this.changing=!0,r||(this.previous=dt(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(t).forEach(h=>{const u=h,g=t[u];Ce(a[u],g)||o.push(u),Ce(l[u],g)?delete c[u]:c[u]=g,n?delete a[u]:a[u]=g}),!s&&o.length>0&&(this.pending=!0,this.pendingOptions=e,o.forEach(h=>{this.emit("change:*",{key:h,options:e,store:this,current:a[h],previous:l[h]})})),r)return this;if(!s)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}get(t,e){if(t==null)return this.data;const n=this.data[t];return n??e}getPrevious(t){if(this.previous){const e=this.previous[t];return e??void 0}}set(t,e,n){return t!=null&&(typeof t=="object"?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const s={};let o;if(typeof t=="string")s[t]=void 0,o=e;else if(Array.isArray(t))t.forEach(r=>s[r]=void 0),o=e;else{for(const r in this.data)s[r]=void 0;o=t}return this.mutate(s,Object.assign(Object.assign({},o),{unset:!0})),this}getByPath(t){return zo(this.data,t,"/")}setByPath(t,e,n={}){const s="/",o=Array.isArray(t)?[...t]:t.split(s),r=Array.isArray(t)?t.join(s):t,a=o[0],l=o.length;if(n.propertyPath=r,n.propertyValue=e,n.propertyPathArray=o,l===1)this.set(a,e,n);else{const c={};let h=c,u=a;for(let p=1;p<l;p+=1){const m=o[p],b=Number.isFinite(Number(m));h=h[u]=b?[]:{},u=m}bn(c,o,e,s);const g=dt(this.data);n.rewrite&&fc(g,t,s);const f=ft(g,c);this.set(a,f[a],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),s=n[0];if(n.length===1)this.remove(s,e);else{const o=n.slice(1),r=dt(this.get(s));r&&fc(r,o),this.set(s,r,e)}return this}hasChanged(t){return t==null?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(t==null)return this.hasChanged()?dt(this.changed):null;const e=this.changing?this.previous:this.data,n={};let s;for(const o in t){const r=t[o];Ce(e[o],r)||(n[o]=r,s=!0)}return s?dt(n):null}toJSON(){return dt(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}$([Z()],hu.prototype,"dispose",null);class q extends Ft{static isCell(t){if(t==null)return!1;if(t instanceof q)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===q.toStringTag)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"}static normalizeTools(t){if(typeof t=="string")return{items:[t]};if(Array.isArray(t))return{items:t};if(t.items)return t;if(Reflect.has(t,"local")){const e=t,{local:n}=e,s=Y(e,["local"]);return{local:n,items:[s]}}return{items:[t]}}static getCommonAncestor(...t){const e=t.filter(s=>s!=null).map(s=>s.getAncestors()).sort((s,o)=>s.length-o.length);return e.shift().find(s=>e.every(o=>o.includes(s)))||null}static getCellsBBox(t,e={}){let n=null;for(let s=0,o=t.length;s<o;s+=1){const r=t[s];let a=r.getBBox(e);if(a){if(r.isNode()){const l=r.getAngle();l!=null&&l!==0&&(a=a.bbox(l))}n=n==null?a:n.union(a)}}return n}static deepClone(t){const e=[t,...t.getDescendants({deep:!0})];return q.cloneCells(e)}static cloneCells(t){const e=Rl(t),n=e.reduce((s,o)=>(s[o.id]=o.clone(),s),{});return e.forEach(s=>{const o=n[s.id];if(o.isEdge()){const l=o.getSourceCellId(),c=o.getTargetCellId();l&&n[l]&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:n[l].id})),c&&n[c]&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:n[c].id}))}const r=s.getParent();r&&n[r.id]&&o.setParent(n[r.id]);const a=s.getChildren();if(a&&a.length){const l=a.reduce((c,h)=>(n[h.id]&&c.push(n[h.id]),c),[]);l.length>0&&o.setChildren(l)}}),n}static config(t){const{markup:e,propHooks:n,attrHooks:s}=t,o=Y(t,["markup","propHooks","attrHooks"]);e!=null&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):typeof n=="function"?this.propHooks.push(n):Object.values(n).forEach(r=>{typeof r=="function"&&this.propHooks.push(r)})),s&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),s)),this.defaults=ft({},this.defaults,o)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:dt(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((n,s)=>s?F(s,t,n):n,e)}static generateId(t={}){return Lo()}get[Symbol.toStringTag](){return q.toStringTag}constructor(t={}){super();const n=this.constructor.getDefaults(!0),s=ft({},this.preprocess(n),this.preprocess(t));this.id=s.id||q.generateId(t),this.store=new hu(s),this.animationManager=new VC,this.setup(),this.init(),this.postprocess(t)}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,o=this.constructor.applyPropHooks(this,t);return n==null&&e!==!0&&(o.id=q.generateId(t)),o}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:n,previous:s,options:o}=t;this.notify("change:*",{key:e,options:o,current:n,previous:s,cell:this}),this.notify(`change:${e}`,{options:o,current:n,previous:s,cell:this});const r=e;(r==="source"||r==="target")&&this.notify("change:terminal",{type:r,current:n,previous:s,options:o,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this})),this.on("added",({cell:t})=>{const e=this.store.get("animation");yo(e)||e.forEach(n=>{t.animate(...n)})})}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify(`cell:${t}`,e),this.isNode()?n.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return t==null?this.store.get():this.store.get(t,e)}setProp(t,e,n){if(typeof t=="string")this.store.set(t,e,n);else{const s=this.preprocess(t,!0);this.store.set(ft({},this.getProp(),s),e),this.postprocess(t)}return this}removeProp(t,e){return typeof t=="string"||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return t==null?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&(t==="children"?this._children=e?e.map(s=>this.model.getCell(s)).filter(s=>s!=null):null:t==="parent"&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return n[0]==="attrs"&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return t==null?this.getProp():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getPropByPath(t):e==null?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){t==null?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n=e.getMaxZIndex(),s;t.deep?(s=this.getDescendants({deep:!0,breadthFirst:!0}),s.unshift(this)):s=[this],n=n-s.length+1;const o=e.total();let r=e.indexOf(this)!==o-s.length;r||(r=s.some((a,l)=>a.getZIndex()!==n+l)),r&&this.batchUpdate("to-front",()=>{n+=s.length,s.forEach((a,l)=>{a.setZIndex(n+l,t)})})}return this}toBack(t={}){const e=this.model;if(e){let n=e.getMinZIndex(),s;t.deep?(s=this.getDescendants({deep:!0,breadthFirst:!0}),s.unshift(this)):s=[this];let o=e.indexOf(this)!==0;o||(o=s.some((r,a)=>r.getZIndex()!==n+a)),o&&this.batchUpdate("to-back",()=>{n-=s.length,s.forEach((r,a)=>{r.setZIndex(n+a,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){t==null?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");return t==null&&(t=this.constructor.getMarkup()),t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){t==null?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(t==null)this.removeAttrs(e);else{const n=s=>this.store.set("attrs",s,e);if(e.overwrite===!0)n(t);else{const s=this.getAttrs();e.deep===!1?n(Object.assign(Object.assign({},s),t)):n(ft({},s,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const n=this.constructor.getAttrHooks()||{};let s=n[t]||ri.get(t);if(!s){const o=Gn(t);s=n[o]||ri.get(o)}return s||null}getAttrByPath(t){return t==null||t===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,n){return t==null?this.getAttrByPath():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getAttrByPath(t):e==null?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return this.store.get("visible")!==!1}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n=typeof t=="boolean"?t:!this.isVisible(),s=typeof t=="boolean"?e:t;return n?this.show(s):this.hide(s),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(t==null)this.removeData(e);else{const n=s=>this.store.set("data",s,e);if(e.overwrite===!0)n(t);else{const s=this.getData();e.deep===!1?n(typeof t=="object"?Object.assign(Object.assign({},s),t):t):n(ft({},s,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(n=>{var s;return(s=this.model)===null||s===void 0?void 0:s.getCell(n)}).filter(n=>n!=null);return this._children=e,[...e]}return null}hasParent(){return this.parent!=null}isParentOf(t){return t!=null&&t.getParent()===this}isChildOf(t){return t!=null&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(t){return this.children==null?-1:this.children.indexOf(t)}getChildAt(t){return this.children!=null&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();for(;n;)e.push(n),n=t.deep!==!1?n.getParent():null;return e}getDescendants(t={}){if(t.deep!==!1){if(t.breadthFirst){const e=[],n=this.getChildren()||[];for(;n.length>0;){const s=n.shift(),o=s.getChildren();e.push(s),o&&n.push(...o)}return e}{const e=this.getChildren()||[];return e.forEach(n=>{e.push(...n.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(t==null)return!1;if(e.deep!==!1){let n=this.getParent();for(;n;){if(n===t)return!0;n=n.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return t==null?!1:t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return q.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,t!=null?this.store.set("children",t.map(n=>n.id),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(n!=null&&t!=null){const s=this.getChildIndex(t);s!==-1&&(n.splice(s,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return q.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(t!=null&&t!==this){const s=t.getParent(),o=this!==s;let r=e;if(r==null&&(r=this.getChildCount(),o||(r-=1)),s){const l=s.getChildren();if(l){const c=l.indexOf(t);c>=0&&(t.setParent(null,n),l.splice(c,1),s.setChildren(l,n))}}let a=this.children;if(a==null?(a=[],a.push(t)):a.splice(r,0,t),t.setParent(this,n),this.setChildren(a,n),o&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(h=>h.updateParent(n)),c&&c.forEach(h=>h.updateParent(n))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(e!=null){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t);return this.children!=null&&n!=null&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),t.deep!==!1&&this.eachChild(n=>n.remove(t)),this.model&&this.model.removeCell(this,t),this.dispose()}),this}animate(t,e){var n;const s=Ae(e)?{duration:e}:Object.assign({},e),o=new zC(this,t,s),r=new QC(o,s.timeline);return this.animationManager.addAnimation(r),r.id=(n=s.id)!==null&&n!==void 0?n:"",r.play(),r}getAnimations(){return this.animationManager.getAnimations()}translate(t,e,n){return this}scale(t,e,n,s){return this}addTools(t,e,n){const s=Array.isArray(t)?t:[t],o=typeof e=="string"?e:null,r=typeof e=="object"?e:typeof n=="object"?n:{};if(r.reset)return this.setTools({name:o,items:s,local:r.local},r);let a=dt(this.getTools());if(a==null||o==null||a.name===o)return a==null&&(a={}),a.items||(a.items=[]),a.name=o,a.items=[...a.items,...s],this.setTools(Object.assign({},a),r)}setTools(t,e={}){return t==null?this.removeTools():this.store.set("tools",q.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return e==null?!1:t==null?!0:e.name===t}hasTool(t){const e=this.getTools();return e==null?!1:e.items.some(n=>typeof n=="string"?n===t:n.name===t)}removeTool(t,e={}){const n=dt(this.getTools());if(n){let s=!1;const o=n.items.slice(),r=a=>{o.splice(a,1),s=!0};if(typeof t=="number")r(t);else for(let a=o.length-1;a>=0;a-=1){const l=o[a];(typeof l=="string"?l===t:l.name===t)&&r(a)}s&&(n.items=o,this.setTools(n,e))}return this}getBBox(t){return new P}getConnectionPoint(t,e){return new A}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,s=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const p=this.constructor;throw new Error(`Unable to serialize ${s} missing "shape" prop, check the ${s} "${p.name||n.call(p)}"`)}const o=this.constructor,r=t.diff===!0,a=e.attrs||{},l=o.getDefaults(!0),c=r?this.preprocess(l,!0):l,h=c.attrs||{},u={};Object.entries(e).forEach(([p,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!se(m))throw new Error(`Can only serialize ${s} with plain-object props, but got a "${n.call(m)}" type of key "${p}" on ${s} "${this.id}"`);if(p!=="attrs"&&p!=="shape"&&r){const b=c[p];Ce(m,b)&&delete e[p]}}),Object.keys(a).forEach(p=>{const m=a[p],b=h[p];Object.keys(m).forEach(y=>{const C=m[y],w=b?b[y]:null;C!=null&&typeof C=="object"&&!Array.isArray(C)?Object.keys(C).forEach(x=>{const E=C[x];if(b==null||w==null||!bt(w)||!Ce(w[x],E)){u[p]==null&&(u[p]={}),u[p][y]==null&&(u[p][y]={});const S=u[p][y];S[x]=E}}):(b==null||!Ce(w,C))&&(u[p]==null&&(u[p]={}),u[p][y]=C)})});const g=Object.assign(Object.assign({},e),{attrs:yo(u)?void 0:u});g.attrs==null&&delete g.attrs;const f=g;return f.angle===0&&delete f.angle,dt(f)}clone(t={}){if(!t.deep){const n=Object.assign({},this.store.get());t.keepId||delete n.id,delete n.parent,delete n.children;const s=this.constructor;return new s(n)}return q.deepClone(this)[this.id]}findView(t){return t.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const s=this.model;this.startBatch(t,n,s);const o=e();return this.stopBatch(t,n,s),o}dispose(){this.removeFromParent(),this.animationManager.cancelAnimations(),this.store.dispose()}}q.toStringTag="X6.cell",q.defaults={},q.attrHooks={},q.propHooks=[],$([Z()],q.prototype,"dispose",null),q.config({propHooks(i){var{tools:t}=i,e=Y(i,["tools"]);return t&&(e.tools=q.normalizeTools(t)),e}});class UC{constructor(t){this.ports=[],this.groups={},this.init(dt(t))}getPorts(){return this.ports}getGroup(t){return t!=null?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||e.group==null&&t==null)}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),s=t?this.getGroup(t):null,o=s?s.position:null,r=o?o.name:null;let a;if(r!=null){const u=mi.get(r);if(u==null)return mi.onNotFound(r);a=u}else a=Th.left;const l=n.map(u=>u&&u.position&&u.position.args||{}),c=o&&o.args||{};return a(l,e,c).map((u,g)=>{const f=n[g];return{portLayout:u,portId:f.id,portSize:f.size,portAttrs:f.attrs,labelSize:f.label.size,labelLayout:this.getPortLabelLayout(f,A.create(u.position),e)}})}init(t){const{groups:e,items:n}=t;e!=null&&Object.keys(e).forEach(s=>{this.groups[s]=this.parseGroup(e[s])}),Array.isArray(n)&&n.forEach(s=>{this.ports.push(this.parsePort(s))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=ft({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=ft({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return typeof e.zIndex=="number"?e.zIndex:typeof t.zIndex=="number"||t.zIndex==="auto"?t.zIndex:"auto"}createPosition(t,e){return ft({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if(typeof t=="object")return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(typeof t=="object")return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const s=t.label.position.name||"left",o=t.label.position.args||{},r=Es.get(s)||Bh.left;return r?r(e,n,o):null}}let fr,pr;function uu(i,t){return t?fr!=null&&fr.exist(i):pr!=null&&pr.exist(i)}function KC(i){fr=i}function JC(i){pr=i}const du="X6.node";let gu=0;function jC(i){return i?Io(i):(gu+=1,`CustomNode${gu}`)}let It=class Dn extends q{static isNode(t){if(t==null)return!1;if(t instanceof Dn)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===du)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.size=="function"&&typeof n.position=="function"}static define(t){const{constructorName:e,overwrite:n}=t,s=Y(t,["constructorName","overwrite"]),o=Vo(jC(e||s.shape),this);return o.config(s),s.shape&&Dn.registry.register(s.shape,o,n),o}static create(t){const e=t.shape||"rect",n=Dn.registry.get(e);return n?new n(t):Dn.registry.onNotFound(e)}get[Symbol.toStringTag](){return Dn.toStringTag}constructor(t={}){super(t),this.initPorts()}preprocess(t,e){const{x:n,y:s,width:o,height:r}=t,a=Y(t,["x","y","width","height"]);if(n!=null||s!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:n??(l?l.x:0),y:s??(l?l.y:0)})}if(o!=null||r!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:o??(l?l.width:0),height:r??(l?l.height:0)})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,n){return t===void 0?this.getSize():typeof t=="number"?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return typeof t=="object"?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const s=n.direction;if(s){const o=this.getSize();switch(s){case"left":case"right":e=o.height;break;case"top":case"bottom":t=o.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[s];const l=Vt(this.getAngle()||0);n.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let h;a===0?h=c.getBottomLeft():a===1?h=c.getCorner():a===2?h=c.getTopRight():h=c.getOrigin();const u=h.clone().rotate(-l,c.getCenter()),g=Math.sqrt(t*t+e*e)/2;let f=a*Math.PI/2;f+=Math.atan(a%2===0?e/t:t/e),f-=Dt(l);const m=A.fromPolar(g,f,u).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(m.x,m.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,s={}){const o=this.getBBox().scale(t,e,n??void 0);return this.startBatch("scale",s),this.setPosition(o.x,o.y,s),this.resize(o.width,o.height,s),this.stopBatch("scale"),this}position(t,e,n){return typeof t=="number"?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const n=this.getParent();if(n!=null&&n.isNode()){const s=this.getPosition(),o=n.getPosition();return{x:s.x-o.x,y:s.y-o.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let s,o,r;if(typeof t=="object"?(s=t.x,o=t.y,r=e||{}):(s=t,o=e,r=n||{}),r.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();s+=l.x,o+=l.y}}if(r.deep){const a=this.getPosition();this.translate(s-a.x,o-a.y,r)}else this.store.set("position",{x:s,y:o},r);return this}translate(t=0,e=0,n={}){if(t===0&&e===0)return this;n.translateBy=n.translateBy||this.id;const s=this.getPosition();if(n.restrict!=null&&n.translateBy===this.id){const r=this.getBBox({deep:!0}),a=n.restrict,l=s.x-r.x,c=s.y-r.y,h=Math.max(a.x+l,Math.min(a.x+a.width+l-r.width,s.x+t)),u=Math.max(a.y+c,Math.min(a.y+a.height+c-r.height,s.y+e));t=h-s.x,e=u-s.y}const o={x:s.x+t,y:s.y+e};if(n.tx=t,n.ty=e,n.transition){let r=typeof n.transition!="object"?{}:Object.assign({},n.transition);r=Object.assign({duration:100,fill:"forwards"},r),this.animate({"position/x":o.x,"position/y":o.y},r),this.eachChild(a=>{var l;((l=n.exclude)===null||l===void 0?void 0:l.includes(a))||a.translate(t,e,n)})}else this.startBatch("translate",n),this.store.set("position",o,n),this.eachChild(r=>{var a;((a=n.exclude)===null||a===void 0?void 0:a.includes(r))||r.translate(t,e,n)}),this.stopBatch("translate",n);return this}angle(t,e){return t==null?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const s=this.getSize(),o=this.getPosition(),r=this.getBBox().getCenter();r.rotate(n-t,e.center);const a=r.x-s.width/2-o.x,l=r.y-s.height/2-o.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(o.x+a,o.y+l,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),q.getCellsBBox(e)}return P.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),s=n.getCenter(),o=t.getTerminal(e);if(o==null)return s;const r=o.port;if(!r||!this.hasPort(r))return s;const a=this.getPort(r);if(!a||!a.group)return s;const c=this.getPortsPosition(a.group)[r].position,h=A.create(c).translate(n.getOrigin()),u=this.getAngle();return u&&h.rotate(-u,s),h}fit(t={}){const n=(this.getChildren()||[]).filter(c=>c.isNode());if(n.length===0)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach(c=>{c.fit(t)});let{x:s,y:o,width:r,height:a}=q.getCellsBBox(n);const l=re(t.padding);return s-=l.left,o-=l.top,r+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:s,y:o},size:{width:r,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Lt.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Lt.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Lt.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Lt.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Lt.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Lt.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return t.items==null&&(t.items=[]),t}getPorts(){return dt(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return dt(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return this.getPortIndex(t)!==-1}getPortIndex(t){const e=typeof t=="string"?t:t.id;return e!=null?this.ports.items.findIndex(n=>n.id===e):-1}getPortsPosition(t){const e=this.getSize();return this.port.getPortsLayoutByGroup(t,new P(0,0,e.width,e.height)).reduce((s,o)=>{const r=o.portLayout;return s[o.portId]={position:Object.assign({},r.position),angle:r.angle||0},s},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,s){if(typeof e=="string"||Array.isArray(e)){const a=this.prefixPortPath(t,e),l=n;return this.setPropByPath(a,l,s)}const o=this.prefixPortPath(t),r=e;return this.setPropByPath(o,r,n)}removePortProp(t,e,n){return typeof e=="string"||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,s){return e==null?this.getPortProp(t):typeof e=="string"||Array.isArray(e)?arguments.length===2?this.getPortProp(t,e):n==null?this.removePortProp(t,e,s):this.setPortProp(t,e,n,s):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(n===-1)throw new Error(`Unable to find port with id: "${t}"`);return e==null||e===""?["ports","items",`${n}`]:Array.isArray(e)?["ports","items",`${n}`,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const s=[...this.ports.items];return s.splice(t,0,e),this.setPropByPath("ports/items",s,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const o=[...this.ports.items].filter(r=>!t.some(a=>{const l=typeof a=="string"?a:a.id;return r.id===l}));this.setPropByPath("ports/items",o,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(r=>{r.id&&(e[r.id]=!0)});const n={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(r=>{r.id&&!e[r.id]&&(n[r.id]=!0)});const o=this.model;o&&!yo(n)&&(o.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&n[c]&&l.remove()}),o.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&n[c]&&l.remove()}))}validatePorts(){const t={},e=[];return this.ports.items.forEach(n=>{typeof n!="object"&&e.push(`Invalid port ${n}.`),n.id==null&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0}),e}generatePortId(){return Lo()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new UC(this.ports);const n=this.port.getPorts(),s=e?n.filter(r=>e.find(a=>a.id===r.id)?null:r):[...n],o=e?e.filter(r=>n.find(a=>a.id===r.id)?null:r):[];s.length>0&&this.notify("ports:added",{added:s,cell:this,node:this}),o.length>0&&this.notify("ports:removed",{removed:o,cell:this,node:this})}};It.toStringTag=du,It.registry=yt.create({type:"node",process(i,t){if(uu(i,!0))throw new Error(`Node with name '${i}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:i}),t;let e=It;const{inherit:n}=t,s=Y(t,["inherit"]);if(n)if(typeof n=="string"){const r=this.get(n);r==null?this.onNotFound(n,"inherited"):e=r}else e=n;s.constructorName==null&&(s.constructorName=i);const o=e.define.call(e,s);return o.config({shape:i}),o}}),It.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},It.config({propHooks(i){var{ports:t}=i,e=Y(i,["ports"]);return t&&(e.ports=Array.isArray(t)?{items:t}:t),e}}),JC(It.registry);const fu="X6.edge",pu="basic.edge";let mu=0;function GC(i){return i?Io(i):(mu+=1,`CustomEdge${mu}`)}let xt=class Ln extends q{static parseStringLabel(t){return{attrs:{label:{text:t}}}}static isEdge(t){if(t==null)return!1;if(t instanceof Ln)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===fu)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.disconnect=="function"&&typeof n.getSource=="function"&&typeof n.getTarget=="function"}static equalTerminals(t,e){const n=t,s=e;return n.cell===s.cell?n.port===s.port||n.port==null&&s.port==null:!1}static define(t){const{constructorName:e,overwrite:n}=t,s=Y(t,["constructorName","overwrite"]),o=Vo(GC(e||s.shape),this);return o.config(s),s.shape&&Ln.registry.register(s.shape,o,n),o}static create(t){const e=t.shape||"edge",n=Ln.registry.get(e);return n?new n(t):Ln.registry.onNotFound(e)}get[Symbol.toStringTag](){return Ln.toStringTag}constructor(t={}){super(t)}preprocess(t,e){const{source:n,sourceCell:s,sourcePort:o,sourcePoint:r,target:a,targetCell:l,targetPort:c,targetPoint:h}=t,g=Y(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),f=p=>typeof p=="string"||typeof p=="number";if(n!=null)if(q.isCell(n))g.source={cell:n.id};else if(f(n))g.source={cell:n};else if(A.isPoint(n))g.source=n.toJSON();else if(Array.isArray(n))g.source={x:n[0],y:n[1]};else{const p=n.cell;q.isCell(p)?g.source=Object.assign(Object.assign({},n),{cell:p.id}):g.source=n}if(s!=null||o!=null){let p=g.source;if(s!=null){const m=f(s)?s:s.id;p?p.cell=m:p=g.source={cell:m}}o!=null&&p&&(p.port=o)}else r!=null&&(g.source=A.create(r).toJSON());if(a!=null)if(q.isCell(a))g.target={cell:a.id};else if(f(a))g.target={cell:a};else if(A.isPoint(a))g.target=a.toJSON();else if(Array.isArray(a))g.target={x:a[0],y:a[1]};else{const p=a.cell;q.isCell(p)?g.target=Object.assign(Object.assign({},a),{cell:p.id}):g.target=a}if(l!=null||c!=null){let p=g.target;if(l!=null){const m=f(l)?l:l.id;p?p.cell=m:p=g.target={cell:m}}c!=null&&p&&(p.port=c)}else h!=null&&(g.target=A.create(h).toJSON());return super.preprocess(g,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,s={}){if(q.isCell(e))return this.store.set(t,ft({},n,{cell:e.id}),s),this;const o=e;return A.isPoint(e)||o.x!=null&&o.y!=null?(this.store.set(t,ft({},n,{x:o.x,y:o.y}),s),this):(this.store.set(t,dt(e),s),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(A.isPointLike(e))return A.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new A}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e=t==="source"?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};for(;e&&e.isEdge();){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){t==null?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return typeof t=="object"?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){t==null?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return typeof t=="object"?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return dt(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const s=this.getLabels(),o=s.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),s.splice(r,0,this.parseLabel(t)),this.setLabels(s,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return t!=null&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const s=this.getLabels();s[t]=this.parseLabel(e),this.setLabels(s,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),s=t!=null&&Number.isFinite(t)?t:-1,o=n.splice(s,1);return this.setLabels(n,e),o.length?o[0]:null}parseLabel(t){return typeof t=="string"?this.constructor.parseStringLabel(t):t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>o===r||Ce(o,r))?null:o):e?[...e]:[],s=t&&e?t.filter(o=>e.find(r=>o===r||Ce(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),s.length>0&&this.notify("labels:removed",{removed:s,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map(s=>A.toJSON(s)),e),this}insertVertex(t,e,n={}){const s=this.getVertices(),o=s.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),s.splice(r,0,A.toJSON(t)),this.setVertices(s,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){return t!=null&&Number.isFinite(t)?this.getVertices()[t]:null}setVertexAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const s=this.getVertices();s[t]=e,this.setVertices(s,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),s=t!=null&&Number.isFinite(t)?t:-1;return n.splice(s,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>A.equals(o,r))?null:o):e?[...e]:[],s=t&&e?t.filter(o=>e.find(r=>A.equals(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),s.length>0&&this.notify("vertexs:removed",{removed:s,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Lt.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints(s=>({x:(s.x||0)+t,y:(s.y||0)+e}),n)}scale(t,e,n,s={}){return this.applyToPoints(o=>A.create(o).scale(t,e,n).toJSON(),s)}applyToPoints(t,e={}){const n={},s=this.getSource(),o=this.getTarget();A.isPointLike(s)&&(n.source=t(s)),A.isPointLike(o)&&(n.target=t(o));const r=this.getVertices();return r.length>0&&(n.vertices=r.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(e=>A.create(e)),this.getTargetPoint()];return new St(t)}updateParent(t){let e=null;const n=this.getSourceCell(),s=this.getTargetCell(),o=this.getParent();return n&&s&&(n===s||n.isDescendantOf(s)?e=s:s.isDescendantOf(n)?e=n:e=q.getCommonAncestor(n,s)),o&&e&&e.id!==o.id&&o.unembed(this,t),e&&(!o||o.id!==e.id)&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),s=e.cell,o=n.cell;if(!s||!o)return!1;let r=s===o;if(!r&&t.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(r=a.isAncestorOf(l,t)||l.isAncestorOf(a,t))}return r}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>e!=null);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}};xt.toStringTag=fu,xt.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}},xt.registry=yt.create({type:"edge",process(i,t){if(uu(i,!1))throw new Error(`Edge with name '${i}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:i}),t;let e=xt;const{inherit:n="edge"}=t,s=Y(t,["inherit"]);if(typeof n=="string"){const r=this.get(n||"edge");r==null&&n?this.onNotFound(n,"inherited"):e=r}else e=n;s.constructorName==null&&(s.constructorName=i);const o=e.define.call(e,s);return o.config({shape:i}),o}}),xt.defaults={},KC(xt.registry),xt.config({shape:pu,propHooks(i){const{label:t,vertices:e}=i,n=Y(i,["label","vertices"]);if(t){n.labels==null&&(n.labels=[]);const s=typeof t=="string"?xt.parseStringLabel(t):t;n.labels.push(s)}return e&&Array.isArray(e)&&(n.vertices=e.map(s=>A.create(s).toJSON())),n}}),xt.registry.register(pu,xt);class mr extends Ft{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,n){let s,o;typeof e=="number"?(s=e,o=Object.assign({merge:!1},n)):(s=this.length,o=Object.assign({merge:!1},e)),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);const r=Array.isArray(t)?t:[t],a=this.comparator&&typeof e!="number"&&o.sort!==!1,l=this.comparator||null;let c=!1;const h=[],u=[];return r.forEach(g=>{const f=this.get(g);f?o.merge&&!g.isSameStore(f)&&(f.setProp(g.getProp(),n),u.push(f),a&&!c&&(l==null||typeof l=="function"?c=f.hasChanged():typeof l=="string"?c=f.hasChanged(l):c=l.some(p=>f.hasChanged(p)))):(h.push(g),this.reference(g))}),h.length&&(a&&(c=!0),this.cells.splice(s,0,...h),this.length=this.cells.length),c&&this.sort({silent:!0}),o.silent||(h.forEach((g,f)=>{const p={cell:g,index:s+f,options:o};this.trigger("added",p),o.dryrun||g.notify("added",Object.assign({},p))}),c&&this.trigger("sorted"),(h.length||u.length)&&this.trigger("updated",{added:h,merged:u,removed:[],options:o})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],s=this.removeCells(n,e);return!e.silent&&s.length>0&&this.trigger("updated",{options:e,removed:s,added:[],merged:[]}),Array.isArray(t)?s:s[0]}removeCells(t,e){const n=[];for(let s=0;s<t.length;s+=1){const o=this.get(t[s]);if(o==null)continue;const r=this.cells.indexOf(o);this.cells.splice(r,1),this.length-=1,delete this.map[o.id],n.push(o),this.unreference(o),e.silent||(this.trigger("removed",{cell:o,index:r,options:e}),e.dryrun||o.notify("removed",{cell:o,index:r,options:e})),e.dryrun||o.remove()}return n}reset(t,e={}){const n=this.cells.slice();if(e.diff||(n.forEach(s=>{this.unreference(s),s.remove()}),this.clean()),this.add(t,Object.assign({silent:!0},e)),!e.silent){const s=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:s});const o=[],r=[];s.forEach(a=>{n.some(c=>c.id===a.id)||o.push(a)}),n.forEach(a=>{s.some(c=>c.id===a.id)||r.push(a)}),this.trigger("updated",{options:e,added:o,removed:r,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return e?this.remove(e,t):null}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return e?this.remove(e,t):null}get(t){if(t==null)return null;const e=typeof t=="string"||typeof t=="number"?t:t.id;return this.map[e]||null}has(t){return this.get(t)!=null}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return this.comparator!=null&&(this.cells=wo(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger(`cell:${t}`,e),n&&(n.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}$([Z()],mr.prototype,"dispose",null);const YC="X6.Model";class Ht extends Ft{static isModel(t){if(t==null)return!1;if(t instanceof Ht)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===YC)&&typeof n.addNode=="function"&&typeof n.addEdge=="function"&&n.collection!=null}static toJSON(t,e={}){return{cells:t.map(n=>n.toJSON(e))}}static fromJSON(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach(n=>{n.shape==null&&(n.shape="rect"),e.push(n)}),t.edges&&t.edges.forEach(n=>{n.shape==null&&(n.shape="edge"),e.push(n)})),e.map(n=>{const s=n.shape;if(s){if(It.registry.exist(s))return It.create(n);if(xt.registry.exist(s))return xt.create(n)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new mr(t),this.setup()}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&(t==="sorted"||t==="reseted"||t==="updated"?n.trigger(`model:${t}`,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",e=>this.notify("updated",e)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:e})=>{this.onCellAdded(e)}),t.on("removed",e=>{const n=e.cell;this.onCellRemoved(n,e.options),this.notify("cell:removed",e),n.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:n}))}),t.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),t.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),t.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const s=t.getSource(),o=t.getTarget();if(s!=null&&s.cell){const r=this.outgoings[s.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.outgoings[s.cell])}if(o!=null&&o.cell){const r=this.incomings[o.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.incomings[o.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(e=>{this.onCellAdded(e)})}onEdgeTerminalChanged(t,e){const n=e==="source"?this.outgoings:this.incomings,s=t.previous(e);if(s!=null&&s.cell){const r=q.isCell(s.cell)?s.cell.id:s.cell,a=n[r],l=a?a.indexOf(t.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete n[r])}const o=t.getTerminal(e);if(o!=null&&o.cell){const r=q.isCell(o.cell)?o.cell.id:o.cell,a=n[r]||[];a.indexOf(t.id)===-1&&a.push(t.id),n[r]=a}}prepareCell(t,e){return!t.model&&(!e||!e.dryrun)&&(t.model=this),t.zIndex==null&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(n=>this.prepareCell(n,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(n=>this.prepareCell(n,{options:e})),this}clear(t={}){const e=this.getCells();if(e.length===0)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const s=e.sort((o,r)=>{const a=o.isEdge()?1:2,l=r.isEdge()?1:2;return a-l});for(;s.length>0;){const o=s.shift();o&&o.remove(n)}},n),this}addNode(t,e={}){const n=It.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}updateNode(t,e={}){const n=this.createNode(t),s=n.getProp();return n.dispose(),this.updateCell(s,e)}createNode(t){return It.create(t)}addEdge(t,e={}){const n=xt.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return xt.create(t)}updateEdge(t,e={}){const n=this.createEdge(t),s=n.getProp();return n.dispose(),this.updateCell(s,e)}addCell(t,e={}){return 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(n=>this.addCell(n,e)),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(n===0)return this;const s=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},s),{cells:t})),t.forEach(o=>{this.addCell(o,s),s.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},s),{cells:t})),this}updateCell(t,e={}){const n=t.id&&this.getCell(t.id);return n?this.batchUpdate("update",()=>(Object.entries(t).forEach(([s,o])=>{n.setProp(s,o,e)}),!0),t):!1}removeCell(t,e={}){const n=typeof t=="string"?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){if(t.id===e)return;this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});return this.addCell(n),this.getConnectedEdges(t).forEach(o=>{const r=o.getSourceCell(),a=o.getTargetCell();r===t&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:e})),a===t&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(n=>this.removeCell(n,e))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach(s=>{s.remove(e)}),n}disconnectConnectedEdges(t,e={}){const n=typeof t=="string"?t:t.id;this.getConnectedEdges(t).forEach(s=>{const o=s.getSourceCellId(),r=s.getTargetCellId();o===n&&s.setSource({x:0,y:0},e),r===n&&s.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(e=>this.getCell(e)).filter(e=>e!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e=typeof t=="string"?t:t.id,n=this.outgoings[e];return n?n.map(s=>this.getCell(s)).filter(s=>s==null?void 0:s.isEdge()):null}getIncomingEdges(t){const e=typeof t=="string"?t:t.id,n=this.incomings[e];return n?n.map(s=>this.getCell(s)).filter(s=>s==null?void 0:s.isEdge()):null}getConnectedEdges(t,e={}){const n=[],s=typeof t=="string"?this.getCell(t):t;if(s==null)return n;const o={},r=e.indirect;let a=e.incoming,l=e.outgoing;a==null&&l==null&&(a=l=!0);const c=(h,u)=>{const g=u?this.getOutgoingEdges(h):this.getIncomingEdges(h);if(g!=null&&g.forEach(f=>{o[f.id]||(n.push(f),o[f.id]=!0,r&&(a&&c(f,!1),l&&c(f,!0)))}),r&&h.isEdge()){const f=u?h.getTargetCell():h.getSourceCell();f!=null&&f.isEdge()&&(o[f.id]||(n.push(f),c(f,u)))}};if(l&&c(s,!0),a&&c(s,!1),e.deep){const h=s.getDescendants({deep:!0}),u={};h.forEach(f=>{f.isNode()&&(u[f.id]=!0)});const g=(f,p)=>{const m=p?this.getOutgoingEdges(f.id):this.getIncomingEdges(f.id);m!=null&&m.forEach(b=>{if(!o[b.id]){const y=b.getSourceCell(),C=b.getTargetCell();if(!e.enclosed&&y&&u[y.id]&&C&&u[C.id])return;n.push(b),o[b.id]=!0}})};h.forEach(f=>{f.isEdge()||(l&&g(f,!0),a&&g(f,!1))})}return n}isBoundary(t,e){const n=typeof t=="string"?this.getCell(t):t,s=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return s==null||s.length===0}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,t)){const s=this.getCell(n);s&&e.push(s)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,s=e.outgoing;n==null&&s==null&&(n=s=!0);const r=this.getConnectedEdges(t,e).reduce((a,l)=>{const c=l.hasLoop(e),h=l.getSourceCell(),u=l.getTargetCell();return n&&h&&h.isNode()&&!a[h.id]&&(c||h!==t&&(!e.deep||!h.isDescendantOf(t)))&&(a[h.id]=h),s&&u&&u.isNode()&&!a[u.id]&&(c||u!==t&&(!e.deep||!u.isDescendantOf(t)))&&(a[u.id]=u),a},{});if(t.isEdge()){if(n){const a=t.getSourceCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}if(s){const a=t.getTargetCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}}return Object.keys(r).map(a=>r[a])}isNeighbor(t,e,n={}){let s=n.incoming,o=n.outgoing;return s==null&&o==null&&(s=o=!0),this.getConnectedEdges(t,n).some(r=>{const a=r.getSourceCell(),l=r.getTargetCell();return!!(s&&a&&a.id===e.id||o&&l&&l.id===e.id)})}getSuccessors(t,e={}){const n=[];return this.search(t,(s,o)=>{s!==t&&this.matchDistance(o,e.distance)&&n.push(s)},Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let s=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return s=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),s}getPredecessors(t,e={}){const n=[];return this.search(t,(s,o)=>{s!==t&&this.matchDistance(o,e.distance)&&n.push(s)},Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let s=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return s=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),s}matchDistance(t,e){return e==null?!0:typeof e=="function"?e(t):Array.isArray(e)&&e.includes(t)?!0:t===e}getCommonAncestor(...t){const e=[];return t.forEach(n=>{n&&(Array.isArray(n)?e.push(...n):e.push(n))}),q.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],s={},o=[],r=[],a=l=>{s[l.id]||(n.push(l),s[l.id]=l,l.isEdge()&&r.push(l),l.isNode()&&o.push(l))};return t.forEach(l=>{a(l),e.deep&&l.getDescendants({deep:!0}).forEach(h=>{a(h)})}),r.forEach(l=>{const c=l.getSourceCell(),h=l.getTargetCell();c&&!s[c.id]&&(n.push(c),s[c.id]=c,c.isNode()&&o.push(c)),h&&!s[h.id]&&(n.push(h),s[h.id]=h,h.isNode()&&o.push(h))}),o.forEach(l=>{this.getConnectedEdges(l,e).forEach(h=>{const u=h.getSourceCell(),g=h.getTargetCell();!s[h.id]&&u&&s[u.id]&&g&&s[g.id]&&(n.push(h),s[h.id]=h)})}),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return q.cloneCells(t)}getNodesFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e||0}:t;return this.getNodes().filter(s=>s.getBBox().containsPoint(n))}getNodesInArea(t,e,n,s,o){const r=typeof t=="number"?new P(t,e,n,s):P.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getNodes().filter(c=>{const h=c.angle(),u=c.getBBox().bbox(h);return l?r.containsRect(u):r.isIntersectWithRect(u)})}getEdgesInArea(t,e,n,s,o){const r=typeof t=="number"?new P(t,e,n,s):P.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getEdges().filter(c=>{const h=c.getBBox();return h.width===0?h.inflate(1,0):h.height===0&&h.inflate(0,1),l?r.containsRect(h):r.isIntersectWithRect(h)})}getNodesUnderNode(t,e={}){const n=t.getBBox();return(e.by==null||e.by==="bbox"?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by])).filter(o=>t.id!==o.id&&!o.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return q.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const s=[],o={},r={};for(s.push(t),r[t.id]=0;s.length>0;){const a=s.shift();if(a==null||o[a.id]||(o[a.id]=!0,F(e,this,a,r[a.id])===!1))continue;this.getNeighbors(a,n).forEach(c=>{r[c.id]=r[a.id]+1,s.push(c)})}}depthFirstSearch(t,e,n={}){const s=[],o={},r={};for(s.push(t),r[t.id]=0;s.length>0;){const a=s.pop();if(a==null||o[a.id]||(o[a.id]=!0,F(e,this,a,r[a.id])===!1))continue;const l=this.getNeighbors(a,n),c=s.length;l.forEach(h=>{r[h.id]=r[a.id]+1,s.splice(c,0,h)})}}getShortestPath(t,e,n={}){const s={};this.getEdges().forEach(c=>{const h=c.getSourceCellId(),u=c.getTargetCellId();h&&u&&(s[h]||(s[h]=[]),s[u]||(s[u]=[]),s[h].push(u),n.directed||s[u].push(h))});const o=typeof t=="string"?t:t.id,r=J6(s,o,n.weight),a=[];let l=typeof e=="string"?e:e.id;for(r[l]&&a.push(l);r[l];){const c=r[l];a.unshift(c),l=c}return a}translate(t,e,n){return this.getCells().filter(s=>!s.hasParent()).forEach(s=>{s.translate(t,e,n)}),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,s={}){const o=this.getCellsBBox(n);if(o){const r=Math.max(t/o.width,0),a=Math.max(e/o.height,0),l=o.getOrigin();n.forEach(c=>{c.scale(r,a,l,s)})}return this}toJSON(t={}){return Ht.toJSON(this.getCells(),t)}parseJSON(t){return Ht.fromJSON(t)}fromJSON(t,e={}){let n=[];if(!e.diff)n=this.parseJSON(t);else{const s=t,{nodes:o=[],edges:r=[]}=s,a=Y(s,["nodes","edges"]),l=o.filter(h=>!this.nodes[h.id])||[],c=r.filter(h=>!this.edges[h.id])||[];n=this.parseJSON(Object.assign(Object.assign({},a),{nodes:l,edges:c}))}return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const s=e();return this.stopBatch(t,n),s}hasActiveBatch(t=Object.keys(this.batches)){return(Array.isArray(t)?t:[t]).some(n=>this.batches[n]>0)}dispose(){this.collection.dispose()}}$([Z()],Ht.prototype,"dispose",null);const bu={fill:"#ffffff",stroke:"#333333",strokeWidth:2},HC={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"};let Mi=class extends It{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return t==null?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};Mi.config({attrs:{text:Object.assign({},HC)},propHooks(i){const{label:t}=i,e=Y(i,["label"]);return t&&bn(e,"attrs/text/text",t),e},visible:!0});function _C(i,t="body"){return[{tagName:i,selector:t},{tagName:"text",selector:"label"}]}function WC(i="xlink:href"){return e=>{const{imageUrl:n,imageWidth:s,imageHeight:o}=e,r=Y(e,["imageUrl","imageWidth","imageHeight"]);if(n!=null||s!=null||o!=null){const a=()=>{if(r.attrs){const l=r.attrs.image;n!=null&&(l[i]=n),s!=null&&(l.width=s),o!=null&&(l.height=o),r.attrs.image=l}};r.attrs?(r.attrs.image==null&&(r.attrs.image={}),a()):(r.attrs={image:{}},a())}return r}}function Mn(i,t,e={}){const n={constructorName:i,markup:_C(i,e.selector),attrs:{[i]:Object.assign({},bu)}};return(e.parent||Mi).define(ft(n,t,{shape:i}))}function yu(i){return typeof i=="string"?i:i.map(t=>Array.isArray(t)?t.join(","):A.isPointLike(t)?`${t.x}, ${t.y}`:"").join(" ")}Mn("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const qC=xt.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"}}});Mn("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});class Zt extends vn{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(t){super(),this.graph=t,this.init()}init(){}}const wu={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onDragEnd"},Qe=1<<30,XC=1<<29;class te extends Tt{constructor(){super(...arguments),this.portsCache={}}static isNodeView(t){if(t==null)return!1;if(t instanceof te)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Cu)&&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=="function"}get[Symbol.toStringTag](){return Cu}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const n=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?lt(e,n):Q(e,n)}else{const n=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(n):this.addClass(n)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(),"update"),n=this.handleAction(n,"update",()=>this.update(),"ports"),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>{this.getFlag("tools")===t?this.renderTools():this.updateTools(e)})),n}update(t){this.cleanCache(),this.removePorts();const e=this.cell,n=e.getSize(),s=e.getAttrs();this.updateAttrs(this.container,s,{attrs:t===s?null:t,rootBBox:new P(0,0,n.width,n.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.appendChild(e.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this.notify("view:render",{view:this}),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const s=n.portContentElement,o=n.portContentSelectors||{};return this.findOne(e,s,o)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(t=>{qt(t.portElement)})}renderPorts(){const t=this.container,e=[];t.childNodes.forEach(r=>{e.push(r)});const n=this.cell.getParsedPorts(),s=Tl(n,"zIndex"),o="auto";s[o]&&s[o].forEach(r=>{const a=this.getPortElement(r);t.append(a),e.push(a)}),Object.keys(s).forEach(r=>{if(r!==o){const a=parseInt(r,10);this.appendPorts(s[r],a,e)}}),this.updatePorts()}appendPorts(t,e,n){const s=t.map(o=>this.getPortElement(o));n[e]||e<0?qn(n[Math.max(e,0)],s):Ot(this.container,s)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Lt.renderMarkup(this.cell.getPortContainerMarkup());const n=e.elem;if(n==null)throw new Error("Invalid port container markup.");e=Lt.renderMarkup(this.getPortMarkup(t));const s=e.elem,o=e.selectors;if(s==null)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},s);let r="x6-port";t.group&&(r+=` x6-port-${t.group}`),Q(n,r),Q(n,"x6-port"),Q(s,"x6-port-body"),n.appendChild(s);let a=o,l,c;if(this.existPortLabel(t)){if(e=Lt.renderMarkup(this.getPortLabelMarkup(t.label)),l=e.elem,c=e.selectors,l==null)throw new Error("Invalid port label markup.");if(o&&c){for(const u in c)if(o[u]&&u!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},o),c)}Q(l,"x6-port-label"),n.appendChild(l)}return this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:s,portContentSelectors:o},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:s,contentSelectors:o}),n}updatePorts(){const t=this.cell.getParsedGroups(),e=Object.keys(t);e.length===0?this.updatePortGroup():e.forEach(n=>{this.updatePortGroup(n)})}updatePortGroup(t){const e=P.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let s=0,o=n.length;s<o;s+=1){const r=n[s],a=r.portId,l=this.portsCache[a]||{},c=r.portLayout;if(this.applyPortTransform(l.portElement,c),r.portAttrs!=null){const u={selectors:l.portSelectors||{}};r.portSize&&(u.rootBBox=P.fromSize(r.portSize)),this.updateAttrs(l.portElement,r.portAttrs,u)}const h=r.labelLayout;if(h&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,h,-(c.angle||0)),h.attrs)){const u={selectors:l.portLabelSelectors||{}};r.labelSize&&(u.rootBBox=P.fromSize(r.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,u)}}}applyPortTransform(t,e,n=0){const s=e.angle,o=e.position,r=Bt().rotate(n).translate(o.x||0,o.y||0).rotate(s||0);yn(t,r,{absolute:!0})}getPortMarkup(t){return t.markup||this.cell.portMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup}existPortLabel(t){return t.attrs&&t.attrs.text}getEventArgs(t,e,n){const s=this,o=s.cell,r=o;return e==null||n==null?{e:t,view:s,node:o,cell:r}:{e:t,x:e,y:n,view:s,node:o,cell:r}}getPortEventArgs(t,e,n){const s=this,o=s.cell,r=o;return n?{e:t,x:n.x,y:n.y,view:s,node:o,cell:r,port:e}:{e:t,view:s,node:o,cell:r,port:e}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}notifyPortEvent(t,e,n){const s=this.findAttr("port",e.target);if(s){const o=e.type;t==="node:port:mouseenter"?e.type="mouseenter":t==="node:port:mouseleave"&&(e.type="mouseleave"),this.notify(t,this.getPortEventArgs(e,s,n)),e.type=o}}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:click",t,{x:e,y:n})}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:dblclick",t,{x:e,y:n})}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:contextmenu",t,{x:e,y:n})}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.notifyPortEvent("node:port:mousedown",t,{x:e,y:n}),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const s=this.getEventData(t),o=s.action;if(o==="magnet")this.dragMagnet(t,e,n);else{if(o==="move"){const a=s.targetView||this;a.dragNode(t,e,n),a.notify("node:moving",{e:t,x:e,y:n,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(t,e,n),this.notifyPortEvent("node:port:mousemove",t,{x:e,y:n})}this.setEventData(t,s)}onMouseUp(t,e,n){const s=this.getEventData(t),o=s.action;o==="magnet"?this.stopMagnetDragging(t,e,n):(this.notifyMouseUp(t,e,n),this.notifyPortEvent("node:port:mouseup",t,{x:e,y:n}),o==="move"&&(s.targetView||this).stopNodeDragging(t,e,n));const r=s.targetMagnet;r&&this.onMagnetClick(t,r,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseenter",t),this.notifyPortEvent("node:port:mouseover",t)}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseleave",t),this.notifyPortEvent("node:port:mouseout",t)}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){super.onMouseWheel(t,e,n,s),this.notify("node:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,s){const o=this.graph;o.view.getMouseMovedCount(t)>o.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetDblClick(t,e,n,s){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetContextMenu(t,e,n,s){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetMouseDown(t,e,n,s){this.startMagnetDragging(t,n,s)}onCustomEvent(t,e,n,s){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),super.onCustomEvent(t,e,n,s)}prepareEmbedding(t){const e=this.graph,s=this.getEventData(t).cell||this.cell,o=e.findViewByCell(s),r=e.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:s,view:o,cell:s,x:r.x,y:r.y,currentParent:s.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,s=e.graph||this.graph,o=s.options.embedding,r=o.findParent;let a=typeof r=="function"?F(r,s,{view:this,node:this.cell}).filter(g=>q.isCell(g)&&this.cell.id!==g.id&&!g.isDescendantOf(this.cell)):s.model.getNodesUnderNode(n,{by:r});if(o.frontOnly&&a.length>0){const g=Tl(a,"zIndex"),f=Db(Object.keys(g).map(p=>parseInt(p,10)));f&&(a=g[f])}a=a.filter(g=>g.visible);let l=null;const c=e.candidateEmbedView,h=o.validate;for(let g=a.length-1;g>=0;g-=1){const f=a[g];if(c&&c.cell.id===f.id){l=c;break}else{const p=f.findView(s);if(h&&F(h,s,{child:this.cell,parent:p.cell,childView:this,parentView:p})){l=p;break}}}this.clearEmbedding(e),l&&l.highlight(null,{type:"embedding"}),e.candidateEmbedView=l;const u=s.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:s.findViewByCell(n),x:u.x,y:u.y,currentParent:n.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const n=e.cell||this.cell,s=e.graph||this.graph,o=s.findViewByCell(n),r=n.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,(r==null||r.id!==a.cell.id)&&a.cell.insertChild(n,void 0,{ui:!0})):r&&r.unembed(n,{ui:!0}),s.model.getConnectedEdges(n,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),o&&a){const l=s.snapToGrid(t.clientX,t.clientY);o.notify("node:embedded",{e:t,cell:n,x:l.x,y:l.y,node:n,view:s.findViewByCell(n),previousParent:r,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.findViewByCell(t)}return null}validateMagnet(t,e,n){if(e.getAttribute("magnet")!=="passive"){const s=this.graph.options.connecting.validateMagnet;return s?F(s,this.graph,{e:n,magnet:e,view:t,cell:t.cell}):!0}return!1}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const s=t.currentTarget,o=this.graph;this.setEventData(t,{targetMagnet:s}),this.validateMagnet(this,s,t)?(o.options.magnetThreshold<=0&&this.startConnectting(t,s,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,n),o.view.delegateDragEvents(t,this)}startConnectting(t,e,n,s){this.graph.model.startBatch("add-edge");const o=this.createEdgeFromMagnet(e,n,s);o.setEventData(t,o.prepareArrowheadDragging("target",{x:n,y:s,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:o}),o.notifyMouseDown(t,n,s)}getDefaultEdge(t,e){let n;const s=this.graph.options.connecting.createEdge;return s&&(n=F(s,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),n}createEdgeFromMagnet(t,e,n){const s=this.graph,o=s.model,r=this.getDefaultEdge(this,t);return r.setSource(Object.assign(Object.assign({},r.getSource()),this.getEdgeTerminal(t,e,n,r,"source"))),r.setTarget(Object.assign(Object.assign({},r.getTarget()),{x:e,y:n})),r.addTo(o,{async:!1,ui:!0}),r.findView(s)}dragMagnet(t,e,n){const s=this.getEventData(t),o=s.edgeView;if(o)o.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const r=this.graph,a=r.options.magnetThreshold,l=this.getEventTarget(t),c=s.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(r.view.getMouseMovedCount(t)<=a)return;this.startConnectting(t,c,e,n)}}stopMagnetDragging(t,e,n){const o=this.eventData(t).edgeView;o&&(o.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,s,o){let r=[o];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(o)&&(r=l.filter(c=>c.isNode()))}r.forEach(l=>{this.notify(t,{e,x:n,y:s,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?F(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}startNodeDragging(t,e,n){const s=this.getDelegatedView();if(s==null||!s.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:s,action:"move"});const o=A.create(s.cell.getPosition());s.setEventData(t,{moving:!1,offset:o.diff(e,n),restrict:this.getRestrictArea(s)})}dragNode(t,e,n){const s=this.cell,o=this.graph,r=o.getGridSize(),a=this.getEventData(t),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=ae(e+l.x,r),u=ae(n+l.y,r);s.setPosition(h,u,{restrict:c,deep:!0,ui:!0}),o.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}autoOffsetNode(){const t=this.cell,e=this.graph,n=Object.assign({id:t.id},t.getPosition()),o=e.getNodes().map(c=>{const h=c.getPosition();return{id:c.id,x:h.x,y:h.y}}).filter(c=>c.id!==n.id),r=[[1,1],[1,-1],[-1,1],[-1,-1]];let a=e.getGridSize();const l=c=>o.some(h=>h.x===c.x&&h.y===c.y);for(;l(n);){let c=!1;for(let h=0;h<r.length;h+=1){const u=r[h],g={x:n.x+u[0]*a,y:n.y+u[1]*a};if(!l(g)){t.translate(u[0]*a,u[1]*a),c=!0;break}}if(c)break;a+=e.getGridSize()}}stopNodeDragging(t,e,n){const s=this.getEventData(t),o=this.graph;s.embedding&&this.finalizeEmbedding(t,s),s.moving&&(o.options.translating.autoOffset&&this.autoOffsetNode(),this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),s.moving=!1,s.embedding=!1}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");n&&n.autoScroll(t,e)}}const Cu=`X6.${te.name}`;te.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"]}}),te.registry.register("node",te,!0);class Ve extends Tt{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}static isEdgeView(t){if(t==null)return!1;if(t instanceof Ve)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Au)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"&&typeof n.update=="function"&&typeof n.getConnection=="function"}get[Symbol.toStringTag](){return Au}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const n=this.cell.getSource();return new P(n.x,n.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new P(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const n=this.cell.getTarget();return new P(n.x,n.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new P(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}return this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","labels","tools"]),n):(n=this.handleAction(n,"update",()=>this.update(e)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(e)),n=this.handleAction(n,"tools",()=>this.renderTools()),n)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this.notify("view:render",{view:this}),this}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}customizeLabels(){if(this.labelContainer){const t=this.cell,e=t.labels;for(let n=0,s=e.length;n<s;n+=1){const o=e[n],r=this.labelCache[n],a=this.labelSelectors[n],l=this.graph.options.onEdgeLabelRendered;if(l){const c=l({edge:t,label:o,container:r,selectors:a});c&&(this.labelDestroyFn[n]=c)}}}}destroyCustomizeLabels(){const t=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let e=0,n=t.length;e<n;e+=1){const s=this.labelDestroyFn[e],o=this.labelCache[e],r=this.labelSelectors[e];s&&o&&r&&s({edge:this.cell,label:t[e],container:o,selectors:r})}this.labelDestroyFn={}}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let s=this.labelContainer;if(this.labelCache={},this.labelSelectors={},n<=0)return s&&s.parentNode&&s.parentNode.removeChild(s),this;s?this.empty(s):(s=ce("g"),this.addClass(this.prefixClassName("edge-labels"),s),this.labelContainer=s);for(let o=0,r=e.length;o<r;o+=1){const a=e[o],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,h;if(l)c=l.node,h=l.selectors;else{const g=t.getDefaultLabel(),f=this.normalizeLabelMarkup(this.parseLabelMarkup(g.markup));c=f.node,h=f.selectors}c.setAttribute("data-index",`${o}`),s.appendChild(c);const u=this.rootSelector;if(h[u])throw new Error("Ambiguous label root selector.");h[u]=c,this.labelCache[o]=c,this.labelSelectors[o]=h}return s.parentNode==null&&this.container.appendChild(s),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(t={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(e==null)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],s=n.length;if(s>1){const o=n[1];if(e[o]){if(s===2)return typeof t.propertyValue=="object"&&ts(t.propertyValue,"markup");if(n[2]!=="markup")return!1}}}return!0}parseLabelMarkup(t){return t?typeof t=="string"?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=U.createVectors(t),n=document.createDocumentFragment();for(let s=0,o=e.length;s<o;s+=1){const r=e[s].node;n.appendChild(r)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(t==null)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const s=e.childNodes;return s.length>1||s[0].nodeName.toUpperCase()!=="G"?n=U.create("g").append(e):n=U.create(s[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.labelContainer){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),s=t.getDefaultLabel();for(let o=0,r=e.length;o<r;o+=1){const a=this.labelCache[o],l=this.labelSelectors[o];a.setAttribute("cursor",n?"move":"default");const c=e[o],h=ft({},s.attrs,c.attrs);this.updateAttrs(a,h,{selectors:l,rootBBox:c.size?P.fromSize(c.size):void 0})}}}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}update(t={}){var e;this.cleanCache(),this.updateConnection(t);const n=this.cell.getAttrs(),{text:s}=n,o=Y(n,["text"]);if(o!=null){if(((e=this.container)===null||e===void 0?void 0:e.tagName)==="g"&&this.isEdgeElement(this.container)&&ay){const r=this.container.parentNode;if(r){const a=this.container.nextSibling;r.removeChild(this.container),r.insertBefore(this.container,a)}}this.updateAttrs(this.container,o,{selectors:this.selectors})}return this.updateLabelPositions(),this.updateTools(t),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),s=[this.sourceAnchor,...n,this.targetAnchor],o=s.length,r=new St(s);r.simplify({threshold:.01});const a=r.points.map(c=>c.toJSON()),l=a.length;return o===l?0:(e.setVertices(a.slice(1,l-1),t),o-l)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return A.create(this.sourceAnchor);case"target":return A.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return A.create(this.sourcePoint);case"target":return A.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const n=this.sourceView;return n?this.sourceMagnet||n.container:null}case"target":{if(e.raw)return this.targetMagnet;const n=this.targetView;return n?this.targetMagnet||n.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const n=t.tx||0,s=t.ty||0;this.routePoints=new St(this.routePoints).translate(n,s).points,this.translateConnectionPoints(n,s),this.path.translate(n,s)}else{const n=e.getVertices(),s=this.findAnchors(n);this.sourceAnchor=s.source,this.targetAnchor=s.target,this.routePoints=this.findRoutePoints(n);const o=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=o.source,this.targetPoint=o.target;const r=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,r.source||this.sourcePoint,r.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,s=e.target,o=t[0],r=t[t.length-1];return s.priority&&!n.priority?this.findAnchorsOrdered("target",r,"source",o):this.findAnchorsOrdered("source",o,"target",r)}findAnchorsOrdered(t,e,n,s){let o,r;const a=this.cell,l=a[t],c=a[n],h=this.getTerminalView(t),u=this.getTerminalView(n),g=this.getTerminalMagnet(t),f=this.getTerminalMagnet(n);if(h){let p;e?p=A.create(e):u?p=f:p=A.create(c),o=this.getAnchor(l.anchor,h,g,p,t)}else o=A.create(l);if(u){const p=A.create(s||o);r=this.getAnchor(c.anchor,u,f,p,n)}else r=A.isPointLike(c)?A.create(c):new A;return{[t]:o,[n]:r}}getAnchor(t,e,n,s,o){const r=e.isEdgeElement(n),a=this.graph.options.connecting;let l=typeof t=="string"?{name:t}:t;if(!l){const u=r?(o==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(o==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof u=="string"?{name:u}:u}if(!l)throw new Error("Anchor should be specified.");let c;const h=l.name;if(r){const u=hi.get(h);if(typeof u!="function")return hi.onNotFound(h);c=F(u,this,e,n,s,l.args||{},o)}else{const u=fi.get(h);if(typeof u!="function")return fi.onNotFound(h);c=F(u,this,e,n,s,l.args||{},o)}return c?c.round(this.POINT_ROUNDING):new A}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||ar.normal,n=this.cell.getRouter()||e;let s;if(typeof n=="function")s=F(n,this,t,{},this);else{const o=typeof n=="string"?n:n.name,r=typeof n=="string"?{}:n.args||{},a=o?wi.get(o):ar.normal;if(typeof a!="function")return wi.onNotFound(o);s=F(a,this,t,r,this)}return s==null?t.map(o=>A.create(o)):s.map(o=>A.create(o))}findConnectionPoints(t,e,n){const s=this.cell,o=this.graph.options.connecting,r=s.getSource(),a=s.getTarget(),l=this.sourceView,c=this.targetView,h=t[0],u=t[t.length-1];let g;if(l&&!l.isEdgeElement(this.sourceMagnet)){const p=this.sourceMagnet||l.container,m=h||n,b=new z(m,e),y=r.connectionPoint||o.sourceConnectionPoint||o.connectionPoint;g=this.getConnectionPoint(y,l,p,b,"source")}else g=e;let f;if(c&&!c.isEdgeElement(this.targetMagnet)){const p=this.targetMagnet||c.container,m=a.connectionPoint||o.targetConnectionPoint||o.connectionPoint,b=u||e,y=new z(b,n);f=this.getConnectionPoint(m,c,p,y,"target")}else f=n;return{source:g,target:f}}getConnectionPoint(t,e,n,s,o){const r=s.end;if(t==null)return r;const a=typeof t=="string"?t:t.name,l=typeof t=="string"?{}:t.args,c=ai.get(a);if(typeof c!="function")return ai.onNotFound(a);const h=F(c,this,s,e,n,l||{},o);return h?h.round(this.POINT_ROUNDING):r}findMarkerPoints(t,e,n){const s=u=>{const g=this.cell.getAttrs(),f=Object.keys(g);for(let p=0,m=f.length;p<m;p+=1){const b=g[f[p]];if(b[`${u}Marker`]||b[`${u}-marker`]){const y=b.strokeWidth||b["stroke-width"];if(y)return parseFloat(y);break}}return null},o=t[0],r=t[t.length-1];let a,l;const c=s("source");c&&(a=e.clone().move(o||n,-c));const h=s("target");return h&&(l=n.clone().move(r||e,-h)),this.sourceMarkerPoint=a||e.clone(),this.targetMarkerPoint=l||n.clone(),{source:a,target:l}}findPath(t,e,n){const s=this.cell.getConnector()||this.graph.options.connecting.connector;let o,r,a;if(typeof s=="string"?o=s:(o=s.name,r=s.args),o){const c=ci.get(o);if(typeof c!="function")return ci.onNotFound(o);a=c}else a=ph.normal;const l=F(a,this,e,n,t,Object.assign(Object.assign({},r),{raw:!0}),this);return typeof l=="string"?J.parse(l):l}translateConnectionPoints(t,e){this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e),this.sourceMarkerPoint.translate(t,e),this.targetMarkerPoint.translate(t,e)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const e=this.cell,n=e.getLabels();if(n.length===0)return this;const s=e.getDefaultLabel(),o=this.normalizeLabelPosition(s.position);for(let r=0,a=n.length;r<a;r+=1){const l=n[r],c=this.labelCache[r];if(!c)continue;const h=this.normalizeLabelPosition(l.position),u=ft({},o,h),g=this.getLabelTransformationMatrix(u);c.setAttribute("transform",ti(g))}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,s=e[t],o=s&&s.cell,r=`${t}View`;if(!o)return this[r]=null,this.updateTerminalMagnet(t),!0;const a=n.getCellById(o);if(!a)throw new Error(`Edge's ${t} node with id "${o}" not exists`);const l=a.findView(n);return l?(this[r]=l,this.updateTerminalMagnet(t),!0):!1}updateTerminalMagnet(t){const e=`${t}Magnet`,n=this.getTerminalView(t);if(n){let s=n.getMagnetFromEdgeTerminal(this.cell[t]);s===n.container&&(s=null),this[e]=s}else this[e]=null}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&typeof e.position=="object"&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&typeof e.position=="object")return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&typeof t.position=="object")return t.position.options}mergeLabelPositionArgs(t,e){return t===null?null:t===void 0?e===null?null:e:ft({},e,t)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const t=this.cache.pathCache;return ts(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const t=this.cache.pathCache;return ts(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const t=this.cache.pathCache;return ts(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return this.path==null?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return this.path==null?null:(xe(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return this.path==null?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return this.path==null?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return this.path==null?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return this.path==null?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return this.path==null?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,s){const o={distance:0};let r=0,a;typeof n=="number"?(r=n,a=s):a=n,a!=null&&(o.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),h=a&&a.absoluteDistance&&a.reverseDistance,u=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},f=new A(t,e),p=u.closestPointT(f,g),m=this.getConnectionLength()||0;let b=u.lengthAtT(p,g);c&&(b=m>0?b/m:0),h&&(b=-1*(m-b)||1),o.distance=b;let y;l||(y=u.tangentAtT(p));let C;if(y)C=y.pointOffset(f);else{const w=u.pointAtT(p),x=f.diff(w);C={x:x.x,y:x.y}}return o.offset=C,o.angle=r,o}normalizeLabelPosition(t){return typeof t=="number"?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},s=e.angle||0,o=e.distance,r=o>0&&o<=1;let a=0;const l={x:0,y:0},c=e.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const h=l.x!==0||l.y!==0||a===0,u=n.keepGradient,g=n.ensureLegibility,f=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},m=r?o*this.getConnectionLength():o,b=f.tangentAtLength(m,p);let y,C=s;if(b){if(h)y=b.start,y.translate(l);else{const w=b.clone();w.rotate(-90,b.start),w.setLength(a),y=w.end}u&&(C=b.angle()+s,g&&(C=Vt((C+90)%180-90)))}else y=f.start,h&&y.translate(l);return Bt().translate(y.x,y.y).rotate(C)}getVertexIndex(t,e){const s=this.cell.getVertices(),o=this.getClosestPointLength(new A(t,e));let r=0;if(o!=null)for(const a=s.length;r<a;r+=1){const l=s[r],c=this.getClosestPointLength(l);if(c!=null&&o<c)break}return r}getEventArgs(t,e,n){const s=this,o=s.cell,r=o;return e==null||n==null?{e:t,view:s,edge:o,cell:r}:{e:t,x:e,y:n,view:s,edge:o,cell:r}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const s=this.getEventData(t);switch(s.action){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);break}}return this.notifyMouseMove(t,e,n),s}onMouseUp(t,e,n){const s=this.getEventData(t);switch(s.action){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);break}}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),s}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){super.onMouseWheel(t,e,n,s),this.notify("edge:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,s){if(nc(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if(e==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,s)))}this.notifyMouseDown(t,n,s)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),super.onCustomEvent(t,e,n,s)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n),this.getEventData(t).stopPropagation&&t.stopPropagation()}startEdgeDragging(t,e,n){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(t,e,n);return}this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"})}dragEdge(t,e,n){const s=this.getEventData(t);s.moving||(s.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-s.x,n-s.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})}stopEdgeDragging(t,e,n){const s=this.getEventData(t);s.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),s.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),s={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:e.isNewEdge===!0,terminalType:t,initialMagnet:n,initialTerminal:co(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(s),s}createValidateConnectionArgs(t){const e=[];e[4]=t,e[5]=this;let n,s=0,o=0;t==="source"?(s=2,n="target"):(o=2,n="source");const r=this.cell[n],a=r.cell;if(a){let l;const c=e[s]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(r),l===c.container&&(l=void 0)),e[s+1]=l}return(l,c)=>(e[o]=l,e[o+1]=l.container===c?void 0:c,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){t.zIndex!=null&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}validateConnection(t,e,n,s,o,r,a){const l=this.graph.options.connecting,c=l.allowLoop,h=l.allowNode,u=l.allowEdge,g=l.allowPort,f=l.allowMulti,p=l.validateConnection,m=r?r.cell:null,b=o==="target"?n:t,y=o==="target"?s:e;let C=!0;const w=x=>{const E=o==="source"?a?a.port:null:m?m.getSourcePortId():null,S=o==="target"?a?a.port:null:m?m.getTargetPortId():null;return F(x,this.graph,{edge:m,edgeView:r,sourceView:t,targetView:n,sourcePort:E,targetPort:S,sourceMagnet:e,targetMagnet:s,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:o})};if(c!=null&&(typeof c=="boolean"?!c&&t===n&&(C=!1):C=w(c)),C&&g!=null&&(typeof g=="boolean"?!g&&y&&(C=!1):C=w(g)),C&&u!=null&&(typeof u=="boolean"?!u&&Ve.isEdgeView(b)&&(C=!1):C=w(u)),C&&h!=null&&y==null&&(typeof h=="boolean"?!h&&te.isNodeView(b)&&(C=!1):C=w(h)),C&&f!=null&&r){const x=r.cell,E=o==="source"?a:x.getSource(),S=o==="target"?a:x.getTarget(),v=a?this.graph.getCellById(a.cell):null;if(E&&S&&E.cell&&S.cell&&v)if(typeof f=="function")C=w(f);else{const M=this.graph.model.getConnectedEdges(v,{outgoing:o==="source",incoming:o==="target"});M.length&&(f==="withPort"?M.some(I=>{const O=I.getSource(),D=I.getTarget();return O&&D&&O.cell===E.cell&&D.cell===S.cell&&O.port!=null&&O.port===E.port&&D.port!=null&&D.port===S.port})&&(C=!1):f||M.some(I=>{const O=I.getSource(),D=I.getTarget();return O&&D&&O.cell===E.cell&&D.cell===S.cell})&&(C=!1))}}return C&&p!=null&&(C=w(p)),C}allowConnectToBlank(t){const e=this.graph,s=e.options.connecting.allowBlank;if(typeof s!="function")return!!s;const o=e.findViewByCell(t),r=t.getSourceCell(),a=t.getTargetCell(),l=e.findViewByCell(r),c=e.findViewByCell(a);return F(s,e,{edge:t,edgeView:o,sourceCell:r,targetCell:a,sourceView:l,targetView:c,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:o.sourceMagnet,targetMagnet:o.targetMagnet})}validateEdge(t,e,n){const s=this.graph;if(!this.allowConnectToBlank(t)){const r=t.getSourceCellId(),a=t.getTargetCellId();if(!(r&&a))return!1}const o=s.options.connecting.validateEdge;return o?F(o,s,{edge:t,type:e,previous:n}):!0}arrowheadDragging(t,e,n,s){s.x=e,s.y=n,s.currentTarget!==t&&(s.currentMagnet&&s.currentView&&s.currentView.unhighlight(s.currentMagnet,{type:"magnetAdsorbed"}),s.currentView=this.graph.findViewByElem(t),s.currentView?(s.currentMagnet=s.currentView.findMagnet(t),s.currentMagnet&&this.validateConnection(...s.getValidateConnectionArgs(s.currentView,s.currentMagnet),s.currentView.getEdgeTerminal(s.currentMagnet,e,n,this.cell,s.terminalType))?s.currentView.highlight(s.currentMagnet,{type:"magnetAdsorbed"}):s.currentMagnet=null):s.currentMagnet=null),s.currentTarget=t,this.cell.prop(s.terminalType,{x:e,y:n},Object.assign(Object.assign({},s.options),{ui:!0}))}arrowheadDragged(t,e,n){const s=t.currentView,o=t.currentMagnet;if(!o||!s)return;s.unhighlight(o,{type:"magnetAdsorbed"});const r=t.terminalType,a=s.getEdgeTerminal(o,e,n,this.cell,r);this.cell.setTerminal(r,a,{ui:!0})}snapArrowhead(t,e,n){const s=this.graph,{snap:o,allowEdge:r}=s.options.connecting,a=typeof o=="object"&&o.radius||50,l=typeof o=="object"&&o.anchor||"center",c=s.renderer.findViewsInArea({x:t-a,y:e-a,width:2*a,height:2*a},{nodeOnly:!0});if(r){const x=s.renderer.findEdgeViewsFromPoint({x:t,y:e},a).filter(E=>E!==this);c.push(...x)}const h=n.closestView||null,u=n.closestMagnet||null;n.closestView=null,n.closestMagnet=null;let g,f=Number.MAX_SAFE_INTEGER;const p=new A(t,e);c.forEach(x=>{if(x.container.getAttribute("magnet")!=="false"){if(x.isNodeView())g=l==="center"?x.cell.getBBox().getCenter().distance(p):x.cell.getBBox().getNearestPointToPoint(p).distance(p);else if(x.isEdgeView()){const E=x.getClosestPoint(p);E?g=E.distance(p):g=Number.MAX_SAFE_INTEGER}g<a&&g<f&&(u===x.container||this.validateConnection(...n.getValidateConnectionArgs(x,null),x.getEdgeTerminal(x.container,t,e,this.cell,n.terminalType)))&&(f=g,n.closestView=x,n.closestMagnet=x.container)}x.container.querySelectorAll("[magnet]").forEach(E=>{if(E.getAttribute("magnet")!=="false"){const S=x.getBBoxOfElement(E);g=p.distance(S.getCenter()),g<a&&g<f&&(u===E||this.validateConnection(...n.getValidateConnectionArgs(x,E),x.getEdgeTerminal(E,t,e,this.cell,n.terminalType)))&&(f=g,n.closestView=x,n.closestMagnet=E)}})});let m;const b=n.terminalType,y=n.closestView,C=n.closestMagnet,w=u!==C;if(h&&w&&h.unhighlight(u,{type:"magnetAdsorbed"}),y){if(!w)return;y.highlight(C,{type:"magnetAdsorbed"}),m=y.getEdgeTerminal(C,t,e,this.cell,b)}else m={x:t,y:e};this.cell.setTerminal(b,m,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,s=t.initialTerminal,o=this.cell[n];if(o&&!xt.equalTerminals(s,o)){const a=this.graph,l=s,c=l.cell?a.getCellById(l.cell):null,h=l.port,u=c?a.findViewByCell(c):null,g=c||t.isNewEdge?null:A.create(s).toJSON(),f=o,p=f.cell?a.getCellById(f.cell):null,m=f.port,b=p?a.findViewByCell(p):null,y=p?null:A.create(o).toJSON();this.notify("edge:connected",{e,previousCell:c,previousPort:h,previousView:u,previousPoint:g,currentCell:p,currentView:b,currentPort:m,currentPoint:y,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let s=0,o=n.length;s<o;s+=1){const r=e.findViewByCell(n[s]);if(!r||r.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(r.container.querySelectorAll("[magnet]"));r.container.getAttribute("magnet")!=="false"&&a.push(r.container);const l=a.filter(c=>this.validateConnection(...t.getValidateConnectionArgs(r,c),r.getEdgeTerminal(c,t.x,t.y,this.cell,t.terminalType)));if(l.length>0){for(let c=0,h=l.length;c<h;c+=1)r.highlight(l[c],{type:"magnetAvailable"});r.highlight(null,{type:"nodeAvailable"}),t.marked[r.cell.id]=l}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(n=>{const s=this.graph.findViewByCell(n);s&&(e[n].forEach(r=>{s.unhighlight(r,{type:"magnetAvailable"})}),s.unhighlight(null,{type:"nodeAvailable"}))}),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(t,e,n);return}const o=t.target.getAttribute("data-terminal"),r=this.prepareArrowheadDragging(o,{x:e,y:n});this.setEventData(t,r)}dragArrowhead(t,e,n){const s=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,s):this.arrowheadDragging(this.getEventTarget(t),e,n,s)}stopArrowheadDragging(t,e,n){const s=this.graph,o=this.getEventData(t);s.options.connecting.snap?this.snapArrowheadEnd(o):this.arrowheadDragged(o,e,n),this.validateEdge(this.cell,o.terminalType,o.initialTerminal)?(this.finishEmbedding(o),this.notifyConnectionEvent(o,t)):this.fallbackConnection(o),this.afterArrowheadDragging(o)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const s=t.currentTarget,o=parseInt(s.getAttribute("data-index"),10),r=this.getLabelPositionAngle(o),a=this.getLabelPositionArgs(o),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(t,{index:o,positionAngle:r,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const s=this.getEventData(t),o=this.cell.getLabelAt(s.index),r=ft({},o,{position:this.getLabelPosition(e,n,s.positionAngle,s.positionArgs)});this.cell.setLabelAt(s.index,r)}stopLabelDragging(t,e,n){}}const Au=`X6.${Ve.name}`;Ve.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"],tools:["tools"],vertices:["vertices","update"]}}),Ve.registry.register("edge",Ve,!0);const Bn={idle:"idle",raf:"raf",timeout:"timeout"};class $C{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=16,this.initialTime=Date.now(),this.pendingJobs=new Map,this.scheduleMode=null}queueJob(t){if(t.priority&Me.PRIOR)t.cb();else{const e=this.pendingJobs.get(t.id);if(e){if(e.cb=t.cb,t.priority!==e.priority){e.priority=t.priority;const n=this.queue.indexOf(e);if(n>=0){this.queue.splice(n,1);const s=this.findInsertionIndex(e);this.queue.splice(s,0,e)}}}else{const n=this.findInsertionIndex(t);this.queue.splice(n,0,t),this.pendingJobs.set(t.id,t)}}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.pendingJobs.clear(),this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(t){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let n=this.frameInterval;if(t&&typeof t.timeRemaining=="function"){const s=t.timeRemaining();n=Math.max(0,Math.min(n,s))}for(;this.queue.length>0;){const s=this.queue.shift();if(s.cb(),this.pendingJobs.delete(s.id),this.getCurrentTime()-e>=n)break}this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){for(this.isFlushPending=!1,this.isFlushing=!0;this.queue.length>0;){const t=this.queue.shift();try{t.cb()}catch(e){console.error(e)}this.pendingJobs.delete(t.id)}this.isFlushing=!1}findInsertionIndex(t){let e=0,n=this.queue.length,s=n-1;const o=t.priority;for(;e<=s;){const r=(s-e>>1)+e;o<=this.queue[r].priority?e=r+1:(n=r,s=r-1)}return n}scheduleJob(){this.scheduleId&&this.cancelScheduleJob(),"requestAnimationFrame"in window?(this.scheduleMode=Bn.raf,this.scheduleId=window.requestAnimationFrame(()=>this.flushJobs())):"requestIdleCallback"in window?(this.scheduleMode=Bn.idle,this.scheduleId=window.requestIdleCallback(t=>this.flushJobs(t),{timeout:100})):(this.scheduleMode=Bn.timeout,this.scheduleId=window.setTimeout(()=>this.flushJobs()))}cancelScheduleJob(){if(!this.scheduleId)return;const t={[Bn.idle]:window==null?void 0:window.cancelIdleCallback,[Bn.raf]:window==null?void 0:window.cancelAnimationFrame,[Bn.timeout]:window==null?void 0:window.clearTimeout},e=this.scheduleMode,n=e?t[e]:void 0;typeof n=="function"&&n(this.scheduleId),this.scheduleId=0,this.scheduleMode=null}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Me;(function(i){i[i.Update=2]="Update",i[i.RenderEdge=4]="RenderEdge",i[i.RenderNode=8]="RenderNode",i[i.PRIOR=1048576]="PRIOR"})(Me||(Me={}));const ZC="#insert";var pe;(function(i){i[i.CREATED=0]="CREATED",i[i.MOUNTED=1]="MOUNTED",i[i.WAITING=2]="WAITING"})(pe||(pe={}));class xu extends vn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(t){super(),this.views={},this.willRemoveViews={},this.queue=new $C,this.graph=t,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,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)}stopListening(){this.model.off("reseted",this.onModelReseted,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)}onModelReseted({options:t,previous:e}){let n=this.model.getCells();if(!(t!=null&&t.diff))this.queue.clearJobs(),this.removeZPivots(),this.resetViews();else{const s=new Set(e);n=n.filter(o=>!s.has(o))}this.renderViews(n,Object.assign(Object.assign({},t),{queue:n.map(s=>s.id)}))}onCellAdded({cell:t,options:e}){this.renderViews([t],e)}onCellRemoved({cell:t}){this.removeViews([t])}onCellZIndexChanged({cell:t,options:e}){const n=this.views[t.id];n&&this.requestViewUpdate(n.view,Qe,e,Me.Update,!0)}onCellVisibleChanged({cell:t,current:e}){this.toggleVisible(t,!!e)}requestViewUpdate(t,e,n={},s=Me.Update,o=!0){const r=t.cell.id,a=this.views[r];if(!a)return;a.flag=e,a.options=n,(t.hasAction(e,["translate","resize","rotate"])||n.async===!1)&&(s=Me.PRIOR,o=!1);const c=e&Qe?`${r}${ZC}`:r;this.queue.queueJob({id:c,priority:s,cb:()=>{this.renderViewInArea(t,e,n);const u=n.queue;if(u){const g=u.indexOf(t.cell.id);g>=0&&u.splice(g,1),u.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(t).forEach(u=>{this.requestViewUpdate(u.view,u.flag,n,s,!1)}),o&&this.flush()}setRenderArea(t){this.renderArea=t,Object.values(this.views).forEach(e=>{if(!e)return;const{view:n}=e;e.state===pe.MOUNTED&&(this.isUpdatable(n)||(n.remove(),this.graph.trigger("view:unmounted",{view:n}),e.state=pe.WAITING,e.flag|=Qe|n.getBootstrapFlag()))}),this.flushWaitingViews()}isViewMounted(t){if(t==null)return!1;const e=this.views[t.cell.id];return e?e.state===pe.MOUNTED:!1}renderViews(t,e={}){t.sort((n,s)=>n.isNode()&&s.isEdge()?-1:0),t.forEach(n=>{const s=n.id,o=this.views;let r=0,a=o[s];if(a)r=Qe;else{const l=this.createCellView(n);l&&(l.graph=this.graph,r=Qe|l.getBootstrapFlag(),a={view:l,flag:r,options:e,state:pe.CREATED},this.views[s]=a)}a&&this.requestViewUpdate(a.view,r,e,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(t,e,n={}){const s=t.cell,o=s.id,r=this.views[o];if(!r)return;let a=0;this.isUpdatable(t)?(a=this.updateView(t,e,n),r.flag=a):(r.state===pe.MOUNTED&&(t.remove(),this.graph.trigger("view:unmounted",{view:t}),a=0),r.state=pe.WAITING,r.flag=e|Qe|t.getBootstrapFlag()),a&&s.isEdge()&&!(a&t.getFlag(["source","target"]))&&this.queue.queueJob({id:o,priority:Me.RenderEdge,cb:()=>{this.updateView(t,e,n)}})}removeViews(t){t.forEach(e=>{const n=e.id,s=this.views[n];s&&(this.willRemoveViews[n]=s,delete this.views[n],this.queue.queueJob({id:n,priority:this.getRenderPriority(s.view),cb:()=>{this.removeView(s.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(t=>{if(t&&t.state===pe.WAITING){const{view:e,flag:n,options:s}=t;this.requestViewUpdate(e,n,s,this.getRenderPriority(e),!1)}}),this.flush()}updateView(t,e,n={}){if(t==null)return 0;if(Tt.isCellView(t)){if(e&XC)return this.removeView(t.cell),0;e&Qe&&(this.insertView(t),e^=Qe)}return e?t.confirmUpdate(e,n):0}insertView(t){const e=this.views[t.cell.id];if(e){const n=t.cell.getZIndex(),s=this.addZPivot(n);this.container.insertBefore(t.container,s),t.cell.isVisible()||this.toggleVisible(t.cell,!1),e.state=pe.MOUNTED,this.graph.trigger("view:mounted",{view:t})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(t=>{t&&this.removeView(t.view)}),this.views={},this.willRemoveViews={}}removeView(t){const e=t.cell,n=this.willRemoveViews[e.id];n&&t&&(n.view.remove(),delete this.willRemoveViews[e.id],this.graph.trigger("view:unmounted",{view:t}))}toggleVisible(t,e){const n=this.model.getConnectedEdges(t);for(let o=0,r=n.length;o<r;o+=1){const a=n[o];if(e){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const s=this.views[t.id];s&&nt(s.view.container,{display:e?"unset":"none"})}addZPivot(t=0){this.zPivots==null&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment(`z-index:${t+1}`);let s=-1/0;for(const r in e){const a=+r;a<t&&a>s&&(s=a)}const o=this.container;if(s!==-1/0){const r=e[s];o.insertBefore(n,r.nextSibling)}else o.insertBefore(n,o.firstChild);return n}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),this.zPivots={}}createCellView(t){const e={graph:this.graph},n=this.graph.options.createCellView;if(n){const o=F(n,this.graph,t);if(o)return new o(t,e);if(o===null)return null}const s=t.view;if(s!=null&&typeof s=="string"){const o=Tt.registry.get(s);return o?new o(t,e):Tt.registry.onNotFound(s)}return t.isNode()?new te(t,e):t.isEdge()?new Ve(t,e):null}getEffectedEdges(t){const e=[],n=t.cell,s=this.model.getConnectedEdges(n);for(let o=0,r=s.length;o<r;o+=1){const a=s[o],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const h=["update"];a.getTargetCell()===n&&h.push("target"),a.getSourceCell()===n&&h.push("source"),e.push({id:a.id,view:c,flag:c.getFlag(h)})}return e}isUpdatable(t){if(t.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(t.cell.getBBox()):!0;if(t.isEdgeView()){const e=t.cell,n=this.renderArea?this.renderArea.isIntersectWithRect(e.getBBox()):!0;if(this.graph.virtualRender.isVirtualEnabled())return n;const s=e.getSourceCell(),o=e.getTargetCell();if(this.renderArea&&s&&o)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(o.getBBox())}return!0}getRenderPriority(t){return t.cell.isNode()?Me.RenderNode:Me.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(t=>{this.views[t].view.dispose()}),this.views={}}}$([Z()],xu.prototype,"dispose",null);class vu extends Zt{constructor(){super(...arguments),this.schedule=new xu(this.graph)}requestViewUpdate(t,e,n={}){this.schedule.requestViewUpdate(t,e,n)}isViewMounted(t){return this.schedule.isViewMounted(t)}setRenderArea(t){this.schedule.setRenderArea(t)}findViewByElem(t){if(t==null)return null;const e=this.options.container,n=typeof t=="string"?e.querySelector(t):t instanceof Element?t:t[0];if(n){const s=this.graph.view.findAttr("data-cell-id",n);if(s){const o=this.schedule.views;if(o[s])return o[s].view}}return null}findViewByCell(t){if(t==null)return null;const e=q.isCell(t)?t.id:t,n=this.schedule.views;return n[e]?n[e].view:null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(n=>this.findViewByCell(n)).filter(n=>n!=null?fe(n.container,{target:this.view.stage}).containsPoint(e):!1)}findEdgeViewsFromPoint(t,e=5){return this.model.getEdges().map(n=>this.findViewByCell(n)).filter(n=>{if(n!=null){const s=n.getClosestPoint(t);if(s)return s.distance(t)<=e}return!1})}findViewsInArea(t,e={}){const n=P.create(t);return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>{if(s){if(e.nodeOnly&&!s.isNodeView())return!1;const o=fe(s.container,{target:this.view.stage});return o.width===0?o.inflate(1,0):o.height===0&&o.inflate(0,1),e.strict?n.containsRect(o):n.isIntersectWithRect(o)}return!1})}dispose(){this.schedule.dispose()}}$([Z()],vu.prototype,"dispose",null);class br extends Zt{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const s=this.graph.transform.getScale(),o=this.graph.translate();if(typeof n=="object"){const r=o.tx+s.sx*(n.x||0),a=o.ty+s.sy*(n.y||0);n=`${r}px ${a}px`}typeof e=="object"&&(e=P.fromSize(e).scale(s.sx,s.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const n=this.optionsCache;if(n&&n.image!==e.image)return;let s;const o=e.opacity,r=e.size;let a=e.repeat||"no-repeat";const l=ms.get(a);if(typeof l=="function"){const h=e.quality||1;t.width*=h,t.height*=h;const u=l(t,e);if(!(u instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");s=u.toDataURL("image/png"),e.repeat&&a!==e.repeat?a=e.repeat:a="repeat",typeof r=="object"?(r.width*=u.width/t.width,r.height*=u.height/t.height):r===void 0&&(e.size={width:u.width/h,height:u.height/h})}else s=t.src,r===void 0&&(e.size={width:t.width,height:t.height});n!=null&&typeof e.size=="object"&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=co(e.size));const c=this.elem.style;c.backgroundImage=`url(${s})`,c.backgroundRepeat=a,c.opacity=o==null||o>=1?"":`${o}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=co(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}$([Z()],br.prototype,"dispose",null);class tA extends Zt{getClientMatrix(){return Bt(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new A(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return(typeof t=="number"?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=A.create(t,e);return Ee(n,this.graph.matrix())}localToClientPoint(t,e){const n=A.create(t,e);return Ee(n,this.getClientMatrix())}localToPagePoint(t,e){return(typeof t=="number"?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,n,s){const o=P.create(t,e,n,s);return $t(o,this.graph.matrix())}localToClientRect(t,e,n,s){const o=P.create(t,e,n,s);return $t(o,this.getClientMatrix())}localToPageRect(t,e,n,s){return(typeof t=="number"?this.localToGraphRect(t,e,n,s):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=A.create(t,e);return Ee(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=A.create(t,e);return Ee(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=A.create(t,e);return Ee(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const s=A.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(s)}graphToLocalRect(t,e,n,s){const o=P.create(t,e,n,s);return $t(o,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,s){const o=P.create(t,e,n,s);return $t(o,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,s){const o=P.create(t,e,n,s);return $t(o,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,s){const o=P.create(t,e,n,s),r=this.getPageOffset();return o.x-=r.x,o.y-=r.y,this.graphToLocalRect(o)}}const eA=`.x6-graph {
|
|
86
|
+
`.trim()}const $3=Object.freeze(Object.defineProperty({__proto__:null,blur:J3,brightness:q3,contrast:X3,dropShadow:j3,grayScale:G3,highlight:K3,hueRotate:_3,invert:W3,outline:U3,saturate:H3,sepia:Y3},Symbol.toStringTag,{value:"Module"})),ui=yt.create({type:"filter"});ui.register($3,!0);const Z3=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(i,t){const e=t.thickness*t.sx,n=t.thickness*t.sy;W(i,{width:e,height:n,rx:e,ry:n,fill:t.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(i,t){let e;const n=t.width,s=t.height,o=t.thickness;n-o>=0&&s-o>=0?e=["M",n,0,"H0 M0 0 V0",s].join(" "):e="M 0 0 0 0",W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(i,t){let e;const n=t.factor||1,s=t.width*n,o=t.height*n,r=t.thickness;s-r>=0&&o-r>=0?e=["M",s,0,"H0 M0 0 V0",o].join(" "):e="M 0 0 0 0",t.width=s,t.height=o,W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(i,t){const e=t.sx<=1?t.thickness*t.sx:t.thickness;W(i,{width:e,height:e,rx:e,ry:e,fill:t.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(i,t){let e;const n=t.width,s=t.height,o=t.thickness;n-o>=0&&s-o>=0?e=["M",n,0,"H0 M0 0 V0",s].join(" "):e="M 0 0 0 0",W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}}},Symbol.toStringTag,{value:"Module"}));class tw{constructor(){this.patterns={},this.root=U.create(is(),{width:"100%",height:"100%"},[le("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,U.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return this.patterns[t]!=null}}const yh=Z3,di=yt.create({type:"grid"});di.register(yh,!0);const et={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(i){return`${et.prefixCls}-${i}`}},wh=et.prefix("highlighted"),ew={highlight(i,t,e){const n=e&&e.className||wh;Q(t,n)},unhighlight(i,t,e){const n=e&&e.className||wh;lt(t,n)}},Ch=et.prefix("highlight-opacity"),nw={highlight(i,t){Q(t,Ch)},unhighlight(i,t){lt(t,Ch)}},iw={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},sw={highlight(i,t,e){const n=Ah(t,e);if(rw(n))return;e=kl({},e,iw);const s=U.create(t);let o,r;try{o=s.toPathData()}catch{r=Vc(s.node),o=Ac(Object.assign(Object.assign({},e),r))}const a=le("path");if(W(a,Object.assign({d:o,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},e.attrs?Xn(e.attrs):null)),i.isEdgeElement(t))W(a,"d",i.getConnectionPathData());else{let h=s.getTransformToElement(i.container);const u=e.padding;if(u){r==null&&(r=Vc(s.node));const g=r.x+r.width/2,f=r.y+r.height/2;r=Xt(r,h);const p=Math.max(r.width,1),m=Math.max(r.height,1),b=(p+u)/p,y=(m+u)/m,w=kt({a:b,b:0,c:0,d:y,e:g-b*g,f:f-y*f});h=h.multiply(w)}yn(a,h)}Q(a,et.prefix("highlight-stroke"));const l=i.cell,c=()=>xh(n);l.on("removed",c),l.model&&l.model.on("reseted",c),i.container.appendChild(a),ow(n,a)},unhighlight(i,t,e){xh(Ah(t,e))}};function Ah(i,t){return Mo(i),i.id+JSON.stringify(t)}const vs={};function ow(i,t){vs[i]=t}function rw(i){return vs[i]!=null}function xh(i){const t=vs[i];t&&(Wt(t),delete vs[i])}const aw=Object.freeze(Object.defineProperty({__proto__:null,className:ew,opacity:nw,stroke:sw},Symbol.toStringTag,{value:"Module"}));function lw(i,t){if(typeof t.highlight!="function")throw new Error(`Highlighter '${i}' is missing required \`highlight()\` method`);if(typeof t.unhighlight!="function")throw new Error(`Highlighter '${i}' is missing required \`unhighlight()\` method`)}const cw=aw,gi=yt.create({type:"highlighter"});gi.register(cw,!0);const hw=Se("center"),uw=Se("topCenter"),dw=Se("bottomCenter"),gw=Se("leftMiddle"),fw=Se("rightMiddle"),pw=Se("topLeft"),mw=Se("topRight"),bw=Se("bottomLeft"),yw=Se("bottomRight");function Se(i){return(t,e,n,s={})=>{let o;t.cell.visible?o=s.rotate?t.getUnrotatedBBoxOfElement(e):t.getBBoxOfElement(e):o=t.cell.getBBox();const r=o[i];r.x+=Gt(s.dx,o.width),r.y+=Gt(s.dy,o.height);const a=t.cell;return s.rotate?r.rotate(-a.getAngle(),a.getBBox().getCenter()):r}}const ww=xs((i,t,e,n)=>{const s=Vt(i.cell.getAngle()),o=i.cell.visible?i.getBBoxOfElement(t):i.cell.getBBox(),r=o.getCenter(),a=o.getTopLeft(),l=o.getBottomRight();let c=n.padding;if(Number.isFinite(c)||(c=0),a.y+c<=e.y&&e.y<=l.y-c){const h=e.y-r.y;r.x+=s===0||s===180?0:h*1/Math.tan(Dt(s)),r.y+=h}else if(a.x+c<=e.x&&e.x<=l.x-c){const h=e.x-r.x;r.y+=s===90||s===270?0:h*Math.tan(Dt(s)),r.x+=h}return r}),Cw=function(i,t,e,n,s){const o=i.cell.getConnectionPoint(this.cell,s);return(n.dx||n.dy)&&o.translate(n.dx||0,n.dy||0),o},Aw=xs((i,t,e,n)=>{let s,o=0,r;const a=i.cell;n.rotate?(s=i.getUnrotatedBBoxOfElement(t),r=a.getBBox().getCenter(),o=a.getAngle()):a.visible?s=i.getBBoxOfElement(t):s=i.cell.getBBox();const l=n.padding;l!=null&&Number.isFinite(l)&&s.inflate(l),n.rotate&&e.rotate(o,r);const c=s.getNearestSideToPoint(e);let h;switch(c){case"left":h=s.getLeftMiddle();break;case"right":h=s.getRightMiddle();break;case"top":h=s.getTopCenter();break;case"bottom":h=s.getBottomCenter();break}const u=n.direction;return u==="H"?(c==="top"||c==="bottom")&&(e.x<=s.x+s.width?h=s.getLeftMiddle():h=s.getRightMiddle()):u==="V"&&(e.y<=s.y+s.height?h=s.getTopCenter():h=s.getBottomCenter()),n.rotate?h.rotate(-o,r):h}),xw=Object.freeze(Object.defineProperty({__proto__:null,bottom:dw,bottomLeft:bw,bottomRight:yw,center:hw,left:gw,midSide:Aw,nodeCenter:Cw,orth:ww,right:fw,top:uw,topLeft:pw,topRight:mw},Symbol.toStringTag,{value:"Module"})),fi=yt.create({type:"node endpoint"});fi.register(xw,!0);const vw={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function De(i,t){const{x:e,y:n,angle:s,attrs:o}=t||{};return kl({},{angle:s,attrs:o,position:{x:e,y:n}},i,vw)}const Ew=(i,t,e)=>De({position:t.getTopLeft()},e),Sw=(i,t,e)=>De({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},e),Mw=(i,t,e)=>De({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},e),Bw=(i,t,e)=>De({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},e),kw=(i,t,e)=>De({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},e),Tw=(i,t,e)=>vh(i,t,!1,e),Iw=(i,t,e)=>vh(i,t,!0,e),Pw=(i,t,e)=>Eh(i,t,!1,e),Ow=(i,t,e)=>Eh(i,t,!0,e);function vh(i,t,e,n){const s=n.offset!=null?n.offset:15,o=t.getCenter().theta(i),r=Sh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=s,c=0,h="start"):o<r[0]?(a="0",l=0,c=-s,e?(u=-90,h="start"):h="middle"):o<r[3]?(a=".3em",l=-s,c=0,h="end"):(a=".6em",l=0,c=s,e?(u=90,h="start"):h="middle"),De({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function Eh(i,t,e,n){const s=n.offset!=null?n.offset:15,o=t.getCenter().theta(i),r=Sh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=-s,c=0,h="end"):o<r[0]?(a=".6em",l=0,c=s,e?(u=90,h="start"):h="middle"):o<r[3]?(a=".3em",l=s,c=0,h="start"):(a="0em",l=0,c=-s,e?(u=-90,h="start"):h="middle"),De({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function Sh(i){const t=i.getCenter(),e=t.theta(i.getTopLeft()),n=t.theta(i.getBottomLeft()),s=t.theta(i.getBottomRight()),o=t.theta(i.getTopRight());return[e,o,s,n]}const Nw=(i,t,e)=>Mh(i.diff(t.getCenter()),!1,e),Rw=(i,t,e)=>Mh(i.diff(t.getCenter()),!0,e);function Mh(i,t,e){const n=e.offset!=null?e.offset:20,s=new A(0,0),o=-i.theta(s),r=i.clone().move(s,n).diff(i).round();let a=".3em",l,c=o;return(o+90)%180===0?(l=t?"end":"middle",!t&&o===-270&&(a="0em")):o>-270&&o<-90?(l="start",c=o-180):l="end",De({position:r.round().toJSON(),angle:t?c:0,attrs:{".":{y:a,"text-anchor":l}}},e)}const Bh=Object.freeze(Object.defineProperty({__proto__:null,bottom:kw,inside:Pw,insideOriented:Ow,left:Sw,manual:Ew,outside:Tw,outsideOriented:Iw,radial:Nw,radialOriented:Rw,right:Mw,top:Bw},Symbol.toStringTag,{value:"Module"})),Es=yt.create({type:"port label layout"});Es.register(Bh,!0);function er(i,t={}){return new A(Gt(t.x,i.width),Gt(t.y,i.height))}function nr(i,t,e){return Object.assign({angle:t,position:i.toJSON()},e)}const Dw=(i,t)=>i.map(({x:e,y:n,angle:s})=>nr(er(t,{x:e,y:n}),s||0)),Lw=(i,t,e)=>{const n=e.start||0,s=e.step||20;return kh(i,t,n,(o,r)=>(o+.5-r/2)*s)},Qw=(i,t,e)=>{const n=e.start||0,s=e.step||360/i.length;return kh(i,t,n,o=>o*s)};function kh(i,t,e,n){const s=t.getCenter(),o=t.getTopCenter(),r=t.width/t.height,a=Jt.fromRect(t),l=i.length;return i.map((c,h)=>{const u=e+n(h,l),g=o.clone().rotate(-u,s).scale(r,1,s),f=c.compensateRotate?-a.tangentTheta(g):0;return(c.dx||c.dy)&&g.translate(c.dx||0,c.dy||0),c.dr&&g.move(s,c.dr),nr(g.round(),f,c)})}const Vw=(i,t,e)=>{const n=er(t,e.start||t.getOrigin()),s=er(t,e.end||t.getCorner());return pi(i,n,s,e)},zw=(i,t,e)=>pi(i,t.getTopLeft(),t.getBottomLeft(),e),Fw=(i,t,e)=>pi(i,t.getTopRight(),t.getBottomRight(),e),Uw=(i,t,e)=>pi(i,t.getTopLeft(),t.getTopRight(),e),Kw=(i,t,e)=>pi(i,t.getBottomLeft(),t.getBottomRight(),e);function pi(i,t,e,n){const s=new z(t,e),o=i.length;return i.map((r,a)=>{var{strict:l}=r,c=Y(r,["strict"]);const h=l||n.strict?(a+1)/(o+1):(a+.5)/o,u=s.pointAt(h);return(c.dx||c.dy)&&u.translate(c.dx||0,c.dy||0),nr(u.round(),0,c)})}const Th=Object.freeze(Object.defineProperty({__proto__:null,absolute:Dw,bottom:Kw,ellipse:Lw,ellipseSpread:Qw,left:zw,line:Vw,right:Fw,top:Uw},Symbol.toStringTag,{value:"Module"})),mi=yt.create({type:"port layout"});mi.register(Th,!0);const Jw=i=>[...i],jw=(i,t,e)=>{const n=t.side||"bottom",s=oe(t.padding||40),o=e.sourceBBox,r=e.targetBBox,a=o.getCenter(),l=r.getCenter();let c,h,u;switch(n){case"top":u=-1,c="y",h="height";break;case"left":u=-1,c="x",h="width";break;case"right":u=1,c="x",h="width";break;case"bottom":default:u=1,c="y",h="height";break}return a[c]+=u*(o[h]/2+s[n]),l[c]+=u*(r[h]/2+s[n]),u*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...i,l.toJSON()]};function Ss(i){return new P(i.x,i.y,0,0)}function Ms(i={}){const t=oe(i.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function Ih(i,t={}){return i.sourceBBox.clone().moveAndExpand(Ms(t))}function Ph(i,t={}){return i.targetBBox.clone().moveAndExpand(Ms(t))}function Gw(i,t={}){return i.sourceAnchor?i.sourceAnchor:Ih(i,t).getCenter()}function Yw(i,t={}){return i.targetAnchor?i.targetAnchor:Ph(i,t).getCenter()}const Oh=(i,t,e)=>{let n=Ih(e,t),s=Ph(e,t);const o=Gw(e,t),r=Yw(e,t);n=n.union(Ss(o)),s=s.union(Ss(r));const a=i.map(h=>A.create(h));a.unshift(o),a.push(r);let l=null;const c=[];for(let h=0,u=a.length-1;h<u;h+=1){let g=null;const f=a[h],p=a[h+1],m=Ut(f,p)!=null;if(h===0)h+1===u?n.intersectsWithRect(s.clone().inflate(1))?g=sr(f,p,n,s):m||(g=qw(f,p,n,s)):n.containsPoint(p)?g=sr(f,p,n,Ss(p).moveAndExpand(Ms(t))):m||(g=ks(f,p,n));else if(h+1===u){const b=m&&Ut(p,f)===l;s.containsPoint(f)||b?g=sr(f,p,Ss(f).moveAndExpand(Ms(t)),s,l):m||(g=Ww(f,p,s,l))}else m||(g=Nh(f,p,l));g?(c.push(...g.points),l=g.direction):l=Ut(f,p),h+1<u&&c.push(p)}return c},Hw={N:"S",S:"N",E:"W",W:"E"},_w={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function Bs(i,t,e){let n=new A(i.x,t.y);return e.containsPoint(n)&&(n=new A(t.x,i.y)),n}function ir(i,t){return i[t==="W"||t==="E"?"width":"height"]}function Ut(i,t){return i.x===t.x?i.y>t.y?"N":"S":i.y===t.y?i.x>t.x?"W":"E":null}function Nh(i,t,e){const n=new A(i.x,t.y),s=new A(t.x,i.y),o=Ut(i,n),r=Ut(i,s),a=e?Hw[e]:null,l=o===e||o!==a&&(r===a||r!==e)?n:s;return{points:[l],direction:Ut(l,t)}}function ks(i,t,e){const n=Bs(i,t,e);return{points:[n],direction:Ut(n,t)}}function Ww(i,t,e,n){const s=[new A(i.x,t.y),new A(t.x,i.y)],o=s.filter(l=>!e.containsPoint(l)),r=o.filter(l=>Ut(l,i)!==n);let a;if(r.length>0)return a=r.filter(l=>Ut(i,l)===n).pop(),a=a||r[0],{points:[a],direction:Ut(a,t)};{a=Cb(s,o)[0];const l=A.create(t).move(a,-ir(e,n)/2);return{points:[Bs(l,i,e),l],direction:Ut(l,t)}}}function qw(i,t,e,n){let s=ks(t,i,n);const o=s.points[0];if(e.containsPoint(o)){s=ks(i,t,e);const r=s.points[0];if(n.containsPoint(r)){const a=A.create(i).move(r,-ir(e,Ut(i,r))/2),l=A.create(t).move(o,-ir(n,Ut(t,o))/2),c=new z(a,l).getCenter(),h=ks(i,c,e),u=Nh(c,t,h.direction);s.points=[h.points[0],u.points[0]],s.direction=u.direction}}return s}function sr(i,t,e,n,s){const o=e.union(n).inflate(1),r=o.getCenter(),a=r.distance(t)>r.distance(i),l=a?t:i,c=a?i:t;let h,u,g;s?(h=A.fromPolar(o.width+o.height,_w[s],l),h=o.getNearestPointToPoint(h).move(h,-1)):h=o.getNearestPointToPoint(l).move(l,1),u=Bs(h,c,o);let f;h.round().equals(u.round())?(u=A.fromPolar(o.width+o.height,Dt(h.theta(l))+Math.PI/2,c),u=o.getNearestPointToPoint(u).move(c,1).round(),g=Bs(h,u,o),f=a?[u,g,h]:[h,g,u]):f=a?[u,h]:[h,u];const p=Ut(a?h:u,t);return{points:f,direction:p}}const Xw={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],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(){return Le(this.step,this)},directions(){const i=Le(this.step,this),t=Le(this.cost,this);return[{cost:t,offsetX:i,offsetY:0},{cost:t,offsetX:-i,offsetY:0},{cost:t,offsetX:0,offsetY:i},{cost:t,offsetX:0,offsetY:-i}]},penalties(){const i=Le(this.step,this);return{0:0,45:i/2,90:i/2}},paddingBox(){const i=Le(this.step,this);return{x:-i,y:-i,width:2*i,height:2*i}},fallbackRouter:Oh,draggingRouter:null,snapToGrid:!0};function Le(i,t){return typeof i=="function"?i.call(t):i}function $w(i){const t=Object.keys(i).reduce((e,n)=>{const s=e;return n==="fallbackRouter"||n==="draggingRouter"||n==="fallbackRoute"?s[n]=i[n]:s[n]=Le(i[n],i),e},{});if(t.padding){const e=oe(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{const n=new A(0,0),s=new A(e.offsetX,e.offsetY);e.angle=Vt(n.theta(s))}),t}class Zw{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,s=n.excludeTerminals.reduce((c,h)=>{const u=e[h];if(u){const g=t.getCell(u.cell);g&&c.push(g)}return c},[]);let o=[];const r=t.getCell(e.getSourceCellId());r&&(o=Nl(o,r.getAncestors().map(c=>c.id)));const a=t.getCell(e.getTargetCellId());a&&(o=Nl(o,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return t.getNodes().reduce((c,h)=>{const u=s.some(b=>b.id===h.id),g=h.shape?n.excludeShapes.includes(h.shape):!1,f=n.excludeNodes.some(b=>typeof b=="string"?h.id===b:b===h),p=o.includes(h.id),m=g||u||f||p;if(h.isVisible()&&!m){const b=h.getBBox().moveAndExpand(n.paddingBox),y=b.getOrigin().snapToGrid(l),w=b.getCorner().snapToGrid(l);for(let C=y.x;C<=w.x;C+=l)for(let x=y.y;x<=w.y;x+=l){const E=new A(C,x).toString();c[E]==null&&(c[E]=[]),c[E].push(b)}}return c},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return n?n.every(s=>!s.containsPoint(t)):!0}}const Rh=1,Dh=2;class tC{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=Rh,this.values[t]=e;const n=Xb(this.items,t,s=>this.values[s]);this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=Dh),t}isOpen(t){return this.hash[t]===Rh}isClose(t){return this.hash[t]===Dh}isEmpty(){return this.items.length===0}}function Lh(i,t){const e=i.sourceBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Qh(i,t){const e=i.targetBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Vh(i,t){return i.sourceAnchor?i.sourceAnchor:Lh(i,t).getCenter()}function eC(i,t){return i.targetAnchor?i.targetAnchor:Qh(i,t).getCenter()}function or(i,t,e,n,s){const o=360/e,r=i.theta(nC(i,t,n,s)),a=Vt(r+o/2);return o*Math.floor(a/o)}function nC(i,t,e,n){const s=n.step,o=t.x-i.x,r=t.y-i.y,a=o/e.x,l=r/e.y,c=a*s,h=l*s;return new A(i.x+c,i.y+h)}function zh(i,t){const e=Math.abs(i-t);return e>180?360-e:e}function iC(i,t){const e=t.step;return t.directions.forEach(n=>{n.gridOffsetX=n.offsetX/e*i.x,n.gridOffsetY=n.offsetY/e*i.y}),t.directions}function sC(i,t,e){return{source:t.clone(),x:Fh(e.x-t.x,i),y:Fh(e.y-t.y,i)}}function Fh(i,t){if(!i)return t;const e=Math.abs(i),n=Math.round(e/t);if(!n)return e;const s=n*t,r=(e-s)/n;return t+r}function oC(i,t){const e=t.source,n=re(i.x-e.x,t.x)+e.x,s=re(i.y-e.y,t.y)+e.y;return new A(n,s)}function bi(i,t){return i.round(t)}function Ts(i,t,e){return bi(oC(i.clone(),t),e)}function yi(i){return i.toString()}function rr(i){return new A(i.x===0?0:Math.abs(i.x)/i.x,i.y===0?0:Math.abs(i.y)/i.y)}function Uh(i,t){let e=1/0;for(let n=0,s=t.length;n<s;n+=1){const o=i.manhattanDistance(t[n]);o<e&&(e=o)}return e}function Kh(i,t,e,n,s){const o=s.precision,r=s.directionMap,a=i.diff(t.getCenter()),l=Object.keys(r).reduce((c,h)=>{if(e.includes(h)){const u=r[h],g=new A(i.x+u.x*(Math.abs(a.x)+t.width),i.y+u.y*(Math.abs(a.y)+t.height)),p=new z(i,g).intersect(t)||[];let m,b=null;for(let y=0;y<p.length;y+=1){const w=p[y],C=i.squaredDistance(w);(m==null||C>m)&&(m=C,b=w)}if(b){let y=Ts(b,n,o);t.containsPoint(y)&&(y=Ts(y.translate(u.x*n.x,u.y*n.y),n,o)),c.push(y)}}return c},[]);return t.containsPoint(i)||l.push(Ts(i,n,o)),l}function rC(i,t,e,n,s){const o=[];let r=rr(s.diff(e)),a=yi(e),l=i[a],c;for(;l;){c=t[a];const g=rr(c.diff(l));g.equals(r)||(o.unshift(c),r=g),a=yi(l),l=i[a]}const h=t[a];return rr(h.diff(n)).equals(r)||o.unshift(h),o}function aC(i,t,e,n,s){const o=s.precision;let r,a;P.isRectangle(t)?r=bi(Vh(i,s).clone(),o):r=bi(t.clone(),o),P.isRectangle(e)?a=bi(eC(i,s).clone(),o):a=bi(e.clone(),o);const l=sC(s.step,r,a),c=r,h=a;let u,g;if(P.isRectangle(t)?u=Kh(c,t,s.startDirections,l,s):u=[c],P.isRectangle(e)?g=Kh(a,e,s.endDirections,l,s):g=[h],u=u.filter(f=>n.isAccessible(f)),g=g.filter(f=>n.isAccessible(f)),u.length>0&&g.length>0){const f=new tC,p={},m={},b={};for(let I=0,O=u.length;I<O;I+=1){const R=u[I],K=yi(R);f.add(K,Uh(R,g)),p[K]=R,b[K]=0}const y=s.previousDirectionAngle,w=y===void 0;let C,x;const E=iC(l,s),S=E.length,v=g.reduce((I,O)=>{const R=yi(O);return I.push(R),I},[]),M=A.equalPoints(u,g);let k=s.maxLoopCount;for(;!f.isEmpty()&&k>0;){const I=f.pop(),O=p[I],R=m[I],K=b[I],D=O.equals(c),N=R==null;let j;if(N?w?D?j=null:j=or(c,O,S,l,s):j=y:j=or(R,O,S,l,s),!(N&&M)&&v.indexOf(I)>=0)return s.previousDirectionAngle=j,rC(m,p,O,c,h);for(let Ct=0;Ct<S;Ct+=1){C=E[Ct];const pt=C.angle;if(x=zh(j,pt),!(w&&D)&&x>s.maxDirectionChange)continue;const ct=Ts(O.clone().translate(C.gridOffsetX||0,C.gridOffsetY||0),l,o),V=yi(ct);if(f.isClose(V)||!n.isAccessible(ct))continue;if(v.indexOf(V)>=0&&!ct.equals(h)){const mt=or(ct,h,S,l,s);if(zh(pt,mt)>s.maxDirectionChange)continue}const tt=C.cost,it=D?0:s.penalties[x],H=K+tt+it;(!f.isOpen(V)||H<b[V])&&(p[V]=ct,m[V]=O,b[V]=H,f.add(V,H+Uh(ct,g)))}k-=1}}return s.fallbackRoute?F(s.fallbackRoute,this,c,h,s):null}function lC(i,t=10){if(i.length<=1)return i;for(let e=0,n=i.length;e<n-1;e+=1){const s=i[e],o=i[e+1];if(s.x===o.x){const r=t*Math.round(s.x/t);s.x!==r&&(s.x=r,o.x=r)}else if(s.y===o.y){const r=t*Math.round(s.y/t);s.y!==r&&(s.y=r,o.y=r)}}return i}const cC=function(i,t,e){const n=$w(t),s=Lh(e,n),o=Qh(e,n),r=Vh(e,n),a=new Zw(n).build(e.graph.model,e.cell),l=i.map(f=>A.create(f)),c=[];let h=r,u,g;for(let f=0,p=l.length;f<=p;f+=1){let m=null;if(u=g||s,g=l[f],g==null){g=o;const y=e.cell;if((y.getSourceCellId()==null||y.getTargetCellId()==null)&&typeof n.draggingRouter=="function"){const C=u===s?r:u,x=g.getOrigin();m=F(n.draggingRouter,e,C,x,n)}}if(m==null&&(m=aC(e,u,g,a,n)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),F(n.fallbackRouter,this,i,n,e);const b=m[0];b&&b.equals(h)&&m.shift(),h=m[m.length-1]||h,c.push(...m)}return n.snapToGrid?lC(c,e.graph.grid.getGridSize()):c},Jh=function(i,t,e){return F(cC,this,i,Object.assign(Object.assign({},Xw),t),e)},hC={maxDirectionChange:45,directions(){const i=Le(this.step,this),t=Le(this.cost,this),e=Math.ceil(Math.sqrt(i*i<<1));return[{cost:t,offsetX:i,offsetY:0},{cost:e,offsetX:i,offsetY:i},{cost:t,offsetX:0,offsetY:i},{cost:e,offsetX:-i,offsetY:i},{cost:t,offsetX:-i,offsetY:0},{cost:e,offsetX:-i,offsetY:-i},{cost:t,offsetX:0,offsetY:-i},{cost:e,offsetX:i,offsetY:-i}]},fallbackRoute(i,t,e){const n=i.theta(t),s=[];let o={x:t.x,y:i.y},r={x:i.x,y:t.y};if(n%180>90){const C=o;o=r,r=C}const a=n%90<45?o:r,l=new z(i,a),c=90*Math.ceil(n/90),h=A.fromPolar(l.squaredLength(),Dt(c+135),a),u=new z(t,h),g=l.intersectsWithLine(u),f=g||t,p=g?f:i,m=360/e.directions.length,b=p.theta(t),y=Vt(b+m/2),w=m*Math.floor(y/m);return e.previousDirectionAngle=w,f&&s.push(f.round()),s.push(t),s}},uC=function(i,t,e){return F(Jh,this,i,Object.assign(Object.assign({},hC),t),e)},dC=(i,t,e)=>{const n=t.offset||32,s=t.min==null?16:t.min;let o=0,r=t.direction;const a=e.sourceBBox,l=e.targetBBox,c=a.getCenter(),h=l.getCenter();if(typeof n=="number"&&(o=n),r==null){let y=l.left-a.right,w=l.top-a.bottom;y>=0&&w>=0?r=y>=w?"L":"T":y<=0&&w>=0?(y=a.left-l.right,y>=0?r=y>=w?"R":"T":r="T"):y>=0&&w<=0?(w=a.top-l.bottom,w>=0?r=y>=w?"L":"B":r="L"):(y=a.left-l.right,w=a.top-l.bottom,y>=0&&w>=0?r=y>=w?"R":"B":y<=0&&w>=0?r="B":y>=0&&w<=0?r="R":r=Math.abs(y)>Math.abs(w)?"R":"B")}r==="H"?r=h.x-c.x>=0?"L":"R":r==="V"&&(r=h.y-c.y>=0?"T":"B"),n==="center"&&(r==="L"?o=(l.left-a.right)/2:r==="R"?o=(a.left-l.right)/2:r==="T"?o=(l.top-a.bottom)/2:r==="B"&&(o=(a.top-l.bottom)/2));let u,g,f;const p=r==="L"||r==="R";if(p){if(h.y===c.y)return[...i];f=r==="L"?1:-1,u="x",g="width"}else{if(h.x===c.x)return[...i];f=r==="T"?1:-1,u="y",g="height"}const m=c.clone(),b=h.clone();if(m[u]+=f*(a[g]/2+o),b[u]-=f*(l[g]/2+o),p){const y=m.x,w=b.x,C=a.width/2+s,x=l.width/2+s;h.x>c.x?w<=y&&(m.x=Math.max(w,c.x+C),b.x=Math.min(y,h.x-x)):w>=y&&(m.x=Math.min(w,c.x-C),b.x=Math.max(y,h.x+x))}else{const y=m.y,w=b.y,C=a.height/2+s,x=l.height/2+s;h.y>c.y?w<=y&&(m.y=Math.max(w,c.y+C),b.y=Math.min(y,h.y-x)):w>=y&&(m.y=Math.min(w,c.y-C),b.y=Math.max(y,h.y+x))}return[m.toJSON(),...i,b.toJSON()]};function Sn(i,t){if(t!=null&&t!==!1){const e=typeof t=="boolean"?0:t;if(e>0){const n=A.create(i[1]).move(i[2],e),s=A.create(i[1]).move(i[0],e);return[n.toJSON(),...i,s.toJSON()]}{const n=i[1];return[Object.assign({},n),...i,Object.assign({},n)]}}return i}const ar=Object.freeze(Object.defineProperty({__proto__:null,er:dC,loop:(i,t,e)=>{const n=t.width||50,o=(t.height||80)/2,r=t.angle||"auto",a=e.sourceAnchor,l=e.targetAnchor,c=e.sourceBBox,h=e.targetBBox;if(a.equals(l)){const u=y=>{const w=Dt(y),C=Math.sin(w),x=Math.cos(w),E=new A(a.x+x*n,a.y+C*n),S=new A(E.x-x*o,E.y-C*o),v=S.clone().rotate(-90,E),M=S.clone().rotate(90,E);return[v.toJSON(),E.toJSON(),M.toJSON()]},g=y=>{const w=a.clone().move(y,-1),C=new z(w,y);return!c.containsPoint(y)&&!c.intersectsWithLine(C)},f=[0,90,180,270,45,135,225,315];if(typeof r=="number")return Sn(u(r),t.merge);const p=c.getCenter();if(p.equals(a))return Sn(u(0),t.merge);const m=p.angleBetween(a,p.clone().translate(1,0));let b=u(m);if(g(b[1]))return Sn(b,t.merge);for(let y=1,w=f.length;y<w;y+=1)if(b=u(m+f[y]),g(b[1]))return Sn(b,t.merge);return Sn(b,t.merge)}{const u=new z(a,l);let g=u.parallel(-n),f=g.getCenter(),p=g.start.clone().move(g.end,o),m=g.end.clone().move(g.start,o);const b=u.parallel(-1),y=new z(b.start,f),w=new z(b.end,f);if((c.containsPoint(f)||h.containsPoint(f)||c.intersectsWithLine(y)||c.intersectsWithLine(w)||h.intersectsWithLine(y)||h.intersectsWithLine(w))&&(g=u.parallel(n),f=g.getCenter(),p=g.start.clone().move(g.end,o),m=g.end.clone().move(g.start,o)),t.merge){const C=new z(a,l),x=new z(f,C.center).setLength(Number.MAX_SAFE_INTEGER),E=c.intersectsWithLine(x),S=h.intersectsWithLine(x),v=E?Array.isArray(E)?E:[E]:[];S&&(Array.isArray(S)?v.push(...S):v.push(S));const M=C.center.closest(v);M?(e.sourceAnchor=M.clone(),e.targetAnchor=M.clone()):(e.sourceAnchor=C.center.clone(),e.targetAnchor=C.center.clone())}return Sn([p.toJSON(),f.toJSON(),m.toJSON()],t.merge)}},manhattan:Jh,metro:uC,normal:Jw,oneSide:jw,orth:Oh},Symbol.toStringTag,{value:"Module"})),wi=yt.create({type:"router"});wi.register(ar,!0);function gC(i){return i!=null&&!Is(i)}function Is(i){return i!=null&&typeof i=="string"}function fC(i){return i==null||Is(i)?i:dt(i)}function pC(i){return`${i}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function jh(i,t={ns:Bt.svg}){const e=document.createDocumentFragment(),n={},s={},o=[{markup:Array.isArray(i)?i:[i],parent:e,ns:t.ns}];for(;o.length>0;){const r=o.pop();let a=r.ns||Bt.svg;const l=r.markup,c=r.parent;l.forEach(h=>{const u=h.tagName;if(!u)throw new TypeError("Invalid tagName");h.ns&&(a=h.ns);const g=a?Bo(u,a):ec(u),f=h.attrs;f&&W(g,Xn(f));const p=h.style;p&&nt(g,p);const m=h.className;m!=null&&g.setAttribute("class",Array.isArray(m)?m.join(" "):m),h.textContent&&(g.textContent=h.textContent);const b=h.selector;if(b!=null){if(s[b])throw new TypeError("Selector must be unique");s[b]=g}if(h.groupSelector){let w=h.groupSelector;Array.isArray(w)||(w=[w]),w.forEach(C=>{n[C]||(n[C]=[]),n[C].push(g)})}c.appendChild(g);const y=h.children;Array.isArray(y)&&o.push({ns:a,markup:y,parent:g})})}return Object.keys(n).forEach(r=>{if(s[r])throw new Error("Ambiguous group selector");s[r]=n[r]}),{fragment:e,selectors:s,groups:n}}function lr(i){return i instanceof SVGElement?le("g"):ec("div")}function mC(i){if(Is(i)){const s=U.createVectors(i),o=s.length;if(o===1)return{elem:s[0].node};if(o>1){const r=lr(s[0].node);return s.forEach(a=>{r.appendChild(a.node)}),{elem:r}}return{}}const t=jh(i),e=t.fragment;let n=null;return e.childNodes.length>1?(n=lr(e.firstChild),n.appendChild(e)):n=e.firstChild,{elem:n,selectors:t.selectors}}function bC(i){const t=U.createVectors(i),e=document.createDocumentFragment();for(let n=0,s=t.length;n<s;n+=1){const o=t[n].node;e.appendChild(o)}return{fragment:e,selectors:{}}}function Gh(i,t,e){if(i!=null){let n;const s=i.tagName.toLowerCase();if(i===t)return typeof e=="string"?n=`> ${s} > ${e}`:n=`> ${s}`,n;const o=i.parentNode;if(o&&o.childNodes.length>1){const r=ko(i)+1;n=`${s}:nth-child(${r})`}else n=s;return e&&(n+=` > ${e}`),Gh(i.parentNode,t,n)}return e}function yC(){return"g"}function wC(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function CC(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}function AC(){return[{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"}}]}function xC(i=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:Bt.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:Bt.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:i?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}const Lt={isJSONMarkup:gC,isStringMarkup:Is,clone:fC,sanitize:pC,parseJSONMarkup:jh,createContainer:lr,renderMarkup:mC,parseLabelStringMarkup:bC,getSelector:Gh,getPortContainerMarkup:yC,getPortMarkup:wC,getPortLabelMarkup:CC,getEdgeMarkup:AC,getForeignObjectMarkup:xC};function UE(i,t){}function KE(i){}function We(i,t){return t?le(i||"g"):Bo(i||"div")}function Yh(i,t,e){if(!i||i===".")return{elems:[t]};if(e){const n=e[i];if(n)return{elems:Array.isArray(n)?n:[n]}}{const n=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(t.querySelectorAll(n))}}}function vC(i){var t;let e=i;const n=i.originalEvent,s=(t=n==null?void 0:n.changedTouches)===null||t===void 0?void 0:t[0];if(s){for(const o in i)s[o]===void 0&&(s[o]=i[o]);e=s}return e}let jt=class extends Ft{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=oy("v"),this.cid}confirmUpdate(t,e){return 0}empty(t=this.container){return Wn(t),this}unmount(t=this.container){return Wt(t),this}remove(t=this.container){return t===this.container?(this.removeEventListeners(document),this.onRemove(),this.cid,this.disposeContainer&&this.unmount(t)):this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return Q(e,Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return lt(e,Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return nt(e,t),this}setAttrs(t,e=this.container){return t!=null&&e!=null&&W(e,t),this}findAttr(t,e=this.container){let n=e;for(;n&&n.nodeType===1;){const s=n.getAttribute(t);if(s!=null)return s;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return Yh(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const s=this.find(t,e,n);return s.length>0?s[0]:null}findByAttr(t,e=this.container){let n=e;for(;n!=null&&n.getAttribute;){const s=n.getAttribute(t);if((s!=null||n===this.container)&&s!=="false")return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return typeof e=="string"&&(n=`> ${e}`),n;if(t){const s=ko(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${s})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return et.prefix(t)}delegateEvents(t,e){if(t==null)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(s=>{const o=s.match(n);if(o==null)return;const r=this.getEventHandler(t[s]);typeof r=="function"&&this.delegateEvent(o[1],o[2],r)}),this}undelegateEvents(){return ot.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return ot.on(this.container,t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const s=t+this.getEventNamespace();return e==null?ot.off(this.container,s):typeof e=="string"?ot.off(this.container,s,e,n):ot.off(this.container,s,e),this}addEventListeners(t,e,n){if(e==null)return this;const s=this.getEventNamespace();return Object.keys(e).forEach(o=>{const r=this.getEventHandler(e[o]);typeof r=="function"&&ot.on(t,o+s,n,r)}),this}removeEventListeners(t){return t!=null&&ot.off(t,this.getEventNamespace()),this}getEventNamespace(){return`.${et.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if(typeof t=="string"){const n=this[t];typeof n=="function"&&(e=(...s)=>n.call(this,...s))}else e=(...n)=>t.call(this,...n);return e}getEventTarget(t,e={}){const{target:n,type:s,clientX:o=0,clientY:r=0}=t;return e.fromPoint||s==="touchmove"||s==="touchend"?document.elementFromPoint(o,r):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return this.getEventData(t).propagationStopped===!0}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(t==null)throw new TypeError("Event object required");let n=t.data;const s=`__${this.cid}__`;return e==null?n==null?{}:n[s]||{}:(n==null&&(n=t.data={}),n[s]==null?n[s]=Object.assign({},e):n[s]=Object.assign(Object.assign({},n[s]),e),n[s])}normalizeEvent(t){return vC(t)}dispose(){this.remove()}};X([$()],jt.prototype,"dispose",null);let Hh=0;function EC(i){return i?Io(i):(Hh+=1,`CustomTool${Hh}`)}class gt extends jt{static isToolItem(t){if(t==null)return!1;if(t instanceof gt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===_h)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"&&typeof n.isVisible=="function"}static define(t){const e=Vo(EC(t.name),gt);return e.config(t),e}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return ft(dt(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return _h}constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=We(this.options.tagName||"g",this.options.isSVGElement!==!1),Q(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&Q(this.container,this.options.className),this.init()}init(){}getOptions(t){return this.constructor.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?Q(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&Q(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=Lt.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const t=this.options.focusOpacity;return t!=null&&Number.isFinite(t)&&(this.container.style.opacity=`${t}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(t,this.cellView)}}gt.toStringTag=`X6.${gt.name}`,gt.defaults={isSVGElement:!0,tagName:"g"};const _h=`X6.${gt.name}`;class SC{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,s,o,r;const a=[];return Object.keys(e).forEach(l=>{const c=e[l],h=this.getDefinition(l),u=F(B3,this.view,h,c,{elem:t,attrs:e,cell:this.cell,view:this.view});if(h&&u)typeof h=="string"?(n==null&&(n={}),n[h]=c):c!==null&&a.push({name:l,definition:h});else{n==null&&(n={});const g=ac.includes(l)?l:rc(l);n[g]=c}}),a.forEach(({name:l,definition:c})=>{const h=e[l];typeof c.set=="function"&&(s==null&&(s={}),s[l]=h),typeof c.offset=="function"&&(o==null&&(o={}),o[l]=h),typeof c.position=="function"&&(r==null&&(r={}),r[l]=h)}),{raw:e,normal:n,set:s,offset:o,position:r}}mergeProcessedAttrs(t,e){var n;t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const s=(n=t.normal)===null||n===void 0?void 0:n.transform;s!=null&&e.normal&&(e.normal.transform=s),t.normal=e.normal}findAttrs(t,e,n,s){const o=[],r=new Wo;return Object.keys(t).forEach(a=>{const l=t[a];if(!ie(l))return;const{isCSSSelector:c,elems:h}=Yh(a,e,s);n[a]=h;for(let u=0,g=h.length;u<g;u+=1){const f=h[u],p=s&&s[a]===f,m=r.get(f);if(m){m.array||(o.push(f),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const b=m.attrs,y=m.priority;if(p)b.unshift(l),y.unshift(-1);else{const w=qb(y,c?-1:g);b.splice(w,0,l),y.splice(w,0,g)}}else r.set(f,{elem:f,attrs:l,priority:p?-1:g,array:!1})}}),o.forEach(a=>{const l=r.get(a),c=l.attrs;l.attrs=c.reduceRight((h,u)=>ft(h,u),{})}),r}updateRelativeAttrs(t,e,n){const s=e.raw||{};let o=e.normal||{};const r=e.set,a=e.position,l=e.offset,c=()=>({elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:n.clone()});if(r!=null&&Object.keys(r).forEach(b=>{const y=r[b],w=this.getDefinition(b);if(w!=null){const C=F(w.set,this.view,y,c());typeof C=="object"?o=Object.assign(Object.assign({},o),C):C!=null&&(o[b]=C)}}),t instanceof HTMLElement){this.view.setAttrs(o,t);return}const h=o.transform,u=h?`${h}`:null,g=Zn(u),f=new A(g.e,g.f);h&&(delete o.transform,g.e=0,g.f=0);let p=!1;a!=null&&Object.keys(a).forEach(b=>{const y=a[b],w=this.getDefinition(b);if(w!=null){const C=F(w.position,this.view,y,c());C!=null&&(p=!0,f.translate(A.create(C)))}}),this.view.setAttrs(o,t);let m=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(t);if(b.width>0&&b.height>0){const y=Xt(b,g);Object.keys(l).forEach(w=>{const C=l[w],x=this.getDefinition(w);if(x!=null){const E=F(x.offset,this.view,C,{elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:y});E!=null&&(m=!0,f.translate(A.create(E)))}})}}(h!=null||p||m)&&(f.round(1),g.e=f.x,g.f=f.y,t.setAttribute("transform",ti(g)))}update(t,e,n){const s={},o=this.findAttrs(n.attrs||e,t,s,n.selectors),r=n.attrs?this.findAttrs(e,t,s,n.selectors):o,a=[];o.each(h=>{const u=h.elem,g=h.attrs,f=this.processAttrs(u,g);if(f.set==null&&f.position==null&&f.offset==null)this.view.setAttrs(f.normal,u);else{const p=r.get(u),m=p?p.attrs:null,b=m&&g.ref==null?m.ref:g.ref;let y;if(b){if(y=(s[b]||this.view.find(b,t,n.selectors))[0],!y)throw new Error(`"${b}" reference does not exist.`)}else y=null;const w={node:u,refNode:y,attributes:m,processedAttributes:f},C=a.findIndex(x=>x.refNode===u);C>-1?a.splice(C,0,w):a.push(w)}});const l=new Wo;let c;a.forEach(h=>{const u=h.node,g=h.refNode;let f;const p=g!=null&&n.rotatableNode!=null&&To(n.rotatableNode,g);if(g&&(f=l.get(g)),!f){const y=p?n.rotatableNode:t;f=g?fe(g,{target:y}):n.rootBBox,g&&l.set(g,f)}let m;n.attrs&&h.attributes?(m=this.processAttrs(u,h.attributes),this.mergeProcessedAttrs(m,h.processedAttributes)):m=h.processedAttributes;let b=f;p&&n.rotatableNode!=null&&!n.rotatableNode.contains(u)&&(c||(c=Zn(W(n.rotatableNode,"transform"))),b=Xt(f,c)),this.updateRelativeAttrs(u,m,b)})}}class MC{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Wo,this.pathCache={}}get(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(e.matrix==null){const n=this.view.container;e.matrix=A6(t,n)}return kt(e.matrix)}getShape(t){const e=this.get(t);return e.shape==null&&(e.shape=Fc(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return e.boundingRect==null&&(e.boundingRect=F6(t)),e.boundingRect.clone()}}class BC{get cell(){return this.view.cell}constructor(t,e,n=[]){this.view=t;const s={},o={};let r=0;Object.keys(e).forEach(l=>{let c=e[l];Array.isArray(c)||(c=[c]),c.forEach(h=>{let u=s[h];u||(r+=1,u=s[h]=1<<r),o[l]|=u})});let a=n;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{s[l]||(r+=1,s[l]=1<<r)}),r>25)throw new Error("Maximum number of flags exceeded.");this.flags=s,this.attrs=o,this.bootstrap=n}getFlag(t){const e=this.flags;return e==null?0:Array.isArray(t)?t.reduce((n,s)=>n|e[s],0):e[t]|0}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs&&Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t}}class It extends jt{static getDefaults(){return It.defaults}static isCellView(t){if(t==null)return!1;if(t instanceof It)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Wh)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"}static config(t){It.defaults=It.getOptions(t)}static getOptions(t){const e=(c,h)=>h!=null?Rl([...Array.isArray(c)?c:[c],...Array.isArray(h)?h:[h]]):Array.isArray(c)?[...c]:[c],n=dt(It.getDefaults()),{bootstrap:s,actions:o,events:r,documentEvents:a}=t,l=Y(t,["bootstrap","actions","events","documentEvents"]);return s&&(n.bootstrap=e(n.bootstrap,s)),o&&Object.entries(o).forEach(([c,h])=>{const u=n.actions[c];h&&u?n.actions[c]=e(u,h):h&&(n.actions[c]=e(h))}),r&&(n.events=Object.assign(Object.assign({},n.events),r)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),a)),ft(n,l)}get[Symbol.toStringTag](){return Wh}constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new SC(this),this.flag=new BC(this,this.options.actions,this.options.bootstrap),this.cache=new MC(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return We(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,this.options.events!=null&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();e!=null&&this.setAttrs(e,t);const n=this.getContainerStyle();n!=null&&this.setStyle(n,t);const s=this.getContainerClassName();s!=null&&this.addClass(s,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,s){if(this.hasAction(t,e)){n();const o=[e];return s&&(typeof s=="string"?o.push(s):o.push(...s)),this.removeAction(t,o)}return t}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:t}){this.onAttrsChange(t)}onAttrsChange(t){let e=this.flag.getChangedFlag();t.updated||!e||(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,e,t))}parseJSONMarkup(t,e){const n=Lt.parseJSONMarkup(t),s=n.selectors,o=this.rootSelector;if(e&&o){if(s[o])throw new Error("Invalid root selector");s[o]=e}return n}can(t){let e=this.graph.options.interacting;if(typeof e=="function"&&(e=F(e,this.graph,this)),typeof e=="object"){let n=e[t];return typeof n=="function"&&(n=F(n,this.graph,this)),n!==!1}return typeof e=="boolean"?e:!1}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),s=this.getRootRotatedMatrix(),o=this.getRootTranslatedMatrix();return Xt(e,o.multiply(s).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),s=this.getRootTranslatedMatrix();return Xt(e,s.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const n=this.cell,s=n.isNode()?n.getAngle():0;e=n.getBBox().bbox(s)}else e=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return kt().translate(e.x,e.y)}getRootRotatedMatrix(){let t=kt();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const s=e.getBBox(),o=s.width/2,r=s.height/2;t=t.translate(o,r).rotate(n).translate(-o,-r)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){n.rootBBox==null&&(n.rootBBox=new P),n.selectors==null&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(t==null||t===this.container)}prepareHighlight(t,e={}){const n=t||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const 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}unhighlight(t,e={}){const 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}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,s,o){const r=this.cell,a=this.findAttr("port",t),l=t.getAttribute("data-selector"),c={cell:r.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,r.isNode()&&!r.hasPort(a)&&l==null&&(c.selector=this.getSelector(t))):l==null&&this.container!==t&&(c.selector=this.getSelector(t)),c}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,s=t.port;let o=t.magnet,r;return s!=null&&e.isNode()&&e.hasPort(s)?r=this.findPortElem(s,o)||n:(o||(o=t.selector),!o&&s!=null&&(o=`[port="${s}"]`),r=this.findOne(o,n,this.selectors)),r}hasTools(t){const e=this.tools;return e==null?!1:t==null?!0:e.name===t}addTools(t){if(this.removeTools(),t){if(!this.can("toolsAddable"))return this;const e=qe.isToolsView(t)?t:new qe(t);this.tools=e,e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const s=this,o=s.cell;return e==null||n==null?{e:t,view:s,cell:o}:{e:t,x:e,y:n,view:s,cell:o}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){this.notify("cell:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,s){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),this.notify(e,Object.assign({},this.getEventArgs(t,n,s)))}onMagnetMouseDown(t,e,n,s){}onMagnetDblClick(t,e,n,s){}onMagnetContextMenu(t,e,n,s){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.getEventTarget(t,{fromPoint:!0}),n=this.graph.findViewByElem(e);n!==this&&(this.onMouseLeave(t),n&&n.onMouseEnter(t))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}It.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},It.registry=yt.create({type:"view"}),X([$()],It.prototype,"dispose",null);const Wh=`X6.${It.name}`;class qe extends jt{static isToolsView(t){if(t==null)return!1;if(t instanceof qe)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===qh)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return qh}constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}createContainer(t,e){const n=t?We("g",!0):We("div",!1);return Q(n,this.prefixClassName("cell-tools")),e.className&&Q(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!It.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(Q(this.svgContainer,this.prefixClassName("edge-tools")),Q(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(Q(this.svgContainer,this.prefixClassName("node-tools")),Q(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));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach(s=>{gt.isToolItem(s)?s.name==="vertices"?n.unshift(s):n.push(s):(typeof s=="object"?s.name:s)==="vertices"?n.unshift(s):n.push(s)});for(let s=0;s<n.length;s+=1){const o=n[s];let r;if(gt.isToolItem(o))r=o;else{const a=typeof o=="object"?o.name:o,l=typeof o=="object"?o.args||{}:{};if(a){if(this.cell.isNode()){const c=Ei.get(a);if(c)r=new c(l);else return Ei.onNotFound(a)}else if(this.cell.isEdge()){const c=Si.get(a);if(c)r=new c(l);else return Si.onNotFound(a)}}}r&&(r.config(this.cellView,this),r.render(),(r.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(r.container),this.tools.push(r))}return this}update(t={}){const e=this.tools;return e&&e.forEach(n=>{t.toolId!==n.cid&&n.isVisible()&&n.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(n=>{t===n?n.show():n.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(n=>{n!==t&&!n.isVisible()&&(n.show(),n.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(e=>e.remove()),this.tools=null),Wt(this.svgContainer),Wt(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some(o=>o.options.isSVGElement!==!1),s=t.some(o=>o.options.isSVGElement===!1);n&&(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer),s&&this.graph.container.appendChild(this.htmlContainer)}return this}}qe.toStringTag=`X6.${qe.name}`;const qh=`X6.${qe.name}`,kC=i=>i;function Xh(i,t){return t===0?"0%":`${Math.round(i/t*100)}%`}function $h(i){return(e,n,s,o)=>n.isEdgeElement(s)?IC(i,e,n,s,o):TC(i,e,n,s,o)}function TC(i,t,e,n,s){const o=e.cell,r=o.getAngle(),a=e.getUnrotatedBBoxOfElement(n),l=o.getBBox().getCenter(),c=A.create(s).rotate(r,l);let h=c.x-a.x,u=c.y-a.y;return i&&(h=Xh(h,a.width),u=Xh(u,a.height)),t.anchor={name:"topLeft",args:{dx:h,dy:u,rotate:!0}},t}function IC(i,t,e,n,s){const o=e.getConnection();if(!o)return t;const r=o.closestPointLength(s);if(i){const a=o.length();t.anchor={name:"ratio",args:{ratio:r/a}}}else t.anchor={name:"length",args:{length:r}};return t}const PC=$h(!0),OC=$h(!1),Zh=Object.freeze(Object.defineProperty({__proto__:null,noop:kC,pinAbsolute:OC,pinRelative:PC},Symbol.toStringTag,{value:"Module"}));yt.create({type:"connection strategy"}).register(Zh,!0);function tu(i,t,e,n){return F(Zh.pinRelative,this.graph,{},t,e,i,this.cell,n,{}).anchor}function eu(i,t){return t?i.cell.getBBox():i.cell.isEdge()?i.getConnection().bbox():i.getUnrotatedBBoxOfElement(i.container)}class Ci extends gt{get type(){return this.options.type}onRender(){Q(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,s=this.cellView,o=this.options,r=s.getTerminalAnchor(n),a=s.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${r.x}, ${r.y})`);const l=a?o.customAnchorAttrs:o.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{e.setAttribute(c,l[c])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,s=this.cellView,o=s.getTerminalView(n);if(o){const r=o.cell,a=s.getTerminalMagnet(n);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,h,u;o.isEdgeElement(a)?(c=o.getBBox(),h=0,u=c.getCenter()):(c=o.getUnrotatedBBoxOfElement(a),h=r.getAngle(),u=c.getCenter(),h&&u.rotate(-h,r.getBBox().getCenter())),c.inflate(l),W(e,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${u.x}, ${u.y}) rotate(${h})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(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}))}resetAnchor(t){const 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})}onMouseMove(t){const e=this.type,n=this.cellView,s=n.getTerminalView(e);if(s==null)return;const o=this.normalizeEvent(t),r=s.cell,a=n.getTerminalMagnet(e);let l=this.graph.coord.clientToLocalPoint(o.clientX,o.clientY);const c=this.options.snap;if(typeof c=="function"){const g=F(c,n,l,s,a,e,n,this);l=A.create(g)}if(this.options.restrictArea)if(s.isEdgeElement(a)){const g=s.getClosestPoint(l);g&&(l=g)}else{const g=s.getUnrotatedBBoxOfElement(a),f=r.getAngle(),p=r.getBBox().getCenter(),m=l.clone().rotate(f,p);g.containsPoint(m)||(l=g.getNearestPointToPoint(m).rotate(-f,p))}let h;const u=this.options.anchor;typeof u=="function"&&(h=F(u,n,l,s,a,e,n,this)),this.resetAnchor(h),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(t===!0?void 0:t),this.update()}}Ci.defaults=Object.assign(Object.assign({},gt.getDefaults()),{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:tu,snap(i,t,e,n,s,o){const r=o.options.snapRadius||0,a=n==="source",l=a?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return c&&(Math.abs(c.x-i.x)<r&&(i.x=c.x),Math.abs(c.y-i.y)<r&&(i.y=c.y)),i}});class nu extends Ci{}nu.defaults=Object.assign(Object.assign({},Ci.getDefaults()),{name:"source-anchor",type:"source"});class iu extends Ci{}iu.defaults=Object.assign(Object.assign({},Ci.getDefaults()),{name:"target-anchor",type:"target"});class Ai extends gt{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=Y(t,["class"]);this.setAttrs(n,this.container),e&&Q(this.container,e)}}onRender(){Q(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),s=n?n.start:e.getPointAtRatio(t),o=n&&n.vector().vectorAngle(new A(1,0))||0;if(!s)return this;const r=kt().translate(s.x,s.y).rotate(o);return yn(this.container,r,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),s=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(t,s),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,s=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,s.x,s.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}Ai.defaults=Object.assign(Object.assign({},gt.getDefaults()),{tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}});class su extends Ai{}su.defaults=Object.assign(Object.assign({},Ai.getDefaults()),{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"}});class ou extends Ai{}ou.defaults=Object.assign(Object.assign({},Ai.getDefaults()),{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"}});class cr extends gt{onRender(){if(Q(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=Y(t,["class"]);W(this.container,Xn(n)),e&&Q(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:s}=e,o=oe(e.padding);let r=eu(t,n);this.parent.options.local&&(r=r.translate({x:-r.x,y:-r.y})),r=r.moveAndExpand({x:-o.left,y:-o.top,width:o.left+o.right,height:o.top+o.bottom});const a=t.cell;if(a.isNode()){const l=a.getAngle();if(l!=null)if(s&&!this.parent.options.local){const c=a.getBBox().getCenter();Ko(this.container,l,c.x,c.y,{absolute:!0})}else s||(r=r.bbox(l))}return W(this.container,r.toJSON()),this}}cr.defaults=Object.assign(Object.assign({},gt.getDefaults()),{name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}});class xi extends gt{onRender(){Q(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();yn(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:s=0}=e;const{offset:o,useCellGeometry:r,rotate:a}=e;let l=eu(t,r);const c=t.cell.getAngle();a||(l=l.bbox(c));let h=0,u=0;typeof o=="number"?(h=o,u=o):typeof o=="object"&&(h=o.x,u=o.y),n=Gt(n,l.width),s=Gt(s,l.height);let g=kt();return this.parent.options.local?g=g.translate(l.width/2,l.height/2):g=g.translate(l.x+l.width/2,l.y+l.height/2),a&&(g=g.rotate(c)),g=g.translate(n+h-l.width/2,s+u-l.height/2),g}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:s=0,rotate:o}=e,r=Gt(s,1),a=r>=0&&r<=1?t.getTangentAtRatio(r):t.getTangentAtLength(r),l=a?a.start:t.getConnection().start,c=a&&a.vector().vectorAngle(new A(1,0))||0;let h=kt().translate(l.x,l.y).rotate(c);return typeof n=="object"?h=h.translate(n.x||0,n.y||0):h=h.translate(0,n),o||(h=h.rotate(-c)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;typeof e=="function"&&F(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}xi.defaults=Object.assign(Object.assign({},gt.getDefaults()),{name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}});class hr extends xi{}hr.defaults=Object.assign(Object.assign({},xi.getDefaults()),{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,useCellGeometry:!0,onClick({view:i,btn:t}){t.parent.remove(),i.cell.remove({ui:!0,toolId:t.cid})}});class vi extends gt{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const t=this.cellView;t&&t.on("cell:dblclick",this.dblClick)}createElement(){const t=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=We("div",!1),this.addClass(t,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:t,editor:e}=this;if(!e)return;const{style:n}=e;t.isNode()?this.updateNodeEditorTransform():t.isEdge()&&this.updateEdgeEditorTransform();const{attrs:s}=this.options;n.fontSize=`${s.fontSize}px`,n.fontFamily=s.fontFamily,n.color=s.color,n.backgroundColor=s.backgroundColor;const o=this.getCellText()||"";return e.innerText=o,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:t,cell:e,editor:n}=this;if(!n)return;let s=A.create(),o=20,r="",{x:a,y:l}=this.options;const{width:c,height:h}=this.options;if(typeof a<"u"&&typeof l<"u"){const f=e.getBBox();a=Gt(a,f.width),l=Gt(l,f.height),s=f.topLeft.translate(a,l),o=f.width-a*2}else{const f=e.getBBox();s=f.center,o=f.width-4,r="translate(-50%, -50%)"}const u=t.scale(),{style:g}=n;s=t.localToGraph(s),g.left=`${s.x}px`,g.top=`${s.y}px`,g.transform=`scale(${u.sx}, ${u.sy}) ${r}`,g.minWidth=`${o}px`,typeof c=="number"&&(g.width=`${c}px`),typeof h=="number"&&(g.height=`${h}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:t,editor:e}=this;if(!e)return;let n=A.create(),s=20;const{style:o}=e,r=this.event.target,a=r.parentElement;if(a&&ge(a,this.prefixClassName("edge-label"))){const h=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);const u=a.getAttribute("transform"),{translation:g}=hs(u);n=new A(g.tx,g.ty),s=fe(r).width}else{if(!this.options.labelAddable)return this;n=t.clientToLocal(A.create(this.event.clientX,this.event.clientY));const u=this.cellView.path.closestPointLength(n);this.distance=u,this.labelIndex=-1}n=t.localToGraph(n);const c=t.scale();o.left=`${n.x}px`,o.top=`${n.y}px`,o.minWidth=`${s}px`,o.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}updateCell(){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}onDocumentMouseUp(t){this.editor&&t.target!==this.editor&&this.updateCell()}onCellDblClick({e:t}){this.editor||(t.stopPropagation(),this.removeElement(),this.event=t,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}getCellText(){const{getText:t}=this.options;if(typeof t=="function")return F(t,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof t=="string"){if(this.cell.isNode())return this.cell.attr(t);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${t}`)}}setCellText(t){const e=this.options.setText;if(typeof e=="function"){F(e,this.cellView,{cell:this.cell,value:t,index:this.labelIndex,distance:this.distance});return}if(typeof e=="string"){if(this.cell.isNode()){t!==null&&this.cell.attr(e,t);return}if(this.cell.isEdge()){const n=this.cell;if(this.labelIndex===-1){if(t){const s={position:{distance:this.distance},attrs:{}};bn(s,`attrs/${e}`,t),n.appendLabel(s)}}else t!==null?n.prop(`labels/${this.labelIndex}/attrs/${e}`,t):typeof this.labelIndex=="number"&&n.removeLabelAt(this.labelIndex)}}}onRemove(){const t=this.cellView;t&&t.off("cell:dblclick",this.dblClick),this.removeElement()}}vi.defaults=Object.assign(Object.assign({},gt.getDefaults()),{tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}});class ru extends vi{}ru.defaults=ft({},vi.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"});class au extends vi{}au.defaults=ft({},vi.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"});class ur extends gt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}getPoints(){const e=this.cellView.routePoints;if(e.length<=2)return e;const n=[e[0]];for(let s=1;s<e.length-1;s++){const o=n[n.length-1],r=e[s],a=e[s+1];(r.x-o.x)*(a.y-o.y)-(r.y-o.y)*(a.x-o.x)!==0&&n.push(r)}return n.push(e[e.length-1]),n}onRender(){Q(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.getPoints()];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,s=e.length;n<s-1;n+=1){const o=e[n],r=e[n+1],a=this.renderHandle(o,r,n);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(t,e,n){const s=this.options.createHandle({index:n,graph:this.graph,guard:o=>this.guard(o),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(s),this.updateHandle(s,t,e),this.container.appendChild(s.container),this.startHandleListening(s),s}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let n=0,s=e.length;n<s;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,s={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,s):n.removeProp([t,"anchor"],s)}snapHandle(t,e,n){const s=t.options.axis,o=t.options.index,l=this.cellView.cell.getVertices(),c=l[o-2]||n.sourceAnchor,h=l[o+1]||n.targetAnchor,u=this.options.snapRadius;return Math.abs(e[s]-c[s])<u?e[s]=c[s]:Math.abs(e[s]-h[s])<u&&(e[s]=h[s]),e}onHandleChanging({handle:t,e}){const n=this.graph,s=this.options,o=this.cellView,r=s.anchor,a=t.options.axis,l=t.options.index-1,c=this.getEventData(e),h=this.normalizeEvent(e),u=n.snapToGrid(h.clientX,h.clientY),g=this.snapHandle(t,u.clone(),c),f=dt(this.vertices);let p=f[l],m=f[l+1];const b=o.sourceView,y=o.sourceBBox;let w=!1,C=!1;if(p?l===0?y.containsPoint(p)?(f.shift(),this.shiftHandleIndexes(-1),w=!0):(p[a]=g[a],C=!0):p[a]=g[a]:(p=o.sourceAnchor.toJSON(),p[a]=g[a],y.containsPoint(p)?w=!0:(f.unshift(p),this.shiftHandleIndexes(1),C=!0)),typeof r=="function"&&b){if(w){const M=c.sourceAnchor.clone();M[a]=g[a];const k=F(r,o,M,b,o.sourceMagnet||b.container,"source",o,this);this.resetAnchor("source",k)}C&&this.resetAnchor("source",c.sourceAnchorDef)}const x=o.targetView,E=o.targetBBox;let S=!1,v=!1;if(m?l===f.length-2?E.containsPoint(m)?(f.pop(),S=!0):(m[a]=g[a],v=!0):m[a]=g[a]:(m=o.targetAnchor.toJSON(),m[a]=g[a],E.containsPoint(m)?S=!0:(f.push(m),v=!0)),typeof r=="function"&&x){if(S){const M=c.targetAnchor.clone();M[a]=g[a];const k=F(r,o,M,x,o.targetMagnet||x.container,"target",o,this);this.resetAnchor("target",k)}v&&this.resetAnchor("target",c.targetAnchorDef)}A.equalPoints(f,this.vertices)||this.cellView.cell.setVertices(f,{ui:!0,toolId:this.cid}),this.updateHandle(t,p,m,0),s.stopPropagation||o.notifyMouseMove(h,u.x,u.y)}onHandleChange({handle:t,e}){const n=this.options,s=this.handles,o=this.cellView,r=t.options.index;if(Array.isArray(s)){for(let a=0,l=s.length;a<l;a+=1)a!==r&&s[a].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:o.sourceAnchor.clone(),targetAnchor:o.targetAnchor.clone(),sourceAnchorDef:dt(this.cell.prop(["source","anchor"])),targetAnchorDef:dt(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const a=this.normalizeEvent(e),l=this.graph.snapToGrid(a.clientX,a.clientY);o.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(s,o.x,o.y),n.checkMouseleave(s),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,s=0){const o=this.options.precision||0,r=Math.abs(e.x-n.x)<o,a=Math.abs(e.y-n.y)<o;if(r||a){const l=new z(e,n);if(l.length()<this.options.threshold)t.hide();else{const h=l.getCenter(),u=r?"x":"y";h[u]+=s||0;const g=l.vector().vectorAngle(new A(1,0));t.updatePosition(h.x,h.y,g,this.cellView),t.show(),t.options.axis=u}}else t.hide()}onRemove(){this.resetHandles()}}ur.defaults=Object.assign(Object.assign({},gt.defaults),{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:i=>new NC(i),anchor:tu});let NC=class extends jt{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=We("rect",!0);const t=this.options.attrs;if(typeof t=="function"){const e=ur.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,s){const o=s.getClosestPoint(new A(t,e))||new A(t,e);let r=kt().translate(o.x,o.y);if(o.equals({x:t,y:e}))r=r.rotate(n);else{let l=new z(t,e,o.x,o.y).vector().vectorAngle(new A(1,0));l!==0&&(l+=90),r=r.rotate(l)}this.setAttrs({transform:ti(r),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(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))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}};const dr=et.prefix("edge-tool-vertex-path");class gr extends gt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=this.options.createHandle,r=this.options.processHandle,a=o({index:e,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});r&&r(a),a.updatePosition(s.x,s.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=this.handles[e];o&&o.updatePosition(s.x,s.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const 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)}stopHandleListening(t){const 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)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,s=t>0?n[t-1]:e.sourceAnchor,o=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:A.create(s),next:A.create(o)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:s}=this.graph.snapToGrid(e.clientX,e.clientY);return{e,x:n,y:s}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:s,y:o}=this.getMouseEventArgs(t);this.eventData(n,{start:{x:s,y:o}}),e.notifyMouseDown(n,s,o)}}onHandleChanging({handle:t,e}){const n=this.cellView,s=t.options.index,{e:o,x:r,y:a}=this.getMouseEventArgs(e),l={x:r,y:a};this.snapVertex(l,s),n.cell.setVertexAt(s,l,{ui:!0,toolId:this.cid}),t.updatePosition(l.x,l.y),this.options.stopPropagation||n.notifyMouseMove(o,r,a)}stopBatch(t){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),t&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies){this.stopBatch(this.eventData(t).vertexAdded);return}n.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(t).vertexAdded);const{e:o,x:r,y:a}=this.getMouseEventArgs(t);if(!this.options.stopPropagation){n.notifyMouseUp(o,r,a);const{start:l}=this.eventData(o);if(l){const{x:c,y:h}=l;c===r&&h===a&&n.onClick(o,r,a)}}n.checkMouseleave(o),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const s=this.getNeighborPoints(e),o=s.prev,r=s.next;Math.abs(t.x-o.x)<n?t.x=o.x:Math.abs(t.x-r.x)<n&&(t.x=r.x),Math.abs(t.y-o.y)<n?t.y=s.prev.y:Math.abs(t.y-r.y)<n&&(t.y=r.y)}}onHandleRemove({handle:t,e}){if(this.options.removable){const n=t.options.index,s=this.cellView;s.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),s.checkMouseleave(this.normalizeEvent(e))}}allowAddVertex(t){const e=this.guard(t),n=this.options.addable&&this.cellView.can("vertexAddable"),s=this.options.modifiers?Ne(t,this.options.modifiers):!0;return!e&&n&&s}onPathMouseDown(t){const e=this.cellView;if(!this.allowAddVertex(t))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),s=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const o=e.getVertexIndex(s.x,s.y);this.snapVertex(s,o),e.cell.insertVertex(s,o,{ui:!0,toolId:this.cid}),this.render();const r=this.handles[o];this.eventData(n,{vertexAdded:!0}),r.onMouseDown(n)}onRemove(){this.resetHandles()}}gr.defaults=Object.assign(Object.assign({},gt.getDefaults()),{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:i=>new RC(i),markup:[{tagName:"path",selector:"connection",className:dr,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${dr}`]:"onPathMouseDown",[`touchstart .${dr}`]:"onPathMouseDown"}});class RC extends jt{get graph(){return this.options.graph}constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=We("circle",!0);const t=this.options.attrs;if(typeof t=="function"){const e=gr.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(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}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}const DC={boundary:cr,button:xi,"button-remove":hr,"node-editor":ru},Ei=yt.create({type:"node tool",process(i,t){if(typeof t=="function")return t;let e=gt;const{inherit:n}=t,s=Y(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return s.name==null&&(s.name=i),e.define.call(e,s)}});Ei.register(DC,!0);const LC={boundary:cr,vertices:gr,segments:ur,button:xi,"button-remove":hr,"source-anchor":nu,"target-anchor":iu,"source-arrowhead":su,"target-arrowhead":ou,"edge-editor":au},Si=yt.create({type:"edge tool",process(i,t){if(typeof t=="function")return t;let e=gt;const{inherit:n}=t,s=Y(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return s.name==null&&(s.name=i),e.define.call(e,s)}});Si.register(LC,!0);class lu{constructor(t,e,n,s){var o;this.target=t,this.cell=(o=this.target.effect)===null||o===void 0?void 0:o.target,this.type=e,this.bubbles=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=0,this.timeStamp=performance.now(),this.currentTime=n,this.timelineTime=s}}function Ps(i){return i!=="offset"&&i!=="easing"&&i!=="composite"&&i!=="computedOffset"}function cu(i,t){return i==="reverse"||i==="alternate"&&t%2===1||i==="alternate-reverse"&&t%2===0}class QC{constructor(t,e){this._effect=null,this._currentTime=null,this._playbackRate=1,this._playState="idle",this._rafId=null,this._startTime=null,this._pausedTime=null,this._timeline=null,this.id="",this.onfinish=null,this.oncancel=null,this._effect=t,this._timeline=e??document.timeline}get effect(){return this._effect}get currentTime(){return this._currentTime}set currentTime(t){const e=this._timeline.currentTime;Ae(e)&&(this._startTime=e-t,this._currentTime=t)}get playbackRate(){return this._playbackRate}set playbackRate(t){const e=this._playbackRate;this._playbackRate=t;const n=this._timeline.currentTime;if(this._playState==="running"&&this._startTime!=null&&Ae(n)){const s=(n-this._startTime)*e;this._startTime=n-s/t}}get playState(){return this._playState}get timeline(){return this._timeline}play(){if(this._playState==="running"||!this._effect)return;const t=this._timeline.currentTime;Ae(t)&&(this._playState==="paused"?(this._startTime=t-this._pausedTime/this._playbackRate,this._pausedTime=null):(this._currentTime=0,this._startTime=t),this._playState="running",this._tick())}pause(){this._playState==="running"&&(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._pausedTime=this._currentTime,this._playState="paused")}finish(){var t;if(!this._effect)return;const e=this._effect.getComputedTiming(),n=this._playbackRate<0,{duration:s,endTime:o,direction:r,fill:a,iterations:l}=e;if(a==="forwards"||a==="both"){const h=n?0:l-1,u=cu(r,h);this._effect.apply(u||n?0:s)}else(a==="none"||a==="backwards")&&this._effect.apply(null);this._currentTime=n?0:o,this._playState="finished",this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null);const c=new lu(this,"finish",this._currentTime,this._timeline.currentTime);(t=this.onfinish)===null||t===void 0||t.call(this,c),this._effect.target.notify("animation:finish",c)}cancel(){var t;if(!this._effect)return;this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._playState="idle",this._currentTime=null,this._startTime=null,this._pausedTime=null,this._effect.apply(null);const e=new lu(this,"cancel",this._currentTime,this._timeline.currentTime);(t=this.oncancel)===null||t===void 0||t.call(this,e),this._effect.target.notify("animation:cancel",e)}updatePlaybackRate(t){this.playbackRate=t}reverse(){this.playbackRate=this.playbackRate*-1}_tick(){const t=this._timeline.currentTime;if(this._playState!=="running"||!this._effect||!Ae(t))return;const e=this._effect.getComputedTiming(),{duration:n,delay:s,iterations:o,direction:r,endTime:a}=e,l=(t-this._startTime)*this._playbackRate,c=l-s;let h=Math.floor(c/n);if(l>=a||l<0||n<=0){this.finish();return}if(l>=s){let u=c%n;h=Math.min(h,o-1),cu(r,h)&&(u=n-u),this._effect.apply(u)}this._currentTime=l,this._rafId=requestAnimationFrame(()=>this._tick())}}class VC{constructor(){this.animations=[]}addAnimation(t){this.animations.push(t)}getAnimations(){return this.animations}cancelAnimations(){this.animations.forEach(t=>{t.cancel()})}}class zC{constructor(t,e,n){this._originProps={},this._target=t,this._options=Ae(n)?{duration:n}:Object.assign({},n),this.setKeyframes(e)}get target(){return this._target}getKeyframes(){if(!this._keyframes||this._keyframes.length===0)return[];let t=[];if(Array.isArray(this._keyframes)&&(t=[...this._keyframes]),ie(this._keyframes)){const n=Object.values(this._keyframes).map(o=>Ga(o).length),s=Math.max(...n);for(let o=0;o<s;o++){const r={};Object.entries(this._keyframes).forEach(([a,l])=>{const c=Ga(l)[o];Ps(a)&&c!=null&&(r[a]=c)}),t.push(r)}}return t=t.map((e,n,s)=>{var o,r,a;const l=e??{},c={};return c.offset=l.offset,c.easing=(a=(o=l.easing)!==null&&o!==void 0?o:(r=s[n-1])===null||r===void 0?void 0:r.easing)!==null&&a!==void 0?a:this.getComputedTiming().easing,Object.keys(l).forEach(h=>{Ps(h)&&(c[h]=l[h])}),c}),t=t.map((e,n)=>(e.offset==null?n===t.length-1?e.computedOffset=1:n===0?e.computedOffset=0:e.computedOffset=n/(t.length-1):e.computedOffset=e.offset,e)),t}setKeyframes(t){this._keyframes=t,this._computedKeyframes=this.getKeyframes(),this._computedKeyframes.forEach(e=>{Object.keys(e).forEach(n=>{Ps(n)&&this._originProps[n]==null&&(this._originProps[n]=this.target.getPropByPath(n))})})}getTiming(){return fb(this._options,FC)}getComputedTiming(){const t=this.getTiming(),e=t.duration*t.iterations;return Object.assign(Object.assign({},t),{activeDuration:e,endTime:e+t.delay})}apply(t){var e,n,s,o;if(!this._target||!this._computedKeyframes.length)return;if(t==null){Object.entries(this._originProps).forEach(([w,C])=>{this.target.setPropByPath(w,C)});return}const a=this.getComputedTiming().duration;if(a<0)return;const l=Math.min(t/a,1),c=this._computedKeyframes;if(c.length===0)return;let h={computedOffset:0},u={computedOffset:1};for(const w of c)if(l===0&&w.computedOffset===0&&(h=w),l===1&&w.computedOffset===1&&(u=w),w.computedOffset<l&&(h=w),w.computedOffset>l){u=w;break}const g=h.computedOffset,f=u.computedOffset,p=(l-g)/(f-g),m=(e=h.easing)!==null&&e!==void 0?e:u.easing,b=Gn(m),y=(n=M2[b])!==null&&n!==void 0?n:Jc;for(const w in Object.assign(Object.assign({},h),u))if(Ps(w)&&(h[w]!=null||u[w]!=null)){const C=(s=h[w])!==null&&s!==void 0?s:this._originProps[w],x=(o=u[w])!==null&&o!==void 0?o:this._originProps[w];let E;String(C).startsWith("#")?E=j6:w.endsWith("transform")&&!Ae(C)?E=G6:ii.test(String(C))||ii.test(String(x))?E=Kc:E=Uc;const v=E(C,x)(y(p));this.target.setPropByPath(w,v)}}}const FC={delay:0,direction:"normal",duration:0,easing:"linear",fill:"none",iterations:1};class hu extends Ft{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(dt(t)),this.changed={}}mutate(t,e={}){const n=e.unset===!0,s=e.silent===!0,o=[],r=this.changing;this.changing=!0,r||(this.previous=dt(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(t).forEach(h=>{const u=h,g=t[u];Ce(a[u],g)||o.push(u),Ce(l[u],g)?delete c[u]:c[u]=g,n?delete a[u]:a[u]=g}),!s&&o.length>0&&(this.pending=!0,this.pendingOptions=e,o.forEach(h=>{this.emit("change:*",{key:h,options:e,store:this,current:a[h],previous:l[h]})})),r)return this;if(!s)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}get(t,e){if(t==null)return this.data;const n=this.data[t];return n??e}getPrevious(t){if(this.previous){const e=this.previous[t];return e??void 0}}set(t,e,n){return t!=null&&(typeof t=="object"?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const s={};let o;if(typeof t=="string")s[t]=void 0,o=e;else if(Array.isArray(t))t.forEach(r=>s[r]=void 0),o=e;else{for(const r in this.data)s[r]=void 0;o=t}return this.mutate(s,Object.assign(Object.assign({},o),{unset:!0})),this}getByPath(t){return zo(this.data,t,"/")}setByPath(t,e,n={}){const s="/",o=Array.isArray(t)?[...t]:t.split(s),r=Array.isArray(t)?t.join(s):t,a=o[0],l=o.length;if(n.propertyPath=r,n.propertyValue=e,n.propertyPathArray=o,l===1)this.set(a,e,n);else{const c={};let h=c,u=a;for(let p=1;p<l;p+=1){const m=o[p],b=Number.isFinite(Number(m));h=h[u]=b?[]:{},u=m}bn(c,o,e,s);const g=dt(this.data);n.rewrite&&fc(g,t,s);const f=ft(g,c);this.set(a,f[a],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),s=n[0];if(n.length===1)this.remove(s,e);else{const o=n.slice(1),r=dt(this.get(s));r&&fc(r,o),this.set(s,r,e)}return this}hasChanged(t){return t==null?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(t==null)return this.hasChanged()?dt(this.changed):null;const e=this.changing?this.previous:this.data,n={};let s;for(const o in t){const r=t[o];Ce(e[o],r)||(n[o]=r,s=!0)}return s?dt(n):null}toJSON(){return dt(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}X([$()],hu.prototype,"dispose",null);class q extends Ft{static isCell(t){if(t==null)return!1;if(t instanceof q)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===q.toStringTag)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"}static normalizeTools(t){if(typeof t=="string")return{items:[t]};if(Array.isArray(t))return{items:t};if(t.items)return t;if(Reflect.has(t,"local")){const e=t,{local:n}=e,s=Y(e,["local"]);return{local:n,items:[s]}}return{items:[t]}}static getCommonAncestor(...t){const e=t.filter(s=>s!=null).map(s=>s.getAncestors()).sort((s,o)=>s.length-o.length);return e.shift().find(s=>e.every(o=>o.includes(s)))||null}static getCellsBBox(t,e={}){let n=null;for(let s=0,o=t.length;s<o;s+=1){const r=t[s];let a=r.getBBox(e);if(a){if(r.isNode()){const l=r.getAngle();l!=null&&l!==0&&(a=a.bbox(l))}n=n==null?a:n.union(a)}}return n}static deepClone(t){const e=[t,...t.getDescendants({deep:!0})];return q.cloneCells(e)}static cloneCells(t){const e=Rl(t),n=e.reduce((s,o)=>(s[o.id]=o.clone(),s),{});return e.forEach(s=>{const o=n[s.id];if(o.isEdge()){const l=o.getSourceCellId(),c=o.getTargetCellId();l&&n[l]&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:n[l].id})),c&&n[c]&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:n[c].id}))}const r=s.getParent();r&&n[r.id]&&o.setParent(n[r.id]);const a=s.getChildren();if(a&&a.length){const l=a.reduce((c,h)=>(n[h.id]&&c.push(n[h.id]),c),[]);l.length>0&&o.setChildren(l)}}),n}static config(t){const{markup:e,propHooks:n,attrHooks:s}=t,o=Y(t,["markup","propHooks","attrHooks"]);e!=null&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):typeof n=="function"?this.propHooks.push(n):Object.values(n).forEach(r=>{typeof r=="function"&&this.propHooks.push(r)})),s&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),s)),this.defaults=ft({},this.defaults,o)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:dt(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((n,s)=>s?F(s,t,n):n,e)}static generateId(t={}){return Lo()}get[Symbol.toStringTag](){return q.toStringTag}constructor(t={}){super();const n=this.constructor.getDefaults(!0),s=ft({},this.preprocess(n),this.preprocess(t));this.id=s.id||q.generateId(t),this.store=new hu(s),this.animationManager=new VC,this.setup(),this.init(),this.postprocess(t)}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,o=this.constructor.applyPropHooks(this,t);return n==null&&e!==!0&&(o.id=q.generateId(t)),o}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:n,previous:s,options:o}=t;this.notify("change:*",{key:e,options:o,current:n,previous:s,cell:this}),this.notify(`change:${e}`,{options:o,current:n,previous:s,cell:this});const r=e;(r==="source"||r==="target")&&this.notify("change:terminal",{type:r,current:n,previous:s,options:o,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this})),this.on("added",({cell:t})=>{const e=this.store.get("animation");yo(e)||e.forEach(n=>{t.animate(...n)})})}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify(`cell:${t}`,e),this.isNode()?n.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return t==null?this.store.get():this.store.get(t,e)}setProp(t,e,n){if(typeof t=="string")this.store.set(t,e,n);else{const s=this.preprocess(t,!0);this.store.set(ft({},this.getProp(),s),e),this.postprocess(t)}return this}removeProp(t,e){return typeof t=="string"||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return t==null?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&(t==="children"?this._children=e?e.map(s=>this.model.getCell(s)).filter(s=>s!=null):null:t==="parent"&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return n[0]==="attrs"&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return t==null?this.getProp():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getPropByPath(t):e==null?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){t==null?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n=e.getMaxZIndex(),s;t.deep?(s=this.getDescendants({deep:!0,breadthFirst:!0}),s.unshift(this)):s=[this],n=n-s.length+1;const o=e.total();let r=e.indexOf(this)!==o-s.length;r||(r=s.some((a,l)=>a.getZIndex()!==n+l)),r&&this.batchUpdate("to-front",()=>{n+=s.length,s.forEach((a,l)=>{a.setZIndex(n+l,t)})})}return this}toBack(t={}){const e=this.model;if(e){let n=e.getMinZIndex(),s;t.deep?(s=this.getDescendants({deep:!0,breadthFirst:!0}),s.unshift(this)):s=[this];let o=e.indexOf(this)!==0;o||(o=s.some((r,a)=>r.getZIndex()!==n+a)),o&&this.batchUpdate("to-back",()=>{n-=s.length,s.forEach((r,a)=>{r.setZIndex(n+a,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){t==null?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");return t==null&&(t=this.constructor.getMarkup()),t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){t==null?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(t==null)this.removeAttrs(e);else{const n=s=>this.store.set("attrs",s,e);if(e.overwrite===!0)n(t);else{const s=this.getAttrs();e.deep===!1?n(Object.assign(Object.assign({},s),t)):n(ft({},s,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const n=this.constructor.getAttrHooks()||{};let s=n[t]||ri.get(t);if(!s){const o=Gn(t);s=n[o]||ri.get(o)}return s||null}getAttrByPath(t){return t==null||t===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,n){return t==null?this.getAttrByPath():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getAttrByPath(t):e==null?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return this.store.get("visible")!==!1}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n=typeof t=="boolean"?t:!this.isVisible(),s=typeof t=="boolean"?e:t;return n?this.show(s):this.hide(s),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(t==null)this.removeData(e);else{const n=s=>this.store.set("data",s,e);if(e.overwrite===!0)n(t);else{const s=this.getData();e.deep===!1?n(typeof t=="object"?Object.assign(Object.assign({},s),t):t):n(ft({},s,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(n=>{var s;return(s=this.model)===null||s===void 0?void 0:s.getCell(n)}).filter(n=>n!=null);return this._children=e,[...e]}return null}hasParent(){return this.parent!=null}isParentOf(t){return t!=null&&t.getParent()===this}isChildOf(t){return t!=null&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(t){return this.children==null?-1:this.children.indexOf(t)}getChildAt(t){return this.children!=null&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();for(;n;)e.push(n),n=t.deep!==!1?n.getParent():null;return e}getDescendants(t={}){if(t.deep!==!1){if(t.breadthFirst){const e=[],n=this.getChildren()||[];for(;n.length>0;){const s=n.shift(),o=s.getChildren();e.push(s),o&&n.push(...o)}return e}{const e=this.getChildren()||[];return e.forEach(n=>{e.push(...n.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(t==null)return!1;if(e.deep!==!1){let n=this.getParent();for(;n;){if(n===t)return!0;n=n.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return t==null?!1:t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return q.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,t!=null?this.store.set("children",t.map(n=>n.id),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(n!=null&&t!=null){const s=this.getChildIndex(t);s!==-1&&(n.splice(s,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return q.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(t!=null&&t!==this){const s=t.getParent(),o=this!==s;let r=e;if(r==null&&(r=this.getChildCount(),o||(r-=1)),s){const l=s.getChildren();if(l){const c=l.indexOf(t);c>=0&&(t.setParent(null,n),l.splice(c,1),s.setChildren(l,n))}}let a=this.children;if(a==null?(a=[],a.push(t)):a.splice(r,0,t),t.setParent(this,n),this.setChildren(a,n),o&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(h=>h.updateParent(n)),c&&c.forEach(h=>h.updateParent(n))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(e!=null){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t);return this.children!=null&&n!=null&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),t.deep!==!1&&this.eachChild(n=>n.remove(t)),this.model&&this.model.removeCell(this,t),this.dispose()}),this}animate(t,e){var n;const s=Ae(e)?{duration:e}:Object.assign({},e),o=new zC(this,t,s),r=new QC(o,s.timeline);return this.animationManager.addAnimation(r),r.id=(n=s.id)!==null&&n!==void 0?n:"",r.play(),r}getAnimations(){return this.animationManager.getAnimations()}translate(t,e,n){return this}scale(t,e,n,s){return this}addTools(t,e,n){const s=Array.isArray(t)?t:[t],o=typeof e=="string"?e:null,r=typeof e=="object"?e:typeof n=="object"?n:{};if(r.reset)return this.setTools({name:o,items:s,local:r.local},r);let a=dt(this.getTools());if(a==null||o==null||a.name===o)return a==null&&(a={}),a.items||(a.items=[]),a.name=o,a.items=[...a.items,...s],this.setTools(Object.assign({},a),r)}setTools(t,e={}){return t==null?this.removeTools():this.store.set("tools",q.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return e==null?!1:t==null?!0:e.name===t}hasTool(t){const e=this.getTools();return e==null?!1:e.items.some(n=>typeof n=="string"?n===t:n.name===t)}removeTool(t,e={}){const n=dt(this.getTools());if(n){let s=!1;const o=n.items.slice(),r=a=>{o.splice(a,1),s=!0};if(typeof t=="number")r(t);else for(let a=o.length-1;a>=0;a-=1){const l=o[a];(typeof l=="string"?l===t:l.name===t)&&r(a)}s&&(n.items=o,this.setTools(n,e))}return this}getBBox(t){return new P}getConnectionPoint(t,e){return new A}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,s=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const p=this.constructor;throw new Error(`Unable to serialize ${s} missing "shape" prop, check the ${s} "${p.name||n.call(p)}"`)}const o=this.constructor,r=t.diff===!0,a=e.attrs||{},l=o.getDefaults(!0),c=r?this.preprocess(l,!0):l,h=c.attrs||{},u={};Object.entries(e).forEach(([p,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!ie(m))throw new Error(`Can only serialize ${s} with plain-object props, but got a "${n.call(m)}" type of key "${p}" on ${s} "${this.id}"`);if(p!=="attrs"&&p!=="shape"&&r){const b=c[p];Ce(m,b)&&delete e[p]}}),Object.keys(a).forEach(p=>{const m=a[p],b=h[p];Object.keys(m).forEach(y=>{const w=m[y],C=b?b[y]:null;w!=null&&typeof w=="object"&&!Array.isArray(w)?Object.keys(w).forEach(x=>{const E=w[x];if(b==null||C==null||!bt(C)||!Ce(C[x],E)){u[p]==null&&(u[p]={}),u[p][y]==null&&(u[p][y]={});const S=u[p][y];S[x]=E}}):(b==null||!Ce(C,w))&&(u[p]==null&&(u[p]={}),u[p][y]=w)})});const g=Object.assign(Object.assign({},e),{attrs:yo(u)?void 0:u});g.attrs==null&&delete g.attrs;const f=g;return f.angle===0&&delete f.angle,dt(f)}clone(t={}){if(!t.deep){const n=Object.assign({},this.store.get());t.keepId||delete n.id,delete n.parent,delete n.children;const s=this.constructor;return new s(n)}return q.deepClone(this)[this.id]}findView(t){return t.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const s=this.model;this.startBatch(t,n,s);const o=e();return this.stopBatch(t,n,s),o}dispose(){this.removeFromParent(),this.animationManager.cancelAnimations(),this.store.dispose()}}q.toStringTag="X6.cell",q.defaults={},q.attrHooks={},q.propHooks=[],X([$()],q.prototype,"dispose",null),q.config({propHooks(i){var{tools:t}=i,e=Y(i,["tools"]);return t&&(e.tools=q.normalizeTools(t)),e}});class UC{constructor(t){this.ports=[],this.groups={},this.init(dt(t))}getPorts(){return this.ports}getGroup(t){return t!=null?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||e.group==null&&t==null)}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),s=t?this.getGroup(t):null,o=s?s.position:null,r=o?o.name:null;let a;if(r!=null){const u=mi.get(r);if(u==null)return mi.onNotFound(r);a=u}else a=Th.left;const l=n.map(u=>u&&u.position&&u.position.args||{}),c=o&&o.args||{};return a(l,e,c).map((u,g)=>{const f=n[g];return{portLayout:u,portId:f.id,portSize:f.size,portAttrs:f.attrs,labelSize:f.label.size,labelLayout:this.getPortLabelLayout(f,A.create(u.position),e)}})}init(t){const{groups:e,items:n}=t;e!=null&&Object.keys(e).forEach(s=>{this.groups[s]=this.parseGroup(e[s])}),Array.isArray(n)&&n.forEach(s=>{this.ports.push(this.parsePort(s))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=ft({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=ft({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return typeof e.zIndex=="number"?e.zIndex:typeof t.zIndex=="number"||t.zIndex==="auto"?t.zIndex:"auto"}createPosition(t,e){return ft({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if(typeof t=="object")return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(typeof t=="object")return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const s=t.label.position.name||"left",o=t.label.position.args||{},r=Es.get(s)||Bh.left;return r?r(e,n,o):null}}let fr,pr;function uu(i,t){return t?fr!=null&&fr.exist(i):pr!=null&&pr.exist(i)}function KC(i){fr=i}function JC(i){pr=i}const du="X6.node";let gu=0;function jC(i){return i?Io(i):(gu+=1,`CustomNode${gu}`)}let Pt=class Dn extends q{static isNode(t){if(t==null)return!1;if(t instanceof Dn)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===du)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.size=="function"&&typeof n.position=="function"}static define(t){const{constructorName:e,overwrite:n}=t,s=Y(t,["constructorName","overwrite"]),o=Vo(jC(e||s.shape),this);return o.config(s),s.shape&&Dn.registry.register(s.shape,o,n),o}static create(t){const e=t.shape||"rect",n=Dn.registry.get(e);return n?new n(t):Dn.registry.onNotFound(e)}get[Symbol.toStringTag](){return Dn.toStringTag}constructor(t={}){super(t),this.initPorts()}preprocess(t,e){const{x:n,y:s,width:o,height:r}=t,a=Y(t,["x","y","width","height"]);if(n!=null||s!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:n??(l?l.x:0),y:s??(l?l.y:0)})}if(o!=null||r!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:o??(l?l.width:0),height:r??(l?l.height:0)})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,n){return t===void 0?this.getSize():typeof t=="number"?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return typeof t=="object"?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const s=n.direction;if(s){const o=this.getSize();switch(s){case"left":case"right":e=o.height;break;case"top":case"bottom":t=o.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[s];const l=Vt(this.getAngle()||0);n.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let h;a===0?h=c.getBottomLeft():a===1?h=c.getCorner():a===2?h=c.getTopRight():h=c.getOrigin();const u=h.clone().rotate(-l,c.getCenter()),g=Math.sqrt(t*t+e*e)/2;let f=a*Math.PI/2;f+=Math.atan(a%2===0?e/t:t/e),f-=Dt(l);const m=A.fromPolar(g,f,u).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(m.x,m.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,s={}){const o=this.getBBox().scale(t,e,n??void 0);return this.startBatch("scale",s),this.setPosition(o.x,o.y,s),this.resize(o.width,o.height,s),this.stopBatch("scale"),this}position(t,e,n){return typeof t=="number"?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const n=this.getParent();if(n!=null&&n.isNode()){const s=this.getPosition(),o=n.getPosition();return{x:s.x-o.x,y:s.y-o.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let s,o,r;if(typeof t=="object"?(s=t.x,o=t.y,r=e||{}):(s=t,o=e,r=n||{}),r.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();s+=l.x,o+=l.y}}if(r.deep){const a=this.getPosition();this.translate(s-a.x,o-a.y,r)}else this.store.set("position",{x:s,y:o},r);return this}translate(t=0,e=0,n={}){if(t===0&&e===0)return this;n.translateBy=n.translateBy||this.id;const s=this.getPosition();if(n.restrict!=null&&n.translateBy===this.id){const r=this.getBBox({deep:!0}),a=n.restrict,l=s.x-r.x,c=s.y-r.y,h=Math.max(a.x+l,Math.min(a.x+a.width+l-r.width,s.x+t)),u=Math.max(a.y+c,Math.min(a.y+a.height+c-r.height,s.y+e));t=h-s.x,e=u-s.y}const o={x:s.x+t,y:s.y+e};if(n.tx=t,n.ty=e,n.transition){let r=typeof n.transition!="object"?{}:Object.assign({},n.transition);r=Object.assign({duration:100,fill:"forwards"},r),this.animate({"position/x":o.x,"position/y":o.y},r),this.eachChild(a=>{var l;((l=n.exclude)===null||l===void 0?void 0:l.includes(a))||a.translate(t,e,n)})}else this.startBatch("translate",n),this.store.set("position",o,n),this.eachChild(r=>{var a;((a=n.exclude)===null||a===void 0?void 0:a.includes(r))||r.translate(t,e,n)}),this.stopBatch("translate",n);return this}angle(t,e){return t==null?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const s=this.getSize(),o=this.getPosition(),r=this.getBBox().getCenter();r.rotate(n-t,e.center);const a=r.x-s.width/2-o.x,l=r.y-s.height/2-o.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(o.x+a,o.y+l,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),q.getCellsBBox(e)}return P.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),s=n.getCenter(),o=t.getTerminal(e);if(o==null)return s;const r=o.port;if(!r||!this.hasPort(r))return s;const a=this.getPort(r);if(!a||!a.group)return s;const c=this.getPortsPosition(a.group)[r].position,h=A.create(c).translate(n.getOrigin()),u=this.getAngle();return u&&h.rotate(-u,s),h}fit(t={}){const n=(this.getChildren()||[]).filter(c=>c.isNode());if(n.length===0)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach(c=>{c.fit(t)});let{x:s,y:o,width:r,height:a}=q.getCellsBBox(n);const l=oe(t.padding);return s-=l.left,o-=l.top,r+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:s,y:o},size:{width:r,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Lt.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Lt.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Lt.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Lt.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Lt.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Lt.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return t.items==null&&(t.items=[]),t}getPorts(){return dt(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return dt(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return this.getPortIndex(t)!==-1}getPortIndex(t){const e=typeof t=="string"?t:t.id;return e!=null?this.ports.items.findIndex(n=>n.id===e):-1}getPortsPosition(t){const e=this.getSize();return this.port.getPortsLayoutByGroup(t,new P(0,0,e.width,e.height)).reduce((s,o)=>{const r=o.portLayout;return s[o.portId]={position:Object.assign({},r.position),angle:r.angle||0},s},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,s){if(typeof e=="string"||Array.isArray(e)){const a=this.prefixPortPath(t,e),l=n;return this.setPropByPath(a,l,s)}const o=this.prefixPortPath(t),r=e;return this.setPropByPath(o,r,n)}removePortProp(t,e,n){return typeof e=="string"||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,s){return e==null?this.getPortProp(t):typeof e=="string"||Array.isArray(e)?arguments.length===2?this.getPortProp(t,e):n==null?this.removePortProp(t,e,s):this.setPortProp(t,e,n,s):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(n===-1)throw new Error(`Unable to find port with id: "${t}"`);return e==null||e===""?["ports","items",`${n}`]:Array.isArray(e)?["ports","items",`${n}`,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const s=[...this.ports.items];return s.splice(t,0,e),this.setPropByPath("ports/items",s,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const o=[...this.ports.items].filter(r=>!t.some(a=>{const l=typeof a=="string"?a:a.id;return r.id===l}));this.setPropByPath("ports/items",o,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(r=>{r.id&&(e[r.id]=!0)});const n={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(r=>{r.id&&!e[r.id]&&(n[r.id]=!0)});const o=this.model;o&&!yo(n)&&(o.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&n[c]&&l.remove()}),o.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&n[c]&&l.remove()}))}validatePorts(){const t={},e=[];return this.ports.items.forEach(n=>{typeof n!="object"&&e.push(`Invalid port ${n}.`),n.id==null&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0}),e}generatePortId(){return Lo()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new UC(this.ports);const n=this.port.getPorts(),s=e?n.filter(r=>e.find(a=>a.id===r.id)?null:r):[...n],o=e?e.filter(r=>n.find(a=>a.id===r.id)?null:r):[];s.length>0&&this.notify("ports:added",{added:s,cell:this,node:this}),o.length>0&&this.notify("ports:removed",{removed:o,cell:this,node:this})}};Pt.toStringTag=du,Pt.registry=yt.create({type:"node",process(i,t){if(uu(i,!0))throw new Error(`Node with name '${i}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:i}),t;let e=Pt;const{inherit:n}=t,s=Y(t,["inherit"]);if(n)if(typeof n=="string"){const r=this.get(n);r==null?this.onNotFound(n,"inherited"):e=r}else e=n;s.constructorName==null&&(s.constructorName=i);const o=e.define.call(e,s);return o.config({shape:i}),o}}),Pt.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},Pt.config({propHooks(i){var{ports:t}=i,e=Y(i,["ports"]);return t&&(e.ports=Array.isArray(t)?{items:t}:t),e}}),JC(Pt.registry);const fu="X6.edge",pu="basic.edge";let mu=0;function GC(i){return i?Io(i):(mu+=1,`CustomEdge${mu}`)}let xt=class Ln extends q{static parseStringLabel(t){return{attrs:{label:{text:t}}}}static isEdge(t){if(t==null)return!1;if(t instanceof Ln)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===fu)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.disconnect=="function"&&typeof n.getSource=="function"&&typeof n.getTarget=="function"}static equalTerminals(t,e){const n=t,s=e;return n.cell===s.cell?n.port===s.port||n.port==null&&s.port==null:!1}static define(t){const{constructorName:e,overwrite:n}=t,s=Y(t,["constructorName","overwrite"]),o=Vo(GC(e||s.shape),this);return o.config(s),s.shape&&Ln.registry.register(s.shape,o,n),o}static create(t){const e=t.shape||"edge",n=Ln.registry.get(e);return n?new n(t):Ln.registry.onNotFound(e)}get[Symbol.toStringTag](){return Ln.toStringTag}constructor(t={}){super(t)}preprocess(t,e){const{source:n,sourceCell:s,sourcePort:o,sourcePoint:r,target:a,targetCell:l,targetPort:c,targetPoint:h}=t,g=Y(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),f=p=>typeof p=="string"||typeof p=="number";if(n!=null)if(q.isCell(n))g.source={cell:n.id};else if(f(n))g.source={cell:n};else if(A.isPoint(n))g.source=n.toJSON();else if(Array.isArray(n))g.source={x:n[0],y:n[1]};else{const p=n.cell;q.isCell(p)?g.source=Object.assign(Object.assign({},n),{cell:p.id}):g.source=n}if(s!=null||o!=null){let p=g.source;if(s!=null){const m=f(s)?s:s.id;p?p.cell=m:p=g.source={cell:m}}o!=null&&p&&(p.port=o)}else r!=null&&(g.source=A.create(r).toJSON());if(a!=null)if(q.isCell(a))g.target={cell:a.id};else if(f(a))g.target={cell:a};else if(A.isPoint(a))g.target=a.toJSON();else if(Array.isArray(a))g.target={x:a[0],y:a[1]};else{const p=a.cell;q.isCell(p)?g.target=Object.assign(Object.assign({},a),{cell:p.id}):g.target=a}if(l!=null||c!=null){let p=g.target;if(l!=null){const m=f(l)?l:l.id;p?p.cell=m:p=g.target={cell:m}}c!=null&&p&&(p.port=c)}else h!=null&&(g.target=A.create(h).toJSON());return super.preprocess(g,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,s={}){if(q.isCell(e))return this.store.set(t,ft({},n,{cell:e.id}),s),this;const o=e;return A.isPoint(e)||o.x!=null&&o.y!=null?(this.store.set(t,ft({},n,{x:o.x,y:o.y}),s),this):(this.store.set(t,dt(e),s),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(A.isPointLike(e))return A.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new A}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e=t==="source"?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};for(;e&&e.isEdge();){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){t==null?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return typeof t=="object"?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){t==null?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return typeof t=="object"?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return dt(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const s=this.getLabels(),o=s.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),s.splice(r,0,this.parseLabel(t)),this.setLabels(s,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return t!=null&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const s=this.getLabels();s[t]=this.parseLabel(e),this.setLabels(s,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),s=t!=null&&Number.isFinite(t)?t:-1,o=n.splice(s,1);return this.setLabels(n,e),o.length?o[0]:null}parseLabel(t){return typeof t=="string"?this.constructor.parseStringLabel(t):t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>o===r||Ce(o,r))?null:o):e?[...e]:[],s=t&&e?t.filter(o=>e.find(r=>o===r||Ce(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),s.length>0&&this.notify("labels:removed",{removed:s,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map(s=>A.toJSON(s)),e),this}insertVertex(t,e,n={}){const s=this.getVertices(),o=s.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),s.splice(r,0,A.toJSON(t)),this.setVertices(s,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){return t!=null&&Number.isFinite(t)?this.getVertices()[t]:null}setVertexAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const s=this.getVertices();s[t]=e,this.setVertices(s,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),s=t!=null&&Number.isFinite(t)?t:-1;return n.splice(s,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>A.equals(o,r))?null:o):e?[...e]:[],s=t&&e?t.filter(o=>e.find(r=>A.equals(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),s.length>0&&this.notify("vertexs:removed",{removed:s,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Lt.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints(s=>({x:(s.x||0)+t,y:(s.y||0)+e}),n)}scale(t,e,n,s={}){return this.applyToPoints(o=>A.create(o).scale(t,e,n).toJSON(),s)}applyToPoints(t,e={}){const n={},s=this.getSource(),o=this.getTarget();A.isPointLike(s)&&(n.source=t(s)),A.isPointLike(o)&&(n.target=t(o));const r=this.getVertices();return r.length>0&&(n.vertices=r.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(e=>A.create(e)),this.getTargetPoint()];return new Mt(t)}updateParent(t){let e=null;const n=this.getSourceCell(),s=this.getTargetCell(),o=this.getParent();return n&&s&&(n===s||n.isDescendantOf(s)?e=s:s.isDescendantOf(n)?e=n:e=q.getCommonAncestor(n,s)),o&&e&&e.id!==o.id&&o.unembed(this,t),e&&(!o||o.id!==e.id)&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),s=e.cell,o=n.cell;if(!s||!o)return!1;let r=s===o;if(!r&&t.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(r=a.isAncestorOf(l,t)||l.isAncestorOf(a,t))}return r}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>e!=null);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}};xt.toStringTag=fu,xt.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}},xt.registry=yt.create({type:"edge",process(i,t){if(uu(i,!1))throw new Error(`Edge with name '${i}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:i}),t;let e=xt;const{inherit:n="edge"}=t,s=Y(t,["inherit"]);if(typeof n=="string"){const r=this.get(n||"edge");r==null&&n?this.onNotFound(n,"inherited"):e=r}else e=n;s.constructorName==null&&(s.constructorName=i);const o=e.define.call(e,s);return o.config({shape:i}),o}}),xt.defaults={},KC(xt.registry),xt.config({shape:pu,propHooks(i){const{label:t,vertices:e}=i,n=Y(i,["label","vertices"]);if(t){n.labels==null&&(n.labels=[]);const s=typeof t=="string"?xt.parseStringLabel(t):t;n.labels.push(s)}return e&&Array.isArray(e)&&(n.vertices=e.map(s=>A.create(s).toJSON())),n}}),xt.registry.register(pu,xt);class mr extends Ft{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,n){let s,o;typeof e=="number"?(s=e,o=Object.assign({merge:!1},n)):(s=this.length,o=Object.assign({merge:!1},e)),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);const r=Array.isArray(t)?t:[t],a=this.comparator&&typeof e!="number"&&o.sort!==!1,l=this.comparator||null;let c=!1;const h=[],u=[];return r.forEach(g=>{const f=this.get(g);f?o.merge&&!g.isSameStore(f)&&(f.setProp(g.getProp(),n),u.push(f),a&&!c&&(l==null||typeof l=="function"?c=f.hasChanged():typeof l=="string"?c=f.hasChanged(l):c=l.some(p=>f.hasChanged(p)))):(h.push(g),this.reference(g))}),h.length&&(a&&(c=!0),this.cells.splice(s,0,...h),this.length=this.cells.length),c&&this.sort({silent:!0}),o.silent||(h.forEach((g,f)=>{const p={cell:g,index:s+f,options:o};this.trigger("added",p),o.dryrun||g.notify("added",Object.assign({},p))}),c&&this.trigger("sorted"),(h.length||u.length)&&this.trigger("updated",{added:h,merged:u,removed:[],options:o})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],s=this.removeCells(n,e);return!e.silent&&s.length>0&&this.trigger("updated",{options:e,removed:s,added:[],merged:[]}),Array.isArray(t)?s:s[0]}removeCells(t,e){const n=[];for(let s=0;s<t.length;s+=1){const o=this.get(t[s]);if(o==null)continue;const r=this.cells.indexOf(o);this.cells.splice(r,1),this.length-=1,delete this.map[o.id],n.push(o),this.unreference(o),e.silent||(this.trigger("removed",{cell:o,index:r,options:e}),e.dryrun||o.notify("removed",{cell:o,index:r,options:e})),e.dryrun||o.remove()}return n}reset(t,e={}){const n=this.cells.slice();if(e.diff||(n.forEach(s=>{this.unreference(s),s.remove()}),this.clean()),this.add(t,Object.assign({silent:!0},e)),!e.silent){const s=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:s});const o=[],r=[];s.forEach(a=>{n.some(c=>c.id===a.id)||o.push(a)}),n.forEach(a=>{s.some(c=>c.id===a.id)||r.push(a)}),this.trigger("updated",{options:e,added:o,removed:r,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return e?this.remove(e,t):null}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return e?this.remove(e,t):null}get(t){if(t==null)return null;const e=typeof t=="string"||typeof t=="number"?t:t.id;return this.map[e]||null}has(t){return this.get(t)!=null}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return this.comparator!=null&&(this.cells=wo(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger(`cell:${t}`,e),n&&(n.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}X([$()],mr.prototype,"dispose",null);const YC="X6.Model";class Yt extends Ft{static isModel(t){if(t==null)return!1;if(t instanceof Yt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===YC)&&typeof n.addNode=="function"&&typeof n.addEdge=="function"&&n.collection!=null}static toJSON(t,e={}){return{cells:t.map(n=>n.toJSON(e))}}static fromJSON(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach(n=>{n.shape==null&&(n.shape="rect"),e.push(n)}),t.edges&&t.edges.forEach(n=>{n.shape==null&&(n.shape="edge"),e.push(n)})),e.map(n=>{const s=n.shape;if(s){if(Pt.registry.exist(s))return Pt.create(n);if(xt.registry.exist(s))return xt.create(n)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new mr(t),this.setup()}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&(t==="sorted"||t==="reseted"||t==="updated"?n.trigger(`model:${t}`,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",e=>this.notify("updated",e)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:e})=>{this.onCellAdded(e)}),t.on("removed",e=>{const n=e.cell;this.onCellRemoved(n,e.options),this.notify("cell:removed",e),n.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:n}))}),t.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),t.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),t.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const s=t.getSource(),o=t.getTarget();if(s!=null&&s.cell){const r=this.outgoings[s.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.outgoings[s.cell])}if(o!=null&&o.cell){const r=this.incomings[o.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.incomings[o.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(e=>{this.onCellAdded(e)})}onEdgeTerminalChanged(t,e){const n=e==="source"?this.outgoings:this.incomings,s=t.previous(e);if(s!=null&&s.cell){const r=q.isCell(s.cell)?s.cell.id:s.cell,a=n[r],l=a?a.indexOf(t.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete n[r])}const o=t.getTerminal(e);if(o!=null&&o.cell){const r=q.isCell(o.cell)?o.cell.id:o.cell,a=n[r]||[];a.indexOf(t.id)===-1&&a.push(t.id),n[r]=a}}prepareCell(t,e){return!t.model&&(!e||!e.dryrun)&&(t.model=this),t.zIndex==null&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(n=>this.prepareCell(n,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(n=>this.prepareCell(n,{options:e})),this}clear(t={}){const e=this.getCells();if(e.length===0)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const s=e.sort((o,r)=>{const a=o.isEdge()?1:2,l=r.isEdge()?1:2;return a-l});for(;s.length>0;){const o=s.shift();o&&o.remove(n)}},n),this}addNode(t,e={}){const n=Pt.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}updateNode(t,e={}){const n=this.createNode(t),s=n.getProp();return n.dispose(),this.updateCell(s,e)}createNode(t){return Pt.create(t)}addEdge(t,e={}){const n=xt.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return xt.create(t)}updateEdge(t,e={}){const n=this.createEdge(t),s=n.getProp();return n.dispose(),this.updateCell(s,e)}addCell(t,e={}){return 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(n=>this.addCell(n,e)),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(n===0)return this;const s=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},s),{cells:t})),t.forEach(o=>{this.addCell(o,s),s.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},s),{cells:t})),this}updateCell(t,e={}){const n=t.id&&this.getCell(t.id);return n?this.batchUpdate("update",()=>(Object.entries(t).forEach(([s,o])=>{n.setProp(s,o,e)}),!0),t):!1}removeCell(t,e={}){const n=typeof t=="string"?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){if(t.id===e)return;this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});return this.addCell(n),this.getConnectedEdges(t).forEach(o=>{const r=o.getSourceCell(),a=o.getTargetCell();r===t&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:e})),a===t&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(n=>this.removeCell(n,e))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach(s=>{s.remove(e)}),n}disconnectConnectedEdges(t,e={}){const n=typeof t=="string"?t:t.id;this.getConnectedEdges(t).forEach(s=>{const o=s.getSourceCellId(),r=s.getTargetCellId();o===n&&s.setSource({x:0,y:0},e),r===n&&s.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(e=>this.getCell(e)).filter(e=>e!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e=typeof t=="string"?t:t.id,n=this.outgoings[e];return n?n.map(s=>this.getCell(s)).filter(s=>s==null?void 0:s.isEdge()):null}getIncomingEdges(t){const e=typeof t=="string"?t:t.id,n=this.incomings[e];return n?n.map(s=>this.getCell(s)).filter(s=>s==null?void 0:s.isEdge()):null}getConnectedEdges(t,e={}){const n=[],s=typeof t=="string"?this.getCell(t):t;if(s==null)return n;const o={},r=e.indirect;let a=e.incoming,l=e.outgoing;a==null&&l==null&&(a=l=!0);const c=(h,u)=>{const g=u?this.getOutgoingEdges(h):this.getIncomingEdges(h);if(g!=null&&g.forEach(f=>{o[f.id]||(n.push(f),o[f.id]=!0,r&&(a&&c(f,!1),l&&c(f,!0)))}),r&&h.isEdge()){const f=u?h.getTargetCell():h.getSourceCell();f!=null&&f.isEdge()&&(o[f.id]||(n.push(f),c(f,u)))}};if(l&&c(s,!0),a&&c(s,!1),e.deep){const h=s.getDescendants({deep:!0}),u={};h.forEach(f=>{f.isNode()&&(u[f.id]=!0)});const g=(f,p)=>{const m=p?this.getOutgoingEdges(f.id):this.getIncomingEdges(f.id);m!=null&&m.forEach(b=>{if(!o[b.id]){const y=b.getSourceCell(),w=b.getTargetCell();if(!e.enclosed&&y&&u[y.id]&&w&&u[w.id])return;n.push(b),o[b.id]=!0}})};h.forEach(f=>{f.isEdge()||(l&&g(f,!0),a&&g(f,!1))})}return n}isBoundary(t,e){const n=typeof t=="string"?this.getCell(t):t,s=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return s==null||s.length===0}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,t)){const s=this.getCell(n);s&&e.push(s)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,s=e.outgoing;n==null&&s==null&&(n=s=!0);const r=this.getConnectedEdges(t,e).reduce((a,l)=>{const c=l.hasLoop(e),h=l.getSourceCell(),u=l.getTargetCell();return n&&h&&h.isNode()&&!a[h.id]&&(c||h!==t&&(!e.deep||!h.isDescendantOf(t)))&&(a[h.id]=h),s&&u&&u.isNode()&&!a[u.id]&&(c||u!==t&&(!e.deep||!u.isDescendantOf(t)))&&(a[u.id]=u),a},{});if(t.isEdge()){if(n){const a=t.getSourceCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}if(s){const a=t.getTargetCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}}return Object.keys(r).map(a=>r[a])}isNeighbor(t,e,n={}){let s=n.incoming,o=n.outgoing;return s==null&&o==null&&(s=o=!0),this.getConnectedEdges(t,n).some(r=>{const a=r.getSourceCell(),l=r.getTargetCell();return!!(s&&a&&a.id===e.id||o&&l&&l.id===e.id)})}getSuccessors(t,e={}){const n=[];return this.search(t,(s,o)=>{s!==t&&this.matchDistance(o,e.distance)&&n.push(s)},Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let s=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return s=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),s}getPredecessors(t,e={}){const n=[];return this.search(t,(s,o)=>{s!==t&&this.matchDistance(o,e.distance)&&n.push(s)},Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let s=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return s=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),s}matchDistance(t,e){return e==null?!0:typeof e=="function"?e(t):Array.isArray(e)&&e.includes(t)?!0:t===e}getCommonAncestor(...t){const e=[];return t.forEach(n=>{n&&(Array.isArray(n)?e.push(...n):e.push(n))}),q.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],s={},o=[],r=[],a=l=>{s[l.id]||(n.push(l),s[l.id]=l,l.isEdge()&&r.push(l),l.isNode()&&o.push(l))};return t.forEach(l=>{a(l),e.deep&&l.getDescendants({deep:!0}).forEach(h=>{a(h)})}),r.forEach(l=>{const c=l.getSourceCell(),h=l.getTargetCell();c&&!s[c.id]&&(n.push(c),s[c.id]=c,c.isNode()&&o.push(c)),h&&!s[h.id]&&(n.push(h),s[h.id]=h,h.isNode()&&o.push(h))}),o.forEach(l=>{this.getConnectedEdges(l,e).forEach(h=>{const u=h.getSourceCell(),g=h.getTargetCell();!s[h.id]&&u&&s[u.id]&&g&&s[g.id]&&(n.push(h),s[h.id]=h)})}),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return q.cloneCells(t)}getNodesFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e||0}:t;return this.getNodes().filter(s=>s.getBBox().containsPoint(n))}getNodesInArea(t,e,n,s,o){const r=typeof t=="number"?new P(t,e,n,s):P.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getNodes().filter(c=>{const h=c.angle(),u=c.getBBox().bbox(h);return l?r.containsRect(u):r.isIntersectWithRect(u)})}getEdgesInArea(t,e,n,s,o){const r=typeof t=="number"?new P(t,e,n,s):P.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getEdges().filter(c=>{const h=c.getBBox();return h.width===0?h.inflate(1,0):h.height===0&&h.inflate(0,1),l?r.containsRect(h):r.isIntersectWithRect(h)})}getNodesUnderNode(t,e={}){const n=t.getBBox();return(e.by==null||e.by==="bbox"?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by])).filter(o=>t.id!==o.id&&!o.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return q.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const s=[],o={},r={};for(s.push(t),r[t.id]=0;s.length>0;){const a=s.shift();if(a==null||o[a.id]||(o[a.id]=!0,F(e,this,a,r[a.id])===!1))continue;this.getNeighbors(a,n).forEach(c=>{r[c.id]=r[a.id]+1,s.push(c)})}}depthFirstSearch(t,e,n={}){const s=[],o={},r={};for(s.push(t),r[t.id]=0;s.length>0;){const a=s.pop();if(a==null||o[a.id]||(o[a.id]=!0,F(e,this,a,r[a.id])===!1))continue;const l=this.getNeighbors(a,n),c=s.length;l.forEach(h=>{r[h.id]=r[a.id]+1,s.splice(c,0,h)})}}getShortestPath(t,e,n={}){const s={};this.getEdges().forEach(c=>{const h=c.getSourceCellId(),u=c.getTargetCellId();h&&u&&(s[h]||(s[h]=[]),s[u]||(s[u]=[]),s[h].push(u),n.directed||s[u].push(h))});const o=typeof t=="string"?t:t.id,r=J6(s,o,n.weight),a=[];let l=typeof e=="string"?e:e.id;for(r[l]&&a.push(l);r[l];){const c=r[l];a.unshift(c),l=c}return a}translate(t,e,n){return this.getCells().filter(s=>!s.hasParent()).forEach(s=>{s.translate(t,e,n)}),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,s={}){const o=this.getCellsBBox(n);if(o){const r=Math.max(t/o.width,0),a=Math.max(e/o.height,0),l=o.getOrigin();n.forEach(c=>{c.scale(r,a,l,s)})}return this}toJSON(t={}){return Yt.toJSON(this.getCells(),t)}parseJSON(t){return Yt.fromJSON(t)}fromJSON(t,e={}){let n=[];if(!e.diff)n=this.parseJSON(t);else{const s=t,{nodes:o=[],edges:r=[]}=s,a=Y(s,["nodes","edges"]),l=o.filter(h=>!this.nodes[h.id])||[],c=r.filter(h=>!this.edges[h.id])||[];n=this.parseJSON(Object.assign(Object.assign({},a),{nodes:l,edges:c}))}return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const s=e();return this.stopBatch(t,n),s}hasActiveBatch(t=Object.keys(this.batches)){return(Array.isArray(t)?t:[t]).some(n=>this.batches[n]>0)}dispose(){this.collection.dispose()}}X([$()],Yt.prototype,"dispose",null);const bu={fill:"#ffffff",stroke:"#333333",strokeWidth:2},HC={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"};let Mi=class extends Pt{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return t==null?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};Mi.config({attrs:{text:Object.assign({},HC)},propHooks(i){const{label:t}=i,e=Y(i,["label"]);return t&&bn(e,"attrs/text/text",t),e},visible:!0});function _C(i,t="body"){return[{tagName:i,selector:t},{tagName:"text",selector:"label"}]}function WC(i="xlink:href"){return e=>{const{imageUrl:n,imageWidth:s,imageHeight:o}=e,r=Y(e,["imageUrl","imageWidth","imageHeight"]);if(n!=null||s!=null||o!=null){const a=()=>{if(r.attrs){const l=r.attrs.image;n!=null&&(l[i]=n),s!=null&&(l.width=s),o!=null&&(l.height=o),r.attrs.image=l}};r.attrs?(r.attrs.image==null&&(r.attrs.image={}),a()):(r.attrs={image:{}},a())}return r}}function Mn(i,t,e={}){const n={constructorName:i,markup:_C(i,e.selector),attrs:{[i]:Object.assign({},bu)}};return(e.parent||Mi).define(ft(n,t,{shape:i}))}function yu(i){return typeof i=="string"?i:i.map(t=>Array.isArray(t)?t.join(","):A.isPointLike(t)?`${t.x}, ${t.y}`:"").join(" ")}Mn("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const qC=xt.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"}}});Mn("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});class $t extends vn{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(t){super(),this.graph=t,this.init()}init(){}}const wu={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onDragEnd"},Qe=1<<30,XC=1<<29;class Zt extends It{constructor(){super(...arguments),this.portsCache={}}static isNodeView(t){if(t==null)return!1;if(t instanceof Zt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Cu)&&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=="function"}get[Symbol.toStringTag](){return Cu}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const n=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?lt(e,n):Q(e,n)}else{const n=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(n):this.addClass(n)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(),"update"),n=this.handleAction(n,"update",()=>this.update(),"ports"),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>{this.getFlag("tools")===t?this.renderTools():this.updateTools(e)})),n}update(t){this.cleanCache(),this.removePorts();const e=this.cell,n=e.getSize(),s=e.getAttrs();this.updateAttrs(this.container,s,{attrs:t===s?null:t,rootBBox:new P(0,0,n.width,n.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.appendChild(e.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this.notify("view:render",{view:this}),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const s=n.portContentElement,o=n.portContentSelectors||{};return this.findOne(e,s,o)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(t=>{Wt(t.portElement)})}renderPorts(){const t=this.container,e=[];t.childNodes.forEach(r=>{e.push(r)});const n=this.cell.getParsedPorts(),s=Tl(n,"zIndex"),o="auto";s[o]&&s[o].forEach(r=>{const a=this.getPortElement(r);t.append(a),e.push(a)}),Object.keys(s).forEach(r=>{if(r!==o){const a=parseInt(r,10);this.appendPorts(s[r],a,e)}}),this.updatePorts()}appendPorts(t,e,n){const s=t.map(o=>this.getPortElement(o));n[e]||e<0?qn(n[Math.max(e,0)],s):Nt(this.container,s)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Lt.renderMarkup(this.cell.getPortContainerMarkup());const n=e.elem;if(n==null)throw new Error("Invalid port container markup.");e=Lt.renderMarkup(this.getPortMarkup(t));const s=e.elem,o=e.selectors;if(s==null)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},s);let r="x6-port";t.group&&(r+=` x6-port-${t.group}`),Q(n,r),Q(n,"x6-port"),Q(s,"x6-port-body"),n.appendChild(s);let a=o,l,c;if(this.existPortLabel(t)){if(e=Lt.renderMarkup(this.getPortLabelMarkup(t.label)),l=e.elem,c=e.selectors,l==null)throw new Error("Invalid port label markup.");if(o&&c){for(const u in c)if(o[u]&&u!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},o),c)}Q(l,"x6-port-label"),n.appendChild(l)}return this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:s,portContentSelectors:o},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:s,contentSelectors:o}),n}updatePorts(){const t=this.cell.getParsedGroups(),e=Object.keys(t);e.length===0?this.updatePortGroup():e.forEach(n=>{this.updatePortGroup(n)})}updatePortGroup(t){const e=P.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let s=0,o=n.length;s<o;s+=1){const r=n[s],a=r.portId,l=this.portsCache[a]||{},c=r.portLayout;if(this.applyPortTransform(l.portElement,c),r.portAttrs!=null){const u={selectors:l.portSelectors||{}};r.portSize&&(u.rootBBox=P.fromSize(r.portSize)),this.updateAttrs(l.portElement,r.portAttrs,u)}const h=r.labelLayout;if(h&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,h,-(c.angle||0)),h.attrs)){const u={selectors:l.portLabelSelectors||{}};r.labelSize&&(u.rootBBox=P.fromSize(r.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,u)}}}applyPortTransform(t,e,n=0){const s=e.angle,o=e.position,r=kt().rotate(n).translate(o.x||0,o.y||0).rotate(s||0);yn(t,r,{absolute:!0})}getPortMarkup(t){return t.markup||this.cell.portMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup}existPortLabel(t){return t.attrs&&t.attrs.text}getEventArgs(t,e,n){const s=this,o=s.cell,r=o;return e==null||n==null?{e:t,view:s,node:o,cell:r}:{e:t,x:e,y:n,view:s,node:o,cell:r}}getPortEventArgs(t,e,n){const s=this,o=s.cell,r=o;return n?{e:t,x:n.x,y:n.y,view:s,node:o,cell:r,port:e}:{e:t,view:s,node:o,cell:r,port:e}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}notifyPortEvent(t,e,n){const s=this.findAttr("port",e.target);if(s){const o=e.type;t==="node:port:mouseenter"?e.type="mouseenter":t==="node:port:mouseleave"&&(e.type="mouseleave"),this.notify(t,this.getPortEventArgs(e,s,n)),e.type=o}}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:click",t,{x:e,y:n})}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:dblclick",t,{x:e,y:n})}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:contextmenu",t,{x:e,y:n})}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.notifyPortEvent("node:port:mousedown",t,{x:e,y:n}),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const s=this.getEventData(t),o=s.action;if(o==="magnet")this.dragMagnet(t,e,n);else{if(o==="move"){const a=s.targetView||this;a.dragNode(t,e,n),a.notify("node:moving",{e:t,x:e,y:n,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(t,e,n),this.notifyPortEvent("node:port:mousemove",t,{x:e,y:n})}this.setEventData(t,s)}onMouseUp(t,e,n){const s=this.getEventData(t),o=s.action;o==="magnet"?this.stopMagnetDragging(t,e,n):(this.notifyMouseUp(t,e,n),this.notifyPortEvent("node:port:mouseup",t,{x:e,y:n}),o==="move"&&(s.targetView||this).stopNodeDragging(t,e,n));const r=s.targetMagnet;r&&this.onMagnetClick(t,r,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseenter",t),this.notifyPortEvent("node:port:mouseover",t)}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseleave",t),this.notifyPortEvent("node:port:mouseout",t)}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){super.onMouseWheel(t,e,n,s),this.notify("node:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,s){const o=this.graph;o.view.getMouseMovedCount(t)>o.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetDblClick(t,e,n,s){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetContextMenu(t,e,n,s){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetMouseDown(t,e,n,s){this.startMagnetDragging(t,n,s)}onCustomEvent(t,e,n,s){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),super.onCustomEvent(t,e,n,s)}prepareEmbedding(t){const e=this.graph,s=this.getEventData(t).cell||this.cell,o=e.findViewByCell(s),r=e.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:s,view:o,cell:s,x:r.x,y:r.y,currentParent:s.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,s=e.graph||this.graph,o=s.options.embedding,r=o.findParent;let a=typeof r=="function"?F(r,s,{view:this,node:this.cell}).filter(g=>q.isCell(g)&&this.cell.id!==g.id&&!g.isDescendantOf(this.cell)):s.model.getNodesUnderNode(n,{by:r});if(o.frontOnly&&a.length>0){const g=Tl(a,"zIndex"),f=Db(Object.keys(g).map(p=>parseInt(p,10)));f&&(a=g[f])}a=a.filter(g=>g.visible);let l=null;const c=e.candidateEmbedView,h=o.validate;for(let g=a.length-1;g>=0;g-=1){const f=a[g];if(c&&c.cell.id===f.id){l=c;break}else{const p=f.findView(s);if(h&&F(h,s,{child:this.cell,parent:p.cell,childView:this,parentView:p})){l=p;break}}}this.clearEmbedding(e),l&&l.highlight(null,{type:"embedding"}),e.candidateEmbedView=l;const u=s.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:s.findViewByCell(n),x:u.x,y:u.y,currentParent:n.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const n=e.cell||this.cell,s=e.graph||this.graph,o=s.findViewByCell(n),r=n.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,(r==null||r.id!==a.cell.id)&&a.cell.insertChild(n,void 0,{ui:!0})):r&&r.unembed(n,{ui:!0}),s.model.getConnectedEdges(n,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),o&&a){const l=s.snapToGrid(t.clientX,t.clientY);o.notify("node:embedded",{e:t,cell:n,x:l.x,y:l.y,node:n,view:s.findViewByCell(n),previousParent:r,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.findViewByCell(t)}return null}validateMagnet(t,e,n){if(e.getAttribute("magnet")!=="passive"){const s=this.graph.options.connecting.validateMagnet;return s?F(s,this.graph,{e:n,magnet:e,view:t,cell:t.cell}):!0}return!1}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const s=t.currentTarget,o=this.graph;this.setEventData(t,{targetMagnet:s}),this.validateMagnet(this,s,t)?(o.options.magnetThreshold<=0&&this.startConnectting(t,s,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,n),o.view.delegateDragEvents(t,this)}startConnectting(t,e,n,s){this.graph.model.startBatch("add-edge");const o=this.createEdgeFromMagnet(e,n,s);o.setEventData(t,o.prepareArrowheadDragging("target",{x:n,y:s,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:o}),o.notifyMouseDown(t,n,s)}getDefaultEdge(t,e){let n;const s=this.graph.options.connecting.createEdge;return s&&(n=F(s,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),n}createEdgeFromMagnet(t,e,n){const s=this.graph,o=s.model,r=this.getDefaultEdge(this,t);return r.setSource(Object.assign(Object.assign({},r.getSource()),this.getEdgeTerminal(t,e,n,r,"source"))),r.setTarget(Object.assign(Object.assign({},r.getTarget()),{x:e,y:n})),r.addTo(o,{async:!1,ui:!0}),r.findView(s)}dragMagnet(t,e,n){const s=this.getEventData(t),o=s.edgeView;if(o)o.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const r=this.graph,a=r.options.magnetThreshold,l=this.getEventTarget(t),c=s.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(r.view.getMouseMovedCount(t)<=a)return;this.startConnectting(t,c,e,n)}}stopMagnetDragging(t,e,n){const o=this.eventData(t).edgeView;o&&(o.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,s,o){let r=[o];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(o)&&(r=l.filter(c=>c.isNode()))}r.forEach(l=>{this.notify(t,{e,x:n,y:s,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?F(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}startNodeDragging(t,e,n){const s=this.getDelegatedView();if(s==null||!s.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:s,action:"move"});const o=A.create(s.cell.getPosition());s.setEventData(t,{moving:!1,offset:o.diff(e,n),restrict:this.getRestrictArea(s)})}dragNode(t,e,n){const s=this.cell,o=this.graph,r=o.getGridSize(),a=this.getEventData(t),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=re(e+l.x,r),u=re(n+l.y,r);s.setPosition(h,u,{restrict:c,deep:!0,ui:!0}),o.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}autoOffsetNode(){const t=this.cell,e=this.graph,n=Object.assign({id:t.id},t.getPosition()),o=e.getNodes().map(c=>{const h=c.getPosition();return{id:c.id,x:h.x,y:h.y}}).filter(c=>c.id!==n.id),r=[[1,1],[1,-1],[-1,1],[-1,-1]];let a=e.getGridSize();const l=c=>o.some(h=>h.x===c.x&&h.y===c.y);for(;l(n);){let c=!1;for(let h=0;h<r.length;h+=1){const u=r[h],g={x:n.x+u[0]*a,y:n.y+u[1]*a};if(!l(g)){t.translate(u[0]*a,u[1]*a),c=!0;break}}if(c)break;a+=e.getGridSize()}}stopNodeDragging(t,e,n){const s=this.getEventData(t),o=this.graph;s.embedding&&this.finalizeEmbedding(t,s),s.moving&&(o.options.translating.autoOffset&&this.autoOffsetNode(),this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),s.moving=!1,s.embedding=!1}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");n&&n.autoScroll(t,e)}}const Cu=`X6.${Zt.name}`;Zt.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"]}}),Zt.registry.register("node",Zt,!0);class Ve extends It{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}static isEdgeView(t){if(t==null)return!1;if(t instanceof Ve)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Au)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"&&typeof n.update=="function"&&typeof n.getConnection=="function"}get[Symbol.toStringTag](){return Au}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const n=this.cell.getSource();return new P(n.x,n.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new P(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const n=this.cell.getTarget();return new P(n.x,n.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new P(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}return this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","labels","tools"]),n):(n=this.handleAction(n,"update",()=>this.update(e)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(e)),n=this.handleAction(n,"tools",()=>this.renderTools()),n)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this.notify("view:render",{view:this}),this}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}customizeLabels(){if(this.labelContainer){const t=this.cell,e=t.labels;for(let n=0,s=e.length;n<s;n+=1){const o=e[n],r=this.labelCache[n],a=this.labelSelectors[n],l=this.graph.options.onEdgeLabelRendered;if(l){const c=l({edge:t,label:o,container:r,selectors:a});c&&(this.labelDestroyFn[n]=c)}}}}destroyCustomizeLabels(){const t=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let e=0,n=t.length;e<n;e+=1){const s=this.labelDestroyFn[e],o=this.labelCache[e],r=this.labelSelectors[e];s&&o&&r&&s({edge:this.cell,label:t[e],container:o,selectors:r})}this.labelDestroyFn={}}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let s=this.labelContainer;if(this.labelCache={},this.labelSelectors={},n<=0)return s&&s.parentNode&&s.parentNode.removeChild(s),this;s?this.empty(s):(s=le("g"),this.addClass(this.prefixClassName("edge-labels"),s),this.labelContainer=s);for(let o=0,r=e.length;o<r;o+=1){const a=e[o],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,h;if(l)c=l.node,h=l.selectors;else{const g=t.getDefaultLabel(),f=this.normalizeLabelMarkup(this.parseLabelMarkup(g.markup));c=f.node,h=f.selectors}c.setAttribute("data-index",`${o}`),s.appendChild(c);const u=this.rootSelector;if(h[u])throw new Error("Ambiguous label root selector.");h[u]=c,this.labelCache[o]=c,this.labelSelectors[o]=h}return s.parentNode==null&&this.container.appendChild(s),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(t={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(e==null)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],s=n.length;if(s>1){const o=n[1];if(e[o]){if(s===2)return typeof t.propertyValue=="object"&&ts(t.propertyValue,"markup");if(n[2]!=="markup")return!1}}}return!0}parseLabelMarkup(t){return t?typeof t=="string"?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=U.createVectors(t),n=document.createDocumentFragment();for(let s=0,o=e.length;s<o;s+=1){const r=e[s].node;n.appendChild(r)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(t==null)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const s=e.childNodes;return s.length>1||s[0].nodeName.toUpperCase()!=="G"?n=U.create("g").append(e):n=U.create(s[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.labelContainer){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),s=t.getDefaultLabel();for(let o=0,r=e.length;o<r;o+=1){const a=this.labelCache[o],l=this.labelSelectors[o];a.setAttribute("cursor",n?"move":"default");const c=e[o],h=ft({},s.attrs,c.attrs);this.updateAttrs(a,h,{selectors:l,rootBBox:c.size?P.fromSize(c.size):void 0})}}}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}update(t={}){var e;this.cleanCache(),this.updateConnection(t);const n=this.cell.getAttrs(),{text:s}=n,o=Y(n,["text"]);if(o!=null){if(((e=this.container)===null||e===void 0?void 0:e.tagName)==="g"&&this.isEdgeElement(this.container)&&ay){const r=this.container.parentNode;if(r){const a=this.container.nextSibling;r.removeChild(this.container),r.insertBefore(this.container,a)}}this.updateAttrs(this.container,o,{selectors:this.selectors})}return this.updateLabelPositions(),this.updateTools(t),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),s=[this.sourceAnchor,...n,this.targetAnchor],o=s.length,r=new Mt(s);r.simplify({threshold:.01});const a=r.points.map(c=>c.toJSON()),l=a.length;return o===l?0:(e.setVertices(a.slice(1,l-1),t),o-l)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return A.create(this.sourceAnchor);case"target":return A.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return A.create(this.sourcePoint);case"target":return A.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const n=this.sourceView;return n?this.sourceMagnet||n.container:null}case"target":{if(e.raw)return this.targetMagnet;const n=this.targetView;return n?this.targetMagnet||n.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const n=t.tx||0,s=t.ty||0;this.routePoints=new Mt(this.routePoints).translate(n,s).points,this.translateConnectionPoints(n,s),this.path.translate(n,s)}else{const n=e.getVertices(),s=this.findAnchors(n);this.sourceAnchor=s.source,this.targetAnchor=s.target,this.routePoints=this.findRoutePoints(n);const o=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=o.source,this.targetPoint=o.target;const r=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,r.source||this.sourcePoint,r.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,s=e.target,o=t[0],r=t[t.length-1];return s.priority&&!n.priority?this.findAnchorsOrdered("target",r,"source",o):this.findAnchorsOrdered("source",o,"target",r)}findAnchorsOrdered(t,e,n,s){let o,r;const a=this.cell,l=a[t],c=a[n],h=this.getTerminalView(t),u=this.getTerminalView(n),g=this.getTerminalMagnet(t),f=this.getTerminalMagnet(n);if(h){let p;e?p=A.create(e):u?p=f:p=A.create(c),o=this.getAnchor(l.anchor,h,g,p,t)}else o=A.create(l);if(u){const p=A.create(s||o);r=this.getAnchor(c.anchor,u,f,p,n)}else r=A.isPointLike(c)?A.create(c):new A;return{[t]:o,[n]:r}}getAnchor(t,e,n,s,o){const r=e.isEdgeElement(n),a=this.graph.options.connecting;let l=typeof t=="string"?{name:t}:t;if(!l){const u=r?(o==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(o==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof u=="string"?{name:u}:u}if(!l)throw new Error("Anchor should be specified.");let c;const h=l.name;if(r){const u=hi.get(h);if(typeof u!="function")return hi.onNotFound(h);c=F(u,this,e,n,s,l.args||{},o)}else{const u=fi.get(h);if(typeof u!="function")return fi.onNotFound(h);c=F(u,this,e,n,s,l.args||{},o)}return c?c.round(this.POINT_ROUNDING):new A}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||ar.normal,n=this.cell.getRouter()||e;let s;if(typeof n=="function")s=F(n,this,t,{},this);else{const o=typeof n=="string"?n:n.name,r=typeof n=="string"?{}:n.args||{},a=o?wi.get(o):ar.normal;if(typeof a!="function")return wi.onNotFound(o);s=F(a,this,t,r,this)}return s==null?t.map(o=>A.create(o)):s.map(o=>A.create(o))}findConnectionPoints(t,e,n){const s=this.cell,o=this.graph.options.connecting,r=s.getSource(),a=s.getTarget(),l=this.sourceView,c=this.targetView,h=t[0],u=t[t.length-1];let g;if(l&&!l.isEdgeElement(this.sourceMagnet)){const p=this.sourceMagnet||l.container,m=h||n,b=new z(m,e),y=r.connectionPoint||o.sourceConnectionPoint||o.connectionPoint;g=this.getConnectionPoint(y,l,p,b,"source")}else g=e;let f;if(c&&!c.isEdgeElement(this.targetMagnet)){const p=this.targetMagnet||c.container,m=a.connectionPoint||o.targetConnectionPoint||o.connectionPoint,b=u||e,y=new z(b,n);f=this.getConnectionPoint(m,c,p,y,"target")}else f=n;return{source:g,target:f}}getConnectionPoint(t,e,n,s,o){const r=s.end;if(t==null)return r;const a=typeof t=="string"?t:t.name,l=typeof t=="string"?{}:t.args,c=ai.get(a);if(typeof c!="function")return ai.onNotFound(a);const h=F(c,this,s,e,n,l||{},o);return h?h.round(this.POINT_ROUNDING):r}findMarkerPoints(t,e,n){const s=u=>{const g=this.cell.getAttrs(),f=Object.keys(g);for(let p=0,m=f.length;p<m;p+=1){const b=g[f[p]];if(b[`${u}Marker`]||b[`${u}-marker`]){const y=b.strokeWidth||b["stroke-width"];if(y)return parseFloat(y);break}}return null},o=t[0],r=t[t.length-1];let a,l;const c=s("source");c&&(a=e.clone().move(o||n,-c));const h=s("target");return h&&(l=n.clone().move(r||e,-h)),this.sourceMarkerPoint=a||e.clone(),this.targetMarkerPoint=l||n.clone(),{source:a,target:l}}findPath(t,e,n){const s=this.cell.getConnector()||this.graph.options.connecting.connector;let o,r,a;if(typeof s=="string"?o=s:(o=s.name,r=s.args),o){const c=ci.get(o);if(typeof c!="function")return ci.onNotFound(o);a=c}else a=ph.normal;const l=F(a,this,e,n,t,Object.assign(Object.assign({},r),{raw:!0}),this);return typeof l=="string"?J.parse(l):l}translateConnectionPoints(t,e){this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e),this.sourceMarkerPoint.translate(t,e),this.targetMarkerPoint.translate(t,e)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const e=this.cell,n=e.getLabels();if(n.length===0)return this;const s=e.getDefaultLabel(),o=this.normalizeLabelPosition(s.position);for(let r=0,a=n.length;r<a;r+=1){const l=n[r],c=this.labelCache[r];if(!c)continue;const h=this.normalizeLabelPosition(l.position),u=ft({},o,h),g=this.getLabelTransformationMatrix(u);c.setAttribute("transform",ti(g))}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,s=e[t],o=s&&s.cell,r=`${t}View`;if(!o)return this[r]=null,this.updateTerminalMagnet(t),!0;const a=n.getCellById(o);if(!a)throw new Error(`Edge's ${t} node with id "${o}" not exists`);const l=a.findView(n);return l?(this[r]=l,this.updateTerminalMagnet(t),!0):!1}updateTerminalMagnet(t){const e=`${t}Magnet`,n=this.getTerminalView(t);if(n){let s=n.getMagnetFromEdgeTerminal(this.cell[t]);s===n.container&&(s=null),this[e]=s}else this[e]=null}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&typeof e.position=="object"&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&typeof e.position=="object")return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&typeof t.position=="object")return t.position.options}mergeLabelPositionArgs(t,e){return t===null?null:t===void 0?e===null?null:e:ft({},e,t)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const t=this.cache.pathCache;return ts(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const t=this.cache.pathCache;return ts(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const t=this.cache.pathCache;return ts(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return this.path==null?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return this.path==null?null:(xe(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return this.path==null?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return this.path==null?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return this.path==null?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return this.path==null?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return this.path==null?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,s){const o={distance:0};let r=0,a;typeof n=="number"?(r=n,a=s):a=n,a!=null&&(o.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),h=a&&a.absoluteDistance&&a.reverseDistance,u=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},f=new A(t,e),p=u.closestPointT(f,g),m=this.getConnectionLength()||0;let b=u.lengthAtT(p,g);c&&(b=m>0?b/m:0),h&&(b=-1*(m-b)||1),o.distance=b;let y;l||(y=u.tangentAtT(p));let w;if(y)w=y.pointOffset(f);else{const C=u.pointAtT(p),x=f.diff(C);w={x:x.x,y:x.y}}return o.offset=w,o.angle=r,o}normalizeLabelPosition(t){return typeof t=="number"?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},s=e.angle||0,o=e.distance,r=o>0&&o<=1;let a=0;const l={x:0,y:0},c=e.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const h=l.x!==0||l.y!==0||a===0,u=n.keepGradient,g=n.ensureLegibility,f=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},m=r?o*this.getConnectionLength():o,b=f.tangentAtLength(m,p);let y,w=s;if(b){if(h)y=b.start,y.translate(l);else{const C=b.clone();C.rotate(-90,b.start),C.setLength(a),y=C.end}u&&(w=b.angle()+s,g&&(w=Vt((w+90)%180-90)))}else y=f.start,h&&y.translate(l);return kt().translate(y.x,y.y).rotate(w)}getVertexIndex(t,e){const s=this.cell.getVertices(),o=this.getClosestPointLength(new A(t,e));let r=0;if(o!=null)for(const a=s.length;r<a;r+=1){const l=s[r],c=this.getClosestPointLength(l);if(c!=null&&o<c)break}return r}getEventArgs(t,e,n){const s=this,o=s.cell,r=o;return e==null||n==null?{e:t,view:s,edge:o,cell:r}:{e:t,x:e,y:n,view:s,edge:o,cell:r}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const s=this.getEventData(t);switch(s.action){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);break}}return this.notifyMouseMove(t,e,n),s}onMouseUp(t,e,n){const s=this.getEventData(t);switch(s.action){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);break}}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),s}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){super.onMouseWheel(t,e,n,s),this.notify("edge:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,s){if(nc(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if(e==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,s)))}this.notifyMouseDown(t,n,s)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),super.onCustomEvent(t,e,n,s)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n),this.getEventData(t).stopPropagation&&t.stopPropagation()}startEdgeDragging(t,e,n){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(t,e,n);return}this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"})}dragEdge(t,e,n){const s=this.getEventData(t);s.moving||(s.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-s.x,n-s.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})}stopEdgeDragging(t,e,n){const s=this.getEventData(t);s.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),s.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),s={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:e.isNewEdge===!0,terminalType:t,initialMagnet:n,initialTerminal:co(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(s),s}createValidateConnectionArgs(t){const e=[];e[4]=t,e[5]=this;let n,s=0,o=0;t==="source"?(s=2,n="target"):(o=2,n="source");const r=this.cell[n],a=r.cell;if(a){let l;const c=e[s]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(r),l===c.container&&(l=void 0)),e[s+1]=l}return(l,c)=>(e[o]=l,e[o+1]=l.container===c?void 0:c,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){t.zIndex!=null&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}validateConnection(t,e,n,s,o,r,a){const l=this.graph.options.connecting,c=l.allowLoop,h=l.allowNode,u=l.allowEdge,g=l.allowPort,f=l.allowMulti,p=l.validateConnection,m=r?r.cell:null,b=o==="target"?n:t,y=o==="target"?s:e;let w=!0;const C=x=>{const E=o==="source"?a?a.port:null:m?m.getSourcePortId():null,S=o==="target"?a?a.port:null:m?m.getTargetPortId():null;return F(x,this.graph,{edge:m,edgeView:r,sourceView:t,targetView:n,sourcePort:E,targetPort:S,sourceMagnet:e,targetMagnet:s,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:o})};if(c!=null&&(typeof c=="boolean"?!c&&t===n&&(w=!1):w=C(c)),w&&g!=null&&(typeof g=="boolean"?!g&&y&&(w=!1):w=C(g)),w&&u!=null&&(typeof u=="boolean"?!u&&Ve.isEdgeView(b)&&(w=!1):w=C(u)),w&&h!=null&&y==null&&(typeof h=="boolean"?!h&&Zt.isNodeView(b)&&(w=!1):w=C(h)),w&&f!=null&&r){const x=r.cell,E=o==="source"?a:x.getSource(),S=o==="target"?a:x.getTarget(),v=a?this.graph.getCellById(a.cell):null;if(E&&S&&E.cell&&S.cell&&v)if(typeof f=="function")w=C(f);else{const M=this.graph.model.getConnectedEdges(v,{outgoing:o==="source",incoming:o==="target"});M.length&&(f==="withPort"?M.some(I=>{const O=I.getSource(),R=I.getTarget();return O&&R&&O.cell===E.cell&&R.cell===S.cell&&O.port!=null&&O.port===E.port&&R.port!=null&&R.port===S.port})&&(w=!1):f||M.some(I=>{const O=I.getSource(),R=I.getTarget();return O&&R&&O.cell===E.cell&&R.cell===S.cell})&&(w=!1))}}return w&&p!=null&&(w=C(p)),w}allowConnectToBlank(t){const e=this.graph,s=e.options.connecting.allowBlank;if(typeof s!="function")return!!s;const o=e.findViewByCell(t),r=t.getSourceCell(),a=t.getTargetCell(),l=e.findViewByCell(r),c=e.findViewByCell(a);return F(s,e,{edge:t,edgeView:o,sourceCell:r,targetCell:a,sourceView:l,targetView:c,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:o.sourceMagnet,targetMagnet:o.targetMagnet})}validateEdge(t,e,n){const s=this.graph;if(!this.allowConnectToBlank(t)){const r=t.getSourceCellId(),a=t.getTargetCellId();if(!(r&&a))return!1}const o=s.options.connecting.validateEdge;return o?F(o,s,{edge:t,type:e,previous:n}):!0}arrowheadDragging(t,e,n,s){s.x=e,s.y=n,s.currentTarget!==t&&(s.currentMagnet&&s.currentView&&s.currentView.unhighlight(s.currentMagnet,{type:"magnetAdsorbed"}),s.currentView=this.graph.findViewByElem(t),s.currentView?(s.currentMagnet=s.currentView.findMagnet(t),s.currentMagnet&&this.validateConnection(...s.getValidateConnectionArgs(s.currentView,s.currentMagnet),s.currentView.getEdgeTerminal(s.currentMagnet,e,n,this.cell,s.terminalType))?s.currentView.highlight(s.currentMagnet,{type:"magnetAdsorbed"}):s.currentMagnet=null):s.currentMagnet=null),s.currentTarget=t,this.cell.prop(s.terminalType,{x:e,y:n},Object.assign(Object.assign({},s.options),{ui:!0}))}arrowheadDragged(t,e,n){const s=t.currentView,o=t.currentMagnet;if(!o||!s)return;s.unhighlight(o,{type:"magnetAdsorbed"});const r=t.terminalType,a=s.getEdgeTerminal(o,e,n,this.cell,r);this.cell.setTerminal(r,a,{ui:!0})}snapArrowhead(t,e,n){const s=this.graph,{snap:o,allowEdge:r}=s.options.connecting,a=typeof o=="object"&&o.radius||50,l=typeof o=="object"&&o.anchor||"center",c=s.renderer.findViewsInArea({x:t-a,y:e-a,width:2*a,height:2*a},{nodeOnly:!0});if(r){const x=s.renderer.findEdgeViewsFromPoint({x:t,y:e},a).filter(E=>E!==this);c.push(...x)}const h=n.closestView||null,u=n.closestMagnet||null;n.closestView=null,n.closestMagnet=null;let g,f=Number.MAX_SAFE_INTEGER;const p=new A(t,e);c.forEach(x=>{if(x.container.getAttribute("magnet")!=="false"){if(x.isNodeView())g=l==="center"?x.cell.getBBox().getCenter().distance(p):x.cell.getBBox().getNearestPointToPoint(p).distance(p);else if(x.isEdgeView()){const E=x.getClosestPoint(p);E?g=E.distance(p):g=Number.MAX_SAFE_INTEGER}g<a&&g<f&&(u===x.container||this.validateConnection(...n.getValidateConnectionArgs(x,null),x.getEdgeTerminal(x.container,t,e,this.cell,n.terminalType)))&&(f=g,n.closestView=x,n.closestMagnet=x.container)}x.container.querySelectorAll("[magnet]").forEach(E=>{if(E.getAttribute("magnet")!=="false"){const S=x.getBBoxOfElement(E);g=p.distance(S.getCenter()),g<a&&g<f&&(u===E||this.validateConnection(...n.getValidateConnectionArgs(x,E),x.getEdgeTerminal(E,t,e,this.cell,n.terminalType)))&&(f=g,n.closestView=x,n.closestMagnet=E)}})});let m;const b=n.terminalType,y=n.closestView,w=n.closestMagnet,C=u!==w;if(h&&C&&h.unhighlight(u,{type:"magnetAdsorbed"}),y){if(!C)return;y.highlight(w,{type:"magnetAdsorbed"}),m=y.getEdgeTerminal(w,t,e,this.cell,b)}else m={x:t,y:e};this.cell.setTerminal(b,m,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,s=t.initialTerminal,o=this.cell[n];if(o&&!xt.equalTerminals(s,o)){const a=this.graph,l=s,c=l.cell?a.getCellById(l.cell):null,h=l.port,u=c?a.findViewByCell(c):null,g=c||t.isNewEdge?null:A.create(s).toJSON(),f=o,p=f.cell?a.getCellById(f.cell):null,m=f.port,b=p?a.findViewByCell(p):null,y=p?null:A.create(o).toJSON();this.notify("edge:connected",{e,previousCell:c,previousPort:h,previousView:u,previousPoint:g,currentCell:p,currentView:b,currentPort:m,currentPoint:y,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let s=0,o=n.length;s<o;s+=1){const r=e.findViewByCell(n[s]);if(!r||r.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(r.container.querySelectorAll("[magnet]"));r.container.getAttribute("magnet")!=="false"&&a.push(r.container);const l=a.filter(c=>this.validateConnection(...t.getValidateConnectionArgs(r,c),r.getEdgeTerminal(c,t.x,t.y,this.cell,t.terminalType)));if(l.length>0){for(let c=0,h=l.length;c<h;c+=1)r.highlight(l[c],{type:"magnetAvailable"});r.highlight(null,{type:"nodeAvailable"}),t.marked[r.cell.id]=l}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(n=>{const s=this.graph.findViewByCell(n);s&&(e[n].forEach(r=>{s.unhighlight(r,{type:"magnetAvailable"})}),s.unhighlight(null,{type:"nodeAvailable"}))}),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(t,e,n);return}const o=t.target.getAttribute("data-terminal"),r=this.prepareArrowheadDragging(o,{x:e,y:n});this.setEventData(t,r)}dragArrowhead(t,e,n){const s=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,s):this.arrowheadDragging(this.getEventTarget(t),e,n,s)}stopArrowheadDragging(t,e,n){const s=this.graph,o=this.getEventData(t);s.options.connecting.snap?this.snapArrowheadEnd(o):this.arrowheadDragged(o,e,n),this.validateEdge(this.cell,o.terminalType,o.initialTerminal)?(this.finishEmbedding(o),this.notifyConnectionEvent(o,t)):this.fallbackConnection(o),this.afterArrowheadDragging(o)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const s=t.currentTarget,o=parseInt(s.getAttribute("data-index"),10),r=this.getLabelPositionAngle(o),a=this.getLabelPositionArgs(o),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(t,{index:o,positionAngle:r,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const s=this.getEventData(t),o=this.cell.getLabelAt(s.index),r=ft({},o,{position:this.getLabelPosition(e,n,s.positionAngle,s.positionArgs)});this.cell.setLabelAt(s.index,r)}stopLabelDragging(t,e,n){}}const Au=`X6.${Ve.name}`;Ve.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"],tools:["tools"],vertices:["vertices","update"]}}),Ve.registry.register("edge",Ve,!0);const Bn={idle:"idle",raf:"raf",timeout:"timeout"};class $C{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=16,this.initialTime=Date.now(),this.pendingJobs=new Map,this.scheduleMode=null}queueJob(t){if(t.priority&Me.PRIOR)t.cb();else{const e=this.pendingJobs.get(t.id);if(e){if(e.cb=t.cb,t.priority!==e.priority){e.priority=t.priority;const n=this.queue.indexOf(e);if(n>=0){this.queue.splice(n,1);const s=this.findInsertionIndex(e);this.queue.splice(s,0,e)}}}else{const n=this.findInsertionIndex(t);this.queue.splice(n,0,t),this.pendingJobs.set(t.id,t)}}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.pendingJobs.clear(),this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(t){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let n=this.frameInterval;if(t&&typeof t.timeRemaining=="function"){const s=t.timeRemaining();n=Math.max(0,Math.min(n,s))}for(;this.queue.length>0;){const s=this.queue.shift();if(s.cb(),this.pendingJobs.delete(s.id),this.getCurrentTime()-e>=n)break}this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){for(this.isFlushPending=!1,this.isFlushing=!0;this.queue.length>0;){const t=this.queue.shift();try{t.cb()}catch(e){console.error(e)}this.pendingJobs.delete(t.id)}this.isFlushing=!1}findInsertionIndex(t){let e=0,n=this.queue.length,s=n-1;const o=t.priority;for(;e<=s;){const r=(s-e>>1)+e;o<=this.queue[r].priority?e=r+1:(n=r,s=r-1)}return n}scheduleJob(){this.scheduleId&&this.cancelScheduleJob(),"requestAnimationFrame"in window?(this.scheduleMode=Bn.raf,this.scheduleId=window.requestAnimationFrame(()=>this.flushJobs())):"requestIdleCallback"in window?(this.scheduleMode=Bn.idle,this.scheduleId=window.requestIdleCallback(t=>this.flushJobs(t),{timeout:100})):(this.scheduleMode=Bn.timeout,this.scheduleId=window.setTimeout(()=>this.flushJobs()))}cancelScheduleJob(){if(!this.scheduleId)return;const t={[Bn.idle]:window==null?void 0:window.cancelIdleCallback,[Bn.raf]:window==null?void 0:window.cancelAnimationFrame,[Bn.timeout]:window==null?void 0:window.clearTimeout},e=this.scheduleMode,n=e?t[e]:void 0;typeof n=="function"&&n(this.scheduleId),this.scheduleId=0,this.scheduleMode=null}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Me;(function(i){i[i.Update=2]="Update",i[i.RenderEdge=4]="RenderEdge",i[i.RenderNode=8]="RenderNode",i[i.PRIOR=1048576]="PRIOR"})(Me||(Me={}));const ZC="#insert";var pe;(function(i){i[i.CREATED=0]="CREATED",i[i.MOUNTED=1]="MOUNTED",i[i.WAITING=2]="WAITING"})(pe||(pe={}));class xu extends vn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(t){super(),this.views={},this.willRemoveViews={},this.queue=new $C,this.graph=t,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,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)}stopListening(){this.model.off("reseted",this.onModelReseted,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)}onModelReseted({options:t,previous:e}){let n=this.model.getCells();if(!(t!=null&&t.diff))this.queue.clearJobs(),this.removeZPivots(),this.resetViews();else{const s=new Set(e);n=n.filter(o=>!s.has(o))}this.renderViews(n,Object.assign(Object.assign({},t),{queue:n.map(s=>s.id)}))}onCellAdded({cell:t,options:e}){this.renderViews([t],e)}onCellRemoved({cell:t}){this.removeViews([t])}onCellZIndexChanged({cell:t,options:e}){const n=this.views[t.id];n&&this.requestViewUpdate(n.view,Qe,e,Me.Update,!0)}onCellVisibleChanged({cell:t,current:e}){this.toggleVisible(t,!!e)}requestViewUpdate(t,e,n={},s=Me.Update,o=!0){const r=t.cell.id,a=this.views[r];if(!a)return;a.flag=e,a.options=n,(t.hasAction(e,["translate","resize","rotate"])||n.async===!1)&&(s=Me.PRIOR,o=!1);const c=e&Qe?`${r}${ZC}`:r;this.queue.queueJob({id:c,priority:s,cb:()=>{this.renderViewInArea(t,e,n);const u=n.queue;if(u){const g=u.indexOf(t.cell.id);g>=0&&u.splice(g,1),u.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(t).forEach(u=>{this.requestViewUpdate(u.view,u.flag,n,s,!1)}),o&&this.flush()}setRenderArea(t){this.renderArea=t,Object.values(this.views).forEach(e=>{if(!e)return;const{view:n}=e;e.state===pe.MOUNTED&&(this.isUpdatable(n)||(n.remove(),this.graph.trigger("view:unmounted",{view:n}),e.state=pe.WAITING,e.flag|=Qe|n.getBootstrapFlag()))}),this.flushWaitingViews()}isViewMounted(t){if(t==null)return!1;const e=this.views[t.cell.id];return e?e.state===pe.MOUNTED:!1}renderViews(t,e={}){t.sort((n,s)=>n.isNode()&&s.isEdge()?-1:0),t.forEach(n=>{const s=n.id,o=this.views;let r=0,a=o[s];if(a)r=Qe;else{const l=this.createCellView(n);l&&(l.graph=this.graph,r=Qe|l.getBootstrapFlag(),a={view:l,flag:r,options:e,state:pe.CREATED},this.views[s]=a)}a&&this.requestViewUpdate(a.view,r,e,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(t,e,n={}){const s=t.cell,o=s.id,r=this.views[o];if(!r)return;let a=0;this.isUpdatable(t)?(a=this.updateView(t,e,n),r.flag=a):(r.state===pe.MOUNTED&&(t.remove(),this.graph.trigger("view:unmounted",{view:t}),a=0),r.state=pe.WAITING,r.flag=e|Qe|t.getBootstrapFlag()),a&&s.isEdge()&&!(a&t.getFlag(["source","target"]))&&this.queue.queueJob({id:o,priority:Me.RenderEdge,cb:()=>{this.updateView(t,e,n)}})}removeViews(t){t.forEach(e=>{const n=e.id,s=this.views[n];s&&(this.willRemoveViews[n]=s,delete this.views[n],this.queue.queueJob({id:n,priority:this.getRenderPriority(s.view),cb:()=>{this.removeView(s.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(t=>{if(t&&t.state===pe.WAITING){const{view:e,flag:n,options:s}=t;this.requestViewUpdate(e,n,s,this.getRenderPriority(e),!1)}}),this.flush()}updateView(t,e,n={}){if(t==null)return 0;if(It.isCellView(t)){if(e&XC)return this.removeView(t.cell),0;e&Qe&&(this.insertView(t),e^=Qe)}return e?t.confirmUpdate(e,n):0}insertView(t){const e=this.views[t.cell.id];if(e){const n=t.cell.getZIndex(),s=this.addZPivot(n);this.container.insertBefore(t.container,s),t.cell.isVisible()||this.toggleVisible(t.cell,!1),e.state=pe.MOUNTED,this.graph.trigger("view:mounted",{view:t})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(t=>{t&&this.removeView(t.view)}),this.views={},this.willRemoveViews={}}removeView(t){const e=t.cell,n=this.willRemoveViews[e.id];n&&t&&(n.view.remove(),delete this.willRemoveViews[e.id],this.graph.trigger("view:unmounted",{view:t}))}toggleVisible(t,e){const n=this.model.getConnectedEdges(t);for(let o=0,r=n.length;o<r;o+=1){const a=n[o];if(e){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const s=this.views[t.id];s&&nt(s.view.container,{display:e?"unset":"none"})}addZPivot(t=0){this.zPivots==null&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment(`z-index:${t+1}`);let s=-1/0;for(const r in e){const a=+r;a<t&&a>s&&(s=a)}const o=this.container;if(s!==-1/0){const r=e[s];o.insertBefore(n,r.nextSibling)}else o.insertBefore(n,o.firstChild);return n}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),this.zPivots={}}createCellView(t){const e={graph:this.graph},n=this.graph.options.createCellView;if(n){const o=F(n,this.graph,t);if(o)return new o(t,e);if(o===null)return null}const s=t.view;if(s!=null&&typeof s=="string"){const o=It.registry.get(s);return o?new o(t,e):It.registry.onNotFound(s)}return t.isNode()?new Zt(t,e):t.isEdge()?new Ve(t,e):null}getEffectedEdges(t){const e=[],n=t.cell,s=this.model.getConnectedEdges(n);for(let o=0,r=s.length;o<r;o+=1){const a=s[o],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const h=["update"];a.getTargetCell()===n&&h.push("target"),a.getSourceCell()===n&&h.push("source"),e.push({id:a.id,view:c,flag:c.getFlag(h)})}return e}isUpdatable(t){if(t.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(t.cell.getBBox()):!0;if(t.isEdgeView()){const e=t.cell,n=this.renderArea?this.renderArea.isIntersectWithRect(e.getBBox()):!0;if(this.graph.virtualRender.isVirtualEnabled())return n;const s=e.getSourceCell(),o=e.getTargetCell();if(this.renderArea&&s&&o)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(o.getBBox())}return!0}getRenderPriority(t){return t.cell.isNode()?Me.RenderNode:Me.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(t=>{this.views[t].view.dispose()}),this.views={}}}X([$()],xu.prototype,"dispose",null);class vu extends $t{constructor(){super(...arguments),this.schedule=new xu(this.graph)}requestViewUpdate(t,e,n={}){this.schedule.requestViewUpdate(t,e,n)}isViewMounted(t){return this.schedule.isViewMounted(t)}setRenderArea(t){this.schedule.setRenderArea(t)}findViewByElem(t){if(t==null)return null;const e=this.options.container,n=typeof t=="string"?e.querySelector(t):t instanceof Element?t:t[0];if(n){const s=this.graph.view.findAttr("data-cell-id",n);if(s){const o=this.schedule.views;if(o[s])return o[s].view}}return null}findViewByCell(t){if(t==null)return null;const e=q.isCell(t)?t.id:t,n=this.schedule.views;return n[e]?n[e].view:null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(n=>this.findViewByCell(n)).filter(n=>n!=null?fe(n.container,{target:this.view.stage}).containsPoint(e):!1)}findEdgeViewsFromPoint(t,e=5){return this.model.getEdges().map(n=>this.findViewByCell(n)).filter(n=>{if(n!=null){const s=n.getClosestPoint(t);if(s)return s.distance(t)<=e}return!1})}findViewsInArea(t,e={}){const n=P.create(t);return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>{if(s){if(e.nodeOnly&&!s.isNodeView())return!1;const o=fe(s.container,{target:this.view.stage});return o.width===0?o.inflate(1,0):o.height===0&&o.inflate(0,1),e.strict?n.containsRect(o):n.isIntersectWithRect(o)}return!1})}dispose(){this.schedule.dispose()}}X([$()],vu.prototype,"dispose",null);class br extends $t{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const s=this.graph.transform.getScale(),o=this.graph.translate();if(typeof n=="object"){const r=o.tx+s.sx*(n.x||0),a=o.ty+s.sy*(n.y||0);n=`${r}px ${a}px`}typeof e=="object"&&(e=P.fromSize(e).scale(s.sx,s.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const n=this.optionsCache;if(n&&n.image!==e.image)return;let s;const o=e.opacity,r=e.size;let a=e.repeat||"no-repeat";const l=ms.get(a);if(typeof l=="function"){const h=e.quality||1;t.width*=h,t.height*=h;const u=l(t,e);if(!(u instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");s=u.toDataURL("image/png"),e.repeat&&a!==e.repeat?a=e.repeat:a="repeat",typeof r=="object"?(r.width*=u.width/t.width,r.height*=u.height/t.height):r===void 0&&(e.size={width:u.width/h,height:u.height/h})}else s=t.src,r===void 0&&(e.size={width:t.width,height:t.height});n!=null&&typeof e.size=="object"&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=co(e.size));const c=this.elem.style;c.backgroundImage=`url(${s})`,c.backgroundRepeat=a,c.opacity=o==null||o>=1?"":`${o}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=co(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}X([$()],br.prototype,"dispose",null);class tA extends $t{getClientMatrix(){return kt(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new A(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return(typeof t=="number"?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=A.create(t,e);return Ee(n,this.graph.matrix())}localToClientPoint(t,e){const n=A.create(t,e);return Ee(n,this.getClientMatrix())}localToPagePoint(t,e){return(typeof t=="number"?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,n,s){const o=P.create(t,e,n,s);return Xt(o,this.graph.matrix())}localToClientRect(t,e,n,s){const o=P.create(t,e,n,s);return Xt(o,this.getClientMatrix())}localToPageRect(t,e,n,s){return(typeof t=="number"?this.localToGraphRect(t,e,n,s):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=A.create(t,e);return Ee(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=A.create(t,e);return Ee(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=A.create(t,e);return Ee(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const s=A.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(s)}graphToLocalRect(t,e,n,s){const o=P.create(t,e,n,s);return Xt(o,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,s){const o=P.create(t,e,n,s);return Xt(o,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,s){const o=P.create(t,e,n,s);return Xt(o,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,s){const o=P.create(t,e,n,s),r=this.getPageOffset();return o.x-=r.x,o.y-=r.y,this.graphToLocalRect(o)}}const eA=`.x6-graph {
|
|
87
87
|
position: relative;
|
|
88
88
|
overflow: hidden;
|
|
89
89
|
outline: none;
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
border: 1px solid #275fc5;
|
|
244
244
|
border-radius: 2px;
|
|
245
245
|
}
|
|
246
|
-
`;class Eu extends Zt{init(){Te("core",eA)}dispose(){Ie("core")}}$([Z()],Eu.prototype,"dispose",null);class nA extends Zt{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return this.svg.getElementById(t)!=null}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${Do(JSON.stringify(t))}`),!this.isDefined(e)){const s=ui.get(n);if(s==null)return ui.onNotFound(n);const o=s(t.args||{}),r=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});U.create(Lt.sanitize(o),r).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Do(JSON.stringify(t))}`),!this.isDefined(e)){const o=t.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),r=`<${n}>${o.join("")}</${n}>`,a=Object.assign({id:e},t.attrs);U.create(r,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:s,markerUnits:o,markerOrient:r,tagName:a,children:l}=t,c=Y(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Do(JSON.stringify(t))}`),!this.isDefined(h)){a!=="path"&&delete c.d;const u=U.create("marker",{refX:n,refY:s,id:h,overflow:"visible",orient:r??"auto",markerUnits:o||"userSpaceOnUse"},l?l.map(g=>{var{tagName:f}=g,p=Y(g,["tagName"]);return U.create(`${f}`||"path",Xn(Object.assign(Object.assign({},c),p)))}):[U.create(a||"path",Xn(c))]);this.defs.appendChild(u.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}class Su extends Zt{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),s=this.getInstance(),o=Array.isArray(t)?t:[t];this.patterns.forEach((l,c)=>{const h=`pattern_${c}`,u=n.a||1,g=n.d||1,{update:f,markup:p}=l,m=Y(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},m),o[c]),{sx:u,sy:g,ox:n.e||0,oy:n.f||0,width:e*u,height:e*g});s.has(h)||s.add(h,U.create("pattern",{id:h,patternUnits:"userSpaceOnUse"},U.createVectors(p)).node);const y=s.get(h);typeof f=="function"&&f(y.childNodes[0],b);let C=b.ox%b.width;C<0&&(C+=b.width);let w=b.oy%b.height;w<0&&(w+=b.height),W(y,{x:C,y:w,width:b.width,height:b.height})});const r=new XMLSerializer().serializeToString(s.root),a=`url(data:image/svg+xml;base64,${btoa(r)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new tw),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(e==null)return[Object.assign(Object.assign({},yh.dot),t.args)];const n=di.get(e);if(n){let s=t.args||[];return Array.isArray(s)||(s=[s]),Array.isArray(n)?n.map((o,r)=>Object.assign(Object.assign({},o),s[r])):[Object.assign(Object.assign({},n),s[0])]}return di.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}$([Z()],Su.prototype,"dispose",null);class Mu extends Zt{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const s=this.resolveHighlighter(n);if(!s)return;const o=this.getHighlighterId(e,s);if(!this.highlights[o]){const r=s.highlighter;r.highlight(t,e,Object.assign({},s.args)),this.highlights[o]={cellView:t,magnet:e,highlighter:r,args:s.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const s=this.getHighlighterId(t,n);this.unhighlight(s)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(n==null){const a=t.type;n=a&&e.highlighting[a]||e.highlighting.default}if(n==null)return null;const s=typeof n=="string"?{name:n}:n,o=s.name,r=gi.get(o);return r==null?gi.onNotFound(o):(lw(o,r),{name:o,highlighter:r,args:s.args||{}})}getHighlighterId(t,e){return Mo(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}$([Z()],Mu.prototype,"dispose",null);class Bu extends Zt{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Qc(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(t){(this.disabled||t)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=this.widgetOptions.guard;return(e==null||e(t))&&Ne(t,this.widgetOptions.modifiers)}onMouseWheel(t){const e=this.widgetOptions.guard;if((e==null||e(t))&&Ne(t,this.widgetOptions.modifiers)){const n=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.transform.getScale().sx),t.deltaY<0?(this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*n*20)/20/this.currentScale,this.cumulatedFactor<=1&&(this.cumulatedFactor=1.05)):(this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/n)*20)/20/this.currentScale,this.cumulatedFactor>=1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const o=this.currentScale;let r=this.graph.transform.clampScale(o*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(r=Ye(r,a,l),r!==o)if(this.widgetOptions.zoomAtMousePosition){const h=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(r,{absolute:!0,center:h.clone()})}else this.graph.zoom(r,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}$([Z()],Bu.prototype,"dispose",null);function iA(i){const{grid:t,panning:e,mousewheel:n,embedding:s}=i,o=Y(i,["grid","panning","mousewheel","embedding"]),r=i.container;if(r!=null)o.width==null&&(o.width=r.clientWidth),o.height==null&&(o.height=r.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const a=ft({},sA,o),l={size:10,visible:!1};return typeof t=="number"?a.grid={size:t,visible:!1}:typeof t=="boolean"?a.grid=Object.assign(Object.assign({},l),{visible:t}):a.grid=Object.assign(Object.assign({},l),t),["panning","mousewheel","embedding"].forEach(h=>{const u=i[h];typeof u=="boolean"?a[h].enabled=u:u!=null&&(a[h]=Object.assign(Object.assign({},a[h]),u))}),a}const sA={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!0,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:et.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:et.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:i,sourceView:t,targetView:e}){return(i==="target"?e:t)!=null},createEdge(){return new qC}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1};class ku extends Zt{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),ot.on(this.graph.container,"mousedown",this.onRightMouseDown),ot.on(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle=new Qc(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),ot.off(this.graph.container,"mousedown",this.onRightMouseDown),ot.off(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(t,e){return t.spaceKey=this.isSpaceKeyPressed,this.pannable&&Ne(t,this.widgetOptions.modifiers,e)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(t),ot.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ot.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,s=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(n,s)}stopPanning(t){this.panning=!1,this.updateClassName(t),ot.off(document.body,".panning"),ot.off(window,".panning")}updateClassName(t){const e=this.widgetOptions.eventTypes;if((e==null?void 0:e.length)===1&&e.includes("mouseWheel"))return;const n=this.view.container,s=this.view.prefixClassName("graph-panning"),o=this.view.prefixClassName("graph-pannable"),r=this.graph.getPlugin("selection"),a=r&&r.allowRubberband(t,!0),l=(e==null?void 0:e.includes("leftMouseDown"))&&!a;this.allowPanning(t??{},!0)||this.allowPanning(t??{})&&l?this.panning?(Q(n,s),lt(n,o)):(lt(n,s),Q(n,o)):this.panning||(lt(n,s),lt(n,o))}onMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.getPlugin("selection"),n=e&&e.allowRubberband(t,!0);(this.allowPanning(t,!0)||this.allowPanning(t)&&!n)&&this.startPanning(t)}onRightMouseDown(t){const e=this.widgetOptions.eventTypes;e!=null&&e.includes("rightMouseDown")&&t.button===2&&this.allowPanning(t,!0)&&this.startPanning(t)}onMouseWheel(t,e,n){this.graph.translateBy(-e,-n)}onKeyDown(t){t.which===32&&(this.isSpaceKeyPressed=!0),this.updateClassName(t)}onKeyUp(t){t.which===32&&(this.isSpaceKeyPressed=!1),this.updateClassName(t)}allowBlankMouseDown(t){const e=this.widgetOptions.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}allowMouseWheel(t){var e;return this.pannable&&!t.ctrlKey&&((e=this.widgetOptions.eventTypes)===null||e===void 0?void 0:e.includes("mouseWheel"))}autoPanning(t,e){const s=this.graph.getGraphArea();let o=0,r=0;t<=s.left+10&&(o=-10),e<=s.top+10&&(r=-10),t>=s.right-10&&(o=10),e>=s.bottom-10&&(r=10),(o!==0||r!==0)&&this.graph.translateBy(-o,-r)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}$([Z()],ku.prototype,"dispose",null);class Tu extends Zt{getScroller(){const t=this.graph.getPlugin("scroller");return t&&t.options.enabled?t:null}getContainer(){const t=this.getScroller();return t?t.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const t=this.options.autoResize;if(t)return typeof t=="boolean"?this.getContainer()||void 0:t}init(){if(this.options.autoResize){const e=this.getSensorTarget();if(e){if(typeof ResizeObserver>"u")return;this.ro=new ResizeObserver(o=>{if(!o||o.length===0)return;const{width:r,height:a}=o[0].contentRect;this.resize(Math.round(r),Math.round(a))}),this.ro.observe(e);const n=e.offsetWidth,s=e.offsetHeight;this.resize(n,s)}}}resize(t,e){const n=this.getScroller();n?n.resize(t,e):this.graph.transform.resize(t,e)}dispose(){this.ro&&(this.ro.disconnect(),this.ro=void 0)}}$([Z()],Tu.prototype,"dispose",null);class oA extends Zt{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),Bt(this.viewportMatrix)}setMatrix(t){const e=Bt(t),n=ti(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=t===void 0?this.options.width:t,s=e===void 0?this.options.height:e;this.options.width=n,this.options.height=s,typeof n=="number"&&(n=Math.round(n)),typeof s=="number"&&(s=Math.round(s)),this.container.style.width=n==null?"":`${n}px`,this.container.style.height=s==null?"":`${s}px`;const o=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},o)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Ae(t)||(t=this.container.clientWidth),Ae(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return y6(this.getMatrix())}scale(t,e=t,n=0,s=0,o=!0){if(t=this.clampScale(t),e=this.clampScale(e),o&&(n||s)){const a=this.getTranslation(),l=this.getScale(),c=n-(n-a.tx)*(t/l.sx),h=s-(s-a.ty)*(e/l.sy);(c!==a.tx||h!==a.ty)&&this.translate(c,h)}const r=this.getMatrix();return r.a=t,r.d=e,this.setMatrix(r),this.graph.trigger("scale",{sx:t,sy:e,ox:n,oy:s}),this}clampScale(t){const e=this.graph.options.scaling;return Ye(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,s=t;const o=this.getScale(),r=this.getComputedSize();let a=r.width/2,l=r.height/2;return e.absolute||(n+=o.sx,s+=o.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,s=Math.round(s/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),s=Math.min(e.maxScale,s)),e.minScale&&(n=Math.max(e.minScale,n),s=Math.max(e.minScale,s)),e.center&&(a=e.center.x,l=e.center.y),n=this.clampScale(n),s=this.clampScale(s),this.scale(n,s,a,l),this}getRotation(){return w6(this.getMatrix())}rotate(t,e,n){if(e==null||n==null){const o=fe(this.stage);e=o.width/2,n=o.height/2}const s=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(s),this}getTranslation(){return C6(this.getMatrix())}translate(t,e){const n=this.getMatrix();n.e=t||0,n.f=e||0,this.setMatrix(n);const s=this.getTranslation();return this.options.x=s.tx,this.options.y=s.ty,this.graph.trigger("translate",Object.assign({},s)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,s){if(typeof t=="object"){const w=t;t=w.gridWidth||1,e=w.gridHeight||1,n=w.padding||0,s=w}else t=t||1,e=e||1,n=n||0,s==null&&(s={});const o=re(n),r=s.border||0,a=s.contentArea?P.create(s.contentArea):this.getContentArea(s);r>0&&a.inflate(r);const l=this.getScale(),c=this.getTranslation(),h=l.sx,u=l.sy;a.x*=h,a.y*=u,a.width*=h,a.height*=u;let g=Math.max(Math.ceil((a.width+a.x)/t),1)*t,f=Math.max(Math.ceil((a.height+a.y)/e),1)*e,p=0,m=0;(s.allowNewOrigin==="negative"&&a.x<0||s.allowNewOrigin==="positive"&&a.x>=0||s.allowNewOrigin==="any")&&(p=Math.ceil(-a.x/t)*t,p+=o.left,g+=p),(s.allowNewOrigin==="negative"&&a.y<0||s.allowNewOrigin==="positive"&&a.y>=0||s.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/e)*e,m+=o.top,f+=m),g+=o.right,f+=o.bottom,g=Math.max(g,s.minWidth||0),f=Math.max(f,s.minHeight||0),g=Math.min(g,s.maxWidth||Number.MAX_SAFE_INTEGER),f=Math.min(f,s.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),y=g!==b.width||f!==b.height;return(p!==c.tx||m!==c.ty)&&this.translate(p,m),y&&this.resize(g,f),new P(-p/h,-m/u,g/h,f/u)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,s;if(t.contentArea){const y=t.contentArea;n=this.graph.localToGraph(y),s=A.create(y)}else n=this.getContentBBox(t),s=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const o=re(t.padding),r=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||r,c=t.maxScaleX||a,h=t.minScaleY||r,u=t.maxScaleY||a;let g;if(t.viewportArea)g=t.viewportArea;else{const y=this.getComputedSize(),C=this.getTranslation();g={x:C.tx,y:C.ty,width:y.width,height:y.height}}g=P.create(g).moveAndExpand({x:o.left,y:o.top,width:-o.left-o.right,height:-o.top-o.bottom});const f=this.getScale();let p=g.width/n.width*f.sx,m=g.height/n.height*f.sy;t.preserveAspectRatio!==!1&&(p=m=Math.min(p,m));const b=t.scaleGrid;if(b&&(p=b*Math.floor(p/b),m=b*Math.floor(m/b)),p=Ye(p,l,c),m=Ye(m,h,u),this.scale(p,m),e){const y=this.options,C=g.x-s.x*p-y.x,w=g.y-s.y*m-y.y;this.translate(C,w)}}getContentArea(t={}){return t.useCellGeometry!==!1?this.model.getAllCellsBBox()||new P:fe(this.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=P.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=P.create(t),s=this.graph;e.contentArea=n,e.viewportArea==null&&(e.viewportArea={x:s.options.x,y:s.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),s=this.getScale(),o=this.getTranslation(),r=n.width/2,a=n.height/2;t=typeof t=="number"?t:r,e=typeof e=="number"?e:a,t=r-t*s.sx,e=a-e*s.sy,(o.tx!==t||o.ty!==e)&&this.translate(t,e)}centerContent(t){const n=this.graph.getContentArea(t).getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const s=this.getComputedSize();e=Yt(e,Math.max(0,s.width)),e<0&&(e=s.width+e),n=Yt(n,Math.max(0,s.height)),n<0&&(n=s.height+n);const o=this.getTranslation(),r=this.getScale(),a=e-t.x*r.sx,l=n-t.y*r.sy;(o.tx!==a||o.ty!==l)&&this.translate(a,l)}positionRect(t,e){const n=P.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}}const ze=`${et.prefixCls}-graph`;class Be extends Gt{static snapshoot(t){const e=t.cloneNode();return t.childNodes.forEach(n=>{e.appendChild(n)}),()=>{for(Wn(t);t.attributes.length>0;)t.removeAttribute(t.attributes[0].name);for(let n=0,s=e.attributes.length;n<s;n+=1){const o=e.attributes[n];t.setAttribute(o.name,o.value)}e.childNodes.forEach(n=>{t.appendChild(n)})}}get disposeContainer(){return!1}get options(){return this.graph.options}constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Lt.parseJSONMarkup(Be.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=Be.snapshoot(this.container),Q(this.container,this.prefixClassName("graph")),Ot(this.container,n),this.delegateEvents()}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return t.type==="mousedown"&&t.button===2||this.options.guard&&this.options.guard(t,e)?!0:t.data&&t.data.guarded!==void 0?t.data.guarded:!(e&&e.cell&&q.isCell(e.cell)||this.svg===t.target||this.container===t.target||this.svg.contains(t.target))}findView(t){return this.graph.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,s.x,s.y):this.graph.trigger("blank:dblclick",{e,x:s.x,y:s.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,s.x,s.y):this.graph.trigger("blank:click",{e,x:s.x,y:s.y})}}isPreventDefaultContextMenu(t){let e=this.options.preventDefaultContextMenu;return typeof e=="function"&&(e=F(e,this.graph,{view:t})),e}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(n)&&t.preventDefault(),this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,s.x,s.y):this.graph.trigger("blank:contextmenu",{e,x:s.x,y:s.y})}delegateDragEvents(t,e){t.data==null&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){return this.getEventData(t).mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&t.preventDefault();const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,s.x,s.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&t.preventDefault(),this.graph.trigger("blank:mousedown",{e,x:s.x,y:s.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY||(e.mouseMovedCount==null&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,e.mouseMovedCount<=this.options.moveThreshold))return;const o=this.normalizeEvent(t),r=this.graph.snapToGrid(o.clientX,o.clientY),a=e.currentView;a?a.onMouseMove(o,r.x,r.y):this.graph.trigger("blank:mousemove",{e:o,x:r.x,y:r.y}),this.setEventData(o,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),o=this.getEventData(t).currentView;if(o?o.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e,x:n.x,y:n.y}),!t.isPropagationStopped()){const r=new ve(t,{type:"click",data:t.data});this.onClick(r)}t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const 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})}}onMouseOut(t){const 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})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.findViewByElem(e.relatedTarget);if(n){if(s===n)return;n.onMouseEnter(e)}else{if(s)return;this.graph.trigger("graph:mouseenter",{e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.findViewByElem(e.relatedTarget);if(n){if(s===n)return;n.onMouseLeave(e)}else{if(s)return;this.graph.trigger("graph:mouseleave",{e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=e.originalEvent,o=this.graph.snapToGrid(s.clientX,s.clientY),r=Math.max(-1,Math.min(1,s.wheelDelta||-s.detail));n?n.onMouseWheel(e,o.x,o.y,r):this.graph.trigger("blank:mousewheel",{e,delta:r,x:o.x,y:o.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const s=this.findView(e);if(s){const o=this.normalizeEvent(t);if(this.guard(o,s))return;const r=this.graph.snapToGrid(o.clientX,o.clientY);s.onCustomEvent(o,n,r.x,r.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,s=n.getAttribute("magnet");if(s&&s.toLowerCase()!=="false"){const o=this.findView(n);if(o){const r=this.normalizeEvent(t);if(this.guard(r,o))return;const a=this.graph.snapToGrid(r.clientX,r.clientY);F(e,this.graph,o,r,n,a.x,a.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(e,n,s,o,r)=>{e.onMagnetMouseDown(n,s,o,r)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(e,n,s,o,r)=>{e.onMagnetDblClick(n,s,o,r)})}onMagnetContextMenu(t){const e=this.findView(t.target);this.isPreventDefaultContextMenu(e)&&t.preventDefault(),this.handleMagnetEvent(t,(n,s,o,r,a)=>{n.onMagnetContextMenu(s,o,r,a)})}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const s=this.normalizeEvent(t);if(this.guard(s,n))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);n.onLabelMouseDown(s,o.x,o.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}Be.markup=[{ns:Mt.xhtml,tagName:"div",selector:"background",className:`${ze}-background`},{ns:Mt.xhtml,tagName:"div",selector:"grid",className:`${ze}-grid`},{ns:Mt.svg,tagName:"svg",selector:"svg",className:`${ze}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":Mt.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${ze}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${ze}-svg-primer`},{tagName:"g",selector:"stage",className:`${ze}-svg-stage`},{tagName:"g",selector:"decorator",className:`${ze}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${ze}-svg-overlay`}]}]}],Be.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${et.prefixCls}-cell`]:"onMouseEnter",[`mouseleave .${et.prefixCls}-cell`]:"onMouseLeave",[`mouseenter .${et.prefixCls}-cell-tools`]:"onMouseEnter",[`mouseleave .${et.prefixCls}-cell-tools`]:"onMouseLeave",[`mousedown .${et.prefixCls}-cell [event]`]:"onCustomEvent",[`touchstart .${et.prefixCls}-cell [event]`]:"onCustomEvent",[`mousedown .${et.prefixCls}-cell [data-event]`]:"onCustomEvent",[`touchstart .${et.prefixCls}-cell [data-event]`]:"onCustomEvent",[`dblclick .${et.prefixCls}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${et.prefixCls}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${et.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${et.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${et.prefixCls}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${et.prefixCls}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${et.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${et.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${et.prefixCls}-cell image`]:"onImageDragStart",[`mousedown .${et.prefixCls}-edge .${et.prefixCls}-edge-label`]:"onLabelMouseDown",[`touchstart .${et.prefixCls}-edge .${et.prefixCls}-edge-label`]:"onLabelMouseDown"},Be.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},$([Z()],Be.prototype,"dispose",null);const Iu=120;class Pu extends Zt{init(){this.resetRenderArea=ty(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}bindScrollerEvents(t){this.scrollerRef=t,typeof t.on=="function"&&(t.on("pan:start",this.resetRenderArea,this),t.on("panning",this.resetRenderArea,this),t.on("pan:stop",this.resetRenderArea,this));const e=t.container;e&&(this.scrollerScrollHandler=n=>{this.resetRenderArea()},ot.on(e,"scroll",this.scrollerScrollHandler))}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this);const t=this.graph.getPlugin("scroller");t&&this.bindScrollerEvents(t)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this),this.unbindScroller()}onScrollerReady(t){this.scrollerRef!==t&&(this.unbindScroller(),this.bindScrollerEvents(t),this.resetRenderArea())}unbindScroller(){if(this.scrollerRef){typeof this.scrollerRef.off=="function"&&(this.scrollerRef.off("pan:start",this.resetRenderArea,this),this.scrollerRef.off("panning",this.resetRenderArea,this),this.scrollerRef.off("pan:stop",this.resetRenderArea,this));const t=this.scrollerRef.container;t&&this.scrollerScrollHandler&&ot.off(t,"scroll",this.scrollerScrollHandler),this.scrollerRef=void 0,this.scrollerScrollHandler=void 0}}setVirtualEnabled(t){const e=this.options.virtual;if(typeof e=="object"){const n=e;this.options.virtual=Object.assign(Object.assign({},n),{enabled:t})}else this.options.virtual=t}enableVirtualRender(){this.setVirtualEnabled(!0),this.resetRenderArea()}disableVirtualRender(){this.setVirtualEnabled(!1),this.graph.renderer.setRenderArea(void 0)}isVirtualEnabled(){const t=this.options.virtual;return t!=null&&typeof t=="object"?t.enabled!==!1:!!t}getVirtualMargin(){const t=this.options.virtual;if(typeof t=="object"){const e=t.margin;return typeof e=="number"?e:Iu}return Iu}resetRenderArea(){if(this.isVirtualEnabled()){const e=this.graph.getGraphArea();if(e){const n=this.getVirtualMargin(),s=e.clone();s.inflate(n,n),this.graph.renderer.setRenderArea(s);return}}}dispose(){this.stopListening()}}$([Z()],Pu.prototype,"dispose",null);class B extends Ft{static isGraph(t){if(t==null)return!1;if(t instanceof B)return!0;const e=t[Symbol.toStringTag];return e==null||e===B.toStringTag}static render(t,e){const n=t instanceof HTMLElement?new B({container:t}):new B(t);return e!=null&&n.fromJSON(e),n}get container(){return this.options.container}get[Symbol.toStringTag](){return B.toStringTag}constructor(t){super(),this.installedPlugins=new Set,this.options=iA(t),this.css=new Eu(this),this.view=new Be(this),this.defs=new nA(this),this.coord=new tA(this),this.transform=new oA(this),this.highlight=new Mu(this),this.grid=new Su(this),this.background=new br(this),this.options.model?this.model=this.options.model:(this.model=new Ht,this.model.graph=this),this.renderer=new vu(this),this.panning=new ku(this),this.mousewheel=new Bu(this),this.virtualRender=new Pu(this),this.size=new Tu(this)}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(n=>It.isNode(n)?n:this.createNode(n)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(n=>xt.isEdge(n)?n:this.createEdge(n)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,s,o){return this.model.getNodesInArea(t,e,n,s,o)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const s=typeof t=="string"?t:"update",o=typeof t=="string"?e:t,r=typeof e=="function"?n:e;this.startBatch(s,r);const a=o();return this.stopBatch(s,r),a}updateCellId(t,e){return this.model.updateCellId(t,e)}findView(t){return q.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return P.isRectangleLike(t)?this.findViewsInArea(t):A.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,s,o){const r=typeof t=="number"?{x:t,y:e,width:n,height:s}:t,a=typeof t=="number"?o:e;return this.renderer.findViewsInArea(r,a)}matrix(t){return typeof t>"u"?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){const n=this.getPlugin("scroller");return n?n.resize(t,e):this.transform.resize(t,e),this}scale(t,e=t,n=0,s=0){return typeof t>"u"?this.transform.getScale():(this.transform.scale(t,e,n,s),this)}zoom(t,e){const n=this.getPlugin("scroller");if(n){if(typeof t>"u")return n.zoom();n.zoom(t,e)}else{if(typeof t>"u")return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.getPlugin("scroller");return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.getPlugin("scroller");return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.getPlugin("scroller");return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return typeof t>"u"?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return typeof t>"u"?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),s=n.tx+t,o=n.ty+e;return this.translate(s,o)}getGraphArea(){var t;const e=this.getPlugin("scroller");if(e){const n=(t=e.getVisibleArea)===null||t===void 0?void 0:t.call(e);if(n)return n}return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,s){return this.transform.fitToContent(t,e,n,s)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const s=this.getPlugin("scroller");return s?s.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.getPlugin("scroller");return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.getPlugin("scroller");return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,s={}){const o=this.getPlugin("scroller");return o?o.positionPoint(t,e,n,s):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const s=this.getPlugin("scroller");return s?s.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const s=this.getPlugin("scroller");return s?s.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.getPlugin("scroller");return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,s){return P.isRectangleLike(t)?this.coord.pageToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.pageToLocalRect(t,e,n,s):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,s){return P.isRectangleLike(t)?this.coord.localToPageRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToPageRect(t,e,n,s):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,s){return P.isRectangleLike(t)?this.coord.clientToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.clientToLocalRect(t,e,n,s):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,s){return P.isRectangleLike(t)?this.coord.localToClientRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToClientRect(t,e,n,s):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,s){return P.isRectangleLike(t)?this.coord.localToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToGraphRect(t,e,n,s):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,s){return P.isRectangleLike(t)?this.coord.graphToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.graphToLocalRect(t,e,n,s):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,s){return P.isRectangleLike(t)?this.coord.clientToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.clientToGraphRect(t,e,n,s):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.getPlugin("scroller");return n!=null&&(this.options.background==null||!e)?n.drawBackground(t,e):this.background.draw(t),this}clearBackground(t){const e=this.getPlugin("scroller");return e!=null&&(this.options.background==null||!t)?e.clearBackground(t):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return t==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.getPlugin("scroller");return t?t.isPannable():this.panning.pannable}enablePanning(){const t=this.getPlugin("scroller");return t?t.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.getPlugin("scroller");return t?t.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}handleScrollerPluginStateChange(t,e){t.name==="scroller"&&(e?this.virtualRender.onScrollerReady(t):this.virtualRender.unbindScroller())}use(t,...e){return this.installedPlugins.has(t)||(this.installedPlugins.add(t),t.init(this,...e),this.handleScrollerPluginStateChange(t,!0)),this}getPlugin(t){return Array.from(this.installedPlugins).find(e=>e.name===t)}getPlugins(t){return Array.from(this.installedPlugins).filter(e=>t.includes(e.name))}enablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{var o;(o=s==null?void 0:s.enable)===null||o===void 0||o.call(s),this.handleScrollerPluginStateChange(s,!0)}),this}disablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{var o;(o=s==null?void 0:s.disable)===null||o===void 0||o.call(s),this.handleScrollerPluginStateChange(s,!1)}),this}isPluginEnabled(t){var e;const n=this.getPlugin(t);return(e=n==null?void 0:n.isEnabled)===null||e===void 0?void 0:e.call(n)}disposePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{s.dispose(),this.handleScrollerPluginStateChange(s,!1),this.installedPlugins.delete(s)}),this}dispose(t=!0){t&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}B.toStringTag=`X6.${B.name}`,B.registerNode=It.registry.register,B.registerEdge=xt.registry.register,B.registerView=Tt.registry.register,B.registerAttr=ri.register,B.registerGrid=di.register,B.registerFilter=ui.register,B.registerNodeTool=Ei.register,B.registerEdgeTool=Si.register,B.registerBackground=ms.register,B.registerHighlighter=gi.register,B.registerPortLayout=mi.register,B.registerPortLabelLayout=Es.register,B.registerMarker=si.register,B.registerRouter=wi.register,B.registerConnector=ci.register,B.registerAnchor=fi.register,B.registerEdgeAnchor=hi.register,B.registerConnectionPoint=ai.register,B.unregisterNode=It.registry.unregister,B.unregisterEdge=xt.registry.unregister,B.unregisterView=Tt.registry.unregister,B.unregisterAttr=ri.unregister,B.unregisterGrid=di.unregister,B.unregisterFilter=ui.unregister,B.unregisterNodeTool=Ei.unregister,B.unregisterEdgeTool=Si.unregister,B.unregisterBackground=ms.unregister,B.unregisterHighlighter=gi.unregister,B.unregisterPortLayout=mi.unregister,B.unregisterPortLabelLayout=Es.unregister,B.unregisterMarker=si.unregister,B.unregisterRouter=wi.unregister,B.unregisterConnector=ci.unregister,B.unregisterAnchor=fi.unregister,B.unregisterEdgeAnchor=hi.unregister,B.unregisterConnectionPoint=ai.unregister,$([Z()],B.prototype,"dispose",null);const yr="html",wr={};class Ou extends It{static register(t){const{shape:e,html:n,effect:s,inherit:o}=t,r=Y(t,["shape","html","effect","inherit"]);if(!e)throw new Error("HTML.register should specify `shape` in config.");wr[e]={html:n,effect:s},B.registerNode(e,Object.assign({inherit:o||"html"},r),!0)}}Ou.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Lt.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),It.registry.register("html",Ou,!0);class Cr extends te{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:t}){const e=wr[this.cell.shape];if(e){const{effect:n}=e;(!n||n.includes(t))&&this.renderHTMLComponent()}}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,yr,()=>this.renderHTMLComponent())}renderHTMLComponent(){const t=this.selectors&&this.selectors.foContent;if(t){Wn(t);const e=wr[this.cell.shape];if(!e)return;let{html:n}=e;typeof n=="function"&&(n=n(this.cell)),n&&(typeof n=="string"?t.innerHTML=n:Ot(t,n))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}$([Z()],Cr.prototype,"dispose",null),Cr.config({bootstrap:[yr],actions:{html:yr}}),te.registry.register("html-view",Cr,!0),Mn("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:WC()},{selector:"image"}),Mi.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(i){const{path:t}=i,e=Y(i,["path"]);return t&&bn(e,"attrs/body/refD",t),e}});class Ar extends Mi{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return t==null?this.removePoints():this.setAttrByPath("body/refPoints",yu(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}Ar.config({propHooks(i){const{points:t}=i,e=Y(i,["points"]);if(t){const n=yu(t);n&&bn(e,"attrs/body/refPoints",n)}return e}}),Mn("polygon",{},{parent:Ar}),Mn("polyline",{},{parent:Ar}),Mn("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});function rA(i){return i?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:Mt.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"}}}const aA={shape:"text-block",markup:[{tagName:"rect",selector:"body"},rA(ly)],attrs:{body:Object.assign(Object.assign({},bu),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(i){const{text:t}=i,e=Y(i,["text"]);return t&&bn(e,"attrs/label/text",t),e},attrHooks:{text:{set(i,{cell:t,view:e,refBBox:n,elem:s,attrs:o}){if(s instanceof HTMLElement)s.textContent=i;else{const r=o.style||{},a={text:i,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},r),c=ah.textWrap;return F(c.set,this,a,{cell:t,view:e,elem:s,refBBox:n,attrs:l}),{fill:r.color||null}}},position(i,{refBBox:t,elem:e}){if(e instanceof SVGElement)return t.getCenter()}}}};Mi.define(aA);const xr=`${et.prefixCls}.clipboard.cells`;function lA(i){if(window.localStorage){const t=i.map(e=>e.toJSON());localStorage.setItem(xr,JSON.stringify(t))}}function cA(){if(window.localStorage){const i=localStorage.getItem(xr),t=i?JSON.parse(i):[];if(t)return Ht.fromJSON(t)}}function hA(){window.localStorage&&localStorage.removeItem(xr)}class uA{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const o=(Ht.isModel(e)?e:e.model).cloneSubGraph(t,n);this.cells=wo(Object.keys(o).map(r=>o[r]),r=>r.isEdge()?2:1),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n),(B.isGraph(e)?e.model:e).batchUpdate("cut",()=>{t.forEach(o=>o.remove())})}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:s,edgeProps:o,nodeProps:r}=n;let a=20,l=20;s&&(a=typeof s=="number"?s:s.dx,l=typeof s=="number"?s:s.dy),this.deserialize(n);const c=this.cells;c.forEach(u=>{u.model=null,u.removeProp("zIndex"),(a||l)&&u.translate(a,l),r&&u.isNode()&&u.prop(r),o&&u.isEdge()&&u.prop(o)});const h=B.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(c,t,e),c}serialize(t){t.useLocalStorage!==!1&&lA(this.cells)}deserialize(t){if(t.useLocalStorage){const e=cA();e&&(this.cells=e)}}isEmpty(t={}){return t.useLocalStorage&&this.deserialize(t),this.cells.length<=0}clean(){this.options={},this.cells=[],hA()}}B.prototype.isClipboardEnabled=function(){const i=this.getPlugin("clipboard");return i?i.isEnabled():!1},B.prototype.enableClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.enable(),this},B.prototype.disableClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.disable(),this},B.prototype.toggleClipboard=function(i){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(i),this},B.prototype.isClipboardEmpty=function(i){const t=this.getPlugin("clipboard");return t?t.isEmpty(i):!0},B.prototype.getCellsInClipboard=function(){const i=this.getPlugin("clipboard");return i?i.getCellsInClipboard():[]},B.prototype.cleanClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.clean(),this},B.prototype.copy=function(i,t){const e=this.getPlugin("clipboard");return e&&e.copy(i,t),this},B.prototype.cut=function(i,t){const e=this.getPlugin("clipboard");return e&&e.cut(i,t),this},B.prototype.paste=function(i,t){const e=this.getPlugin("clipboard");return e?e.paste(i,t):[]};class Nu extends Ft{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(t={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},t)}init(t){this.graph=t,this.clipboardImpl=new uA,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}isEmpty(t={}){return this.clipboardImpl.isEmpty(t)}getCellsInClipboard(){return this.cells}clean(t){return(!this.disabled||t)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(t,e={}){return this.disabled||(this.clipboardImpl.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}cut(t,e={}){return this.disabled||(this.clipboardImpl.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}paste(t={},e=this.graph){return this.disabled?[]:this.clipboardImpl.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}get commonOptions(){const t=this.options,{enabled:e}=t;return Y(t,["enabled"])}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.clean(!0),this.off()}}$([Z()],Nu.prototype,"dispose",null);function Ru(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,n)}return e}function Du(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(e),!0).forEach(function(n){dA(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Ru(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}function vr(i){"@babel/helpers - typeof";return vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(i)}function dA(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bi,gA={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Os(){if(Bi!==void 0)return Bi;Bi="";var i=document.createElement("p").style,t="Transform";for(var e in gA)e+t in i&&(Bi=e);return Bi}function Lu(){return Os()?"".concat(Os(),"TransitionProperty"):"transitionProperty"}function Ns(){return Os()?"".concat(Os(),"Transform"):"transform"}function Qu(i,t){var e=Lu();e&&(i.style[e]=t,e!=="transitionProperty"&&(i.style.transitionProperty=t))}function Er(i,t){var e=Ns();e&&(i.style[e]=t,e!=="transform"&&(i.style.transform=t))}function fA(i){return i.style.transitionProperty||i.style[Lu()]}function pA(i){var t=window.getComputedStyle(i,null),e=t.getPropertyValue("transform")||t.getPropertyValue(Ns());if(e&&e!=="none"){var n=e.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}var mA=/matrix\((.*)\)/,bA=/matrix3d\((.*)\)/;function yA(i,t){var e=window.getComputedStyle(i,null),n=e.getPropertyValue("transform")||e.getPropertyValue(Ns());if(n&&n!=="none"){var s,o=n.match(mA);if(o)o=o[1],s=o.split(",").map(function(a){return parseFloat(a,10)}),s[4]=t.x,s[5]=t.y,Er(i,"matrix(".concat(s.join(","),")"));else{var r=n.match(bA)[1];s=r.split(",").map(function(a){return parseFloat(a,10)}),s[12]=t.x,s[13]=t.y,Er(i,"matrix3d(".concat(s.join(","),")"))}}else Er(i,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}var wA=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,ki;function Vu(i){var t=i.style.display;i.style.display="none",i.offsetHeight,i.style.display=t}function kn(i,t,e){var n=e;if(vr(t)==="object"){for(var s in t)t.hasOwnProperty(s)&&kn(i,s,t[s]);return}if(typeof n<"u"){typeof n=="number"&&(n="".concat(n,"px")),i.style[t]=n;return}return ki(i,t)}function CA(i){var t,e,n,s=i.ownerDocument,o=s.body,r=s&&s.documentElement;return t=i.getBoundingClientRect(),e=Math.floor(t.left),n=Math.floor(t.top),e-=r.clientLeft||o.clientLeft||0,n-=r.clientTop||o.clientTop||0,{left:e,top:n}}function zu(i,t){var e=i["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof e!="number"){var s=i.document;e=s.documentElement[n],typeof e!="number"&&(e=s.body[n])}return e}function Fu(i){return zu(i)}function Uu(i){return zu(i,!0)}function Ti(i){var t=CA(i),e=i.ownerDocument,n=e.defaultView||e.parentWindow;return t.left+=Fu(n),t.top+=Uu(n),t}function Sr(i){return i!=null&&i==i.window}function Ku(i){return Sr(i)?i.document:i.nodeType===9?i:i.ownerDocument}function AA(i,t,e){var n=e,s="",o=Ku(i);return n=n||o.defaultView.getComputedStyle(i,null),n&&(s=n.getPropertyValue(t)||n[t]),s}var xA=new RegExp("^(".concat(wA,")(?!px)[a-z%]+$"),"i"),vA=/^(top|right|bottom|left)$/,Mr="currentStyle",Br="runtimeStyle",Xe="left",EA="px";function SA(i,t){var e=i[Mr]&&i[Mr][t];if(xA.test(e)&&!vA.test(t)){var n=i.style,s=n[Xe],o=i[Br][Xe];i[Br][Xe]=i[Mr][Xe],n[Xe]=t==="fontSize"?"1em":e||0,e=n.pixelLeft+EA,n[Xe]=s,i[Br][Xe]=o}return e===""?"auto":e}typeof window<"u"&&(ki=window.getComputedStyle?AA:SA);function Rs(i,t){return i==="left"?t.useCssRight?"right":i:t.useCssBottom?"bottom":i}function Ju(i){if(i==="left")return"right";if(i==="right")return"left";if(i==="top")return"bottom";if(i==="bottom")return"top"}function ju(i,t,e){kn(i,"position")==="static"&&(i.style.position="relative");var n=-999,s=-999,o=Rs("left",e),r=Rs("top",e),a=Ju(o),l=Ju(r);o!=="left"&&(n=999),r!=="top"&&(s=999);var c="",h=Ti(i);("left"in t||"top"in t)&&(c=fA(i)||"",Qu(i,"none")),"left"in t&&(i.style[a]="",i.style[o]="".concat(n,"px")),"top"in t&&(i.style[l]="",i.style[r]="".concat(s,"px")),Vu(i);var u=Ti(i),g={};for(var f in t)if(t.hasOwnProperty(f)){var p=Rs(f,e),m=f==="left"?n:s,b=h[f]-u[f];p===f?g[p]=m+b:g[p]=m-b}kn(i,g),Vu(i),("left"in t||"top"in t)&&Qu(i,c);var y={};for(var C in t)if(t.hasOwnProperty(C)){var w=Rs(C,e),x=t[C]-h[C];C===w?y[w]=g[w]+x:y[w]=g[w]-x}kn(i,y)}function MA(i,t){var e=Ti(i),n=pA(i),s={x:n.x,y:n.y};"left"in t&&(s.x=n.x+t.left-e.left),"top"in t&&(s.y=n.y+t.top-e.top),yA(i,s)}function BA(i,t,e){if(e.ignoreShake){var n=Ti(i),s=n.left.toFixed(0),o=n.top.toFixed(0),r=t.left.toFixed(0),a=t.top.toFixed(0);if(s===r&&o===a)return}e.useCssRight||e.useCssBottom?ju(i,t,e):e.useCssTransform&&Ns()in document.body.style?MA(i,t):ju(i,t,e)}function kr(i,t){for(var e=0;e<i.length;e++)t(i[e])}function Gu(i){return ki(i,"boxSizing")==="border-box"}var kA=["margin","border","padding"],Tr=-1,TA=2,Ir=1,IA=0;function PA(i,t,e){var n={},s=i.style,o;for(o in t)t.hasOwnProperty(o)&&(n[o]=s[o],s[o]=t[o]);e.call(i);for(o in t)t.hasOwnProperty(o)&&(s[o]=n[o])}function Ii(i,t,e){var n=0,s,o,r;for(o=0;o<t.length;o++)if(s=t[o],s)for(r=0;r<e.length;r++){var a=void 0;s==="border"?a="".concat(s).concat(e[r],"Width"):a=s+e[r],n+=parseFloat(ki(i,a))||0}return n}var me={getParent:function(t){var e=t;do e.nodeType===11&&e.host?e=e.host:e=e.parentNode;while(e&&e.nodeType!==1&&e.nodeType!==9);return e}};kr(["Width","Height"],function(i){me["doc".concat(i)]=function(t){var e=t.document;return Math.max(e.documentElement["scroll".concat(i)],e.body["scroll".concat(i)],me["viewport".concat(i)](e))},me["viewport".concat(i)]=function(t){var e="client".concat(i),n=t.document,s=n.body,o=n.documentElement,r=o[e];return n.compatMode==="CSS1Compat"&&r||s&&s[e]||r}});function Yu(i,t,e){var n=e;if(Sr(i))return t==="width"?me.viewportWidth(i):me.viewportHeight(i);if(i.nodeType===9)return t==="width"?me.docWidth(i):me.docHeight(i);var s=t==="width"?["Left","Right"]:["Top","Bottom"],o=Math.floor(t==="width"?i.getBoundingClientRect().width:i.getBoundingClientRect().height),r=Gu(i),a=0;(o==null||o<=0)&&(o=void 0,a=ki(i,t),(a==null||Number(a)<0)&&(a=i.style[t]||0),a=Math.floor(parseFloat(a))||0),n===void 0&&(n=r?Ir:Tr);var l=o!==void 0||r,c=o||a;return n===Tr?l?c-Ii(i,["border","padding"],s):a:l?n===Ir?c:c+(n===TA?-Ii(i,["border"],s):Ii(i,["margin"],s)):a+Ii(i,kA.slice(n),s)}var OA={position:"absolute",visibility:"hidden",display:"block"};function Hu(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];var n,s=t[0];return s.offsetWidth!==0?n=Yu.apply(void 0,t):PA(s,OA,function(){n=Yu.apply(void 0,t)}),n}kr(["width","height"],function(i){var t=i.charAt(0).toUpperCase()+i.slice(1);me["outer".concat(t)]=function(n,s){return n&&Hu(n,i,s?IA:Ir)};var e=i==="width"?["Left","Right"]:["Top","Bottom"];me[i]=function(n,s){var o=s;if(o!==void 0){if(n){var r=Gu(n);return r&&(o+=Ii(n,["padding","border"],e)),kn(n,i,o)}return}return n&&Hu(n,i,Tr)}});function _u(i,t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}var G={getWindow:function(t){if(t&&t.document&&t.setTimeout)return t;var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},getDocument:Ku,offset:function(t,e,n){if(typeof e<"u")BA(t,e,n||{});else return Ti(t)},isWindow:Sr,each:kr,css:kn,clone:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);var s=t.overflow;if(s)for(e in t)t.hasOwnProperty(e)&&(n.overflow[e]=t.overflow[e]);return n},mix:_u,getWindowScrollLeft:function(t){return Fu(t)},getWindowScrollTop:function(t){return Uu(t)},merge:function(){for(var t={},e=0;e<arguments.length;e++)G.mix(t,e<0||arguments.length<=e?void 0:arguments[e]);return t},viewportWidth:0,viewportHeight:0};_u(G,me);var Pr=G.getParent;function Wu(i){if(G.isWindow(i)||i.nodeType===9)return null;var t=G.getDocument(i),e=t.body,n,s=G.css(i,"position"),o=s==="fixed"||s==="absolute";if(!o)return i.nodeName.toLowerCase()==="html"?null:Pr(i);for(n=Pr(i);n&&n!==e&&n.nodeType!==9;n=Pr(n))if(s=G.css(n,"position"),s!=="static")return n;return null}var qu=G.getParent;function NA(i){if(G.isWindow(i)||i.nodeType===9)return!1;var t=G.getDocument(i),e=t.body,n=null;for(n=qu(i);n&&n!==e&&n!==t;n=qu(n)){var s=G.css(n,"position");if(s==="fixed")return!0}return!1}function RA(i,t){for(var e={left:0,right:1/0,top:0,bottom:1/0},n=Wu(i),s=G.getDocument(i),o=s.defaultView||s.parentWindow,r=s.body,a=s.documentElement;n;){if((navigator.userAgent.indexOf("MSIE")===-1||n.clientWidth!==0)&&n!==r&&n!==a&&G.css(n,"overflow")!=="visible"){var l=G.offset(n);l.left+=n.clientLeft,l.top+=n.clientTop,e.top=Math.max(e.top,l.top),e.right=Math.min(e.right,l.left+n.clientWidth),e.bottom=Math.min(e.bottom,l.top+n.clientHeight),e.left=Math.max(e.left,l.left)}else if(n===r||n===a)break;n=Wu(n)}var c=null;if(!G.isWindow(i)&&i.nodeType!==9){c=i.style.position;var h=G.css(i,"position");h==="absolute"&&(i.style.position="fixed")}var u=G.getWindowScrollLeft(o),g=G.getWindowScrollTop(o),f=G.viewportWidth(o),p=G.viewportHeight(o),m=a.scrollWidth,b=a.scrollHeight,y=window.getComputedStyle(r);if(y.overflowX==="hidden"&&(m=o.innerWidth),y.overflowY==="hidden"&&(b=o.innerHeight),i.style&&(i.style.position=c),t||NA(i))e.left=Math.max(e.left,u),e.top=Math.max(e.top,g),e.right=Math.min(e.right,u+f),e.bottom=Math.min(e.bottom,g+p);else{var C=Math.max(m,u+f);e.right=Math.min(e.right,C);var w=Math.max(b,g+p);e.bottom=Math.min(e.bottom,w)}return e.top>=0&&e.left>=0&&e.bottom>e.top&&e.right>e.left?e:null}function DA(i,t,e,n){var s=G.clone(i),o={width:t.width,height:t.height};return n.adjustX&&s.left<e.left&&(s.left=e.left),n.resizeWidth&&s.left>=e.left&&s.left+o.width>e.right&&(o.width-=s.left+o.width-e.right),n.adjustX&&s.left+o.width>e.right&&(s.left=Math.max(e.right-o.width,e.left)),n.adjustY&&s.top<e.top&&(s.top=e.top),n.resizeHeight&&s.top>=e.top&&s.top+o.height>e.bottom&&(o.height-=s.top+o.height-e.bottom),n.adjustY&&s.top+o.height>e.bottom&&(s.top=Math.max(e.bottom-o.height,e.top)),G.mix(s,o)}function LA(i){var t,e,n;if(!G.isWindow(i)&&i.nodeType!==9)t=G.offset(i),e=G.outerWidth(i),n=G.outerHeight(i);else{var s=G.getWindow(i);t={left:G.getWindowScrollLeft(s),top:G.getWindowScrollTop(s)},e=G.viewportWidth(s),n=G.viewportHeight(s)}return t.width=e,t.height=n,t}function Xu(i,t){var e=t.charAt(0),n=t.charAt(1),s=i.width,o=i.height,r=i.left,a=i.top;return e==="c"?a+=o/2:e==="b"&&(a+=o),n==="c"?r+=s/2:n==="r"&&(r+=s),{left:r,top:a}}function Ds(i,t,e,n,s){var o=Xu(t,e[1]),r=Xu(i,e[0]),a=[r.left-o.left,r.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-s[0]),top:Math.round(i.top-a[1]+n[1]-s[1])}}function $u(i,t,e){return i.left<e.left||i.left+t.width>e.right}function Zu(i,t,e){return i.top<e.top||i.top+t.height>e.bottom}function QA(i,t,e){return i.left>e.right||i.left+t.width<e.left}function VA(i,t,e){return i.top>e.bottom||i.top+t.height<e.top}function Ls(i,t,e){var n=[];return G.each(i,function(s){n.push(s.replace(t,function(o){return e[o]}))}),n}function Qs(i,t){return i[t]=-i[t],i}function td(i,t){var e;return/%$/.test(i)?e=parseInt(i.substring(0,i.length-1),10)/100*t:e=parseInt(i,10),e||0}function ed(i,t){i[0]=td(i[0],t.width),i[1]=td(i[1],t.height)}function zA(i,t,e,n){var s=e.points,o=e.offset||[0,0],r=e.targetOffset||[0,0],a=e.overflow,l=e.source||i;o=[].concat(o),r=[].concat(r),a=a||{};var c={},h=0,u=!!(a&&a.alwaysByViewport),g=RA(l,u),f=LA(l);ed(o,f),ed(r,t);var p=Ds(f,t,s,o,r),m=G.merge(f,p);if(g&&(a.adjustX||a.adjustY)&&n){if(a.adjustX&&$u(p,f,g)){var b=Ls(s,/[lr]/gi,{l:"r",r:"l"}),y=Qs(o,0),C=Qs(r,0),w=Ds(f,t,b,y,C);QA(w,f,g)||(h=1,s=b,o=y,r=C)}if(a.adjustY&&Zu(p,f,g)){var x=Ls(s,/[tb]/gi,{t:"b",b:"t"}),E=Qs(o,1),S=Qs(r,1),v=Ds(f,t,x,E,S);VA(v,f,g)||(h=1,s=x,o=E,r=S)}h&&(p=Ds(f,t,s,o,r),G.mix(m,p));var M=$u(p,f,g),k=Zu(p,f,g);if(M||k){var I=s;M&&(I=Ls(s,/[lr]/gi,{l:"r",r:"l"})),k&&(I=Ls(s,/[tb]/gi,{t:"b",b:"t"})),s=I,o=e.offset||[0,0],r=e.targetOffset||[0,0]}c.adjustX=a.adjustX&&M,c.adjustY=a.adjustY&&k,(c.adjustX||c.adjustY)&&(m=DA(p,f,g,c))}return m.width!==f.width&&G.css(l,"width",G.width(l)+m.width-f.width),m.height!==f.height&&G.css(l,"height",G.height(l)+m.height-f.height),G.offset(l,{left:m.left,top:m.top},{useCssRight:e.useCssRight,useCssBottom:e.useCssBottom,useCssTransform:e.useCssTransform,ignoreShake:e.ignoreShake}),{points:s,offset:o,targetOffset:r,overflow:c}}function FA(i,t,e){var n,s,o=G.getDocument(i),r=o.defaultView||o.parentWindow,a=G.getWindowScrollLeft(r),l=G.getWindowScrollTop(r),c=G.viewportWidth(r),h=G.viewportHeight(r);"pageX"in t?n=t.pageX:n=a+t.clientX,"pageY"in t?s=t.pageY:s=l+t.clientY;var u={left:n,top:s,width:0,height:0},g=n>=0&&n<=a+c&&s>=0&&s<=l+h,f=[e.points[0],"cc"];return zA(i,u,Du(Du({},e),{},{points:f}),g)}const UA=`.x6-widget-dnd {
|
|
246
|
+
`;class Eu extends $t{init(){Te("core",eA)}dispose(){Ie("core")}}X([$()],Eu.prototype,"dispose",null);class nA extends $t{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return this.svg.getElementById(t)!=null}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${Do(JSON.stringify(t))}`),!this.isDefined(e)){const s=ui.get(n);if(s==null)return ui.onNotFound(n);const o=s(t.args||{}),r=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});U.create(Lt.sanitize(o),r).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Do(JSON.stringify(t))}`),!this.isDefined(e)){const o=t.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),r=`<${n}>${o.join("")}</${n}>`,a=Object.assign({id:e},t.attrs);U.create(r,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:s,markerUnits:o,markerOrient:r,tagName:a,children:l}=t,c=Y(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Do(JSON.stringify(t))}`),!this.isDefined(h)){a!=="path"&&delete c.d;const u=U.create("marker",{refX:n,refY:s,id:h,overflow:"visible",orient:r??"auto",markerUnits:o||"userSpaceOnUse"},l?l.map(g=>{var{tagName:f}=g,p=Y(g,["tagName"]);return U.create(`${f}`||"path",Xn(Object.assign(Object.assign({},c),p)))}):[U.create(a||"path",Xn(c))]);this.defs.appendChild(u.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}class Su extends $t{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),s=this.getInstance(),o=Array.isArray(t)?t:[t];this.patterns.forEach((l,c)=>{const h=`pattern_${c}`,u=n.a||1,g=n.d||1,{update:f,markup:p}=l,m=Y(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},m),o[c]),{sx:u,sy:g,ox:n.e||0,oy:n.f||0,width:e*u,height:e*g});s.has(h)||s.add(h,U.create("pattern",{id:h,patternUnits:"userSpaceOnUse"},U.createVectors(p)).node);const y=s.get(h);typeof f=="function"&&f(y.childNodes[0],b);let w=b.ox%b.width;w<0&&(w+=b.width);let C=b.oy%b.height;C<0&&(C+=b.height),W(y,{x:w,y:C,width:b.width,height:b.height})});const r=new XMLSerializer().serializeToString(s.root),a=`url(data:image/svg+xml;base64,${btoa(r)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new tw),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(e==null)return[Object.assign(Object.assign({},yh.dot),t.args)];const n=di.get(e);if(n){let s=t.args||[];return Array.isArray(s)||(s=[s]),Array.isArray(n)?n.map((o,r)=>Object.assign(Object.assign({},o),s[r])):[Object.assign(Object.assign({},n),s[0])]}return di.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}X([$()],Su.prototype,"dispose",null);class Mu extends $t{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const s=this.resolveHighlighter(n);if(!s)return;const o=this.getHighlighterId(e,s);if(!this.highlights[o]){const r=s.highlighter;r.highlight(t,e,Object.assign({},s.args)),this.highlights[o]={cellView:t,magnet:e,highlighter:r,args:s.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const s=this.getHighlighterId(t,n);this.unhighlight(s)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(n==null){const a=t.type;n=a&&e.highlighting[a]||e.highlighting.default}if(n==null)return null;const s=typeof n=="string"?{name:n}:n,o=s.name,r=gi.get(o);return r==null?gi.onNotFound(o):(lw(o,r),{name:o,highlighter:r,args:s.args||{}})}getHighlighterId(t,e){return Mo(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}X([$()],Mu.prototype,"dispose",null);class Bu extends $t{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Qc(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(t){(this.disabled||t)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=this.widgetOptions.guard;return(e==null||e(t))&&Ne(t,this.widgetOptions.modifiers)}onMouseWheel(t){const e=this.widgetOptions.guard;if((e==null||e(t))&&Ne(t,this.widgetOptions.modifiers)){const n=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.transform.getScale().sx),t.deltaY<0?(this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*n*20)/20/this.currentScale,this.cumulatedFactor<=1&&(this.cumulatedFactor=1.05)):(this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/n)*20)/20/this.currentScale,this.cumulatedFactor>=1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const o=this.currentScale;let r=this.graph.transform.clampScale(o*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(r=Ye(r,a,l),r!==o)if(this.widgetOptions.zoomAtMousePosition){const h=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(r,{absolute:!0,center:h.clone()})}else this.graph.zoom(r,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}X([$()],Bu.prototype,"dispose",null);function iA(i){const{grid:t,panning:e,mousewheel:n,embedding:s}=i,o=Y(i,["grid","panning","mousewheel","embedding"]),r=i.container;if(r!=null)o.width==null&&(o.width=r.clientWidth),o.height==null&&(o.height=r.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const a=ft({},sA,o),l={size:10,visible:!1};return typeof t=="number"?a.grid={size:t,visible:!1}:typeof t=="boolean"?a.grid=Object.assign(Object.assign({},l),{visible:t}):a.grid=Object.assign(Object.assign({},l),t),["panning","mousewheel","embedding"].forEach(h=>{const u=i[h];typeof u=="boolean"?a[h].enabled=u:u!=null&&(a[h]=Object.assign(Object.assign({},a[h]),u))}),a}const sA={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!0,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:et.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:et.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:i,sourceView:t,targetView:e}){return(i==="target"?e:t)!=null},createEdge(){return new qC}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1};class ku extends $t{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),ot.on(this.graph.container,"mousedown",this.onRightMouseDown),ot.on(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle=new Qc(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),ot.off(this.graph.container,"mousedown",this.onRightMouseDown),ot.off(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(t,e){return t.spaceKey=this.isSpaceKeyPressed,this.pannable&&Ne(t,this.widgetOptions.modifiers,e)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(t),ot.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ot.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,s=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(n,s)}stopPanning(t){this.panning=!1,this.updateClassName(t),ot.off(document.body,".panning"),ot.off(window,".panning")}updateClassName(t){const e=this.widgetOptions.eventTypes;if((e==null?void 0:e.length)===1&&e.includes("mouseWheel"))return;const n=this.view.container,s=this.view.prefixClassName("graph-panning"),o=this.view.prefixClassName("graph-pannable"),r=this.graph.getPlugin("selection"),a=r&&r.allowRubberband(t,!0),l=(e==null?void 0:e.includes("leftMouseDown"))&&!a;this.allowPanning(t??{},!0)||this.allowPanning(t??{})&&l?this.panning?(Q(n,s),lt(n,o)):(lt(n,s),Q(n,o)):this.panning||(lt(n,s),lt(n,o))}onMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.getPlugin("selection"),n=e&&e.allowRubberband(t,!0);(this.allowPanning(t,!0)||this.allowPanning(t)&&!n)&&this.startPanning(t)}onRightMouseDown(t){const e=this.widgetOptions.eventTypes;e!=null&&e.includes("rightMouseDown")&&t.button===2&&this.allowPanning(t,!0)&&this.startPanning(t)}onMouseWheel(t,e,n){this.graph.translateBy(-e,-n)}onKeyDown(t){t.which===32&&(this.isSpaceKeyPressed=!0),this.updateClassName(t)}onKeyUp(t){t.which===32&&(this.isSpaceKeyPressed=!1),this.updateClassName(t)}allowBlankMouseDown(t){const e=this.widgetOptions.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}allowMouseWheel(t){var e;return this.pannable&&!t.ctrlKey&&((e=this.widgetOptions.eventTypes)===null||e===void 0?void 0:e.includes("mouseWheel"))}autoPanning(t,e){const s=this.graph.getGraphArea();let o=0,r=0;t<=s.left+10&&(o=-10),e<=s.top+10&&(r=-10),t>=s.right-10&&(o=10),e>=s.bottom-10&&(r=10),(o!==0||r!==0)&&this.graph.translateBy(-o,-r)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}X([$()],ku.prototype,"dispose",null);class Tu extends $t{getScroller(){const t=this.graph.getPlugin("scroller");return t&&t.options.enabled?t:null}getContainer(){const t=this.getScroller();return t?t.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const t=this.options.autoResize;if(t)return typeof t=="boolean"?this.getContainer()||void 0:t}init(){if(this.options.autoResize){const e=this.getSensorTarget();if(e){if(typeof ResizeObserver>"u")return;this.ro=new ResizeObserver(o=>{if(!o||o.length===0)return;const{width:r,height:a}=o[0].contentRect;this.resize(Math.round(r),Math.round(a))}),this.ro.observe(e);const n=e.offsetWidth,s=e.offsetHeight;this.resize(n,s)}}}resize(t,e){const n=this.getScroller();n?n.resize(t,e):this.graph.transform.resize(t,e)}dispose(){this.ro&&(this.ro.disconnect(),this.ro=void 0)}}X([$()],Tu.prototype,"dispose",null);class oA extends $t{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),kt(this.viewportMatrix)}setMatrix(t){const e=kt(t),n=ti(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=t===void 0?this.options.width:t,s=e===void 0?this.options.height:e;this.options.width=n,this.options.height=s,typeof n=="number"&&(n=Math.round(n)),typeof s=="number"&&(s=Math.round(s)),this.container.style.width=n==null?"":`${n}px`,this.container.style.height=s==null?"":`${s}px`;const o=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},o)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Ae(t)||(t=this.container.clientWidth),Ae(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return y6(this.getMatrix())}scale(t,e=t,n=0,s=0,o=!0){if(t=this.clampScale(t),e=this.clampScale(e),o&&(n||s)){const a=this.getTranslation(),l=this.getScale(),c=n-(n-a.tx)*(t/l.sx),h=s-(s-a.ty)*(e/l.sy);(c!==a.tx||h!==a.ty)&&this.translate(c,h)}const r=this.getMatrix();return r.a=t,r.d=e,this.setMatrix(r),this.graph.trigger("scale",{sx:t,sy:e,ox:n,oy:s}),this}clampScale(t){const e=this.graph.options.scaling;return Ye(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,s=t;const o=this.getScale(),r=this.getComputedSize();let a=r.width/2,l=r.height/2;return e.absolute||(n+=o.sx,s+=o.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,s=Math.round(s/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),s=Math.min(e.maxScale,s)),e.minScale&&(n=Math.max(e.minScale,n),s=Math.max(e.minScale,s)),e.center&&(a=e.center.x,l=e.center.y),n=this.clampScale(n),s=this.clampScale(s),this.scale(n,s,a,l),this}getRotation(){return w6(this.getMatrix())}rotate(t,e,n){if(e==null||n==null){const o=fe(this.stage);e=o.width/2,n=o.height/2}const s=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(s),this}getTranslation(){return C6(this.getMatrix())}translate(t,e){const n=this.getMatrix();n.e=t||0,n.f=e||0,this.setMatrix(n);const s=this.getTranslation();return this.options.x=s.tx,this.options.y=s.ty,this.graph.trigger("translate",Object.assign({},s)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,s){if(typeof t=="object"){const C=t;t=C.gridWidth||1,e=C.gridHeight||1,n=C.padding||0,s=C}else t=t||1,e=e||1,n=n||0,s==null&&(s={});const o=oe(n),r=s.border||0,a=s.contentArea?P.create(s.contentArea):this.getContentArea(s);r>0&&a.inflate(r);const l=this.getScale(),c=this.getTranslation(),h=l.sx,u=l.sy;a.x*=h,a.y*=u,a.width*=h,a.height*=u;let g=Math.max(Math.ceil((a.width+a.x)/t),1)*t,f=Math.max(Math.ceil((a.height+a.y)/e),1)*e,p=0,m=0;(s.allowNewOrigin==="negative"&&a.x<0||s.allowNewOrigin==="positive"&&a.x>=0||s.allowNewOrigin==="any")&&(p=Math.ceil(-a.x/t)*t,p+=o.left,g+=p),(s.allowNewOrigin==="negative"&&a.y<0||s.allowNewOrigin==="positive"&&a.y>=0||s.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/e)*e,m+=o.top,f+=m),g+=o.right,f+=o.bottom,g=Math.max(g,s.minWidth||0),f=Math.max(f,s.minHeight||0),g=Math.min(g,s.maxWidth||Number.MAX_SAFE_INTEGER),f=Math.min(f,s.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),y=g!==b.width||f!==b.height;return(p!==c.tx||m!==c.ty)&&this.translate(p,m),y&&this.resize(g,f),new P(-p/h,-m/u,g/h,f/u)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,s;if(t.contentArea){const y=t.contentArea;n=this.graph.localToGraph(y),s=A.create(y)}else n=this.getContentBBox(t),s=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const o=oe(t.padding),r=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||r,c=t.maxScaleX||a,h=t.minScaleY||r,u=t.maxScaleY||a;let g;if(t.viewportArea)g=t.viewportArea;else{const y=this.getComputedSize(),w=this.getTranslation();g={x:w.tx,y:w.ty,width:y.width,height:y.height}}g=P.create(g).moveAndExpand({x:o.left,y:o.top,width:-o.left-o.right,height:-o.top-o.bottom});const f=this.getScale();let p=g.width/n.width*f.sx,m=g.height/n.height*f.sy;t.preserveAspectRatio!==!1&&(p=m=Math.min(p,m));const b=t.scaleGrid;if(b&&(p=b*Math.floor(p/b),m=b*Math.floor(m/b)),p=Ye(p,l,c),m=Ye(m,h,u),this.scale(p,m),e){const y=this.options,w=g.x-s.x*p-y.x,C=g.y-s.y*m-y.y;this.translate(w,C)}}getContentArea(t={}){return t.useCellGeometry!==!1?this.model.getAllCellsBBox()||new P:fe(this.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=P.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=P.create(t),s=this.graph;e.contentArea=n,e.viewportArea==null&&(e.viewportArea={x:s.options.x,y:s.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),s=this.getScale(),o=this.getTranslation(),r=n.width/2,a=n.height/2;t=typeof t=="number"?t:r,e=typeof e=="number"?e:a,t=r-t*s.sx,e=a-e*s.sy,(o.tx!==t||o.ty!==e)&&this.translate(t,e)}centerContent(t){const n=this.graph.getContentArea(t).getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const s=this.getComputedSize();e=Gt(e,Math.max(0,s.width)),e<0&&(e=s.width+e),n=Gt(n,Math.max(0,s.height)),n<0&&(n=s.height+n);const o=this.getTranslation(),r=this.getScale(),a=e-t.x*r.sx,l=n-t.y*r.sy;(o.tx!==a||o.ty!==l)&&this.translate(a,l)}positionRect(t,e){const n=P.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}}const ze=`${et.prefixCls}-graph`;class Be extends jt{static snapshoot(t){const e=t.cloneNode();return t.childNodes.forEach(n=>{e.appendChild(n)}),()=>{for(Wn(t);t.attributes.length>0;)t.removeAttribute(t.attributes[0].name);for(let n=0,s=e.attributes.length;n<s;n+=1){const o=e.attributes[n];t.setAttribute(o.name,o.value)}e.childNodes.forEach(n=>{t.appendChild(n)})}}get disposeContainer(){return!1}get options(){return this.graph.options}constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Lt.parseJSONMarkup(Be.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=Be.snapshoot(this.container),Q(this.container,this.prefixClassName("graph")),Nt(this.container,n),this.delegateEvents()}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return t.type==="mousedown"&&t.button===2||this.options.guard&&this.options.guard(t,e)?!0:t.data&&t.data.guarded!==void 0?t.data.guarded:!(e&&e.cell&&q.isCell(e.cell)||this.svg===t.target||this.container===t.target||this.svg.contains(t.target))}findView(t){return this.graph.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,s.x,s.y):this.graph.trigger("blank:dblclick",{e,x:s.x,y:s.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,s.x,s.y):this.graph.trigger("blank:click",{e,x:s.x,y:s.y})}}isPreventDefaultContextMenu(t){let e=this.options.preventDefaultContextMenu;return typeof e=="function"&&(e=F(e,this.graph,{view:t})),e}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(n)&&t.preventDefault(),this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,s.x,s.y):this.graph.trigger("blank:contextmenu",{e,x:s.x,y:s.y})}delegateDragEvents(t,e){t.data==null&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){return this.getEventData(t).mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&t.preventDefault();const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,s.x,s.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&t.preventDefault(),this.graph.trigger("blank:mousedown",{e,x:s.x,y:s.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY||(e.mouseMovedCount==null&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,e.mouseMovedCount<=this.options.moveThreshold))return;const o=this.normalizeEvent(t),r=this.graph.snapToGrid(o.clientX,o.clientY),a=e.currentView;a?a.onMouseMove(o,r.x,r.y):this.graph.trigger("blank:mousemove",{e:o,x:r.x,y:r.y}),this.setEventData(o,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),o=this.getEventData(t).currentView;if(o?o.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e,x:n.x,y:n.y}),!t.isPropagationStopped()){const r=new ve(t,{type:"click",data:t.data});this.onClick(r)}t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const 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})}}onMouseOut(t){const 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})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.findViewByElem(e.relatedTarget);if(n){if(s===n)return;n.onMouseEnter(e)}else{if(s)return;this.graph.trigger("graph:mouseenter",{e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.findViewByElem(e.relatedTarget);if(n){if(s===n)return;n.onMouseLeave(e)}else{if(s)return;this.graph.trigger("graph:mouseleave",{e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=e.originalEvent,o=this.graph.snapToGrid(s.clientX,s.clientY),r=Math.max(-1,Math.min(1,s.wheelDelta||-s.detail));n?n.onMouseWheel(e,o.x,o.y,r):this.graph.trigger("blank:mousewheel",{e,delta:r,x:o.x,y:o.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const s=this.findView(e);if(s){const o=this.normalizeEvent(t);if(this.guard(o,s))return;const r=this.graph.snapToGrid(o.clientX,o.clientY);s.onCustomEvent(o,n,r.x,r.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,s=n.getAttribute("magnet");if(s&&s.toLowerCase()!=="false"){const o=this.findView(n);if(o){const r=this.normalizeEvent(t);if(this.guard(r,o))return;const a=this.graph.snapToGrid(r.clientX,r.clientY);F(e,this.graph,o,r,n,a.x,a.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(e,n,s,o,r)=>{e.onMagnetMouseDown(n,s,o,r)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(e,n,s,o,r)=>{e.onMagnetDblClick(n,s,o,r)})}onMagnetContextMenu(t){const e=this.findView(t.target);this.isPreventDefaultContextMenu(e)&&t.preventDefault(),this.handleMagnetEvent(t,(n,s,o,r,a)=>{n.onMagnetContextMenu(s,o,r,a)})}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const s=this.normalizeEvent(t);if(this.guard(s,n))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);n.onLabelMouseDown(s,o.x,o.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}Be.markup=[{ns:Bt.xhtml,tagName:"div",selector:"background",className:`${ze}-background`},{ns:Bt.xhtml,tagName:"div",selector:"grid",className:`${ze}-grid`},{ns:Bt.svg,tagName:"svg",selector:"svg",className:`${ze}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":Bt.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${ze}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${ze}-svg-primer`},{tagName:"g",selector:"stage",className:`${ze}-svg-stage`},{tagName:"g",selector:"decorator",className:`${ze}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${ze}-svg-overlay`}]}]}],Be.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${et.prefixCls}-cell`]:"onMouseEnter",[`mouseleave .${et.prefixCls}-cell`]:"onMouseLeave",[`mouseenter .${et.prefixCls}-cell-tools`]:"onMouseEnter",[`mouseleave .${et.prefixCls}-cell-tools`]:"onMouseLeave",[`mousedown .${et.prefixCls}-cell [event]`]:"onCustomEvent",[`touchstart .${et.prefixCls}-cell [event]`]:"onCustomEvent",[`mousedown .${et.prefixCls}-cell [data-event]`]:"onCustomEvent",[`touchstart .${et.prefixCls}-cell [data-event]`]:"onCustomEvent",[`dblclick .${et.prefixCls}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${et.prefixCls}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${et.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${et.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${et.prefixCls}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${et.prefixCls}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${et.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${et.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${et.prefixCls}-cell image`]:"onImageDragStart",[`mousedown .${et.prefixCls}-edge .${et.prefixCls}-edge-label`]:"onLabelMouseDown",[`touchstart .${et.prefixCls}-edge .${et.prefixCls}-edge-label`]:"onLabelMouseDown"},Be.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},X([$()],Be.prototype,"dispose",null);const Iu=120;class Pu extends $t{init(){this.resetRenderArea=ty(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}bindScrollerEvents(t){this.scrollerRef=t,typeof t.on=="function"&&(t.on("pan:start",this.resetRenderArea,this),t.on("panning",this.resetRenderArea,this),t.on("pan:stop",this.resetRenderArea,this));const e=t.container;e&&(this.scrollerScrollHandler=n=>{this.resetRenderArea()},ot.on(e,"scroll",this.scrollerScrollHandler))}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this);const t=this.graph.getPlugin("scroller");t&&this.bindScrollerEvents(t)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this),this.unbindScroller()}onScrollerReady(t){this.scrollerRef!==t&&(this.unbindScroller(),this.bindScrollerEvents(t),this.resetRenderArea())}unbindScroller(){if(this.scrollerRef){typeof this.scrollerRef.off=="function"&&(this.scrollerRef.off("pan:start",this.resetRenderArea,this),this.scrollerRef.off("panning",this.resetRenderArea,this),this.scrollerRef.off("pan:stop",this.resetRenderArea,this));const t=this.scrollerRef.container;t&&this.scrollerScrollHandler&&ot.off(t,"scroll",this.scrollerScrollHandler),this.scrollerRef=void 0,this.scrollerScrollHandler=void 0}}setVirtualEnabled(t){const e=this.options.virtual;if(typeof e=="object"){const n=e;this.options.virtual=Object.assign(Object.assign({},n),{enabled:t})}else this.options.virtual=t}enableVirtualRender(){this.setVirtualEnabled(!0),this.resetRenderArea()}disableVirtualRender(){this.setVirtualEnabled(!1),this.graph.renderer.setRenderArea(void 0)}isVirtualEnabled(){const t=this.options.virtual;return t!=null&&typeof t=="object"?t.enabled!==!1:!!t}getVirtualMargin(){const t=this.options.virtual;if(typeof t=="object"){const e=t.margin;return typeof e=="number"?e:Iu}return Iu}resetRenderArea(){if(this.isVirtualEnabled()){const e=this.graph.getGraphArea();if(e){const n=this.getVirtualMargin(),s=e.clone();s.inflate(n,n),this.graph.renderer.setRenderArea(s);return}}}dispose(){this.stopListening()}}X([$()],Pu.prototype,"dispose",null);class B extends Ft{static isGraph(t){if(t==null)return!1;if(t instanceof B)return!0;const e=t[Symbol.toStringTag];return e==null||e===B.toStringTag}static render(t,e){const n=t instanceof HTMLElement?new B({container:t}):new B(t);return e!=null&&n.fromJSON(e),n}get container(){return this.options.container}get[Symbol.toStringTag](){return B.toStringTag}constructor(t){super(),this.installedPlugins=new Set,this.options=iA(t),this.css=new Eu(this),this.view=new Be(this),this.defs=new nA(this),this.coord=new tA(this),this.transform=new oA(this),this.highlight=new Mu(this),this.grid=new Su(this),this.background=new br(this),this.options.model?this.model=this.options.model:(this.model=new Yt,this.model.graph=this),this.renderer=new vu(this),this.panning=new ku(this),this.mousewheel=new Bu(this),this.virtualRender=new Pu(this),this.size=new Tu(this)}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(n=>Pt.isNode(n)?n:this.createNode(n)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(n=>xt.isEdge(n)?n:this.createEdge(n)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,s,o){return this.model.getNodesInArea(t,e,n,s,o)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const s=typeof t=="string"?t:"update",o=typeof t=="string"?e:t,r=typeof e=="function"?n:e;this.startBatch(s,r);const a=o();return this.stopBatch(s,r),a}updateCellId(t,e){return this.model.updateCellId(t,e)}findView(t){return q.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return P.isRectangleLike(t)?this.findViewsInArea(t):A.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,s,o){const r=typeof t=="number"?{x:t,y:e,width:n,height:s}:t,a=typeof t=="number"?o:e;return this.renderer.findViewsInArea(r,a)}matrix(t){return typeof t>"u"?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){const n=this.getPlugin("scroller");return n?n.resize(t,e):this.transform.resize(t,e),this}scale(t,e=t,n=0,s=0){return typeof t>"u"?this.transform.getScale():(this.transform.scale(t,e,n,s),this)}zoom(t,e){const n=this.getPlugin("scroller");if(n){if(typeof t>"u")return n.zoom();n.zoom(t,e)}else{if(typeof t>"u")return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.getPlugin("scroller");return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.getPlugin("scroller");return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.getPlugin("scroller");return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return typeof t>"u"?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return typeof t>"u"?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),s=n.tx+t,o=n.ty+e;return this.translate(s,o)}getGraphArea(){var t;const e=this.getPlugin("scroller");if(e){const n=(t=e.getVisibleArea)===null||t===void 0?void 0:t.call(e);if(n)return n}return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,s){return this.transform.fitToContent(t,e,n,s)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const s=this.getPlugin("scroller");return s?s.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.getPlugin("scroller");return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.getPlugin("scroller");return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,s={}){const o=this.getPlugin("scroller");return o?o.positionPoint(t,e,n,s):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const s=this.getPlugin("scroller");return s?s.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const s=this.getPlugin("scroller");return s?s.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.getPlugin("scroller");return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,s){return P.isRectangleLike(t)?this.coord.pageToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.pageToLocalRect(t,e,n,s):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,s){return P.isRectangleLike(t)?this.coord.localToPageRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToPageRect(t,e,n,s):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,s){return P.isRectangleLike(t)?this.coord.clientToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.clientToLocalRect(t,e,n,s):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,s){return P.isRectangleLike(t)?this.coord.localToClientRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToClientRect(t,e,n,s):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,s){return P.isRectangleLike(t)?this.coord.localToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToGraphRect(t,e,n,s):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,s){return P.isRectangleLike(t)?this.coord.graphToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.graphToLocalRect(t,e,n,s):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,s){return P.isRectangleLike(t)?this.coord.clientToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.clientToGraphRect(t,e,n,s):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.getPlugin("scroller");return n!=null&&(this.options.background==null||!e)?n.drawBackground(t,e):this.background.draw(t),this}clearBackground(t){const e=this.getPlugin("scroller");return e!=null&&(this.options.background==null||!t)?e.clearBackground(t):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return t==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.getPlugin("scroller");return t?t.isPannable():this.panning.pannable}enablePanning(){const t=this.getPlugin("scroller");return t?t.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.getPlugin("scroller");return t?t.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}handleScrollerPluginStateChange(t,e){t.name==="scroller"&&(e?this.virtualRender.onScrollerReady(t):this.virtualRender.unbindScroller())}use(t,...e){return this.installedPlugins.has(t)||(this.installedPlugins.add(t),t.init(this,...e),this.handleScrollerPluginStateChange(t,!0)),this}getPlugin(t){return Array.from(this.installedPlugins).find(e=>e.name===t)}getPlugins(t){return Array.from(this.installedPlugins).filter(e=>t.includes(e.name))}enablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{var o;(o=s==null?void 0:s.enable)===null||o===void 0||o.call(s),this.handleScrollerPluginStateChange(s,!0)}),this}disablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{var o;(o=s==null?void 0:s.disable)===null||o===void 0||o.call(s),this.handleScrollerPluginStateChange(s,!1)}),this}isPluginEnabled(t){var e;const n=this.getPlugin(t);return(e=n==null?void 0:n.isEnabled)===null||e===void 0?void 0:e.call(n)}disposePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{s.dispose(),this.handleScrollerPluginStateChange(s,!1),this.installedPlugins.delete(s)}),this}dispose(t=!0){t&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}B.toStringTag=`X6.${B.name}`,B.registerNode=Pt.registry.register,B.registerEdge=xt.registry.register,B.registerView=It.registry.register,B.registerAttr=ri.register,B.registerGrid=di.register,B.registerFilter=ui.register,B.registerNodeTool=Ei.register,B.registerEdgeTool=Si.register,B.registerBackground=ms.register,B.registerHighlighter=gi.register,B.registerPortLayout=mi.register,B.registerPortLabelLayout=Es.register,B.registerMarker=si.register,B.registerRouter=wi.register,B.registerConnector=ci.register,B.registerAnchor=fi.register,B.registerEdgeAnchor=hi.register,B.registerConnectionPoint=ai.register,B.unregisterNode=Pt.registry.unregister,B.unregisterEdge=xt.registry.unregister,B.unregisterView=It.registry.unregister,B.unregisterAttr=ri.unregister,B.unregisterGrid=di.unregister,B.unregisterFilter=ui.unregister,B.unregisterNodeTool=Ei.unregister,B.unregisterEdgeTool=Si.unregister,B.unregisterBackground=ms.unregister,B.unregisterHighlighter=gi.unregister,B.unregisterPortLayout=mi.unregister,B.unregisterPortLabelLayout=Es.unregister,B.unregisterMarker=si.unregister,B.unregisterRouter=wi.unregister,B.unregisterConnector=ci.unregister,B.unregisterAnchor=fi.unregister,B.unregisterEdgeAnchor=hi.unregister,B.unregisterConnectionPoint=ai.unregister,X([$()],B.prototype,"dispose",null);const yr="html",wr={};class Ou extends Pt{static register(t){const{shape:e,html:n,effect:s,inherit:o}=t,r=Y(t,["shape","html","effect","inherit"]);if(!e)throw new Error("HTML.register should specify `shape` in config.");wr[e]={html:n,effect:s},B.registerNode(e,Object.assign({inherit:o||"html"},r),!0)}}Ou.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Lt.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Pt.registry.register("html",Ou,!0);class Cr extends Zt{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:t}){const e=wr[this.cell.shape];if(e){const{effect:n}=e;(!n||n.includes(t))&&this.renderHTMLComponent()}}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,yr,()=>this.renderHTMLComponent())}renderHTMLComponent(){const t=this.selectors&&this.selectors.foContent;if(t){Wn(t);const e=wr[this.cell.shape];if(!e)return;let{html:n}=e;typeof n=="function"&&(n=n(this.cell)),n&&(typeof n=="string"?t.innerHTML=n:Nt(t,n))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}X([$()],Cr.prototype,"dispose",null),Cr.config({bootstrap:[yr],actions:{html:yr}}),Zt.registry.register("html-view",Cr,!0),Mn("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:WC()},{selector:"image"}),Mi.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(i){const{path:t}=i,e=Y(i,["path"]);return t&&bn(e,"attrs/body/refD",t),e}});class Ar extends Mi{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return t==null?this.removePoints():this.setAttrByPath("body/refPoints",yu(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}Ar.config({propHooks(i){const{points:t}=i,e=Y(i,["points"]);if(t){const n=yu(t);n&&bn(e,"attrs/body/refPoints",n)}return e}}),Mn("polygon",{},{parent:Ar}),Mn("polyline",{},{parent:Ar}),Mn("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});function rA(i){return i?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:Bt.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"}}}const aA={shape:"text-block",markup:[{tagName:"rect",selector:"body"},rA(ly)],attrs:{body:Object.assign(Object.assign({},bu),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(i){const{text:t}=i,e=Y(i,["text"]);return t&&bn(e,"attrs/label/text",t),e},attrHooks:{text:{set(i,{cell:t,view:e,refBBox:n,elem:s,attrs:o}){if(s instanceof HTMLElement)s.textContent=i;else{const r=o.style||{},a={text:i,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},r),c=ah.textWrap;return F(c.set,this,a,{cell:t,view:e,elem:s,refBBox:n,attrs:l}),{fill:r.color||null}}},position(i,{refBBox:t,elem:e}){if(e instanceof SVGElement)return t.getCenter()}}}};Mi.define(aA);const xr=`${et.prefixCls}.clipboard.cells`;function lA(i){if(window.localStorage){const t=i.map(e=>e.toJSON());localStorage.setItem(xr,JSON.stringify(t))}}function cA(){if(window.localStorage){const i=localStorage.getItem(xr),t=i?JSON.parse(i):[];if(t)return Yt.fromJSON(t)}}function hA(){window.localStorage&&localStorage.removeItem(xr)}class uA{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const o=(Yt.isModel(e)?e:e.model).cloneSubGraph(t,n);this.cells=wo(Object.keys(o).map(r=>o[r]),r=>r.isEdge()?2:1),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n),(B.isGraph(e)?e.model:e).batchUpdate("cut",()=>{t.forEach(o=>o.remove())})}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:s,edgeProps:o,nodeProps:r}=n;let a=20,l=20;s&&(a=typeof s=="number"?s:s.dx,l=typeof s=="number"?s:s.dy),this.deserialize(n);const c=this.cells;c.forEach(u=>{u.model=null,u.removeProp("zIndex"),(a||l)&&u.translate(a,l),r&&u.isNode()&&u.prop(r),o&&u.isEdge()&&u.prop(o)});const h=B.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(c,t,e),c}serialize(t){t.useLocalStorage!==!1&&lA(this.cells)}deserialize(t){if(t.useLocalStorage){const e=cA();e&&(this.cells=e)}}isEmpty(t={}){return t.useLocalStorage&&this.deserialize(t),this.cells.length<=0}clean(){this.options={},this.cells=[],hA()}}B.prototype.isClipboardEnabled=function(){const i=this.getPlugin("clipboard");return i?i.isEnabled():!1},B.prototype.enableClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.enable(),this},B.prototype.disableClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.disable(),this},B.prototype.toggleClipboard=function(i){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(i),this},B.prototype.isClipboardEmpty=function(i){const t=this.getPlugin("clipboard");return t?t.isEmpty(i):!0},B.prototype.getCellsInClipboard=function(){const i=this.getPlugin("clipboard");return i?i.getCellsInClipboard():[]},B.prototype.cleanClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.clean(),this},B.prototype.copy=function(i,t){const e=this.getPlugin("clipboard");return e&&e.copy(i,t),this},B.prototype.cut=function(i,t){const e=this.getPlugin("clipboard");return e&&e.cut(i,t),this},B.prototype.paste=function(i,t){const e=this.getPlugin("clipboard");return e?e.paste(i,t):[]};class Nu extends Ft{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(t={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},t)}init(t){this.graph=t,this.clipboardImpl=new uA,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}isEmpty(t={}){return this.clipboardImpl.isEmpty(t)}getCellsInClipboard(){return this.cells}clean(t){return(!this.disabled||t)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(t,e={}){return this.disabled||(this.clipboardImpl.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}cut(t,e={}){return this.disabled||(this.clipboardImpl.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}paste(t={},e=this.graph){return this.disabled?[]:this.clipboardImpl.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}get commonOptions(){const t=this.options,{enabled:e}=t;return Y(t,["enabled"])}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.clean(!0),this.off()}}X([$()],Nu.prototype,"dispose",null);function Ru(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,n)}return e}function Du(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(e),!0).forEach(function(n){dA(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Ru(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}function vr(i){"@babel/helpers - typeof";return vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(i)}function dA(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bi,gA={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Os(){if(Bi!==void 0)return Bi;Bi="";var i=document.createElement("p").style,t="Transform";for(var e in gA)e+t in i&&(Bi=e);return Bi}function Lu(){return Os()?"".concat(Os(),"TransitionProperty"):"transitionProperty"}function Ns(){return Os()?"".concat(Os(),"Transform"):"transform"}function Qu(i,t){var e=Lu();e&&(i.style[e]=t,e!=="transitionProperty"&&(i.style.transitionProperty=t))}function Er(i,t){var e=Ns();e&&(i.style[e]=t,e!=="transform"&&(i.style.transform=t))}function fA(i){return i.style.transitionProperty||i.style[Lu()]}function pA(i){var t=window.getComputedStyle(i,null),e=t.getPropertyValue("transform")||t.getPropertyValue(Ns());if(e&&e!=="none"){var n=e.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}var mA=/matrix\((.*)\)/,bA=/matrix3d\((.*)\)/;function yA(i,t){var e=window.getComputedStyle(i,null),n=e.getPropertyValue("transform")||e.getPropertyValue(Ns());if(n&&n!=="none"){var s,o=n.match(mA);if(o)o=o[1],s=o.split(",").map(function(a){return parseFloat(a,10)}),s[4]=t.x,s[5]=t.y,Er(i,"matrix(".concat(s.join(","),")"));else{var r=n.match(bA)[1];s=r.split(",").map(function(a){return parseFloat(a,10)}),s[12]=t.x,s[13]=t.y,Er(i,"matrix3d(".concat(s.join(","),")"))}}else Er(i,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}var wA=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,ki;function Vu(i){var t=i.style.display;i.style.display="none",i.offsetHeight,i.style.display=t}function kn(i,t,e){var n=e;if(vr(t)==="object"){for(var s in t)t.hasOwnProperty(s)&&kn(i,s,t[s]);return}if(typeof n<"u"){typeof n=="number"&&(n="".concat(n,"px")),i.style[t]=n;return}return ki(i,t)}function CA(i){var t,e,n,s=i.ownerDocument,o=s.body,r=s&&s.documentElement;return t=i.getBoundingClientRect(),e=Math.floor(t.left),n=Math.floor(t.top),e-=r.clientLeft||o.clientLeft||0,n-=r.clientTop||o.clientTop||0,{left:e,top:n}}function zu(i,t){var e=i["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof e!="number"){var s=i.document;e=s.documentElement[n],typeof e!="number"&&(e=s.body[n])}return e}function Fu(i){return zu(i)}function Uu(i){return zu(i,!0)}function Ti(i){var t=CA(i),e=i.ownerDocument,n=e.defaultView||e.parentWindow;return t.left+=Fu(n),t.top+=Uu(n),t}function Sr(i){return i!=null&&i==i.window}function Ku(i){return Sr(i)?i.document:i.nodeType===9?i:i.ownerDocument}function AA(i,t,e){var n=e,s="",o=Ku(i);return n=n||o.defaultView.getComputedStyle(i,null),n&&(s=n.getPropertyValue(t)||n[t]),s}var xA=new RegExp("^(".concat(wA,")(?!px)[a-z%]+$"),"i"),vA=/^(top|right|bottom|left)$/,Mr="currentStyle",Br="runtimeStyle",Xe="left",EA="px";function SA(i,t){var e=i[Mr]&&i[Mr][t];if(xA.test(e)&&!vA.test(t)){var n=i.style,s=n[Xe],o=i[Br][Xe];i[Br][Xe]=i[Mr][Xe],n[Xe]=t==="fontSize"?"1em":e||0,e=n.pixelLeft+EA,n[Xe]=s,i[Br][Xe]=o}return e===""?"auto":e}typeof window<"u"&&(ki=window.getComputedStyle?AA:SA);function Rs(i,t){return i==="left"?t.useCssRight?"right":i:t.useCssBottom?"bottom":i}function Ju(i){if(i==="left")return"right";if(i==="right")return"left";if(i==="top")return"bottom";if(i==="bottom")return"top"}function ju(i,t,e){kn(i,"position")==="static"&&(i.style.position="relative");var n=-999,s=-999,o=Rs("left",e),r=Rs("top",e),a=Ju(o),l=Ju(r);o!=="left"&&(n=999),r!=="top"&&(s=999);var c="",h=Ti(i);("left"in t||"top"in t)&&(c=fA(i)||"",Qu(i,"none")),"left"in t&&(i.style[a]="",i.style[o]="".concat(n,"px")),"top"in t&&(i.style[l]="",i.style[r]="".concat(s,"px")),Vu(i);var u=Ti(i),g={};for(var f in t)if(t.hasOwnProperty(f)){var p=Rs(f,e),m=f==="left"?n:s,b=h[f]-u[f];p===f?g[p]=m+b:g[p]=m-b}kn(i,g),Vu(i),("left"in t||"top"in t)&&Qu(i,c);var y={};for(var w in t)if(t.hasOwnProperty(w)){var C=Rs(w,e),x=t[w]-h[w];w===C?y[C]=g[C]+x:y[C]=g[C]-x}kn(i,y)}function MA(i,t){var e=Ti(i),n=pA(i),s={x:n.x,y:n.y};"left"in t&&(s.x=n.x+t.left-e.left),"top"in t&&(s.y=n.y+t.top-e.top),yA(i,s)}function BA(i,t,e){if(e.ignoreShake){var n=Ti(i),s=n.left.toFixed(0),o=n.top.toFixed(0),r=t.left.toFixed(0),a=t.top.toFixed(0);if(s===r&&o===a)return}e.useCssRight||e.useCssBottom?ju(i,t,e):e.useCssTransform&&Ns()in document.body.style?MA(i,t):ju(i,t,e)}function kr(i,t){for(var e=0;e<i.length;e++)t(i[e])}function Gu(i){return ki(i,"boxSizing")==="border-box"}var kA=["margin","border","padding"],Tr=-1,TA=2,Ir=1,IA=0;function PA(i,t,e){var n={},s=i.style,o;for(o in t)t.hasOwnProperty(o)&&(n[o]=s[o],s[o]=t[o]);e.call(i);for(o in t)t.hasOwnProperty(o)&&(s[o]=n[o])}function Ii(i,t,e){var n=0,s,o,r;for(o=0;o<t.length;o++)if(s=t[o],s)for(r=0;r<e.length;r++){var a=void 0;s==="border"?a="".concat(s).concat(e[r],"Width"):a=s+e[r],n+=parseFloat(ki(i,a))||0}return n}var me={getParent:function(t){var e=t;do e.nodeType===11&&e.host?e=e.host:e=e.parentNode;while(e&&e.nodeType!==1&&e.nodeType!==9);return e}};kr(["Width","Height"],function(i){me["doc".concat(i)]=function(t){var e=t.document;return Math.max(e.documentElement["scroll".concat(i)],e.body["scroll".concat(i)],me["viewport".concat(i)](e))},me["viewport".concat(i)]=function(t){var e="client".concat(i),n=t.document,s=n.body,o=n.documentElement,r=o[e];return n.compatMode==="CSS1Compat"&&r||s&&s[e]||r}});function Yu(i,t,e){var n=e;if(Sr(i))return t==="width"?me.viewportWidth(i):me.viewportHeight(i);if(i.nodeType===9)return t==="width"?me.docWidth(i):me.docHeight(i);var s=t==="width"?["Left","Right"]:["Top","Bottom"],o=Math.floor(t==="width"?i.getBoundingClientRect().width:i.getBoundingClientRect().height),r=Gu(i),a=0;(o==null||o<=0)&&(o=void 0,a=ki(i,t),(a==null||Number(a)<0)&&(a=i.style[t]||0),a=Math.floor(parseFloat(a))||0),n===void 0&&(n=r?Ir:Tr);var l=o!==void 0||r,c=o||a;return n===Tr?l?c-Ii(i,["border","padding"],s):a:l?n===Ir?c:c+(n===TA?-Ii(i,["border"],s):Ii(i,["margin"],s)):a+Ii(i,kA.slice(n),s)}var OA={position:"absolute",visibility:"hidden",display:"block"};function Hu(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];var n,s=t[0];return s.offsetWidth!==0?n=Yu.apply(void 0,t):PA(s,OA,function(){n=Yu.apply(void 0,t)}),n}kr(["width","height"],function(i){var t=i.charAt(0).toUpperCase()+i.slice(1);me["outer".concat(t)]=function(n,s){return n&&Hu(n,i,s?IA:Ir)};var e=i==="width"?["Left","Right"]:["Top","Bottom"];me[i]=function(n,s){var o=s;if(o!==void 0){if(n){var r=Gu(n);return r&&(o+=Ii(n,["padding","border"],e)),kn(n,i,o)}return}return n&&Hu(n,i,Tr)}});function _u(i,t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}var G={getWindow:function(t){if(t&&t.document&&t.setTimeout)return t;var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},getDocument:Ku,offset:function(t,e,n){if(typeof e<"u")BA(t,e,n||{});else return Ti(t)},isWindow:Sr,each:kr,css:kn,clone:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);var s=t.overflow;if(s)for(e in t)t.hasOwnProperty(e)&&(n.overflow[e]=t.overflow[e]);return n},mix:_u,getWindowScrollLeft:function(t){return Fu(t)},getWindowScrollTop:function(t){return Uu(t)},merge:function(){for(var t={},e=0;e<arguments.length;e++)G.mix(t,e<0||arguments.length<=e?void 0:arguments[e]);return t},viewportWidth:0,viewportHeight:0};_u(G,me);var Pr=G.getParent;function Wu(i){if(G.isWindow(i)||i.nodeType===9)return null;var t=G.getDocument(i),e=t.body,n,s=G.css(i,"position"),o=s==="fixed"||s==="absolute";if(!o)return i.nodeName.toLowerCase()==="html"?null:Pr(i);for(n=Pr(i);n&&n!==e&&n.nodeType!==9;n=Pr(n))if(s=G.css(n,"position"),s!=="static")return n;return null}var qu=G.getParent;function NA(i){if(G.isWindow(i)||i.nodeType===9)return!1;var t=G.getDocument(i),e=t.body,n=null;for(n=qu(i);n&&n!==e&&n!==t;n=qu(n)){var s=G.css(n,"position");if(s==="fixed")return!0}return!1}function RA(i,t){for(var e={left:0,right:1/0,top:0,bottom:1/0},n=Wu(i),s=G.getDocument(i),o=s.defaultView||s.parentWindow,r=s.body,a=s.documentElement;n;){if((navigator.userAgent.indexOf("MSIE")===-1||n.clientWidth!==0)&&n!==r&&n!==a&&G.css(n,"overflow")!=="visible"){var l=G.offset(n);l.left+=n.clientLeft,l.top+=n.clientTop,e.top=Math.max(e.top,l.top),e.right=Math.min(e.right,l.left+n.clientWidth),e.bottom=Math.min(e.bottom,l.top+n.clientHeight),e.left=Math.max(e.left,l.left)}else if(n===r||n===a)break;n=Wu(n)}var c=null;if(!G.isWindow(i)&&i.nodeType!==9){c=i.style.position;var h=G.css(i,"position");h==="absolute"&&(i.style.position="fixed")}var u=G.getWindowScrollLeft(o),g=G.getWindowScrollTop(o),f=G.viewportWidth(o),p=G.viewportHeight(o),m=a.scrollWidth,b=a.scrollHeight,y=window.getComputedStyle(r);if(y.overflowX==="hidden"&&(m=o.innerWidth),y.overflowY==="hidden"&&(b=o.innerHeight),i.style&&(i.style.position=c),t||NA(i))e.left=Math.max(e.left,u),e.top=Math.max(e.top,g),e.right=Math.min(e.right,u+f),e.bottom=Math.min(e.bottom,g+p);else{var w=Math.max(m,u+f);e.right=Math.min(e.right,w);var C=Math.max(b,g+p);e.bottom=Math.min(e.bottom,C)}return e.top>=0&&e.left>=0&&e.bottom>e.top&&e.right>e.left?e:null}function DA(i,t,e,n){var s=G.clone(i),o={width:t.width,height:t.height};return n.adjustX&&s.left<e.left&&(s.left=e.left),n.resizeWidth&&s.left>=e.left&&s.left+o.width>e.right&&(o.width-=s.left+o.width-e.right),n.adjustX&&s.left+o.width>e.right&&(s.left=Math.max(e.right-o.width,e.left)),n.adjustY&&s.top<e.top&&(s.top=e.top),n.resizeHeight&&s.top>=e.top&&s.top+o.height>e.bottom&&(o.height-=s.top+o.height-e.bottom),n.adjustY&&s.top+o.height>e.bottom&&(s.top=Math.max(e.bottom-o.height,e.top)),G.mix(s,o)}function LA(i){var t,e,n;if(!G.isWindow(i)&&i.nodeType!==9)t=G.offset(i),e=G.outerWidth(i),n=G.outerHeight(i);else{var s=G.getWindow(i);t={left:G.getWindowScrollLeft(s),top:G.getWindowScrollTop(s)},e=G.viewportWidth(s),n=G.viewportHeight(s)}return t.width=e,t.height=n,t}function Xu(i,t){var e=t.charAt(0),n=t.charAt(1),s=i.width,o=i.height,r=i.left,a=i.top;return e==="c"?a+=o/2:e==="b"&&(a+=o),n==="c"?r+=s/2:n==="r"&&(r+=s),{left:r,top:a}}function Ds(i,t,e,n,s){var o=Xu(t,e[1]),r=Xu(i,e[0]),a=[r.left-o.left,r.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-s[0]),top:Math.round(i.top-a[1]+n[1]-s[1])}}function $u(i,t,e){return i.left<e.left||i.left+t.width>e.right}function Zu(i,t,e){return i.top<e.top||i.top+t.height>e.bottom}function QA(i,t,e){return i.left>e.right||i.left+t.width<e.left}function VA(i,t,e){return i.top>e.bottom||i.top+t.height<e.top}function Ls(i,t,e){var n=[];return G.each(i,function(s){n.push(s.replace(t,function(o){return e[o]}))}),n}function Qs(i,t){return i[t]=-i[t],i}function td(i,t){var e;return/%$/.test(i)?e=parseInt(i.substring(0,i.length-1),10)/100*t:e=parseInt(i,10),e||0}function ed(i,t){i[0]=td(i[0],t.width),i[1]=td(i[1],t.height)}function zA(i,t,e,n){var s=e.points,o=e.offset||[0,0],r=e.targetOffset||[0,0],a=e.overflow,l=e.source||i;o=[].concat(o),r=[].concat(r),a=a||{};var c={},h=0,u=!!(a&&a.alwaysByViewport),g=RA(l,u),f=LA(l);ed(o,f),ed(r,t);var p=Ds(f,t,s,o,r),m=G.merge(f,p);if(g&&(a.adjustX||a.adjustY)&&n){if(a.adjustX&&$u(p,f,g)){var b=Ls(s,/[lr]/gi,{l:"r",r:"l"}),y=Qs(o,0),w=Qs(r,0),C=Ds(f,t,b,y,w);QA(C,f,g)||(h=1,s=b,o=y,r=w)}if(a.adjustY&&Zu(p,f,g)){var x=Ls(s,/[tb]/gi,{t:"b",b:"t"}),E=Qs(o,1),S=Qs(r,1),v=Ds(f,t,x,E,S);VA(v,f,g)||(h=1,s=x,o=E,r=S)}h&&(p=Ds(f,t,s,o,r),G.mix(m,p));var M=$u(p,f,g),k=Zu(p,f,g);if(M||k){var I=s;M&&(I=Ls(s,/[lr]/gi,{l:"r",r:"l"})),k&&(I=Ls(s,/[tb]/gi,{t:"b",b:"t"})),s=I,o=e.offset||[0,0],r=e.targetOffset||[0,0]}c.adjustX=a.adjustX&&M,c.adjustY=a.adjustY&&k,(c.adjustX||c.adjustY)&&(m=DA(p,f,g,c))}return m.width!==f.width&&G.css(l,"width",G.width(l)+m.width-f.width),m.height!==f.height&&G.css(l,"height",G.height(l)+m.height-f.height),G.offset(l,{left:m.left,top:m.top},{useCssRight:e.useCssRight,useCssBottom:e.useCssBottom,useCssTransform:e.useCssTransform,ignoreShake:e.ignoreShake}),{points:s,offset:o,targetOffset:r,overflow:c}}function FA(i,t,e){var n,s,o=G.getDocument(i),r=o.defaultView||o.parentWindow,a=G.getWindowScrollLeft(r),l=G.getWindowScrollTop(r),c=G.viewportWidth(r),h=G.viewportHeight(r);"pageX"in t?n=t.pageX:n=a+t.clientX,"pageY"in t?s=t.pageY:s=l+t.clientY;var u={left:n,top:s,width:0,height:0},g=n>=0&&n<=a+c&&s>=0&&s<=l+h,f=[e.points[0],"cc"];return zA(i,u,Du(Du({},e),{},{points:f}),g)}const UA=`.x6-widget-dnd {
|
|
247
247
|
position: absolute;
|
|
248
248
|
top: -10000px;
|
|
249
249
|
left: -10000px;
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
background: transparent;
|
|
263
263
|
box-shadow: none;
|
|
264
264
|
}
|
|
265
|
-
`,nd={getDragNode:i=>i.clone(),getDropNode:i=>i.clone()};class Or extends Gt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(t){super(),this.name="dnd",this.options=Object.assign(Object.assign({},nd),t),this.init()}init(){Te(this.name,UA),this.container=document.createElement("div"),Q(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new B(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Ot(this.container,this.draggingGraph.container)}start(t,e){var n;const s=e;s.preventDefault(),this.targetModel.startBatch("dnd"),Q(this.container,"dragging"),Xt(this.container,this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,s.clientX,s.clientY);const o=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:t,cell:t,view:this.draggingView,x:o.x,y:o.y}),(n=this.draggingNode)===null||n===void 0||n.on("change:position",this.snap,this)),this.delegateDocumentEvents(wu,s.data)}isSnaplineEnabled(){var t;return(t=this.snapline)===null||t===void 0?void 0:t.isEnabled()}prepareDragging(t,e,n){const s=this.draggingGraph,o=s.model,r=this.options.getDragNode(t,{sourceNode:t,draggingGraph:s,targetGraph:this.targetGraph});r.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const h=this.targetGraph.transform.getScale();s.scale(h.sx,h.sy),a*=Math.max(h.sx,h.sy)}else s.scale(1,1);this.clearDragging(),o.resetCells([r]);const l=s.findViewByCell(r);l.undelegateEvents(),l.cell.off("changed"),s.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const c=l.getBBox();this.geometryBBox=l.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(c.getTopLeft()),this.draggingNode=r,this.draggingView=l,this.draggingBBox=r.getBBox(),this.padding=a,this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=this.delta,s=this.geometryBBox,o=this.padding||5,r={left:t-n.x-s.width/2-o,top:e-n.y-s.height/2-o};this.draggingGraph&&FA(this.container,{clientX:r.left,clientY:r.top},{points:["tl"]})}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),s=this.draggingBBox;return s&&(n.x-=s.width/2,n.y-=s.height/2,this.draggingNode.position(n.x,n.y)),n}snap({cell:t,current:e,options:n}){const s=t;if(n.snapped){const o=this.draggingBBox;s.position(o.x+n.tx,o.y+n.ty,{silent:!0}),this.draggingView.translate(),s.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onMouseMove(t){this.onDragging(t)}onMouseUp(t){this.onDragEnd(t)}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),s=n.clientX,o=n.clientY;this.updateGraphPosition(s,o);const r=this.updateNodePosition(s,o),a=this.targetGraph.options.embedding.enabled,l=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:s,y:o});if(a){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const c=e.getEventData(n);l?e.processEmbedding(n,c):e.clearEmbedding(c),this.candidateEmbedView=c.candidateEmbedView}this.isSnaplineEnabled()&&(l?this.snapline.snapOnMoving({e:n,view:e,x:r.x,y:r.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),s=this.draggingView,o=this.draggingBBox,r=this.snapOffset;let a=o.x,l=o.y;r&&(a+=r.x,l+=r.y),e.position(a,l,{silent:!0});const c=this.drop(e,{x:n.clientX,y:n.clientY}),h=u=>{u?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&s&&(s.setEventData(n,{cell:u,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),s.finalizeEmbedding(n,s.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Ao(c)?(this.undelegateDocumentEvents(),c.then(h)):h(c)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),lt(this.container,"dragging"),qt(this.container))}onDropInvalid(){const t=this.draggingNode;t&&this.onDropped(t)}isInsideValidArea(t){let e,n=null;const s=this.targetGraph,o=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const r=n==null?void 0:n.containsPoint(t);if(o)if(o.options.autoResize)e=this.getDropArea(o.container);else{const a=this.getDropArea(o.container);e=this.getDropArea(s.container).intersectsWithRect(a)}else e=this.getDropArea(s.container);return!r&&e&&e.containsPoint(t)}getDropArea(t){const e=xn(t),n=document.body.scrollTop||document.documentElement.scrollTop,s=document.body.scrollLeft||document.documentElement.scrollLeft;return P.create({x:e.left+parseInt(nt(t,"border-left-width"),10)-s,y:e.top+parseInt(nt(t,"border-top-width"),10)-n,width:t.clientWidth,height:t.clientHeight})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,s=n.model,o=n.clientToLocal(e),r=this.sourceNode,a=this.options.getDropNode(t,{sourceNode:r,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=a.getBBox();o.x+=l.x-l.width/2,o.y+=l.y-l.height/2;const c=this.snapOffset?1:n.getGridSize();a.position(ae(o.x,c),ae(o.y,c)),a.removeZIndex();const h=this.options.validateNode,u=h?h(a,{sourceNode:r,draggingNode:t,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph}):!0;return typeof u=="boolean"?u?(s.addCell(a,{stencil:this.cid}),a):null:wy(u).then(g=>g?(s.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Ie(this.name)}}$([Z()],Or.prototype,"dispose",null),B.prototype.toSVG=function(i,t){const e=this.getPlugin("export");e&&e.toSVG(i,t)},B.prototype.toSVGAsync=function(i){return Gs(this,void 0,void 0,function*(){return new Promise(t=>{this.toSVG(t,i)})})},B.prototype.toPNG=function(i,t){const e=this.getPlugin("export");e&&e.toPNG(i,t)},B.prototype.toPNGAsync=function(i){return Gs(this,void 0,void 0,function*(){return new Promise(t=>{this.toPNG(t,i)})})},B.prototype.toJPEG=function(i,t){const e=this.getPlugin("export");e&&e.toJPEG(i,t)},B.prototype.toJPEGAsync=function(i){return Gs(this,void 0,void 0,function*(){return new Promise(t=>{this.toJPEG(t,i)})})},B.prototype.exportPNG=function(i,t){const e=this.getPlugin("export");e&&e.exportPNG(i,t)},B.prototype.exportJPEG=function(i,t){const e=this.getPlugin("export");e&&e.exportJPEG(i,t)},B.prototype.exportSVG=function(i,t){const e=this.getPlugin("export");e&&e.exportSVG(i,t)};class KA extends Ft{constructor(){super(...arguments),this.name="export"}get view(){return this.graph.view}init(t){this.graph=t}exportPNG(t="chart",e={}){this.toPNG(n=>{Co(n,t)},e)}exportJPEG(t="chart",e={}){this.toJPEG(n=>{Co(n,t)},e)}exportSVG(t="chart",e={}){this.toSVG(n=>{Co(by(n),t)},e)}toSVG(t,e={}){this.notify("before:export",e),Object.hasOwn(e,"copyStyles")||(e.copyStyles=!0),Object.hasOwn(e,"serializeImages")||(e.serializeImages=!0);const n=this.view.svg,s=U.create(n).clone();let o=s.node;const r=s.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),l=e.preserveDimensions;if(l){const u=typeof l=="boolean"?a:l;s.attr({width:u.width,height:u.height})}if(s.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),r.removeAttribute("transform"),e.copyStyles){const u=n.ownerDocument,g=Array.from(n.querySelectorAll("*")),f=Array.from(o.querySelectorAll("*")),p=u.implementation.createHTMLDocument("x6-export-defaults"),m=p.importNode(n,!0);p.body.appendChild(m);const b=Array.from(m.querySelectorAll("*")),y={};b.forEach((w,x)=>{const E=window.getComputedStyle(w,null),S={};for(let v=0;v<E.length;v+=1){const M=E[v],k=E.getPropertyValue(M);S[M]=k}y[x]=S});const C={};g.forEach((w,x)=>{const E=window.getComputedStyle(w,null),S=y[x]||{},v={};for(let M=0;M<E.length;M+=1){const k=E[M],I=E.getPropertyValue(k);I!==S[k]&&(v[k]=I)}C[x]=v}),f.forEach((w,x)=>{nt(w,C[x])})}const c=e.stylesheet;if(typeof c=="string"){const u=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(c);s.prepend(U.create("style",{type:"text/css"},[u]))}const h=()=>{const u=e.beforeSerialize;if(typeof u=="function"){const f=F(u,this.graph,o);f instanceof SVGSVGElement&&(o=f)}const g=new XMLSerializer().serializeToString(o).replace(/ /g," ");this.notify("after:export",e),t(g)};if(e.serializeImages){const u=s.find("image").map(g=>new Promise(f=>{const p=g.attr("xlink:href")||g.attr("href");fy(p,(m,b)=>{!m&&b&&(g.attr("xlink:href",b),g.attr("href",b)),f()})}));Promise.all(u).then(h)}else h()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const s=re(e.padding);e.width&&e.height&&(s.left+s.right>=e.width&&(s.left=s.right=0),s.top+s.bottom>=e.height&&(s.top=s.bottom=0));const o=new P(-s.left,-s.top,s.left+s.right,s.top+s.bottom);if(e.width&&e.height){const h=n.width+s.left+s.right,u=n.height+s.top+s.bottom;o.scale(h/e.width,u/e.height)}n=P.create(n).moveAndExpand(o);const r=typeof e.width=="number"&&typeof e.height=="number"?{width:e.width,height:e.height}:n;let a=e.ratio?e.ratio:1;(!Number.isFinite(a)||a===0)&&(a=1);const l={width:Math.max(Math.round(r.width*a),1),height:Math.max(Math.round(r.height*a),1)};{const h=document.createElement("canvas"),u=h.getContext("2d");h.width=l.width,h.height=l.height;const g=l.width-1,f=l.height-1;u.fillStyle="rgb(1,1,1)",u.fillRect(g,f,1,1);const p=u.getImageData(g,f,1,1).data;if(p[0]!==1||p[1]!==1||p[2]!==1)throw new Error("size exceeded")}const c=new Image;c.onload=()=>{const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const u=h.getContext("2d");u.fillStyle=e.backgroundColor||"white",u.fillRect(0,0,l.width,l.height);try{u.drawImage(c,0,0,l.width,l.height);const g=h.toDataURL(e.type,e.quality);t(g)}catch{}},this.toSVG(h=>{c.src=`data:image/svg+xml,${encodeURIComponent(h)}`},Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.off()}}$([Z()],KA.prototype,"dispose",null);function Fe(i){return i==="cell:added"}function $e(i){return i==="cell:removed"}function Pi(i){return i!=null&&i.startsWith("cell:change:")}function JA(i){const t=["cell:added","cell:removed","cell:change:*"],e=["batch:start","batch:stop"],n=i.eventNames?i.eventNames.filter(s=>!(Pi(s)||t.includes(s)||e.includes(s))):t;return Object.assign(Object.assign({enabled:!0},i),{eventNames:n,applyOptionsList:i.applyOptionsList||["propertyPath"],revertOptionsList:i.revertOptionsList||["propertyPath"]})}function id(i){const t=[];for(let e=0,n=i.length;e<n;e+=1){const s=i[e];let o=null;if(Fe(s.event)){const r=s.data.id;for(let a=0;a<e;a+=1)if(i[a].data.id===r){o=a;break}}o!==null?t.splice(o,0,s):t.push(s)}return t}class sd extends Ft{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=t.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every(e=>this.isValidCommand(e)):this.isValidCommand(t)}isValidCommand(t){if(t.options&&t.options.validation===!1)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach(s=>{let o=0;const r=a=>{const l=s[o];o+=1;try{l?l(a,t,r):n=a}catch(c){r(c)}};r(n)}),n?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1):!0}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach(s=>{if(typeof s!="function")throw new Error(`${n.join(" ")} requires callback functions.`)}),n.forEach(s=>{this.map[s]==null&&(this.map[s]=[]),this.map[s].push(e)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}$([Z()],sd.prototype,"dispose",null),B.prototype.isHistoryEnabled=function(){const i=this.getPlugin("history");return i?i.isEnabled():!1},B.prototype.enableHistory=function(){const i=this.getPlugin("history");return i&&i.enable(),this},B.prototype.disableHistory=function(){const i=this.getPlugin("history");return i&&i.disable(),this},B.prototype.toggleHistory=function(i){const t=this.getPlugin("history");return t&&t.toggleEnabled(i),this},B.prototype.undo=function(i){const t=this.getPlugin("history");return t&&t.undo(i),this},B.prototype.redo=function(i){const t=this.getPlugin("history");return t&&t.redo(i),this},B.prototype.undoAndCancel=function(i){const t=this.getPlugin("history");return t&&t.cancel(i),this},B.prototype.canUndo=function(){const i=this.getPlugin("history");return i?i.canUndo():!1},B.prototype.canRedo=function(){const i=this.getPlugin("history");return i?i.canRedo():!1},B.prototype.cleanHistory=function(i){const t=this.getPlugin("history");return t&&t.clean(i),this},B.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},B.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},B.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},B.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};class od extends Ft{constructor(t={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:e=0}=t;this.stackSize=e,this.options=JA(t),this.validator=new sd({history:this,cancelInvalid:this.options.cancelInvalid})}init(t){this.graph=t,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStackPush(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const t=this.undoStack.length;return this.stackSize-t}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}get disabled(){return this.options.enabled!==!0}validate(t,...e){return this.validator.validate(t,...e),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:t?t.batch:!1,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?id(t):[t];for(let s=n.length-1;s>=0;s-=1){const o=n[s],r=Object.assign(Object.assign({},e),Il(o.options,this.options.revertOptionsList||[]));this.executeCommand(o,!0,r)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?id(t):[t];for(let s=0;s<n.length;s+=1){const o=n[s],r=Object.assign(Object.assign({},e),Il(o.options,this.options.applyOptionsList||[]));this.executeCommand(o,!1,r)}this.freezed=!1}executeCommand(t,e,n){const s=this.model,o=s.getCell(t.data.id),r=t.event;if(Fe(r)&&e||$e(r)&&!e)o&&o.remove(n);else if(Fe(r)&&!e||$e(r)&&e){const a=t.data;a.node?s.addNode(a.props,n):a.edge&&s.addEdge(a.props,n)}else if(Pi(r)){const a=t.data,l=a.key;if(l&&o){const c=e?a.prev[l]:a.next[l];a.key==="attrs"&&this.ensureUndefinedAttrs(c,e?a.next[l]:a.prev[l])&&(n.dirty=!0),o.prop(l,c,n)}}else{const a=this.options.executeCommand;a&&F(a,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,s=n.options||{};if(s.dryrun||Fe(t)&&this.options.ignoreAdd||$e(t)&&this.options.ignoreRemove||Pi(t)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(o!=null&&F(o,this,t,e)===!1)return;t==="cell:change:*"&&(t=`cell:change:${n.key}`);const r=n.cell,a=Ht.isModel(r);let l;if(this.batchCommands){l=this.batchCommands[Math.max(this.lastBatchIndex,0)];const h=a&&!l.modelChange||l.data.id!==r.id,u=l.event!==t;if(this.lastBatchIndex>=0&&(h||u)){const g=this.batchCommands.findIndex(f=>(a&&f.modelChange||f.data.id===r.id)&&f.event===t);g<0||Fe(t)||$e(t)?l=this.createCommand({batch:!0}):(l=this.batchCommands[g],this.batchCommands.splice(g,1)),this.batchCommands.push(l),this.lastBatchIndex=this.batchCommands.length-1}}else l=this.createCommand({batch:!1});if(Fe(t)||$e(t)){const h=l.data;return l.event=t,l.options=s,h.id=r.id,h.props=dt(r.toJSON()),r.isEdge()?h.edge=!0:r.isNode()&&(h.node=!0),this.push(l,s)}if(Pi(t)){const h=e.key,u=l.data;return(!l.batch||!l.event)&&(l.event=t,l.options=s,u.key=h,u.prev==null&&(u.prev={}),u.prev[h]=dt(r.previous(h)),a?l.modelChange=!0:u.id=r.id),u.next==null&&(u.next={}),u.next[h]=dt(r.prop(h)),this.push(l,s)}const c=this.options.afterAddCommand;c&&F(c,this,t,e,l),this.push(l,s)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];for(;e.length>0;){const s=e.shift(),o=s.event,r=s.data.id;if(o!=null&&(r!=null||s.modelChange)){if(Fe(o)){const a=e.findIndex(l=>$e(l.event)&&l.data.id===r);if(a>=0){e=e.filter((l,c)=>a<c||l.data.id!==r);continue}}else if($e(o)){const a=e.findIndex(l=>Fe(l.event)&&l.data.id===r);if(a>=0){e.splice(a,1);continue}}else if(Pi(o)){const a=s.data;if(Ce(a.prev,a.next))continue}n.push(s)}}return n}notify(t,e,n){const s=e==null?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:s,options:n}),this.graph.trigger(`history:${t}`,{cmds:s,options:n}),this.emit("change",{cmds:s,options:n}),this.graph.trigger("history:change",{cmds:s,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const s=new Set(e.map(r=>r.event));if(s.size!==2||!s.has("cell:change:parent")||!s.has("cell:change:children")||!e.every(r=>{var a;return r.batch&&((a=r.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(n)||n.length!==1)return;const o=n[0];o.event!=="cell:change:position"||!(!((t=o.options)===null||t===void 0)&&t.ui)||(n.push(...e),this.undoStack.pop())}undoStackPush(t){if(this.stackSize===0){this.undoStack.push(t);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(t)}ensureUndefinedAttrs(t,e){let n=!1;return t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(s=>{t[s]===void 0&&e[s]!==void 0?(t[s]=void 0,n=!0):typeof t[s]=="object"&&typeof e[s]=="object"&&(n=this.ensureUndefinedAttrs(t[s],e[s]))}),n}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}$([Z()],od.prototype,"dispose",null);function jA(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var rd={exports:{}};(function(i){(function(t,e,n){if(!t)return;for(var s={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"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,c=1;c<20;++c)s[111+c]="f"+c;for(c=0;c<=9;++c)s[c+96]=c.toString();function h(v,M,k){if(v.addEventListener){v.addEventListener(M,k,!1);return}v.attachEvent("on"+M,k)}function u(v){if(v.type=="keypress"){var M=String.fromCharCode(v.which);return v.shiftKey||(M=M.toLowerCase()),M}return s[v.which]?s[v.which]:o[v.which]?o[v.which]:String.fromCharCode(v.which).toLowerCase()}function g(v,M){return v.sort().join(",")===M.sort().join(",")}function f(v){var M=[];return v.shiftKey&&M.push("shift"),v.altKey&&M.push("alt"),v.ctrlKey&&M.push("ctrl"),v.metaKey&&M.push("meta"),M}function p(v){if(v.preventDefault){v.preventDefault();return}v.returnValue=!1}function m(v){if(v.stopPropagation){v.stopPropagation();return}v.cancelBubble=!0}function b(v){return v=="shift"||v=="ctrl"||v=="alt"||v=="meta"}function y(){if(!l){l={};for(var v in s)v>95&&v<112||s.hasOwnProperty(v)&&(l[s[v]]=v)}return l}function C(v,M,k){return k||(k=y()[v]?"keydown":"keypress"),k=="keypress"&&M.length&&(k="keydown"),k}function w(v){return v==="+"?["+"]:(v=v.replace(/\+{2}/g,"+plus"),v.split("+"))}function x(v,M){var k,I,O,D=[];for(k=w(v),O=0;O<k.length;++O)I=k[O],a[I]&&(I=a[I]),M&&M!="keypress"&&r[I]&&(I=r[I],D.push("shift")),b(I)&&D.push(I);return M=C(I,D,M),{key:I,modifiers:D,action:M}}function E(v,M){return v===null||v===e?!1:v===M?!0:E(v.parentNode,M)}function S(v){var M=this;if(v=v||e,!(M instanceof S))return new S(v);M.target=v,M._callbacks={},M._directMap={};var k={},I,O=!1,D=!1,K=!1;function L(V){V=V||{};var tt=!1,it;for(it in k){if(V[it]){tt=!0;continue}k[it]=0}tt||(K=!1)}function N(V,tt,it,H,st,mt){var T,R,X=[],_=it.type;if(!M._callbacks[V])return[];for(_=="keyup"&&b(V)&&(tt=[V]),T=0;T<M._callbacks[V].length;++T)if(R=M._callbacks[V][T],!(!H&&R.seq&&k[R.seq]!=R.level)&&_==R.action&&(_=="keypress"&&!it.metaKey&&!it.ctrlKey||g(tt,R.modifiers))){var Rt=!H&&R.combo==st,Jt=H&&R.seq==H&&R.level==mt;(Rt||Jt)&&M._callbacks[V].splice(T,1),X.push(R)}return X}function j(V,tt,it,H){M.stopCallback(tt,tt.target||tt.srcElement,it,H)||V(tt,it)===!1&&(p(tt),m(tt))}M._handleKey=function(V,tt,it){var H=N(V,tt,it),st,mt={},T=0,R=!1;for(st=0;st<H.length;++st)H[st].seq&&(T=Math.max(T,H[st].level));for(st=0;st<H.length;++st){if(H[st].seq){if(H[st].level!=T)continue;R=!0,mt[H[st].seq]=1,j(H[st].callback,it,H[st].combo,H[st].seq);continue}R||j(H[st].callback,it,H[st].combo)}var X=it.type=="keypress"&&D;it.type==K&&!b(V)&&!X&&L(mt),D=R&&it.type=="keydown"};function rt(V){typeof V.which!="number"&&(V.which=V.keyCode);var tt=u(V);if(tt){if(V.type=="keyup"&&O===tt){O=!1;return}M.handleKey(tt,f(V),V)}}function Ct(){clearTimeout(I),I=setTimeout(L,1e3)}function pt(V,tt,it,H){k[V]=0;function st(_){return function(){K=_,++k[V],Ct()}}function mt(_){j(it,_,V),H!=="keyup"&&(O=u(_)),setTimeout(L,10)}for(var T=0;T<tt.length;++T){var R=T+1===tt.length,X=R?mt:st(H||x(tt[T+1]).action);ct(tt[T],X,H,V,T)}}function ct(V,tt,it,H,st){M._directMap[V+":"+it]=tt,V=V.replace(/\s+/g," ");var mt=V.split(" "),T;if(mt.length>1){pt(V,mt,tt,it);return}T=x(V,it),M._callbacks[T.key]=M._callbacks[T.key]||[],N(T.key,T.modifiers,{type:T.action},H,V,st),M._callbacks[T.key][H?"unshift":"push"]({callback:tt,modifiers:T.modifiers,action:T.action,seq:H,level:st,combo:V})}M._bindMultiple=function(V,tt,it){for(var H=0;H<V.length;++H)ct(V[H],tt,it)},h(v,"keypress",rt),h(v,"keydown",rt),h(v,"keyup",rt)}S.prototype.bind=function(v,M,k){var I=this;return v=v instanceof Array?v:[v],I._bindMultiple.call(I,v,M,k),I},S.prototype.unbind=function(v,M){var k=this;return k.bind.call(k,v,function(){},M)},S.prototype.trigger=function(v,M){var k=this;return k._directMap[v+":"+M]&&k._directMap[v+":"+M]({},v),k},S.prototype.reset=function(){var v=this;return v._callbacks={},v._directMap={},v},S.prototype.stopCallback=function(v,M){var k=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||E(M,k.target))return!1;if("composedPath"in v&&typeof v.composedPath=="function"){var I=v.composedPath()[0];I!==v.target&&(M=I)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},S.prototype.handleKey=function(){var v=this;return v._handleKey.apply(v,arguments)},S.addKeycodes=function(v){for(var M in v)v.hasOwnProperty(M)&&(s[M]=v[M]);l=null},S.init=function(){var v=S(e);for(var M in v)M.charAt(0)!=="_"&&(S[M]=function(k){return function(){return v[k].apply(v,arguments)}}(M))},S.init(),t.Mousetrap=S,i.exports&&(i.exports=S)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(rd);var GA=rd.exports;const YA=jA(GA);function ad(i,t,e){const n=i.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left");return t?F(t,e,n):n}function ld(i){var t;const e=i.target,n=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase();let s=["input","textarea"].includes(n);return W(e,"contenteditable")==="true"&&(s=!0),s}function HA(i,t,e){const n=i.target,s=i.currentTarget;return n?n===t||s===t||n===document.body?!0:To(e,n):!1}function _A(i){const t=new YA(i.target),e=t.stopCallback;return t.stopCallback=(n,s,o)=>i.isEnabledForEvent(n)?e?e.call(t,n,s,o):!1:!0,t}class cd extends vn{get graph(){return this.options.graph}constructor(t){super(),this.options=t;const e=this.graph.getPlugin("scroller");this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus.bind(this),this),this.graph.on("blank:mouseup",this.focus.bind(this),this)),this.mousetrap=_A(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}clear(){this.mousetrap.reset()}trigger(t,e){this.mousetrap.trigger(ad(t,this.options.format,this.graph),e)}focus(t){if(ld(t.e))return;this.target.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(e=>ad(e,this.options.format,this.graph))}isEnabledForEvent(t){const e=!this.disabled&&HA(t,this.target,this.container),n=ld(t);if(e){if(n&&(t.key==="Backspace"||t.key==="Delete"))return!1;if(this.options.guard)return F(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}$([Z()],cd.prototype,"dispose",null),B.prototype.isKeyboardEnabled=function(){const i=this.getPlugin("keyboard");return i?i.isEnabled():!1},B.prototype.enableKeyboard=function(){const i=this.getPlugin("keyboard");return i&&i.enable(),this},B.prototype.disableKeyboard=function(){const i=this.getPlugin("keyboard");return i&&i.disable(),this},B.prototype.toggleKeyboard=function(i){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(i),this},B.prototype.bindKey=function(i,t,e){const n=this.getPlugin("keyboard");return n&&n.bindKey(i,t,e),this},B.prototype.unbindKey=function(i,t){const e=this.getPlugin("keyboard");return e&&e.unbindKey(i,t),this},B.prototype.clearKeys=function(){const i=this.getPlugin("keyboard");return i&&i.clear(),this},B.prototype.triggerKey=function(i,t){const e=this.getPlugin("keyboard");return e&&e.trigger(i,t),this};class hd extends vn{constructor(t={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},t)}init(t){this.keyboardImpl=new cd(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}bindKey(t,e,n){return this.keyboardImpl.on(t,e,n),this}trigger(t,e){return this.keyboardImpl.trigger(t,e),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(t,e){return this.keyboardImpl.off(t,e),this}dispose(){this.keyboardImpl.dispose()}}$([Z()],hd.prototype,"dispose",null);class ud extends Gt{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(he.box)}get $boxes(){return Dy(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(t){super(),this.updateThrottleTimer=null,this.isDragging=!1,this.batchUpdating=!1,this.dragRafId=null,this.transformRafId=null,this.dragPendingOffset=null,this.containerOffsetX=0,this.containerOffsetY=0,this.translatingCache=null,this.options=t,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new mr([],{comparator:WA}),this.options.collection=this.collection),this.boxCount=0,this.boxesUpdated=!1,this.createContainer(),this.startListening()}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`mousedown .${this.prefixClassName(he.inner)}`]:"onSelectionContainerMouseDown",[`touchstart .${this.prefixClassName(he.inner)}`]:"onSelectionContainerMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),this.transformRafId!=null&&(cancelAnimationFrame(this.transformRafId),this.transformRafId=null),this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),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)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),this.transformRafId==null&&(this.transformRafId=window.requestAnimationFrame(()=>{this.transformRafId=null,!this.isDragging&&this.collection.length>0&&this.refreshSelectionBoxes()}))}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:s}=this.options,{ui:o,selection:r,translateBy:a,snapped:l}=e,c=(n!==!0||s&&this.getPointerEventsValue(s)==="none")&&!this.translating&&!r,h=o&&a&&t.id===a;if(c&&(h||l)){this.translating=!0;const u=t.position(),g=t.previous("position");if(g){const f=u.x-g.x,p=u.y-g.y;(f!==0||p!==0)&&this.translateSelectedNodes(f,p,t,e)}this.translating=!1}}onModelUpdated({removed:t}){t!=null&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){this.batchUpdating=!!e.batch;const n=this.cells,s=this.filter(Array.isArray(t)?t:[t]),o={},r={};for(const c of n)o[c.id]=c;for(const c of s)r[c.id]=c;const a=[],l=[];return s.forEach(c=>{o[c.id]||a.push(c)}),n.forEach(c=>{r[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),this.updateContainer(),this.batchUpdating=!1,this}return this.clean(e)}clean(t={}){return this.length&&this.unselect(this.cells,t),this.containerOffsetX=0,this.containerOffsetY=0,nt(this.container,"transform",""),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){t=this.normalizeEvent(t),this.clean();let e,n;const s=this.graph.container;if(t.offsetX!=null&&t.offsetY!=null&&s.contains(t.target))e=t.offsetX,n=t.offsetY;else{const o=xn(s),r=s.scrollLeft,a=s.scrollTop;e=t.clientX-o.left+window.pageXOffset+r,n=t.clientY-o.top+window.pageYOffset+a}nt(this.container,{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,moving:!1}),this.delegateDocumentEvents(dd,t.data)}filter(t){const e=this.options.filter;return t.filter(n=>Array.isArray(e)?e.some(s=>typeof s=="string"?n.shape===s:n.id===s.id):typeof e=="function"?F(e,this.graph,n):!0)}stopSelecting(t){this.isDragging=!1,this.boxesUpdated=!1,this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null);const e=this.graph;switch(this.getEventData(t).action){case"selecting":{let o=D6(this.container),r=L6(this.container);const a=xn(this.container),l=e.pageToLocal(a.left,a.top),c=e.transform.getScale();o/=c.sx,r/=c.sy;const h=new P(l.x,l.y,o,r),u=this.getCellViewsInArea(h).map(g=>g.cell);this.reset(u,{batch:!0}),this.hideRubberband();break}case"translating":{const o=e.snapToGrid(t.clientX,t.clientY);if(this.dragPendingOffset){const r=this.dragPendingOffset;this.dragPendingOffset=null,this.translateSelectedNodes(r.dx,r.dy),this.updateContainerPosition(r)}this.dragRafId!=null&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=null),this.containerOffsetX=0,this.containerOffsetY=0,nt(this.container,"transform",""),this.graph.model.stopBatch("move-selection"),this.translatingCache=null,this.notifyBoxEvent("box:mouseup",t,o.x,o.y),this.repositionSelectionBoxesInPlace();break}default:{this.clean();break}}this.undelegateDocumentEvents()}onMouseUp(t){const e=this.normalizeEvent(t);this.getEventData(e)&&this.stopSelecting(t)}onSelectionBoxMouseDown(t){this.handleSelectionMouseDown(t,!0)}onSelectionContainerMouseDown(t){this.handleSelectionMouseDown(t,!1)}handleSelectionMouseDown(t,e){var n;t.stopPropagation(),(n=t.preventDefault)===null||n===void 0||n.call(t);const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY);if(!e&&Ne(s,this.options.multipleSelectionModifiers)){const l=this.graph.findViewsFromPoint(o.x,o.y).find(c=>c.isNodeView());if(l){const c=l.cell;this.isSelected(c)?this.unselect(c,{ui:!0}):this.options.multiple===!1?this.reset(c,{ui:!0}):this.select(c,{ui:!0})}return}this.options.movable&&this.startTranslating(s);let r=e?this.getCellViewFromElem(s.target):null;if(!r&&(r=this.graph.findViewsFromPoint(o.x,o.y).filter(l=>this.isSelected(l.cell))[0]||null,!r)){const l=this.collection.first();l&&(r=this.graph.renderer.findViewByCell(l))}r&&(this.setEventData(s,{activeView:r}),e&&this.notifyBoxEvent("box:mousedown",s,o.x,o.y),this.delegateDocumentEvents(dd,s.data))}startTranslating(t){this.graph.model.startBatch("move-selection");const 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}),this.prepareTranslatingCache()}getRestrictArea(){const t=this.graph.options.translating.restrict,e=typeof t=="function"?F(t,this.graph,null):t;return typeof e=="number"?this.graph.transform.getGraphArea().inflate(e):e===!0?this.graph.transform.getGraphArea():e||null}prepareTranslatingCache(){const t=this.collection.toArray().filter(r=>r.isNode()),e=new Set(t.map(r=>r.id)),n=this.collection.toArray().filter(r=>r.isEdge()),s=new Set,o=r=>r.getVertices().length>0||!r.getSourceCellId()||!r.getTargetCellId();this.graph.model.getEdges().forEach(r=>{const a=r.getSourceCellId(),l=r.getTargetCellId();(a!=null&&e.has(a)||l!=null&&e.has(l))&&o(r)&&s.add(r)}),n.forEach(r=>{o(r)&&s.add(r)}),this.translatingCache={selectedNodes:t,nodeIdSet:e,edgesToTranslate:Array.from(s)}}getSelectionOffset(t,e){let n=t.x-e.clientX,s=t.y-e.clientY;const o=this.getRestrictArea();if(o){const r=this.collection.toArray(),a=q.getCellsBBox(r,{deep:!0})||P.create(),l=o.x-a.x,c=o.y-a.y,h=o.x+o.width-(a.x+a.width),u=o.y+o.height-(a.y+a.height);if(n<l&&(n=l),s<c&&(s=c),h<n&&(n=h),u<s&&(s=u),!this.options.following){const g=t.x-e.originX,f=t.y-e.originY;n=g<=l||g>=h?0:n,s=f<=c||f>=u?0:s}}return{dx:n,dy:s}}updateSelectedNodesPosition(t){t.dx===0&&t.dy===0||(this.dragPendingOffset?(this.dragPendingOffset.dx+=t.dx,this.dragPendingOffset.dy+=t.dy):this.dragPendingOffset={dx:t.dx,dy:t.dy},this.dragRafId==null&&(this.dragRafId=requestAnimationFrame(()=>{const e=this.dragPendingOffset||{dx:0,dy:0};this.dragPendingOffset=null,this.dragRafId=null,this.translateSelectedNodes(e.dx,e.dy),this.updateContainerPosition(e),this.boxesUpdated=!0,this.isDragging=!0})))}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");return n!=null&&n.autoScroll?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e);switch(n.action){case"selecting":{const o=n;o.moving!==!0&&(Xt(this.container,this.graph.container),this.showRubberband(),o.moving=!0);const{scrollerX:r,scrollerY:a}=this.autoScrollGraph(e.clientX,e.clientY);o.scrollerX+=r,o.scrollerY+=a;const l=e.clientX-o.clientX+o.scrollerX,c=e.clientY-o.clientY+o.scrollerY;nt(this.container,{left:l<0?o.offsetX+l:o.offsetX,top:c<0?o.offsetY+c:o.offsetY,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{this.isDragging=!0;const o=this.graph.snapToGrid(e.clientX,e.clientY),r=n,a=this.getSelectionOffset(o,r);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(r.clientX=o.x),a.dy&&(r.clientY=o.y),this.notifyBoxEvent("box:mousemove",t,o.x,o.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,s){var o,r;const a={},l=[];if(n&&(a[n.id]=!0),this.collection.toArray().forEach(m=>{m.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0})}),s!=null&&s.translateBy){const m=this.graph.getCellById(s.translateBy);m&&(a[m.id]=!0,m.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0}),l.push(m))}const c=Object.assign(Object.assign({},s),{selection:this.cid,exclude:l}),h=(o=this.translatingCache)===null||o===void 0?void 0:o.selectedNodes,u=(h??this.collection.toArray().filter(m=>m.isNode())).filter(m=>!a[m.id]);u.forEach(m=>{m.translate(t,e,c)});const g=(r=this.translatingCache)===null||r===void 0?void 0:r.edgesToTranslate,f=new Set;if(g)g.forEach(m=>{f.add(m)});else{const m=new Set(u.map(b=>b.id));this.graph.model.getEdges().forEach(b=>{const y=b.getSourceCellId(),C=b.getTargetCellId(),w=y?m.has(y):!1,x=C?m.has(C):!1;(w||x)&&(b.getVertices().length>0||(!y||!C))&&f.add(b)})}this.collection.toArray().filter(m=>m.isEdge()&&!a[m.id]).forEach(m=>{const b=m.getVertices().length>0,y=!m.getSourceCellId()||!m.getTargetCellId();(b||y)&&f.add(m)}),f.forEach(m=>{m.translate(t,e,c)})}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let s=[];return this.options.rubberNode&&(s=s.concat(e.model.getNodesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),this.options.rubberEdge&&(s=s.concat(e.model.getEdgesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),s}notifyBoxEvent(t,e,n,s){const r=this.getEventData(e).activeView;this.trigger(t,{e,view:r,x:n,y:s,cell:r.cell})}getSelectedClassName(t){return this.prefixClassName(`${t.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(qt(this.container.querySelector(`[data-cell-id="${t.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(e=>{this.removeCellUnSelectedClassName(e)}),this.hide(),qt(this.$boxes),this.boxCount=0}hide(){lt(this.container,this.prefixClassName(he.rubberband)),lt(this.container,this.prefixClassName(he.selected))}showRubberband(){Q(this.container,this.prefixClassName(he.rubberband))}hideRubberband(){lt(this.container,this.prefixClassName(he.rubberband))}showSelected(){Po(this.container,"style"),Q(this.container,this.prefixClassName(he.selected))}createContainer(){this.container=document.createElement("div"),Q(this.container,this.prefixClassName(he.root)),this.options.className&&Q(this.container,this.options.className),nt(this.container,{willChange:"transform"}),this.selectionContainer=document.createElement("div"),Q(this.selectionContainer,this.prefixClassName(he.inner)),this.selectionContent=document.createElement("div"),Q(this.selectionContent,this.prefixClassName(he.content)),Ot(this.selectionContainer,this.selectionContent),W(this.selectionContainer,"data-selection-length",this.collection.length),ic(this.container,this.selectionContainer)}updateContainerPosition(t){if(t.dx||t.dy){const e=this.graph.transform.getScale();this.containerOffsetX+=t.dx*e.sx,this.containerOffsetY+=t.dy*e.sy,nt(this.container,"transform",`translate3d(${this.containerOffsetX}px, ${this.containerOffsetY}px, 0)`)}}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0};this.collection.toArray().filter(o=>this.canShowSelectionBox(o)).forEach(o=>{const r=this.graph.renderer.findViewByCell(o);if(r){const a=r.getBBox({useCellGeometry:!0});t.x=Math.min(t.x,a.x),t.y=Math.min(t.y,a.y),e.x=Math.max(e.x,a.x+a.width),e.y=Math.max(e.y,a.y+a.height)}}),nt(this.selectionContainer,{position:"absolute",pointerEvents:this.options.movable?"auto":"none",cursor:this.options.movable?"move":"default",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}),W(this.selectionContainer,"data-selection-length",this.collection.length);const s=this.options.content;if(s)if(typeof s=="function"){const o=F(s,this.graph,this,this.selectionContent);o&&(this.selectionContent.innerHTML=o)}else this.selectionContent.innerHTML=s;this.collection.length>0&&!this.container.parentNode?Xt(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&this.options.showNodeSelectionBox===!0||t.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(t){return typeof t=="string"?t:t(this.cells)}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:!0}),s=this.boxClassName,o=document.createElement("div"),r=this.options.pointerEvents;Q(o,s),Q(o,`${s}-${t.isNode()?"node":"edge"}`),W(o,"data-cell-id",t.id),nt(o,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:r?this.getPointerEventsValue(r):"auto"}),Xt(o,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){if(this.collection.length>0){if(this.isDragging)return;this.updateThrottleTimer&&clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=setTimeout(()=>{this.refreshSelectionBoxes(),this.updateThrottleTimer=null},16)}}refreshSelectionBoxes(){qt(this.$boxes),this.boxCount=0,this.collection.toArray().forEach(t=>{this.createSelectionBox(t)}),this.updateContainer(),this.boxesUpdated=!0}repositionSelectionBoxesInPlace(){const t=this.$boxes;if(t.length===0){this.refreshSelectionBoxes();return}for(const e of t){const n=e.getAttribute("data-cell-id");if(!n)continue;const s=this.collection.get(n);if(!s)continue;const o=this.graph.renderer.findViewByCell(s);if(!o)continue;const r=o.getBBox({useCellGeometry:!0});nt(e,{left:r.x,top:r.y,width:r.width,height:r.height})}this.updateContainer(),this.boxesUpdated=!0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const n=this.collection.get(e);if(n)return this.graph.renderer.findViewByCell(n)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.batchUpdating||this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(n=>{this.listenCellRemoveEvent(n),this.createSelectionBox(n)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.batchUpdating||this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach(o=>{this.trigger("cell:selected",{cell:o,options:n}),o.isNode()?this.trigger("node:selected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:selected",{cell:o,options:n,edge:o})}),e.forEach(o=>{this.trigger("cell:unselected",{cell:o,options:n}),o.isNode()?this.trigger("node:unselected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:unselected",{cell:o,options:n,edge:o})});const s={added:t,removed:e,options:n,selected:this.cells.filter(o=>!!this.graph.getCellById(o.id))};this.trigger("selection:changed",s)}dispose(){this.clean(),this.remove(),this.off()}}$([Z()],ud.prototype,"dispose",null);const Tn="widget-selection",he={root:Tn,inner:`${Tn}-inner`,box:`${Tn}-box`,content:`${Tn}-content`,rubberband:`${Tn}-rubberband`,selected:`${Tn}-selected`},dd={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function WA(i){return i.getAncestors().length}const qA=`.x6-widget-selection {
|
|
265
|
+
`,nd={getDragNode:i=>i.clone(),getDropNode:i=>i.clone()};class Or extends jt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(t){super(),this.name="dnd",this.options=Object.assign(Object.assign({},nd),t),this.init()}init(){Te(this.name,UA),this.container=document.createElement("div"),Q(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new B(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Nt(this.container,this.draggingGraph.container)}start(t,e){var n;const s=e;s.preventDefault(),this.targetModel.startBatch("dnd"),Q(this.container,"dragging"),qt(this.container,this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,s.clientX,s.clientY);const o=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:t,cell:t,view:this.draggingView,x:o.x,y:o.y}),(n=this.draggingNode)===null||n===void 0||n.on("change:position",this.snap,this)),this.delegateDocumentEvents(wu,s.data)}isSnaplineEnabled(){var t;return(t=this.snapline)===null||t===void 0?void 0:t.isEnabled()}prepareDragging(t,e,n){const s=this.draggingGraph,o=s.model,r=this.options.getDragNode(t,{sourceNode:t,draggingGraph:s,targetGraph:this.targetGraph});r.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const h=this.targetGraph.transform.getScale();s.scale(h.sx,h.sy),a*=Math.max(h.sx,h.sy)}else s.scale(1,1);this.clearDragging(),o.resetCells([r]);const l=s.findViewByCell(r);l.undelegateEvents(),l.cell.off("changed"),s.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const c=l.getBBox();this.geometryBBox=l.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(c.getTopLeft()),this.draggingNode=r,this.draggingView=l,this.draggingBBox=r.getBBox(),this.padding=a,this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=this.delta,s=this.geometryBBox,o=this.padding||5,r={left:t-n.x-s.width/2-o,top:e-n.y-s.height/2-o};this.draggingGraph&&FA(this.container,{clientX:r.left,clientY:r.top},{points:["tl"]})}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),s=this.draggingBBox;return s&&(n.x-=s.width/2,n.y-=s.height/2,this.draggingNode.position(n.x,n.y)),n}snap({cell:t,current:e,options:n}){const s=t;if(n.snapped){const o=this.draggingBBox;s.position(o.x+n.tx,o.y+n.ty,{silent:!0}),this.draggingView.translate(),s.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onMouseMove(t){this.onDragging(t)}onMouseUp(t){this.onDragEnd(t)}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),s=n.clientX,o=n.clientY;this.updateGraphPosition(s,o);const r=this.updateNodePosition(s,o),a=this.targetGraph.options.embedding.enabled,l=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:s,y:o});if(a){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const c=e.getEventData(n);l?e.processEmbedding(n,c):e.clearEmbedding(c),this.candidateEmbedView=c.candidateEmbedView}this.isSnaplineEnabled()&&(l?this.snapline.snapOnMoving({e:n,view:e,x:r.x,y:r.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),s=this.draggingView,o=this.draggingBBox,r=this.snapOffset;let a=o.x,l=o.y;r&&(a+=r.x,l+=r.y),e.position(a,l,{silent:!0});const c=this.drop(e,{x:n.clientX,y:n.clientY}),h=u=>{u?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&s&&(s.setEventData(n,{cell:u,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),s.finalizeEmbedding(n,s.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Ao(c)?(this.undelegateDocumentEvents(),c.then(h)):h(c)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),lt(this.container,"dragging"),Wt(this.container))}onDropInvalid(){const t=this.draggingNode;t&&this.onDropped(t)}isInsideValidArea(t){let e,n=null;const s=this.targetGraph,o=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const r=n==null?void 0:n.containsPoint(t);if(o)if(o.options.autoResize)e=this.getDropArea(o.container);else{const a=this.getDropArea(o.container);e=this.getDropArea(s.container).intersectsWithRect(a)}else e=this.getDropArea(s.container);return!r&&e&&e.containsPoint(t)}getDropArea(t){const e=xn(t),n=document.body.scrollTop||document.documentElement.scrollTop,s=document.body.scrollLeft||document.documentElement.scrollLeft;return P.create({x:e.left+parseInt(nt(t,"border-left-width"),10)-s,y:e.top+parseInt(nt(t,"border-top-width"),10)-n,width:t.clientWidth,height:t.clientHeight})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,s=n.model,o=n.clientToLocal(e),r=this.sourceNode,a=this.options.getDropNode(t,{sourceNode:r,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=a.getBBox();o.x+=l.x-l.width/2,o.y+=l.y-l.height/2;const c=this.snapOffset?1:n.getGridSize();a.position(re(o.x,c),re(o.y,c)),a.removeZIndex();const h=this.options.validateNode,u=h?h(a,{sourceNode:r,draggingNode:t,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph}):!0;return typeof u=="boolean"?u?(s.addCell(a,{stencil:this.cid}),a):null:wy(u).then(g=>g?(s.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Ie(this.name)}}X([$()],Or.prototype,"dispose",null),B.prototype.toSVG=function(i,t){const e=this.getPlugin("export");e&&e.toSVG(i,t)},B.prototype.toSVGAsync=function(i){return Gs(this,void 0,void 0,function*(){return new Promise(t=>{this.toSVG(t,i)})})},B.prototype.toPNG=function(i,t){const e=this.getPlugin("export");e&&e.toPNG(i,t)},B.prototype.toPNGAsync=function(i){return Gs(this,void 0,void 0,function*(){return new Promise(t=>{this.toPNG(t,i)})})},B.prototype.toJPEG=function(i,t){const e=this.getPlugin("export");e&&e.toJPEG(i,t)},B.prototype.toJPEGAsync=function(i){return Gs(this,void 0,void 0,function*(){return new Promise(t=>{this.toJPEG(t,i)})})},B.prototype.exportPNG=function(i,t){const e=this.getPlugin("export");e&&e.exportPNG(i,t)},B.prototype.exportJPEG=function(i,t){const e=this.getPlugin("export");e&&e.exportJPEG(i,t)},B.prototype.exportSVG=function(i,t){const e=this.getPlugin("export");e&&e.exportSVG(i,t)};class KA extends Ft{constructor(){super(...arguments),this.name="export"}get view(){return this.graph.view}init(t){this.graph=t}exportPNG(t="chart",e={}){this.toPNG(n=>{Co(n,t)},e)}exportJPEG(t="chart",e={}){this.toJPEG(n=>{Co(n,t)},e)}exportSVG(t="chart",e={}){this.toSVG(n=>{Co(by(n),t)},e)}toSVG(t,e={}){this.notify("before:export",e),Object.hasOwn(e,"copyStyles")||(e.copyStyles=!0),Object.hasOwn(e,"serializeImages")||(e.serializeImages=!0);const n=this.view.svg,s=U.create(n).clone();let o=s.node;const r=s.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),l=e.preserveDimensions;if(l){const u=typeof l=="boolean"?a:l;s.attr({width:u.width,height:u.height})}if(s.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),r.removeAttribute("transform"),e.copyStyles){const u=n.ownerDocument,g=Array.from(n.querySelectorAll("*")),f=Array.from(o.querySelectorAll("*")),p=u.implementation.createHTMLDocument("x6-export-defaults"),m=p.importNode(n,!0);p.body.appendChild(m);const b=Array.from(m.querySelectorAll("*")),y={};b.forEach((C,x)=>{const E=window.getComputedStyle(C,null),S={};for(let v=0;v<E.length;v+=1){const M=E[v],k=E.getPropertyValue(M);S[M]=k}y[x]=S});const w={};g.forEach((C,x)=>{const E=window.getComputedStyle(C,null),S=y[x]||{},v={};for(let M=0;M<E.length;M+=1){const k=E[M],I=E.getPropertyValue(k);I!==S[k]&&(v[k]=I)}w[x]=v}),f.forEach((C,x)=>{nt(C,w[x])})}const c=e.stylesheet;if(typeof c=="string"){const u=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(c);s.prepend(U.create("style",{type:"text/css"},[u]))}const h=()=>{const u=e.beforeSerialize;if(typeof u=="function"){const f=F(u,this.graph,o);f instanceof SVGSVGElement&&(o=f)}const g=new XMLSerializer().serializeToString(o).replace(/ /g," ");this.notify("after:export",e),t(g)};if(e.serializeImages){const u=s.find("image").map(g=>new Promise(f=>{const p=g.attr("xlink:href")||g.attr("href");fy(p,(m,b)=>{!m&&b&&(g.attr("xlink:href",b),g.attr("href",b)),f()})}));Promise.all(u).then(h)}else h()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const s=oe(e.padding);e.width&&e.height&&(s.left+s.right>=e.width&&(s.left=s.right=0),s.top+s.bottom>=e.height&&(s.top=s.bottom=0));const o=new P(-s.left,-s.top,s.left+s.right,s.top+s.bottom);if(e.width&&e.height){const h=n.width+s.left+s.right,u=n.height+s.top+s.bottom;o.scale(h/e.width,u/e.height)}n=P.create(n).moveAndExpand(o);const r=typeof e.width=="number"&&typeof e.height=="number"?{width:e.width,height:e.height}:n;let a=e.ratio?e.ratio:1;(!Number.isFinite(a)||a===0)&&(a=1);const l={width:Math.max(Math.round(r.width*a),1),height:Math.max(Math.round(r.height*a),1)};{const h=document.createElement("canvas"),u=h.getContext("2d");h.width=l.width,h.height=l.height;const g=l.width-1,f=l.height-1;u.fillStyle="rgb(1,1,1)",u.fillRect(g,f,1,1);const p=u.getImageData(g,f,1,1).data;if(p[0]!==1||p[1]!==1||p[2]!==1)throw new Error("size exceeded")}const c=new Image;c.onload=()=>{const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const u=h.getContext("2d");u.fillStyle=e.backgroundColor||"white",u.fillRect(0,0,l.width,l.height);try{u.drawImage(c,0,0,l.width,l.height);const g=h.toDataURL(e.type,e.quality);t(g)}catch{}},this.toSVG(h=>{c.src=`data:image/svg+xml,${encodeURIComponent(h)}`},Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.off()}}X([$()],KA.prototype,"dispose",null);function Fe(i){return i==="cell:added"}function $e(i){return i==="cell:removed"}function Pi(i){return i!=null&&i.startsWith("cell:change:")}function JA(i){const t=["cell:added","cell:removed","cell:change:*"],e=["batch:start","batch:stop"],n=i.eventNames?i.eventNames.filter(s=>!(Pi(s)||t.includes(s)||e.includes(s))):t;return Object.assign(Object.assign({enabled:!0},i),{eventNames:n,applyOptionsList:i.applyOptionsList||["propertyPath"],revertOptionsList:i.revertOptionsList||["propertyPath"]})}function id(i){const t=[];for(let e=0,n=i.length;e<n;e+=1){const s=i[e];let o=null;if(Fe(s.event)){const r=s.data.id;for(let a=0;a<e;a+=1)if(i[a].data.id===r){o=a;break}}o!==null?t.splice(o,0,s):t.push(s)}return t}class sd extends Ft{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=t.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every(e=>this.isValidCommand(e)):this.isValidCommand(t)}isValidCommand(t){if(t.options&&t.options.validation===!1)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach(s=>{let o=0;const r=a=>{const l=s[o];o+=1;try{l?l(a,t,r):n=a}catch(c){r(c)}};r(n)}),n?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1):!0}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach(s=>{if(typeof s!="function")throw new Error(`${n.join(" ")} requires callback functions.`)}),n.forEach(s=>{this.map[s]==null&&(this.map[s]=[]),this.map[s].push(e)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}X([$()],sd.prototype,"dispose",null),B.prototype.isHistoryEnabled=function(){const i=this.getPlugin("history");return i?i.isEnabled():!1},B.prototype.enableHistory=function(){const i=this.getPlugin("history");return i&&i.enable(),this},B.prototype.disableHistory=function(){const i=this.getPlugin("history");return i&&i.disable(),this},B.prototype.toggleHistory=function(i){const t=this.getPlugin("history");return t&&t.toggleEnabled(i),this},B.prototype.undo=function(i){const t=this.getPlugin("history");return t&&t.undo(i),this},B.prototype.redo=function(i){const t=this.getPlugin("history");return t&&t.redo(i),this},B.prototype.undoAndCancel=function(i){const t=this.getPlugin("history");return t&&t.cancel(i),this},B.prototype.canUndo=function(){const i=this.getPlugin("history");return i?i.canUndo():!1},B.prototype.canRedo=function(){const i=this.getPlugin("history");return i?i.canRedo():!1},B.prototype.cleanHistory=function(i){const t=this.getPlugin("history");return t&&t.clean(i),this},B.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},B.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},B.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},B.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};class od extends Ft{constructor(t={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:e=0}=t;this.stackSize=e,this.options=JA(t),this.validator=new sd({history:this,cancelInvalid:this.options.cancelInvalid})}init(t){this.graph=t,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStackPush(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const t=this.undoStack.length;return this.stackSize-t}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}get disabled(){return this.options.enabled!==!0}validate(t,...e){return this.validator.validate(t,...e),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:t?t.batch:!1,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?id(t):[t];for(let s=n.length-1;s>=0;s-=1){const o=n[s],r=Object.assign(Object.assign({},e),Il(o.options,this.options.revertOptionsList||[]));this.executeCommand(o,!0,r)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?id(t):[t];for(let s=0;s<n.length;s+=1){const o=n[s],r=Object.assign(Object.assign({},e),Il(o.options,this.options.applyOptionsList||[]));this.executeCommand(o,!1,r)}this.freezed=!1}executeCommand(t,e,n){const s=this.model,o=s.getCell(t.data.id),r=t.event;if(Fe(r)&&e||$e(r)&&!e)o&&o.remove(n);else if(Fe(r)&&!e||$e(r)&&e){const a=t.data;a.node?s.addNode(a.props,n):a.edge&&s.addEdge(a.props,n)}else if(Pi(r)){const a=t.data,l=a.key;if(l&&o){const c=e?a.prev[l]:a.next[l];a.key==="attrs"&&this.ensureUndefinedAttrs(c,e?a.next[l]:a.prev[l])&&(n.dirty=!0),o.prop(l,c,n)}}else{const a=this.options.executeCommand;a&&F(a,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,s=n.options||{};if(s.dryrun||Fe(t)&&this.options.ignoreAdd||$e(t)&&this.options.ignoreRemove||Pi(t)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(o!=null&&F(o,this,t,e)===!1)return;t==="cell:change:*"&&(t=`cell:change:${n.key}`);const r=n.cell,a=Yt.isModel(r);let l;if(this.batchCommands){l=this.batchCommands[Math.max(this.lastBatchIndex,0)];const h=a&&!l.modelChange||l.data.id!==r.id,u=l.event!==t;if(this.lastBatchIndex>=0&&(h||u)){const g=this.batchCommands.findIndex(f=>(a&&f.modelChange||f.data.id===r.id)&&f.event===t);g<0||Fe(t)||$e(t)?l=this.createCommand({batch:!0}):(l=this.batchCommands[g],this.batchCommands.splice(g,1)),this.batchCommands.push(l),this.lastBatchIndex=this.batchCommands.length-1}}else l=this.createCommand({batch:!1});if(Fe(t)||$e(t)){const h=l.data;return l.event=t,l.options=s,h.id=r.id,h.props=dt(r.toJSON()),r.isEdge()?h.edge=!0:r.isNode()&&(h.node=!0),this.push(l,s)}if(Pi(t)){const h=e.key,u=l.data;return(!l.batch||!l.event)&&(l.event=t,l.options=s,u.key=h,u.prev==null&&(u.prev={}),u.prev[h]=dt(r.previous(h)),a?l.modelChange=!0:u.id=r.id),u.next==null&&(u.next={}),u.next[h]=dt(r.prop(h)),this.push(l,s)}const c=this.options.afterAddCommand;c&&F(c,this,t,e,l),this.push(l,s)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];for(;e.length>0;){const s=e.shift(),o=s.event,r=s.data.id;if(o!=null&&(r!=null||s.modelChange)){if(Fe(o)){const a=e.findIndex(l=>$e(l.event)&&l.data.id===r);if(a>=0){e=e.filter((l,c)=>a<c||l.data.id!==r);continue}}else if($e(o)){const a=e.findIndex(l=>Fe(l.event)&&l.data.id===r);if(a>=0){e.splice(a,1);continue}}else if(Pi(o)){const a=s.data;if(Ce(a.prev,a.next))continue}n.push(s)}}return n}notify(t,e,n){const s=e==null?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:s,options:n}),this.graph.trigger(`history:${t}`,{cmds:s,options:n}),this.emit("change",{cmds:s,options:n}),this.graph.trigger("history:change",{cmds:s,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const s=new Set(e.map(r=>r.event));if(s.size!==2||!s.has("cell:change:parent")||!s.has("cell:change:children")||!e.every(r=>{var a;return r.batch&&((a=r.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(n)||n.length!==1)return;const o=n[0];o.event!=="cell:change:position"||!(!((t=o.options)===null||t===void 0)&&t.ui)||(n.push(...e),this.undoStack.pop())}undoStackPush(t){if(this.stackSize===0){this.undoStack.push(t);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(t)}ensureUndefinedAttrs(t,e){let n=!1;return t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(s=>{t[s]===void 0&&e[s]!==void 0?(t[s]=void 0,n=!0):typeof t[s]=="object"&&typeof e[s]=="object"&&(n=this.ensureUndefinedAttrs(t[s],e[s]))}),n}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}X([$()],od.prototype,"dispose",null);function jA(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var rd={exports:{}};(function(i){(function(t,e,n){if(!t)return;for(var s={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"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,c=1;c<20;++c)s[111+c]="f"+c;for(c=0;c<=9;++c)s[c+96]=c.toString();function h(v,M,k){if(v.addEventListener){v.addEventListener(M,k,!1);return}v.attachEvent("on"+M,k)}function u(v){if(v.type=="keypress"){var M=String.fromCharCode(v.which);return v.shiftKey||(M=M.toLowerCase()),M}return s[v.which]?s[v.which]:o[v.which]?o[v.which]:String.fromCharCode(v.which).toLowerCase()}function g(v,M){return v.sort().join(",")===M.sort().join(",")}function f(v){var M=[];return v.shiftKey&&M.push("shift"),v.altKey&&M.push("alt"),v.ctrlKey&&M.push("ctrl"),v.metaKey&&M.push("meta"),M}function p(v){if(v.preventDefault){v.preventDefault();return}v.returnValue=!1}function m(v){if(v.stopPropagation){v.stopPropagation();return}v.cancelBubble=!0}function b(v){return v=="shift"||v=="ctrl"||v=="alt"||v=="meta"}function y(){if(!l){l={};for(var v in s)v>95&&v<112||s.hasOwnProperty(v)&&(l[s[v]]=v)}return l}function w(v,M,k){return k||(k=y()[v]?"keydown":"keypress"),k=="keypress"&&M.length&&(k="keydown"),k}function C(v){return v==="+"?["+"]:(v=v.replace(/\+{2}/g,"+plus"),v.split("+"))}function x(v,M){var k,I,O,R=[];for(k=C(v),O=0;O<k.length;++O)I=k[O],a[I]&&(I=a[I]),M&&M!="keypress"&&r[I]&&(I=r[I],R.push("shift")),b(I)&&R.push(I);return M=w(I,R,M),{key:I,modifiers:R,action:M}}function E(v,M){return v===null||v===e?!1:v===M?!0:E(v.parentNode,M)}function S(v){var M=this;if(v=v||e,!(M instanceof S))return new S(v);M.target=v,M._callbacks={},M._directMap={};var k={},I,O=!1,R=!1,K=!1;function D(V){V=V||{};var tt=!1,it;for(it in k){if(V[it]){tt=!0;continue}k[it]=0}tt||(K=!1)}function N(V,tt,it,H,st,mt){var T,L,_=[],Z=it.type;if(!M._callbacks[V])return[];for(Z=="keyup"&&b(V)&&(tt=[V]),T=0;T<M._callbacks[V].length;++T)if(L=M._callbacks[V][T],!(!H&&L.seq&&k[L.seq]!=L.level)&&Z==L.action&&(Z=="keypress"&&!it.metaKey&&!it.ctrlKey||g(tt,L.modifiers))){var Et=!H&&L.combo==st,he=H&&L.seq==H&&L.level==mt;(Et||he)&&M._callbacks[V].splice(T,1),_.push(L)}return _}function j(V,tt,it,H){M.stopCallback(tt,tt.target||tt.srcElement,it,H)||V(tt,it)===!1&&(p(tt),m(tt))}M._handleKey=function(V,tt,it){var H=N(V,tt,it),st,mt={},T=0,L=!1;for(st=0;st<H.length;++st)H[st].seq&&(T=Math.max(T,H[st].level));for(st=0;st<H.length;++st){if(H[st].seq){if(H[st].level!=T)continue;L=!0,mt[H[st].seq]=1,j(H[st].callback,it,H[st].combo,H[st].seq);continue}L||j(H[st].callback,it,H[st].combo)}var _=it.type=="keypress"&&R;it.type==K&&!b(V)&&!_&&D(mt),R=L&&it.type=="keydown"};function rt(V){typeof V.which!="number"&&(V.which=V.keyCode);var tt=u(V);if(tt){if(V.type=="keyup"&&O===tt){O=!1;return}M.handleKey(tt,f(V),V)}}function Ct(){clearTimeout(I),I=setTimeout(D,1e3)}function pt(V,tt,it,H){k[V]=0;function st(Z){return function(){K=Z,++k[V],Ct()}}function mt(Z){j(it,Z,V),H!=="keyup"&&(O=u(Z)),setTimeout(D,10)}for(var T=0;T<tt.length;++T){var L=T+1===tt.length,_=L?mt:st(H||x(tt[T+1]).action);ct(tt[T],_,H,V,T)}}function ct(V,tt,it,H,st){M._directMap[V+":"+it]=tt,V=V.replace(/\s+/g," ");var mt=V.split(" "),T;if(mt.length>1){pt(V,mt,tt,it);return}T=x(V,it),M._callbacks[T.key]=M._callbacks[T.key]||[],N(T.key,T.modifiers,{type:T.action},H,V,st),M._callbacks[T.key][H?"unshift":"push"]({callback:tt,modifiers:T.modifiers,action:T.action,seq:H,level:st,combo:V})}M._bindMultiple=function(V,tt,it){for(var H=0;H<V.length;++H)ct(V[H],tt,it)},h(v,"keypress",rt),h(v,"keydown",rt),h(v,"keyup",rt)}S.prototype.bind=function(v,M,k){var I=this;return v=v instanceof Array?v:[v],I._bindMultiple.call(I,v,M,k),I},S.prototype.unbind=function(v,M){var k=this;return k.bind.call(k,v,function(){},M)},S.prototype.trigger=function(v,M){var k=this;return k._directMap[v+":"+M]&&k._directMap[v+":"+M]({},v),k},S.prototype.reset=function(){var v=this;return v._callbacks={},v._directMap={},v},S.prototype.stopCallback=function(v,M){var k=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||E(M,k.target))return!1;if("composedPath"in v&&typeof v.composedPath=="function"){var I=v.composedPath()[0];I!==v.target&&(M=I)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},S.prototype.handleKey=function(){var v=this;return v._handleKey.apply(v,arguments)},S.addKeycodes=function(v){for(var M in v)v.hasOwnProperty(M)&&(s[M]=v[M]);l=null},S.init=function(){var v=S(e);for(var M in v)M.charAt(0)!=="_"&&(S[M]=function(k){return function(){return v[k].apply(v,arguments)}}(M))},S.init(),t.Mousetrap=S,i.exports&&(i.exports=S)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(rd);var GA=rd.exports;const YA=jA(GA);function ad(i,t,e){const n=i.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left");return t?F(t,e,n):n}function ld(i){var t;const e=i.target,n=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase();let s=["input","textarea"].includes(n);return W(e,"contenteditable")==="true"&&(s=!0),s}function HA(i,t,e){const n=i.target,s=i.currentTarget;return n?n===t||s===t||n===document.body?!0:To(e,n):!1}function _A(i){const t=new YA(i.target),e=t.stopCallback;return t.stopCallback=(n,s,o)=>i.isEnabledForEvent(n)?e?e.call(t,n,s,o):!1:!0,t}class cd extends vn{get graph(){return this.options.graph}constructor(t){super(),this.options=t;const e=this.graph.getPlugin("scroller");this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus.bind(this),this),this.graph.on("blank:mouseup",this.focus.bind(this),this)),this.mousetrap=_A(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}clear(){this.mousetrap.reset()}trigger(t,e){this.mousetrap.trigger(ad(t,this.options.format,this.graph),e)}focus(t){if(ld(t.e))return;this.target.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(e=>ad(e,this.options.format,this.graph))}isEnabledForEvent(t){const e=!this.disabled&&HA(t,this.target,this.container),n=ld(t);if(e){if(n&&(t.key==="Backspace"||t.key==="Delete"))return!1;if(this.options.guard)return F(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}X([$()],cd.prototype,"dispose",null),B.prototype.isKeyboardEnabled=function(){const i=this.getPlugin("keyboard");return i?i.isEnabled():!1},B.prototype.enableKeyboard=function(){const i=this.getPlugin("keyboard");return i&&i.enable(),this},B.prototype.disableKeyboard=function(){const i=this.getPlugin("keyboard");return i&&i.disable(),this},B.prototype.toggleKeyboard=function(i){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(i),this},B.prototype.bindKey=function(i,t,e){const n=this.getPlugin("keyboard");return n&&n.bindKey(i,t,e),this},B.prototype.unbindKey=function(i,t){const e=this.getPlugin("keyboard");return e&&e.unbindKey(i,t),this},B.prototype.clearKeys=function(){const i=this.getPlugin("keyboard");return i&&i.clear(),this},B.prototype.triggerKey=function(i,t){const e=this.getPlugin("keyboard");return e&&e.trigger(i,t),this};class hd extends vn{constructor(t={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},t)}init(t){this.keyboardImpl=new cd(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}bindKey(t,e,n){return this.keyboardImpl.on(t,e,n),this}trigger(t,e){return this.keyboardImpl.trigger(t,e),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(t,e){return this.keyboardImpl.off(t,e),this}dispose(){this.keyboardImpl.dispose()}}X([$()],hd.prototype,"dispose",null);class ud extends jt{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(ce.box)}get $boxes(){return Dy(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(t){super(),this.updateThrottleTimer=null,this.isDragging=!1,this.batchUpdating=!1,this.dragRafId=null,this.transformRafId=null,this.dragPendingOffset=null,this.containerOffsetX=0,this.containerOffsetY=0,this.translatingCache=null,this.options=t,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new mr([],{comparator:WA}),this.options.collection=this.collection),this.boxCount=0,this.boxesUpdated=!1,this.createContainer(),this.startListening()}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`mousedown .${this.prefixClassName(ce.inner)}`]:"onSelectionContainerMouseDown",[`touchstart .${this.prefixClassName(ce.inner)}`]:"onSelectionContainerMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),this.transformRafId!=null&&(cancelAnimationFrame(this.transformRafId),this.transformRafId=null),this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),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)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),this.transformRafId==null&&(this.transformRafId=window.requestAnimationFrame(()=>{this.transformRafId=null,!this.isDragging&&this.collection.length>0&&this.refreshSelectionBoxes()}))}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:s}=this.options,{ui:o,selection:r,translateBy:a,snapped:l}=e,c=(n!==!0||s&&this.getPointerEventsValue(s)==="none")&&!this.translating&&!r,h=o&&a&&t.id===a;if(c&&(h||l)){this.translating=!0;const u=t.position(),g=t.previous("position");if(g){const f=u.x-g.x,p=u.y-g.y;(f!==0||p!==0)&&this.translateSelectedNodes(f,p,t,e)}this.translating=!1}}onModelUpdated({removed:t}){t!=null&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){this.batchUpdating=!!e.batch;const n=this.cells,s=this.filter(Array.isArray(t)?t:[t]),o={},r={};for(const c of n)o[c.id]=c;for(const c of s)r[c.id]=c;const a=[],l=[];return s.forEach(c=>{o[c.id]||a.push(c)}),n.forEach(c=>{r[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),this.updateContainer(),this.batchUpdating=!1,this}return this.clean(e)}clean(t={}){return this.length&&this.unselect(this.cells,t),this.containerOffsetX=0,this.containerOffsetY=0,nt(this.container,"transform",""),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){t=this.normalizeEvent(t),this.clean();let e,n;const s=this.graph.container;if(t.offsetX!=null&&t.offsetY!=null&&s.contains(t.target))e=t.offsetX,n=t.offsetY;else{const o=xn(s),r=s.scrollLeft,a=s.scrollTop;e=t.clientX-o.left+window.pageXOffset+r,n=t.clientY-o.top+window.pageYOffset+a}nt(this.container,{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,moving:!1}),this.delegateDocumentEvents(dd,t.data)}filter(t){const e=this.options.filter;return t.filter(n=>Array.isArray(e)?e.some(s=>typeof s=="string"?n.shape===s:n.id===s.id):typeof e=="function"?F(e,this.graph,n):!0)}stopSelecting(t){this.isDragging=!1,this.boxesUpdated=!1,this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null);const e=this.graph;switch(this.getEventData(t).action){case"selecting":{let o=D6(this.container),r=L6(this.container);const a=xn(this.container),l=e.pageToLocal(a.left,a.top),c=e.transform.getScale();o/=c.sx,r/=c.sy;const h=new P(l.x,l.y,o,r),u=this.getCellViewsInArea(h).map(g=>g.cell);this.reset(u,{batch:!0}),this.hideRubberband();break}case"translating":{const o=e.snapToGrid(t.clientX,t.clientY);if(this.dragPendingOffset){const r=this.dragPendingOffset;this.dragPendingOffset=null,this.translateSelectedNodes(r.dx,r.dy),this.updateContainerPosition(r)}this.dragRafId!=null&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=null),this.containerOffsetX=0,this.containerOffsetY=0,nt(this.container,"transform",""),this.graph.model.stopBatch("move-selection"),this.translatingCache=null,this.notifyBoxEvent("box:mouseup",t,o.x,o.y),this.repositionSelectionBoxesInPlace();break}default:{this.clean();break}}this.undelegateDocumentEvents()}onMouseUp(t){const e=this.normalizeEvent(t);this.getEventData(e)&&this.stopSelecting(t)}onSelectionBoxMouseDown(t){this.handleSelectionMouseDown(t,!0)}onSelectionContainerMouseDown(t){this.handleSelectionMouseDown(t,!1)}handleSelectionMouseDown(t,e){var n;t.stopPropagation(),(n=t.preventDefault)===null||n===void 0||n.call(t);const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY);if(!e&&Ne(s,this.options.multipleSelectionModifiers)){const l=this.graph.findViewsFromPoint(o.x,o.y).find(c=>c.isNodeView());if(l){const c=l.cell;this.isSelected(c)?this.unselect(c,{ui:!0}):this.options.multiple===!1?this.reset(c,{ui:!0}):this.select(c,{ui:!0})}return}this.options.movable&&this.startTranslating(s);let r=e?this.getCellViewFromElem(s.target):null;if(!r&&(r=this.graph.findViewsFromPoint(o.x,o.y).filter(l=>this.isSelected(l.cell))[0]||null,!r)){const l=this.collection.first();l&&(r=this.graph.renderer.findViewByCell(l))}r&&(this.setEventData(s,{activeView:r}),e&&this.notifyBoxEvent("box:mousedown",s,o.x,o.y),this.delegateDocumentEvents(dd,s.data))}startTranslating(t){this.graph.model.startBatch("move-selection");const 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}),this.prepareTranslatingCache()}getRestrictArea(){const t=this.graph.options.translating.restrict,e=typeof t=="function"?F(t,this.graph,null):t;return typeof e=="number"?this.graph.transform.getGraphArea().inflate(e):e===!0?this.graph.transform.getGraphArea():e||null}prepareTranslatingCache(){const t=this.collection.toArray().filter(r=>r.isNode()),e=new Set(t.map(r=>r.id)),n=this.collection.toArray().filter(r=>r.isEdge()),s=new Set,o=r=>r.getVertices().length>0||!r.getSourceCellId()||!r.getTargetCellId();this.graph.model.getEdges().forEach(r=>{const a=r.getSourceCellId(),l=r.getTargetCellId();(a!=null&&e.has(a)||l!=null&&e.has(l))&&o(r)&&s.add(r)}),n.forEach(r=>{o(r)&&s.add(r)}),this.translatingCache={selectedNodes:t,nodeIdSet:e,edgesToTranslate:Array.from(s)}}getSelectionOffset(t,e){let n=t.x-e.clientX,s=t.y-e.clientY;const o=this.getRestrictArea();if(o){const r=this.collection.toArray(),a=q.getCellsBBox(r,{deep:!0})||P.create(),l=o.x-a.x,c=o.y-a.y,h=o.x+o.width-(a.x+a.width),u=o.y+o.height-(a.y+a.height);if(n<l&&(n=l),s<c&&(s=c),h<n&&(n=h),u<s&&(s=u),!this.options.following){const g=t.x-e.originX,f=t.y-e.originY;n=g<=l||g>=h?0:n,s=f<=c||f>=u?0:s}}return{dx:n,dy:s}}updateSelectedNodesPosition(t){t.dx===0&&t.dy===0||(this.dragPendingOffset?(this.dragPendingOffset.dx+=t.dx,this.dragPendingOffset.dy+=t.dy):this.dragPendingOffset={dx:t.dx,dy:t.dy},this.dragRafId==null&&(this.dragRafId=requestAnimationFrame(()=>{const e=this.dragPendingOffset||{dx:0,dy:0};this.dragPendingOffset=null,this.dragRafId=null,this.translateSelectedNodes(e.dx,e.dy),this.updateContainerPosition(e),this.boxesUpdated=!0,this.isDragging=!0})))}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");return n!=null&&n.autoScroll?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e);switch(n.action){case"selecting":{const o=n;o.moving!==!0&&(qt(this.container,this.graph.container),this.showRubberband(),o.moving=!0);const{scrollerX:r,scrollerY:a}=this.autoScrollGraph(e.clientX,e.clientY);o.scrollerX+=r,o.scrollerY+=a;const l=e.clientX-o.clientX+o.scrollerX,c=e.clientY-o.clientY+o.scrollerY;nt(this.container,{left:l<0?o.offsetX+l:o.offsetX,top:c<0?o.offsetY+c:o.offsetY,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{this.isDragging=!0;const o=this.graph.snapToGrid(e.clientX,e.clientY),r=n,a=this.getSelectionOffset(o,r);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(r.clientX=o.x),a.dy&&(r.clientY=o.y),this.notifyBoxEvent("box:mousemove",t,o.x,o.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,s){var o,r;const a={},l=[];if(n&&(a[n.id]=!0),this.collection.toArray().forEach(m=>{m.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0})}),s!=null&&s.translateBy){const m=this.graph.getCellById(s.translateBy);m&&(a[m.id]=!0,m.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0}),l.push(m))}const c=Object.assign(Object.assign({},s),{selection:this.cid,exclude:l}),h=(o=this.translatingCache)===null||o===void 0?void 0:o.selectedNodes,u=(h??this.collection.toArray().filter(m=>m.isNode())).filter(m=>!a[m.id]);u.forEach(m=>{m.translate(t,e,c)});const g=(r=this.translatingCache)===null||r===void 0?void 0:r.edgesToTranslate,f=new Set;if(g)g.forEach(m=>{f.add(m)});else{const m=new Set(u.map(b=>b.id));this.graph.model.getEdges().forEach(b=>{const y=b.getSourceCellId(),w=b.getTargetCellId(),C=y?m.has(y):!1,x=w?m.has(w):!1;(C||x)&&(b.getVertices().length>0||(!y||!w))&&f.add(b)})}this.collection.toArray().filter(m=>m.isEdge()&&!a[m.id]).forEach(m=>{const b=m.getVertices().length>0,y=!m.getSourceCellId()||!m.getTargetCellId();(b||y)&&f.add(m)}),f.forEach(m=>{m.translate(t,e,c)})}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let s=[];return this.options.rubberNode&&(s=s.concat(e.model.getNodesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),this.options.rubberEdge&&(s=s.concat(e.model.getEdgesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),s}notifyBoxEvent(t,e,n,s){const r=this.getEventData(e).activeView;this.trigger(t,{e,view:r,x:n,y:s,cell:r.cell})}getSelectedClassName(t){return this.prefixClassName(`${t.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(Wt(this.container.querySelector(`[data-cell-id="${t.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(e=>{this.removeCellUnSelectedClassName(e)}),this.hide(),Wt(this.$boxes),this.boxCount=0}hide(){lt(this.container,this.prefixClassName(ce.rubberband)),lt(this.container,this.prefixClassName(ce.selected))}showRubberband(){Q(this.container,this.prefixClassName(ce.rubberband))}hideRubberband(){lt(this.container,this.prefixClassName(ce.rubberband))}showSelected(){Po(this.container,"style"),Q(this.container,this.prefixClassName(ce.selected))}createContainer(){this.container=document.createElement("div"),Q(this.container,this.prefixClassName(ce.root)),this.options.className&&Q(this.container,this.options.className),nt(this.container,{willChange:"transform"}),this.selectionContainer=document.createElement("div"),Q(this.selectionContainer,this.prefixClassName(ce.inner)),this.selectionContent=document.createElement("div"),Q(this.selectionContent,this.prefixClassName(ce.content)),Nt(this.selectionContainer,this.selectionContent),W(this.selectionContainer,"data-selection-length",this.collection.length),ic(this.container,this.selectionContainer)}updateContainerPosition(t){if(t.dx||t.dy){const e=this.graph.transform.getScale();this.containerOffsetX+=t.dx*e.sx,this.containerOffsetY+=t.dy*e.sy,nt(this.container,"transform",`translate3d(${this.containerOffsetX}px, ${this.containerOffsetY}px, 0)`)}}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0};this.collection.toArray().filter(o=>this.canShowSelectionBox(o)).forEach(o=>{const r=this.graph.renderer.findViewByCell(o);if(r){const a=r.getBBox({useCellGeometry:!0});t.x=Math.min(t.x,a.x),t.y=Math.min(t.y,a.y),e.x=Math.max(e.x,a.x+a.width),e.y=Math.max(e.y,a.y+a.height)}}),nt(this.selectionContainer,{position:"absolute",pointerEvents:this.options.movable?"auto":"none",cursor:this.options.movable?"move":"default",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}),W(this.selectionContainer,"data-selection-length",this.collection.length);const s=this.options.content;if(s)if(typeof s=="function"){const o=F(s,this.graph,this,this.selectionContent);o&&(this.selectionContent.innerHTML=o)}else this.selectionContent.innerHTML=s;this.collection.length>0&&!this.container.parentNode?qt(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&this.options.showNodeSelectionBox===!0||t.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(t){return typeof t=="string"?t:t(this.cells)}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:!0}),s=this.boxClassName,o=document.createElement("div"),r=this.options.pointerEvents;Q(o,s),Q(o,`${s}-${t.isNode()?"node":"edge"}`),W(o,"data-cell-id",t.id),nt(o,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:r?this.getPointerEventsValue(r):"auto"}),qt(o,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){if(this.collection.length>0){if(this.isDragging)return;this.updateThrottleTimer&&clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=setTimeout(()=>{this.refreshSelectionBoxes(),this.updateThrottleTimer=null},16)}}refreshSelectionBoxes(){Wt(this.$boxes),this.boxCount=0,this.collection.toArray().forEach(t=>{this.createSelectionBox(t)}),this.updateContainer(),this.boxesUpdated=!0}repositionSelectionBoxesInPlace(){const t=this.$boxes;if(t.length===0){this.refreshSelectionBoxes();return}for(const e of t){const n=e.getAttribute("data-cell-id");if(!n)continue;const s=this.collection.get(n);if(!s)continue;const o=this.graph.renderer.findViewByCell(s);if(!o)continue;const r=o.getBBox({useCellGeometry:!0});nt(e,{left:r.x,top:r.y,width:r.width,height:r.height})}this.updateContainer(),this.boxesUpdated=!0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const n=this.collection.get(e);if(n)return this.graph.renderer.findViewByCell(n)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.batchUpdating||this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(n=>{this.listenCellRemoveEvent(n),this.createSelectionBox(n)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.batchUpdating||this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach(o=>{this.trigger("cell:selected",{cell:o,options:n}),o.isNode()?this.trigger("node:selected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:selected",{cell:o,options:n,edge:o})}),e.forEach(o=>{this.trigger("cell:unselected",{cell:o,options:n}),o.isNode()?this.trigger("node:unselected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:unselected",{cell:o,options:n,edge:o})});const s={added:t,removed:e,options:n,selected:this.cells.filter(o=>!!this.graph.getCellById(o.id))};this.trigger("selection:changed",s)}dispose(){this.clean(),this.remove(),this.off()}}X([$()],ud.prototype,"dispose",null);const Tn="widget-selection",ce={root:Tn,inner:`${Tn}-inner`,box:`${Tn}-box`,content:`${Tn}-content`,rubberband:`${Tn}-rubberband`,selected:`${Tn}-selected`},dd={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function WA(i){return i.getAncestors().length}const qA=`.x6-widget-selection {
|
|
266
266
|
position: absolute;
|
|
267
267
|
top: 0;
|
|
268
268
|
left: 0;
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
font-size: 10px;
|
|
328
328
|
background-color: #6a6b8a;
|
|
329
329
|
}
|
|
330
|
-
`;B.prototype.isSelectionEnabled=function(){const i=this.getPlugin("selection");return i?i.isEnabled():!1},B.prototype.enableSelection=function(){const i=this.getPlugin("selection");return i&&i.enable(),this},B.prototype.disableSelection=function(){const i=this.getPlugin("selection");return i&&i.disable(),this},B.prototype.toggleSelection=function(i){const t=this.getPlugin("selection");return t&&t.toggleEnabled(i),this},B.prototype.isMultipleSelection=function(){const i=this.getPlugin("selection");return i?i.isMultipleSelection():!1},B.prototype.enableMultipleSelection=function(){const i=this.getPlugin("selection");return i&&i.enableMultipleSelection(),this},B.prototype.disableMultipleSelection=function(){const i=this.getPlugin("selection");return i&&i.disableMultipleSelection(),this},B.prototype.toggleMultipleSelection=function(i){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(i),this},B.prototype.isSelectionMovable=function(){const i=this.getPlugin("selection");return i?i.isSelectionMovable():!1},B.prototype.enableSelectionMovable=function(){const i=this.getPlugin("selection");return i&&i.enableSelectionMovable(),this},B.prototype.disableSelectionMovable=function(){const i=this.getPlugin("selection");return i&&i.disableSelectionMovable(),this},B.prototype.toggleSelectionMovable=function(i){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(i),this},B.prototype.isRubberbandEnabled=function(){const i=this.getPlugin("selection");return i?i.isRubberbandEnabled():!1},B.prototype.enableRubberband=function(){const i=this.getPlugin("selection");return i&&i.enableRubberband(),this},B.prototype.disableRubberband=function(){const i=this.getPlugin("selection");return i&&i.disableRubberband(),this},B.prototype.toggleRubberband=function(i){const t=this.getPlugin("selection");return t&&t.toggleRubberband(i),this},B.prototype.isStrictRubberband=function(){const i=this.getPlugin("selection");return i?i.isStrictRubberband():!1},B.prototype.enableStrictRubberband=function(){const i=this.getPlugin("selection");return i&&i.enableStrictRubberband(),this},B.prototype.disableStrictRubberband=function(){const i=this.getPlugin("selection");return i&&i.disableStrictRubberband(),this},B.prototype.toggleStrictRubberband=function(i){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(i),this},B.prototype.setRubberbandModifiers=function(i){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(i),this},B.prototype.setSelectionFilter=function(i){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(i),this},B.prototype.setSelectionDisplayContent=function(i){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(i),this},B.prototype.isSelectionEmpty=function(){const i=this.getPlugin("selection");return i?i.isEmpty():!0},B.prototype.cleanSelection=function(i){const t=this.getPlugin("selection");return t&&t.clean(i),this},B.prototype.resetSelection=function(i,t){const e=this.getPlugin("selection");return e&&e.reset(i,t),this},B.prototype.getSelectedCells=function(){const i=this.getPlugin("selection");return i?i.getSelectedCells():[]},B.prototype.getSelectedCellCount=function(){const i=this.getPlugin("selection");return i?i.getSelectedCellCount():0},B.prototype.isSelected=function(i){const t=this.getPlugin("selection");return t?t.isSelected(i):!1},B.prototype.select=function(i,t){const e=this.getPlugin("selection");return e&&e.select(i,t),this},B.prototype.unselect=function(i,t){const e=this.getPlugin("selection");return e&&e.unselect(i,t),this};const XA={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};class gd extends Ft{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(t={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},XA),t),Te(this.name,qA)}init(t){this.graph=t,this.selectionImpl=new ud(Object.assign(Object.assign({},this.options),{graph:t})),this.resolvePanningSelectionConflict(),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(t){return t!=null?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(t){return t!=null?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(t){return t!=null?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(t){return t!=null?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.setModifiers(t)}setSelectionFilter(t){return this.setFilter(t),this}setSelectionDisplayContent(t){return this.setContent(t),this}isEmpty(){return this.length<=0}clean(t={}){return this.selectionImpl.clean(t),this}reset(t,e={}){return this.selectionImpl.reset(t?this.getCells(t):[],e),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(t){return this.selectionImpl.isSelected(t)}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.selectionImpl.unselect(this.getCells(t),e),this}setup(){this.selectionImpl.on("*",(t,e)=>{this.trigger(t,e),this.graph.trigger(t,e)})}startListening(){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.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){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.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.panning.allowPanning(t,!0),n=this.graph.getPlugin("scroller"),s=n&&n.allowPanning(t,!0);(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!s&&!e)&&this.startRubberband(t)}allowBlankMouseDown(t){const e=this.options.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}onBlankClick(){this.clean()}allowRubberband(t,e){const n=t??{altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1};return!this.rubberbandDisabled&&Ne(n,this.options.modifiers,e)}resolvePanningSelectionConflict(){if(this.options.enabled!==!0||this.options.rubberband!==!0)return;const t=this.graph.options.panning;if(!t||t.enabled===!1)return;(()=>{var n,s;const o=(n=this.options.eventTypes)!==null&&n!==void 0?n:[],r=(s=t.eventTypes)!==null&&s!==void 0?s:[],a=new Set(r),l=o.some(h=>a.has(h)),c=k2(t.modifiers,this.options.modifiers);return l&&c})()&&this.graph.panning.disablePanning()}allowMultipleSelection(t){return this.isMultiple()&&Ne(t,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.options;let s=this.disabled;!s&&this.movedMap.has(e)&&(s=n.selectCellOnMoved===!1,s||(s=n.selectNodeOnMoved===!1&&e.isNode()),s||(s=n.selectEdgeOnMoved===!1&&e.isEdge())),s||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}getCells(t){return(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?this.graph.getCellById(e):e).filter(e=>e!=null)}startRubberband(t){return this.rubberbandDisabled||this.selectionImpl.startSelecting(t),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(t){return this.options.modifiers=t,this}setContent(t){return this.selectionImpl.setContent(t),this}setFilter(t){return this.selectionImpl.setFilter(t),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Ie(this.name)}}$([Z()],gd.prototype,"dispose",null);const $A=`.x6-widget-minimap {
|
|
330
|
+
`;B.prototype.isSelectionEnabled=function(){const i=this.getPlugin("selection");return i?i.isEnabled():!1},B.prototype.enableSelection=function(){const i=this.getPlugin("selection");return i&&i.enable(),this},B.prototype.disableSelection=function(){const i=this.getPlugin("selection");return i&&i.disable(),this},B.prototype.toggleSelection=function(i){const t=this.getPlugin("selection");return t&&t.toggleEnabled(i),this},B.prototype.isMultipleSelection=function(){const i=this.getPlugin("selection");return i?i.isMultipleSelection():!1},B.prototype.enableMultipleSelection=function(){const i=this.getPlugin("selection");return i&&i.enableMultipleSelection(),this},B.prototype.disableMultipleSelection=function(){const i=this.getPlugin("selection");return i&&i.disableMultipleSelection(),this},B.prototype.toggleMultipleSelection=function(i){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(i),this},B.prototype.isSelectionMovable=function(){const i=this.getPlugin("selection");return i?i.isSelectionMovable():!1},B.prototype.enableSelectionMovable=function(){const i=this.getPlugin("selection");return i&&i.enableSelectionMovable(),this},B.prototype.disableSelectionMovable=function(){const i=this.getPlugin("selection");return i&&i.disableSelectionMovable(),this},B.prototype.toggleSelectionMovable=function(i){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(i),this},B.prototype.isRubberbandEnabled=function(){const i=this.getPlugin("selection");return i?i.isRubberbandEnabled():!1},B.prototype.enableRubberband=function(){const i=this.getPlugin("selection");return i&&i.enableRubberband(),this},B.prototype.disableRubberband=function(){const i=this.getPlugin("selection");return i&&i.disableRubberband(),this},B.prototype.toggleRubberband=function(i){const t=this.getPlugin("selection");return t&&t.toggleRubberband(i),this},B.prototype.isStrictRubberband=function(){const i=this.getPlugin("selection");return i?i.isStrictRubberband():!1},B.prototype.enableStrictRubberband=function(){const i=this.getPlugin("selection");return i&&i.enableStrictRubberband(),this},B.prototype.disableStrictRubberband=function(){const i=this.getPlugin("selection");return i&&i.disableStrictRubberband(),this},B.prototype.toggleStrictRubberband=function(i){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(i),this},B.prototype.setRubberbandModifiers=function(i){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(i),this},B.prototype.setSelectionFilter=function(i){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(i),this},B.prototype.setSelectionDisplayContent=function(i){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(i),this},B.prototype.isSelectionEmpty=function(){const i=this.getPlugin("selection");return i?i.isEmpty():!0},B.prototype.cleanSelection=function(i){const t=this.getPlugin("selection");return t&&t.clean(i),this},B.prototype.resetSelection=function(i,t){const e=this.getPlugin("selection");return e&&e.reset(i,t),this},B.prototype.getSelectedCells=function(){const i=this.getPlugin("selection");return i?i.getSelectedCells():[]},B.prototype.getSelectedCellCount=function(){const i=this.getPlugin("selection");return i?i.getSelectedCellCount():0},B.prototype.isSelected=function(i){const t=this.getPlugin("selection");return t?t.isSelected(i):!1},B.prototype.select=function(i,t){const e=this.getPlugin("selection");return e&&e.select(i,t),this},B.prototype.unselect=function(i,t){const e=this.getPlugin("selection");return e&&e.unselect(i,t),this};const XA={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};class gd extends Ft{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(t={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},XA),t),Te(this.name,qA)}init(t){this.graph=t,this.selectionImpl=new ud(Object.assign(Object.assign({},this.options),{graph:t})),this.resolvePanningSelectionConflict(),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(t){return t!=null?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(t){return t!=null?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(t){return t!=null?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(t){return t!=null?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.setModifiers(t)}setSelectionFilter(t){return this.setFilter(t),this}setSelectionDisplayContent(t){return this.setContent(t),this}isEmpty(){return this.length<=0}clean(t={}){return this.selectionImpl.clean(t),this}reset(t,e={}){return this.selectionImpl.reset(t?this.getCells(t):[],e),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(t){return this.selectionImpl.isSelected(t)}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.selectionImpl.unselect(this.getCells(t),e),this}setup(){this.selectionImpl.on("*",(t,e)=>{this.trigger(t,e),this.graph.trigger(t,e)})}startListening(){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.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){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.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.panning.allowPanning(t,!0),n=this.graph.getPlugin("scroller"),s=n&&n.allowPanning(t,!0);(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!s&&!e)&&this.startRubberband(t)}allowBlankMouseDown(t){const e=this.options.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}onBlankClick(){this.clean()}allowRubberband(t,e){const n=t??{altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1};return!this.rubberbandDisabled&&Ne(n,this.options.modifiers,e)}resolvePanningSelectionConflict(){if(this.options.enabled!==!0||this.options.rubberband!==!0)return;const t=this.graph.options.panning;if(!t||t.enabled===!1)return;(()=>{var n,s;const o=(n=this.options.eventTypes)!==null&&n!==void 0?n:[],r=(s=t.eventTypes)!==null&&s!==void 0?s:[],a=new Set(r),l=o.some(h=>a.has(h)),c=k2(t.modifiers,this.options.modifiers);return l&&c})()&&this.graph.panning.disablePanning()}allowMultipleSelection(t){return this.isMultiple()&&Ne(t,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.options;let s=this.disabled;!s&&this.movedMap.has(e)&&(s=n.selectCellOnMoved===!1,s||(s=n.selectNodeOnMoved===!1&&e.isNode()),s||(s=n.selectEdgeOnMoved===!1&&e.isEdge())),s||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}getCells(t){return(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?this.graph.getCellById(e):e).filter(e=>e!=null)}startRubberband(t){return this.rubberbandDisabled||this.selectionImpl.startSelecting(t),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(t){return this.options.modifiers=t,this}setContent(t){return this.selectionImpl.setContent(t),this}setFilter(t){return this.selectionImpl.setFilter(t),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Ie(this.name)}}X([$()],gd.prototype,"dispose",null);const $A=`.x6-widget-minimap {
|
|
331
331
|
position: relative;
|
|
332
332
|
display: table-cell;
|
|
333
333
|
box-sizing: border-box;
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
border-radius: 50%;
|
|
371
371
|
cursor: nwse-resize;
|
|
372
372
|
}
|
|
373
|
-
`,ZA={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:i=>new B(i)},tx={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"},fd="widget-minimap",pd=`${fd}-viewport`,ex=`${pd}-zoom`;class nx extends Gt{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(t){super(),this.name="minimap",this.options=Object.assign(Object.assign({},ZA),t),Te(this.name,$A)}init(t){this.graph=t,this.updateViewport=Xi(this.updateViewport.bind(this),0),this.container=document.createElement("div"),Q(this.container,this.prefixClassName(fd));const e=document.createElement("div");this.container.appendChild(e),this.viewport=document.createElement("div"),Q(this.viewport,this.prefixClassName(pd)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),Q(this.zoomHandle,this.prefixClassName(ex)),Xt(this.zoomHandle,this.viewport)),Ot(this.container,this.viewport),nt(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1,panning:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new B(n),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?ot.on(this.graphContainer,`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({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?ot.off(this.graphContainer,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()}onRemove(){this.stopListening(),this.targetGraph.dispose(!1)}onTransform(t){(t.ui||this.targetGraphTransforming||!this.scroller)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,s;typeof t=="object"?(n=t.width,s=t.height):(n=t,s=e);const o=this.sourceGraph.options,r=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;n/=r.sx,s/=r.sy,this.ratio=Math.min(a/n,l/s);const c=this.ratio,h=o.x*c/r.sx,u=o.y*c/r.sy;return n*=c,s*=c,this.targetGraph.resize(n,s),this.targetGraph.translate(h,u),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale(),n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0),s=Q6(this.targetGraph.container),o=this.targetGraph.translate();o.ty=o.ty||0,this.geometry={top:s.top+n.y*e.sy+o.ty,left:s.left+n.x*e.sx+o.tx,width:this.graphContainer.clientWidth*e.sx/t.sx,height:this.graphContainer.clientHeight*e.sy/t.sy},nt(this.viewport,this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:s,ty:o}=this.sourceGraph.translate(),r={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:s,translateY:o};this.targetGraphTransforming=!0,this.delegateDocumentEvents(tx,r)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,s=e.clientY,o=e.data;switch(o.action){case"panning":{const r=this.sourceGraph.transform.getScale(),a=(n-o.clientX)*r.sx,l=(s-o.clientY)*r.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":{const r=o.scale,a=o.geometry,l=1+(o.clientX-n)/a.width/r.sx;o.frameId&&cancelAnimationFrame(o.frameId),o.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*o.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,s;const o=this.targetGraph.translate();if(o.ty=o.ty||0,e.offsetX==null){const l=xn(this.targetGraph.container);n=e.pageX-l.left,s=e.pageY-l.top}else n=e.offsetX,s=e.offsetY;const r=(n-o.tx)/this.ratio,a=(s-o.ty)/this.ratio;this.sourceGraph.centerPoint(r,a)}dispose(){this.remove(),Ie(this.name)}}$([Z()],nx.prototype,"dispose",null);const Vs="graph-scroller",ix=`${Vs}-paged`,sx=`${Vs}-content`,ox=`${Vs}-background`,md="transition-in-progress",Nr="transitionend.graph-scroller-transition",rx={padding(){const i=this.getClientSize(),t=Math.max(this.options.minVisibleWidth||0,1)||1,e=Math.max(this.options.minVisibleHeight||0,1)||1,n=Math.max(i.width-t,0),s=Math.max(i.height-e,0);return{left:n,top:s,right:n,bottom:s}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function bd(i){const t=ft({},rx,i);t.pageWidth==null&&(t.pageWidth=i.graph.options.width),t.pageHeight==null&&(t.pageHeight=i.graph.options.height);const e=i.graph.options;return e.background&&t.enabled&&t.background==null&&(t.background=e.background,i.graph.background.clear()),t}class yd extends Gt{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=bd(t),this.onUpdate=Xi(this.onUpdate,200);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,s=this.options.height||this.graph.options.height;this.container=document.createElement("div"),Q(this.container,this.prefixClassName(Vs)),nt(this.container,{width:n,height:s}),this.options.pageVisible&&Q(this.container,this.prefixClassName(ix)),this.options.className&&Q(this.container,this.options.className);const o=this.graph.container;o.parentNode&&qn(o,this.container),this.content=document.createElement("div"),Q(this.content,this.prefixClassName(sx)),nt(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),Q(this.background,this.prefixClassName(ox)),Ot(this.content,this.background),this.options.pageVisible||Ot(this.content,this.graph.view.grid),Ot(this.content,o),Xt(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new ax(this),this.options.autoResize||this.update()}startListening(){const 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),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),this.delegateBackgroundEvents()}stopListening(){const 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),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),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(t){const e=t||Be.events;this.delegatedHandlers=Object.keys(e).reduce((n,s)=>{const o=e[s];if(s.indexOf(" ")===-1)if(typeof o=="function")n[s]=o;else{let r=this.graph.view[o];typeof r=="function"&&(r=r.bind(this.graph.view),n[s]=r)}return n},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(n=>{this.delegateEvent(n,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(t=>{this.undelegateEvent(t,this.onBackgroundEvent)})}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)this.options.background?e=this.background===n:e=this.content===n;else{const s=this.graph.view;e=s.background===n||s.grid===n}if(e){const s=this.delegatedHandlers[t.type];typeof s=="function"&&s.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:s}){this.updateScale(t,e),(n||s)&&(this.centerPoint(n,s),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(zl||Fl)&&nt(this.container,{visibility:"hidden"})}afterManipulation(){(zl||Fl)&&nt(this.container,{visibility:"visible"})}updatePageSize(t,e){t!=null&&(this.options.pageWidth=t),e!=null&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,s=this.options.pageHeight*this.sy;if(n===0||s===0)return;if(t>n||e>s){let o=!1;const r=document.createElement("div");for(let a=1,l=Math.floor(t/n);a<l;a+=1){const c=document.createElement("div");Q(c,this.prefixClassName("graph-pagebreak-vertical")),nt(c,{left:a*n}),Xt(c,r),o=!0}for(let a=1,l=Math.floor(e/s);a<l;a+=1){const c=document.createElement("div");Q(c,this.prefixClassName("graph-pagebreak-horizontal")),nt(c,{top:a*s}),Xt(c,r),o=!0}o&&(Q(r,this.prefixClassName("graph-pagebreak")),Ny(this.graph.view.grid,r),this.pageBreak=r)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions;typeof e=="function"&&(e=F(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),typeof t.padding=="object"?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:typeof t.padding=="number"&&(t.padding*=e),this.options.autoResize||(t.contentArea=P.create()),t}updateScale(t,e){const n=this.graph.options,s=t/this.sx,o=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*s,n.y*o),this.graph.transform.resize(n.width*s,n.height*o)}scrollbarPosition(t,e){if(t==null&&e==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const n={};return typeof t=="number"&&(n.scrollLeft=t),typeof e=="number"&&(n.scrollTop=e),Qo(this.container,n),this}scrollToPoint(t,e){const n=this.getClientSize(),s=this.graph.matrix(),o={};return typeof t=="number"&&(o.scrollLeft=t-n.width/2+s.e+(this.padding.left||0)),typeof e=="number"&&(o.scrollTop=e-n.height/2+s.f+(this.padding.top||0)),Qo(this.container,o),this}scrollToContent(){const t=this.sx,e=this.sy,n=this.graph.getContentArea().getCenter();return this.scrollToPoint(n.x*t,n.y*e)}scrollToCell(t){const e=this.sx,n=this.sy,s=t.getBBox().getCenter();return this.scrollToPoint(s.x*e,s.y*n)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const s=this.graph.matrix(),o=s.a,r=s.d,a=-s.e,l=-s.f,c=a+this.graph.options.width,h=l+this.graph.options.height;let u;if(this.storeClientSize(),typeof t=="number"||typeof e=="number"){u=n;const E=this.getVisibleArea().getCenter();typeof t=="number"?t*=o:t=E.x,typeof e=="number"?e*=r:e=E.y}else u=t,t=(a+c)/2,e=(l+h)/2;if(u&&u.padding)return this.positionPoint({x:t,y:e},"50%","50%",u);const g=this.getPadding(),f=this.getClientSize(),p=f.width/2,m=f.height/2,b=p-g.left-t+a,y=p-g.right+t-c,C=m-g.top-e+l,w=m-g.bottom+e-h;this.addPadding(Math.max(b,0),Math.max(y,0),Math.max(C,0),Math.max(w,0));const x=this.scrollToPoint(t,e);return this.restoreClientSize(),x}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const s=t.getBBox();return this.positionRect(s,e,n)}positionRect(t,e,n){const s=P.create(t);switch(e){case"center":return this.positionPoint(s.getCenter(),"50%","50%",n);case"top":return this.positionPoint(s.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0,n);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(s.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,s={}){const{padding:o}=s,r=Y(s,["padding"]),a=re(o),l=P.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});e=Yt(e,Math.max(0,c.width)),e<0&&(e=c.width+e),n=Yt(n,Math.max(0,c.height)),n<0&&(n=c.height+n);const h=c.getTopLeft().translate(e,n),u=l.getCenter().diff(h),g=this.zoom(),f=u.scale(1/g,1/g),p=A.create(t).translate(f);return this.centerPoint(p.x,p.y,r)}zoom(t,e){if(t==null)return this.sx;e=e||{};let n,s;const o=this.getClientSize(),r=this.clientToLocalPoint(o.width/2,o.height/2);let a=t,l=t;if(e.absolute||(a+=this.sx,l+=this.sy),e.scaleGrid&&(a=Math.round(a/e.scaleGrid)*e.scaleGrid,l=Math.round(l/e.scaleGrid)*e.scaleGrid),e.maxScale&&(a=Math.min(e.maxScale,a),l=Math.min(e.maxScale,l)),e.minScale&&(a=Math.max(e.minScale,a),l=Math.max(e.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),e.center){const c=a/this.sx,h=l/this.sy;n=e.center.x-(e.center.x-r.x)/c,s=e.center.y-(e.center.y-r.y)/h}else n=r.x,s=r.y;return this.beforeManipulation(),this.graph.transform.scale(a,l,n,s,!1),this.centerPoint(n,s),this.afterManipulation(),this}zoomToRect(t,e={}){const n=P.create(t),s=this.graph;if(e.contentArea=n,e.viewportArea==null){const r=this.container.getBoundingClientRect();e.viewportArea={x:s.options.x,y:s.options.y,width:r.width,height:r.height}}this.beforeManipulation(),s.transform.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){typeof t=="object"?(n=e,e=t.y,t=t.x):e=e,n==null&&(n={});let s,o;const r=this.sx,a=Math.max(n.scale||r,1e-6),l=this.getClientSize(),c=new A(t,e),h=this.clientToLocalPoint(l.width/2,l.height/2);if(r===a){const g=h.diff(c).scale(r,r).round();s=`translate(${g.x}px,${g.y}px)`}else{const g=a/(r-a)*c.distance(h),f=h.clone().move(c,g),p=this.localToBackgroundPoint(f).round();s=`scale(${a/r})`,o=`${p.x}px ${p.y}px`}const u=n.onTransitionEnd;return Q(this.container,md),ot.off(this.content,Nr),ot.on(this.content,Nr,g=>{this.syncTransition(a,{x:t,y:e}),typeof u=="function"&&F(u,this,g.originalEvent)}),nt(this.content,{transform:s,transformOrigin:o,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return lt(this.container,md),ot.off(this.content,Nr),nt(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=P.create(t),s=e.maxScale||1/0,o=e.minScale||Number.MIN_VALUE,r=e.scaleGrid||null,a=e.visibility||1,l=e.center?A.create(e.center):n.getCenter(),c=this.getClientSize(),h=c.width*a,u=c.height*a;let g=new P(l.x-h/2,l.y-u/2,h,u).getMaxUniformScaleToFit(n,l);return g=Math.min(g,s),r&&(g=Math.floor(g/r)*r),g=Math.max(o,g),this.transitionToPoint(l,Object.assign({scale:g},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e}),ot.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ot.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,s=e.clientY-this.clientY;this.container.scrollTop-=s,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e})}stopPanning(t){ot.off(document.body,".panning"),ot.off(window,".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n=typeof t=="object"?t.x:t,s=typeof t=="object"?t.y:e;const o=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-o.e,s+=this.container.scrollTop-this.padding.top-o.f,new A(n/o.a,s/o.d)}localToBackgroundPoint(t,e){const n=typeof t=="object"?A.create(t):new A(t,e),s=this.graph.matrix(),o=this.padding;return Ee(n,s).translate(o.left,o.top)}resize(t,e){let n=t??this.container.offsetWidth,s=e??this.container.offsetHeight;typeof n=="number"&&(n=Math.round(n)),typeof s=="number"&&(s=Math.round(s)),this.options.width=n,this.options.height=s,nt(this.container,{width:n,height:s}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const s=this.container,o=s.getBoundingClientRect();let r=0,a=0;return t<=o.left+10&&(r=-10),e<=o.top+10&&(a=-10),t>=o.right-10&&(r=10),e>=o.bottom-10&&(a=10),r!==0&&(s.scrollLeft+=r),a!==0&&(s.scrollTop+=a),{scrollerX:r,scrollerY:a}}addPadding(t,e,n,s){let o=this.getPadding();this.padding={left:Math.round(o.left+(t||0)),top:Math.round(o.top+(n||0)),bottom:Math.round(o.bottom+(s||0)),right:Math.round(o.right+(e||0))},o=this.padding,nt(this.content,{width:o.left+this.graph.options.width+o.right,height:o.top+this.graph.options.height+o.bottom});const r=this.graph.container;return r.style.left=`${this.padding.left}px`,r.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return re(typeof t=="function"?F(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},s=$t(n,t.inverse());return s.x-=(this.padding.left||0)/this.sx,s.y-=(this.padding.top||0)/this.sy,s}isCellVisible(t,e={}){const n=t.getBBox(),s=this.getVisibleArea();return e.strict?s.containsRect(n):s.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return nt(this.container,{overflow:"hidden"}),this}unlock(){return nt(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){qn(this.container,this.graph.container),this.remove()}}$([Z()],yd.prototype,"dispose",null);class ax extends br{get elem(){return this.scroller.background}constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}const lx=`.x6-graph-scroller {
|
|
373
|
+
`,ZA={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:i=>new B(i)},tx={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"},fd="widget-minimap",pd=`${fd}-viewport`,ex=`${pd}-zoom`;class nx extends jt{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(t){super(),this.name="minimap",this.options=Object.assign(Object.assign({},ZA),t),Te(this.name,$A)}init(t){this.graph=t,this.updateViewport=Xi(this.updateViewport.bind(this),0),this.container=document.createElement("div"),Q(this.container,this.prefixClassName(fd));const e=document.createElement("div");this.container.appendChild(e),this.viewport=document.createElement("div"),Q(this.viewport,this.prefixClassName(pd)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),Q(this.zoomHandle,this.prefixClassName(ex)),qt(this.zoomHandle,this.viewport)),Nt(this.container,this.viewport),nt(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1,panning:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new B(n),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?ot.on(this.graphContainer,`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({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?ot.off(this.graphContainer,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()}onRemove(){this.stopListening(),this.targetGraph.dispose(!1)}onTransform(t){(t.ui||this.targetGraphTransforming||!this.scroller)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,s;typeof t=="object"?(n=t.width,s=t.height):(n=t,s=e);const o=this.sourceGraph.options,r=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;n/=r.sx,s/=r.sy,this.ratio=Math.min(a/n,l/s);const c=this.ratio,h=o.x*c/r.sx,u=o.y*c/r.sy;return n*=c,s*=c,this.targetGraph.resize(n,s),this.targetGraph.translate(h,u),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale(),n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0),s=Q6(this.targetGraph.container),o=this.targetGraph.translate();o.ty=o.ty||0,this.geometry={top:s.top+n.y*e.sy+o.ty,left:s.left+n.x*e.sx+o.tx,width:this.graphContainer.clientWidth*e.sx/t.sx,height:this.graphContainer.clientHeight*e.sy/t.sy},nt(this.viewport,this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:s,ty:o}=this.sourceGraph.translate(),r={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:s,translateY:o};this.targetGraphTransforming=!0,this.delegateDocumentEvents(tx,r)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,s=e.clientY,o=e.data;switch(o.action){case"panning":{const r=this.sourceGraph.transform.getScale(),a=(n-o.clientX)*r.sx,l=(s-o.clientY)*r.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":{const r=o.scale,a=o.geometry,l=1+(o.clientX-n)/a.width/r.sx;o.frameId&&cancelAnimationFrame(o.frameId),o.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*o.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,s;const o=this.targetGraph.translate();if(o.ty=o.ty||0,e.offsetX==null){const l=xn(this.targetGraph.container);n=e.pageX-l.left,s=e.pageY-l.top}else n=e.offsetX,s=e.offsetY;const r=(n-o.tx)/this.ratio,a=(s-o.ty)/this.ratio;this.sourceGraph.centerPoint(r,a)}dispose(){this.remove(),Ie(this.name)}}X([$()],nx.prototype,"dispose",null);const Vs="graph-scroller",ix=`${Vs}-paged`,sx=`${Vs}-content`,ox=`${Vs}-background`,md="transition-in-progress",Nr="transitionend.graph-scroller-transition",rx={padding(){const i=this.getClientSize(),t=Math.max(this.options.minVisibleWidth||0,1)||1,e=Math.max(this.options.minVisibleHeight||0,1)||1,n=Math.max(i.width-t,0),s=Math.max(i.height-e,0);return{left:n,top:s,right:n,bottom:s}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function bd(i){const t=ft({},rx,i);t.pageWidth==null&&(t.pageWidth=i.graph.options.width),t.pageHeight==null&&(t.pageHeight=i.graph.options.height);const e=i.graph.options;return e.background&&t.enabled&&t.background==null&&(t.background=e.background,i.graph.background.clear()),t}class yd extends jt{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=bd(t),this.onUpdate=Xi(this.onUpdate,200);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,s=this.options.height||this.graph.options.height;this.container=document.createElement("div"),Q(this.container,this.prefixClassName(Vs)),nt(this.container,{width:n,height:s}),this.options.pageVisible&&Q(this.container,this.prefixClassName(ix)),this.options.className&&Q(this.container,this.options.className);const o=this.graph.container;o.parentNode&&qn(o,this.container),this.content=document.createElement("div"),Q(this.content,this.prefixClassName(sx)),nt(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),Q(this.background,this.prefixClassName(ox)),Nt(this.content,this.background),this.options.pageVisible||Nt(this.content,this.graph.view.grid),Nt(this.content,o),qt(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new ax(this),this.options.autoResize||this.update()}startListening(){const 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),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),this.delegateBackgroundEvents()}stopListening(){const 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),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),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(t){const e=t||Be.events;this.delegatedHandlers=Object.keys(e).reduce((n,s)=>{const o=e[s];if(s.indexOf(" ")===-1)if(typeof o=="function")n[s]=o;else{let r=this.graph.view[o];typeof r=="function"&&(r=r.bind(this.graph.view),n[s]=r)}return n},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(n=>{this.delegateEvent(n,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(t=>{this.undelegateEvent(t,this.onBackgroundEvent)})}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)this.options.background?e=this.background===n:e=this.content===n;else{const s=this.graph.view;e=s.background===n||s.grid===n}if(e){const s=this.delegatedHandlers[t.type];typeof s=="function"&&s.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:s}){this.updateScale(t,e),(n||s)&&(this.centerPoint(n,s),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(zl||Fl)&&nt(this.container,{visibility:"hidden"})}afterManipulation(){(zl||Fl)&&nt(this.container,{visibility:"visible"})}updatePageSize(t,e){t!=null&&(this.options.pageWidth=t),e!=null&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,s=this.options.pageHeight*this.sy;if(n===0||s===0)return;if(t>n||e>s){let o=!1;const r=document.createElement("div");for(let a=1,l=Math.floor(t/n);a<l;a+=1){const c=document.createElement("div");Q(c,this.prefixClassName("graph-pagebreak-vertical")),nt(c,{left:a*n}),qt(c,r),o=!0}for(let a=1,l=Math.floor(e/s);a<l;a+=1){const c=document.createElement("div");Q(c,this.prefixClassName("graph-pagebreak-horizontal")),nt(c,{top:a*s}),qt(c,r),o=!0}o&&(Q(r,this.prefixClassName("graph-pagebreak")),Ny(this.graph.view.grid,r),this.pageBreak=r)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions;typeof e=="function"&&(e=F(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),typeof t.padding=="object"?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:typeof t.padding=="number"&&(t.padding*=e),this.options.autoResize||(t.contentArea=P.create()),t}updateScale(t,e){const n=this.graph.options,s=t/this.sx,o=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*s,n.y*o),this.graph.transform.resize(n.width*s,n.height*o)}scrollbarPosition(t,e){if(t==null&&e==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const n={};return typeof t=="number"&&(n.scrollLeft=t),typeof e=="number"&&(n.scrollTop=e),Qo(this.container,n),this}scrollToPoint(t,e){const n=this.getClientSize(),s=this.graph.matrix(),o={};return typeof t=="number"&&(o.scrollLeft=t-n.width/2+s.e+(this.padding.left||0)),typeof e=="number"&&(o.scrollTop=e-n.height/2+s.f+(this.padding.top||0)),Qo(this.container,o),this}scrollToContent(){const t=this.sx,e=this.sy,n=this.graph.getContentArea().getCenter();return this.scrollToPoint(n.x*t,n.y*e)}scrollToCell(t){const e=this.sx,n=this.sy,s=t.getBBox().getCenter();return this.scrollToPoint(s.x*e,s.y*n)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const s=this.graph.matrix(),o=s.a,r=s.d,a=-s.e,l=-s.f,c=a+this.graph.options.width,h=l+this.graph.options.height;let u;if(this.storeClientSize(),typeof t=="number"||typeof e=="number"){u=n;const E=this.getVisibleArea().getCenter();typeof t=="number"?t*=o:t=E.x,typeof e=="number"?e*=r:e=E.y}else u=t,t=(a+c)/2,e=(l+h)/2;if(u&&u.padding)return this.positionPoint({x:t,y:e},"50%","50%",u);const g=this.getPadding(),f=this.getClientSize(),p=f.width/2,m=f.height/2,b=p-g.left-t+a,y=p-g.right+t-c,w=m-g.top-e+l,C=m-g.bottom+e-h;this.addPadding(Math.max(b,0),Math.max(y,0),Math.max(w,0),Math.max(C,0));const x=this.scrollToPoint(t,e);return this.restoreClientSize(),x}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const s=t.getBBox();return this.positionRect(s,e,n)}positionRect(t,e,n){const s=P.create(t);switch(e){case"center":return this.positionPoint(s.getCenter(),"50%","50%",n);case"top":return this.positionPoint(s.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0,n);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(s.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,s={}){const{padding:o}=s,r=Y(s,["padding"]),a=oe(o),l=P.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});e=Gt(e,Math.max(0,c.width)),e<0&&(e=c.width+e),n=Gt(n,Math.max(0,c.height)),n<0&&(n=c.height+n);const h=c.getTopLeft().translate(e,n),u=l.getCenter().diff(h),g=this.zoom(),f=u.scale(1/g,1/g),p=A.create(t).translate(f);return this.centerPoint(p.x,p.y,r)}zoom(t,e){if(t==null)return this.sx;e=e||{};let n,s;const o=this.getClientSize(),r=this.clientToLocalPoint(o.width/2,o.height/2);let a=t,l=t;if(e.absolute||(a+=this.sx,l+=this.sy),e.scaleGrid&&(a=Math.round(a/e.scaleGrid)*e.scaleGrid,l=Math.round(l/e.scaleGrid)*e.scaleGrid),e.maxScale&&(a=Math.min(e.maxScale,a),l=Math.min(e.maxScale,l)),e.minScale&&(a=Math.max(e.minScale,a),l=Math.max(e.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),e.center){const c=a/this.sx,h=l/this.sy;n=e.center.x-(e.center.x-r.x)/c,s=e.center.y-(e.center.y-r.y)/h}else n=r.x,s=r.y;return this.beforeManipulation(),this.graph.transform.scale(a,l,n,s,!1),this.centerPoint(n,s),this.afterManipulation(),this}zoomToRect(t,e={}){const n=P.create(t),s=this.graph;if(e.contentArea=n,e.viewportArea==null){const r=this.container.getBoundingClientRect();e.viewportArea={x:s.options.x,y:s.options.y,width:r.width,height:r.height}}this.beforeManipulation(),s.transform.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){typeof t=="object"?(n=e,e=t.y,t=t.x):e=e,n==null&&(n={});let s,o;const r=this.sx,a=Math.max(n.scale||r,1e-6),l=this.getClientSize(),c=new A(t,e),h=this.clientToLocalPoint(l.width/2,l.height/2);if(r===a){const g=h.diff(c).scale(r,r).round();s=`translate(${g.x}px,${g.y}px)`}else{const g=a/(r-a)*c.distance(h),f=h.clone().move(c,g),p=this.localToBackgroundPoint(f).round();s=`scale(${a/r})`,o=`${p.x}px ${p.y}px`}const u=n.onTransitionEnd;return Q(this.container,md),ot.off(this.content,Nr),ot.on(this.content,Nr,g=>{this.syncTransition(a,{x:t,y:e}),typeof u=="function"&&F(u,this,g.originalEvent)}),nt(this.content,{transform:s,transformOrigin:o,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return lt(this.container,md),ot.off(this.content,Nr),nt(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=P.create(t),s=e.maxScale||1/0,o=e.minScale||Number.MIN_VALUE,r=e.scaleGrid||null,a=e.visibility||1,l=e.center?A.create(e.center):n.getCenter(),c=this.getClientSize(),h=c.width*a,u=c.height*a;let g=new P(l.x-h/2,l.y-u/2,h,u).getMaxUniformScaleToFit(n,l);return g=Math.min(g,s),r&&(g=Math.floor(g/r)*r),g=Math.max(o,g),this.transitionToPoint(l,Object.assign({scale:g},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e}),ot.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ot.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,s=e.clientY-this.clientY;this.container.scrollTop-=s,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e})}stopPanning(t){ot.off(document.body,".panning"),ot.off(window,".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n=typeof t=="object"?t.x:t,s=typeof t=="object"?t.y:e;const o=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-o.e,s+=this.container.scrollTop-this.padding.top-o.f,new A(n/o.a,s/o.d)}localToBackgroundPoint(t,e){const n=typeof t=="object"?A.create(t):new A(t,e),s=this.graph.matrix(),o=this.padding;return Ee(n,s).translate(o.left,o.top)}resize(t,e){let n=t??this.container.offsetWidth,s=e??this.container.offsetHeight;typeof n=="number"&&(n=Math.round(n)),typeof s=="number"&&(s=Math.round(s)),this.options.width=n,this.options.height=s,nt(this.container,{width:n,height:s}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const s=this.container,o=s.getBoundingClientRect();let r=0,a=0;return t<=o.left+10&&(r=-10),e<=o.top+10&&(a=-10),t>=o.right-10&&(r=10),e>=o.bottom-10&&(a=10),r!==0&&(s.scrollLeft+=r),a!==0&&(s.scrollTop+=a),{scrollerX:r,scrollerY:a}}addPadding(t,e,n,s){let o=this.getPadding();this.padding={left:Math.round(o.left+(t||0)),top:Math.round(o.top+(n||0)),bottom:Math.round(o.bottom+(s||0)),right:Math.round(o.right+(e||0))},o=this.padding,nt(this.content,{width:o.left+this.graph.options.width+o.right,height:o.top+this.graph.options.height+o.bottom});const r=this.graph.container;return r.style.left=`${this.padding.left}px`,r.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return oe(typeof t=="function"?F(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},s=Xt(n,t.inverse());return s.x-=(this.padding.left||0)/this.sx,s.y-=(this.padding.top||0)/this.sy,s}isCellVisible(t,e={}){const n=t.getBBox(),s=this.getVisibleArea();return e.strict?s.containsRect(n):s.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return nt(this.container,{overflow:"hidden"}),this}unlock(){return nt(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){qn(this.container,this.graph.container),this.remove()}}X([$()],yd.prototype,"dispose",null);class ax extends br{get elem(){return this.scroller.background}constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}const lx=`.x6-graph-scroller {
|
|
374
374
|
position: relative;
|
|
375
375
|
box-sizing: border-box;
|
|
376
376
|
overflow: scroll;
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
height: 1px;
|
|
429
429
|
border-top: 1px dashed #bdbdbd;
|
|
430
430
|
}
|
|
431
|
-
`;B.prototype.lockScroller=function(){const i=this.getPlugin("scroller");return i&&i.lockScroller(),this},B.prototype.unlockScroller=function(){const i=this.getPlugin("scroller");return i&&i.unlockScroller(),this},B.prototype.updateScroller=function(){const i=this.getPlugin("scroller");return i&&i.updateScroller(),this},B.prototype.getScrollbarPosition=function(){const i=this.getPlugin("scroller");return i?i.getScrollbarPosition():{left:0,top:0}},B.prototype.setScrollbarPosition=function(i,t){const e=this.getPlugin("scroller");return e&&e.setScrollbarPosition(i,t),this};class wd extends Ft{get pannable(){return this.options?typeof this.options.pannable=="object"?this.options.pannable.enabled:!!this.options.pannable:!1}get container(){return this.scrollerImpl.container}constructor(t={}){super(),this.name="scroller",this.options=t,Te(this.name,lx)}init(t){this.graph=t;const e=bd(Object.assign(Object.assign({enabled:!0},this.options),{graph:t}));this.options=e,this.scrollerImpl=new yd(e),this.setup(),this.autoDisableGraphPanning(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(t,e){this.scrollerImpl.resize(t,e)}resizePage(t,e){this.scrollerImpl.updatePageSize(t,e)}zoom(t,e){return typeof t>"u"?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(t,e),this)}zoomTo(t,e={}){return this.scrollerImpl.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){return this.scrollerImpl.zoomToRect(t,e),this}zoomToFit(t={}){return this.scrollerImpl.zoomToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){return this.scrollerImpl.centerPoint(t,e,n),this}centerContent(t){return this.scrollerImpl.centerContent(t),this}centerCell(t,e){return this.scrollerImpl.centerCell(t,e),this}positionPoint(t,e,n,s={}){return this.scrollerImpl.positionPoint(t,e,n,s),this}positionRect(t,e,n){return this.scrollerImpl.positionRect(t,e,n),this}positionCell(t,e,n){return this.scrollerImpl.positionCell(t,e,n),this}positionContent(t,e){return this.scrollerImpl.positionContent(t,e),this}drawBackground(t,e){return(this.graph.options.background==null||!e)&&this.scrollerImpl.backgroundManager.draw(t),this}clearBackground(t){return(this.graph.options.background==null||!t)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){this.pannable||(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(t,e){return this.scrollerImpl.scrollbarPosition(t,e),this}scrollToPoint(t,e){return this.scrollerImpl.scrollToPoint(t,e),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(t){return this.scrollerImpl.scrollToCell(t),this}transitionToPoint(t,e,n){return this.scrollerImpl.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){return this.scrollerImpl.transitionToRect(t,e),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(t,e){return this.scrollerImpl.autoScroll(t,e)}clientToLocalPoint(t,e){return this.scrollerImpl.clientToLocalPoint(t,e)}getVisibleArea(){return this.scrollerImpl.getVisibleArea()}isCellVisible(t,e={}){return this.scrollerImpl.isCellVisible(t,e)}isPointVisible(t){return this.scrollerImpl.isPointVisible(t)}setup(){this.scrollerImpl.on("*",(t,e)=>{this.trigger(t,e)})}startListening(){let t=[];const e=this.options.pannable;typeof e=="object"?t=e.eventTypes||[]:t=["leftMouseDown"],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),ot.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.options.pannable;typeof e=="object"?t=e.eventTypes||[]:t=["leftMouseDown"],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")&&ot.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(t){t.button===2&&this.allowPanning(t,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(t),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e:t}){const e=this.allowPanning(t,!0),n=this.graph.getPlugin("selection"),s=n&&n.allowRubberband(t,!0);(e||this.allowPanning(t)&&!s)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(t),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(t,e){return this.pannable&&Ne(t,this.options.modifiers,e)}updateClassName(t){const e=this.scrollerImpl.container,n=et.prefix("graph-scroller-pannable");this.pannable?(Q(e,n),e.dataset.panning=(!!t).toString()):lt(e,n)}autoDisableGraphPanning(){var t;const e=(t=this.graph)===null||t===void 0?void 0:t.panning;e!=null&&e.pannable&&(e.disablePanning(),console.warn("Detected Scroller plugin; Graph panning has been disabled by default to avoid conflicts."))}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),Ie(this.name)}}
|
|
431
|
+
`;B.prototype.lockScroller=function(){const i=this.getPlugin("scroller");return i&&i.lockScroller(),this},B.prototype.unlockScroller=function(){const i=this.getPlugin("scroller");return i&&i.unlockScroller(),this},B.prototype.updateScroller=function(){const i=this.getPlugin("scroller");return i&&i.updateScroller(),this},B.prototype.getScrollbarPosition=function(){const i=this.getPlugin("scroller");return i?i.getScrollbarPosition():{left:0,top:0}},B.prototype.setScrollbarPosition=function(i,t){const e=this.getPlugin("scroller");return e&&e.setScrollbarPosition(i,t),this};class wd extends Ft{get pannable(){return this.options?typeof this.options.pannable=="object"?this.options.pannable.enabled:!!this.options.pannable:!1}get container(){return this.scrollerImpl.container}constructor(t={}){super(),this.name="scroller",this.options=t,Te(this.name,lx)}init(t){this.graph=t;const e=bd(Object.assign(Object.assign({enabled:!0},this.options),{graph:t}));this.options=e,this.scrollerImpl=new yd(e),this.setup(),this.autoDisableGraphPanning(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(t,e){this.scrollerImpl.resize(t,e)}resizePage(t,e){this.scrollerImpl.updatePageSize(t,e)}zoom(t,e){return typeof t>"u"?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(t,e),this)}zoomTo(t,e={}){return this.scrollerImpl.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){return this.scrollerImpl.zoomToRect(t,e),this}zoomToFit(t={}){return this.scrollerImpl.zoomToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){return this.scrollerImpl.centerPoint(t,e,n),this}centerContent(t){return this.scrollerImpl.centerContent(t),this}centerCell(t,e){return this.scrollerImpl.centerCell(t,e),this}positionPoint(t,e,n,s={}){return this.scrollerImpl.positionPoint(t,e,n,s),this}positionRect(t,e,n){return this.scrollerImpl.positionRect(t,e,n),this}positionCell(t,e,n){return this.scrollerImpl.positionCell(t,e,n),this}positionContent(t,e){return this.scrollerImpl.positionContent(t,e),this}drawBackground(t,e){return(this.graph.options.background==null||!e)&&this.scrollerImpl.backgroundManager.draw(t),this}clearBackground(t){return(this.graph.options.background==null||!t)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){this.pannable||(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(t,e){return this.scrollerImpl.scrollbarPosition(t,e),this}scrollToPoint(t,e){return this.scrollerImpl.scrollToPoint(t,e),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(t){return this.scrollerImpl.scrollToCell(t),this}transitionToPoint(t,e,n){return this.scrollerImpl.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){return this.scrollerImpl.transitionToRect(t,e),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(t,e){return this.scrollerImpl.autoScroll(t,e)}clientToLocalPoint(t,e){return this.scrollerImpl.clientToLocalPoint(t,e)}getVisibleArea(){return this.scrollerImpl.getVisibleArea()}isCellVisible(t,e={}){return this.scrollerImpl.isCellVisible(t,e)}isPointVisible(t){return this.scrollerImpl.isPointVisible(t)}setup(){this.scrollerImpl.on("*",(t,e)=>{this.trigger(t,e)})}startListening(){let t=[];const e=this.options.pannable;typeof e=="object"?t=e.eventTypes||[]:t=["leftMouseDown"],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),ot.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.options.pannable;typeof e=="object"?t=e.eventTypes||[]:t=["leftMouseDown"],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")&&ot.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(t){t.button===2&&this.allowPanning(t,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(t),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e:t}){const e=this.allowPanning(t,!0),n=this.graph.getPlugin("selection"),s=n&&n.allowRubberband(t,!0);(e||this.allowPanning(t)&&!s)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(t),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(t,e){return this.pannable&&Ne(t,this.options.modifiers,e)}updateClassName(t){const e=this.scrollerImpl.container,n=et.prefix("graph-scroller-pannable");this.pannable?(Q(e,n),e.dataset.panning=(!!t).toString()):lt(e,n)}autoDisableGraphPanning(){var t;const e=(t=this.graph)===null||t===void 0?void 0:t.panning;e!=null&&e.pannable&&(e.disablePanning(),console.warn("Detected Scroller plugin; Graph panning has been disabled by default to avoid conflicts."))}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),Ie(this.name)}}X([$()],wd.prototype,"dispose",null);function zs(i,t){return i.reduce((e,n)=>Math.max(n==null?void 0:n.getSize()[t],e),0)}function cx(i,t,e){const n=[];for(let s=e*t,o=s+e;s<o;s+=1)i[s]&&n.push(i[s]);return n}function hx(i,t,e){const n=[];for(let s=t,o=i.length;s<o;s+=e)i[s]&&n.push(i[s]);return n}function Cd(i,t){return i.reduce((e,n,s)=>(e.push(e[s]+n),e),[t||0])}function ux(i,t={}){const e=Yt.isModel(i)?i:new Yt().resetCells(i,{sort:!1,dryrun:!0}),n=e.getNodes(),s=t.columns||1,o=Math.ceil(n.length/s),r=t.dx||0,a=t.dy||0,l=t.center!==!1,c=t.resizeToFit===!0,h=t.marginX||0,u=t.marginY||0,g=[];let f=t.columnWidth;if(f==="compact")for(let w=0;w<s;w+=1){const C=hx(n,w,s);g.push(zs(C,"width")+r)}else{(f==null||f==="auto")&&(f=zs(n,"width")+r);for(let w=0;w<s;w+=1)g.push(f)}const p=Cd(g,h),m=[];let b=t.rowHeight;if(b==="compact")for(let w=0;w<o;w+=1){const C=cx(n,w,s);m.push(zs(C,"height")+a)}else{(b==null||b==="auto")&&(b=zs(n,"height")+a);for(let w=0;w<o;w+=1)m.push(b)}const y=Cd(m,u);e.startBatch("layout"),n.forEach((w,C)=>{const x=C%s,E=Math.floor(C/s),S=g[x],v=m[E];let M=0,k=0,I=w.getSize();if(c){let O=S-2*r,R=v-2*a;const K=I.height*(I.width?O/I.width:1),D=I.width*(I.height?R/I.height:1);v<K?O=D:R=K,I={width:O,height:R},w.setSize(I,t)}l&&(M=(S-I.width)/2,k=(v-I.height)/2),w.position(p[x]+r+M,y[E]+a+k,t)}),e.stopBatch("layout")}const dx=`.x6-widget-dnd {
|
|
432
432
|
position: absolute;
|
|
433
433
|
top: -10000px;
|
|
434
434
|
left: -10000px;
|
|
@@ -665,7 +665,7 @@
|
|
|
665
665
|
font-size: 12px;
|
|
666
666
|
background: 0 0;
|
|
667
667
|
}
|
|
668
|
-
`,ee={base:"widget-stencil",title:"widget-stencil-title",search:"widget-stencil-search",searchText:"widget-stencil-search-text",content:"widget-stencil-content",group:"widget-stencil-group",groupTitle:"widget-stencil-group-title",groupContent:"widget-stencil-group-content"},Rr="__default__",gx=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(i,t){const e={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};ux(i,Object.assign(Object.assign(Object.assign({},e),this.options.layoutOptions),t?t.layoutOptions:{}))}},nd);class fx extends Gt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(t={}){super(),this.name="stencil",Te(this.name,dx),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},gx),t),this.init()}init(){this.dnd=new Or(this.options),this.onSearch=Xi(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n)}),this}unload(t,e){return Array.isArray(t)?this.loadGroup(t,e,!0):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n,!0)}),this}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),Q(e,"collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),lt(e,"collapsed"))}return this}isGroupCollapsable(t){const e=this.groups[t];return ge(e,"collapsable")}isGroupCollapsed(t){const e=this.groups[t];return e&&ge(e,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(t=>{this.collapseGroup(t)}),this}expandGroups(){return Object.keys(this.groups).forEach(t=>{this.expandGroup(t)}),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}addGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups?this.options.groups.push(...e):this.options.groups=e,e.forEach(n=>{this.initGroup(n)})}removeGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups&&(this.options.groups=this.options.groups.filter(n=>!e.includes(n.name)),e.forEach(n=>{const s=this.graphs[n];this.unregisterGraphEvents(s),s.dispose(),delete this.graphs[n];const o=this.groups[n];qt(o),delete this.groups[n]}))}initContainer(){this.container=document.createElement("div"),Q(this.container,this.prefixClassName(ee.base)),W(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),Q(this.content,this.prefixClassName(ee.content)),Xt(this.content,this.container)}buildGraphConfig(t){const e=this.options.stencilGraphOptions||{},n=t==null?void 0:t.graphOptions,s=Object.assign(Object.assign({},e),n);s.panning==null&&(s.panning=!1);const o=t&&t.graphWidth||this.options.stencilGraphWidth,r=t&&t.graphHeight||this.options.stencilGraphHeight,a=s.model||new Ht;return{mergedGraphOptions:s,width:o,height:r,model:a}}createStencilGraph(t,e,n,s){const o=new B(Object.assign(Object.assign({},t),{container:document.createElement("div"),model:s,width:e,height:n,interacting:!1,preventDefaultBlankAction:!1}));return this.registerGraphEvents(o),o}initSearch(){this.options.search&&(Q(this.container,"searchable"),Ot(this.container,this.renderSearch()))}initGroup(t){const e=document.createElement("div");Q(e,this.prefixClassName(ee.group)),W(e,"data-name",t.name),(t.collapsable==null&&this.options.collapsable||t.collapsable!==!1)&&Q(e,"collapsable"),le(e,"collapsed",t.collapsed===!0);const n=document.createElement("h3");Q(n,this.prefixClassName(ee.groupTitle)),n.innerHTML=t.title||t.name;const s=document.createElement("div");Q(s,this.prefixClassName(ee.groupContent));const{mergedGraphOptions:o,width:r,height:a,model:l}=this.buildGraphConfig(t),c=this.createStencilGraph(o,r,a,l);Ot(s,c.container),Ot(e,[n,s]),Xt(e,this.content),this.groups[t.name]=e,this.graphs[t.name]=c}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(t=>{this.initGroup(t)});else{const{mergedGraphOptions:t,width:e,height:n,model:s}=this.buildGraphConfig(),o=this.createStencilGraph(t,e,n,s);Ot(this.content,o.container),this.graphs[Rr]=o}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(t=>t.collapsable!==!1),this.options.collapsable?(Q(this.container,"collapsable"),this.options.groups&&this.options.groups.every(e=>e.collapsed||e.collapsable===!1)?Q(this.container,"collapsed"):lt(this.container,"collapsed")):lt(this.container,"collapsable")}setTitle(){const t=document.createElement("div");Q(t,this.prefixClassName(ee.title)),t.innerHTML=this.options.title,Xt(t,this.container)}renderSearch(){const t=document.createElement("div");Q(t,this.prefixClassName(ee.search));const e=document.createElement("input");return W(e,{type:"search",placeholder:this.options.placeholder||"Search"}),Q(e,this.prefixClassName(ee.searchText)),Ot(t,e),t}startListening(){const t=this.prefixClassName(ee.title),e=this.prefixClassName(ee.searchText),n=this.prefixClassName(ee.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${n}`]:"onGroupTitleClick",[`touchstart .${n}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(t){t.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(t){t.off("cell:mousedown",this.onDragStart,this)}loadGroup(t,e,n){const s=this.getModel(e);if(s){const l=t.map(c=>It.isNode(c)?c:It.create(c));n===!0?s.removeCells(l):s.resetCells(l)}const o=this.getGroup(e);let r=this.options.stencilGraphHeight;o&&o.graphHeight!=null&&(r=o.graphHeight);const a=o&&o.layout||this.options.layout;if(a&&s&&F(a,this,s,o),!r){const l=this.getGraph(e);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:o&&o.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e,node:n}=t,s=this.getGroupByNode(n);if(s&&s.nodeMovable===!1)return;const o=this.getGraph(s?s.name:void 0),r=o&&typeof o.isPannable=="function"?o.isPannable():!1;r&&o.disablePanning();const a=()=>{r&&o.enablePanning(),this.undelegateDocumentEvents()};this.delegateDocumentEvents({mouseup:a,touchend:a,touchcancel:a}),this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce((s,o)=>{const r=this.graphs[o],a=o===Rr?null:o,l=r.model.getNodes().filter(g=>{let f=!1;typeof e=="function"?f=F(e,this,g,t,a,this):typeof e=="boolean"?f=e:f=this.isCellMatched(g,t,e,t.toLowerCase()!==t);const p=r.renderer.findViewByCell(g);return p&&le(p.container,"unmatched",!f),f}),c=l.length>0,h=this.options,u=new Ht;return u.resetCells(l),h.layout&&F(h.layout,this,u,this.getGroup(o)),this.groups[o]&&le(this.groups[o],"unmatched",!c),r.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),s||c},!1);le(this.container,"not-found",!n)}isCellMatched(t,e,n,s){return e&&n?Object.keys(n).some(o=>{if(o==="*"||t.shape===o){const r=n[o];return typeof r=="boolean"?r:(Array.isArray(r)?r:[r]).some(l=>{let c=t.getPropByPath(l);return c!=null?(c=`${c}`,s||(c=c.toLowerCase()),c.indexOf(e)>=0):!1})}return!1}):!0}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){Q(this.container,"is-focused")}onSearchFocusOut(){lt(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(le(this.container,"collapsed"),ge(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=t.target.closest(`.${this.prefixClassName(ee.group)}`);e&&this.toggleGroup(W(e,"data-name")||"");const n=Object.keys(this.groups).every(s=>{const o=this.getGroup(s),r=this.groups[s];return o&&o.collapsable===!1||ge(r,"collapsed")});le(this.container,"collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||Rr]}getGroup(t){const e=this.options.groups;return t!=null&&e&&e.length?e.find(n=>n.name===t):null}getGroupByNode(t){const e=this.options.groups;return e?e.find(n=>{const s=this.getModel(n.name);return s?s.has(t.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];this.unregisterGraphEvents(e),e.dispose()}),Object.keys(this.groups).forEach(t=>{const e=this.groups[t];qt(e)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Ie(this.name)}}$([Z()],fx.prototype,"dispose",null);class Ad extends Gt{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(t){super();const{graph:e}=t,n=Y(t,["graph"]);this.graph=e,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t}render(){const t=this.containerWrapper=new U("svg"),e=this.horizontal=new U("line"),n=this.vertical=new U("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){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"})}stopListening(){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()}onBatchStop({name:t,data:e}){t==="resize"&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const s=t.getDelegatedView();if(s&&this.isNodeMovable(s)){const o=t.cell.getPosition();this.offset={x:e-o.x,y:n-o.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?F(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const s=t.getBBox(),o=s.bbox(t.getAngle()),r=o.getTopLeft(),a=o.getBottomRight(),l=Vt(t.getAngle()),c=this.options.tolerance||0;let h,u,g,f,p,m;const b={vertical:0,horizontal:0},y=e.direction,C=e.trueDirection,w=e.relativeDirection;C.indexOf("right")!==-1?b.vertical=a.x:b.vertical=r.x,C.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=r.y,this.model.getNodes().some(D=>{if(this.isIgnored(t,D))return!1;const K=D.getBBox().bbox(D.getAngle()),L=K.getTopLeft(),N=K.getBottomRight(),j={vertical:[L.x,N.x],horizontal:[L.y,N.y]},rt={};return Object.keys(j).forEach(Ct=>{const pt=Ct,ct=j[pt].map(V=>({position:V,distance:Math.abs(V-b[pt])})).filter(V=>V.distance<=c);rt[pt]=wo(ct,V=>V.distance)}),h==null&&rt.vertical.length>0&&(h=rt.vertical[0].position,u=Math.min(o.y,K.y),g=Math.max(a.y,N.y)-u),f==null&&rt.horizontal.length>0&&(f=rt.horizontal[0].position,p=Math.min(o.x,K.x),m=Math.max(a.x,N.x)-p),h!=null&&f!=null}),this.hide();let x=0,E=0;(f!=null||h!=null)&&(h!=null&&(x=C.indexOf("right")!==-1?h-a.x:r.x-h),f!=null&&(E=C.indexOf("bottom")!==-1?f-a.y:r.y-f));let S=0,v=0;if(l%90===0)l===90||l===270?(S=E,v=x):(S=x,v=E);else{const D=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;f!=null&&h!=null&&(x<E?(E=0,f=void 0):(x=0,h=void 0));const K=Dt(l%90);x&&(S=D===3?x/Math.cos(K):x/Math.sin(K)),E&&(v=D===3?E/Math.cos(K):E/Math.sin(K));const L=D===1||D===3;switch(w){case"top":case"bottom":v=E?E/(L?Math.cos(K):Math.sin(K)):x/(L?Math.sin(K):Math.cos(K));break;case"left":case"right":S=x?x/(L?Math.cos(K):Math.sin(K)):E/(L?Math.sin(K):Math.cos(K));break}}switch(w){case"top":case"bottom":S=0;break;case"left":case"right":v=0;break}const M=this.graph.getGridSize();let k=Math.max(s.width+S,M),I=Math.max(s.height+v,M);e.minWidth&&e.minWidth>M&&(k=Math.max(k,e.minWidth)),e.minHeight&&e.minHeight>M&&(I=Math.max(I,e.minHeight)),e.maxWidth&&(k=Math.min(k,e.maxWidth)),e.maxHeight&&(I=Math.min(I,e.maxHeight)),e.preserveAspectRatio&&(v<S?I=k*(s.height/s.width):k=I*(s.width/s.height)),(k!==s.width||I!==s.height)&&(t.resize(k,I,{direction:y,relativeDirection:w,trueDirection:C,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),g&&(g+=I-s.height),m&&(m+=k-s.width));const O=t.getBBox().bbox(l);h&&Math.abs(O.x-h)>1&&Math.abs(O.width+O.x-h)>1&&(h=void 0),f&&Math.abs(O.y-f)>1&&Math.abs(O.height+O.y-f)>1&&(f=void 0),this.update({verticalLeft:h,verticalTop:u,verticalHeight:g,horizontalTop:f,horizontalLeft:p,horizontalWidth:m})}}}snapOnMoving({view:t,e,x:n,y:s}){const o=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(o))return;const r=o.cell,a=r.getSize(),l=r.getPosition(),c=new P(n-this.offset.x,s-this.offset.y,a.width,a.height),h=r.getAngle(),u=c.getCenter(),g=c.bbox(h),f=g.getTopLeft(),p=g.getBottomRight(),m=this.options.tolerance||0;let b,y,C,w,x,E,S=0,v=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(r,M))return!1;const k=M.getBBox().bbox(M.getAngle()),I=k.getCenter(),O=k.getTopLeft(),D=k.getBottomRight();return b==null&&(Math.abs(I.x-u.x)<m?(b=I.x,S=.5):Math.abs(O.x-f.x)<m?(b=O.x,S=0):Math.abs(O.x-p.x)<m?(b=O.x,S=1):Math.abs(D.x-p.x)<m?(b=D.x,S=1):Math.abs(D.x-f.x)<m&&(b=D.x),b!=null&&(y=Math.min(g.y,k.y),C=Math.max(p.y,D.y)-y)),w==null&&(Math.abs(I.y-u.y)<m?(w=I.y,v=.5):Math.abs(O.y-f.y)<m?w=O.y:Math.abs(O.y-p.y)<m?(w=O.y,v=1):Math.abs(D.y-p.y)<m?(w=D.y,v=1):Math.abs(D.y-f.y)<m&&(w=D.y),w!=null&&(x=Math.min(g.x,k.x),E=Math.max(p.x,D.x)-x)),b!=null&&w!=null}),this.hide(),w!=null||b!=null){w!=null&&(g.y=w-v*g.height),b!=null&&(g.x=b-S*g.width);const M=g.getCenter(),k=M.x-c.width/2,I=M.y-c.height/2,O=k-l.x,D=I-l.y;(O!==0||D!==0)&&(r.translate(O,D,{snapped:!0,restrict:this.getRestrictArea(o)}),E&&(E+=O),C&&(C+=D)),this.update({verticalLeft:b,verticalTop:y,verticalHeight:C,horizontalTop:w,horizontalLeft:x,horizontalWidth:E})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||!this.filter(e)}filter(t){const e=this.options.filter;return Array.isArray(e)?e.some(n=>typeof n=="string"?t.shape===n:t.id===n.id):typeof e=="function"?F(e,this.graph,t):!0}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new A(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new A(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new A(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new A(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e=typeof t=="number"?t:t!==!1?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}$([Z()],Ad.prototype,"dispose",null);const px=`.x6-widget-snapline {
|
|
668
|
+
`,te={base:"widget-stencil",title:"widget-stencil-title",search:"widget-stencil-search",searchText:"widget-stencil-search-text",content:"widget-stencil-content",group:"widget-stencil-group",groupTitle:"widget-stencil-group-title",groupContent:"widget-stencil-group-content"},Rr="__default__",gx=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(i,t){const e={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};ux(i,Object.assign(Object.assign(Object.assign({},e),this.options.layoutOptions),t?t.layoutOptions:{}))}},nd);class fx extends jt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(t={}){super(),this.name="stencil",Te(this.name,dx),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},gx),t),this.init()}init(){this.dnd=new Or(this.options),this.onSearch=Xi(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n)}),this}unload(t,e){return Array.isArray(t)?this.loadGroup(t,e,!0):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n,!0)}),this}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),Q(e,"collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),lt(e,"collapsed"))}return this}isGroupCollapsable(t){const e=this.groups[t];return ge(e,"collapsable")}isGroupCollapsed(t){const e=this.groups[t];return e&&ge(e,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(t=>{this.collapseGroup(t)}),this}expandGroups(){return Object.keys(this.groups).forEach(t=>{this.expandGroup(t)}),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}addGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups?this.options.groups.push(...e):this.options.groups=e,e.forEach(n=>{this.initGroup(n)})}removeGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups&&(this.options.groups=this.options.groups.filter(n=>!e.includes(n.name)),e.forEach(n=>{const s=this.graphs[n];this.unregisterGraphEvents(s),s.dispose(),delete this.graphs[n];const o=this.groups[n];Wt(o),delete this.groups[n]}))}initContainer(){this.container=document.createElement("div"),Q(this.container,this.prefixClassName(te.base)),W(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),Q(this.content,this.prefixClassName(te.content)),qt(this.content,this.container)}buildGraphConfig(t){const e=this.options.stencilGraphOptions||{},n=t==null?void 0:t.graphOptions,s=Object.assign(Object.assign({},e),n);s.panning==null&&(s.panning=!1);const o=t&&t.graphWidth||this.options.stencilGraphWidth,r=t&&t.graphHeight||this.options.stencilGraphHeight,a=s.model||new Yt;return{mergedGraphOptions:s,width:o,height:r,model:a}}createStencilGraph(t,e,n,s){const o=new B(Object.assign(Object.assign({},t),{container:document.createElement("div"),model:s,width:e,height:n,interacting:!1,preventDefaultBlankAction:!1}));return this.registerGraphEvents(o),o}initSearch(){this.options.search&&(Q(this.container,"searchable"),Nt(this.container,this.renderSearch()))}initGroup(t){const e=document.createElement("div");Q(e,this.prefixClassName(te.group)),W(e,"data-name",t.name),(t.collapsable==null&&this.options.collapsable||t.collapsable!==!1)&&Q(e,"collapsable"),ae(e,"collapsed",t.collapsed===!0);const n=document.createElement("h3");Q(n,this.prefixClassName(te.groupTitle)),n.innerHTML=t.title||t.name;const s=document.createElement("div");Q(s,this.prefixClassName(te.groupContent));const{mergedGraphOptions:o,width:r,height:a,model:l}=this.buildGraphConfig(t),c=this.createStencilGraph(o,r,a,l);Nt(s,c.container),Nt(e,[n,s]),qt(e,this.content),this.groups[t.name]=e,this.graphs[t.name]=c}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(t=>{this.initGroup(t)});else{const{mergedGraphOptions:t,width:e,height:n,model:s}=this.buildGraphConfig(),o=this.createStencilGraph(t,e,n,s);Nt(this.content,o.container),this.graphs[Rr]=o}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(t=>t.collapsable!==!1),this.options.collapsable?(Q(this.container,"collapsable"),this.options.groups&&this.options.groups.every(e=>e.collapsed||e.collapsable===!1)?Q(this.container,"collapsed"):lt(this.container,"collapsed")):lt(this.container,"collapsable")}setTitle(){const t=document.createElement("div");Q(t,this.prefixClassName(te.title)),t.innerHTML=this.options.title,qt(t,this.container)}renderSearch(){const t=document.createElement("div");Q(t,this.prefixClassName(te.search));const e=document.createElement("input");return W(e,{type:"search",placeholder:this.options.placeholder||"Search"}),Q(e,this.prefixClassName(te.searchText)),Nt(t,e),t}startListening(){const t=this.prefixClassName(te.title),e=this.prefixClassName(te.searchText),n=this.prefixClassName(te.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${n}`]:"onGroupTitleClick",[`touchstart .${n}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(t){t.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(t){t.off("cell:mousedown",this.onDragStart,this)}loadGroup(t,e,n){const s=this.getModel(e);if(s){const l=t.map(c=>Pt.isNode(c)?c:Pt.create(c));n===!0?s.removeCells(l):s.resetCells(l)}const o=this.getGroup(e);let r=this.options.stencilGraphHeight;o&&o.graphHeight!=null&&(r=o.graphHeight);const a=o&&o.layout||this.options.layout;if(a&&s&&F(a,this,s,o),!r){const l=this.getGraph(e);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:o&&o.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e,node:n}=t,s=this.getGroupByNode(n);if(s&&s.nodeMovable===!1)return;const o=this.getGraph(s?s.name:void 0),r=o&&typeof o.isPannable=="function"?o.isPannable():!1;r&&o.disablePanning();const a=()=>{r&&o.enablePanning(),this.undelegateDocumentEvents()};this.delegateDocumentEvents({mouseup:a,touchend:a,touchcancel:a}),this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce((s,o)=>{const r=this.graphs[o],a=o===Rr?null:o,l=r.model.getNodes().filter(g=>{let f=!1;typeof e=="function"?f=F(e,this,g,t,a,this):typeof e=="boolean"?f=e:f=this.isCellMatched(g,t,e,t.toLowerCase()!==t);const p=r.renderer.findViewByCell(g);return p&&ae(p.container,"unmatched",!f),f}),c=l.length>0,h=this.options,u=new Yt;return u.resetCells(l),h.layout&&F(h.layout,this,u,this.getGroup(o)),this.groups[o]&&ae(this.groups[o],"unmatched",!c),r.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),s||c},!1);ae(this.container,"not-found",!n)}isCellMatched(t,e,n,s){return e&&n?Object.keys(n).some(o=>{if(o==="*"||t.shape===o){const r=n[o];return typeof r=="boolean"?r:(Array.isArray(r)?r:[r]).some(l=>{let c=t.getPropByPath(l);return c!=null?(c=`${c}`,s||(c=c.toLowerCase()),c.indexOf(e)>=0):!1})}return!1}):!0}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){Q(this.container,"is-focused")}onSearchFocusOut(){lt(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(ae(this.container,"collapsed"),ge(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=t.target.closest(`.${this.prefixClassName(te.group)}`);e&&this.toggleGroup(W(e,"data-name")||"");const n=Object.keys(this.groups).every(s=>{const o=this.getGroup(s),r=this.groups[s];return o&&o.collapsable===!1||ge(r,"collapsed")});ae(this.container,"collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||Rr]}getGroup(t){const e=this.options.groups;return t!=null&&e&&e.length?e.find(n=>n.name===t):null}getGroupByNode(t){const e=this.options.groups;return e?e.find(n=>{const s=this.getModel(n.name);return s?s.has(t.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];this.unregisterGraphEvents(e),e.dispose()}),Object.keys(this.groups).forEach(t=>{const e=this.groups[t];Wt(e)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Ie(this.name)}}X([$()],fx.prototype,"dispose",null);class Ad extends jt{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(t){super();const{graph:e}=t,n=Y(t,["graph"]);this.graph=e,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t}render(){const t=this.containerWrapper=new U("svg"),e=this.horizontal=new U("line"),n=this.vertical=new U("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){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"})}stopListening(){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()}onBatchStop({name:t,data:e}){t==="resize"&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const s=t.getDelegatedView();if(s&&this.isNodeMovable(s)){const o=t.cell.getPosition();this.offset={x:e-o.x,y:n-o.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?F(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const s=t.getBBox(),o=s.bbox(t.getAngle()),r=o.getTopLeft(),a=o.getBottomRight(),l=Vt(t.getAngle()),c=this.options.tolerance||0;let h,u,g,f,p,m;const b={vertical:0,horizontal:0},y=e.direction,w=e.trueDirection,C=e.relativeDirection;w.indexOf("right")!==-1?b.vertical=a.x:b.vertical=r.x,w.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=r.y,this.model.getNodes().some(R=>{if(this.isIgnored(t,R))return!1;const K=R.getBBox().bbox(R.getAngle()),D=K.getTopLeft(),N=K.getBottomRight(),j={vertical:[D.x,N.x],horizontal:[D.y,N.y]},rt={};return Object.keys(j).forEach(Ct=>{const pt=Ct,ct=j[pt].map(V=>({position:V,distance:Math.abs(V-b[pt])})).filter(V=>V.distance<=c);rt[pt]=wo(ct,V=>V.distance)}),h==null&&rt.vertical.length>0&&(h=rt.vertical[0].position,u=Math.min(o.y,K.y),g=Math.max(a.y,N.y)-u),f==null&&rt.horizontal.length>0&&(f=rt.horizontal[0].position,p=Math.min(o.x,K.x),m=Math.max(a.x,N.x)-p),h!=null&&f!=null}),this.hide();let x=0,E=0;(f!=null||h!=null)&&(h!=null&&(x=w.indexOf("right")!==-1?h-a.x:r.x-h),f!=null&&(E=w.indexOf("bottom")!==-1?f-a.y:r.y-f));let S=0,v=0;if(l%90===0)l===90||l===270?(S=E,v=x):(S=x,v=E);else{const R=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;f!=null&&h!=null&&(x<E?(E=0,f=void 0):(x=0,h=void 0));const K=Dt(l%90);x&&(S=R===3?x/Math.cos(K):x/Math.sin(K)),E&&(v=R===3?E/Math.cos(K):E/Math.sin(K));const D=R===1||R===3;switch(C){case"top":case"bottom":v=E?E/(D?Math.cos(K):Math.sin(K)):x/(D?Math.sin(K):Math.cos(K));break;case"left":case"right":S=x?x/(D?Math.cos(K):Math.sin(K)):E/(D?Math.sin(K):Math.cos(K));break}}switch(C){case"top":case"bottom":S=0;break;case"left":case"right":v=0;break}const M=this.graph.getGridSize();let k=Math.max(s.width+S,M),I=Math.max(s.height+v,M);e.minWidth&&e.minWidth>M&&(k=Math.max(k,e.minWidth)),e.minHeight&&e.minHeight>M&&(I=Math.max(I,e.minHeight)),e.maxWidth&&(k=Math.min(k,e.maxWidth)),e.maxHeight&&(I=Math.min(I,e.maxHeight)),e.preserveAspectRatio&&(v<S?I=k*(s.height/s.width):k=I*(s.width/s.height)),(k!==s.width||I!==s.height)&&(t.resize(k,I,{direction:y,relativeDirection:C,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),g&&(g+=I-s.height),m&&(m+=k-s.width));const O=t.getBBox().bbox(l);h&&Math.abs(O.x-h)>1&&Math.abs(O.width+O.x-h)>1&&(h=void 0),f&&Math.abs(O.y-f)>1&&Math.abs(O.height+O.y-f)>1&&(f=void 0),this.update({verticalLeft:h,verticalTop:u,verticalHeight:g,horizontalTop:f,horizontalLeft:p,horizontalWidth:m})}}}snapOnMoving({view:t,e,x:n,y:s}){const o=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(o))return;const r=o.cell,a=r.getSize(),l=r.getPosition(),c=new P(n-this.offset.x,s-this.offset.y,a.width,a.height),h=r.getAngle(),u=c.getCenter(),g=c.bbox(h),f=g.getTopLeft(),p=g.getBottomRight(),m=this.options.tolerance||0;let b,y,w,C,x,E,S=0,v=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(r,M))return!1;const k=M.getBBox().bbox(M.getAngle()),I=k.getCenter(),O=k.getTopLeft(),R=k.getBottomRight();return b==null&&(Math.abs(I.x-u.x)<m?(b=I.x,S=.5):Math.abs(O.x-f.x)<m?(b=O.x,S=0):Math.abs(O.x-p.x)<m?(b=O.x,S=1):Math.abs(R.x-p.x)<m?(b=R.x,S=1):Math.abs(R.x-f.x)<m&&(b=R.x),b!=null&&(y=Math.min(g.y,k.y),w=Math.max(p.y,R.y)-y)),C==null&&(Math.abs(I.y-u.y)<m?(C=I.y,v=.5):Math.abs(O.y-f.y)<m?C=O.y:Math.abs(O.y-p.y)<m?(C=O.y,v=1):Math.abs(R.y-p.y)<m?(C=R.y,v=1):Math.abs(R.y-f.y)<m&&(C=R.y),C!=null&&(x=Math.min(g.x,k.x),E=Math.max(p.x,R.x)-x)),b!=null&&C!=null}),this.hide(),C!=null||b!=null){C!=null&&(g.y=C-v*g.height),b!=null&&(g.x=b-S*g.width);const M=g.getCenter(),k=M.x-c.width/2,I=M.y-c.height/2,O=k-l.x,R=I-l.y;(O!==0||R!==0)&&(r.translate(O,R,{snapped:!0,restrict:this.getRestrictArea(o)}),E&&(E+=O),w&&(w+=R)),this.update({verticalLeft:b,verticalTop:y,verticalHeight:w,horizontalTop:C,horizontalLeft:x,horizontalWidth:E})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||!this.filter(e)}filter(t){const e=this.options.filter;return Array.isArray(e)?e.some(n=>typeof n=="string"?t.shape===n:t.id===n.id):typeof e=="function"?F(e,this.graph,t):!0}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new A(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new A(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new A(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new A(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e=typeof t=="number"?t:t!==!1?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}X([$()],Ad.prototype,"dispose",null);const px=`.x6-widget-snapline {
|
|
669
669
|
position: absolute;
|
|
670
670
|
top: 0;
|
|
671
671
|
right: 0;
|
|
@@ -678,7 +678,7 @@
|
|
|
678
678
|
stroke: #2ecc71;
|
|
679
679
|
stroke-width: 1px;
|
|
680
680
|
}
|
|
681
|
-
`;B.prototype.isSnaplineEnabled=function(){const i=this.getPlugin("snapline");return i?i.isEnabled():!1},B.prototype.enableSnapline=function(){const i=this.getPlugin("snapline");return i&&i.enable(),this},B.prototype.disableSnapline=function(){const i=this.getPlugin("snapline");return i&&i.disable(),this},B.prototype.toggleSnapline=function(){const i=this.getPlugin("snapline");return i&&i.toggleEnabled(),this},B.prototype.hideSnapline=function(){const i=this.getPlugin("snapline");return i&&i.hide(),this},B.prototype.setSnaplineFilter=function(i){const t=this.getPlugin("snapline");return t&&t.setFilter(i),this},B.prototype.isSnaplineOnResizingEnabled=function(){const i=this.getPlugin("snapline");return i?i.isOnResizingEnabled():!1},B.prototype.enableSnaplineOnResizing=function(){const i=this.getPlugin("snapline");return i&&i.enableOnResizing(),this},B.prototype.disableSnaplineOnResizing=function(){const i=this.getPlugin("snapline");return i&&i.disableOnResizing(),this},B.prototype.toggleSnaplineOnResizing=function(i){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(i),this},B.prototype.isSharpSnapline=function(){const i=this.getPlugin("snapline");return i?i.isSharp():!1},B.prototype.enableSharpSnapline=function(){const i=this.getPlugin("snapline");return i&&i.enableSharp(),this},B.prototype.disableSharpSnapline=function(){const i=this.getPlugin("snapline");return i&&i.disableSharp(),this},B.prototype.toggleSharpSnapline=function(i){const t=this.getPlugin("snapline");return t&&t.toggleSharp(i),this},B.prototype.getSnaplineTolerance=function(){const i=this.getPlugin("snapline");if(i)return i.getTolerance()},B.prototype.setSnaplineTolerance=function(i){const t=this.getPlugin("snapline");return t&&t.setTolerance(i),this};class xd extends vn{constructor(t={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},t),Te(this.name,px)}init(t){this.snaplineImpl=new Ad(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(t){if(t!=null)t!==this.isEnabled()&&(t?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(t){return this.snaplineImpl.setFilter(t),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(t){return t!=null?t!==this.isOnResizingEnabled()&&(t?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(t){return t!=null?t!==this.isSharp()&&(t?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(t){return this.snaplineImpl.options.tolerance=t,this}captureCursorOffset(t){this.snaplineImpl.captureCursorOffset(t)}snapOnMoving(t){this.snaplineImpl.snapOnMoving(t)}dispose(){this.snaplineImpl.dispose(),Ie(this.name)}}
|
|
681
|
+
`;B.prototype.isSnaplineEnabled=function(){const i=this.getPlugin("snapline");return i?i.isEnabled():!1},B.prototype.enableSnapline=function(){const i=this.getPlugin("snapline");return i&&i.enable(),this},B.prototype.disableSnapline=function(){const i=this.getPlugin("snapline");return i&&i.disable(),this},B.prototype.toggleSnapline=function(){const i=this.getPlugin("snapline");return i&&i.toggleEnabled(),this},B.prototype.hideSnapline=function(){const i=this.getPlugin("snapline");return i&&i.hide(),this},B.prototype.setSnaplineFilter=function(i){const t=this.getPlugin("snapline");return t&&t.setFilter(i),this},B.prototype.isSnaplineOnResizingEnabled=function(){const i=this.getPlugin("snapline");return i?i.isOnResizingEnabled():!1},B.prototype.enableSnaplineOnResizing=function(){const i=this.getPlugin("snapline");return i&&i.enableOnResizing(),this},B.prototype.disableSnaplineOnResizing=function(){const i=this.getPlugin("snapline");return i&&i.disableOnResizing(),this},B.prototype.toggleSnaplineOnResizing=function(i){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(i),this},B.prototype.isSharpSnapline=function(){const i=this.getPlugin("snapline");return i?i.isSharp():!1},B.prototype.enableSharpSnapline=function(){const i=this.getPlugin("snapline");return i&&i.enableSharp(),this},B.prototype.disableSharpSnapline=function(){const i=this.getPlugin("snapline");return i&&i.disableSharp(),this},B.prototype.toggleSharpSnapline=function(i){const t=this.getPlugin("snapline");return t&&t.toggleSharp(i),this},B.prototype.getSnaplineTolerance=function(){const i=this.getPlugin("snapline");if(i)return i.getTolerance()},B.prototype.setSnaplineTolerance=function(i){const t=this.getPlugin("snapline");return t&&t.setTolerance(i),this};class xd extends vn{constructor(t={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},t),Te(this.name,px)}init(t){this.snaplineImpl=new Ad(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(t){if(t!=null)t!==this.isEnabled()&&(t?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(t){return this.snaplineImpl.setFilter(t),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(t){return t!=null?t!==this.isOnResizingEnabled()&&(t?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(t){return t!=null?t!==this.isSharp()&&(t?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(t){return this.snaplineImpl.options.tolerance=t,this}captureCursorOffset(t){this.snaplineImpl.captureCursorOffset(t)}snapOnMoving(t){this.snaplineImpl.snapOnMoving(t)}dispose(){this.snaplineImpl.dispose(),Ie(this.name)}}X([$()],xd.prototype,"dispose",null);const mx=`.x6-widget-transform {
|
|
682
682
|
position: absolute;
|
|
683
683
|
box-sizing: content-box !important;
|
|
684
684
|
margin: -5px 0 0 -5px;
|
|
@@ -804,7 +804,7 @@
|
|
|
804
804
|
display: block;
|
|
805
805
|
background-color: #808080;
|
|
806
806
|
}
|
|
807
|
-
`,vd="has-widget-transform",In=["nw","n","ne","e","se","s","sw","w"],Ze=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],bx={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0};class Ed extends Gt{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(t,e,n){super(),this.node=e,this.graph=n,this.options=Object.assign(Object.assign({},bx),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),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)}stopListening(){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)}renderHandles(){this.container=document.createElement("div");const t=document.createElement("div");W(t,"draggable","false");const e=t.cloneNode(!0);Q(e,this.rotateClassName);const n=Ze.map(s=>{const o=t.cloneNode(!0);return Q(o,this.resizeClassName),W(o,"data-position",s),o});this.empty(),Ot(this.container,[...n,e])}render(){return this.renderHandles(),this.view&&this.view.addClass(vd),Q(this.container,this.containerClassName),le(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),le(this.container,"no-resize",!this.options.resizable),le(this.container,"no-rotate",!this.options.rotatable),this.options.className&&Q(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=Vt(this.node.getAngle()),s=n!==0?`rotate(${n}deg)`:"";return nt(this.container,{transform:s,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(vd),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Vt(this.node.getAngle()),e=Math.floor(t*(In.length/360));if(e!==this.prevShift){const n=In.slice(e).concat(In.slice(0,e)),s=r=>`${this.containerClassName}-cursor-${r}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((r,a)=>{lt(r,In.map(l=>s(l)).join(" ")),Q(r,s(n[a]))}),this.prevShift=e}}getTrueDirection(t){const e=Vt(this.node.getAngle());let n=Ze.indexOf(t);return n+=Math.floor(e*(Ze.length/360)),n%=Ze.length,Ze[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=W(t.target,"data-position");this.prepareResizing(t,e),this.startAction(t)}prepareResizing(t,e){const n=this.getTrueDirection(e);let s=0,o=0;e.split("-").forEach(c=>{s={left:-1,right:1}[c]||s,o={top:-1,bottom:1}[c]||o});const r=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[r],l=Vt(this.node.getAngle());this.setEventData(t,{selector:a,direction:r,trueDirection:n,relativeDirection:e,angle:l,resizeX:s,resizeY:o,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.node.getBBox().getCenter(),n=this.normalizeEvent(t),s=this.graph.snapToGrid(n.clientX,n.clientY);this.setEventData(t,{center:e,action:"rotating",angle:Vt(this.node.getAngle()),start:A.create(s).theta(e)}),this.startAction(t)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const s=this.normalizeEvent(t);let o=s.clientX,r=s.clientY;const a=this.graph.getPlugin("scroller"),l=this.options.restrictedResizing;if(l===!0||typeof l=="number"){const f=l===!0?0:l,p=a?Math.max(f,8):f,m=this.graph.container.getBoundingClientRect();o=Ye(o,m.left+p,m.right-p),r=Ye(r,m.top+p,m.bottom-p)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,r);const c=this.graph.snapToGrid(o,r),h=this.graph.getGridSize(),u=this.node,g=this.options;if(n.action==="resizing"){n=n,n.resized||(e&&(e.addClass("node-resizing"),this.notify("node:resize",t,e)),n.resized=!0);const f=u.getBBox(),p=A.create(c).rotate(n.angle,f.getCenter()).diff(f[n.selector]);let m=n.resizeX?p.x*n.resizeX:f.width,b=n.resizeY?p.y*n.resizeY:f.height;const y=m,C=b;if(m=ae(m,h),b=ae(b,h),m=Math.max(m,g.minWidth||h),b=Math.max(b,g.minHeight||h),m=Math.min(m,g.maxWidth||1/0),b=Math.min(b,g.maxHeight||1/0),g.preserveAspectRatio){const x=f.width*b/f.height,E=f.height*m/f.width;m<x?b=E:m=x}const w=n.relativeDirection;if(g.allowReverse&&(y<=-m||C<=-b)){let x;w==="left"?y<=-m&&(x="right"):w==="right"?y<=-m&&(x="left"):w==="top"?C<=-b&&(x="bottom"):w==="bottom"?C<=-b&&(x="top"):w==="top-left"?y<=-m&&C<=-b?x="bottom-right":y<=-m?x="top-right":C<=-b&&(x="bottom-left"):w==="top-right"?y<=-m&&C<=-b?x="bottom-left":y<=-m?x="top-left":C<=-b&&(x="bottom-right"):w==="bottom-left"?y<=-m&&C<=-b?x="top-right":y<=-m?x="bottom-right":C<=-b&&(x="top-left"):w==="bottom-right"&&(y<=-m&&C<=-b?x="top-left":y<=-m?x="bottom-left":C<=-b&&(x="top-right"));const E=x;this.stopHandle();const S=this.container.querySelector(`.${this.resizeClassName}[data-position="${E}"]`);this.startHandle(S),this.prepareResizing(t,E),this.onMouseMove(t)}if(f.width!==m||f.height!==b){const x={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:g.minWidth,minHeight:g.minHeight,maxWidth:g.maxWidth,maxHeight:g.maxHeight,preserveAspectRatio:g.preserveAspectRatio===!0};u.resize(m,b,x),this.notify("node:resizing",t,e)}}else if(n.action==="rotating"){n=n,n.rotated||(e&&(e.addClass("node-rotating"),this.notify("node:rotate",t,e)),n.rotated=!0);const f=u.getAngle(),p=n.start-A.create(c).theta(n.center);let m=n.angle+p;g.rotateGrid&&(m=ae(m,g.rotateGrid)),m=Vt(m),f!==m&&(u.rotate(m,{absolute:!0}),this.notify("node:rotating",t,e))}}}onMouseUp(t){const e=this.getEventData(t);e.action&&(this.stopAction(t),this.model.stopBatch(e.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(t){if(this.handle=t||null,Q(this.container,`${this.containerClassName}-active`),t){Q(t,`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const n=In[Ze.indexOf(e)];Q(this.container,`${this.containerClassName}-cursor-${n}`)}}}stopHandle(){if(lt(this.container,`${this.containerClassName}-active`),this.handle){lt(this.handle,`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=In[Ze.indexOf(t)];lt(this.container,`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(wu,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass(`node-${n.action}`),n.action==="resizing"&&n.resized?this.notify("node:resized",t,e):n.action==="rotating"&&n.rotated&&this.notify("node:rotated",t,e))}notify(t,e,n,s={}){if(n){const o=n.graph,r=o.view.normalizeEvent(e),a=o.snapToGrid(r.clientX,r.clientY);this.trigger(t,Object.assign({e:r,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},s))}}dispose(){this.stopListening(),this.remove(),this.off()}}$([Z()],Ed.prototype,"dispose",null),B.prototype.createTransformWidget=function(i){const t=this.getPlugin("transform");return t&&t.createWidget(i),this},B.prototype.clearTransformWidgets=function(){const i=this.getPlugin("transform");return i&&i.clearWidgets(),this};class Sd extends Ft{constructor(t={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=t,Te(this.name,mx)}init(t){this.graph=t,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(t){this.clearWidgets();const e=this.createTransform(t);e&&(this.widgets.set(t,e),e.on("*",(n,s)=>{this.trigger(n,s),this.graph.trigger(n,s)}))}onNodeClick({node:t}){this.createWidget(t)}onBlankMouseDown(){this.clearWidgets()}createTransform(t){const e=this.getTransformOptions(t);return e.resizable||e.rotatable?new Ed(e,t,this.graph):null}parseOptionGroup(t,e,n){const s={};return Object.keys(n||{}).forEach(o=>{const r=n[o];s[o]=typeof r=="function"?r.call(t,e):r}),s}getTransformOptions(t){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const e=this.parseOptionGroup(this.graph,t,this.options.resizing),n=this.parseOptionGroup(this.graph,t,this.options.rotating);return{resizable:!!e.enabled,minWidth:e.minWidth||0,maxWidth:e.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:e.minHeight||0,maxHeight:e.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof e.orthogonal=="boolean"?e.orthogonal:!0,restrictedResizing:!!e.restrict,autoScrollOnResizing:typeof e.autoScroll=="boolean"?e.autoScroll:!0,preserveAspectRatio:!!e.preserveAspectRatio,allowReverse:typeof e.allowReverse=="boolean"?e.allowReverse:!0,rotatable:!!n.enabled,rotateGrid:n.grid||15}}clearWidgets(){this.widgets.forEach((t,e)=>{this.graph.getCellById(e.id)&&t.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Ie(this.name)}}$([Z()],Sd.prototype,"dispose",null);function Md(i){const t=Lt.getForeignObjectMarkup();return i?[{tagName:i,selector:"body"},t]:[t]}B.registerNode("vue-shape",{view:"vue-shape-view",markup:Md(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(i){if(i.markup==null){const t=i.primer;if(t){i.markup=Md(t);let e={};switch(t){case"circle":e={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":e={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}i.attrs=ft({},{body:Object.assign({refWidth:null,refHeight:null},e)},i.attrs||{})}}return i}},!0);var yx=function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(e[n[s]]=i[n[s]]);return e};const Bd={};function wx(i){const{shape:t,component:e,inherit:n}=i,s=yx(i,["shape","component","inherit"]);if(!t)throw new Error("should specify shape in config");Bd[t]={component:e},B.registerNode(t,Object.assign({inherit:n||"vue-shape"},s),!0)}let Oi=!1;const Fs=d.reactive({});function Cx(i,t,e,n,s){Oi&&(Fs[i]=d.markRaw(d.defineComponent({render:()=>d.h(d.Teleport,{to:e},[d.h(t,{node:n,graph:s})]),provide:()=>({getNode:()=>n,getGraph:()=>s})})))}function Ax(i){Oi&&delete Fs[i]}function kd(){return Oi}let Us=null;function Dr(){return Us&&Oi?null:(Oi=!0,Us=d.defineComponent({setup(){return d.onBeforeUnmount(()=>{Us=null}),()=>d.h(d.Fragment,{},Object.keys(Fs).map(i=>d.h(Fs[i])))}}),Us)}class tn extends te{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,tn.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,n=this.graph;if(t){const{component:s}=Bd[e.shape];s&&(kd()?Cx(this.targetId(),s,t,e,n):(this.vm=d.createApp({render(){return d.h(s,{node:e,graph:n})},provide(){return{getNode:()=>e,getGraph:()=>n}}}),this.vm.mount(t)))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,e,n){const s=t.target;if(s.tagName.toLowerCase()==="input"){const r=s.getAttribute("type");if(r==null||["text","password","number","email","search","tel","url"].includes(r))return}super.onMouseDown(t,e,n)}unmount(){return kd()&&Ax(this.targetId()),this.unmountVueComponent(),super.unmount(),this}}tn.action="vue",tn.config({bootstrap:[tn.action],actions:{component:tn.action}}),te.registry.register("vue-shape-view",tn,!0);const vt=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},xx=vt({__name:"vueNode",setup(i){d.useCssVars(l=>({d8dfc212:n.value.color,v6be3529f:n.value.opacity,v324d6579:n.value.borderStyle,v6de6f73f:n.value.borderWidth+"px",v3169772b:n.value.borderColor,v28e858fa:n.value.borderRadius+"px",v2fb97d69:n.value.backgroundColor}));let e=d.inject("getNode")();const n=d.ref(e.getData()),s=d.ref(128),o=d.ref(128),r=({current:l})=>{s.value=l.width,o.value=l.height},a=({current:l})=>{n.value={...n.value,...l}};return d.provide("x6NodeData",n),d.provide("width",s),d.provide("height",o),d.onMounted(()=>{s.value=e.size().width,o.value=e.size().height,e.on("change:data",a),e.on("change:size",r)}),d.onBeforeUnmount(()=>{e.off("change:data",a),e.off("change:size",r)}),(l,c)=>(d.openBlock(),d.createElementBlock("div",{style:d.normalizeStyle({width:s.value+"px",height:o.value+"px",backgroundImage:n.value.backgroundImage&&n.value.backgroundImage!=="none"?`url(${n.value.backgroundImage})`:"none"}),class:"vueNode"},[d.renderSlot(l.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-c87e42ba"]]),vx={class:"svgNode"},Ex=["xlink:href"],Sx=vt({__name:"svgNode",setup(i){d.inject("getNode");const t=d.inject("width"),e=d.inject("height"),n=d.inject("x6NodeData"),s=d.computed(()=>{var o;return{fontSize:`${Math.min(t.value,e.value)}px`,color:((o=n.value)==null?void 0:o.color)||"#ffffff"}});return d.onMounted(()=>{}),d.onBeforeUnmount(()=>{}),(o,r)=>(d.openBlock(),d.createElementBlock("div",vx,[(d.openBlock(),d.createElementBlock("svg",{class:"svg-icon","aria-hidden":"true",style:d.normalizeStyle(s.value)},[d.createElementVNode("use",{"xlink:href":"#"+d.unref(n).icon},null,8,Ex)],4))]))}},[["__scopeId","data-v-88b0fd56"]]),Mx=["title"],Bx=vt({__name:"textNode",setup(i){const t=d.inject("x6NodeData"),e=d.computed(()=>{const s=t.value||{};return{justifyContent:s.justifyContent||"center",alignItems:s.alignItems||"center",padding:s.padding||"0",overflow:s.overflow||"hidden",backgroundColor:"transparent"}}),n=d.computed(()=>{const s=t.value||{},o=s.textOverflow==="ellipsis",r=s.whiteSpace||(o?"nowrap":"pre-wrap"),a=!s.lineHeight&&s.lineHeight!==0?"1.4":typeof s.lineHeight=="number"?s.lineHeight<=10?`${s.lineHeight}`:`${s.lineHeight}px`:s.lineHeight;return{color:s.color||"#ffffff",fontWeight:s.fontWeight||400,fontSize:`${s.fontSize||16}px`,letterSpacing:`${s.letterSpacing||0}px`,fontFamily:s.fontFamily||"inherit",fontStyle:s.fontStyle||"normal",textDecoration:s.textDecoration||"none",textAlign:s.textAlign||"center",lineHeight:a,whiteSpace:r,wordBreak:s.wordBreak||"break-word",textOverflow:s.textOverflow||"clip",overflow:"hidden",display:s.display||"block"}});return(s,o)=>(d.openBlock(),d.createElementBlock("div",{class:"textNode",style:d.normalizeStyle(e.value),title:d.unref(t).text},[d.createElementVNode("span",{class:"textContent",style:d.normalizeStyle(n.value)},d.toDisplayString(d.unref(t).text),5)],12,Mx))}},[["__scopeId","data-v-98979c16"]]),kx={class:"formNode"},Tx=vt({__name:"formNode",setup(i){const t=d.inject("x6NodeData"),e=d.ref("");return(n,s)=>{const o=d.resolveComponent("el-input"),r=d.resolveComponent("el-option"),a=d.resolveComponent("el-select"),l=d.resolveComponent("el-date-picker"),c=d.resolveComponent("el-input-number"),h=d.resolveComponent("el-button");return d.openBlock(),d.createElementBlock("div",kx,[d.unref(t).type=="input"?(d.openBlock(),d.createBlock(o,{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=u=>e.value=u),clearable:""},null,8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="select"?(d.openBlock(),d.createBlock(a,{key:1,modelValue:e.value,"onUpdate:modelValue":s[1]||(s[1]=u=>e.value=u),clearable:"",style:{width:"100%"}},{default:d.withCtx(()=>[d.createVNode(r)]),_:1},8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="date"?(d.openBlock(),d.createBlock(l,{key:2,modelValue:e.value,"onUpdate:modelValue":s[2]||(s[2]=u=>e.value=u),type:"date",placeholder:"Pick a day",clearable:"",style:{width:"100%"}},null,8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="number"?(d.openBlock(),d.createBlock(c,{key:3,modelValue:e.value,"onUpdate:modelValue":s[3]||(s[3]=u=>e.value=u),controls:!1,clearable:"",style:{width:"100%"}},null,8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="button"?(d.openBlock(),d.createBlock(h,{key:4,type:"primary",style:{width:"100%"}},{default:d.withCtx(()=>[...s[4]||(s[4]=[d.createTextVNode("按钮",-1)])]),_:1})):d.createCommentVNode("",!0)])}}},[["__scopeId","data-v-1d6b54a4"]]),Ix={name:"",borderStyle:"none",borderRadius:0,borderWidth:0,borderColor:"#5F95FF",opacity:1,backgroundImage:"none",backgroundColor:"transparent",color:"#ffffff",dataSource:{bindName:["text"],type:"none",path:"",point:{},httpType:"GET",httpUrl:"",params:[],parse:null},model:{},status:[]},Lr={"svg-node":Sx,"text-node":Bx,"form-node":Tx},Qr=()=>{Object.keys(Lr).forEach(i=>{wx({shape:i,width:50,height:50,data:{...Ix},component:{render(){return d.h(xx,null,{default:()=>d.h(Lr[i])})}}})})},Td={Blank:"blank"},Pn=be.defineStore("property",{state:()=>({targetType:Td.Blank,cellId:null,tabs:["画布"],activeTab:0}),getters:{},actions:{setTarget(i,t){this.targetType=i,i===Td.Blank?this.tabs=["画布"]:this.tabs=["外观","数据","动画","状态","交互"],this.activeTab=0,this.cellId=t}}}),Vr={backgroundColor:"#6b6b6b26",backgroundImage:null},Kt=be.defineStore("editor-graph",{state:()=>({el:null,graph:null,dnd:null,style:{...Vr,width:1920,height:1080},name:"",id:"",zoom:100}),getters:{hasGraph:i=>!!i.graph},actions:{init(){if(this.el===null)return;this.graph&&this.graph.dispose(),this.graph=new B({container:this.el,autoResize:!0,mousewheel:{enabled:!0,factor:.1},panning:!1,scaling:{min:.5,max:2},background:{color:"#000000"},grid:{size:5,visible:!0,type:"mesh",args:{color:"rgba(100, 100, 100, 0.6)",thickness:1}},translating:{restrict:!0},connecting:{router:"orth",connector:{name:"normal"},args:{padding:0,direction:"H"},anchor:"center",connectionPoint:"anchor",allowBlank:!0,allowLoop:!1,allowMulti:!1,snap:{radius:20},validateConnection({targetMagnet:t}){return!!t}},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{fill:"#5F95FF",stroke:"#5F95FF"}}}}}),this.graph.use(new xd({enabled:!0}));const i=new wd({pageWidth:this.style.width,pageHeight:this.style.height,enabled:!0,pannable:!0,autoResize:!1});this.graph.use(i),this.dnd=new Or({target:this.graph,validateNode(){return!0}}),this.graph.use(new Sd({resizing:!0,rotating:!0})),this.graph.use(new Nu({enabled:!0})),this.graph.use(new hd({enabled:!0,global:!0})).use(new gd({rubberband:!0,showNodeSelectionBox:!0,showEdgeSelectionBox:!1,modifiers:["meta","shift","ctrl"]})).use(new od),Qr(),this.initEvent()},loadMenu({name:i,id:t,value:e,style:n}){if(!this.graph)return;this.name=i,this.id=t,this.graph.fromJSON(e||{}),n?this.style={...this.style,...Vr,...n}:this.style={...this.style,...Vr};const s=Math.min(1280/this.style.width,840/this.style.height);console.log(s,this.style.width,this.style.height),this.graph.zoomTo(s),setTimeout(()=>{this.graph.center(),console.log(this.graph.getScrollbarPosition()),Pn().setTarget("blank",null)},100)},setZoom(i){this.zoom=Number(i),this.graph.zoomTo(i)},updateSize(i,t,e){this.style.width=i,this.style.height=t,this.init(),setTimeout(()=>{e&&e()},100)},syncDataToAttrs(i){if(!i||Object.keys(Lr).includes(i.shape))return;const t=i.getData?i.getData()||{}:{},e={dashed:"6 4",dotted:"2 2",solid:null,none:null},n={};t.backgroundColor!==void 0&&(n.fill=t.backgroundColor),t.borderColor!==void 0&&(n.stroke=t.borderColor),t.borderWidth!==void 0&&(n.strokeWidth=t.borderWidth),t.borderStyle!==void 0&&e.hasOwnProperty(t.borderStyle)&&(t.borderStyle==="none"?(n.strokeDasharray=null,n.strokeWidth=0):n.strokeDasharray=e[t.borderStyle]),t.borderRadius!==void 0&&(n.rx=n.ry=t.borderRadius),t.opacity!==void 0&&(n.opacity=t.opacity);const s={};Object.keys(n).length&&(s.body=n),Object.keys(s).length&&i.setAttrs(s)},groupSelectedNodes(){if(!this.graph)return null;const i=this.graph.getSelectedCells(),t=i.filter(a=>a.isNode()&&!a.id.includes("group"));if(t.length<2)return null;const e=i.filter(a=>a.isNode()&&a.id.includes("group"));e.length>0&&this.graph.removeCells(e);const n=t.reduce((a,l)=>{const c=l.getBBox();return a.minX=Math.min(a.minX,c.x),a.minY=Math.min(a.minY,c.y),a.maxX=Math.max(a.maxX,c.x+c.width),a.maxY=Math.max(a.maxY,c.y+c.height),a},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),s=10,o=this.graph.addNode({id:`group-${Date.now()}`,shape:"rect",x:n.minX-s,y:n.minY-s,width:n.maxX-n.minX+s*2,height:n.maxY-n.minY+s*2,attrs:{body:{fill:"rgba(69, 131, 255, 0.08)",stroke:"#4583ff",strokeWidth:1,strokeDasharray:"6 4"}},data:{type:"group",name:"组合",opacity:1,borderStyle:"dashed",borderRadius:0,borderWidth:1,borderColor:"#4583ff",backgroundColor:"rgba(69, 131, 255, 0.08)"},zIndex:1e3});return t.forEach(a=>{o.addChild(a)}),this.graph.cleanSelection(),this.graph.select(o),Pn().setTarget("node",o.id),o},initEvent(){this.graph.on("node:moving",s=>{}),this.graph.on("scale",({sx:s,sy:o})=>{console.log(s,o),this.zoom=Number((s*100).toFixed(0))});const i=Pn();this.graph.on("blank:click",({e:s,x:o,y:r})=>{console.log("Blank click at:",o,r,s),i.setTarget("blank",null)}),this.graph.on("edge:click",({e:s,x:o,y:r,edge:a})=>{console.log("edge:click",o,r,a.id),i.setTarget("edge",a.id),this.graph.select([a.getSourceNode(),a.getTargetNode()])}),this.graph.on("node:click",({e:s,x:o,y:r,node:a})=>{var l;if(console.log("node:click",o,r,a.id),(l=a.id)!=null&&l.includes("line")){this.graph.clearTransformWidgets(),s.stopPropagation();return}i.setTarget("node",a.id)}),this.graph.on("node:change:data",({node:s})=>{this.syncDataToAttrs(s)}),this.graph.on("node:added",({node:s})=>{this.syncDataToAttrs(s)}),this.graph.on("edge:mouseenter",({cell:s})=>{s.addTools([{name:"vertices",args:{attrs:{fill:"#666"},modifiers:["meta","shift","ctrl"]}}])}),this.graph.on("edge:mouseleave",({cell:s})=>{s.hasTool("vertices")&&s.removeTool("vertices"),s.hasTool("source-arrowhead")&&s.removeTool("source-arrowhead"),s.hasTool("target-arrowhead")&&s.removeTool("target-arrowhead")}),this.graph.bindKey(["meta+c","ctrl+c"],()=>{const s=this.graph.getSelectedCells();if(!s.length)return!1;const r=s.filter(g=>g.isNode()&&g.id.includes("group")).flatMap(g=>g.getChildren?g.getChildren()||[]:[]),a=s.filter(g=>g.isNode()),l=s.filter(g=>g.isEdge()),c=[...a,...r],h=this.graph.getEdges().filter(g=>{const f=g.getSourceCell&&g.getSourceCell(),p=g.getTargetCell&&g.getTargetCell();return c.includes(f)||c.includes(p)}),u=[...s,...c,...l,...h].reduce((g,f)=>(g.set(f.id,f),g),new Map);return this.graph.copy([...u.values()]),!1}),this.graph.bindKey(["meta+x","ctrl+x"],()=>{const s=this.graph.getSelectedCells();return s.length&&this.graph.cut(s),!1}),this.graph.bindKey(["meta+v","ctrl+v"],()=>{if(!this.graph.isClipboardEmpty()){const s=this.graph.paste({offset:32});this.graph.cleanSelection(),this.graph.select(s)}return!1}),this.graph.bindKey(["meta+z","ctrl+z"],()=>(this.graph.canUndo()&&this.graph.undo(),!1)),this.graph.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(this.graph.canRedo()&&this.graph.redo(),!1)),this.graph.bindKey(["meta+a","ctrl+alt+a"],()=>{const s=this.graph.getNodes();s&&this.graph.select(s)}),this.graph.bindKey("backspace",()=>{const s=this.graph.getSelectedCells();s.length&&(this.graph.removeCells(s),i.setTarget("blank",null))});const t=(s=0,o=0)=>{const r=this.graph.getSelectedCells().filter(a=>a.isNode());if(r.length)return r.forEach(a=>{const{x:l,y:c}=a.getPosition();a.position(l+s,c+o)}),!1},e=5;this.graph.bindKey(["meta+up","ctrl+up"],()=>t(0,-e)),this.graph.bindKey(["meta+down","ctrl+down"],()=>t(0,e)),this.graph.bindKey(["meta+left","ctrl+left"],()=>t(-e,0)),this.graph.bindKey(["meta+right","ctrl+right"],()=>t(e,0));const n=(s,o)=>{for(let r=0,a=s.length;r<a;r+=1)s[r].style.visibility=o?"visible":"hidden"};this.graph.on("node:mouseenter",()=>{const s=this.el.querySelectorAll(".x6-port-body");n(s,!0)}),this.graph.on("node:mouseleave",()=>{const s=this.el.querySelectorAll(".x6-port-body");n(s,!1)})}}}),On=be.defineStore("menus",{state:()=>({menus:[],current:[],services:{}}),getters:{currentMenu:i=>{var t;return(t=i.menus.find(e=>e.id===i.current[0]))==null?void 0:t.children.find(e=>e.id===i.current[1])}},actions:{async setCurrentMenu(i,t=!1){const e=Kt();if(JSON.stringify(i)===JSON.stringify(this.current)&&t===!1)return!1;this.current=i,e.loadMenu(await this.services.getMenu(i[1]))},async loadAllMenus(i=!1){var t;this.menus=await((t=this.services)==null?void 0:t.getAllMenus()),i&&this.menus[0]&&this.menus[0].children[0]&&this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id])},async addMenu(i,t){var n;const e=await((n=this.services)==null?void 0:n.addMenu(i));this.loadAllMenus(),this.setCurrentMenu([e.parentId,e.id]),t&&t()},async saveMenu(i){const t=Kt(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:t.graph.toJSON()};await this.services.saveMenus(e),i&&i()},clearMenu(i){const t=Kt(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:{}};this.services.saveMenus(e),t.graph.clearCells(),i&&i()},async removeMenu(i){if(await this.services.removeMenu(this.current[1]),await this.loadAllMenus(),this.menus[0]&&this.menus[0].children[0])this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id]);else{const t=Kt();t.graph.clearCells(),t.name="",t.id=""}i&&i()}}}),Px={class:"dialog-footer"},Ox={__name:"addMenu",emits:["close"],setup(i,{emit:t}){const e=On(),{menus:n}=be.storeToRefs(e),s=t,o=d.ref(!1);function r(){o.value=!1,s("close")}const a=d.ref(null),l=d.ref({parent:null,parentNameNew:"",name:""}),c=d.ref({parent:[{required:!0,message:"请选择上级目录",trigger:"change"}],parentNameNew:{required:!0,message:"请输入一级目录名称",trigger:"blur"},name:[{required:!0,message:"请输入二级目录名称",trigger:"blur"}]}),h=d.ref(!1),u=async()=>{if(a.value){h.value=!0;try{await a.value.validate((g,f)=>{g?(console.log("submit!"),e.addMenu(l.value,()=>{r()})):console.log("error submit!",f)})}catch(g){console.log("表单验证失败:",g)}finally{h.value=!1}}};return d.onMounted(()=>{o.value=!0}),(g,f)=>{const p=d.resolveComponent("el-option"),m=d.resolveComponent("el-select"),b=d.resolveComponent("el-form-item"),y=d.resolveComponent("el-input"),C=d.resolveComponent("el-form"),w=d.resolveComponent("el-button"),x=d.resolveComponent("el-dialog");return d.openBlock(),d.createBlock(x,{modelValue:o.value,"onUpdate:modelValue":f[3]||(f[3]=E=>o.value=E),title:"新增目录",width:"500"},{footer:d.withCtx(()=>[d.createElementVNode("div",Px,[d.createVNode(w,{onClick:r},{default:d.withCtx(()=>[...f[4]||(f[4]=[d.createTextVNode("取消",-1)])]),_:1}),d.createVNode(w,{type:"primary",onClick:u},{default:d.withCtx(()=>[...f[5]||(f[5]=[d.createTextVNode("确定",-1)])]),_:1})])]),default:d.withCtx(()=>[d.createVNode(C,{ref_key:"formRef",ref:a,model:l.value,"label-width":"auto",style:{padding:"10px 20px"},rules:c.value},{default:d.withCtx(()=>[d.createVNode(b,{label:"上级目录",prop:"parent"},{default:d.withCtx(()=>[d.createVNode(m,{modelValue:l.value.parent,"onUpdate:modelValue":f[0]||(f[0]=E=>l.value.parent=E),placeholder:"请选择上级目录"},{default:d.withCtx(()=>[d.createVNode(p,{value:"0",label:"根目录"}),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(n),E=>(d.openBlock(),d.createBlock(p,{key:E.id,label:E.name,value:E.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value.parent=="0"?(d.openBlock(),d.createBlock(b,{key:0,label:"一级目录名称",prop:"parentNameNew"},{default:d.withCtx(()=>[d.createVNode(y,{modelValue:l.value.parentNameNew,"onUpdate:modelValue":f[1]||(f[1]=E=>l.value.parentNameNew=E)},null,8,["modelValue"])]),_:1})):d.createCommentVNode("",!0),d.createVNode(b,{label:"二级目录名称",prop:"name"},{default:d.withCtx(()=>[d.createVNode(y,{modelValue:l.value.name,"onUpdate:modelValue":f[2]||(f[2]=E=>l.value.name=E)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}},Nx=vt({__name:"previewBox",emits:["close"],setup(i,{emit:t}){const e=Kt(),n=d.ref(null);Qr();const s=Dr(),o=t;inject("topoApi");function r(){o("close")}let a=null;return d.onMounted(()=>{const{width:l,height:c}=e.style;a=new B({container:n.value,width:l,height:c,interacting:{nodeMovable:!1,edgeMovable:!1,magnetConnectable:!1,arrowheadMovable:!1,vertexMovable:!1},selecting:!1,keyboard:!1,mousewheel:!1,panning:!1});const h=e.graph.toJSON();a.fromJSON(h),a.drawBackground({color:e.style.backgroundColor,image:e.style.backgroundImage,size:"cover"})}),d.onBeforeUnmount(()=>{a&&a.dispose()}),(l,c)=>(d.openBlock(),d.createElementBlock("div",{class:"previewBox",onClick:d.withModifiers(r,["self"])},[d.createElementVNode("div",{ref_key:"container",ref:n,class:"ems-preview"},null,512),d.createVNode(d.unref(s))]))}},[["__scopeId","data-v-f3de5af3"]]),Rx={class:"toolBox"},Dx={class:"left"},Lx={style:{"line-height":"40px",width:"100px","text-align":"center"}},Qx={class:"right"},Vx={key:0,class:"iconfont icon-suoding1",style:{color:"#4583ff"}},zx={key:1,class:"iconfont icon-jiesuo1"},Fx=vt({__name:"index",setup(i){const t=On(),e=Kt(),{zoom:n}=be.storeToRefs(e),s=d.ref(!1),o=()=>{s.value=!0},r=()=>{t.saveMenu(()=>{Et.ElMessage.success("保存成功!"),t.loadAllMenus()})};function a(C){const w=/Mac|iPod|iPhone|iPad/.test(navigator.platform);(w&&C.metaKey&&C.key==="s"||!w&&C.ctrlKey&&C.key==="s")&&(C.preventDefault(),r())}const l=()=>{Et.ElMessageBox.confirm("确认清空画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.clearMenu(()=>{Et.ElMessage.success("清空成功!")})})},c=()=>{if(!e.groupSelectedNodes()){Et.ElMessage.warning("请先框选至少两个节点后再组合");return}Et.ElMessage.success("组合完成")},h=()=>{Et.ElMessageBox.confirm("确认删除画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.removeMenu(()=>{Et.ElMessage.success("删除成功!")})})},u=d.ref(!1),g=()=>{u.value=!0},f=C=>{e.setZoom(+C*.1)},p=e.graph;p.on("blank:click",({x:C,y:w})=>{}),p.on("mousemove",({x:C,y:w})=>{}),p.on("blank:contextmenu",({e:C})=>{});const m=d.ref(!1),b=()=>{p.isMouseWheelEnabled()?(m.value=!0,p.disablePanning(),p.disableMouseWheel()):(m.value=!1,p.enablePanning(),p.enableMouseWheel())},y=()=>{console.log(p.toJSON())};return d.onMounted(()=>{window.addEventListener("keydown",a)}),d.onBeforeUnmount(()=>{window.removeEventListener("keydown",a)}),(C,w)=>{const x=d.resolveComponent("el-tooltip"),E=d.resolveComponent("el-dropdown-item"),S=d.resolveComponent("el-dropdown-menu"),v=d.resolveComponent("el-dropdown");return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",Rx,[d.createElementVNode("div",Dx,[d.createElementVNode("a",{onClick:o},[d.createVNode(x,{effect:"light",content:"新增",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[2]||(w[2]=[d.createElementVNode("i",{class:"iconfont icon-xinjian"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:r},[d.createVNode(x,{effect:"light",content:"保存",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[3]||(w[3]=[d.createElementVNode("i",{class:"iconfont icon-baocun"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:l},[d.createVNode(x,{effect:"light",content:"清空",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[4]||(w[4]=[d.createElementVNode("i",{class:"iconfont icon-qingkong"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:c},[d.createVNode(x,{effect:"light",content:"组合",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[5]||(w[5]=[d.createElementVNode("i",{class:"iconfont icon-jianlizuhe1"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:h},[d.createVNode(x,{effect:"light",content:"删除",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[6]||(w[6]=[d.createElementVNode("i",{class:"iconfont icon-shanchu"},null,-1)])]),_:1})])]),w[10]||(w[10]=d.createElementVNode("div",{style:{flex:"1"}},null,-1)),d.createElementVNode("div",Lx,[d.createVNode(v,{onCommand:f,"split-button":"",type:"primary",plain:"",size:"small",style:{"margin-top":"8px"}},{dropdown:d.withCtx(()=>[d.createVNode(S,null,{default:d.withCtx(()=>[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(20,M=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[M>=5&&M<=20?(d.openBlock(),d.createBlock(E,{key:0,command:M},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(M)+"0%",1)]),_:2},1032,["command"])):d.createCommentVNode("",!0)],64))),64))]),_:1})]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n))+"% ",1)]),_:1})]),w[11]||(w[11]=d.createElementVNode("div",{style:{flex:"1"}},null,-1)),d.createElementVNode("div",Qx,[d.createElementVNode("a",{onClick:b},[d.createVNode(x,{effect:"light",content:"锁定/解锁画布",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[m.value?(d.openBlock(),d.createElementBlock("i",Vx)):(d.openBlock(),d.createElementBlock("i",zx))]),_:1})]),d.createElementVNode("a",{onClick:g},[d.createVNode(x,{effect:"light",content:"预览",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[7]||(w[7]=[d.createElementVNode("i",{class:"iconfont icon-yulan"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:y},[d.createVNode(x,{effect:"light",content:"导出",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[8]||(w[8]=[d.createElementVNode("i",{class:"iconfont icon-daochu"},null,-1)])]),_:1})]),d.createElementVNode("a",null,[d.createVNode(x,{effect:"light",content:"导入",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...w[9]||(w[9]=[d.createElementVNode("i",{class:"iconfont icon-daoru"},null,-1)])]),_:1})])])]),s.value?(d.openBlock(),d.createBlock(Ox,{key:0,onClose:w[0]||(w[0]=M=>s.value=!1)})):d.createCommentVNode("",!0),u.value?(d.openBlock(),d.createBlock(Nx,{key:1,onClose:w[1]||(w[1]=M=>u.value=!1)})):d.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7ddbf68a"]]),Ux={class:"editorArea"},Kx={class:"drawBox"},Jx={style:{width:"100%",height:"100%"}},jx=vt({__name:"editorArea",props:["width","height"],setup(i){const t=On(),e=Kt(),{style:n}=be.storeToRefs(e),s=i,o=d.ref(null),r=Dr(),a=d.inject("topoApi");return d.onMounted(()=>{e.el=o.value,e.style.height=s.height||1080,e.style.width=s.width||1920,e.init(),t.services=a,t.loadAllMenus(!0)}),d.onBeforeUnmount(()=>{e.graph&&e.graph.dispose()}),(l,c)=>(d.openBlock(),d.createElementBlock("div",Ux,[d.unref(e).graph?(d.openBlock(),d.createBlock(Fx,{key:0})):d.createCommentVNode("",!0),d.createElementVNode("div",Kx,[d.createElementVNode("div",Jx,[d.createElementVNode("div",{ref_key:"container",ref:o,class:"editor-container",style:d.normalizeStyle({backgroundColor:d.unref(n).backgroundColor,backgroundImage:d.unref(n).backgroundImage?`url(${d.unref(n).backgroundImage})`:"none"})},null,4),d.createVNode(d.unref(r))])])]))}},[["__scopeId","data-v-0d80170d"]]),Gx={class:"groups-menus"},Yx=vt({__name:"menus",setup(i){const t=On(),{menus:e,current:n}=be.storeToRefs(t),s=(o,r)=>{t.setCurrentMenu(r)};return d.onMounted(()=>{console.log(e,n)}),(o,r)=>{const a=d.resolveComponent("el-icon"),l=d.resolveComponent("el-menu-item"),c=d.resolveComponent("el-sub-menu"),h=d.resolveComponent("el-menu");return d.openBlock(),d.createElementBlock("div",Gx,[d.createVNode(h,{"default-active":d.unref(n)[1],onSelect:s,"background-color":"transparent"},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(e),u=>(d.openBlock(),d.createBlock(c,{key:u.id,index:u.id,"popper-offset":100},{title:d.withCtx(()=>[d.createVNode(a,null,{default:d.withCtx(()=>[d.createVNode(d.unref(Hd))]),_:1}),d.createElementVNode("span",null,d.toDisplayString(u.name),1)]),default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.children,g=>(d.openBlock(),d.createBlock(l,{key:g.id,index:g.id},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(g.name),1)]),default:d.withCtx(()=>[d.createVNode(a,null,{default:d.withCtx(()=>[d.createVNode(d.unref(Jr))]),_:1})]),_:2},1032,["index"]))),128))]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])}}},[["__scopeId","data-v-4ccd6e37"]]),Hx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAEo1JREFUeF7t3E3I5mUVBvD/DGPISBnF5Ec5FkxFG1FykYQLK7BFi2rppo1tgkBqVeJKrFURBG1q48ZluHAjVC4MbKEEbsRamFl+NEz0QcOgw0y8Ay7H68Ccns5zP7+29/F+7ud33t6La/HOsdNn7ry8+R8BAgQIELhGgWMC5RoF/ecECBAgcEVAoPhBIECAAIEWAYHSwugSAgQIEBAofgYIECBAoEVAoLQwuoQAAQIEBIqfAQIECBBoERAoLYwuIUCAAAGB4meAAAECBFoEBEoLo0sIECBAoBwot93/8+3kzXcTI0CAAIEDEzj/5vPba09/M37rcqB8+hu/315+/K54oQECBAgQWEug+vtfoKy1d9+GAAEC7QICpZ3UhQQIEDhMAYFymHv3rQkQINAuIFDaSV1IgACBwxQQKIe5d9+aAAEC7QICpZ3UhQQIEDhMgZ0Hir9TyT9ob//z1e2NZ7+3XTj3Uh42QYDANQtc/+HPbLfc+8PtfTfefs13rXxB+juTnQdK9QNXXkr6brd/5YntreceFSgJyjmBJoGjQLnpnke2V596oOnGNa9Jv7/T+bsqbX+HUv3ANddR+1YCpeZkikCXgECpSabf3+lcoNScW6cESiunywhEAYESia4MpMBI5wKl5tw6JVBaOV1GIAoIlEgkUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiM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1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knWsoNefWKYHSyukyAlFAoEQiDaVGNG9KoMzbiRetLSBQavtNDSSdayg159YpgdLK6TICUUCgRCINpUY0b0qgzNuJF60tIFBq+00NJJ1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knWsoNefWKYHSyukyAlFAoEQiDaVGNG9KoMzbiRetLSBQavtNDSSdayg159YpgdLK6TICUUCgRCINpUY0b0qgzNuJF60tIFBq+00NJJ1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knWsoNefWKYHSyukyAlFAoEQiDaVGNG9KoMzbiRetLSBQavtNDSSdayg159YpgdLK6TICUUCgRCINpUY0b0qgzNuJF60tIFBq+00NJJ1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knf9PGspbzz1ae/2BTn3ojge315/57nbh3EsHKuBrE9itwFGg3Hrfj7a/v/iL3X7wnn3aTfc8sr38+F1XffXOA+XU3d/Zjl93w54x7va5x09cv5194SfbxfNnd/vBPo3AgQqcOHlqO/XZh7ZLFy8cqEDta1965z/b2ed/PCdQas82RYAAAQL7JrDzhrJvQN5LgAABAjUBgVJzMkWAAAECQUCg+BEhQIAAgRYBgdLC6BICBAgQECh+BggQIECgRUCgtDC6hAABAgTaA+W2+3++nbz5brIECBAgcGAC5998fnvt6W/Gb33s9Jk7L8cpAwQIECBAIAgIFD8iBAgQINAiIFBaGF1CgAABAgLFzwABAgQItAgIlBZGlxAgQICAQPEzQIAAAQItAgKlhdElBAgQICBQ/AwQIECAQIuAQGlhdAkBAgQI/BceBmwYFkhKEgAAAABJRU5ErkJggg==",_x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAFO1JREFUeF7tnD3I32f1h78JUUpEK0qsrZpaqIqLtNjBIhV8gQo6qGNBXHQRBLGTlU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7/PRXD0coi35fvRYCCCBw6gns/U8op544AAgggMCiBAhl0WG9FgIIILBvAoSyb+LuQwABBBYlQCiLDuu1EEAAgX0TIJR9E3cfAgggsCgBQll0WK+FAAII7JtAXShve+Sb2/k3PbDv93AfAggggMBkAlf++PT2hx98Jj7Fmbvvve9a/JQPIIAAAgggEAgQiq8IAggggECFAKFUMCpBAAEEECAU3wEEEEAAgQoBQqlgVIIAAgggQCi+AwgggAACFQKEUsGoBAEEEECAUHwHEEAAAQQqBAilglEJAggggMB/ARktVif0N2BWAAAAAElFTkSuQmCC",$x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAESxJREFUeF7t3E/I51UVB+A7w0yK/0pikKkwDKl0EUoJRbiIAoMiolUE0sb20TJxJdKqCIJWbtxEKwmsRZs2Lgq0AiFCC/u3MBsMrRy1GZx4C6HFvHMOeLi/e+c8bs/x3nOf82U+vjIzJ269/a5Lwz8ECBAgQOBtCpwQKG9T0L9OgAABAv8VECg+BAIECBAoERAoJYwOIUCAAAGB4hsgQIAAgRIBgVLC6BACBAgQECi+AQIECBAoERAoJYwOIUCAAAGB4hsgQIAAgRIBgVLC6BACBAgQSAfKqY98eZy45gZiBAgQINBM4NIb/xoXn/lh+Op0oJy+54Fx4alHwwM1ECBAgMDVJZD99V+gXF179xoCBAiUCwiUclIHEiBAoKeAQOm5d68mQIBAuYBAKSd1IAECBHoKCJSee/dqAgQIlAsIlHJSBxIgQKCngEDpuXevJkDg/wSuffcd4+y93xrveOf7uVxB4Pxfnx5/+enXju0QKD4fAgTaCxwFyi2feGj86cdfaW9xJYAPffXX49nH7hYovhICBAgcJyBQct+GQMk56SJAoLGAQMktX6DknHQRINBYQKDkli9Qck66CBBoLCBQcssXKDknXQQINBYQKLnlC5Scky4CBBoLCJTc8gVKzkkXAQKNBQRKbvkCJeekiwCBxgICJbd8gZJz0kWAQGMBgZJbvkDJOekiQKCxgEDJLV+g5Jx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gpRdIwUhzQVlpES5DgMD5BFIw0vx8T35Zd07BSHNBuax9ehoCBI4QSMFI8yNuuckfScFIc0HZ5GfhpQjsSyAFI833pXX4bVMw0lxQfEkECIwXSMFI8/EAK71ACkaaC8pKi3AZAgTOJ5CCkebne/LLunMKRpoLymXt09MQIHCEQApGmh9xy03+SApGmgvKJj8LL0VgXwIpGGm+Ly1/h2LfBAgQOCiQgpHmaG8LpN9A0txvKL4kAgTGC6RgpPl4gJVeIAUjzQVlpUW4DAEC5xNIwUjz8z35Zd05BSPNBeWy9ulpCBA4QiAFI82PuOUmfyQFI80FZZOfhZcisC+BFIw035fW4bdNwUhzQfElESAwXiAFI83HA6z0AikYaS4oKy3CZQgQOJ9ACkaan+/JL+vOKRhpLiiXtU9PQ4DAEQIpGGl+xC03+SMpGGkuKJv8LLwUgX0JpGCk+b60hv0dyu9/8AX7IUCAwMkErt33wPL6h55Yfvn0x171nreC8tYPfnn584+/cbJnmnij+x9/cnn2qUcPPvrJf0O58dhnl6v33DfR0jMTIDBU4Oq1e5ebz/1wef7n337VN7h2/cZy472fWV568YWhb3iax37pH39b/vjMVy4nKKd5bXchQIAAgVMLnPw3lFO/oPsRIECAwGkEBOU0zu5CgACBzQsIyuZX7AUJECBwGgFBOY2zuxAgQGDzAoKy+RV7QQIECJxGQFBO4+wuBAgQ2LzA6kF5xxNfX66/5bHNw3lBAgQIEPhvgZu/e2b57Xc/HVmuPPjwIy/HUw4QIECAAIEgICg+EQIECBBYRUBQVmF0EQIECBAQFN8AAQIECKwiICirMLoIAQIECAiKb4AAAQIEVhEQlFUYXYQAAQIEBMU3QIAAAQKrCAjKKowuQoAAAQL/BNGmU82l5+MXAAAAAElFTkSuQmCC",ev=Object.assign({"../../../assets/iconfont/svg/A相手车刀闸合.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M511.9872 921.5232l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 76.8768 76.864 76.864-76.864 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 921.6z m0-102.4l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 54.4896 54.4832V290.6176l-54.4896 54.464-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68-54.4512-54.432v442.7008l54.4512-54.4512 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 819.2z m0-653.2864L435.1104 242.6816l-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68z" fill="#EF5317" /></svg>',"../../../assets/iconfont/svg/三绕组变压器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M544 64v268.256a192.064 192.064 0 0 1 147.84 256.704A192 192 0 1 1 512 904.608a192 192 0 1 1-179.84-315.68A192.064 192.064 0 0 1 480 332.256V64h64z m-197.44 555.072l-5.856 0.832A160.032 160.032 0 0 0 368 937.6a159.68 159.68 0 0 0 124.48-59.456 190.72 190.72 0 0 1-28.48-100.544c0-23.68 4.288-46.4 12.16-67.36a192 192 0 0 1-125.12-83.904l-4.48-7.264z m330.88-0.064l-0.8 1.44a192.192 192.192 0 0 1-128.832 89.824A190.72 190.72 0 0 1 560 777.6a191.104 191.104 0 0 1-28.384 100.544 160 160 0 1 0 145.824-259.104zM509.344 713.6l-2.016 4.8A159.584 159.584 0 0 0 496 777.6c0 25.024 5.76 48.672 16 69.76a158.72 158.72 0 0 0 16-69.76c0-22.784-4.768-44.448-13.344-64.064l-5.312 0.032z m-124.608-95.104l1.28 1.76a159.84 159.84 0 0 0 104.544 59.968l1.824-3.136a159.456 159.456 0 0 0-107.648-58.592z m254.56 0.064l-3.872 0.384a159.808 159.808 0 0 0-103.872 58.144l1.92 3.072a159.488 159.488 0 0 0 100.96-55.52l4.864-6.08zM512 361.6a160 160 0 0 0-146.656 224.064l2.656-0.064c57.344 0 108.8 25.152 144 64.992a191.552 191.552 0 0 1 144-64.992h2.688a160 160 0 0 0-146.688-224z" /></svg>',"../../../assets/iconfont/svg/变压器_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.0944 534.3232c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#E60012" /><path d="M633.6512 459.9808h-200.704l98.7136-158.1056 101.9904 158.1056z m-163.84-20.48h126.1568l-64.1024-99.5328-62.0544 99.5328z" fill="#E60012" /><path d="M533.0944 694.272c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896c0 81.92-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#EF7C1B" /><path d="M522.8544 611.9424h20.48v317.0304h-20.48z" fill="#EF7C1B" /><path d="M522.8544 57.9584h20.48v192.512h-20.48z" fill="#E60012" /><path d="M534.7328 632.832l-90.9312-101.9904 15.1552-13.5168 75.3664 84.3776 72.704-84.3776 15.5648 13.5168z" fill="#EF7C1B" /></svg>',"../../../assets/iconfont/svg/变压器_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 170.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333S629.824 170.666667 512 170.666667zM256 384c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M512 426.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333-95.509333-213.333333-213.333333-213.333333zM256 640c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M490.666667 981.333333v-106.666666h42.666666v106.666666h-42.666666zM490.666667 149.333333V42.666667h42.666666v106.666666h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/手持开关盒.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M431.431671 299.041479h159.572225v426.308151H431.431671z" fill="#d81e06" /><path d="M609.777099 744.122832H412.658468v-463.854556h197.118631v463.854556z m-159.572225-37.546405h122.025819v-388.761745H450.204874v388.761745z" fill="#d81e06" /><path d="M492.44458 131.568864h37.546406v186.167596h-37.546406zM492.44458 707.280422h37.546406v186.167596h-37.546406z" fill="#d81e06" /><path d="M594.993201 252.656023L511.06134 145.414101 427.129478 252.656023l-29.567794-23.153617L511.06134 84.479413l113.499656 145.022993z" fill="#d81e06" /><path d="M594.993201 168.17661L511.06134 60.934688 427.129478 168.17661l-29.567794-23.153617 113.499656-145.022993L624.560996 145.022993z" fill="#d81e06" /><path d="M511.06134 939.520587L397.561684 794.497594l29.567794-23.075396 83.931862 107.241922L594.993201 771.422198l29.567795 23.075396z" fill="#d81e06" /><path d="M511.06134 1024L397.561684 878.977007l29.567794-23.075395 83.931862 107.241922L594.993201 855.901612l29.567795 23.075395z" fill="#d81e06" /></svg>',"../../../assets/iconfont/svg/手持断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M494.481834 206.967196l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196l71.51746 87.410229-8.668783 7.223986-67.544268-82.714639-67.544268 82.714639zM566.360494 119.195767c0 0.361199 0 0.361199 0 0z" fill="#FF0000" /><path d="M494.481834 148.091711l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196L638.600353 140.867725l-8.668783 7.223986-67.544268-82.714639L494.481834 148.091711z m71.87866-87.771429c0 0.361199 0 0.361199 0 0zM562.026102 913.834215c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196z" fill="#FF0000" /><path d="M562.026102 972.7097c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196zM567.805291 849.179541h-11.197178V617.650794l-171.208466-252.839507 9.391182-6.140388 171.930864 254.284304c0.722399 1.083598 1.083598 2.167196 1.083598 3.250793v232.973545zM556.608113 178.071252h11.197178v183.489242h-11.197178z" fill="#FF0000" /><path d="M510.898342 402.654138l94.446392-90.429856 7.740501 8.087252-94.44278 90.429856z" fill="#FF0000" /><path d="M511.158406 320.35849l7.744113-8.087252 94.457227 90.415408-7.744113 8.090864zM556.608113 849.179541h11.197178v58.875485h-11.197178zM556.608113 119.195767h11.197178v58.875485h-11.197178z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/抽屉式断路器断开.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M85.18656007 375.38588444l-13.9264 0 0-387.28817777 13.9264 0z" fill="#EF1616" /><path d="M12.7726934 188.10538666l-9.84746666-9.84746666 72.41500444-72.41500444 9.84746666 9.84746666z" fill="#EF1616" /><path d="M71.25674674 115.69038222l9.84746666-9.84746665 72.41500443 72.41500443-9.84746665 9.84746667zM12.77496896 261.79811556l-9.84746667-9.84746667 72.41500445-72.41500445 9.84746666 9.84746667z" fill="#EF1616" /><path d="M71.25447117 189.38311111l9.84746667-9.84746667 72.41500445 72.41500445-9.84746667 9.84746667zM85.1797334 1037.94346667l-13.9264 0 0-387.28817778 13.9264 0z" fill="#EF1616" /><path d="M85.18769784 910.336l-9.84746665 9.84746667-72.41500445-72.41500445 9.84746666-9.84746666z" fill="#EF1616" /><path d="M143.67175118 837.92099556l9.84746666 9.84746665-72.41500444 72.41500446-9.84746666-9.84746667z" fill="#EF1616" /><path d="M85.18542229 836.64668444l-9.84746667 9.84746667-72.41500444-72.41500444 9.84746666-9.84746667z" fill="#EF1616" /><path d="M143.67402674 764.23168l9.84746666 9.84746667-72.41614222 72.41500444-9.84632889-9.84746667z" fill="#EF1616" /><path d="M19.62666674 375.38702222l118.32888888 0L137.95555561 650.33102222l-118.32888886 0-1e-8-274.944z m104.41386666 13.91502222l-90.48746666 0L33.55306674 636.40462222l90.48746666 0 0-247.10257778z" fill="#EF1616" /></svg>',"../../../assets/iconfont/svg/接地_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M531.791456 701.961295a17.407498 17.407498 0 0 1-15.824998-16.616247v-316.499956a15.824998 15.824998 0 0 1 15.824998-15.824998 17.407498 17.407498 0 0 1 15.824998 16.616248v320.456205a15.824998 15.824998 0 0 1-15.824998 11.868748zM533.373956 377.548841a18.989997 18.989997 0 0 1-11.077499 0L172.564006 27.02514a15.033748 15.033748 0 0 1 0-22.154997 15.033748 15.033748 0 0 1 22.154997 0l349.732451 345.776202a15.033748 15.033748 0 0 1 0 22.154996 14.242498 14.242498 0 0 1-11.077498 4.7475zM609.333945 1024H455.040217a15.824998 15.824998 0 0 1 0-31.649996h158.249977a15.824998 15.824998 0 0 1 0 31.649996zM762.836423 870.497522H300.746488a15.824998 15.824998 0 0 1 0-31.649996h462.089935a15.824998 15.824998 0 1 1 0 31.649996zM840.378913 716.203793H223.995249a15.824998 15.824998 0 0 1-15.824998-15.824998 15.824998 15.824998 0 0 1 15.824998-16.616247H840.378913a15.824998 15.824998 0 0 1 15.824997 16.616247 15.824998 15.824998 0 0 1-15.824997 15.824998z" /></svg>',"../../../assets/iconfont/svg/接地_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 704H213.333333v-42.666667h597.333334v42.666667zM725.333333 810.666667H298.666667v-42.666667h426.666666v42.666667zM640 917.333333H384v-42.666666h256v42.666666z" fill="#000000" /><path d="M490.666667 704V106.666667h42.666666v597.333333h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/断路器-he.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M640 176H528V0h-32v176H384v672h112v176h32V848h112z" fill="#D81E06" /></svg>',"../../../assets/iconfont/svg/断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M700.16 341.333333l55.04-55.04a42.666667 42.666667 0 0 0-60.16-60.16l-12.373333 12.373334V42.666667a42.666667 42.666667 0 0 0-85.333334 0v195.84l-12.373333-12.373334a42.666667 42.666667 0 0 0-60.16 60.16L579.84 341.333333l-55.466667 55.04a42.666667 42.666667 0 1 0 60.16 60.16L640 401.493333l55.04 55.04a42.666667 42.666667 0 1 0 60.16-60.16zM333.226667 230.826667a42.666667 42.666667 0 0 0-69.12 50.346666L597.333333 739.413333V981.333333a42.666667 42.666667 0 0 0 85.333334 0v-256a42.666667 42.666667 0 0 0-8.106667-25.173333z" /></svg>',"../../../assets/iconfont/svg/母线.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="98.08px" viewBox="0 0 2088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2088.44 442.576H5.726v138.848H2088.44V442.576z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/电池.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="100.64px" viewBox="0 0 2035 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2538.89999992 217.3c2.9-0.1 5.7-0.1 8.6-0.1" /><path d="M1344.19999992 960.2H703.99999992V130.3h640.1v829.9z m-567.5-70.1h494.8V200.4H776.69999992v689.7z" fill="#03E086" /><path d="M896.09999992 61h254.4v70H896.09999992zM1064.99999992 755.9l-80.7-39.7 63.6-129.1H855.49999992l128.3-255.3 80.4 40.5-62.7 124.8h191z" fill="#03E086" /></svg>',"../../../assets/iconfont/svg/直流逆变器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M207.36 359.936l58.624-58.624c9.216-9.216 21.418667-14.250667 34.389333-14.250667s25.173333 5.034667 34.389334 14.250667l41.557333 41.557333c17.749333 17.749333 40.96 26.88 64.341333 26.88 18.773333 0 37.632-5.802667 53.930667-17.749333l45.909333-33.621333c9.472-6.912 11.52-20.224 4.608-29.696a21.265067 21.265067 0 0 0-29.696-4.608l-45.909333 33.621333a48.452267 48.452267 0 0 1-63.146667-4.864l-41.557333-41.557333c-17.237333-17.237333-40.106667-26.709333-64.426667-26.709334-24.32 0-47.274667 9.472-64.426666 26.709334l-58.624 58.624c-8.277333 8.277333-8.277333 21.76 0 30.037333 8.277333 8.277333 21.76 8.277333 30.037333 0zM119.466667 119.466667v785.066666h785.066666V119.466667H119.466667z m706.645333 42.496L161.962667 826.112V161.962667h664.149333z m-640 700.074666l675.925333-675.925333v675.925333H186.112zM490.837333 685.568h339.882667v42.496H490.837333zM736.682667 790.101333h94.122666v42.496H736.682667zM613.717333 790.101333h94.122667v42.496H613.717333zM490.837333 790.101333h94.122667v42.496H490.837333z" /></svg>'});function nv(i){return i?(i=i.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"').replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),i=i.replace(/<([a-z]+)([^>]*?)\/?>/gi,(t,e,n)=>{const s=t.endsWith("/>")?"/>":">";return!/(fill=)/i.test(n)&&/^(path|circle|rect|polygon|polyline)$/i.test(e)?`<${e}${n} fill="currentColor"${s}`:t}),i):""}const Id="__node_panel_svg_sprite__";function iv(){if(typeof document>"u")return null;let i=document.getElementById(Id);i||(i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.id=Id,document.body.prepend(i));let t=i.querySelector("defs");return t||(t=document.createElementNS("http://www.w3.org/2000/svg","defs"),i.appendChild(t)),t}function sv(i){const t=i.match(/viewBox="([^"]+)"/i),e=i.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i);return{viewBox:t?t[1]:"",content:e?e[1]:i}}function ov(i,t){const e=iv();if(!e||e.querySelector(`#${i}`))return i;const{viewBox:n,content:s}=sv(nv(t)),o=document.createElementNS("http://www.w3.org/2000/svg","symbol");return o.setAttribute("id",i),n&&o.setAttribute("viewBox",n),o.innerHTML=s,e.appendChild(o),i}const rv=Object.entries(ev).map(([i,t])=>({name:i.split("/").pop().replace(".svg",""),id:ov(`node-icon-${i.split("/").pop().replace(".svg","")}`,t)})),av={class:"nodes"},lv={class:"groups"},cv=["onClick"],hv={class:"list"},uv={style:{width:"100%",display:"flex","justify-content":"space-between","align-items":"center",padding:"20px 10px 10px 10px"}},dv={style:{padding:"10px"}},gv=["onMousedown","title"],fv={key:1,class:"svg-icon"},pv={"aria-hidden":"true"},mv=["xlink:href"],bv=vt({__name:"nodes",setup(i){const t=Kt(),e={IMG:"img"},n=d.ref(0),s=d.ref([{name:"控件",icon:"iconfont icon-icon-relativity",active:[],children:[{name:"基础",layout:"1fr 1fr 1fr",list:[{name:"线段",renderType:"svg",icon:"icon-xianduan",data:{type:"line"}},{name:"基础文字",renderType:"text",icon:"icon-wenzi",data:{type:"text",text:"测试"}},{name:"数值",renderType:"svg",icon:"icon-shuzhi",data:{type:"svg"}},{name:"图标",renderType:"svg",icon:"icon-tubiao",data:{type:"svg"}},{name:"图片",renderType:"svg",icon:"icon-tupian",data:{type:"svg"}},{name:"自定义",renderType:"svg",icon:"icon-tupian",data:{type:"icon"}}]},{name:"图形",list:[]},{name:"表格",list:[]},{name:"图表",list:[]},{name:"表单",layout:"1fr 1fr 1fr",list:[{name:"按钮",renderType:"form",icon:"icon-shuzhi",data:{type:"button"}},{name:"文本输入框",renderType:"form",icon:"icon-shuzhi",data:{type:"input"}},{name:"数字输入框",renderType:"form",icon:"icon-shuzhi",data:{type:"number"}},{name:"选择框",renderType:"form",icon:"icon-shuzhi",data:{type:"select"}},{name:"日期框",renderType:"form",icon:"icon-shuzhi",data:{type:"date"}}]}]},{name:"模板",icon:"iconfont icon-root-list",active:[],children:[{name:"布局",layout:"1fr 1fr",list:[{name:"布局1",renderType:"img",icon:Hx,data:{type:"layout"}},{name:"布局2",renderType:"img",icon:_x,data:{type:"layout"}},{name:"布局3",renderType:"img",icon:Wx,data:{type:"layout"}},{name:"布局4",renderType:"img",icon:qx,data:{type:"layout"}},{name:"布局5",renderType:"img",icon:Xx,data:{type:"layout"}},{name:"布局6",renderType:"img",icon:$x,data:{type:"layout"}},{name:"布局7",renderType:"img",icon:Zx,data:{type:"layout"}},{name:"布局8",renderType:"img",icon:tv,data:{type:"layout"}}]}]},{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"图表",icon:"iconfont icon-icon_chart",children:[],active:[]},{name:"素材",icon:"iconfont icon-icon_image",children:[{name:"电器svg",layout:"1fr 1fr 1fr",list:rv.map(h=>({name:h.name,renderType:"svg",icon:h.id,data:{type:"svg"}}))}],active:[]}]),o=d.ref(""),r=h=>{n.value=h},a=()=>{if(s.value[n.value].active.length>0)s.value[n.value].active=[];else{const h=[];s.value[n.value].children.forEach((u,g)=>{h.push(g)}),s.value[n.value].active=h}},l=(h,u)=>{console.log(u);let g=t.graph.createNode({shape:u.renderType+"-node"});g.setData({icon:u.icon,name:u.name,...u.data}),t.dnd.start(g,h)},c=({node:h})=>{var u,g;if(((u=h.data)==null?void 0:u.type)==="line"){const f=h.position();console.log(h,h.position()),h.remove();const p=t.graph.addNode({id:"line"+crypto.randomUUID(),x:f.x-50,y:f.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),m=t.graph.addNode({id:"line"+crypto.randomUUID(),x:f.x+50,y:f.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),b=t.graph.addEdge({source:p,target:m,router:"normal",markup:[{tagName:"path",selector:"line"},{tagName:"path",selector:"line1"}],attrs:{line:{stroke:"#1bc8de80",strokeWidth:2,connection:!0,sourceMarker:"",targetMarker:""},line1:{display:"none",connection:!0,x:0,y:0,strokeWidth:4,stroke:"#91f4ffff",fill:"none",strokeDasharray:"8 8",pointerEvents:"none",style:{animation:"ant-line 30s infinite linear"}}},zIndex:0,data:{name:"line",status:[],bindData:[],realData:[]}});t.graph.select(b)}["button","input","number","select","date"].includes((g=h.data)==null?void 0:g.type)&&h.prop("size",{width:120,height:30})};return d.onMounted(()=>{var h;(h=t.graph)==null||h.on("node:added",c)}),d.onBeforeUnmount(()=>{var h;(h=t.graph)==null||h.off("node:added",c)}),(h,u)=>{const g=d.resolveComponent("el-input"),f=d.resolveComponent("el-tooltip"),p=d.resolveComponent("el-image"),m=d.resolveComponent("el-collapse-item"),b=d.resolveComponent("el-collapse");return d.openBlock(),d.createElementBlock("div",av,[d.createElementVNode("div",lv,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,(y,C)=>(d.openBlock(),d.createElementBlock("div",{key:y.index,class:d.normalizeClass(["group",{active:n.value===C}]),onClick:w=>r(C)},[d.createElementVNode("i",{class:d.normalizeClass(y.icon)},null,2),d.createElementVNode("span",null,d.toDisplayString(y.name),1)],10,cv))),128))]),d.createElementVNode("div",hv,[d.createElementVNode("div",uv,[d.createVNode(g,{modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=y=>o.value=y),style:{width:"180px"},placeholder:"请输入过滤","prefix-icon":d.unref(jr),clearable:""},null,8,["modelValue","prefix-icon"]),d.createVNode(f,{effect:"light",content:"展开/折叠",placement:"top"},{default:d.withCtx(()=>[d.createElementVNode("div",{style:{cursor:"pointer","font-size":"20px"},onClick:a},[...u[2]||(u[2]=[d.createElementVNode("i",{class:"iconfont icon-menu-fold"},null,-1)])])]),_:1})]),d.createElementVNode("div",dv,[d.createVNode(b,{modelValue:s.value[n.value].active,"onUpdate:modelValue":u[1]||(u[1]=y=>s.value[n.value].active=y),"expand-icon-position":"left",style:{border:"none","background-color":"transparent"}},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value[n.value].children,(y,C)=>(d.openBlock(),d.createBlock(m,{key:C,title:y.name,name:C},{default:d.withCtx(()=>[d.createElementVNode("div",{class:"expand-content",style:d.normalizeStyle({gridTemplateColumns:y.layout?y.layout:"1fr 1fr 1fr"})},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.list.filter(w=>w.name.includes(o.value)),(w,x)=>(d.openBlock(),d.createElementBlock("div",{key:x,class:"graphic",onMousedown:E=>l(E,w),title:w.name},[w.renderType===e.IMG?(d.openBlock(),d.createBlock(p,{key:0,src:w.icon,style:{width:"100px",height:"60px",margin:"auto"}},null,8,["src"])):(d.openBlock(),d.createElementBlock("div",fv,[(d.openBlock(),d.createElementBlock("svg",pv,[d.createElementVNode("use",{"xlink:href":"#"+w.icon},null,8,mv)]))])),d.createElementVNode("p",null,d.toDisplayString(w.name),1)],40,gv))),128))],4)]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])])])}}},[["__scopeId","data-v-91228510"]]),yv={class:"datas"},wv={class:"groups"},Cv=["onClick"],Av={class:"list"},xv={style:{padding:"10px"}},vv=["onMousedown"],Ev=vt({__name:"datas",setup(i){const t=Kt(),e=d.inject("topoApi"),n=d.ref([]);(async()=>{n.value=await e.getDeviceList()})();const o=d.ref([{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"接口",icon:"iconfont icon-icon_chart",children:[],active:[]}]),r=d.ref(0),a=m=>{r.value=m};d.ref({});const l=d.ref(""),c=d.ref(null),h={value:"id",label:"label",data:"data",children:"children"},u=()=>{c.value.filter(l.value)},g=(m,b,y)=>(console.log(m,y.label.includes(m)),y.label.includes(m)),f=(m,b)=>{var E;const y=((E=b.data)==null?void 0:E.data)||{};console.log(y);const w={type:"text",text:"--",dataSource:{type:"opcua",path:y.nodeId,parse:y.description?`const description = data.pointTemp.description;
|
|
807
|
+
`,vd="has-widget-transform",In=["nw","n","ne","e","se","s","sw","w"],Ze=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],bx={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0};class Ed extends jt{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(t,e,n){super(),this.node=e,this.graph=n,this.options=Object.assign(Object.assign({},bx),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),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)}stopListening(){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)}renderHandles(){this.container=document.createElement("div");const t=document.createElement("div");W(t,"draggable","false");const e=t.cloneNode(!0);Q(e,this.rotateClassName);const n=Ze.map(s=>{const o=t.cloneNode(!0);return Q(o,this.resizeClassName),W(o,"data-position",s),o});this.empty(),Nt(this.container,[...n,e])}render(){return this.renderHandles(),this.view&&this.view.addClass(vd),Q(this.container,this.containerClassName),ae(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),ae(this.container,"no-resize",!this.options.resizable),ae(this.container,"no-rotate",!this.options.rotatable),this.options.className&&Q(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=Vt(this.node.getAngle()),s=n!==0?`rotate(${n}deg)`:"";return nt(this.container,{transform:s,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(vd),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Vt(this.node.getAngle()),e=Math.floor(t*(In.length/360));if(e!==this.prevShift){const n=In.slice(e).concat(In.slice(0,e)),s=r=>`${this.containerClassName}-cursor-${r}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((r,a)=>{lt(r,In.map(l=>s(l)).join(" ")),Q(r,s(n[a]))}),this.prevShift=e}}getTrueDirection(t){const e=Vt(this.node.getAngle());let n=Ze.indexOf(t);return n+=Math.floor(e*(Ze.length/360)),n%=Ze.length,Ze[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=W(t.target,"data-position");this.prepareResizing(t,e),this.startAction(t)}prepareResizing(t,e){const n=this.getTrueDirection(e);let s=0,o=0;e.split("-").forEach(c=>{s={left:-1,right:1}[c]||s,o={top:-1,bottom:1}[c]||o});const r=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[r],l=Vt(this.node.getAngle());this.setEventData(t,{selector:a,direction:r,trueDirection:n,relativeDirection:e,angle:l,resizeX:s,resizeY:o,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.node.getBBox().getCenter(),n=this.normalizeEvent(t),s=this.graph.snapToGrid(n.clientX,n.clientY);this.setEventData(t,{center:e,action:"rotating",angle:Vt(this.node.getAngle()),start:A.create(s).theta(e)}),this.startAction(t)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const s=this.normalizeEvent(t);let o=s.clientX,r=s.clientY;const a=this.graph.getPlugin("scroller"),l=this.options.restrictedResizing;if(l===!0||typeof l=="number"){const f=l===!0?0:l,p=a?Math.max(f,8):f,m=this.graph.container.getBoundingClientRect();o=Ye(o,m.left+p,m.right-p),r=Ye(r,m.top+p,m.bottom-p)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,r);const c=this.graph.snapToGrid(o,r),h=this.graph.getGridSize(),u=this.node,g=this.options;if(n.action==="resizing"){n=n,n.resized||(e&&(e.addClass("node-resizing"),this.notify("node:resize",t,e)),n.resized=!0);const f=u.getBBox(),p=A.create(c).rotate(n.angle,f.getCenter()).diff(f[n.selector]);let m=n.resizeX?p.x*n.resizeX:f.width,b=n.resizeY?p.y*n.resizeY:f.height;const y=m,w=b;if(m=re(m,h),b=re(b,h),m=Math.max(m,g.minWidth||h),b=Math.max(b,g.minHeight||h),m=Math.min(m,g.maxWidth||1/0),b=Math.min(b,g.maxHeight||1/0),g.preserveAspectRatio){const x=f.width*b/f.height,E=f.height*m/f.width;m<x?b=E:m=x}const C=n.relativeDirection;if(g.allowReverse&&(y<=-m||w<=-b)){let x;C==="left"?y<=-m&&(x="right"):C==="right"?y<=-m&&(x="left"):C==="top"?w<=-b&&(x="bottom"):C==="bottom"?w<=-b&&(x="top"):C==="top-left"?y<=-m&&w<=-b?x="bottom-right":y<=-m?x="top-right":w<=-b&&(x="bottom-left"):C==="top-right"?y<=-m&&w<=-b?x="bottom-left":y<=-m?x="top-left":w<=-b&&(x="bottom-right"):C==="bottom-left"?y<=-m&&w<=-b?x="top-right":y<=-m?x="bottom-right":w<=-b&&(x="top-left"):C==="bottom-right"&&(y<=-m&&w<=-b?x="top-left":y<=-m?x="bottom-left":w<=-b&&(x="top-right"));const E=x;this.stopHandle();const S=this.container.querySelector(`.${this.resizeClassName}[data-position="${E}"]`);this.startHandle(S),this.prepareResizing(t,E),this.onMouseMove(t)}if(f.width!==m||f.height!==b){const x={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:g.minWidth,minHeight:g.minHeight,maxWidth:g.maxWidth,maxHeight:g.maxHeight,preserveAspectRatio:g.preserveAspectRatio===!0};u.resize(m,b,x),this.notify("node:resizing",t,e)}}else if(n.action==="rotating"){n=n,n.rotated||(e&&(e.addClass("node-rotating"),this.notify("node:rotate",t,e)),n.rotated=!0);const f=u.getAngle(),p=n.start-A.create(c).theta(n.center);let m=n.angle+p;g.rotateGrid&&(m=re(m,g.rotateGrid)),m=Vt(m),f!==m&&(u.rotate(m,{absolute:!0}),this.notify("node:rotating",t,e))}}}onMouseUp(t){const e=this.getEventData(t);e.action&&(this.stopAction(t),this.model.stopBatch(e.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(t){if(this.handle=t||null,Q(this.container,`${this.containerClassName}-active`),t){Q(t,`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const n=In[Ze.indexOf(e)];Q(this.container,`${this.containerClassName}-cursor-${n}`)}}}stopHandle(){if(lt(this.container,`${this.containerClassName}-active`),this.handle){lt(this.handle,`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=In[Ze.indexOf(t)];lt(this.container,`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(wu,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass(`node-${n.action}`),n.action==="resizing"&&n.resized?this.notify("node:resized",t,e):n.action==="rotating"&&n.rotated&&this.notify("node:rotated",t,e))}notify(t,e,n,s={}){if(n){const o=n.graph,r=o.view.normalizeEvent(e),a=o.snapToGrid(r.clientX,r.clientY);this.trigger(t,Object.assign({e:r,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},s))}}dispose(){this.stopListening(),this.remove(),this.off()}}X([$()],Ed.prototype,"dispose",null),B.prototype.createTransformWidget=function(i){const t=this.getPlugin("transform");return t&&t.createWidget(i),this},B.prototype.clearTransformWidgets=function(){const i=this.getPlugin("transform");return i&&i.clearWidgets(),this};class Sd extends Ft{constructor(t={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=t,Te(this.name,mx)}init(t){this.graph=t,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(t){this.clearWidgets();const e=this.createTransform(t);e&&(this.widgets.set(t,e),e.on("*",(n,s)=>{this.trigger(n,s),this.graph.trigger(n,s)}))}onNodeClick({node:t}){this.createWidget(t)}onBlankMouseDown(){this.clearWidgets()}createTransform(t){const e=this.getTransformOptions(t);return e.resizable||e.rotatable?new Ed(e,t,this.graph):null}parseOptionGroup(t,e,n){const s={};return Object.keys(n||{}).forEach(o=>{const r=n[o];s[o]=typeof r=="function"?r.call(t,e):r}),s}getTransformOptions(t){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const e=this.parseOptionGroup(this.graph,t,this.options.resizing),n=this.parseOptionGroup(this.graph,t,this.options.rotating);return{resizable:!!e.enabled,minWidth:e.minWidth||0,maxWidth:e.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:e.minHeight||0,maxHeight:e.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof e.orthogonal=="boolean"?e.orthogonal:!0,restrictedResizing:!!e.restrict,autoScrollOnResizing:typeof e.autoScroll=="boolean"?e.autoScroll:!0,preserveAspectRatio:!!e.preserveAspectRatio,allowReverse:typeof e.allowReverse=="boolean"?e.allowReverse:!0,rotatable:!!n.enabled,rotateGrid:n.grid||15}}clearWidgets(){this.widgets.forEach((t,e)=>{this.graph.getCellById(e.id)&&t.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Ie(this.name)}}X([$()],Sd.prototype,"dispose",null);function Md(i){const t=Lt.getForeignObjectMarkup();return i?[{tagName:i,selector:"body"},t]:[t]}B.registerNode("vue-shape",{view:"vue-shape-view",markup:Md(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(i){if(i.markup==null){const t=i.primer;if(t){i.markup=Md(t);let e={};switch(t){case"circle":e={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":e={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}i.attrs=ft({},{body:Object.assign({refWidth:null,refHeight:null},e)},i.attrs||{})}}return i}},!0);var yx=function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(e[n[s]]=i[n[s]]);return e};const Bd={};function wx(i){const{shape:t,component:e,inherit:n}=i,s=yx(i,["shape","component","inherit"]);if(!t)throw new Error("should specify shape in config");Bd[t]={component:e},B.registerNode(t,Object.assign({inherit:n||"vue-shape"},s),!0)}let Oi=!1;const Fs=d.reactive({});function Cx(i,t,e,n,s){Oi&&(Fs[i]=d.markRaw(d.defineComponent({render:()=>d.h(d.Teleport,{to:e},[d.h(t,{node:n,graph:s})]),provide:()=>({getNode:()=>n,getGraph:()=>s})})))}function Ax(i){Oi&&delete Fs[i]}function kd(){return Oi}let Us=null;function Dr(){return Us&&Oi?null:(Oi=!0,Us=d.defineComponent({setup(){return d.onBeforeUnmount(()=>{Us=null}),()=>d.h(d.Fragment,{},Object.keys(Fs).map(i=>d.h(Fs[i])))}}),Us)}class tn extends Zt{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,tn.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,n=this.graph;if(t){const{component:s}=Bd[e.shape];s&&(kd()?Cx(this.targetId(),s,t,e,n):(this.vm=d.createApp({render(){return d.h(s,{node:e,graph:n})},provide(){return{getNode:()=>e,getGraph:()=>n}}}),this.vm.mount(t)))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,e,n){const s=t.target;if(s.tagName.toLowerCase()==="input"){const r=s.getAttribute("type");if(r==null||["text","password","number","email","search","tel","url"].includes(r))return}super.onMouseDown(t,e,n)}unmount(){return kd()&&Ax(this.targetId()),this.unmountVueComponent(),super.unmount(),this}}tn.action="vue",tn.config({bootstrap:[tn.action],actions:{component:tn.action}}),Zt.registry.register("vue-shape-view",tn,!0);const vt=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},xx=vt({__name:"vueNode",setup(i){d.useCssVars(l=>({d8dfc212:n.value.color,v6be3529f:n.value.opacity,v324d6579:n.value.borderStyle,v6de6f73f:n.value.borderWidth+"px",v3169772b:n.value.borderColor,v28e858fa:n.value.borderRadius+"px",v2fb97d69:n.value.backgroundColor}));let e=d.inject("getNode")();const n=d.ref(e.getData()),s=d.ref(128),o=d.ref(128),r=({current:l})=>{s.value=l.width,o.value=l.height},a=({current:l})=>{n.value={...n.value,...l}};return d.provide("x6NodeData",n),d.provide("width",s),d.provide("height",o),d.onMounted(()=>{s.value=e.size().width,o.value=e.size().height,e.on("change:data",a),e.on("change:size",r)}),d.onBeforeUnmount(()=>{e.off("change:data",a),e.off("change:size",r)}),(l,c)=>(d.openBlock(),d.createElementBlock("div",{style:d.normalizeStyle({width:s.value+"px",height:o.value+"px",backgroundImage:n.value.backgroundImage&&n.value.backgroundImage!=="none"?`url(${n.value.backgroundImage})`:"none"}),class:"vueNode"},[d.renderSlot(l.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-c87e42ba"]]),vx={class:"svgNode"},Ex=["xlink:href"],Sx=vt({__name:"svgNode",setup(i){d.inject("getNode");const t=d.inject("width"),e=d.inject("height"),n=d.inject("x6NodeData"),s=d.computed(()=>{var o;return{fontSize:`${Math.min(t.value,e.value)}px`,color:((o=n.value)==null?void 0:o.color)||"#ffffff"}});return d.onMounted(()=>{}),d.onBeforeUnmount(()=>{}),(o,r)=>(d.openBlock(),d.createElementBlock("div",vx,[(d.openBlock(),d.createElementBlock("svg",{class:"svg-icon","aria-hidden":"true",style:d.normalizeStyle(s.value)},[d.createElementVNode("use",{"xlink:href":"#"+d.unref(n).icon},null,8,Ex)],4))]))}},[["__scopeId","data-v-88b0fd56"]]),Mx=["title"],Bx=vt({__name:"textNode",setup(i){const t=d.inject("x6NodeData"),e=d.computed(()=>{const s=t.value||{};return{justifyContent:s.justifyContent||"center",alignItems:s.alignItems||"center",padding:s.padding||"0",overflow:s.overflow||"hidden",backgroundColor:"transparent"}}),n=d.computed(()=>{const s=t.value||{},o=s.textOverflow==="ellipsis",r=s.whiteSpace||(o?"nowrap":"pre-wrap"),a=!s.lineHeight&&s.lineHeight!==0?"1.4":typeof s.lineHeight=="number"?s.lineHeight<=10?`${s.lineHeight}`:`${s.lineHeight}px`:s.lineHeight;return{color:s.color||"#ffffff",fontWeight:s.fontWeight||400,fontSize:`${s.fontSize||16}px`,letterSpacing:`${s.letterSpacing||0}px`,fontFamily:s.fontFamily||"inherit",fontStyle:s.fontStyle||"normal",textDecoration:s.textDecoration||"none",textAlign:s.textAlign||"center",lineHeight:a,whiteSpace:r,wordBreak:s.wordBreak||"break-word",textOverflow:s.textOverflow||"clip",overflow:"hidden",display:s.display||"block"}});return(s,o)=>(d.openBlock(),d.createElementBlock("div",{class:"textNode",style:d.normalizeStyle(e.value),title:d.unref(t).text},[d.createElementVNode("span",{class:"textContent",style:d.normalizeStyle(n.value)},d.toDisplayString(d.unref(t).text),5)],12,Mx))}},[["__scopeId","data-v-98979c16"]]),kx={class:"formNode"},Tx=vt({__name:"formNode",setup(i){const t=d.inject("x6NodeData"),e=d.ref("");return(n,s)=>{const o=d.resolveComponent("el-input"),r=d.resolveComponent("el-option"),a=d.resolveComponent("el-select"),l=d.resolveComponent("el-date-picker"),c=d.resolveComponent("el-input-number"),h=d.resolveComponent("el-button");return d.openBlock(),d.createElementBlock("div",kx,[d.unref(t).type=="input"?(d.openBlock(),d.createBlock(o,{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=u=>e.value=u),clearable:""},null,8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="select"?(d.openBlock(),d.createBlock(a,{key:1,modelValue:e.value,"onUpdate:modelValue":s[1]||(s[1]=u=>e.value=u),clearable:"",style:{width:"100%"}},{default:d.withCtx(()=>[d.createVNode(r)]),_:1},8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="date"?(d.openBlock(),d.createBlock(l,{key:2,modelValue:e.value,"onUpdate:modelValue":s[2]||(s[2]=u=>e.value=u),type:"date",placeholder:"Pick a day",clearable:"",style:{width:"100%"}},null,8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="number"?(d.openBlock(),d.createBlock(c,{key:3,modelValue:e.value,"onUpdate:modelValue":s[3]||(s[3]=u=>e.value=u),controls:!1,clearable:"",style:{width:"100%"}},null,8,["modelValue"])):d.createCommentVNode("",!0),d.unref(t).type=="button"?(d.openBlock(),d.createBlock(h,{key:4,type:"primary",style:{width:"100%"}},{default:d.withCtx(()=>[...s[4]||(s[4]=[d.createTextVNode("按钮",-1)])]),_:1})):d.createCommentVNode("",!0)])}}},[["__scopeId","data-v-1d6b54a4"]]),Ix={name:"",borderStyle:"none",borderRadius:0,borderWidth:0,borderColor:"#5F95FF",opacity:1,backgroundImage:"none",backgroundColor:"transparent",color:"#ffffff",dataSource:{bindName:["text"],type:"none",path:"",point:{},httpType:"GET",httpUrl:"",params:[],parse:null},model:{},status:[]},Lr={"svg-node":Sx,"text-node":Bx,"form-node":Tx},Qr=()=>{Object.keys(Lr).forEach(i=>{wx({shape:i,width:50,height:50,data:{...Ix},component:{render(){return d.h(xx,null,{default:()=>d.h(Lr[i])})}}})})},Td={Blank:"blank"},Pn=be.defineStore("property",{state:()=>({targetType:Td.Blank,cellId:null,tabs:["画布"],activeTab:0}),getters:{},actions:{setTarget(i,t){this.targetType=i,i===Td.Blank?this.tabs=["画布"]:this.tabs=["外观","数据","动画","状态","交互"],this.activeTab=0,this.cellId=t}}}),Vr={backgroundColor:"#6b6b6b26",backgroundImage:null},Kt=be.defineStore("editor-graph",{state:()=>({el:null,graph:null,dnd:null,style:{...Vr,width:1920,height:1080},name:"",id:"",zoom:100}),getters:{hasGraph:i=>!!i.graph},actions:{init(){if(this.el===null)return;this.graph&&this.graph.dispose(),this.graph=new B({container:this.el,autoResize:!0,mousewheel:{enabled:!0,factor:.1},panning:!1,scaling:{min:.5,max:2},background:{color:"#000000"},grid:{size:5,visible:!0,type:"mesh",args:{color:"rgba(100, 100, 100, 0.6)",thickness:1}},translating:{restrict:!0},connecting:{router:"orth",connector:{name:"normal"},args:{padding:0,direction:"H"},anchor:"center",connectionPoint:"anchor",allowBlank:!0,allowLoop:!1,allowMulti:!1,snap:{radius:20},validateConnection({targetMagnet:t}){return!!t}},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{fill:"#5F95FF",stroke:"#5F95FF"}}}}}),this.graph.use(new xd({enabled:!0}));const i=new wd({pageWidth:this.style.width,pageHeight:this.style.height,enabled:!0,pannable:!0,autoResize:!1});this.graph.use(i),this.dnd=new Or({target:this.graph,validateNode(){return!0}}),this.graph.use(new Sd({resizing:!0,rotating:!0})),this.graph.use(new Nu({enabled:!0})),this.graph.use(new hd({enabled:!0,global:!0})).use(new gd({rubberband:!0,showNodeSelectionBox:!0,showEdgeSelectionBox:!1,modifiers:["meta","shift","ctrl"]})).use(new od),Qr(),this.initEvent()},loadMenu({name:i,id:t,value:e,style:n}){if(!this.graph)return;this.name=i,this.id=t,this.graph.fromJSON(e||{}),n?this.style={...this.style,...Vr,...n}:this.style={...this.style,...Vr};const s=Math.min(1280/this.style.width,840/this.style.height);console.log(s,this.style.width,this.style.height),this.graph.zoomTo(s),setTimeout(()=>{this.graph.center(),console.log(this.graph.getScrollbarPosition()),Pn().setTarget("blank",null)},100)},setZoom(i){this.zoom=Number(i),this.graph.zoomTo(i)},updateSize(i,t,e){this.style.width=i,this.style.height=t,this.init(),setTimeout(()=>{e&&e()},100)},syncDataToAttrs(i){if(!i||Object.keys(Lr).includes(i.shape))return;const t=i.getData?i.getData()||{}:{},e={dashed:"6 4",dotted:"2 2",solid:null,none:null},n={};t.backgroundColor!==void 0&&(n.fill=t.backgroundColor),t.borderColor!==void 0&&(n.stroke=t.borderColor),t.borderWidth!==void 0&&(n.strokeWidth=t.borderWidth),t.borderStyle!==void 0&&e.hasOwnProperty(t.borderStyle)&&(t.borderStyle==="none"?(n.strokeDasharray=null,n.strokeWidth=0):n.strokeDasharray=e[t.borderStyle]),t.borderRadius!==void 0&&(n.rx=n.ry=t.borderRadius),t.opacity!==void 0&&(n.opacity=t.opacity);const s={};Object.keys(n).length&&(s.body=n),Object.keys(s).length&&i.setAttrs(s)},groupSelectedNodes(){if(!this.graph)return null;const i=this.graph.getSelectedCells(),t=i.filter(a=>a.isNode()&&!a.id.includes("group"));if(t.length<2)return null;const e=i.filter(a=>a.isNode()&&a.id.includes("group"));e.length>0&&this.graph.removeCells(e);const n=t.reduce((a,l)=>{const c=l.getBBox();return a.minX=Math.min(a.minX,c.x),a.minY=Math.min(a.minY,c.y),a.maxX=Math.max(a.maxX,c.x+c.width),a.maxY=Math.max(a.maxY,c.y+c.height),a},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),s=10,o=this.graph.addNode({id:`group-${Date.now()}`,shape:"rect",x:n.minX-s,y:n.minY-s,width:n.maxX-n.minX+s*2,height:n.maxY-n.minY+s*2,attrs:{body:{fill:"rgba(69, 131, 255, 0.08)",stroke:"#4583ff",strokeWidth:1,strokeDasharray:"6 4"}},data:{type:"group",name:"组合",opacity:1,borderStyle:"dashed",borderRadius:0,borderWidth:1,borderColor:"#4583ff",backgroundColor:"rgba(69, 131, 255, 0.08)"},zIndex:1e3});return t.forEach(a=>{o.addChild(a)}),this.graph.cleanSelection(),this.graph.select(o),Pn().setTarget("node",o.id),o},initEvent(){this.graph.on("node:moving",s=>{}),this.graph.on("scale",({sx:s,sy:o})=>{console.log(s,o),this.zoom=Number((s*100).toFixed(0))});const i=Pn();this.graph.on("blank:click",({e:s,x:o,y:r})=>{console.log("Blank click at:",o,r,s),i.setTarget("blank",null)}),this.graph.on("edge:click",({e:s,x:o,y:r,edge:a})=>{console.log("edge:click",o,r,a.id),i.setTarget("edge",a.id),this.graph.select([a.getSourceNode(),a.getTargetNode()])}),this.graph.on("node:click",({e:s,x:o,y:r,node:a})=>{var l;if(console.log("node:click",o,r,a.id),(l=a.id)!=null&&l.includes("line")){this.graph.clearTransformWidgets(),s.stopPropagation();return}i.setTarget("node",a.id)}),this.graph.on("node:change:data",({node:s})=>{this.syncDataToAttrs(s)}),this.graph.on("node:added",({node:s})=>{this.syncDataToAttrs(s)}),this.graph.on("edge:mouseenter",({cell:s})=>{s.addTools([{name:"vertices",args:{attrs:{fill:"#666"},modifiers:["meta","shift","ctrl"]}}])}),this.graph.on("edge:mouseleave",({cell:s})=>{s.hasTool("vertices")&&s.removeTool("vertices"),s.hasTool("source-arrowhead")&&s.removeTool("source-arrowhead"),s.hasTool("target-arrowhead")&&s.removeTool("target-arrowhead")}),this.graph.bindKey(["meta+c","ctrl+c"],()=>{const s=this.graph.getSelectedCells();if(!s.length)return!1;const r=s.filter(g=>g.isNode()&&g.id.includes("group")).flatMap(g=>g.getChildren?g.getChildren()||[]:[]),a=s.filter(g=>g.isNode()),l=s.filter(g=>g.isEdge()),c=[...a,...r],h=this.graph.getEdges().filter(g=>{const f=g.getSourceCell&&g.getSourceCell(),p=g.getTargetCell&&g.getTargetCell();return c.includes(f)||c.includes(p)}),u=[...s,...c,...l,...h].reduce((g,f)=>(g.set(f.id,f),g),new Map);return this.graph.copy([...u.values()]),!1}),this.graph.bindKey(["meta+x","ctrl+x"],()=>{const s=this.graph.getSelectedCells();return s.length&&this.graph.cut(s),!1}),this.graph.bindKey(["meta+v","ctrl+v"],()=>{if(!this.graph.isClipboardEmpty()){const s=this.graph.paste({offset:32});this.graph.cleanSelection(),this.graph.select(s)}return!1}),this.graph.bindKey(["meta+z","ctrl+z"],()=>(this.graph.canUndo()&&this.graph.undo(),!1)),this.graph.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(this.graph.canRedo()&&this.graph.redo(),!1)),this.graph.bindKey(["meta+a","ctrl+alt+a"],()=>{const s=this.graph.getNodes();s&&this.graph.select(s)}),this.graph.bindKey("backspace",()=>{const s=this.graph.getSelectedCells();s.length&&(this.graph.removeCells(s),i.setTarget("blank",null))});const t=(s=0,o=0)=>{const r=this.graph.getSelectedCells().filter(a=>a.isNode());if(r.length)return r.forEach(a=>{const{x:l,y:c}=a.getPosition();a.position(l+s,c+o)}),!1},e=5;this.graph.bindKey(["meta+up","ctrl+up"],()=>t(0,-e)),this.graph.bindKey(["meta+down","ctrl+down"],()=>t(0,e)),this.graph.bindKey(["meta+left","ctrl+left"],()=>t(-e,0)),this.graph.bindKey(["meta+right","ctrl+right"],()=>t(e,0));const n=(s,o)=>{for(let r=0,a=s.length;r<a;r+=1)s[r].style.visibility=o?"visible":"hidden"};this.graph.on("node:mouseenter",()=>{const s=this.el.querySelectorAll(".x6-port-body");n(s,!0)}),this.graph.on("node:mouseleave",()=>{const s=this.el.querySelectorAll(".x6-port-body");n(s,!1)})}}}),On=be.defineStore("menus",{state:()=>({menus:[],current:[],services:{}}),getters:{currentMenu:i=>{var t;return(t=i.menus.find(e=>e.id===i.current[0]))==null?void 0:t.children.find(e=>e.id===i.current[1])}},actions:{async setCurrentMenu(i,t=!1){const e=Kt();if(JSON.stringify(i)===JSON.stringify(this.current)&&t===!1)return!1;this.current=i,e.loadMenu(await this.services.getMenu(i[1]))},async loadAllMenus(i=!1){var t;this.menus=await((t=this.services)==null?void 0:t.getAllMenus()),i&&this.menus[0]&&this.menus[0].children[0]&&this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id])},async addMenu(i,t){var n;const e=await((n=this.services)==null?void 0:n.addMenu(i));this.loadAllMenus(),this.setCurrentMenu([e.parentId,e.id]),t&&t()},async saveMenu(i){const t=Kt(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:t.graph.toJSON()};await this.services.saveMenus(e),i&&i()},clearMenu(i){const t=Kt(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:{}};this.services.saveMenus(e),t.graph.clearCells(),i&&i()},async removeMenu(i){if(await this.services.removeMenu(this.current[1]),await this.loadAllMenus(),this.menus[0]&&this.menus[0].children[0])this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id]);else{const t=Kt();t.graph.clearCells(),t.name="",t.id=""}i&&i()}}}),Px={class:"dialog-footer"},Ox={__name:"addMenu",emits:["close"],setup(i,{emit:t}){const e=On(),{menus:n}=be.storeToRefs(e),s=t,o=d.ref(!1);function r(){o.value=!1,s("close")}const a=d.ref(null),l=d.ref({parent:null,parentNameNew:"",name:""}),c=d.ref({parent:[{required:!0,message:"请选择上级目录",trigger:"change"}],parentNameNew:{required:!0,message:"请输入一级目录名称",trigger:"blur"},name:[{required:!0,message:"请输入二级目录名称",trigger:"blur"}]}),h=d.ref(!1),u=async()=>{if(a.value){h.value=!0;try{await a.value.validate((g,f)=>{g?(console.log("submit!"),e.addMenu(l.value,()=>{r()})):console.log("error submit!",f)})}catch(g){console.log("表单验证失败:",g)}finally{h.value=!1}}};return d.onMounted(()=>{o.value=!0}),(g,f)=>{const p=d.resolveComponent("el-option"),m=d.resolveComponent("el-select"),b=d.resolveComponent("el-form-item"),y=d.resolveComponent("el-input"),w=d.resolveComponent("el-form"),C=d.resolveComponent("el-button"),x=d.resolveComponent("el-dialog");return d.openBlock(),d.createBlock(x,{modelValue:o.value,"onUpdate:modelValue":f[3]||(f[3]=E=>o.value=E),title:"新增目录",width:"500"},{footer:d.withCtx(()=>[d.createElementVNode("div",Px,[d.createVNode(C,{onClick:r},{default:d.withCtx(()=>[...f[4]||(f[4]=[d.createTextVNode("取消",-1)])]),_:1}),d.createVNode(C,{type:"primary",onClick:u},{default:d.withCtx(()=>[...f[5]||(f[5]=[d.createTextVNode("确定",-1)])]),_:1})])]),default:d.withCtx(()=>[d.createVNode(w,{ref_key:"formRef",ref:a,model:l.value,"label-width":"auto",style:{padding:"10px 20px"},rules:c.value},{default:d.withCtx(()=>[d.createVNode(b,{label:"上级目录",prop:"parent"},{default:d.withCtx(()=>[d.createVNode(m,{modelValue:l.value.parent,"onUpdate:modelValue":f[0]||(f[0]=E=>l.value.parent=E),placeholder:"请选择上级目录"},{default:d.withCtx(()=>[d.createVNode(p,{value:"0",label:"根目录"}),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(n),E=>(d.openBlock(),d.createBlock(p,{key:E.id,label:E.name,value:E.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value.parent=="0"?(d.openBlock(),d.createBlock(b,{key:0,label:"一级目录名称",prop:"parentNameNew"},{default:d.withCtx(()=>[d.createVNode(y,{modelValue:l.value.parentNameNew,"onUpdate:modelValue":f[1]||(f[1]=E=>l.value.parentNameNew=E)},null,8,["modelValue"])]),_:1})):d.createCommentVNode("",!0),d.createVNode(b,{label:"二级目录名称",prop:"name"},{default:d.withCtx(()=>[d.createVNode(y,{modelValue:l.value.name,"onUpdate:modelValue":f[2]||(f[2]=E=>l.value.name=E)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}},Nx=vt({__name:"previewBox",emits:["close"],setup(i,{emit:t}){const e=Kt(),n=d.ref(null);Qr();const s=Dr(),o=t;inject("topoApi");function r(){o("close")}let a=null;return d.onMounted(()=>{const{width:l,height:c}=e.style;a=new B({container:n.value,width:l,height:c,interacting:{nodeMovable:!1,edgeMovable:!1,magnetConnectable:!1,arrowheadMovable:!1,vertexMovable:!1},selecting:!1,keyboard:!1,mousewheel:!1,panning:!1});const h=e.graph.toJSON();a.fromJSON(h),a.drawBackground({color:e.style.backgroundColor,image:e.style.backgroundImage,size:"cover"})}),d.onBeforeUnmount(()=>{a&&a.dispose()}),(l,c)=>(d.openBlock(),d.createElementBlock("div",{class:"previewBox",onClick:d.withModifiers(r,["self"])},[d.createElementVNode("div",{ref_key:"container",ref:n,class:"ems-preview"},null,512),d.createVNode(d.unref(s))]))}},[["__scopeId","data-v-f3de5af3"]]),Rx={class:"toolBox"},Dx={class:"left"},Lx={style:{"line-height":"40px",width:"100px","text-align":"center"}},Qx={class:"right"},Vx={key:0,class:"iconfont icon-suoding1",style:{color:"#4583ff"}},zx={key:1,class:"iconfont icon-jiesuo1"},Fx=vt({__name:"index",setup(i){const t=On(),e=Kt(),{zoom:n}=be.storeToRefs(e),s=d.ref(!1),o=()=>{s.value=!0},r=()=>{t.saveMenu(()=>{St.ElMessage.success("保存成功!"),t.loadAllMenus()})};function a(w){const C=/Mac|iPod|iPhone|iPad/.test(navigator.platform);(C&&w.metaKey&&w.key==="s"||!C&&w.ctrlKey&&w.key==="s")&&(w.preventDefault(),r())}const l=()=>{St.ElMessageBox.confirm("确认清空画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.clearMenu(()=>{St.ElMessage.success("清空成功!")})})},c=()=>{if(!e.groupSelectedNodes()){St.ElMessage.warning("请先框选至少两个节点后再组合");return}St.ElMessage.success("组合完成")},h=()=>{St.ElMessageBox.confirm("确认删除画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.removeMenu(()=>{St.ElMessage.success("删除成功!")})})},u=d.ref(!1),g=()=>{u.value=!0},f=w=>{e.setZoom(+w*.1)},p=e.graph;p.on("blank:click",({x:w,y:C})=>{}),p.on("mousemove",({x:w,y:C})=>{}),p.on("blank:contextmenu",({e:w})=>{});const m=d.ref(!1),b=()=>{p.isMouseWheelEnabled()?(m.value=!0,p.disablePanning(),p.disableMouseWheel()):(m.value=!1,p.enablePanning(),p.enableMouseWheel())},y=()=>{console.log(p.toJSON())};return d.onMounted(()=>{window.addEventListener("keydown",a)}),d.onBeforeUnmount(()=>{window.removeEventListener("keydown",a)}),(w,C)=>{const x=d.resolveComponent("el-tooltip"),E=d.resolveComponent("el-dropdown-item"),S=d.resolveComponent("el-dropdown-menu"),v=d.resolveComponent("el-dropdown");return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",Rx,[d.createElementVNode("div",Dx,[d.createElementVNode("a",{onClick:o},[d.createVNode(x,{effect:"light",content:"新增",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[2]||(C[2]=[d.createElementVNode("i",{class:"iconfont icon-xinjian"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:r},[d.createVNode(x,{effect:"light",content:"保存",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[3]||(C[3]=[d.createElementVNode("i",{class:"iconfont icon-baocun"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:l},[d.createVNode(x,{effect:"light",content:"清空",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[4]||(C[4]=[d.createElementVNode("i",{class:"iconfont icon-qingkong"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:c},[d.createVNode(x,{effect:"light",content:"组合",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[5]||(C[5]=[d.createElementVNode("i",{class:"iconfont icon-jianlizuhe1"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:h},[d.createVNode(x,{effect:"light",content:"删除",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[6]||(C[6]=[d.createElementVNode("i",{class:"iconfont icon-shanchu"},null,-1)])]),_:1})])]),C[10]||(C[10]=d.createElementVNode("div",{style:{flex:"1"}},null,-1)),d.createElementVNode("div",Lx,[d.createVNode(v,{onCommand:f,"split-button":"",type:"primary",plain:"",size:"small",style:{"margin-top":"8px"}},{dropdown:d.withCtx(()=>[d.createVNode(S,null,{default:d.withCtx(()=>[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(20,M=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[M>=5&&M<=20?(d.openBlock(),d.createBlock(E,{key:0,command:M},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(M)+"0%",1)]),_:2},1032,["command"])):d.createCommentVNode("",!0)],64))),64))]),_:1})]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n))+"% ",1)]),_:1})]),C[11]||(C[11]=d.createElementVNode("div",{style:{flex:"1"}},null,-1)),d.createElementVNode("div",Qx,[d.createElementVNode("a",{onClick:b},[d.createVNode(x,{effect:"light",content:"锁定/解锁画布",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[m.value?(d.openBlock(),d.createElementBlock("i",Vx)):(d.openBlock(),d.createElementBlock("i",zx))]),_:1})]),d.createElementVNode("a",{onClick:g},[d.createVNode(x,{effect:"light",content:"预览",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[7]||(C[7]=[d.createElementVNode("i",{class:"iconfont icon-yulan"},null,-1)])]),_:1})]),d.createElementVNode("a",{onClick:y},[d.createVNode(x,{effect:"light",content:"导出",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[8]||(C[8]=[d.createElementVNode("i",{class:"iconfont icon-daochu"},null,-1)])]),_:1})]),d.createElementVNode("a",null,[d.createVNode(x,{effect:"light",content:"导入",placement:"bottom","popper-class":"tooltipcolor"},{default:d.withCtx(()=>[...C[9]||(C[9]=[d.createElementVNode("i",{class:"iconfont icon-daoru"},null,-1)])]),_:1})])])]),s.value?(d.openBlock(),d.createBlock(Ox,{key:0,onClose:C[0]||(C[0]=M=>s.value=!1)})):d.createCommentVNode("",!0),u.value?(d.openBlock(),d.createBlock(Nx,{key:1,onClose:C[1]||(C[1]=M=>u.value=!1)})):d.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7ddbf68a"]]),Ux={class:"editorArea"},Kx={class:"drawBox"},Jx={style:{width:"100%",height:"100%"}},jx=vt({__name:"editorArea",props:["width","height"],setup(i){const t=On(),e=Kt(),{style:n}=be.storeToRefs(e),s=i,o=d.ref(null),r=Dr(),a=d.inject("topoApi");return d.onMounted(()=>{e.el=o.value,e.style.height=s.height||1080,e.style.width=s.width||1920,e.init(),t.services=a,t.loadAllMenus(!0)}),d.onBeforeUnmount(()=>{e.graph&&e.graph.dispose()}),(l,c)=>(d.openBlock(),d.createElementBlock("div",Ux,[d.unref(e).graph?(d.openBlock(),d.createBlock(Fx,{key:0})):d.createCommentVNode("",!0),d.createElementVNode("div",Kx,[d.createElementVNode("div",Jx,[d.createElementVNode("div",{ref_key:"container",ref:o,class:"editor-container",style:d.normalizeStyle({backgroundColor:d.unref(n).backgroundColor,backgroundImage:d.unref(n).backgroundImage?`url(${d.unref(n).backgroundImage})`:"none"})},null,4),d.createVNode(d.unref(r))])])]))}},[["__scopeId","data-v-0d80170d"]]),Gx={class:"groups-menus"},Yx=vt({__name:"menus",setup(i){const t=On(),{menus:e,current:n}=be.storeToRefs(t),s=(o,r)=>{t.setCurrentMenu(r)};return d.onMounted(()=>{console.log(e,n)}),(o,r)=>{const a=d.resolveComponent("el-icon"),l=d.resolveComponent("el-menu-item"),c=d.resolveComponent("el-sub-menu"),h=d.resolveComponent("el-menu");return d.openBlock(),d.createElementBlock("div",Gx,[d.createVNode(h,{"default-active":d.unref(n)[1],onSelect:s,"background-color":"transparent"},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(e),u=>(d.openBlock(),d.createBlock(c,{key:u.id,index:u.id,"popper-offset":100},{title:d.withCtx(()=>[d.createVNode(a,null,{default:d.withCtx(()=>[d.createVNode(d.unref(Hd))]),_:1}),d.createElementVNode("span",null,d.toDisplayString(u.name),1)]),default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.children,g=>(d.openBlock(),d.createBlock(l,{key:g.id,index:g.id},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(g.name),1)]),default:d.withCtx(()=>[d.createVNode(a,null,{default:d.withCtx(()=>[d.createVNode(d.unref(Jr))]),_:1})]),_:2},1032,["index"]))),128))]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])}}},[["__scopeId","data-v-4ccd6e37"]]),Hx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAEo1JREFUeF7t3E3I5mUVBvD/DGPISBnF5Ec5FkxFG1FykYQLK7BFi2rppo1tgkBqVeJKrFURBG1q48ZluHAjVC4MbKEEbsRamFl+NEz0QcOgw0y8Ay7H68Ccns5zP7+29/F+7ud33t6La/HOsdNn7ry8+R8BAgQIELhGgWMC5RoF/ecECBAgcEVAoPhBIECAAIEWAYHSwugSAgQIEBAofgYIECBAoEVAoLQwuoQAAQIEBIqfAQIECBBoERAoLYwuIUCAAAGB4meAAAECBFoEBEoLo0sIECBAoBwot93/8+3kzXcTI0CAAIEDEzj/5vPba09/M37rcqB8+hu/315+/K54oQECBAgQWEug+vtfoKy1d9+GAAEC7QICpZ3UhQQIEDhMAYFymHv3rQkQINAuIFDaSV1IgACBwxQQKIe5d9+aAAEC7QICpZ3UhQQIEDhMgZ0Hir9TyT9ob//z1e2NZ7+3XTj3Uh42QYDANQtc/+HPbLfc+8PtfTfefs13rXxB+juTnQdK9QNXXkr6brd/5YntreceFSgJyjmBJoGjQLnpnke2V596oOnGNa9Jv7/T+bsqbX+HUv3ANddR+1YCpeZkikCXgECpSabf3+lcoNScW6cESiunywhEAYESia4MpMBI5wKl5tw6JVBaOV1GIAoIlEgkUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICp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Q2LzA6kF5xxNfX66/5bHNw3lBAgQIEPhvgZu/e2b57Xc/HVmuPPjwIy/HUw4QIECAAIEgICg+EQIECBBYRUBQVmF0EQIECBAQFN8AAQIECKwiICirMLoIAQIECAiKb4AAAQIEVhEQlFUYXYQAAQIEBMU3QIAAAQKrCAjKKowuQoAAAQL/BNGmU82l5+MXAAAAAElFTkSuQmCC",ev=Object.assign({"../../../assets/iconfont/svg/A相手车刀闸合.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M511.9872 921.5232l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 76.8768 76.864 76.864-76.864 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 921.6z m0-102.4l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 54.4896 54.4832V290.6176l-54.4896 54.464-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68-54.4512-54.432v442.7008l54.4512-54.4512 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 819.2z m0-653.2864L435.1104 242.6816l-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68z" fill="#EF5317" /></svg>',"../../../assets/iconfont/svg/三绕组变压器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M544 64v268.256a192.064 192.064 0 0 1 147.84 256.704A192 192 0 1 1 512 904.608a192 192 0 1 1-179.84-315.68A192.064 192.064 0 0 1 480 332.256V64h64z m-197.44 555.072l-5.856 0.832A160.032 160.032 0 0 0 368 937.6a159.68 159.68 0 0 0 124.48-59.456 190.72 190.72 0 0 1-28.48-100.544c0-23.68 4.288-46.4 12.16-67.36a192 192 0 0 1-125.12-83.904l-4.48-7.264z m330.88-0.064l-0.8 1.44a192.192 192.192 0 0 1-128.832 89.824A190.72 190.72 0 0 1 560 777.6a191.104 191.104 0 0 1-28.384 100.544 160 160 0 1 0 145.824-259.104zM509.344 713.6l-2.016 4.8A159.584 159.584 0 0 0 496 777.6c0 25.024 5.76 48.672 16 69.76a158.72 158.72 0 0 0 16-69.76c0-22.784-4.768-44.448-13.344-64.064l-5.312 0.032z m-124.608-95.104l1.28 1.76a159.84 159.84 0 0 0 104.544 59.968l1.824-3.136a159.456 159.456 0 0 0-107.648-58.592z m254.56 0.064l-3.872 0.384a159.808 159.808 0 0 0-103.872 58.144l1.92 3.072a159.488 159.488 0 0 0 100.96-55.52l4.864-6.08zM512 361.6a160 160 0 0 0-146.656 224.064l2.656-0.064c57.344 0 108.8 25.152 144 64.992a191.552 191.552 0 0 1 144-64.992h2.688a160 160 0 0 0-146.688-224z" /></svg>',"../../../assets/iconfont/svg/变压器_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.0944 534.3232c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#E60012" /><path d="M633.6512 459.9808h-200.704l98.7136-158.1056 101.9904 158.1056z m-163.84-20.48h126.1568l-64.1024-99.5328-62.0544 99.5328z" fill="#E60012" /><path d="M533.0944 694.272c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896c0 81.92-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#EF7C1B" /><path d="M522.8544 611.9424h20.48v317.0304h-20.48z" fill="#EF7C1B" /><path d="M522.8544 57.9584h20.48v192.512h-20.48z" fill="#E60012" /><path d="M534.7328 632.832l-90.9312-101.9904 15.1552-13.5168 75.3664 84.3776 72.704-84.3776 15.5648 13.5168z" fill="#EF7C1B" /></svg>',"../../../assets/iconfont/svg/变压器_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 170.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333S629.824 170.666667 512 170.666667zM256 384c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M512 426.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333-95.509333-213.333333-213.333333-213.333333zM256 640c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M490.666667 981.333333v-106.666666h42.666666v106.666666h-42.666666zM490.666667 149.333333V42.666667h42.666666v106.666666h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/手持开关盒.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M431.431671 299.041479h159.572225v426.308151H431.431671z" fill="#d81e06" /><path d="M609.777099 744.122832H412.658468v-463.854556h197.118631v463.854556z m-159.572225-37.546405h122.025819v-388.761745H450.204874v388.761745z" fill="#d81e06" /><path d="M492.44458 131.568864h37.546406v186.167596h-37.546406zM492.44458 707.280422h37.546406v186.167596h-37.546406z" fill="#d81e06" /><path d="M594.993201 252.656023L511.06134 145.414101 427.129478 252.656023l-29.567794-23.153617L511.06134 84.479413l113.499656 145.022993z" fill="#d81e06" /><path d="M594.993201 168.17661L511.06134 60.934688 427.129478 168.17661l-29.567794-23.153617 113.499656-145.022993L624.560996 145.022993z" fill="#d81e06" /><path d="M511.06134 939.520587L397.561684 794.497594l29.567794-23.075396 83.931862 107.241922L594.993201 771.422198l29.567795 23.075396z" fill="#d81e06" /><path d="M511.06134 1024L397.561684 878.977007l29.567794-23.075395 83.931862 107.241922L594.993201 855.901612l29.567795 23.075395z" fill="#d81e06" /></svg>',"../../../assets/iconfont/svg/手持断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M494.481834 206.967196l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196l71.51746 87.410229-8.668783 7.223986-67.544268-82.714639-67.544268 82.714639zM566.360494 119.195767c0 0.361199 0 0.361199 0 0z" fill="#FF0000" /><path d="M494.481834 148.091711l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196L638.600353 140.867725l-8.668783 7.223986-67.544268-82.714639L494.481834 148.091711z m71.87866-87.771429c0 0.361199 0 0.361199 0 0zM562.026102 913.834215c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196z" fill="#FF0000" /><path d="M562.026102 972.7097c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196zM567.805291 849.179541h-11.197178V617.650794l-171.208466-252.839507 9.391182-6.140388 171.930864 254.284304c0.722399 1.083598 1.083598 2.167196 1.083598 3.250793v232.973545zM556.608113 178.071252h11.197178v183.489242h-11.197178z" fill="#FF0000" /><path d="M510.898342 402.654138l94.446392-90.429856 7.740501 8.087252-94.44278 90.429856z" fill="#FF0000" /><path d="M511.158406 320.35849l7.744113-8.087252 94.457227 90.415408-7.744113 8.090864zM556.608113 849.179541h11.197178v58.875485h-11.197178zM556.608113 119.195767h11.197178v58.875485h-11.197178z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/抽屉式断路器断开.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M85.18656007 375.38588444l-13.9264 0 0-387.28817777 13.9264 0z" fill="#EF1616" /><path d="M12.7726934 188.10538666l-9.84746666-9.84746666 72.41500444-72.41500444 9.84746666 9.84746666z" fill="#EF1616" /><path d="M71.25674674 115.69038222l9.84746666-9.84746665 72.41500443 72.41500443-9.84746665 9.84746667zM12.77496896 261.79811556l-9.84746667-9.84746667 72.41500445-72.41500445 9.84746666 9.84746667z" fill="#EF1616" /><path d="M71.25447117 189.38311111l9.84746667-9.84746667 72.41500445 72.41500445-9.84746667 9.84746667zM85.1797334 1037.94346667l-13.9264 0 0-387.28817778 13.9264 0z" fill="#EF1616" /><path d="M85.18769784 910.336l-9.84746665 9.84746667-72.41500445-72.41500445 9.84746666-9.84746666z" fill="#EF1616" /><path d="M143.67175118 837.92099556l9.84746666 9.84746665-72.41500444 72.41500446-9.84746666-9.84746667z" fill="#EF1616" /><path d="M85.18542229 836.64668444l-9.84746667 9.84746667-72.41500444-72.41500444 9.84746666-9.84746667z" fill="#EF1616" /><path d="M143.67402674 764.23168l9.84746666 9.84746667-72.41614222 72.41500444-9.84632889-9.84746667z" fill="#EF1616" /><path d="M19.62666674 375.38702222l118.32888888 0L137.95555561 650.33102222l-118.32888886 0-1e-8-274.944z m104.41386666 13.91502222l-90.48746666 0L33.55306674 636.40462222l90.48746666 0 0-247.10257778z" fill="#EF1616" /></svg>',"../../../assets/iconfont/svg/接地_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M531.791456 701.961295a17.407498 17.407498 0 0 1-15.824998-16.616247v-316.499956a15.824998 15.824998 0 0 1 15.824998-15.824998 17.407498 17.407498 0 0 1 15.824998 16.616248v320.456205a15.824998 15.824998 0 0 1-15.824998 11.868748zM533.373956 377.548841a18.989997 18.989997 0 0 1-11.077499 0L172.564006 27.02514a15.033748 15.033748 0 0 1 0-22.154997 15.033748 15.033748 0 0 1 22.154997 0l349.732451 345.776202a15.033748 15.033748 0 0 1 0 22.154996 14.242498 14.242498 0 0 1-11.077498 4.7475zM609.333945 1024H455.040217a15.824998 15.824998 0 0 1 0-31.649996h158.249977a15.824998 15.824998 0 0 1 0 31.649996zM762.836423 870.497522H300.746488a15.824998 15.824998 0 0 1 0-31.649996h462.089935a15.824998 15.824998 0 1 1 0 31.649996zM840.378913 716.203793H223.995249a15.824998 15.824998 0 0 1-15.824998-15.824998 15.824998 15.824998 0 0 1 15.824998-16.616247H840.378913a15.824998 15.824998 0 0 1 15.824997 16.616247 15.824998 15.824998 0 0 1-15.824997 15.824998z" /></svg>',"../../../assets/iconfont/svg/接地_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 704H213.333333v-42.666667h597.333334v42.666667zM725.333333 810.666667H298.666667v-42.666667h426.666666v42.666667zM640 917.333333H384v-42.666666h256v42.666666z" fill="#000000" /><path d="M490.666667 704V106.666667h42.666666v597.333333h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/断路器-he.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M640 176H528V0h-32v176H384v672h112v176h32V848h112z" fill="#D81E06" /></svg>',"../../../assets/iconfont/svg/断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M700.16 341.333333l55.04-55.04a42.666667 42.666667 0 0 0-60.16-60.16l-12.373333 12.373334V42.666667a42.666667 42.666667 0 0 0-85.333334 0v195.84l-12.373333-12.373334a42.666667 42.666667 0 0 0-60.16 60.16L579.84 341.333333l-55.466667 55.04a42.666667 42.666667 0 1 0 60.16 60.16L640 401.493333l55.04 55.04a42.666667 42.666667 0 1 0 60.16-60.16zM333.226667 230.826667a42.666667 42.666667 0 0 0-69.12 50.346666L597.333333 739.413333V981.333333a42.666667 42.666667 0 0 0 85.333334 0v-256a42.666667 42.666667 0 0 0-8.106667-25.173333z" /></svg>',"../../../assets/iconfont/svg/母线.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="98.08px" viewBox="0 0 2088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2088.44 442.576H5.726v138.848H2088.44V442.576z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/电池.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="100.64px" viewBox="0 0 2035 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2538.89999992 217.3c2.9-0.1 5.7-0.1 8.6-0.1" /><path d="M1344.19999992 960.2H703.99999992V130.3h640.1v829.9z m-567.5-70.1h494.8V200.4H776.69999992v689.7z" fill="#03E086" /><path d="M896.09999992 61h254.4v70H896.09999992zM1064.99999992 755.9l-80.7-39.7 63.6-129.1H855.49999992l128.3-255.3 80.4 40.5-62.7 124.8h191z" fill="#03E086" /></svg>',"../../../assets/iconfont/svg/直流逆变器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M207.36 359.936l58.624-58.624c9.216-9.216 21.418667-14.250667 34.389333-14.250667s25.173333 5.034667 34.389334 14.250667l41.557333 41.557333c17.749333 17.749333 40.96 26.88 64.341333 26.88 18.773333 0 37.632-5.802667 53.930667-17.749333l45.909333-33.621333c9.472-6.912 11.52-20.224 4.608-29.696a21.265067 21.265067 0 0 0-29.696-4.608l-45.909333 33.621333a48.452267 48.452267 0 0 1-63.146667-4.864l-41.557333-41.557333c-17.237333-17.237333-40.106667-26.709333-64.426667-26.709334-24.32 0-47.274667 9.472-64.426666 26.709334l-58.624 58.624c-8.277333 8.277333-8.277333 21.76 0 30.037333 8.277333 8.277333 21.76 8.277333 30.037333 0zM119.466667 119.466667v785.066666h785.066666V119.466667H119.466667z m706.645333 42.496L161.962667 826.112V161.962667h664.149333z m-640 700.074666l675.925333-675.925333v675.925333H186.112zM490.837333 685.568h339.882667v42.496H490.837333zM736.682667 790.101333h94.122666v42.496H736.682667zM613.717333 790.101333h94.122667v42.496H613.717333zM490.837333 790.101333h94.122667v42.496H490.837333z" /></svg>'});function nv(i){return i?(i=i.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"').replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),i=i.replace(/<([a-z]+)([^>]*?)\/?>/gi,(t,e,n)=>{const s=t.endsWith("/>")?"/>":">";return!/(fill=)/i.test(n)&&/^(path|circle|rect|polygon|polyline)$/i.test(e)?`<${e}${n} fill="currentColor"${s}`:t}),i):""}const Id="__node_panel_svg_sprite__";function iv(){if(typeof document>"u")return null;let i=document.getElementById(Id);i||(i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.id=Id,document.body.prepend(i));let t=i.querySelector("defs");return t||(t=document.createElementNS("http://www.w3.org/2000/svg","defs"),i.appendChild(t)),t}function sv(i){const t=i.match(/viewBox="([^"]+)"/i),e=i.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i);return{viewBox:t?t[1]:"",content:e?e[1]:i}}function ov(i,t){const e=iv();if(!e||e.querySelector(`#${i}`))return i;const{viewBox:n,content:s}=sv(nv(t)),o=document.createElementNS("http://www.w3.org/2000/svg","symbol");return o.setAttribute("id",i),n&&o.setAttribute("viewBox",n),o.innerHTML=s,e.appendChild(o),i}const rv=Object.entries(ev).map(([i,t])=>({name:i.split("/").pop().replace(".svg",""),id:ov(`node-icon-${i.split("/").pop().replace(".svg","")}`,t)})),av={class:"nodes"},lv={class:"groups"},cv=["onClick"],hv={class:"list"},uv={style:{width:"100%",display:"flex","justify-content":"space-between","align-items":"center",padding:"20px 10px 10px 10px"}},dv={style:{padding:"10px"}},gv=["onMousedown","title"],fv={key:1,class:"svg-icon"},pv={"aria-hidden":"true"},mv=["xlink:href"],bv=vt({__name:"nodes",setup(i){const t=Kt(),e={IMG:"img"},n=d.ref(0),s=d.ref([{name:"控件",icon:"iconfont icon-icon-relativity",active:[],children:[{name:"基础",layout:"1fr 1fr 1fr",list:[{name:"线段",renderType:"svg",icon:"icon-xianduan",data:{type:"line"}},{name:"基础文字",renderType:"text",icon:"icon-wenzi",data:{type:"text",text:"测试"}},{name:"数值",renderType:"svg",icon:"icon-shuzhi",data:{type:"svg"}},{name:"图标",renderType:"svg",icon:"icon-tubiao",data:{type:"svg"}},{name:"图片",renderType:"svg",icon:"icon-tupian",data:{type:"svg"}},{name:"自定义",renderType:"svg",icon:"icon-tupian",data:{type:"icon"}}]},{name:"图形",list:[]},{name:"表格",list:[]},{name:"图表",list:[]},{name:"表单",layout:"1fr 1fr 1fr",list:[{name:"按钮",renderType:"form",icon:"icon-shuzhi",data:{type:"button"}},{name:"文本输入框",renderType:"form",icon:"icon-shuzhi",data:{type:"input"}},{name:"数字输入框",renderType:"form",icon:"icon-shuzhi",data:{type:"number"}},{name:"选择框",renderType:"form",icon:"icon-shuzhi",data:{type:"select"}},{name:"日期框",renderType:"form",icon:"icon-shuzhi",data:{type:"date"}}]}]},{name:"模板",icon:"iconfont icon-root-list",active:[],children:[{name:"布局",layout:"1fr 1fr",list:[{name:"布局1",renderType:"img",icon:Hx,data:{type:"layout"}},{name:"布局2",renderType:"img",icon:_x,data:{type:"layout"}},{name:"布局3",renderType:"img",icon:Wx,data:{type:"layout"}},{name:"布局4",renderType:"img",icon:qx,data:{type:"layout"}},{name:"布局5",renderType:"img",icon:Xx,data:{type:"layout"}},{name:"布局6",renderType:"img",icon:$x,data:{type:"layout"}},{name:"布局7",renderType:"img",icon:Zx,data:{type:"layout"}},{name:"布局8",renderType:"img",icon:tv,data:{type:"layout"}}]}]},{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"图表",icon:"iconfont icon-icon_chart",children:[],active:[]},{name:"素材",icon:"iconfont icon-icon_image",children:[{name:"电器svg",layout:"1fr 1fr 1fr",list:rv.map(h=>({name:h.name,renderType:"svg",icon:h.id,data:{type:"svg"}}))}],active:[]}]),o=d.ref(""),r=h=>{n.value=h},a=()=>{if(s.value[n.value].active.length>0)s.value[n.value].active=[];else{const h=[];s.value[n.value].children.forEach((u,g)=>{h.push(g)}),s.value[n.value].active=h}},l=(h,u)=>{console.log(u);let g=t.graph.createNode({shape:u.renderType+"-node"});g.setData({icon:u.icon,name:u.name,...u.data}),t.dnd.start(g,h)},c=({node:h})=>{var u,g;if(((u=h.data)==null?void 0:u.type)==="line"){const f=h.position();console.log(h,h.position()),h.remove();const p=t.graph.addNode({id:"line"+crypto.randomUUID(),x:f.x-50,y:f.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),m=t.graph.addNode({id:"line"+crypto.randomUUID(),x:f.x+50,y:f.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),b=t.graph.addEdge({source:p,target:m,router:"normal",markup:[{tagName:"path",selector:"line"},{tagName:"path",selector:"line1"}],attrs:{line:{stroke:"#1bc8de80",strokeWidth:2,connection:!0,sourceMarker:"",targetMarker:""},line1:{display:"none",connection:!0,x:0,y:0,strokeWidth:4,stroke:"#91f4ffff",fill:"none",strokeDasharray:"8 8",pointerEvents:"none",style:{animation:"ant-line 30s infinite linear"}}},zIndex:0,data:{name:"line",status:[],bindData:[],realData:[]}});t.graph.select(b)}["button","input","number","select","date"].includes((g=h.data)==null?void 0:g.type)&&h.prop("size",{width:120,height:30})};return d.onMounted(()=>{var h;(h=t.graph)==null||h.on("node:added",c)}),d.onBeforeUnmount(()=>{var h;(h=t.graph)==null||h.off("node:added",c)}),(h,u)=>{const g=d.resolveComponent("el-input"),f=d.resolveComponent("el-tooltip"),p=d.resolveComponent("el-image"),m=d.resolveComponent("el-collapse-item"),b=d.resolveComponent("el-collapse");return d.openBlock(),d.createElementBlock("div",av,[d.createElementVNode("div",lv,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,(y,w)=>(d.openBlock(),d.createElementBlock("div",{key:y.index,class:d.normalizeClass(["group",{active:n.value===w}]),onClick:C=>r(w)},[d.createElementVNode("i",{class:d.normalizeClass(y.icon)},null,2),d.createElementVNode("span",null,d.toDisplayString(y.name),1)],10,cv))),128))]),d.createElementVNode("div",hv,[d.createElementVNode("div",uv,[d.createVNode(g,{modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=y=>o.value=y),style:{width:"180px"},placeholder:"请输入过滤","prefix-icon":d.unref(jr),clearable:""},null,8,["modelValue","prefix-icon"]),d.createVNode(f,{effect:"light",content:"展开/折叠",placement:"top"},{default:d.withCtx(()=>[d.createElementVNode("div",{style:{cursor:"pointer","font-size":"20px"},onClick:a},[...u[2]||(u[2]=[d.createElementVNode("i",{class:"iconfont icon-menu-fold"},null,-1)])])]),_:1})]),d.createElementVNode("div",dv,[d.createVNode(b,{modelValue:s.value[n.value].active,"onUpdate:modelValue":u[1]||(u[1]=y=>s.value[n.value].active=y),"expand-icon-position":"left",style:{border:"none","background-color":"transparent"}},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value[n.value].children,(y,w)=>(d.openBlock(),d.createBlock(m,{key:w,title:y.name,name:w},{default:d.withCtx(()=>[d.createElementVNode("div",{class:"expand-content",style:d.normalizeStyle({gridTemplateColumns:y.layout?y.layout:"1fr 1fr 1fr"})},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.list.filter(C=>C.name.includes(o.value)),(C,x)=>(d.openBlock(),d.createElementBlock("div",{key:x,class:"graphic",onMousedown:E=>l(E,C),title:C.name},[C.renderType===e.IMG?(d.openBlock(),d.createBlock(p,{key:0,src:C.icon,style:{width:"100px",height:"60px",margin:"auto"}},null,8,["src"])):(d.openBlock(),d.createElementBlock("div",fv,[(d.openBlock(),d.createElementBlock("svg",pv,[d.createElementVNode("use",{"xlink:href":"#"+C.icon},null,8,mv)]))])),d.createElementVNode("p",null,d.toDisplayString(C.name),1)],40,gv))),128))],4)]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])])])}}},[["__scopeId","data-v-91228510"]]),yv={class:"datas"},wv={class:"groups"},Cv=["onClick"],Av={class:"list"},xv={style:{padding:"10px"}},vv=["onMousedown"],Ev=vt({__name:"datas",setup(i){const t=Kt(),e=d.inject("topoApi"),n=d.ref([]);(async()=>{n.value=await e.getDeviceList()})();const o=d.ref([{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"接口",icon:"iconfont icon-icon_chart",children:[],active:[]}]),r=d.ref(0),a=m=>{r.value=m};d.ref({});const l=d.ref(""),c=d.ref(null),h={value:"id",label:"label",data:"data",children:"children"},u=()=>{c.value.filter(l.value)},g=(m,b,y)=>(console.log(m,y.label.includes(m)),y.label.includes(m)),f=(m,b)=>{var S;const y=((S=b.data)==null?void 0:S.data)||{};console.log(y);const x={type:"text",text:"--",dataSource:{type:"opcua",path:y.nodeId,parse:y.description?`const description = data.pointTemp.description;
|
|
808
808
|
const value = data.payload.value;
|
|
809
809
|
if(!description) return value
|
|
810
810
|
const a = description.split(";").map(i => {
|
|
@@ -813,13 +813,14 @@ const a = description.split(";").map(i => {
|
|
|
813
813
|
}
|
|
814
814
|
})
|
|
815
815
|
a.length = a.length - 1
|
|
816
|
-
return {"text": a.find(i => i.value == value)?.label || '--'}`:null,point:{...y},bindName:["text"]},name:b.label};let x=t.graph.createNode({shape:"text-node"});x.setData(w),t.dnd.start(x,m)},p=({node:m})=>{var b,y,C,w,x,E,S,v,M,k,I,O,D,K;if(((b=m.data)==null?void 0:b.type)!=="line"&&(y=m.data)!=null&&y.dataSource&&(w=(C=m.data)==null?void 0:C.dataSource)!=null&&w.type){const L=(E=(x=m.data)==null?void 0:x.dataSource)==null?void 0:E.type,N=(v=(S=m.data)==null?void 0:S.dataSource)==null?void 0:v.path,j=(k=(M=m.data)==null?void 0:M.dataSource)==null?void 0:k.parse,rt=(O=(I=m.data)==null?void 0:I.dataSource)==null?void 0:O.point,Ct=(K=(D=m.data)==null?void 0:D.dataSource)==null?void 0:K.bindName;L==="opcua"&&N&&e.readPoints([N]).then(pt=>{if(pt&&pt.length>0){let ct={};if(j)try{const V=new Function("data","$",j);console.log({...pt.payload,...rt}),ct=V({payload:pt[0],pointTemp:rt},{})}catch(V){console.log(V)}else ct[Ct]=pt[0].value||"--";m.setData(ct)}})}};return d.onMounted(()=>{var m;(m=t.graph)==null||m.on("node:added",p)}),d.onBeforeUnmount(()=>{var m;(m=t.graph)==null||m.off("node:added",p)}),(m,b)=>{const y=d.resolveComponent("el-button"),C=d.resolveComponent("el-input"),w=d.resolveComponent("el-icon"),x=d.resolveComponent("el-tree-v2");return d.openBlock(),d.createElementBlock("div",yv,[d.createElementVNode("div",wv,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.value,(E,S)=>(d.openBlock(),d.createElementBlock("div",{key:E.index,class:d.normalizeClass(["group",{active:r.value===S}]),onClick:v=>a(S)},[d.createElementVNode("i",{class:d.normalizeClass(E.icon)},null,2),d.createElementVNode("span",null,d.toDisplayString(E.name),1)],10,Cv))),128))]),d.createElementVNode("div",Av,[d.createElementVNode("div",xv,[d.createVNode(C,{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=E=>l.value=E),style:{height:"30px"},placeholder:"请输入名称过滤",size:"small"},{append:d.withCtx(()=>[d.createVNode(y,{icon:d.unref(jr),onClick:u},null,8,["icon"])]),_:1},8,["modelValue"])]),r.value===0?(d.openBlock(),d.createBlock(x,{key:0,ref_key:"treeRef",ref:c,style:{width:"100%"},data:n.value,props:h,height:800,"filter-method":g},{default:d.withCtx(({node:E})=>[d.createVNode(w,{class:"el-icon--left"},{default:d.withCtx(()=>[E.isLeaf?(d.openBlock(),d.createBlock(d.unref(Jr),{key:0})):E.expanded?(d.openBlock(),d.createBlock(d.unref(Jd),{key:2})):(d.openBlock(),d.createBlock(d.unref(Gd),{key:1}))]),_:2},1024),d.createElementVNode("div",{onMousedown:S=>f(S,E),style:{flex:"1"}},d.toDisplayString(E.label),41,vv)]),_:1},8,["data"])):d.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-40186c78"]]),Sv={class:"graphics"},Mv={class:"menus"},Bv=vt({__name:"index",setup(i){const t=d.ref(0);return(e,n)=>(d.openBlock(),d.createElementBlock("div",Sv,[d.createElementVNode("div",Mv,[d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===0}]),onClick:n[0]||(n[0]=s=>t.value=0)},"菜单目录",2),d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===1}]),onClick:n[1]||(n[1]=s=>t.value=1)},"系统资源",2),d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===2}]),onClick:n[2]||(n[2]=s=>t.value=2)},"我的资源",2),d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===3}]),onClick:n[3]||(n[3]=s=>t.value=3)},"数据来源",2)]),t.value===0?(d.openBlock(),d.createBlock(Yx,{key:0})):d.createCommentVNode("",!0),t.value===1?(d.openBlock(),d.createBlock(bv,{key:1})):d.createCommentVNode("",!0),t.value===3?(d.openBlock(),d.createBlock(Ev,{key:2})):d.createCommentVNode("",!0)]))}},[["__scopeId","data-v-cacbdac3"]]),kv=["src"],Tv=vt({__name:"graphProperty",setup(i){On();const t=Kt(),{style:e,name:n}=be.storeToRefs(t),s=d.ref(["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]);function o(a){return new Promise((l,c)=>{const h=new FileReader;h.onload=()=>l(h.result),h.onerror=c,h.readAsDataURL(a)})}const r=async a=>{if(!a.type.startsWith("image/"))return Et.ElMessage.error("只能上传图片文件"),!1;if(!(a.size/1024/1024<2))return Et.ElMessage.error("图片大小不能超过 2MB"),!1;try{const c=await o(a);e.value.backgroundImage=c}catch{return Et.ElMessage.error("图片读取失败"),!1}return!1};return d.ref(1920),d.ref(1080),(a,l)=>{const c=d.resolveComponent("el-input"),h=d.resolveComponent("el-form-item");d.resolveComponent("el-input-number"),d.resolveComponent("el-button");const u=d.resolveComponent("el-color-picker"),g=d.resolveComponent("el-icon"),f=d.resolveComponent("el-upload"),p=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(p,{class:"graphProperty",size:"small","label-width":"auto",onSubmit:l[4]||(l[4]=d.withModifiers(()=>{},["prevent"]))},{default:d.withCtx(()=>[d.createVNode(h,{label:"目录名称"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:d.unref(n),"onUpdate:modelValue":l[0]||(l[0]=m=>d.isRef(n)?n.value=m:null)},null,8,["modelValue"])]),_:1}),d.createCommentVNode("",!0),d.createVNode(h,{label:"背景颜色"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:d.unref(e).backgroundColor,"onUpdate:modelValue":l[3]||(l[3]=m=>d.unref(e).backgroundColor=m),"show-alpha":"",predefine:s.value,style:{width:"100%",height:"30px"}},null,8,["modelValue","predefine"])]),_:1}),d.createVNode(h,{label:"背景图片"},{default:d.withCtx(()=>[d.createVNode(f,{accept:"image/*","show-file-list":!1,"before-upload":r},{default:d.withCtx(()=>[d.unref(e).backgroundImage?(d.openBlock(),d.createElementBlock("img",{key:0,src:d.unref(e).backgroundImage,style:{width:"100%",height:"100%"}},null,8,kv)):(d.openBlock(),d.createBlock(g,{key:1,class:"avatar-uploader-icon"},{default:d.withCtx(()=>[d.createVNode(d.unref(Wd))]),_:1}))]),_:1})]),_:1})]),_:1})}}},[["__scopeId","data-v-3a1238a6"]]),Iv=vt({__name:"nodePanel",setup(i){var r;const t=Kt(),e=d.inject("cellId"),n=d.inject("getCurCell")(),s=n.getData()||{},o=d.ref({name:((r=n.getData())==null?void 0:r.name)||"",x:n.position().x,y:n.position().y,width:n.size().width,height:n.size().height,zIndex:n.prop("zIndex"),opacity:s.opacity||1,borderStyle:s.borderStyle,borderRadius:s.borderRadius,borderWidth:s.borderWidth,borderColor:s.borderColor,backgroundColor:s.backgroundColor});return d.watch(o.value,()=>{n.prop("position",{x:o.value.x,y:o.value.y}),n.prop("size",{width:o.value.width,height:o.value.height}),n.prop("zIndex",o.value.zIndex);const{name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:g,backgroundColor:f,backgroundImage:p,color:m}=o.value;n.setData({name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:g,backgroundColor:f})}),d.onMounted(()=>{t.graph.on("node:resized",({node:a})=>{a.id===e.value&&(o.value.width=a.size().width,o.value.height=a.size().height)}),t.graph.on("node:change:position",({node:a})=>{console.log(a.position()),a.id===e.value&&(o.value.x=+a.position().x.toFixed(0),o.value.y=+a.position().y.toFixed(0))})}),d.onBeforeUnmount(()=>{t.graph.off("node:resized"),t.graph.off("node:change:position")}),(a,l)=>{const c=d.resolveComponent("el-input"),h=d.resolveComponent("el-form-item"),u=d.resolveComponent("el-input-number"),g=d.resolveComponent("el-slider"),f=d.resolveComponent("el-option"),p=d.resolveComponent("el-select"),m=d.resolveComponent("el-color-picker"),b=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(b,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:d.withCtx(()=>[l[17]||(l[17]=d.createElementVNode("div",{class:"baseTitle"},"基础",-1)),d.createVNode(h,{label:"元素名称"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:o.value.name,"onUpdate:modelValue":l[0]||(l[0]=y=>o.value.name=y)},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"位置"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:o.value.x,"onUpdate:modelValue":l[1]||(l[1]=y=>o.value.x=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...l[12]||(l[12]=[d.createElementVNode("span",null,"X",-1)])]),_:1},8,["modelValue"]),d.createVNode(u,{modelValue:o.value.y,"onUpdate:modelValue":l[2]||(l[2]=y=>o.value.y=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:d.withCtx(()=>[...l[13]||(l[13]=[d.createElementVNode("span",null,"Y",-1)])]),_:1},8,["modelValue"])]),_:1}),d.createVNode(h,{label:"宽高"},{default:d.withCtx(()=>[l[16]||(l[16]=d.createElementVNode("span",null,null,-1)),d.createVNode(u,{modelValue:o.value.width,"onUpdate:modelValue":l[3]||(l[3]=y=>o.value.width=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...l[14]||(l[14]=[d.createElementVNode("span",null,"W",-1)])]),_:1},8,["modelValue"]),d.createVNode(u,{modelValue:o.value.height,"onUpdate:modelValue":l[4]||(l[4]=y=>o.value.height=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:d.withCtx(()=>[...l[15]||(l[15]=[d.createElementVNode("span",null,"H",-1)])]),_:1},8,["modelValue"])]),_:1}),d.createVNode(h,{label:"层级"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:o.value.zIndex,"onUpdate:modelValue":l[5]||(l[5]=y=>o.value.zIndex=y),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"透明度"},{default:d.withCtx(()=>[d.createVNode(g,{modelValue:o.value.opacity,"onUpdate:modelValue":l[6]||(l[6]=y=>o.value.opacity=y),min:0,max:1,step:.01,style:{width:"160px"}},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"边框"},{default:d.withCtx(()=>[d.createVNode(p,{modelValue:o.value.borderStyle,"onUpdate:modelValue":l[7]||(l[7]=y=>o.value.borderStyle=y),style:{width:"60px","margin-right":"10px"},placeholder:"样式"},{default:d.withCtx(()=>[d.createVNode(f,{label:"无",value:"none"}),d.createVNode(f,{label:"实线",value:"solid"}),d.createVNode(f,{label:"虚线",value:"dashed"}),d.createVNode(f,{label:"点线",value:"dotted"})]),_:1},8,["modelValue"]),d.createVNode(u,{modelValue:o.value.borderWidth,"onUpdate:modelValue":l[8]||(l[8]=y=>o.value.borderWidth=y),"controls-position":"right",min:0,step:1,style:{width:"60px","margin-right":"10px"},placeholder:"宽度"},null,8,["modelValue"]),d.createVNode(m,{modelValue:o.value.borderColor,"onUpdate:modelValue":l[9]||(l[9]=y=>o.value.borderColor=y),"show-alpha":"",placeholder:"颜色"},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"圆角"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:o.value.borderRadius,"onUpdate:modelValue":l[10]||(l[10]=y=>o.value.borderRadius=y),min:0,max:100,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"背景颜色"},{default:d.withCtx(()=>[d.createVNode(m,{modelValue:o.value.backgroundColor,"onUpdate:modelValue":l[11]||(l[11]=y=>o.value.backgroundColor=y),"show-alpha":"",placeholder:"颜色",style:{width:"180px",height:"30px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-71c57f2d"]]),Pv={class:"inline-row"},Ov=vt({__name:"linePanel",setup(i){var l,c;const t=d.inject("getCurCell")(),e=((l=t.getAttrs())==null?void 0:l.line)||{},n=((c=t.getAttrs())==null?void 0:c.line1)||{},s=h=>!h||h==="none"?"none":typeof h=="string"?h:h.name||"none",o=(h,u)=>!h||h==="none"?u:typeof h=="object"&&h.size?h.size:u,r=d.ref({name:"line",trackColor:e.stroke||"#754c3c",strokeWidth:e.strokeWidth??2,strokeOpacity:e.strokeOpacity??1,sourceMarker:s(e.sourceMarker)||"none",targetMarker:s(e.targetMarker)||"none",markerSize:o(e.targetMarker||e.sourceMarker,8),flowEnabled:n.display!=="none"}),a=()=>{const h=r.value;t.setData({...t.getData(),name:h.name}),t.prop("zIndex",h.zIndex),t.attr("line/stroke",h.trackColor),t.attr("line/strokeWidth",h.strokeWidth),t.attr("line/strokeOpacity",h.strokeOpacity),t.attr("line/fill","none"),t.attr("line/strokeDasharray",null),t.attr("line/strokeDashoffset",0);const u=g=>!g||g==="none"?"":{name:g,size:h.markerSize};t.attr("line/sourceMarker",u(h.sourceMarker)),t.attr("line/targetMarker",u(h.targetMarker)),h.flowEnabled?(t.attr("line/strokeWidth",8),t.attr("line1/display","inline")):t.attr("line1/display","none")};return d.watch(r,a,{deep:!0,immediate:!0}),(h,u)=>{const g=d.resolveComponent("el-input"),f=d.resolveComponent("el-form-item"),p=d.resolveComponent("el-input-number"),m=d.resolveComponent("el-color-picker"),b=d.resolveComponent("el-slider"),y=d.resolveComponent("el-option"),C=d.resolveComponent("el-select"),w=d.resolveComponent("el-switch"),x=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(x,{size:"small","label-width":"90px","label-position":"left"},{default:d.withCtx(()=>[u[9]||(u[9]=d.createElementVNode("div",{class:"baseTitle"},"连线样式",-1)),d.createVNode(f,{label:"名称"},{default:d.withCtx(()=>[d.createVNode(g,{modelValue:r.value.name,"onUpdate:modelValue":u[0]||(u[0]=E=>r.value.name=E),placeholder:""},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"层级"},{default:d.withCtx(()=>[d.createVNode(p,{modelValue:r.value.zIndex,"onUpdate:modelValue":u[1]||(u[1]=E=>r.value.zIndex=E),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"颜色"},{default:d.withCtx(()=>[d.createVNode(m,{modelValue:r.value.trackColor,"onUpdate:modelValue":u[2]||(u[2]=E=>r.value.trackColor=E),"show-alpha":"",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"粗细"},{default:d.withCtx(()=>[d.createVNode(p,{modelValue:r.value.strokeWidth,"onUpdate:modelValue":u[3]||(u[3]=E=>r.value.strokeWidth=E),min:1,step:1,"controls-position":"right",style:{width:"120px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"透明度"},{default:d.withCtx(()=>[d.createVNode(b,{modelValue:r.value.strokeOpacity,"onUpdate:modelValue":u[4]||(u[4]=E=>r.value.strokeOpacity=E),min:0,max:1,step:.01,style:{width:"180px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"箭头"},{default:d.withCtx(()=>[d.createElementVNode("div",Pv,[d.createVNode(C,{modelValue:r.value.sourceMarker,"onUpdate:modelValue":u[5]||(u[5]=E=>r.value.sourceMarker=E),style:{width:"60px","margin-right":"3px"}},{default:d.withCtx(()=>[d.createVNode(y,{label:"无",value:"none"}),d.createVNode(y,{label:"箭头",value:"block"}),d.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),d.createVNode(C,{modelValue:r.value.targetMarker,"onUpdate:modelValue":u[6]||(u[6]=E=>r.value.targetMarker=E),style:{width:"60px","margin-right":"3px"}},{default:d.withCtx(()=>[d.createVNode(y,{label:"无",value:"none"}),d.createVNode(y,{label:"箭头",value:"block"}),d.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),d.createVNode(p,{modelValue:r.value.markerSize,"onUpdate:modelValue":u[7]||(u[7]=E=>r.value.markerSize=E),min:4,max:30,step:1,"controls-position":"right",style:{width:"60px"}},null,8,["modelValue"])])]),_:1}),d.createVNode(f,{label:"动画"},{default:d.withCtx(()=>[d.createVNode(w,{modelValue:r.value.flowEnabled,"onUpdate:modelValue":u[8]||(u[8]=E=>r.value.flowEnabled=E),"active-text":"开启","inactive-text":"关闭",style:{"margin-right":"8px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-007fe38a"]]),Nv=vt({__name:"textPanel",setup(i){Kt(),d.inject("cellId");const t=d.inject("getCurCell")(),e=t.getData()||{},n=d.ref({text:e.text||"",justifyContent:e.justifyContent||"center",alignItems:e.alignItems||"center",textAlign:e.textAlign||"center",color:e.color||"#ffffff",fontWeight:e.fontWeight??400,fontSize:e.fontSize??16,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??1.4,fontFamily:e.fontFamily||"",fontStyle:e.fontStyle||"normal",textDecoration:e.textDecoration||"none",whiteSpace:e.whiteSpace||"pre-wrap",wordBreak:e.wordBreak||"break-word",textOverflow:e.textOverflow||"clip",overflow:e.overflow||"hidden",display:e.display||"block"});return d.watch(n,s=>{t.setData({...s})},{deep:!0}),(s,o)=>{const r=d.resolveComponent("el-option"),a=d.resolveComponent("el-select"),l=d.resolveComponent("el-form-item"),c=d.resolveComponent("el-input-number"),h=d.resolveComponent("el-color-picker"),u=d.resolveComponent("el-input"),g=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(g,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:d.withCtx(()=>[o[14]||(o[14]=d.createElementVNode("div",{class:"baseTitle"},"文字",-1)),d.createVNode(l,{label:"文本对齐"},{default:d.withCtx(()=>[d.createVNode(a,{modelValue:n.value.textAlign,"onUpdate:modelValue":o[0]||(o[0]=f=>n.value.textAlign=f),style:{width:"190px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"左对齐",value:"left"}),d.createVNode(r,{label:"居中",value:"center"}),d.createVNode(r,{label:"右对齐",value:"right"})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"字体"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:n.value.fontSize,"onUpdate:modelValue":o[1]||(o[1]=f=>n.value.fontSize=f),"controls-position":"right",min:8,step:1,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...o[11]||(o[11]=[d.createElementVNode("span",null,"大小",-1)])]),_:1},8,["modelValue"]),d.createVNode(a,{modelValue:n.value.fontWeight,"onUpdate:modelValue":o[2]||(o[2]=f=>n.value.fontWeight=f),modelModifiers:{number:!0},style:{width:"90px"}},{default:d.withCtx(()=>[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(7,f=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[f>2?(d.openBlock(),d.createBlock(r,{key:f,label:f*100,value:f*100},null,8,["label","value"])):d.createCommentVNode("",!0)],64))),64))]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"行高/间距"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:n.value.lineHeight,"onUpdate:modelValue":o[3]||(o[3]=f=>n.value.lineHeight=f),"controls-position":"right",min:.5,step:.1,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...o[12]||(o[12]=[d.createElementVNode("span",null,"行高",-1)])]),_:1},8,["modelValue"]),d.createVNode(c,{modelValue:n.value.letterSpacing,"onUpdate:modelValue":o[4]||(o[4]=f=>n.value.letterSpacing=f),"controls-position":"right",min:0,step:1,style:{width:"90px"}},{prefix:d.withCtx(()=>[...o[13]||(o[13]=[d.createElementVNode("span",null,"间距",-1)])]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"样式"},{default:d.withCtx(()=>[d.createVNode(a,{modelValue:n.value.fontStyle,"onUpdate:modelValue":o[5]||(o[5]=f=>n.value.fontStyle=f),style:{width:"90px","margin-right":"10px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"常规",value:"normal"}),d.createVNode(r,{label:"斜体",value:"italic"})]),_:1},8,["modelValue"]),d.createVNode(a,{modelValue:n.value.textDecoration,"onUpdate:modelValue":o[6]||(o[6]=f=>n.value.textDecoration=f),style:{width:"90px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"无",value:"none"}),d.createVNode(r,{label:"下划线",value:"underline"}),d.createVNode(r,{label:"删除线",value:"line-through"})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"换行/溢出",style:{display:"flex"}},{default:d.withCtx(()=>[d.createVNode(a,{modelValue:n.value.whiteSpace,"onUpdate:modelValue":o[7]||(o[7]=f=>n.value.whiteSpace=f),style:{width:"90px","margin-right":"10px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"自动换行",value:"pre-wrap"}),d.createVNode(r,{label:"单行",value:"nowrap"}),d.createVNode(r,{label:"普通",value:"normal"})]),_:1},8,["modelValue"]),d.createVNode(a,{modelValue:n.value.textOverflow,"onUpdate:modelValue":o[8]||(o[8]=f=>n.value.textOverflow=f),style:{width:"90px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"裁剪",value:"clip"}),d.createVNode(r,{label:"省略号",value:"ellipsis"})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"字体颜色"},{default:d.withCtx(()=>[d.createVNode(h,{modelValue:n.value.color,"onUpdate:modelValue":o[9]||(o[9]=f=>n.value.color=f),"show-alpha":"",placeholder:"颜色",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),d.createVNode(l,{label:"文本内容"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:n.value.text,"onUpdate:modelValue":o[10]||(o[10]=f=>n.value.text=f),style:{width:"200px"},rows:3,type:"textarea",placeholder:"请输入文本"},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-8c4d2068"]]),Rv={class:"propertyForm"},Dv={__name:"base",setup(i){var s;Pn(),Kt();const t=d.inject("getCurCell")(),e=d.ref(t==null?void 0:t.isNode()),n=(s=t==null?void 0:t.getData())==null?void 0:s.type;return(o,r)=>(d.openBlock(),d.createElementBlock("div",Rv,[e.value?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.createVNode(Iv),d.unref(n)==="text"?(d.openBlock(),d.createBlock(Nv,{key:0})):d.createCommentVNode("",!0)],64)):(d.openBlock(),d.createBlock(Ov,{key:1}))]))}},zr={__name:"JsonEditor",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(i,{emit:t}){const e=i,n=t,s=d.ref(null);let o=null;return d.onMounted(()=>{o=Qt.editor.create(s.value,{value:JSON.stringify(e.modelValue,null,2),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12}),o.onDidChangeModelContent(()=>{try{const r=o.getValue(),a=JSON.parse(r);n("update:modelValue",a)}catch{}})}),d.watch(()=>e.modelValue,r=>{const a=o.getValue(),l=JSON.stringify(r,null,2);a!==l&&o.setValue(l)},{deep:!0}),d.onBeforeUnmount(()=>{o==null||o.dispose()}),(r,a)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"editorContainer",ref:s,class:"json-editor"},null,512))}};function Lv(i,t=!1){const e=i.length;let n=0,s="",o=0,r=16,a=0,l=0,c=0,h=0,u=0;function g(w,x){let E=0,S=0;for(;E<w;){let v=i.charCodeAt(n);if(v>=48&&v<=57)S=S*16+v-48;else if(v>=65&&v<=70)S=S*16+v-65+10;else if(v>=97&&v<=102)S=S*16+v-97+10;else break;n++,E++}return E<w&&(S=-1),S}function f(w){n=w,s="",o=0,r=16,u=0}function p(){let w=n;if(i.charCodeAt(n)===48)n++;else for(n++;n<i.length&&Nn(i.charCodeAt(n));)n++;if(n<i.length&&i.charCodeAt(n)===46)if(n++,n<i.length&&Nn(i.charCodeAt(n)))for(n++;n<i.length&&Nn(i.charCodeAt(n));)n++;else return u=3,i.substring(w,n);let x=n;if(n<i.length&&(i.charCodeAt(n)===69||i.charCodeAt(n)===101))if(n++,(n<i.length&&i.charCodeAt(n)===43||i.charCodeAt(n)===45)&&n++,n<i.length&&Nn(i.charCodeAt(n))){for(n++;n<i.length&&Nn(i.charCodeAt(n));)n++;x=n}else u=3;return i.substring(w,x)}function m(){let w="",x=n;for(;;){if(n>=e){w+=i.substring(x,n),u=2;break}const E=i.charCodeAt(n);if(E===34){w+=i.substring(x,n),n++;break}if(E===92){if(w+=i.substring(x,n),n++,n>=e){u=2;break}switch(i.charCodeAt(n++)){case 34:w+='"';break;case 92:w+="\\";break;case 47:w+="/";break;case 98:w+="\b";break;case 102:w+="\f";break;case 110:w+=`
|
|
817
|
-
`;break;case 114:w+="\r";break;case 116:w+=" ";break;case 117:const v=g(4);v>=0?w+=String.fromCharCode(v):u=4;break;default:u=5}x=n;continue}if(E>=0&&E<=31)if(Ni(E)){w+=i.substring(x,n),u=2;break}else u=6;n++}return w}function b(){if(s="",u=0,o=n,l=a,h=c,n>=e)return o=e,r=17;let w=i.charCodeAt(n);if(Fr(w)){do n++,s+=String.fromCharCode(w),w=i.charCodeAt(n);while(Fr(w));return r=15}if(Ni(w))return n++,s+=String.fromCharCode(w),w===13&&i.charCodeAt(n)===10&&(n++,s+=`
|
|
818
|
-
|
|
816
|
+
return {"text": a.find(i => i.value == value)?.label || '--'}`:`const value = data.payload.value;
|
|
817
|
+
return {"text": value || '--'}`,point:{...y},bindName:["text"]},name:b.label};let E=t.graph.createNode({shape:"text-node"});E.setData(x),t.dnd.start(E,m)},p=({node:m})=>{var b,y,w,C,x,E,S,v,M,k,I,O,R,K;if(((b=m.data)==null?void 0:b.type)!=="line"&&(y=m.data)!=null&&y.dataSource&&(C=(w=m.data)==null?void 0:w.dataSource)!=null&&C.type){const D=(E=(x=m.data)==null?void 0:x.dataSource)==null?void 0:E.type,N=(v=(S=m.data)==null?void 0:S.dataSource)==null?void 0:v.path,j=(k=(M=m.data)==null?void 0:M.dataSource)==null?void 0:k.parse,rt=(O=(I=m.data)==null?void 0:I.dataSource)==null?void 0:O.point,Ct=(K=(R=m.data)==null?void 0:R.dataSource)==null?void 0:K.bindName;D==="opcua"&&N&&e.readPoints([N]).then(pt=>{if(pt&&pt.length>0){let ct={};if(j)try{const V=new Function("data","$",j);console.log({...pt.payload,...rt}),ct=V({payload:pt[0],pointTemp:rt},{})}catch(V){console.log(V)}else ct[Ct]=pt[0].value||"--";m.setData(ct)}})}};return d.onMounted(()=>{var m;(m=t.graph)==null||m.on("node:added",p)}),d.onBeforeUnmount(()=>{var m;(m=t.graph)==null||m.off("node:added",p)}),(m,b)=>{const y=d.resolveComponent("el-button"),w=d.resolveComponent("el-input"),C=d.resolveComponent("el-icon"),x=d.resolveComponent("el-tree-v2");return d.openBlock(),d.createElementBlock("div",yv,[d.createElementVNode("div",wv,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.value,(E,S)=>(d.openBlock(),d.createElementBlock("div",{key:E.index,class:d.normalizeClass(["group",{active:r.value===S}]),onClick:v=>a(S)},[d.createElementVNode("i",{class:d.normalizeClass(E.icon)},null,2),d.createElementVNode("span",null,d.toDisplayString(E.name),1)],10,Cv))),128))]),d.createElementVNode("div",Av,[d.createElementVNode("div",xv,[d.createVNode(w,{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=E=>l.value=E),style:{height:"30px"},placeholder:"请输入名称过滤",size:"small"},{append:d.withCtx(()=>[d.createVNode(y,{icon:d.unref(jr),onClick:u},null,8,["icon"])]),_:1},8,["modelValue"])]),r.value===0?(d.openBlock(),d.createBlock(x,{key:0,ref_key:"treeRef",ref:c,style:{width:"100%"},data:n.value,props:h,height:800,"filter-method":g},{default:d.withCtx(({node:E})=>[d.createVNode(C,{class:"el-icon--left"},{default:d.withCtx(()=>[E.isLeaf?(d.openBlock(),d.createBlock(d.unref(Jr),{key:0})):E.expanded?(d.openBlock(),d.createBlock(d.unref(Jd),{key:2})):(d.openBlock(),d.createBlock(d.unref(Gd),{key:1}))]),_:2},1024),d.createElementVNode("div",{onMousedown:S=>f(S,E),style:{flex:"1"}},d.toDisplayString(E.label),41,vv)]),_:1},8,["data"])):d.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-c06c9e44"]]),Sv={class:"graphics"},Mv={class:"menus"},Bv=vt({__name:"index",setup(i){const t=d.ref(0);return(e,n)=>(d.openBlock(),d.createElementBlock("div",Sv,[d.createElementVNode("div",Mv,[d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===0}]),onClick:n[0]||(n[0]=s=>t.value=0)},"菜单目录",2),d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===1}]),onClick:n[1]||(n[1]=s=>t.value=1)},"系统资源",2),d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===2}]),onClick:n[2]||(n[2]=s=>t.value=2)},"我的资源",2),d.createElementVNode("div",{class:d.normalizeClass(["menu",{active:t.value===3}]),onClick:n[3]||(n[3]=s=>t.value=3)},"数据来源",2)]),t.value===0?(d.openBlock(),d.createBlock(Yx,{key:0})):d.createCommentVNode("",!0),t.value===1?(d.openBlock(),d.createBlock(bv,{key:1})):d.createCommentVNode("",!0),t.value===3?(d.openBlock(),d.createBlock(Ev,{key:2})):d.createCommentVNode("",!0)]))}},[["__scopeId","data-v-cacbdac3"]]),kv=["src"],Tv=vt({__name:"graphProperty",setup(i){On();const t=Kt(),{style:e,name:n}=be.storeToRefs(t),s=d.ref(["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]);function o(a){return new Promise((l,c)=>{const h=new FileReader;h.onload=()=>l(h.result),h.onerror=c,h.readAsDataURL(a)})}const r=async a=>{if(!a.type.startsWith("image/"))return St.ElMessage.error("只能上传图片文件"),!1;if(!(a.size/1024/1024<2))return St.ElMessage.error("图片大小不能超过 2MB"),!1;try{const c=await o(a);e.value.backgroundImage=c}catch{return St.ElMessage.error("图片读取失败"),!1}return!1};return d.ref(1920),d.ref(1080),(a,l)=>{const c=d.resolveComponent("el-input"),h=d.resolveComponent("el-form-item");d.resolveComponent("el-input-number"),d.resolveComponent("el-button");const u=d.resolveComponent("el-color-picker"),g=d.resolveComponent("el-icon"),f=d.resolveComponent("el-upload"),p=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(p,{class:"graphProperty",size:"small","label-width":"auto",onSubmit:l[4]||(l[4]=d.withModifiers(()=>{},["prevent"]))},{default:d.withCtx(()=>[d.createVNode(h,{label:"目录名称"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:d.unref(n),"onUpdate:modelValue":l[0]||(l[0]=m=>d.isRef(n)?n.value=m:null)},null,8,["modelValue"])]),_:1}),d.createCommentVNode("",!0),d.createVNode(h,{label:"背景颜色"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:d.unref(e).backgroundColor,"onUpdate:modelValue":l[3]||(l[3]=m=>d.unref(e).backgroundColor=m),"show-alpha":"",predefine:s.value,style:{width:"100%",height:"30px"}},null,8,["modelValue","predefine"])]),_:1}),d.createVNode(h,{label:"背景图片"},{default:d.withCtx(()=>[d.createVNode(f,{accept:"image/*","show-file-list":!1,"before-upload":r},{default:d.withCtx(()=>[d.unref(e).backgroundImage?(d.openBlock(),d.createElementBlock("img",{key:0,src:d.unref(e).backgroundImage,style:{width:"100%",height:"100%"}},null,8,kv)):(d.openBlock(),d.createBlock(g,{key:1,class:"avatar-uploader-icon"},{default:d.withCtx(()=>[d.createVNode(d.unref(Wd))]),_:1}))]),_:1})]),_:1})]),_:1})}}},[["__scopeId","data-v-3a1238a6"]]),Iv=vt({__name:"nodePanel",setup(i){var r;const t=Kt(),e=d.inject("cellId"),n=d.inject("getCurCell")(),s=n.getData()||{},o=d.ref({name:((r=n.getData())==null?void 0:r.name)||"",x:n.position().x,y:n.position().y,width:n.size().width,height:n.size().height,zIndex:n.prop("zIndex"),opacity:s.opacity||1,borderStyle:s.borderStyle,borderRadius:s.borderRadius,borderWidth:s.borderWidth,borderColor:s.borderColor,backgroundColor:s.backgroundColor});return d.watch(o.value,()=>{n.prop("position",{x:o.value.x,y:o.value.y}),n.prop("size",{width:o.value.width,height:o.value.height}),n.prop("zIndex",o.value.zIndex);const{name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:g,backgroundColor:f,backgroundImage:p,color:m}=o.value;n.setData({name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:g,backgroundColor:f})}),d.onMounted(()=>{t.graph.on("node:resized",({node:a})=>{a.id===e.value&&(o.value.width=a.size().width,o.value.height=a.size().height)}),t.graph.on("node:change:position",({node:a})=>{console.log(a.position()),a.id===e.value&&(o.value.x=+a.position().x.toFixed(0),o.value.y=+a.position().y.toFixed(0))})}),d.onBeforeUnmount(()=>{var a,l;(a=t.graph)==null||a.off("node:resized"),(l=t.graph)==null||l.off("node:change:position")}),(a,l)=>{const c=d.resolveComponent("el-input"),h=d.resolveComponent("el-form-item"),u=d.resolveComponent("el-input-number"),g=d.resolveComponent("el-slider"),f=d.resolveComponent("el-option"),p=d.resolveComponent("el-select"),m=d.resolveComponent("el-color-picker"),b=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(b,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:d.withCtx(()=>[l[17]||(l[17]=d.createElementVNode("div",{class:"baseTitle"},"基础",-1)),d.createVNode(h,{label:"元素名称"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:o.value.name,"onUpdate:modelValue":l[0]||(l[0]=y=>o.value.name=y)},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"位置"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:o.value.x,"onUpdate:modelValue":l[1]||(l[1]=y=>o.value.x=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...l[12]||(l[12]=[d.createElementVNode("span",null,"X",-1)])]),_:1},8,["modelValue"]),d.createVNode(u,{modelValue:o.value.y,"onUpdate:modelValue":l[2]||(l[2]=y=>o.value.y=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:d.withCtx(()=>[...l[13]||(l[13]=[d.createElementVNode("span",null,"Y",-1)])]),_:1},8,["modelValue"])]),_:1}),d.createVNode(h,{label:"宽高"},{default:d.withCtx(()=>[l[16]||(l[16]=d.createElementVNode("span",null,null,-1)),d.createVNode(u,{modelValue:o.value.width,"onUpdate:modelValue":l[3]||(l[3]=y=>o.value.width=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...l[14]||(l[14]=[d.createElementVNode("span",null,"W",-1)])]),_:1},8,["modelValue"]),d.createVNode(u,{modelValue:o.value.height,"onUpdate:modelValue":l[4]||(l[4]=y=>o.value.height=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:d.withCtx(()=>[...l[15]||(l[15]=[d.createElementVNode("span",null,"H",-1)])]),_:1},8,["modelValue"])]),_:1}),d.createVNode(h,{label:"层级"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:o.value.zIndex,"onUpdate:modelValue":l[5]||(l[5]=y=>o.value.zIndex=y),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"透明度"},{default:d.withCtx(()=>[d.createVNode(g,{modelValue:o.value.opacity,"onUpdate:modelValue":l[6]||(l[6]=y=>o.value.opacity=y),min:0,max:1,step:.01,style:{width:"160px"}},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"边框"},{default:d.withCtx(()=>[d.createVNode(p,{modelValue:o.value.borderStyle,"onUpdate:modelValue":l[7]||(l[7]=y=>o.value.borderStyle=y),style:{width:"60px","margin-right":"10px"},placeholder:"样式"},{default:d.withCtx(()=>[d.createVNode(f,{label:"无",value:"none"}),d.createVNode(f,{label:"实线",value:"solid"}),d.createVNode(f,{label:"虚线",value:"dashed"}),d.createVNode(f,{label:"点线",value:"dotted"})]),_:1},8,["modelValue"]),d.createVNode(u,{modelValue:o.value.borderWidth,"onUpdate:modelValue":l[8]||(l[8]=y=>o.value.borderWidth=y),"controls-position":"right",min:0,step:1,style:{width:"60px","margin-right":"10px"},placeholder:"宽度"},null,8,["modelValue"]),d.createVNode(m,{modelValue:o.value.borderColor,"onUpdate:modelValue":l[9]||(l[9]=y=>o.value.borderColor=y),"show-alpha":"",placeholder:"颜色"},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"圆角"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:o.value.borderRadius,"onUpdate:modelValue":l[10]||(l[10]=y=>o.value.borderRadius=y),min:0,max:100,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),d.createVNode(h,{label:"背景颜色"},{default:d.withCtx(()=>[d.createVNode(m,{modelValue:o.value.backgroundColor,"onUpdate:modelValue":l[11]||(l[11]=y=>o.value.backgroundColor=y),"show-alpha":"",placeholder:"颜色",style:{width:"180px",height:"30px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-a035d9fd"]]),Pv={class:"inline-row"},Ov=vt({__name:"linePanel",setup(i){var l,c;const t=d.inject("getCurCell")(),e=((l=t.getAttrs())==null?void 0:l.line)||{},n=((c=t.getAttrs())==null?void 0:c.line1)||{},s=h=>!h||h==="none"?"none":typeof h=="string"?h:h.name||"none",o=(h,u)=>!h||h==="none"?u:typeof h=="object"&&h.size?h.size:u,r=d.ref({name:"line",trackColor:e.stroke||"#754c3c",strokeWidth:e.strokeWidth??2,strokeOpacity:e.strokeOpacity??1,sourceMarker:s(e.sourceMarker)||"none",targetMarker:s(e.targetMarker)||"none",markerSize:o(e.targetMarker||e.sourceMarker,8),flowEnabled:n.display!=="none"}),a=()=>{const h=r.value;t.setData({...t.getData(),name:h.name}),t.prop("zIndex",h.zIndex),t.attr("line/stroke",h.trackColor),t.attr("line/strokeWidth",h.strokeWidth),t.attr("line/strokeOpacity",h.strokeOpacity),t.attr("line/fill","none"),t.attr("line/strokeDasharray",null),t.attr("line/strokeDashoffset",0);const u=g=>!g||g==="none"?"":{name:g,size:h.markerSize};t.attr("line/sourceMarker",u(h.sourceMarker)),t.attr("line/targetMarker",u(h.targetMarker)),h.flowEnabled?(t.attr("line/strokeWidth",8),t.attr("line1/display","inline")):t.attr("line1/display","none")};return d.watch(r,a,{deep:!0,immediate:!0}),(h,u)=>{const g=d.resolveComponent("el-input"),f=d.resolveComponent("el-form-item"),p=d.resolveComponent("el-input-number"),m=d.resolveComponent("el-color-picker"),b=d.resolveComponent("el-slider"),y=d.resolveComponent("el-option"),w=d.resolveComponent("el-select"),C=d.resolveComponent("el-switch"),x=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(x,{size:"small","label-width":"90px","label-position":"left"},{default:d.withCtx(()=>[u[9]||(u[9]=d.createElementVNode("div",{class:"baseTitle"},"连线样式",-1)),d.createVNode(f,{label:"名称"},{default:d.withCtx(()=>[d.createVNode(g,{modelValue:r.value.name,"onUpdate:modelValue":u[0]||(u[0]=E=>r.value.name=E),placeholder:""},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"层级"},{default:d.withCtx(()=>[d.createVNode(p,{modelValue:r.value.zIndex,"onUpdate:modelValue":u[1]||(u[1]=E=>r.value.zIndex=E),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"颜色"},{default:d.withCtx(()=>[d.createVNode(m,{modelValue:r.value.trackColor,"onUpdate:modelValue":u[2]||(u[2]=E=>r.value.trackColor=E),"show-alpha":"",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"粗细"},{default:d.withCtx(()=>[d.createVNode(p,{modelValue:r.value.strokeWidth,"onUpdate:modelValue":u[3]||(u[3]=E=>r.value.strokeWidth=E),min:1,step:1,"controls-position":"right",style:{width:"120px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"透明度"},{default:d.withCtx(()=>[d.createVNode(b,{modelValue:r.value.strokeOpacity,"onUpdate:modelValue":u[4]||(u[4]=E=>r.value.strokeOpacity=E),min:0,max:1,step:.01,style:{width:"180px"}},null,8,["modelValue"])]),_:1}),d.createVNode(f,{label:"箭头"},{default:d.withCtx(()=>[d.createElementVNode("div",Pv,[d.createVNode(w,{modelValue:r.value.sourceMarker,"onUpdate:modelValue":u[5]||(u[5]=E=>r.value.sourceMarker=E),style:{width:"60px","margin-right":"3px"}},{default:d.withCtx(()=>[d.createVNode(y,{label:"无",value:"none"}),d.createVNode(y,{label:"箭头",value:"block"}),d.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),d.createVNode(w,{modelValue:r.value.targetMarker,"onUpdate:modelValue":u[6]||(u[6]=E=>r.value.targetMarker=E),style:{width:"60px","margin-right":"3px"}},{default:d.withCtx(()=>[d.createVNode(y,{label:"无",value:"none"}),d.createVNode(y,{label:"箭头",value:"block"}),d.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),d.createVNode(p,{modelValue:r.value.markerSize,"onUpdate:modelValue":u[7]||(u[7]=E=>r.value.markerSize=E),min:4,max:30,step:1,"controls-position":"right",style:{width:"60px"}},null,8,["modelValue"])])]),_:1}),d.createVNode(f,{label:"动画"},{default:d.withCtx(()=>[d.createVNode(C,{modelValue:r.value.flowEnabled,"onUpdate:modelValue":u[8]||(u[8]=E=>r.value.flowEnabled=E),"active-text":"开启","inactive-text":"关闭",style:{"margin-right":"8px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-007fe38a"]]),Nv=vt({__name:"textPanel",setup(i){Kt(),d.inject("cellId");const t=d.inject("getCurCell")(),e=t.getData()||{},n=d.ref({text:e.text||"",justifyContent:e.justifyContent||"center",alignItems:e.alignItems||"center",textAlign:e.textAlign||"center",color:e.color||"#ffffff",fontWeight:e.fontWeight??400,fontSize:e.fontSize??16,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??1.4,fontFamily:e.fontFamily||"",fontStyle:e.fontStyle||"normal",textDecoration:e.textDecoration||"none",whiteSpace:e.whiteSpace||"pre-wrap",wordBreak:e.wordBreak||"break-word",textOverflow:e.textOverflow||"clip",overflow:e.overflow||"hidden",display:e.display||"block"});return d.watch(n,s=>{t.setData({...s})},{deep:!0}),(s,o)=>{const r=d.resolveComponent("el-option"),a=d.resolveComponent("el-select"),l=d.resolveComponent("el-form-item"),c=d.resolveComponent("el-input-number"),h=d.resolveComponent("el-color-picker"),u=d.resolveComponent("el-input"),g=d.resolveComponent("el-form");return d.openBlock(),d.createBlock(g,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:d.withCtx(()=>[o[14]||(o[14]=d.createElementVNode("div",{class:"baseTitle"},"文字",-1)),d.createVNode(l,{label:"文本对齐"},{default:d.withCtx(()=>[d.createVNode(a,{modelValue:n.value.textAlign,"onUpdate:modelValue":o[0]||(o[0]=f=>n.value.textAlign=f),style:{width:"190px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"左对齐",value:"left"}),d.createVNode(r,{label:"居中",value:"center"}),d.createVNode(r,{label:"右对齐",value:"right"})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"字体"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:n.value.fontSize,"onUpdate:modelValue":o[1]||(o[1]=f=>n.value.fontSize=f),"controls-position":"right",min:8,step:1,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...o[11]||(o[11]=[d.createElementVNode("span",null,"大小",-1)])]),_:1},8,["modelValue"]),d.createVNode(a,{modelValue:n.value.fontWeight,"onUpdate:modelValue":o[2]||(o[2]=f=>n.value.fontWeight=f),modelModifiers:{number:!0},style:{width:"90px"}},{default:d.withCtx(()=>[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(7,f=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[f>2?(d.openBlock(),d.createBlock(r,{key:f,label:f*100,value:f*100},null,8,["label","value"])):d.createCommentVNode("",!0)],64))),64))]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"行高/间距"},{default:d.withCtx(()=>[d.createVNode(c,{modelValue:n.value.lineHeight,"onUpdate:modelValue":o[3]||(o[3]=f=>n.value.lineHeight=f),"controls-position":"right",min:.5,step:.1,style:{width:"90px","margin-right":"10px"}},{prefix:d.withCtx(()=>[...o[12]||(o[12]=[d.createElementVNode("span",null,"行高",-1)])]),_:1},8,["modelValue"]),d.createVNode(c,{modelValue:n.value.letterSpacing,"onUpdate:modelValue":o[4]||(o[4]=f=>n.value.letterSpacing=f),"controls-position":"right",min:0,step:1,style:{width:"90px"}},{prefix:d.withCtx(()=>[...o[13]||(o[13]=[d.createElementVNode("span",null,"间距",-1)])]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"样式"},{default:d.withCtx(()=>[d.createVNode(a,{modelValue:n.value.fontStyle,"onUpdate:modelValue":o[5]||(o[5]=f=>n.value.fontStyle=f),style:{width:"90px","margin-right":"10px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"常规",value:"normal"}),d.createVNode(r,{label:"斜体",value:"italic"})]),_:1},8,["modelValue"]),d.createVNode(a,{modelValue:n.value.textDecoration,"onUpdate:modelValue":o[6]||(o[6]=f=>n.value.textDecoration=f),style:{width:"90px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"无",value:"none"}),d.createVNode(r,{label:"下划线",value:"underline"}),d.createVNode(r,{label:"删除线",value:"line-through"})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"换行/溢出",style:{display:"flex"}},{default:d.withCtx(()=>[d.createVNode(a,{modelValue:n.value.whiteSpace,"onUpdate:modelValue":o[7]||(o[7]=f=>n.value.whiteSpace=f),style:{width:"90px","margin-right":"10px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"自动换行",value:"pre-wrap"}),d.createVNode(r,{label:"单行",value:"nowrap"}),d.createVNode(r,{label:"普通",value:"normal"})]),_:1},8,["modelValue"]),d.createVNode(a,{modelValue:n.value.textOverflow,"onUpdate:modelValue":o[8]||(o[8]=f=>n.value.textOverflow=f),style:{width:"90px"}},{default:d.withCtx(()=>[d.createVNode(r,{label:"裁剪",value:"clip"}),d.createVNode(r,{label:"省略号",value:"ellipsis"})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(l,{label:"字体颜色"},{default:d.withCtx(()=>[d.createVNode(h,{modelValue:n.value.color,"onUpdate:modelValue":o[9]||(o[9]=f=>n.value.color=f),"show-alpha":"",placeholder:"颜色",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),d.createVNode(l,{label:"文本内容"},{default:d.withCtx(()=>[d.createVNode(u,{modelValue:n.value.text,"onUpdate:modelValue":o[10]||(o[10]=f=>n.value.text=f),style:{width:"200px"},rows:3,type:"textarea",placeholder:"请输入文本"},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-8c4d2068"]]),Rv={class:"propertyForm"},Dv={__name:"base",setup(i){var s;Pn(),Kt();const t=d.inject("getCurCell")(),e=d.ref(t==null?void 0:t.isNode()),n=(s=t==null?void 0:t.getData())==null?void 0:s.type;return(o,r)=>(d.openBlock(),d.createElementBlock("div",Rv,[e.value?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.createVNode(Iv),d.unref(n)==="text"?(d.openBlock(),d.createBlock(Nv,{key:0})):d.createCommentVNode("",!0)],64)):(d.openBlock(),d.createBlock(Ov,{key:1}))]))}},zr={__name:"JsonEditor",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(i,{emit:t}){const e=i,n=t,s=d.ref(null);let o=null;return d.onMounted(()=>{o=Qt.editor.create(s.value,{value:JSON.stringify(e.modelValue,null,2),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12}),o.onDidChangeModelContent(()=>{try{const r=o.getValue(),a=JSON.parse(r);n("update:modelValue",a)}catch{}})}),d.watch(()=>e.modelValue,r=>{const a=o.getValue(),l=JSON.stringify(r,null,2);a!==l&&o.setValue(l)},{deep:!0}),d.onBeforeUnmount(()=>{o==null||o.dispose()}),(r,a)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"editorContainer",ref:s,class:"json-editor"},null,512))}};function Lv(i,t=!1){const e=i.length;let n=0,s="",o=0,r=16,a=0,l=0,c=0,h=0,u=0;function g(C,x){let E=0,S=0;for(;E<C;){let v=i.charCodeAt(n);if(v>=48&&v<=57)S=S*16+v-48;else if(v>=65&&v<=70)S=S*16+v-65+10;else if(v>=97&&v<=102)S=S*16+v-97+10;else break;n++,E++}return E<C&&(S=-1),S}function f(C){n=C,s="",o=0,r=16,u=0}function p(){let C=n;if(i.charCodeAt(n)===48)n++;else for(n++;n<i.length&&Nn(i.charCodeAt(n));)n++;if(n<i.length&&i.charCodeAt(n)===46)if(n++,n<i.length&&Nn(i.charCodeAt(n)))for(n++;n<i.length&&Nn(i.charCodeAt(n));)n++;else return u=3,i.substring(C,n);let x=n;if(n<i.length&&(i.charCodeAt(n)===69||i.charCodeAt(n)===101))if(n++,(n<i.length&&i.charCodeAt(n)===43||i.charCodeAt(n)===45)&&n++,n<i.length&&Nn(i.charCodeAt(n))){for(n++;n<i.length&&Nn(i.charCodeAt(n));)n++;x=n}else u=3;return i.substring(C,x)}function m(){let C="",x=n;for(;;){if(n>=e){C+=i.substring(x,n),u=2;break}const E=i.charCodeAt(n);if(E===34){C+=i.substring(x,n),n++;break}if(E===92){if(C+=i.substring(x,n),n++,n>=e){u=2;break}switch(i.charCodeAt(n++)){case 34:C+='"';break;case 92:C+="\\";break;case 47:C+="/";break;case 98:C+="\b";break;case 102:C+="\f";break;case 110:C+=`
|
|
818
|
+
`;break;case 114:C+="\r";break;case 116:C+=" ";break;case 117:const v=g(4);v>=0?C+=String.fromCharCode(v):u=4;break;default:u=5}x=n;continue}if(E>=0&&E<=31)if(Ni(E)){C+=i.substring(x,n),u=2;break}else u=6;n++}return C}function b(){if(s="",u=0,o=n,l=a,h=c,n>=e)return o=e,r=17;let C=i.charCodeAt(n);if(Fr(C)){do n++,s+=String.fromCharCode(C),C=i.charCodeAt(n);while(Fr(C));return r=15}if(Ni(C))return n++,s+=String.fromCharCode(C),C===13&&i.charCodeAt(n)===10&&(n++,s+=`
|
|
819
|
+
`),a++,c=n,r=14;switch(C){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,s=m(),r=10;case 47:const x=n-1;if(i.charCodeAt(n+1)===47){for(n+=2;n<e&&!Ni(i.charCodeAt(n));)n++;return s=i.substring(x,n),r=12}if(i.charCodeAt(n+1)===42){n+=2;const E=e-1;let S=!1;for(;n<E;){const v=i.charCodeAt(n);if(v===42&&i.charCodeAt(n+1)===47){n+=2,S=!0;break}n++,Ni(v)&&(v===13&&i.charCodeAt(n)===10&&n++,a++,c=n)}return S||(n++,u=1),s=i.substring(x,n),r=13}return s+=String.fromCharCode(C),n++,r=16;case 45:if(s+=String.fromCharCode(C),n++,n===e||!Nn(i.charCodeAt(n)))return r=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=p(),r=11;default:for(;n<e&&y(C);)n++,C=i.charCodeAt(n);if(o!==n){switch(s=i.substring(o,n),s){case"true":return r=8;case"false":return r=9;case"null":return r=7}return r=16}return s+=String.fromCharCode(C),n++,r=16}}function y(C){if(Fr(C)||Ni(C))return!1;switch(C){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function w(){let C;do C=b();while(C>=12&&C<=15);return C}return{setPosition:f,getPosition:()=>n,scan:t?w:b,getToken:()=>r,getTokenValue:()=>s,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>l,getTokenStartCharacter:()=>o-h,getTokenError:()=>u}}function Fr(i){return i===32||i===9}function Ni(i){return i===10||i===13}function Nn(i){return i>=48&&i<=57}var Pd;(function(i){i[i.lineFeed=10]="lineFeed",i[i.carriageReturn=13]="carriageReturn",i[i.space=32]="space",i[i._0=48]="_0",i[i._1=49]="_1",i[i._2=50]="_2",i[i._3=51]="_3",i[i._4=52]="_4",i[i._5=53]="_5",i[i._6=54]="_6",i[i._7=55]="_7",i[i._8=56]="_8",i[i._9=57]="_9",i[i.a=97]="a",i[i.b=98]="b",i[i.c=99]="c",i[i.d=100]="d",i[i.e=101]="e",i[i.f=102]="f",i[i.g=103]="g",i[i.h=104]="h",i[i.i=105]="i",i[i.j=106]="j",i[i.k=107]="k",i[i.l=108]="l",i[i.m=109]="m",i[i.n=110]="n",i[i.o=111]="o",i[i.p=112]="p",i[i.q=113]="q",i[i.r=114]="r",i[i.s=115]="s",i[i.t=116]="t",i[i.u=117]="u",i[i.v=118]="v",i[i.w=119]="w",i[i.x=120]="x",i[i.y=121]="y",i[i.z=122]="z",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.asterisk=42]="asterisk",i[i.backslash=92]="backslash",i[i.closeBrace=125]="closeBrace",i[i.closeBracket=93]="closeBracket",i[i.colon=58]="colon",i[i.comma=44]="comma",i[i.dot=46]="dot",i[i.doubleQuote=34]="doubleQuote",i[i.minus=45]="minus",i[i.openBrace=123]="openBrace",i[i.openBracket=91]="openBracket",i[i.plus=43]="plus",i[i.slash=47]="slash",i[i.formFeed=12]="formFeed",i[i.tab=9]="tab"})(Pd||(Pd={})),new Array(20).fill(0).map((i,t)=>" ".repeat(t));const Rn=200;new Array(Rn).fill(0).map((i,t)=>`
|
|
819
820
|
`+" ".repeat(t)),new Array(Rn).fill(0).map((i,t)=>"\r"+" ".repeat(t)),new Array(Rn).fill(0).map((i,t)=>`\r
|
|
820
821
|
`+" ".repeat(t)),new Array(Rn).fill(0).map((i,t)=>`
|
|
821
822
|
`+" ".repeat(t)),new Array(Rn).fill(0).map((i,t)=>"\r"+" ".repeat(t)),new Array(Rn).fill(0).map((i,t)=>`\r
|
|
822
|
-
`+" ".repeat(t));var Ur;(function(i){i.DEFAULT={allowTrailingComma:!1}})(Ur||(Ur={}));function Qv(i,t){const e=[],n=new Object;let s;const o={value:{},offset:0,length:0,type:"object",parent:void 0};let r=!1;function a(l,c,h,u){o.value=l,o.offset=c,o.length=h,o.type=u,o.colonOffset=void 0,s=o}try{Vv(i,{onObjectBegin:(l,c)=>{if(t<=l)throw n;s=void 0,r=t>l,e.push("")},onObjectProperty:(l,c,h)=>{if(t<c||(a(l,c,h,"property"),e[e.length-1]=l,t<=c+h))throw n},onObjectEnd:(l,c)=>{if(t<=l)throw n;s=void 0,e.pop()},onArrayBegin:(l,c)=>{if(t<=l)throw n;s=void 0,e.push(0)},onArrayEnd:(l,c)=>{if(t<=l)throw n;s=void 0,e.pop()},onLiteralValue:(l,c,h)=>{if(t<c||(a(l,c,h,zv(l)),t<=c+h))throw n},onSeparator:(l,c,h)=>{if(t<=c)throw n;if(l===":"&&s&&s.type==="property")s.colonOffset=c,r=!1,s=void 0;else if(l===","){const u=e[e.length-1];typeof u=="number"?e[e.length-1]=u+1:(r=!0,e[e.length-1]=""),s=void 0}}})}catch(l){if(l!==n)throw l}return{path:e,previousNode:s,isAtPropertyKey:r,matches:l=>{let c=0;for(let h=0;c<l.length&&h<e.length;h++)if(l[c]===e[h]||l[c]==="*")c++;else if(l[c]!=="**")return!1;return c===l.length}}}function Vv(i,t,e=Ur.DEFAULT){const n=Lv(i,!1),s=[];let o=0;function r(
|
|
823
|
+
`+" ".repeat(t));var Ur;(function(i){i.DEFAULT={allowTrailingComma:!1}})(Ur||(Ur={}));function Qv(i,t){const e=[],n=new Object;let s;const o={value:{},offset:0,length:0,type:"object",parent:void 0};let r=!1;function a(l,c,h,u){o.value=l,o.offset=c,o.length=h,o.type=u,o.colonOffset=void 0,s=o}try{Vv(i,{onObjectBegin:(l,c)=>{if(t<=l)throw n;s=void 0,r=t>l,e.push("")},onObjectProperty:(l,c,h)=>{if(t<c||(a(l,c,h,"property"),e[e.length-1]=l,t<=c+h))throw n},onObjectEnd:(l,c)=>{if(t<=l)throw n;s=void 0,e.pop()},onArrayBegin:(l,c)=>{if(t<=l)throw n;s=void 0,e.push(0)},onArrayEnd:(l,c)=>{if(t<=l)throw n;s=void 0,e.pop()},onLiteralValue:(l,c,h)=>{if(t<c||(a(l,c,h,zv(l)),t<=c+h))throw n},onSeparator:(l,c,h)=>{if(t<=c)throw n;if(l===":"&&s&&s.type==="property")s.colonOffset=c,r=!1,s=void 0;else if(l===","){const u=e[e.length-1];typeof u=="number"?e[e.length-1]=u+1:(r=!0,e[e.length-1]=""),s=void 0}}})}catch(l){if(l!==n)throw l}return{path:e,previousNode:s,isAtPropertyKey:r,matches:l=>{let c=0;for(let h=0;c<l.length&&h<e.length;h++)if(l[c]===e[h]||l[c]==="*")c++;else if(l[c]!=="**")return!1;return c===l.length}}}function Vv(i,t,e=Ur.DEFAULT){const n=Lv(i,!1),s=[];let o=0;function r(D){return D?()=>o===0&&D(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(D){return D?N=>o===0&&D(N,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function l(D){return D?N=>o===0&&D(N,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice()):()=>!0}function c(D){return D?()=>{o>0?o++:D(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice())===!1&&(o=1)}:()=>!0}function h(D){return D?()=>{o>0&&o--,o===0&&D(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}const u=c(t.onObjectBegin),g=l(t.onObjectProperty),f=h(t.onObjectEnd),p=c(t.onArrayBegin),m=h(t.onArrayEnd),b=l(t.onLiteralValue),y=a(t.onSeparator),w=r(t.onComment),C=a(t.onError),x=e&&e.disallowComments,E=e&&e.allowTrailingComma;function S(){for(;;){const D=n.scan();switch(n.getTokenError()){case 4:v(14);break;case 5:v(15);break;case 3:v(13);break;case 1:x||v(11);break;case 2:v(12);break;case 6:v(16);break}switch(D){case 12:case 13:x?v(10):w();break;case 16:v(1);break;case 15:case 14:break;default:return D}}}function v(D,N=[],j=[]){if(C(D),N.length+j.length>0){let rt=n.getToken();for(;rt!==17;){if(N.indexOf(rt)!==-1){S();break}else if(j.indexOf(rt)!==-1)break;rt=S()}}}function M(D){const N=n.getTokenValue();return D?b(N):(g(N),s.push(N)),S(),!0}function k(){switch(n.getToken()){case 11:const D=n.getTokenValue();let N=Number(D);isNaN(N)&&(v(2),N=0),b(N);break;case 7:b(null);break;case 8:b(!0);break;case 9:b(!1);break;default:return!1}return S(),!0}function I(){return n.getToken()!==10?(v(3,[],[2,5]),!1):(M(!1),n.getToken()===6?(y(":"),S(),K()||v(4,[],[2,5])):v(5,[],[2,5]),s.pop(),!0)}function O(){u(),S();let D=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(D||v(4,[],[]),y(","),S(),n.getToken()===2&&E)break}else D&&v(6,[],[]);I()||v(4,[],[2,5]),D=!0}return f(),n.getToken()!==2?v(7,[2],[]):S(),!0}function R(){p(),S();let D=!0,N=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(N||v(4,[],[]),y(","),S(),n.getToken()===4&&E)break}else N&&v(6,[],[]);D?(s.push(0),D=!1):s[s.length-1]++,K()||v(4,[],[4,5]),N=!0}return m(),D||s.pop(),n.getToken()!==4?v(8,[4],[]):S(),!0}function K(){switch(n.getToken()){case 3:return R();case 1:return O();case 10:return M(!0);default:return k()}}return S(),n.getToken()===17?e.allowEmptyContent?!0:(v(4,[],[]),!1):K()?(n.getToken()!==17&&v(9,[],[]),!0):(v(4,[],[]),!1)}function zv(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(i){if(Array.isArray(i))return"array"}else return"null";return"object"}default:return"null"}}var Od;(function(i){i[i.None=0]="None",i[i.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",i[i.UnexpectedEndOfString=2]="UnexpectedEndOfString",i[i.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",i[i.InvalidUnicode=4]="InvalidUnicode",i[i.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",i[i.InvalidCharacter=6]="InvalidCharacter"})(Od||(Od={}));var Nd;(function(i){i[i.OpenBraceToken=1]="OpenBraceToken",i[i.CloseBraceToken=2]="CloseBraceToken",i[i.OpenBracketToken=3]="OpenBracketToken",i[i.CloseBracketToken=4]="CloseBracketToken",i[i.CommaToken=5]="CommaToken",i[i.ColonToken=6]="ColonToken",i[i.NullKeyword=7]="NullKeyword",i[i.TrueKeyword=8]="TrueKeyword",i[i.FalseKeyword=9]="FalseKeyword",i[i.StringLiteral=10]="StringLiteral",i[i.NumericLiteral=11]="NumericLiteral",i[i.LineCommentTrivia=12]="LineCommentTrivia",i[i.BlockCommentTrivia=13]="BlockCommentTrivia",i[i.LineBreakTrivia=14]="LineBreakTrivia",i[i.Trivia=15]="Trivia",i[i.Unknown=16]="Unknown",i[i.EOF=17]="EOF"})(Nd||(Nd={}));const Fv=Qv;var Rd;(function(i){i[i.InvalidSymbol=1]="InvalidSymbol",i[i.InvalidNumberFormat=2]="InvalidNumberFormat",i[i.PropertyNameExpected=3]="PropertyNameExpected",i[i.ValueExpected=4]="ValueExpected",i[i.ColonExpected=5]="ColonExpected",i[i.CommaExpected=6]="CommaExpected",i[i.CloseBraceExpected=7]="CloseBraceExpected",i[i.CloseBracketExpected=8]="CloseBracketExpected",i[i.EndOfFileExpected=9]="EndOfFileExpected",i[i.InvalidCommentToken=10]="InvalidCommentToken",i[i.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",i[i.UnexpectedEndOfString=12]="UnexpectedEndOfString",i[i.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",i[i.InvalidUnicode=14]="InvalidUnicode",i[i.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",i[i.InvalidCharacter=16]="InvalidCharacter"})(Rd||(Rd={}));const Uv={style:{display:"flex","justify-content":"space-between"}},Kv={class:"preview-output"},Jv={key:0,class:"muted"},jv=`// data: 当前 JSON 对象
|
|
823
824
|
// $: 全局变量对象(可选)
|
|
824
825
|
// 返回需要展示的数值
|
|
825
826
|
const { payload } = data
|
|
@@ -833,7 +834,7 @@ const a = description.split(";").map(i => {
|
|
|
833
834
|
}
|
|
834
835
|
})
|
|
835
836
|
a.length = a.length - 1
|
|
836
|
-
return {"text": a.find(i => i.value == value)?.label || '--'}`)},y=d.computed(()=>e.modelValue||{}),
|
|
837
|
-
// ${
|
|
838
|
-
const ${T} = ${
|
|
839
|
-
`;X.pushEditOperations([],[{range:new Qt.Range(_.lineNumber,_.column,_.lineNumber,_.column),text:Jt,forceMoveMarkers:!0}],()=>null),a.focus()},rt=T=>{var Qd,Vd;if(!l)return;const R=l.getModel();if(!R)return;const X=((Qd=T.target)==null?void 0:Qd.position)||T.position;if(!X)return;const _=R.getOffsetAt(X),Rt=R.getValue(),Ue=Fv(Rt,_).path||[];if(!Ue.length)return;const Ld=it(Ue),Js=x(y.value,Ue),uE=Ue.length?String(Ue[Ue.length-1]):"",js=(Vd=s.value)==null?void 0:Vd.getBoundingClientRect();m.value={visible:!0,x:js?T.event.browserEvent.clientX-js.left:0,y:js?T.event.browserEvent.clientY-js.top:0,path:Ld,pathParts:Ue,key:uE,value:Js}},Ct=T=>{var X;T.event.preventDefault(),T.event.stopPropagation();const R=(X=s.value)==null?void 0:X.getBoundingClientRect();u.value={visible:!0,x:R?T.event.browserEvent.clientX-R.left:0,y:R?T.event.browserEvent.clientY-R.top:0}},pt=async()=>{if(!a)return M();const T=a.getModel().getValueInRange(a.getSelection());if(!T)return M();try{await navigator.clipboard.writeText(T)}catch{}M()},ct=async()=>{if(!a)return M();const T=a.getSelection(),R=a.getModel().getValueInRange(T);if(!R)return M();try{await navigator.clipboard.writeText(R),a.executeEdits("custom-cut",[{range:T,text:"",forceMoveMarkers:!0}])}catch{}M()},V=async()=>{if(!a)return M();try{const T=await navigator.clipboard.readText();if(!T)return M();a.executeEdits("custom-paste",[{range:a.getSelection(),text:T,forceMoveMarkers:!0}])}catch{}M()},tt=async()=>{if(!a)return M();try{const T=a.getAction("editor.action.formatDocument");T&&await T.run()}catch{}M()},it=T=>Array.isArray(T)?(T[0]==="data"?T:["data",...T]).map(X=>String(X)).join("."):String(T||""),H=T=>{const R=Array.isArray(T)?T:String(T||"").split(".").filter(Boolean);return(R[0]==="data"?R:["data",...R]).map((_,Rt)=>{if(Rt===0)return"data";const Jt=Number(_);return!Number.isNaN(Jt)&&String(Jt)===String(_)?`[${Jt}]`:`.${_}`}).join("")},st=()=>{n("close")};d.onMounted(()=>{a=Qt.editor.create(o.value,{value:e.rule||jv,language:"javascript",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:14}),a.updateOptions({contextmenu:!1}),a.onContextMenu(T=>Ct(T)),a.onMouseDown(()=>M()),a.onKeyDown(()=>M()),h=a.addAction({id:"custom-paste",label:"粘贴",contextMenuGroupId:"9_cutcopypaste",run:async T=>{try{const R=await navigator.clipboard.readText();if(!R)return;T.executeEdits("custom-paste",[{range:T.getSelection(),text:R,forceMoveMarkers:!0}])}catch(R){console.warn("Clipboard read blocked",R)}}}),c=Qt.languages.registerCompletionItemProvider("javascript",{triggerCharacters:["$","."],provideCompletionItems(T,R){const _=T.getValueInRange(new Qt.Range(R.lineNumber,1,R.lineNumber,R.column)).match(/\$\.[\w$]*$/);if(!_)return{suggestions:[]};const Rt=_[0].split(".").pop()||"",Jt=new Qt.Range(R.lineNumber,R.column-Rt.length,R.lineNumber,R.column);return{suggestions:Object.keys(C.value||{}).map(Js=>({label:Js,kind:Qt.languages.CompletionItemKind.Variable,insertText:Js,range:Jt}))}}}),l=Qt.editor.create(r.value,{value:S(y.value),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:13,readOnly:!0,contextmenu:!1}),l.onContextMenu(T=>{T.event.preventDefault(),T.event.stopPropagation(),rt(T)}),a.updateOptions({contextmenu:!1}),a.onContextMenu(T=>{Ct(T)}),a.addCommand(Qt.KeyMod.CtrlCmd|Qt.KeyCode.KeyC,()=>pt()),a.addCommand(Qt.KeyMod.CtrlCmd|Qt.KeyCode.KeyX,()=>ct()),a.addCommand(Qt.KeyMod.CtrlCmd|Qt.KeyCode.KeyV,()=>V()),a.onDidChangeModelContent(()=>{try{const T=a.getValue();n("update:rule",T)}catch{}}),document.addEventListener("click",v),document.addEventListener("click",M),mt()}),d.watch(()=>e.rule,T=>{if(!a)return;const R=T||"";a.getValue()!==R&&a.setValue(R)}),d.watch(y,T=>{l&&l.setValue(S(T)),mt()}),d.onBeforeUnmount(()=>{a==null||a.dispose(),l==null||l.dispose(),c==null||c.dispose(),h==null||h.dispose(),u.value.visible=!1,document.removeEventListener("click",v),document.removeEventListener("click",M)});const mt=()=>{p.value=E()};return(T,R)=>(d.openBlock(),d.createElementBlock("div",{class:"json-rule-editor",ref_key:"rootRef",ref:s},[R[2]||(R[2]=d.createElementVNode("div",{class:"editor-header"},[d.createElementVNode("span",null,"数据 JSON(右键选取字段为变量)")],-1)),d.createElementVNode("div",{ref_key:"dataEditorContainer",ref:r,class:"monaco-pane slim"},null,512),m.value.visible?(d.openBlock(),d.createElementBlock("div",{key:0,class:"context-menu",style:d.normalizeStyle({left:m.value.x+"px",top:m.value.y+"px"})},[d.createElementVNode("div",{class:"menu-item",onClick:K},"复制属性"),d.createElementVNode("div",{class:"menu-item",onClick:L},"复制值"),d.createElementVNode("div",{class:"menu-item",onClick:N},"复制属性路径"),d.createElementVNode("div",{class:"menu-item",onClick:k},"设置为变量(并插入解析函数)"),R[0]||(R[0]=d.createElementVNode("div",{class:"menu-item disabled"},"设置为全局变量(待实现)",-1))],4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"editor-header",style:{"margin-top":"8px"}},[R[1]||(R[1]=d.createElementVNode("span",null,"解析函数(JS,需 return 数值)",-1)),d.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:b},"填充示例")]),d.createElementVNode("div",{ref_key:"editorContainer",ref:o,class:"monaco-pane"},null,512),u.value.visible?(d.openBlock(),d.createElementBlock("div",{key:1,class:"context-menu",style:d.normalizeStyle({left:u.value.x+"px",top:u.value.y+"px"})},[d.createElementVNode("div",{class:"menu-item",onClick:ct},"剪切"),d.createElementVNode("div",{class:"menu-item",onClick:pt},"复制"),d.createElementVNode("div",{class:"menu-item",onClick:V},"粘贴"),d.createElementVNode("div",{class:"menu-item",onClick:tt},"格式化")],4)):d.createCommentVNode("",!0),d.createElementVNode("div",Uv,[d.createElementVNode("div",null,[d.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:mt},"运行测试"),d.createElementVNode("span",Kv,d.toDisplayString(p.value),1),f.value?(d.openBlock(),d.createElementBlock("span",Jv,"错误:"+d.toDisplayString(f.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:st},"确认生效")]),R[3]||(R[3]=d.createElementVNode("div",{class:"helper"},[d.createElementVNode("div",{class:"helper-title"},"使用方式"),d.createElementVNode("p",null,"data 为当前 JSON 数据,$ 为全局变量对象;右键字段插入示例代码(data.xxx 或 $?.xxx)。在下方函数里 return 需要展示的数值。")],-1))],512))}},[["__scopeId","data-v-a3960d13"]]),Yv={class:"dataBox"},Hv={style:{padding:"10px 0","margin-bottom":"10px"}},_v={style:{padding:"10px 0","margin-bottom":"10px"}},Wv={class:"param-table"},qv={class:"param-table__toolbar"},Xv={style:{padding:"10px 0"}},$v={style:{padding:"10px 0","margin-bottom":"10px"}},Zv=vt({__name:"data",setup(i){const t=d.inject("getCurCell")(),e=d.inject("topoApi"),n=d.ref(t.getData()),s=d.ref(n.value.dataSource.parse||""),o=d.ref(!1),r=d.ref({text1:""}),a=d.ref(null),l={},c=d.ref({}),h=async()=>{var C;if(a.value===null)return Et.ElMessage.error("请获取数据!"),!1;if(!s.value){const w={};g.value.bindName.forEach(x=>{w[x]=""}),s.value=`return ${JSON.stringify(w)}`}g.value.type==="opcua"&&(c.value={payload:(C=a.value)==null?void 0:C.payload,pointTemp:n.value.dataSource.point}),g.value.type==="http"&&(c.value=a.value),o.value=!0},u=()=>{a.value=null},g=d.ref(n.value.dataSource);Array.isArray(g.value.params)||(g.value.params=[]);const f=async()=>{if(!g.value.path)return Et.ElMessage.error("请输入点位地址!"),!1;const C=await e.readPoints([g.value.path]);console.log(C),a.value=C[0]||{error:"未找到数据"}},p=()=>{g.value.params.push({label:"",value:""})},m=C=>{g.value.params.splice(C,1)},b=async()=>{if(!g.value.httpUrl)return Et.ElMessage.error("请输入请求地址"),!1;let C={};for(let x of g.value.params)if(x.label)C[x.label]=x.value;else return Et.ElMessage.error("请完善请求参数"),!1;let w;try{w=await e.httpRequest({...g.value,params:C})}catch{w={error:"数据获取失败"}}a.value=w,console.log(w)},y=()=>{var w,x,E,S;if(((w=g.value.name)==null?void 0:w.length)==0)return Et.ElMessage.error("请选择数据关联!"),!1;if(a.value===null)return Et.ElMessage.error("请获取数据!"),!1;let C={};if(s.value)try{const v=new Function("data","$",s.value);g.value.type=="opcua"?C=v({payload:(x=a.value)==null?void 0:x.payload,pointTemp:n.value.dataSource.point},r.value):g.value.type=="http"&&(C=v(a.value,r.value)),C.dataSource={parse:s.value},t.setData(C),o.value=!1}catch(v){Et.ElMessage.error("解析失败!"),console.log(v)}else C[g.value.name]=((S=(E=a.value)==null?void 0:E.payload)==null?void 0:S.value)||"--",t.setData(C),o.value=!1};return(C,w)=>{const x=d.resolveComponent("el-option"),E=d.resolveComponent("el-select"),S=d.resolveComponent("el-form-item"),v=d.resolveComponent("el-input"),M=d.resolveComponent("el-button"),k=d.resolveComponent("el-radio"),I=d.resolveComponent("el-radio-group"),O=d.resolveComponent("el-table-column"),D=d.resolveComponent("el-table"),K=d.resolveComponent("el-form"),L=d.resolveComponent("el-dialog");return d.openBlock(),d.createElementBlock("div",Yv,[d.createVNode(K,{class:"panelList",size:"small"},{default:d.withCtx(()=>[d.createVNode(S,{label:"数据类型"},{default:d.withCtx(()=>[d.createVNode(E,{modelValue:g.value.type,"onUpdate:modelValue":w[0]||(w[0]=N=>g.value.type=N),onChange:u},{default:d.withCtx(()=>[d.createVNode(x,{value:"none",label:"无"}),d.createVNode(x,{value:"opcua",label:"OPCUA点位"}),d.createVNode(x,{value:"http",label:"HTTP接口"}),d.createVNode(x,{value:"mock",label:"Mock模拟"})]),_:1},8,["modelValue"])]),_:1}),g.value.type!=="none"?(d.openBlock(),d.createBlock(S,{key:0,label:"数据关联"},{default:d.withCtx(()=>[d.createVNode(E,{modelValue:g.value.bindName,"onUpdate:modelValue":w[1]||(w[1]=N=>g.value.bindName=N),multiple:"","collapse-tags":""},{default:d.withCtx(()=>[d.createVNode(x,{value:"text",label:"文本"}),d.createVNode(x,{value:"color",label:"字体颜色"}),d.createVNode(x,{value:"backgroundColor",label:"背景颜色"}),d.createVNode(x,{value:"model",label:"内部变量"})]),_:1},8,["modelValue"])]),_:1})):d.createCommentVNode("",!0),g.value.type==="opcua"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createVNode(S,{label:"点位地址"},{default:d.withCtx(()=>[d.createVNode(v,{modelValue:g.value.path,"onUpdate:modelValue":w[2]||(w[2]=N=>g.value.path=N)},null,8,["modelValue"])]),_:1}),d.createElementVNode("div",Hv,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:f},{default:d.withCtx(()=>[...w[10]||(w[10]=[d.createTextVNode("获取数据",-1)])]),_:1})]),d.createVNode(zr,{modelValue:a.value,"onUpdate:modelValue":w[3]||(w[3]=N=>a.value=N),style:{height:"400px"}},null,8,["modelValue"]),d.createElementVNode("div",_v,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:h},{default:d.withCtx(()=>[...w[11]||(w[11]=[d.createTextVNode("数据解析",-1)])]),_:1})])],64)):d.createCommentVNode("",!0),g.value.type==="http"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[d.createVNode(S,{label:"接口类型"},{default:d.withCtx(()=>[d.createVNode(I,{modelValue:g.value.httpType,"onUpdate:modelValue":w[4]||(w[4]=N=>g.value.httpType=N)},{default:d.withCtx(()=>[d.createVNode(k,{value:"GET"},{default:d.withCtx(()=>[...w[12]||(w[12]=[d.createTextVNode("GET",-1)])]),_:1}),d.createVNode(k,{value:"POST"},{default:d.withCtx(()=>[...w[13]||(w[13]=[d.createTextVNode("POST",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(S,{label:"接口地址"},{default:d.withCtx(()=>[d.createVNode(v,{modelValue:g.value.httpUrl,"onUpdate:modelValue":w[5]||(w[5]=N=>g.value.httpUrl=N),autosize:{minRows:2,maxRows:4},type:"textarea"},null,8,["modelValue"])]),_:1}),d.createElementVNode("div",Wv,[d.createElementVNode("div",qv,[w[15]||(w[15]=d.createElementVNode("div",null,"请求参数",-1)),d.createVNode(M,{size:"small",type:"primary",plain:"",onClick:p},{default:d.withCtx(()=>[...w[14]||(w[14]=[d.createTextVNode("新增参数",-1)])]),_:1})]),d.createVNode(D,{data:g.value.params,size:"small",border:"",height:"180"},{default:d.withCtx(()=>[d.createVNode(O,{prop:"label",label:"字段名"},{default:d.withCtx(({row:N})=>[d.createVNode(v,{modelValue:N.label,"onUpdate:modelValue":j=>N.label=j,modelModifiers:{trim:!0},placeholder:"字段名"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),d.createVNode(O,{prop:"value",label:"值"},{default:d.withCtx(({row:N})=>[d.createVNode(v,{modelValue:N.value,"onUpdate:modelValue":j=>N.value=j,placeholder:"值"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),d.createVNode(O,{label:"操作",width:"60"},{default:d.withCtx(({$index:N})=>[d.createVNode(M,{link:"",type:"danger",onClick:j=>m(N)},{default:d.withCtx(()=>[...w[16]||(w[16]=[d.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])]),d.createElementVNode("div",Xv,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:b},{default:d.withCtx(()=>[...w[17]||(w[17]=[d.createTextVNode("获取数据",-1)])]),_:1})]),d.createVNode(zr,{modelValue:a.value,"onUpdate:modelValue":w[6]||(w[6]=N=>a.value=N),style:{height:"300px"}},null,8,["modelValue"]),d.createElementVNode("div",$v,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:h},{default:d.withCtx(()=>[...w[18]||(w[18]=[d.createTextVNode("数据解析",-1)])]),_:1})])],64)):d.createCommentVNode("",!0),g.value.type==="mock"?(d.openBlock(),d.createBlock(zr,{key:3,modelValue:n.value,"onUpdate:modelValue":w[7]||(w[7]=N=>n.value=N),style:{height:"600px"}},null,8,["modelValue"])):d.createCommentVNode("",!0)]),_:1}),d.createVNode(L,{modelValue:o.value,"onUpdate:modelValue":w[9]||(w[9]=N=>o.value=N),title:"实时数据解析",width:"800","align-center":""},{default:d.withCtx(()=>[d.createVNode(Gv,{"model-value":c.value,rule:s.value,"onUpdate:rule":w[8]||(w[8]=N=>s.value=N),globals:l,onClose:y},null,8,["model-value","rule"])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-2a4bc8e5"]]),tE={class:"prop"},eE={class:"tabContainer"},nE=["onClick"],iE={class:"activeLine"},sE={key:0,class:"main"},oE=vt({__name:"index",setup(i){const t=Kt(),e=Pn(),{targetType:n,tabs:s,activeTab:o,cellId:r}=be.storeToRefs(e),a=h=>{o.value=h};let l=r.value?t.graph.getCellById(r.value):null;d.provide("getCurCell",()=>l),d.provide("cellId",r);const c=d.ref(!0);return d.watch(r,()=>{console.log("cellId",r.value),l=t.graph.getCellById(r.value),c.value=!1,d.nextTick(()=>{c.value=!0})}),(h,u)=>(d.openBlock(),d.createElementBlock("div",tE,[d.createElementVNode("div",eE,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(s),(g,f)=>(d.openBlock(),d.createElementBlock("div",{key:f,class:d.normalizeClass(["tabItem",{active:d.unref(o)===f}]),onClick:p=>a(f)},[d.createTextVNode(d.toDisplayString(g)+" ",1),d.withDirectives(d.createElementVNode("div",iE,null,512),[[d.vShow,d.unref(o)===f]])],10,nE))),128))]),c.value?(d.openBlock(),d.createElementBlock("div",sE,[d.unref(n)==="blank"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.unref(o)===0?(d.openBlock(),d.createBlock(Tv,{key:0})):d.createCommentVNode("",!0)],64)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.unref(o)===0?(d.openBlock(),d.createBlock(Dv,{key:0})):d.unref(o)===1?(d.openBlock(),d.createBlock(Zv,{key:1})):d.createCommentVNode("",!0)],64))])):d.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b4a4e65e"]]),rE={class:"ems-editor"},aE={class:"ems-editor__workspace"},Kr=Object.assign({name:"EmsEditor"},{__name:"index",props:{services:{type:Object,default:()=>({})},width:{type:Number,default:1920},height:{type:Number,default:1080}},emits:["ready","exit"],setup(i,{emit:t}){const e=On(),n=Pn(),s=Kt(),o=i,r={setItem(l,c){c!==void 0&&window.localStorage.setItem(l,JSON.stringify(c))},getItem(l){let c=window.localStorage.getItem(l);return JSON.parse(c)},removeItem(l){window.localStorage.removeItem(l)},clear(){window.localStorage.clear()}},a={async getAllMenus(){var c;let l=[];return(c=o.services)!=null&&c.getAllMenus?l=await o.services.getAllMenus()||[]:l=r.getItem("menus")||[{id:"1",parentId:"0",name:"首页",children:[{id:crypto.randomUUID(),parentId:"1",name:"首页概览",style:{},value:{}}]}],r.setItem("menus",l),l},async getMenu(l){var c;if((c=o.services)!=null&&c.getMenu)return await o.services.getMenu(l)||{};{let h=r.getItem("menus")||[];for(let u of h)if(u.children){for(let g of u.children)if(g.id===l)return g}return{}}},async addMenu({parent:l,parentNameNew:c,name:h}){var u;if((u=o.services)!=null&&u.addMenu)return await o.services.addMenu({parent:l,parentNameNew:c,name:h});{let g=r.getItem("menus")||[],f=null,p=crypto.randomUUID(),m="";if(l==="0")m=crypto.randomUUID(),f={name:h,id:p,parentId:m,style:{},value:{}},g.push({name:c,id:m,parentId:"0",children:[f]});else{const b=g.find(y=>y.id===l);b&&(m=b.id,b.children.push({name:h,id:p,parentId:m,style:{},value:{}}),f={name:h,id:p,parentId:m,style:{},value:{}})}return r.setItem(p,f),r.setItem("menus",g),f}},async saveMenus(l){var h;const c=await this.getMenu(l.id);if(c&&(c.name=l.name,c.style=l.style,c.value=l.value),(h=o.services)!=null&&h.saveMenus)await o.services.saveMenus(l);else{let u=r.getItem("menus")||[];for(let g of u){const f=g.children.findIndex(p=>p.id===l.id);f>-1&&(g.children[f]=l)}r.setItem("menus",u),r.setItem(l.id,l)}},async removeMenu(l){var c;if((c=o.services)!=null&&c.removeMenu)await o.services.removeMenu(l);else{let h=r.getItem("menus")||[];if(this.getMenu(l)){const g=h.find(f=>{var p;return(p=f.children)==null?void 0:p.some(m=>m.id===l)});g&&(g.children=g.children.filter(f=>f.id!==l),g.children.length===0&&(h=h.filter(f=>f.id!==g.id))),r.setItem("menus",h)}r.removeItem(l)}},async getDeviceList(){var c;let l=[];if((c=o.services)!=null&&c.getDeviceList)l=await o.services.getDeviceList();else{const h=[{id:"2010960121314734082",deviceName:"干接点",deviceType:"OTHERS",deviceNo:"DIDO",templateName:"DIDO_test.json",templateId:"2010957702564474882",pointList:[{id:"2010957702568669185",templateId:"2010957702564474882",tag:"en_sts",name:"使能STS",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0001, uint, AB]",description:"0:失能;1:启动使能;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863489",templateId:"2010957702564474882",tag:"connect_statu",name:"电网闸",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0002, uint, AB]",description:"0:断开;1:闭合;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863490",templateId:"2010957702564474882",tag:"icb_sign",name:"外源断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0003, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863491",templateId:"2010957702564474882",tag:"icb_ctrl",name:"外源断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0004, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863492",templateId:"2010957702564474882",tag:"lcb_sign",name:"负载断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0005, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863493",templateId:"2010957702564474882",tag:"lcb_ctrl",name:"负载断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0006, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863494",templateId:"2010957702564474882",tag:"dg_sign",name:"发动机启停状态",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0007, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863495",templateId:"2010957702564474882",tag:"dg_ctrl",name:"发动机控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0008, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863496",templateId:"2010957702564474882",tag:"ats",name:"ATS反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0009, uint, AB]",description:"0:合闸柴发;1:合闸电网;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null}]}];for(const u of h){const g=u.pointList;g&&Array.isArray(g)&&g.length>0&&l.push({id:u.id,label:u.deviceName,data:u,children:g.map(f=>({id:f.id,label:f.name,data:{...f,nodeId:`ns=1;s=${u.deviceType}.${f.tag}`}}))})}}return l},async readPoints(l){var c,h;return(c=o.services)!=null&&c.readPoints?await((h=o.services)==null?void 0:h.readPoints(l)):[{nodeId:"ns=1;s=PV.RatReActivePowerPer",value:1,statusCode:"Good",sourceTimestamp:"2026-01-16T02:26:37.533Z",serverTimestamp:"2026-01-16T02:26:37.533Z",aa:[{vv:1},{vv1:1}]}]},async httpRequest(l){var c,h;return(c=o.services)!=null&&c.httpRequest?await((h=o.services)==null?void 0:h.httpRequest(l)):{}}};return d.provide("topoApi",a),d.onMounted(()=>{}),d.onBeforeUnmount(()=>{e.$reset(),n.$reset(),s.$reset()}),(l,c)=>(d.openBlock(),d.createElementBlock("div",rE,[d.createElementVNode("div",aE,[d.createVNode(Bv),d.createVNode(jx,{width:o.width,height:o.height},null,8,["width","height"]),d.createVNode(oE)])]))}}),lE={class:"previewBox"},Dd=vt({__name:"preview",props:{menu:{type:Object,required:!0},service:{type:Object,required:!0}},setup(i){const t=i,e=t.service,n=d.ref(null);let s=null;const o=Dr();let r=[];const a=c=>{if(!c.cell)return!1;r.length>0&&(e.unsubscribe(r.map(h=>h.path)),r=[]);for(let h of c)if(h.data&&h.data.datasource&&h.data.datasource.type!=="none"){const u=s.getCellById(h.id),g=h.data.datasource;if(g.type=="opcua"&&g.path&&g.parse)try{e.readPoints([g.path]).then(f=>{f&&f.length>0&&l(f[0],g,u)}),r.push({nodeId:g.path,callBack:f=>l(f,g,u)})}catch(f){ElMessage.error("解析失败!"),console.log(f)}if(g.type=="http")try{const f=new Function("data","$",g.parse);e.httpRequest(g).then(p=>{if(p){let m=f(p,{});u.setData(m)}})}catch(f){ElMessage.error("解析失败!"),console.log(f)}}e.subscribe(r.map(h=>h.path)),e.onEvent(h=>{h.event==="data-changed"&&h.payload&&h.payload.nodeId&&r.forEach((u,g)=>{u.nodeId==h.payload.nodeId&&r[g].callBack(h.payload)})})},l=(c,h,u)=>{const g=new Function("data","$",h.parse);let f={};parse?f=g({payload:c,pointTemp:h.point},{}):f.text=res.payload.value||"--",u.setData(f)};return d.watch(()=>t.menu,c=>{s&&(s.clearCells(),s.resize(c.style.width,c.style.height),s.fromJSON(c.value),s.drawBackground({color:c.style.backgroundColor,image:c.style.backgroundImage,size:"cover"}),a(c.value))},{deep:!0}),d.onMounted(()=>{const{width:c,height:h}=t.menu.style;s=new B({container:n.value,width:c,height:h,interacting:!1,selecting:!1,keyboard:!1,mousewheel:!1,panning:!1}),Qr(),s.fromJSON(t.menu.value),s.drawBackground({color:t.menu.style.backgroundColor,image:t.menu.style.backgroundImage,size:"cover"})}),d.onBeforeUnmount(()=>{s&&s.dispose()}),(c,h)=>(d.openBlock(),d.createElementBlock("div",lE,[d.createElementVNode("div",{ref_key:"container",ref:n,class:"ems-preview"},null,512),d.createVNode(d.unref(o))]))}},[["__scopeId","data-v-89effbc5"]]);window._iconfont_svg_string_5087053='<svg><symbol id="icon-jiesuo1" viewBox="0 0 1024 1024"><path d="M768.25422 0q48.810328 0 94.061569 18.303873t80.333664 50.33565 56.436941 74.740814 21.354518 91.519364l0 150.49851-123.042701 0 0-122.025819q0-64.063555-36.099305-99.654419t-97.112214-35.590864q-54.911619 0-88.468719 35.590864t-33.5571 99.654419l0 124.059583-128.12711 0 0-152.532274q0-48.810328 19.320755-91.519364t53.386296-74.740814 80.333664-50.33565 101.179742-18.303873zM766.220457 693.513406l0 87.451837 0 47.793446q0 27.455809-9.660377 51.860973t-26.438928 41.692155-39.658391 27.455809-50.33565 10.168818l-514.542205 0q-27.455809 0-49.82721-9.660377t-38.641509-26.438928-24.913605-39.14995-8.643496-47.793446l0-323.368421q0-28.472691 19.829196-47.793446t46.268123-19.320755l629.449851 0q28.472691 0 47.793446 19.320755t19.320755 47.793446l0 179.988083z" ></path></symbol><symbol id="icon-jianlizuhe1" viewBox="0 0 1024 1024"><path d="M891.8 65h-632c-35.5 0-64.4 28.8-64.4 64.4v125.3h-66.3c-35.5 0-64.4 28.8-64.4 64.4v575.6c0 35.5 28.8 64.4 64.4 64.4h572.6c35.5 0 64.4-28.8 64.4-64.4v-65.3h125.6c35.5 0 64.4-28.8 64.4-64.4V129.4c0.1-35.6-28.7-64.4-64.3-64.4zM702.2 894.6v0.1c0 0.1-0.2 0.2-0.2 0.2H129.1c-0.1 0-0.2-0.2-0.2-0.2V319v-0.1c0-0.1 0.2-0.2 0.2-0.2h0.1l66.3 0.1S194 794.1 194 797.4c0 17.7 14.3 32 32 32h476.2v65.2zM259.5 129.2c0-0.1 0.2-0.2 0.2-0.2h632.2c0.1 0 0.2 0.2 0.2 0.2V765.1c0 0.1-0.2 0.2-0.2 0.2H259.5V129.2z" ></path></symbol><symbol id="icon-suoding1" viewBox="0 0 1024 1024"><path d="M860.069521 429.487623h-73.242947v-170.422692C786.826574 116.337371 670.888872 0.272064 528.240764 0.272064c-142.650515 0-258.720638 116.065307-258.720638 258.792867v170.422692H196.339779c-35.281619 0-63.879618 28.612445-63.879618 63.91814v466.606275c0 35.368294 28.597999 63.983146 63.879618 63.983147h663.79234c35.29125 0 63.821834-28.614852 63.821835-63.983147V493.405763c-0.004815-35.310511-28.590776-63.91814-63.884433-63.91814zM564.114664 738.867504v101.889098c0 4.552855-3.765556 8.388233-8.385825 8.388233h-54.91355c-4.678053 0-8.446016-3.837785-8.446017-8.388233v-101.889098c-25.800316-13.201114-43.672259-39.665939-43.672259-70.68362 0-43.888947 35.613874-79.584681 79.481153-79.584682 43.932285 0 79.548567 35.695734 79.548566 79.584682 0.062599 31.020089-17.811752 57.482507-43.612068 70.68362z m123.476036-309.379881H368.883605v-166.202091c0-87.912723 71.55278-159.501618 159.417351-159.501618s159.287337 71.588895 159.287337 159.501618l0.002407 166.202091z" ></path></symbol><symbol id="icon-xingzhuang-juxing" viewBox="0 0 1024 1024"><path d="M864 896H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h704a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zM192 832h640V192H192v640z" ></path></symbol><symbol id="icon-shuzhi" viewBox="0 0 1024 1024"><path d="M921.6 21.162667H102.4c-37.546667 0-68.266667 30.788267-68.266667 68.4032v819.950933c0 37.546667 30.72 68.334933 68.266667 68.334933h819.2c37.546667 0 68.266667-30.72 68.266667-68.266666V89.4976c0-37.546667-30.72-68.334933-68.266667-68.334933z m0 854.2208c0 20.48-13.653333 34.133333-34.133333 34.133333h-750.933334c-20.48 0-34.133333-13.653333-34.133333-34.133333V123.767467c0-20.548267 13.653333-34.2016 34.133333-34.2016h750.933334c20.48 0 34.133333 13.653333 34.133333 34.133333v751.616z" ></path><path d="M274.568533 365.704533h36.0448V658.090667h-47.9232V423.458133a165.546667 165.546667 0 0 1-66.7648 35.6352v-47.5136c13.1072-3.2768 27.0336-9.0112 41.7792-17.2032 14.7456-9.0112 27.0336-18.432 36.864-28.672z m200.2944-5.7344c28.2624 0 51.6096 8.192 70.0416 24.576 18.0224 16.384 27.0336 37.2736 27.0336 63.488 0 25.3952-9.8304 48.3328-28.672 69.2224-11.4688 12.288-31.9488 27.8528-60.6208 47.104-29.9008 19.6608-47.9232 36.864-54.4768 51.6096h144.1792v42.1888H368.366933c0-29.9008 9.4208-55.7056 29.0816-77.824 10.6496-12.288 33.1776-30.3104 67.1744-53.6576 18.8416-13.1072 31.9488-24.1664 40.1408-32.768 12.6976-14.336 19.2512-29.9008 19.2512-46.2848 0-15.9744-4.5056-27.8528-12.6976-35.6352-8.6016-7.7824-21.2992-11.4688-38.0928-11.4688-18.0224 0-31.5392 6.144-40.5504 18.432-9.0112 11.4688-13.9264 29.0816-14.7456 52.0192H370.005333c0.4096-32.768 9.8304-58.9824 28.672-79.0528 19.2512-21.2992 44.6464-31.9488 76.1856-31.9488z m244.1216 0c29.4912 0 53.6576 6.9632 71.68 21.2992 17.6128 14.336 26.624 33.9968 26.624 59.392 0 31.9488-16.384 53.248-48.7424 63.8976 17.2032 5.3248 30.72 13.1072 39.7312 23.7568a61.986133 61.986133 0 0 1 14.7456 42.5984c0 27.0336-9.4208 49.152-28.2624 66.3552-19.6608 17.6128-45.4656 26.624-77.4144 26.624-30.3104 0-54.8864-7.7824-73.3184-23.3472-20.48-17.2032-31.9488-42.5984-34.4064-75.3664h48.7424c0.8192 18.8416 6.5536 33.5872 18.0224 43.8272 10.24 9.4208 23.7568 14.336 40.5504 14.336 18.432 0 33.1776-5.3248 43.8272-15.5648a47.240533 47.240533 0 0 0 14.336-34.816c0-16.7936-5.3248-29.0816-15.1552-36.864-9.8304-8.192-24.1664-11.8784-43.008-11.8784h-20.48V488.106667h20.48c17.2032 0 30.3104-3.6864 39.3216-11.0592 8.6016-7.3728 13.1072-18.432 13.1072-32.768 0-14.336-4.096-24.9856-11.8784-32.3584-8.6016-7.3728-21.2992-11.0592-38.0928-11.0592-17.2032 0-30.3104 4.096-39.7312 12.6976-9.8304 8.6016-15.5648 21.7088-17.2032 39.3216h-47.104c2.4576-29.4912 13.1072-52.4288 32.768-68.8128 18.432-16.384 42.1888-24.1664 70.8608-24.1664z" ></path></symbol><symbol id="icon-xianduan" viewBox="0 0 1024 1024"><path d="M0.034239 975.503207L976.222236 0l48.400922 48.435162L48.435162 1023.945217z" ></path></symbol><symbol id="icon-yulan" viewBox="0 0 1024 1024"><path d="M512.122 272.146c-247.216 0-412.027 247.216-412.027 247.216s164.811 247.216 412.027 247.216c247.216 0 412.027-247.216 412.027-247.216S759.217 272.146 512.122 272.146z m0 410.207c-90.537 0-163.962-73.424-163.962-163.962s73.424-163.962 163.962-163.962c90.537 0 163.962 73.424 163.962 163.962-0.122 90.658-73.424 163.962-163.962 163.962z m-82.406-163.476c0 21.482 8.86 42.841 24.03 58.012s36.53 24.03 58.012 24.03 42.841-8.86 58.012-24.03c15.17-15.17 24.03-36.53 24.03-58.012s-8.86-42.841-24.03-58.012c-15.17-15.17-36.53-24.03-58.012-24.03s-42.841 8.86-58.012 24.03c-15.17 15.292-24.03 36.53-24.03 58.012z" ></path></symbol><symbol id="icon-tubiao" viewBox="0 0 1024 1024"><path d="M437.996 697.519V586.722H327.195c-61.187 0-110.797 49.61-110.797 110.797 0 61.195 49.61 110.797 110.797 110.797 61.192 0 110.801-49.602 110.801-110.797z m55.399 0c0 91.789-74.411 166.195-166.2 166.195C235.41 863.714 161 789.308 161 697.519c0-91.789 74.41-166.195 166.195-166.195h166.2v166.195z m92.328 0V586.722H696.52c61.195 0 110.796 49.61 110.796 110.797 0 61.195-49.601 110.797-110.796 110.797-61.188 0-110.797-49.602-110.797-110.797z m-55.399 0c0 91.789 74.41 166.195 166.196 166.195 91.789 0 166.199-74.406 166.199-166.195 0-91.789-74.41-166.195-166.199-166.195H530.324v166.195z m-92.328-369.324v110.801H327.195c-61.187 0-110.797-49.61-110.797-110.801 0-61.188 49.61-110.797 110.797-110.797 61.192 0 110.801 49.609 110.801 110.797z m55.399 0c0-91.785-74.411-166.195-166.2-166.195C235.41 162 161 236.41 161 328.195c0 91.789 74.41 166.199 166.195 166.199h166.2V328.195z m92.328 0v110.801H696.52c61.195 0 110.796-49.61 110.796-110.801 0-61.188-49.601-110.797-110.796-110.797-61.188 0-110.797 49.609-110.797 110.797z m-55.399 0C530.324 236.41 604.734 162 696.52 162c91.789 0 166.199 74.41 166.199 166.195 0 91.789-74.41 166.199-166.199 166.199H530.324V328.195z m0 0" ></path></symbol><symbol id="icon-tupian" viewBox="0 0 1024 1024"><path d="M335.36 440.32c38.4 0 71.68-30.72 71.68-71.68 0-38.4-30.72-71.68-71.68-71.68-38.4 0-71.68 30.72-71.68 71.68 2.56 40.96 33.28 71.68 71.68 71.68z m0 0M652.8 396.8L445.44 691.2 337.92 540.16 158.72 793.6h704L652.8 396.8z m0 0" ></path><path d="M934.4 107.52H89.6c-20.48 0-35.84 15.36-35.84 35.84V883.2c0 20.48 15.36 35.84 35.84 35.84h844.8c20.48 0 35.84-15.36 35.84-35.84V143.36c0-20.48-15.36-35.84-35.84-35.84z m-35.84 739.84H125.44V176.64h775.68v670.72h-2.56z m0 0" ></path></symbol><symbol id="icon-wenzi" viewBox="0 0 1024 1024"><path d="M64.1 66v303.7l39.5-1.3c13.6-110.8 102.6-186.4 153.2-199 50.7-12.6 148.3 1.1 148.3 1.1s-1.3 625.2-1.3 669.2c0 44.1-59.3 63-59.3 63l-79 1.3-1.2 55.4h493.1v-54.1h-90.2c-40.8-3.8-65.4-56.7-65.4-56.7l1.1-684.5s61.8-11.3 150.8 5.1c89 16.4 164.3 204.1 164.3 204.1h39.5V66H64.1z" ></path></symbol><symbol id="icon-xinjian" viewBox="0 0 1024 1024"><path d="M618 958.5H202c-44.8 0-81.3-34.1-81.3-76v-740c0-41.9 36.5-76 81.3-76h610.5c44.8 0 81.3 34.1 81.3 76v521.9c0 12.8-10.4 23.1-23.1 23.1s-23.1-10.4-23.1-23.1V142.5c0-16.4-15.7-29.7-35-29.7H202c-19.3 0-35 13.3-35 29.7v740c0 16.4 15.7 29.7 35 29.7h416c12.8 0 23.1 10.4 23.1 23.1 0.1 12.8-10.3 23.2-23.1 23.2z" ></path><path d="M738.4 360.5H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h462.5c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1zM584.3 595.1H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h308.3c12.8 0 23.1 10.4 23.1 23.1 0 12.7-10.3 23.1-23.1 23.1zM878.8 826.3H614.6c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h264.3c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1z" ></path><path d="M746.7 958.5c-12.8 0-23.1-10.4-23.1-23.1V671.1c0-12.8 10.4-23.1 23.1-23.1 12.8 0 23.1 10.4 23.1 23.1v264.3c0 12.7-10.3 23.1-23.1 23.1z" ></path></symbol><symbol id="icon-qingkong" viewBox="0 0 1024 1024"><path d="M274.56 798.997333l19.434667-25.130666-33.792 68.565333a18.133333 18.133333 0 0 0 11.562666 25.536l59.733334 16a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.818667 35.626667-35.989333 45.290666-48.469333l19.456-25.130667-33.813333 68.565333a18.133333 18.133333 0 0 0 11.562667 25.536l84.48 22.634667a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-35.989333 45.269333-48.469333l19.456-25.130667-33.813333 68.565333A18.133333 18.133333 0 0 0 535.530667 938.666667l72.106666 19.328a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-36.010667 45.269334-48.490667l19.456-25.130667-33.813334 68.586667a18.133333 18.133333 0 0 0 11.584 25.514667l86.421334 23.338666 3.84-0.213333c13.269333-0.704 29.056-5.034667 43.84-12.8 29.781333-15.701333 48.170667-43.2 52.181333-78.250667 2.133333-18.517333 4.778667-38.549333 8.405333-63.530666 1.642667-11.221333 2.944-20.010667 6.229334-41.834667 11.050667-73.322667 14.634667-101.034667 17.130666-133.674667l0.938667-12.373333 2.837333-2.922667 12.330667-1.344a41.813333 41.813333 0 0 0 24.810667-11.221333c10.730667-10.24 14.805333-25.386667 11.093333-42.197333l-37.546667-171.584c-3.029333-13.696-11.264-27.946667-23.146666-39.829334-11.648-11.626667-25.92-20.138667-39.893334-23.893333L723.626667 331.306667l-2.261334-3.925334L774.250667 130.133333c8.32-31.061333-11.754667-63.744-44.970667-72.64l-79.509333-21.312c-33.194667-8.896-66.922667 9.365333-75.264 40.426667l-52.842667 197.269333-3.925333 2.261334-118.101334-31.637334c-13.994667-3.754667-30.634667-3.498667-46.506666 0.746667-16.256 4.352-30.506667 12.586667-39.957334 22.933333l-118.314666 129.792c-11.605333 12.714667-15.658667 27.84-11.52 42.090667 4.16 14.229333 15.850667 25.194667 32.896 30.528l13.610666 4.266667 2.133334 3.882666-3.626667 13.802667c-21.12 79.850667-52.885333 136.917333-85.717333 150.890667-47.530667 20.202667-72.938667 49.429333-78.421334 85.034666-5.034667 32.682667 9.28 67.114667 37.589334 91.541334l22.037333 8.341333 74.666667 20.010667a42.666667 42.666667 0 0 0 41.216-11.050667c15.274667-15.274667 26.88-28.032 34.837333-38.293333z m551.381333-396.565333c14.144 3.797333 29.952 19.2 32.768 32l34.56 157.781333a10.666667 10.666667 0 0 1-13.184 12.586667L240.64 433.493333a10.666667 10.666667 0 0 1-5.12-17.493333l108.8-119.36c8.832-9.685333 30.229333-15.146667 44.373333-11.349333l141.333334 37.866666a21.333333 21.333333 0 0 0 26.133333-15.082666l58.304-217.642667a21.333333 21.333333 0 0 1 26.133333-15.082667l77.056 20.650667a21.333333 21.333333 0 0 1 15.082667 26.133333l-58.325333 217.642667a21.333333 21.333333 0 0 0 15.082666 26.112l136.448 36.565333zM315.456 701.568c-33.664 45.141333-64.597333 79.082667-92.8 101.802667l-5.909333 4.778666-2.837334 0.597334-88.106666-24.106667-2.922667-3.2c-13.034667-14.165333-19.370667-31.04-16.981333-46.592 3.285333-21.333333 22.058667-39.338667 53.205333-52.586667 31.722667-13.482667 59.818667-47.104 82.922667-99.904 10.026667-22.954667 18.88-48.725333 26.389333-76.586666l3.882667-14.4 3.904-2.261334 566.165333 151.701334 2.346667 3.306666-0.789334 12.224c-1.984 30.592-30.336 229.397333-32.128 244.906667-2.346667 20.416-11.306667 34.986667-27.605333 44.394667a73.237333 73.237333 0 0 1-21.397333 8.106666l-5.013334 0.725334-60.373333-16.170667 11.242667-20.288c8.277333-14.976 22.656-43.84 43.093333-86.613333a21.12 21.12 0 0 0-9.962667-28.16l-3.136-1.493334a21.333333 21.333333 0 0 0-26.261333 6.485334c-33.642667 45.056-64.533333 78.912-92.672 101.546666l-5.909333 4.757334-2.837334 0.597333-52.544-14.08 11.114667-20.266667c3.562667-6.485333 7.04-13.013333 10.453333-19.626666 7.04-13.504 17.898667-35.797333 32.597334-66.816a21.290667 21.290667 0 0 0-9.984-28.309334l-3.029334-1.450666a21.333333 21.333333 0 0 0-26.368 6.442666c-33.6 45.013333-64.469333 78.826667-92.608 101.482667l-5.909333 4.757333-2.837333 0.597334-52.138667-13.973334 11.114667-20.266666c3.242667-5.888 6.72-12.416 10.453333-19.626667 6.997333-13.461333 17.962667-35.946667 32.896-67.434667a20.970667 20.970667 0 0 0-10.112-28.010666l-3.328-1.536a21.333333 21.333333 0 0 0-26.069333 6.613333c-33.642667 45.056-64.554667 78.976-92.778667 101.696l-5.909333 4.757333-2.837334 0.597334-32.64-8.746667 11.093334-20.245333c3.541333-6.506667 7.04-13.034667 10.453333-19.626667 6.976-13.482667 17.941333-35.968 32.874667-67.456a21.056 21.056 0 0 0-10.069334-28.074667l-3.242666-1.514666a21.333333 21.333333 0 0 0-26.154667 6.549333z" ></path></symbol><symbol id="icon-shanchu" viewBox="0 0 1024 1024"><path d="M202.666667 256h-42.666667a32 32 0 0 1 0-64h704a32 32 0 0 1 0 64H266.666667v565.333333a53.333333 53.333333 0 0 0 53.333333 53.333334h384a53.333333 53.333333 0 0 0 53.333333-53.333334V352a32 32 0 0 1 64 0v469.333333c0 64.8-52.533333 117.333333-117.333333 117.333334H320c-64.8 0-117.333333-52.533333-117.333333-117.333334V256z m224-106.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z m-32 288a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z m170.666666 0a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z" ></path></symbol><symbol id="icon-jia" viewBox="0 0 1024 1024"><path d="M580.722174 437.990403 580.722174 78.171384 436.794158 78.171384 436.794158 437.990403 76.975139 437.990403 76.975139 581.918419 436.794158 581.918419 436.794158 941.737438 580.722174 941.737438 580.722174 581.918419 940.542216 581.918419 940.542216 437.990403Z" ></path></symbol><symbol id="icon-baocun" viewBox="0 0 1024 1024"><path d="M814.805 128a51.179 51.179 0 0 1 51.179 51.179V844.01a51.179 51.179 0 0 1-51.179 51.157H201.173a51.179 51.179 0 0 1-51.178-51.157V179.179A51.179 51.179 0 0 1 201.173 128h613.654zM329.024 434.837a51.093 51.093 0 0 1-51.179-51.093V179.157h-76.672v664.854h613.76V179.179H738.22v204.48a51.179 51.179 0 0 1-51.179 51.178H329.024z m0-51.093h357.995V179.157H329.024v204.587z m357.91 204.501a25.557 25.557 0 1 1 0.085 51.072H329.024a25.536 25.536 0 1 1 0-51.072h357.91z" ></path></symbol><symbol id="icon-daochu" viewBox="0 0 1024 1024"><path d="M293.632 645.248c91.456-86.784 183.552-220.544 346.88-211.584a20.8 20.8 0 0 1 20.224 20.8v59.392a21.376 21.376 0 0 0 34.432 16.64l211.2-171.2a21.376 21.376 0 0 0 0-33.28l-210.24-192a21.952 21.952 0 0 0-35.648 16.64v60.096a20.8 20.8 0 0 1-17.856 20.8c-280.704 61.76-351.36 391.104-348.992 413.696zM192 960a138.176 138.176 0 0 1-129.984-152.512L64 832V192a116.48 116.48 0 0 1 128-128c-108.8 1.024 256 0 256 0a28.224 28.224 0 0 1 29.76 27.84A35.968 35.968 0 0 1 448 128H192a53.12 53.12 0 0 0-64 64c1.536-37.504 0 640 0 640a52.8 52.8 0 0 0 64 64c49.536-0.448 640 0 640 0a52.48 52.48 0 0 0 64-64c-0.64 105.152 0-256 0-256a36.48 36.48 0 0 1 27.264-38.4A33.216 33.216 0 0 1 960 576v256a116.48 116.48 0 0 1-128 128c-50.56-0.448-640 0-640 0z" ></path></symbol><symbol id="icon-daoru" viewBox="0 0 1024 1024"><path d="M512 384a42.666667 42.666667 0 0 1 42.666667 42.666667v341.333333h130.986666a21.333333 21.333333 0 0 1 14.250667 5.504l2.688 2.901333a21.333333 21.333333 0 0 1-4.010667 29.866667l-165.717333 126.464a32 32 0 0 1-38.912-0.042667l-164.48-126.464A21.333333 21.333333 0 0 1 342.442667 768H469.333333v-341.333333a42.666667 42.666667 0 0 1 42.666667-42.666667z m229.674667 298.368A42.666667 42.666667 0 0 1 746.666667 597.333333H853.333333V170.666667H170.666667v426.666666h106.666666a42.666667 42.666667 0 0 1 0 85.333334H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333334-85.333334h682.666666a85.333333 85.333333 0 0 1 85.333334 85.333334v426.666666a85.333333 85.333333 0 0 1-85.333334 85.333334h-106.666666z" ></path></symbol><symbol id="icon-huanyuan" viewBox="0 0 1024 1024"><path d="M909.637 478.524c-15.444-189.946-167.065-345.049-356.655-364.38-99.805-10.176-193.011 16.474-267.901 67.887l18.467-68.842c5.725-21.337-6.933-43.274-28.27-48.998s-43.274 6.934-48.998 28.271l-41.455 154.536c-5.724 21.337 6.933 43.273 28.271 48.998l154.536 41.455c21.337 5.724 43.273-6.934 48.998-28.271 5.724-21.337-6.934-43.274-28.271-48.998l-54.194-14.538c58.917-39.301 131.457-59.686 208.999-52.061 147.885 14.543 268.327 132.461 285.589 280.053 23.02 196.82-133.879 363.973-327.45 358.219-135.107-4.017-252.98-96.111-294.938-224.602-17.513-53.632-18.92-105.027-9.92-152.849 3.188-16.946-4.238-34.086-19.172-42.707l-0.049-0.028c-23.737-13.705-54.358-0.164-59.404 26.777-7.724 41.233-9.128 84.686-2.965 129.403 25.571 185.535 181.03 330.336 367.878 343.176C727.656 927.857 929.6 724.049 909.637 478.524z" ></path></symbol><symbol id="icon-menu-fold" viewBox="0 0 1024 1024"><path d="M85.312 170.688h853.376V256H85.312V170.688z m0 179.328L266.752 512l-181.44 162.048V349.952zM384 469.312h554.688v85.376H384V469.248zM85.312 768h853.376v85.312H85.312V768z" ></path></symbol><symbol id="icon-icon_image" viewBox="0 0 1024 1024"><path d="M85.333333 852.992V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666h768a42.666667 42.666667 0 0 1 42.666667 42.666666v640a42.666667 42.666667 0 0 1-42.666667 42.666667H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-0.341333z m768-157.610667V256H170.666667v493.994667l127.744-127.744a42.666667 42.666667 0 0 1 47.018666-9.045334l126.293334 54.314667 184.789333-146.346667a42.666667 42.666667 0 0 1 59.52 6.485334L853.333333 695.381333zM837.418667 810.666667l-160.853334-196.48-171.818666 136.021333a42.666667 42.666667 0 0 1-43.349334 5.76l-123.093333-52.906667L230.656 810.666667h606.762667zM341.333333 512a85.333333 85.333333 0 1 1 0-170.666667 85.333333 85.333333 0 0 1 0 170.666667z" ></path></symbol><symbol id="icon-icon_chart" viewBox="0 0 1024 1024"><path d="M128 864V128H96v768h896v-32H128z" ></path><path d="M225.6 352h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V385.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M417.6 128h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V161.6A33.6 33.6 0 0 1 417.6 128z" ></path><path d="M609.6 544h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V577.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M801.6 704h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128v-62.4a33.6 33.6 0 0 1 33.6-33.6z" ></path></symbol><symbol id="icon-jichukongjian" viewBox="0 0 1024 1024"><path d="M912 662.016l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 662.016c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.84 271.872 163.072c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.872-163.136 59.712 35.84c19.456 11.712 19.456 30.592 0 42.24z" ></path><path d="M912 501.12l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 501.12c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.904 271.872 163.136c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.936-163.2 59.712 35.904c19.392 11.712 19.392 30.656 0 42.24z" ></path><path d="M912 340.224L559.744 551.68c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 340.224c-19.456-11.584-19.456-30.592 0-42.24l352.32-211.456c9.728-5.76 22.528-8.704 35.2-8.704 12.736 0 25.472 2.88 35.2 8.704l352.32 211.456c19.456 11.648 19.456 30.656 0 42.24z" ></path></symbol><symbol id="icon-icon-relativity" viewBox="0 0 1024 1024"><path d="M352 352v-192a64 64 0 0 1 64-64h448a64 64 0 0 1 64 64v448a64 64 0 0 1-64 64h-192v192a64 64 0 0 1-64 64h-448a64 64 0 0 1-64-64v-448a64 64 0 0 1 64-64h192z m64-192v192h192a64 64 0 0 1 64 64v192h192v-448h-448z m192 512h-192a64 64 0 0 1-64-64v-192h-192v448h448v-192z m0-64v-192h-192v192h192z" ></path></symbol><symbol id="icon-root-list" viewBox="0 0 1024 1024"><path d="M85.333333 85.333333h853.333334v853.333334H85.333333V85.333333z m85.333334 85.333334v682.666666h682.666666V170.666667H170.666667z m85.333333 149.333333h512v85.333333H256v-85.333333z m0 170.666667h341.333333v85.333333H256v-85.333333z" ></path></symbol><symbol id="icon-control-platform" viewBox="0 0 1024 1024"><path d="M512 36.48l426.688 237.056v476.928L512 987.456l-426.688-236.992V273.536L512 36.544zM170.688 379.52v320.704l298.624 165.952V537.6l-298.624-158.08z m384 486.656l298.624-165.952v-320.64L554.688 537.6v328.512zM512 463.744l303.744-160.832L512 134.144 208.256 302.912 512 463.744z" ></path></symbol><symbol id="icon-icon-yonghu" viewBox="0 0 1024 1024"><path d="M511.744 96a253.184 253.184 0 0 1 252.8 252.928c0 91.904-49.216 172.544-122.688 216.832 146.24 50.24 253.632 181.824 253.632 331.584a32 32 0 0 1-64 0c0-156.864-146.432-289.408-319.744-289.408C338.432 607.936 192 740.48 192 897.344a32 32 0 0 1-64 0c0-149.76 107.328-281.28 253.568-331.648a252.992 252.992 0 0 1-122.752-216.768A253.184 253.184 0 0 1 511.744 96z m0 64a189.12 189.12 0 0 0-188.928 188.928 189.12 189.12 0 0 0 188.928 188.928 189.12 189.12 0 0 0 188.8-188.928A189.12 189.12 0 0 0 511.808 160z" ></path></symbol><symbol id="icon-a-shezhi" viewBox="0 0 1024 1024"><path d="M933.868272 511.691752a140.807706 140.807706 0 0 1 90.131728-131.067068 525.562914 525.562914 0 0 0-57.334136-138.64997 139.882962 139.882962 0 0 1-184.948826-184.948826A525.562914 525.562914 0 0 0 643.067068 0a140.376159 140.376159 0 0 1-262.134136 0A525.562914 525.562914 0 0 0 242.282962 57.334136a139.882962 139.882962 0 0 1-184.948826 184.948826A506.698134 506.698134 0 0 0 0 380.932932a140.376159 140.376159 0 0 1 0 262.134136 525.562914 525.562914 0 0 0 57.334136 138.64997 139.882962 139.882962 0 0 1 184.948826 184.948826 525.562914 525.562914 0 0 0 138.64997 57.334136 140.376159 140.376159 0 0 1 262.134136 0 525.562914 525.562914 0 0 0 138.64997-57.334136 139.882962 139.882962 0 0 1 184.948826-184.948826 506.698134 506.698134 0 0 0 57.334136-138.64997A140.807706 140.807706 0 0 1 933.868272 511.691752zM511.691752 652.437809A140.437809 140.437809 0 1 1 652.437809 511.691752 140.499458 140.499458 0 0 1 511.691752 652.437809z" ></path></symbol></svg>',(i=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var n,s,o,r,a,l=function(u,g){g.parentNode.insertBefore(u,g)};if(t&&!i.__iconfont__svg__cssinject__){i.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,g=document.createElement("div");g.innerHTML=i._iconfont_svg_string_5087053,(g=g.getElementsByTagName("svg")[0])&&(g.setAttribute("aria-hidden","true"),g.style.position="absolute",g.style.width=0,g.style.height=0,g.style.overflow="hidden",g=g,(u=document.body).firstChild?l(g,u.firstChild):u.appendChild(g))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(s=function(){document.removeEventListener("DOMContentLoaded",s,!1),n()},document.addEventListener("DOMContentLoaded",s,!1)):document.attachEvent&&(o=n,r=i.document,a=!1,h(),r.onreadystatechange=function(){r.readyState=="complete"&&(r.onreadystatechange=null,c())})}function c(){a||(a=!0,o())}function h(){try{r.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const cE=[Kr],Ks=i=>{!i||Ks.installed||(i.use(Et),cE.forEach(t=>{const e=t.name||t.__name;e&&i.component(e,t)}),Ks.installed=!0)},hE={install:Ks,EmsEditor:Kr,EmsPreview:Dd};ht.EmsEditor=Kr,ht.EmsPreview=Dd,ht.default=hE,ht.install=Ks,Object.defineProperties(ht,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
837
|
+
return {"text": a.find(i => i.value == value)?.label || '--'}`)},y=d.computed(()=>e.modelValue||{}),w=d.computed(()=>e.globals||{}),C=d.computed(()=>{if(!g.value)return"selected";const T=g.value.split(".").filter(Boolean);return T[T.length-1]||"selected"}),x=(T,L)=>(Array.isArray(L)?L:String(L||"").split(".")).filter(Z=>Z!=="").reduce((Z,Et)=>{if(Z==null)return;const he=Number(Et);return!Number.isNaN(he)&&String(he)===String(Et)?Z[he]:Z[Et]},T),E=()=>{if(f.value="",!a)return"";try{return new Function("data","$",a.getValue())(y.value,w.value)}catch(T){return f.value=T.message,""}},S=T=>{try{return JSON.stringify(T??{},null,2)}catch{return""}},v=()=>{m.value.visible=!1},M=()=>{u.value.visible=!1},k=()=>{var T;if(!((T=m.value.pathParts)!=null&&T.length)){v();return}g.value=m.value.path,j(C.value,m.value.pathParts),v()},I=(T,L=!1)=>{var Et;if(!T&&T!==0)return;const _=String(T),Z=()=>{!O(_)&&L&&R(_)};(Et=navigator==null?void 0:navigator.clipboard)!=null&&Et.writeText?navigator.clipboard.writeText(_).catch(()=>{Z()}).finally(()=>{L&&R(_)}):(Z(),L&&R(_))},O=T=>{try{const L=document.createElement("textarea");L.value=T,document.body.appendChild(L),L.select();const _=document.execCommand("copy");return document.body.removeChild(L),_}catch{return!1}},R=T=>{if(!a)return;const L=a.getModel();if(!L)return;const _=a.getPosition();L.pushEditOperations([],[{range:new Qt.Range(_.lineNumber,_.column,_.lineNumber,_.column),text:T,forceMoveMarkers:!0}],()=>null),a.focus()},K=()=>{if(!m.value.key)return v();I(m.value.key,!0),v()},D=()=>{if(m.value.value===void 0)return v();const T=typeof m.value.value=="object"?JSON.stringify(m.value.value):m.value.value;I(T,!0),v()},N=()=>{if(!m.value.path)return v();const T=m.value.path.startsWith("data.")?m.value.path:`data.${m.value.path}`;I(T,!0),v()},j=(T,L)=>{if(!a)return;const _=a.getModel();if(!_)return;const Z=a.getPosition(),Et=H(L),he=`
|
|
838
|
+
// ${Et}
|
|
839
|
+
const ${T} = ${Et};
|
|
840
|
+
`;_.pushEditOperations([],[{range:new Qt.Range(Z.lineNumber,Z.column,Z.lineNumber,Z.column),text:he,forceMoveMarkers:!0}],()=>null),a.focus()},rt=T=>{var Qd,Vd;if(!l)return;const L=l.getModel();if(!L)return;const _=((Qd=T.target)==null?void 0:Qd.position)||T.position;if(!_)return;const Z=L.getOffsetAt(_),Et=L.getValue(),Ue=Fv(Et,Z).path||[];if(!Ue.length)return;const Ld=it(Ue),Js=x(y.value,Ue),uE=Ue.length?String(Ue[Ue.length-1]):"",js=(Vd=s.value)==null?void 0:Vd.getBoundingClientRect();m.value={visible:!0,x:js?T.event.browserEvent.clientX-js.left:0,y:js?T.event.browserEvent.clientY-js.top:0,path:Ld,pathParts:Ue,key:uE,value:Js}},Ct=T=>{var _;T.event.preventDefault(),T.event.stopPropagation();const L=(_=s.value)==null?void 0:_.getBoundingClientRect();u.value={visible:!0,x:L?T.event.browserEvent.clientX-L.left:0,y:L?T.event.browserEvent.clientY-L.top:0}},pt=async()=>{if(!a)return M();const T=a.getModel().getValueInRange(a.getSelection());if(!T)return M();try{await navigator.clipboard.writeText(T)}catch{}M()},ct=async()=>{if(!a)return M();const T=a.getSelection(),L=a.getModel().getValueInRange(T);if(!L)return M();try{await navigator.clipboard.writeText(L),a.executeEdits("custom-cut",[{range:T,text:"",forceMoveMarkers:!0}])}catch{}M()},V=async()=>{if(!a)return M();try{const T=await navigator.clipboard.readText();if(!T)return M();a.executeEdits("custom-paste",[{range:a.getSelection(),text:T,forceMoveMarkers:!0}])}catch{}M()},tt=async()=>{if(!a)return M();try{const T=a.getAction("editor.action.formatDocument");T&&await T.run()}catch{}M()},it=T=>["data",...Array.isArray(T)?T:String(T||"").split(".").filter(Boolean)].map(_=>String(_)).join("."),H=T=>["data",...Array.isArray(T)?T:String(T||"").split(".").filter(Boolean)].map((_,Z)=>{if(Z===0)return"data";const Et=Number(_);return!Number.isNaN(Et)&&String(Et)===String(_)?`[${Et}]`:`.${_}`}).join(""),st=()=>{n("close")};d.onMounted(()=>{a=Qt.editor.create(o.value,{value:e.rule||jv,language:"javascript",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:14}),a.updateOptions({contextmenu:!1}),a.onContextMenu(T=>Ct(T)),a.onMouseDown(()=>M()),a.onKeyDown(()=>M()),h=a.addAction({id:"custom-paste",label:"粘贴",contextMenuGroupId:"9_cutcopypaste",run:async T=>{try{const L=await navigator.clipboard.readText();if(!L)return;T.executeEdits("custom-paste",[{range:T.getSelection(),text:L,forceMoveMarkers:!0}])}catch(L){console.warn("Clipboard read blocked",L)}}}),c=Qt.languages.registerCompletionItemProvider("javascript",{triggerCharacters:["$","."],provideCompletionItems(T,L){const Z=T.getValueInRange(new Qt.Range(L.lineNumber,1,L.lineNumber,L.column)).match(/\$\.[\w$]*$/);if(!Z)return{suggestions:[]};const Et=Z[0].split(".").pop()||"",he=new Qt.Range(L.lineNumber,L.column-Et.length,L.lineNumber,L.column);return{suggestions:Object.keys(w.value||{}).map(Js=>({label:Js,kind:Qt.languages.CompletionItemKind.Variable,insertText:Js,range:he}))}}}),l=Qt.editor.create(r.value,{value:S(y.value),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:13,readOnly:!0,contextmenu:!1}),l.onContextMenu(T=>{T.event.preventDefault(),T.event.stopPropagation(),rt(T)}),a.updateOptions({contextmenu:!1}),a.onContextMenu(T=>{Ct(T)}),a.addCommand(Qt.KeyMod.CtrlCmd|Qt.KeyCode.KeyC,()=>pt()),a.addCommand(Qt.KeyMod.CtrlCmd|Qt.KeyCode.KeyX,()=>ct()),a.addCommand(Qt.KeyMod.CtrlCmd|Qt.KeyCode.KeyV,()=>V()),a.onDidChangeModelContent(()=>{try{const T=a.getValue();n("update:rule",T)}catch{}}),document.addEventListener("click",v),document.addEventListener("click",M),mt()}),d.watch(()=>e.rule,T=>{if(!a)return;const L=T||"";a.getValue()!==L&&a.setValue(L)}),d.watch(y,T=>{l&&l.setValue(S(T)),mt()}),d.onBeforeUnmount(()=>{a==null||a.dispose(),l==null||l.dispose(),c==null||c.dispose(),h==null||h.dispose(),u.value.visible=!1,document.removeEventListener("click",v),document.removeEventListener("click",M)});const mt=()=>{p.value=E()};return(T,L)=>(d.openBlock(),d.createElementBlock("div",{class:"json-rule-editor",ref_key:"rootRef",ref:s},[L[2]||(L[2]=d.createElementVNode("div",{class:"editor-header"},[d.createElementVNode("span",null,"数据 JSON(右键选取字段为变量)")],-1)),d.createElementVNode("div",{ref_key:"dataEditorContainer",ref:r,class:"monaco-pane slim"},null,512),m.value.visible?(d.openBlock(),d.createElementBlock("div",{key:0,class:"context-menu",style:d.normalizeStyle({left:m.value.x+"px",top:m.value.y+"px"})},[d.createElementVNode("div",{class:"menu-item",onClick:K},"复制属性"),d.createElementVNode("div",{class:"menu-item",onClick:D},"复制值"),d.createElementVNode("div",{class:"menu-item",onClick:N},"复制属性路径"),d.createElementVNode("div",{class:"menu-item",onClick:k},"设置为变量(并插入解析函数)"),L[0]||(L[0]=d.createElementVNode("div",{class:"menu-item disabled"},"设置为全局变量(待实现)",-1))],4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"editor-header",style:{"margin-top":"8px"}},[L[1]||(L[1]=d.createElementVNode("span",null,"解析函数(JS,需 return 数值)",-1)),d.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:b},"填充示例")]),d.createElementVNode("div",{ref_key:"editorContainer",ref:o,class:"monaco-pane"},null,512),u.value.visible?(d.openBlock(),d.createElementBlock("div",{key:1,class:"context-menu",style:d.normalizeStyle({left:u.value.x+"px",top:u.value.y+"px"})},[d.createElementVNode("div",{class:"menu-item",onClick:ct},"剪切"),d.createElementVNode("div",{class:"menu-item",onClick:pt},"复制"),d.createElementVNode("div",{class:"menu-item",onClick:V},"粘贴"),d.createElementVNode("div",{class:"menu-item",onClick:tt},"格式化")],4)):d.createCommentVNode("",!0),d.createElementVNode("div",Uv,[d.createElementVNode("div",null,[d.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:mt},"运行测试"),d.createElementVNode("span",Kv,d.toDisplayString(p.value),1),f.value?(d.openBlock(),d.createElementBlock("span",Jv,"错误:"+d.toDisplayString(f.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:st},"确认生效")]),L[3]||(L[3]=d.createElementVNode("div",{class:"helper"},[d.createElementVNode("div",{class:"helper-title"},"使用方式"),d.createElementVNode("p",null,"data 为当前 JSON 数据,$ 为全局变量对象;右键字段插入示例代码(data.xxx 或 $?.xxx)。在下方函数里 return 需要展示的数值。")],-1))],512))}},[["__scopeId","data-v-a757bc46"]]),Yv={class:"dataBox"},Hv={style:{padding:"10px 0","margin-bottom":"10px"}},_v={style:{padding:"10px 0","margin-bottom":"10px"}},Wv={class:"param-table"},qv={class:"param-table__toolbar"},Xv={style:{padding:"10px 0"}},$v={style:{padding:"10px 0","margin-bottom":"10px"}},Zv=vt({__name:"data",setup(i){const t=d.inject("getCurCell")(),e=d.inject("topoApi"),n=d.ref(t.getData()),s=d.ref(n.value.dataSource.parse||""),o=d.ref(!1),r=d.ref({text1:""}),a=d.ref(null),l={},c=d.ref({}),h=async()=>{if(a.value===null)return St.ElMessage.error("请获取数据!"),!1;if(!s.value){const w={};g.value.bindName.forEach(C=>{w[C]=""}),s.value=`return ${JSON.stringify(w)}`}g.value.type==="opcua"&&(c.value={payload:a.value,pointTemp:n.value.dataSource.point}),g.value.type==="http"&&(c.value=a.value),o.value=!0},u=()=>{a.value=null},g=d.ref(n.value.dataSource);Array.isArray(g.value.params)||(g.value.params=[]);const f=async()=>{if(!g.value.path)return St.ElMessage.error("请输入点位地址!"),!1;const w=await e.readPoints([g.value.path]);console.log(w),a.value=w[0]||{error:"未找到数据"}},p=()=>{g.value.params.push({label:"",value:""})},m=w=>{g.value.params.splice(w,1)},b=async()=>{if(!g.value.httpUrl)return St.ElMessage.error("请输入请求地址"),!1;let w={};for(let x of g.value.params)if(x.label)w[x.label]=x.value;else return St.ElMessage.error("请完善请求参数"),!1;let C;try{C=await e.httpRequest({...g.value,params:w})}catch{C={error:"数据获取失败"}}a.value=C,console.log(C)},y=()=>{var C,x,E;if(((C=g.value.name)==null?void 0:C.length)==0)return St.ElMessage.error("请选择数据关联!"),!1;if(a.value===null)return St.ElMessage.error("请获取数据!"),!1;let w={};if(s.value)try{const S=new Function("data","$",s.value);g.value.type=="opcua"?w=S({payload:a.value,pointTemp:n.value.dataSource.point},r.value):g.value.type=="http"&&(w=S(a.value,r.value)),w.dataSource={parse:s.value},t.setData(w),o.value=!1}catch(S){St.ElMessage.error("解析失败!"),console.log(S)}else w[g.value.name]=((E=(x=a.value)==null?void 0:x.payload)==null?void 0:E.value)||"--",t.setData(w),o.value=!1};return(w,C)=>{const x=d.resolveComponent("el-option"),E=d.resolveComponent("el-select"),S=d.resolveComponent("el-form-item"),v=d.resolveComponent("el-input"),M=d.resolveComponent("el-button"),k=d.resolveComponent("el-radio"),I=d.resolveComponent("el-radio-group"),O=d.resolveComponent("el-table-column"),R=d.resolveComponent("el-table"),K=d.resolveComponent("el-form"),D=d.resolveComponent("el-dialog");return d.openBlock(),d.createElementBlock("div",Yv,[d.createVNode(K,{class:"panelList",size:"small"},{default:d.withCtx(()=>[d.createVNode(S,{label:"数据类型"},{default:d.withCtx(()=>[d.createVNode(E,{modelValue:g.value.type,"onUpdate:modelValue":C[0]||(C[0]=N=>g.value.type=N),onChange:u},{default:d.withCtx(()=>[d.createVNode(x,{value:"none",label:"无"}),d.createVNode(x,{value:"opcua",label:"OPCUA点位"}),d.createVNode(x,{value:"http",label:"HTTP接口"}),d.createVNode(x,{value:"mock",label:"Mock模拟"})]),_:1},8,["modelValue"])]),_:1}),g.value.type!=="none"?(d.openBlock(),d.createBlock(S,{key:0,label:"数据关联"},{default:d.withCtx(()=>[d.createVNode(E,{modelValue:g.value.bindName,"onUpdate:modelValue":C[1]||(C[1]=N=>g.value.bindName=N),multiple:"","collapse-tags":""},{default:d.withCtx(()=>[d.createVNode(x,{value:"text",label:"文本"}),d.createVNode(x,{value:"color",label:"字体颜色"}),d.createVNode(x,{value:"backgroundColor",label:"背景颜色"}),d.createVNode(x,{value:"model",label:"内部变量"})]),_:1},8,["modelValue"])]),_:1})):d.createCommentVNode("",!0),g.value.type==="opcua"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createVNode(S,{label:"点位地址"},{default:d.withCtx(()=>[d.createVNode(v,{modelValue:g.value.path,"onUpdate:modelValue":C[2]||(C[2]=N=>g.value.path=N)},null,8,["modelValue"])]),_:1}),d.createElementVNode("div",Hv,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:f},{default:d.withCtx(()=>[...C[10]||(C[10]=[d.createTextVNode("获取数据",-1)])]),_:1})]),d.createVNode(zr,{modelValue:a.value,"onUpdate:modelValue":C[3]||(C[3]=N=>a.value=N),style:{height:"400px"}},null,8,["modelValue"]),d.createElementVNode("div",_v,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:h},{default:d.withCtx(()=>[...C[11]||(C[11]=[d.createTextVNode("数据解析",-1)])]),_:1})])],64)):d.createCommentVNode("",!0),g.value.type==="http"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[d.createVNode(S,{label:"接口类型"},{default:d.withCtx(()=>[d.createVNode(I,{modelValue:g.value.httpType,"onUpdate:modelValue":C[4]||(C[4]=N=>g.value.httpType=N)},{default:d.withCtx(()=>[d.createVNode(k,{value:"GET"},{default:d.withCtx(()=>[...C[12]||(C[12]=[d.createTextVNode("GET",-1)])]),_:1}),d.createVNode(k,{value:"POST"},{default:d.withCtx(()=>[...C[13]||(C[13]=[d.createTextVNode("POST",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),d.createVNode(S,{label:"接口地址"},{default:d.withCtx(()=>[d.createVNode(v,{modelValue:g.value.httpUrl,"onUpdate:modelValue":C[5]||(C[5]=N=>g.value.httpUrl=N),autosize:{minRows:2,maxRows:4},type:"textarea"},null,8,["modelValue"])]),_:1}),d.createElementVNode("div",Wv,[d.createElementVNode("div",qv,[C[15]||(C[15]=d.createElementVNode("div",null,"请求参数",-1)),d.createVNode(M,{size:"small",type:"primary",plain:"",onClick:p},{default:d.withCtx(()=>[...C[14]||(C[14]=[d.createTextVNode("新增参数",-1)])]),_:1})]),d.createVNode(R,{data:g.value.params,size:"small",border:"",height:"180"},{default:d.withCtx(()=>[d.createVNode(O,{prop:"label",label:"字段名"},{default:d.withCtx(({row:N})=>[d.createVNode(v,{modelValue:N.label,"onUpdate:modelValue":j=>N.label=j,modelModifiers:{trim:!0},placeholder:"字段名"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),d.createVNode(O,{prop:"value",label:"值"},{default:d.withCtx(({row:N})=>[d.createVNode(v,{modelValue:N.value,"onUpdate:modelValue":j=>N.value=j,placeholder:"值"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),d.createVNode(O,{label:"操作",width:"60"},{default:d.withCtx(({$index:N})=>[d.createVNode(M,{link:"",type:"danger",onClick:j=>m(N)},{default:d.withCtx(()=>[...C[16]||(C[16]=[d.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])]),d.createElementVNode("div",Xv,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:b},{default:d.withCtx(()=>[...C[17]||(C[17]=[d.createTextVNode("获取数据",-1)])]),_:1})]),d.createVNode(zr,{modelValue:a.value,"onUpdate:modelValue":C[6]||(C[6]=N=>a.value=N),style:{height:"300px"}},null,8,["modelValue"]),d.createElementVNode("div",$v,[d.createVNode(M,{type:"primary",style:{width:"100%"},onClick:h},{default:d.withCtx(()=>[...C[18]||(C[18]=[d.createTextVNode("数据解析",-1)])]),_:1})])],64)):d.createCommentVNode("",!0),g.value.type==="mock"?(d.openBlock(),d.createBlock(zr,{key:3,modelValue:n.value,"onUpdate:modelValue":C[7]||(C[7]=N=>n.value=N),style:{height:"600px"}},null,8,["modelValue"])):d.createCommentVNode("",!0)]),_:1}),d.createVNode(D,{modelValue:o.value,"onUpdate:modelValue":C[9]||(C[9]=N=>o.value=N),title:"实时数据解析",width:"800","align-center":""},{default:d.withCtx(()=>[d.createVNode(Gv,{"model-value":c.value,rule:s.value,"onUpdate:rule":C[8]||(C[8]=N=>s.value=N),globals:l,onClose:y},null,8,["model-value","rule"])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-4c27164c"]]),tE={class:"prop"},eE={class:"tabContainer"},nE=["onClick"],iE={class:"activeLine"},sE={key:0,class:"main"},oE=vt({__name:"index",setup(i){const t=Kt(),e=Pn(),{targetType:n,tabs:s,activeTab:o,cellId:r}=be.storeToRefs(e),a=h=>{o.value=h};let l=r.value?t.graph.getCellById(r.value):null;d.provide("getCurCell",()=>l),d.provide("cellId",r);const c=d.ref(!0);return d.watch(r,()=>{console.log("cellId",r.value),l=t.graph.getCellById(r.value),c.value=!1,d.nextTick(()=>{c.value=!0})}),(h,u)=>(d.openBlock(),d.createElementBlock("div",tE,[d.createElementVNode("div",eE,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(s),(g,f)=>(d.openBlock(),d.createElementBlock("div",{key:f,class:d.normalizeClass(["tabItem",{active:d.unref(o)===f}]),onClick:p=>a(f)},[d.createTextVNode(d.toDisplayString(g)+" ",1),d.withDirectives(d.createElementVNode("div",iE,null,512),[[d.vShow,d.unref(o)===f]])],10,nE))),128))]),c.value?(d.openBlock(),d.createElementBlock("div",sE,[d.unref(n)==="blank"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.unref(o)===0?(d.openBlock(),d.createBlock(Tv,{key:0})):d.createCommentVNode("",!0)],64)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.unref(o)===0?(d.openBlock(),d.createBlock(Dv,{key:0})):d.unref(o)===1?(d.openBlock(),d.createBlock(Zv,{key:1})):d.createCommentVNode("",!0)],64))])):d.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b4a4e65e"]]),rE={class:"ems-editor"},aE={class:"ems-editor__workspace"},Kr=Object.assign({name:"EmsEditor"},{__name:"index",props:{services:{type:Object,default:()=>({})},width:{type:Number,default:1920},height:{type:Number,default:1080}},emits:["ready","exit"],setup(i,{emit:t}){const e=On(),n=Pn(),s=Kt(),o=i,r={setItem(l,c){c!==void 0&&window.localStorage.setItem(l,JSON.stringify(c))},getItem(l){let c=window.localStorage.getItem(l);return JSON.parse(c)},removeItem(l){window.localStorage.removeItem(l)},clear(){window.localStorage.clear()}},a={async getAllMenus(){var c;let l=[];return(c=o.services)!=null&&c.getAllMenus?l=await o.services.getAllMenus()||[]:l=r.getItem("menus")||[{id:"1",parentId:"0",name:"首页",children:[{id:crypto.randomUUID(),parentId:"1",name:"首页概览",style:{},value:{}}]}],r.setItem("menus",l),l},async getMenu(l){var c;if((c=o.services)!=null&&c.getMenu)return await o.services.getMenu(l)||{};{let h=r.getItem("menus")||[];for(let u of h)if(u.children){for(let g of u.children)if(g.id===l)return g}return{}}},async addMenu({parent:l,parentNameNew:c,name:h}){var u;if((u=o.services)!=null&&u.addMenu)return await o.services.addMenu({parent:l,parentNameNew:c,name:h});{let g=r.getItem("menus")||[],f=null,p=crypto.randomUUID(),m="";if(l==="0")m=crypto.randomUUID(),f={name:h,id:p,parentId:m,style:{},value:{}},g.push({name:c,id:m,parentId:"0",children:[f]});else{const b=g.find(y=>y.id===l);b&&(m=b.id,b.children.push({name:h,id:p,parentId:m,style:{},value:{}}),f={name:h,id:p,parentId:m,style:{},value:{}})}return r.setItem(p,f),r.setItem("menus",g),f}},async saveMenus(l){var h;const c=await this.getMenu(l.id);if(c&&(c.name=l.name,c.style=l.style,c.value=l.value),(h=o.services)!=null&&h.saveMenus)await o.services.saveMenus(l);else{let u=r.getItem("menus")||[];for(let g of u){const f=g.children.findIndex(p=>p.id===l.id);f>-1&&(g.children[f]=l)}r.setItem("menus",u),r.setItem(l.id,l)}},async removeMenu(l){var c;if((c=o.services)!=null&&c.removeMenu)await o.services.removeMenu(l);else{let h=r.getItem("menus")||[];if(this.getMenu(l)){const g=h.find(f=>{var p;return(p=f.children)==null?void 0:p.some(m=>m.id===l)});g&&(g.children=g.children.filter(f=>f.id!==l),g.children.length===0&&(h=h.filter(f=>f.id!==g.id))),r.setItem("menus",h)}r.removeItem(l)}},async getDeviceList(){var c;let l=[];if((c=o.services)!=null&&c.getDeviceList)l=await o.services.getDeviceList();else{const h=[{id:"2010960121314734082",deviceName:"干接点",deviceType:"OTHERS",deviceNo:"DIDO",templateName:"DIDO_test.json",templateId:"2010957702564474882",pointList:[{id:"2010957702568669185",templateId:"2010957702564474882",tag:"en_sts",name:"使能STS",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0001, uint, AB]",description:"0:失能;1:启动使能;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863489",templateId:"2010957702564474882",tag:"connect_statu",name:"电网闸",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0002, uint, AB]",description:"0:断开;1:闭合;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863490",templateId:"2010957702564474882",tag:"icb_sign",name:"外源断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0003, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863491",templateId:"2010957702564474882",tag:"icb_ctrl",name:"外源断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0004, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863492",templateId:"2010957702564474882",tag:"lcb_sign",name:"负载断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0005, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863493",templateId:"2010957702564474882",tag:"lcb_ctrl",name:"负载断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0006, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863494",templateId:"2010957702564474882",tag:"dg_sign",name:"发动机启停状态",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0007, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863495",templateId:"2010957702564474882",tag:"dg_ctrl",name:"发动机控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0008, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863496",templateId:"2010957702564474882",tag:"ats",name:"ATS反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0009, uint, AB]",description:"0:合闸柴发;1:合闸电网;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null}]}];for(const u of h){const g=u.pointList;g&&Array.isArray(g)&&g.length>0&&l.push({id:u.id,label:u.deviceName,data:u,children:g.map(f=>({id:f.id,label:f.name,data:{...f,nodeId:`ns=1;s=${u.deviceType}.${f.tag}`}}))})}}return l},async readPoints(l){var c,h;return(c=o.services)!=null&&c.readPoints?await((h=o.services)==null?void 0:h.readPoints(l)):[{nodeId:"ns=1;s=PV.RatReActivePowerPer",value:1,statusCode:"Good",sourceTimestamp:"2026-01-16T02:26:37.533Z",serverTimestamp:"2026-01-16T02:26:37.533Z",aa:[{vv:1},{vv1:1}]}]},async httpRequest(l){var c,h;return(c=o.services)!=null&&c.httpRequest?await((h=o.services)==null?void 0:h.httpRequest(l)):{}}};return d.provide("topoApi",a),d.onMounted(()=>{}),d.onBeforeUnmount(()=>{e.$reset(),n.$reset(),s.$reset()}),(l,c)=>(d.openBlock(),d.createElementBlock("div",rE,[d.createElementVNode("div",aE,[d.createVNode(Bv),d.createVNode(jx,{width:o.width,height:o.height},null,8,["width","height"]),d.createVNode(oE)])]))}}),lE={class:"previewBox"},Dd=vt({__name:"preview",props:{menu:{type:Object,required:!0},service:{type:Object,required:!0}},setup(i){const t=i,e=t.service,n=d.ref(null);let s=null;const o=Dr();let r=[];const a=c=>{if(!c.cell)return!1;r.length>0&&(e.unsubscribe(r.map(h=>h.path)),r=[]);for(let h of c.cell)if(h.data&&h.data.datasource&&h.data.datasource.type!=="none"){const u=s.getCellById(h.id),g=h.data.datasource;if(g.type=="opcua"&&g.path&&g.parse)try{e.readPoints([g.path]).then(f=>{f&&f.length>0&&l(f[0],g,u)}),r.push({nodeId:g.path,callBack:f=>l(f,g,u)})}catch(f){ElMessage.error("解析失败!"),console.log(f)}if(g.type=="http"&&g.parse)try{const f=new Function("data","$",g.parse);e.httpRequest(g).then(p=>{if(p){let m=f(p,{});u.setData(m)}})}catch(f){ElMessage.error("解析失败!"),console.log(f)}}e.subscribe(r.map(h=>h.path)),e.onEvent(h=>{h.event==="data-changed"&&h.payload&&h.payload.nodeId&&r.forEach((u,g)=>{u.nodeId==h.payload.nodeId&&r[g].callBack(h.payload)})})},l=(c,h,u)=>{const g=new Function("data","$",h.parse);let f={};parse?f=g({payload:c,pointTemp:h.point},{}):f.text=res.payload.value||"--",u.setData(f)};return d.watch(()=>t.menu,c=>{s&&(s.clearCells(),s.resize(c.style.width,c.style.height),s.fromJSON(c.value),s.drawBackground({color:c.style.backgroundColor,image:c.style.backgroundImage,size:"cover"}),a(c.value))},{deep:!0}),d.onMounted(()=>{const{width:c,height:h}=t.menu.style;s=new B({container:n.value,width:c,height:h,interacting:!1,selecting:!1,keyboard:!1,mousewheel:!1,panning:!1}),Qr(),s.fromJSON(t.menu.value),s.drawBackground({color:t.menu.style.backgroundColor,image:t.menu.style.backgroundImage,size:"cover"})}),d.onBeforeUnmount(()=>{s&&s.dispose()}),(c,h)=>(d.openBlock(),d.createElementBlock("div",lE,[d.createElementVNode("div",{ref_key:"container",ref:n,class:"ems-preview"},null,512),d.createVNode(d.unref(o))]))}},[["__scopeId","data-v-a4b36e35"]]);window._iconfont_svg_string_5087053='<svg><symbol id="icon-jiesuo1" viewBox="0 0 1024 1024"><path d="M768.25422 0q48.810328 0 94.061569 18.303873t80.333664 50.33565 56.436941 74.740814 21.354518 91.519364l0 150.49851-123.042701 0 0-122.025819q0-64.063555-36.099305-99.654419t-97.112214-35.590864q-54.911619 0-88.468719 35.590864t-33.5571 99.654419l0 124.059583-128.12711 0 0-152.532274q0-48.810328 19.320755-91.519364t53.386296-74.740814 80.333664-50.33565 101.179742-18.303873zM766.220457 693.513406l0 87.451837 0 47.793446q0 27.455809-9.660377 51.860973t-26.438928 41.692155-39.658391 27.455809-50.33565 10.168818l-514.542205 0q-27.455809 0-49.82721-9.660377t-38.641509-26.438928-24.913605-39.14995-8.643496-47.793446l0-323.368421q0-28.472691 19.829196-47.793446t46.268123-19.320755l629.449851 0q28.472691 0 47.793446 19.320755t19.320755 47.793446l0 179.988083z" ></path></symbol><symbol id="icon-jianlizuhe1" viewBox="0 0 1024 1024"><path d="M891.8 65h-632c-35.5 0-64.4 28.8-64.4 64.4v125.3h-66.3c-35.5 0-64.4 28.8-64.4 64.4v575.6c0 35.5 28.8 64.4 64.4 64.4h572.6c35.5 0 64.4-28.8 64.4-64.4v-65.3h125.6c35.5 0 64.4-28.8 64.4-64.4V129.4c0.1-35.6-28.7-64.4-64.3-64.4zM702.2 894.6v0.1c0 0.1-0.2 0.2-0.2 0.2H129.1c-0.1 0-0.2-0.2-0.2-0.2V319v-0.1c0-0.1 0.2-0.2 0.2-0.2h0.1l66.3 0.1S194 794.1 194 797.4c0 17.7 14.3 32 32 32h476.2v65.2zM259.5 129.2c0-0.1 0.2-0.2 0.2-0.2h632.2c0.1 0 0.2 0.2 0.2 0.2V765.1c0 0.1-0.2 0.2-0.2 0.2H259.5V129.2z" ></path></symbol><symbol id="icon-suoding1" viewBox="0 0 1024 1024"><path d="M860.069521 429.487623h-73.242947v-170.422692C786.826574 116.337371 670.888872 0.272064 528.240764 0.272064c-142.650515 0-258.720638 116.065307-258.720638 258.792867v170.422692H196.339779c-35.281619 0-63.879618 28.612445-63.879618 63.91814v466.606275c0 35.368294 28.597999 63.983146 63.879618 63.983147h663.79234c35.29125 0 63.821834-28.614852 63.821835-63.983147V493.405763c-0.004815-35.310511-28.590776-63.91814-63.884433-63.91814zM564.114664 738.867504v101.889098c0 4.552855-3.765556 8.388233-8.385825 8.388233h-54.91355c-4.678053 0-8.446016-3.837785-8.446017-8.388233v-101.889098c-25.800316-13.201114-43.672259-39.665939-43.672259-70.68362 0-43.888947 35.613874-79.584681 79.481153-79.584682 43.932285 0 79.548567 35.695734 79.548566 79.584682 0.062599 31.020089-17.811752 57.482507-43.612068 70.68362z m123.476036-309.379881H368.883605v-166.202091c0-87.912723 71.55278-159.501618 159.417351-159.501618s159.287337 71.588895 159.287337 159.501618l0.002407 166.202091z" ></path></symbol><symbol id="icon-xingzhuang-juxing" viewBox="0 0 1024 1024"><path d="M864 896H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h704a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zM192 832h640V192H192v640z" ></path></symbol><symbol id="icon-shuzhi" viewBox="0 0 1024 1024"><path d="M921.6 21.162667H102.4c-37.546667 0-68.266667 30.788267-68.266667 68.4032v819.950933c0 37.546667 30.72 68.334933 68.266667 68.334933h819.2c37.546667 0 68.266667-30.72 68.266667-68.266666V89.4976c0-37.546667-30.72-68.334933-68.266667-68.334933z m0 854.2208c0 20.48-13.653333 34.133333-34.133333 34.133333h-750.933334c-20.48 0-34.133333-13.653333-34.133333-34.133333V123.767467c0-20.548267 13.653333-34.2016 34.133333-34.2016h750.933334c20.48 0 34.133333 13.653333 34.133333 34.133333v751.616z" ></path><path d="M274.568533 365.704533h36.0448V658.090667h-47.9232V423.458133a165.546667 165.546667 0 0 1-66.7648 35.6352v-47.5136c13.1072-3.2768 27.0336-9.0112 41.7792-17.2032 14.7456-9.0112 27.0336-18.432 36.864-28.672z m200.2944-5.7344c28.2624 0 51.6096 8.192 70.0416 24.576 18.0224 16.384 27.0336 37.2736 27.0336 63.488 0 25.3952-9.8304 48.3328-28.672 69.2224-11.4688 12.288-31.9488 27.8528-60.6208 47.104-29.9008 19.6608-47.9232 36.864-54.4768 51.6096h144.1792v42.1888H368.366933c0-29.9008 9.4208-55.7056 29.0816-77.824 10.6496-12.288 33.1776-30.3104 67.1744-53.6576 18.8416-13.1072 31.9488-24.1664 40.1408-32.768 12.6976-14.336 19.2512-29.9008 19.2512-46.2848 0-15.9744-4.5056-27.8528-12.6976-35.6352-8.6016-7.7824-21.2992-11.4688-38.0928-11.4688-18.0224 0-31.5392 6.144-40.5504 18.432-9.0112 11.4688-13.9264 29.0816-14.7456 52.0192H370.005333c0.4096-32.768 9.8304-58.9824 28.672-79.0528 19.2512-21.2992 44.6464-31.9488 76.1856-31.9488z m244.1216 0c29.4912 0 53.6576 6.9632 71.68 21.2992 17.6128 14.336 26.624 33.9968 26.624 59.392 0 31.9488-16.384 53.248-48.7424 63.8976 17.2032 5.3248 30.72 13.1072 39.7312 23.7568a61.986133 61.986133 0 0 1 14.7456 42.5984c0 27.0336-9.4208 49.152-28.2624 66.3552-19.6608 17.6128-45.4656 26.624-77.4144 26.624-30.3104 0-54.8864-7.7824-73.3184-23.3472-20.48-17.2032-31.9488-42.5984-34.4064-75.3664h48.7424c0.8192 18.8416 6.5536 33.5872 18.0224 43.8272 10.24 9.4208 23.7568 14.336 40.5504 14.336 18.432 0 33.1776-5.3248 43.8272-15.5648a47.240533 47.240533 0 0 0 14.336-34.816c0-16.7936-5.3248-29.0816-15.1552-36.864-9.8304-8.192-24.1664-11.8784-43.008-11.8784h-20.48V488.106667h20.48c17.2032 0 30.3104-3.6864 39.3216-11.0592 8.6016-7.3728 13.1072-18.432 13.1072-32.768 0-14.336-4.096-24.9856-11.8784-32.3584-8.6016-7.3728-21.2992-11.0592-38.0928-11.0592-17.2032 0-30.3104 4.096-39.7312 12.6976-9.8304 8.6016-15.5648 21.7088-17.2032 39.3216h-47.104c2.4576-29.4912 13.1072-52.4288 32.768-68.8128 18.432-16.384 42.1888-24.1664 70.8608-24.1664z" ></path></symbol><symbol id="icon-xianduan" viewBox="0 0 1024 1024"><path d="M0.034239 975.503207L976.222236 0l48.400922 48.435162L48.435162 1023.945217z" ></path></symbol><symbol id="icon-yulan" viewBox="0 0 1024 1024"><path d="M512.122 272.146c-247.216 0-412.027 247.216-412.027 247.216s164.811 247.216 412.027 247.216c247.216 0 412.027-247.216 412.027-247.216S759.217 272.146 512.122 272.146z m0 410.207c-90.537 0-163.962-73.424-163.962-163.962s73.424-163.962 163.962-163.962c90.537 0 163.962 73.424 163.962 163.962-0.122 90.658-73.424 163.962-163.962 163.962z m-82.406-163.476c0 21.482 8.86 42.841 24.03 58.012s36.53 24.03 58.012 24.03 42.841-8.86 58.012-24.03c15.17-15.17 24.03-36.53 24.03-58.012s-8.86-42.841-24.03-58.012c-15.17-15.17-36.53-24.03-58.012-24.03s-42.841 8.86-58.012 24.03c-15.17 15.292-24.03 36.53-24.03 58.012z" ></path></symbol><symbol id="icon-tubiao" viewBox="0 0 1024 1024"><path d="M437.996 697.519V586.722H327.195c-61.187 0-110.797 49.61-110.797 110.797 0 61.195 49.61 110.797 110.797 110.797 61.192 0 110.801-49.602 110.801-110.797z m55.399 0c0 91.789-74.411 166.195-166.2 166.195C235.41 863.714 161 789.308 161 697.519c0-91.789 74.41-166.195 166.195-166.195h166.2v166.195z m92.328 0V586.722H696.52c61.195 0 110.796 49.61 110.796 110.797 0 61.195-49.601 110.797-110.796 110.797-61.188 0-110.797-49.602-110.797-110.797z m-55.399 0c0 91.789 74.41 166.195 166.196 166.195 91.789 0 166.199-74.406 166.199-166.195 0-91.789-74.41-166.195-166.199-166.195H530.324v166.195z m-92.328-369.324v110.801H327.195c-61.187 0-110.797-49.61-110.797-110.801 0-61.188 49.61-110.797 110.797-110.797 61.192 0 110.801 49.609 110.801 110.797z m55.399 0c0-91.785-74.411-166.195-166.2-166.195C235.41 162 161 236.41 161 328.195c0 91.789 74.41 166.199 166.195 166.199h166.2V328.195z m92.328 0v110.801H696.52c61.195 0 110.796-49.61 110.796-110.801 0-61.188-49.601-110.797-110.796-110.797-61.188 0-110.797 49.609-110.797 110.797z m-55.399 0C530.324 236.41 604.734 162 696.52 162c91.789 0 166.199 74.41 166.199 166.195 0 91.789-74.41 166.199-166.199 166.199H530.324V328.195z m0 0" ></path></symbol><symbol id="icon-tupian" viewBox="0 0 1024 1024"><path d="M335.36 440.32c38.4 0 71.68-30.72 71.68-71.68 0-38.4-30.72-71.68-71.68-71.68-38.4 0-71.68 30.72-71.68 71.68 2.56 40.96 33.28 71.68 71.68 71.68z m0 0M652.8 396.8L445.44 691.2 337.92 540.16 158.72 793.6h704L652.8 396.8z m0 0" ></path><path d="M934.4 107.52H89.6c-20.48 0-35.84 15.36-35.84 35.84V883.2c0 20.48 15.36 35.84 35.84 35.84h844.8c20.48 0 35.84-15.36 35.84-35.84V143.36c0-20.48-15.36-35.84-35.84-35.84z m-35.84 739.84H125.44V176.64h775.68v670.72h-2.56z m0 0" ></path></symbol><symbol id="icon-wenzi" viewBox="0 0 1024 1024"><path d="M64.1 66v303.7l39.5-1.3c13.6-110.8 102.6-186.4 153.2-199 50.7-12.6 148.3 1.1 148.3 1.1s-1.3 625.2-1.3 669.2c0 44.1-59.3 63-59.3 63l-79 1.3-1.2 55.4h493.1v-54.1h-90.2c-40.8-3.8-65.4-56.7-65.4-56.7l1.1-684.5s61.8-11.3 150.8 5.1c89 16.4 164.3 204.1 164.3 204.1h39.5V66H64.1z" ></path></symbol><symbol id="icon-xinjian" viewBox="0 0 1024 1024"><path d="M618 958.5H202c-44.8 0-81.3-34.1-81.3-76v-740c0-41.9 36.5-76 81.3-76h610.5c44.8 0 81.3 34.1 81.3 76v521.9c0 12.8-10.4 23.1-23.1 23.1s-23.1-10.4-23.1-23.1V142.5c0-16.4-15.7-29.7-35-29.7H202c-19.3 0-35 13.3-35 29.7v740c0 16.4 15.7 29.7 35 29.7h416c12.8 0 23.1 10.4 23.1 23.1 0.1 12.8-10.3 23.2-23.1 23.2z" ></path><path d="M738.4 360.5H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h462.5c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1zM584.3 595.1H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h308.3c12.8 0 23.1 10.4 23.1 23.1 0 12.7-10.3 23.1-23.1 23.1zM878.8 826.3H614.6c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h264.3c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1z" ></path><path d="M746.7 958.5c-12.8 0-23.1-10.4-23.1-23.1V671.1c0-12.8 10.4-23.1 23.1-23.1 12.8 0 23.1 10.4 23.1 23.1v264.3c0 12.7-10.3 23.1-23.1 23.1z" ></path></symbol><symbol id="icon-qingkong" viewBox="0 0 1024 1024"><path d="M274.56 798.997333l19.434667-25.130666-33.792 68.565333a18.133333 18.133333 0 0 0 11.562666 25.536l59.733334 16a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.818667 35.626667-35.989333 45.290666-48.469333l19.456-25.130667-33.813333 68.565333a18.133333 18.133333 0 0 0 11.562667 25.536l84.48 22.634667a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-35.989333 45.269333-48.469333l19.456-25.130667-33.813333 68.565333A18.133333 18.133333 0 0 0 535.530667 938.666667l72.106666 19.328a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-36.010667 45.269334-48.490667l19.456-25.130667-33.813334 68.586667a18.133333 18.133333 0 0 0 11.584 25.514667l86.421334 23.338666 3.84-0.213333c13.269333-0.704 29.056-5.034667 43.84-12.8 29.781333-15.701333 48.170667-43.2 52.181333-78.250667 2.133333-18.517333 4.778667-38.549333 8.405333-63.530666 1.642667-11.221333 2.944-20.010667 6.229334-41.834667 11.050667-73.322667 14.634667-101.034667 17.130666-133.674667l0.938667-12.373333 2.837333-2.922667 12.330667-1.344a41.813333 41.813333 0 0 0 24.810667-11.221333c10.730667-10.24 14.805333-25.386667 11.093333-42.197333l-37.546667-171.584c-3.029333-13.696-11.264-27.946667-23.146666-39.829334-11.648-11.626667-25.92-20.138667-39.893334-23.893333L723.626667 331.306667l-2.261334-3.925334L774.250667 130.133333c8.32-31.061333-11.754667-63.744-44.970667-72.64l-79.509333-21.312c-33.194667-8.896-66.922667 9.365333-75.264 40.426667l-52.842667 197.269333-3.925333 2.261334-118.101334-31.637334c-13.994667-3.754667-30.634667-3.498667-46.506666 0.746667-16.256 4.352-30.506667 12.586667-39.957334 22.933333l-118.314666 129.792c-11.605333 12.714667-15.658667 27.84-11.52 42.090667 4.16 14.229333 15.850667 25.194667 32.896 30.528l13.610666 4.266667 2.133334 3.882666-3.626667 13.802667c-21.12 79.850667-52.885333 136.917333-85.717333 150.890667-47.530667 20.202667-72.938667 49.429333-78.421334 85.034666-5.034667 32.682667 9.28 67.114667 37.589334 91.541334l22.037333 8.341333 74.666667 20.010667a42.666667 42.666667 0 0 0 41.216-11.050667c15.274667-15.274667 26.88-28.032 34.837333-38.293333z m551.381333-396.565333c14.144 3.797333 29.952 19.2 32.768 32l34.56 157.781333a10.666667 10.666667 0 0 1-13.184 12.586667L240.64 433.493333a10.666667 10.666667 0 0 1-5.12-17.493333l108.8-119.36c8.832-9.685333 30.229333-15.146667 44.373333-11.349333l141.333334 37.866666a21.333333 21.333333 0 0 0 26.133333-15.082666l58.304-217.642667a21.333333 21.333333 0 0 1 26.133333-15.082667l77.056 20.650667a21.333333 21.333333 0 0 1 15.082667 26.133333l-58.325333 217.642667a21.333333 21.333333 0 0 0 15.082666 26.112l136.448 36.565333zM315.456 701.568c-33.664 45.141333-64.597333 79.082667-92.8 101.802667l-5.909333 4.778666-2.837334 0.597334-88.106666-24.106667-2.922667-3.2c-13.034667-14.165333-19.370667-31.04-16.981333-46.592 3.285333-21.333333 22.058667-39.338667 53.205333-52.586667 31.722667-13.482667 59.818667-47.104 82.922667-99.904 10.026667-22.954667 18.88-48.725333 26.389333-76.586666l3.882667-14.4 3.904-2.261334 566.165333 151.701334 2.346667 3.306666-0.789334 12.224c-1.984 30.592-30.336 229.397333-32.128 244.906667-2.346667 20.416-11.306667 34.986667-27.605333 44.394667a73.237333 73.237333 0 0 1-21.397333 8.106666l-5.013334 0.725334-60.373333-16.170667 11.242667-20.288c8.277333-14.976 22.656-43.84 43.093333-86.613333a21.12 21.12 0 0 0-9.962667-28.16l-3.136-1.493334a21.333333 21.333333 0 0 0-26.261333 6.485334c-33.642667 45.056-64.533333 78.912-92.672 101.546666l-5.909333 4.757334-2.837334 0.597333-52.544-14.08 11.114667-20.266667c3.562667-6.485333 7.04-13.013333 10.453333-19.626666 7.04-13.504 17.898667-35.797333 32.597334-66.816a21.290667 21.290667 0 0 0-9.984-28.309334l-3.029334-1.450666a21.333333 21.333333 0 0 0-26.368 6.442666c-33.6 45.013333-64.469333 78.826667-92.608 101.482667l-5.909333 4.757333-2.837333 0.597334-52.138667-13.973334 11.114667-20.266666c3.242667-5.888 6.72-12.416 10.453333-19.626667 6.997333-13.461333 17.962667-35.946667 32.896-67.434667a20.970667 20.970667 0 0 0-10.112-28.010666l-3.328-1.536a21.333333 21.333333 0 0 0-26.069333 6.613333c-33.642667 45.056-64.554667 78.976-92.778667 101.696l-5.909333 4.757333-2.837334 0.597334-32.64-8.746667 11.093334-20.245333c3.541333-6.506667 7.04-13.034667 10.453333-19.626667 6.976-13.482667 17.941333-35.968 32.874667-67.456a21.056 21.056 0 0 0-10.069334-28.074667l-3.242666-1.514666a21.333333 21.333333 0 0 0-26.154667 6.549333z" ></path></symbol><symbol id="icon-shanchu" viewBox="0 0 1024 1024"><path d="M202.666667 256h-42.666667a32 32 0 0 1 0-64h704a32 32 0 0 1 0 64H266.666667v565.333333a53.333333 53.333333 0 0 0 53.333333 53.333334h384a53.333333 53.333333 0 0 0 53.333333-53.333334V352a32 32 0 0 1 64 0v469.333333c0 64.8-52.533333 117.333333-117.333333 117.333334H320c-64.8 0-117.333333-52.533333-117.333333-117.333334V256z m224-106.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z m-32 288a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z m170.666666 0a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z" ></path></symbol><symbol id="icon-jia" viewBox="0 0 1024 1024"><path d="M580.722174 437.990403 580.722174 78.171384 436.794158 78.171384 436.794158 437.990403 76.975139 437.990403 76.975139 581.918419 436.794158 581.918419 436.794158 941.737438 580.722174 941.737438 580.722174 581.918419 940.542216 581.918419 940.542216 437.990403Z" ></path></symbol><symbol id="icon-baocun" viewBox="0 0 1024 1024"><path d="M814.805 128a51.179 51.179 0 0 1 51.179 51.179V844.01a51.179 51.179 0 0 1-51.179 51.157H201.173a51.179 51.179 0 0 1-51.178-51.157V179.179A51.179 51.179 0 0 1 201.173 128h613.654zM329.024 434.837a51.093 51.093 0 0 1-51.179-51.093V179.157h-76.672v664.854h613.76V179.179H738.22v204.48a51.179 51.179 0 0 1-51.179 51.178H329.024z m0-51.093h357.995V179.157H329.024v204.587z m357.91 204.501a25.557 25.557 0 1 1 0.085 51.072H329.024a25.536 25.536 0 1 1 0-51.072h357.91z" ></path></symbol><symbol id="icon-daochu" viewBox="0 0 1024 1024"><path d="M293.632 645.248c91.456-86.784 183.552-220.544 346.88-211.584a20.8 20.8 0 0 1 20.224 20.8v59.392a21.376 21.376 0 0 0 34.432 16.64l211.2-171.2a21.376 21.376 0 0 0 0-33.28l-210.24-192a21.952 21.952 0 0 0-35.648 16.64v60.096a20.8 20.8 0 0 1-17.856 20.8c-280.704 61.76-351.36 391.104-348.992 413.696zM192 960a138.176 138.176 0 0 1-129.984-152.512L64 832V192a116.48 116.48 0 0 1 128-128c-108.8 1.024 256 0 256 0a28.224 28.224 0 0 1 29.76 27.84A35.968 35.968 0 0 1 448 128H192a53.12 53.12 0 0 0-64 64c1.536-37.504 0 640 0 640a52.8 52.8 0 0 0 64 64c49.536-0.448 640 0 640 0a52.48 52.48 0 0 0 64-64c-0.64 105.152 0-256 0-256a36.48 36.48 0 0 1 27.264-38.4A33.216 33.216 0 0 1 960 576v256a116.48 116.48 0 0 1-128 128c-50.56-0.448-640 0-640 0z" ></path></symbol><symbol id="icon-daoru" viewBox="0 0 1024 1024"><path d="M512 384a42.666667 42.666667 0 0 1 42.666667 42.666667v341.333333h130.986666a21.333333 21.333333 0 0 1 14.250667 5.504l2.688 2.901333a21.333333 21.333333 0 0 1-4.010667 29.866667l-165.717333 126.464a32 32 0 0 1-38.912-0.042667l-164.48-126.464A21.333333 21.333333 0 0 1 342.442667 768H469.333333v-341.333333a42.666667 42.666667 0 0 1 42.666667-42.666667z m229.674667 298.368A42.666667 42.666667 0 0 1 746.666667 597.333333H853.333333V170.666667H170.666667v426.666666h106.666666a42.666667 42.666667 0 0 1 0 85.333334H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333334-85.333334h682.666666a85.333333 85.333333 0 0 1 85.333334 85.333334v426.666666a85.333333 85.333333 0 0 1-85.333334 85.333334h-106.666666z" ></path></symbol><symbol id="icon-huanyuan" viewBox="0 0 1024 1024"><path d="M909.637 478.524c-15.444-189.946-167.065-345.049-356.655-364.38-99.805-10.176-193.011 16.474-267.901 67.887l18.467-68.842c5.725-21.337-6.933-43.274-28.27-48.998s-43.274 6.934-48.998 28.271l-41.455 154.536c-5.724 21.337 6.933 43.273 28.271 48.998l154.536 41.455c21.337 5.724 43.273-6.934 48.998-28.271 5.724-21.337-6.934-43.274-28.271-48.998l-54.194-14.538c58.917-39.301 131.457-59.686 208.999-52.061 147.885 14.543 268.327 132.461 285.589 280.053 23.02 196.82-133.879 363.973-327.45 358.219-135.107-4.017-252.98-96.111-294.938-224.602-17.513-53.632-18.92-105.027-9.92-152.849 3.188-16.946-4.238-34.086-19.172-42.707l-0.049-0.028c-23.737-13.705-54.358-0.164-59.404 26.777-7.724 41.233-9.128 84.686-2.965 129.403 25.571 185.535 181.03 330.336 367.878 343.176C727.656 927.857 929.6 724.049 909.637 478.524z" ></path></symbol><symbol id="icon-menu-fold" viewBox="0 0 1024 1024"><path d="M85.312 170.688h853.376V256H85.312V170.688z m0 179.328L266.752 512l-181.44 162.048V349.952zM384 469.312h554.688v85.376H384V469.248zM85.312 768h853.376v85.312H85.312V768z" ></path></symbol><symbol id="icon-icon_image" viewBox="0 0 1024 1024"><path d="M85.333333 852.992V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666h768a42.666667 42.666667 0 0 1 42.666667 42.666666v640a42.666667 42.666667 0 0 1-42.666667 42.666667H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-0.341333z m768-157.610667V256H170.666667v493.994667l127.744-127.744a42.666667 42.666667 0 0 1 47.018666-9.045334l126.293334 54.314667 184.789333-146.346667a42.666667 42.666667 0 0 1 59.52 6.485334L853.333333 695.381333zM837.418667 810.666667l-160.853334-196.48-171.818666 136.021333a42.666667 42.666667 0 0 1-43.349334 5.76l-123.093333-52.906667L230.656 810.666667h606.762667zM341.333333 512a85.333333 85.333333 0 1 1 0-170.666667 85.333333 85.333333 0 0 1 0 170.666667z" ></path></symbol><symbol id="icon-icon_chart" viewBox="0 0 1024 1024"><path d="M128 864V128H96v768h896v-32H128z" ></path><path d="M225.6 352h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V385.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M417.6 128h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V161.6A33.6 33.6 0 0 1 417.6 128z" ></path><path d="M609.6 544h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V577.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M801.6 704h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128v-62.4a33.6 33.6 0 0 1 33.6-33.6z" ></path></symbol><symbol id="icon-jichukongjian" viewBox="0 0 1024 1024"><path d="M912 662.016l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 662.016c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.84 271.872 163.072c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.872-163.136 59.712 35.84c19.456 11.712 19.456 30.592 0 42.24z" ></path><path d="M912 501.12l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 501.12c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.904 271.872 163.136c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.936-163.2 59.712 35.904c19.392 11.712 19.392 30.656 0 42.24z" ></path><path d="M912 340.224L559.744 551.68c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 340.224c-19.456-11.584-19.456-30.592 0-42.24l352.32-211.456c9.728-5.76 22.528-8.704 35.2-8.704 12.736 0 25.472 2.88 35.2 8.704l352.32 211.456c19.456 11.648 19.456 30.656 0 42.24z" ></path></symbol><symbol id="icon-icon-relativity" viewBox="0 0 1024 1024"><path d="M352 352v-192a64 64 0 0 1 64-64h448a64 64 0 0 1 64 64v448a64 64 0 0 1-64 64h-192v192a64 64 0 0 1-64 64h-448a64 64 0 0 1-64-64v-448a64 64 0 0 1 64-64h192z m64-192v192h192a64 64 0 0 1 64 64v192h192v-448h-448z m192 512h-192a64 64 0 0 1-64-64v-192h-192v448h448v-192z m0-64v-192h-192v192h192z" ></path></symbol><symbol id="icon-root-list" viewBox="0 0 1024 1024"><path d="M85.333333 85.333333h853.333334v853.333334H85.333333V85.333333z m85.333334 85.333334v682.666666h682.666666V170.666667H170.666667z m85.333333 149.333333h512v85.333333H256v-85.333333z m0 170.666667h341.333333v85.333333H256v-85.333333z" ></path></symbol><symbol id="icon-control-platform" viewBox="0 0 1024 1024"><path d="M512 36.48l426.688 237.056v476.928L512 987.456l-426.688-236.992V273.536L512 36.544zM170.688 379.52v320.704l298.624 165.952V537.6l-298.624-158.08z m384 486.656l298.624-165.952v-320.64L554.688 537.6v328.512zM512 463.744l303.744-160.832L512 134.144 208.256 302.912 512 463.744z" ></path></symbol><symbol id="icon-icon-yonghu" viewBox="0 0 1024 1024"><path d="M511.744 96a253.184 253.184 0 0 1 252.8 252.928c0 91.904-49.216 172.544-122.688 216.832 146.24 50.24 253.632 181.824 253.632 331.584a32 32 0 0 1-64 0c0-156.864-146.432-289.408-319.744-289.408C338.432 607.936 192 740.48 192 897.344a32 32 0 0 1-64 0c0-149.76 107.328-281.28 253.568-331.648a252.992 252.992 0 0 1-122.752-216.768A253.184 253.184 0 0 1 511.744 96z m0 64a189.12 189.12 0 0 0-188.928 188.928 189.12 189.12 0 0 0 188.928 188.928 189.12 189.12 0 0 0 188.8-188.928A189.12 189.12 0 0 0 511.808 160z" ></path></symbol><symbol id="icon-a-shezhi" viewBox="0 0 1024 1024"><path d="M933.868272 511.691752a140.807706 140.807706 0 0 1 90.131728-131.067068 525.562914 525.562914 0 0 0-57.334136-138.64997 139.882962 139.882962 0 0 1-184.948826-184.948826A525.562914 525.562914 0 0 0 643.067068 0a140.376159 140.376159 0 0 1-262.134136 0A525.562914 525.562914 0 0 0 242.282962 57.334136a139.882962 139.882962 0 0 1-184.948826 184.948826A506.698134 506.698134 0 0 0 0 380.932932a140.376159 140.376159 0 0 1 0 262.134136 525.562914 525.562914 0 0 0 57.334136 138.64997 139.882962 139.882962 0 0 1 184.948826 184.948826 525.562914 525.562914 0 0 0 138.64997 57.334136 140.376159 140.376159 0 0 1 262.134136 0 525.562914 525.562914 0 0 0 138.64997-57.334136 139.882962 139.882962 0 0 1 184.948826-184.948826 506.698134 506.698134 0 0 0 57.334136-138.64997A140.807706 140.807706 0 0 1 933.868272 511.691752zM511.691752 652.437809A140.437809 140.437809 0 1 1 652.437809 511.691752 140.499458 140.499458 0 0 1 511.691752 652.437809z" ></path></symbol></svg>',(i=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var n,s,o,r,a,l=function(u,g){g.parentNode.insertBefore(u,g)};if(t&&!i.__iconfont__svg__cssinject__){i.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,g=document.createElement("div");g.innerHTML=i._iconfont_svg_string_5087053,(g=g.getElementsByTagName("svg")[0])&&(g.setAttribute("aria-hidden","true"),g.style.position="absolute",g.style.width=0,g.style.height=0,g.style.overflow="hidden",g=g,(u=document.body).firstChild?l(g,u.firstChild):u.appendChild(g))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(s=function(){document.removeEventListener("DOMContentLoaded",s,!1),n()},document.addEventListener("DOMContentLoaded",s,!1)):document.attachEvent&&(o=n,r=i.document,a=!1,h(),r.onreadystatechange=function(){r.readyState=="complete"&&(r.onreadystatechange=null,c())})}function c(){a||(a=!0,o())}function h(){try{r.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const cE=[Kr],Ks=i=>{!i||Ks.installed||(i.use(St),cE.forEach(t=>{const e=t.name||t.__name;e&&i.component(e,t)}),Ks.installed=!0)},hE={install:Ks,EmsEditor:Kr,EmsPreview:Dd};ht.EmsEditor=Kr,ht.EmsPreview=Dd,ht.default=hE,ht.install=Ks,Object.defineProperties(ht,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|